diff --git a/libc-test/build.rs b/libc-test/build.rs index eb41e2eaa7ac..7efacf7a41e6 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2083,6 +2083,9 @@ fn test_android(target: &str) { | "PF_BLOCK_TS" | "PF_SUSPEND_TASK" => true, + // FIXME(android): Requires >= 6.12 kernel headers. + "SOF_TIMESTAMPING_OPT_RX_FILTER" => true, + _ => false, } }); @@ -2312,6 +2315,7 @@ fn test_freebsd(target: &str) { "sys/thr.h", "sys/time.h", [freebsd14 || freebsd15]:"sys/timerfd.h", + [freebsd13 || freebsd14 || freebsd15]:"dev/evdev/input.h", "sys/times.h", "sys/timex.h", "sys/types.h", @@ -2385,6 +2389,7 @@ fn test_freebsd(target: &str) { "type_" if struct_ == "rtprio" => "type".to_string(), "type_" if struct_ == "sockstat" => "type".to_string(), "type_" if struct_ == "devstat_match_table" => "type".to_string(), + "type_" if struct_ == "input_event" => "type".to_string(), s => s.to_string(), } }); @@ -4336,6 +4341,12 @@ fn test_linux(target: &str) { // FIXME: Requires >= 6.11 kernel headers. "MAP_DROPPABLE" => true, + // FIXME(linux): Requires >= 6.2 kernel headers. + "SOF_TIMESTAMPING_OPT_ID_TCP" => true, + + // FIXME(linux): Requires >= 6.12 kernel headers. + "SOF_TIMESTAMPING_OPT_RX_FILTER" => true, + _ => false, } }); diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt index f8c136dd70e1..a60cd024f204 100644 --- a/libc-test/semver/android.txt +++ b/libc-test/semver/android.txt @@ -2385,9 +2385,12 @@ SOCK_RAW SOCK_RDM SOCK_SEQPACKET SOCK_STREAM +SOF_TIMESTAMPING_BIND_PHC SOF_TIMESTAMPING_OPT_CMSG SOF_TIMESTAMPING_OPT_ID +SOF_TIMESTAMPING_OPT_ID_TCP SOF_TIMESTAMPING_OPT_PKTINFO +SOF_TIMESTAMPING_OPT_RX_FILTER SOF_TIMESTAMPING_OPT_STATS SOF_TIMESTAMPING_OPT_TSONLY SOF_TIMESTAMPING_OPT_TX_SWHW diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index 486d11e64a60..a5a9f9befb9d 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -2026,6 +2026,8 @@ ifconf ifreq in6_pktinfo initgroups +input_absinfo +input_event ip_mreqn ipc_perm jail diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index 3ec327aec633..c91b5034608d 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -2898,9 +2898,12 @@ SOCK_NONBLOCK SOCK_PACKET SOCK_RAW SOCK_RDM +SOF_TIMESTAMPING_BIND_PHC SOF_TIMESTAMPING_OPT_CMSG SOF_TIMESTAMPING_OPT_ID +SOF_TIMESTAMPING_OPT_ID_TCP SOF_TIMESTAMPING_OPT_PKTINFO +SOF_TIMESTAMPING_OPT_RX_FILTER SOF_TIMESTAMPING_OPT_STATS SOF_TIMESTAMPING_OPT_TSONLY SOF_TIMESTAMPING_OPT_TX_SWHW diff --git a/src/primitives.rs b/src/primitives.rs index ed71e843057b..668d3340d2ab 100644 --- a/src/primitives.rs +++ b/src/primitives.rs @@ -20,7 +20,14 @@ pub type c_double = f64; cfg_if! { if #[cfg(all( not(windows), - not(target_vendor = "apple"), + // FIXME(ctest): just use `target_vendor` = "apple"` once `ctest` supports it + not(any( + target_os = "macos", + target_os = "ios", + target_os = "tvos", + target_os = "watchos", + target_os = "visionos", + )), not(target_os = "vita"), any( target_arch = "aarch64", diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index ae4e366afdd4..23bbb1e1c47f 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -290,6 +290,22 @@ s! { pub sem_flg: c_short, } + pub struct input_event { + pub time: crate::timeval, + pub type_: crate::u_short, + pub code: crate::u_short, + pub value: i32, + } + + pub struct input_absinfo { + pub value: i32, + pub minimum: i32, + pub maximum: i32, + pub fuzz: i32, + pub flat: i32, + pub resolution: i32, + } + pub struct msqid_ds { pub msg_perm: crate::ipc_perm, __unused1: *mut c_void, diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index d8e52f5f7424..445957537eb7 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -639,7 +639,7 @@ safe_f! { } pub {const} fn WEXITSTATUS(status: c_int) -> c_int { - status >> 8 + (status >> 8) & 0x00ff } pub {const} fn WCOREDUMP(status: c_int) -> bool { diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index 0e1b05aa5cf7..5debbe8fb967 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -2942,6 +2942,9 @@ pub const SOF_TIMESTAMPING_OPT_TSONLY: c_uint = 1 << 11; pub const SOF_TIMESTAMPING_OPT_STATS: c_uint = 1 << 12; pub const SOF_TIMESTAMPING_OPT_PKTINFO: c_uint = 1 << 13; pub const SOF_TIMESTAMPING_OPT_TX_SWHW: c_uint = 1 << 14; +pub const SOF_TIMESTAMPING_BIND_PHC: c_uint = 1 << 15; +pub const SOF_TIMESTAMPING_OPT_ID_TCP: c_uint = 1 << 16; +pub const SOF_TIMESTAMPING_OPT_RX_FILTER: c_uint = 1 << 17; #[deprecated( since = "0.2.55", diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 71311c1ed668..63049fe1c554 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -4544,6 +4544,9 @@ pub const SOF_TIMESTAMPING_OPT_TSONLY: c_uint = 1 << 11; pub const SOF_TIMESTAMPING_OPT_STATS: c_uint = 1 << 12; pub const SOF_TIMESTAMPING_OPT_PKTINFO: c_uint = 1 << 13; pub const SOF_TIMESTAMPING_OPT_TX_SWHW: c_uint = 1 << 14; +pub const SOF_TIMESTAMPING_BIND_PHC: c_uint = 1 << 15; +pub const SOF_TIMESTAMPING_OPT_ID_TCP: c_uint = 1 << 16; +pub const SOF_TIMESTAMPING_OPT_RX_FILTER: c_uint = 1 << 17; pub const SOF_TXTIME_DEADLINE_MODE: u32 = 1 << 0; pub const SOF_TXTIME_REPORT_ERRORS: u32 = 1 << 1; diff --git a/src/vxworks/mod.rs b/src/vxworks/mod.rs index 2b910616d794..073b5d07ce6f 100644 --- a/src/vxworks/mod.rs +++ b/src/vxworks/mod.rs @@ -34,7 +34,7 @@ pub type ino_t = c_ulong; pub type rlim_t = c_ulong; pub type suseconds_t = c_long; -pub type time_t = c_long; +pub type time_t = c_longlong; pub type errno_t = c_int;