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