Skip to content
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ jobs:
- target: powerpc64le-unknown-linux-musl
env:
RUST_LIBC_UNSTABLE_MUSL_V1_2_3: 1
- target: x86_64-unknown-linux-musl
env:
RUST_LIBC_UNSTABLE_MUSL_V1_2_3: 1
# FIXME(ppc): SIGILL running tests, see
# https://github.com/rust-lang/libc/pull/4254#issuecomment-2636288713
# - target: powerpc-unknown-linux-gnu
Expand Down
166 changes: 43 additions & 123 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4037,9 +4037,6 @@ fn test_linux(target: &str) {
// FIXME(linux): Requires >= 6.12 kernel headers.
"mnt_ns_info" => true,

// FIXME(linux): Requires >= 6.4 kernel headers.
"ptrace_sud_config" => true,

// Struct has changed for new musl versions
"tcp_info" if old_musl => true,

Expand Down Expand Up @@ -4095,20 +4092,6 @@ fn test_linux(target: &str) {
if name.starts_with("NI_IDN") {
return true;
}
// FIXME: Requires >= 6.3 kernel headers
if loongarch64 && (name == "MFD_NOEXEC_SEAL" || name == "MFD_EXEC") {
return true;
}
// FIXME: Requires >= 6.3 (6.6) kernel headers
if name == "PR_GET_MDWE" || name == "PR_MDWE_NO_INHERIT" || name == "PR_MDWE_REFUSE_EXEC_GAIN" || name == "PR_SET_MDWE" {
return true;
}
// Requires musl >= 1.2
if old_musl && (name == "SO_PREFER_BUSY_POLL"
|| name == "SO_BUSY_POLL_BUDGET")
{
return true;
}
// FIXME(musl): Not in musl yet
if name == "SO_NETNS_COOKIE"
|| name == "SO_BUF_LOCK"
Expand All @@ -4129,20 +4112,45 @@ fn test_linux(target: &str) {
{
return true;
}
// Values changed in newer musl versions on these arches
if old_musl && (riscv64 || x86_64) && name == "O_LARGEFILE" {
return true;
}
// Values changed in newer musl versions
if old_musl && name == "RLIM_NLIMITS" {
return true;
}
// FIXME: Does not exist on non-x86 architectures, slated for removal
// in libc in 1.0
if ppc64 && name == "MAP_32BIT" {
return true;
}
}
if old_musl {
// Constants that don't exist on the old version of musl we test with, but do exist
// on newer versions.
match name {
| "FAN_EVENT_INFO_TYPE_ERROR"
| "FAN_EVENT_INFO_TYPE_NEW_DFID_NAME"
| "FAN_EVENT_INFO_TYPE_OLD_DFID_NAME"
| "FAN_FS_ERROR"
| "FAN_INFO"
| "FAN_MARK_EVICTABLE"
| "FAN_MARK_IGNORE"
| "FAN_MARK_IGNORE_SURV"
| "FAN_RENAME"
| "FAN_REPORT_DFID_NAME_TARGET"
| "FAN_REPORT_TARGET_FID"
| "FAN_RESPONSE_INFO_AUDIT_RULE"
| "FAN_RESPONSE_INFO_NONE"
| "IPPROTO_ETHERNET"
| "IPPROTO_MPTCP"
| "PR_GET_MDWE"
| "PR_MDWE_NO_INHERIT"
| "PR_MDWE_REFUSE_EXEC_GAIN"
| "PR_SET_MDWE"
| "RLIM_NLIMITS"
| "SI_DETHREAD"
| "SO_BUSY_POLL_BUDGET"
| "SO_PREFER_BUSY_POLL"
=> return true,
// Values changed in newer musl versions on these arches
"O_LARGEFILE" if riscv64 || x86_64 => return true,
_ => (),
}
}
match name {
// These constants are not available if gnu headers have been included
// and can therefore not be tested here
Expand Down Expand Up @@ -4195,43 +4203,17 @@ fn test_linux(target: &str) {
// deprecated: not available from Linux kernel 5.6:
"VMADDR_CID_RESERVED" => true,

// IPPROTO_MAX was increased in 5.6 for IPPROTO_MPTCP:
| "IPPROTO_MAX"
| "IPPROTO_ETHERNET"
| "IPPROTO_MPTCP" => true,
// FIXME(value): IPPROTO_MAX was increased in 5.6 for IPPROTO_MPTCP:
"IPPROTO_MAX" => true,

// FIXME(linux): Not yet implemented on sparc64
"SYS_clone3" if sparc64 => true,

// FIXME(linux): Not defined on ARM, gnueabihf, mips, musl, PowerPC, riscv64, s390x, and sparc64.
"SYS_memfd_secret" if arm | gnueabihf | mips | musl | ppc | riscv64 | s390x | sparc64 => true,

// FIXME(linux): Added in Linux 5.16
// https://github.com/torvalds/linux/commit/039c0ec9bb77446d7ada7f55f90af9299b28ca49
"SYS_futex_waitv" => true,

// FIXME(linux): Added in Linux 5.17
// https://github.com/torvalds/linux/commit/c6018b4b254971863bd0ad36bb5e7d0fa0f0ddb0
"SYS_set_mempolicy_home_node" => true,

// FIXME(linux): Added in Linux 5.18
// https://github.com/torvalds/linux/commit/8b5413647262dda8d8d0e07e14ea1de9ac7cf0b2
"NFQA_PRIORITY" => true,

// FIXME(linux): requires more recent kernel headers on CI
| "UINPUT_VERSION"
| "SW_MAX"
| "SW_CNT"
if ppc64 || riscv64 => true,

// FIXME(linux): requires more recent kernel headers on CI
"SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV" if sparc64 => true,

// FIXME(linux): Not currently available in headers on ARM and musl.
"NETLINK_GET_STRICT_CHK" if arm => true,

// Skip as this signal codes and trap reasons need newer headers
"SI_DETHREAD" | "TRAP_PERF" => true,
"TRAP_PERF" => true,

// kernel constants not available in uclibc 1.0.34
| "EXTPROC"
Expand Down Expand Up @@ -4305,15 +4287,6 @@ fn test_linux(target: &str) {
// value changed
"NF_NETDEV_NUMHOOKS" if sparc64 => true,

// FIXME(linux): Requires >= 6.3 kernel headers
"MFD_EXEC" | "MFD_NOEXEC_SEAL" if sparc64 => true,

// kernel 6.1 minimum
"MADV_COLLAPSE" => true,

// kernel 6.2 minimum
"TUN_F_USO4" | "TUN_F_USO6" | "IFF_NO_CARRIER" => true,

// kernel 6.9 minimum
"RWF_NOAPPEND" => true,

Expand All @@ -4323,38 +4296,6 @@ fn test_linux(target: &str) {
// kernel 6.14 minimum
"RWF_DONTCACHE" => true,

// FIXME(linux): Requires more recent kernel headers
| "IFLA_PARENT_DEV_NAME" // linux v5.13+
| "IFLA_PARENT_DEV_BUS_NAME" // linux v5.13+
| "IFLA_GRO_MAX_SIZE" // linux v5.16+
| "IFLA_TSO_MAX_SIZE" // linux v5.18+
| "IFLA_TSO_MAX_SEGS" // linux v5.18+
| "IFLA_ALLMULTI" // linux v6.0+
| "MADV_DONTNEED_LOCKED" // linux v5.18+
=> true,
"SCTP_FUTURE_ASSOC" | "SCTP_CURRENT_ASSOC" | "SCTP_ALL_ASSOC" | "SCTP_PEER_ADDR_THLDS_V2" => true, // linux 5.5+

// kernel 6.5 minimum
"MOVE_MOUNT_BENEATH" => true,
// FIXME(linux): Requires linux 6.1
"ALG_SET_KEY_BY_KEY_SERIAL" | "ALG_SET_DRBG_ENTROPY" => true,

// FIXME(linux): Requires more recent kernel headers
| "FAN_FS_ERROR" // linux v5.16+
| "FAN_RENAME" // linux v5.17+
| "FAN_REPORT_TARGET_FID" // linux v5.17+
| "FAN_REPORT_DFID_NAME_TARGET" // linux v5.17+
| "FAN_MARK_EVICTABLE" // linux v5.19+
| "FAN_MARK_IGNORE" // linux v6.0+
| "FAN_MARK_IGNORE_SURV" // linux v6.0+
| "FAN_EVENT_INFO_TYPE_ERROR" // linux v5.16+
| "FAN_EVENT_INFO_TYPE_OLD_DFID_NAME" // linux v5.17+
| "FAN_EVENT_INFO_TYPE_NEW_DFID_NAME" // linux v5.17+
| "FAN_RESPONSE_INFO_NONE" // linux v5.16+
| "FAN_RESPONSE_INFO_AUDIT_RULE" // linux v5.16+
| "FAN_INFO" // linux v5.16+
=> true,

// musl doesn't use <linux/fanotify.h> in <sys/fanotify.h>
"FAN_REPORT_PIDFD"
| "FAN_REPORT_DIR_FID"
Expand All @@ -4367,36 +4308,21 @@ fn test_linux(target: &str) {
| "FAN_EPIDFD"
if musl => true,

// FIXME(linux): Requires linux 6.5
"NFT_MSG_MAX" => true,

// FIXME(linux): Requires >= 6.6 kernel headers.
"XDP_USE_SG"
| "XDP_PKT_CONTD"
=>
{
true
}
"XDP_USE_SG" | "XDP_PKT_CONTD" => true,

// FIXME(linux): Requires >= 6.6 kernel headers.
"PR_MDWE_NO_INHERIT" => true,
// FIXME(linux): Missing only on this platform for some reason
"PR_MDWE_NO_INHERIT" if gnueabihf => true,

// FIXME(linux): Requires >= 6.8 kernel headers.
"XDP_UMEM_TX_SW_CSUM"
| "XDP_TXMD_FLAGS_TIMESTAMP"
| "XDP_TXMD_FLAGS_CHECKSUM"
| "XDP_TX_METADATA"
=>
{
true
}
=> true,

// FIXME(linux): Requires >= 6.11 kernel headers.
"XDP_UMEM_TX_METADATA_LEN"
=>
{
true
}
"XDP_UMEM_TX_METADATA_LEN" => true,

// FIXME(linux): Requires >= 6.11 kernel headers.
"NS_GET_MNTNS_ID" | "NS_GET_PID_FROM_PIDNS" | "NS_GET_TGID_FROM_PIDNS" | "NS_GET_PID_IN_PIDNS" | "NS_GET_TGID_IN_PIDNS" => true,
Expand Down Expand Up @@ -4439,15 +4365,11 @@ fn test_linux(target: &str) {
| "PF_SUSPEND_TASK" => true,

// FIXME(linux): Requires >= 6.9 kernel headers.
"EPIOCSPARAMS"
| "EPIOCGPARAMS" => true,
"EPIOCSPARAMS" | "EPIOCGPARAMS" => true,

// FIXME(linux): 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,

Expand All @@ -4457,12 +4379,10 @@ fn test_linux(target: &str) {
| "SO_DEVMEM_DONTNEED"
| "SCM_DEVMEM_LINEAR"
| "SCM_DEVMEM_DMABUF" => true,

// FIXME(linux): Requires >= 6.4 kernel headers.
"PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG" | "PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG" => true,

// FIXME(linux): Requires >= 6.6 kernel headers.
"PROC_EVENT_NONZERO_EXIT" => true,

// FIXME(linux): Requires >= 6.14 kernel headers.
"SECBIT_EXEC_DENY_INTERACTIVE"
| "SECBIT_EXEC_DENY_INTERACTIVE_LOCKED"
Expand Down
3 changes: 2 additions & 1 deletion src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4883,7 +4883,8 @@ cfg_if! {
pub const NFT_MSG_GETOBJ_RESET: c_int = 21;
}
}
pub const NFT_MSG_MAX: c_int = 25;

pub const NFT_MSG_MAX: c_int = 34;

pub const NFT_SET_ANONYMOUS: c_int = 0x1;
pub const NFT_SET_CONSTANT: c_int = 0x2;
Expand Down