.5K of code.
p4raw-id: //depot/perl@25850
Apd |void |pack_cat |NN SV *cat|NN const char *pat|NN const char *patend \
|NN SV **beglist|NN SV **endlist|NN SV ***next_in_list|U32 flags
Apd |void |packlist |NN SV *cat|NN const char *pat|NN const char *patend|NN SV **beglist|NN SV **endlist
+#ifdef PERL_USES_PL_PIDSTATUS
p |void |pidgone |Pid_t pid|int status
+#endif
Ap |void |pmflag |NN U32* pmfl|int ch
p |OP* |pmruntime |NN OP* pm|NN OP* expr|bool isreg
p |OP* |pmtrans |NN OP* o|NN OP* expr|NN OP* repl
PERLVARI(Ievalseq, U32, 0) /* eval sequence number */
PERLVAR(Iorigenviron, char **)
PERLVAR(Iorigalen, U32)
+#ifdef PERL_USES_PL_PIDSTATUS
PERLVAR(Ipidstatus, HV *) /* pid-to-status mappings for waitpid */
+#endif
PERLVARI(Imaxo, int, MAXO) /* maximum number of ops */
PERLVAR(Iosname, char *) /* operating system */
Perl_my_sprintf
)];
}
+unless ($define{'PERL_USES_PL_PIDSTATUS'}) {
+ skip_symbols [qw(
+ Perl_pidgone
+ PL_pidstatus
+ )];
+}
unless ($define{'d_mmap'}) {
skip_symbols [qw(
}
PL_sighandlerp = (Sighandler_t) Perl_sighandler;
+#ifdef PERL_USES_PL_PIDSTATUS
PL_pidstatus = newHV();
+#endif
}
PL_rs = newSVpvn("\n", 1);
PL_subname = Nullsv;
SvREFCNT_dec(PL_linestr);
PL_linestr = Nullsv;
+#ifdef PERL_USES_PL_PIDSTATUS
SvREFCNT_dec(PL_pidstatus);
PL_pidstatus = Nullhv;
+#endif
SvREFCNT_dec(PL_toptarget);
PL_toptarget = Nullsv;
SvREFCNT_dec(PL_bodytarget);
# ifdef PERL_USE_SAFE_PUTENV
" PERL_USE_SAFE_PUTENV"
# endif
+#ifdef PERL_USES_PL_PIDSTATUS
+ " PERL_USES_PL_PIDSTATUS"
+#endif
# ifdef PL_OP_SLAB_ALLOC
" PL_OP_SLAB_ALLOC"
# endif
#define PERL_DONT_CREATE_GVSV
#endif
+#if !defined(HAS_WAITPID) && !defined(HAS_WAIT4) || defined(HAS_WAITPID_RUNTIME)
+#define PERL_USES_PL_PIDSTATUS
+#endif
+
/* Cannot include embed.h here on Win32 as win32.h has not
yet been included and defines some config variables e.g. HAVE_INTERP_INTERN
*/
#ifdef THREADS_HAVE_PIDS
PL_ppid = (IV)getppid();
#endif
+#ifdef PERL_USES_PL_PIDSTATUS
hv_clear(PL_pidstatus); /* no kids, so don't wait for 'em */
+#endif
}
PUSHi(childpid);
RETURN;
PL_evalseq = proto_perl->Ievalseq;
PL_origenviron = proto_perl->Iorigenviron; /* XXX not quite right */
PL_origalen = proto_perl->Iorigalen;
+#ifdef PERL_USES_PL_PIDSTATUS
PL_pidstatus = newHV(); /* XXX flag for cloning? */
+#endif
PL_osname = SAVEPV(proto_perl->Iosname);
PL_sighandlerp = proto_perl->Isighandlerp;
PL_ppid = (IV)getppid();
#endif
PL_forkprocess = 0;
+#ifdef PERL_USES_PL_PIDSTATUS
hv_clear(PL_pidstatus); /* we have no children */
+#endif
return Nullfp;
#undef THIS
#undef THAT
I32 result = 0;
if (!pid)
return -1;
-#if !defined(HAS_WAITPID) && !defined(HAS_WAIT4) || defined(HAS_WAITPID_RUNTIME)
+#ifdef PERL_USES_PL_PIDSTATUS
{
char spid[TYPE_CHARS(IV)];
result = wait4((pid==-1)?0:pid,statusp,flags,Null(struct rusage *));
goto finish;
#endif
-#if !defined(HAS_WAITPID) && !defined(HAS_WAIT4) || defined(HAS_WAITPID_RUNTIME)
+#ifdef PERL_USES_PL_PIDSTATUS
#if defined(HAS_WAITPID) && defined(HAS_WAITPID_RUNTIME)
hard_way:
#endif
}
#endif /* !DOSISH || OS2 || WIN32 || NETWARE */
+#ifdef PERL_USES_PL_PIDSTATUS
void
Perl_pidgone(pTHX_ Pid_t pid, int status)
{
SvIV_set(sv, status);
return;
}
+#endif
#if defined(atarist) || defined(OS2) || defined(EPOC)
int pclose();