mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:47:34 +00:00
LibCore: Add syscall wrapper for fork()
This commit is contained in:
parent
01c2756e9a
commit
2637a64130
2 changed files with 9 additions and 0 deletions
|
@ -480,4 +480,12 @@ ErrorOr<void> mkdir(StringView path, mode_t mode)
|
||||||
#endif
|
#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<bool> isatty(int fd);
|
||||||
ErrorOr<void> symlink(StringView target, StringView link_path);
|
ErrorOr<void> symlink(StringView target, StringView link_path);
|
||||||
ErrorOr<void> mkdir(StringView path, mode_t);
|
ErrorOr<void> mkdir(StringView path, mode_t);
|
||||||
|
ErrorOr<pid_t> fork();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue