15 lines
248 B
C
15 lines
248 B
C
|
#define _GNU_SOURCE
|
||
|
#include <unistd.h>
|
||
|
#include <signal.h>
|
||
|
#include "syscall.h"
|
||
|
|
||
|
pid_t vfork(void)
|
||
|
{
|
||
|
/* vfork syscall cannot be made from C code */
|
||
|
#ifdef SYS_fork
|
||
|
return syscall(SYS_fork);
|
||
|
#else
|
||
|
return syscall(SYS_clone, SIGCHLD, 0);
|
||
|
#endif
|
||
|
}
|