Brian Anderson | 773aab8 | 2015-12-29 20:00:29 +0000 | [diff] [blame] | 1 | pub type c_long = i64; |
| 2 | pub type c_ulong = u64; |
| 3 | |
Alex Crichton | 8a8bc66 | 2016-02-29 23:02:36 -0800 | [diff] [blame] | 4 | s! { |
Alex Crichton | a36da11 | 2017-08-25 18:03:53 -0700 | [diff] [blame] | 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 | |
Alex Crichton | 8a8bc66 | 2016-02-29 23:02:36 -0800 | [diff] [blame] | 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 | |
Alexander Schlarb | 7590565 | 2016-09-17 22:17:17 +0200 | [diff] [blame] | 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 | |
Alex Crichton | 8a8bc66 | 2016-02-29 23:02:36 -0800 | [diff] [blame] | 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, |
A. Wilcox | 06bf363 | 2018-12-05 11:38:05 -0600 | [diff] [blame] | 95 | #[cfg(target_endian = "big")] |
| 96 | __pad1: ::c_int, |
Alex Crichton | 8a8bc66 | 2016-02-29 23:02:36 -0800 | [diff] [blame] | 97 | pub msg_iovlen: ::c_int, |
A. Wilcox | 06bf363 | 2018-12-05 11:38:05 -0600 | [diff] [blame] | 98 | #[cfg(target_endian = "little")] |
Alex Crichton | 8a8bc66 | 2016-02-29 23:02:36 -0800 | [diff] [blame] | 99 | __pad1: ::c_int, |
| 100 | pub msg_control: *mut ::c_void, |
A. Wilcox | 06bf363 | 2018-12-05 11:38:05 -0600 | [diff] [blame] | 101 | #[cfg(target_endian = "big")] |
| 102 | __pad2: ::c_int, |
Alex Crichton | 8a8bc66 | 2016-02-29 23:02:36 -0800 | [diff] [blame] | 103 | pub msg_controllen: ::socklen_t, |
A. Wilcox | 06bf363 | 2018-12-05 11:38:05 -0600 | [diff] [blame] | 104 | #[cfg(target_endian = "little")] |
| 105 | __pad2: ::c_int, |
Alex Crichton | 8a8bc66 | 2016-02-29 23:02:36 -0800 | [diff] [blame] | 106 | pub msg_flags: ::c_int, |
| 107 | } |
Steven Fackler | 41699f7 | 2016-06-03 21:02:56 -0700 | [diff] [blame] | 108 | |
Guillaume Gomez | 7d2aea9 | 2016-12-04 10:32:42 -0800 | [diff] [blame] | 109 | pub struct cmsghdr { |
A. Wilcox | 06bf363 | 2018-12-05 11:38:05 -0600 | [diff] [blame] | 110 | #[cfg(target_endian = "big")] |
| 111 | pub __pad1: ::c_int, |
Guillaume Gomez | 7d2aea9 | 2016-12-04 10:32:42 -0800 | [diff] [blame] | 112 | pub cmsg_len: ::socklen_t, |
A. Wilcox | 06bf363 | 2018-12-05 11:38:05 -0600 | [diff] [blame] | 113 | #[cfg(target_endian = "little")] |
Guillaume Gomez | 7d2aea9 | 2016-12-04 10:32:42 -0800 | [diff] [blame] | 114 | pub __pad1: ::c_int, |
| 115 | pub cmsg_level: ::c_int, |
| 116 | pub cmsg_type: ::c_int, |
| 117 | } |
| 118 | |
Steven Fackler | 41699f7 | 2016-06-03 21:02:56 -0700 | [diff] [blame] | 119 | pub struct sem_t { |
| 120 | __val: [::c_int; 8], |
| 121 | } |
Alex Crichton | ed32e3f | 2016-08-28 11:53:09 -0700 | [diff] [blame] | 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 | } |
Alex Crichton | 8a8bc66 | 2016-02-29 23:02:36 -0800 | [diff] [blame] | 130 | } |
| 131 | |
Brian Anderson | 773aab8 | 2015-12-29 20:00:29 +0000 | [diff] [blame] | 132 | pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; |
| 133 | pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; |
| 134 | |
Jorge Aparicio | 751bea3 | 2016-01-30 01:28:50 -0500 | [diff] [blame] | 135 | pub const O_ASYNC: ::c_int = 0x2000; |
| 136 | |
Jorge Aparicio | 751bea3 | 2016-01-30 01:28:50 -0500 | [diff] [blame] | 137 | pub const RLIMIT_RSS: ::c_int = 5; |
| 138 | pub const RLIMIT_NOFILE: ::c_int = 7; |
| 139 | pub const RLIMIT_AS: ::c_int = 9; |
| 140 | pub const RLIMIT_NPROC: ::c_int = 6; |
| 141 | pub const RLIMIT_MEMLOCK: ::c_int = 8; |
| 142 | |
| 143 | pub const O_APPEND: ::c_int = 1024; |
| 144 | pub const O_CREAT: ::c_int = 64; |
| 145 | pub const O_EXCL: ::c_int = 128; |
| 146 | pub const O_NOCTTY: ::c_int = 256; |
| 147 | pub const O_NONBLOCK: ::c_int = 2048; |
| 148 | pub const O_SYNC: ::c_int = 1052672; |
| 149 | pub const O_RSYNC: ::c_int = 1052672; |
| 150 | pub const O_DSYNC: ::c_int = 4096; |
| 151 | |
| 152 | pub const SOCK_NONBLOCK: ::c_int = 2048; |
| 153 | |
| 154 | pub const MAP_ANON: ::c_int = 0x0020; |
| 155 | pub const MAP_GROWSDOWN: ::c_int = 0x0100; |
| 156 | pub const MAP_DENYWRITE: ::c_int = 0x0800; |
| 157 | pub const MAP_EXECUTABLE: ::c_int = 0x01000; |
| 158 | pub const MAP_LOCKED: ::c_int = 0x02000; |
| 159 | pub const MAP_NORESERVE: ::c_int = 0x04000; |
| 160 | pub const MAP_POPULATE: ::c_int = 0x08000; |
| 161 | pub const MAP_NONBLOCK: ::c_int = 0x010000; |
| 162 | pub const MAP_STACK: ::c_int = 0x020000; |
| 163 | |
| 164 | pub const SOCK_STREAM: ::c_int = 1; |
| 165 | pub const SOCK_DGRAM: ::c_int = 2; |
Rick Richardson | df0a9ba | 2016-05-26 23:52:00 -0400 | [diff] [blame] | 166 | pub const SOCK_SEQPACKET: ::c_int = 5; |
Jorge Aparicio | 751bea3 | 2016-01-30 01:28:50 -0500 | [diff] [blame] | 167 | |
| 168 | pub const SOL_SOCKET: ::c_int = 1; |
| 169 | |
Jorge Aparicio | 751bea3 | 2016-01-30 01:28:50 -0500 | [diff] [blame] | 170 | pub const ENAMETOOLONG: ::c_int = 36; |
| 171 | pub const ENOLCK: ::c_int = 37; |
| 172 | pub const ENOSYS: ::c_int = 38; |
| 173 | pub const ENOTEMPTY: ::c_int = 39; |
| 174 | pub const ELOOP: ::c_int = 40; |
| 175 | pub const ENOMSG: ::c_int = 42; |
| 176 | pub const EIDRM: ::c_int = 43; |
| 177 | pub const ECHRNG: ::c_int = 44; |
| 178 | pub const EL2NSYNC: ::c_int = 45; |
| 179 | pub const EL3HLT: ::c_int = 46; |
| 180 | pub const EL3RST: ::c_int = 47; |
| 181 | pub const ELNRNG: ::c_int = 48; |
| 182 | pub const EUNATCH: ::c_int = 49; |
| 183 | pub const ENOCSI: ::c_int = 50; |
| 184 | pub const EL2HLT: ::c_int = 51; |
| 185 | pub const EBADE: ::c_int = 52; |
| 186 | pub const EBADR: ::c_int = 53; |
| 187 | pub const EXFULL: ::c_int = 54; |
| 188 | pub const ENOANO: ::c_int = 55; |
| 189 | pub const EBADRQC: ::c_int = 56; |
| 190 | pub const EBADSLT: ::c_int = 57; |
Jorge Aparicio | 751bea3 | 2016-01-30 01:28:50 -0500 | [diff] [blame] | 191 | pub const EMULTIHOP: ::c_int = 72; |
| 192 | pub const EBADMSG: ::c_int = 74; |
| 193 | pub const EOVERFLOW: ::c_int = 75; |
| 194 | pub const ENOTUNIQ: ::c_int = 76; |
| 195 | pub const EBADFD: ::c_int = 77; |
| 196 | pub const EREMCHG: ::c_int = 78; |
| 197 | pub const ELIBACC: ::c_int = 79; |
| 198 | pub const ELIBBAD: ::c_int = 80; |
| 199 | pub const ELIBSCN: ::c_int = 81; |
| 200 | pub const ELIBMAX: ::c_int = 82; |
| 201 | pub const ELIBEXEC: ::c_int = 83; |
| 202 | pub const EILSEQ: ::c_int = 84; |
| 203 | pub const ERESTART: ::c_int = 85; |
| 204 | pub const ESTRPIPE: ::c_int = 86; |
| 205 | pub const EUSERS: ::c_int = 87; |
| 206 | pub const ENOTSOCK: ::c_int = 88; |
| 207 | pub const EDESTADDRREQ: ::c_int = 89; |
| 208 | pub const EMSGSIZE: ::c_int = 90; |
| 209 | pub const EPROTOTYPE: ::c_int = 91; |
| 210 | pub const ENOPROTOOPT: ::c_int = 92; |
| 211 | pub const EPROTONOSUPPORT: ::c_int = 93; |
| 212 | pub const ESOCKTNOSUPPORT: ::c_int = 94; |
| 213 | pub const EOPNOTSUPP: ::c_int = 95; |
Steven Allen | 8c3e6ba | 2016-11-11 11:00:16 -0800 | [diff] [blame] | 214 | pub const ENOTSUP: ::c_int = EOPNOTSUPP; |
Jorge Aparicio | 751bea3 | 2016-01-30 01:28:50 -0500 | [diff] [blame] | 215 | pub const EPFNOSUPPORT: ::c_int = 96; |
| 216 | pub const EAFNOSUPPORT: ::c_int = 97; |
| 217 | pub const EADDRINUSE: ::c_int = 98; |
| 218 | pub const EADDRNOTAVAIL: ::c_int = 99; |
| 219 | pub const ENETDOWN: ::c_int = 100; |
| 220 | pub const ENETUNREACH: ::c_int = 101; |
| 221 | pub const ENETRESET: ::c_int = 102; |
| 222 | pub const ECONNABORTED: ::c_int = 103; |
| 223 | pub const ECONNRESET: ::c_int = 104; |
| 224 | pub const ENOBUFS: ::c_int = 105; |
| 225 | pub const EISCONN: ::c_int = 106; |
| 226 | pub const ENOTCONN: ::c_int = 107; |
| 227 | pub const ESHUTDOWN: ::c_int = 108; |
| 228 | pub const ETOOMANYREFS: ::c_int = 109; |
| 229 | pub const ETIMEDOUT: ::c_int = 110; |
| 230 | pub const ECONNREFUSED: ::c_int = 111; |
| 231 | pub const EHOSTDOWN: ::c_int = 112; |
| 232 | pub const EHOSTUNREACH: ::c_int = 113; |
| 233 | pub const EALREADY: ::c_int = 114; |
| 234 | pub const EINPROGRESS: ::c_int = 115; |
| 235 | pub const ESTALE: ::c_int = 116; |
| 236 | pub const EUCLEAN: ::c_int = 117; |
| 237 | pub const ENOTNAM: ::c_int = 118; |
| 238 | pub const ENAVAIL: ::c_int = 119; |
| 239 | pub const EISNAM: ::c_int = 120; |
| 240 | pub const EREMOTEIO: ::c_int = 121; |
| 241 | pub const EDQUOT: ::c_int = 122; |
| 242 | pub const ENOMEDIUM: ::c_int = 123; |
| 243 | pub const EMEDIUMTYPE: ::c_int = 124; |
| 244 | pub const ECANCELED: ::c_int = 125; |
| 245 | pub const ENOKEY: ::c_int = 126; |
| 246 | pub const EKEYEXPIRED: ::c_int = 127; |
| 247 | pub const EKEYREVOKED: ::c_int = 128; |
| 248 | pub const EKEYREJECTED: ::c_int = 129; |
| 249 | pub const EOWNERDEAD: ::c_int = 130; |
| 250 | pub const ENOTRECOVERABLE: ::c_int = 131; |
| 251 | pub const ERFKILL: ::c_int = 132; |
| 252 | pub const EHWPOISON: ::c_int = 133; |
| 253 | |
| 254 | pub const SO_REUSEADDR: ::c_int = 2; |
| 255 | pub const SO_TYPE: ::c_int = 3; |
| 256 | pub const SO_ERROR: ::c_int = 4; |
| 257 | pub const SO_DONTROUTE: ::c_int = 5; |
| 258 | pub const SO_BROADCAST: ::c_int = 6; |
| 259 | pub const SO_SNDBUF: ::c_int = 7; |
| 260 | pub const SO_RCVBUF: ::c_int = 8; |
| 261 | pub const SO_KEEPALIVE: ::c_int = 9; |
| 262 | pub const SO_OOBINLINE: ::c_int = 10; |
Zac Berkowitz | 1479ea8 | 2017-02-28 03:59:17 +0000 | [diff] [blame] | 263 | pub const SO_NO_CHECK: ::c_int = 11; |
| 264 | pub const SO_PRIORITY: ::c_int = 12; |
Jorge Aparicio | 751bea3 | 2016-01-30 01:28:50 -0500 | [diff] [blame] | 265 | pub const SO_LINGER: ::c_int = 13; |
Zac Berkowitz | 1479ea8 | 2017-02-28 03:59:17 +0000 | [diff] [blame] | 266 | pub const SO_BSDCOMPAT: ::c_int = 14; |
Jorge Aparicio | 751bea3 | 2016-01-30 01:28:50 -0500 | [diff] [blame] | 267 | pub const SO_REUSEPORT: ::c_int = 15; |
Jorge Aparicio | 751bea3 | 2016-01-30 01:28:50 -0500 | [diff] [blame] | 268 | pub const SO_ACCEPTCONN: ::c_int = 30; |
Zac Berkowitz | 1479ea8 | 2017-02-28 03:59:17 +0000 | [diff] [blame] | 269 | pub const SO_SNDBUFFORCE: ::c_int = 32; |
| 270 | pub const SO_RCVBUFFORCE: ::c_int = 33; |
| 271 | pub const SO_PROTOCOL: ::c_int = 38; |
| 272 | pub const SO_DOMAIN: ::c_int = 39; |
Jorge Aparicio | 751bea3 | 2016-01-30 01:28:50 -0500 | [diff] [blame] | 273 | |
| 274 | pub const SA_ONSTACK: ::c_int = 0x08000000; |
| 275 | pub const SA_SIGINFO: ::c_int = 0x00000004; |
| 276 | pub const SA_NOCLDWAIT: ::c_int = 0x00000002; |
| 277 | |
| 278 | pub const SIGCHLD: ::c_int = 17; |
| 279 | pub const SIGBUS: ::c_int = 7; |
| 280 | pub const SIGTTIN: ::c_int = 21; |
| 281 | pub const SIGTTOU: ::c_int = 22; |
| 282 | pub const SIGXCPU: ::c_int = 24; |
| 283 | pub const SIGXFSZ: ::c_int = 25; |
| 284 | pub const SIGVTALRM: ::c_int = 26; |
| 285 | pub const SIGPROF: ::c_int = 27; |
| 286 | pub const SIGWINCH: ::c_int = 28; |
| 287 | pub const SIGUSR1: ::c_int = 10; |
| 288 | pub const SIGUSR2: ::c_int = 12; |
| 289 | pub const SIGCONT: ::c_int = 18; |
| 290 | pub const SIGSTOP: ::c_int = 19; |
| 291 | pub const SIGTSTP: ::c_int = 20; |
| 292 | pub const SIGURG: ::c_int = 23; |
| 293 | pub const SIGIO: ::c_int = 29; |
| 294 | pub const SIGSYS: ::c_int = 31; |
| 295 | pub const SIGSTKFLT: ::c_int = 16; |
| 296 | pub const SIGPOLL: ::c_int = 29; |
| 297 | pub const SIGPWR: ::c_int = 30; |
| 298 | pub const SIG_SETMASK: ::c_int = 2; |
| 299 | pub const SIG_BLOCK: ::c_int = 0x000000; |
| 300 | pub const SIG_UNBLOCK: ::c_int = 0x01; |
| 301 | |
Jorge Aparicio | 751bea3 | 2016-01-30 01:28:50 -0500 | [diff] [blame] | 302 | pub const MAP_HUGETLB: ::c_int = 0x040000; |
| 303 | |
Brian Anderson | 773aab8 | 2015-12-29 20:00:29 +0000 | [diff] [blame] | 304 | pub const F_GETLK: ::c_int = 5; |
Jorge Aparicio | 751bea3 | 2016-01-30 01:28:50 -0500 | [diff] [blame] | 305 | pub const F_GETOWN: ::c_int = 9; |
Brian Anderson | 773aab8 | 2015-12-29 20:00:29 +0000 | [diff] [blame] | 306 | pub const F_SETLK: ::c_int = 6; |
| 307 | pub const F_SETLKW: ::c_int = 7; |
Jorge Aparicio | 751bea3 | 2016-01-30 01:28:50 -0500 | [diff] [blame] | 308 | pub const F_SETOWN: ::c_int = 8; |
| 309 | |
| 310 | pub const VEOF: usize = 4; |
Brian Anderson | 773aab8 | 2015-12-29 20:00:29 +0000 | [diff] [blame] | 311 | |
Alex Crichton | ed32e3f | 2016-08-28 11:53:09 -0700 | [diff] [blame] | 312 | pub const POLLWRNORM: ::c_short = 0x100; |
| 313 | pub const POLLWRBAND: ::c_short = 0x200; |
| 314 | |
Kamal Marhubi | f934724 | 2016-03-10 14:47:03 -0500 | [diff] [blame] | 315 | cfg_if! { |
| 316 | if #[cfg(target_arch = "aarch64")] { |
| 317 | mod aarch64; |
| 318 | pub use self::aarch64::*; |
| 319 | } else if #[cfg(any(target_arch = "powerpc64"))] { |
| 320 | mod powerpc64; |
| 321 | pub use self::powerpc64::*; |
| 322 | } else if #[cfg(any(target_arch = "x86_64"))] { |
| 323 | mod x86_64; |
| 324 | pub use self::x86_64::*; |
| 325 | } else { |
| 326 | // Unknown target_arch |
| 327 | } |
| 328 | } |