aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2020-12-29 20:36:30 +0100
committerAndrew Kelley <andrew@ziglang.org>2020-12-30 10:25:43 -0800
commitdaed2ba2a01ca0d65daebf5401d99bc1f2e292fa (patch)
tree03173ce9bc8acc89a6e29e84dd2227c7139493da /lib/std
parent3634d44d08c73326c7783cf2a3095acb50eb2e1c (diff)
downloadzig-daed2ba2a01ca0d65daebf5401d99bc1f2e292fa.tar.gz
zig-daed2ba2a01ca0d65daebf5401d99bc1f2e292fa.zip
std: Add more standard type definitions for FreeBSD
Closes #7550
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/os/bits/freebsd.zig31
1 files changed, 19 insertions, 12 deletions
diff --git a/lib/std/os/bits/freebsd.zig b/lib/std/os/bits/freebsd.zig
index 13e14df33c..1405749cdb 100644
--- a/lib/std/os/bits/freebsd.zig
+++ b/lib/std/os/bits/freebsd.zig
@@ -7,13 +7,23 @@ const std = @import("../../std.zig");
const builtin = std.builtin;
const maxInt = std.math.maxInt;
-// See https://svnweb.freebsd.org/base/head/sys/sys/_types.h?view=co
-// TODO: audit pid_t/mode_t. They should likely be i32 and u16, respectively
-pub const fd_t = c_int;
-pub const pid_t = c_int;
+pub const blksize_t = i32;
+pub const blkcnt_t = i64;
+pub const clockid_t = i32;
+pub const fsblkcnt_t = u64;
+pub const fsfilcnt_t = u64;
+pub const nlink_t = u64;
+pub const fd_t = i32;
+pub const pid_t = i32;
pub const uid_t = u32;
pub const gid_t = u32;
-pub const mode_t = c_uint;
+pub const mode_t = u16;
+pub const off_t = i64;
+pub const ino_t = u64;
+pub const dev_t = u64;
+pub const time_t = i64;
+// The signedness is not constant across different architectures.
+pub const clock_t = isize;
pub const socklen_t = u32;
@@ -117,20 +127,17 @@ pub const msghdr_const = extern struct {
msg_flags: i32,
};
-pub const off_t = i64;
-pub const ino_t = u64;
-
pub const libc_stat = extern struct {
- dev: u64,
+ dev: dev_t,
ino: ino_t,
- nlink: usize,
+ nlink: nlink_t,
- mode: u16,
+ mode: mode_t,
__pad0: u16,
uid: uid_t,
gid: gid_t,
__pad1: u32,
- rdev: u64,
+ rdev: dev_t,
atim: timespec,
mtim: timespec,