authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2020-09-09 20:05:47+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-09-10 15:41:52-04:00
log13b8c638346b82da4856e9c5d688feffa66a32f6
tree76e1fceedf885e397334a9035d1d3625b2407b58
parentbb9773f695ee1a783ebd347d301dcc089afb64ba

std: complete C definitions for uid/gid setters

Also: - correct the definition of setgid - update the existing definitions to use the uid_t/gid_t types

1 files changed, 9 insertions(+), 4 deletions(-)

lib/std/c.zig+9-4
......@@ -132,8 +132,6 @@ pub usingnamespace switch (builtin.os.tag) {
132132 },
133133};
134134
135pub extern "c" fn setreuid(ruid: c_uint, euid: c_uint) c_int;
136pub extern "c" fn setregid(rgid: c_uint, egid: c_uint) c_int;
137135pub extern "c" fn rmdir(path: [*:0]const u8) c_int;
138136pub extern "c" fn getenv(name: [*:0]const u8) ?[*:0]u8;
139137pub extern "c" fn sysctl(name: [*]const c_int, namelen: c_uint, oldp: ?*c_void, oldlenp: ?*usize, newp: ?*c_void, newlen: usize) c_int;
......@@ -237,8 +235,15 @@ pub usingnamespace switch (builtin.os.tag) {
237235
238236pub extern "c" fn kill(pid: pid_t, sig: c_int) c_int;
239237pub extern "c" fn getdirentries(fd: fd_t, buf_ptr: [*]u8, nbytes: usize, basep: *i64) isize;
240pub extern "c" fn setgid(ruid: c_uint, euid: c_uint) c_int;
241pub extern "c" fn setuid(uid: c_uint) c_int;
238
239pub extern "c" fn setuid(uid: uid_t) c_int;
240pub extern "c" fn setgid(gid: gid_t) c_int;
241pub extern "c" fn seteuid(euid: uid_t) c_int;
242pub extern "c" fn setegid(egid: gid_t) c_int;
243pub extern "c" fn setreuid(ruid: uid_t, euid: uid_t) c_int;
244pub extern "c" fn setregid(rgid: gid_t, egid: gid_t) c_int;
245pub extern "c" fn setresuid(ruid: uid_t, euid: uid_t, suid: uid_t) c_int;
246pub extern "c" fn setresgid(rgid: gid_t, egid: gid_t, sgid: gid_t) c_int;
242247
243248pub extern "c" fn aligned_alloc(alignment: usize, size: usize) ?*c_void;
244249pub extern "c" fn malloc(usize) ?*c_void;