From d6ea1f4bcd55d118c8ea48c5280699725a1d2049 Mon Sep 17 00:00:00 2001 From: Xuntao Chi Date: Tue, 26 May 2026 20:17:20 +0800 Subject: [PATCH 1/9] ctest: probe optional compiler flags --- ctest/src/generator.rs | 10 ++++++++++ ctest/src/runner.rs | 19 ++++++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/ctest/src/generator.rs b/ctest/src/generator.rs index b79d319fe950a..3a976ba7d3667 100644 --- a/ctest/src/generator.rs +++ b/ctest/src/generator.rs @@ -62,6 +62,7 @@ pub struct TestGenerator { pub(crate) includes: Vec, out_dir: Option, pub(crate) flags: Vec, + pub(crate) flags_if_supported: Vec, pub(crate) global_defines: Vec<(String, Option)>, cfg: Vec<(String, Option)>, mapped_names: Vec, @@ -670,6 +671,15 @@ impl TestGenerator { self } + /// Add a flag to the C compiler invocation if the compiler supports it. + /// + /// This is useful for warning suppressions that are only available on some + /// compiler families or versions. + pub fn flag_if_supported(&mut self, flag: &str) -> &mut Self { + self.flags_if_supported.push(flag.to_string()); + self + } + /// Set a `-D` flag for the C compiler being called. /// /// This can be used to define various global variables to configure how header diff --git a/ctest/src/runner.rs b/ctest/src/runner.rs index d55bd50bc7275..8953e95964146 100644 --- a/ctest/src/runner.rs +++ b/ctest/src/runner.rs @@ -38,6 +38,7 @@ pub fn generate_test( let mut cfg = cc::Build::new(); cfg.file(output_file_path.with_extension(generator.language.extension())); cfg.host(&host); + cfg.target(&target); if target.contains("msvc") { cfg.flag("/W3") @@ -63,10 +64,12 @@ pub fn generate_test( .flag("-Werror") .flag("-Wno-unused-parameter") .flag("-Wno-type-limits") - // allow taking address of packed struct members: - .flag("-Wno-address-of-packed-member") - .flag("-Wno-unknown-warning-option") - .flag("-Wno-deprecated-declarations"); // allow deprecated items + .flag("-Wno-deprecated-declarations") // allow deprecated items + // Probe support instead of assuming a compiler family. This keeps + // the suppression on newer GCC/Clang while avoiding regressions on + // older toolchains that reject these flags. + .flag_if_supported("-Wno-address-of-packed-member") + .flag_if_supported("-Wno-unknown-warning-option"); } for p in &generator.includes { @@ -77,6 +80,10 @@ pub fn generate_test( cfg.flag(flag); } + for flag in &generator.flags_if_supported { + cfg.flag_if_supported(flag); + } + for (k, v) in &generator.global_defines { cfg.define(k, v.as_ref().map(|s| &s[..])); } @@ -84,9 +91,7 @@ pub fn generate_test( cfg.cpp(matches!(generator.language, Language::CXX)); let stem: &str = output_file_path.file_stem().unwrap().to_str().unwrap(); - cfg.target(&target) - .out_dir(output_file_path.parent().unwrap()) - .compile(stem); + cfg.out_dir(output_file_path.parent().unwrap()).compile(stem); Ok(output_file_path) } From b9036cc0aa6f74d0a77fdb2d8f08d70de6573bdd Mon Sep 17 00:00:00 2001 From: Xuntao Chi Date: Tue, 26 May 2026 21:54:12 +0800 Subject: [PATCH 2/9] dragonfly: correct existing ABI definitions Fix DragonFly type aliases and struct layouts to match current headers, including regex offsets, ifaddrs, pthread barriers, process sizing fields, and mcontext alignment. --- src/unix/bsd/freebsdlike/dragonfly/mod.rs | 15 +++++++++------ src/unix/bsd/mod.rs | 5 ++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 386da7de3279d..d988c7db79b15 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -31,11 +31,11 @@ pub type cpu_set_t = cpumask_t; pub type register_t = c_long; pub type umtx_t = c_int; -pub type pthread_barrierattr_t = c_int; -pub type pthread_barrier_t = crate::uintptr_t; +pub type pthread_barrierattr_t = *mut __c_anonymous_pthread_barrierattr; +pub type pthread_barrier_t = *mut __c_anonymous_pthread_barrier; pub type pthread_spinlock_t = crate::uintptr_t; -pub type segsz_t = usize; +pub type segsz_t = isize; pub type vm_prot_t = u8; pub type vm_maptype_t = u8; @@ -50,6 +50,8 @@ pub type pmap = __c_anonymous_pmap; extern_ty! { pub enum sem {} + pub enum __c_anonymous_pthread_barrier {} + pub enum __c_anonymous_pthread_barrierattr {} } c_enum! { @@ -191,9 +193,9 @@ s! { pub ifm_msglen: c_ushort, pub ifm_version: c_uchar, pub ifm_type: c_uchar, - pub ifm_addrs: c_int, - pub ifm_flags: c_int, pub ifm_index: c_ushort, + pub ifm_flags: c_int, + pub ifm_addrs: c_int, pub ifm_data: if_data, } @@ -259,7 +261,7 @@ s! { pub cp_nice: u64, pub cp_sys: u64, pub cp_intr: u64, - pub cp_idel: u64, + pub cp_idle: u64, cp_unused01: Padding, cp_unused02: Padding, pub cp_sample_pc: u64, @@ -481,6 +483,7 @@ s! { __unused3: Padding<*mut c_void>, //actually a function pointer } + #[repr(align(64))] pub struct mcontext_t { pub mc_onstack: register_t, pub mc_rdi: register_t, diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index 74a6fa8142b27..0013a13f2c4a7 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -7,6 +7,9 @@ pub type socklen_t = u32; pub type sa_family_t = u8; pub type pthread_t = crate::uintptr_t; pub type nfds_t = c_uint; +#[cfg(target_os = "dragonfly")] +pub type regoff_t = c_int; +#[cfg(not(target_os = "dragonfly"))] pub type regoff_t = off_t; s! { @@ -57,7 +60,7 @@ s! { pub ifa_netmask: *mut crate::sockaddr, pub ifa_dstaddr: *mut crate::sockaddr, pub ifa_data: *mut c_void, - #[cfg(target_os = "netbsd")] + #[cfg(any(target_os = "dragonfly", target_os = "netbsd"))] pub ifa_addrflags: c_uint, } From fbaac0b54e753e3eda525ab54c5b4a3f8b30c3d5 Mon Sep 17 00:00:00 2001 From: Xuntao Chi Date: Tue, 26 May 2026 21:58:18 +0800 Subject: [PATCH 3/9] bsd: move target-specific regex and getrandom constants --- src/unix/bsd/apple/mod.rs | 6 ++++++ src/unix/bsd/freebsdlike/dragonfly/mod.rs | 10 ++++++++++ src/unix/bsd/freebsdlike/freebsd/mod.rs | 11 +++++++++++ src/unix/bsd/freebsdlike/mod.rs | 3 --- src/unix/bsd/mod.rs | 5 ----- src/unix/bsd/netbsdlike/mod.rs | 6 ++++++ 6 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 794a603ef782c..e4863ea5a1454 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -1821,6 +1821,12 @@ pub const ABMON_10: crate::nl_item = 42; pub const ABMON_11: crate::nl_item = 43; pub const ABMON_12: crate::nl_item = 44; +pub const REG_NOSUB: c_int = 0o0004; +pub const REG_NEWLINE: c_int = 0o0010; +pub const REG_PEND: c_int = 0o0040; +pub const REG_INVARG: c_int = 16; +pub const REG_BACKR: c_int = 0o02000; + pub const CLOCK_REALTIME: crate::clockid_t = 0; pub const CLOCK_MONOTONIC_RAW: crate::clockid_t = 4; pub const CLOCK_MONOTONIC_RAW_APPROX: crate::clockid_t = 5; diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index d988c7db79b15..4707c600b2756 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -701,6 +701,13 @@ pub const CPUCTL_CPUID_COUNT: c_int = 0xc0106307; pub const CPU_SETSIZE: size_t = size_of::() * 8; +pub const REG_NOSUB: c_int = 0x8; +pub const REG_NEWLINE: c_int = 0x4; +pub const REG_PEND: c_int = 0x80; +pub const REG_INVARG: c_int = 15; +pub const REG_BACKR: c_int = 0x8; +pub const REG_ILLSEQ: c_int = 16; + pub const EVFILT_READ: i16 = -1; pub const EVFILT_WRITE: i16 = -2; pub const EVFILT_AIO: i16 = -3; @@ -1075,6 +1082,9 @@ pub const _UTX_USERSIZE: usize = 32; pub const _UTX_IDSIZE: usize = 4; pub const _UTX_HOSTSIZE: usize = 256; +pub const GRND_NONBLOCK: c_uint = 0x2; +pub const GRND_RANDOM: c_uint = 0x1; + pub const LC_COLLATE_MASK: c_int = 1 << 0; pub const LC_CTYPE_MASK: c_int = 1 << 1; pub const LC_MONETARY_MASK: c_int = 1 << 2; diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 3a3f8076bb51e..65962a1d757d5 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -2079,6 +2079,17 @@ pub const POSIX_FADV_WILLNEED: c_int = 3; pub const POSIX_FADV_DONTNEED: c_int = 4; pub const POSIX_FADV_NOREUSE: c_int = 5; +pub const REG_NOSUB: c_int = 0o0004; +pub const REG_NEWLINE: c_int = 0o0010; +pub const REG_PEND: c_int = 0o0040; +pub const REG_INVARG: c_int = 16; +pub const REG_ILLSEQ: c_int = 17; +pub const REG_BACKR: c_int = 0o02000; + +// For getrandom() +pub const GRND_NONBLOCK: c_uint = 0x1; +pub const GRND_RANDOM: c_uint = 0x2; + pub const POLLINIGNEOF: c_short = 0x2000; pub const POLLRDHUP: c_short = 0x4000; diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index b8d9e779830d9..1bbdc29e76359 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -1402,7 +1402,6 @@ pub const TIME_WAIT: c_int = 4; pub const TIME_ERROR: c_int = 5; pub const REG_ENOSYS: c_int = -1; -pub const REG_ILLSEQ: c_int = 17; pub const IPC_PRIVATE: crate::key_t = 0; pub const IPC_CREAT: c_int = 0o1000; @@ -1446,8 +1445,6 @@ pub const RB_MUTE: c_int = 0x10000; pub const RB_SELFTEST: c_int = 0x20000; // For getrandom() -pub const GRND_NONBLOCK: c_uint = 0x1; -pub const GRND_RANDOM: c_uint = 0x2; pub const GRND_INSECURE: c_uint = 0x4; pub const POSIX_SPAWN_RESETIDS: c_short = 0x01; diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index 0013a13f2c4a7..6035464f0d795 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -409,10 +409,7 @@ cfg_if! { pub const REG_BASIC: c_int = 0o0000; pub const REG_EXTENDED: c_int = 0o0001; pub const REG_ICASE: c_int = 0o0002; -pub const REG_NOSUB: c_int = 0o0004; -pub const REG_NEWLINE: c_int = 0o0010; pub const REG_NOSPEC: c_int = 0o0020; -pub const REG_PEND: c_int = 0o0040; pub const REG_DUMP: c_int = 0o0200; pub const REG_NOMATCH: c_int = 1; @@ -430,7 +427,6 @@ pub const REG_ESPACE: c_int = 12; pub const REG_BADRPT: c_int = 13; pub const REG_EMPTY: c_int = 14; pub const REG_ASSERT: c_int = 15; -pub const REG_INVARG: c_int = 16; pub const REG_ATOI: c_int = 255; pub const REG_ITOA: c_int = 0o0400; @@ -439,7 +435,6 @@ pub const REG_NOTEOL: c_int = 0o00002; pub const REG_STARTEND: c_int = 0o00004; pub const REG_TRACE: c_int = 0o00400; pub const REG_LARGE: c_int = 0o01000; -pub const REG_BACKR: c_int = 0o02000; pub const TIOCCBRK: c_uint = 0x2000747a; pub const TIOCSBRK: c_uint = 0x2000747b; diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs index e4d4e68ad1fb7..b268b5f90291a 100644 --- a/src/unix/bsd/netbsdlike/mod.rs +++ b/src/unix/bsd/netbsdlike/mod.rs @@ -133,6 +133,12 @@ pub const CRNCYSTR: crate::nl_item = 50; pub const CODESET: crate::nl_item = 51; +pub const REG_NOSUB: c_int = 0o0004; +pub const REG_NEWLINE: c_int = 0o0010; +pub const REG_PEND: c_int = 0o0040; +pub const REG_INVARG: c_int = 16; +pub const REG_BACKR: c_int = 0o02000; + pub const EXIT_FAILURE: c_int = 1; pub const EXIT_SUCCESS: c_int = 0; pub const RAND_MAX: c_int = 2147483647; From 22a2dffd7af451cf223fef52aa533cfd892368c7 Mon Sep 17 00:00:00 2001 From: Xuntao Chi Date: Tue, 26 May 2026 22:00:30 +0800 Subject: [PATCH 4/9] dragonfly: add compatibility aliases for renamed constants --- src/unix/bsd/freebsdlike/dragonfly/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 4707c600b2756..0581db9ed11be 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -691,7 +691,9 @@ pub const CTL_P1003_1B_SIGQUEUE_MAX: c_int = 24; pub const CTL_P1003_1B_TIMER_MAX: c_int = 25; pub const CTL_P1003_1B_MAXID: c_int = 26; -pub const CPUCTL_RSMSR: c_int = 0xc0106301; +pub const CPUCTL_RDMSR: c_int = 0xc0106301; +#[deprecated(since = "1.0", note = "Replaced on DragonFly by CPUCTL_RDMSR")] +pub const CPUCTL_RSMSR: c_int = CPUCTL_RDMSR; pub const CPUCTL_WRMSR: c_int = 0xc0106302; pub const CPUCTL_CPUID: c_int = 0xc0106303; pub const CPUCTL_UPDATE: c_int = 0xc0106304; @@ -1076,7 +1078,9 @@ pub const DOWNTIME: c_short = 11; // utmpx database types pub const UTX_DB_UTMPX: c_uint = 0; pub const UTX_DB_WTMPX: c_uint = 1; -pub const UTX_DB_LASTLOG: c_uint = 2; +pub const UTX_DB_LASTLOGX: c_uint = 2; +#[deprecated(since = "1.0", note = "Replaced on DragonFly by UTX_DB_LASTLOGX")] +pub const UTX_DB_LASTLOG: c_uint = UTX_DB_LASTLOGX; pub const _UTX_LINESIZE: usize = 32; pub const _UTX_USERSIZE: usize = 32; pub const _UTX_IDSIZE: usize = 4; From 594124bc850f4ee74b2fe67872d5da8bce0b4e71 Mon Sep 17 00:00:00 2001 From: Xuntao Chi Date: Tue, 26 May 2026 22:01:06 +0800 Subject: [PATCH 5/9] dragonfly: correct existing constant values --- src/unix/bsd/freebsdlike/dragonfly/mod.rs | 8 ++++---- src/unix/mod.rs | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 0581db9ed11be..2ca517e22d573 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -695,11 +695,11 @@ pub const CPUCTL_RDMSR: c_int = 0xc0106301; #[deprecated(since = "1.0", note = "Replaced on DragonFly by CPUCTL_RDMSR")] pub const CPUCTL_RSMSR: c_int = CPUCTL_RDMSR; pub const CPUCTL_WRMSR: c_int = 0xc0106302; -pub const CPUCTL_CPUID: c_int = 0xc0106303; +pub const CPUCTL_CPUID: c_int = 0xc0146303; pub const CPUCTL_UPDATE: c_int = 0xc0106304; pub const CPUCTL_MSRSBIT: c_int = 0xc0106305; pub const CPUCTL_MSRCBIT: c_int = 0xc0106306; -pub const CPUCTL_CPUID_COUNT: c_int = 0xc0106307; +pub const CPUCTL_CPUID_COUNT: c_int = 0xc0186307; pub const CPU_SETSIZE: size_t = size_of::() * 8; @@ -733,8 +733,8 @@ pub const EV_NODATA: u16 = 0x1000; pub const EV_FLAG1: u16 = 0x2000; pub const EV_ERROR: u16 = 0x4000; pub const EV_EOF: u16 = 0x8000; -pub const EV_HUP: u16 = 0x8000; -pub const EV_SYSFLAGS: u16 = 0xf000; +pub const EV_HUP: u16 = 0x0800; +pub const EV_SYSFLAGS: u16 = 0xF800; pub const FIODNAME: c_ulong = 0x80106678; diff --git a/src/unix/mod.rs b/src/unix/mod.rs index ef83c7c9a5532..ae5e5b58e2572 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -395,6 +395,7 @@ cfg_if! { if #[cfg(any( target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "android", target_os = "openbsd", target_os = "cygwin", @@ -410,6 +411,7 @@ cfg_if! { if #[cfg(any( target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "android", target_os = "openbsd", target_os = "netbsd", From c723400a4db8291b032cfda5322c252dbd6903ed Mon Sep 17 00:00:00 2001 From: Xuntao Chi Date: Tue, 26 May 2026 22:02:11 +0800 Subject: [PATCH 6/9] dragonfly: add missing constants --- src/unix/bsd/freebsdlike/dragonfly/mod.rs | 38 +++++++++++++++++++++-- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 2ca517e22d573..17887368a4eb4 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -543,10 +543,24 @@ pub const MADV_INVAL: c_int = 10; pub const MADV_SETMAP: c_int = 11; pub const O_CLOEXEC: c_int = 0x00020000; pub const O_DIRECTORY: c_int = 0x08000000; +pub const O_FBLOCKING: c_int = 0x00040000; +pub const O_FNONBLOCKING: c_int = 0x00080000; +pub const O_FAPPEND: c_int = 0x00100000; +pub const O_FOFFSET: c_int = 0x00200000; +pub const O_FSYNCWRITE: c_int = 0x00400000; +pub const O_FASYNCWRITE: c_int = 0x00800000; +pub const O_FMASK: c_int = + O_FBLOCKING | O_FNONBLOCKING | O_FAPPEND | O_FOFFSET | O_FSYNCWRITE | O_FASYNCWRITE; pub const F_GETLK: c_int = 7; pub const F_SETLK: c_int = 8; pub const F_SETLKW: c_int = 9; pub const F_GETPATH: c_int = 19; +pub const POSIX_FADV_NORMAL: c_int = 0; +pub const POSIX_FADV_SEQUENTIAL: c_int = 1; +pub const POSIX_FADV_RANDOM: c_int = 2; +pub const POSIX_FADV_WILLNEED: c_int = 3; +pub const POSIX_FADV_DONTNEED: c_int = 4; +pub const POSIX_FADV_NOREUSE: c_int = 5; pub const ENOMEDIUM: c_int = 93; pub const ENOTRECOVERABLE: c_int = 94; pub const EOWNERDEAD: c_int = 95; @@ -607,7 +621,8 @@ pub const KERN_USRSTACK: c_int = 33; pub const KERN_LOGSIGEXIT: c_int = 34; pub const KERN_IOV_MAX: c_int = 35; pub const KERN_MAXPOSIXLOCKSPERUID: c_int = 36; -pub const KERN_MAXID: c_int = 37; +pub const KERN_STATIC_TLS_EXTRA: c_int = 37; +pub const KERN_MAXID: c_int = 38; pub const KERN_PROC_ALL: c_int = 0; pub const KERN_PROC_PID: c_int = 1; pub const KERN_PROC_PGRP: c_int = 2; @@ -787,6 +802,7 @@ pub const IFF_NOARP: c_int = 0x80; // no address resolution protocol pub const IFF_PROMISC: c_int = 0x100; // receive all packets pub const IFF_ALLMULTI: c_int = 0x200; // receive all multicast packets pub const IFF_OACTIVE_COMPAT: c_int = 0x400; // was transmission in progress +pub const IFF_OACTIVE: c_int = IFF_OACTIVE_COMPAT; pub const IFF_SIMPLEX: c_int = 0x800; // can't hear own transmissions pub const IFF_LINK0: c_int = 0x1000; // per link layer defined bit pub const IFF_LINK1: c_int = 0x2000; // per link layer defined bit @@ -1034,8 +1050,10 @@ pub const TCP_FASTKEEP: c_int = 128; pub const AF_BLUETOOTH: c_int = 33; pub const AF_MPLS: c_int = 34; pub const AF_IEEE80211: c_int = 35; +pub const AF_ARP: c_int = 36; pub const PF_BLUETOOTH: c_int = AF_BLUETOOTH; +pub const PF_ARP: c_int = AF_ARP; pub const NET_RT_DUMP: c_int = 1; pub const NET_RT_FLAGS: c_int = 2; @@ -1086,9 +1104,23 @@ pub const _UTX_USERSIZE: usize = 32; pub const _UTX_IDSIZE: usize = 4; pub const _UTX_HOSTSIZE: usize = 256; +pub const EXTATTR_NAMESPACE_EMPTY: c_int = 0; +pub const EXTATTR_NAMESPACE_USER: c_int = 1; +pub const EXTATTR_NAMESPACE_SYSTEM: c_int = 2; + pub const GRND_NONBLOCK: c_uint = 0x2; pub const GRND_RANDOM: c_uint = 0x1; +pub const NI_NOFQDN: c_int = 0x00000001; +pub const NI_NUMERICHOST: c_int = 0x00000002; +pub const NI_NAMEREQD: c_int = 0x00000004; +pub const NI_NUMERICSERV: c_int = 0x00000008; +pub const NI_DGRAM: c_int = 0x00000010; +pub const NI_NUMERICSCOPE: c_int = 0x00000040; + +pub const B460800: crate::speed_t = 460800; +pub const B921600: crate::speed_t = 921600; + pub const LC_COLLATE_MASK: c_int = 1 << 0; pub const LC_CTYPE_MASK: c_int = 1 << 1; pub const LC_MONETARY_MASK: c_int = 1 << 2; @@ -1112,6 +1144,8 @@ pub const TIOCMODG: c_ulong = 0x40047403; pub const TIOCMODS: c_ulong = 0x80047404; pub const TIOCREMOTE: c_ulong = 0x80047469; pub const TIOCTIMESTAMP: c_ulong = 0x40107459; +pub const BIOCSRTIMEOUT: c_ulong = 0x8010426d; +pub const BIOCGRTIMEOUT: c_ulong = 0x4010426e; // Constants used by "at" family of system calls. pub const AT_FDCWD: c_int = 0xFFFAFDCD; // invalid file descriptor @@ -1125,8 +1159,6 @@ pub const VCHECKPT: usize = 19; pub const _PC_2_SYMLINKS: c_int = 22; pub const _PC_TIMESTAMP_RESOLUTION: c_int = 23; -pub const _CS_PATH: c_int = 1; - pub const _SC_V7_ILP32_OFF32: c_int = 122; pub const _SC_V7_ILP32_OFFBIG: c_int = 123; pub const _SC_V7_LP64_OFF64: c_int = 124; From 0b84f93312081f02ed4719631c7e80091eb17eb5 Mon Sep 17 00:00:00 2001 From: Xuntao Chi Date: Tue, 26 May 2026 22:02:30 +0800 Subject: [PATCH 7/9] dragonfly: add missing libc functions --- src/unix/bsd/freebsdlike/dragonfly/mod.rs | 47 +++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 17887368a4eb4..ef9da156cbccc 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -1327,6 +1327,7 @@ extern "C" { pub fn statfs(path: *const c_char, buf: *mut statfs) -> c_int; pub fn fstatfs(fd: c_int, buf: *mut statfs) -> c_int; + pub fn fdatasync(fd: c_int) -> c_int; pub fn uname(buf: *mut crate::utsname) -> c_int; pub fn memmem( haystack: *const c_void, @@ -1334,12 +1335,36 @@ extern "C" { needle: *const c_void, needlelen: size_t, ) -> *mut c_void; + pub fn dlvsym( + handle: *mut c_void, + symbol: *const c_char, + version: *const c_char, + ) -> *mut c_void; + pub fn reallocarray(ptr: *mut c_void, nmemb: size_t, size: size_t) -> *mut c_void; + pub fn qsort_r( + base: *mut c_void, + num: size_t, + size: size_t, + arg: *mut c_void, + compar: Option c_int>, + ); pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: c_int) -> c_int; pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> c_int; pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> c_int; pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> c_int; pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> c_int; + pub fn pthread_getaffinity_np( + td: crate::pthread_t, + cpusetsize: size_t, + cpusetp: *mut cpuset_t, + ) -> c_int; + pub fn pthread_setaffinity_np( + td: crate::pthread_t, + cpusetsize: size_t, + cpusetp: *const cpuset_t, + ) -> c_int; + pub fn sched_getaffinity(pid: crate::pid_t, cpusetsize: size_t, mask: *mut cpu_set_t) -> c_int; pub fn sched_setaffinity( pid: crate::pid_t, @@ -1349,6 +1374,7 @@ extern "C" { pub fn sched_getcpu() -> c_int; pub fn setproctitle(fmt: *const c_char, ...); + pub fn ftok(path: *const c_char, id: c_int) -> crate::key_t; pub fn shmget(key: crate::key_t, size: size_t, shmflg: c_int) -> c_int; pub fn shmat(shmid: c_int, shmaddr: *const c_void, shmflg: c_int) -> *mut c_void; pub fn shmdt(shmaddr: *const c_void) -> c_int; @@ -1381,6 +1407,27 @@ extern "C" { flags: c_int, ) -> c_int; + pub fn extattr_delete_file( + path: *const c_char, + attrnamespace: c_int, + attrname: *const c_char, + ) -> c_int; + pub fn extattr_get_file( + path: *const c_char, + attrnamespace: c_int, + attrname: *const c_char, + data: *mut c_void, + nbytes: size_t, + ) -> ssize_t; + pub fn extattr_set_file( + path: *const c_char, + attrnamespace: c_int, + attrname: *const c_char, + data: *const c_void, + nbytes: size_t, + ) -> c_int; + + pub fn dup3(src: c_int, dst: c_int, flags: c_int) -> c_int; pub fn closefrom(lowfd: c_int) -> c_int; } From cc8bcd833a29f2138266c9f3e6ffb8379522ecdd Mon Sep 17 00:00:00 2001 From: Xuntao Chi Date: Tue, 26 May 2026 22:02:57 +0800 Subject: [PATCH 8/9] libc-test: expand DragonFly coverage --- libc-test/build.rs | 149 ++++++++++++++++++++++++++++++--- libc-test/semver/dragonfly.txt | 57 ++++++++++++- 2 files changed, 194 insertions(+), 12 deletions(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index 6879015d217fb..d30bcb8943d27 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -36,6 +36,7 @@ fn do_cc() { || target.contains("android") || target.contains("emscripten") || target.contains("fuchsia") + || target.contains("dragonfly") || target.contains("bsd") || target.contains("cygwin") { @@ -1504,7 +1505,17 @@ fn test_netbsd(target: &str) { fn test_dragonflybsd(target: &str) { assert!(target.contains("dragonfly")); let mut cfg = ctest_cfg(); - cfg.flag("-Wno-deprecated-declarations"); + cfg.flag("-Wno-deprecated-declarations") + .flag_if_supported("-Wno-address-of-packed-member") + .flag_if_supported("-Wno-unknown-warning-option"); + + let dragonfly_version = if let Ok(version) = env::var("RUST_LIBC_UNSTABLE_DRAGONFLY_VERSION") { + let vers = parse_dragonfly_version(&version).unwrap(); + println!("cargo:warning=setting DragonFly version to {vers}"); + vers + } else { + which_dragonfly().unwrap_or(600_200) + }; headers!( cfg, @@ -1547,6 +1558,7 @@ fn test_dragonflybsd(target: &str) { "sched.h", "semaphore.h", "signal.h", + "spawn.h", "stddef.h", "stdint.h", "stdio.h", @@ -1557,6 +1569,7 @@ fn test_dragonflybsd(target: &str) { "sys/ioctl.h", "sys/cpuctl.h", "sys/eui64.h", + "sys/extattr.h", "sys/ipc.h", "sys/kinfo.h", "sys/ktrace.h", @@ -1566,6 +1579,7 @@ fn test_dragonflybsd(target: &str) { "sys/procctl.h", "sys/ptrace.h", "sys/reboot.h", + "sys/random.h", "sys/resource.h", "sys/rtprio.h", "sys/sched.h", @@ -1591,8 +1605,8 @@ fn test_dragonflybsd(target: &str) { "util.h", "utime.h", "utmpx.h", + "vm/vm.h", "vfs/ufs/quota.h", - "vm/vm_map.h", "wchar.h", "iconv.h", ); @@ -1613,6 +1627,12 @@ fn test_dragonflybsd(target: &str) { match ty { // FIXME(dragonflybsd): OSX calls this something else "sighandler_t" => Some("sig_t".to_string()), + "lwpstat" => Some("enum lwpstat".to_string()), + "procstat" => Some("enum procstat".to_string()), + "vm_map_t" => Some("struct vm_map *".to_string()), + "vm_map_entry_t" => Some("struct vm_map_entry *".to_string()), + "vm_eflags_t" => Some("unsigned int".to_string()), + "vm_subsys_t" => Some("int".to_string()), _ => None, } }); @@ -1663,11 +1683,34 @@ fn test_dragonflybsd(target: &str) { _ => false, } }); + cfg.alias_is_c_enum(move |e| matches!(e, "lwpstat" | "procstat")); cfg.skip_const(move |constant| { match constant.ident() { "SIG_DFL" | "SIG_ERR" | "SIG_IGN" => true, // sighandler_t weirdness + // Kernel-only symbols in DragonFly headers. + "DTYPE_VNODE" | "DTYPE_SOCKET" | "DTYPE_PIPE" | "DTYPE_FIFO" | "DTYPE_KQUEUE" + | "DTYPE_CRYPTO" | "DTYPE_MQUEUE" | "DTYPE_DMABUF" => true, + + // Not exposed by current DragonFly userland headers. + "REG_DUMP" | "REG_ASSERT" | "REG_ATOI" | "REG_ITOA" | "REG_TRACE" | "REG_LARGE" + | "IP_ADD_SOURCE_MEMBERSHIP" | "IP_DROP_SOURCE_MEMBERSHIP" | "IP_BLOCK_SOURCE" + | "IP_UNBLOCK_SOURCE" | "MAP_RENAME" | "MAP_NORESERVE" | "CTL_UNSPEC" + | "KERN_PROF" | "CTL_P1003_1B_UNUSED1" | "CTL_P1003_1B_SEM_VALUE_MAX" + | "DOWNTIME" | "SF_CACHE" => true, + + // libc exposes the 6.0-compatible value for this version-dependent mask. + "KERN_PROC_FLAGMASK" => true, + + // Renamed in current DragonFly headers. + "CPUCTL_RSMSR" | "UTX_DB_LASTLOG" => true, + + // Introduced after DragonFly 5.8. + "AF_ARP" | "PF_ARP" | "IP_SENDSRCADDR" | "F_GETPATH" | "ENOTRECOVERABLE" | "EOWNERDEAD" + | "SO_PASSCRED" | "PROC_PDEATHSIG_CTL" | "PROC_PDEATHSIG_STATUS" + | "KERN_STATIC_TLS_EXTRA" | "KERN_MAXID" if dragonfly_version < 600_000 => true, + // weird signed extension or something like that? "MS_NOUSER" => true, "MS_RMT_MASK" => true, // updated in glibc 2.22 and musl 1.1.13 @@ -1688,18 +1731,40 @@ fn test_dragonflybsd(target: &str) { "prlimit" | "prlimit64" // non-int in 2nd arg => true, + // These are exposed unconditionally by libc, but older DragonFly + // headers cannot validate them. + "clock_nanosleep" | "fexecve" | "pthread_getname_np" | "pthread_setname_np" + if dragonfly_version < 600_000 => true, + "pthread_getaffinity_np" | "pthread_setaffinity_np" if dragonfly_version < 600_000 => { + true + }, + "fdatasync" | "getentropy" | "posix_fallocate" if dragonfly_version < 600_200 => true, + "malloc_usable_size" if dragonfly_version < 600_400 => true, _ => false, } }); - cfg.skip_struct_field_type(move |struct_, field| { - match (struct_.ident(), field.ident()) { - // This is a weird union, don't check the type. - ("ifaddrs", "ifa_ifu") => true, - // sighandler_t type is super weird - ("sigaction", "sa_sigaction") => true, - // aio_buf is "volatile void*" and Rust doesn't understand volatile - ("aiocb", "aio_buf") => true, + cfg.skip_alias(move |ty| { + match ty.ident() { + // sighandler_t is crazy across platforms + "sighandler_t" => true, + // Kernel-only or opaque types in userland. + "kvm_t" | "pmap" | "umtx_t" | "Elf32_Lword" => true, + _ => false, + } + }); + + cfg.skip_struct(move |struct_| { + match struct_.ident() { + // FIXME(dragonflybsd): These are tested as part of the linux_fcntl tests since + // there are header conflicts when including them with all the other + // structs. + "termios2" => true, + + // Not available as userland-complete structs on DragonFly. + "ip_mreq_source" | "vm_map_entry" | "vmspace" => true, + "ip_mreqn" if dragonfly_version < 600_000 => true, + _ => false, } }); @@ -1711,13 +1776,77 @@ fn test_dragonflybsd(target: &str) { ("siginfo_t", "_pad") => true, // sigev_notify_thread_id is actually part of a sigev_un union ("sigevent", "sigev_notify_thread_id") => true, + // Current DragonFly headers use these names instead. + ("kinfo_cputime", "cp_idel") => true, + // conflicting with `p_type` macro from . + ("Elf32_Phdr", "p_type") | ("Elf64_Phdr", "p_type") => true, + ("kinfo_lwp", "kl_stat") | ("kinfo_proc", "kp_stat") => true, + ("utmpx", "ut_type") => true, + ("mcontext_t", "mc_fpregs") => true, _ => false, } }); + cfg.skip_struct_field_type(move |struct_, field| { + match (struct_.ident(), field.ident()) { + // This is a weird union, don't check the type. + ("ifaddrs", "ifa_ifu") => true, + // sighandler_t type is super weird + ("sigaction", "sa_sigaction") => true, + // aio_buf is "volatile void*" and Rust doesn't understand volatile + ("aiocb", "aio_buf") => true, + _ => false, + } + }); + + cfg.skip_roundtrip(move |ty| { + matches!( + ty, + "kvm_t" + | "posix_spawnattr_t" + | "posix_spawn_file_actions_t" + | "umtx_t" + | "pmap" + | "ip_mreq_source" + ) + }); + ctest::generate_test(&mut cfg, "../src/lib.rs", "ctest_output.rs").unwrap(); } +fn parse_dragonfly_version(version: &str) -> Option { + let version = version.trim(); + + if let Ok(version) = version.parse::() { + // DragonFly's __DragonFly_version uses major * 100_000 + minor * 100. + // Accept compact test override spellings like 58, 60, 62, and 602. + return Some(match version { + 0..=9 => version * 100_000, + 10..=99 => (version / 10) * 100_000 + (version % 10) * 100, + 100..=999 => (version / 100) * 100_000 + (version % 100) * 100, + _ => version, + }); + } + + let mut pieces = version.split(['.', '-']); + let major = pieces.next()?.parse::().ok()?; + let minor = pieces.next()?.parse::().ok()?; + Some(major * 100_000 + minor * 100) +} + +fn which_dragonfly() -> Option { + if env::var("CARGO_CFG_TARGET_OS").ok()?.as_str() != "dragonfly" { + return None; + } + + if try_command_output("uname", &["-s"])?.trim() != "DragonFly" { + return None; + } + + let stdout = try_command_output("uname", &["-r"])?; + parse_dragonfly_version(stdout.trim()) +} + fn test_wasi(target: &str) { assert!(target.contains("wasi")); let p2 = target.contains("wasip2"); diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt index 0b158da70a17a..c20f897b28488 100644 --- a/libc-test/semver/dragonfly.txt +++ b/libc-test/semver/dragonfly.txt @@ -19,6 +19,7 @@ ABMON_8 ABMON_9 ACCOUNTING AF_APPLETALK +AF_ARP AF_ATM AF_BLUETOOTH AF_CCITT @@ -52,6 +53,13 @@ AIO_ALLDONE AIO_CANCELED AIO_LISTIO_MAX AIO_NOTCANCELED +AI_ADDRCONFIG +AI_ALL +AI_CANONNAME +AI_NUMERICHOST +AI_NUMERICSERV +AI_PASSIVE +AI_V4MAPPED ALTMON_1 ALTMON_10 ALTMON_11 @@ -80,8 +88,10 @@ AT_SYMLINK_FOLLOW AT_SYMLINK_NOFOLLOW B14400 B28800 +B460800 B7200 B76800 +B921600 BIOCFLUSH BIOCGBLEN BIOCGDLT @@ -146,6 +156,7 @@ CPUCTL_CPUID CPUCTL_CPUID_COUNT CPUCTL_MSRCBIT CPUCTL_MSRSBIT +CPUCTL_RDMSR CPUCTL_RSMSR CPUCTL_UPDATE CPUCTL_WRMSR @@ -277,6 +288,9 @@ EV_SYSFLAGS EXTA EXTB EXTPROC +EXTATTR_NAMESPACE_EMPTY +EXTATTR_NAMESPACE_SYSTEM +EXTATTR_NAMESPACE_USER Elf32_Addr Elf32_Half Elf32_Lword @@ -356,6 +370,7 @@ IFF_MONITOR IFF_MULTICAST IFF_NOARP IFF_NPOLLING +IFF_OACTIVE IFF_OACTIVE_COMPAT IFF_POINTOPOINT IFF_POLLING_COMPAT @@ -560,6 +575,7 @@ KERN_PROF KERN_PS_STRINGS KERN_SAVED_IDS KERN_SECURELVL +KERN_STATIC_TLS_EXTRA KERN_UPDATEINTERVAL KERN_USRSTACK KERN_VERSION @@ -685,6 +701,12 @@ NET_RT_FLAGS NET_RT_IFLIST NET_RT_MAXID NEW_TIME +NI_DGRAM +NI_NAMEREQD +NI_NOFQDN +NI_NUMERICHOST +NI_NUMERICSCOPE +NI_NUMERICSERV NOEXPR NOKERNINFO NOSTR @@ -719,13 +741,21 @@ OXTABS O_ASYNC O_DIRECT O_EXLOCK +O_FAPPEND +O_FASYNCWRITE +O_FBLOCKING +O_FMASK +O_FNONBLOCKING +O_FOFFSET O_FSYNC +O_FSYNCWRITE O_NDELAY O_NOCTTY O_SHLOCK O_SYNC PENDIN PF_APPLETALK +PF_ARP PF_ATM PF_BLUETOOTH PF_CCITT @@ -767,6 +797,12 @@ POLLRDNORM POLLSTANDARD POLLWRBAND POLLWRNORM +POSIX_FADV_DONTNEED +POSIX_FADV_NOREUSE +POSIX_FADV_NORMAL +POSIX_FADV_RANDOM +POSIX_FADV_SEQUENTIAL +POSIX_FADV_WILLNEED POSIX_MADV_DONTNEED POSIX_MADV_NORMAL POSIX_MADV_RANDOM @@ -968,6 +1004,7 @@ SO_ACCEPTFILTER SO_CPUHINT SO_NOSIGPIPE SO_PASSCRED +SO_REUSEPORT SO_SNDSPACE SO_TIMESTAMP SO_USELOOPBACK @@ -1112,6 +1149,7 @@ USER_TZNAME_MAX UTIME_NOW UTIME_OMIT UTX_DB_LASTLOG +UTX_DB_LASTLOGX UTX_DB_UTMPX UTX_DB_WTMPX VCHECKPT @@ -1321,6 +1359,7 @@ dl_iterate_phdr dl_phdr_info dlvsym drand48 +dup3 duplocale eaccess endgrent @@ -1336,9 +1375,13 @@ exect execvP exit_status explicit_bzero +extattr_delete_file +extattr_get_file +extattr_set_file faccessat fchdir fchflags +fdatasync fdopendir fexecve fmemopen @@ -1349,6 +1392,7 @@ freelocale freezero fsid_t fstatfs +ftok futimes getdomainname getdtablesize @@ -1404,8 +1448,10 @@ if_nameindex ifaddrs in6_pktinfo initgroups +ipc_perm issetugid jrand48 +key_t kevent killpg kinfo_cputime @@ -1424,7 +1470,7 @@ kvm_vm_map_entry_first kvm_vm_map_entry_next kvm_write labs -lastlog +lastlogx lchflags lcong48 lio_listio @@ -1528,8 +1574,10 @@ pthread_condattr_getpshared pthread_condattr_setclock pthread_condattr_setpshared pthread_get_name_np +pthread_getaffinity_np pthread_getcpuclockid pthread_getname_np +pthread_getschedparam pthread_kill pthread_main_np pthread_mutex_timedlock @@ -1538,7 +1586,9 @@ pthread_mutexattr_setpshared pthread_rwlockattr_getpshared pthread_rwlockattr_setpshared pthread_set_name_np +pthread_setaffinity_np pthread_setname_np +pthread_setschedparam pthread_spin_destroy pthread_spin_init pthread_spin_lock @@ -1550,10 +1600,12 @@ ptrace_io_desc pututxline pwritev qsort +qsort_r querylocale rand readdir_r readlinkat +reallocarray reallocf recvmsg regcomp @@ -1605,6 +1657,7 @@ setutxent sf_hdtr shmat shmctl +shmid_ds shmdt shmget sigaltstack @@ -1640,7 +1693,7 @@ ucontext_t umtx_sleep umtx_wakeup unmount -updatelastlogx +updlastlogx updwtmpx useconds_t uselocale From ef2e8b4a5e25e553c889dfecf338d7f1dc375ccd Mon Sep 17 00:00:00 2001 From: Xuntao Chi Date: Wed, 27 May 2026 00:36:48 +0800 Subject: [PATCH 9/9] style: fix DragonFly CI checks --- ctest/src/runner.rs | 3 ++- libc-test/build.rs | 41 +++++++++++++++++++++++++++------- libc-test/semver/dragonfly.txt | 8 +++---- 3 files changed, 39 insertions(+), 13 deletions(-) diff --git a/ctest/src/runner.rs b/ctest/src/runner.rs index 8953e95964146..26c9d82cb2d38 100644 --- a/ctest/src/runner.rs +++ b/ctest/src/runner.rs @@ -91,7 +91,8 @@ pub fn generate_test( cfg.cpp(matches!(generator.language, Language::CXX)); let stem: &str = output_file_path.file_stem().unwrap().to_str().unwrap(); - cfg.out_dir(output_file_path.parent().unwrap()).compile(stem); + cfg.out_dir(output_file_path.parent().unwrap()) + .compile(stem); Ok(output_file_path) } diff --git a/libc-test/build.rs b/libc-test/build.rs index d30bcb8943d27..255d53b4136fd 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -1694,11 +1694,24 @@ fn test_dragonflybsd(target: &str) { | "DTYPE_CRYPTO" | "DTYPE_MQUEUE" | "DTYPE_DMABUF" => true, // Not exposed by current DragonFly userland headers. - "REG_DUMP" | "REG_ASSERT" | "REG_ATOI" | "REG_ITOA" | "REG_TRACE" | "REG_LARGE" - | "IP_ADD_SOURCE_MEMBERSHIP" | "IP_DROP_SOURCE_MEMBERSHIP" | "IP_BLOCK_SOURCE" - | "IP_UNBLOCK_SOURCE" | "MAP_RENAME" | "MAP_NORESERVE" | "CTL_UNSPEC" - | "KERN_PROF" | "CTL_P1003_1B_UNUSED1" | "CTL_P1003_1B_SEM_VALUE_MAX" - | "DOWNTIME" | "SF_CACHE" => true, + "REG_DUMP" + | "REG_ASSERT" + | "REG_ATOI" + | "REG_ITOA" + | "REG_TRACE" + | "REG_LARGE" + | "IP_ADD_SOURCE_MEMBERSHIP" + | "IP_DROP_SOURCE_MEMBERSHIP" + | "IP_BLOCK_SOURCE" + | "IP_UNBLOCK_SOURCE" + | "MAP_RENAME" + | "MAP_NORESERVE" + | "CTL_UNSPEC" + | "KERN_PROF" + | "CTL_P1003_1B_UNUSED1" + | "CTL_P1003_1B_SEM_VALUE_MAX" + | "DOWNTIME" + | "SF_CACHE" => true, // libc exposes the 6.0-compatible value for this version-dependent mask. "KERN_PROC_FLAGMASK" => true, @@ -1707,9 +1720,21 @@ fn test_dragonflybsd(target: &str) { "CPUCTL_RSMSR" | "UTX_DB_LASTLOG" => true, // Introduced after DragonFly 5.8. - "AF_ARP" | "PF_ARP" | "IP_SENDSRCADDR" | "F_GETPATH" | "ENOTRECOVERABLE" | "EOWNERDEAD" - | "SO_PASSCRED" | "PROC_PDEATHSIG_CTL" | "PROC_PDEATHSIG_STATUS" - | "KERN_STATIC_TLS_EXTRA" | "KERN_MAXID" if dragonfly_version < 600_000 => true, + "AF_ARP" + | "PF_ARP" + | "IP_SENDSRCADDR" + | "F_GETPATH" + | "ENOTRECOVERABLE" + | "EOWNERDEAD" + | "SO_PASSCRED" + | "PROC_PDEATHSIG_CTL" + | "PROC_PDEATHSIG_STATUS" + | "KERN_STATIC_TLS_EXTRA" + | "KERN_MAXID" + if dragonfly_version < 600_000 => + { + true + } // weird signed extension or something like that? "MS_NOUSER" => true, diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt index c20f897b28488..b9fe580cea0ed 100644 --- a/libc-test/semver/dragonfly.txt +++ b/libc-test/semver/dragonfly.txt @@ -286,11 +286,11 @@ EV_ONESHOT EV_RECEIPT EV_SYSFLAGS EXTA -EXTB -EXTPROC EXTATTR_NAMESPACE_EMPTY EXTATTR_NAMESPACE_SYSTEM EXTATTR_NAMESPACE_USER +EXTB +EXTPROC Elf32_Addr Elf32_Half Elf32_Lword @@ -1451,8 +1451,8 @@ initgroups ipc_perm issetugid jrand48 -key_t kevent +key_t killpg kinfo_cputime kinfo_file @@ -1657,9 +1657,9 @@ setutxent sf_hdtr shmat shmctl -shmid_ds shmdt shmget +shmid_ds sigaltstack sigevent siginfo_t