Skip to content

Commit 65e762a

Browse files
committed
fix the size of posix_spawn{_file_actions_t,attr_t} on Linux
1 parent 70768a8 commit 65e762a

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/unix/linux_like/android/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ pub type Elf64_Xword = u64;
4848

4949
pub type eventfd_t = u64;
5050

51+
// these structs sit behind a heap allocation on Android
52+
pub type posix_spawn_file_actions_t = *mut ::c_void;
53+
pub type posix_spawnattr_t = *mut ::c_void;
54+
5155
s! {
5256
pub struct stack_t {
5357
pub ss_sp: *mut ::c_void,

src/unix/linux_like/linux/mod.rs

+20
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,26 @@ s! {
742742
pub salt: [::c_uchar; TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE],
743743
pub rec_seq: [::c_uchar; TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE],
744744
}
745+
746+
pub struct posix_spawn_file_actions_t {
747+
__allocated: ::c_int,
748+
__used: ::c_int,
749+
__actions: *mut ::c_int,
750+
__pad: [::c_int; 16],
751+
}
752+
753+
pub struct posix_spawnattr_t {
754+
__flags: ::c_short,
755+
__pgrp: ::pid_t,
756+
__sd: ::sigset_t,
757+
__ss: ::sigset_t,
758+
#[cfg(any(target_env = "musl", target_env = "ohos"))]
759+
__prio: ::c_int,
760+
#[cfg(not(any(target_env = "musl", target_env = "ohos")))]
761+
__sp: ::sched_param,
762+
__policy: ::c_int,
763+
__pad: [::c_int; 16],
764+
}
745765
}
746766

747767
s_no_extra_traits! {

0 commit comments

Comments
 (0)