diff options
author | 2000-04-06 16:08:14 +0000 | |
---|---|---|
committer | 2000-04-06 16:08:14 +0000 | |
commit | c8ca900353947dc5d441eb0530d040a27377e87a (patch) | |
tree | 4d285b4c6eba04f0b54447330833c17180716716 /gnu/usr.bin/perl/cygwin/cygwin.c | |
parent | Fix typo introduce when removing smtpd MLINK (diff) | |
download | wireguard-openbsd-c8ca900353947dc5d441eb0530d040a27377e87a.tar.xz wireguard-openbsd-c8ca900353947dc5d441eb0530d040a27377e87a.zip |
virgin perl 5.6.0
Diffstat (limited to 'gnu/usr.bin/perl/cygwin/cygwin.c')
-rw-r--r-- | gnu/usr.bin/perl/cygwin/cygwin.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gnu/usr.bin/perl/cygwin/cygwin.c b/gnu/usr.bin/perl/cygwin/cygwin.c new file mode 100644 index 00000000000..bece81b1e4a --- /dev/null +++ b/gnu/usr.bin/perl/cygwin/cygwin.c @@ -0,0 +1,37 @@ +/* + * Cygwin extras + */ + +#include "EXTERN.h" +#include "perl.h" +#undef USE_DYNAMIC_LOADING +#include "XSUB.h" + +#include <unistd.h> + + +/* see also Cwd.pm */ +static +XS(Cygwin_cwd) +{ + dXSARGS; + char *cwd; + + if(items != 0) + Perl_croak(aTHX_ "Usage: Cwd::cwd()"); + if(cwd = getcwd(NULL, 0)) { + ST(0) = sv_2mortal(newSVpv(cwd, 0)); + safesysfree(cwd); + XSRETURN(1); + } + XSRETURN_UNDEF; +} + +void +init_os_extras(void) +{ + char *file = __FILE__; + dTHX; + + newXS("Cwd::cwd", Cygwin_cwd, file); +} |