mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +00:00
add RFENVG, RFCENVG
This commit is contained in:
parent
00d75e0eae
commit
e4d832222b
1 changed files with 7 additions and 3 deletions
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue