LibCore: Add a wrapper for setsid()

This commit is contained in:
Lucas CHOLLET 2022-01-03 01:58:58 +01:00 committed by Ali Mohammad Pur
commit 3fa5be655d
Notes: sideshowbarker 2024-07-17 21:22:58 +09:00
2 changed files with 9 additions and 0 deletions

View file

@ -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);