mirror of
https://github.com/ziglang/zig.git
synced 2026-01-21 06:45:24 +00:00
implement setreuid, setregid for darwin
This commit is contained in:
parent
4f0f3a7d45
commit
768af66977
@ -41,3 +41,5 @@ pub extern "c" fn realpath(noalias file_name: &const u8, noalias resolved_name:
|
||||
pub extern "c" fn sigprocmask(how: c_int, noalias set: &const sigset_t, noalias oset: ?&sigset_t) -> c_int;
|
||||
pub extern "c" fn sigaction(sig: c_int, noalias act: &const Sigaction, noalias oact: ?&Sigaction) -> c_int;
|
||||
pub extern "c" fn nanosleep(rqtp: &const timespec, rmtp: ?×pec) -> c_int;
|
||||
pub extern "c" fn setreuid(ruid: c_uint, euid: c_uint) -> c_int;
|
||||
pub extern "c" fn setregid(rgid: c_uint, egid: c_uint) -> c_int;
|
||||
|
||||
@ -229,6 +229,14 @@ pub fn realpath(noalias filename: &const u8, noalias resolved_name: &u8) -> usiz
|
||||
if (c.realpath(filename, resolved_name) == null) @bitCast(usize, -isize(*c._errno())) else 0
|
||||
}
|
||||
|
||||
pub fn setreuid(ruid: u32, euid: u32) -> usize {
|
||||
errnoWrap(c.setreuid(ruid, euid))
|
||||
}
|
||||
|
||||
pub fn setregid(rgid: u32, egid: u32) -> usize {
|
||||
errnoWrap(c.setregid(rgid, egid))
|
||||
}
|
||||
|
||||
pub fn sigprocmask(flags: u32, noalias set: &const sigset_t, noalias oldset: ?&sigset_t) -> usize {
|
||||
errnoWrap(c.sigprocmask(@bitCast(c_int, flags), set, oldset))
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user