@@ -3935,8 +3935,14 @@ fn test_linux(target: &str) {
39353935 // FIXME(linux): Requires >= 6.12 kernel headers.
39363936 "mnt_ns_info" => true ,
39373937
3938- // Struct has changed for new musl versions
3939- "tcp_info" if old_musl => true ,
3938+ // FIXME(musl): Struct has changed for new musl versions
3939+ "tcp_info" if musl => true ,
3940+
3941+ // FIXME(musl): Supported in new musl but we don't have a new enough version in CI.
3942+ "statx" | "statx_timestamp" if musl => true ,
3943+
3944+ // FIXME(musl): New fields in newer versions
3945+ "utmpx" if !old_musl => true ,
39403946
39413947 _ => false ,
39423948 }
@@ -3990,35 +3996,26 @@ fn test_linux(target: &str) {
39903996 if name. starts_with ( "NI_IDN" ) {
39913997 return true ;
39923998 }
3993- // FIXME(musl): Not in musl yet
3994- if name == "SO_NETNS_COOKIE"
3995- || name == "SO_BUF_LOCK"
3996- || name == "SO_RESERVE_MEM"
3997- || name == "SO_TXREHASH"
3998- || name == "SO_RCVMARK"
3999- || name == "SO_PASSPIDFD"
4000- || name == "SO_PEERPIDFD"
4001- || name == "SO_DEVMEM_LINEAR"
4002- || name == "SO_DEVMEM_DMABUF"
4003- || name == "SO_DEVMEM_DONTNEED"
4004- {
4005- return true ;
4006- }
4007- // FIXME(musl): Not in musl yet
4008- if name == "SCM_DEVMEM_LINEAR" || name == "SCM_DEVMEM_DMABUF" {
4009- return true ;
4010- }
4011- // FIXME: Does not exist on non-x86 architectures, slated for removal
4012- // in libc in 1.0
4013- if ppc64 && name == "MAP_32BIT" {
4014- return true ;
4015- }
4016- }
4017- if old_musl {
4018- // Constants that don't exist on the old version of musl we test with, but do exist
4019- // on newer versions.
3999+
40204000 match name {
4021- "FAN_EVENT_INFO_TYPE_ERROR"
4001+ // FIXME: Does not exist on non-x86 architectures, slated for removal
4002+ // in libc in 1.0
4003+ "MAP_32BIT" if ppc64 => return true ,
4004+
4005+ // FIXME(musl): None of these are actually defined in musl, they should be removed.
4006+ "SO_NETNS_COOKIE"
4007+ | "SO_BUF_LOCK"
4008+ | "SO_RESERVE_MEM"
4009+ | "SO_TXREHASH"
4010+ | "SO_RCVMARK"
4011+ | "SO_PASSPIDFD"
4012+ | "SO_PEERPIDFD"
4013+ | "SO_DEVMEM_LINEAR"
4014+ | "SO_DEVMEM_DMABUF"
4015+ | "SO_DEVMEM_DONTNEED"
4016+ | "SCM_DEVMEM_LINEAR"
4017+ | "SCM_DEVMEM_DMABUF"
4018+ | "FAN_EVENT_INFO_TYPE_ERROR"
40224019 | "FAN_EVENT_INFO_TYPE_NEW_DFID_NAME"
40234020 | "FAN_EVENT_INFO_TYPE_OLD_DFID_NAME"
40244021 | "FAN_FS_ERROR"
@@ -4031,21 +4028,39 @@ fn test_linux(target: &str) {
40314028 | "FAN_REPORT_TARGET_FID"
40324029 | "FAN_RESPONSE_INFO_AUDIT_RULE"
40334030 | "FAN_RESPONSE_INFO_NONE"
4034- | "IPPROTO_ETHERNET"
4035- | "IPPROTO_MPTCP"
40364031 | "PR_GET_MDWE"
40374032 | "PR_MDWE_NO_INHERIT"
40384033 | "PR_MDWE_REFUSE_EXEC_GAIN"
40394034 | "PR_SET_MDWE"
4040- | "RLIM_NLIMITS"
4035+ | "IPPROTO_ETHERNET"
4036+ | "IPPROTO_MPTCP"
40414037 | "SI_DETHREAD"
4042- | "SO_BUSY_POLL_BUDGET"
4043- | "SO_PREFER_BUSY_POLL" => return true ,
4044- // Values changed in newer musl versions on these arches
4038+ | "PR_SET_VMA"
4039+ | "PR_SET_VMA_ANON_NAME"
4040+ | "PR_SCHED_CORE"
4041+ | "PR_SCHED_CORE_CREATE"
4042+ | "PR_SCHED_CORE_GET"
4043+ | "PR_SCHED_CORE_MAX"
4044+ | "PR_SCHED_CORE_SCOPE_PROCESS_GROUP"
4045+ | "PR_SCHED_CORE_SCOPE_THREAD"
4046+ | "PR_SCHED_CORE_SCOPE_THREAD_GROUP"
4047+ | "PR_SCHED_CORE_SHARE_FROM"
4048+ | "PR_SCHED_CORE_SHARE_TO" => return true ,
4049+
4050+ /* Added in versions more recent than what we test */
4051+ // Since 1.2.3
4052+ "SO_BUSY_POLL_BUDGET" | "SO_PREFER_BUSY_POLL" => return true ,
4053+
4054+ // FIXME(musl): value was updated in new musl
4055+ "RLIM_NLIMITS" => return true ,
4056+
4057+ // FIXME(musl): Values changed in newer musl versions on these arches
40454058 "O_LARGEFILE" if riscv64 || x86_64 => return true ,
4059+
40464060 _ => ( ) ,
40474061 }
40484062 }
4063+
40494064 match name {
40504065 // These constants are not available if gnu headers have been included
40514066 // and can therefore not be tested here
@@ -4158,23 +4173,6 @@ fn test_linux(target: &str) {
41584173 // is a private value for kernel usage normally
41594174 "FUSE_SUPER_MAGIC" => true ,
41604175
4161- // Not present on old musl
4162- "PR_SET_VMA"
4163- | "PR_SET_VMA_ANON_NAME"
4164- | "PR_SCHED_CORE"
4165- | "PR_SCHED_CORE_CREATE"
4166- | "PR_SCHED_CORE_GET"
4167- | "PR_SCHED_CORE_MAX"
4168- | "PR_SCHED_CORE_SCOPE_PROCESS_GROUP"
4169- | "PR_SCHED_CORE_SCOPE_THREAD"
4170- | "PR_SCHED_CORE_SCOPE_THREAD_GROUP"
4171- | "PR_SCHED_CORE_SHARE_FROM"
4172- | "PR_SCHED_CORE_SHARE_TO"
4173- if old_musl =>
4174- {
4175- true
4176- }
4177-
41784176 // Not present in glibc
41794177 "PR_SME_VL_LEN_MAX" | "PR_SME_SET_VL_INHERIT" | "PR_SME_SET_VL_ONE_EXEC" if gnu => true ,
41804178
@@ -4359,20 +4357,22 @@ fn test_linux(target: &str) {
43594357 // assume it's a int instead.
43604358 "getnameinfo" if uclibc => true ,
43614359
4362- // FIXME(musl): This needs musl 1.2.2 or later.
4363- "gettid" if old_musl => true ,
4360+ // FIXME(musl): This needs musl 1.2.2 or later, which is newer than what we test with
4361+ // on CI.
4362+ "gettid" | "reallocarray" if musl => true ,
4363+ // Needs musl 1.2.3 or later.
4364+ "pthread_getname_np" if musl => true ,
4365+ // Added in musl 1.2.5
4366+ "preadv2" | "pwritev2" if musl => true ,
4367+ // FIXME(musl): Supported in new musl but we don't have a new enough version in CI.
4368+ "statx" if musl => true ,
43644369
43654370 // Needs glibc 2.33 or later.
43664371 "mallinfo2" => true ,
43674372
4368- "reallocarray" if old_musl => true ,
4369-
43704373 // Not defined in uclibc as of 1.0.34
43714374 "gettid" if uclibc => true ,
43724375
4373- // Needs musl 1.2.3 or later.
4374- "pthread_getname_np" if old_musl => true ,
4375-
43764376 // There are two versions of basename(3) on Linux with glibc, see
43774377 //
43784378 // https://man7.org/linux/man-pages/man3/basename.3.html
@@ -4392,9 +4392,6 @@ fn test_linux(target: &str) {
43924392 // FIXME(linux): function pointers changed since Ubuntu 23.10
43934393 "strtol" | "strtoll" | "strtoul" | "strtoull" | "fscanf" | "scanf" | "sscanf" => true ,
43944394
4395- // Added in musl 1.2.5
4396- "preadv2" | "pwritev2" if musl => true ,
4397-
43984395 _ => false ,
43994396 }
44004397 } ) ;
@@ -4506,7 +4503,7 @@ fn test_linux(target: &str) {
45064503 // the `xsk_tx_metadata_union` field is an anonymous union
45074504 ( struct_ == "xsk_tx_metadata" && field == "xsk_tx_metadata_union" ) ||
45084505 // After musl 1.2.0, the type becomes `int` instead of `long`.
4509- ( old_musl && struct_ == "utmpx" && field == "ut_session" ) ||
4506+ ( musl && struct_ == "utmpx" && field == "ut_session" ) ||
45104507 // `frames` is a flexible array member
45114508 ( struct_ == "bcm_msg_head" && field == "frames" ) ||
45124509 // FAM
0 commit comments