ref: 03417fd3346d32dc8b4213d1a9cb3ec09b2d8a80
dir: /sys/src/ape/lib/ap/plan9/fork.c/
#include "lib.h"
#include <errno.h>
#include <unistd.h>
#include "sys9.h"
pid_t
fork(void)
{
int n;
n = _RFORK(RFENVG|RFFDG|RFPROC);
if(n < 0)
_syserrno();
if(n == 0) {
_detachbuf();
_sessleader = 0;
}
return n;
}