From b68a15960f28d36f3d248978a910a9e3faf99682 Mon Sep 17 00:00:00 2001 From: Rain Date: Sat, 28 Sep 2024 18:48:08 -0700 Subject: [PATCH] [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 --- 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 c8b5ddbd75c28..1b6efeccfa5b1 100644 --- a/libc-test/semver/linux-musl.txt +++ b/libc-test/semver/linux-musl.txt @@ -80,6 +80,8 @@ getutxline 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 a37da7d24c314..6bc9cc60d273d 100644 --- a/src/unix/linux_like/linux/musl/mod.rs +++ b/src/unix/linux_like/linux/musl/mod.rs @@ -968,6 +968,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; + pub fn getutxent() -> *mut utmpx; pub fn getutxid(ut: *const utmpx) -> *mut utmpx; pub fn getutxline(ut: *const utmpx) -> *mut utmpx;