diff options
author | rsc <devnull@localhost> | 2006-02-11 22:58:29 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2006-02-11 22:58:29 +0000 |
commit | e4d832222ba5519db94c7512c1fb82bd32491120 (patch) | |
tree | 23f3c34f462919364ce0694b3004506afa811dea /src/lib9 | |
parent | 00d75e0eaefc3d52a6bb631e4747da2b88e7c393 (diff) | |
download | plan9port-e4d832222ba5519db94c7512c1fb82bd32491120.tar.gz plan9port-e4d832222ba5519db94c7512c1fb82bd32491120.tar.bz2 plan9port-e4d832222ba5519db94c7512c1fb82bd32491120.zip |
add RFENVG, RFCENVG
Diffstat (limited to 'src/lib9')
-rw-r--r-- | src/lib9/rfork.c | 10 |
1 files changed, 7 insertions, 3 deletions
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"); |