| ... | ... | @@ -5,12 +5,21 @@ const maxInt = std.math.maxInt; |
| 5 | 5 | const iovec = std.os.iovec; |
| 6 | 6 | const iovec_const = std.os.iovec_const; |
| 7 | 7 | |
| 8 | pub const CPU_SETSIZE = 256; |
| 9 | pub const cpuset_t = extern struct { |
| 10 | __bits: [(CPU_SETSIZE + (@bitSizeOf(c_long) - 1)) / @bitSizeOf(c_long)]c_long, |
| 11 | }; |
| 12 | pub const cpulevel_t = c_int; |
| 13 | pub const cpuwhich_t = c_int; |
| 14 | pub const id_t = i64; |
| 15 | |
| 8 | 16 | extern "c" fn __error() *c_int; |
| 9 | 17 | pub const _errno = __error; |
| 10 | 18 | |
| 11 | 19 | pub extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) usize; |
| 12 | 20 | pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int; |
| 13 | 21 | pub extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize; |
| 22 | pub extern "c" fn getentropy(buf_ptr: [*]u8, buf_len: usize) c_int; |
| 14 | 23 | |
| 15 | 24 | pub extern "c" fn pthread_getthreadid_np() c_int; |
| 16 | 25 | pub extern "c" fn pthread_set_name_np(thread: std.c.pthread_t, name: [*:0]const u8) void; |
| ... | ... | @@ -26,6 +35,9 @@ pub extern "c" fn getpid() pid_t; |
| 26 | 35 | pub extern "c" fn kinfo_getfile(pid: pid_t, cntp: *c_int) ?[*]kinfo_file; |
| 27 | 36 | pub extern "c" fn kinfo_getvmmap(pid: pid_t, cntp: *c_int) ?[*]kinfo_vmentry; |
| 28 | 37 | |
| 38 | pub extern "c" fn cpuset_getaffinity(level: cpulevel_t, which: cpuwhich_t, id: id_t, setsize: usize, mask: *cpuset_t) c_int; |
| 39 | pub extern "c" fn cpuset_setaffinity(level: cpulevel_t, which: cpuwhich_t, id: id_t, setsize: usize, mask: *const cpuset_t) c_int; |
| 40 | |
| 29 | 41 | pub const sf_hdtr = extern struct { |
| 30 | 42 | headers: [*]const iovec_const, |
| 31 | 43 | hdr_cnt: c_int, |
| ... | ... | @@ -203,8 +215,6 @@ pub const clock_t = isize; |
| 203 | 215 | pub const socklen_t = u32; |
| 204 | 216 | pub const suseconds_t = c_long; |
| 205 | 217 | |
| 206 | | pub const id_t = i64; |
| 207 | | |
| 208 | 218 | /// Renamed from `kevent` to `Kevent` to avoid conflict with function name. |
| 209 | 219 | pub const Kevent = extern struct { |
| 210 | 220 | /// Identifier for this event. |