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 setpgid(pid_t pid, pid_t pgid) return {}; } +ErrorOr setsid() +{ + int rc = ::setsid(); + if (rc < 0) + return Error::from_syscall("setsid"sv, -errno); + return rc; +} + ErrorOr isatty(int fd) { int rc = ::isatty(fd); diff --git a/Userland/Libraries/LibCore/System.h b/Userland/Libraries/LibCore/System.h index 97e60ad6b7..8a3a414860 100644 --- a/Userland/Libraries/LibCore/System.h +++ b/Userland/Libraries/LibCore/System.h @@ -90,6 +90,7 @@ ErrorOr seteuid(uid_t); ErrorOr setgid(gid_t); ErrorOr setegid(gid_t); ErrorOr setpgid(pid_t pid, pid_t pgid); +ErrorOr setsid(); ErrorOr isatty(int fd); ErrorOr symlink(StringView target, StringView link_path); ErrorOr mkdir(StringView path, mode_t);