1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:27:35 +00:00

Kernel+LibC: Support passing O_CLOEXEC to pipe()

In the userspace, this mimics the Linux pipe2() syscall;
in the kernel, the Process::sys$pipe() now always accepts
a flags argument, the no-argument pipe() syscall is now a
userspace wrapper over pipe2().
This commit is contained in:
Sergey Bugaev 2019-08-05 15:29:05 +03:00 committed by Andreas Kling
parent 55d7810fab
commit 9c3b1ca0c6
5 changed files with 17 additions and 6 deletions

View file

@ -366,7 +366,12 @@ int getgroups(int size, gid_t list[])
int pipe(int pipefd[2])
{
int rc = syscall(SC_pipe, pipefd);
return pipe2(pipefd, 0);
}
int pipe2(int pipefd[2], int flags)
{
int rc = syscall(SC_pipe, pipefd, flags);
__RETURN_WITH_ERRNO(rc, rc, -1);
}