freebsd, netbsd, dragonfly: add struct timeval

This commit is contained in:
xackus 2021-01-05 12:49:56 +01:00 committed by Andrew Kelley
parent 3e8aaee829
commit 1640c357f4
3 changed files with 24 additions and 0 deletions

View File

@ -20,6 +20,7 @@ pub const off_t = c_long;
pub const mode_t = c_uint;
pub const uid_t = u32;
pub const gid_t = u32;
pub const suseconds_t = c_long;
pub const ENOTSUP = EOPNOTSUPP;
pub const EWOULDBLOCK = EAGAIN;
@ -190,6 +191,13 @@ pub const timespec = extern struct {
tv_nsec: c_long,
};
pub const timeval = extern struct {
/// seconds
tv_sec: time_t,
/// microseconds
tv_usec: suseconds_t,
};
pub const CTL_UNSPEC = 0;
pub const CTL_KERN = 1;
pub const CTL_VM = 2;

View File

@ -26,6 +26,7 @@ pub const time_t = i64;
pub const clock_t = isize;
pub const socklen_t = u32;
pub const suseconds_t = c_long;
/// Renamed from `kevent` to `Kevent` to avoid conflict with function name.
pub const Kevent = extern struct {
@ -169,6 +170,13 @@ pub const timespec = extern struct {
tv_nsec: isize,
};
pub const timeval = extern struct {
/// seconds
tv_sec: time_t,
/// microseconds
tv_usec: suseconds_t,
};
pub const dirent = extern struct {
d_fileno: usize,
d_off: i64,

View File

@ -22,6 +22,7 @@ pub const socklen_t = u32;
pub const time_t = i64;
pub const uid_t = u32;
pub const lwpid_t = i32;
pub const suseconds_t = c_int;
/// Renamed from `kevent` to `Kevent` to avoid conflict with function name.
pub const Kevent = extern struct {
@ -190,6 +191,13 @@ pub const timespec = extern struct {
tv_nsec: isize,
};
pub const timeval = extern struct {
/// seconds
tv_sec: time_t,
/// microseconds
tv_usec: suseconds_t,
};
pub const MAXNAMLEN = 511;
pub const dirent = extern struct {