authorgravatar for 14938807+xackus@users.noreply.github.comxackus <14938807+xackus@users.noreply.github.com> 2021-01-05 12:49:56+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-01-05 13:07:25-08:00
log1640c357f42e0fc18d88a02995c25094063fef5e
treef870cd7905c28a4027c32f227ff20c77d2ddb448
parent3e8aaee829584f4893cad5c524076d2300f45f24

freebsd, netbsd, dragonfly: add struct timeval


3 files changed, 24 insertions(+), 0 deletions(-)

lib/std/os/bits/dragonfly.zig+8
...@@ -20,6 +20,7 @@ pub const off_t = c_long;...@@ -20,6 +20,7 @@ pub const off_t = c_long;
20pub const mode_t = c_uint;20pub const mode_t = c_uint;
21pub const uid_t = u32;21pub const uid_t = u32;
22pub const gid_t = u32;22pub const gid_t = u32;
23pub const suseconds_t = c_long;
2324
24pub const ENOTSUP = EOPNOTSUPP;25pub const ENOTSUP = EOPNOTSUPP;
25pub const EWOULDBLOCK = EAGAIN;26pub const EWOULDBLOCK = EAGAIN;
...@@ -190,6 +191,13 @@ pub const timespec = extern struct {...@@ -190,6 +191,13 @@ pub const timespec = extern struct {
190 tv_nsec: c_long,191 tv_nsec: c_long,
191};192};
192193
194pub const timeval = extern struct {
195 /// seconds
196 tv_sec: time_t,
197 /// microseconds
198 tv_usec: suseconds_t,
199};
200
193pub const CTL_UNSPEC = 0;201pub const CTL_UNSPEC = 0;
194pub const CTL_KERN = 1;202pub const CTL_KERN = 1;
195pub const CTL_VM = 2;203pub const CTL_VM = 2;
lib/std/os/bits/freebsd.zig+8
...@@ -26,6 +26,7 @@ pub const time_t = i64;...@@ -26,6 +26,7 @@ pub const time_t = i64;
26pub const clock_t = isize;26pub const clock_t = isize;
2727
28pub const socklen_t = u32;28pub const socklen_t = u32;
29pub const suseconds_t = c_long;
2930
30/// Renamed from `kevent` to `Kevent` to avoid conflict with function name.31/// Renamed from `kevent` to `Kevent` to avoid conflict with function name.
31pub const Kevent = extern struct {32pub const Kevent = extern struct {
...@@ -169,6 +170,13 @@ pub const timespec = extern struct {...@@ -169,6 +170,13 @@ pub const timespec = extern struct {
169 tv_nsec: isize,170 tv_nsec: isize,
170};171};
171172
173pub const timeval = extern struct {
174 /// seconds
175 tv_sec: time_t,
176 /// microseconds
177 tv_usec: suseconds_t,
178};
179
172pub const dirent = extern struct {180pub const dirent = extern struct {
173 d_fileno: usize,181 d_fileno: usize,
174 d_off: i64,182 d_off: i64,
lib/std/os/bits/netbsd.zig+8
...@@ -22,6 +22,7 @@ pub const socklen_t = u32;...@@ -22,6 +22,7 @@ pub const socklen_t = u32;
22pub const time_t = i64;22pub const time_t = i64;
23pub const uid_t = u32;23pub const uid_t = u32;
24pub const lwpid_t = i32;24pub const lwpid_t = i32;
25pub const suseconds_t = c_int;
2526
26/// Renamed from `kevent` to `Kevent` to avoid conflict with function name.27/// Renamed from `kevent` to `Kevent` to avoid conflict with function name.
27pub const Kevent = extern struct {28pub const Kevent = extern struct {
...@@ -190,6 +191,13 @@ pub const timespec = extern struct {...@@ -190,6 +191,13 @@ pub const timespec = extern struct {
190 tv_nsec: isize,191 tv_nsec: isize,
191};192};
192193
194pub const timeval = extern struct {
195 /// seconds
196 tv_sec: time_t,
197 /// microseconds
198 tv_usec: suseconds_t,
199};
200
193pub const MAXNAMLEN = 511;201pub const MAXNAMLEN = 511;
194202
195pub const dirent = extern struct {203pub const dirent = extern struct {