authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-12-29 20:36:30+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-12-30 10:25:43-08:00
logdaed2ba2a01ca0d65daebf5401d99bc1f2e292fa
tree03173ce9bc8acc89a6e29e84dd2227c7139493da
parent3634d44d08c73326c7783cf2a3095acb50eb2e1c

std: Add more standard type definitions for FreeBSD

Closes #7550

1 files changed, 19 insertions(+), 12 deletions(-)

lib/std/os/bits/freebsd.zig+19-12
......@@ -7,13 +7,23 @@ const std = @import("../../std.zig");
77const builtin = std.builtin;
88const maxInt = std.math.maxInt;
99
10// See https://svnweb.freebsd.org/base/head/sys/sys/_types.h?view=co
11// TODO: audit pid_t/mode_t. They should likely be i32 and u16, respectively
12pub const fd_t = c_int;
13pub const pid_t = c_int;
10pub const blksize_t = i32;
11pub const blkcnt_t = i64;
12pub const clockid_t = i32;
13pub const fsblkcnt_t = u64;
14pub const fsfilcnt_t = u64;
15pub const nlink_t = u64;
16pub const fd_t = i32;
17pub const pid_t = i32;
1418pub const uid_t = u32;
1519pub const gid_t = u32;
16pub const mode_t = c_uint;
20pub const mode_t = u16;
21pub const off_t = i64;
22pub const ino_t = u64;
23pub const dev_t = u64;
24pub const time_t = i64;
25// The signedness is not constant across different architectures.
26pub const clock_t = isize;
1727
1828pub const socklen_t = u32;
1929
......@@ -117,20 +127,17 @@ pub const msghdr_const = extern struct {
117127 msg_flags: i32,
118128};
119129
120pub const off_t = i64;
121pub const ino_t = u64;
122
123130pub const libc_stat = extern struct {
124 dev: u64,
131 dev: dev_t,
125132 ino: ino_t,
126 nlink: usize,
133 nlink: nlink_t,
127134
128 mode: u16,
135 mode: mode_t,
129136 __pad0: u16,
130137 uid: uid_t,
131138 gid: gid_t,
132139 __pad1: u32,
133 rdev: u64,
140 rdev: dev_t,
134141
135142 atim: timespec,
136143 mtim: timespec,