diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp index a3d4c1bf3d..ab7be608f4 100644 --- a/Userland/Libraries/LibCore/System.cpp +++ b/Userland/Libraries/LibCore/System.cpp @@ -40,6 +40,14 @@ ErrorOr unveil(StringView path, StringView permissions) int rc = syscall(SC_unveil, ¶ms); HANDLE_SYSCALL_RETURN_VALUE("unveil"sv, rc, {}); } + +ErrorOr> pipe2(int flags) +{ + Array fds; + if (::pipe2(fds.data(), flags) < 0) + return Error::from_syscall("pipe2"sv, -errno); + return fds; +} #endif ErrorOr sigaction(int signal, struct sigaction const* action, struct sigaction* old_action) diff --git a/Userland/Libraries/LibCore/System.h b/Userland/Libraries/LibCore/System.h index 140da81ebb..70300ceffa 100644 --- a/Userland/Libraries/LibCore/System.h +++ b/Userland/Libraries/LibCore/System.h @@ -15,6 +15,7 @@ namespace Core::System { #ifdef __serenity__ ErrorOr pledge(StringView promises, StringView execpromises); ErrorOr unveil(StringView path, StringView permissions); +ErrorOr> pipe2(int flags); #endif ErrorOr sigaction(int signal, struct sigaction const* action, struct sigaction* old_action);