This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fork() failure to create pseudo process sets errno=EAGAIN and returns
[perl5.git] / cygwin / cygwin.c
CommitLineData
5db16f6a
FE
1/*
2 * Cygwin extras
3 */
4
5#include "EXTERN.h"
6#include "perl.h"
7#undef USE_DYNAMIC_LOADING
8#include "XSUB.h"
9
6b49d266 10#include <unistd.h>
5db16f6a
FE
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}