summaryrefslogtreecommitdiff
path: root/djgpp
diff options
context:
space:
mode:
Diffstat (limited to 'djgpp')
-rw-r--r--djgpp/djgpp.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/djgpp/djgpp.c b/djgpp/djgpp.c
index 4c53eb09c8..6aa290ec53 100644
--- a/djgpp/djgpp.c
+++ b/djgpp/djgpp.c
@@ -366,6 +366,24 @@ XS(dos_UseLFN)
XSRETURN_IV (_USE_LFN);
}
+XS(XS_Cwd_sys_cwd)
+{
+ dXSARGS;
+ if (items != 0)
+ Perl_croak_nocontext("Usage: Cwd::sys_cwd()");
+ {
+ char p[MAXPATHLEN];
+ char * RETVAL;
+ RETVAL = getcwd(p, MAXPATHLEN);
+ ST(0) = sv_newmortal();
+ sv_setpv((SV*)ST(0), RETVAL);
+#ifndef INCOMPLETE_TAINTS
+ SvTAINTED_on(ST(0));
+#endif
+ }
+ XSRETURN(1);
+}
+
void
Perl_init_os_extras(pTHX)
{
@@ -375,6 +393,7 @@ Perl_init_os_extras(pTHX)
newXS ("Dos::GetCwd",dos_GetCwd,file);
newXS ("Dos::UseLFN",dos_UseLFN,file);
+ newXS ("Cwd::sys_cwd",XS_Cwd_sys_cwd,file);
/* install my File System Extension for globbing */
__FSEXT_add_open_handler (glob_handler);