source: trunk/third/perl/cygwin/cygwin.c @ 14545

Revision 14545, 506 bytes checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r14544, which included commits to RCS files with non-trunk default branches.
Line 
1/*
2 * Cygwin extras
3 */
4
5#include "EXTERN.h"
6#include "perl.h"
7#undef USE_DYNAMIC_LOADING
8#include "XSUB.h"
9
10#include <unistd.h>
11
12
13/* see also Cwd.pm */
14static
15XS(Cygwin_cwd)
16{
17    dXSARGS;
18    char *cwd;
19
20    if(items != 0)
21        Perl_croak(aTHX_ "Usage: Cwd::cwd()");
22    if(cwd = getcwd(NULL, 0)) {
23        ST(0) = sv_2mortal(newSVpv(cwd, 0));
24        safesysfree(cwd);
25        XSRETURN(1);
26    }
27    XSRETURN_UNDEF;
28}
29
30void
31init_os_extras(void)
32{
33    char *file = __FILE__;
34    dTHX;
35
36    newXS("Cwd::cwd", Cygwin_cwd, file);
37}
Note: See TracBrowser for help on using the repository browser.