1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 08:27:46 +00:00

Kernel+LibC: Implement setregid(2)

This copies and adapts the setresgid syscall, following in the footsteps
of setreuid and setresuid.
This commit is contained in:
sin-ack 2022-10-01 12:47:38 +00:00 committed by Andrew Kaster
parent 2a502fe232
commit 70337f3a4b
5 changed files with 43 additions and 0 deletions

View file

@ -790,6 +790,12 @@ int setresuid(uid_t ruid, uid_t euid, uid_t suid)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int setregid(gid_t rgid, gid_t egid)
{
int rc = syscall(SC_setresgid, rgid, egid);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int setresgid(gid_t rgid, gid_t egid, gid_t sgid)
{
int rc = syscall(SC_setresgid, rgid, egid, sgid);

View file

@ -71,6 +71,7 @@ int setuid(uid_t);
int setgid(gid_t);
int setreuid(uid_t, uid_t);
int setresuid(uid_t, uid_t, uid_t);
int setregid(gid_t, gid_t);
int setresgid(gid_t, gid_t, gid_t);
pid_t tcgetpgrp(int fd);
int tcsetpgrp(int fd, pid_t pgid);