From 9a14e4a13afa2d828db6732d4b16b335dfaf08c7 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Tue, 23 Jun 2026 16:36:53 -0400 Subject: [PATCH 01/80] ci: Don't set `fail-fast` in 0.2 CI Since most CI for 0.2 is backports that affect all targets, don't stop testing one target if another fails. --- .github/workflows/ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7a86a0e4fee4..fc865e674518 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -106,6 +106,7 @@ jobs: test_tier1: name: Test tier1 strategy: + fail-fast: false # Speed up 0.2 backport CI matrix: include: - target: aarch64-apple-darwin @@ -164,9 +165,8 @@ jobs: # Unlike `main` this job doesn't have `needs`, in order to speed up backports a bit test_tier2: name: Test tier2 - needs: [test_tier1, style_check] strategy: - fail-fast: true + fail-fast: false # Speed up 0.2 backport CI max-parallel: 16 matrix: include: @@ -262,7 +262,7 @@ jobs: name: Test tier2 VM runs-on: ubuntu-latest strategy: - fail-fast: true + fail-fast: false # Speed up 0.2 backport CI matrix: include: # FIXME(#4740): FreeBSD 13 tests are extremely flaky and fail most of the time From e5862a23348c50479106cbb554876fd2c000e217 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2026 16:29:18 +0000 Subject: [PATCH 02/80] build(deps): bump vmactions/solaris-vm from 1.3.2 to 1.3.3 Bumps [vmactions/solaris-vm](https://github.com/vmactions/solaris-vm) from 1.3.2 to 1.3.3. - [Release notes](https://github.com/vmactions/solaris-vm/releases) - [Commits](https://github.com/vmactions/solaris-vm/compare/v1.3.2...v1.3.3) --- updated-dependencies: - dependency-name: vmactions/solaris-vm dependency-version: 1.3.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit 0dddfc8c344fb622b8cd78f7f24b4d1ace302e51) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fc865e674518..d1f11551d805 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -300,7 +300,7 @@ jobs: ./ci/run.sh ${{ matrix.target }} - name: test on Solaris - uses: vmactions/solaris-vm@v1.3.2 + uses: vmactions/solaris-vm@v1.3.3 if: contains(matrix.target, 'solaris') with: release: "11.4-gcc" From a2ba3b93e4fbec1f0b29ce721512caf661634876 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Sat, 25 Apr 2026 16:41:17 +0100 Subject: [PATCH 03/80] cargo: use workspace-level lints (backport ) (cherry picked from commit 2c61e190724f866d94b687eccc3108c878dbf38a) --- Cargo.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a448d888c773..22057eb6b248 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -184,14 +184,11 @@ members = [ "libc-test", ] -# FIXME(msrv): These should be renamed as `[workspace.lints.*]` once MSRV is above 1.64 -# This way all crates can use it with `[lints] workspace=true` section - -[lints.rust] +[workspace.lints.rust] # FIXME(cleanup): make ident usage consistent in each file unused_qualifications = "allow" -[lints.clippy] +[workspace.lints.clippy] # Enable pedantic lints - use this manually once in a while, but don't enable by default # pedantic = { level = "warn", priority = -1 } @@ -211,6 +208,9 @@ uninlined_format_args = "allow" unnecessary_cast = "allow" # some casts like `as usize` are only needed for some targets used_underscore_binding = "allow" +[lints] +workspace = true + [package.metadata.cargo-semver-checks.lints] # Alignment is an internal detail that users must not rely upon repr_align_removed = "warn" From 00fabab7c02376494517f10a86b1cb759fe51993 Mon Sep 17 00:00:00 2001 From: Kamal Al Marhubi Date: Fri, 24 Apr 2026 21:37:31 -0400 Subject: [PATCH 04/80] apple: add missing kqueue constants Add kqueue constants from that were not yet exposed: - EVFILT_EXCEPT - EV_UDATA_SPECIFIC, EV_DISPATCH2, EV_VANISHED - NOTE_OOB, NOTE_FUNLOCK, NOTE_LEASE_DOWNGRADE, NOTE_LEASE_RELEASE (backport ) (cherry picked from commit a07061500a2f367b58443eb1507727739c877041) --- libc-test/semver/apple.txt | 8 ++++++++ src/unix/bsd/apple/mod.rs | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index 2a7e1ddb3ddb..ade5114bbec3 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -380,6 +380,7 @@ ETIME ETOOMANYREFS EUSERS EVFILT_AIO +EVFILT_EXCEPT EVFILT_FS EVFILT_MACHPORT EVFILT_PROC @@ -395,6 +396,7 @@ EV_CLEAR EV_DELETE EV_DISABLE EV_DISPATCH +EV_DISPATCH2 EV_ENABLE EV_EOF EV_ERROR @@ -405,6 +407,8 @@ EV_OOBAND EV_POLL EV_RECEIPT EV_SYSFLAGS +EV_UDATA_SPECIFIC +EV_VANISHED EXTA EXTB EXTPROC @@ -1007,6 +1011,9 @@ NOTE_FFLAGSMASK NOTE_FFNOP NOTE_FFOR NOTE_FORK +NOTE_FUNLOCK +NOTE_LEASE_DOWNGRADE +NOTE_LEASE_RELEASE NOTE_LEEWAY NOTE_LINK NOTE_LOWAT @@ -1014,6 +1021,7 @@ NOTE_MACHTIME NOTE_MACH_CONTINUOUS_TIME NOTE_NONE NOTE_NSECONDS +NOTE_OOB NOTE_PCTRLMASK NOTE_PDATAMASK NOTE_RENAME diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index ff0e24a90a1d..ca916d65e5ed 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -3168,6 +3168,7 @@ pub const EVFILT_MACHPORT: i16 = -8; pub const EVFILT_FS: i16 = -9; pub const EVFILT_USER: i16 = -10; pub const EVFILT_VM: i16 = -12; +pub const EVFILT_EXCEPT: i16 = -15; pub const EV_ADD: u16 = 0x1; pub const EV_DELETE: u16 = 0x2; @@ -3177,6 +3178,9 @@ pub const EV_ONESHOT: u16 = 0x10; pub const EV_CLEAR: u16 = 0x20; pub const EV_RECEIPT: u16 = 0x40; pub const EV_DISPATCH: u16 = 0x80; +pub const EV_UDATA_SPECIFIC: u16 = 0x0100; +pub const EV_DISPATCH2: u16 = EV_DISPATCH | EV_UDATA_SPECIFIC; +pub const EV_VANISHED: u16 = 0x0200; pub const EV_FLAG0: u16 = 0x1000; pub const EV_POLL: u16 = 0x1000; pub const EV_FLAG1: u16 = 0x2000; @@ -3197,6 +3201,7 @@ pub const NOTE_FFCOPY: u32 = 0xc0000000; pub const NOTE_FFCTRLMASK: u32 = 0xc0000000; pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff; pub const NOTE_LOWAT: u32 = 0x00000001; +pub const NOTE_OOB: u32 = 0x00000002; pub const NOTE_DELETE: u32 = 0x00000001; pub const NOTE_WRITE: u32 = 0x00000002; pub const NOTE_EXTEND: u32 = 0x00000004; @@ -3205,6 +3210,9 @@ pub const NOTE_LINK: u32 = 0x00000010; pub const NOTE_RENAME: u32 = 0x00000020; pub const NOTE_REVOKE: u32 = 0x00000040; pub const NOTE_NONE: u32 = 0x00000080; +pub const NOTE_FUNLOCK: u32 = 0x00000100; +pub const NOTE_LEASE_DOWNGRADE: u32 = 0x00000200; +pub const NOTE_LEASE_RELEASE: u32 = 0x00000400; pub const NOTE_EXIT: u32 = 0x80000000; pub const NOTE_FORK: u32 = 0x40000000; pub const NOTE_EXEC: u32 = 0x20000000; From 444412e90bee26e9e7e3ca424c03b3cb7a7d985a Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Mon, 27 Apr 2026 03:45:10 +0100 Subject: [PATCH 05/80] refactor: use slice::fill (backport ) (cherry picked from commit 3b53a7b5d588a38716e69d6e9111cda3fc58e4a8) --- src/fuchsia/mod.rs | 8 ++------ src/unix/aix/mod.rs | 4 +--- src/unix/bsd/freebsdlike/dragonfly/mod.rs | 4 +--- src/unix/bsd/freebsdlike/freebsd/mod.rs | 8 ++------ src/unix/bsd/mod.rs | 4 +--- src/unix/cygwin/mod.rs | 11 ++++------- src/unix/haiku/mod.rs | 4 +--- src/unix/hurd/mod.rs | 8 ++------ src/unix/linux_like/android/mod.rs | 4 +--- src/unix/linux_like/emscripten/mod.rs | 4 +--- src/unix/linux_like/linux_l4re_shared.rs | 4 +--- src/unix/linux_like/mod.rs | 4 +--- src/unix/newlib/mod.rs | 4 +--- src/unix/nto/mod.rs | 4 +--- src/unix/redox/mod.rs | 4 +--- src/unix/solarish/mod.rs | 4 +--- 16 files changed, 22 insertions(+), 61 deletions(-) diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs index 3e35faa7b711..b49e9aa7a96f 100644 --- a/src/fuchsia/mod.rs +++ b/src/fuchsia/mod.rs @@ -2985,15 +2985,11 @@ f! { } pub fn FD_ZERO(set: *mut fd_set) -> () { - for slot in (*set).fds_bits.iter_mut() { - *slot = 0; - } + (*set).fds_bits.fill(0); } pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { - for slot in cpuset.bits.iter_mut() { - *slot = 0; - } + cpuset.bits.fill(0); } pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { diff --git a/src/unix/aix/mod.rs b/src/unix/aix/mod.rs index 71d041f7b52f..d5b2a00f5d6a 100644 --- a/src/unix/aix/mod.rs +++ b/src/unix/aix/mod.rs @@ -2447,9 +2447,7 @@ f! { } pub fn FD_ZERO(set: *mut fd_set) -> () { - for slot in (*set).fds_bits.iter_mut() { - *slot = 0; - } + (*set).fds_bits.fill(0); } pub fn FD_SET(fd: c_int, set: *mut fd_set) -> () { diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 60e7989bbde3..bce0513d2d3e 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -1198,9 +1198,7 @@ f! { } pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { - for slot in cpuset.ary.iter_mut() { - *slot = 0; - } + cpuset.ary.fill(0); } pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 233026cc7837..cb89ac14120b 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -4325,15 +4325,11 @@ f! { } pub fn CPU_ZERO(cpuset: &mut cpuset_t) -> () { - for slot in cpuset.__bits.iter_mut() { - *slot = 0; - } + cpuset.__bits.fill(0); } pub fn CPU_FILL(cpuset: &mut cpuset_t) -> () { - for slot in cpuset.__bits.iter_mut() { - *slot = !0; - } + cpuset.__bits.fill(!0); } pub fn CPU_SET(cpu: usize, cpuset: &mut cpuset_t) -> () { diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index cb4781735986..812177c8d48d 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -522,9 +522,7 @@ f! { } pub fn FD_ZERO(set: *mut fd_set) -> () { - for slot in &mut (*set).fds_bits { - *slot = 0; - } + (*set).fds_bits.fill(0); } } diff --git a/src/unix/cygwin/mod.rs b/src/unix/cygwin/mod.rs index 0c093a4c1772..56ee0a5d105e 100644 --- a/src/unix/cygwin/mod.rs +++ b/src/unix/cygwin/mod.rs @@ -1691,9 +1691,7 @@ f! { } pub fn FD_ZERO(set: *mut fd_set) -> () { - for slot in (*set).fds_bits.iter_mut() { - *slot = 0; - } + (*set).fds_bits.fill(0); } pub fn CPU_ALLOC_SIZE(count: c_int) -> size_t { @@ -1711,11 +1709,10 @@ f! { s as c_int } - pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { - for slot in cpuset.bits.iter_mut() { - *slot = 0; - } + pub fn CPU_ZERO(cpuset: &mut cpuset_t) -> () { + cpuset.bits.fill(0); } + pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { let size_in_bits = 8 * size_of_val(&cpuset.bits[0]); if cpu < size_in_bits { diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs index cbb6464ed84b..3ccb5a172f61 100644 --- a/src/unix/haiku/mod.rs +++ b/src/unix/haiku/mod.rs @@ -1439,9 +1439,7 @@ f! { } pub fn FD_ZERO(set: *mut fd_set) -> () { - for slot in (*set).fds_bits.iter_mut() { - *slot = 0; - } + (*set).fds_bits.fill(0); } } diff --git a/src/unix/hurd/mod.rs b/src/unix/hurd/mod.rs index 74b77d96f007..206cd5b2afc2 100644 --- a/src/unix/hurd/mod.rs +++ b/src/unix/hurd/mod.rs @@ -3403,9 +3403,7 @@ f! { } pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { - for slot in cpuset.bits.iter_mut() { - *slot = 0; - } + cpuset.bits.fill(0); } pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { @@ -3472,9 +3470,7 @@ f! { } pub fn FD_ZERO(set: *mut fd_set) -> () { - for slot in (*set).fds_bits.iter_mut() { - *slot = 0; - } + (*set).fds_bits.fill(0); } } diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index 31d1dba3ecf1..309e0999a1cc 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -3335,9 +3335,7 @@ f! { } pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { - for slot in cpuset.__bits.iter_mut() { - *slot = 0; - } + cpuset.__bits.fill(0); } pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs index 711ed8f8b4c3..a97e772f99e7 100644 --- a/src/unix/linux_like/emscripten/mod.rs +++ b/src/unix/linux_like/emscripten/mod.rs @@ -1265,9 +1265,7 @@ f! { } pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { - for slot in cpuset.bits.iter_mut() { - *slot = 0; - } + cpuset.bits.fill(0); } pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { diff --git a/src/unix/linux_like/linux_l4re_shared.rs b/src/unix/linux_like/linux_l4re_shared.rs index cf76b3966ffa..6b320ff4effa 100644 --- a/src/unix/linux_like/linux_l4re_shared.rs +++ b/src/unix/linux_like/linux_l4re_shared.rs @@ -1523,9 +1523,7 @@ f! { } pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { - for slot in &mut cpuset.bits { - *slot = 0; - } + cpuset.bits.fill(0); } pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index 59e16a0f3c4b..133c57fc4dec 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -1779,9 +1779,7 @@ f! { } pub fn FD_ZERO(set: *mut fd_set) -> () { - for slot in &mut (*set).fds_bits { - *slot = 0; - } + (*set).fds_bits.fill(0); } } diff --git a/src/unix/newlib/mod.rs b/src/unix/newlib/mod.rs index 9e7df163e62e..5783e66b5472 100644 --- a/src/unix/newlib/mod.rs +++ b/src/unix/newlib/mod.rs @@ -837,9 +837,7 @@ f! { } pub fn FD_ZERO(set: *mut fd_set) -> () { - for slot in (*set).fds_bits.iter_mut() { - *slot = 0; - } + (*set).fds_bits.fill(0); } } diff --git a/src/unix/nto/mod.rs b/src/unix/nto/mod.rs index 022fb0be1f78..0674e1bca4e1 100644 --- a/src/unix/nto/mod.rs +++ b/src/unix/nto/mod.rs @@ -2477,9 +2477,7 @@ f! { } pub fn FD_ZERO(set: *mut fd_set) -> () { - for slot in (*set).fds_bits.iter_mut() { - *slot = 0; - } + (*set).fds_bits.fill(0); } pub fn _DEXTRA_FIRST(_d: *const dirent) -> *mut crate::dirent_extra { diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs index 691fe5c5fced..4326cdfdd700 100644 --- a/src/unix/redox/mod.rs +++ b/src/unix/redox/mod.rs @@ -1134,9 +1134,7 @@ f! { } pub fn FD_ZERO(set: *mut fd_set) -> () { - for slot in (*set).fds_bits.iter_mut() { - *slot = 0; - } + (*set).fds_bits.fill(0); } } diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index 494ecdb7d95c..3826a3c7d9e7 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -2263,9 +2263,7 @@ f! { } pub fn FD_ZERO(set: *mut fd_set) -> () { - for slot in (*set).fds_bits.iter_mut() { - *slot = 0; - } + (*set).fds_bits.fill(0); } } From b2276850a1c7fc826593217a73533bd056de7eaa Mon Sep 17 00:00:00 2001 From: Petr Sumbera Date: Mon, 27 Apr 2026 13:03:37 +0200 Subject: [PATCH 06/80] solarish: add AI_CANONNAME (backport ) (cherry picked from commit c12ee660bc874b73d24448e7d2f21259e91c0666) --- src/unix/solarish/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index 3826a3c7d9e7..298d183e3bf7 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -1234,6 +1234,8 @@ pub const EAI_SOCKTYPE: c_int = 10; pub const EAI_SYSTEM: c_int = 11; pub const EAI_OVERFLOW: c_int = 12; +pub const AI_CANONNAME: c_int = 0x0010; + pub const NI_NOFQDN: c_uint = 0x0001; pub const NI_NUMERICHOST: c_uint = 0x0002; pub const NI_NAMEREQD: c_uint = 0x0004; From 5330b7c9bb02f338e97b4cb4901ea90cc4065be2 Mon Sep 17 00:00:00 2001 From: Zhenzhong Wu Date: Sat, 25 Apr 2026 23:30:57 +0800 Subject: [PATCH 07/80] linux: add SO_DETACH_REUSEPORT_BPF (backport ) (cherry picked from commit 95c957237dcad9096ba26d712ca3e3aacc16e8de) --- libc-test/build.rs | 2 ++ libc-test/semver/TODO-linux.txt | 1 - libc-test/semver/linux.txt | 1 + src/unix/linux_like/linux/arch/generic/mod.rs | 2 +- src/unix/linux_like/linux/arch/mips/mod.rs | 2 +- src/unix/linux_like/linux/arch/powerpc/mod.rs | 2 +- src/unix/linux_like/linux/arch/sparc/mod.rs | 2 +- 7 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index 6378b245a860..f5455afe5c74 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -4440,6 +4440,8 @@ fn test_linux(target: &str) { | "PR_SCHED_CORE_SHARE_TO" => return true, /* Added in versions more recent than what we test */ + // Since 1.2.0 + "SO_DETACH_REUSEPORT_BPF" => return true, // Since 1.2.3 "SO_BUSY_POLL_BUDGET" | "SO_PREFER_BUSY_POLL" => return true, diff --git a/libc-test/semver/TODO-linux.txt b/libc-test/semver/TODO-linux.txt index 98568ab0e974..4dee6991cd9f 100644 --- a/libc-test/semver/TODO-linux.txt +++ b/libc-test/semver/TODO-linux.txt @@ -35,7 +35,6 @@ SO_CNX_ADVICE SO_COOKIE SO_DETACH_BPF SO_DETACH_FILTER -SO_DETACH_REUSEPORT_BPF SO_GET_FILTER SO_INCOMING_CPU SO_INCOMING_NAPI_ID diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index 646696e43cde..3656ab97aba0 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -3179,6 +3179,7 @@ SO_BINDTODEVICE SO_BUF_LOCK SO_BUSY_POLL SO_BUSY_POLL_BUDGET +SO_DETACH_REUSEPORT_BPF SO_DEVMEM_DMABUF SO_DEVMEM_DONTNEED SO_DEVMEM_LINEAR diff --git a/src/unix/linux_like/linux/arch/generic/mod.rs b/src/unix/linux_like/linux/arch/generic/mod.rs index 37b751715e44..cf70367f8e6b 100644 --- a/src/unix/linux_like/linux/arch/generic/mod.rs +++ b/src/unix/linux_like/linux/arch/generic/mod.rs @@ -143,9 +143,9 @@ cfg_if! { pub const SO_TIMESTAMPING_NEW: c_int = 65; pub const SO_RCVTIMEO_NEW: c_int = 66; pub const SO_SNDTIMEO_NEW: c_int = 67; - pub const SO_DETACH_REUSEPORT_BPF: c_int = 68; } } +pub const SO_DETACH_REUSEPORT_BPF: c_int = 68; pub const SO_PREFER_BUSY_POLL: c_int = 69; pub const SO_BUSY_POLL_BUDGET: c_int = 70; pub const SO_NETNS_COOKIE: c_int = 71; diff --git a/src/unix/linux_like/linux/arch/mips/mod.rs b/src/unix/linux_like/linux/arch/mips/mod.rs index 78eec0ff55ac..12d46eb72d5a 100644 --- a/src/unix/linux_like/linux/arch/mips/mod.rs +++ b/src/unix/linux_like/linux/arch/mips/mod.rs @@ -117,7 +117,7 @@ cfg_if! { } } -// pub const SO_DETACH_REUSEPORT_BPF: c_int = 68; +pub const SO_DETACH_REUSEPORT_BPF: c_int = 68; pub const SO_PREFER_BUSY_POLL: c_int = 69; pub const SO_BUSY_POLL_BUDGET: c_int = 70; pub const SO_NETNS_COOKIE: c_int = 71; diff --git a/src/unix/linux_like/linux/arch/powerpc/mod.rs b/src/unix/linux_like/linux/arch/powerpc/mod.rs index b5a3557a705b..41908261721b 100644 --- a/src/unix/linux_like/linux/arch/powerpc/mod.rs +++ b/src/unix/linux_like/linux/arch/powerpc/mod.rs @@ -105,7 +105,7 @@ pub const SO_ZEROCOPY: c_int = 60; pub const SO_TXTIME: c_int = 61; pub const SCM_TXTIME: c_int = SO_TXTIME; pub const SO_BINDTOIFINDEX: c_int = 62; -// pub const SO_DETACH_REUSEPORT_BPF: c_int = 68; +pub const SO_DETACH_REUSEPORT_BPF: c_int = 68; pub const SO_PREFER_BUSY_POLL: c_int = 69; pub const SO_BUSY_POLL_BUDGET: c_int = 70; pub const SO_NETNS_COOKIE: c_int = 71; diff --git a/src/unix/linux_like/linux/arch/sparc/mod.rs b/src/unix/linux_like/linux/arch/sparc/mod.rs index 006156ee0c0e..40899e97f21c 100644 --- a/src/unix/linux_like/linux/arch/sparc/mod.rs +++ b/src/unix/linux_like/linux/arch/sparc/mod.rs @@ -94,7 +94,7 @@ pub const SO_TIMESTAMPING: c_int = 0x0023; // pub const SO_TIMESTAMPING_NEW: c_int = 0x0043; // pub const SO_RCVTIMEO_NEW: c_int = 0x0044; // pub const SO_SNDTIMEO_NEW: c_int = 0x0045; -// pub const SO_DETACH_REUSEPORT_BPF: c_int = 0x0047; +pub const SO_DETACH_REUSEPORT_BPF: c_int = 0x0047; pub const SO_PREFER_BUSY_POLL: c_int = 0x0048; pub const SO_BUSY_POLL_BUDGET: c_int = 0x0049; pub const SO_NETNS_COOKIE: c_int = 0x0050; From f82e16c6cd7bb5964484231130657618943f405b Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sat, 25 Apr 2026 11:43:43 +0900 Subject: [PATCH 08/80] chore: SHA-pin actions (backport ) (cherry picked from commit 3c0a00b1f8b49fe62f008f625b6673804d32e431) --- .github/workflows/ci.yaml | 57 ++++++++++++++++++++----------- .github/workflows/publish_0.2.yml | 5 +-- 2 files changed, 41 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d1f11551d805..262347de86d5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,5 @@ name: CI +permissions: {} on: merge_group: @@ -26,7 +27,9 @@ jobs: runs-on: ubuntu-24.04 timeout-minutes: 10 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Setup Rust toolchain run: ./ci/install-rust.sh && rustup component add rustfmt - name: Check style @@ -40,9 +43,11 @@ jobs: runs-on: ${{ matrix.os }} timeout-minutes: 10 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - run: rustup update stable --no-self-update - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 # Here we use the latest stable Rust toolchain already installed by GitHub # Ideally we should run it for every target, but we cannot rely on unstable toolchains # due to Clippy not being consistent between them. @@ -69,13 +74,17 @@ jobs: env: TOOLCHAIN: ${{ matrix.toolchain }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Setup Rust toolchain run: ./ci/install-rust.sh - name: Install semver-checks - uses: taiki-e/install-action@cargo-semver-checks + uses: taiki-e/install-action@787505cde8a44ea468a00478fe52baf23b15bccd # v2.75.21 if: matrix.toolchain == 'stable' + with: + tool: cargo-semver-checks - name: Retrieve semver baseline if: matrix.toolchain == 'stable' @@ -84,7 +93,7 @@ jobs: # FIXME(ci): These `du` statements are temporary for debugging cache - name: Target size before restoring cache run: du -sh target | sort -k 2 || true - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 with: key: ${{ matrix.os }}-${{ matrix.toolchain }} - name: Target size after restoring cache @@ -130,10 +139,12 @@ jobs: env: TARGET: ${{ matrix.target }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Setup Rust toolchain run: ./ci/install-rust.sh - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 with: key: ${{ matrix.target }} @@ -155,7 +166,7 @@ jobs: id: create_artifacts if: always() run: python3 ci/create-artifacts.py - - uses: actions/upload-artifact@v7 + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: always() && steps.create_artifacts.outcome == 'success' with: name: ${{ env.ARCHIVE_NAME }}-${{ matrix.target }}${{ matrix.artifact-tag && format('-{0}', matrix.artifact-tag) }} @@ -226,10 +237,12 @@ jobs: env: TARGET: ${{ matrix.target }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Setup Rust toolchain run: ./ci/install-rust.sh - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 with: key: ${{ matrix.target }} @@ -251,7 +264,7 @@ jobs: id: create_artifacts if: always() run: ./ci/create-artifacts.py - - uses: actions/upload-artifact@v7 + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: always() && steps.create_artifacts.outcome == 'success' with: name: ${{ env.ARCHIVE_NAME }}-${{ matrix.target }}${{ matrix.artifact-tag && format('-{0}', matrix.artifact-tag) }} @@ -278,9 +291,11 @@ jobs: - target: x86_64-unknown-netbsd timeout-minutes: 25 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Test on FreeBSD - uses: vmactions/freebsd-vm@v1.4.5 + uses: vmactions/freebsd-vm@d1e65811565151536c0c894fff74f06351ed26e6 # v1.4.5 if: contains(matrix.target, 'freebsd') with: release: ${{ matrix.release }} @@ -300,7 +315,7 @@ jobs: ./ci/run.sh ${{ matrix.target }} - name: test on Solaris - uses: vmactions/solaris-vm@v1.3.3 + uses: vmactions/solaris-vm@c20562b2c69737b06be9e828915761703e487373 # v1.3.3 if: contains(matrix.target, 'solaris') with: release: "11.4-gcc" @@ -317,7 +332,7 @@ jobs: ./ci/run.sh ${{ matrix.target }} - name: Test on NetBSD - uses: vmactions/netbsd-vm@v1 + uses: vmactions/netbsd-vm@eb3ba840926911ccf17dc9de235335cb27a02ba0 # v1.3.8 if: contains(matrix.target, 'netbsd') with: release: "10.1" @@ -341,10 +356,12 @@ jobs: runs-on: ubuntu-24.04 timeout-minutes: 10 steps: - - uses: actions/checkout@master + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Install Rust run: rustup update nightly --no-self-update && rustup default nightly - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 - run: cargo doc --workspace --no-deps # One job that "summarizes" the success state of this pipeline. This can then be added to branch @@ -364,7 +381,9 @@ jobs: # failed" as success. So we have to do some contortions to ensure the job fails if any of its # dependencies fails. if: always() # make sure this is never "skipped" + env: + NEEDS: ${{ toJson(needs) }} steps: # Manually check the status of all dependencies. `if: failure()` does not work. - name: check if any dependency failed - run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' + run: jq --exit-status 'all(.result == "success")' <<< "$NEEDS" diff --git a/.github/workflows/publish_0.2.yml b/.github/workflows/publish_0.2.yml index 9327c50d8889..55f48c7c9d3d 100644 --- a/.github/workflows/publish_0.2.yml +++ b/.github/workflows/publish_0.2.yml @@ -17,13 +17,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 + persist-credentials: false - name: Install Rust (rustup) run: rustup update stable --no-self-update && rustup default stable - name: Run release-plz - uses: MarcoIeni/release-plz-action@v0.5 + uses: MarcoIeni/release-plz-action@1528104d2ca23787631a1c1f022abb64b34c1e11 # v0.5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} From 0eee72bf79f6b962d316ff7433703d6fc955ef14 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Fri, 1 May 2026 15:13:38 -0600 Subject: [PATCH 09/80] Delete FreeBSD 13 CI job Because FreeBSD 13 is officially EoL as of today. (backport ) (cherry picked from commit 13f655f610f272a167580805d8016e8e1a0e32ac) --- .github/workflows/ci.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 262347de86d5..fbd4e82284be 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -278,9 +278,6 @@ jobs: fail-fast: false # Speed up 0.2 backport CI matrix: include: - # FIXME(#4740): FreeBSD 13 tests are extremely flaky and fail most of the time - # - release: "13.4" - # target: x86_64-unknown-freebsd - release: "15.0" target: i686-unknown-freebsd - release: "14.4" From 70e6f36377b6be9cf6128334c8e5c88ca85068c2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 18:02:14 +0000 Subject: [PATCH 10/80] build(deps): bump taiki-e/install-action from 2.75.21 to 2.76.0 Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.75.21 to 2.76.0. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/787505cde8a44ea468a00478fe52baf23b15bccd...711e1c3275189d76dcc4d34ddea63bf96ac49090) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-version: 2.76.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit d1795ee435a30a5504f1b972846e8f3459c93b31) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fbd4e82284be..f548c8a1c0cf 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -81,7 +81,7 @@ jobs: run: ./ci/install-rust.sh - name: Install semver-checks - uses: taiki-e/install-action@787505cde8a44ea468a00478fe52baf23b15bccd # v2.75.21 + uses: taiki-e/install-action@711e1c3275189d76dcc4d34ddea63bf96ac49090 # v2.76.0 if: matrix.toolchain == 'stable' with: tool: cargo-semver-checks From 8d9f88844f65f4e62ed712377b4f5880f17db1ec Mon Sep 17 00:00:00 2001 From: Trey Aspelund Date: Wed, 29 Apr 2026 00:57:38 +0000 Subject: [PATCH 11/80] solarish: Add IP TTL and IPv6 Hop Limit consts Adds: - IPV6_HOPLIMIT (illumos + solaris) - IPV6_MINHOPCOUNT (illumos) - IP_MINTTL (illumos) Signed-off-by: Trey Aspelund (backport ) (cherry picked from commit f8d641ac4da49ada1462e1c486bbce69bb2be186) --- libc-test/semver/illumos.txt | 2 ++ libc-test/semver/solarish.txt | 1 + src/unix/solarish/illumos.rs | 4 ++++ src/unix/solarish/mod.rs | 1 + 4 files changed, 8 insertions(+) diff --git a/libc-test/semver/illumos.txt b/libc-test/semver/illumos.txt index 54c3afbfbf90..f66ee1d87322 100644 --- a/libc-test/semver/illumos.txt +++ b/libc-test/semver/illumos.txt @@ -3,6 +3,8 @@ F_DUP2FD_CLOEXEC F_DUP2FD_CLOFORK F_DUP3FD F_DUPFD_CLOFORK +IPV6_MINHOPCOUNT +IP_MINTTL MSG_CMSG_CLOEXEC MSG_CMSG_CLOFORK O_CLOFORK diff --git a/libc-test/semver/solarish.txt b/libc-test/semver/solarish.txt index 9b1931c5a24f..13af17a0a7a5 100644 --- a/libc-test/semver/solarish.txt +++ b/libc-test/semver/solarish.txt @@ -3,6 +3,7 @@ AIO_CANCELED AIO_NOTCANCELED IPV6_BOUND_IF IPV6_DONTFRAG +IPV6_HOPLIMIT IPV6_PKTINFO IPV6_RECVTCLASS IPV6_TCLASS diff --git a/src/unix/solarish/illumos.rs b/src/unix/solarish/illumos.rs index 50e6302e7c9e..b31c31bd1f6c 100644 --- a/src/unix/solarish/illumos.rs +++ b/src/unix/solarish/illumos.rs @@ -207,6 +207,10 @@ pub const B4000000: crate::speed_t = 31; // sys/systeminfo.h pub const SI_ADDRESS_WIDTH: c_int = 520; +// netinet/in.h +pub const IP_MINTTL: c_int = 0x1c; +pub const IPV6_MINHOPCOUNT: c_int = 0x2f; + // sys/timerfd.h pub const TFD_CLOEXEC: i32 = 0o2000000; pub const TFD_NONBLOCK: i32 = 0o4000; diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index 298d183e3bf7..e41787178178 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -882,6 +882,7 @@ pub const IPV6_MULTICAST_IF: c_int = 0x6; pub const IPV6_MULTICAST_HOPS: c_int = 0x7; pub const IPV6_MULTICAST_LOOP: c_int = 0x8; pub const IPV6_PKTINFO: c_int = 0xb; +pub const IPV6_HOPLIMIT: c_int = 0xc; pub const IPV6_RECVPKTINFO: c_int = 0x12; pub const IPV6_RECVTCLASS: c_int = 0x19; pub const IPV6_DONTFRAG: c_int = 0x21; From 1da5aed1f7ba9a381258effd1f566a5591b9fce1 Mon Sep 17 00:00:00 2001 From: Philip Dye Date: Thu, 7 May 2026 03:08:55 -0400 Subject: [PATCH 12/80] cygwin: fix cpuset_t typo in CPU_ZERO CPU_ZERO at src/unix/cygwin/mod.rs:1712 declares its parameter as &mut cpuset_t, but no type by that name exists in the cygwin module. The struct is cpu_set_t (defined at line 91), and every sibling function (CPU_SET, CPU_CLR, CPU_ISSET, CPU_COUNT, CPU_COUNT_S, CPU_EQUAL) correctly uses cpu_set_t. The typo prevents the cygwin module from compiling on x86_64-pc-cygwin: error[E0425]: cannot find type `cpuset_t` in this scope --> src/unix/cygwin/mod.rs:1712:34 | 1712 | pub fn CPU_ZERO(cpuset: &mut cpuset_t) -> () { | ^^^^^^^^ After this fix, libc and libc-test build cleanly for x86_64-pc-cygwin and the full libc-test suite passes (2968 ctest cases, all other targets green). (backport ) (cherry picked from commit 41f2d1d2cc557e0ff46a1dfc3225ac1e643fbf99) --- src/unix/cygwin/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unix/cygwin/mod.rs b/src/unix/cygwin/mod.rs index 56ee0a5d105e..504eec69841e 100644 --- a/src/unix/cygwin/mod.rs +++ b/src/unix/cygwin/mod.rs @@ -1709,7 +1709,7 @@ f! { s as c_int } - pub fn CPU_ZERO(cpuset: &mut cpuset_t) -> () { + pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { cpuset.bits.fill(0); } From 80b7ee03f61ee193bb09835c2ccfe95b24636e17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 May 2026 21:52:01 +0000 Subject: [PATCH 13/80] build(deps): bump taiki-e/install-action from 2.76.0 to 2.77.6 Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.76.0 to 2.77.6. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/711e1c3275189d76dcc4d34ddea63bf96ac49090...c070f87102a1c75b3183910f391c1cb887fe13c8) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-version: 2.77.6 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit ed7ac8a87f7b2eba95630222b0b559ddbf074b92) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f548c8a1c0cf..884b389fb568 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -81,7 +81,7 @@ jobs: run: ./ci/install-rust.sh - name: Install semver-checks - uses: taiki-e/install-action@711e1c3275189d76dcc4d34ddea63bf96ac49090 # v2.76.0 + uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6 if: matrix.toolchain == 'stable' with: tool: cargo-semver-checks From 3aea6683a671afba5bd292e38164da5809b9e72a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 May 2026 21:52:09 +0000 Subject: [PATCH 14/80] build(deps): bump MarcoIeni/release-plz-action from 0.5.128 to 0.5.129 Bumps [MarcoIeni/release-plz-action](https://github.com/marcoieni/release-plz-action) from 0.5.128 to 0.5.129. - [Release notes](https://github.com/marcoieni/release-plz-action/releases) - [Commits](https://github.com/marcoieni/release-plz-action/compare/1528104d2ca23787631a1c1f022abb64b34c1e11...064f4d1e36c843611ddf013be726beaa4ad804db) --- updated-dependencies: - dependency-name: MarcoIeni/release-plz-action dependency-version: 0.5.129 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit c9f2d1dbc894cc0acc7c9097a7d5799e1607f785) --- .github/workflows/publish_0.2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_0.2.yml b/.github/workflows/publish_0.2.yml index 55f48c7c9d3d..e821b2732ae5 100644 --- a/.github/workflows/publish_0.2.yml +++ b/.github/workflows/publish_0.2.yml @@ -24,7 +24,7 @@ jobs: - name: Install Rust (rustup) run: rustup update stable --no-self-update && rustup default stable - name: Run release-plz - uses: MarcoIeni/release-plz-action@1528104d2ca23787631a1c1f022abb64b34c1e11 # v0.5 + uses: MarcoIeni/release-plz-action@064f4d1e36c843611ddf013be726beaa4ad804db # v0.5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} From 549a94b014f88dd64aab2c8239ae86f176e269b3 Mon Sep 17 00:00:00 2001 From: Asuna Date: Fri, 1 May 2026 23:33:18 +0000 Subject: [PATCH 15/80] Add pthread mutex initializer constants for riscv64 (backport ) (cherry picked from commit 7833bf83a5ca781368c047229f0116775d7f777f) --- libc-test/semver/linux-riscv64gc.txt | 3 ++ .../linux_like/linux/gnu/b64/riscv64/mod.rs | 44 +++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/libc-test/semver/linux-riscv64gc.txt b/libc-test/semver/linux-riscv64gc.txt index 3f0f93a13ac1..0b5f408e2e26 100644 --- a/libc-test/semver/linux-riscv64gc.txt +++ b/libc-test/semver/linux-riscv64gc.txt @@ -30,6 +30,9 @@ NFT_MSG_DELOBJ NFT_MSG_GETOBJ NFT_MSG_GETOBJ_RESET NFT_MSG_NEWOBJ +PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP +PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP +PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP SCM_TIMESTAMPNS SCM_WIFI_STATUS SIGSTKFLT diff --git a/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs b/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs index cbb1502ebcc0..10438234b6e6 100644 --- a/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs @@ -4,6 +4,7 @@ use crate::prelude::*; use crate::{ off64_t, off_t, + pthread_mutex_t, }; pub type wchar_t = c_int; @@ -293,6 +294,49 @@ s_no_extra_traits! { } } +#[cfg(target_endian = "little")] +pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: pthread_mutex_t = pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], +}; +#[cfg(target_endian = "little")] +pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: pthread_mutex_t = pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], +}; +#[cfg(target_endian = "little")] +pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: pthread_mutex_t = pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], +}; +#[cfg(target_endian = "big")] +pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: pthread_mutex_t = pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], +}; +#[cfg(target_endian = "big")] +pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: pthread_mutex_t = pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], +}; +#[cfg(target_endian = "big")] +pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: pthread_mutex_t = pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], +}; + pub const POSIX_FADV_DONTNEED: c_int = 4; pub const POSIX_FADV_NOREUSE: c_int = 5; pub const VEOF: usize = 4; From f28f0eb53abb009ba4b5a33dbf9ddc443d43336c Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Mon, 12 Jan 2026 22:24:35 +0100 Subject: [PATCH 16/80] Add ENOTCAPABLE for macOS Also updates ELAST to 107 since a new error was added. (backport ) (cherry picked from commit e4d0aa8535788afa1cdb2d49f4387bc2d8bfdaf8) --- libc-test/semver/apple.txt | 1 + src/unix/bsd/apple/mod.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index ade5114bbec3..96950dd682c9 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -358,6 +358,7 @@ ENOPOLICY ENOSR ENOSTR ENOTBLK +ENOTCAPABLE ENOTRECOVERABLE ENOTSUP EOF diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index ca916d65e5ed..f5d7fd3e67a9 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -2301,7 +2301,8 @@ pub const ENOPOLICY: c_int = 103; pub const ENOTRECOVERABLE: c_int = 104; pub const EOWNERDEAD: c_int = 105; pub const EQFULL: c_int = 106; -pub const ELAST: c_int = 106; +pub const ENOTCAPABLE: c_int = 107; +pub const ELAST: c_int = 107; pub const EAI_AGAIN: c_int = 2; pub const EAI_BADFLAGS: c_int = 3; From 3b2189bbf16f153a9b8cbafcb5a4d35dbc6e3762 Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Mon, 12 Jan 2026 22:30:21 +0100 Subject: [PATCH 17/80] Add swapped_count to vm_statistics64 on macOS (backport ) (cherry picked from commit 9ffbae558c68175c653ba1c4740637c71c8630e6) --- src/unix/bsd/apple/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index f5d7fd3e67a9..50d1f3c4abd4 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -1521,6 +1521,7 @@ s! { pub external_page_count: natural_t, pub internal_page_count: natural_t, pub total_uncompressed_pages_in_compressor: u64, + pub swapped_count: u64, } #[repr(packed(4))] From d41494827ba16b53d3b3781931a2bf7c34ce0ef4 Mon Sep 17 00:00:00 2001 From: Dylan Conway Date: Thu, 14 May 2026 21:24:29 +0000 Subject: [PATCH 18/80] android: add POSIX_SPAWN_* constants (backport ) (cherry picked from commit a3e451c936e0d7f8532dca077795238eef4cfb65) --- libc-test/semver/android.txt | 9 +++++++++ src/unix/linux_like/android/mod.rs | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt index e48c6d825856..d911d81d8f64 100644 --- a/libc-test/semver/android.txt +++ b/libc-test/semver/android.txt @@ -1936,6 +1936,15 @@ POSIX_FADV_NORMAL POSIX_FADV_RANDOM POSIX_FADV_SEQUENTIAL POSIX_FADV_WILLNEED +POSIX_SPAWN_CLOEXEC_DEFAULT +POSIX_SPAWN_RESETIDS +POSIX_SPAWN_SETPGROUP +POSIX_SPAWN_SETSCHEDPARAM +POSIX_SPAWN_SETSCHEDULER +POSIX_SPAWN_SETSID +POSIX_SPAWN_SETSIGDEF +POSIX_SPAWN_SETSIGMASK +POSIX_SPAWN_USEVFORK PRIO_MAX PRIO_MIN PRIO_PGRP diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index 309e0999a1cc..2655e145cb80 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -742,6 +742,15 @@ pub const FILENAME_MAX: c_uint = 4096; pub const FOPEN_MAX: c_uint = 20; pub const POSIX_FADV_DONTNEED: c_int = 4; pub const POSIX_FADV_NOREUSE: c_int = 5; +pub const POSIX_SPAWN_RESETIDS: c_short = 1; +pub const POSIX_SPAWN_SETPGROUP: c_short = 2; +pub const POSIX_SPAWN_SETSIGDEF: c_short = 4; +pub const POSIX_SPAWN_SETSIGMASK: c_short = 8; +pub const POSIX_SPAWN_SETSCHEDPARAM: c_short = 16; +pub const POSIX_SPAWN_SETSCHEDULER: c_short = 32; +pub const POSIX_SPAWN_USEVFORK: c_short = 64; +pub const POSIX_SPAWN_SETSID: c_short = 128; +pub const POSIX_SPAWN_CLOEXEC_DEFAULT: c_short = 256; pub const L_tmpnam: c_uint = 4096; pub const TMP_MAX: c_uint = 308915776; pub const _PC_LINK_MAX: c_int = 1; From 8282cb7eb51f2d85a2c2defcd35a7f76690c031e Mon Sep 17 00:00:00 2001 From: Petr Sumbera Date: Mon, 18 May 2026 11:40:49 +0200 Subject: [PATCH 19/80] Use rustup for Solaris CI (backport ) (cherry picked from commit cb5ab4cfa88ab469e644dd400b9235dea10632b0) --- .github/workflows/ci.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 884b389fb568..8317b432fb2b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -321,11 +321,14 @@ jobs: copyback: false prepare: | set -ex - source <(curl -s https://raw.githubusercontent.com/psumbera/solaris-rust/refs/heads/main/sh.rust-web-install) - rustc --version + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ + --profile minimal --default-toolchain nightly -y uname -a run: | - export PATH=$HOME/.rust_solaris/bin:$PATH + set -ex + . "$HOME/.cargo/env" + which rustc + rustc -Vv ./ci/run.sh ${{ matrix.target }} - name: Test on NetBSD From df559986b1ac9eda52683b61264ad2773cc47aed Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Mon, 18 May 2026 14:18:11 +0100 Subject: [PATCH 20/80] chore(cargo): remove deprecated package authors field (backport ) (cherry picked from commit 7d014e57f8963ac5dc082468512728266295d345) --- Cargo.toml | 1 - libc-test/Cargo.toml | 1 - 2 files changed, 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 22057eb6b248..1f1c1af48ecc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,6 @@ keywords = ["libc", "ffi", "bindings", "operating", "system"] categories = ["external-ffi-bindings", "no-std", "os"] exclude = ["/ci/*", "/.github/*", "/triagebot.toml", "cherry-pick-stable.sh"] description = "Raw FFI bindings to platform libraries like libc." -authors = ["The Rust Project Developers"] edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/libc" diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml index d276a34f09ff..3c982729828e 100644 --- a/libc-test/Cargo.toml +++ b/libc-test/Cargo.toml @@ -3,7 +3,6 @@ name = "libc-test" version = "0.1.0" description = "A test crate for the libc crate." publish = false -authors = ["The Rust Project Developers"] edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/libc" From 8006bdfefbbb53814e227ba794b5b1b6a65a6c95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 May 2026 23:45:50 +0000 Subject: [PATCH 21/80] build(deps): bump taiki-e/install-action from 2.77.6 to 2.79.1 Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.77.6 to 2.79.1. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/c070f87102a1c75b3183910f391c1cb887fe13c8...b550161ef8a7bc4f2a671c0b03a18ac9ccedea1e) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-version: 2.79.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit c5c1a5a451e949f0ec3890039877fd2cbd7e4ddf) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8317b432fb2b..b5bceb7e0d90 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -81,7 +81,7 @@ jobs: run: ./ci/install-rust.sh - name: Install semver-checks - uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6 + uses: taiki-e/install-action@b550161ef8a7bc4f2a671c0b03a18ac9ccedea1e # v2.79.1 if: matrix.toolchain == 'stable' with: tool: cargo-semver-checks From 9d22bdb4b996edf30c3aa13c6317bd5d3b1f5916 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Wed, 13 May 2026 18:27:05 +0900 Subject: [PATCH 22/80] chore: migrate to `release-plz/action` (backport ) (cherry picked from commit 7e1465f53bdc65d174eb124bb2c7eb128853157a) --- .github/workflows/publish_0.2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_0.2.yml b/.github/workflows/publish_0.2.yml index e821b2732ae5..d7b153ee71a7 100644 --- a/.github/workflows/publish_0.2.yml +++ b/.github/workflows/publish_0.2.yml @@ -24,7 +24,7 @@ jobs: - name: Install Rust (rustup) run: rustup update stable --no-self-update && rustup default stable - name: Run release-plz - uses: MarcoIeni/release-plz-action@064f4d1e36c843611ddf013be726beaa4ad804db # v0.5 + uses: release-plz/action@064f4d1e36c843611ddf013be726beaa4ad804db # v0.5.129 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} From 91b8273f7e6054ddaaa00743bda51953451c9da5 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Fri, 22 May 2026 09:51:05 +0800 Subject: [PATCH 23/80] nuttx: add SO_KEEPALIVE and TCP keepalive constants (backport ) (cherry picked from commit 4dc9caa7037c0f7ff47a84858c56b81b57b91bed) --- src/unix/nuttx/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/unix/nuttx/mod.rs b/src/unix/nuttx/mod.rs index 150dc43557d2..0f65225fe48f 100644 --- a/src/unix/nuttx/mod.rs +++ b/src/unix/nuttx/mod.rs @@ -501,9 +501,13 @@ pub const SO_LINGER: i32 = 6; pub const SO_RCVTIMEO: i32 = 0xa; pub const SO_SNDTIMEO: i32 = 0xe; pub const SO_BROADCAST: i32 = 1; +pub const SO_KEEPALIVE: i32 = 5; // netinet/tcp.h pub const TCP_NODELAY: i32 = 0x10; +pub const TCP_KEEPIDLE: i32 = 0x11; +pub const TCP_KEEPINTVL: i32 = 0x12; +pub const TCP_KEEPCNT: i32 = 0x13; // nuttx/fs/ioctl.h pub const FIONBIO: i32 = 0x30a; From 45e8a510dc40b224ab192e951c7c1c3c85962768 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 May 2026 20:11:34 +0000 Subject: [PATCH 24/80] build(deps): bump vmactions/solaris-vm from 1.3.3 to 1.3.5 Bumps [vmactions/solaris-vm](https://github.com/vmactions/solaris-vm) from 1.3.3 to 1.3.5. - [Release notes](https://github.com/vmactions/solaris-vm/releases) - [Commits](https://github.com/vmactions/solaris-vm/compare/c20562b2c69737b06be9e828915761703e487373...ccfaaeedda3686a8c26cfaee9aadd1c32c30b439) --- updated-dependencies: - dependency-name: vmactions/solaris-vm dependency-version: 1.3.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit 59e4578dae5a78f116b8448da829d9fd249e64e1) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b5bceb7e0d90..8a8781dfaaf8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -312,7 +312,7 @@ jobs: ./ci/run.sh ${{ matrix.target }} - name: test on Solaris - uses: vmactions/solaris-vm@c20562b2c69737b06be9e828915761703e487373 # v1.3.3 + uses: vmactions/solaris-vm@ccfaaeedda3686a8c26cfaee9aadd1c32c30b439 # v1.3.5 if: contains(matrix.target, 'solaris') with: release: "11.4-gcc" From f08289caea14ff6594983be1266f72fbc5e40abe Mon Sep 17 00:00:00 2001 From: Paul Mabileau Date: Tue, 19 May 2026 16:31:13 +0200 Subject: [PATCH 25/80] Feat(apple): Add `PROC_PIDT_SHORTBSDINFO` and `proc_bsdshortinfo` Defined respectively at: * https://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/bsd/sys/proc_info.h#L760 * https://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/bsd/sys/proc_info.h#L85 Signed-off-by: Paul Mabileau (backport ) (cherry picked from commit bdcb4b521a774a383e74f9a0cd60665d7b858383) --- libc-test/semver/apple.txt | 1 + src/unix/bsd/apple/mod.rs | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index 96950dd682c9..1972308793dc 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -2179,6 +2179,7 @@ posix_spawnattr_t posix_spawnp preadv proc_bsdinfo +proc_bsdshortinfo proc_kmsgbuf proc_libversion proc_listallpids diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 50d1f3c4abd4..ead358475b63 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -628,6 +628,35 @@ s! { pub pbi_start_tvusec: u64, } + pub struct proc_bsdshortinfo { + /// Process ID. + pub pbsi_pid: u32, + /// Process parent ID. + pub pbsi_ppid: u32, + /// Process perp ID. + pub pbsi_pgid: u32, + /// `p_stat` value: `SZOMB`, `SRUN`, etc. + pub pbsi_status: u32, + /// Up to 16 characters of process name. + pub pbsi_comm: [c_char; MAXCOMLEN], + /// 64bit, emulated, etc. + pub pbsi_flags: u32, + /// Current UID on process. + pub pbsi_uid: crate::uid_t, + /// Current GID on process. + pub pbsi_gid: crate::gid_t, + /// Current RUID on process. + pub pbsi_ruid: crate::uid_t, + /// Current RGID on process. + pub pbsi_rgid: crate::gid_t, + /// Current SVUID on process. + pub pbsi_svuid: crate::uid_t, + /// Current SVGID on process. + pub pbsi_svgid: crate::gid_t, + /// Reserved for future use. + pub pbsi_rfu: u32, + } + pub struct proc_taskallinfo { pub pbsd: proc_bsdinfo, pub ptinfo: proc_taskinfo, @@ -3695,6 +3724,7 @@ pub const PROC_PIDTBSDINFO: c_int = 3; pub const PROC_PIDTASKINFO: c_int = 4; pub const PROC_PIDTHREADINFO: c_int = 5; pub const PROC_PIDVNODEPATHINFO: c_int = 9; +pub const PROC_PIDT_SHORTBSDINFO: c_int = 13; pub const PROC_PIDPATHINFO_MAXSIZE: c_int = 4096; pub const PROC_PIDLISTFDS: c_int = 1; From ae665401fa50b8274c7e1a07bfa8f96f3469ce0f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 May 2026 20:11:57 +0000 Subject: [PATCH 26/80] build(deps): bump taiki-e/install-action from 2.79.1 to 2.79.7 Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.79.1 to 2.79.7. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/b550161ef8a7bc4f2a671c0b03a18ac9ccedea1e...d9be7d8cda89035c9c843f78bd44d4f72d8403d4) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-version: 2.79.7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit c5134521e8da4273740444b079d2a439a65648bc) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8a8781dfaaf8..3dadf1f499ac 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -81,7 +81,7 @@ jobs: run: ./ci/install-rust.sh - name: Install semver-checks - uses: taiki-e/install-action@b550161ef8a7bc4f2a671c0b03a18ac9ccedea1e # v2.79.1 + uses: taiki-e/install-action@d9be7d8cda89035c9c843f78bd44d4f72d8403d4 # v2.79.7 if: matrix.toolchain == 'stable' with: tool: cargo-semver-checks From 4723b798232e7cbe45434eb056b90266bd79c659 Mon Sep 17 00:00:00 2001 From: jiang1997 Date: Mon, 25 May 2026 07:09:28 +0800 Subject: [PATCH 27/80] musl: add renameat2 binding (backport ) (cherry picked from commit 88ea64b8b67e39a7af16d36ceef567fbbed7e9d0) --- libc-test/build.rs | 2 ++ libc-test/semver/linux-musl.txt | 1 + src/unix/linux_like/linux/musl/mod.rs | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index f5455afe5c74..583709e8bee7 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -4792,6 +4792,8 @@ fn test_linux(target: &str) { "preadv2" | "pwritev2" if musl => true, // FIXME(musl): Supported in new musl but we don't have a new enough version in CI. "statx" if musl => true, + // FIXME(musl): Supported since musl 1.2.6 but not yet in CI. + "renameat2" if musl => true, // Needs glibc 2.33 or later. "mallinfo2" => true, diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt index 397135477743..ff5bc25939b5 100644 --- a/libc-test/semver/linux-musl.txt +++ b/libc-test/semver/linux-musl.txt @@ -87,6 +87,7 @@ pututxline pwritev2 pwritev64 reallocarray +renameat2 setutxent tcp_info timex diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs index 9d3009cba880..8b6cec713222 100644 --- a/src/unix/linux_like/linux/musl/mod.rs +++ b/src/unix/linux_like/linux/musl/mod.rs @@ -795,6 +795,13 @@ extern "C" { flags: c_int, ) -> ssize_t; pub fn getauxval(type_: c_ulong) -> c_ulong; + pub fn renameat2( + olddirfd: c_int, + oldpath: *const c_char, + newdirfd: c_int, + newpath: *const c_char, + flags: c_uint, + ) -> c_int; // Added in `musl` 1.1.20 pub fn explicit_bzero(s: *mut c_void, len: size_t); From e7c893ca3e8a26a82e84b393a74b0e3419c55115 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Wed, 27 May 2026 16:23:14 +0700 Subject: [PATCH 28/80] redox: Add *at and dirent functions (backport ) (cherry picked from commit 7491ac8daf5e9ada26fe3a6c44835ee007997a82) --- libc-test/semver/redox.txt | 17 +++++++++++++++++ src/unix/mod.rs | 29 +++++++++++++---------------- src/unix/redox/mod.rs | 18 ++++++++++++++++++ 3 files changed, 48 insertions(+), 16 deletions(-) diff --git a/libc-test/semver/redox.txt b/libc-test/semver/redox.txt index 95d289f9da41..ef9caaed63e4 100644 --- a/libc-test/semver/redox.txt +++ b/libc-test/semver/redox.txt @@ -4,7 +4,12 @@ ATF_COM ATF_PERM ATF_PUBL ATF_USETRAILERS +AT_EACCESS +AT_EMPTY_PATH AT_FDCWD +AT_REMOVEDIR +AT_SYMLINK_FOLLOW +AT_SYMLINK_NOFOLLOW B1000000 B1152000 B1500000 @@ -140,6 +145,7 @@ O_NOCTTY O_PATH O_SHLOCK O_SYMLINK +O_SYNC PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_ERRORCHECK PTHREAD_MUTEX_ROBUST @@ -199,6 +205,8 @@ TCSETS TIOCGPGRP TIOCSCTTY TIOCSPGRP +UTIME_NOW +UTIME_OMIT UTSLENGTH VDISCARD VLNEXT @@ -291,6 +299,8 @@ __errno_location bsearch chroot clearerr +clock_getres +clock_gettime difftime dirfd endgrent @@ -302,7 +312,9 @@ epoll_ctl epoll_event epoll_wait explicit_bzero +faccessat fchdir +fdopendir fmemopen getdtablesize getgrent @@ -325,11 +337,14 @@ lockf login_tty madvise memalign +mkdirat +mknodat mkostemp mkostemps nice open_memstream open_wmemstream +openat openpty pipe2 pthread_condattr_setclock @@ -337,6 +352,7 @@ qsort reallocarray renameat2 rlim_t +seekdir sem_clockwait sem_destroy sem_getvalue @@ -363,3 +379,4 @@ strncasecmp strndup strsignal ttyname_r +utimensat diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 207c36b82d55..3f5451c2b643 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -957,6 +957,15 @@ extern "C" { )] #[cfg_attr(target_os = "netbsd", link_name = "__opendir30")] pub fn opendir(dirname: *const c_char) -> *mut crate::DIR; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86_64"), + link_name = "fdopendir$INODE64" + )] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "fdopendir$INODE64$UNIX2003" + )] + pub fn fdopendir(fd: c_int) -> *mut crate::DIR; #[cfg_attr( all(target_os = "macos", not(target_arch = "aarch64")), @@ -994,6 +1003,8 @@ extern "C" { group: crate::gid_t, flags: c_int, ) -> c_int; + #[cfg_attr(gnu_file_offset_bits64, link_name = "openat64")] + pub fn openat(dirfd: c_int, pathname: *const c_char, flags: c_int, ...) -> c_int; #[cfg_attr( all(target_os = "macos", not(target_arch = "aarch64")), link_name = "fstatat$INODE64" @@ -1019,6 +1030,8 @@ extern "C" { flags: c_int, ) -> c_int; #[cfg(not(target_os = "l4re"))] + pub fn mkdirat(dirfd: c_int, pathname: *const c_char, mode: mode_t) -> c_int; + #[cfg(not(target_os = "l4re"))] pub fn renameat( olddirfd: c_int, oldpath: *const c_char, @@ -2201,22 +2214,6 @@ cfg_if! { link_name = "pause$UNIX2003" )] pub fn pause() -> c_int; - - #[cfg(not(target_os = "l4re"))] - pub fn mkdirat(dirfd: c_int, pathname: *const c_char, mode: mode_t) -> c_int; - #[cfg_attr(gnu_file_offset_bits64, link_name = "openat64")] - pub fn openat(dirfd: c_int, pathname: *const c_char, flags: c_int, ...) -> c_int; - - #[cfg_attr( - all(target_os = "macos", target_arch = "x86_64"), - link_name = "fdopendir$INODE64" - )] - #[cfg_attr( - all(target_os = "macos", target_arch = "x86"), - link_name = "fdopendir$INODE64$UNIX2003" - )] - pub fn fdopendir(fd: c_int) -> *mut crate::DIR; - #[cfg_attr( all(target_os = "macos", not(target_arch = "aarch64")), link_name = "readdir_r$INODE64" diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs index 4326cdfdd700..bd39b872c383 100644 --- a/src/unix/redox/mod.rs +++ b/src/unix/redox/mod.rs @@ -345,6 +345,11 @@ pub const F_TLOCK: c_int = 2; pub const F_TEST: c_int = 3; pub const AT_FDCWD: c_int = -100; +pub const AT_SYMLINK_NOFOLLOW: c_int = 0x200; +pub const AT_REMOVEDIR: c_int = 0x200; +pub const AT_SYMLINK_FOLLOW: c_int = 0x2000; +pub const AT_EMPTY_PATH: c_int = 0x4000; +pub const AT_EACCESS: c_int = 0x400; // FIXME(redox): relibc { pub const RTLD_DEFAULT: *mut c_void = ptr::null_mut(); @@ -516,6 +521,7 @@ pub const O_SHLOCK: c_int = 0x0010_0000; pub const O_EXLOCK: c_int = 0x0020_0000; pub const O_ASYNC: c_int = 0x0040_0000; pub const O_FSYNC: c_int = 0x0080_0000; +pub const O_SYNC: c_int = O_FSYNC; pub const O_CLOEXEC: c_int = 0x0100_0000; pub const O_CREAT: c_int = 0x0200_0000; pub const O_TRUNC: c_int = 0x0400_0000; @@ -725,6 +731,8 @@ pub const S_IRWXO: c_int = 0o0007; pub const S_IROTH: c_int = 0o0004; pub const S_IWOTH: c_int = 0o0002; pub const S_IXOTH: c_int = 0o0001; +pub const UTIME_NOW: c_long = 0xffffffff; +pub const UTIME_OMIT: c_long = 0xfffffffe; // stdlib.h pub const EXIT_SUCCESS: c_int = 0; @@ -1204,8 +1212,10 @@ extern "C" { // dirent.h pub fn dirfd(dirp: *mut crate::DIR) -> c_int; + pub fn seekdir(dirp: *mut crate::DIR, loc: c_long); // unistd.h + pub fn faccessat(dirfd: c_int, pathname: *const c_char, mode: c_int, flags: c_int) -> c_int; pub fn pipe2(fds: *mut c_int, flags: c_int) -> c_int; pub fn getdtablesize() -> c_int; pub fn getresgid( @@ -1406,6 +1416,13 @@ extern "C" { // sys/stat.h pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int; + pub fn mknodat(dirfd: c_int, pathname: *const c_char, mode: mode_t, dev: dev_t) -> c_int; + pub fn utimensat( + dirfd: c_int, + path: *const c_char, + times: *const crate::timespec, + flag: c_int, + ) -> c_int; // sys/uio.h pub fn preadv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t; @@ -1418,6 +1435,7 @@ extern "C" { // time.h pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut crate::timezone) -> c_int; + pub fn clock_getres(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; pub fn strftime( s: *mut c_char, From d78d8e58993e7b4b0954deb19aeba9630c1e59df Mon Sep 17 00:00:00 2001 From: Nicholas Robinson Date: Mon, 18 May 2026 14:20:10 -0400 Subject: [PATCH 29/80] feat(android): add timer_[create, delete, getoverrun, gettime, settime] Add timer_create, timer_delete, timer_getoverrun, timer_gettime, and timer_settime to the Android extern block. These are standard POSIX per-process timer functions provided by Bionic but missing from the libc crate's Android bindings. (backport ) (cherry picked from commit 2364caf83be0f55ead8bd34dfb82cce66a17c387) --- libc-test/semver/android.txt | 5 +++++ src/unix/linux_like/android/mod.rs | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt index d911d81d8f64..e2bff6a4ec59 100644 --- a/libc-test/semver/android.txt +++ b/libc-test/semver/android.txt @@ -4099,6 +4099,11 @@ tgkill time time_t timegm +timer_create +timer_delete +timer_getoverrun +timer_gettime +timer_settime timerfd_create timerfd_gettime timerfd_settime diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index 2655e145cb80..90bf12a8be93 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -3540,6 +3540,20 @@ extern "C" { new_value: *const itimerspec, old_value: *mut itimerspec, ) -> c_int; + pub fn timer_create( + clockid: crate::clockid_t, + sevp: *mut crate::sigevent, + timerid: *mut crate::timer_t, + ) -> c_int; + pub fn timer_delete(timerid: crate::timer_t) -> c_int; + pub fn timer_getoverrun(timerid: crate::timer_t) -> c_int; + pub fn timer_gettime(timerid: crate::timer_t, curr_value: *mut crate::itimerspec) -> c_int; + pub fn timer_settime( + timerid: crate::timer_t, + flags: c_int, + new_value: *const crate::itimerspec, + old_value: *mut crate::itimerspec, + ) -> c_int; pub fn syscall(num: c_long, ...) -> c_long; pub fn sched_getaffinity( pid: crate::pid_t, From 3bef69a780a2314ae9e71ece291215e65aa5fdfc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2026 17:55:01 +0000 Subject: [PATCH 30/80] build(deps): bump taiki-e/install-action from 2.79.7 to 2.81.2 Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.79.7 to 2.81.2. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/d9be7d8cda89035c9c843f78bd44d4f72d8403d4...6887963ccf37a9ddcd8c5fa4baeb3e1e5fd61fa1) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-version: 2.81.2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit a10b351961a0027e540318f9b6ecace1364ba35d) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3dadf1f499ac..306c3bf4dcd0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -81,7 +81,7 @@ jobs: run: ./ci/install-rust.sh - name: Install semver-checks - uses: taiki-e/install-action@d9be7d8cda89035c9c843f78bd44d4f72d8403d4 # v2.79.7 + uses: taiki-e/install-action@6887963ccf37a9ddcd8c5fa4baeb3e1e5fd61fa1 # v2.81.2 if: matrix.toolchain == 'stable' with: tool: cargo-semver-checks From 34b748d40c35f16014db8afec10fe313fe6f1935 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2026 17:55:12 +0000 Subject: [PATCH 31/80] build(deps): bump actions/checkout from 6.0.2 to 6.0.3 Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 6.0.3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...df4cb1c069e1874edd31b4311f1884172cec0e10) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit 51a5a642a5ee10d9b7d83de23f5c31fb61f655a8) --- .github/workflows/ci.yaml | 14 +++++++------- .github/workflows/publish_0.2.yml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 306c3bf4dcd0..f4bf6b934093 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-24.04 timeout-minutes: 10 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Setup Rust toolchain @@ -43,7 +43,7 @@ jobs: runs-on: ${{ matrix.os }} timeout-minutes: 10 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - run: rustup update stable --no-self-update @@ -74,7 +74,7 @@ jobs: env: TOOLCHAIN: ${{ matrix.toolchain }} steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Setup Rust toolchain @@ -139,7 +139,7 @@ jobs: env: TARGET: ${{ matrix.target }} steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Setup Rust toolchain @@ -237,7 +237,7 @@ jobs: env: TARGET: ${{ matrix.target }} steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Setup Rust toolchain @@ -288,7 +288,7 @@ jobs: - target: x86_64-unknown-netbsd timeout-minutes: 25 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Test on FreeBSD @@ -356,7 +356,7 @@ jobs: runs-on: ubuntu-24.04 timeout-minutes: 10 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Install Rust diff --git a/.github/workflows/publish_0.2.yml b/.github/workflows/publish_0.2.yml index d7b153ee71a7..e9475a597421 100644 --- a/.github/workflows/publish_0.2.yml +++ b/.github/workflows/publish_0.2.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: fetch-depth: 0 persist-credentials: false From 3b557cc2a26672273080ee1ffb69ecc296bfec32 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2026 17:55:15 +0000 Subject: [PATCH 32/80] build(deps): bump vmactions/netbsd-vm from 1.3.8 to 1.3.9 Bumps [vmactions/netbsd-vm](https://github.com/vmactions/netbsd-vm) from 1.3.8 to 1.3.9. - [Release notes](https://github.com/vmactions/netbsd-vm/releases) - [Commits](https://github.com/vmactions/netbsd-vm/compare/eb3ba840926911ccf17dc9de235335cb27a02ba0...ad31081832386a0ba569aee243e6edf9524f3f80) --- updated-dependencies: - dependency-name: vmactions/netbsd-vm dependency-version: 1.3.9 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit eeafe5dc7595ddf20e4fb83e279112ff712e77f8) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f4bf6b934093..c8127fec9c8a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -332,7 +332,7 @@ jobs: ./ci/run.sh ${{ matrix.target }} - name: Test on NetBSD - uses: vmactions/netbsd-vm@eb3ba840926911ccf17dc9de235335cb27a02ba0 # v1.3.8 + uses: vmactions/netbsd-vm@ad31081832386a0ba569aee243e6edf9524f3f80 # v1.3.9 if: contains(matrix.target, 'netbsd') with: release: "10.1" From 54990bab6e11cb3d541754733fca9f189398d2cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2026 17:54:39 +0000 Subject: [PATCH 33/80] build(deps): bump vmactions/solaris-vm from 1.3.5 to 1.3.6 Bumps [vmactions/solaris-vm](https://github.com/vmactions/solaris-vm) from 1.3.5 to 1.3.6. - [Release notes](https://github.com/vmactions/solaris-vm/releases) - [Commits](https://github.com/vmactions/solaris-vm/compare/ccfaaeedda3686a8c26cfaee9aadd1c32c30b439...3702ccf20b84c7f7c0a9bb68894aba7623f8301d) --- updated-dependencies: - dependency-name: vmactions/solaris-vm dependency-version: 1.3.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit 61b9c279ad3349288034fc31b4ad2f1734c67c9a) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c8127fec9c8a..a7ae45ea2318 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -312,7 +312,7 @@ jobs: ./ci/run.sh ${{ matrix.target }} - name: test on Solaris - uses: vmactions/solaris-vm@ccfaaeedda3686a8c26cfaee9aadd1c32c30b439 # v1.3.5 + uses: vmactions/solaris-vm@3702ccf20b84c7f7c0a9bb68894aba7623f8301d # v1.3.6 if: contains(matrix.target, 'solaris') with: release: "11.4-gcc" From c8da2f785f062613db64d31cb3776a7f24db2ff1 Mon Sep 17 00:00:00 2001 From: fullzer4 Date: Mon, 1 Jun 2026 18:46:52 -0300 Subject: [PATCH 34/80] aarch64: add missing SYS_sendfile and SYS_fadvise64 constants (backport ) (cherry picked from commit dbd7ad9a0ef5205226d8541f2a1a7cbdd9da2989) --- libc-test/semver/linux-aarch64.txt | 2 ++ src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs | 2 ++ src/unix/linux_like/linux/musl/b64/aarch64/mod.rs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/libc-test/semver/linux-aarch64.txt b/libc-test/semver/linux-aarch64.txt index c4bce0196f8a..03a312bcc13d 100644 --- a/libc-test/semver/linux-aarch64.txt +++ b/libc-test/semver/linux-aarch64.txt @@ -76,6 +76,7 @@ SKF_NET_OFF SO_PRIORITY SO_PROTOCOL SYS_accept +SYS_fadvise64 SYS_fstat SYS_msgctl SYS_msgget @@ -90,6 +91,7 @@ SYS_semctl SYS_semget SYS_semop SYS_semtimedop +SYS_sendfile SYS_setrlimit SYS_shmat SYS_shmctl diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs index b8c55dc33c89..beafaf4e2d47 100644 --- a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs @@ -712,6 +712,7 @@ pub const SYS_pread64: c_long = 67; pub const SYS_pwrite64: c_long = 68; pub const SYS_preadv: c_long = 69; pub const SYS_pwritev: c_long = 70; +pub const SYS_sendfile: c_long = 71; pub const SYS_pselect6: c_long = 72; pub const SYS_ppoll: c_long = 73; pub const SYS_signalfd4: c_long = 74; @@ -863,6 +864,7 @@ pub const SYS_keyctl: c_long = 219; pub const SYS_clone: c_long = 220; pub const SYS_execve: c_long = 221; pub const SYS_mmap: c_long = 222; +pub const SYS_fadvise64: c_long = 223; pub const SYS_swapon: c_long = 224; pub const SYS_swapoff: c_long = 225; pub const SYS_mprotect: c_long = 226; diff --git a/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs b/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs index 82df29bf43a1..5a1fa8866add 100644 --- a/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs +++ b/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs @@ -373,6 +373,7 @@ pub const SYS_pread64: c_long = 67; pub const SYS_pwrite64: c_long = 68; pub const SYS_preadv: c_long = 69; pub const SYS_pwritev: c_long = 70; +pub const SYS_sendfile: c_long = 71; pub const SYS_pselect6: c_long = 72; pub const SYS_ppoll: c_long = 73; pub const SYS_signalfd4: c_long = 74; @@ -524,6 +525,7 @@ pub const SYS_keyctl: c_long = 219; pub const SYS_clone: c_long = 220; pub const SYS_execve: c_long = 221; pub const SYS_mmap: c_long = 222; +pub const SYS_fadvise64: c_long = 223; pub const SYS_swapon: c_long = 224; pub const SYS_swapoff: c_long = 225; pub const SYS_mprotect: c_long = 226; From 543add849766c868bf15cacf988b81d3db2ecbe2 Mon Sep 17 00:00:00 2001 From: Francisco Gouveia Date: Thu, 4 Jun 2026 19:06:32 +0100 Subject: [PATCH 35/80] Remove unnecessary clones in match statements (backport ) (cherry picked from commit d03c1dcd8306f7f11c9a5ff30a1b589afd92391f) --- build.rs | 4 ++-- libc-test/build.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.rs b/build.rs index 34df96aa7ce0..c6954cf31f80 100644 --- a/build.rs +++ b/build.rs @@ -151,10 +151,10 @@ fn main() { ) { (Ok(_), Ok(_)) => panic!("Do not set both RUST_LIBC_UNSTABLE_GNU_TIME_BITS and RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS"), (Err(_), Err(_)) => (defaultbits.clone(), defaultbits.clone()), - (Ok(tb), Err(_)) if tb == "64" => (tb.clone(), tb.clone()), + (Ok(tb), Err(_)) if tb == "64" => (tb.clone(), tb), (Ok(tb), Err(_)) if tb == "32" => (tb, defaultbits.clone()), (Ok(_), Err(_)) => panic!("Invalid value for RUST_LIBC_UNSTABLE_GNU_TIME_BITS, must be 32 or 64"), - (Err(_), Ok(fb)) if fb == "32" || fb == "64" => (defaultbits.clone(), fb), + (Err(_), Ok(fb)) if fb == "32" || fb == "64" => (defaultbits, fb), (Err(_), Ok(_)) => panic!("Invalid value for RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS, must be 32 or 64"), }; let valid_bits = ["32", "64"]; diff --git a/libc-test/build.rs b/libc-test/build.rs index 583709e8bee7..a2d453ca431e 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -3781,10 +3781,10 @@ fn config_gnu_bits(target: &str, cfg: &mut ctest::TestGenerator) { ) { (Ok(_), Ok(_)) => panic!("Do not set both RUST_LIBC_UNSTABLE_GNU_TIME_BITS and RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS"), (Err(_), Err(_)) => (defaultbits.clone(), defaultbits.clone()), - (Ok(tb), Err(_)) if tb == "64" => (tb.clone(), tb.clone()), + (Ok(tb), Err(_)) if tb == "64" => (tb.clone(), tb), (Ok(tb), Err(_)) if tb == "32" => (tb, defaultbits.clone()), (Ok(_), Err(_)) => panic!("Invalid value for RUST_LIBC_UNSTABLE_GNU_TIME_BITS, must be 32 or 64"), - (Err(_), Ok(fb)) if fb == "32" || fb == "64" => (defaultbits.clone(), fb), + (Err(_), Ok(fb)) if fb == "32" || fb == "64" => (defaultbits, fb), (Err(_), Ok(_)) => panic!("Invalid value for RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS, must be 32 or 64"), }; let valid_bits = ["32", "64"]; From f6203fafa92bfc932d4adb4fd4b4b9fc2dbde730 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2026 17:55:06 +0000 Subject: [PATCH 36/80] build(deps): bump vmactions/freebsd-vm from 1.4.5 to 1.4.6 Bumps [vmactions/freebsd-vm](https://github.com/vmactions/freebsd-vm) from 1.4.5 to 1.4.6. - [Release notes](https://github.com/vmactions/freebsd-vm/releases) - [Commits](https://github.com/vmactions/freebsd-vm/compare/d1e65811565151536c0c894fff74f06351ed26e6...a6de9343ef5747433d9c25784c90e84998b9d69a) --- updated-dependencies: - dependency-name: vmactions/freebsd-vm dependency-version: 1.4.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit fe7f7b4936d035152d0063d0539ae48d59b4f471) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a7ae45ea2318..06877201300d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -292,7 +292,7 @@ jobs: with: persist-credentials: false - name: Test on FreeBSD - uses: vmactions/freebsd-vm@d1e65811565151536c0c894fff74f06351ed26e6 # v1.4.5 + uses: vmactions/freebsd-vm@a6de9343ef5747433d9c25784c90e84998b9d69a # v1.4.6 if: contains(matrix.target, 'freebsd') with: release: ${{ matrix.release }} From 75b9c7afc704c20ff5a7872e5a23cd6e532bec88 Mon Sep 17 00:00:00 2001 From: Ondrej Perutka Date: Thu, 4 Jun 2026 12:40:48 +0200 Subject: [PATCH 37/80] Fix constants accidentally removed for Linux uClibc targets The constants were removed by commit 2fe1d91 for uClibc in all operating systems. However, the commit was supposed to fix things for L4Re, not break things for other operating systems. So this commit limits the uClibc exclusions introduced in 2fe1d91 to apply only if the target OS is L4Re. (backport ) (cherry picked from commit 022b3249ba8f5f31e52bdecde0eac10f34abe5d7) --- src/unix/linux_like/mod.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index 133c57fc4dec..b2a2f39129d0 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -760,11 +760,11 @@ pub const IP_TRANSPARENT: c_int = 19; pub const IP_ORIGDSTADDR: c_int = 20; pub const IP_RECVORIGDSTADDR: c_int = IP_ORIGDSTADDR; pub const IP_MINTTL: c_int = 21; -#[cfg(not(target_env = "uclibc"))] +#[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] pub const IP_NODEFRAG: c_int = 22; -#[cfg(not(target_env = "uclibc"))] +#[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] pub const IP_CHECKSUM: c_int = 23; -#[cfg(not(target_env = "uclibc"))] +#[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] pub const IP_BIND_ADDRESS_NO_PORT: c_int = 24; pub const IP_MULTICAST_IF: c_int = 32; pub const IP_MULTICAST_TTL: c_int = 33; @@ -786,9 +786,9 @@ pub const IP_PMTUDISC_DONT: c_int = 0; pub const IP_PMTUDISC_WANT: c_int = 1; pub const IP_PMTUDISC_DO: c_int = 2; pub const IP_PMTUDISC_PROBE: c_int = 3; -#[cfg(not(target_env = "uclibc"))] +#[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] pub const IP_PMTUDISC_INTERFACE: c_int = 4; -#[cfg(not(target_env = "uclibc"))] +#[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] pub const IP_PMTUDISC_OMIT: c_int = 5; // IPPROTO_IP defined in src/unix/mod.rs @@ -898,16 +898,16 @@ pub const IPV6_RECVRTHDR: c_int = 56; pub const IPV6_RTHDR: c_int = 57; pub const IPV6_RECVDSTOPTS: c_int = 58; pub const IPV6_DSTOPTS: c_int = 59; -#[cfg(not(target_env = "uclibc"))] +#[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] pub const IPV6_RECVPATHMTU: c_int = 60; -#[cfg(not(target_env = "uclibc"))] +#[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] pub const IPV6_PATHMTU: c_int = 61; -#[cfg(not(target_env = "uclibc"))] +#[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] pub const IPV6_DONTFRAG: c_int = 62; pub const IPV6_RECVTCLASS: c_int = 66; pub const IPV6_TCLASS: c_int = 67; cfg_if! { - if #[cfg(not(target_env = "uclibc"))] { + if #[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] { pub const IPV6_AUTOFLOWLABEL: c_int = 70; pub const IPV6_ADDR_PREFERENCES: c_int = 72; pub const IPV6_MINHOPCOUNT: c_int = 73; @@ -1171,7 +1171,7 @@ pub const __WALL: c_int = 0x40000000; pub const __WCLONE: c_int = 0x80000000; cfg_if! { - if #[cfg(not(target_env = "uclibc"))] { + if #[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] { pub const SPLICE_F_MOVE: c_uint = 0x01; pub const SPLICE_F_NONBLOCK: c_uint = 0x02; pub const SPLICE_F_MORE: c_uint = 0x04; From d1fb5dac95d4cd5b2e49a6c6199df225bb6d1ad9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2026 14:03:26 +0000 Subject: [PATCH 38/80] build(deps): bump vmactions/netbsd-vm from 1.3.9 to 1.4.0 Bumps [vmactions/netbsd-vm](https://github.com/vmactions/netbsd-vm) from 1.3.9 to 1.4.0. - [Release notes](https://github.com/vmactions/netbsd-vm/releases) - [Commits](https://github.com/vmactions/netbsd-vm/compare/ad31081832386a0ba569aee243e6edf9524f3f80...99816dccf75edf233ed6cd00a159e3a5b85ea373) --- updated-dependencies: - dependency-name: vmactions/netbsd-vm dependency-version: 1.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit d1e34f1d6ef22c1168033034494e489d0ddf5bd4) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 06877201300d..9042df9de7bb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -332,7 +332,7 @@ jobs: ./ci/run.sh ${{ matrix.target }} - name: Test on NetBSD - uses: vmactions/netbsd-vm@ad31081832386a0ba569aee243e6edf9524f3f80 # v1.3.9 + uses: vmactions/netbsd-vm@99816dccf75edf233ed6cd00a159e3a5b85ea373 # v1.4.0 if: contains(matrix.target, 'netbsd') with: release: "10.1" From a3ccd41d28f13ef9db37880f46b30fc1248fe7e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2026 14:03:50 +0000 Subject: [PATCH 39/80] build(deps): bump taiki-e/install-action from 2.81.2 to 2.81.8 Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.81.2 to 2.81.8. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/6887963ccf37a9ddcd8c5fa4baeb3e1e5fd61fa1...0631aa6515c7d545823c67cfae7ef4fc7f490154) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-version: 2.81.8 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit 16774a4083f87d12e87532d3b4877ea5fbb51de3) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9042df9de7bb..c9415580779d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -81,7 +81,7 @@ jobs: run: ./ci/install-rust.sh - name: Install semver-checks - uses: taiki-e/install-action@6887963ccf37a9ddcd8c5fa4baeb3e1e5fd61fa1 # v2.81.2 + uses: taiki-e/install-action@0631aa6515c7d545823c67cfae7ef4fc7f490154 # v2.81.8 if: matrix.toolchain == 'stable' with: tool: cargo-semver-checks From 21266190723d0bc3afb7581a0f9dff439ff0b921 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2026 14:03:56 +0000 Subject: [PATCH 40/80] build(deps): bump vmactions/solaris-vm from 1.3.6 to 1.3.7 Bumps [vmactions/solaris-vm](https://github.com/vmactions/solaris-vm) from 1.3.6 to 1.3.7. - [Release notes](https://github.com/vmactions/solaris-vm/releases) - [Commits](https://github.com/vmactions/solaris-vm/compare/3702ccf20b84c7f7c0a9bb68894aba7623f8301d...d30dd6c228c8661ade859e36ead7660b9a62efcc) --- updated-dependencies: - dependency-name: vmactions/solaris-vm dependency-version: 1.3.7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit 8132431a05a94bfce91b56fd1bac74e224d9230a) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c9415580779d..492d270e097a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -312,7 +312,7 @@ jobs: ./ci/run.sh ${{ matrix.target }} - name: test on Solaris - uses: vmactions/solaris-vm@3702ccf20b84c7f7c0a9bb68894aba7623f8301d # v1.3.6 + uses: vmactions/solaris-vm@d30dd6c228c8661ade859e36ead7660b9a62efcc # v1.3.7 if: contains(matrix.target, 'solaris') with: release: "11.4-gcc" From 5684db68b639071a7cae8257f975310305ee2312 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Wed, 10 Jun 2026 18:34:59 +0900 Subject: [PATCH 41/80] fix: remove unused imports (backport ) (cherry picked from commit f228f268207b25fb00a6d30d94d357e01d8078a5) --- src/new/apple/mod.rs | 1 - src/new/mod.rs | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/new/apple/mod.rs b/src/new/apple/mod.rs index beb8caab63c2..1708cc36f1e9 100644 --- a/src/new/apple/mod.rs +++ b/src/new/apple/mod.rs @@ -16,5 +16,4 @@ mod xnu; pub(crate) use libc::*; pub(crate) use libpthread::pthread_; -pub(crate) use pthread_::pthread; pub(crate) use xnu::*; diff --git a/src/new/mod.rs b/src/new/mod.rs index 1c5d6a6e17c2..6928668f8ac0 100644 --- a/src/new/mod.rs +++ b/src/new/mod.rs @@ -181,7 +181,6 @@ cfg_if! { pub use linux::can::j1939::*; pub use linux::can::netlink::*; pub use linux::can::raw::*; - pub use linux::can::*; pub use linux::keyctl::*; pub use linux::membarrier::*; pub use linux::netlink::*; @@ -189,7 +188,6 @@ cfg_if! { #[cfg(target_env = "gnu")] pub use net::route::*; } else if #[cfg(target_vendor = "apple")] { - pub use pthread::*; pub use pthread_::introspection::*; pub use pthread_::pthread_spis::*; pub use pthread_::spawn::*; From 85d0cf5adebe000b3eb5f924e9311f75d3256908 Mon Sep 17 00:00:00 2001 From: gergelyvagujhelyi <13369913+gergelyvagujhelyi@users.noreply.github.com> Date: Mon, 8 Jun 2026 16:31:31 +0200 Subject: [PATCH 42/80] emscripten: fix pthread type sizes for wasm64 (MEMORY64) On wasm64-unknown-emscripten the pthread types are larger than the hardcoded wasm32 sizes, so pthread_attr_init overruns the pthread_attr_t that std stack-allocates in Thread::new and corrupts the spawn. Sizes from sizeof() via emcc / emcc -sMEMORY64=1: pthread_attr_t : 44 -> 88 (11 pointer-width words -> [usize; 11]) pthread_mutex_t : 24 -> 40 pthread_rwlock_t: 32 -> 56 pthread_cond_t : 48 (unchanged); pthread_t = c_ulong (4/8) already correct (backport ) (cherry picked from commit 8f9915fbaa1fadfac66374504acd4d69237cd699) --- src/unix/linux_like/emscripten/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs index a97e772f99e7..ecae17ef37f7 100644 --- a/src/unix/linux_like/emscripten/mod.rs +++ b/src/unix/linux_like/emscripten/mod.rs @@ -188,7 +188,8 @@ s! { } pub struct pthread_attr_t { - __size: [u32; 11], + // 11 pointer-width words: 44 bytes on wasm32, 88 on wasm64 (MEMORY64). + __size: [usize; 11], } pub struct sigset_t { @@ -1064,8 +1065,14 @@ pub const SO_RXQ_OVFL: c_int = 40; pub const SO_PEEK_OFF: c_int = 42; pub const SO_BUSY_POLL: c_int = 46; +#[cfg(target_pointer_width = "32")] pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; +#[cfg(target_pointer_width = "64")] +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; +#[cfg(target_pointer_width = "32")] pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; +#[cfg(target_pointer_width = "64")] +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; pub const O_DIRECT: c_int = 0x4000; pub const O_DIRECTORY: c_int = 0x10000; From 9cb224a740e7f5fa47e289d78c2728905684098f Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sun, 14 Jun 2026 14:30:51 +0900 Subject: [PATCH 43/80] triagebot: enable no-merges feature (backport ) (cherry picked from commit c4ea92b6ccf512cd1caff2c6cf3a401506badff7) --- triagebot.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/triagebot.toml b/triagebot.toml index 91bc102738b5..0e34f9edbd58 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -4,6 +4,7 @@ allow-unauthenticated = [ "O-*", "S-*", "ctest", + "has-merge-commits", "stable-nominated", ] @@ -113,6 +114,10 @@ remove_labels = ["S-waiting-on-author"] # Those labels are added when PR author requests a review from an assignee add_labels = ["S-waiting-on-review"] +[no-merges] +exclude_titles = ["[0.2]"] +labels = ["has-merge-commits", "S-waiting-on-author"] + [shortcut] [mentions."*openbsd*"] From af8768fc5e6dd4ea03d93611e1ada9f1dc5d33a3 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sun, 31 May 2026 19:27:57 +0900 Subject: [PATCH 44/80] linux: add futex_waitv bindings (backport ) (cherry picked from commit 2f877eaaf8eb52fef58968f6e1b697db5eb9d481) --- libc-test/build.rs | 4 ++++ libc-test/semver/android.txt | 10 ++++++++++ libc-test/semver/linux.txt | 11 +++++++++++ src/unix/linux_like/android/mod.rs | 10 ++++++++++ src/unix/linux_like/linux/mod.rs | 10 ++++++++++ src/unix/linux_like/mod.rs | 8 ++++++++ 6 files changed, 53 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index a2d453ca431e..2899adf48203 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -4355,6 +4355,7 @@ fn test_linux(target: &str) { || name.starts_with("EPOLL") || name.starts_with("F_") || name.starts_with("FALLOC_FL_") + || name.starts_with("FUTEX2_") || name.starts_with("IFLA_") || name.starts_with("KEXEC_") || name.starts_with("MS_") @@ -4508,6 +4509,9 @@ fn test_linux(target: &str) { // FIXME(linux): Not yet implemented on sparc64 "SYS_clone3" if sparc64 => true, + // FIXME(linux): Requires >= 6.9 kernel headers. + n if (arm || ppc32) && n.starts_with("FUTEX2_") => 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 => diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt index e2bff6a4ec59..04a1c67ee4b9 100644 --- a/libc-test/semver/android.txt +++ b/libc-test/semver/android.txt @@ -656,6 +656,14 @@ FS_IOC_GETFLAGS FS_IOC_GETVERSION FS_IOC_SETFLAGS FS_IOC_SETVERSION +FUTEX2_NUMA +FUTEX2_PRIVATE +FUTEX2_SIZE_MASK +FUTEX2_SIZE_U16 +FUTEX2_SIZE_U32 +FUTEX2_SIZE_U64 +FUTEX2_SIZE_U8 +FUTEX_32 FUTEX_CLOCK_REALTIME FUTEX_CMD_MASK FUTEX_CMP_REQUEUE @@ -668,6 +676,7 @@ FUTEX_REQUEUE FUTEX_TRYLOCK_PI FUTEX_UNLOCK_PI FUTEX_WAIT +FUTEX_WAITV_MAX FUTEX_WAIT_BITSET FUTEX_WAIT_REQUEUE_PI FUTEX_WAKE @@ -3545,6 +3554,7 @@ ftell ftello ftruncate ftruncate64 +futex_waitv futimens fwrite fwrite_unlocked diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index 3656ab97aba0..163cb838af46 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -906,6 +906,14 @@ FS_IOC_GETFLAGS FS_IOC_GETVERSION FS_IOC_SETFLAGS FS_IOC_SETVERSION +FUTEX2_NUMA +FUTEX2_PRIVATE +FUTEX2_SIZE_MASK +FUTEX2_SIZE_U16 +FUTEX2_SIZE_U32 +FUTEX2_SIZE_U64 +FUTEX2_SIZE_U8 +FUTEX_32 FUTEX_BITSET_MATCH_ANY FUTEX_CLOCK_REALTIME FUTEX_CMD_MASK @@ -935,6 +943,7 @@ FUTEX_TRYLOCK_PI FUTEX_UNLOCK_PI FUTEX_WAIT FUTEX_WAITERS +FUTEX_WAITV_MAX FUTEX_WAIT_BITSET FUTEX_WAIT_REQUEUE_PI FUTEX_WAKE @@ -3295,6 +3304,7 @@ SYS_fstatfs SYS_fsync SYS_ftruncate SYS_futex +SYS_futex_waitv SYS_get_mempolicy SYS_get_robust_list SYS_getcpu @@ -4109,6 +4119,7 @@ fstatvfs64 ftello64 ftok ftruncate64 +futex_waitv genlmsghdr getdomainname getdtablesize diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index 90bf12a8be93..caa8bf8c2ea3 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -2622,6 +2622,16 @@ pub const FUTEX_PRIVATE_FLAG: c_int = 128; pub const FUTEX_CLOCK_REALTIME: c_int = 256; pub const FUTEX_CMD_MASK: c_int = !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME); +pub const FUTEX2_SIZE_U8: c_int = 0x00; +pub const FUTEX2_SIZE_U16: c_int = 0x01; +pub const FUTEX2_SIZE_U32: c_int = 0x02; +pub const FUTEX2_SIZE_U64: c_int = 0x03; +pub const FUTEX2_NUMA: c_int = 0x04; +pub const FUTEX2_PRIVATE: c_int = FUTEX_PRIVATE_FLAG; +pub const FUTEX2_SIZE_MASK: c_int = 0x03; +pub const FUTEX_32: c_int = FUTEX2_SIZE_U32; +pub const FUTEX_WAITV_MAX: c_int = 128; + // linux/errqueue.h pub const SO_EE_ORIGIN_NONE: u8 = 0; pub const SO_EE_ORIGIN_LOCAL: u8 = 1; diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index e58849b4e08f..aab2ea60dd96 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -3491,6 +3491,16 @@ pub const FUTEX_PRIVATE_FLAG: c_int = 128; pub const FUTEX_CLOCK_REALTIME: c_int = 256; pub const FUTEX_CMD_MASK: c_int = !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME); +pub const FUTEX2_SIZE_U8: c_int = 0x00; +pub const FUTEX2_SIZE_U16: c_int = 0x01; +pub const FUTEX2_SIZE_U32: c_int = 0x02; +pub const FUTEX2_SIZE_U64: c_int = 0x03; +pub const FUTEX2_NUMA: c_int = 0x04; +pub const FUTEX2_PRIVATE: c_int = FUTEX_PRIVATE_FLAG; +pub const FUTEX2_SIZE_MASK: c_int = 0x03; +pub const FUTEX_32: c_int = FUTEX2_SIZE_U32; +pub const FUTEX_WAITV_MAX: c_int = 128; + pub const FUTEX_WAITERS: u32 = 0x80000000; pub const FUTEX_OWNER_DIED: u32 = 0x40000000; pub const FUTEX_TID_MASK: u32 = 0x3fffffff; diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index b2a2f39129d0..21b6c2e898f7 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -250,6 +250,14 @@ cfg_if! { pub len: c_ushort, pub filter: *mut sock_filter, } + + // linux/futex.h + pub struct futex_waitv { + pub val: crate::__u64, + pub uaddr: crate::__u64, + pub flags: crate::__u32, + __reserved: Padding, + } } } } From 19291e7fe0502db4ac554bb2504328ac4ab8c751 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Mon, 27 Apr 2026 23:33:10 +0100 Subject: [PATCH 45/80] fix: replace raw pointer casts with pointer::cast (backport ) (cherry picked from commit e73df1b5f3bfdfd2fecb8f1f5dcd3d58ebd1865c) --- src/unix/bsd/freebsdlike/freebsd/mod.rs | 2 +- src/unix/bsd/mod.rs | 2 +- src/unix/bsd/netbsdlike/netbsd/mod.rs | 8 +++---- src/unix/bsd/netbsdlike/openbsd/mod.rs | 2 +- src/unix/cygwin/mod.rs | 6 ++--- src/unix/haiku/mod.rs | 2 +- src/unix/hurd/mod.rs | 4 ++-- src/unix/linux_like/android/mod.rs | 8 +++---- src/unix/linux_like/emscripten/lfs64.rs | 28 +++++++++++------------ src/unix/linux_like/emscripten/mod.rs | 2 +- src/unix/linux_like/linux/musl/lfs64.rs | 30 ++++++++++++------------- src/unix/linux_like/linux/musl/mod.rs | 6 ++--- src/unix/linux_like/linux/uclibc/mod.rs | 6 ++--- src/unix/linux_like/mod.rs | 2 +- src/unix/nto/mod.rs | 12 +++++----- src/unix/solarish/mod.rs | 2 +- src/vxworks/mod.rs | 2 +- 17 files changed, 62 insertions(+), 62 deletions(-) diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index cb89ac14120b..45115b085579 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -4321,7 +4321,7 @@ f! { } pub fn uname(buf: *mut crate::utsname) -> c_int { - __xuname(256, buf as *mut c_void) + __xuname(256, buf.cast()) } pub fn CPU_ZERO(cpuset: &mut cpuset_t) -> () { diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index 812177c8d48d..6ee7cd9e0656 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -495,7 +495,7 @@ pub const RTAX_BRD: c_int = 7; f! { pub fn CMSG_FIRSTHDR(mhdr: *const crate::msghdr) -> *mut cmsghdr { if (*mhdr).msg_controllen as usize >= size_of::() { - (*mhdr).msg_control.cast::() + (*mhdr).msg_control.cast() } else { core::ptr::null_mut() } diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index f3d027ce3432..ede5c019986a 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -84,7 +84,7 @@ impl siginfo_t { __pad1: Padding, _pid: crate::pid_t, } - (*(self as *const siginfo_t as *const siginfo_timer))._pid + (*(self as *const siginfo_t).cast::())._pid } pub unsafe fn si_uid(&self) -> crate::uid_t { @@ -98,7 +98,7 @@ impl siginfo_t { _pid: crate::pid_t, _uid: crate::uid_t, } - (*(self as *const siginfo_t as *const siginfo_timer))._uid + (*(self as *const siginfo_t).cast::())._uid } pub unsafe fn si_value(&self) -> crate::sigval { @@ -113,7 +113,7 @@ impl siginfo_t { _uid: crate::uid_t, value: crate::sigval, } - (*(self as *const siginfo_t as *const siginfo_timer)).value + (*(self as *const siginfo_t).cast::()).value } pub unsafe fn si_status(&self) -> c_int { @@ -128,7 +128,7 @@ impl siginfo_t { _uid: crate::uid_t, status: c_int, } - (*(self as *const siginfo_t as *const siginfo_timer)).status + (*(self as *const siginfo_t).cast::()).status } } diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index b6e70f9871d4..72ccc2c718c3 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -865,7 +865,7 @@ impl siginfo_t { _stime: crate::clock_t, _status: crate::c_int, } - (*(self as *const siginfo_t as *const siginfo_proc))._status + (*(self as *const siginfo_t).cast::())._status } } diff --git a/src/unix/cygwin/mod.rs b/src/unix/cygwin/mod.rs index 504eec69841e..68183dc1ae8e 100644 --- a/src/unix/cygwin/mod.rs +++ b/src/unix/cygwin/mod.rs @@ -534,7 +534,7 @@ impl siginfo_t { _si_errno: c_int, si_addr: *mut c_void, } - (*(self as *const siginfo_t as *const siginfo_si_addr)).si_addr + (*(self as *const siginfo_t).cast::()).si_addr } pub unsafe fn si_status(&self) -> c_int { @@ -547,7 +547,7 @@ impl siginfo_t { _si_errno: c_int, si_status: c_int, } - (*(self as *const siginfo_t as *const siginfo_sigchld)).si_status + (*(self as *const siginfo_t).cast::()).si_status } pub unsafe fn si_pid(&self) -> pid_t { @@ -568,7 +568,7 @@ impl siginfo_t { _si_errno: c_int, si_value: sigval, } - (*(self as *const siginfo_t as *const siginfo_si_value)).si_value + (*(self as *const siginfo_t).cast::()).si_value } } diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs index 3ccb5a172f61..ca782fe4702d 100644 --- a/src/unix/haiku/mod.rs +++ b/src/unix/haiku/mod.rs @@ -1385,7 +1385,7 @@ const fn CMSG_ALIGN(len: usize) -> usize { f! { pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { if (*mhdr).msg_controllen as usize >= size_of::() { - (*mhdr).msg_control as *mut cmsghdr + (*mhdr).msg_control.cast() } else { core::ptr::null_mut::() } diff --git a/src/unix/hurd/mod.rs b/src/unix/hurd/mod.rs index 206cd5b2afc2..1d50854ac698 100644 --- a/src/unix/hurd/mod.rs +++ b/src/unix/hurd/mod.rs @@ -3363,7 +3363,7 @@ const fn CMSG_ALIGN(len: usize) -> usize { f! { pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { if (*mhdr).msg_controllen as usize >= size_of::() { - (*mhdr).msg_control.cast::() + (*mhdr).msg_control.cast() } else { core::ptr::null_mut::() } @@ -3392,7 +3392,7 @@ f! { { core::ptr::null_mut::() } else { - next.cast::() + next.cast() } } diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index caa8bf8c2ea3..883673db972b 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -3343,7 +3343,7 @@ f! { if (next.offset(1)) as usize > max { core::ptr::null_mut::() } else { - next as *mut cmsghdr + next.cast() } } @@ -3819,7 +3819,7 @@ impl siginfo_t { _si_code: c_int, si_addr: *mut c_void, } - (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr + (*(self as *const siginfo_t).cast::()).si_addr } pub unsafe fn si_value(&self) -> crate::sigval { @@ -3832,13 +3832,13 @@ impl siginfo_t { _si_overrun: c_int, si_sigval: crate::sigval, } - (*(self as *const siginfo_t as *const siginfo_timer)).si_sigval + (*(self as *const siginfo_t).cast::()).si_sigval } } impl siginfo_t { unsafe fn sifields(&self) -> &sifields { - &(*(self as *const siginfo_t as *const siginfo_f)).sifields + &(*(self as *const siginfo_t).cast::()).sifields } pub unsafe fn si_pid(&self) -> crate::pid_t { diff --git a/src/unix/linux_like/emscripten/lfs64.rs b/src/unix/linux_like/emscripten/lfs64.rs index 501540943889..5ced3277a73f 100644 --- a/src/unix/linux_like/emscripten/lfs64.rs +++ b/src/unix/linux_like/emscripten/lfs64.rs @@ -10,7 +10,7 @@ pub unsafe extern "C" fn creat64(path: *const c_char, mode: crate::mode_t) -> c_ #[inline] pub unsafe extern "C" fn fgetpos64(stream: *mut crate::FILE, pos: *mut crate::fpos64_t) -> c_int { - crate::fgetpos(stream, pos as *mut _) + crate::fgetpos(stream, pos.cast()) } #[inline] @@ -38,12 +38,12 @@ pub unsafe extern "C" fn fseeko64( #[inline] pub unsafe extern "C" fn fsetpos64(stream: *mut crate::FILE, pos: *const crate::fpos64_t) -> c_int { - crate::fsetpos(stream, pos as *mut _) + crate::fsetpos(stream, pos.cast()) } #[inline] pub unsafe extern "C" fn fstat64(fildes: c_int, buf: *mut crate::stat64) -> c_int { - crate::fstat(fildes, buf as *mut _) + crate::fstat(fildes, buf.cast()) } #[inline] @@ -53,17 +53,17 @@ pub unsafe extern "C" fn fstatat64( buf: *mut crate::stat64, flag: c_int, ) -> c_int { - crate::fstatat(fd, path, buf as *mut _, flag) + crate::fstatat(fd, path, buf.cast(), flag) } #[inline] pub unsafe extern "C" fn fstatfs64(fd: c_int, buf: *mut crate::statfs64) -> c_int { - crate::fstatfs(fd, buf as *mut _) + crate::fstatfs(fd, buf.cast()) } #[inline] pub unsafe extern "C" fn fstatvfs64(fd: c_int, buf: *mut crate::statvfs64) -> c_int { - crate::fstatvfs(fd, buf as *mut _) + crate::fstatvfs(fd, buf.cast()) } #[inline] @@ -78,7 +78,7 @@ pub unsafe extern "C" fn ftruncate64(fd: c_int, length: off64_t) -> c_int { #[inline] pub unsafe extern "C" fn getrlimit64(resource: c_int, rlim: *mut crate::rlimit64) -> c_int { - crate::getrlimit(resource, rlim as *mut _) + crate::getrlimit(resource, rlim.cast()) } #[inline] @@ -88,7 +88,7 @@ pub unsafe extern "C" fn lseek64(fd: c_int, offset: off64_t, whence: c_int) -> o #[inline] pub unsafe extern "C" fn lstat64(path: *const c_char, buf: *mut crate::stat64) -> c_int { - crate::lstat(path, buf as *mut _) + crate::lstat(path, buf.cast()) } #[inline] @@ -171,7 +171,7 @@ pub unsafe extern "C" fn pwritev64( #[inline] pub unsafe extern "C" fn readdir64(dirp: *mut crate::DIR) -> *mut crate::dirent64 { - crate::readdir(dirp) as *mut _ + crate::readdir(dirp).cast() } #[inline] @@ -180,27 +180,27 @@ pub unsafe extern "C" fn readdir64_r( entry: *mut crate::dirent64, result: *mut *mut crate::dirent64, ) -> c_int { - crate::readdir_r(dirp, entry as *mut _, result as *mut _) + crate::readdir_r(dirp, entry.cast(), result.cast()) } #[inline] pub unsafe extern "C" fn setrlimit64(resource: c_int, rlim: *const crate::rlimit64) -> c_int { - crate::setrlimit(resource, rlim as *mut _) + crate::setrlimit(resource, rlim.cast()) } #[inline] pub unsafe extern "C" fn stat64(pathname: *const c_char, statbuf: *mut crate::stat64) -> c_int { - crate::stat(pathname, statbuf as *mut _) + crate::stat(pathname, statbuf.cast()) } #[inline] pub unsafe extern "C" fn statfs64(pathname: *const c_char, buf: *mut crate::statfs64) -> c_int { - crate::statfs(pathname, buf as *mut _) + crate::statfs(pathname, buf.cast()) } #[inline] pub unsafe extern "C" fn statvfs64(path: *const c_char, buf: *mut crate::statvfs64) -> c_int { - crate::statvfs(path, buf as *mut _) + crate::statvfs(path, buf.cast()) } #[inline] diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs index ecae17ef37f7..b5a81fa4195e 100644 --- a/src/unix/linux_like/emscripten/mod.rs +++ b/src/unix/linux_like/emscripten/mod.rs @@ -1267,7 +1267,7 @@ f! { if (next.offset(1)) as usize >= max { core::ptr::null_mut::() } else { - next as *mut cmsghdr + next.cast() } } diff --git a/src/unix/linux_like/linux/musl/lfs64.rs b/src/unix/linux_like/linux/musl/lfs64.rs index 4d595fc42d72..c74fb8460a02 100644 --- a/src/unix/linux_like/linux/musl/lfs64.rs +++ b/src/unix/linux_like/linux/musl/lfs64.rs @@ -18,7 +18,7 @@ pub unsafe extern "C" fn fallocate64( #[inline] pub unsafe extern "C" fn fgetpos64(stream: *mut crate::FILE, pos: *mut crate::fpos64_t) -> c_int { - crate::fgetpos(stream, pos as *mut _) + crate::fgetpos(stream, pos.cast()) } #[inline] @@ -46,12 +46,12 @@ pub unsafe extern "C" fn fseeko64( #[inline] pub unsafe extern "C" fn fsetpos64(stream: *mut crate::FILE, pos: *const crate::fpos64_t) -> c_int { - crate::fsetpos(stream, pos as *mut _) + crate::fsetpos(stream, pos.cast()) } #[inline] pub unsafe extern "C" fn fstat64(fildes: c_int, buf: *mut crate::stat64) -> c_int { - crate::fstat(fildes, buf as *mut _) + crate::fstat(fildes, buf.cast()) } #[inline] @@ -61,17 +61,17 @@ pub unsafe extern "C" fn fstatat64( buf: *mut crate::stat64, flag: c_int, ) -> c_int { - crate::fstatat(fd, path, buf as *mut _, flag) + crate::fstatat(fd, path, buf.cast(), flag) } #[inline] pub unsafe extern "C" fn fstatfs64(fd: c_int, buf: *mut crate::statfs64) -> c_int { - crate::fstatfs(fd, buf as *mut _) + crate::fstatfs(fd, buf.cast()) } #[inline] pub unsafe extern "C" fn fstatvfs64(fd: c_int, buf: *mut crate::statvfs64) -> c_int { - crate::fstatvfs(fd, buf as *mut _) + crate::fstatvfs(fd, buf.cast()) } #[inline] @@ -86,7 +86,7 @@ pub unsafe extern "C" fn ftruncate64(fd: c_int, length: off64_t) -> c_int { #[inline] pub unsafe extern "C" fn getrlimit64(resource: c_int, rlim: *mut crate::rlimit64) -> c_int { - crate::getrlimit(resource, rlim as *mut _) + crate::getrlimit(resource, rlim.cast()) } #[inline] @@ -96,7 +96,7 @@ pub unsafe extern "C" fn lseek64(fd: c_int, offset: off64_t, whence: c_int) -> o #[inline] pub unsafe extern "C" fn lstat64(path: *const c_char, buf: *mut crate::stat64) -> c_int { - crate::lstat(path, buf as *mut _) + crate::lstat(path, buf.cast()) } #[inline] @@ -164,7 +164,7 @@ pub unsafe extern "C" fn prlimit64( new_limit: *const crate::rlimit64, old_limit: *mut crate::rlimit64, ) -> c_int { - crate::prlimit(pid, resource, new_limit as *mut _, old_limit as *mut _) + crate::prlimit(pid, resource, new_limit.cast(), old_limit.cast()) } #[inline] @@ -189,7 +189,7 @@ pub unsafe extern "C" fn pwritev64( #[inline] pub unsafe extern "C" fn readdir64(dirp: *mut crate::DIR) -> *mut crate::dirent64 { - crate::readdir(dirp) as *mut _ + crate::readdir(dirp).cast() } #[inline] @@ -198,7 +198,7 @@ pub unsafe extern "C" fn readdir64_r( entry: *mut crate::dirent64, result: *mut *mut crate::dirent64, ) -> c_int { - crate::readdir_r(dirp, entry as *mut _, result as *mut _) + crate::readdir_r(dirp, entry.cast(), result.cast()) } #[inline] @@ -213,22 +213,22 @@ pub unsafe extern "C" fn sendfile64( #[inline] pub unsafe extern "C" fn setrlimit64(resource: c_int, rlim: *const crate::rlimit64) -> c_int { - crate::setrlimit(resource, rlim as *mut _) + crate::setrlimit(resource, rlim.cast()) } #[inline] pub unsafe extern "C" fn stat64(pathname: *const c_char, statbuf: *mut crate::stat64) -> c_int { - crate::stat(pathname, statbuf as *mut _) + crate::stat(pathname, statbuf.cast()) } #[inline] pub unsafe extern "C" fn statfs64(pathname: *const c_char, buf: *mut crate::statfs64) -> c_int { - crate::statfs(pathname, buf as *mut _) + crate::statfs(pathname, buf.cast()) } #[inline] pub unsafe extern "C" fn statvfs64(path: *const c_char, buf: *mut crate::statvfs64) -> c_int { - crate::statvfs(path, buf as *mut _) + crate::statvfs(path, buf.cast()) } #[inline] diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs index 8b6cec713222..6c9f948aa3ba 100644 --- a/src/unix/linux_like/linux/musl/mod.rs +++ b/src/unix/linux_like/linux/musl/mod.rs @@ -61,7 +61,7 @@ impl siginfo_t { _si_code: c_int, si_addr: *mut c_void, } - (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr + (*(self as *const siginfo_t).cast::()).si_addr } pub unsafe fn si_value(&self) -> crate::sigval { @@ -74,7 +74,7 @@ impl siginfo_t { _si_overrun: c_int, si_value: crate::sigval, } - (*(self as *const siginfo_t as *const siginfo_si_value)).si_value + (*(self as *const siginfo_t).cast::()).si_value } } @@ -105,7 +105,7 @@ s_no_extra_traits! { impl siginfo_t { unsafe fn sifields(&self) -> &sifields { - &(*(self as *const siginfo_t as *const siginfo_f)).sifields + &(*(self as *const siginfo_t).cast::()).sifields } pub unsafe fn si_pid(&self) -> crate::pid_t { diff --git a/src/unix/linux_like/linux/uclibc/mod.rs b/src/unix/linux_like/linux/uclibc/mod.rs index f70e0c41aeed..7da0779d4dd7 100644 --- a/src/unix/linux_like/linux/uclibc/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mod.rs @@ -164,7 +164,7 @@ impl siginfo_t { _si_code: c_int, si_addr: *mut c_void, } - (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr + (*(self as *const siginfo_t).cast::()).si_addr } pub unsafe fn si_value(&self) -> crate::sigval { @@ -177,7 +177,7 @@ impl siginfo_t { _si_overrun: c_int, si_value: crate::sigval, } - (*(self as *const siginfo_t as *const siginfo_si_value)).si_value + (*(self as *const siginfo_t).cast::()).si_value } } @@ -208,7 +208,7 @@ s_no_extra_traits! { impl siginfo_t { unsafe fn sifields(&self) -> &sifields { - &(*(self as *const siginfo_t as *const siginfo_f)).sifields + &(*(self as *const siginfo_t).cast::()).sifields } pub unsafe fn si_pid(&self) -> crate::pid_t { diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index 21b6c2e898f7..b350aaa02250 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -1748,7 +1748,7 @@ const fn CMSG_ALIGN(len: usize) -> usize { f! { pub fn CMSG_FIRSTHDR(mhdr: *const crate::msghdr) -> *mut crate::cmsghdr { if (*mhdr).msg_controllen as usize >= size_of::() { - (*mhdr).msg_control.cast::() + (*mhdr).msg_control.cast() } else { core::ptr::null_mut::() } diff --git a/src/unix/nto/mod.rs b/src/unix/nto/mod.rs index 0674e1bca4e1..e29195db0264 100644 --- a/src/unix/nto/mod.rs +++ b/src/unix/nto/mod.rs @@ -2428,7 +2428,7 @@ const fn _ALIGN(p: usize, b: usize) -> usize { f! { pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { if (*mhdr).msg_controllen as usize >= size_of::() { - (*mhdr).msg_control as *mut cmsghdr + (*mhdr).msg_control.cast() } else { core::ptr::null_mut::() } @@ -3158,7 +3158,7 @@ impl siginfo_t { _pad: Padding<[u8; 32]>, si_addr: *mut c_void, } - (*(self as *const siginfo_t as *const siginfo_si_addr)).si_addr + (*(self as *const siginfo_t).cast::()).si_addr } pub unsafe fn si_value(&self) -> crate::sigval { @@ -3167,7 +3167,7 @@ impl siginfo_t { _pad: Padding<[u8; 32]>, si_value: crate::sigval, } - (*(self as *const siginfo_t as *const siginfo_si_value)).si_value + (*(self as *const siginfo_t).cast::()).si_value } pub unsafe fn si_pid(&self) -> crate::pid_t { @@ -3176,7 +3176,7 @@ impl siginfo_t { _pad: Padding<[u8; 16]>, si_pid: crate::pid_t, } - (*(self as *const siginfo_t as *const siginfo_si_pid)).si_pid + (*(self as *const siginfo_t).cast::()).si_pid } pub unsafe fn si_uid(&self) -> crate::uid_t { @@ -3185,7 +3185,7 @@ impl siginfo_t { _pad: Padding<[u8; 24]>, si_uid: crate::uid_t, } - (*(self as *const siginfo_t as *const siginfo_si_uid)).si_uid + (*(self as *const siginfo_t).cast::()).si_uid } pub unsafe fn si_status(&self) -> c_int { @@ -3194,7 +3194,7 @@ impl siginfo_t { _pad: Padding<[u8; 28]>, si_status: c_int, } - (*(self as *const siginfo_t as *const siginfo_si_status)).si_status + (*(self as *const siginfo_t).cast::()).si_status } } diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index e41787178178..3b01520b7568 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -2223,7 +2223,7 @@ f! { if ((*mhdr).msg_controllen as usize) < size_of::() { core::ptr::null_mut::() } else { - (*mhdr).msg_control as *mut cmsghdr + (*mhdr).msg_control.cast::() } } diff --git a/src/vxworks/mod.rs b/src/vxworks/mod.rs index bc4d53689647..2f1c89c7a8f1 100644 --- a/src/vxworks/mod.rs +++ b/src/vxworks/mod.rs @@ -1458,7 +1458,7 @@ f! { pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { if (*mhdr).msg_controllen as usize > 0 { - (*mhdr).msg_control as *mut cmsghdr + (*mhdr).msg_control.cast() } else { core::ptr::null_mut::() } From deadf22d15a3becc51e280af4be9c63ca33118a8 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Tue, 28 Apr 2026 03:40:31 +0100 Subject: [PATCH 46/80] fix: replace raw pointer casts with ptr::null (backport ) (cherry picked from commit f4d67773492709f79fcbd4b6f60dd26778291d87) --- src/fuchsia/mod.rs | 6 ++--- src/new/qurt/mod.rs | 2 +- src/unix/aix/mod.rs | 4 ++-- src/unix/bsd/apple/mod.rs | 2 +- src/unix/bsd/freebsdlike/dragonfly/mod.rs | 2 +- src/unix/bsd/freebsdlike/freebsd/mod.rs | 2 +- src/unix/bsd/mod.rs | 2 +- src/unix/bsd/netbsdlike/netbsd/mod.rs | 28 +++++++++++------------ src/unix/bsd/netbsdlike/openbsd/mod.rs | 2 +- src/unix/cygwin/mod.rs | 6 ++--- src/unix/haiku/mod.rs | 8 +++---- src/unix/haiku/native.rs | 2 +- src/unix/hurd/mod.rs | 20 ++++++++-------- src/unix/linux_like/android/mod.rs | 2 +- src/unix/linux_like/emscripten/mod.rs | 4 ++-- src/unix/linux_like/l4re/uclibc/mod.rs | 10 ++++---- src/unix/linux_like/linux_l4re_shared.rs | 6 ++--- src/unix/linux_like/mod.rs | 2 +- src/unix/nto/mod.rs | 6 ++--- src/unix/solarish/mod.rs | 4 ++-- src/vxworks/mod.rs | 14 +++++------- 21 files changed, 66 insertions(+), 68 deletions(-) diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs index b49e9aa7a96f..53b5e2ed207c 100644 --- a/src/fuchsia/mod.rs +++ b/src/fuchsia/mod.rs @@ -3022,9 +3022,9 @@ f! { pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { if ((*cmsg).cmsg_len as size_t) < size_of::() { - core::ptr::null_mut::() + ptr::null_mut() } else if __CMSG_NEXT(cmsg).add(size_of::()) >= __MHDR_END(mhdr) { - core::ptr::null_mut::() + ptr::null_mut() } else { __CMSG_NEXT(cmsg).cast() } @@ -3034,7 +3034,7 @@ f! { if (*mhdr).msg_controllen as size_t >= size_of::() { (*mhdr).msg_control.cast() } else { - core::ptr::null_mut::() + ptr::null_mut() } } diff --git a/src/new/qurt/mod.rs b/src/new/qurt/mod.rs index 52d7ae04881e..41ce4b50ba0a 100644 --- a/src/new/qurt/mod.rs +++ b/src/new/qurt/mod.rs @@ -236,7 +236,7 @@ pub const FOPEN_MAX: c_uint = 20; pub const EOK: c_int = 0; // Semaphore constants -pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t; +pub const SEM_FAILED: *mut sem_t = ptr::null_mut(); // Page size constants (hexagon-specific) pub const PAGESIZE: size_t = 4096; diff --git a/src/unix/aix/mod.rs b/src/unix/aix/mod.rs index d5b2a00f5d6a..3791ef9a6624 100644 --- a/src/unix/aix/mod.rs +++ b/src/unix/aix/mod.rs @@ -2415,7 +2415,7 @@ f! { if (*mhdr).msg_controllen as usize >= size_of::() { (*mhdr).msg_control as *mut cmsghdr } else { - core::ptr::null_mut::() + ptr::null_mut() } } @@ -2426,7 +2426,7 @@ f! { if (cmsg as usize + (*cmsg).cmsg_len as usize + size_of::()) > ((*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize) { - core::ptr::null_mut::() + ptr::null_mut() } else { // AIX does not have any alignment/padding for ancillary data, so we don't need _CMSG_ALIGN here. (cmsg as usize + (*cmsg).cmsg_len as usize) as *mut cmsghdr diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index ead358475b63..d9cc9ce9bd14 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -4290,7 +4290,7 @@ f! { let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len); let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; if next + __DARWIN_ALIGN32(size_of::()) > max { - core::ptr::null_mut() + ptr::null_mut() } else { next as *mut cmsghdr } diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index bce0513d2d3e..c56db0448008 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -1189,7 +1189,7 @@ f! { if next <= max { (cmsg as usize + _CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr } else { - core::ptr::null_mut::() + ptr::null_mut() } } diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 45115b085579..e74baba0c04f 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -4293,7 +4293,7 @@ f! { let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize) + _ALIGN(size_of::()); let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; if next > max { - core::ptr::null_mut::() + ptr::null_mut() } else { (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr } diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index 6ee7cd9e0656..fb54288d1f26 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -497,7 +497,7 @@ f! { if (*mhdr).msg_controllen as usize >= size_of::() { (*mhdr).msg_control.cast() } else { - core::ptr::null_mut() + ptr::null_mut() } } diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index ede5c019986a..21bfc5010428 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -1331,20 +1331,20 @@ cfg_if! { ptm_pad1: Padding::new([0; 3]), ptm_unused: Padding::new(0), ptm_pad2: Padding::new([0; 3]), - ptm_waiters: 0 as *mut _, + ptm_waiters: ptr::null_mut(), ptm_owner: 0, ptm_recursed: 0, - ptm_spare2: 0 as *mut _, + ptm_spare2: ptr::null_mut(), }; } else { pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ptm_magic: 0x33330003, ptm_errorcheck: 0, ptm_unused: Padding::new(0), - ptm_waiters: 0 as *mut _, + ptm_waiters: ptr::null_mut(), ptm_owner: 0, ptm_recursed: 0, - ptm_spare2: 0 as *mut _, + ptm_spare2: ptr::null_mut(), }; } } @@ -1352,21 +1352,21 @@ cfg_if! { pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { ptc_magic: 0x55550005, ptc_lock: 0, - ptc_waiters_first: 0 as *mut _, - ptc_waiters_last: 0 as *mut _, - ptc_mutex: 0 as *mut _, - ptc_private: 0 as *mut _, + ptc_waiters_first: ptr::null_mut(), + ptc_waiters_last: ptr::null_mut(), + ptc_mutex: ptr::null_mut(), + ptc_private: ptr::null_mut(), }; pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { ptr_magic: 0x99990009, ptr_interlock: 0, - ptr_rblocked_first: 0 as *mut _, - ptr_rblocked_last: 0 as *mut _, - ptr_wblocked_first: 0 as *mut _, - ptr_wblocked_last: 0 as *mut _, + ptr_rblocked_first: ptr::null_mut(), + ptr_rblocked_last: ptr::null_mut(), + ptr_wblocked_first: ptr::null_mut(), + ptr_wblocked_last: ptr::null_mut(), ptr_nreaders: 0, ptr_owner: 0, - ptr_private: 0 as *mut _, + ptr_private: ptr::null_mut(), }; pub const PTHREAD_MUTEX_NORMAL: c_int = 0; pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 1; @@ -1825,7 +1825,7 @@ f! { let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize) + _ALIGN(size_of::()); let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; if next > max { - core::ptr::null_mut::() + ptr::null_mut() } else { (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr } diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index 72ccc2c718c3..216d17bd7783 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -1852,7 +1852,7 @@ f! { let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize) + _ALIGN(size_of::()); let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; if next > max { - core::ptr::null_mut::() + ptr::null_mut() } else { (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr } diff --git a/src/unix/cygwin/mod.rs b/src/unix/cygwin/mod.rs index 68183dc1ae8e..c712c03ff5b3 100644 --- a/src/unix/cygwin/mod.rs +++ b/src/unix/cygwin/mod.rs @@ -1020,7 +1020,7 @@ pub const LC_TIME_MASK: c_int = 1 << 5; pub const LC_MESSAGES_MASK: c_int = 1 << 6; pub const LC_GLOBAL_LOCALE: locale_t = -1isize as locale_t; -pub const SEM_FAILED: *mut sem_t = core::ptr::null_mut(); +pub const SEM_FAILED: *mut sem_t = ptr::null_mut(); pub const ST_RDONLY: c_ulong = 0x80000; pub const ST_NOSUID: c_ulong = 0; @@ -1759,7 +1759,7 @@ f! { if (*mhdr).msg_controllen as usize >= size_of::() { (*mhdr).msg_control.cast() } else { - core::ptr::null_mut() + ptr::null_mut() } } @@ -1767,7 +1767,7 @@ f! { let next = (cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr; let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; if next as usize + CMSG_ALIGN(size_of::()) as usize > max { - core::ptr::null_mut() + ptr::null_mut() } else { next } diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs index ca782fe4702d..dd9d6fdb136f 100644 --- a/src/unix/haiku/mod.rs +++ b/src/unix/haiku/mod.rs @@ -1098,7 +1098,7 @@ pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { flags: 0, unused: Padding::new(0), - mutex: 0 as *mut _, + mutex: ptr::null_mut(), waiter_count: 0, lock: 0, }; @@ -1109,7 +1109,7 @@ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { lock_count: 0, reader_count: 0, writer_count: 0, - waiters: [0 as *mut _; 2], + waiters: [ptr::null_mut(); 2], }; pub const PTHREAD_MUTEX_DEFAULT: c_int = 0; @@ -1387,7 +1387,7 @@ f! { if (*mhdr).msg_controllen as usize >= size_of::() { (*mhdr).msg_control.cast() } else { - core::ptr::null_mut::() + ptr::null_mut() } } @@ -1412,7 +1412,7 @@ f! { + CMSG_ALIGN(size_of::()); let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; if next > max { - core::ptr::null_mut::() + ptr::null_mut() } else { (cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr } diff --git a/src/unix/haiku/native.rs b/src/unix/haiku/native.rs index 99ceab8a7519..9c86f72638a3 100644 --- a/src/unix/haiku/native.rs +++ b/src/unix/haiku/native.rs @@ -905,7 +905,7 @@ pub const B_XATTR_TYPE: u32 = haiku_constant!('X', 'A', 'T', 'R'); pub const B_NETWORK_ADDRESS_TYPE: u32 = haiku_constant!('N', 'W', 'A', 'D'); pub const B_MIME_STRING_TYPE: u32 = haiku_constant!('M', 'I', 'M', 'S'); pub const B_ASCII_TYPE: u32 = haiku_constant!('T', 'E', 'X', 'T'); -pub const B_APP_IMAGE_SYMBOL: *const c_void = core::ptr::null(); +pub const B_APP_IMAGE_SYMBOL: *const c_void = ptr::null(); extern "C" { // kernel/OS.h diff --git a/src/unix/hurd/mod.rs b/src/unix/hurd/mod.rs index 1d50854ac698..4e01ab6ca6db 100644 --- a/src/unix/hurd/mod.rs +++ b/src/unix/hurd/mod.rs @@ -3336,19 +3336,19 @@ pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { }; pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { __lock: __PTHREAD_SPIN_LOCK_INITIALIZER, - __queue: 0i64 as *mut __pthread, - __attr: 0i64 as *mut __pthread_condattr, + __queue: ptr::null_mut(), + __attr: ptr::null_mut(), __wrefs: 0, - __data: 0i64 as *mut c_void, + __data: ptr::null_mut(), }; pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { __held: __PTHREAD_SPIN_LOCK_INITIALIZER, __lock: __PTHREAD_SPIN_LOCK_INITIALIZER, __readers: 0, - __readerqueue: 0i64 as *mut __pthread, - __writerqueue: 0i64 as *mut __pthread, - __attr: 0i64 as *mut __pthread_rwlockattr, - __data: 0i64 as *mut c_void, + __readerqueue: ptr::null_mut(), + __writerqueue: ptr::null_mut(), + __attr: ptr::null_mut(), + __data: ptr::null_mut(), }; pub const PTHREAD_STACK_MIN: size_t = 0; @@ -3365,7 +3365,7 @@ f! { if (*mhdr).msg_controllen as usize >= size_of::() { (*mhdr).msg_control.cast() } else { - core::ptr::null_mut::() + ptr::null_mut() } } @@ -3383,14 +3383,14 @@ f! { pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { if ((*cmsg).cmsg_len as usize) < size_of::() { - return core::ptr::null_mut::(); + return ptr::null_mut(); } let next = (cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr; let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; if (next.offset(1)) as usize > max || next as usize + CMSG_ALIGN((*next).cmsg_len as usize) > max { - core::ptr::null_mut::() + ptr::null_mut() } else { next.cast() } diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index 883673db972b..fae34a285dab 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -3341,7 +3341,7 @@ f! { let next = (cmsg as usize + super::CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr; let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; if (next.offset(1)) as usize > max { - core::ptr::null_mut::() + ptr::null_mut() } else { next.cast() } diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs index b5a81fa4195e..128025d81378 100644 --- a/src/unix/linux_like/emscripten/mod.rs +++ b/src/unix/linux_like/emscripten/mod.rs @@ -1260,12 +1260,12 @@ pub const SOMAXCONN: c_int = 128; f! { pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { if ((*cmsg).cmsg_len as usize) < size_of::() { - return core::ptr::null_mut::(); + return ptr::null_mut(); } let next = (cmsg as usize + super::CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr; let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; if (next.offset(1)) as usize >= max { - core::ptr::null_mut::() + ptr::null_mut() } else { next.cast() } diff --git a/src/unix/linux_like/l4re/uclibc/mod.rs b/src/unix/linux_like/l4re/uclibc/mod.rs index e593ad76d4fc..b3dba2c37766 100644 --- a/src/unix/linux_like/l4re/uclibc/mod.rs +++ b/src/unix/linux_like/l4re/uclibc/mod.rs @@ -456,7 +456,7 @@ pub const __LOCK_INITIALIZER: _pthread_fastlock = _pthread_fastlock { pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { __m_reserved: 0, __m_count: 0, - __m_owner: core::ptr::null_mut(), + __m_owner: ptr::null_mut(), __m_kind: PTHREAD_MUTEX_TIMED_NP, __m_lock: __LOCK_INITIALIZER, }; @@ -468,7 +468,7 @@ const PTHREAD_COND_PADDING_SIZE: usize = 48 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { __c_lock: __LOCK_INITIALIZER, - __c_waiting: core::ptr::null_mut(), + __c_waiting: ptr::null_mut(), __padding: [0; PTHREAD_COND_PADDING_SIZE], __align: 0, }; @@ -476,9 +476,9 @@ pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { __rw_lock: __LOCK_INITIALIZER, __rw_readers: 0, - __rw_writer: core::ptr::null_mut(), - __rw_read_waiting: core::ptr::null_mut(), - __rw_write_waiting: core::ptr::null_mut(), + __rw_writer: ptr::null_mut(), + __rw_read_waiting: ptr::null_mut(), + __rw_write_waiting: ptr::null_mut(), __rw_kind: PTHREAD_RWLOCK_DEFAULT_NP, __rw_pshared: crate::PTHREAD_PROCESS_PRIVATE, }; diff --git a/src/unix/linux_like/linux_l4re_shared.rs b/src/unix/linux_like/linux_l4re_shared.rs index 6b320ff4effa..041e2525d9bc 100644 --- a/src/unix/linux_like/linux_l4re_shared.rs +++ b/src/unix/linux_like/linux_l4re_shared.rs @@ -1485,7 +1485,7 @@ f! { cmsg: *const crate::cmsghdr, ) -> *mut crate::cmsghdr { if ((*cmsg).cmsg_len as usize) < size_of::() { - return core::ptr::null_mut::(); + return ptr::null_mut(); } // FIXME(msrv): `.wrapping_byte_add()` stabilized in 1.75 @@ -1497,7 +1497,7 @@ f! { // In case the addition wrapped. `next_addr > max_addr` // would otherwise not work as intended. if (next_cmsg as usize) < (cmsg as usize) { - return core::ptr::null_mut(); + return ptr::null_mut(); } let mut max_addr = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; @@ -1510,7 +1510,7 @@ f! { } if next_cmsg as usize + size_of::() > max_addr { - core::ptr::null_mut::() + ptr::null_mut() } else { next_cmsg as *mut crate::cmsghdr } diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index b350aaa02250..a1ea493f0abc 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -1750,7 +1750,7 @@ f! { if (*mhdr).msg_controllen as usize >= size_of::() { (*mhdr).msg_control.cast() } else { - core::ptr::null_mut::() + ptr::null_mut() } } diff --git a/src/unix/nto/mod.rs b/src/unix/nto/mod.rs index e29195db0264..551d034b660a 100644 --- a/src/unix/nto/mod.rs +++ b/src/unix/nto/mod.rs @@ -2430,7 +2430,7 @@ f! { if (*mhdr).msg_controllen as usize >= size_of::() { (*mhdr).msg_control.cast() } else { - core::ptr::null_mut::() + ptr::null_mut() } } @@ -2438,7 +2438,7 @@ f! { let msg = _CMSG_ALIGN((*cmsg).cmsg_len as usize); let next = cmsg as usize + msg + _CMSG_ALIGN(size_of::()); if next > (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize { - core::ptr::null_mut::() + ptr::null_mut() } else { (cmsg as usize + msg) as *mut cmsghdr } @@ -3148,7 +3148,7 @@ pub unsafe fn atexit(cb: extern "C" fn()) -> c_int { static __dso_handle: *mut c_void; pub fn __cxa_atexit(cb: extern "C" fn(), __arg: *mut c_void, __dso: *mut c_void) -> c_int; } - __cxa_atexit(cb, 0 as *mut c_void, __dso_handle) + __cxa_atexit(cb, ptr::null_mut(), __dso_handle) } impl siginfo_t { diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index 3b01520b7568..5ef4a301c927 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -2221,7 +2221,7 @@ f! { pub fn CMSG_FIRSTHDR(mhdr: *const crate::msghdr) -> *mut cmsghdr { if ((*mhdr).msg_controllen as usize) < size_of::() { - core::ptr::null_mut::() + ptr::null_mut() } else { (*mhdr).msg_control.cast::() } @@ -2235,7 +2235,7 @@ f! { _CMSG_HDR_ALIGN(cmsg as usize + (*cmsg).cmsg_len as usize + size_of::()); let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; if next > max { - core::ptr::null_mut::() + ptr::null_mut() } else { _CMSG_HDR_ALIGN(cmsg as usize + (*cmsg).cmsg_len as usize) as *mut cmsghdr } diff --git a/src/vxworks/mod.rs b/src/vxworks/mod.rs index 2f1c89c7a8f1..58bf10838d59 100644 --- a/src/vxworks/mod.rs +++ b/src/vxworks/mod.rs @@ -1,7 +1,5 @@ //! Interface to VxWorks C library -use core::ptr::null_mut; - use crate::prelude::*; extern_ty! { @@ -1333,7 +1331,7 @@ const PTHREAD_MUTEXATTR_INITIALIZER: pthread_mutexattr_t = pthread_mutexattr_t { mutexAttrPshared: 1, }; pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { - mutexSemId: null_mut(), + mutexSemId: ptr::null_mut(), mutexValid: PTHREAD_VALID_OBJ, mutexInitted: PTHREAD_UNUSED_YET_OBJ, mutexCondRefCount: 0, @@ -1348,11 +1346,11 @@ const PTHREAD_CONDATTR_INITIALIZER: pthread_condattr_t = pthread_condattr_t { condAttrClockId: CLOCK_REALTIME, }; pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { - condSemId: null_mut(), + condSemId: ptr::null_mut(), condValid: PTHREAD_VALID_OBJ, condInitted: PTHREAD_UNUSED_YET_OBJ, condRefCount: 0, - condMutex: null_mut(), + condMutex: ptr::null_mut(), condAttr: PTHREAD_CONDATTR_INITIALIZER, condSemName: [0; _PTHREAD_SHARED_SEM_NAME_MAX], }; @@ -1364,7 +1362,7 @@ const PTHREAD_RWLOCKATTR_INITIALIZER: pthread_rwlockattr_t = pthread_rwlockattr_ rwlockAttrConformOpt: 1, }; pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { - rwlockSemId: null_mut(), + rwlockSemId: ptr::null_mut(), rwlockReadersRefCount: 0, rwlockValid: PTHREAD_VALID_OBJ, rwlockInitted: PTHREAD_UNUSED_YET_OBJ, @@ -1452,7 +1450,7 @@ f! { if next <= max { (cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr } else { - core::ptr::null_mut::() + ptr::null_mut() } } @@ -1460,7 +1458,7 @@ f! { if (*mhdr).msg_controllen as usize > 0 { (*mhdr).msg_control.cast() } else { - core::ptr::null_mut::() + ptr::null_mut() } } From eb78eb9f42a165b6a87ce1b3560ce00f1e989d19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2026 14:03:53 +0000 Subject: [PATCH 47/80] build(deps): bump taiki-e/install-action from 2.81.8 to 2.81.10 Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.81.8 to 2.81.10. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/0631aa6515c7d545823c67cfae7ef4fc7f490154...7a79fe8c3a13344501c80d99cae481c1c9085912) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-version: 2.81.10 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit aa9ea4f2b391a84e62985c6fd7a2fc0900eee54f) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 492d270e097a..181e4492ae15 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -81,7 +81,7 @@ jobs: run: ./ci/install-rust.sh - name: Install semver-checks - uses: taiki-e/install-action@0631aa6515c7d545823c67cfae7ef4fc7f490154 # v2.81.8 + uses: taiki-e/install-action@7a79fe8c3a13344501c80d99cae481c1c9085912 # v2.81.10 if: matrix.toolchain == 'stable' with: tool: cargo-semver-checks From db9a440242f66a2a25536427dc01a06b87eb7637 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2026 14:03:59 +0000 Subject: [PATCH 48/80] build(deps): bump release-plz/action from 0.5.129 to 0.5.130 Bumps [release-plz/action](https://github.com/release-plz/action) from 0.5.129 to 0.5.130. - [Release notes](https://github.com/release-plz/action/releases) - [Commits](https://github.com/release-plz/action/compare/064f4d1e36c843611ddf013be726beaa4ad804db...e8792575c7f2366cf6ff3ccc33ead9ace5b691c7) --- updated-dependencies: - dependency-name: release-plz/action dependency-version: 0.5.130 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit 38c6231f667b698224c5dc4ffa87b7c48e0e2b47) --- .github/workflows/publish_0.2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_0.2.yml b/.github/workflows/publish_0.2.yml index e9475a597421..2edc7c207930 100644 --- a/.github/workflows/publish_0.2.yml +++ b/.github/workflows/publish_0.2.yml @@ -24,7 +24,7 @@ jobs: - name: Install Rust (rustup) run: rustup update stable --no-self-update && rustup default stable - name: Run release-plz - uses: release-plz/action@064f4d1e36c843611ddf013be726beaa4ad804db # v0.5.129 + uses: release-plz/action@e8792575c7f2366cf6ff3ccc33ead9ace5b691c7 # v0.5.130 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} From cb2da90858ff51bc21f0ed17f01e4e92be536892 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Wed, 17 Jun 2026 19:47:38 -0400 Subject: [PATCH 49/80] apple: Make bsdshortinfo.pbsi_rfu nonpublic (backport ) (cherry picked from commit 064dc78220fc185dc1e679583dc28d3efa48ccd5) --- src/unix/bsd/apple/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index d9cc9ce9bd14..a8da5e86de7d 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -654,7 +654,7 @@ s! { /// Current SVGID on process. pub pbsi_svgid: crate::gid_t, /// Reserved for future use. - pub pbsi_rfu: u32, + pbsi_rfu: u32, } pub struct proc_taskallinfo { From c606f6c85a46ea271c15e838885c215aaacfafaf Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Wed, 29 Apr 2026 21:47:24 -0700 Subject: [PATCH 50/80] qurt: fix type and definition inaccuracies against SDK headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compare Rust definitions against Hexagon SDK 6.4.0.2 computev69 POSIX headers and fix mismatches. Changes pthread_rwlock_t and pthread_rwlockattr_t to *mut c_void, sigval from struct to union, closedir param from *const to *mut DIR. Removes functions not provided by QuRT (fork, execve, kill, alarm, pause, sigprocmask, sigpending, creat). Adds sched_yield, SIGIOT, SIGPOLL; removes SIGVTALRM. Also adds test_qurt() ctest function (disabled — requires sched_yield stub), libc-test/semver/qurt.txt, and fixes the c_schar ambiguous glob re-export. (backport ) (cherry picked from commit ab8fc5ad5c97b0abbb1dc76f2a8cfebd984fc796) --- libc-test/build.rs | 240 +++++++++++++++++++++- libc-test/semver/qurt.txt | 404 ++++++++++++++++++++++++++++++++++++++ src/new/mod.rs | 1 - src/new/qurt/fcntl.rs | 1 - src/new/qurt/limits.rs | 4 +- src/new/qurt/mod.rs | 114 +++++------ src/new/qurt/pthread.rs | 28 +-- src/new/qurt/signal.rs | 23 ++- src/new/qurt/sys/sched.rs | 3 + 9 files changed, 720 insertions(+), 98 deletions(-) create mode 100644 libc-test/semver/qurt.txt diff --git a/libc-test/build.rs b/libc-test/build.rs index 2899adf48203..e644ad9ba34e 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -20,7 +20,7 @@ use std::{ fn do_cc() { let target = env::var("TARGET").unwrap(); if cfg!(unix) || target.contains("cygwin") { - let exclude = ["redox", "wasi", "wali"]; + let exclude = ["redox", "wasi", "wali", "qurt"]; if !exclude.iter().any(|x| target.contains(x)) { let mut cmsg = cc::Build::new(); @@ -76,6 +76,8 @@ fn do_ctest() { t if t.contains("windows") => test_windows(t), t if t.contains("vxworks") => test_vxworks(t), t if t.contains("nto-qnx") => test_neutrino(t), + // QuRT ctest requires a sched_yield stub (static inline in SDK). + t if t.contains("qurt") => return, t if t.contains("aix") => return test_aix(t), t => panic!("unknown target {t}"), } @@ -5830,6 +5832,242 @@ fn test_aix(target: &str) { ctest::generate_test(&mut cfg, "../src/lib.rs", "ctest_output.rs").unwrap(); } +// QuRT ctest is disabled: sched_yield is static inline in the SDK (no +// linkable symbol). A stub or --defsym is needed. The semver test works. +#[allow(dead_code)] +fn test_qurt(target: &str) { + assert!(target.contains("qurt")); + + let mut cfg = ctest_cfg(); + cfg.flag("-Wno-deprecated-declarations"); + + // QuRT POSIX headers are in the SDK, include paths are set via + // CFLAGS_hexagon_unknown_qurt in the test runner script. + headers!( + cfg, + "pthread.h", + "pthread_types.h", + "semaphore.h", + "signal.h", + "time.h", + "fcntl.h", + "sys/types.h", + "sys/sched.h", + "sys/errno.h", + "mqueue.h", + ); + + // QuRT doesn't have all the standard unix types/structs + cfg.skip_struct(|s| { + match s.ident() { + // These are compatibility stubs in libc, not from QuRT headers + "stat" | "tm" | "timespec" | "timeval" | "itimerspec" | "dirent" | "DIR" + | "termios" | "rlimit" | "rusage" | "flock" | "div_t" | "ldiv_t" | "lldiv_t" => true, + // sigaction: sa_handler/sa_sigaction are a union in C but separate fields in Rust + "sigaction" => true, + // sem_t is typedef of anonymous struct in C (no struct tag) + "sem_t" => true, + _ => false, + } + }); + + cfg.skip_alias(|ty| { + match ty.ident() { + // Skip types not defined in QuRT POSIX headers + "intptr_t" | "uintptr_t" | "ptrdiff_t" | "size_t" | "ssize_t" | "time_t" + | "suseconds_t" | "useconds_t" | "timer_t" | "dev_t" | "ino_t" | "mode_t" + | "nlink_t" | "off_t" | "blkcnt_t" | "blksize_t" | "uid_t" | "gid_t" | "socklen_t" + | "sa_family_t" | "in_addr_t" | "in_port_t" | "fpos_t" | "clock_t" | "nfds_t" + | "va_list" | "c_schar" | "wchar_t" | "errno_t" | "rlim_t" | "speed_t" | "tcflag_t" + | "sighandler_t" => true, + // fd_set is defined in mqueue.h as a struct, but libc has it as c_ulong + "fd_set" => true, + // sem_t is a struct in QuRT but an alias in libc + "sem_t" => true, + // Skip internal/compatibility types + "FILE" => true, + // These are libc internal types + t if t.starts_with("__c_anonymous_") => true, + t if t.starts_with("__uint") => true, + _ => false, + } + }); + + cfg.skip_const(|c| { + let name = c.ident(); + match name { + // Skip constants not from QuRT POSIX headers + "EOK" | "PAGESIZE" | "PAGE_SIZE" | "L_tmpnam" | "TMP_MAX" | "FOPEN_MAX" => true, + // Skip DT_* directory entry constants (not in QuRT POSIX headers) + _ if name.starts_with("DT_") => true, + // Skip CLOCK_* that aren't in the QuRT time.h directly + "CLOCK_MONOTONIC_RAW" + | "CLOCK_REALTIME_COARSE" + | "CLOCK_MONOTONIC_COARSE" + | "CLOCK_BOOTTIME" => true, + // Skip signal constants not defined in QuRT signal.h + _ if name.starts_with("SIG") + && !matches!( + name, + "SIGKILL" + | "SIGRTMIN" + | "SIGRTMAX" + | "SIGEV_NONE" + | "SIGEV_SIGNAL" + | "SIGEV_THREAD" + | "SIG_BLOCK" + | "SIG_UNBLOCK" + | "SIG_SETMASK" + ) => + { + true + } + "SA_SIGINFO" => false, + // Skip SIG_DFL, SIG_IGN, SIG_ERR (function pointers, not simple ints) + "SIG_DFL" | "SIG_IGN" | "SIG_ERR" => true, + // Skip POSIX_MSG/POSIX_NOTIF + "POSIX_MSG" | "POSIX_NOTIF" => true, + // Skip errno constants (they come from toolchain errno.h, not QuRT-specific) + _ if name.starts_with("E") + && name.len() > 1 + && name + .chars() + .all(|c| c.is_ascii_uppercase() || c.is_ascii_digit()) => + { + true + } + // Skip O_* constants that use POSIX_ prefix in QuRT + _ if name.starts_with("O_") => true, + // Skip F_* fcntl constants + _ if name.starts_with("F_") && !name.starts_with("FD_") => true, + "FD_CLOEXEC" => true, + // Skip limits constants not in QuRT headers + _ if name.starts_with("CHAR_") + || name.starts_with("SCHAR_") + || name.starts_with("UCHAR_") => + { + true + } + _ if name.starts_with("INT_") || name.starts_with("UINT_") => true, + _ if name.starts_with("LONG_") || name.starts_with("ULONG_") => true, + _ if name.starts_with("SHRT_") || name.starts_with("USHRT_") => true, + "CHAR_BIT" | "IOV_MAX" => true, + _ if name.starts_with("ARG_MAX") + || name.starts_with("CHILD_MAX") + || name.starts_with("LINK_MAX") + || name.starts_with("MAX_") + || name.starts_with("NAME_MAX") + || name.starts_with("OPEN_MAX") + || name.starts_with("PATH_MAX") + || name.starts_with("PIPE_BUF") + || name.starts_with("STREAM_MAX") + || name.starts_with("TZNAME_MAX") => + { + true + } + // Skip stdio constants + "BUFSIZ" | "FILENAME_MAX" | "EOF" => true, + // Skip stdlib constants + "EXIT_SUCCESS" | "EXIT_FAILURE" | "RAND_MAX" => true, + // Skip dlfcn constants + _ if name.starts_with("RTLD_") || name == "DL_LAZY" => true, + // Skip mman constants + _ if name.starts_with("PROT_") + || name.starts_with("MAP_") + || name.starts_with("MS_") + || name.starts_with("MCL_") => + { + true + } + // Skip stat constants + _ if name.starts_with("S_I") || name == "S_IFMT" => true, + // Skip unistd constants + _ if name.starts_with("_PC_") || name.starts_with("_SC_") => true, + "F_OK" | "X_OK" | "W_OK" | "R_OK" => true, + "SEEK_SET" | "SEEK_CUR" | "SEEK_END" => true, + "STDIN_FILENO" | "STDOUT_FILENO" | "STDERR_FILENO" => true, + // Skip TIME_CONV_SCLK_FREQ (QuRT-specific, not a standard C constant) + "TIME_CONV_SCLK_FREQ" => true, + // Skip SEM_FAILED (null pointer constant) + "SEM_FAILED" => true, + // Skip MAP_FAILED + "MAP_FAILED" => true, + _ => false, + } + }); + + cfg.skip_fn(|func| { + let name = func.ident(); + match name { + // Skip functions not from QuRT POSIX headers we're testing + "strlen" | "strcpy" | "strncpy" | "strcat" | "strncat" | "strcmp" | "strncmp" + | "strcoll" | "strxfrm" | "strchr" | "strrchr" | "strspn" | "strcspn" | "strpbrk" + | "strstr" | "strtok" | "strerror" | "memchr" | "memcmp" | "memcpy" | "memmove" + | "memset" => true, + // Skip ctype functions + "isalnum" | "isalpha" | "iscntrl" | "isdigit" | "isgraph" | "islower" | "isprint" + | "ispunct" | "isspace" | "isupper" | "isxdigit" | "tolower" | "toupper" => true, + // Skip stdio functions + "fopen" | "freopen" | "fclose" | "fflush" | "fread" | "fwrite" | "fgetc" | "fputc" + | "getchar" | "putchar" | "ungetc" | "fgets" | "fputs" | "gets" | "puts" | "printf" + | "fprintf" | "sprintf" | "snprintf" | "vprintf" | "vfprintf" | "vsprintf" + | "vsnprintf" | "scanf" | "fscanf" | "sscanf" | "fseek" | "ftell" | "rewind" + | "fgetpos" | "fsetpos" | "clearerr" | "feof" | "ferror" | "perror" | "remove" + | "rename" | "tmpfile" | "tmpnam" | "setvbuf" | "setbuf" => true, + // Skip stdlib functions + "malloc" | "calloc" | "realloc" | "free" | "abort" | "exit" | "atexit" | "getenv" + | "setenv" | "unsetenv" | "atoi" | "atol" | "atoll" | "strtol" | "strtoul" + | "strtoll" | "strtoull" | "strtod" | "strtof" | "rand" | "srand" | "qsort" + | "bsearch" | "abs" | "labs" | "llabs" | "div" | "ldiv" | "lldiv" => true, + // Skip unistd functions + "access" | "close" | "lseek" | "read" | "write" | "ftruncate" | "unlink" | "getcwd" + | "rmdir" | "getpid" | "sleep" | "sysconf" => true, + // Skip dlfcn functions + "dlopen" | "dlclose" | "dlsym" | "dlerror" => true, + // Skip mman functions + "mmap" | "munmap" | "mprotect" | "mlock" | "munlock" | "mlockall" | "munlockall" + | "msync" => true, + // Skip stat functions + "stat" | "fstat" => true, + // Skip time functions (some are in generic headers, not QuRT posix) + "time" | "clock" | "difftime" | "mktime" | "gmtime" | "gmtime_r" | "localtime" + | "localtime_r" | "asctime" | "asctime_r" | "ctime" | "ctime_r" | "strftime" + | "strptime" | "nanosleep" => true, + // Skip signal functions that use sigaction (it's a macro in QuRT) + "sigaction" => true, + // Skip signal functions from generic toolchain headers + "signal" | "raise" => true, + // Skip dir functions + "opendir" | "readdir" | "closedir" | "mkdir" => true, + // Skip aligned_alloc / posix_memalign + "aligned_alloc" | "posix_memalign" => true, + // Skip clock_getcpuclockid + "clock_getcpuclockid" => true, + // Skip sem_open/sem_close/sem_unlink + "sem_open" | "sem_close" | "sem_unlink" => true, + // Skip __errno_location (QuRT-specific) + "__errno_location" => true, + // Skip _sigaction (internal) + "_sigaction" => true, + // pthread_equal is a static inline in QuRT + "pthread_equal" => true, + // sigtimedwait is not in QuRT POSIX libraries + "sigtimedwait" => true, + _ => false, + } + }); + + // Skip field checks for opaque types + cfg.skip_struct_field(|s, f| { + // pthread_attr_t bitfield can't be checked directly + s.ident() == "pthread_attr_t" && f.ident() == "__bitfield" + }); + + cfg.skip_roundtrip(|_| true); + + ctest::generate_test(&mut cfg, "../src/lib.rs", "ctest_output.rs").unwrap(); +} + /// Attempt to execute a command and collect its output, If the command fails for whatever /// reason, return `None`. fn try_command_output(cmd: &str, args: &[&str]) -> Option { diff --git a/libc-test/semver/qurt.txt b/libc-test/semver/qurt.txt new file mode 100644 index 000000000000..ed77dc99dde5 --- /dev/null +++ b/libc-test/semver/qurt.txt @@ -0,0 +1,404 @@ +ARG_MAX +BUFSIZ +CHAR_BIT +CHAR_MAX +CHAR_MIN +CHILD_MAX +CLOCK_BOOTTIME +CLOCK_MONOTONIC_COARSE +CLOCK_MONOTONIC_RAW +CLOCK_PROCESS_CPUTIME_ID +CLOCK_REALTIME_COARSE +CLOCK_THREAD_CPUTIME_ID +DL_LAZY +DT_UNKNOWN +EADV +EBADE +EBADFD +EBADR +EBADRQC +EBADSLT +EBFONT +ECHRNG +ECOMM +EDEADLOCK +EDOTDOT +EHWPOISON +EISNAM +EKEYEXPIRED +EKEYREJECTED +EKEYREVOKED +EL2HLT +EL2NSYNC +EL3HLT +EL3RST +ELIBACC +ELIBBAD +ELIBEXEC +ELIBMAX +ELIBSCN +ELNRNG +EMEDIUMTYPE +EMULTIHOP +ENAVAIL +ENOANO +ENOCSI +ENODATA +ENOKEY +ENOLINK +ENOMEDIUM +ENONET +ENOPKG +ENOSR +ENOSTR +ENOTBLK +ENOTNAM +ENOTRECOVERABLE +ENOTSUP +ENOTUNIQ +EOF +EOK +EOWNERDEAD +EREMCHG +EREMOTE +EREMOTEIO +ERESTART +ERFKILL +ESOCKTNOSUPPORT +ESRMNT +ESTRPIPE +ETIME +ETOOMANYREFS +EUCLEAN +EUNATCH +EUSERS +EXFULL +FILENAME_MAX +FOPEN_MAX +F_RDLCK +F_UNLCK +F_WRLCK +IOV_MAX +LINK_MAX +LONG_MAX +LONG_MIN +L_tmpnam +MAP_FILE +MAP_HASSEMAPHORE +MAP_INHERIT +MAP_NORESERVE +MAP_RENAME +MAP_TRYFIXED +MAP_WIRED +MAX_CANON +MAX_INPUT +MCL_CURRENT +MCL_FUTURE +NAME_MAX +NFDBITS +OPEN_MAX +O_DSYNC +O_FSYNC +O_NOCTTY +O_SYNC +PAGESIZE +PAGE_SIZE +PIPE_BUF +POSIX_MSG +POSIX_NOTIF +PTHREAD_CREATE_DETACHED +PTHREAD_CREATE_JOINABLE +PTHREAD_DEFAULT_PRIORITY +PTHREAD_DEFAULT_STACKSIZE +PTHREAD_EXPLICIT_SCHED +PTHREAD_INHERIT_SCHED +PTHREAD_MAX_PRIORITY +PTHREAD_MAX_STACKSIZE +PTHREAD_MAX_THREADS +PTHREAD_MIN_PRIORITY +PTHREAD_MIN_STACKSIZE +PTHREAD_MUTEX_DEFAULT +PTHREAD_MUTEX_ERRORCHECK +PTHREAD_NAME_LEN +PTHREAD_ONCE_INIT +PTHREAD_PRIO_INHERIT +PTHREAD_PRIO_NONE +PTHREAD_PRIO_PROTECT +PTHREAD_PROCESS_PRIVATE +PTHREAD_PROCESS_SHARED +PTHREAD_SCOPE_PROCESS +PTHREAD_SCOPE_SYSTEM +PTHREAD_SPINLOCK_LOCKED +PTHREAD_SPINLOCK_UNLOCKED +PTHREAD_STACK_MIN +RAND_MAX +RTLD_NEXT +RTLD_SELF +SCHAR_MAX +SCHAR_MIN +SCHED_FIFO +SCHED_OTHER +SCHED_RR +SCHED_SPORADIC +SEM_FAILED +SHRT_MAX +SHRT_MIN +SIGEV_NONE +SIGEV_SIGNAL +SIGEV_THREAD +SIGIO +SIGPOLL +SIGPWR +SIGRTMAX +SIGRTMIN +SIGSTKFLT +STREAM_MAX +TIME_CONV_SCLK_FREQ +TMP_MAX +TZNAME_MAX +UCHAR_MAX +UINT_MAX +ULONG_MAX +USHRT_MAX +_PC_2_SYMLINKS +_PC_ALLOC_SIZE_MIN +_PC_ASYNC_IO +_PC_FILESIZEBITS +_PC_PRIO_IO +_PC_REC_INCR_XFER_SIZE +_PC_REC_MAX_XFER_SIZE +_PC_REC_MIN_XFER_SIZE +_PC_REC_XFER_ALIGN +_PC_SOCK_MAXBUF +_PC_SYMLINK_MAX +_PC_SYNC_IO +_SC_2_CHAR_TERM +_SC_2_C_BIND +_SC_2_C_DEV +_SC_2_C_VERSION +_SC_2_FORT_DEV +_SC_2_FORT_RUN +_SC_2_LOCALEDEF +_SC_2_PBS +_SC_2_PBS_ACCOUNTING +_SC_2_PBS_CHECKPOINT +_SC_2_PBS_LOCATE +_SC_2_PBS_MESSAGE +_SC_2_PBS_TRACK +_SC_2_SW_DEV +_SC_2_UPE +_SC_2_VERSION +_SC_ADVISORY_INFO +_SC_AIO_LISTIO_MAX +_SC_AIO_MAX +_SC_AIO_PRIO_DELTA_MAX +_SC_ASYNCHRONOUS_IO +_SC_ATEXIT_MAX +_SC_AVPHYS_PAGES +_SC_BARRIERS +_SC_BC_BASE_MAX +_SC_BC_DIM_MAX +_SC_BC_SCALE_MAX +_SC_BC_STRING_MAX +_SC_CHARCLASS_NAME_MAX +_SC_CHAR_BIT +_SC_CHAR_MAX +_SC_CHAR_MIN +_SC_CLOCK_SELECTION +_SC_COLL_WEIGHTS_MAX +_SC_CPUTIME +_SC_DELAYTIMER_MAX +_SC_EQUIV_CLASS_MAX +_SC_EXPR_NEST_MAX +_SC_FSYNC +_SC_GETGR_R_SIZE_MAX +_SC_GETPW_R_SIZE_MAX +_SC_INT_MAX +_SC_INT_MIN +_SC_IOV_MAX +_SC_IPV6 +_SC_JOB_CONTROL +_SC_LINE_MAX +_SC_LOGIN_NAME_MAX +_SC_LONG_BIT +_SC_MAPPED_FILES +_SC_MB_LEN_MAX +_SC_MEMLOCK +_SC_MEMLOCK_RANGE +_SC_MEMORY_PROTECTION +_SC_MESSAGE_PASSING +_SC_MONOTONIC_CLOCK +_SC_MQ_OPEN_MAX +_SC_MQ_PRIO_MAX +_SC_NL_ARGMAX +_SC_NL_LANGMAX +_SC_NL_MSGMAX +_SC_NL_NMAX +_SC_NL_SETMAX +_SC_NL_TEXTMAX +_SC_NPROCESSORS_CONF +_SC_NPROCESSORS_ONLN +_SC_NZERO +_SC_PASS_MAX +_SC_PHYS_PAGES +_SC_PII +_SC_PII_INTERNET +_SC_PII_INTERNET_DGRAM +_SC_PII_INTERNET_STREAM +_SC_PII_OSI +_SC_PII_OSI_CLTS +_SC_PII_OSI_COTS +_SC_PII_OSI_M +_SC_PII_SOCKET +_SC_PII_XTI +_SC_POLL +_SC_PRIORITIZED_IO +_SC_PRIORITY_SCHEDULING +_SC_RAW_SOCKETS +_SC_READER_WRITER_LOCKS +_SC_REALTIME_SIGNALS +_SC_REGEXP +_SC_RE_DUP_MAX +_SC_RTSIG_MAX +_SC_SAVED_IDS +_SC_SCHAR_MAX +_SC_SCHAR_MIN +_SC_SELECT +_SC_SEMAPHORES +_SC_SEM_NSEMS_MAX +_SC_SEM_VALUE_MAX +_SC_SHARED_MEMORY_OBJECTS +_SC_SHELL +_SC_SHRT_MAX +_SC_SHRT_MIN +_SC_SIGQUEUE_MAX +_SC_SPAWN +_SC_SPIN_LOCKS +_SC_SPORADIC_SERVER +_SC_SSIZE_MAX +_SC_SS_REPL_MAX +_SC_SYNCHRONIZED_IO +_SC_THREADS +_SC_THREAD_ATTR_STACKADDR +_SC_THREAD_ATTR_STACKSIZE +_SC_THREAD_CPUTIME +_SC_THREAD_DESTRUCTOR_ITERATIONS +_SC_THREAD_KEYS_MAX +_SC_THREAD_PRIORITY_SCHEDULING +_SC_THREAD_PRIO_INHERIT +_SC_THREAD_PRIO_PROTECT +_SC_THREAD_PROCESS_SHARED +_SC_THREAD_ROBUST_PRIO_INHERIT +_SC_THREAD_ROBUST_PRIO_PROTECT +_SC_THREAD_SAFE_FUNCTIONS +_SC_THREAD_SPORADIC_SERVER +_SC_THREAD_STACK_MIN +_SC_THREAD_THREADS_MAX +_SC_TIMEOUTS +_SC_TIMERS +_SC_TIMER_MAX +_SC_TRACE +_SC_TRACE_EVENT_FILTER +_SC_TRACE_EVENT_NAME_MAX +_SC_TRACE_INHERIT +_SC_TRACE_LOG +_SC_TRACE_NAME_MAX +_SC_TRACE_SYS_MAX +_SC_TRACE_USER_EVENT_MAX +_SC_TYPED_MEMORY_OBJECTS +_SC_T_IOV_MAX +_SC_UCHAR_MAX +_SC_UINT_MAX +_SC_UIO_MAXIOV +_SC_ULONG_MAX +_SC_USHRT_MAX +_SC_V6_ILP32_OFF32 +_SC_V6_ILP32_OFFBIG +_SC_V6_LP64_OFF64 +_SC_V6_LPBIG_OFFBIG +_SC_V7_ILP32_OFF32 +_SC_V7_ILP32_OFFBIG +_SC_V7_LP64_OFF64 +_SC_V7_LPBIG_OFFBIG +_SC_WORD_BIT +_SC_XBS5_ILP32_OFF32 +_SC_XBS5_ILP32_OFFBIG +_SC_XBS5_LP64_OFF64 +_SC_XBS5_LPBIG_OFFBIG +_SC_XOPEN_CRYPT +_SC_XOPEN_ENH_I18N +_SC_XOPEN_LEGACY +_SC_XOPEN_REALTIME +_SC_XOPEN_REALTIME_THREADS +_SC_XOPEN_SHM +_SC_XOPEN_STREAMS +_SC_XOPEN_UNIX +_SC_XOPEN_VERSION +_SC_XOPEN_XCU_VERSION +_SC_XOPEN_XPG2 +_SC_XOPEN_XPG3 +_SC_XOPEN_XPG4 +__errno_location +_sigaction +abs +asctime +asctime_r +bsearch +clearerr +clock +clock_getcpuclockid +cpu_set_t +ctime +ctime_r +difftime +div +div_t +errno_t +gets +itimerspec +labs +ldiv +ldiv_t +llabs +lldiv +lldiv_t +mqd_t +pthread_attr_getaffinity_np +pthread_attr_getdetachstate +pthread_attr_getstack +pthread_attr_setaffinity_np +pthread_attr_setstack +pthread_barrier_t +pthread_barrierattr_t +pthread_condattr_setclock +pthread_getname_np +pthread_mutexattr_gettype +pthread_once +pthread_once_t +pthread_spinlock_t +qsort +rand +sched_get_priority_max +sched_get_priority_min +sched_param +sem_close +sem_destroy +sem_getvalue +sem_init +sem_open +sem_unlink +sigevent +siginfo_t +sigsuspend +sigtimedwait +sigwait +srand +strftime +strptime +timer_t +useconds_t +va_list +vfprintf +vprintf +vsnprintf +vsprintf diff --git a/src/new/mod.rs b/src/new/mod.rs index 6928668f8ac0..e45dea7b9dae 100644 --- a/src/new/mod.rs +++ b/src/new/mod.rs @@ -104,7 +104,6 @@ cfg_if! { pub(crate) use openbsd::*; } else if #[cfg(target_os = "qurt")] { pub mod qurt; - pub use qurt::*; } else if #[cfg(target_os = "redox")] { mod redox; // pub(crate) use redox::*; diff --git a/src/new/qurt/fcntl.rs b/src/new/qurt/fcntl.rs index 0287292ad2f8..615a7128cc50 100644 --- a/src/new/qurt/fcntl.rs +++ b/src/new/qurt/fcntl.rs @@ -47,6 +47,5 @@ pub const F_UNLCK: c_int = 2; // Functions extern "C" { pub fn open(pathname: *const c_char, flags: c_int, ...) -> c_int; - pub fn creat(pathname: *const c_char, mode: mode_t) -> c_int; pub fn fcntl(fd: c_int, cmd: c_int, ...) -> c_int; } diff --git a/src/new/qurt/limits.rs b/src/new/qurt/limits.rs index ae1a007ff1c6..fefe069c1c19 100644 --- a/src/new/qurt/limits.rs +++ b/src/new/qurt/limits.rs @@ -7,8 +7,8 @@ use crate::prelude::*; pub const CHAR_BIT: c_uint = 8; pub const CHAR_MAX: c_char = 255; // unsigned char on Hexagon pub const CHAR_MIN: c_char = 0; -pub const SCHAR_MAX: c_schar = 127; -pub const SCHAR_MIN: c_schar = -128; +pub const SCHAR_MAX: i8 = 127; +pub const SCHAR_MIN: i8 = -128; pub const UCHAR_MAX: c_uchar = 255; // Integer properties diff --git a/src/new/qurt/mod.rs b/src/new/qurt/mod.rs index 41ce4b50ba0a..7d1db55a7824 100644 --- a/src/new/qurt/mod.rs +++ b/src/new/qurt/mod.rs @@ -39,15 +39,18 @@ pub type pthread_t = c_uint; pub type pthread_key_t = c_int; pub type pthread_once_t = c_int; pub type pthread_mutex_t = c_uint; -pub type pthread_mutexattr_t = c_uint; +// QuRT pthread_mutexattr_t is a struct with 4 ints (is_initialized, type, pshared, protocol) +pub type pthread_mutexattr_t = [c_uint; 4]; pub type pthread_cond_t = c_uint; -pub type pthread_condattr_t = c_uint; -pub type pthread_attr_t = c_uint; -pub type pthread_rwlock_t = c_uint; -pub type pthread_rwlockattr_t = c_uint; +// QuRT pthread_condattr_t is a struct with 3 ints (is_initialized, pshared, clock_id) +pub type pthread_condattr_t = [c_uint; 3]; +// pthread_attr_t is defined as a struct in the s! block below +pub type pthread_rwlock_t = *mut c_void; +pub type pthread_rwlockattr_t = *mut c_void; pub type pthread_spinlock_t = c_uint; pub type pthread_barrier_t = c_uint; -pub type pthread_barrierattr_t = c_uint; +// QuRT pthread_barrierattr_t is a struct with 2 ints (is_initialized, pshared) +pub type pthread_barrierattr_t = [c_uint; 2]; // Network types pub type socklen_t = c_uint; @@ -55,8 +58,8 @@ pub type sa_family_t = c_ushort; pub type in_addr_t = c_uint; pub type in_port_t = c_ushort; -// File descriptor types -pub type fd_set = c_ulong; +// File descriptor types - QuRT defines fd_set as a struct in mqueue.h +// FD_SETSIZE = 256, NFDBITS = 32, so fds_bits has 8 elements // Standard C library types extern_ty! { @@ -65,8 +68,7 @@ extern_ty! { pub type fpos_t = c_long; pub type clock_t = c_long; -// POSIX semaphore types -pub type sem_t = c_uint; +// POSIX semaphore types - QuRT sem_t is a struct with an opaque pointer // Message queue types pub type mqd_t = c_int; @@ -80,22 +82,12 @@ pub type sigset_t = c_ulong; // Variadic argument list type pub type va_list = *mut c_char; -// Additional missing types -pub type c_schar = i8; - -// Wide character type (hexagon-specific) -pub type wchar_t = u32; +// Wide character type (hexagon uses signed wchar_t) +pub type wchar_t = i32; // Error type (compatible with std expectations) pub type errno_t = c_int; -// Resource limit type (for compatibility, not fully supported on QuRT) -pub type rlim_t = c_ulong; - -// Terminal types (for compatibility, not fully supported on QuRT) -pub type speed_t = c_uint; -pub type tcflag_t = c_uint; - // Division result types and structures s! { pub struct div_t { @@ -164,43 +156,7 @@ s! { pub entry: dirent, } - // Terminal I/O structure (for compatibility, limited support on QuRT) - pub struct termios { - pub c_iflag: tcflag_t, - pub c_oflag: tcflag_t, - pub c_cflag: tcflag_t, - pub c_lflag: tcflag_t, - pub c_cc: [c_uchar; 32], - pub c_ispeed: speed_t, - pub c_ospeed: speed_t, - } - - // Resource limit structures (for compatibility, limited support on QuRT) - pub struct rlimit { - pub rlim_cur: rlim_t, - pub rlim_max: rlim_t, - } - - pub struct rusage { - pub ru_utime: timeval, - pub ru_stime: timeval, - pub ru_maxrss: c_long, - pub ru_ixrss: c_long, - pub ru_idrss: c_long, - pub ru_isrss: c_long, - pub ru_minflt: c_long, - pub ru_majflt: c_long, - pub ru_nswap: c_long, - pub ru_inblock: c_long, - pub ru_oublock: c_long, - pub ru_msgsnd: c_long, - pub ru_msgrcv: c_long, - pub ru_nsignals: c_long, - pub ru_nvcsw: c_long, - pub ru_nivcsw: c_long, - } - - // File lock structure (for compatibility) + // File lock structure (from toolchain generic fcntl.h) pub struct flock { pub l_type: c_short, pub l_whence: c_short, @@ -208,6 +164,30 @@ s! { pub l_len: off_t, pub l_pid: pid_t, } + + // QuRT fd_set from mqueue.h: FD_SETSIZE=256, NFDBITS=32 (sizeof(fd_mask)*8) + pub struct fd_set { + pub fds_bits: [c_ulong; 8], + } + + // QuRT sem_t from semaphore.h: struct with opaque pointer + pub struct sem_t { + pub opaque: *mut c_uint, + } + + // QuRT pthread_attr_t - matches pthread_types.h struct layout + pub struct pthread_attr_t { + pub stackaddr: *mut c_void, + pub internal_stack: c_int, + pub stacksize: size_t, + pub priority: c_int, + pub timetest_id: c_ushort, + __bitfield: c_ushort, + pub cpumask: cpu_set_t, + pub name: [c_char; 16], + pub ext_context: c_int, + pub detachstate: c_int, + } } // Additional pthread constants @@ -238,6 +218,10 @@ pub const EOK: c_int = 0; // Semaphore constants pub const SEM_FAILED: *mut sem_t = ptr::null_mut(); +// fd_set constants from mqueue.h +pub const FD_SETSIZE: c_uint = 256; +pub const NFDBITS: c_uint = 32; + // Page size constants (hexagon-specific) pub const PAGESIZE: size_t = 4096; pub const PAGE_SIZE: size_t = 4096; @@ -256,7 +240,7 @@ pub const DT_SOCK: c_uchar = 12; extern "C" { pub fn opendir(name: *const c_char) -> *mut DIR; pub fn readdir(dirp: *mut DIR) -> *mut dirent; - pub fn closedir(dirp: *const DIR) -> c_int; + pub fn closedir(dirp: *mut DIR) -> c_int; pub fn mkdir(path: *const c_char, mode: mode_t) -> c_int; } @@ -317,16 +301,6 @@ extern "C" { pub fn memset(s: *mut c_void, c: c_int, n: size_t) -> *mut c_void; } -// Additional unistd functions -extern "C" { - pub fn fork() -> pid_t; - pub fn execve( - filename: *const c_char, - argv: *const *const c_char, - envp: *const *const c_char, - ) -> c_int; -} - // Character classification functions (ctype.h) extern "C" { pub fn isalnum(c: c_int) -> c_int; diff --git a/src/new/qurt/pthread.rs b/src/new/qurt/pthread.rs index 543f7874c3dc..d068eaf2f56e 100644 --- a/src/new/qurt/pthread.rs +++ b/src/new/qurt/pthread.rs @@ -5,15 +5,19 @@ use super::*; use crate::prelude::*; -// Thread creation attributes -pub const PTHREAD_CREATE_JOINABLE: c_int = 0; -pub const PTHREAD_CREATE_DETACHED: c_int = 1; +// Thread creation attributes (QuRT values differ from POSIX/Linux defaults) +pub const PTHREAD_CREATE_DETACHED: c_int = 0; +pub const PTHREAD_CREATE_JOINABLE: c_int = 1; -// Mutex types -pub const PTHREAD_MUTEX_NORMAL: c_int = 0; -pub const PTHREAD_MUTEX_RECURSIVE: c_int = 1; -pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 2; -pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL; +// Mutex types (QuRT values differ from POSIX/Linux defaults) +pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 0; +pub const PTHREAD_MUTEX_NORMAL: c_int = 1; +pub const PTHREAD_MUTEX_RECURSIVE: c_int = 2; +pub const PTHREAD_MUTEX_DEFAULT: c_int = 3; + +// Process sharing +pub const PTHREAD_PROCESS_PRIVATE: c_int = 0; +pub const PTHREAD_PROCESS_SHARED: c_int = 1; // Mutex protocol pub const PTHREAD_PRIO_NONE: c_int = 0; @@ -27,6 +31,7 @@ pub const PTHREAD_MAX_PRIORITY: c_int = 255; // Initializer constants pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0xFFFFFFFF; pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0xFFFFFFFF; +pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = !0usize as pthread_rwlock_t; pub const PTHREAD_ONCE_INIT: pthread_once_t = 0; // Stack size @@ -36,8 +41,9 @@ pub const PTHREAD_STACK_MIN: size_t = 8192; pub const PTHREAD_SCOPE_SYSTEM: c_int = 0; pub const PTHREAD_SCOPE_PROCESS: c_int = 1; -pub const PTHREAD_INHERIT_SCHED: c_int = 0; -pub const PTHREAD_EXPLICIT_SCHED: c_int = 1; +// Scheduler inheritance (QuRT values differ from POSIX/Linux defaults) +pub const PTHREAD_EXPLICIT_SCHED: c_int = 0; +pub const PTHREAD_INHERIT_SCHED: c_int = 1; extern "C" { // Thread management @@ -51,7 +57,7 @@ extern "C" { pub fn pthread_detach(thread: pthread_t) -> c_int; pub fn pthread_exit(retval: *mut c_void) -> !; pub fn pthread_self() -> pthread_t; - pub fn pthread_equal(t1: pthread_t, t2: pthread_t) -> c_int; + // Note: pthread_equal is static inline in QuRT pthread.h, no linkable symbol // Thread attributes pub fn pthread_attr_init(attr: *mut pthread_attr_t) -> c_int; diff --git a/src/new/qurt/signal.rs b/src/new/qurt/signal.rs index f525fa15ff29..e5a219af5881 100644 --- a/src/new/qurt/signal.rs +++ b/src/new/qurt/signal.rs @@ -3,13 +3,14 @@ use super::*; use crate::prelude::*; -// Standard signal numbers +// Signal numbers from toolchain signal.h (non-_LINUX_C_LIB_H_ path) pub const SIGHUP: c_int = 1; pub const SIGINT: c_int = 2; pub const SIGQUIT: c_int = 3; pub const SIGILL: c_int = 4; pub const SIGTRAP: c_int = 5; pub const SIGABRT: c_int = 6; +pub const SIGIOT: c_int = 6; pub const SIGBUS: c_int = 7; pub const SIGFPE: c_int = 8; pub const SIGKILL: c_int = 9; @@ -29,9 +30,9 @@ pub const SIGTTOU: c_int = 22; pub const SIGURG: c_int = 23; pub const SIGXCPU: c_int = 24; pub const SIGXFSZ: c_int = 25; -pub const SIGVTALRM: c_int = 26; pub const SIGPROF: c_int = 27; pub const SIGWINCH: c_int = 28; +pub const SIGPOLL: c_int = 29; pub const SIGIO: c_int = 29; pub const SIGPWR: c_int = 30; pub const SIGSYS: c_int = 31; @@ -61,12 +62,16 @@ pub const SA_SIGINFO: c_int = 1; pub type sighandler_t = size_t; // Signal structures based on QuRT SDK headers -s! { - pub struct sigval { + +// sigval is a union in C (4 bytes on 32-bit hexagon) +s_no_extra_traits! { + pub union sigval { pub sival_int: c_int, pub sival_ptr: *mut c_void, } +} +s! { pub struct sigevent { pub sigev_notify: c_int, pub sigev_signo: c_int, @@ -90,23 +95,17 @@ s! { } extern "C" { + // From generic signal.h (toolchain) pub fn signal(sig: c_int, handler: sighandler_t) -> sighandler_t; - pub fn kill(pid: pid_t, sig: c_int) -> c_int; pub fn raise(sig: c_int) -> c_int; - pub fn alarm(seconds: c_uint) -> c_uint; - pub fn pause() -> c_int; - // Signal mask functions + // QuRT POSIX signal functions pub fn sigemptyset(set: *mut sigset_t) -> c_int; pub fn sigfillset(set: *mut sigset_t) -> c_int; pub fn sigaddset(set: *mut sigset_t, signum: c_int) -> c_int; pub fn sigdelset(set: *mut sigset_t, signum: c_int) -> c_int; pub fn sigismember(set: *const sigset_t, signum: c_int) -> c_int; - pub fn sigprocmask(how: c_int, set: *const sigset_t, oldset: *mut sigset_t) -> c_int; - pub fn sigpending(set: *mut sigset_t) -> c_int; pub fn sigsuspend(mask: *const sigset_t) -> c_int; - - // QuRT-specific signal functions pub fn sigwait(set: *const sigset_t, sig: *mut c_int) -> c_int; pub fn _sigaction(sig: c_int, act: *const sigaction, oact: *mut sigaction) -> c_int; pub fn sigtimedwait( diff --git a/src/new/qurt/sys/sched.rs b/src/new/qurt/sys/sched.rs index 56fed5ba0089..d56a4bc65e64 100644 --- a/src/new/qurt/sys/sched.rs +++ b/src/new/qurt/sys/sched.rs @@ -18,6 +18,9 @@ s! { } extern "C" { + // Note: sched_yield is static inline in QuRT sys/sched.h, so there is no + // linkable symbol in the SDK libraries. Programs must provide their own + // implementation or use --defsym=sched_yield=abort at link time. pub fn sched_yield() -> c_int; pub fn sched_get_priority_max(policy: c_int) -> c_int; pub fn sched_get_priority_min(policy: c_int) -> c_int; From 9d4e37a7e6ddec45d96068942488d2031823896e Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Wed, 29 Apr 2026 21:47:32 -0700 Subject: [PATCH 51/80] qurt: add missing pthread functions from QuRT SDK headers Add all pthread functions declared in the QuRT SDK pthread.h and pthread_types.h: thread cancellation, scheduling, spinlocks, barriers, rwlocks, and various attribute get/set functions. Moves pthread_attr_{get,set}stack from mod.rs to pthread.rs. (backport ) (cherry picked from commit b4b55e38d3b70ecdad5a7a024171dcf9505fed7b) --- libc-test/semver/qurt.txt | 48 ++++++++++++ src/new/qurt/mod.rs | 14 ---- src/new/qurt/pthread.rs | 150 ++++++++++++++++++++++++++++++++++++-- 3 files changed, 193 insertions(+), 19 deletions(-) diff --git a/libc-test/semver/qurt.txt b/libc-test/semver/qurt.txt index ed77dc99dde5..4f263cd0142c 100644 --- a/libc-test/semver/qurt.txt +++ b/libc-test/semver/qurt.txt @@ -365,16 +365,64 @@ lldiv_t mqd_t pthread_attr_getaffinity_np pthread_attr_getdetachstate +pthread_attr_getguardsize +pthread_attr_getinheritsched +pthread_attr_getschedparam +pthread_attr_getscope pthread_attr_getstack +pthread_attr_getstackaddr +pthread_attr_getthreadname +pthread_attr_gettimetestid pthread_attr_setaffinity_np +pthread_attr_setautostack +pthread_attr_setbuspriority +pthread_attr_setinheritsched +pthread_attr_setschedparam +pthread_attr_setscope pthread_attr_setstack +pthread_attr_setstackaddr +pthread_attr_setthreadname +pthread_attr_settimetestid +pthread_barrier_destroy +pthread_barrier_init pthread_barrier_t +pthread_barrier_wait +pthread_barrierattr_destroy +pthread_barrierattr_getpshared +pthread_barrierattr_init +pthread_barrierattr_setpshared pthread_barrierattr_t +pthread_cancel +pthread_condattr_getclock +pthread_condattr_getpshared pthread_condattr_setclock +pthread_condattr_setpshared +pthread_getattr_np pthread_getname_np +pthread_getschedparam +pthread_kill +pthread_mutex_getprioceiling +pthread_mutex_setprioceiling +pthread_mutexattr_getprioceiling +pthread_mutexattr_getprotocol +pthread_mutexattr_getpshared pthread_mutexattr_gettype +pthread_mutexattr_setprioceiling +pthread_mutexattr_setprotocol +pthread_mutexattr_setpshared pthread_once pthread_once_t +pthread_rwlockattr_getpshared +pthread_rwlockattr_setpshared +pthread_setcancelstate +pthread_setcanceltype +pthread_setschedparam +pthread_setschedprio +pthread_spin_destroy +pthread_spin_init +pthread_spin_lock +pthread_spin_trylock +pthread_spin_unlock pthread_spinlock_t qsort rand diff --git a/src/new/qurt/mod.rs b/src/new/qurt/mod.rs index 7d1db55a7824..d8a2762d742f 100644 --- a/src/new/qurt/mod.rs +++ b/src/new/qurt/mod.rs @@ -244,20 +244,6 @@ extern "C" { pub fn mkdir(path: *const c_char, mode: mode_t) -> c_int; } -// Additional pthread functions -extern "C" { - pub fn pthread_attr_getstack( - attr: *const pthread_attr_t, - stackaddr: *mut *mut c_void, - stacksize: *mut size_t, - ) -> c_int; - pub fn pthread_attr_setstack( - attr: *mut pthread_attr_t, - stackaddr: *mut c_void, - stacksize: size_t, - ) -> c_int; -} - // Additional time functions extern "C" { pub fn clock_getcpuclockid(pid: pid_t, clock_id: *mut clockid_t) -> c_int; diff --git a/src/new/qurt/pthread.rs b/src/new/qurt/pthread.rs index d068eaf2f56e..80ae47f495ea 100644 --- a/src/new/qurt/pthread.rs +++ b/src/new/qurt/pthread.rs @@ -37,7 +37,7 @@ pub const PTHREAD_ONCE_INIT: pthread_once_t = 0; // Stack size pub const PTHREAD_STACK_MIN: size_t = 8192; -// Additional pthread types and attributes +// Contention scope pub const PTHREAD_SCOPE_SYSTEM: c_int = 0; pub const PTHREAD_SCOPE_PROCESS: c_int = 1; @@ -58,17 +58,65 @@ extern "C" { pub fn pthread_exit(retval: *mut c_void) -> !; pub fn pthread_self() -> pthread_t; // Note: pthread_equal is static inline in QuRT pthread.h, no linkable symbol + pub fn pthread_cancel(thread: pthread_t) -> c_int; + pub fn pthread_kill(thread: pthread_t, sig: c_int) -> c_int; + pub fn pthread_setcancelstate(state: c_int, oldstate: *mut c_int) -> c_int; + pub fn pthread_setcanceltype(r#type: c_int, oldtype: *mut c_int) -> c_int; + + // Thread scheduling + pub fn pthread_getschedparam( + thread: pthread_t, + policy: *mut c_int, + param: *mut sched_param, + ) -> c_int; + pub fn pthread_setschedparam( + thread: pthread_t, + policy: c_int, + param: *const sched_param, + ) -> c_int; + pub fn pthread_setschedprio(thread: pthread_t, prio: c_int) -> c_int; // Thread attributes pub fn pthread_attr_init(attr: *mut pthread_attr_t) -> c_int; pub fn pthread_attr_destroy(attr: *mut pthread_attr_t) -> c_int; pub fn pthread_attr_setstacksize(attr: *mut pthread_attr_t, stacksize: size_t) -> c_int; pub fn pthread_attr_getstacksize(attr: *const pthread_attr_t, stacksize: *mut size_t) -> c_int; + pub fn pthread_attr_setstackaddr(attr: *mut pthread_attr_t, stackaddr: *mut c_void) -> c_int; + pub fn pthread_attr_getstackaddr( + attr: *const pthread_attr_t, + stackaddr: *mut *mut c_void, + ) -> c_int; + pub fn pthread_attr_setstack( + attr: *mut pthread_attr_t, + stackaddr: *mut c_void, + stacksize: size_t, + ) -> c_int; + pub fn pthread_attr_getstack( + attr: *const pthread_attr_t, + stackaddr: *mut *mut c_void, + stacksize: *mut size_t, + ) -> c_int; pub fn pthread_attr_setdetachstate(attr: *mut pthread_attr_t, detachstate: c_int) -> c_int; pub fn pthread_attr_getdetachstate( attr: *const pthread_attr_t, detachstate: *mut c_int, ) -> c_int; + pub fn pthread_attr_setscope(attr: *mut pthread_attr_t, scope: c_int) -> c_int; + pub fn pthread_attr_getscope(attr: *const pthread_attr_t, scope: *mut c_int) -> c_int; + pub fn pthread_attr_setinheritsched(attr: *mut pthread_attr_t, inheritsched: c_int) -> c_int; + pub fn pthread_attr_getinheritsched( + attr: *const pthread_attr_t, + inheritsched: *mut c_int, + ) -> c_int; + pub fn pthread_attr_setschedparam( + attr: *mut pthread_attr_t, + param: *const sched_param, + ) -> c_int; + pub fn pthread_attr_getschedparam( + attr: *const pthread_attr_t, + param: *mut sched_param, + ) -> c_int; + pub fn pthread_attr_getguardsize(attr: *const pthread_attr_t, guardsize: *mut size_t) -> c_int; // Mutex operations pub fn pthread_mutex_init( @@ -79,12 +127,39 @@ extern "C" { pub fn pthread_mutex_lock(mutex: *mut pthread_mutex_t) -> c_int; pub fn pthread_mutex_trylock(mutex: *mut pthread_mutex_t) -> c_int; pub fn pthread_mutex_unlock(mutex: *mut pthread_mutex_t) -> c_int; + pub fn pthread_mutex_getprioceiling( + mutex: *const pthread_mutex_t, + prioceiling: *mut c_int, + ) -> c_int; + pub fn pthread_mutex_setprioceiling( + mutex: *mut pthread_mutex_t, + prioceiling: c_int, + old_ceiling: *mut c_int, + ) -> c_int; // Mutex attributes pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> c_int; pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> c_int; pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, kind: c_int) -> c_int; pub fn pthread_mutexattr_gettype(attr: *const pthread_mutexattr_t, kind: *mut c_int) -> c_int; + pub fn pthread_mutexattr_setprotocol(attr: *mut pthread_mutexattr_t, protocol: c_int) -> c_int; + pub fn pthread_mutexattr_getprotocol( + attr: *const pthread_mutexattr_t, + protocol: *mut c_int, + ) -> c_int; + pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, pshared: c_int) -> c_int; + pub fn pthread_mutexattr_getpshared( + attr: *const pthread_mutexattr_t, + pshared: *mut c_int, + ) -> c_int; + pub fn pthread_mutexattr_setprioceiling( + attr: *mut pthread_mutexattr_t, + prioceiling: c_int, + ) -> c_int; + pub fn pthread_mutexattr_getprioceiling( + attr: *const pthread_mutexattr_t, + prioceiling: *mut c_int, + ) -> c_int; // Condition variables pub fn pthread_cond_init(cond: *mut pthread_cond_t, attr: *const pthread_condattr_t) -> c_int; @@ -102,6 +177,60 @@ extern "C" { pub fn pthread_condattr_init(attr: *mut pthread_condattr_t) -> c_int; pub fn pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> c_int; pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t, clock_id: clockid_t) -> c_int; + pub fn pthread_condattr_getclock( + attr: *const pthread_condattr_t, + clock_id: *mut clockid_t, + ) -> c_int; + pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: c_int) -> c_int; + pub fn pthread_condattr_getpshared( + attr: *const pthread_condattr_t, + pshared: *mut c_int, + ) -> c_int; + + // Spinlocks + 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; + + // Barriers + pub fn pthread_barrier_init( + barrier: *mut pthread_barrier_t, + attr: *const pthread_barrierattr_t, + count: c_uint, + ) -> c_int; + pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> c_int; + pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> c_int; + pub fn pthread_barrierattr_init(attr: *mut pthread_barrierattr_t) -> c_int; + pub fn pthread_barrierattr_destroy(attr: *mut pthread_barrierattr_t) -> c_int; + pub fn pthread_barrierattr_getpshared( + attr: *const pthread_barrierattr_t, + pshared: *mut c_int, + ) -> c_int; + pub fn pthread_barrierattr_setpshared( + attr: *mut pthread_barrierattr_t, + pshared: c_int, + ) -> c_int; + + // Read-write locks + pub fn pthread_rwlock_init( + rwlock: *mut pthread_rwlock_t, + attr: *const pthread_rwlockattr_t, + ) -> c_int; + pub fn pthread_rwlock_destroy(rwlock: *mut pthread_rwlock_t) -> c_int; + pub fn pthread_rwlock_rdlock(rwlock: *mut pthread_rwlock_t) -> c_int; + pub fn pthread_rwlock_tryrdlock(rwlock: *mut pthread_rwlock_t) -> c_int; + pub fn pthread_rwlock_wrlock(rwlock: *mut pthread_rwlock_t) -> c_int; + pub fn pthread_rwlock_trywrlock(rwlock: *mut pthread_rwlock_t) -> c_int; + pub fn pthread_rwlock_unlock(rwlock: *mut pthread_rwlock_t) -> c_int; + pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) -> c_int; + pub fn pthread_rwlockattr_destroy(attr: *mut pthread_rwlockattr_t) -> c_int; + pub fn pthread_rwlockattr_getpshared( + attr: *const pthread_rwlockattr_t, + pshared: *mut c_int, + ) -> c_int; + pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, pshared: c_int) -> c_int; // Thread-local storage pub fn pthread_key_create( @@ -115,21 +244,32 @@ extern "C" { // One-time initialization pub fn pthread_once(once_control: *mut pthread_once_t, init_routine: extern "C" fn()) -> c_int; - // GNU extensions + // GNU/QuRT non-portable extensions pub fn pthread_getname_np(thread: pthread_t, name: *mut c_char, len: size_t) -> c_int; - + pub fn pthread_getattr_np(thread: pthread_t, attr: *mut pthread_attr_t) -> c_int; pub fn pthread_attr_setaffinity_np( attr: *mut pthread_attr_t, cpusetsize: size_t, cpuset: *const cpu_set_t, ) -> c_int; - pub fn pthread_attr_getaffinity_np( attr: *mut pthread_attr_t, cpusetsize: size_t, cpuset: *mut cpu_set_t, ) -> c_int; - // POSIX standard + // QuRT-specific thread attribute extensions + pub fn pthread_attr_setthreadname(attr: *mut pthread_attr_t, name: *const c_char) -> c_int; + pub fn pthread_attr_getthreadname( + attr: *const pthread_attr_t, + name: *mut c_char, + size: c_int, + ) -> c_int; + pub fn pthread_attr_settimetestid(attr: *mut pthread_attr_t, tid: c_uint) -> c_int; + pub fn pthread_attr_gettimetestid(attr: *const pthread_attr_t, tid: *mut c_uint) -> c_int; + pub fn pthread_attr_setautostack(attr: *mut pthread_attr_t) -> c_int; + pub fn pthread_attr_setbuspriority(attr: *mut pthread_attr_t, bus_priority: c_ushort) -> c_int; + + // POSIX standard (declared in QuRT pthread.h) pub fn posix_memalign(memptr: *mut *mut c_void, alignment: size_t, size: size_t) -> c_int; } From 09d304737533368d517b9d4211f268be9d983db8 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Wed, 29 Apr 2026 21:47:40 -0700 Subject: [PATCH 52/80] qurt: add mqueue subsystem (message queues, select/pselect) Add POSIX message queue bindings from QuRT's mqueue.h: mq_attr struct, mq_open/close/send/receive and friends, select, pselect. (backport ) (cherry picked from commit 7d735b4cb5b90f2d6b32cbd358c674913f59c056) --- libc-test/semver/qurt.txt | 12 +++++++ src/new/qurt/mod.rs | 2 ++ src/new/qurt/mqueue.rs | 74 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 src/new/qurt/mqueue.rs diff --git a/libc-test/semver/qurt.txt b/libc-test/semver/qurt.txt index 4f263cd0142c..f0a691e1bb4e 100644 --- a/libc-test/semver/qurt.txt +++ b/libc-test/semver/qurt.txt @@ -94,7 +94,9 @@ MAX_CANON MAX_INPUT MCL_CURRENT MCL_FUTURE +MQ_PRIO_DEFAULT NAME_MAX +NBBY NFDBITS OPEN_MAX O_DSYNC @@ -362,6 +364,16 @@ ldiv_t llabs lldiv lldiv_t +mq_attr +mq_close +mq_getattr +mq_open +mq_receive +mq_send +mq_setattr +mq_timedreceive +mq_timedsend +mq_unlink mqd_t pthread_attr_getaffinity_np pthread_attr_getdetachstate diff --git a/src/new/qurt/mod.rs b/src/new/qurt/mod.rs index d8a2762d742f..9b7ae151a847 100644 --- a/src/new/qurt/mod.rs +++ b/src/new/qurt/mod.rs @@ -308,6 +308,7 @@ pub(crate) mod dlfcn; pub(crate) mod errno; pub(crate) mod fcntl; pub(crate) mod limits; +pub(crate) mod mqueue; pub(crate) mod pthread; pub(crate) mod semaphore; pub(crate) mod signal; @@ -322,6 +323,7 @@ pub use dlfcn::*; pub use errno::*; pub use fcntl::*; pub use limits::*; +pub use mqueue::*; pub use pthread::*; pub use semaphore::*; pub use signal::*; diff --git a/src/new/qurt/mqueue.rs b/src/new/qurt/mqueue.rs new file mode 100644 index 000000000000..88ecef584f67 --- /dev/null +++ b/src/new/qurt/mqueue.rs @@ -0,0 +1,74 @@ +//! Header: `mqueue.h` +//! +//! QuRT POSIX message queue API. Also provides select/pselect and fd_set +//! operations since these are declared in QuRT's mqueue.h. + +use super::*; +use crate::prelude::*; + +// Message queue priority constants +pub const MQ_PRIO_DEFAULT: c_int = 0; + +// Bits per byte +pub const NBBY: c_uint = 8; + +s! { + pub struct mq_attr { + pub mq_flags: c_long, + pub mq_maxmsg: c_long, + pub mq_msgsize: c_long, + pub mq_curmsgs: c_long, + } +} + +extern "C" { + // Message queue operations + pub fn mq_open(name: *const c_char, oflag: c_int, ...) -> mqd_t; + pub fn mq_close(mq_desc: mqd_t) -> c_int; + pub fn mq_unlink(name: *const c_char) -> c_int; + pub fn mq_send( + mqdes: mqd_t, + msg_ptr: *const c_char, + msg_len: size_t, + msg_prio: c_uint, + ) -> c_int; + pub fn mq_timedsend( + mqdes: mqd_t, + msg_ptr: *const c_char, + msg_len: size_t, + msg_prio: c_uint, + abs_timeout: *const timespec, + ) -> c_int; + pub fn mq_receive( + mqdes: mqd_t, + msg_ptr: *mut c_char, + msg_len: size_t, + msg_prio: *mut c_uint, + ) -> ssize_t; + pub fn mq_timedreceive( + mqdes: mqd_t, + msg_ptr: *mut c_char, + msg_len: size_t, + msg_prio: *mut c_uint, + abs_timeout: *const timespec, + ) -> ssize_t; + pub fn mq_getattr(mqdes: mqd_t, mqstat: *mut mq_attr) -> c_int; + pub fn mq_setattr(mqdes: mqd_t, mqstat: *const mq_attr, omqstat: *mut mq_attr) -> c_int; + + // select/pselect (declared in QuRT mqueue.h) + pub fn select( + nfds: c_int, + readfds: *mut fd_set, + writefds: *mut fd_set, + errorfds: *mut fd_set, + timeout: *mut timeval, + ) -> c_int; + pub fn pselect( + nfds: c_int, + readfds: *mut fd_set, + writefds: *mut fd_set, + errorfds: *mut fd_set, + timeout: *const timespec, + sigmask: *const sigset_t, + ) -> c_int; +} From eabae8b74d8bac79d8f5b014b81c8b349d6789a0 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Wed, 29 Apr 2026 21:48:03 -0700 Subject: [PATCH 53/80] qurt: add POSIX timer functions Add timer_create, timer_delete, timer_gettime, and timer_settime from QuRT's time.h POSIX timer API. (backport ) (cherry picked from commit 829759e7490ffd7d00bbe2e1a82ce7f49fd4f7b3) --- libc-test/semver/qurt.txt | 4 ++++ src/new/qurt/time.rs | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/libc-test/semver/qurt.txt b/libc-test/semver/qurt.txt index f0a691e1bb4e..7d8b15a70261 100644 --- a/libc-test/semver/qurt.txt +++ b/libc-test/semver/qurt.txt @@ -455,6 +455,10 @@ sigwait srand strftime strptime +timer_create +timer_delete +timer_gettime +timer_settime timer_t useconds_t va_list diff --git a/src/new/qurt/time.rs b/src/new/qurt/time.rs index ab6f4453dbea..732297ecbd64 100644 --- a/src/new/qurt/time.rs +++ b/src/new/qurt/time.rs @@ -31,4 +31,15 @@ extern "C" { pub fn strptime(s: *const c_char, format: *const c_char, tm: *mut tm) -> *mut c_char; pub fn clock_gettime(clk_id: clockid_t, tp: *mut timespec) -> c_int; pub fn nanosleep(req: *const timespec, rem: *mut timespec) -> c_int; + + // POSIX timer functions (from QuRT time.h) + pub fn timer_create(clockid: clockid_t, evp: *mut sigevent, timerid: *mut timer_t) -> c_int; + pub fn timer_delete(timerid: timer_t) -> c_int; + pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> c_int; + pub fn timer_settime( + timerid: timer_t, + flags: c_int, + value: *const itimerspec, + ovalue: *mut itimerspec, + ) -> c_int; } From 4a05068f1a6df10a78584540f1708e9b3a5af847 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Wed, 29 Apr 2026 21:48:03 -0700 Subject: [PATCH 54/80] qurt: add missing unistd process and file functions Add process/file functions from QuRT's hooks/unistd.h: getppid, getpgid, getpgrp, setsid, get/set uid/gid variants, fsync, pathconf. (backport ) (cherry picked from commit 0030c65140f2cb447bb05c5933d27900d81848c7) --- libc-test/build.rs | 8 ++++++-- libc-test/semver/qurt.txt | 1 + src/new/qurt/unistd.rs | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index e644ad9ba34e..0f811d941d60 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -6019,9 +6019,13 @@ fn test_qurt(target: &str) { | "setenv" | "unsetenv" | "atoi" | "atol" | "atoll" | "strtol" | "strtoul" | "strtoll" | "strtoull" | "strtod" | "strtof" | "rand" | "srand" | "qsort" | "bsearch" | "abs" | "labs" | "llabs" | "div" | "ldiv" | "lldiv" => true, - // Skip unistd functions + // Skip unistd functions: QuRT has no standard unistd.h in its POSIX + // headers; these are declared via sys/types.h -> hooks/unistd.h or the + // toolchain's own sys/unistd.h, neither of which ctest traverses. "access" | "close" | "lseek" | "read" | "write" | "ftruncate" | "unlink" | "getcwd" - | "rmdir" | "getpid" | "sleep" | "sysconf" => true, + | "rmdir" | "getpid" | "getppid" | "getpgid" | "getpgrp" | "getuid" | "geteuid" + | "getgid" | "getegid" | "seteuid" | "setuid" | "setpgid" | "setpgrp" | "setsid" + | "fsync" | "pathconf" | "sleep" | "sysconf" => true, // Skip dlfcn functions "dlopen" | "dlclose" | "dlsym" | "dlerror" => true, // Skip mman functions diff --git a/libc-test/semver/qurt.txt b/libc-test/semver/qurt.txt index 7d8b15a70261..289874aa3e35 100644 --- a/libc-test/semver/qurt.txt +++ b/libc-test/semver/qurt.txt @@ -447,6 +447,7 @@ sem_getvalue sem_init sem_open sem_unlink +setpgrp sigevent siginfo_t sigsuspend diff --git a/src/new/qurt/unistd.rs b/src/new/qurt/unistd.rs index b973b60e6676..654d02a38a9d 100644 --- a/src/new/qurt/unistd.rs +++ b/src/new/qurt/unistd.rs @@ -239,10 +239,26 @@ extern "C" { // Process operations pub fn getpid() -> pid_t; + pub fn getppid() -> pid_t; + pub fn getpgid(pid: pid_t) -> pid_t; + pub fn getpgrp() -> pid_t; + pub fn getuid() -> uid_t; + pub fn geteuid() -> uid_t; + pub fn getgid() -> gid_t; + pub fn getegid() -> gid_t; + pub fn seteuid(uid: uid_t) -> c_int; + pub fn setuid(uid: uid_t) -> c_int; + pub fn setpgid(pid: pid_t, pgid: pid_t) -> c_int; + pub fn setpgrp() -> pid_t; + pub fn setsid() -> pid_t; // Sleep functions pub fn sleep(seconds: c_uint) -> c_uint; + // Sync operations + pub fn fsync(fd: c_int) -> c_int; + // System configuration pub fn sysconf(name: c_int) -> c_long; + pub fn pathconf(path: *const c_char, name: c_int) -> c_long; } From 96cdce0e8ed8594584c37b65b5dfb169e75b37af Mon Sep 17 00:00:00 2001 From: Clayton Slaughter Date: Thu, 2 Apr 2026 14:08:43 -0500 Subject: [PATCH 55/80] linux: add `sockaddr_iucv` This adds the sockaddr_iucv define in netiucv/iucv. It is primarily used on the s390x platform when linux is running under z/VM, but is present on all the linux systems I've been able to test on. [ cleaned up commit message - Trevor ] (backport ) (cherry picked from commit 7a0c4350bf9565e6d1e1e9a5aea4a1c20f7244bc) --- libc-test/build.rs | 1 + src/unix/linux_like/linux/gnu/b64/mod.rs | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index 0f811d941d60..7539c85955d6 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -3929,6 +3929,7 @@ fn test_linux(target: &str) { "netinet/ip.h", "netinet/tcp.h", "netinet/udp.h", + (gnu, "netiucv/iucv.h"), (l4re, "netpacket/packet.h"), "poll.h", "pthread.h", diff --git a/src/unix/linux_like/linux/gnu/b64/mod.rs b/src/unix/linux_like/linux/gnu/b64/mod.rs index 3d442a6d8129..16b7bef085fe 100644 --- a/src/unix/linux_like/linux/gnu/b64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/mod.rs @@ -98,6 +98,17 @@ s! { __glibc_reserved4: Padding, } + // net/iucv/iucv.h + + pub struct sockaddr_iucv { + pub siucv_family: crate::sa_family_t, + __siucv_port: Padding, // unused crate::in_port_t + __siucv_addr: Padding, // unused crate::in_addr_t + pub siucv_nodeid: [c_char; 8], + pub siucv_user_id: [c_char; 8], + pub siucv_name: [c_char; 8], + } + pub struct timex { pub modes: c_uint, #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] From 9ade6a2b5e91f28747e3eff137b150cdea0053b7 Mon Sep 17 00:00:00 2001 From: joboet Date: Mon, 15 Jun 2026 10:17:11 +0200 Subject: [PATCH 56/80] `_lwp_park`: `ts` pointer is mutable (backport ) (cherry picked from commit 986f3147ecb1a1ee107689cd9bc657663d4b6b53) --- src/unix/bsd/netbsdlike/netbsd/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index 21bfc5010428..a0930169442c 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -2234,7 +2234,7 @@ extern "C" { pub fn _lwp_park( clock: crate::clockid_t, flags: c_int, - ts: *const crate::timespec, + ts: *mut crate::timespec, unpark: crate::lwpid_t, hint: *const c_void, unparkhint: *mut c_void, From 7a5b9315741a3673346edcc8fa1b61337dc83800 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Wed, 17 Jun 2026 21:08:30 -0400 Subject: [PATCH 57/80] ci: Switch Linux runners to ubuntu-26.04 (backport ) (cherry picked from commit dfcc80729ca7e3d26f6ce4a951ad3adf764dca26) --- .github/workflows/ci.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 181e4492ae15..75b2bc1508a9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -24,7 +24,7 @@ defaults: jobs: style_check: name: Style check - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 timeout-minutes: 10 steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 @@ -39,7 +39,7 @@ jobs: name: Clippy on ${{ matrix.os }} strategy: matrix: - os: [ubuntu-24.04, macos-26, windows-2025] + os: [ubuntu-26.04, macos-26, windows-2025] runs-on: ${{ matrix.os }} timeout-minutes: 10 steps: @@ -69,7 +69,7 @@ jobs: only: '(aarch64|x86_64)' # just a spot check for beta - toolchain: stable - toolchain: 1.65.0 # msrv - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 timeout-minutes: 25 env: TOOLCHAIN: ${{ matrix.toolchain }} @@ -123,7 +123,7 @@ jobs: - target: aarch64-pc-windows-msvc os: windows-11-arm - target: aarch64-unknown-linux-gnu - os: ubuntu-24.04-arm + os: ubuntu-26.04-arm - target: i686-pc-windows-gnu os: windows-2025 - target: i686-pc-windows-msvc @@ -134,7 +134,7 @@ jobs: - target: x86_64-pc-windows-msvc os: windows-2025 - target: x86_64-unknown-linux-gnu - runs-on: ${{ matrix.os && matrix.os || 'ubuntu-24.04' }} + runs-on: ${{ matrix.os && matrix.os || 'ubuntu-26.04' }} timeout-minutes: 25 env: TARGET: ${{ matrix.target }} @@ -232,7 +232,7 @@ jobs: # FIXME(ppc): SIGILL running tests, see # https://github.com/rust-lang/libc/pull/4254#issuecomment-2636288713 # - target: powerpc-unknown-linux-gnu - runs-on: ${{ matrix.os && matrix.os || 'ubuntu-24.04' }} + runs-on: ${{ matrix.os && matrix.os || 'ubuntu-26.04' }} timeout-minutes: 25 env: TARGET: ${{ matrix.target }} @@ -353,7 +353,7 @@ jobs: docs: name: Ensure docs build - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 timeout-minutes: 10 steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 @@ -368,7 +368,7 @@ jobs: # protection, rather than having to add each job separately. success: name: success - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 needs: - style_check - test_tier1 From eaad34224d8b1ba31682e77a0e0eb35645fe9b34 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Wed, 17 Jun 2026 23:31:05 -0400 Subject: [PATCH 58/80] ci: Log libc version (backport ) (cherry picked from commit ba89637dd6059767be322fa1358403e4e7d2fb1d) --- ci/run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/run.sh b/ci/run.sh index ce6ca11f4439..d7578187b5fc 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -13,8 +13,9 @@ export RUSTFLAGS="${EXTRA_RUSTFLAGS:-} ${RUSTFLAGS:-}" echo "RUSTFLAGS: '$RUSTFLAGS'" -# For logging +# Print system and libc version for logging if available uname -a +dpkg -l | grep libc- || true cmd="cargo test --target $target ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"}" test_flags="--skip check_style" From 442af65a81cf84f88a0d4a381cd9b996c4b5346c Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Wed, 17 Jun 2026 23:35:17 -0400 Subject: [PATCH 59/80] linux: Remove `KERN_REALROOTDEV` and `VM_LAPTOP_MODE` These were removed in kernel version 7.0. They do not appear used in the Rust ecosystem from a quick search [1]; thus, remove them from libc too. Link: https://github.com/search?q=lang%3Arust+%2F%28VM_LAPTOP_MODE%7CKERN_REALROOTDEV%29%28%5B%5E%3A%5D%7C%24%29%2F&type=code [1] Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e6ce36ccc86f6d447808a6e620f56d440d74aa19 Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=64dd89ae01f2708a508e028c28b7906e4702a9a7 (backport ) (cherry picked from commit e34c8b6da178f87bfbb4613fa9b7a8318548eff3) --- src/unix/linux_like/android/mod.rs | 2 -- src/unix/linux_like/linux/mod.rs | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index fae34a285dab..dbfc0f36a097 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -3142,7 +3142,6 @@ pub const KERN_PROF: c_int = 6; pub const KERN_NODENAME: c_int = 7; pub const KERN_DOMAINNAME: c_int = 8; pub const KERN_PANIC: c_int = 15; -pub const KERN_REALROOTDEV: c_int = 16; pub const KERN_SPARC_REBOOT: c_int = 21; pub const KERN_CTLALTDEL: c_int = 22; pub const KERN_PRINTK: c_int = 23; @@ -3212,7 +3211,6 @@ pub const VM_SWAPPINESS: c_int = 19; pub const VM_LOWMEM_RESERVE_RATIO: c_int = 20; pub const VM_MIN_FREE_KBYTES: c_int = 21; pub const VM_MAX_MAP_COUNT: c_int = 22; -pub const VM_LAPTOP_MODE: c_int = 23; pub const VM_BLOCK_DUMP: c_int = 24; pub const VM_HUGETLB_GROUP: c_int = 25; pub const VM_VFS_CACHE_PRESSURE: c_int = 26; diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index aab2ea60dd96..80c1a4272ab5 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -3680,7 +3680,6 @@ pub const KERN_PROF: c_int = 6; pub const KERN_NODENAME: c_int = 7; pub const KERN_DOMAINNAME: c_int = 8; pub const KERN_PANIC: c_int = 15; -pub const KERN_REALROOTDEV: c_int = 16; pub const KERN_SPARC_REBOOT: c_int = 21; pub const KERN_CTLALTDEL: c_int = 22; pub const KERN_PRINTK: c_int = 23; @@ -3752,7 +3751,6 @@ pub const VM_SWAPPINESS: c_int = 19; pub const VM_LOWMEM_RESERVE_RATIO: c_int = 20; pub const VM_MIN_FREE_KBYTES: c_int = 21; pub const VM_MAX_MAP_COUNT: c_int = 22; -pub const VM_LAPTOP_MODE: c_int = 23; pub const VM_BLOCK_DUMP: c_int = 24; pub const VM_HUGETLB_GROUP: c_int = 25; pub const VM_VFS_CACHE_PRESSURE: c_int = 26; From f55a5d63eddc193876be51e12dc61c32225656b3 Mon Sep 17 00:00:00 2001 From: dybucc <149513579+dybucc@users.noreply.github.com> Date: Mon, 1 Jun 2026 12:15:47 +0200 Subject: [PATCH 60/80] refactor: adjust definition of `off_t` in wasi The definition for the analogous `time_t` was using the exact same C type as that declared in the "bottom half" of the WASI upstream C library implementation. On the other hand, the `off_t` type was explicitly declaring the type as a signed 64-bit integer, which is equivalent in the case of WASI to the upstream definition as a `c_longlong`. Still, this patch attempts to reflect a mirrored definition, rather than an equivalent definition. (backport ) (cherry picked from commit 1a9bdc4d16edc21dfa66e655d1edf8e4eac16ba8) --- src/wasi/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wasi/mod.rs b/src/wasi/mod.rs index e580df52ad22..77c6368caef4 100644 --- a/src/wasi/mod.rs +++ b/src/wasi/mod.rs @@ -14,7 +14,7 @@ pub type ssize_t = isize; pub type ptrdiff_t = isize; pub type intptr_t = isize; pub type uintptr_t = usize; -pub type off_t = i64; +pub type off_t = c_longlong; pub type pid_t = i32; pub type clock_t = c_longlong; pub type time_t = c_longlong; From eb94ae1d1c102f9ae682173cca86708b20b389ea Mon Sep 17 00:00:00 2001 From: David Carlier Date: Fri, 15 Aug 2025 06:35:59 +0000 Subject: [PATCH 61/80] procctl for freebsd 15 upgrade. adding missing PROC_SPROTECT helpers while at it. ref: https://github.com/freebsd/freebsd-src/commit/dabf006a638fdc44cdcf69731de8ac83959db731#diff-769c07b1f90eef1351a20f40593b254f85925859273219036320baa1d086774cR68 (backport ) (cherry picked from commit cef4fa4f03fce3c3f6933e1463bfcd4439a20a2c) --- libc-test/build.rs | 11 +++++++++++ libc-test/semver/freebsd.txt | 6 ++++++ src/unix/bsd/freebsdlike/freebsd/mod.rs | 13 +++++++++++++ 3 files changed, 30 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index 7539c85955d6..08eaf91242b2 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2898,6 +2898,17 @@ fn test_freebsd(target: &str) { // Added in FreeBSD 15 "DTYPE_INOTIFY" | "DTYPE_JAILDESC" if Some(15) > freebsd_ver => true, + // Added in FreeBSD 15 + "PROC_LOGSIGEXIT_CTL" + | "PROC_LOGSIGEXIT_STATUS" + | "PROC_LOGSIGEXIT_CTL_NOFORCE" + | "PROC_LOGSIGEXIT_CTL_FORCE_ENABLE" + | "PROC_LOGSIGEXIT_CTL_FORCE_DISABLE" + if Some(15) > freebsd_ver => + { + true + } + _ => false, } }); diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index 79a81624074c..3a06645cfc96 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -1054,6 +1054,12 @@ POSIX_SPAWN_SETSCHEDULER POSIX_SPAWN_SETSIGDEF POSIX_SPAWN_SETSIGMASK PPPDISC +PPROT_CLEAR +PPROT_DESCEND +PPROT_FLAGS +PPROT_INHERIT +PPROT_OP +PPROT_SET PROC_NO_NEW_PRIVS_CTL PROC_NO_NEW_PRIVS_DISABLE PROC_NO_NEW_PRIVS_ENABLE diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index e74baba0c04f..aea89235a52d 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -2608,6 +2608,11 @@ pub const PROC_NO_NEW_PRIVS_CTL: c_int = 19; pub const PROC_NO_NEW_PRIVS_STATUS: c_int = 20; pub const PROC_WXMAP_CTL: c_int = 21; pub const PROC_WXMAP_STATUS: c_int = 22; +pub const PROC_LOGSIGEXIT_CTL: c_int = 23; +pub const PROC_LOGSIGEXIT_STATUS: c_int = 24; +pub const PROC_LOGSIGEXIT_CTL_NOFORCE: c_int = 1; +pub const PROC_LOGSIGEXIT_CTL_FORCE_ENABLE: c_int = 2; +pub const PROC_LOGSIGEXIT_CTL_FORCE_DISABLE: c_int = 3; pub const PROC_PROCCTL_MD_MIN: c_int = 0x10000000; pub const PPROT_SET: c_int = 1; @@ -4419,6 +4424,14 @@ safe_f! { pub const fn PR_SCTP_VALID_POLICY(x: c_int) -> bool { PR_SCTP_POLICY(x) <= SCTP_PR_SCTP_MAX } + + pub const fn PPROT_OP(o: c_int) -> c_int { + o & 0xf + } + + pub const fn PPROT_FLAGS(o: c_int) -> c_int { + o & !0xf + } } cfg_if! { From 91195f0692915306508a686c0e4192ed12ead0d1 Mon Sep 17 00:00:00 2001 From: dybucc <149513579+dybucc@users.noreply.github.com> Date: Mon, 1 Jun 2026 09:30:36 +0200 Subject: [PATCH 62/80] refactor: change type of `time_t` in teeos The type with which it was defined did not reflect the right definition, not by musl standard nor by the actual definitions found in the latest OhOS SDK. Indeed, `c_long` in Linux systems is likely to be defined as a 64-bit integer, but the definition in all of the above, which are mentioned to be used by TEEOS in the rustc target information, define `time_t` specifically as an `_Int64`. Sources are included in the accompanying PR. (backport ) (cherry picked from commit ba27d376f02e9411fa575fb9ca37995682fe7ffc) --- src/teeos/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/teeos/mod.rs b/src/teeos/mod.rs index 89a30a888a5b..7a5c81554b54 100644 --- a/src/teeos/mod.rs +++ b/src/teeos/mod.rs @@ -41,7 +41,7 @@ pub type pthread_spinlock_t = c_int; pub type off_t = i64; -pub type time_t = c_long; +pub type time_t = i64; pub type clock_t = c_long; From 154b06f801ff6a46a36b600eeb4775a8269874b4 Mon Sep 17 00:00:00 2001 From: Yuki Sireneva Date: Wed, 10 Jun 2026 07:17:25 +0000 Subject: [PATCH 63/80] android: Add getpwent/setpwent/endpwent Closes rust-lang/libc#3014 Supersedes rust-lang/libc#3015 (backport ) (cherry picked from commit 2330f64b9fb900f3b9ee8e260d332c6965e9f68e) --- libc-test/build.rs | 3 +++ libc-test/semver/android.txt | 3 +++ src/unix/linux_like/android/mod.rs | 3 +++ 3 files changed, 9 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index 08eaf91242b2..caea2a890565 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2341,6 +2341,9 @@ fn test_android(target: &str) { // Added in API level 26, but some tests use level 24. "endgrent" => true, + // Added in API level 26, but some tests use level 24. + "getpwent" | "setpwent" | "endpwent" => true, + // Added in API level 26, but some tests use level 24. "getdomainname" | "setdomainname" => true, diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt index 04a1c67ee4b9..11848f0c90bd 100644 --- a/libc-test/semver/android.txt +++ b/libc-test/semver/android.txt @@ -3461,6 +3461,7 @@ dup dup2 duplocale endgrent +endpwent endservent epoll_create epoll_create1 @@ -3592,6 +3593,7 @@ getppid getpriority getprotobyname getprotobynumber +getpwent getpwnam getpwnam_r getpwuid @@ -3979,6 +3981,7 @@ setlogmask setns setpgid setpriority +setpwent setregid setresgid setresuid diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index dbfc0f36a097..a94406842461 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -3418,6 +3418,9 @@ safe_f! { } extern "C" { + pub fn setpwent(); + pub fn endpwent(); + pub fn getpwent() -> *mut passwd; pub fn setgrent(); pub fn endgrent(); pub fn getgrent() -> *mut crate::group; From c1b7e6a643ee006da7042573cf918513a477a6b0 Mon Sep 17 00:00:00 2001 From: dybucc <149513579+dybucc@users.noreply.github.com> Date: Wed, 27 May 2026 18:05:02 +0200 Subject: [PATCH 64/80] refactor: annotate `ELAST` constants as unstable this patch annotates symbols that are known to have been the source of semver-breaking issues by using a macro for which another pr has been opened. these issues have been tracked thus far in rust-lang/libc#3131. (backport ) (cherry picked from commit aab67be737c79c6e5bb0c1ad0fe8675fe05845d2) --- src/unix/bsd/apple/mod.rs | 3 +++ src/unix/bsd/freebsdlike/dragonfly/mod.rs | 4 ++++ src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs | 3 +++ src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs | 3 +++ src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs | 3 +++ src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs | 3 +++ src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs | 3 +++ src/unix/bsd/netbsdlike/openbsd/mod.rs | 3 +++ 8 files changed, 25 insertions(+) diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index a8da5e86de7d..9b06c6d62267 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -2332,6 +2332,9 @@ pub const ENOTRECOVERABLE: c_int = 104; pub const EOWNERDEAD: c_int = 105; pub const EQFULL: c_int = 106; pub const ENOTCAPABLE: c_int = 107; + +/// This symbols is prone to change across releases upstream. +/// See the [usage guidelines](crate::#usage-guidelines) for details and use. pub const ELAST: c_int = 107; pub const EAI_AGAIN: c_int = 2; diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index c56db0448008..4aedc2618287 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -548,7 +548,11 @@ pub const ENOMEDIUM: c_int = 93; pub const ENOTRECOVERABLE: c_int = 94; pub const EOWNERDEAD: c_int = 95; pub const EASYNC: c_int = 99; + +/// This symbols is prone to change across releases upstream. +/// See the [usage guidelines](crate::#usage-guidelines) for details and use. pub const ELAST: c_int = 99; + pub const RLIMIT_POSIXLOCKS: c_int = 11; #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] pub const RLIM_NLIMITS: crate::rlim_t = 12; diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs index e04fcc0cd82d..9cbc7a7390f7 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs @@ -258,7 +258,10 @@ s! { } } +/// This symbols is prone to change across releases upstream. +/// See the [usage guidelines](crate::#usage-guidelines) for details and use. pub const ELAST: c_int = 96; + pub const RAND_MAX: c_int = 0x7fff_fffd; pub const KI_NSPARE_PTR: usize = 6; pub const MINCORE_SUPER: c_int = 0x20; diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs index 34979f8884d7..19fa5984cd88 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs @@ -304,6 +304,9 @@ s! { } pub const RAND_MAX: c_int = 0x7fff_fffd; + +/// This symbols is prone to change across releases upstream. +/// See the [usage guidelines](crate::#usage-guidelines) for details and use. pub const ELAST: c_int = 97; /// max length of devicename diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs index 6ef62be3c0a2..73b798d97d7f 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs @@ -317,6 +317,9 @@ s! { } pub const RAND_MAX: c_int = 0x7fff_ffff; + +/// This symbols is prone to change across releases upstream. +/// See the [usage guidelines](crate::#usage-guidelines) for details and use. pub const ELAST: c_int = 97; pub const KF_TYPE_EVENTFD: c_int = 13; diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs index f2753cebcec9..e2c72828d98b 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs @@ -319,6 +319,9 @@ s! { } pub const RAND_MAX: c_int = 0x7fff_ffff; + +/// This symbols is prone to change across releases upstream. +/// See the [usage guidelines](crate::#usage-guidelines) for details and use. pub const ELAST: c_int = 97; pub const KF_TYPE_EVENTFD: c_int = 13; diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs index d9d93687850c..7f05c8144a91 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs @@ -321,6 +321,9 @@ s! { } pub const RAND_MAX: c_int = 0x7fff_ffff; + +/// This symbols is prone to change across releases upstream. +/// See the [usage guidelines](crate::#usage-guidelines) for details and use. pub const ELAST: c_int = 97; pub const KF_TYPE_EVENTFD: c_int = 13; diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index 216d17bd7783..1d3fd62b76b1 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -945,6 +945,9 @@ pub const EBADMSG: c_int = 92; pub const ENOTRECOVERABLE: c_int = 93; pub const EOWNERDEAD: c_int = 94; pub const EPROTO: c_int = 95; + +/// This symbols is prone to change across releases upstream. +/// See the [usage guidelines](crate::#usage-guidelines) for details and use. pub const ELAST: c_int = 95; pub const F_DUPFD_CLOEXEC: c_int = 10; From 44f267d683eb1700aceafa6a4deacd1caa89c76c Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 6 Jun 2026 21:55:13 +0100 Subject: [PATCH 65/80] adding OPEN_TREE_NAMESPACE and fsopen/fsconfig/fsmount/fspick constants for Linux (7.0) rust-lang/libc#5072 [ref](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/mount.h?h=v7.0) (backport ) (cherry picked from commit 204104b3e960cdf2490bb521e1d0f52267fe847d) --- libc-test/build.rs | 13 +++++++++++++ libc-test/semver/linux.txt | 17 +++++++++++++++++ src/unix/linux_like/linux/mod.rs | 24 ++++++++++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index caea2a890565..b8a4ada27ba2 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -4350,6 +4350,14 @@ fn test_linux(target: &str) { cfg.skip_const(move |constant| { let name = constant.ident(); + // FIXME(linux): Requires newer kernel headers than CI has. These uapi/linux/mount.h + // constants (OPEN_TREE_NAMESPACE landed in v7.0, FSCONFIG_CMD_CREATE_EXCL in v6.6) + // aren't defined by the headers CI builds against on several targets (notably the + // tier2 cross sysroots), so skip on every libc until CI catches up. + if name == "OPEN_TREE_NAMESPACE" || name == "FSCONFIG_CMD_CREATE_EXCL" { + return true; + } + // L4Re requires a min stack size of 64k; that isn't defined in uClibc, but // somewhere in the core libraries. uClibc wants 16k, but that's not enough. if l4re && name == "PTHREAD_STACK_MIN" { @@ -4372,6 +4380,10 @@ fn test_linux(target: &str) { || name.starts_with("EPOLL") || name.starts_with("F_") || name.starts_with("FALLOC_FL_") + || name.starts_with("FSCONFIG_") + || name.starts_with("FSMOUNT_") + || name.starts_with("FSOPEN_") + || name.starts_with("FSPICK_") || name.starts_with("FUTEX2_") || name.starts_with("IFLA_") || name.starts_with("KEXEC_") @@ -4720,6 +4732,7 @@ fn test_linux(target: &str) { let c_enums = [ "can_state", + "fsconfig_command", "membarrier_cmd", "pid_type", "proc_cn_event", diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index 163cb838af46..40fffa77360a 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -898,6 +898,21 @@ FIONCLEX FIONREAD FLUSHO FOPEN_MAX +FSCONFIG_CMD_CREATE +FSCONFIG_CMD_CREATE_EXCL +FSCONFIG_CMD_RECONFIGURE +FSCONFIG_SET_BINARY +FSCONFIG_SET_FD +FSCONFIG_SET_FLAG +FSCONFIG_SET_PATH +FSCONFIG_SET_PATH_EMPTY +FSCONFIG_SET_STRING +FSMOUNT_CLOEXEC +FSOPEN_CLOEXEC +FSPICK_CLOEXEC +FSPICK_EMPTY_PATH +FSPICK_NO_AUTOMOUNT +FSPICK_SYMLINK_NOFOLLOW FS_IOC32_GETFLAGS FS_IOC32_GETVERSION FS_IOC32_SETFLAGS @@ -2202,6 +2217,7 @@ OFILL OLCUC OPEN_TREE_CLOEXEC OPEN_TREE_CLONE +OPEN_TREE_NAMESPACE O_ASYNC O_DIRECT O_DSYNC @@ -4107,6 +4123,7 @@ freeifaddrs freelocale fremovexattr freopen64 +fsconfig_command fseeko64 fsetpos64 fsetxattr diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 80c1a4272ab5..e29e123ee8a1 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -3143,8 +3143,32 @@ pub const IN_NONBLOCK: c_int = O_NONBLOCK; // uapi/linux/mount.h pub const OPEN_TREE_CLONE: c_uint = 0x01; +pub const OPEN_TREE_NAMESPACE: c_uint = 0x02; pub const OPEN_TREE_CLOEXEC: c_uint = O_CLOEXEC as c_uint; +pub const FSOPEN_CLOEXEC: c_uint = 0x00000001; + +pub const FSPICK_CLOEXEC: c_uint = 0x00000001; +pub const FSPICK_SYMLINK_NOFOLLOW: c_uint = 0x00000002; +pub const FSPICK_NO_AUTOMOUNT: c_uint = 0x00000004; +pub const FSPICK_EMPTY_PATH: c_uint = 0x00000008; + +pub const FSMOUNT_CLOEXEC: c_uint = 0x00000001; + +c_enum! { + pub enum fsconfig_command { + pub FSCONFIG_SET_FLAG, + pub FSCONFIG_SET_STRING, + pub FSCONFIG_SET_BINARY, + pub FSCONFIG_SET_PATH, + pub FSCONFIG_SET_PATH_EMPTY, + pub FSCONFIG_SET_FD, + pub FSCONFIG_CMD_CREATE, + pub FSCONFIG_CMD_RECONFIGURE, + pub FSCONFIG_CMD_CREATE_EXCL, + } +} + // uapi/linux/netfilter/nf_tables.h pub const NFT_TABLE_MAXNAMELEN: c_int = 256; pub const NFT_CHAIN_MAXNAMELEN: c_int = 256; From d29bf13ef7ab14dcbe11118335761af11124b537 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 19 Jun 2026 05:49:25 -0400 Subject: [PATCH 66/80] linux: Move `mount.h` API to `src/new` This has the effect of making `MOVE_MOUNT_*` constants available on all Linux platforms, not just glibc. Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/mount.h?h=028ef9c96e96197026887c0f092424679298aae8 (backport ) (cherry picked from commit 2ba56c899a363d8d31f125fc65412bd566f9ecb0) --- src/new/linux_uapi/linux/mod.rs | 1 + src/new/linux_uapi/linux/mount.rs | 68 +++++++++++++++++++++++++ src/new/mod.rs | 1 + src/unix/linux_like/linux/gnu/mod.rs | 12 ----- src/unix/linux_like/linux/mod.rs | 52 ------------------- src/unix/linux_like/linux/musl/mod.rs | 2 - src/unix/linux_like/linux/uclibc/mod.rs | 4 -- src/unix/linux_like/mod.rs | 1 + 8 files changed, 71 insertions(+), 70 deletions(-) create mode 100644 src/new/linux_uapi/linux/mount.rs diff --git a/src/new/linux_uapi/linux/mod.rs b/src/new/linux_uapi/linux/mod.rs index 09e2c3ece741..09387e3eea88 100644 --- a/src/new/linux_uapi/linux/mod.rs +++ b/src/new/linux_uapi/linux/mod.rs @@ -5,5 +5,6 @@ pub(crate) mod can; pub(crate) mod keyctl; pub(crate) mod membarrier; +pub(crate) mod mount; pub(crate) mod netlink; pub(crate) mod pidfd; diff --git a/src/new/linux_uapi/linux/mount.rs b/src/new/linux_uapi/linux/mount.rs new file mode 100644 index 000000000000..bf736acb4ca5 --- /dev/null +++ b/src/new/linux_uapi/linux/mount.rs @@ -0,0 +1,68 @@ +//! Header: `uapi/linux/mount.h` + +use crate::prelude::*; + +pub const MS_RMT_MASK: c_ulong = crate::MS_RDONLY + | crate::MS_SYNCHRONOUS + | crate::MS_MANDLOCK + | crate::MS_I_VERSION + | crate::MS_LAZYTIME; + +pub const OPEN_TREE_CLONE: c_uint = 0x01; +pub const OPEN_TREE_NAMESPACE: c_uint = 0x02; +pub const OPEN_TREE_CLOEXEC: c_uint = crate::O_CLOEXEC as c_uint; + +pub const MOVE_MOUNT_F_SYMLINKS: c_uint = 0x00000001; +pub const MOVE_MOUNT_F_AUTOMOUNTS: c_uint = 0x00000002; +pub const MOVE_MOUNT_F_EMPTY_PATH: c_uint = 0x00000004; +pub const MOVE_MOUNT_T_SYMLINKS: c_uint = 0x00000010; +pub const MOVE_MOUNT_T_AUTOMOUNTS: c_uint = 0x00000020; +pub const MOVE_MOUNT_T_EMPTY_PATH: c_uint = 0x00000040; +pub const MOVE_MOUNT_SET_GROUP: c_uint = 0x00000100; +pub const MOVE_MOUNT_BENEATH: c_uint = 0x00000200; + +pub const FSOPEN_CLOEXEC: c_uint = 0x00000001; + +pub const FSPICK_CLOEXEC: c_uint = 0x00000001; +pub const FSPICK_SYMLINK_NOFOLLOW: c_uint = 0x00000002; +pub const FSPICK_NO_AUTOMOUNT: c_uint = 0x00000004; +pub const FSPICK_EMPTY_PATH: c_uint = 0x00000008; + +c_enum! { + pub enum fsconfig_command { + pub FSCONFIG_SET_FLAG, + pub FSCONFIG_SET_STRING, + pub FSCONFIG_SET_BINARY, + pub FSCONFIG_SET_PATH, + pub FSCONFIG_SET_PATH_EMPTY, + pub FSCONFIG_SET_FD, + pub FSCONFIG_CMD_CREATE, + pub FSCONFIG_CMD_RECONFIGURE, + pub FSCONFIG_CMD_CREATE_EXCL, + } +} + +pub const FSMOUNT_CLOEXEC: c_uint = 0x00000001; + +pub const MOUNT_ATTR_RDONLY: u64 = 0x00000001; +pub const MOUNT_ATTR_NOSUID: u64 = 0x00000002; +pub const MOUNT_ATTR_NODEV: u64 = 0x00000004; +pub const MOUNT_ATTR_NOEXEC: u64 = 0x00000008; +pub const MOUNT_ATTR__ATIME: u64 = 0x00000070; +pub const MOUNT_ATTR_RELATIME: u64 = 0x00000000; +pub const MOUNT_ATTR_NOATIME: u64 = 0x00000010; +pub const MOUNT_ATTR_STRICTATIME: u64 = 0x00000020; +pub const MOUNT_ATTR_NODIRATIME: u64 = 0x00000080; +pub const MOUNT_ATTR_IDMAP: u64 = 0x00100000; +pub const MOUNT_ATTR_NOSYMFOLLOW: u64 = 0x00200000; + +s! { + pub struct mount_attr { + pub attr_set: crate::__u64, + pub attr_clr: crate::__u64, + pub propagation: crate::__u64, + pub userns_fd: crate::__u64, + } +} + +pub const MOUNT_ATTR_SIZE_VER0: c_int = 32; diff --git a/src/new/mod.rs b/src/new/mod.rs index e45dea7b9dae..3bbc632f5882 100644 --- a/src/new/mod.rs +++ b/src/new/mod.rs @@ -182,6 +182,7 @@ cfg_if! { pub use linux::can::raw::*; pub use linux::keyctl::*; pub use linux::membarrier::*; + pub use linux::mount::*; pub use linux::netlink::*; pub use linux::pidfd::*; #[cfg(target_env = "gnu")] diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs index 65e94a19a517..494ad6c7ee68 100644 --- a/src/unix/linux_like/linux/gnu/mod.rs +++ b/src/unix/linux_like/linux/gnu/mod.rs @@ -545,8 +545,6 @@ pub const PRIO_PROCESS: crate::__priority_which_t = 0; pub const PRIO_PGRP: crate::__priority_which_t = 1; pub const PRIO_USER: crate::__priority_which_t = 2; -pub const MS_RMT_MASK: c_ulong = 0x02800051; - pub const __UT_LINESIZE: usize = 32; pub const __UT_NAMESIZE: usize = 32; pub const __UT_HOSTSIZE: usize = 256; @@ -832,16 +830,6 @@ pub const M_ARENA_MAX: c_int = -8; pub const SOMAXCONN: c_int = 4096; -// linux/mount.h -pub const MOVE_MOUNT_F_SYMLINKS: c_uint = 0x00000001; -pub const MOVE_MOUNT_F_AUTOMOUNTS: c_uint = 0x00000002; -pub const MOVE_MOUNT_F_EMPTY_PATH: c_uint = 0x00000004; -pub const MOVE_MOUNT_T_SYMLINKS: c_uint = 0x00000010; -pub const MOVE_MOUNT_T_AUTOMOUNTS: c_uint = 0x00000020; -pub const MOVE_MOUNT_T_EMPTY_PATH: c_uint = 0x00000040; -pub const MOVE_MOUNT_SET_GROUP: c_uint = 0x00000100; -pub const MOVE_MOUNT_BENEATH: c_uint = 0x00000200; - // sys/timex.h pub const ADJ_OFFSET: c_uint = 0x0001; pub const ADJ_FREQUENCY: c_uint = 0x0002; diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index e29e123ee8a1..53af329167df 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -994,15 +994,6 @@ s! { pub csum_offset: __u16, } - // linux/mount.h - - pub struct mount_attr { - pub attr_set: crate::__u64, - pub attr_clr: crate::__u64, - pub propagation: crate::__u64, - pub userns_fd: crate::__u64, - } - // linux/nsfs.h pub struct mnt_ns_info { pub size: crate::__u32, @@ -3141,34 +3132,6 @@ pub const IN_ALL_EVENTS: u32 = IN_ACCESS pub const IN_CLOEXEC: c_int = O_CLOEXEC; pub const IN_NONBLOCK: c_int = O_NONBLOCK; -// uapi/linux/mount.h -pub const OPEN_TREE_CLONE: c_uint = 0x01; -pub const OPEN_TREE_NAMESPACE: c_uint = 0x02; -pub const OPEN_TREE_CLOEXEC: c_uint = O_CLOEXEC as c_uint; - -pub const FSOPEN_CLOEXEC: c_uint = 0x00000001; - -pub const FSPICK_CLOEXEC: c_uint = 0x00000001; -pub const FSPICK_SYMLINK_NOFOLLOW: c_uint = 0x00000002; -pub const FSPICK_NO_AUTOMOUNT: c_uint = 0x00000004; -pub const FSPICK_EMPTY_PATH: c_uint = 0x00000008; - -pub const FSMOUNT_CLOEXEC: c_uint = 0x00000001; - -c_enum! { - pub enum fsconfig_command { - pub FSCONFIG_SET_FLAG, - pub FSCONFIG_SET_STRING, - pub FSCONFIG_SET_BINARY, - pub FSCONFIG_SET_PATH, - pub FSCONFIG_SET_PATH_EMPTY, - pub FSCONFIG_SET_FD, - pub FSCONFIG_CMD_CREATE, - pub FSCONFIG_CMD_RECONFIGURE, - pub FSCONFIG_CMD_CREATE_EXCL, - } -} - // uapi/linux/netfilter/nf_tables.h pub const NFT_TABLE_MAXNAMELEN: c_int = 256; pub const NFT_CHAIN_MAXNAMELEN: c_int = 256; @@ -3934,21 +3897,6 @@ pub const XDP_TX_METADATA: crate::__u32 = 1 << 1; pub const SOL_XDP: c_int = 283; -// linux/mount.h -pub const MOUNT_ATTR_RDONLY: crate::__u64 = 0x00000001; -pub const MOUNT_ATTR_NOSUID: crate::__u64 = 0x00000002; -pub const MOUNT_ATTR_NODEV: crate::__u64 = 0x00000004; -pub const MOUNT_ATTR_NOEXEC: crate::__u64 = 0x00000008; -pub const MOUNT_ATTR__ATIME: crate::__u64 = 0x00000070; -pub const MOUNT_ATTR_RELATIME: crate::__u64 = 0x00000000; -pub const MOUNT_ATTR_NOATIME: crate::__u64 = 0x00000010; -pub const MOUNT_ATTR_STRICTATIME: crate::__u64 = 0x00000020; -pub const MOUNT_ATTR_NODIRATIME: crate::__u64 = 0x00000080; -pub const MOUNT_ATTR_IDMAP: crate::__u64 = 0x00100000; -pub const MOUNT_ATTR_NOSYMFOLLOW: crate::__u64 = 0x00200000; - -pub const MOUNT_ATTR_SIZE_VER0: c_int = 32; - pub const SCHED_FLAG_KEEP_ALL: c_int = SCHED_FLAG_KEEP_POLICY | SCHED_FLAG_KEEP_PARAMS; pub const SCHED_FLAG_UTIL_CLAMP: c_int = SCHED_FLAG_UTIL_CLAMP_MIN | SCHED_FLAG_UTIL_CLAMP_MAX; diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs index 6c9f948aa3ba..2677462436d4 100644 --- a/src/unix/linux_like/linux/musl/mod.rs +++ b/src/unix/linux_like/linux/musl/mod.rs @@ -507,8 +507,6 @@ pub const MAP_HUGE_1GB: c_int = 30 << MAP_HUGE_SHIFT; pub const MAP_HUGE_2GB: c_int = 31 << MAP_HUGE_SHIFT; pub const MAP_HUGE_16GB: c_int = 34 << MAP_HUGE_SHIFT; -pub const MS_RMT_MASK: c_ulong = 0x02800051; - // include/utmpx.h pub const EMPTY: c_short = 0; pub const RUN_LVL: c_short = 1; diff --git a/src/unix/linux_like/linux/uclibc/mod.rs b/src/unix/linux_like/linux/uclibc/mod.rs index 7da0779d4dd7..bdf80596d210 100644 --- a/src/unix/linux_like/linux/uclibc/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mod.rs @@ -288,10 +288,6 @@ pub const LC_MESSAGES: c_int = 5; pub const LC_ALL: c_int = 6; // end different section -// MS_ flags for mount(2) -pub const MS_RMT_MASK: c_ulong = - crate::MS_RDONLY | crate::MS_SYNCHRONOUS | crate::MS_MANDLOCK | crate::MS_I_VERSION; - pub const ENOTSUP: c_int = EOPNOTSUPP; pub const IPV6_JOIN_GROUP: c_int = 20; diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index a1ea493f0abc..8e73caac0d6b 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -553,6 +553,7 @@ pub const MS_NODIRATIME: c_ulong = 0x0800; pub const MS_BIND: c_ulong = 0x1000; pub const MS_MOVE: c_ulong = 0x2000; pub const MS_REC: c_ulong = 0x4000; +// MS_VERBOSE is deprecated pub const MS_SILENT: c_ulong = 0x8000; pub const MS_POSIXACL: c_ulong = 0x010000; pub const MS_UNBINDABLE: c_ulong = 0x020000; From aa04be761804df459b990cf4d636f3423de71226 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 19 Jun 2026 06:16:44 -0400 Subject: [PATCH 67/80] linux: Move `if_packet.h` API to `src/new` Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/if_packet.h?h=028ef9c96e96197026887c0f092424679298aae8 Link: https://github.com/kernkonzept/l4re-core/blob/6d4b236ae59f69008a91176063851a8429bff22b/libc/uclibc-ng/contrib/uclibc/include/netpacket/packet.h#L35 (backport ) (cherry picked from commit 68504c79c97deeb16db5ebab2b441d1bd962cb93) --- src/new/l4re/mod.rs | 2 + src/new/l4re/packet.rs | 29 +++ src/new/linux_uapi/linux/if_packet.rs | 257 +++++++++++++++++++++++ src/new/linux_uapi/linux/mod.rs | 1 + src/new/mod.rs | 3 + src/unix/linux_like/linux/mod.rs | 202 ------------------ src/unix/linux_like/linux_l4re_shared.rs | 44 ---- 7 files changed, 292 insertions(+), 246 deletions(-) create mode 100644 src/new/l4re/packet.rs create mode 100644 src/new/linux_uapi/linux/if_packet.rs diff --git a/src/new/l4re/mod.rs b/src/new/l4re/mod.rs index cbf725f406b6..1c5c8855e7f4 100644 --- a/src/new/l4re/mod.rs +++ b/src/new/l4re/mod.rs @@ -1,3 +1,5 @@ //! L4re. //! //! * Headers: + +pub(crate) mod packet; diff --git a/src/new/l4re/packet.rs b/src/new/l4re/packet.rs new file mode 100644 index 000000000000..f9df7997ffa1 --- /dev/null +++ b/src/new/l4re/packet.rs @@ -0,0 +1,29 @@ +//! Header: `netpacket/packet.h` + +use crate::prelude::*; + +pub const PACKET_HOST: c_uchar = 0; +pub const PACKET_BROADCAST: c_uchar = 1; +pub const PACKET_MULTICAST: c_uchar = 2; +pub const PACKET_OTHERHOST: c_uchar = 3; +pub const PACKET_OUTGOING: c_uchar = 4; +pub const PACKET_LOOPBACK: c_uchar = 5; + +pub const PACKET_ADD_MEMBERSHIP: c_int = 1; +pub const PACKET_DROP_MEMBERSHIP: c_int = 2; +pub const PACKET_RECV_OUTPUT: c_int = 3; +pub const PACKET_RX_RING: c_int = 5; +pub const PACKET_STATISTICS: c_int = 6; + +s! { + pub struct packet_mreq { + pub mr_ifindex: c_int, + pub mr_type: c_ushort, + pub mr_alen: c_ushort, + pub mr_address: [c_uchar; 8], + } +} + +pub const PACKET_MR_MULTICAST: c_int = 0; +pub const PACKET_MR_PROMISC: c_int = 1; +pub const PACKET_MR_ALLMULTI: c_int = 2; diff --git a/src/new/linux_uapi/linux/if_packet.rs b/src/new/linux_uapi/linux/if_packet.rs new file mode 100644 index 000000000000..9c8b8dcfbe65 --- /dev/null +++ b/src/new/linux_uapi/linux/if_packet.rs @@ -0,0 +1,257 @@ +//! Header: `uapi/linux/if_packet.h` + +use crate::prelude::*; + +s! { + #[deprecated(since = "0.2.70", note = "sockaddr_ll type should be used instead")] + pub struct sockaddr_pkt { + pub spkt_family: c_ushort, + pub spkt_device: [c_uchar; 14], + pub spkt_protocol: c_ushort, + } +} + +pub const PACKET_HOST: c_uchar = 0; +pub const PACKET_BROADCAST: c_uchar = 1; +pub const PACKET_MULTICAST: c_uchar = 2; +pub const PACKET_OTHERHOST: c_uchar = 3; +pub const PACKET_OUTGOING: c_uchar = 4; +pub const PACKET_LOOPBACK: c_uchar = 5; +pub const PACKET_USER: c_uchar = 6; +pub const PACKET_KERNEL: c_uchar = 7; + +pub const PACKET_ADD_MEMBERSHIP: c_int = 1; +pub const PACKET_DROP_MEMBERSHIP: c_int = 2; +pub const PACKET_RECV_OUTPUT: c_int = 3; +pub const PACKET_RX_RING: c_int = 5; +pub const PACKET_STATISTICS: c_int = 6; +pub const PACKET_COPY_THRESH: c_int = 7; +pub const PACKET_AUXDATA: c_int = 8; +pub const PACKET_ORIGDEV: c_int = 9; +pub const PACKET_VERSION: c_int = 10; +pub const PACKET_HDRLEN: c_int = 11; +pub const PACKET_RESERVE: c_int = 12; +pub const PACKET_TX_RING: c_int = 13; +pub const PACKET_LOSS: c_int = 14; +pub const PACKET_VNET_HDR: c_int = 15; +pub const PACKET_TX_TIMESTAMP: c_int = 16; +pub const PACKET_TIMESTAMP: c_int = 17; +pub const PACKET_FANOUT: c_int = 18; +pub const PACKET_TX_HAS_OFF: c_int = 19; +pub const PACKET_QDISC_BYPASS: c_int = 20; +pub const PACKET_ROLLOVER_STATS: c_int = 21; +pub const PACKET_FANOUT_DATA: c_int = 22; +pub const PACKET_IGNORE_OUTGOING: c_int = 23; +pub const PACKET_VNET_HDR_SZ: c_int = 24; + +pub const PACKET_FANOUT_HASH: c_uint = 0; +pub const PACKET_FANOUT_LB: c_uint = 1; +pub const PACKET_FANOUT_CPU: c_uint = 2; +pub const PACKET_FANOUT_ROLLOVER: c_uint = 3; +pub const PACKET_FANOUT_RND: c_uint = 4; +pub const PACKET_FANOUT_QM: c_uint = 5; +pub const PACKET_FANOUT_CBPF: c_uint = 6; +pub const PACKET_FANOUT_EBPF: c_uint = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: c_uint = 0x1000; +pub const PACKET_FANOUT_FLAG_UNIQUEID: c_uint = 0x2000; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: c_uint = 0x4000; +pub const PACKET_FANOUT_FLAG_DEFRAG: c_uint = 0x8000; + +s! { + pub struct tpacket_stats { + pub tp_packets: c_uint, + pub tp_drops: c_uint, + } + + pub struct tpacket_stats_v3 { + pub tp_packets: c_uint, + pub tp_drops: c_uint, + pub tp_freeze_q_cnt: c_uint, + } + + #[repr(align(8))] + pub struct tpacket_rollover_stats { + pub tp_all: crate::__u64, + pub tp_huge: crate::__u64, + pub tp_failed: crate::__u64, + } + + pub struct tpacket_auxdata { + pub tp_status: u32, + pub tp_len: u32, + pub tp_snaplen: u32, + pub tp_mac: u16, + pub tp_net: u16, + pub tp_vlan_tci: u16, + pub tp_vlan_tpid: u16, + } +} + +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1 << 0; +pub const TP_STATUS_COPY: u32 = 1 << 1; +pub const TP_STATUS_LOSING: u32 = 1 << 2; +pub const TP_STATUS_CSUMNOTREADY: u32 = 1 << 3; +pub const TP_STATUS_VLAN_VALID: u32 = 1 << 4; +pub const TP_STATUS_BLK_TMO: u32 = 1 << 5; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 1 << 6; +pub const TP_STATUS_CSUM_VALID: u32 = 1 << 7; + +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1 << 0; +pub const TP_STATUS_SENDING: u32 = 1 << 1; +pub const TP_STATUS_WRONG_FORMAT: u32 = 1 << 2; + +pub const TP_STATUS_TS_SOFTWARE: u32 = 1 << 29; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1 << 30; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 1 << 31; + +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; + +s! { + pub struct tpacket_hdr { + pub tp_status: c_ulong, + pub tp_len: c_uint, + pub tp_snaplen: c_uint, + pub tp_mac: c_ushort, + pub tp_net: c_ushort, + pub tp_sec: c_uint, + pub tp_usec: c_uint, + } +} + +pub const TPACKET_ALIGNMENT: usize = 16; +f! { + pub fn TPACKET_ALIGN(x: usize) -> usize { + (x + TPACKET_ALIGNMENT - 1) & !(TPACKET_ALIGNMENT - 1) + } +} +pub const TPACKET_HDRLEN: usize = ((size_of::() + TPACKET_ALIGNMENT - 1) + & !(TPACKET_ALIGNMENT - 1)) + + size_of::(); + +s! { + pub struct tpacket2_hdr { + pub tp_status: u32, + pub tp_len: u32, + pub tp_snaplen: u32, + pub tp_mac: u16, + pub tp_net: u16, + pub tp_sec: u32, + pub tp_nsec: u32, + pub tp_vlan_tci: u16, + pub tp_vlan_tpid: u16, + pub tp_padding: [u8; 4], + } + + pub struct tpacket_hdr_variant1 { + pub tp_rxhash: u32, + pub tp_vlan_tci: u32, + pub tp_vlan_tpid: u16, + pub tp_padding: u16, + } + + pub struct tpacket3_hdr { + pub tp_next_offset: u32, + pub tp_sec: u32, + pub tp_nsec: u32, + pub tp_snaplen: u32, + pub tp_len: u32, + pub tp_status: u32, + pub tp_mac: u16, + pub tp_net: u16, + pub hv1: tpacket_hdr_variant1, + pub tp_padding: [u8; 8], + } + + pub struct tpacket_bd_ts { + pub ts_sec: c_uint, + pub ts_usec: c_uint, + } + + #[repr(align(8))] + pub struct tpacket_hdr_v1 { + pub block_status: u32, + pub num_pkts: u32, + pub offset_to_first_pkt: u32, + pub blk_len: u32, + pub seq_num: crate::__u64, + pub ts_first_pkt: tpacket_bd_ts, + pub ts_last_pkt: tpacket_bd_ts, + } +} + +s_no_extra_traits! { + pub union tpacket_bd_header_u { + pub bh1: tpacket_hdr_v1, + } + + pub struct tpacket_block_desc { + pub version: u32, + pub offset_to_priv: u32, + pub hdr: tpacket_bd_header_u, + } +} + +pub const TPACKET2_HDRLEN: usize = ((size_of::() + TPACKET_ALIGNMENT - 1) + & !(TPACKET_ALIGNMENT - 1)) + + size_of::(); +pub const TPACKET3_HDRLEN: usize = ((size_of::() + TPACKET_ALIGNMENT - 1) + & !(TPACKET_ALIGNMENT - 1)) + + size_of::(); + +c_enum! { + pub enum tpacket_versions { + pub TPACKET_V1, + pub TPACKET_V2, + pub TPACKET_V3, + } +} + +s! { + pub struct tpacket_req { + pub tp_block_size: c_uint, + pub tp_block_nr: c_uint, + pub tp_frame_size: c_uint, + pub tp_frame_nr: c_uint, + } + + pub struct tpacket_req3 { + pub tp_block_size: c_uint, + pub tp_block_nr: c_uint, + pub tp_frame_size: c_uint, + pub tp_frame_nr: c_uint, + pub tp_retire_blk_tov: c_uint, + pub tp_sizeof_priv: c_uint, + pub tp_feature_req_word: c_uint, + } +} + +s_no_extra_traits! { + pub union tpacket_req_u { + pub req: tpacket_req, + pub req3: tpacket_req3, + } +} + +s! { + pub struct packet_mreq { + pub mr_ifindex: c_int, + pub mr_type: c_ushort, + pub mr_alen: c_ushort, + pub mr_address: [c_uchar; 8], + } + + pub struct fanout_args { + #[cfg(target_endian = "little")] + pub id: u16, + pub type_flags: u16, + #[cfg(target_endian = "big")] + pub id: u16, + pub max_num_members: u32, + } +} + +pub const PACKET_MR_MULTICAST: c_int = 0; +pub const PACKET_MR_PROMISC: c_int = 1; +pub const PACKET_MR_ALLMULTI: c_int = 2; diff --git a/src/new/linux_uapi/linux/mod.rs b/src/new/linux_uapi/linux/mod.rs index 09387e3eea88..d11d7d1c4a64 100644 --- a/src/new/linux_uapi/linux/mod.rs +++ b/src/new/linux_uapi/linux/mod.rs @@ -3,6 +3,7 @@ //! pub(crate) mod can; +pub(crate) mod if_packet; pub(crate) mod keyctl; pub(crate) mod membarrier; pub(crate) mod mount; diff --git a/src/new/mod.rs b/src/new/mod.rs index 3bbc632f5882..1eab46d4b887 100644 --- a/src/new/mod.rs +++ b/src/new/mod.rs @@ -180,6 +180,7 @@ cfg_if! { pub use linux::can::j1939::*; pub use linux::can::netlink::*; pub use linux::can::raw::*; + pub use linux::if_packet::*; pub use linux::keyctl::*; pub use linux::membarrier::*; pub use linux::mount::*; @@ -193,6 +194,8 @@ cfg_if! { pub use pthread_::spawn::*; pub use pthread_::stack_np::*; pub use signal::*; + } else if #[cfg(target_os = "l4re")] { + pub use l4re::packet::*; } else if #[cfg(target_os = "netbsd")] { pub use net::if_::*; pub use sys::file::*; diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 53af329167df..b706fb356efa 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -37,15 +37,6 @@ pub type sctp_assoc_t = __s32; pub type eventfd_t = u64; -e! { - #[repr(u32)] - pub enum tpacket_versions { - TPACKET_V1, - TPACKET_V2, - TPACKET_V3, - } -} - c_enum! { pub enum pid_type { pub PIDTYPE_PID, @@ -94,126 +85,6 @@ s! { _pad: Padding<[u8; 28]>, } - pub struct fanout_args { - #[cfg(target_endian = "little")] - pub id: __u16, - pub type_flags: __u16, - #[cfg(target_endian = "big")] - pub id: __u16, - pub max_num_members: __u32, - } - - #[deprecated(since = "0.2.70", note = "sockaddr_ll type must be used instead")] - pub struct sockaddr_pkt { - pub spkt_family: c_ushort, - pub spkt_device: [c_uchar; 14], - pub spkt_protocol: c_ushort, - } - - pub struct tpacket_auxdata { - pub tp_status: __u32, - pub tp_len: __u32, - pub tp_snaplen: __u32, - pub tp_mac: __u16, - pub tp_net: __u16, - pub tp_vlan_tci: __u16, - pub tp_vlan_tpid: __u16, - } - - pub struct tpacket_hdr { - pub tp_status: c_ulong, - pub tp_len: c_uint, - pub tp_snaplen: c_uint, - pub tp_mac: c_ushort, - pub tp_net: c_ushort, - pub tp_sec: c_uint, - pub tp_usec: c_uint, - } - - pub struct tpacket_hdr_variant1 { - pub tp_rxhash: __u32, - pub tp_vlan_tci: __u32, - pub tp_vlan_tpid: __u16, - pub tp_padding: __u16, - } - - pub struct tpacket2_hdr { - pub tp_status: __u32, - pub tp_len: __u32, - pub tp_snaplen: __u32, - pub tp_mac: __u16, - pub tp_net: __u16, - pub tp_sec: __u32, - pub tp_nsec: __u32, - pub tp_vlan_tci: __u16, - pub tp_vlan_tpid: __u16, - pub tp_padding: [__u8; 4], - } - - pub struct tpacket_req { - pub tp_block_size: c_uint, - pub tp_block_nr: c_uint, - pub tp_frame_size: c_uint, - pub tp_frame_nr: c_uint, - } - - pub struct tpacket_req3 { - pub tp_block_size: c_uint, - pub tp_block_nr: c_uint, - pub tp_frame_size: c_uint, - pub tp_frame_nr: c_uint, - pub tp_retire_blk_tov: c_uint, - pub tp_sizeof_priv: c_uint, - pub tp_feature_req_word: c_uint, - } - - #[repr(align(8))] - pub struct tpacket_rollover_stats { - pub tp_all: crate::__u64, - pub tp_huge: crate::__u64, - pub tp_failed: crate::__u64, - } - - pub struct tpacket_stats { - pub tp_packets: c_uint, - pub tp_drops: c_uint, - } - - pub struct tpacket_stats_v3 { - pub tp_packets: c_uint, - pub tp_drops: c_uint, - pub tp_freeze_q_cnt: c_uint, - } - - pub struct tpacket3_hdr { - pub tp_next_offset: __u32, - pub tp_sec: __u32, - pub tp_nsec: __u32, - pub tp_snaplen: __u32, - pub tp_len: __u32, - pub tp_status: __u32, - pub tp_mac: __u16, - pub tp_net: __u16, - pub hv1: crate::tpacket_hdr_variant1, - pub tp_padding: [__u8; 8], - } - - pub struct tpacket_bd_ts { - pub ts_sec: c_uint, - pub ts_usec: c_uint, - } - - #[repr(align(8))] - pub struct tpacket_hdr_v1 { - pub block_status: __u32, - pub num_pkts: __u32, - pub offset_to_first_pkt: __u32, - pub blk_len: __u32, - pub seq_num: crate::__u64, - pub ts_first_pkt: crate::tpacket_bd_ts, - pub ts_last_pkt: crate::tpacket_bd_ts, - } - // System V IPC pub struct msginfo { pub msgpool: c_int, @@ -1295,21 +1166,6 @@ s_no_extra_traits! { pub iv: [c_uchar; 0], } - pub union tpacket_req_u { - pub req: crate::tpacket_req, - pub req3: crate::tpacket_req3, - } - - pub union tpacket_bd_header_u { - pub bh1: crate::tpacket_hdr_v1, - } - - pub struct tpacket_block_desc { - pub version: __u32, - pub offset_to_priv: __u32, - pub hdr: crate::tpacket_bd_header_u, - } - // linux/net_tstamp.h pub struct sock_txtime { pub clockid: crate::clockid_t, @@ -2091,60 +1947,6 @@ pub const CTRL_ATTR_MCAST_GRP_UNSPEC: c_int = 0; pub const CTRL_ATTR_MCAST_GRP_NAME: c_int = 1; pub const CTRL_ATTR_MCAST_GRP_ID: c_int = 2; -pub const PACKET_FANOUT: c_int = 18; -pub const PACKET_TX_HAS_OFF: c_int = 19; -pub const PACKET_QDISC_BYPASS: c_int = 20; -pub const PACKET_ROLLOVER_STATS: c_int = 21; -pub const PACKET_FANOUT_DATA: c_int = 22; -pub const PACKET_IGNORE_OUTGOING: c_int = 23; -pub const PACKET_VNET_HDR_SZ: c_int = 24; - -pub const PACKET_FANOUT_HASH: c_uint = 0; -pub const PACKET_FANOUT_LB: c_uint = 1; -pub const PACKET_FANOUT_CPU: c_uint = 2; -pub const PACKET_FANOUT_ROLLOVER: c_uint = 3; -pub const PACKET_FANOUT_RND: c_uint = 4; -pub const PACKET_FANOUT_QM: c_uint = 5; -pub const PACKET_FANOUT_CBPF: c_uint = 6; -pub const PACKET_FANOUT_EBPF: c_uint = 7; -pub const PACKET_FANOUT_FLAG_ROLLOVER: c_uint = 0x1000; -pub const PACKET_FANOUT_FLAG_UNIQUEID: c_uint = 0x2000; -pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: c_uint = 0x4000; -pub const PACKET_FANOUT_FLAG_DEFRAG: c_uint = 0x8000; - -pub const TP_STATUS_KERNEL: __u32 = 0; -pub const TP_STATUS_USER: __u32 = 1 << 0; -pub const TP_STATUS_COPY: __u32 = 1 << 1; -pub const TP_STATUS_LOSING: __u32 = 1 << 2; -pub const TP_STATUS_CSUMNOTREADY: __u32 = 1 << 3; -pub const TP_STATUS_VLAN_VALID: __u32 = 1 << 4; -pub const TP_STATUS_BLK_TMO: __u32 = 1 << 5; -pub const TP_STATUS_VLAN_TPID_VALID: __u32 = 1 << 6; -pub const TP_STATUS_CSUM_VALID: __u32 = 1 << 7; - -pub const TP_STATUS_AVAILABLE: __u32 = 0; -pub const TP_STATUS_SEND_REQUEST: __u32 = 1 << 0; -pub const TP_STATUS_SENDING: __u32 = 1 << 1; -pub const TP_STATUS_WRONG_FORMAT: __u32 = 1 << 2; - -pub const TP_STATUS_TS_SOFTWARE: __u32 = 1 << 29; -pub const TP_STATUS_TS_SYS_HARDWARE: __u32 = 1 << 30; -pub const TP_STATUS_TS_RAW_HARDWARE: __u32 = 1 << 31; - -pub const TP_FT_REQ_FILL_RXHASH: __u32 = 1; - -pub const TPACKET_ALIGNMENT: usize = 16; - -pub const TPACKET_HDRLEN: usize = ((size_of::() + TPACKET_ALIGNMENT - 1) - & !(TPACKET_ALIGNMENT - 1)) - + size_of::(); -pub const TPACKET2_HDRLEN: usize = ((size_of::() + TPACKET_ALIGNMENT - 1) - & !(TPACKET_ALIGNMENT - 1)) - + size_of::(); -pub const TPACKET3_HDRLEN: usize = ((size_of::() + TPACKET_ALIGNMENT - 1) - & !(TPACKET_ALIGNMENT - 1)) - + size_of::(); - // linux/netfilter.h pub const NF_DROP: c_int = 0; pub const NF_ACCEPT: c_int = 1; @@ -3933,10 +3735,6 @@ f! { ee.offset(1) as *mut crate::sockaddr } - pub fn TPACKET_ALIGN(x: usize) -> usize { - (x + TPACKET_ALIGNMENT - 1) & !(TPACKET_ALIGNMENT - 1) - } - pub fn BPF_CLASS(code: __u32) -> __u32 { code & 0x07 } diff --git a/src/unix/linux_like/linux_l4re_shared.rs b/src/unix/linux_like/linux_l4re_shared.rs index 041e2525d9bc..b9f2bc86b3b9 100644 --- a/src/unix/linux_like/linux_l4re_shared.rs +++ b/src/unix/linux_like/linux_l4re_shared.rs @@ -85,13 +85,6 @@ s! { __val: [c_int; 2], } - pub struct packet_mreq { - pub mr_ifindex: c_int, - pub mr_type: c_ushort, - pub mr_alen: c_ushort, - pub mr_address: [c_uchar; 8], - } - pub struct cpu_set_t { #[cfg(all(target_pointer_width = "32", not(target_arch = "x86_64")))] bits: [u32; 32], @@ -1217,43 +1210,6 @@ cfg_if! { } } -// linux/if_packet.h -pub const PACKET_HOST: c_uchar = 0; -pub const PACKET_BROADCAST: c_uchar = 1; -pub const PACKET_MULTICAST: c_uchar = 2; -pub const PACKET_OTHERHOST: c_uchar = 3; -pub const PACKET_OUTGOING: c_uchar = 4; -pub const PACKET_LOOPBACK: c_uchar = 5; -#[cfg(not(target_os = "l4re"))] -pub const PACKET_USER: c_uchar = 6; -#[cfg(not(target_os = "l4re"))] -pub const PACKET_KERNEL: c_uchar = 7; - -pub const PACKET_ADD_MEMBERSHIP: c_int = 1; -pub const PACKET_DROP_MEMBERSHIP: c_int = 2; -pub const PACKET_RECV_OUTPUT: c_int = 3; -pub const PACKET_RX_RING: c_int = 5; -pub const PACKET_STATISTICS: c_int = 6; -cfg_if! { - if #[cfg(not(target_os = "l4re"))] { - pub const PACKET_COPY_THRESH: c_int = 7; - pub const PACKET_AUXDATA: c_int = 8; - pub const PACKET_ORIGDEV: c_int = 9; - pub const PACKET_VERSION: c_int = 10; - pub const PACKET_HDRLEN: c_int = 11; - pub const PACKET_RESERVE: c_int = 12; - pub const PACKET_TX_RING: c_int = 13; - pub const PACKET_LOSS: c_int = 14; - pub const PACKET_VNET_HDR: c_int = 15; - pub const PACKET_TX_TIMESTAMP: c_int = 16; - pub const PACKET_TIMESTAMP: c_int = 17; - } -} - -pub const PACKET_MR_MULTICAST: c_int = 0; -pub const PACKET_MR_PROMISC: c_int = 1; -pub const PACKET_MR_ALLMULTI: c_int = 2; - pub const SIOCADDRT: c_ulong = 0x0000890B; pub const SIOCDELRT: c_ulong = 0x0000890C; pub const SIOCGIFNAME: c_ulong = 0x00008910; From 53c06b4eb4389bfbc21b6ef6ece391d5976c533f Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 19 Jun 2026 06:57:42 -0400 Subject: [PATCH 68/80] linux: Move IFLA_* constants to an anonymous enum to match source Link: https://github.com/torvalds/linux/blob/9ecfb2f7287a967b418ba69f10d45ead0d360593/include/uapi/linux/if_link.h#L296-L385 (backport ) (cherry picked from commit 0d1d9deefe5676a4592d9edd5a0c430410fa6274) --- src/unix/linux_like/linux/mod.rs | 149 ++++++++++++++++--------------- 1 file changed, 79 insertions(+), 70 deletions(-) diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index b706fb356efa..399a8c297220 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -1324,76 +1324,85 @@ pub const RWF_ATOMIC: c_int = 0x00000040; pub const RWF_DONTCACHE: c_int = 0x00000080; // linux/if_link.h -pub const IFLA_UNSPEC: c_ushort = 0; -pub const IFLA_ADDRESS: c_ushort = 1; -pub const IFLA_BROADCAST: c_ushort = 2; -pub const IFLA_IFNAME: c_ushort = 3; -pub const IFLA_MTU: c_ushort = 4; -pub const IFLA_LINK: c_ushort = 5; -pub const IFLA_QDISC: c_ushort = 6; -pub const IFLA_STATS: c_ushort = 7; -pub const IFLA_COST: c_ushort = 8; -pub const IFLA_PRIORITY: c_ushort = 9; -pub const IFLA_MASTER: c_ushort = 10; -pub const IFLA_WIRELESS: c_ushort = 11; -pub const IFLA_PROTINFO: c_ushort = 12; -pub const IFLA_TXQLEN: c_ushort = 13; -pub const IFLA_MAP: c_ushort = 14; -pub const IFLA_WEIGHT: c_ushort = 15; -pub const IFLA_OPERSTATE: c_ushort = 16; -pub const IFLA_LINKMODE: c_ushort = 17; -pub const IFLA_LINKINFO: c_ushort = 18; -pub const IFLA_NET_NS_PID: c_ushort = 19; -pub const IFLA_IFALIAS: c_ushort = 20; -pub const IFLA_NUM_VF: c_ushort = 21; -pub const IFLA_VFINFO_LIST: c_ushort = 22; -pub const IFLA_STATS64: c_ushort = 23; -pub const IFLA_VF_PORTS: c_ushort = 24; -pub const IFLA_PORT_SELF: c_ushort = 25; -pub const IFLA_AF_SPEC: c_ushort = 26; -pub const IFLA_GROUP: c_ushort = 27; -pub const IFLA_NET_NS_FD: c_ushort = 28; -pub const IFLA_EXT_MASK: c_ushort = 29; -pub const IFLA_PROMISCUITY: c_ushort = 30; -pub const IFLA_NUM_TX_QUEUES: c_ushort = 31; -pub const IFLA_NUM_RX_QUEUES: c_ushort = 32; -pub const IFLA_CARRIER: c_ushort = 33; -pub const IFLA_PHYS_PORT_ID: c_ushort = 34; -pub const IFLA_CARRIER_CHANGES: c_ushort = 35; -pub const IFLA_PHYS_SWITCH_ID: c_ushort = 36; -pub const IFLA_LINK_NETNSID: c_ushort = 37; -pub const IFLA_PHYS_PORT_NAME: c_ushort = 38; -pub const IFLA_PROTO_DOWN: c_ushort = 39; -pub const IFLA_GSO_MAX_SEGS: c_ushort = 40; -pub const IFLA_GSO_MAX_SIZE: c_ushort = 41; -pub const IFLA_PAD: c_ushort = 42; -pub const IFLA_XDP: c_ushort = 43; -pub const IFLA_EVENT: c_ushort = 44; -pub const IFLA_NEW_NETNSID: c_ushort = 45; -pub const IFLA_IF_NETNSID: c_ushort = 46; -pub const IFLA_TARGET_NETNSID: c_ushort = IFLA_IF_NETNSID; -pub const IFLA_CARRIER_UP_COUNT: c_ushort = 47; -pub const IFLA_CARRIER_DOWN_COUNT: c_ushort = 48; -pub const IFLA_NEW_IFINDEX: c_ushort = 49; -pub const IFLA_MIN_MTU: c_ushort = 50; -pub const IFLA_MAX_MTU: c_ushort = 51; -pub const IFLA_PROP_LIST: c_ushort = 52; -pub const IFLA_ALT_IFNAME: c_ushort = 53; -pub const IFLA_PERM_ADDRESS: c_ushort = 54; -pub const IFLA_PROTO_DOWN_REASON: c_ushort = 55; -pub const IFLA_PARENT_DEV_NAME: c_ushort = 56; -pub const IFLA_PARENT_DEV_BUS_NAME: c_ushort = 57; -pub const IFLA_GRO_MAX_SIZE: c_ushort = 58; -pub const IFLA_TSO_MAX_SIZE: c_ushort = 59; -pub const IFLA_TSO_MAX_SEGS: c_ushort = 60; -pub const IFLA_ALLMULTI: c_ushort = 61; - -pub const IFLA_INFO_UNSPEC: c_ushort = 0; -pub const IFLA_INFO_KIND: c_ushort = 1; -pub const IFLA_INFO_DATA: c_ushort = 2; -pub const IFLA_INFO_XSTATS: c_ushort = 3; -pub const IFLA_INFO_SLAVE_KIND: c_ushort = 4; -pub const IFLA_INFO_SLAVE_DATA: c_ushort = 5; +c_enum! { + #[repr(c_ushort)] + pub enum #anon { + pub IFLA_UNSPEC, + pub IFLA_ADDRESS, + pub IFLA_BROADCAST, + pub IFLA_IFNAME, + pub IFLA_MTU, + pub IFLA_LINK, + pub IFLA_QDISC, + pub IFLA_STATS, + pub IFLA_COST, + pub IFLA_PRIORITY, + pub IFLA_MASTER, + pub IFLA_WIRELESS, + pub IFLA_PROTINFO, + pub IFLA_TXQLEN, + pub IFLA_MAP, + pub IFLA_WEIGHT, + pub IFLA_OPERSTATE, + pub IFLA_LINKMODE, + pub IFLA_LINKINFO, + pub IFLA_NET_NS_PID, + pub IFLA_IFALIAS, + pub IFLA_NUM_VF, + pub IFLA_VFINFO_LIST, + pub IFLA_STATS64, + pub IFLA_VF_PORTS, + pub IFLA_PORT_SELF, + pub IFLA_AF_SPEC, + pub IFLA_GROUP, + pub IFLA_NET_NS_FD, + pub IFLA_EXT_MASK, + pub IFLA_PROMISCUITY, + pub IFLA_NUM_TX_QUEUES, + pub IFLA_NUM_RX_QUEUES, + pub IFLA_CARRIER, + pub IFLA_PHYS_PORT_ID, + pub IFLA_CARRIER_CHANGES, + pub IFLA_PHYS_SWITCH_ID, + pub IFLA_LINK_NETNSID, + pub IFLA_PHYS_PORT_NAME, + pub IFLA_PROTO_DOWN, + pub IFLA_GSO_MAX_SEGS, + pub IFLA_GSO_MAX_SIZE, + pub IFLA_PAD, + pub IFLA_XDP, + pub IFLA_EVENT, + pub IFLA_NEW_NETNSID, + pub IFLA_IF_NETNSID, + pub IFLA_TARGET_NETNSID = IFLA_IF_NETNSID, + pub IFLA_CARRIER_UP_COUNT, + pub IFLA_CARRIER_DOWN_COUNT, + pub IFLA_NEW_IFINDEX, + pub IFLA_MIN_MTU, + pub IFLA_MAX_MTU, + pub IFLA_PROP_LIST, + pub IFLA_ALT_IFNAME, + pub IFLA_PERM_ADDRESS, + pub IFLA_PROTO_DOWN_REASON, + + pub IFLA_PARENT_DEV_NAME, + pub IFLA_PARENT_DEV_BUS_NAME, + pub IFLA_GRO_MAX_SIZE, + pub IFLA_TSO_MAX_SIZE, + pub IFLA_TSO_MAX_SEGS, + pub IFLA_ALLMULTI, + } + + #[repr(c_ushort)] + pub enum #anon { + pub IFLA_INFO_UNSPEC, + pub IFLA_INFO_KIND, + pub IFLA_INFO_DATA, + pub IFLA_INFO_XSTATS, + pub IFLA_INFO_SLAVE_KIND, + pub IFLA_INFO_SLAVE_DATA, + } +} // Since Linux 3.1 pub const SEEK_DATA: c_int = 3; From 6d91817cd5daaef8180a983310cfe352b87df8a2 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 19 Jun 2026 07:11:40 -0400 Subject: [PATCH 69/80] linux: Move `if_link.h` API to `src/new` Link: https://github.com/torvalds/linux/blob/9ecfb2f7287a967b418ba69f10d45ead0d360593/include/uapi/linux/if_link.h (backport ) (cherry picked from commit d73763fe397958f427b360fdc76da56df44f1a89) --- src/new/linux_uapi/linux/if_link.rs | 83 +++++++++++++++++++++++++++++ src/new/linux_uapi/linux/mod.rs | 1 + src/new/mod.rs | 1 + src/unix/linux_like/linux/mod.rs | 81 ---------------------------- 4 files changed, 85 insertions(+), 81 deletions(-) create mode 100644 src/new/linux_uapi/linux/if_link.rs diff --git a/src/new/linux_uapi/linux/if_link.rs b/src/new/linux_uapi/linux/if_link.rs new file mode 100644 index 000000000000..2c9bb5216867 --- /dev/null +++ b/src/new/linux_uapi/linux/if_link.rs @@ -0,0 +1,83 @@ +//! Header: `uapi/linux/if_link.h` + +use crate::prelude::*; + +c_enum! { + #[repr(c_ushort)] + pub enum #anon { + pub IFLA_UNSPEC, + pub IFLA_ADDRESS, + pub IFLA_BROADCAST, + pub IFLA_IFNAME, + pub IFLA_MTU, + pub IFLA_LINK, + pub IFLA_QDISC, + pub IFLA_STATS, + pub IFLA_COST, + pub IFLA_PRIORITY, + pub IFLA_MASTER, + pub IFLA_WIRELESS, + pub IFLA_PROTINFO, + pub IFLA_TXQLEN, + pub IFLA_MAP, + pub IFLA_WEIGHT, + pub IFLA_OPERSTATE, + pub IFLA_LINKMODE, + pub IFLA_LINKINFO, + pub IFLA_NET_NS_PID, + pub IFLA_IFALIAS, + pub IFLA_NUM_VF, + pub IFLA_VFINFO_LIST, + pub IFLA_STATS64, + pub IFLA_VF_PORTS, + pub IFLA_PORT_SELF, + pub IFLA_AF_SPEC, + pub IFLA_GROUP, + pub IFLA_NET_NS_FD, + pub IFLA_EXT_MASK, + pub IFLA_PROMISCUITY, + pub IFLA_NUM_TX_QUEUES, + pub IFLA_NUM_RX_QUEUES, + pub IFLA_CARRIER, + pub IFLA_PHYS_PORT_ID, + pub IFLA_CARRIER_CHANGES, + pub IFLA_PHYS_SWITCH_ID, + pub IFLA_LINK_NETNSID, + pub IFLA_PHYS_PORT_NAME, + pub IFLA_PROTO_DOWN, + pub IFLA_GSO_MAX_SEGS, + pub IFLA_GSO_MAX_SIZE, + pub IFLA_PAD, + pub IFLA_XDP, + pub IFLA_EVENT, + pub IFLA_NEW_NETNSID, + pub IFLA_IF_NETNSID, + pub IFLA_TARGET_NETNSID = IFLA_IF_NETNSID, + pub IFLA_CARRIER_UP_COUNT, + pub IFLA_CARRIER_DOWN_COUNT, + pub IFLA_NEW_IFINDEX, + pub IFLA_MIN_MTU, + pub IFLA_MAX_MTU, + pub IFLA_PROP_LIST, + pub IFLA_ALT_IFNAME, + pub IFLA_PERM_ADDRESS, + pub IFLA_PROTO_DOWN_REASON, + + pub IFLA_PARENT_DEV_NAME, + pub IFLA_PARENT_DEV_BUS_NAME, + pub IFLA_GRO_MAX_SIZE, + pub IFLA_TSO_MAX_SIZE, + pub IFLA_TSO_MAX_SEGS, + pub IFLA_ALLMULTI, + } + + #[repr(c_ushort)] + pub enum #anon { + pub IFLA_INFO_UNSPEC, + pub IFLA_INFO_KIND, + pub IFLA_INFO_DATA, + pub IFLA_INFO_XSTATS, + pub IFLA_INFO_SLAVE_KIND, + pub IFLA_INFO_SLAVE_DATA, + } +} diff --git a/src/new/linux_uapi/linux/mod.rs b/src/new/linux_uapi/linux/mod.rs index d11d7d1c4a64..248b7f2a25ec 100644 --- a/src/new/linux_uapi/linux/mod.rs +++ b/src/new/linux_uapi/linux/mod.rs @@ -3,6 +3,7 @@ //! pub(crate) mod can; +pub(crate) mod if_link; pub(crate) mod if_packet; pub(crate) mod keyctl; pub(crate) mod membarrier; diff --git a/src/new/mod.rs b/src/new/mod.rs index 1eab46d4b887..2c7e12975b73 100644 --- a/src/new/mod.rs +++ b/src/new/mod.rs @@ -180,6 +180,7 @@ cfg_if! { pub use linux::can::j1939::*; pub use linux::can::netlink::*; pub use linux::can::raw::*; + pub use linux::if_link::*; pub use linux::if_packet::*; pub use linux::keyctl::*; pub use linux::membarrier::*; diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 399a8c297220..359cf58713e4 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -1323,87 +1323,6 @@ pub const RWF_NOAPPEND: c_int = 0x00000020; pub const RWF_ATOMIC: c_int = 0x00000040; pub const RWF_DONTCACHE: c_int = 0x00000080; -// linux/if_link.h -c_enum! { - #[repr(c_ushort)] - pub enum #anon { - pub IFLA_UNSPEC, - pub IFLA_ADDRESS, - pub IFLA_BROADCAST, - pub IFLA_IFNAME, - pub IFLA_MTU, - pub IFLA_LINK, - pub IFLA_QDISC, - pub IFLA_STATS, - pub IFLA_COST, - pub IFLA_PRIORITY, - pub IFLA_MASTER, - pub IFLA_WIRELESS, - pub IFLA_PROTINFO, - pub IFLA_TXQLEN, - pub IFLA_MAP, - pub IFLA_WEIGHT, - pub IFLA_OPERSTATE, - pub IFLA_LINKMODE, - pub IFLA_LINKINFO, - pub IFLA_NET_NS_PID, - pub IFLA_IFALIAS, - pub IFLA_NUM_VF, - pub IFLA_VFINFO_LIST, - pub IFLA_STATS64, - pub IFLA_VF_PORTS, - pub IFLA_PORT_SELF, - pub IFLA_AF_SPEC, - pub IFLA_GROUP, - pub IFLA_NET_NS_FD, - pub IFLA_EXT_MASK, - pub IFLA_PROMISCUITY, - pub IFLA_NUM_TX_QUEUES, - pub IFLA_NUM_RX_QUEUES, - pub IFLA_CARRIER, - pub IFLA_PHYS_PORT_ID, - pub IFLA_CARRIER_CHANGES, - pub IFLA_PHYS_SWITCH_ID, - pub IFLA_LINK_NETNSID, - pub IFLA_PHYS_PORT_NAME, - pub IFLA_PROTO_DOWN, - pub IFLA_GSO_MAX_SEGS, - pub IFLA_GSO_MAX_SIZE, - pub IFLA_PAD, - pub IFLA_XDP, - pub IFLA_EVENT, - pub IFLA_NEW_NETNSID, - pub IFLA_IF_NETNSID, - pub IFLA_TARGET_NETNSID = IFLA_IF_NETNSID, - pub IFLA_CARRIER_UP_COUNT, - pub IFLA_CARRIER_DOWN_COUNT, - pub IFLA_NEW_IFINDEX, - pub IFLA_MIN_MTU, - pub IFLA_MAX_MTU, - pub IFLA_PROP_LIST, - pub IFLA_ALT_IFNAME, - pub IFLA_PERM_ADDRESS, - pub IFLA_PROTO_DOWN_REASON, - - pub IFLA_PARENT_DEV_NAME, - pub IFLA_PARENT_DEV_BUS_NAME, - pub IFLA_GRO_MAX_SIZE, - pub IFLA_TSO_MAX_SIZE, - pub IFLA_TSO_MAX_SEGS, - pub IFLA_ALLMULTI, - } - - #[repr(c_ushort)] - pub enum #anon { - pub IFLA_INFO_UNSPEC, - pub IFLA_INFO_KIND, - pub IFLA_INFO_DATA, - pub IFLA_INFO_XSTATS, - pub IFLA_INFO_SLAVE_KIND, - pub IFLA_INFO_SLAVE_DATA, - } -} - // Since Linux 3.1 pub const SEEK_DATA: c_int = 3; pub const SEEK_HOLE: c_int = 4; From 54ee4c125cbe5a763e7d636f74ffe91927dbbbb0 Mon Sep 17 00:00:00 2001 From: Jonah Petri Date: Tue, 7 Apr 2026 13:18:50 -0400 Subject: [PATCH 70/80] uclibc: fix build, enable CI, add unstable support of 64-bit time_t (backport ) (cherry picked from commit 2549bd4a98192194ff655d0184cb7adb6152427f) --- build.rs | 5 + .../Dockerfile | 8 +- ci/install-uclibc.sh | 20 ++ ci/run-docker.sh | 5 + libc-test/build.rs | 221 ++++++++++++++++-- src/unix/linux_like/linux/mod.rs | 5 +- src/unix/linux_like/linux/uclibc/arm/mod.rs | 13 +- src/unix/linux_like/linux/uclibc/mod.rs | 90 ------- src/unix/linux_like/linux_l4re_shared.rs | 18 +- src/unix/linux_like/mod.rs | 52 ++--- 10 files changed, 267 insertions(+), 170 deletions(-) create mode 100755 ci/install-uclibc.sh diff --git a/build.rs b/build.rs index c6954cf31f80..66bd213ffc53 100644 --- a/build.rs +++ b/build.rs @@ -131,6 +131,11 @@ fn main() { } } + let uclibc_use_time64 = env_flag("CARGO_CFG_LIBC_UNSTABLE_UCLIBC_TIME64"); + if target_env == "uclibc" && uclibc_use_time64 { + set_cfg("linux_time_bits64"); + } + let linux_time_bits64 = env::var("RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64").is_ok(); println!("cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64"); if linux_time_bits64 { diff --git a/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile b/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile index 284389360ac2..a5e685318ad0 100644 --- a/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile +++ b/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile @@ -14,11 +14,9 @@ RUN sed -i -E 's/(archive|security)\.ubuntu\.com/old-releases.ubuntu.com/g' \ qemu-user \ xz-utils -RUN mkdir /toolchain - -RUN curl --retry 5 -L https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--uclibc--bleeding-edge-2021.11-1.tar.bz2 | \ - tar xjf - -C /toolchain --strip-components=1 -RUN /toolchain/relocate-sdk.sh +ARG TEST_UCLIBC_TIME64 +COPY install-uclibc.sh / +RUN /install-uclibc.sh "$TEST_UCLIBC_TIME64" ENV PATH=$PATH:/rust/bin:/toolchain/bin \ STAGING_DIR=/toolchain/armv7-buildroot-linux-uclibceabihf/sysroot \ diff --git a/ci/install-uclibc.sh b/ci/install-uclibc.sh new file mode 100755 index 000000000000..131f78f2065d --- /dev/null +++ b/ci/install-uclibc.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Installs the appropriate uclibc toolchain into /toolchain + +set -eux + +time64="$1" + +if [ "${time64:-0}" != "0" ]; then + version='bleeding-edge-2025.08-1' +else + version='bleeding-edge-2024.02-1' # last version with 32-bit time_t +fi + +mkdir /toolchain + +curl --retry 5 -L "https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--uclibc--${version}.tar.bz2" | +tar xjf - -C /toolchain --strip-components=1 + +/toolchain/relocate-sdk.sh diff --git a/ci/run-docker.sh b/ci/run-docker.sh index b376e8538a92..4b46b59f7bec 100755 --- a/ci/run-docker.sh +++ b/ci/run-docker.sh @@ -44,6 +44,11 @@ run() { fi fi + if [ -n "${TEST_UCLIBC_TIME64:-}" ]; then + build_args+=("--build-arg=TEST_UCLIBC_TIME64=1") + export RUSTFLAGS="$RUSTFLAGS --cfg=libc_unstable_uclibc_time64" + fi + # use -f so we can use ci/ as build context docker build "${build_args[@]}" diff --git a/libc-test/build.rs b/libc-test/build.rs index b8a4ada27ba2..ccb7a071dd34 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -3898,6 +3898,12 @@ fn test_linux(target: &str) { cfg.cfg("musl_redir_time64", None); } } + let uclibc_use_time64 = env::var("CARGO_CFG_LIBC_UNSTABLE_UCLIBC_TIME64") + .map(|val| val != "0") + .unwrap_or(false); + if uclibc && uclibc_use_time64 { + cfg.cfg("linux_time_bits64", None); + } cfg.define("_GNU_SOURCE", None) // This macro re-defines fscanf,scanf,sscanf to link to the symbols that are // deprecated since glibc >= 2.29. This allows Rust binaries to link against @@ -4102,9 +4108,14 @@ fn test_linux(target: &str) { "linux/wait.h", "linux/wireless.h", "sys/fanotify.h", - // is not present on uclibc - (!uclibc, "sys/auxv.h"), + "sys/auxv.h", (gnu || musl, "linux/close_range.h"), + (uclibc, "linux/fanotify.h"), + (uclibc, "linux/auxvec.h"), + (uclibc, "linux/close_range.h"), + (uclibc, "linux/if_packet.h"), + (uclibc, "linux/elf-em.h"), + (uclibc, "sys/resource.h"), ); } @@ -4343,6 +4354,18 @@ fn test_linux(target: &str) { // On 64 bits the size did not change, skip only for 32 bits. "ptrace_syscall_info" if pointer_width == 32 => true, + "canxl_frame" + | "fanotify_event_info_header" // not in sys/fanotify.h in uclibc + | "fanotify_event_info_fid" // not in sys/fanotify.h in uclibc + | "tls12_crypto_info_sm4_gcm" + | "tls12_crypto_info_sm4_ccm" + | "tls12_crypto_info_aria_gcm_128" + | "tls12_crypto_info_aria_gcm_256" + if uclibc => + { + true + } + _ => false, } }); @@ -4485,6 +4508,170 @@ fn test_linux(target: &str) { } } + if uclibc { + match name { + // The canonical uClibc toolchain, bootlin bleeding-edge-2024.02-1, + // uses linux 5.15, so several constants are not available. + + // requires linux 5.16 + "PR_SCHED_CORE_SCOPE_PROCESS_GROUP" + | "PR_SCHED_CORE_SCOPE_THREAD_GROUP" + | "PR_SCHED_CORE_SCOPE_THREAD" + | "NF_NETDEV_EGRESS" + | "SO_RESERVE_MEM" => return true, + + // TLS_CIPHER_SM4_[GC]CM requires linux 5.16 + "TLS_CIPHER_SM4_CCM_IV_SIZE" + | "TLS_CIPHER_SM4_CCM_KEY_SIZE" + | "TLS_CIPHER_SM4_CCM_REC_SEQ_SIZE" + | "TLS_CIPHER_SM4_CCM_SALT_SIZE" + | "TLS_CIPHER_SM4_CCM_TAG_SIZE" + | "TLS_CIPHER_SM4_CCM" + | "TLS_CIPHER_SM4_GCM_IV_SIZE" + | "TLS_CIPHER_SM4_GCM_KEY_SIZE" + | "TLS_CIPHER_SM4_GCM_REC_SEQ_SIZE" + | "TLS_CIPHER_SM4_GCM_SALT_SIZE" + | "TLS_CIPHER_SM4_GCM_TAG_SIZE" + | "TLS_CIPHER_SM4_GCM" => return true, + + // requires linux 5.17 + "PR_SET_VMA_ANON_NAME" + | "PR_SET_VMA" + | "RTNLGRP_MCTP_IFADDR" => return true, + + // requires linux 5.18 + "RTNLGRP_STATS" + | "RTNLGRP_TUNNEL" + | "TLS_TX_ZEROCOPY_RO" + | "MADV_DONTNEED_LOCKED" + | "NFQA_PRIORITY" + | "SO_TXREHASH" => return true, + + // requires linux 5.19 + "SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV" + | "NLM_F_BULK" + | "SO_RCVMARK" + | "TLS_INFO_ZC_RO_TX" => return true, + + // CAN_* consts requiring linux 6.0 + "CAN_BUS_OFF_THRESHOLD" + | "CAN_CTRLMODE_TDC_AUTO" + | "CAN_CTRLMODE_TDC_MANUAL" + | "CAN_ERR_CNT" + | "CAN_ERROR_PASSIVE_THRESHOLD" + | "CAN_ERROR_WARNING_THRESHOLD" => return true, + + // requires linux 6.0 + "IFF_NO_CARRIER" + | "TLS_INFO_RX_NO_PAD" + | "TLS_RX_EXPECT_NO_PAD" => return true, + + // CAN_* consts requiring linux 6.1 + "CAN_RAW_XL_FRAMES" + | "CANXL_HDR_SIZE" + | "CANXL_MAX_DLC_MASK" + | "CANXL_MAX_DLC" + | "CANXL_MAX_DLEN" + | "CANXL_MAX_MTU" + | "CANXL_MIN_DLC" + | "CANXL_MIN_DLEN" + | "CANXL_MIN_MTU" + | "CANXL_MTU" + | "CANXL_PRIO_BITS" + | "CANXL_PRIO_MASK" + | "CANXL_SEC" + | "CANXL_XLF" => return true, + + // TLS_CIPHER_ARIA_GCM_* requires linux 6.1 + "TLS_CIPHER_ARIA_GCM_128_IV_SIZE" + | "TLS_CIPHER_ARIA_GCM_128_KEY_SIZE" + | "TLS_CIPHER_ARIA_GCM_128_REC_SEQ_SIZE" + | "TLS_CIPHER_ARIA_GCM_128_SALT_SIZE" + | "TLS_CIPHER_ARIA_GCM_128_TAG_SIZE" + | "TLS_CIPHER_ARIA_GCM_128" + | "TLS_CIPHER_ARIA_GCM_256_IV_SIZE" + | "TLS_CIPHER_ARIA_GCM_256_KEY_SIZE" + | "TLS_CIPHER_ARIA_GCM_256_REC_SEQ_SIZE" + | "TLS_CIPHER_ARIA_GCM_256_SALT_SIZE" + | "TLS_CIPHER_ARIA_GCM_256_TAG_SIZE" + | "TLS_CIPHER_ARIA_GCM_256" => return true, + + // requires linux 6.2 + "ALG_SET_KEY_BY_KEY_SERIAL" + | "PACKET_FANOUT_FLAG_IGNORE_OUTGOING" + | "SOF_TIMESTAMPING_OPT_ID_TCP" + | "TUN_F_USO4" + | "TUN_F_USO6" => return true, + + // FAN_* consts require kernel 6.3 + "FAN_INFO" + | "FAN_RESPONSE_INFO_AUDIT_RULE" + | "FAN_RESPONSE_INFO_NONE" => return true, + + // requires linux 6.3 + "MFD_EXEC" + | "MFD_NOEXEC_SEAL" + | "PR_GET_MDWE" + | "PR_SET_MDWE" => return true, + + // requires linux 6.4 + "PACKET_VNET_HDR_SZ" => return true, + + // requires linux 6.5 + "SO_PASSPIDFD" + | "SO_PEERPIDFD" => return true, + + // requires linux 6.6 + "PR_MDWE_NO_INHERIT" + | "PR_MDWE_REFUSE_EXEC_GAIN" => return true, + + // defined as a synonym for EM_ARC_COMPACT in gnu but not uclibc + "EM_ARC_A5" => return true, + + /* + Here are a list of kernel UAPI constants which appear in linux/ headers, + but cannot be imported due to conflicts with the uclibc headers. + The conflicting linux/ header is noted. + */ + // linux/signal.h + "BUS_MCEERR_AO" + | "BUS_MCEERR_AR" + // linux/termios.h + | "EXTPROC" + // linux/inotify.h + | "IN_MASK_CREATE" + // linux/in.h + | "IPPROTO_BEETPH" + | "IPPROTO_ETHERNET" + | "IPPROTO_MPLS" + | "IPPROTO_MPTCP" + // linux/in6.h + | "IPV6_HDRINCL" + | "IPV6_MULTICAST_ALL" + | "IPV6_PMTUDISC_INTERFACE" + | "IPV6_PMTUDISC_OMIT" + | "IPV6_ROUTER_ALERT_ISOLATE" + // linux/elf.h + | "NT_PRFPREG" + // linux/sem.h + | "SEM_STAT_ANY" + // linux/shm.h + | "SHM_EXEC" + // linux/signal.h + | "SI_DETHREAD" + | "TRAP_BRANCH" + | "TRAP_HWBKPT" + | "TRAP_UNK" + // linux/timerfd.h + | "TFD_TIMER_CANCEL_ON_SET" + // linux/udp.h + | "UDP_GRO" + | "UDP_SEGMENT" => return true, + + _ => (), + } + } + match name { // These constants are not available if gnu headers have been included // and can therefore not be tested here @@ -4551,25 +4738,6 @@ fn test_linux(target: &str) { // Skip as this signal codes and trap reasons need newer headers "TRAP_PERF" => true, - // kernel constants not available in uclibc 1.0.34 - "EXTPROC" - | "IPPROTO_BEETPH" - | "IPPROTO_MPLS" - | "IPV6_HDRINCL" - | "IPV6_MULTICAST_ALL" - | "IPV6_PMTUDISC_INTERFACE" - | "IPV6_PMTUDISC_OMIT" - | "IPV6_ROUTER_ALERT_ISOLATE" - | "PACKET_MR_UNICAST" - | "RUSAGE_THREAD" - | "SHM_EXEC" - | "UDP_GRO" - | "UDP_SEGMENT" - if uclibc => - { - true - } - // headers conflicts with linux/pidfd.h "PIDFD_NONBLOCK" => true, // Linux >= 6.9 @@ -4610,6 +4778,10 @@ fn test_linux(target: &str) { // value changed "NF_NETDEV_NUMHOOKS" if sparc64 => true, + // Canonical uclibc latest from toolchains.bootlin.com is based on kernel 5.15, + // so opt out of tests for constants which are different in later kernels. + "NF_NETDEV_NUMHOOKS" | "RLIM_NLIMITS" | "NFT_MSG_MAX" if uclibc => true, + // DIFF(main): fixed in 1.0 with e9abac9ac2 "CLONE_CLEAR_SIGHAND" | "CLONE_INTO_CGROUP" => true, @@ -4832,8 +5004,9 @@ fn test_linux(target: &str) { // Needs glibc 2.33 or later. "mallinfo2" => true, - // Not defined in uclibc as of 1.0.34 + // Not defined in uclibc as of 1.0.45 "gettid" if uclibc => true, + "getauxval" if uclibc => true, // pthread_sigqueue uses sigval, which was initially declared // as a struct but should be defined as a union. However due @@ -4971,7 +5144,7 @@ fn test_linux(target: &str) { // FIXME(linux): `max_phase_adj` requires >= 5.19 kernel headers // the rsv field shrunk when those fields got added, so is omitted too ("ptp_clock_caps", "adjust_phase" | "max_phase_adj" | "rsv") - if loongarch64 || sparc64 => + if loongarch64 || sparc64 || uclibc => { true } @@ -4988,7 +5161,7 @@ fn test_linux(target: &str) { ("bcm_msg_head", "frames") => true, // FAM ("af_alg_iv", "iv") => true, - ("file_handle", "f_handle") if musl => true, + ("file_handle", "f_handle") if musl || uclibc => true, // FIXME(ctest): ctest does not translate the rust code which computes the padding size ("pthread_cond_t", "__padding") if l4re => true, _ => false, diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 359cf58713e4..6d762623da75 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -1268,8 +1268,9 @@ cfg_if! { } } -pub const POSIX_SPAWN_USEVFORK: c_int = 64; -pub const POSIX_SPAWN_SETSID: c_int = 128; +pub const POSIX_SPAWN_USEVFORK: c_short = 64; +#[cfg(not(target_env = "uclibc"))] +pub const POSIX_SPAWN_SETSID: c_short = 128; pub const F_SEAL_FUTURE_WRITE: c_int = 0x0010; pub const F_SEAL_EXEC: c_int = 0x0020; diff --git a/src/unix/linux_like/linux/uclibc/arm/mod.rs b/src/unix/linux_like/linux/uclibc/arm/mod.rs index 26dd49b24465..1c09954cc834 100644 --- a/src/unix/linux_like/linux/uclibc/arm/mod.rs +++ b/src/unix/linux_like/linux/uclibc/arm/mod.rs @@ -2,7 +2,17 @@ use crate::off64_t; use crate::prelude::*; pub type wchar_t = c_uint; -pub type time_t = c_long; + +cfg_if! { + // Set cfg(libc_unstable_uclibc_time64) in rustflags if your uclibc has 64-bit time + if #[cfg(linux_time_bits64)] { + pub type time_t = c_longlong; + pub type suseconds_t = c_longlong; + } else { + pub type time_t = c_long; + pub type suseconds_t = c_long; + } +} pub type clock_t = c_long; pub type fsblkcnt_t = c_ulong; @@ -10,7 +20,6 @@ pub type fsfilcnt_t = c_ulong; pub type ino_t = c_ulong; pub type off_t = c_long; pub type pthread_t = c_ulong; -pub type suseconds_t = c_long; pub type nlink_t = c_uint; pub type blksize_t = c_long; diff --git a/src/unix/linux_like/linux/uclibc/mod.rs b/src/unix/linux_like/linux/uclibc/mod.rs index bdf80596d210..d8bb28e2cad2 100644 --- a/src/unix/linux_like/linux/uclibc/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mod.rs @@ -87,37 +87,6 @@ s! { pub nr: crate::__s32, } - #[cfg_attr( - any( - target_pointer_width = "32", - target_arch = "x86_64", - target_arch = "powerpc64", - target_arch = "mips64", - target_arch = "s390x", - target_arch = "sparc64" - ), - repr(align(4)) - )] - #[cfg_attr( - not(any( - target_pointer_width = "32", - target_arch = "x86_64", - target_arch = "powerpc64", - target_arch = "mips64", - target_arch = "s390x", - target_arch = "sparc64" - )), - repr(align(8)) - )] - pub struct pthread_mutexattr_t { - size: [u8; crate::__SIZEOF_PTHREAD_MUTEXATTR_T], - } - - #[repr(align(4))] - pub struct pthread_condattr_t { - size: [u8; crate::__SIZEOF_PTHREAD_CONDATTR_T], - } - pub struct tcp_info { pub tcpi_state: u8, pub tcpi_ca_state: u8, @@ -293,64 +262,6 @@ pub const ENOTSUP: c_int = EOPNOTSUPP; pub const IPV6_JOIN_GROUP: c_int = 20; pub const IPV6_LEAVE_GROUP: c_int = 21; -// These are different from GNU -pub const ABDAY_1: crate::nl_item = 0x300; -pub const ABDAY_2: crate::nl_item = 0x301; -pub const ABDAY_3: crate::nl_item = 0x302; -pub const ABDAY_4: crate::nl_item = 0x303; -pub const ABDAY_5: crate::nl_item = 0x304; -pub const ABDAY_6: crate::nl_item = 0x305; -pub const ABDAY_7: crate::nl_item = 0x306; -pub const DAY_1: crate::nl_item = 0x307; -pub const DAY_2: crate::nl_item = 0x308; -pub const DAY_3: crate::nl_item = 0x309; -pub const DAY_4: crate::nl_item = 0x30A; -pub const DAY_5: crate::nl_item = 0x30B; -pub const DAY_6: crate::nl_item = 0x30C; -pub const DAY_7: crate::nl_item = 0x30D; -pub const ABMON_1: crate::nl_item = 0x30E; -pub const ABMON_2: crate::nl_item = 0x30F; -pub const ABMON_3: crate::nl_item = 0x310; -pub const ABMON_4: crate::nl_item = 0x311; -pub const ABMON_5: crate::nl_item = 0x312; -pub const ABMON_6: crate::nl_item = 0x313; -pub const ABMON_7: crate::nl_item = 0x314; -pub const ABMON_8: crate::nl_item = 0x315; -pub const ABMON_9: crate::nl_item = 0x316; -pub const ABMON_10: crate::nl_item = 0x317; -pub const ABMON_11: crate::nl_item = 0x318; -pub const ABMON_12: crate::nl_item = 0x319; -pub const MON_1: crate::nl_item = 0x31A; -pub const MON_2: crate::nl_item = 0x31B; -pub const MON_3: crate::nl_item = 0x31C; -pub const MON_4: crate::nl_item = 0x31D; -pub const MON_5: crate::nl_item = 0x31E; -pub const MON_6: crate::nl_item = 0x31F; -pub const MON_7: crate::nl_item = 0x320; -pub const MON_8: crate::nl_item = 0x321; -pub const MON_9: crate::nl_item = 0x322; -pub const MON_10: crate::nl_item = 0x323; -pub const MON_11: crate::nl_item = 0x324; -pub const MON_12: crate::nl_item = 0x325; -pub const AM_STR: crate::nl_item = 0x326; -pub const PM_STR: crate::nl_item = 0x327; -pub const D_T_FMT: crate::nl_item = 0x328; -pub const D_FMT: crate::nl_item = 0x329; -pub const T_FMT: crate::nl_item = 0x32A; -pub const T_FMT_AMPM: crate::nl_item = 0x32B; -pub const ERA: crate::nl_item = 0x32C; -pub const ERA_D_FMT: crate::nl_item = 0x32E; -pub const ALT_DIGITS: crate::nl_item = 0x32F; -pub const ERA_D_T_FMT: crate::nl_item = 0x330; -pub const ERA_T_FMT: crate::nl_item = 0x331; -pub const CODESET: crate::nl_item = 10; -pub const CRNCYSTR: crate::nl_item = 0x215; -pub const RADIXCHAR: crate::nl_item = 0x100; -pub const THOUSEP: crate::nl_item = 0x101; -pub const NOEXPR: crate::nl_item = 0x501; -pub const YESSTR: crate::nl_item = 0x502; -pub const NOSTR: crate::nl_item = 0x503; - // Different than Gnu. pub const FILENAME_MAX: c_uint = 4095; @@ -414,7 +325,6 @@ pub const SOCK_PACKET: c_int = 10; pub const TCP_COOKIE_TRANSACTIONS: c_int = 15; pub const UDP_GRO: c_int = 104; pub const UDP_SEGMENT: c_int = 103; -pub const YESEXPR: c_int = ((5) << 8) | (0); extern "C" { pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut crate::timezone) -> c_int; diff --git a/src/unix/linux_like/linux_l4re_shared.rs b/src/unix/linux_like/linux_l4re_shared.rs index b9f2bc86b3b9..1877f3cadcf3 100644 --- a/src/unix/linux_like/linux_l4re_shared.rs +++ b/src/unix/linux_like/linux_l4re_shared.rs @@ -798,11 +798,9 @@ pub const EM_M32R: u16 = 88; pub const EM_MN10300: u16 = 89; pub const EM_MN10200: u16 = 90; pub const EM_PJ: u16 = 91; -#[cfg(not(target_env = "uclibc"))] pub const EM_OPENRISC: u16 = 92; #[cfg(target_env = "uclibc")] pub const EM_OR1K: u16 = 92; -#[cfg(not(target_env = "uclibc"))] pub const EM_ARC_A5: u16 = 93; pub const EM_XTENSA: u16 = 94; pub const EM_AARCH64: u16 = 183; @@ -877,7 +875,6 @@ pub const AT_EXECFN: c_ulong = 31; // defined in arch//include/uapi/asm/auxvec.h but has the same value // wherever it is defined. pub const AT_SYSINFO_EHDR: c_ulong = 33; -#[cfg(not(target_env = "uclibc"))] pub const AT_MINSIGSTKSZ: c_ulong = 51; pub const GLOB_ERR: c_int = 1 << 0; @@ -932,21 +929,16 @@ pub const PTHREAD_MUTEX_NORMAL: c_int = 0; pub const PTHREAD_MUTEX_RECURSIVE: c_int = 1; pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 2; pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL; -#[cfg(not(target_env = "uclibc"))] pub const PTHREAD_MUTEX_STALLED: c_int = 0; -#[cfg(not(target_env = "uclibc"))] pub const PTHREAD_MUTEX_ROBUST: c_int = 1; -#[cfg(not(target_env = "uclibc"))] pub const PTHREAD_PRIO_NONE: c_int = 0; -#[cfg(not(target_env = "uclibc"))] pub const PTHREAD_PRIO_INHERIT: c_int = 1; -#[cfg(not(target_env = "uclibc"))] pub const PTHREAD_PRIO_PROTECT: c_int = 2; pub const PTHREAD_PROCESS_PRIVATE: c_int = 0; pub const PTHREAD_PROCESS_SHARED: c_int = 1; pub const PTHREAD_INHERIT_SCHED: c_int = 0; pub const PTHREAD_EXPLICIT_SCHED: c_int = 1; -#[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] +#[cfg(not(target_os = "l4re"))] pub const __SIZEOF_PTHREAD_COND_T: usize = 48; // netinet/in.h @@ -1186,11 +1178,11 @@ pub const IUTF8: crate::tcflag_t = 0x00004000; #[cfg(not(all(target_env = "uclibc", target_arch = "mips")))] pub const CMSPAR: crate::tcflag_t = 0o10000000000; -pub const MFD_CLOEXEC: c_uint = 0x0001; -pub const MFD_ALLOW_SEALING: c_uint = 0x0002; -pub const MFD_HUGETLB: c_uint = 0x0004; cfg_if! { - if #[cfg(not(target_env = "uclibc"))] { + if #[cfg(not(target_os = "l4re"))] { + pub const MFD_CLOEXEC: c_uint = 0x0001; + pub const MFD_ALLOW_SEALING: c_uint = 0x0002; + pub const MFD_HUGETLB: c_uint = 0x0004; pub const MFD_NOEXEC_SEAL: c_uint = 0x0008; pub const MFD_EXEC: c_uint = 0x0010; pub const MFD_HUGE_64KB: c_uint = 0x40000000; diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index 8e73caac0d6b..3d6a86ea9c75 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -769,11 +769,8 @@ pub const IP_TRANSPARENT: c_int = 19; pub const IP_ORIGDSTADDR: c_int = 20; pub const IP_RECVORIGDSTADDR: c_int = IP_ORIGDSTADDR; pub const IP_MINTTL: c_int = 21; -#[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] pub const IP_NODEFRAG: c_int = 22; -#[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] pub const IP_CHECKSUM: c_int = 23; -#[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] pub const IP_BIND_ADDRESS_NO_PORT: c_int = 24; pub const IP_MULTICAST_IF: c_int = 32; pub const IP_MULTICAST_TTL: c_int = 33; @@ -795,9 +792,7 @@ pub const IP_PMTUDISC_DONT: c_int = 0; pub const IP_PMTUDISC_WANT: c_int = 1; pub const IP_PMTUDISC_DO: c_int = 2; pub const IP_PMTUDISC_PROBE: c_int = 3; -#[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] pub const IP_PMTUDISC_INTERFACE: c_int = 4; -#[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] pub const IP_PMTUDISC_OMIT: c_int = 5; // IPPROTO_IP defined in src/unix/mod.rs @@ -907,32 +902,25 @@ pub const IPV6_RECVRTHDR: c_int = 56; pub const IPV6_RTHDR: c_int = 57; pub const IPV6_RECVDSTOPTS: c_int = 58; pub const IPV6_DSTOPTS: c_int = 59; -#[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] pub const IPV6_RECVPATHMTU: c_int = 60; -#[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] pub const IPV6_PATHMTU: c_int = 61; -#[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] pub const IPV6_DONTFRAG: c_int = 62; pub const IPV6_RECVTCLASS: c_int = 66; pub const IPV6_TCLASS: c_int = 67; -cfg_if! { - if #[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] { - pub const IPV6_AUTOFLOWLABEL: c_int = 70; - pub const IPV6_ADDR_PREFERENCES: c_int = 72; - pub const IPV6_MINHOPCOUNT: c_int = 73; - pub const IPV6_ORIGDSTADDR: c_int = 74; - pub const IPV6_RECVORIGDSTADDR: c_int = IPV6_ORIGDSTADDR; - pub const IPV6_TRANSPARENT: c_int = 75; - pub const IPV6_UNICAST_IF: c_int = 76; - pub const IPV6_PREFER_SRC_TMP: c_int = 0x0001; - pub const IPV6_PREFER_SRC_PUBLIC: c_int = 0x0002; - pub const IPV6_PREFER_SRC_PUBTMP_DEFAULT: c_int = 0x0100; - pub const IPV6_PREFER_SRC_COA: c_int = 0x0004; - pub const IPV6_PREFER_SRC_HOME: c_int = 0x0400; - pub const IPV6_PREFER_SRC_CGA: c_int = 0x0008; - pub const IPV6_PREFER_SRC_NONCGA: c_int = 0x0800; - } -} +pub const IPV6_AUTOFLOWLABEL: c_int = 70; +pub const IPV6_ADDR_PREFERENCES: c_int = 72; +pub const IPV6_MINHOPCOUNT: c_int = 73; +pub const IPV6_ORIGDSTADDR: c_int = 74; +pub const IPV6_RECVORIGDSTADDR: c_int = IPV6_ORIGDSTADDR; +pub const IPV6_TRANSPARENT: c_int = 75; +pub const IPV6_UNICAST_IF: c_int = 76; +pub const IPV6_PREFER_SRC_TMP: c_int = 0x0001; +pub const IPV6_PREFER_SRC_PUBLIC: c_int = 0x0002; +pub const IPV6_PREFER_SRC_PUBTMP_DEFAULT: c_int = 0x0100; +pub const IPV6_PREFER_SRC_COA: c_int = 0x0004; +pub const IPV6_PREFER_SRC_HOME: c_int = 0x0400; +pub const IPV6_PREFER_SRC_CGA: c_int = 0x0008; +pub const IPV6_PREFER_SRC_NONCGA: c_int = 0x0800; pub const IPV6_PMTUDISC_DONT: c_int = 0; pub const IPV6_PMTUDISC_WANT: c_int = 1; @@ -1179,14 +1167,10 @@ pub const __WNOTHREAD: c_int = 0x20000000; pub const __WALL: c_int = 0x40000000; pub const __WCLONE: c_int = 0x80000000; -cfg_if! { - if #[cfg(not(all(target_os = "l4re", target_env = "uclibc")))] { - pub const SPLICE_F_MOVE: c_uint = 0x01; - pub const SPLICE_F_NONBLOCK: c_uint = 0x02; - pub const SPLICE_F_MORE: c_uint = 0x04; - pub const SPLICE_F_GIFT: c_uint = 0x08; - } -} +pub const SPLICE_F_MOVE: c_uint = 0x01; +pub const SPLICE_F_NONBLOCK: c_uint = 0x02; +pub const SPLICE_F_MORE: c_uint = 0x04; +pub const SPLICE_F_GIFT: c_uint = 0x08; pub const RTLD_LOCAL: c_int = 0; pub const RTLD_LAZY: c_int = 1; From e4b77ed8a5e1f67ceb6216c93208fb9e648c3a6e Mon Sep 17 00:00:00 2001 From: Jonah Petri Date: Fri, 8 May 2026 11:44:56 -0400 Subject: [PATCH 71/80] semver: move POSIX_SPAWN_SETSID from linux -> linux-{gnu,musl} as it is a gnu-ism (backport ) (cherry picked from commit b5d228182b3f5e501ad1c7d680a1d8541d3042b6) --- libc-test/build.rs | 2 ++ libc-test/semver/linux-gnu.txt | 1 + libc-test/semver/linux-musl.txt | 1 + libc-test/semver/linux.txt | 1 - 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index ccb7a071dd34..0bdd5176d180 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -4616,6 +4616,8 @@ fn test_linux(target: &str) { // requires linux 6.4 "PACKET_VNET_HDR_SZ" => return true, + "PR_GET_MEMORY_MERGE" => return true, + "PR_SET_MEMORY_MERGE" => return true, // requires linux 6.5 "SO_PASSPIDFD" diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt index d8cf94d3512c..9c5553975c6a 100644 --- a/libc-test/semver/linux-gnu.txt +++ b/libc-test/semver/linux-gnu.txt @@ -342,6 +342,7 @@ O_FSYNC PF_IB PF_MPLS PF_XDP +POSIX_SPAWN_SETSID PROC_SUPER_MAGIC PR_SET_VMA PR_SET_VMA_ANON_NAME diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt index ff5bc25939b5..32a26960dacb 100644 --- a/libc-test/semver/linux-musl.txt +++ b/libc-test/semver/linux-musl.txt @@ -28,6 +28,7 @@ OLD_TIME PF_IB PF_MPLS PF_XDP +POSIX_SPAWN_SETSID PR_SET_VMA PR_SET_VMA_ANON_NAME RUN_LVL diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index 40fffa77360a..bee77aa7564f 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -2391,7 +2391,6 @@ POSIX_SPAWN_RESETIDS POSIX_SPAWN_SETPGROUP POSIX_SPAWN_SETSCHEDPARAM POSIX_SPAWN_SETSCHEDULER -POSIX_SPAWN_SETSID POSIX_SPAWN_SETSIGDEF POSIX_SPAWN_SETSIGMASK POSIX_SPAWN_USEVFORK From 5290691a2fdc800326cef9d6a2cf252b1e31c45a Mon Sep 17 00:00:00 2001 From: Jonah Petri Date: Fri, 8 May 2026 12:20:45 -0400 Subject: [PATCH 72/80] uclibc: fix type of PRIO_PROCESS and friends (backport ) (cherry picked from commit 24952f3f2be18aed6c98a765e3718a19dcc10097) --- src/unix/linux_like/linux/uclibc/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/unix/linux_like/linux/uclibc/mod.rs b/src/unix/linux_like/linux/uclibc/mod.rs index d8bb28e2cad2..ead968a1c65c 100644 --- a/src/unix/linux_like/linux/uclibc/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mod.rs @@ -265,9 +265,9 @@ pub const IPV6_LEAVE_GROUP: c_int = 21; // Different than Gnu. pub const FILENAME_MAX: c_uint = 4095; -pub const PRIO_PROCESS: c_int = 0; -pub const PRIO_PGRP: c_int = 1; -pub const PRIO_USER: c_int = 2; +pub const PRIO_PROCESS: crate::__priority_which_t = 0; +pub const PRIO_PGRP: crate::__priority_which_t = 1; +pub const PRIO_USER: crate::__priority_which_t = 2; pub const SOMAXCONN: c_int = 128; From 077e706c684c2a30be62627d5656c4a9fe463413 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 28 Apr 2026 20:47:00 +0900 Subject: [PATCH 73/80] chore: Use zizmor to harden GHA usage (backport ) (cherry picked from commit 413bb61f08f005112e67957337db95db0fb01113) --- .github/workflows/ci.yaml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 75b2bc1508a9..e90c7b48acfb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -364,6 +364,21 @@ jobs: - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 - run: cargo doc --workspace --no-deps + zizmor: + name: Zizmor (Static analysis for GitHub Actions) + runs-on: ubuntu-24.04 + permissions: + security-events: write + timeout-minutes: 10 + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Run zizmor + uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3 + # One job that "summarizes" the success state of this pipeline. This can then be added to branch # protection, rather than having to add each job separately. success: @@ -377,7 +392,8 @@ jobs: - verify_build - docs - clippy - # Github branch protection is exceedingly silly and treats "jobs skipped because a dependency + - zizmor + # GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency # failed" as success. So we have to do some contortions to ensure the job fails if any of its # dependencies fails. if: always() # make sure this is never "skipped" From 77ebaed4dd33d4286d37f42e2970660a5b21ebe9 Mon Sep 17 00:00:00 2001 From: mansiverma897993 Date: Sun, 21 Jun 2026 09:56:42 +0530 Subject: [PATCH 74/80] freebsd: Add SOL_LOCAL Add SOL_LOCAL constant (value 0) to FreeBSD to match Apple/macOS targets and allow setting local socket options. (backport ) (cherry picked from commit 561485940e0a8a6ebe0e5d6213f2950c02d2d3fa) --- libc-test/semver/freebsd.txt | 1 + src/unix/bsd/freebsdlike/freebsd/mod.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index 3a06645cfc96..866c29160a0e 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -1457,6 +1457,7 @@ SOCK_MAXADDRLEN SOCK_NONBLOCK SOCK_RAW SOCK_RDM +SOL_LOCAL SOMAXCONN SO_ACCEPTFILTER SO_BINTIME diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index aea89235a52d..d70caabf5687 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -4274,6 +4274,8 @@ pub const KCMP_FILES: c_int = 102; pub const KCMP_SIGHAND: c_int = 103; pub const KCMP_VM: c_int = 104; +pub const SOL_LOCAL: c_int = 0; + pub const fn MAP_ALIGNED(a: c_int) -> c_int { a << 24 } From 2136794530bf13a82ec64c30fb689bc696e6b353 Mon Sep 17 00:00:00 2001 From: dybucc <149513579+dybucc@users.noreply.github.com> Date: Thu, 4 Jun 2026 19:23:53 +0200 Subject: [PATCH 75/80] linux(uclibc): move definition of `time_t` A recent patch [1] overhauled the `uclibc` module to add support for "toggling" 64-bit `time_t`. That patch, though, was centered around supported 32-bit arm targets. This patch extends that to all platforms whose target environment matches `uclibc`. This option is mahine word-independent. [1]: https://github.com/rust-lang/libc/commit/2549bd4a98192194ff655d0184cb7adb6152427f (backport ) (cherry picked from commit 60297178ac454f730335325c2fa6d37fe93886e2) --- src/unix/linux_like/linux/uclibc/arm/mod.rs | 11 ----------- src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs | 2 -- src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs | 2 -- src/unix/linux_like/linux/uclibc/mod.rs | 11 +++++++++++ src/unix/linux_like/linux/uclibc/x86_64/mod.rs | 2 -- 5 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/unix/linux_like/linux/uclibc/arm/mod.rs b/src/unix/linux_like/linux/uclibc/arm/mod.rs index 1c09954cc834..56e37a113410 100644 --- a/src/unix/linux_like/linux/uclibc/arm/mod.rs +++ b/src/unix/linux_like/linux/uclibc/arm/mod.rs @@ -3,17 +3,6 @@ use crate::prelude::*; pub type wchar_t = c_uint; -cfg_if! { - // Set cfg(libc_unstable_uclibc_time64) in rustflags if your uclibc has 64-bit time - if #[cfg(linux_time_bits64)] { - pub type time_t = c_longlong; - pub type suseconds_t = c_longlong; - } else { - pub type time_t = c_long; - pub type suseconds_t = c_long; - } -} - pub type clock_t = c_long; pub type fsblkcnt_t = c_ulong; pub type fsfilcnt_t = c_ulong; diff --git a/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs b/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs index 93ed7ab21333..92a3d218eb0d 100644 --- a/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs @@ -2,8 +2,6 @@ use crate::off64_t; use crate::prelude::*; pub type clock_t = i32; -pub type time_t = i32; -pub type suseconds_t = i32; pub type wchar_t = i32; pub type off_t = i32; pub type ino_t = u32; diff --git a/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs b/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs index 4495181400d4..a6a63a33a93b 100644 --- a/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs @@ -8,8 +8,6 @@ pub type fsfilcnt_t = c_ulong; pub type ino_t = u64; pub type nlink_t = u64; pub type off_t = i64; -pub type suseconds_t = i64; -pub type time_t = i64; pub type wchar_t = i32; s! { diff --git a/src/unix/linux_like/linux/uclibc/mod.rs b/src/unix/linux_like/linux/uclibc/mod.rs index ead968a1c65c..6c3d8013f917 100644 --- a/src/unix/linux_like/linux/uclibc/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mod.rs @@ -12,6 +12,17 @@ pub type rlim_t = c_ulong; pub type __rlimit_resource_t = c_ulong; pub type __priority_which_t = c_uint; +cfg_if! { + // Set `--cfg=libc_unstable_uclibc_time64` in RUSTFLAGS if your uClibc has 64-bit `time_t`. + if #[cfg(linux_time_bits64)] { + pub type time_t = i64; + pub type suseconds_t = i64; + } else { + pub type time_t = c_long; + pub type suseconds_t = c_long; + } +} + cfg_if! { if #[cfg(doc)] { // Used in `linux::arch` to define ioctl constants. diff --git a/src/unix/linux_like/linux/uclibc/x86_64/mod.rs b/src/unix/linux_like/linux/uclibc/x86_64/mod.rs index 30e6772388d1..09ffffd2954b 100644 --- a/src/unix/linux_like/linux/uclibc/x86_64/mod.rs +++ b/src/unix/linux_like/linux/uclibc/x86_64/mod.rs @@ -14,8 +14,6 @@ pub type nlink_t = c_uint; pub type off_t = c_long; // [uClibc docs] Note stat64 has the same shape as stat for x86-64. pub type stat64 = stat; -pub type suseconds_t = c_long; -pub type time_t = c_int; pub type wchar_t = c_int; pub type pthread_t = c_ulong; From 96c5884a44fe7e4c5b312e6952653d83d49eddef Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Mon, 22 Jun 2026 02:00:52 -0400 Subject: [PATCH 76/80] test: Don't `deny(warnings)` We set `-Dwarnings` in CI which will check this. There is no need to prevent building locally with incomplete changes. (backport ) (cherry picked from commit 63001363035fc2ed974f82689416c85e3725ebab) --- libc-test/build.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index 0bdd5176d180..30ac2a1155c2 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -1,4 +1,3 @@ -#![deny(warnings)] #![allow(clippy::match_like_matches_macro)] use std::fs::File; From 67c87e3fef1f7053453118db902ae274151bdaf4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 14:03:45 +0000 Subject: [PATCH 77/80] build(deps): bump taiki-e/install-action from 2.81.10 to 2.82.2 Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.81.10 to 2.82.2. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/7a79fe8c3a13344501c80d99cae481c1c9085912...9e1e5806d4a4822de933115878265be9aaa786d9) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-version: 2.82.2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit 851e9f7473fbdfc74aced62bed461a280f559cb3) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e90c7b48acfb..9b295bf794c1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -81,7 +81,7 @@ jobs: run: ./ci/install-rust.sh - name: Install semver-checks - uses: taiki-e/install-action@7a79fe8c3a13344501c80d99cae481c1c9085912 # v2.81.10 + uses: taiki-e/install-action@9e1e5806d4a4822de933115878265be9aaa786d9 # v2.82.2 if: matrix.toolchain == 'stable' with: tool: cargo-semver-checks From 66675de8aeebf3cf4d47a8d5be424b59f7099ddb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 14:03:51 +0000 Subject: [PATCH 78/80] build(deps): bump actions/checkout from 6.0.2 to 7.0.0 Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 7.0.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v6.0.2...9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit 8e99b033dc1f86ef14a76050834b6dcd57c31b12) --- .github/workflows/ci.yaml | 16 ++++++++-------- .github/workflows/publish_0.2.yml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9b295bf794c1..9eb5bcc03f89 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-26.04 timeout-minutes: 10 steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Setup Rust toolchain @@ -43,7 +43,7 @@ jobs: runs-on: ${{ matrix.os }} timeout-minutes: 10 steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - run: rustup update stable --no-self-update @@ -74,7 +74,7 @@ jobs: env: TOOLCHAIN: ${{ matrix.toolchain }} steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Setup Rust toolchain @@ -139,7 +139,7 @@ jobs: env: TARGET: ${{ matrix.target }} steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Setup Rust toolchain @@ -237,7 +237,7 @@ jobs: env: TARGET: ${{ matrix.target }} steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Setup Rust toolchain @@ -288,7 +288,7 @@ jobs: - target: x86_64-unknown-netbsd timeout-minutes: 25 steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Test on FreeBSD @@ -356,7 +356,7 @@ jobs: runs-on: ubuntu-26.04 timeout-minutes: 10 steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Install Rust @@ -372,7 +372,7 @@ jobs: timeout-minutes: 10 steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false diff --git a/.github/workflows/publish_0.2.yml b/.github/workflows/publish_0.2.yml index 2edc7c207930..32182761ee7b 100644 --- a/.github/workflows/publish_0.2.yml +++ b/.github/workflows/publish_0.2.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: fetch-depth: 0 persist-credentials: false From 60e70edc9c900836f37d77ffa7ad5a6d1e55dbc7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 14:03:56 +0000 Subject: [PATCH 79/80] build(deps): bump zizmorcore/zizmor-action from 0.5.3 to 0.5.7 Bumps [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) from 0.5.3 to 0.5.7. - [Release notes](https://github.com/zizmorcore/zizmor-action/releases) - [Commits](https://github.com/zizmorcore/zizmor-action/compare/b1d7e1fb5de872772f31590499237e7cce841e8e...192e21d79ab29983730a13d1382995c2307fbcaa) --- updated-dependencies: - dependency-name: zizmorcore/zizmor-action dependency-version: 0.5.7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit c16a5a8ec79bb1639f7117ee53a39b30089f0f3b) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9eb5bcc03f89..fc422f005f5e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -377,7 +377,7 @@ jobs: persist-credentials: false - name: Run zizmor - uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3 + uses: zizmorcore/zizmor-action@192e21d79ab29983730a13d1382995c2307fbcaa # v0.5.7 # One job that "summarizes" the success state of this pipeline. This can then be added to branch # protection, rather than having to add each job separately. From f538e7345e371524c66e91826f8368f4ee72eb26 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 14:03:59 +0000 Subject: [PATCH 80/80] build(deps): bump vmactions/freebsd-vm from 1.4.6 to 1.4.8 Bumps [vmactions/freebsd-vm](https://github.com/vmactions/freebsd-vm) from 1.4.6 to 1.4.8. - [Release notes](https://github.com/vmactions/freebsd-vm/releases) - [Commits](https://github.com/vmactions/freebsd-vm/compare/a6de9343ef5747433d9c25784c90e84998b9d69a...b84ab5559b5a1bb4b8ee2737d2506a16e1737636) --- updated-dependencies: - dependency-name: vmactions/freebsd-vm dependency-version: 1.4.8 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (backport ) (cherry picked from commit daaf25f0d939946ce1955d964101a410c4fab3e2) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fc422f005f5e..66560f5b320f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -292,7 +292,7 @@ jobs: with: persist-credentials: false - name: Test on FreeBSD - uses: vmactions/freebsd-vm@a6de9343ef5747433d9c25784c90e84998b9d69a # v1.4.6 + uses: vmactions/freebsd-vm@b84ab5559b5a1bb4b8ee2737d2506a16e1737636 # v1.4.8 if: contains(matrix.target, 'freebsd') with: release: ${{ matrix.release }}