diff options
Diffstat (limited to 'Userland/Libraries/LibCore/System.cpp')
-rw-r--r-- | Userland/Libraries/LibCore/System.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp index 8e241749cc..b0198294fe 100644 --- a/Userland/Libraries/LibCore/System.cpp +++ b/Userland/Libraries/LibCore/System.cpp @@ -196,6 +196,14 @@ ErrorOr<void> kill(pid_t pid, int signal) return {}; } +ErrorOr<int> dup(int source_fd) +{ + int fd = ::dup(source_fd); + if (fd < 0) + return Error::from_syscall("dup"sv, -errno); + return fd; +} + ErrorOr<int> dup2(int source_fd, int destination_fd) { int fd = ::dup2(source_fd, destination_fd); |