2013-12-12 05:09:18 +00:00
|
|
|
#define _GNU_SOURCE
|
2011-02-12 00:22:29 -05:00
|
|
|
#include <unistd.h>
|
2014-05-30 01:51:23 -04:00
|
|
|
#include <signal.h>
|
2011-02-12 00:22:29 -05:00
|
|
|
#include "syscall.h"
|
2011-10-14 23:34:12 -04:00
|
|
|
#include "libc.h"
|
2011-02-12 00:22:29 -05:00
|
|
|
|
2011-10-14 23:34:12 -04:00
|
|
|
pid_t __vfork(void)
|
2011-02-12 00:22:29 -05:00
|
|
|
{
|
|
|
|
/* vfork syscall cannot be made from C code */
|
2014-05-30 01:51:23 -04:00
|
|
|
#ifdef SYS_fork
|
2011-03-20 00:16:43 -04:00
|
|
|
return syscall(SYS_fork);
|
2014-05-30 01:51:23 -04:00
|
|
|
#else
|
|
|
|
return syscall(SYS_clone, SIGCHLD, 0);
|
|
|
|
#endif
|
2011-02-12 00:22:29 -05:00
|
|
|
}
|
2011-10-14 23:34:12 -04:00
|
|
|
|
|
|
|
weak_alias(__vfork, vfork);
|