summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-08-06 23:56:46 +0200
committerhv <hv@crypt.org>2002-08-29 11:44:00 +0000
commit4d76a3443f3312704ec3416fd425698e92a208cd (patch)
tree769fa92e2e9f3a46a171807a82b7d5fd7c623c0a /pp_sys.c
parent85cf7f2e6c0eee352cdc28bfa7e316574993c2ba (diff)
downloadperl-4d76a3443f3312704ec3416fd425698e92a208cd.tar.gz
posixify getppid on linux-multithread
Message-Id: <20020806215646.3f6852bb.rgarciasuarez@free.fr> p4raw-id: //depot/perl@17798
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 7a44b6bb2e..54699c8841 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3960,6 +3960,9 @@ PP(pp_fork)
sv_setiv(GvSV(tmpgv), (IV)PerlProc_getpid());
SvREADONLY_on(GvSV(tmpgv));
}
+#ifdef THREADS_HAVE_PIDS
+ PL_ppid = (IV)getppid();
+#endif
hv_clear(PL_pidstatus); /* no kids, so don't wait for 'em */
}
PUSHi(childpid);
@@ -4239,7 +4242,11 @@ PP(pp_getppid)
{
#ifdef HAS_GETPPID
dSP; dTARGET;
+# ifdef THREADS_HAVE_PIDS
+ XPUSHi( PL_ppid );
+# else
XPUSHi( getppid() );
+# endif
RETURN;
#else
DIE(aTHX_ PL_no_func, "getppid");