summaryrefslogtreecommitdiff
path: root/cygwin
diff options
context:
space:
mode:
authorFifer, Eric <EFifer@sanwaint.com>2000-02-24 17:15:28 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-02-24 18:00:49 +0000
commit5db16f6aca34f97afbc0dca7253849c56c0c381d (patch)
treec838fb0afb1b0643ce3428b18235ee402e9891f3 /cygwin
parent86d026b8c4144498131a8760a0ef71417fc4151d (diff)
downloadperl-5db16f6aca34f97afbc0dca7253849c56c0c381d.tar.gz
cygwin port
To: "'perl5-porters@perl.org'" <perl5-porters@perl.org> Message-ID: <779F20BCCE5AD31186A50008C75D99791716E1@SILLDN_MAIL1> p4raw-id: //depot/cfgperl@5241
Diffstat (limited to 'cygwin')
-rw-r--r--cygwin/Makefile.SHs3
-rw-r--r--cygwin/cygwin.c37
2 files changed, 40 insertions, 0 deletions
diff --git a/cygwin/Makefile.SHs b/cygwin/Makefile.SHs
index 8d777788ba..d67f55f763 100644
--- a/cygwin/Makefile.SHs
+++ b/cygwin/Makefile.SHs
@@ -25,6 +25,9 @@ esac
addtopath=`pwd`
$spitshell >>Makefile <<!GROK!THIS!
+cygwin.c: cygwin/cygwin.c
+ ln -s cygwin/cygwin.c
+
# shell script feeding perlld to decent perl
ld2: $& Makefile perlld ${src}/cygwin/ld2.in
@echo "extracting ld2 (with variable substitutions)"
diff --git a/cygwin/cygwin.c b/cygwin/cygwin.c
new file mode 100644
index 0000000000..fc7767ffdc
--- /dev/null
+++ b/cygwin/cygwin.c
@@ -0,0 +1,37 @@
+/*
+ * Cygwin extras
+ */
+
+#include "EXTERN.h"
+#include "perl.h"
+#undef USE_DYNAMIC_LOADING
+#include "XSUB.h"
+
+#include <sys/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);
+}