1 pub type shmatt_t = ::c_ulong; 2 pub type msgqnum_t = ::c_ulong; 3 pub type msglen_t = ::c_ulong; 4 pub type regoff_t = ::c_int; 5 6 s! { 7 pub struct statvfs { // Different than GNU! 8 pub f_bsize: ::c_ulong, 9 pub f_frsize: ::c_ulong, 10 pub f_blocks: ::fsblkcnt_t, 11 pub f_bfree: ::fsblkcnt_t, 12 pub f_bavail: ::fsblkcnt_t, 13 pub f_files: ::fsfilcnt_t, 14 pub f_ffree: ::fsfilcnt_t, 15 pub f_favail: ::fsfilcnt_t, 16 #[cfg(target_endian = "little")] 17 pub f_fsid: ::c_ulong, 18 #[cfg(target_pointer_width = "32")] 19 __f_unused: ::c_int, 20 #[cfg(target_endian = "big")] 21 pub f_fsid: ::c_ulong, 22 pub f_flag: ::c_ulong, 23 pub f_namemax: ::c_ulong, 24 __f_spare: [::c_int; 6], 25 } 26 27 pub struct regex_t { 28 __buffer: *mut ::c_void, 29 __allocated: ::size_t, 30 __used: ::size_t, 31 __syntax: ::c_ulong, 32 __fastmap: *mut ::c_char, 33 __translate: *mut ::c_char, 34 __re_nsub: ::size_t, 35 __bitfield: u8, 36 } 37 } 38 39 pub const MCL_CURRENT: ::c_int = 0x0001; 40 pub const MCL_FUTURE: ::c_int = 0x0002; 41 42 pub const SIGEV_THREAD_ID: ::c_int = 4; 43 44 pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5; 45 pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff; 46 pub const AFS_SUPER_MAGIC: ::c_long = 0x5346414f; 47 pub const AUTOFS_SUPER_MAGIC: ::c_long = 0x0187; 48 pub const BINDERFS_SUPER_MAGIC: ::c_long = 0x6c6f6f70; 49 pub const BPF_FS_MAGIC: ::c_long = 0xcafe4a11; 50 pub const BTRFS_SUPER_MAGIC: ::c_long = 0x9123683e; 51 pub const CGROUP2_SUPER_MAGIC: ::c_long = 0x63677270; 52 pub const CGROUP_SUPER_MAGIC: ::c_long = 0x27e0eb; 53 pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245; 54 pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45; 55 pub const DEBUGFS_MAGIC: ::c_long = 0x64626720; 56 pub const DEVPTS_SUPER_MAGIC: ::c_long = 0x1cd1; 57 pub const ECRYPTFS_SUPER_MAGIC: ::c_long = 0xf15f; 58 pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53; 59 pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53; 60 pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53; 61 pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53; 62 pub const F2FS_SUPER_MAGIC: ::c_long = 0xf2f52010; 63 pub const FUTEXFS_SUPER_MAGIC: ::c_long = 0xbad1dea; 64 pub const HOSTFS_SUPER_MAGIC: ::c_long = 0x00c0ffee; 65 pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849; 66 pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6; 67 pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660; 68 pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6; 69 pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478; 70 pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468; 71 pub const MINIX3_SUPER_MAGIC: ::c_long = 0x4d5a; 72 pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f; 73 pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f; 74 pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44; 75 pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c; 76 pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969; 77 pub const NILFS_SUPER_MAGIC: ::c_long = 0x3434; 78 pub const OCFS2_SUPER_MAGIC: ::c_long = 0x7461636f; 79 pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1; 80 pub const OVERLAYFS_SUPER_MAGIC: ::c_long = 0x794c7630; 81 pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0; 82 pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f; 83 pub const QNX6_SUPER_MAGIC: ::c_long = 0x68191122; 84 pub const RDTGROUP_SUPER_MAGIC: ::c_long = 0x7655821; 85 pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973; 86 pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b; 87 pub const SYSFS_MAGIC: ::c_long = 0x62656572; 88 pub const TMPFS_MAGIC: ::c_long = 0x01021994; 89 pub const TRACEFS_MAGIC: ::c_long = 0x74726163; 90 pub const UDF_SUPER_MAGIC: ::c_long = 0x15013346; 91 pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2; 92 pub const XENFS_SUPER_MAGIC: ::c_long = 0xabba1974; 93 pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342; 94 95 pub const PTRACE_TRACEME: ::c_int = 0; 96 pub const PTRACE_PEEKTEXT: ::c_int = 1; 97 pub const PTRACE_PEEKDATA: ::c_int = 2; 98 pub const PTRACE_PEEKUSER: ::c_int = 3; 99 pub const PTRACE_POKETEXT: ::c_int = 4; 100 pub const PTRACE_POKEDATA: ::c_int = 5; 101 pub const PTRACE_POKEUSER: ::c_int = 6; 102 pub const PTRACE_CONT: ::c_int = 7; 103 pub const PTRACE_KILL: ::c_int = 8; 104 pub const PTRACE_SINGLESTEP: ::c_int = 9; 105 pub const PTRACE_GETREGS: ::c_int = 12; 106 pub const PTRACE_SETREGS: ::c_int = 13; 107 pub const PTRACE_GETFPREGS: ::c_int = 14; 108 pub const PTRACE_SETFPREGS: ::c_int = 15; 109 pub const PTRACE_ATTACH: ::c_int = 16; 110 pub const PTRACE_DETACH: ::c_int = 17; 111 pub const PTRACE_GETFPXREGS: ::c_int = 18; 112 pub const PTRACE_SETFPXREGS: ::c_int = 19; 113 pub const PTRACE_SYSCALL: ::c_int = 24; 114 pub const PTRACE_SETOPTIONS: ::c_int = 0x4200; 115 pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201; 116 pub const PTRACE_GETSIGINFO: ::c_int = 0x4202; 117 pub const PTRACE_SETSIGINFO: ::c_int = 0x4203; 118 pub const PTRACE_GETREGSET: ::c_int = 0x4204; 119 pub const PTRACE_SETREGSET: ::c_int = 0x4205; 120 pub const PTRACE_SEIZE: ::c_int = 0x4206; 121 pub const PTRACE_INTERRUPT: ::c_int = 0x4207; 122 pub const PTRACE_LISTEN: ::c_int = 0x4208; 123 pub const PTRACE_O_MASK: ::c_int = 0x000000ff; 124 125 pub const POSIX_FADV_DONTNEED: ::c_int = 4; 126 pub const POSIX_FADV_NOREUSE: ::c_int = 5; 127 128 pub const RLIMIT_CPU: ::c_int = 0; 129 pub const RLIMIT_FSIZE: ::c_int = 1; 130 pub const RLIMIT_DATA: ::c_int = 2; 131 pub const RLIMIT_STACK: ::c_int = 3; 132 pub const RLIMIT_CORE: ::c_int = 4; 133 pub const RLIMIT_LOCKS: ::c_int = 10; 134 pub const RLIMIT_SIGPENDING: ::c_int = 11; 135 pub const RLIMIT_MSGQUEUE: ::c_int = 12; 136 pub const RLIMIT_NICE: ::c_int = 13; 137 pub const RLIMIT_RTPRIO: ::c_int = 14; 138 139 // These are different than GNU! 140 pub const LC_CTYPE: ::c_int = 0; 141 pub const LC_NUMERIC: ::c_int = 1; 142 pub const LC_TIME: ::c_int = 3; 143 pub const LC_COLLATE: ::c_int = 4; 144 pub const LC_MONETARY: ::c_int = 2; 145 pub const LC_MESSAGES: ::c_int = 5; 146 pub const LC_ALL: ::c_int = 6; 147 // end different section 148 149 // MS_ flags for mount(2) 150 pub const MS_RMT_MASK: ::c_ulong = 151 ::MS_RDONLY | ::MS_SYNCHRONOUS | ::MS_MANDLOCK | ::MS_I_VERSION; 152 153 pub const ENOTSUP: ::c_int = EOPNOTSUPP; 154 155 pub const IPV6_JOIN_GROUP: ::c_int = 20; 156 pub const IPV6_LEAVE_GROUP: ::c_int = 21; 157 158 // These are different from GNU 159 pub const ABDAY_1: ::nl_item = 0x300; 160 pub const ABDAY_2: ::nl_item = 0x301; 161 pub const ABDAY_3: ::nl_item = 0x302; 162 pub const ABDAY_4: ::nl_item = 0x303; 163 pub const ABDAY_5: ::nl_item = 0x304; 164 pub const ABDAY_6: ::nl_item = 0x305; 165 pub const ABDAY_7: ::nl_item = 0x306; 166 pub const DAY_1: ::nl_item = 0x307; 167 pub const DAY_2: ::nl_item = 0x308; 168 pub const DAY_3: ::nl_item = 0x309; 169 pub const DAY_4: ::nl_item = 0x30A; 170 pub const DAY_5: ::nl_item = 0x30B; 171 pub const DAY_6: ::nl_item = 0x30C; 172 pub const DAY_7: ::nl_item = 0x30D; 173 pub const ABMON_1: ::nl_item = 0x30E; 174 pub const ABMON_2: ::nl_item = 0x30F; 175 pub const ABMON_3: ::nl_item = 0x310; 176 pub const ABMON_4: ::nl_item = 0x311; 177 pub const ABMON_5: ::nl_item = 0x312; 178 pub const ABMON_6: ::nl_item = 0x313; 179 pub const ABMON_7: ::nl_item = 0x314; 180 pub const ABMON_8: ::nl_item = 0x315; 181 pub const ABMON_9: ::nl_item = 0x316; 182 pub const ABMON_10: ::nl_item = 0x317; 183 pub const ABMON_11: ::nl_item = 0x318; 184 pub const ABMON_12: ::nl_item = 0x319; 185 pub const MON_1: ::nl_item = 0x31A; 186 pub const MON_2: ::nl_item = 0x31B; 187 pub const MON_3: ::nl_item = 0x31C; 188 pub const MON_4: ::nl_item = 0x31D; 189 pub const MON_5: ::nl_item = 0x31E; 190 pub const MON_6: ::nl_item = 0x31F; 191 pub const MON_7: ::nl_item = 0x320; 192 pub const MON_8: ::nl_item = 0x321; 193 pub const MON_9: ::nl_item = 0x322; 194 pub const MON_10: ::nl_item = 0x323; 195 pub const MON_11: ::nl_item = 0x324; 196 pub const MON_12: ::nl_item = 0x325; 197 pub const AM_STR: ::nl_item = 0x326; 198 pub const PM_STR: ::nl_item = 0x327; 199 pub const D_T_FMT: ::nl_item = 0x328; 200 pub const D_FMT: ::nl_item = 0x329; 201 pub const T_FMT: ::nl_item = 0x32A; 202 pub const T_FMT_AMPM: ::nl_item = 0x32B; 203 pub const ERA: ::nl_item = 0x32C; 204 pub const ERA_D_FMT: ::nl_item = 0x32E; 205 pub const ALT_DIGITS: ::nl_item = 0x32F; 206 pub const ERA_D_T_FMT: ::nl_item = 0x330; 207 pub const ERA_T_FMT: ::nl_item = 0x331; 208 pub const CODESET: ::nl_item = 10; 209 pub const CRNCYSTR: ::nl_item = 0x215; 210 pub const RADIXCHAR: ::nl_item = 0x100; 211 pub const THOUSEP: ::nl_item = 0x101; 212 pub const NOEXPR: ::nl_item = 0x501; 213 pub const YESSTR: ::nl_item = 0x502; 214 pub const NOSTR: ::nl_item = 0x503; 215 216 // Different than Gnu. 217 pub const FILENAME_MAX: ::c_uint = 4095; 218 219 pub const PRIO_PROCESS: ::c_int = 0; 220 pub const PRIO_PGRP: ::c_int = 1; 221 pub const PRIO_USER: ::c_int = 2; 222 223 pub const ST_RELATIME: ::c_ulong = 4096; 224 225 extern "C" { gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int226 pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; 227 pthread_rwlockattr_getkind_np( attr: *const ::pthread_rwlockattr_t, val: *mut ::c_int, ) -> ::c_int228 pub fn pthread_rwlockattr_getkind_np( 229 attr: *const ::pthread_rwlockattr_t, 230 val: *mut ::c_int, 231 ) -> ::c_int; pthread_rwlockattr_setkind_np( attr: *mut ::pthread_rwlockattr_t, val: ::c_int, ) -> ::c_int232 pub fn pthread_rwlockattr_setkind_np( 233 attr: *mut ::pthread_rwlockattr_t, 234 val: ::c_int, 235 ) -> ::c_int; 236 ptrace(request: ::c_uint, ...) -> ::c_long237 pub fn ptrace(request: ::c_uint, ...) -> ::c_long; 238 sendmmsg( sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, flags: ::c_int, ) -> ::c_int239 pub fn sendmmsg( 240 sockfd: ::c_int, 241 msgvec: *mut ::mmsghdr, 242 vlen: ::c_uint, 243 flags: ::c_int, 244 ) -> ::c_int; recvmmsg( sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, flags: ::c_int, timeout: *mut ::timespec, ) -> ::c_int245 pub fn recvmmsg( 246 sockfd: ::c_int, 247 msgvec: *mut ::mmsghdr, 248 vlen: ::c_uint, 249 flags: ::c_int, 250 timeout: *mut ::timespec, 251 ) -> ::c_int; 252 openpty( amaster: *mut ::c_int, aslave: *mut ::c_int, name: *mut ::c_char, termp: *mut termios, winp: *mut ::winsize, ) -> ::c_int253 pub fn openpty( 254 amaster: *mut ::c_int, 255 aslave: *mut ::c_int, 256 name: *mut ::c_char, 257 termp: *mut termios, 258 winp: *mut ::winsize, 259 ) -> ::c_int; forkpty( amaster: *mut ::c_int, name: *mut ::c_char, termp: *mut termios, winp: *mut ::winsize, ) -> ::pid_t260 pub fn forkpty( 261 amaster: *mut ::c_int, 262 name: *mut ::c_char, 263 termp: *mut termios, 264 winp: *mut ::winsize, 265 ) -> ::pid_t; 266 getnameinfo( sa: *const ::sockaddr, salen: ::socklen_t, host: *mut ::c_char, hostlen: ::socklen_t, serv: *mut ::c_char, sevlen: ::socklen_t, flags: ::c_int, ) -> ::c_int267 pub fn getnameinfo( 268 sa: *const ::sockaddr, 269 salen: ::socklen_t, 270 host: *mut ::c_char, 271 hostlen: ::socklen_t, 272 serv: *mut ::c_char, 273 sevlen: ::socklen_t, 274 flags: ::c_int, 275 ) -> ::c_int; 276 pwritev( fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off64_t, ) -> ::ssize_t277 pub fn pwritev( 278 fd: ::c_int, 279 iov: *const ::iovec, 280 iovcnt: ::c_int, 281 offset: ::off64_t, 282 ) -> ::ssize_t; preadv( fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off64_t, ) -> ::ssize_t283 pub fn preadv( 284 fd: ::c_int, 285 iov: *const ::iovec, 286 iovcnt: ::c_int, 287 offset: ::off64_t, 288 ) -> ::ssize_t; 289 } 290 291 cfg_if! { 292 if #[cfg(any(target_arch = "mips", target_arch = "mips64"))] { 293 mod mips; 294 pub use self::mips::*; 295 } else if #[cfg(target_arch = "x86_64")] { 296 mod x86_64; 297 pub use self::x86_64::*; 298 } else if #[cfg(target_arch = "arm")] { 299 mod arm; 300 pub use self::arm::*; 301 } else { 302 pub use unsupported_target; 303 } 304 } 305