mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +00:00
LibCore: Add Core::System wrapper for getsid()
This commit is contained in:
parent
9c32b9ea3c
commit
71728f3ea6
2 changed files with 9 additions and 0 deletions
|
@ -747,6 +747,14 @@ ErrorOr<pid_t> setsid()
|
|||
return rc;
|
||||
}
|
||||
|
||||
ErrorOr<pid_t> getsid(pid_t pid)
|
||||
{
|
||||
int rc = ::getsid(pid);
|
||||
if (rc < 0)
|
||||
return Error::from_syscall("getsid"sv, -errno);
|
||||
return rc;
|
||||
}
|
||||
|
||||
ErrorOr<void> drop_privileges()
|
||||
{
|
||||
auto gid_result = setgid(getgid());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue