1 pub type c_long = i64; 2 pub type c_ulong = u64; 3 4 s! { 5 pub struct statfs64 { 6 pub f_type: ::c_ulong, 7 pub f_bsize: ::c_ulong, 8 pub f_blocks: ::fsblkcnt_t, 9 pub f_bfree: ::fsblkcnt_t, 10 pub f_bavail: ::fsblkcnt_t, 11 pub f_files: ::fsfilcnt_t, 12 pub f_ffree: ::fsfilcnt_t, 13 pub f_fsid: ::fsid_t, 14 pub f_namelen: ::c_ulong, 15 pub f_frsize: ::c_ulong, 16 pub f_flags: ::c_ulong, 17 pub f_spare: [::c_ulong; 4], 18 } 19 20 pub struct statvfs64 { 21 pub f_bsize: ::c_ulong, 22 pub f_frsize: ::c_ulong, 23 pub f_blocks: u64, 24 pub f_bfree: u64, 25 pub f_bavail: u64, 26 pub f_files: u64, 27 pub f_ffree: u64, 28 pub f_favail: u64, 29 pub f_fsid: ::c_ulong, 30 pub f_flag: ::c_ulong, 31 pub f_namemax: ::c_ulong, 32 __f_spare: [::c_int; 6], 33 } 34 35 pub struct stack_t { 36 pub ss_sp: *mut ::c_void, 37 pub ss_flags: ::c_int, 38 pub ss_size: ::size_t 39 } 40 41 pub struct pthread_attr_t { 42 __size: [u64; 7] 43 } 44 45 pub struct sigset_t { 46 __val: [::c_ulong; 16], 47 } 48 49 pub struct shmid_ds { 50 pub shm_perm: ::ipc_perm, 51 pub shm_segsz: ::size_t, 52 pub shm_atime: ::time_t, 53 pub shm_dtime: ::time_t, 54 pub shm_ctime: ::time_t, 55 pub shm_cpid: ::pid_t, 56 pub shm_lpid: ::pid_t, 57 pub shm_nattch: ::c_ulong, 58 __pad1: ::c_ulong, 59 __pad2: ::c_ulong, 60 } 61 62 pub struct msqid_ds { 63 pub msg_perm: ::ipc_perm, 64 pub msg_stime: ::time_t, 65 pub msg_rtime: ::time_t, 66 pub msg_ctime: ::time_t, 67 __msg_cbytes: ::c_ulong, 68 pub msg_qnum: ::msgqnum_t, 69 pub msg_qbytes: ::msglen_t, 70 pub msg_lspid: ::pid_t, 71 pub msg_lrpid: ::pid_t, 72 __pad1: ::c_ulong, 73 __pad2: ::c_ulong, 74 } 75 76 pub struct statfs { 77 pub f_type: ::c_ulong, 78 pub f_bsize: ::c_ulong, 79 pub f_blocks: ::fsblkcnt_t, 80 pub f_bfree: ::fsblkcnt_t, 81 pub f_bavail: ::fsblkcnt_t, 82 pub f_files: ::fsfilcnt_t, 83 pub f_ffree: ::fsfilcnt_t, 84 pub f_fsid: ::fsid_t, 85 pub f_namelen: ::c_ulong, 86 pub f_frsize: ::c_ulong, 87 pub f_flags: ::c_ulong, 88 pub f_spare: [::c_ulong; 4], 89 } 90 91 pub struct msghdr { 92 pub msg_name: *mut ::c_void, 93 pub msg_namelen: ::socklen_t, 94 pub msg_iov: *mut ::iovec, 95 #[cfg(target_endian = "big")] 96 __pad1: ::c_int, 97 pub msg_iovlen: ::c_int, 98 #[cfg(target_endian = "little")] 99 __pad1: ::c_int, 100 pub msg_control: *mut ::c_void, 101 #[cfg(target_endian = "big")] 102 __pad2: ::c_int, 103 pub msg_controllen: ::socklen_t, 104 #[cfg(target_endian = "little")] 105 __pad2: ::c_int, 106 pub msg_flags: ::c_int, 107 } 108 109 pub struct cmsghdr { 110 #[cfg(target_endian = "big")] 111 pub __pad1: ::c_int, 112 pub cmsg_len: ::socklen_t, 113 #[cfg(target_endian = "little")] 114 pub __pad1: ::c_int, 115 pub cmsg_level: ::c_int, 116 pub cmsg_type: ::c_int, 117 } 118 119 pub struct sem_t { 120 __val: [::c_int; 8], 121 } 122 123 pub struct siginfo_t { 124 pub si_signo: ::c_int, 125 pub si_errno: ::c_int, 126 pub si_code: ::c_int, 127 pub _pad: [::c_int; 29], 128 _align: [usize; 0], 129 } 130 131 pub struct termios2 { 132 pub c_iflag: ::tcflag_t, 133 pub c_oflag: ::tcflag_t, 134 pub c_cflag: ::tcflag_t, 135 pub c_lflag: ::tcflag_t, 136 pub c_line: ::cc_t, 137 pub c_cc: [::cc_t; 19], 138 pub c_ispeed: ::speed_t, 139 pub c_ospeed: ::speed_t, 140 } 141 } 142 143 pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; 144 pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; 145 146 pub const O_ASYNC: ::c_int = 0x2000; 147 148 pub const RLIMIT_RSS: ::c_int = 5; 149 pub const RLIMIT_NOFILE: ::c_int = 7; 150 pub const RLIMIT_AS: ::c_int = 9; 151 pub const RLIMIT_NPROC: ::c_int = 6; 152 pub const RLIMIT_MEMLOCK: ::c_int = 8; 153 154 pub const O_APPEND: ::c_int = 1024; 155 pub const O_CREAT: ::c_int = 64; 156 pub const O_EXCL: ::c_int = 128; 157 pub const O_NOCTTY: ::c_int = 256; 158 pub const O_NONBLOCK: ::c_int = 2048; 159 pub const O_SYNC: ::c_int = 1052672; 160 pub const O_RSYNC: ::c_int = 1052672; 161 pub const O_DSYNC: ::c_int = 4096; 162 163 pub const SOCK_NONBLOCK: ::c_int = 2048; 164 165 pub const MAP_ANON: ::c_int = 0x0020; 166 pub const MAP_GROWSDOWN: ::c_int = 0x0100; 167 pub const MAP_DENYWRITE: ::c_int = 0x0800; 168 pub const MAP_EXECUTABLE: ::c_int = 0x01000; 169 pub const MAP_LOCKED: ::c_int = 0x02000; 170 pub const MAP_NORESERVE: ::c_int = 0x04000; 171 pub const MAP_POPULATE: ::c_int = 0x08000; 172 pub const MAP_NONBLOCK: ::c_int = 0x010000; 173 pub const MAP_STACK: ::c_int = 0x020000; 174 175 pub const SOCK_STREAM: ::c_int = 1; 176 pub const SOCK_DGRAM: ::c_int = 2; 177 pub const SOCK_SEQPACKET: ::c_int = 5; 178 179 pub const SOL_SOCKET: ::c_int = 1; 180 181 pub const ENAMETOOLONG: ::c_int = 36; 182 pub const ENOLCK: ::c_int = 37; 183 pub const ENOSYS: ::c_int = 38; 184 pub const ENOTEMPTY: ::c_int = 39; 185 pub const ELOOP: ::c_int = 40; 186 pub const ENOMSG: ::c_int = 42; 187 pub const EIDRM: ::c_int = 43; 188 pub const ECHRNG: ::c_int = 44; 189 pub const EL2NSYNC: ::c_int = 45; 190 pub const EL3HLT: ::c_int = 46; 191 pub const EL3RST: ::c_int = 47; 192 pub const ELNRNG: ::c_int = 48; 193 pub const EUNATCH: ::c_int = 49; 194 pub const ENOCSI: ::c_int = 50; 195 pub const EL2HLT: ::c_int = 51; 196 pub const EBADE: ::c_int = 52; 197 pub const EBADR: ::c_int = 53; 198 pub const EXFULL: ::c_int = 54; 199 pub const ENOANO: ::c_int = 55; 200 pub const EBADRQC: ::c_int = 56; 201 pub const EBADSLT: ::c_int = 57; 202 pub const EMULTIHOP: ::c_int = 72; 203 pub const EBADMSG: ::c_int = 74; 204 pub const EOVERFLOW: ::c_int = 75; 205 pub const ENOTUNIQ: ::c_int = 76; 206 pub const EBADFD: ::c_int = 77; 207 pub const EREMCHG: ::c_int = 78; 208 pub const ELIBACC: ::c_int = 79; 209 pub const ELIBBAD: ::c_int = 80; 210 pub const ELIBSCN: ::c_int = 81; 211 pub const ELIBMAX: ::c_int = 82; 212 pub const ELIBEXEC: ::c_int = 83; 213 pub const EILSEQ: ::c_int = 84; 214 pub const ERESTART: ::c_int = 85; 215 pub const ESTRPIPE: ::c_int = 86; 216 pub const EUSERS: ::c_int = 87; 217 pub const ENOTSOCK: ::c_int = 88; 218 pub const EDESTADDRREQ: ::c_int = 89; 219 pub const EMSGSIZE: ::c_int = 90; 220 pub const EPROTOTYPE: ::c_int = 91; 221 pub const ENOPROTOOPT: ::c_int = 92; 222 pub const EPROTONOSUPPORT: ::c_int = 93; 223 pub const ESOCKTNOSUPPORT: ::c_int = 94; 224 pub const EOPNOTSUPP: ::c_int = 95; 225 pub const ENOTSUP: ::c_int = EOPNOTSUPP; 226 pub const EPFNOSUPPORT: ::c_int = 96; 227 pub const EAFNOSUPPORT: ::c_int = 97; 228 pub const EADDRINUSE: ::c_int = 98; 229 pub const EADDRNOTAVAIL: ::c_int = 99; 230 pub const ENETDOWN: ::c_int = 100; 231 pub const ENETUNREACH: ::c_int = 101; 232 pub const ENETRESET: ::c_int = 102; 233 pub const ECONNABORTED: ::c_int = 103; 234 pub const ECONNRESET: ::c_int = 104; 235 pub const ENOBUFS: ::c_int = 105; 236 pub const EISCONN: ::c_int = 106; 237 pub const ENOTCONN: ::c_int = 107; 238 pub const ESHUTDOWN: ::c_int = 108; 239 pub const ETOOMANYREFS: ::c_int = 109; 240 pub const ETIMEDOUT: ::c_int = 110; 241 pub const ECONNREFUSED: ::c_int = 111; 242 pub const EHOSTDOWN: ::c_int = 112; 243 pub const EHOSTUNREACH: ::c_int = 113; 244 pub const EALREADY: ::c_int = 114; 245 pub const EINPROGRESS: ::c_int = 115; 246 pub const ESTALE: ::c_int = 116; 247 pub const EUCLEAN: ::c_int = 117; 248 pub const ENOTNAM: ::c_int = 118; 249 pub const ENAVAIL: ::c_int = 119; 250 pub const EISNAM: ::c_int = 120; 251 pub const EREMOTEIO: ::c_int = 121; 252 pub const EDQUOT: ::c_int = 122; 253 pub const ENOMEDIUM: ::c_int = 123; 254 pub const EMEDIUMTYPE: ::c_int = 124; 255 pub const ECANCELED: ::c_int = 125; 256 pub const ENOKEY: ::c_int = 126; 257 pub const EKEYEXPIRED: ::c_int = 127; 258 pub const EKEYREVOKED: ::c_int = 128; 259 pub const EKEYREJECTED: ::c_int = 129; 260 pub const EOWNERDEAD: ::c_int = 130; 261 pub const ENOTRECOVERABLE: ::c_int = 131; 262 pub const ERFKILL: ::c_int = 132; 263 pub const EHWPOISON: ::c_int = 133; 264 265 pub const SO_REUSEADDR: ::c_int = 2; 266 pub const SO_TYPE: ::c_int = 3; 267 pub const SO_ERROR: ::c_int = 4; 268 pub const SO_DONTROUTE: ::c_int = 5; 269 pub const SO_BROADCAST: ::c_int = 6; 270 pub const SO_SNDBUF: ::c_int = 7; 271 pub const SO_RCVBUF: ::c_int = 8; 272 pub const SO_KEEPALIVE: ::c_int = 9; 273 pub const SO_OOBINLINE: ::c_int = 10; 274 pub const SO_NO_CHECK: ::c_int = 11; 275 pub const SO_PRIORITY: ::c_int = 12; 276 pub const SO_LINGER: ::c_int = 13; 277 pub const SO_BSDCOMPAT: ::c_int = 14; 278 pub const SO_REUSEPORT: ::c_int = 15; 279 pub const SO_ACCEPTCONN: ::c_int = 30; 280 pub const SO_SNDBUFFORCE: ::c_int = 32; 281 pub const SO_RCVBUFFORCE: ::c_int = 33; 282 pub const SO_PROTOCOL: ::c_int = 38; 283 pub const SO_DOMAIN: ::c_int = 39; 284 285 pub const SA_ONSTACK: ::c_int = 0x08000000; 286 pub const SA_SIGINFO: ::c_int = 0x00000004; 287 pub const SA_NOCLDWAIT: ::c_int = 0x00000002; 288 289 pub const SIGCHLD: ::c_int = 17; 290 pub const SIGBUS: ::c_int = 7; 291 pub const SIGTTIN: ::c_int = 21; 292 pub const SIGTTOU: ::c_int = 22; 293 pub const SIGXCPU: ::c_int = 24; 294 pub const SIGXFSZ: ::c_int = 25; 295 pub const SIGVTALRM: ::c_int = 26; 296 pub const SIGPROF: ::c_int = 27; 297 pub const SIGWINCH: ::c_int = 28; 298 pub const SIGUSR1: ::c_int = 10; 299 pub const SIGUSR2: ::c_int = 12; 300 pub const SIGCONT: ::c_int = 18; 301 pub const SIGSTOP: ::c_int = 19; 302 pub const SIGTSTP: ::c_int = 20; 303 pub const SIGURG: ::c_int = 23; 304 pub const SIGIO: ::c_int = 29; 305 pub const SIGSYS: ::c_int = 31; 306 pub const SIGSTKFLT: ::c_int = 16; 307 pub const SIGPOLL: ::c_int = 29; 308 pub const SIGPWR: ::c_int = 30; 309 pub const SIG_SETMASK: ::c_int = 2; 310 pub const SIG_BLOCK: ::c_int = 0x000000; 311 pub const SIG_UNBLOCK: ::c_int = 0x01; 312 313 pub const MAP_HUGETLB: ::c_int = 0x040000; 314 315 pub const F_GETLK: ::c_int = 5; 316 pub const F_GETOWN: ::c_int = 9; 317 pub const F_SETLK: ::c_int = 6; 318 pub const F_SETLKW: ::c_int = 7; 319 pub const F_SETOWN: ::c_int = 8; 320 321 pub const VEOF: usize = 4; 322 323 pub const POLLWRNORM: ::c_short = 0x100; 324 pub const POLLWRBAND: ::c_short = 0x200; 325 326 cfg_if! { 327 if #[cfg(target_arch = "aarch64")] { 328 mod aarch64; 329 pub use self::aarch64::*; 330 } else if #[cfg(any(target_arch = "powerpc64"))] { 331 mod powerpc64; 332 pub use self::powerpc64::*; 333 } else if #[cfg(any(target_arch = "x86_64"))] { 334 mod x86_64; 335 pub use self::x86_64::*; 336 } else { 337 // Unknown target_arch 338 } 339 } 340