diff --git a/src/kernel/libroot/posix/unistd/fork.c b/src/kernel/libroot/posix/unistd/fork.c index 33e8aca451..dc084fb6eb 100644 --- a/src/kernel/libroot/posix/unistd/fork.c +++ b/src/kernel/libroot/posix/unistd/fork.c @@ -7,16 +7,21 @@ #include #include -#include #include pid_t fork(void) { - // ToDo: implement me - // ToDo: atfork() - fprintf(stderr, "fork(): NOT IMPLEMENTED\n"); - return -1; + thread_id thread = _kern_fork(); + if (thread < 0) { + errno = thread; + return -1; + } + + // ToDo: initialize child + // ToDo: atfork() support + + return thread; }