| author | |
| committer | |
| log | fee9318b1756054ff7050bae72c87a1b63a6f968 |
| tree | 232e1be13e56305b64400e0077a95907559a5f36 |
| parent | 2f6b045fb13b6a49e5185fa0f4006bef1dacd0d7 |
| signature |
* add reserved field to match musl struct definition so that
it will work with musl libc.
* add libc getrusage so that it will work with libc
what's not done in this branch is:
* test coverage. See #1629, which should also aim to provide
general test coverage for the std lib.
* rusage struct bits for non-linux operating systems2 files changed, 2 insertions(+), 0 deletions(-)
lib/std/c.zig+1| ... | ... | @@ -109,6 +109,7 @@ pub extern "c" fn setreuid(ruid: c_uint, euid: c_uint) c_int; |
| 109 | 109 | pub extern "c" fn setregid(rgid: c_uint, egid: c_uint) c_int; |
| 110 | 110 | pub extern "c" fn rmdir(path: [*:0]const u8) c_int; |
| 111 | 111 | pub extern "c" fn getenv(name: [*:0]const u8) ?[*:0]u8; |
| 112 | pub extern "c" fn getrusage(who: c_int, usage: *rusage) c_int; | |
| 112 | 113 | pub extern "c" fn sysctl(name: [*]const c_int, namelen: c_uint, oldp: ?*c_void, oldlenp: ?*usize, newp: ?*c_void, newlen: usize) c_int; |
| 113 | 114 | pub extern "c" fn sysctlbyname(name: [*:0]const u8, oldp: ?*c_void, oldlenp: ?*usize, newp: ?*c_void, newlen: usize) c_int; |
| 114 | 115 | pub extern "c" fn sysctlnametomib(name: [*:0]const u8, mibp: ?*c_int, sizep: ?*usize) c_int; |
lib/std/os/bits/linux.zig+1| ... | ... | @@ -1475,4 +1475,5 @@ pub const rusage = extern struct { |
| 1475 | 1475 | nsignals: isize, |
| 1476 | 1476 | nvcsw: isize, |
| 1477 | 1477 | nivcsw: isize, |
| 1478 | __reserved: [16]isize = [1]isize{0} ** 16, | |
| 1478 | 1479 | }; |