From 7f42793075fd1d18f02d1072202d2515b0e3567f Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Tue, 7 May 2024 00:34:46 +0700 Subject: [PATCH] Readd posix_spawn{_file_actions_t,attr_t} on Android Fixes: https://github.com/rust-lang/libc/issues/3709 Fixes: https://github.com/rust-lang/libc/issues/3608 Fixes: https://github.com/rust-lang/libc/issues/3677 Co-authored-by: Jorge Aparicio [resolved conflict, update commit message - Trevor] (apply to `main`) (cherry picked from commit b2b2fd71f4cb866c2d3e4579a50a70aa460aab8e) Signed-off-by: Trevor Gross --- libc-test/build.rs | 5 +++++ src/unix/linux_like/android/mod.rs | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index f2c6c3ccddf5a..010f42fbf9904 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -1550,6 +1550,7 @@ fn test_android(target: &str) { "sched.h", "semaphore.h", "signal.h", + "spawn.h", "stddef.h", "stdint.h", "stdio.h", @@ -1709,6 +1710,10 @@ fn test_android(target: &str) { // FIXME: Somehow fails to test after removing cfg hacks: "__uint128" => true, + + // These are intended to be opaque + "posix_spawn_file_actions_t" => true, + "posix_spawnattr_t" => true, _ => false, } }); diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index cf8b98d7e62c1..79f06fdf1a33b 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -48,6 +48,10 @@ pub type Elf64_Xword = u64; pub type eventfd_t = u64; +// these structs sit behind a heap allocation on Android +pub type posix_spawn_file_actions_t = *mut ::c_void; +pub type posix_spawnattr_t = *mut ::c_void; + s! { pub struct stack_t { pub ss_sp: *mut ::c_void,