From e4d832222ba5519db94c7512c1fb82bd32491120 Mon Sep 17 00:00:00 2001 From: rsc Date: Sat, 11 Feb 2006 22:58:29 +0000 Subject: add RFENVG, RFCENVG --- src/lib9/rfork.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/lib9') diff --git a/src/lib9/rfork.c b/src/lib9/rfork.c index ea4e088f..69c7d546 100644 --- a/src/lib9/rfork.c +++ b/src/lib9/rfork.c @@ -15,13 +15,14 @@ p9rfork(int flags) { int pid, status; int p[2]; - int n; + int i, n; char buf[128], *q; + extern char **environ; if((flags&(RFPROC|RFFDG|RFMEM)) == (RFPROC|RFFDG)){ /* check other flags before we commit */ - flags &= ~(RFPROC|RFFDG); - n = (flags & ~(RFNOTEG|RFNAMEG|RFNOWAIT)); + flags &= ~(RFPROC|RFFDG|RFENVG); + n = (flags & ~(RFNOTEG|RFNAMEG|RFNOWAIT|RFCENVG)); if(n){ werrstr("unknown flags %08ux in rfork", n); return -1; @@ -99,6 +100,9 @@ p9rfork(int flags) } if(pid != 0) return pid; + if(flags&RFCENVG) + if(environ) + *environ = nil; } if(flags&RFPROC){ werrstr("cannot use rfork for shared memory -- use libthread"); -- cgit v1.2.3