mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
std.{c,posix}: add getgid and getegid
This commit is contained in:
parent
dbf9c7b548
commit
8d4b5662cd
3 changed files with 16 additions and 0 deletions
|
|
@ -10713,7 +10713,9 @@ pub extern "c" fn setresuid(ruid: uid_t, euid: uid_t, suid: uid_t) c_int;
|
|||
pub extern "c" fn setresgid(rgid: gid_t, egid: gid_t, sgid: gid_t) c_int;
|
||||
pub extern "c" fn setpgid(pid: pid_t, pgid: pid_t) c_int;
|
||||
pub extern "c" fn getuid() uid_t;
|
||||
pub extern "c" fn getgid() gid_t;
|
||||
pub extern "c" fn geteuid() uid_t;
|
||||
pub extern "c" fn getegid() gid_t;
|
||||
pub extern "c" fn getresuid(ruid: *uid_t, euid: *uid_t, suid: *uid_t) c_int;
|
||||
pub extern "c" fn getresgid(rgid: *gid_t, egid: *gid_t, sgid: *gid_t) c_int;
|
||||
|
||||
|
|
|
|||
|
|
@ -3557,6 +3557,14 @@ pub fn geteuid() uid_t {
|
|||
return system.geteuid();
|
||||
}
|
||||
|
||||
pub fn getgid() gid_t {
|
||||
return system.getgid();
|
||||
}
|
||||
|
||||
pub fn getegid() gid_t {
|
||||
return system.getegid();
|
||||
}
|
||||
|
||||
/// Test whether a file descriptor refers to a terminal.
|
||||
pub fn isatty(handle: fd_t) bool {
|
||||
if (native_os == .windows) {
|
||||
|
|
|
|||
|
|
@ -314,6 +314,12 @@ test "getuid" {
|
|||
_ = posix.geteuid();
|
||||
}
|
||||
|
||||
test "getgid" {
|
||||
if (native_os == .windows or native_os == .wasi) return error.SkipZigTest;
|
||||
_ = posix.getgid();
|
||||
_ = posix.getegid();
|
||||
}
|
||||
|
||||
test "sigaltstack" {
|
||||
if (native_os == .windows or native_os == .wasi) return error.SkipZigTest;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue