Skip to content

Commit 0d2ea3c

Browse files
authored
Merge pull request #4284 from tgross35/backport-oysters
[0.2] Backports
2 parents b1d4d35 + 42a30ad commit 0d2ea3c

File tree

10 files changed

+51
-3
lines changed

10 files changed

+51
-3
lines changed

Diff for: libc-test/build.rs

+11
Original file line numberDiff line numberDiff line change
@@ -2083,6 +2083,9 @@ fn test_android(target: &str) {
20832083
| "PF_BLOCK_TS"
20842084
| "PF_SUSPEND_TASK" => true,
20852085

2086+
// FIXME(android): Requires >= 6.12 kernel headers.
2087+
"SOF_TIMESTAMPING_OPT_RX_FILTER" => true,
2088+
20862089
_ => false,
20872090
}
20882091
});
@@ -2312,6 +2315,7 @@ fn test_freebsd(target: &str) {
23122315
"sys/thr.h",
23132316
"sys/time.h",
23142317
[freebsd14 || freebsd15]:"sys/timerfd.h",
2318+
[freebsd13 || freebsd14 || freebsd15]:"dev/evdev/input.h",
23152319
"sys/times.h",
23162320
"sys/timex.h",
23172321
"sys/types.h",
@@ -2385,6 +2389,7 @@ fn test_freebsd(target: &str) {
23852389
"type_" if struct_ == "rtprio" => "type".to_string(),
23862390
"type_" if struct_ == "sockstat" => "type".to_string(),
23872391
"type_" if struct_ == "devstat_match_table" => "type".to_string(),
2392+
"type_" if struct_ == "input_event" => "type".to_string(),
23882393
s => s.to_string(),
23892394
}
23902395
});
@@ -4336,6 +4341,12 @@ fn test_linux(target: &str) {
43364341
// FIXME: Requires >= 6.11 kernel headers.
43374342
"MAP_DROPPABLE" => true,
43384343

4344+
// FIXME(linux): Requires >= 6.2 kernel headers.
4345+
"SOF_TIMESTAMPING_OPT_ID_TCP" => true,
4346+
4347+
// FIXME(linux): Requires >= 6.12 kernel headers.
4348+
"SOF_TIMESTAMPING_OPT_RX_FILTER" => true,
4349+
43394350
_ => false,
43404351
}
43414352
});

Diff for: libc-test/semver/android.txt

+3
Original file line numberDiff line numberDiff line change
@@ -2385,9 +2385,12 @@ SOCK_RAW
23852385
SOCK_RDM
23862386
SOCK_SEQPACKET
23872387
SOCK_STREAM
2388+
SOF_TIMESTAMPING_BIND_PHC
23882389
SOF_TIMESTAMPING_OPT_CMSG
23892390
SOF_TIMESTAMPING_OPT_ID
2391+
SOF_TIMESTAMPING_OPT_ID_TCP
23902392
SOF_TIMESTAMPING_OPT_PKTINFO
2393+
SOF_TIMESTAMPING_OPT_RX_FILTER
23912394
SOF_TIMESTAMPING_OPT_STATS
23922395
SOF_TIMESTAMPING_OPT_TSONLY
23932396
SOF_TIMESTAMPING_OPT_TX_SWHW

Diff for: libc-test/semver/freebsd.txt

+2
Original file line numberDiff line numberDiff line change
@@ -2026,6 +2026,8 @@ ifconf
20262026
ifreq
20272027
in6_pktinfo
20282028
initgroups
2029+
input_absinfo
2030+
input_event
20292031
ip_mreqn
20302032
ipc_perm
20312033
jail

Diff for: libc-test/semver/linux.txt

+3
Original file line numberDiff line numberDiff line change
@@ -2898,9 +2898,12 @@ SOCK_NONBLOCK
28982898
SOCK_PACKET
28992899
SOCK_RAW
29002900
SOCK_RDM
2901+
SOF_TIMESTAMPING_BIND_PHC
29012902
SOF_TIMESTAMPING_OPT_CMSG
29022903
SOF_TIMESTAMPING_OPT_ID
2904+
SOF_TIMESTAMPING_OPT_ID_TCP
29032905
SOF_TIMESTAMPING_OPT_PKTINFO
2906+
SOF_TIMESTAMPING_OPT_RX_FILTER
29042907
SOF_TIMESTAMPING_OPT_STATS
29052908
SOF_TIMESTAMPING_OPT_TSONLY
29062909
SOF_TIMESTAMPING_OPT_TX_SWHW

Diff for: src/primitives.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@ pub type c_double = f64;
2020
cfg_if! {
2121
if #[cfg(all(
2222
not(windows),
23-
not(target_vendor = "apple"),
23+
// FIXME(ctest): just use `target_vendor` = "apple"` once `ctest` supports it
24+
not(any(
25+
target_os = "macos",
26+
target_os = "ios",
27+
target_os = "tvos",
28+
target_os = "watchos",
29+
target_os = "visionos",
30+
)),
2431
not(target_os = "vita"),
2532
any(
2633
target_arch = "aarch64",

Diff for: src/unix/bsd/freebsdlike/freebsd/mod.rs

+16
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,22 @@ s! {
290290
pub sem_flg: c_short,
291291
}
292292

293+
pub struct input_event {
294+
pub time: crate::timeval,
295+
pub type_: crate::u_short,
296+
pub code: crate::u_short,
297+
pub value: i32,
298+
}
299+
300+
pub struct input_absinfo {
301+
pub value: i32,
302+
pub minimum: i32,
303+
pub maximum: i32,
304+
pub fuzz: i32,
305+
pub flat: i32,
306+
pub resolution: i32,
307+
}
308+
293309
pub struct msqid_ds {
294310
pub msg_perm: crate::ipc_perm,
295311
__unused1: *mut c_void,

Diff for: src/unix/bsd/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ safe_f! {
639639
}
640640

641641
pub {const} fn WEXITSTATUS(status: c_int) -> c_int {
642-
status >> 8
642+
(status >> 8) & 0x00ff
643643
}
644644

645645
pub {const} fn WCOREDUMP(status: c_int) -> bool {

Diff for: src/unix/linux_like/android/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -2942,6 +2942,9 @@ pub const SOF_TIMESTAMPING_OPT_TSONLY: c_uint = 1 << 11;
29422942
pub const SOF_TIMESTAMPING_OPT_STATS: c_uint = 1 << 12;
29432943
pub const SOF_TIMESTAMPING_OPT_PKTINFO: c_uint = 1 << 13;
29442944
pub const SOF_TIMESTAMPING_OPT_TX_SWHW: c_uint = 1 << 14;
2945+
pub const SOF_TIMESTAMPING_BIND_PHC: c_uint = 1 << 15;
2946+
pub const SOF_TIMESTAMPING_OPT_ID_TCP: c_uint = 1 << 16;
2947+
pub const SOF_TIMESTAMPING_OPT_RX_FILTER: c_uint = 1 << 17;
29452948

29462949
#[deprecated(
29472950
since = "0.2.55",

Diff for: src/unix/linux_like/linux/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -4544,6 +4544,9 @@ pub const SOF_TIMESTAMPING_OPT_TSONLY: c_uint = 1 << 11;
45444544
pub const SOF_TIMESTAMPING_OPT_STATS: c_uint = 1 << 12;
45454545
pub const SOF_TIMESTAMPING_OPT_PKTINFO: c_uint = 1 << 13;
45464546
pub const SOF_TIMESTAMPING_OPT_TX_SWHW: c_uint = 1 << 14;
4547+
pub const SOF_TIMESTAMPING_BIND_PHC: c_uint = 1 << 15;
4548+
pub const SOF_TIMESTAMPING_OPT_ID_TCP: c_uint = 1 << 16;
4549+
pub const SOF_TIMESTAMPING_OPT_RX_FILTER: c_uint = 1 << 17;
45474550
pub const SOF_TXTIME_DEADLINE_MODE: u32 = 1 << 0;
45484551
pub const SOF_TXTIME_REPORT_ERRORS: u32 = 1 << 1;
45494552

Diff for: src/vxworks/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub type ino_t = c_ulong;
3434

3535
pub type rlim_t = c_ulong;
3636
pub type suseconds_t = c_long;
37-
pub type time_t = c_long;
37+
pub type time_t = c_longlong;
3838

3939
pub type errno_t = c_int;
4040

0 commit comments

Comments
 (0)