| author | |
| committer | |
| log | fb188c3d18a744cb98fc361aeeb8e8796066868b |
| tree | 171dd8df55851a6ae36eb81416718e15ec972bdb |
| parent | dc66f4384f5ab4210f57f3fd37fd96cdd2823782 |
| signature |
3 files changed, 16 insertions(+), 0 deletions(-)
lib/std/c.zig+2| ... | @@ -10547,6 +10547,8 @@ pub extern "c" fn setregid(rgid: gid_t, egid: gid_t) c_int; | ... | @@ -10547,6 +10547,8 @@ pub extern "c" fn setregid(rgid: gid_t, egid: gid_t) c_int; |
| 10547 | pub extern "c" fn setresuid(ruid: uid_t, euid: uid_t, suid: uid_t) c_int; | 10547 | pub extern "c" fn setresuid(ruid: uid_t, euid: uid_t, suid: uid_t) c_int; |
| 10548 | pub extern "c" fn setresgid(rgid: gid_t, egid: gid_t, sgid: gid_t) c_int; | 10548 | pub extern "c" fn setresgid(rgid: gid_t, egid: gid_t, sgid: gid_t) c_int; |
| 10549 | pub extern "c" fn setpgid(pid: pid_t, pgid: pid_t) c_int; | 10549 | pub extern "c" fn setpgid(pid: pid_t, pgid: pid_t) c_int; |
| 10550 | pub extern "c" fn getuid() uid_t; | ||
| 10551 | pub extern "c" fn geteuid() uid_t; | ||
| 10550 | 10552 | ||
| 10551 | pub extern "c" fn malloc(usize) ?*anyopaque; | 10553 | pub extern "c" fn malloc(usize) ?*anyopaque; |
| 10552 | pub extern "c" fn calloc(usize, usize) ?*anyopaque; | 10554 | pub extern "c" fn calloc(usize, usize) ?*anyopaque; |
lib/std/posix.zig+8| ... | @@ -3505,6 +3505,14 @@ pub fn setpgid(pid: pid_t, pgid: pid_t) SetPgidError!void { | ... | @@ -3505,6 +3505,14 @@ pub fn setpgid(pid: pid_t, pgid: pid_t) SetPgidError!void { |
| 3505 | } | 3505 | } |
| 3506 | } | 3506 | } |
| 3507 | 3507 | ||
| 3508 | pub fn getuid() uid_t { | ||
| 3509 | return system.getuid(); | ||
| 3510 | } | ||
| 3511 | |||
| 3512 | pub fn geteuid() uid_t { | ||
| 3513 | return system.geteuid(); | ||
| 3514 | } | ||
| 3515 | |||
| 3508 | /// Test whether a file descriptor refers to a terminal. | 3516 | /// Test whether a file descriptor refers to a terminal. |
| 3509 | pub fn isatty(handle: fd_t) bool { | 3517 | pub fn isatty(handle: fd_t) bool { |
| 3510 | if (native_os == .windows) { | 3518 | if (native_os == .windows) { |
lib/std/posix/test.zig+6| ... | @@ -509,6 +509,12 @@ test "getcwd" { | ... | @@ -509,6 +509,12 @@ test "getcwd" { |
| 509 | _ = posix.getcwd(&buf) catch undefined; | 509 | _ = posix.getcwd(&buf) catch undefined; |
| 510 | } | 510 | } |
| 511 | 511 | ||
| 512 | test "getuid" { | ||
| 513 | if (native_os == .windows or native_os == .wasi) return error.SkipZigTest; | ||
| 514 | _ = posix.getuid(); | ||
| 515 | _ = posix.geteuid(); | ||
| 516 | } | ||
| 517 | |||
| 512 | test "sigaltstack" { | 518 | test "sigaltstack" { |
| 513 | if (native_os == .windows or native_os == .wasi) return error.SkipZigTest; | 519 | if (native_os == .windows or native_os == .wasi) return error.SkipZigTest; |
| 514 | 520 |