From 46b90a84f10929ae4b16dec2a07328f94b8bc2f5 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sat, 14 Jun 2025 14:39:58 -0600 Subject: [PATCH] Fix CI on FreeBSD 15 A recent change has replaced an unused preprocessor symbol: P_UNUSED3 https://github.com/freebsd/freebsd-src/commit/33be1632047c05dbfcc139476e05f49c3a86d560 Another recent change has changed the size of a spare field: mc_spare https://github.com/freebsd/freebsd-src/commit/eea3e4dd9703a252509d75814049aa8da5007ebb --- libc-test/build.rs | 4 +++- src/unix/bsd/freebsdlike/freebsd/mod.rs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index 794e2ef9d1a2..d3af5e5db1e7 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2574,7 +2574,7 @@ fn test_freebsd(target: &str) { "TDF_CANSWAP" | "TDF_SWAPINREQ" => true, // Unaccessible in FreeBSD 15 - "TDI_SWAPPED" | "P_SWAPPINGOUT" | "P_SWAPPINGIN" => true, + "TDI_SWAPPED" | "P_SWAPPINGOUT" | "P_SWAPPINGIN" | "P_UNUSED3" => true, // Removed in FreeBSD 14 (git a6b55ee6be1) "IFF_KNOWSEPOCH" => true, @@ -2986,6 +2986,8 @@ fn test_freebsd(target: &str) { // `tcp_snd_wscale` and `tcp_rcv_wscale` are bitfields ("tcp_info", "tcp_snd_wscale") => true, ("tcp_info", "tcp_rcv_wscale") => true, + // mc_spare can change in size between OS releases. It's a spare field, after all. + ("__mcontext", "mc_spare") => true, _ => false, } diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index b010a1b30ee3..7c420d703cc0 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -4186,7 +4186,9 @@ pub const TDI_IWAIT: c_int = 0x0010; pub const P_ADVLOCK: c_int = 0x00000001; pub const P_CONTROLT: c_int = 0x00000002; pub const P_KPROC: c_int = 0x00000004; +#[deprecated(since = "1.0", note = "Replaced in FreeBSD 15 by P_IDLEPROC")] pub const P_UNUSED3: c_int = 0x00000008; +pub const P_IDLEPROC: c_int = 0x00000008; pub const P_PPWAIT: c_int = 0x00000010; pub const P_PROFIL: c_int = 0x00000020; pub const P_STOPPROF: c_int = 0x00000040;