mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 11:07:45 +00:00
LibCore: Add syscall wrapper for dup2()
This commit is contained in:
parent
71bc9bee0a
commit
a152b1f215
2 changed files with 9 additions and 0 deletions
|
@ -179,4 +179,12 @@ ErrorOr<void> kill(pid_t pid, int signal)
|
|||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<int> dup2(int source_fd, int destination_fd)
|
||||
{
|
||||
int fd = ::dup2(source_fd, destination_fd);
|
||||
if (fd < 0)
|
||||
return Error::from_syscall("dup2"sv, -errno);
|
||||
return fd;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue