1 //! 64-bit specific definitions for linux-like values 2 3 pub type ino_t = u64; 4 pub type off_t = i64; 5 pub type blkcnt_t = i64; 6 pub type shmatt_t = u64; 7 pub type msgqnum_t = u64; 8 pub type msglen_t = u64; 9 pub type fsblkcnt_t = u64; 10 pub type fsfilcnt_t = u64; 11 pub type rlim_t = u64; 12 cfg_if! { 13 if #[cfg(all(target_arch = "aarch64", target_pointer_width = "32"))] { 14 pub type clock_t = i32; 15 pub type time_t = i32; 16 pub type __fsword_t = i32; 17 } else { 18 pub type __fsword_t = i64; 19 pub type clock_t = i64; 20 pub type time_t = i64; 21 } 22 } 23 24 s! { 25 pub struct sigset_t { 26 #[cfg(target_pointer_width = "32")] 27 __val: [u32; 32], 28 #[cfg(target_pointer_width = "64")] 29 __val: [u64; 16], 30 } 31 32 pub struct sysinfo { 33 pub uptime: i64, 34 pub loads: [u64; 3], 35 pub totalram: u64, 36 pub freeram: u64, 37 pub sharedram: u64, 38 pub bufferram: u64, 39 pub totalswap: u64, 40 pub freeswap: u64, 41 pub procs: ::c_ushort, 42 pub pad: ::c_ushort, 43 pub totalhigh: u64, 44 pub freehigh: u64, 45 pub mem_unit: ::c_uint, 46 pub _f: [::c_char; 0], 47 } 48 49 pub struct msqid_ds { 50 pub msg_perm: ::ipc_perm, 51 pub msg_stime: ::time_t, 52 pub msg_rtime: ::time_t, 53 pub msg_ctime: ::time_t, 54 __msg_cbytes: u64, 55 pub msg_qnum: ::msgqnum_t, 56 pub msg_qbytes: ::msglen_t, 57 pub msg_lspid: ::pid_t, 58 pub msg_lrpid: ::pid_t, 59 __glibc_reserved4: u64, 60 __glibc_reserved5: u64, 61 } 62 63 } 64 65 pub const RLIM_INFINITY: ::rlim_t = !0; 66 pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; 67 68 pub const O_LARGEFILE: ::c_int = 0; 69 70 cfg_if! { 71 if #[cfg(target_arch = "aarch64")] { 72 mod aarch64; 73 pub use self::aarch64::*; 74 } else if #[cfg(any(target_arch = "powerpc64"))] { 75 mod powerpc64; 76 pub use self::powerpc64::*; 77 } else if #[cfg(any(target_arch = "sparc64"))] { 78 mod sparc64; 79 pub use self::sparc64::*; 80 } else if #[cfg(any(target_arch = "mips64"))] { 81 mod mips64; 82 pub use self::mips64::*; 83 } else if #[cfg(any(target_arch = "s390x"))] { 84 mod s390x; 85 pub use self::s390x::*; 86 } else if #[cfg(any(target_arch = "x86_64"))] { 87 mod x86_64; 88 pub use self::x86_64::*; 89 } else if #[cfg(any(target_arch = "riscv64"))] { 90 mod riscv64; 91 pub use self::riscv64::*; 92 } else { 93 // Unknown target_arch 94 } 95 } 96