| 1 |
#define _GNU_SOURCE |
| 2 |
#include <unistd.h> |
| 3 |
#include <signal.h> |
| 4 |
#include "syscall.h" |
| 5 |
|
| 6 |
pid_t vfork(void) |
| 7 |
{ |
| 8 |
/* vfork syscall cannot be made from C code */ |
| 9 |
#ifdef SYS_fork |
| 10 |
return syscall(SYS_fork); |
| 11 |
#else |
| 12 |
return syscall(SYS_clone, SIGCHLD, 0); |
| 13 |
#endif |
| 14 |
} |