mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
LibCore: Add syscall wrapper for fork()
This commit is contained in:
parent
01c2756e9a
commit
2637a64130
Notes:
sideshowbarker
2024-07-17 22:41:35 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/2637a641301
2 changed files with 9 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -64,5 +64,6 @@ ErrorOr<void> setegid(gid_t);
|
|||
ErrorOr<bool> isatty(int fd);
|
||||
ErrorOr<void> symlink(StringView target, StringView link_path);
|
||||
ErrorOr<void> mkdir(StringView path, mode_t);
|
||||
ErrorOr<pid_t> fork();
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue