| ... | @@ -7,13 +7,23 @@ const std = @import("../../std.zig"); | ... | @@ -7,13 +7,23 @@ const std = @import("../../std.zig"); |
| 7 | const builtin = std.builtin; | 7 | const builtin = std.builtin; |
| 8 | const maxInt = std.math.maxInt; | 8 | const maxInt = std.math.maxInt; |
| 9 | | 9 | |
| 10 | // See https://svnweb.freebsd.org/base/head/sys/sys/_types.h?view=co | 10 | pub const blksize_t = i32; |
| 11 | // TODO: audit pid_t/mode_t. They should likely be i32 and u16, respectively | 11 | pub const blkcnt_t = i64; |
| 12 | pub const fd_t = c_int; | 12 | pub const clockid_t = i32; |
| 13 | pub const pid_t = c_int; | 13 | pub const fsblkcnt_t = u64; |
| | 14 | pub const fsfilcnt_t = u64; |
| | 15 | pub const nlink_t = u64; |
| | 16 | pub const fd_t = i32; |
| | 17 | pub const pid_t = i32; |
| 14 | pub const uid_t = u32; | 18 | pub const uid_t = u32; |
| 15 | pub const gid_t = u32; | 19 | pub const gid_t = u32; |
| 16 | pub const mode_t = c_uint; | 20 | pub const mode_t = u16; |
| | 21 | pub const off_t = i64; |
| | 22 | pub const ino_t = u64; |
| | 23 | pub const dev_t = u64; |
| | 24 | pub const time_t = i64; |
| | 25 | // The signedness is not constant across different architectures. |
| | 26 | pub const clock_t = isize; |
| 17 | | 27 | |
| 18 | pub const socklen_t = u32; | 28 | pub const socklen_t = u32; |
| 19 | | 29 | |
| ... | @@ -117,20 +127,17 @@ pub const msghdr_const = extern struct { | ... | @@ -117,20 +127,17 @@ pub const msghdr_const = extern struct { |
| 117 | msg_flags: i32, | 127 | msg_flags: i32, |
| 118 | }; | 128 | }; |
| 119 | | 129 | |
| 120 | pub const off_t = i64; | | |
| 121 | pub const ino_t = u64; | | |
| 122 | | | |
| 123 | pub const libc_stat = extern struct { | 130 | pub const libc_stat = extern struct { |
| 124 | dev: u64, | 131 | dev: dev_t, |
| 125 | ino: ino_t, | 132 | ino: ino_t, |
| 126 | nlink: usize, | 133 | nlink: nlink_t, |
| 127 | | 134 | |
| 128 | mode: u16, | 135 | mode: mode_t, |
| 129 | __pad0: u16, | 136 | __pad0: u16, |
| 130 | uid: uid_t, | 137 | uid: uid_t, |
| 131 | gid: gid_t, | 138 | gid: gid_t, |
| 132 | __pad1: u32, | 139 | __pad1: u32, |
| 133 | rdev: u64, | 140 | rdev: dev_t, |
| 134 | | 141 | |
| 135 | atim: timespec, | 142 | atim: timespec, |
| 136 | mtim: timespec, | 143 | mtim: timespec, |