1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:37:46 +00:00

LibCore: Add syscall wrapper for fork()

This commit is contained in:
Andreas Kling 2021-12-16 20:28:54 +01:00
parent 01c2756e9a
commit 2637a64130
2 changed files with 9 additions and 0 deletions

View file

@ -480,4 +480,12 @@ ErrorOr<void> mkdir(StringView path, mode_t mode)
#endif
}
ErrorOr<pid_t> fork()
{
pid_t pid = ::fork();
if (pid < 0)
return Error::from_syscall("fork"sv, -errno);
return pid;
}
}