plan9port/src/lib9/fork.c

23 lines
311 B
C
Raw Normal View History

2004-04-21 04:50:23 +00:00
#include <u.h>
2004-09-21 01:11:28 +00:00
#include <signal.h>
2004-04-21 04:50:23 +00:00
#include <libc.h>
#include "9proc.h"
#undef fork
int
p9fork(void)
{
int pid;
2004-09-21 01:11:28 +00:00
sigset_t all, old;
2004-04-21 04:50:23 +00:00
2004-09-21 01:11:28 +00:00
sigfillset(&all);
sigprocmask(SIG_SETMASK, &all, &old);
2004-04-21 04:50:23 +00:00
pid = fork();
2004-09-21 01:11:28 +00:00
if(pid == 0){
_clearuproc();
_p9uproc(0);
}
sigprocmask(SIG_SETMASK, &old, nil);
2004-04-21 04:50:23 +00:00
return pid;
}