Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the size of posix_spawn_file_actions_t and posix_spawnattr_t on Linux #3609

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3299,6 +3299,7 @@ fn test_vxworks(target: &str) {

fn test_linux(target: &str) {
assert!(target.contains("linux"));
assert!(!target.contains("android"));

// target_env
let gnu = target.contains("gnu");
Expand Down
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
Loading