mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:47:44 +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());
|
||||
|
|
|
@ -141,6 +141,7 @@ ErrorOr<void> setgid(gid_t);
|
|||
ErrorOr<void> setegid(gid_t);
|
||||
ErrorOr<void> setpgid(pid_t pid, pid_t pgid);
|
||||
ErrorOr<pid_t> setsid();
|
||||
ErrorOr<pid_t> getsid(pid_t pid = 0);
|
||||
ErrorOr<void> drop_privileges();
|
||||
ErrorOr<bool> isatty(int fd);
|
||||
ErrorOr<void> link(StringView old_path, StringView new_path);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue