| ... | ... | @@ -28,12 +28,12 @@ pub extern "c" fn _kern_read_stat(fd: c_int, path_ptr: [*]u8, traverse_link: boo |
| 28 | 28 | pub extern "c" fn _kern_get_current_team() i32; |
| 29 | 29 | |
| 30 | 30 | pub const sem_t = extern struct { |
| 31 | | _magic: u32, |
| 32 | | _kern: extern struct { |
| 33 | | _count: u32, |
| 34 | | _flags: u32, |
| 31 | type: i32, |
| 32 | u: extern union { |
| 33 | named_sem_id: ?i32, |
| 34 | unnamed_sem: ?i32, |
| 35 | 35 | }, |
| 36 | | _padding: u32, |
| 36 | padding: [2]i32, |
| 37 | 37 | }; |
| 38 | 38 | |
| 39 | 39 | pub const pthread_attr_t = extern struct { |
| ... | ... | @@ -51,6 +51,7 @@ pub const pthread_mutex_t = extern struct { |
| 51 | 51 | owner: i32 = -1, |
| 52 | 52 | owner_count: i32 = 0, |
| 53 | 53 | }; |
| 54 | |
| 54 | 55 | pub const pthread_cond_t = extern struct { |
| 55 | 56 | flags: u32 = 0, |
| 56 | 57 | unused: i32 = -42, |
| ... | ... | @@ -58,15 +59,6 @@ pub const pthread_cond_t = extern struct { |
| 58 | 59 | waiter_count: i32 = 0, |
| 59 | 60 | lock: i32 = 0, |
| 60 | 61 | }; |
| 61 | | pub const pthread_rwlock_t = extern struct { |
| 62 | | flags: u32 = 0, |
| 63 | | owner: i32 = -1, |
| 64 | | lock_sem: i32 = 0, |
| 65 | | lock_count: i32 = 0, |
| 66 | | reader_count: i32 = 0, |
| 67 | | writer_count: i32 = 0, |
| 68 | | waiters: [2]?*c_void = [_]?*c_void{ null, null }, |
| 69 | | }; |
| 70 | 62 | |
| 71 | 63 | pub const EAI = enum(c_int) { |
| 72 | 64 | /// address family for hostname not supported |
| ... | ... | @@ -130,17 +122,6 @@ pub const mode_t = c_uint; |
| 130 | 122 | |
| 131 | 123 | pub const socklen_t = u32; |
| 132 | 124 | |
| 133 | | /// Renamed from `kevent` to `Kevent` to avoid conflict with function name. |
| 134 | | pub const Kevent = extern struct { |
| 135 | | ident: usize, |
| 136 | | filter: i16, |
| 137 | | flags: u16, |
| 138 | | fflags: u32, |
| 139 | | data: i64, |
| 140 | | udata: usize, |
| 141 | | // TODO ext |
| 142 | | }; |
| 143 | | |
| 144 | 125 | // Modes and flags for dlopen() |
| 145 | 126 | // include/dlfcn.h |
| 146 | 127 | |
| ... | ... | @@ -178,13 +159,11 @@ pub const dl_phdr_info = extern struct { |
| 178 | 159 | }; |
| 179 | 160 | |
| 180 | 161 | pub const Flock = extern struct { |
| 162 | l_type: c_short, |
| 163 | l_whence: c_short, |
| 181 | 164 | l_start: off_t, |
| 182 | 165 | l_len: off_t, |
| 183 | 166 | l_pid: pid_t, |
| 184 | | l_type: i16, |
| 185 | | l_whence: i16, |
| 186 | | l_sysid: i32, |
| 187 | | __unused: [4]u8, |
| 188 | 167 | }; |
| 189 | 168 | |
| 190 | 169 | pub const msghdr = extern struct { |
| ... | ... | @@ -210,29 +189,6 @@ pub const msghdr = extern struct { |
| 210 | 189 | msg_flags: i32, |
| 211 | 190 | }; |
| 212 | 191 | |
| 213 | | pub const msghdr_const = extern struct { |
| 214 | | /// optional address |
| 215 | | msg_name: ?*const sockaddr, |
| 216 | | |
| 217 | | /// size of address |
| 218 | | msg_namelen: socklen_t, |
| 219 | | |
| 220 | | /// scatter/gather array |
| 221 | | msg_iov: [*]iovec_const, |
| 222 | | |
| 223 | | /// # elements in msg_iov |
| 224 | | msg_iovlen: i32, |
| 225 | | |
| 226 | | /// ancillary data |
| 227 | | msg_control: ?*c_void, |
| 228 | | |
| 229 | | /// ancillary data buffer len |
| 230 | | msg_controllen: socklen_t, |
| 231 | | |
| 232 | | /// flags on received message |
| 233 | | msg_flags: i32, |
| 234 | | }; |
| 235 | | |
| 236 | 192 | pub const off_t = i64; |
| 237 | 193 | pub const ino_t = u64; |
| 238 | 194 | |
| ... | ... | @@ -1001,24 +957,15 @@ pub const IPPROTO = struct { |
| 1001 | 957 | }; |
| 1002 | 958 | |
| 1003 | 959 | pub const rlimit_resource = enum(c_int) { |
| 1004 | | CPU = 0, |
| 1005 | | FSIZE = 1, |
| 960 | CORE = 0, |
| 961 | CPU = 1, |
| 1006 | 962 | DATA = 2, |
| 1007 | | STACK = 3, |
| 1008 | | CORE = 4, |
| 1009 | | RSS = 5, |
| 1010 | | MEMLOCK = 6, |
| 1011 | | NPROC = 7, |
| 1012 | | NOFILE = 8, |
| 1013 | | SBSIZE = 9, |
| 1014 | | VMEM = 10, |
| 1015 | | NPTS = 11, |
| 1016 | | SWAP = 12, |
| 1017 | | KQUEUES = 13, |
| 1018 | | UMTXP = 14, |
| 963 | FSIZE = 3, |
| 964 | NOFILE = 4, |
| 965 | STACK = 5, |
| 966 | AS = 6, |
| 967 | NOVMON = 7, |
| 1019 | 968 | _, |
| 1020 | | |
| 1021 | | pub const AS: rlimit_resource = .VMEM; |
| 1022 | 969 | }; |
| 1023 | 970 | |
| 1024 | 971 | pub const rlim_t = i64; |
| ... | ... | @@ -1055,7 +1002,7 @@ pub const cc_t = u8; |
| 1055 | 1002 | pub const speed_t = u8; |
| 1056 | 1003 | pub const tcflag_t = u32; |
| 1057 | 1004 | |
| 1058 | | pub const NCCS = 32; |
| 1005 | pub const NCCS = 11; |
| 1059 | 1006 | |
| 1060 | 1007 | pub const termios = extern struct { |
| 1061 | 1008 | c_iflag: tcflag_t, |