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");...@@ -7,13 +7,23 @@ const std = @import("../../std.zig");
7const builtin = std.builtin;7const builtin = std.builtin;
8const maxInt = std.math.maxInt;8const maxInt = std.math.maxInt;
99
10// See https://svnweb.freebsd.org/base/head/sys/sys/_types.h?view=co10pub const blksize_t = i32;
11// TODO: audit pid_t/mode_t. They should likely be i32 and u16, respectively11pub const blkcnt_t = i64;
12pub const fd_t = c_int;12pub const clockid_t = i32;
13pub const pid_t = c_int;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;
14pub const uid_t = u32;18pub const uid_t = u32;
15pub const gid_t = u32;19pub 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
18pub const socklen_t = u32;28pub const socklen_t = u32;
1929
...@@ -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};
119129
120pub const off_t = i64;
121pub const ino_t = u64;
122
123pub const libc_stat = extern struct {130pub 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,
127134
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,
134141
135 atim: timespec,142 atim: timespec,
136 mtim: timespec,143 mtim: timespec,