From 485005d08a09f53409d3f82472214e4ee233d015 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 9 Oct 2025 21:37:37 +0900 Subject: [PATCH 01/10] add script to cherry-pick --- cherry-pick-stable.sh | 150 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100755 cherry-pick-stable.sh diff --git a/cherry-pick-stable.sh b/cherry-pick-stable.sh new file mode 100755 index 0000000000000..c338be4f2ab22 --- /dev/null +++ b/cherry-pick-stable.sh @@ -0,0 +1,150 @@ +#!/bin/bash + +set -e + +# Parse arguments +DRY_RUN=false +while [[ $# -gt 0 ]]; do + case $1 in + --dry-run|-d) + DRY_RUN=true + shift + ;; + --help|-h) + echo "Usage: $0 [OPTIONS]" + echo "" + echo "Cherry-pick commits from PRs labeled 'stable-nominated' to current branch" + echo "" + echo "Options:" + echo " -d, --dry-run Show what would be done without making changes" + echo " -h, --help Show this help message" + exit 0 + ;; + *) + echo "Unknown option: $1" + echo "Use --help for usage information" + exit 1 + ;; + esac +done + +if [ "$DRY_RUN" = true ]; then + echo "[DRY RUN MODE - No changes will be made]" + echo "" +fi + +current_branch=$(git branch --show-current) +echo "Current branch: $current_branch" +echo "Fetching PRs with 'stable-nominated' label..." +echo "" + +# Get PRs with stable-nominated label that are merged +# Sort by merge date (oldest first) to preserve merge order and avoid conflicts +# Format: PR number, title, merge commit SHA +prs=$(gh pr list --state merged --label stable-nominated --json number,title,mergeCommit,mergedAt --jq 'sort_by(.mergedAt) | .[] | "\(.number)|\(.title)|\(.mergeCommit.oid)"') + +if [ -z "$prs" ]; then + echo "No PRs found with 'stable-nominated' label." + exit 0 +fi + +# Arrays to track results +declare -a successful +declare -a failed +declare -a skipped + +echo "Found PRs to cherry-pick:" +echo "" + +# Process each PR +while IFS='|' read -r pr_number title commit_sha; do + echo "----------------------------------------" + echo "PR #${pr_number}: ${title}" + echo "Commit: ${commit_sha}" + + # Check if commit already exists in current branch + if git branch --contains "$commit_sha" 2>/dev/null | grep -q "^\*"; then + echo "⏭ Already cherry-picked, skipping" + skipped+=("PR #${pr_number}: ${title}") + echo "" + continue + fi + + # Cherry-pick with -xe flags as specified + if [ "$DRY_RUN" = true ]; then + echo "Would cherry-pick with: git cherry-pick -xe $commit_sha" + echo "Would add backport note: (backport https://github.com/rust-lang/libc/pull/$pr_number)" + successful+=("PR #${pr_number}: ${title} (${commit_sha:0:8})") + else + if git cherry-pick -xe "$commit_sha" 2>&1; then + # Add backport note before the cherry-pick note as per CONTRIBUTING.md + current_msg=$(git log -1 --format=%B) + backport_line="(backport https://github.com/rust-lang/libc/pull/$pr_number)" + + # Insert backport line before "(cherry picked from commit" line + new_msg=$(echo "$current_msg" | sed "/^(cherry picked from commit/i\\ +$backport_line\\ +") + + # Amend the commit with the new message + git commit --amend -m "$new_msg" + + echo "✓ Successfully cherry-picked with backport note" + successful+=("PR #${pr_number}: ${title} (${commit_sha:0:8})") + else + echo "✗ Failed to cherry-pick" + failed+=("PR #${pr_number}: ${title} (${commit_sha:0:8})") + # Abort the failed cherry-pick + git cherry-pick --abort 2>/dev/null || true + fi + fi + echo "" +done <<< "$prs" + +# Print summary +echo "========================================" +if [ "$DRY_RUN" = true ]; then + echo "SUMMARY (DRY RUN)" +else + echo "SUMMARY" +fi +echo "========================================" +echo "" + +if [ ${#successful[@]} -gt 0 ]; then + if [ "$DRY_RUN" = true ]; then + echo "Would cherry-pick (${#successful[@]}):" + else + echo "Successfully cherry-picked (${#successful[@]}):" + fi + for item in "${successful[@]}"; do + echo " ✓ $item" + done + echo "" +fi + +if [ ${#skipped[@]} -gt 0 ]; then + echo "Skipped (${#skipped[@]}):" + for item in "${skipped[@]}"; do + echo " ⏭ $item" + done + echo "" +fi + +if [ ${#failed[@]} -gt 0 ]; then + echo "Failed (${#failed[@]}):" + for item in "${failed[@]}"; do + echo " ✗ $item" + done + echo "" + if [ "$DRY_RUN" = false ]; then + echo "Please resolve conflicts manually and re-run if needed." + fi + exit 1 +fi + +if [ "$DRY_RUN" = true ]; then + echo "Dry run complete! Run without --dry-run to apply changes." +else + echo "All done!" +fi From bb668003332c7b276fdc0512cc79700087ef4ff1 Mon Sep 17 00:00:00 2001 From: joboet Date: Tue, 23 Sep 2025 20:16:26 +0200 Subject: [PATCH 02/10] Windows: add `wcsnlen` (backport https://github.com/rust-lang/libc/pull/4721) (cherry picked from commit 11f939ad4d7154755d7e30ded09beeb8a4e6780a) --- libc-test/semver/windows.txt | 1 + src/windows/mod.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/libc-test/semver/windows.txt b/libc-test/semver/windows.txt index a91794bed52ef..9e39684f07558 100644 --- a/libc-test/semver/windows.txt +++ b/libc-test/semver/windows.txt @@ -348,6 +348,7 @@ utimbuf wchar_t wchmod wcslen +wcsnlen wcstombs wexecl wexecle diff --git a/src/windows/mod.rs b/src/windows/mod.rs index 33ff35ef20a4b..2f35af84c7493 100644 --- a/src/windows/mod.rs +++ b/src/windows/mod.rs @@ -379,6 +379,7 @@ extern "C" { pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; pub fn wcslen(buf: *const wchar_t) -> size_t; + pub fn wcsnlen(str: *const wchar_t, numberOfElements: size_t) -> size_t; pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> size_t; pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; From 64c3693fd56405ee291661fc7ad7fa21261ec7b0 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 30 Sep 2025 16:54:05 -0700 Subject: [PATCH 03/10] wasip2: Invert conditional to include p2 APIs This commit switches `cfg(target_feature = "p2")` to instead using `cfg(not(target_feature = "p1"))` to be more future-proof of new Rust targets such as `wasm32-wasip3`. All future targets will support the same set of functionality in `wasm32-wasip2`, so this should be valid for future targets. (backport https://github.com/rust-lang/libc/pull/4733) (cherry picked from commit d2fb5b062d40856cc944df3160d23af506f28914) --- 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 823b87aa69efa..bb3b729548780 100644 --- a/src/wasi/mod.rs +++ b/src/wasi/mod.rs @@ -846,7 +846,7 @@ extern "C" { } cfg_if! { - if #[cfg(target_env = "p2")] { + if #[cfg(not(target_env = "p1"))] { mod p2; pub use self::p2::*; } From 8ea690f4ae5aed1c019a4bc18cc7df978c9ea15c Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sun, 28 Sep 2025 15:37:11 +0700 Subject: [PATCH 04/10] redox: more sysconf constants (backport https://github.com/rust-lang/libc/pull/4728) (cherry picked from commit 4d939b0d26d97f8794f14bdf2638e39bf19d4af1) --- libc-test/semver/redox.txt | 19 +++++++++++++++++++ src/unix/redox/mod.rs | 9 +++++++++ 2 files changed, 28 insertions(+) diff --git a/libc-test/semver/redox.txt b/libc-test/semver/redox.txt index eeba3a35a54ce..b7aaa5706d626 100644 --- a/libc-test/semver/redox.txt +++ b/libc-test/semver/redox.txt @@ -251,8 +251,27 @@ _PC_SOCK_MAXBUF _PC_SYMLINK_MAX _PC_SYNC_IO _POSIX_VDISABLE +_SC_ARG_MAX +_SC_CHILD_MAX +_SC_CLK_TCK +_SC_GETGR_R_SIZE_MAX +_SC_GETPW_R_SIZE_MAX +_SC_HOST_NAME_MAX _SC_LOGIN_NAME_MAX +_SC_NGROUPS_MAX +_SC_NPROCESSORS_CONF +_SC_NPROCESSORS_ONLN +_SC_OPEN_MAX +_SC_PAGESIZE +_SC_PAGE_SIZE +_SC_REALTIME_SIGNALS _SC_RE_DUP_MAX +_SC_SIGQUEUE_MAX +_SC_STREAM_MAX +_SC_SYMLOOP_MAX +_SC_TTY_NAME_MAX +_SC_TZNAME_MAX +_SC_VERSION __WALL __WCLONE __WNOTHREAD diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs index 4a8b2ae3c435d..50bdaf4d4f06b 100644 --- a/src/unix/redox/mod.rs +++ b/src/unix/redox/mod.rs @@ -1002,13 +1002,22 @@ pub const _SC_PAGESIZE: c_int = 30; pub const _SC_PAGE_SIZE: c_int = 30; // ... pub const _SC_RE_DUP_MAX: c_int = 44; + +pub const _SC_NPROCESSORS_CONF: c_int = 57; +pub const _SC_NPROCESSORS_ONLN: c_int = 58; + // ... +pub const _SC_GETGR_R_SIZE_MAX: c_int = 69; +pub const _SC_GETPW_R_SIZE_MAX: c_int = 70; pub const _SC_LOGIN_NAME_MAX: c_int = 71; pub const _SC_TTY_NAME_MAX: c_int = 72; // ... pub const _SC_SYMLOOP_MAX: c_int = 173; // ... pub const _SC_HOST_NAME_MAX: c_int = 180; +// ... +pub const _SC_SIGQUEUE_MAX: c_int = 190; +pub const _SC_REALTIME_SIGNALS: c_int = 191; // } POSIX.1 // confstr From 7f16874d5267f103ad8062bc2a376172b08a1f14 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 5 Oct 2025 20:38:30 +0200 Subject: [PATCH 05/10] Define _CS_PATH on the BSDs According to https://man.netbsd.org/confstr.3 _CS_PATH is obsoleted by sysctl (which has a USER_CS_PATH equivalent), but Linux doesn't have that. So the simplest thing for applications is to use _CS_PATH which is part of POSIX. Define, matching the header. We could maybe share this definition in src/unix/bsd/netbsdlike/mod.rs, but I saw that existing definitions are not shared either, so I'm not sure. $ grep src/unix/bsd/netbsdlike -e _PC_LINK_MAX src/unix/bsd/netbsdlike/netbsd/mod.rs:1599:11:pub const _PC_LINK_MAX: c_int = 1; src/unix/bsd/netbsdlike/openbsd/mod.rs:1193:11:pub const _PC_LINK_MAX: c_int = 1; Originally reported in https://github.com/fish-shell/fish-shell/issues/11892 (backport https://github.com/rust-lang/libc/pull/4738) (cherry picked from commit b1be455b7b280b8a827ba051da0175bae03d47dd) --- libc-test/semver/dragonfly.txt | 1 + libc-test/semver/freebsd.txt | 1 + libc-test/semver/netbsd.txt | 1 + libc-test/semver/openbsd.txt | 1 + src/unix/bsd/freebsdlike/dragonfly/mod.rs | 2 ++ src/unix/bsd/freebsdlike/mod.rs | 2 ++ src/unix/bsd/netbsdlike/netbsd/mod.rs | 2 ++ src/unix/bsd/netbsdlike/openbsd/mod.rs | 2 ++ 8 files changed, 12 insertions(+) diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt index 31c40372f195c..6c2a3a0d2e4e0 100644 --- a/libc-test/semver/dragonfly.txt +++ b/libc-test/semver/dragonfly.txt @@ -1128,6 +1128,7 @@ WTRAPPED XUCRED_VERSION YESEXPR YESSTR +_CS_PATH _IOFBF _IOLBF _IONBF diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index 74ea7dad541e0..cebe46464eebf 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -1724,6 +1724,7 @@ XUCRED_VERSION XU_NGROUPS YESEXPR YESSTR +_CS_PATH _IOFBF _IOLBF _IONBF diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt index 4280ec02de730..5821466cc8ddf 100644 --- a/libc-test/semver/netbsd.txt +++ b/libc-test/semver/netbsd.txt @@ -1127,6 +1127,7 @@ XATTR_CREATE XATTR_REPLACE YESEXPR YESSTR +_CS_PATH _IO _IOC _IOFBF diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt index c63c347723834..8c20b2456cd5a 100644 --- a/libc-test/semver/openbsd.txt +++ b/libc-test/semver/openbsd.txt @@ -921,6 +921,7 @@ WSTOPPED WTRAPPED YESEXPR YESSTR +_CS_PATH _IO _IOC _IOFBF diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index dbf18ebb64dc6..8720bf7fb3649 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -1359,6 +1359,8 @@ pub const VCHECKPT: usize = 19; pub const _PC_2_SYMLINKS: c_int = 22; pub const _PC_TIMESTAMP_RESOLUTION: c_int = 23; +pub const _CS_PATH: c_int = 1; + pub const _SC_V7_ILP32_OFF32: c_int = 122; pub const _SC_V7_ILP32_OFFBIG: c_int = 123; pub const _SC_V7_LP64_OFF64: c_int = 124; diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index 71765b1f3bbf8..4bf62033474f0 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -1197,6 +1197,8 @@ pub const _SC_RAW_SOCKETS: c_int = 119; pub const _SC_SYMLOOP_MAX: c_int = 120; pub const _SC_PHYS_PAGES: c_int = 121; +pub const _CS_PATH: c_int = 1; + pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = ptr::null_mut(); pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = ptr::null_mut(); pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = ptr::null_mut(); diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index fba5391e14c44..9f0831323af79 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -1613,6 +1613,8 @@ pub const _PC_2_SYMLINKS: c_int = 13; pub const _PC_ACL_EXTENDED: c_int = 14; pub const _PC_MIN_HOLE_SIZE: c_int = 15; +pub const _CS_PATH: c_int = 1; + pub const _SC_SYNCHRONIZED_IO: c_int = 31; pub const _SC_IOV_MAX: c_int = 32; pub const _SC_MAPPED_FILES: c_int = 33; diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index d2937bc16911b..f4aa34a7ca40d 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -1219,6 +1219,8 @@ pub const _PC_SYMLINK_MAX: c_int = 19; pub const _PC_SYNC_IO: c_int = 20; pub const _PC_TIMESTAMP_RESOLUTION: c_int = 21; +pub const _CS_PATH: c_int = 1; + pub const _SC_CLK_TCK: c_int = 3; pub const _SC_SEM_NSEMS_MAX: c_int = 31; pub const _SC_SEM_VALUE_MAX: c_int = 32; From 874d18eb6282e2d9f9bd1b55ac7cede1dbb98a3c Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Thu, 2 Oct 2025 15:03:07 -0600 Subject: [PATCH 06/10] Update semver tests (backport https://github.com/rust-lang/libc/pull/4736) (cherry picked from commit a7fe341fbf1f6eeadbd74b4be35fca9c85c55563) --- libc-test/semver/apple.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index 9301252dcc949..213f4d12d1507 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -1451,6 +1451,7 @@ TIOCEXCL TIOCEXT TIOCFLUSH TIOCGDRAINWAIT +TIOCGETA TIOCGETD TIOCGPGRP TIOCIXOFF @@ -1495,6 +1496,9 @@ TIOCSCONS TIOCSCTTY TIOCSDRAINWAIT TIOCSDTR +TIOCSETA +TIOCSETAF +TIOCSETAW TIOCSETD TIOCSIG TIOCSPGRP From 64250d550bade274af580e7ca6a0028c1bac4ed1 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Mon, 29 Sep 2025 06:10:17 -0400 Subject: [PATCH 07/10] openbsd add elf_aux_info (backport https://github.com/rust-lang/libc/pull/4729) (cherry picked from commit 70625420c22ec55e3de2bb065bd0c617b28b4084) --- libc-test/build.rs | 1 + libc-test/semver/openbsd.txt | 6 ++++++ src/unix/bsd/netbsdlike/openbsd/mod.rs | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index cc15451b760fb..ebc8f775c584d 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -553,6 +553,7 @@ fn test_openbsd(target: &str) { "sys/syscall.h", "sys/shm.h", "sys/param.h", + "sys/auxv.h", } cfg.rename_type(|ty| match ty { diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt index 8c20b2456cd5a..cfb234fdfa3d1 100644 --- a/libc-test/semver/openbsd.txt +++ b/libc-test/semver/openbsd.txt @@ -63,6 +63,11 @@ ATF_PUBL ATF_USETRAILERS AT_EACCESS AT_FDCWD +AT_HWCAP +AT_HWCAP2 +AT_IGNORE +AT_NULL +AT_PAGESZ AT_REMOVEDIR AT_SYMLINK_FOLLOW AT_SYMLINK_NOFOLLOW @@ -1095,6 +1100,7 @@ dl_phdr_info drand48 dup3 duplocale +elf_aux_info endgrent endpwent endservent diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index f4aa34a7ca40d..b28f4557f5218 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -1041,6 +1041,12 @@ pub const AT_SYMLINK_NOFOLLOW: c_int = 0x02; pub const AT_SYMLINK_FOLLOW: c_int = 0x04; pub const AT_REMOVEDIR: c_int = 0x08; +pub const AT_NULL: c_int = 0; +pub const AT_IGNORE: c_int = 1; +pub const AT_PAGESZ: c_int = 6; +pub const AT_HWCAP: c_int = 25; +pub const AT_HWCAP2: c_int = 26; + #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] pub const RLIM_NLIMITS: c_int = 9; @@ -2093,6 +2099,8 @@ extern "C" { pub fn fstatfs(fd: c_int, buf: *mut statfs) -> c_int; pub fn getmntinfo(mntbufp: *mut *mut crate::statfs, flags: c_int) -> c_int; pub fn getfsstat(buf: *mut statfs, bufsize: size_t, flags: c_int) -> c_int; + + pub fn elf_aux_info(aux: c_int, buf: *mut c_void, buflen: c_int) -> c_int; } #[link(name = "execinfo")] From c022c400ab129029f5fa49728c9db9661f2e14ef Mon Sep 17 00:00:00 2001 From: Henry Chen Date: Mon, 29 Sep 2025 17:19:22 +0800 Subject: [PATCH 08/10] linux_like: add SIGEMT for mips* and sparc* (backport https://github.com/rust-lang/libc/pull/4730) (cherry picked from commit de7e184784a5e7fcacf9c6f90b5cf6331c44cbbd) --- libc-test/semver/linux-mips.txt | 1 + libc-test/semver/linux-sparc64.txt | 1 + src/unix/linux_like/linux/gnu/b32/mips/mod.rs | 1 + src/unix/linux_like/linux/gnu/b32/sparc/mod.rs | 1 + src/unix/linux_like/linux/gnu/b64/mips64/mod.rs | 1 + src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs | 1 + src/unix/linux_like/linux/musl/b32/mips/mod.rs | 1 + src/unix/linux_like/linux/musl/b64/mips64.rs | 1 + src/unix/linux_like/linux/uclibc/mips/mod.rs | 1 + 9 files changed, 9 insertions(+) diff --git a/libc-test/semver/linux-mips.txt b/libc-test/semver/linux-mips.txt index 62da7368b5587..8d98f5604df0f 100644 --- a/libc-test/semver/linux-mips.txt +++ b/libc-test/semver/linux-mips.txt @@ -9,6 +9,7 @@ PTRACE_GETREGS PTRACE_SETFPREGS PTRACE_SETFPXREGS PTRACE_SETREGS +SIGEMT SO_PRIORITY SO_PROTOCOL SYS__sysctl diff --git a/libc-test/semver/linux-sparc64.txt b/libc-test/semver/linux-sparc64.txt index d6ae2f675f793..bb20c031feb5c 100644 --- a/libc-test/semver/linux-sparc64.txt +++ b/libc-test/semver/linux-sparc64.txt @@ -20,6 +20,7 @@ MAP_SYNC PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP +SIGEMT SYS__llseek SYS__newselect SYS__sysctl diff --git a/src/unix/linux_like/linux/gnu/b32/mips/mod.rs b/src/unix/linux_like/linux/gnu/b32/mips/mod.rs index db0505a2473de..3d2775cd800ae 100644 --- a/src/unix/linux_like/linux/gnu/b32/mips/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/mips/mod.rs @@ -768,6 +768,7 @@ pub const SOCK_DGRAM: c_int = 1; pub const SA_SIGINFO: c_int = 0x00000008; pub const SA_NOCLDWAIT: c_int = 0x00010000; +pub const SIGEMT: c_int = 7; pub const SIGCHLD: c_int = 18; pub const SIGBUS: c_int = 10; pub const SIGTTIN: c_int = 26; diff --git a/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs b/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs index f9d6a95ed036e..801f31e2c0e34 100644 --- a/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs @@ -316,6 +316,7 @@ pub const SOCK_DGRAM: c_int = 2; pub const SA_SIGINFO: c_int = 0x200; pub const SA_NOCLDWAIT: c_int = 0x100; +pub const SIGEMT: c_int = 7; pub const SIGTTIN: c_int = 21; pub const SIGTTOU: c_int = 22; pub const SIGXCPU: c_int = 24; diff --git a/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs b/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs index 56f30cd08a482..7f66330d9c7ed 100644 --- a/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs @@ -757,6 +757,7 @@ pub const SA_ONSTACK: c_int = 0x08000000; pub const SA_SIGINFO: c_int = 0x00000008; pub const SA_NOCLDWAIT: c_int = 0x00010000; +pub const SIGEMT: c_int = 7; pub const SIGCHLD: c_int = 18; pub const SIGBUS: c_int = 10; pub const SIGTTIN: c_int = 26; diff --git a/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs b/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs index c4203dc0b2da4..f18e53a99b466 100644 --- a/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs @@ -324,6 +324,7 @@ pub const SA_ONSTACK: c_int = 1; pub const SA_SIGINFO: c_int = 0x200; pub const SA_NOCLDWAIT: c_int = 0x100; +pub const SIGEMT: c_int = 7; pub const SIGTTIN: c_int = 21; pub const SIGTTOU: c_int = 22; pub const SIGXCPU: c_int = 24; diff --git a/src/unix/linux_like/linux/musl/b32/mips/mod.rs b/src/unix/linux_like/linux/musl/b32/mips/mod.rs index 4f29b27ad0a14..a623ff9a9f757 100644 --- a/src/unix/linux_like/linux/musl/b32/mips/mod.rs +++ b/src/unix/linux_like/linux/musl/b32/mips/mod.rs @@ -345,6 +345,7 @@ pub const SA_ONSTACK: c_int = 0x08000000; pub const SA_SIGINFO: c_int = 8; pub const SA_NOCLDWAIT: c_int = 0x10000; +pub const SIGEMT: c_int = 7; pub const SIGCHLD: c_int = 18; pub const SIGBUS: c_int = 10; pub const SIGTTIN: c_int = 26; diff --git a/src/unix/linux_like/linux/musl/b64/mips64.rs b/src/unix/linux_like/linux/musl/b64/mips64.rs index 57a460bd1c8f4..95dd37c889804 100644 --- a/src/unix/linux_like/linux/musl/b64/mips64.rs +++ b/src/unix/linux_like/linux/musl/b64/mips64.rs @@ -591,6 +591,7 @@ pub const SA_ONSTACK: c_int = 0x08000000; pub const SA_SIGINFO: c_int = 0x00000008; pub const SA_NOCLDWAIT: c_int = 0x00010000; +pub const SIGEMT: c_int = 7; pub const SIGCHLD: c_int = 18; pub const SIGBUS: c_int = 10; pub const SIGTTIN: c_int = 26; diff --git a/src/unix/linux_like/linux/uclibc/mips/mod.rs b/src/unix/linux_like/linux/uclibc/mips/mod.rs index 0ad572a95f888..8d17aa8e98e9a 100644 --- a/src/unix/linux_like/linux/uclibc/mips/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mips/mod.rs @@ -163,6 +163,7 @@ pub const SA_ONSTACK: c_uint = 0x08000000; pub const SA_SIGINFO: c_uint = 0x00000008; pub const SA_NOCLDWAIT: c_int = 0x00010000; +pub const SIGEMT: c_int = 7; pub const SIGCHLD: c_int = 18; pub const SIGBUS: c_int = 10; pub const SIGTTIN: c_int = 26; From c0b86a45715c5f1f2056a1e439f3f53a255df4f3 Mon Sep 17 00:00:00 2001 From: joboet Date: Tue, 23 Sep 2025 15:51:45 +0200 Subject: [PATCH 09/10] add `pthread_cond_timedwait_relative_np` (backport ) (cherry picked from commit d2ece10681cdf854fc4509ca2de23ce16a3783ff) --- libc-test/semver/apple.txt | 1 + src/unix/bsd/apple/mod.rs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index 213f4d12d1507..1d340bd54929d 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -2202,6 +2202,7 @@ pthread_attr_setschedpolicy pthread_attr_setscope pthread_attr_setstackaddr pthread_cancel +pthread_cond_timedwait_relative_np pthread_condattr_getpshared pthread_condattr_setpshared pthread_cpu_number_np diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 1c6e5a8f000f7..57c4d442836e0 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -5380,6 +5380,11 @@ extern "C" { pub fn mach_host_self() -> mach_port_t; #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] pub fn mach_thread_self() -> mach_port_t; + pub fn pthread_cond_timedwait_relative_np( + cond: *mut pthread_cond_t, + lock: *mut pthread_mutex_t, + timeout: *const crate::timespec, + ) -> c_int; pub fn pthread_once( once_control: *mut crate::pthread_once_t, init_routine: Option, From 1d993bf5ae2973d58f04f614e4335c41b2fe86fa Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Thu, 2 Oct 2025 14:44:35 -0600 Subject: [PATCH 10/10] Add missing TIOCGETA/TIOCSETA constants for macOS - Add TIOCGETA (0x40487413) for getting termios state - Add TIOCSETA (0x80487414) for setting termios state immediately - Add TIOCSETAW (0x80487415) for draining output then setting - Add TIOCSETAF (0x80487416) for draining output, flushing input, then setting These constants are present in macOS system headers but were missing from the libc crate. Fixes issue #4735. (backport ) (cherry picked from commit 755613edadc9950133731358acc81002e4b5437e) --- src/unix/bsd/apple/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 57c4d442836e0..857508f794ad1 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -3341,6 +3341,10 @@ pub const TIOCDSIMICROCODE: c_uint = 0x20007455; pub const TIOCPTYGRANT: c_uint = 0x20007454; pub const TIOCPTYGNAME: c_uint = 0x40807453; pub const TIOCPTYUNLK: c_uint = 0x20007452; +pub const TIOCGETA: c_ulong = 0x40487413; +pub const TIOCSETA: c_ulong = 0x80487414; +pub const TIOCSETAW: c_ulong = 0x80487415; +pub const TIOCSETAF: c_ulong = 0x80487416; pub const BIOCGRSIG: c_ulong = 0x40044272; pub const BIOCSRSIG: c_ulong = 0x80044273;