Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.2] Backports #4284

Merged
merged 5 commits into from
Feb 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
});
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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(),
}
});
Expand Down Expand Up @@ -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,
}
});
Expand Down
3 changes: 3 additions & 0 deletions libc-test/semver/android.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions libc-test/semver/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2026,6 +2026,8 @@ ifconf
ifreq
in6_pktinfo
initgroups
input_absinfo
input_event
ip_mreqn
ipc_perm
jail
Expand Down
3 changes: 3 additions & 0 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion src/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 16 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions src/unix/linux_like/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/vxworks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Loading