Skip to content

Commit

Permalink
fix the size of posix_spawn{_file_actions_t,attr_t} on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
japaric committed May 8, 2024
1 parent 70768a8 commit 65e762a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/unix/linux_like/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
20 changes: 20 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,26 @@ s! {
pub salt: [::c_uchar; TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE],
pub rec_seq: [::c_uchar; TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE],
}

pub struct posix_spawn_file_actions_t {
__allocated: ::c_int,
__used: ::c_int,
__actions: *mut ::c_int,
__pad: [::c_int; 16],
}

pub struct posix_spawnattr_t {
__flags: ::c_short,
__pgrp: ::pid_t,
__sd: ::sigset_t,
__ss: ::sigset_t,
#[cfg(any(target_env = "musl", target_env = "ohos"))]
__prio: ::c_int,
#[cfg(not(any(target_env = "musl", target_env = "ohos")))]
__sp: ::sched_param,
__policy: ::c_int,
__pad: [::c_int; 16],
}
}

s_no_extra_traits! {
Expand Down

0 comments on commit 65e762a

Please sign in to comment.