musl/src/process/vfork.c

18 lines
297 B
C
Raw Normal View History

#define _GNU_SOURCE
2011-02-12 00:22:29 -05:00
#include <unistd.h>
#include <signal.h>
2011-02-12 00:22:29 -05:00
#include "syscall.h"
#include "libc.h"
2011-02-12 00:22:29 -05:00
pid_t __vfork(void)
2011-02-12 00:22:29 -05:00
{
/* vfork syscall cannot be made from C code */
#ifdef SYS_fork
return syscall(SYS_fork);
#else
return syscall(SYS_clone, SIGCHLD, 0);
#endif
2011-02-12 00:22:29 -05:00
}
weak_alias(__vfork, vfork);