Add getgroups/setgroups (stub on redox)

This commit is contained in:
Jeremy Soller
2023-09-13 11:16:59 -06:00
parent 13f22d72c6
commit afdc26f9cc
4 changed files with 34 additions and 3 deletions
+8
View File
@@ -277,6 +277,10 @@ impl Pal for Sys {
e(unsafe { syscall!(GETGID) }) as gid_t
}
unsafe fn getgroups(size: c_int, list: *mut gid_t) -> c_int {
e(unsafe { syscall!(GETGROUPS, size, list) })
}
fn getpagesize() -> usize {
4096
}
@@ -508,6 +512,10 @@ impl Pal for Sys {
e(unsafe { syscall!(SCHED_YIELD) }) as c_int
}
unsafe fn setgroups(size: size_t, list: *const gid_t) -> c_int {
e(unsafe { syscall!(SETGROUPS, size, list) })
}
fn setpgid(pid: pid_t, pgid: pid_t) -> c_int {
e(unsafe { syscall!(SETPGID, pid, pgid) }) as c_int
}