chiark / gitweb /
[PATCH] klibc specific tweaks
[elogind.git] / klibc / klibc / fork.c
1 /*
2  * fork.c
3  *
4  * This is normally just a syscall stub, but at least one system
5  * doesn't have sys_fork, only sys_clone...
6  */
7
8 #include <sys/syscall.h>
9 #include <signal.h>
10 #include <unistd.h>
11
12 #ifdef __NR_fork
13
14 #ifdef _syscall0_forkish
15 _syscall0_forkish(pid_t,fork);
16 #else
17 _syscall0(pid_t,fork);
18 #endif
19
20 #else /* __NR_fork */
21
22 static inline _syscall2(pid_t,clone,unsigned long,flags,void *,newsp);
23
24 pid_t fork(void)
25 {
26   return clone(SIGCHLD, 0);
27 }
28
29 #endif /* __NR_fork */