Skip to content

Commit

Permalink
make ci/style.sh happy
Browse files Browse the repository at this point in the history
  • Loading branch information
japaric committed Mar 4, 2024
1 parent 3d74718 commit fb31f88
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 30 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 @@ -722,6 +722,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
30 changes: 0 additions & 30 deletions src/unix/linux_like/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,6 @@ pub type timer_t = *mut ::c_void;
pub type key_t = ::c_int;
pub type id_t = ::c_uint;

cfg_if! {
if #[cfg(target_os = "android")] {
// 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;
} else if #[cfg(not(target_os = "emscripten"))] {
s! {
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],
}
}
}
}

missing! {
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
Expand Down

0 comments on commit fb31f88

Please sign in to comment.