diff options
author | Lucas CHOLLET <lucas.chollet@free.fr> | 2022-01-03 01:58:58 +0100 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2022-01-09 03:22:10 +0330 |
commit | 3fa5be655de5fcd18e4b0f7634cc943c76841bef (patch) | |
tree | a55a2f09c2490450e98fcd74a007de120d5a9bf1 /Userland/Libraries/LibCore/System.cpp | |
parent | 9aa0cf326510372e766f3c79deb676dce56995f4 (diff) | |
download | serenity-3fa5be655de5fcd18e4b0f7634cc943c76841bef.zip |
LibCore: Add a wrapper for setsid()
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 46d21b2b13..7a9df33728 100644 --- a/Userland/Libraries/LibCore/System.cpp +++ b/Userland/Libraries/LibCore/System.cpp @@ -551,6 +551,14 @@ ErrorOr<void> setpgid(pid_t pid, pid_t pgid) return {}; } +ErrorOr<pid_t> setsid() +{ + int rc = ::setsid(); + if (rc < 0) + return Error::from_syscall("setsid"sv, -errno); + return rc; +} + ErrorOr<bool> isatty(int fd) { int rc = ::isatty(fd); |