diff options
Diffstat (limited to 'usr/klibc/fork.c')
-rw-r--r-- | usr/klibc/fork.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/usr/klibc/fork.c b/usr/klibc/fork.c new file mode 100644 index 0000000..b07486e --- /dev/null +++ b/usr/klibc/fork.c @@ -0,0 +1,21 @@ +/* + * fork.c + * + * This is normally just a syscall stub, but at least one system + * doesn't have sys_fork, only sys_clone... + */ + +#include <sys/syscall.h> +#include <signal.h> +#include <unistd.h> +#include <sched.h> +#include <klibc/sysconfig.h> + +#if !_KLIBC_NO_MMU && !defined(__NR_fork) + +pid_t fork(void) +{ + return __clone(SIGCHLD, 0); +} + +#endif /* __NR_fork */ |