| 1 |
use crate::prelude::*; |
| 2 |
|
| 3 |
pub type regoff_t = c_long; |
| 4 |
|
| 5 |
s! { |
| 6 |
pub struct stack_t { |
| 7 |
pub ss_sp: *mut c_void, |
| 8 |
pub ss_flags: c_int, |
| 9 |
pub ss_size: size_t, |
| 10 |
} |
| 11 |
|
| 12 |
pub struct pthread_attr_t { |
| 13 |
__size: [u64; 7], |
| 14 |
} |
| 15 |
|
| 16 |
pub struct sigset_t { |
| 17 |
__val: [c_ulong; 16], |
| 18 |
} |
| 19 |
|
| 20 |
pub struct shmid_ds { |
| 21 |
pub shm_perm: crate::ipc_perm, |
| 22 |
pub shm_segsz: size_t, |
| 23 |
pub shm_atime: crate::time_t, |
| 24 |
pub shm_dtime: crate::time_t, |
| 25 |
pub shm_ctime: crate::time_t, |
| 26 |
pub shm_cpid: crate::pid_t, |
| 27 |
pub shm_lpid: crate::pid_t, |
| 28 |
pub shm_nattch: c_ulong, |
| 29 |
__pad1: c_ulong, |
| 30 |
__pad2: c_ulong, |
| 31 |
} |
| 32 |
|
| 33 |
pub struct msqid_ds { |
| 34 |
pub msg_perm: crate::ipc_perm, |
| 35 |
pub msg_stime: crate::time_t, |
| 36 |
pub msg_rtime: crate::time_t, |
| 37 |
pub msg_ctime: crate::time_t, |
| 38 |
pub __msg_cbytes: c_ulong, |
| 39 |
pub msg_qnum: crate::msgqnum_t, |
| 40 |
pub msg_qbytes: crate::msglen_t, |
| 41 |
pub msg_lspid: crate::pid_t, |
| 42 |
pub msg_lrpid: crate::pid_t, |
| 43 |
__pad1: c_ulong, |
| 44 |
__pad2: c_ulong, |
| 45 |
} |
| 46 |
|
| 47 |
pub struct msghdr { |
| 48 |
pub msg_name: *mut c_void, |
| 49 |
pub msg_namelen: crate::socklen_t, |
| 50 |
pub msg_iov: *mut crate::iovec, |
| 51 |
#[cfg(target_endian = "big")] |
| 52 |
__pad1: c_int, |
| 53 |
pub msg_iovlen: c_int, |
| 54 |
#[cfg(target_endian = "little")] |
| 55 |
__pad1: c_int, |
| 56 |
pub msg_control: *mut c_void, |
| 57 |
#[cfg(target_endian = "big")] |
| 58 |
__pad2: c_int, |
| 59 |
pub msg_controllen: crate::socklen_t, |
| 60 |
#[cfg(target_endian = "little")] |
| 61 |
__pad2: c_int, |
| 62 |
pub msg_flags: c_int, |
| 63 |
} |
| 64 |
|
| 65 |
pub struct cmsghdr { |
| 66 |
#[cfg(target_endian = "big")] |
| 67 |
pub __pad1: c_int, |
| 68 |
pub cmsg_len: crate::socklen_t, |
| 69 |
#[cfg(target_endian = "little")] |
| 70 |
pub __pad1: c_int, |
| 71 |
pub cmsg_level: c_int, |
| 72 |
pub cmsg_type: c_int, |
| 73 |
} |
| 74 |
|
| 75 |
pub struct sem_t { |
| 76 |
__val: [c_int; 8], |
| 77 |
} |
| 78 |
} |
| 79 |
|
| 80 |
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; |
| 81 |
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; |
| 82 |
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; |
| 83 |
|
| 84 |
extern "C" { |
| 85 |
pub fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t; |
| 86 |
} |
| 87 |
|
| 88 |
cfg_if! { |
| 89 |
if #[cfg(target_arch = "aarch64")] { |
| 90 |
mod aarch64; |
| 91 |
pub use self::aarch64::*; |
| 92 |
} else if #[cfg(target_arch = "mips64")] { |
| 93 |
mod mips64; |
| 94 |
pub use self::mips64::*; |
| 95 |
} else if #[cfg(any(target_arch = "powerpc64"))] { |
| 96 |
mod powerpc64; |
| 97 |
pub use self::powerpc64::*; |
| 98 |
} else if #[cfg(any(target_arch = "s390x"))] { |
| 99 |
mod s390x; |
| 100 |
pub use self::s390x::*; |
| 101 |
} else if #[cfg(any(target_arch = "x86_64"))] { |
| 102 |
mod x86_64; |
| 103 |
pub use self::x86_64::*; |
| 104 |
} else if #[cfg(any(target_arch = "riscv64"))] { |
| 105 |
mod riscv64; |
| 106 |
pub use self::riscv64::*; |
| 107 |
} else if #[cfg(any(target_arch = "loongarch64"))] { |
| 108 |
mod loongarch64; |
| 109 |
pub use self::loongarch64::*; |
| 110 |
} else if #[cfg(any(target_arch = "wasm32"))] { |
| 111 |
mod wasm32; |
| 112 |
pub use self::wasm32::*; |
| 113 |
} else { |
| 114 |
// Unknown target_arch |
| 115 |
} |
| 116 |
} |