1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:17:44 +00:00

LibCore: Add syscall wrapper for pipe2()

This commit is contained in:
Andreas Kling 2021-11-24 22:36:13 +01:00
parent bc2ee02ce0
commit 71bc9bee0a
2 changed files with 9 additions and 0 deletions

View file

@ -40,6 +40,14 @@ ErrorOr<void> unveil(StringView path, StringView permissions)
int rc = syscall(SC_unveil, &params);
HANDLE_SYSCALL_RETURN_VALUE("unveil"sv, rc, {});
}
ErrorOr<Array<int, 2>> pipe2(int flags)
{
Array<int, 2> fds;
if (::pipe2(fds.data(), flags) < 0)
return Error::from_syscall("pipe2"sv, -errno);
return fds;
}
#endif
ErrorOr<void> sigaction(int signal, struct sigaction const* action, struct sigaction* old_action)