From cbad5bef7ae9226102d36bff616b2f6388c3a2ef Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 14 Sep 2024 20:20:02 +0100 Subject: [PATCH 1/5] fcntl add F_TRANSFEREXTENTS for macos. [ref](https://newosxbook.com/src.jl?tree=xnu&file=/bsd/man/man2/fcntl.2) (backport ) (cherry picked from commit 2fcf54bcb327202f0e50374ef904faeb1aa4bfc3) --- libc-test/semver/apple.txt | 1 + src/unix/bsd/apple/mod.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index 69166efd65e81..11f26658c2a47 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -455,6 +455,7 @@ F_SPECULATIVE_READ F_TEST F_THAW_FS F_TLOCK +F_TRANSFEREXTENTS F_TRIM_ACTIVE_FILE F_ULOCK F_UNLCK diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index c204f1db507fe..804bd89b5c4e8 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -3618,6 +3618,7 @@ pub const F_PUNCHHOLE: ::c_int = 99; pub const F_TRIM_ACTIVE_FILE: ::c_int = 100; pub const F_SPECULATIVE_READ: ::c_int = 101; pub const F_GETPATH_NOFIRMLINK: ::c_int = 102; +pub const F_TRANSFEREXTENTS: ::c_int = 110; pub const F_ALLOCATECONTIG: ::c_uint = 0x02; pub const F_ALLOCATEALL: ::c_uint = 0x04; From af80ac49fd64b64009568270997f285b89864c0c Mon Sep 17 00:00:00 2001 From: David Carlier Date: Fri, 27 Sep 2024 22:01:43 +0000 Subject: [PATCH 2/5] arc4random api for haiku (backport ) (cherry picked from commit 8924123c42e5fe9232f524129fd4e0d6f239b1d2) --- libc-test/build.rs | 1 + src/unix/haiku/mod.rs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index fb779daecc123..dfa6185195dbc 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -4834,6 +4834,7 @@ fn test_haiku(target: &str) { "libutil.h", "link.h", "pty.h", + "stdlib.h", "stringlist.h", "sys/link_elf.h", } diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs index 4dc931cd047d9..3a226e6696405 100644 --- a/src/unix/haiku/mod.rs +++ b/src/unix/haiku/mod.rs @@ -2133,6 +2133,10 @@ extern "C" { >, data: *mut ::c_void, ) -> ::c_int; + + pub fn arc4random() -> u32; + pub fn arc4random_uniform(upper_bound: u32) -> u32; + pub fn arc4random_buf(buf: *mut ::c_void, n: ::size_t); } #[link(name = "gnu")] From c800e28d6c9d10149bd70c56554e6e5ca2b58416 Mon Sep 17 00:00:00 2001 From: Rain Date: Sat, 28 Sep 2024 18:48:08 -0700 Subject: [PATCH 3/5] [musl] add posix_spawn chdir functions Add `posix_spawn_file_actions_add[f]chdir_np`, as present in musl 1.1.24 and above ([reference]). [reference]: https://git.musl-libc.org/cgit/musl/commit/?id=74244e5b3ed4a61d99c5fc0967b69e5c9a753456 (backport ) (cherry picked from commit b68a15960f28d36f3d248978a910a9e3faf99682) --- libc-test/semver/linux-musl.txt | 2 ++ src/unix/linux_like/linux/musl/mod.rs | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt index e873cb21d0491..b775cec7182d9 100644 --- a/libc-test/semver/linux-musl.txt +++ b/libc-test/semver/linux-musl.txt @@ -80,6 +80,8 @@ getloadavg lio_listio ntptimeval open_wmemstream +posix_spawn_file_actions_addchdir_np +posix_spawn_file_actions_addfchdir_np preadv2 preadv64 prlimit diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs index 72bd335360b8e..14e1e6d3bfd0f 100644 --- a/src/unix/linux_like/linux/musl/mod.rs +++ b/src/unix/linux_like/linux/musl/mod.rs @@ -983,6 +983,17 @@ extern "C" { pub fn dirname(path: *mut ::c_char) -> *mut ::c_char; pub fn basename(path: *mut ::c_char) -> *mut ::c_char; + + // Added in `musl` 1.1.24 + pub fn posix_spawn_file_actions_addchdir_np( + actions: *mut ::posix_spawn_file_actions_t, + path: *const ::c_char, + ) -> ::c_int; + // Added in `musl` 1.1.24 + pub fn posix_spawn_file_actions_addfchdir_np( + actions: *mut ::posix_spawn_file_actions_t, + fd: ::c_int, + ) -> ::c_int; } // Alias to 64 to mimic glibc's LFS64 support From 9c32959f4b3293642664346b366cf29803210fad Mon Sep 17 00:00:00 2001 From: Jan Sommer Date: Tue, 15 Oct 2024 18:28:51 +0200 Subject: [PATCH 4/5] Add getentropy to RTEMS (backport ) (cherry picked from commit a4ef31b4334b658df8760faec51030559af6a109) --- src/unix/newlib/rtems/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/unix/newlib/rtems/mod.rs b/src/unix/newlib/rtems/mod.rs index 36f4820c92f4f..031754950e6c1 100644 --- a/src/unix/newlib/rtems/mod.rs +++ b/src/unix/newlib/rtems/mod.rs @@ -137,5 +137,7 @@ extern "C" { clock_id: ::clockid_t, ) -> ::c_int; + pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; + pub fn setgroups(ngroups: ::c_int, grouplist: *const ::gid_t) -> ::c_int; } From c185415e6a4e7c024f6cac7a704393a7d9489821 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Tue, 15 Oct 2024 12:35:21 -0600 Subject: [PATCH 5/5] Temporarily disable CI on FreeBSD 15 FreeBSD 15 is the unstable development release. Currently its GCE images available to Cirrus CI don't work because the solib version of libmd was just bumped, and the package builders haven't yet caught up. Issue #3967 (backport ) (cherry picked from commit 9b0ccb1014d847270be7721a059bc34d6e32161e) --- .cirrus.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 7ce3b932ba084..ff3b80f7f4fc1 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -7,9 +7,13 @@ task: - name: nightly freebsd-14 freebsd_instance: image: freebsd-14-0-release-amd64-ufs - - name: nightly freebsd-15 - freebsd_instance: - image_family: freebsd-15-0-snap + # Temporarily disable CI on FreeBSD 15.0-CURRENT until the libmd solib + # fallout is cleaned up. + # FIXME https://github.com/rust-lang/libc/issues/3967 + # https://github.com/rust-lang/libc/issues/3967 + #- name: nightly freebsd-15 + # freebsd_instance: + # image_family: freebsd-15-0-snap setup_script: - pkg install -y libnghttp2 curl - curl https://sh.rustup.rs -sSf --output rustup.sh