Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 1 | pub type blkcnt_t = i64; |
| 2 | pub type blksize_t = i64; |
| 3 | pub type c_char = u8; |
| 4 | pub type c_long = i64; |
| 5 | pub type c_ulong = u64; |
| 6 | pub type fsblkcnt_t = u64; |
| 7 | pub type fsfilcnt_t = u64; |
| 8 | pub type ino_t = u64; |
| 9 | pub type nlink_t = u64; |
| 10 | pub type off_t = i64; |
| 11 | pub type rlim_t = u64; |
| 12 | pub type suseconds_t = i64; |
| 13 | pub type time_t = i64; |
| 14 | pub type wchar_t = i32; |
Ulrich Weigand | 38569c7 | 2016-09-05 19:50:10 +0200 | [diff] [blame] | 15 | pub type greg_t = u64; |
| 16 | pub type clock_t = i64; |
| 17 | pub type __fsword_t = ::c_long; |
| 18 | pub type __priority_which_t = ::c_uint; |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 19 | |
| 20 | s! { |
Alan Somers | a46123c | 2016-11-13 18:04:47 -0700 | [diff] [blame] | 21 | pub struct aiocb { |
| 22 | pub aio_fildes: ::c_int, |
| 23 | pub aio_lio_opcode: ::c_int, |
| 24 | pub aio_reqprio: ::c_int, |
| 25 | pub aio_buf: *mut ::c_void, |
| 26 | pub aio_nbytes: ::size_t, |
| 27 | pub aio_sigevent: ::sigevent, |
| 28 | __next_prio: *mut aiocb, |
| 29 | __abs_prio: ::c_int, |
| 30 | __policy: ::c_int, |
| 31 | __error_code: ::c_int, |
| 32 | __return_value: ::ssize_t, |
| 33 | pub aio_offset: off_t, |
| 34 | #[cfg(target_pointer_width = "32")] |
| 35 | __unused1: [::c_char; 4], |
| 36 | __glibc_reserved: [::c_char; 32] |
| 37 | } |
| 38 | |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 39 | pub struct stat { |
| 40 | pub st_dev: ::dev_t, |
| 41 | pub st_ino: ::ino_t, |
| 42 | pub st_nlink: ::nlink_t, |
| 43 | pub st_mode: ::mode_t, |
| 44 | pub st_uid: ::uid_t, |
| 45 | pub st_gid: ::gid_t, |
| 46 | st_pad0: ::c_int, |
| 47 | pub st_rdev: ::dev_t, |
| 48 | pub st_size: ::off_t, |
| 49 | pub st_atime: ::time_t, |
| 50 | pub st_atime_nsec: ::c_long, |
| 51 | pub st_mtime: ::time_t, |
| 52 | pub st_mtime_nsec: ::c_long, |
| 53 | pub st_ctime: ::time_t, |
| 54 | pub st_ctime_nsec: ::c_long, |
| 55 | pub st_blksize: ::blksize_t, |
| 56 | pub st_blocks: ::blkcnt_t, |
Ulrich Weigand | 38569c7 | 2016-09-05 19:50:10 +0200 | [diff] [blame] | 57 | __glibc_reserved: [::c_long; 3], |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | pub struct stat64 { |
| 61 | pub st_dev: ::dev_t, |
Ulrich Weigand | 38569c7 | 2016-09-05 19:50:10 +0200 | [diff] [blame] | 62 | pub st_ino: ::ino64_t, |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 63 | pub st_nlink: ::nlink_t, |
| 64 | pub st_mode: ::mode_t, |
| 65 | pub st_uid: ::uid_t, |
| 66 | pub st_gid: ::gid_t, |
| 67 | st_pad0: ::c_int, |
| 68 | pub st_rdev: ::dev_t, |
| 69 | pub st_size: ::off_t, |
| 70 | pub st_atime: ::time_t, |
| 71 | pub st_atime_nsec: ::c_long, |
| 72 | pub st_mtime: ::time_t, |
| 73 | pub st_mtime_nsec: ::c_long, |
| 74 | pub st_ctime: ::time_t, |
| 75 | pub st_ctime_nsec: ::c_long, |
| 76 | pub st_blksize: ::blksize_t, |
Ulrich Weigand | 38569c7 | 2016-09-05 19:50:10 +0200 | [diff] [blame] | 77 | pub st_blocks: ::blkcnt64_t, |
| 78 | __glibc_reserved: [::c_long; 3], |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | pub struct pthread_attr_t { |
| 82 | __size: [::c_ulong; 7] |
| 83 | } |
| 84 | |
| 85 | pub struct sigaction { |
| 86 | pub sa_sigaction: ::sighandler_t, |
Ulrich Weigand | 38569c7 | 2016-09-05 19:50:10 +0200 | [diff] [blame] | 87 | __glibc_reserved0: ::c_int, |
| 88 | pub sa_flags: ::c_int, |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 89 | _restorer: *mut ::c_void, |
| 90 | pub sa_mask: sigset_t, |
| 91 | } |
| 92 | |
| 93 | pub struct stack_t { |
| 94 | pub ss_sp: *mut ::c_void, |
| 95 | pub ss_flags: ::c_int, |
| 96 | pub ss_size: ::size_t, |
| 97 | } |
| 98 | |
| 99 | pub struct sigset_t { |
| 100 | __size: [::c_ulong; 16], |
| 101 | } |
| 102 | |
| 103 | pub struct siginfo_t { |
| 104 | pub si_signo: ::c_int, |
| 105 | pub si_errno: ::c_int, |
| 106 | pub si_code: ::c_int, |
| 107 | _pad: ::c_int, |
| 108 | _pad2: [::c_long; 14], |
| 109 | } |
| 110 | |
| 111 | pub struct ipc_perm { |
| 112 | pub __key: ::key_t, |
| 113 | pub uid: ::uid_t, |
| 114 | pub gid: ::gid_t, |
| 115 | pub cuid: ::uid_t, |
| 116 | pub cgid: ::gid_t, |
Ulrich Weigand | 38569c7 | 2016-09-05 19:50:10 +0200 | [diff] [blame] | 117 | pub mode: ::mode_t, |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 118 | pub __seq: ::c_ushort, |
| 119 | __pad1: ::c_ushort, |
| 120 | __unused1: ::c_ulong, |
| 121 | __unused2: ::c_ulong |
| 122 | } |
| 123 | |
| 124 | pub struct shmid_ds { |
| 125 | pub shm_perm: ::ipc_perm, |
| 126 | pub shm_segsz: ::size_t, |
| 127 | pub shm_atime: ::time_t, |
| 128 | pub shm_dtime: ::time_t, |
| 129 | pub shm_ctime: ::time_t, |
| 130 | pub shm_cpid: ::pid_t, |
| 131 | pub shm_lpid: ::pid_t, |
| 132 | pub shm_nattch: ::shmatt_t, |
| 133 | __unused4: ::c_ulong, |
| 134 | __unused5: ::c_ulong |
| 135 | } |
| 136 | |
| 137 | pub struct statfs { |
| 138 | pub f_type: ::c_uint, |
| 139 | pub f_bsize: ::c_uint, |
| 140 | pub f_blocks: ::fsblkcnt_t, |
| 141 | pub f_bfree: ::fsblkcnt_t, |
| 142 | pub f_bavail: ::fsblkcnt_t, |
Ulrich Weigand | 38569c7 | 2016-09-05 19:50:10 +0200 | [diff] [blame] | 143 | pub f_files: ::fsfilcnt_t, |
| 144 | pub f_ffree: ::fsfilcnt_t, |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 145 | pub f_fsid: ::fsid_t, |
| 146 | pub f_namelen: ::c_uint, |
| 147 | pub f_frsize: ::c_uint, |
| 148 | pub f_flags: ::c_uint, |
| 149 | f_spare: [::c_uint; 4], |
| 150 | } |
| 151 | |
| 152 | pub struct msghdr { |
| 153 | pub msg_name: *mut ::c_void, |
| 154 | pub msg_namelen: ::socklen_t, |
| 155 | pub msg_iov: *mut ::iovec, |
| 156 | pub msg_iovlen: ::size_t, |
| 157 | pub msg_control: *mut ::c_void, |
| 158 | pub msg_controllen: ::size_t, |
| 159 | pub msg_flags: ::c_int, |
| 160 | } |
| 161 | |
Guillaume Gomez | 7d2aea9 | 2016-12-04 10:32:42 -0800 | [diff] [blame] | 162 | pub struct cmsghdr { |
| 163 | pub cmsg_len: ::size_t, |
| 164 | pub cmsg_level: ::c_int, |
| 165 | pub cmsg_type: ::c_int, |
| 166 | } |
| 167 | |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 168 | pub struct termios { |
| 169 | pub c_iflag: ::tcflag_t, |
| 170 | pub c_oflag: ::tcflag_t, |
| 171 | pub c_cflag: ::tcflag_t, |
| 172 | pub c_lflag: ::tcflag_t, |
| 173 | pub c_line: ::cc_t, |
| 174 | pub c_cc: [::cc_t; ::NCCS], |
| 175 | pub c_ispeed: ::speed_t, |
| 176 | pub c_ospeed: ::speed_t, |
| 177 | } |
| 178 | |
| 179 | pub struct sysinfo { |
| 180 | pub uptime: ::c_long, |
| 181 | pub loads: [::c_ulong; 3], |
| 182 | pub totalram: ::c_ulong, |
| 183 | pub freeram: ::c_ulong, |
| 184 | pub sharedram: ::c_ulong, |
| 185 | pub bufferram: ::c_ulong, |
| 186 | pub totalswap: ::c_ulong, |
| 187 | pub freeswap: ::c_ulong, |
| 188 | pub procs: ::c_ushort, |
| 189 | pub pad: ::c_ushort, |
| 190 | pub totalhigh: ::c_ulong, |
| 191 | pub freehigh: ::c_ulong, |
| 192 | pub mem_unit: ::c_uint, |
| 193 | pub _f: [::c_char; 0], |
| 194 | } |
| 195 | |
Ulrich Weigand | 38569c7 | 2016-09-05 19:50:10 +0200 | [diff] [blame] | 196 | pub struct glob64_t { |
| 197 | pub gl_pathc: ::size_t, |
| 198 | pub gl_pathv: *mut *mut ::c_char, |
| 199 | pub gl_offs: ::size_t, |
| 200 | pub gl_flags: ::c_int, |
| 201 | |
| 202 | __unused1: *mut ::c_void, |
| 203 | __unused2: *mut ::c_void, |
| 204 | __unused3: *mut ::c_void, |
| 205 | __unused4: *mut ::c_void, |
| 206 | __unused5: *mut ::c_void, |
| 207 | } |
| 208 | |
| 209 | pub struct ucred { |
| 210 | pub pid: ::pid_t, |
| 211 | pub uid: ::uid_t, |
| 212 | pub gid: ::gid_t, |
| 213 | } |
| 214 | |
| 215 | pub struct flock { |
| 216 | pub l_type: ::c_short, |
| 217 | pub l_whence: ::c_short, |
| 218 | pub l_start: ::off_t, |
| 219 | pub l_len: ::off_t, |
| 220 | pub l_pid: ::pid_t, |
| 221 | } |
| 222 | |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 223 | // FIXME this is actually a union |
| 224 | pub struct sem_t { |
| 225 | __size: [::c_char; 32], |
| 226 | __align: [::c_long; 0], |
| 227 | } |
Ulrich Weigand | 38569c7 | 2016-09-05 19:50:10 +0200 | [diff] [blame] | 228 | |
| 229 | pub struct __psw_t { |
| 230 | pub mask: u64, |
| 231 | pub addr: u64, |
| 232 | } |
| 233 | |
| 234 | // FIXME: This is actually a union. |
| 235 | pub struct fpreg_t { |
| 236 | pub d: ::c_double, |
| 237 | // f: ::c_float, |
| 238 | } |
| 239 | |
| 240 | pub struct fpregset_t { |
| 241 | pub fpc: u32, |
| 242 | __pad: u32, |
| 243 | pub fprs: [fpreg_t; 16], |
| 244 | } |
| 245 | |
| 246 | pub struct mcontext_t { |
| 247 | pub psw: __psw_t, |
| 248 | pub gregs: [u64; 16], |
| 249 | pub aregs: [u32; 16], |
| 250 | pub fpregs: fpregset_t, |
| 251 | } |
| 252 | |
| 253 | pub struct ucontext_t { |
| 254 | pub uc_flags: ::c_ulong, |
| 255 | pub uc_link: *mut ucontext_t, |
| 256 | pub uc_stack: ::stack_t, |
| 257 | pub uc_mcontext: mcontext_t, |
| 258 | pub uc_sigmask: ::sigset_t, |
| 259 | } |
Alex Crichton | 8a9d8c2 | 2016-10-10 21:59:07 -0700 | [diff] [blame] | 260 | |
| 261 | pub struct msqid_ds { |
| 262 | pub msg_perm: ::ipc_perm, |
| 263 | pub msg_stime: ::time_t, |
| 264 | pub msg_rtime: ::time_t, |
| 265 | pub msg_ctime: ::time_t, |
| 266 | __msg_cbytes: ::c_ulong, |
| 267 | pub msg_qnum: ::msgqnum_t, |
| 268 | pub msg_qbytes: ::msglen_t, |
| 269 | pub msg_lspid: ::pid_t, |
| 270 | pub msg_lrpid: ::pid_t, |
| 271 | __glibc_reserved4: ::c_ulong, |
| 272 | __glibc_reserved5: ::c_ulong, |
| 273 | } |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 274 | } |
| 275 | |
Jorge Aparicio | 540d140 | 2016-12-31 16:40:13 -0500 | [diff] [blame] | 276 | pub const CLONE_NEWCGROUP: ::c_int = 0x02000000; |
| 277 | |
| 278 | pub const SFD_CLOEXEC: ::c_int = 0x080000; |
| 279 | |
| 280 | pub const NCCS: usize = 32; |
| 281 | |
| 282 | pub const O_TRUNC: ::c_int = 512; |
| 283 | |
| 284 | pub const O_CLOEXEC: ::c_int = 0x80000; |
| 285 | |
| 286 | pub const EBFONT: ::c_int = 59; |
| 287 | pub const ENOSTR: ::c_int = 60; |
| 288 | pub const ENODATA: ::c_int = 61; |
| 289 | pub const ETIME: ::c_int = 62; |
| 290 | pub const ENOSR: ::c_int = 63; |
| 291 | pub const ENONET: ::c_int = 64; |
| 292 | pub const ENOPKG: ::c_int = 65; |
| 293 | pub const EREMOTE: ::c_int = 66; |
| 294 | pub const ENOLINK: ::c_int = 67; |
| 295 | pub const EADV: ::c_int = 68; |
| 296 | pub const ESRMNT: ::c_int = 69; |
| 297 | pub const ECOMM: ::c_int = 70; |
| 298 | pub const EPROTO: ::c_int = 71; |
| 299 | pub const EDOTDOT: ::c_int = 73; |
| 300 | |
| 301 | pub const SA_NODEFER: ::c_int = 0x40000000; |
| 302 | pub const SA_RESETHAND: ::c_int = 0x80000000; |
| 303 | pub const SA_RESTART: ::c_int = 0x10000000; |
| 304 | pub const SA_NOCLDSTOP: ::c_int = 0x00000001; |
| 305 | |
| 306 | pub const EPOLL_CLOEXEC: ::c_int = 0x80000; |
| 307 | |
| 308 | pub const EFD_CLOEXEC: ::c_int = 0x80000; |
| 309 | |
Jorge Aparicio | e16b11d | 2016-09-03 00:58:30 -0500 | [diff] [blame] | 310 | pub const POSIX_FADV_DONTNEED: ::c_int = 6; |
| 311 | pub const POSIX_FADV_NOREUSE: ::c_int = 7; |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 312 | |
| 313 | pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; |
| 314 | pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; |
| 315 | pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; |
| 316 | pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; |
| 317 | |
| 318 | pub const EADDRINUSE: ::c_int = 98; |
| 319 | pub const EADDRNOTAVAIL: ::c_int = 99; |
| 320 | pub const ECONNABORTED: ::c_int = 103; |
| 321 | pub const ECONNREFUSED: ::c_int = 111; |
| 322 | pub const ECONNRESET: ::c_int = 104; |
| 323 | pub const EDEADLK: ::c_int = 35; |
| 324 | pub const ENOSYS: ::c_int = 38; |
| 325 | pub const ENOTCONN: ::c_int = 107; |
| 326 | pub const ETIMEDOUT: ::c_int = 110; |
| 327 | pub const FIOCLEX: ::c_ulong = 0x5451; |
| 328 | pub const FIONBIO: ::c_ulong = 0x5421; |
| 329 | pub const MAP_ANON: ::c_int = 0x20; |
| 330 | pub const O_ACCMODE: ::c_int = 3; |
| 331 | pub const O_APPEND: ::c_int = 1024; |
| 332 | pub const O_CREAT: ::c_int = 64; |
| 333 | pub const O_EXCL: ::c_int = 128; |
| 334 | pub const O_NONBLOCK: ::c_int = 2048; |
| 335 | pub const PTHREAD_STACK_MIN: ::size_t = 16384; |
| 336 | pub const RLIM_INFINITY: ::rlim_t = 0xffffffffffffffff; |
Ulrich Weigand | 38569c7 | 2016-09-05 19:50:10 +0200 | [diff] [blame] | 337 | pub const SA_NOCLDWAIT: ::c_int = 2; |
| 338 | pub const SA_ONSTACK: ::c_int = 0x08000000; |
| 339 | pub const SA_SIGINFO: ::c_int = 4; |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 340 | pub const SIGBUS: ::c_int = 7; |
| 341 | pub const SIGSTKSZ: ::size_t = 0x2000; |
Anatol Pomozov | de75eb6 | 2017-04-04 13:26:32 -0700 | [diff] [blame^] | 342 | pub const MINSIGSTKSZ: ::size_t = 2048; |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 343 | pub const SIG_SETMASK: ::c_int = 2; |
| 344 | pub const SOCK_DGRAM: ::c_int = 2; |
| 345 | pub const SOCK_STREAM: ::c_int = 1; |
| 346 | pub const SOL_SOCKET: ::c_int = 1; |
| 347 | pub const SO_BROADCAST: ::c_int = 6; |
| 348 | pub const SO_ERROR: ::c_int = 4; |
| 349 | pub const SO_RCVTIMEO: ::c_int = 20; |
| 350 | pub const SO_REUSEADDR: ::c_int = 2; |
| 351 | pub const SO_SNDTIMEO: ::c_int = 21; |
| 352 | |
Ulrich Weigand | 38569c7 | 2016-09-05 19:50:10 +0200 | [diff] [blame] | 353 | pub const RLIMIT_RSS: ::c_int = 5; |
| 354 | pub const RLIMIT_NOFILE: ::c_int = 7; |
| 355 | pub const RLIMIT_AS: ::c_int = 9; |
| 356 | pub const RLIMIT_NPROC: ::c_int = 6; |
| 357 | pub const RLIMIT_MEMLOCK: ::c_int = 8; |
| 358 | pub const RLIMIT_RTTIME: ::c_int = 15; |
| 359 | pub const RLIMIT_NLIMITS: ::c_int = 16; |
| 360 | |
| 361 | pub const O_NOCTTY: ::c_int = 256; |
| 362 | pub const O_SYNC: ::c_int = 1052672; |
| 363 | pub const O_RSYNC: ::c_int = 1052672; |
| 364 | pub const O_DSYNC: ::c_int = 4096; |
| 365 | pub const O_FSYNC: ::c_int = 0x101000; |
| 366 | pub const O_DIRECT: ::c_int = 0x4000; |
| 367 | pub const O_DIRECTORY: ::c_int = 0x10000; |
| 368 | pub const O_NOFOLLOW: ::c_int = 0x20000; |
| 369 | |
| 370 | pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK; |
| 371 | |
| 372 | pub const LC_PAPER: ::c_int = 7; |
| 373 | pub const LC_NAME: ::c_int = 8; |
| 374 | pub const LC_ADDRESS: ::c_int = 9; |
| 375 | pub const LC_TELEPHONE: ::c_int = 10; |
| 376 | pub const LC_MEASUREMENT: ::c_int = 11; |
| 377 | pub const LC_IDENTIFICATION: ::c_int = 12; |
| 378 | pub const LC_PAPER_MASK: ::c_int = (1 << LC_PAPER); |
| 379 | pub const LC_NAME_MASK: ::c_int = (1 << LC_NAME); |
| 380 | pub const LC_ADDRESS_MASK: ::c_int = (1 << LC_ADDRESS); |
| 381 | pub const LC_TELEPHONE_MASK: ::c_int = (1 << LC_TELEPHONE); |
| 382 | pub const LC_MEASUREMENT_MASK: ::c_int = (1 << LC_MEASUREMENT); |
| 383 | pub const LC_IDENTIFICATION_MASK: ::c_int = (1 << LC_IDENTIFICATION); |
| 384 | pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK |
| 385 | | ::LC_NUMERIC_MASK |
| 386 | | ::LC_TIME_MASK |
| 387 | | ::LC_COLLATE_MASK |
| 388 | | ::LC_MONETARY_MASK |
| 389 | | ::LC_MESSAGES_MASK |
| 390 | | LC_PAPER_MASK |
| 391 | | LC_NAME_MASK |
| 392 | | LC_ADDRESS_MASK |
| 393 | | LC_TELEPHONE_MASK |
| 394 | | LC_MEASUREMENT_MASK |
| 395 | | LC_IDENTIFICATION_MASK; |
| 396 | |
| 397 | pub const MAP_ANONYMOUS: ::c_int = 0x0020; |
| 398 | pub const MAP_GROWSDOWN: ::c_int = 0x0100; |
| 399 | pub const MAP_DENYWRITE: ::c_int = 0x0800; |
| 400 | pub const MAP_EXECUTABLE: ::c_int = 0x01000; |
| 401 | pub const MAP_LOCKED: ::c_int = 0x02000; |
| 402 | pub const MAP_NORESERVE: ::c_int = 0x04000; |
| 403 | pub const MAP_POPULATE: ::c_int = 0x08000; |
| 404 | pub const MAP_NONBLOCK: ::c_int = 0x010000; |
| 405 | pub const MAP_STACK: ::c_int = 0x020000; |
| 406 | |
| 407 | pub const EDEADLOCK: ::c_int = 35; |
| 408 | pub const ENAMETOOLONG: ::c_int = 36; |
| 409 | pub const ENOLCK: ::c_int = 37; |
| 410 | pub const ENOTEMPTY: ::c_int = 39; |
| 411 | pub const ELOOP: ::c_int = 40; |
| 412 | pub const ENOMSG: ::c_int = 42; |
| 413 | pub const EIDRM: ::c_int = 43; |
| 414 | pub const ECHRNG: ::c_int = 44; |
| 415 | pub const EL2NSYNC: ::c_int = 45; |
| 416 | pub const EL3HLT: ::c_int = 46; |
| 417 | pub const EL3RST: ::c_int = 47; |
| 418 | pub const ELNRNG: ::c_int = 48; |
| 419 | pub const EUNATCH: ::c_int = 49; |
| 420 | pub const ENOCSI: ::c_int = 50; |
| 421 | pub const EL2HLT: ::c_int = 51; |
| 422 | pub const EBADE: ::c_int = 52; |
| 423 | pub const EBADR: ::c_int = 53; |
| 424 | pub const EXFULL: ::c_int = 54; |
| 425 | pub const ENOANO: ::c_int = 55; |
| 426 | pub const EBADRQC: ::c_int = 56; |
| 427 | pub const EBADSLT: ::c_int = 57; |
| 428 | pub const EMULTIHOP: ::c_int = 72; |
| 429 | pub const EOVERFLOW: ::c_int = 75; |
| 430 | pub const ENOTUNIQ: ::c_int = 76; |
| 431 | pub const EBADFD: ::c_int = 77; |
| 432 | pub const EBADMSG: ::c_int = 74; |
| 433 | pub const EREMCHG: ::c_int = 78; |
| 434 | pub const ELIBACC: ::c_int = 79; |
| 435 | pub const ELIBBAD: ::c_int = 80; |
| 436 | pub const ELIBSCN: ::c_int = 81; |
| 437 | pub const ELIBMAX: ::c_int = 82; |
| 438 | pub const ELIBEXEC: ::c_int = 83; |
| 439 | pub const EILSEQ: ::c_int = 84; |
| 440 | pub const ERESTART: ::c_int = 85; |
| 441 | pub const ESTRPIPE: ::c_int = 86; |
| 442 | pub const EUSERS: ::c_int = 87; |
| 443 | pub const ENOTSOCK: ::c_int = 88; |
| 444 | pub const EDESTADDRREQ: ::c_int = 89; |
| 445 | pub const EMSGSIZE: ::c_int = 90; |
| 446 | pub const EPROTOTYPE: ::c_int = 91; |
| 447 | pub const ENOPROTOOPT: ::c_int = 92; |
| 448 | pub const EPROTONOSUPPORT: ::c_int = 93; |
| 449 | pub const ESOCKTNOSUPPORT: ::c_int = 94; |
| 450 | pub const EOPNOTSUPP: ::c_int = 95; |
Steven Allen | 8c3e6ba | 2016-11-11 11:00:16 -0800 | [diff] [blame] | 451 | pub const ENOTSUP: ::c_int = EOPNOTSUPP; |
Ulrich Weigand | 38569c7 | 2016-09-05 19:50:10 +0200 | [diff] [blame] | 452 | pub const EPFNOSUPPORT: ::c_int = 96; |
| 453 | pub const EAFNOSUPPORT: ::c_int = 97; |
| 454 | pub const ENETDOWN: ::c_int = 100; |
| 455 | pub const ENETUNREACH: ::c_int = 101; |
| 456 | pub const ENETRESET: ::c_int = 102; |
| 457 | pub const ENOBUFS: ::c_int = 105; |
| 458 | pub const EISCONN: ::c_int = 106; |
| 459 | pub const ESHUTDOWN: ::c_int = 108; |
| 460 | pub const ETOOMANYREFS: ::c_int = 109; |
| 461 | pub const EHOSTDOWN: ::c_int = 112; |
| 462 | pub const EHOSTUNREACH: ::c_int = 113; |
| 463 | pub const EALREADY: ::c_int = 114; |
| 464 | pub const EINPROGRESS: ::c_int = 115; |
| 465 | pub const ESTALE: ::c_int = 116; |
| 466 | pub const EUCLEAN: ::c_int = 117; |
| 467 | pub const ENOTNAM: ::c_int = 118; |
| 468 | pub const ENAVAIL: ::c_int = 119; |
| 469 | pub const EISNAM: ::c_int = 120; |
| 470 | pub const EREMOTEIO: ::c_int = 121; |
| 471 | pub const EDQUOT: ::c_int = 122; |
| 472 | pub const ENOMEDIUM: ::c_int = 123; |
| 473 | pub const EMEDIUMTYPE: ::c_int = 124; |
| 474 | pub const ECANCELED: ::c_int = 125; |
| 475 | pub const ENOKEY: ::c_int = 126; |
| 476 | pub const EKEYEXPIRED: ::c_int = 127; |
| 477 | pub const EKEYREVOKED: ::c_int = 128; |
| 478 | pub const EKEYREJECTED: ::c_int = 129; |
| 479 | pub const EOWNERDEAD: ::c_int = 130; |
| 480 | pub const ENOTRECOVERABLE: ::c_int = 131; |
| 481 | pub const EHWPOISON: ::c_int = 133; |
| 482 | pub const ERFKILL: ::c_int = 132; |
| 483 | |
| 484 | pub const SOCK_SEQPACKET: ::c_int = 5; |
| 485 | |
| 486 | pub const SO_TYPE: ::c_int = 3; |
| 487 | pub const SO_DONTROUTE: ::c_int = 5; |
| 488 | pub const SO_SNDBUF: ::c_int = 7; |
| 489 | pub const SO_RCVBUF: ::c_int = 8; |
| 490 | pub const SO_KEEPALIVE: ::c_int = 9; |
| 491 | pub const SO_OOBINLINE: ::c_int = 10; |
| 492 | pub const SO_LINGER: ::c_int = 13; |
| 493 | pub const SO_REUSEPORT: ::c_int = 15; |
| 494 | pub const SO_PEERCRED: ::c_int = 17; |
| 495 | pub const SO_RCVLOWAT: ::c_int = 18; |
| 496 | pub const SO_SNDLOWAT: ::c_int = 19; |
| 497 | pub const SO_ACCEPTCONN: ::c_int = 30; |
| 498 | |
| 499 | pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15; |
| 500 | pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16; |
| 501 | pub const TCP_THIN_DUPACK: ::c_int = 17; |
| 502 | pub const TCP_USER_TIMEOUT: ::c_int = 18; |
| 503 | pub const TCP_REPAIR: ::c_int = 19; |
| 504 | pub const TCP_REPAIR_QUEUE: ::c_int = 20; |
| 505 | pub const TCP_QUEUE_SEQ: ::c_int = 21; |
| 506 | pub const TCP_REPAIR_OPTIONS: ::c_int = 22; |
| 507 | pub const TCP_FASTOPEN: ::c_int = 23; |
| 508 | pub const TCP_TIMESTAMP: ::c_int = 24; |
| 509 | |
| 510 | pub const SIGCHLD: ::c_int = 17; |
| 511 | pub const SIGUSR1: ::c_int = 10; |
| 512 | pub const SIGUSR2: ::c_int = 12; |
| 513 | pub const SIGCONT: ::c_int = 18; |
| 514 | pub const SIGSTOP: ::c_int = 19; |
| 515 | pub const SIGTSTP: ::c_int = 20; |
| 516 | pub const SIGURG: ::c_int = 23; |
| 517 | pub const SIGIO: ::c_int = 29; |
| 518 | pub const SIGSYS: ::c_int = 31; |
| 519 | pub const SIGSTKFLT: ::c_int = 16; |
| 520 | pub const SIGUNUSED: ::c_int = 31; |
| 521 | pub const SIGTTIN: ::c_int = 21; |
| 522 | pub const SIGTTOU: ::c_int = 22; |
| 523 | pub const SIGXCPU: ::c_int = 24; |
| 524 | pub const SIGXFSZ: ::c_int = 25; |
| 525 | pub const SIGVTALRM: ::c_int = 26; |
| 526 | pub const SIGPROF: ::c_int = 27; |
| 527 | pub const SIGWINCH: ::c_int = 28; |
| 528 | pub const SIGPOLL: ::c_int = 29; |
| 529 | pub const SIGPWR: ::c_int = 30; |
| 530 | pub const SIG_BLOCK: ::c_int = 0x000000; |
| 531 | pub const SIG_UNBLOCK: ::c_int = 0x01; |
| 532 | |
| 533 | pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01; |
| 534 | pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02; |
| 535 | |
| 536 | pub const BUFSIZ: ::c_uint = 8192; |
| 537 | pub const TMP_MAX: ::c_uint = 238328; |
| 538 | pub const FOPEN_MAX: ::c_uint = 16; |
| 539 | pub const POSIX_MADV_DONTNEED: ::c_int = 4; |
| 540 | pub const _SC_2_C_VERSION: ::c_int = 96; |
Ulrich Weigand | 38569c7 | 2016-09-05 19:50:10 +0200 | [diff] [blame] | 541 | pub const O_ASYNC: ::c_int = 0x2000; |
| 542 | pub const O_NDELAY: ::c_int = 0x800; |
Ulrich Weigand | 38569c7 | 2016-09-05 19:50:10 +0200 | [diff] [blame] | 543 | pub const ST_RELATIME: ::c_ulong = 4096; |
| 544 | pub const NI_MAXHOST: ::socklen_t = 1025; |
| 545 | |
| 546 | pub const ADFS_SUPER_MAGIC: ::c_int = 0x0000adf5; |
| 547 | pub const AFFS_SUPER_MAGIC: ::c_int = 0x0000adff; |
| 548 | pub const CODA_SUPER_MAGIC: ::c_int = 0x73757245; |
| 549 | pub const CRAMFS_MAGIC: ::c_int = 0x28cd3d45; |
| 550 | pub const EFS_SUPER_MAGIC: ::c_int = 0x00414a53; |
| 551 | pub const EXT2_SUPER_MAGIC: ::c_int = 0x0000ef53; |
| 552 | pub const EXT3_SUPER_MAGIC: ::c_int = 0x0000ef53; |
| 553 | pub const EXT4_SUPER_MAGIC: ::c_int = 0x0000ef53; |
| 554 | pub const HPFS_SUPER_MAGIC: ::c_int = 0xf995e849; |
| 555 | pub const HUGETLBFS_MAGIC: ::c_int = 0x958458f6; |
| 556 | pub const ISOFS_SUPER_MAGIC: ::c_int = 0x00009660; |
| 557 | pub const JFFS2_SUPER_MAGIC: ::c_int = 0x000072b6; |
| 558 | pub const MINIX_SUPER_MAGIC: ::c_int = 0x0000137f; |
| 559 | pub const MINIX_SUPER_MAGIC2: ::c_int = 0x0000138f; |
| 560 | pub const MINIX2_SUPER_MAGIC: ::c_int = 0x00002468; |
| 561 | pub const MINIX2_SUPER_MAGIC2: ::c_int = 0x00002478; |
| 562 | pub const MSDOS_SUPER_MAGIC: ::c_int = 0x00004d44; |
| 563 | pub const NCP_SUPER_MAGIC: ::c_int = 0x0000564c; |
| 564 | pub const NFS_SUPER_MAGIC: ::c_int = 0x00006969; |
| 565 | pub const OPENPROM_SUPER_MAGIC: ::c_int = 0x00009fa1; |
| 566 | pub const PROC_SUPER_MAGIC: ::c_int = 0x00009fa0; |
| 567 | pub const QNX4_SUPER_MAGIC: ::c_int = 0x0000002f; |
| 568 | pub const REISERFS_SUPER_MAGIC: ::c_int = 0x52654973; |
| 569 | pub const SMB_SUPER_MAGIC: ::c_int = 0x0000517b; |
| 570 | pub const TMPFS_MAGIC: ::c_int = 0x01021994; |
| 571 | pub const USBDEVICE_SUPER_MAGIC: ::c_int = 0x00009fa2; |
| 572 | |
| 573 | pub const VEOF: usize = 4; |
| 574 | pub const VEOL: usize = 11; |
| 575 | pub const VEOL2: usize = 16; |
| 576 | pub const VMIN: usize = 6; |
| 577 | pub const IEXTEN: ::tcflag_t = 0x00008000; |
| 578 | pub const TOSTOP: ::tcflag_t = 0x00000100; |
| 579 | pub const FLUSHO: ::tcflag_t = 0x00001000; |
Ulrich Weigand | 38569c7 | 2016-09-05 19:50:10 +0200 | [diff] [blame] | 580 | |
| 581 | pub const CPU_SETSIZE: ::c_int = 0x400; |
| 582 | |
| 583 | pub const EXTPROC: ::tcflag_t = 0x00010000; |
| 584 | |
| 585 | pub const QFMT_VFS_V1: ::c_int = 4; |
| 586 | |
| 587 | pub const PTRACE_TRACEME: ::c_uint = 0; |
| 588 | pub const PTRACE_PEEKTEXT: ::c_uint = 1; |
| 589 | pub const PTRACE_PEEKDATA: ::c_uint = 2; |
| 590 | pub const PTRACE_PEEKUSER: ::c_uint = 3; |
| 591 | pub const PTRACE_POKETEXT: ::c_uint = 4; |
| 592 | pub const PTRACE_POKEDATA: ::c_uint = 5; |
| 593 | pub const PTRACE_POKEUSER: ::c_uint = 6; |
| 594 | pub const PTRACE_CONT: ::c_uint = 7; |
| 595 | pub const PTRACE_KILL: ::c_uint = 8; |
| 596 | pub const PTRACE_SINGLESTEP: ::c_uint = 9; |
| 597 | pub const PTRACE_GETREGS: ::c_uint = 12; |
| 598 | pub const PTRACE_SETREGS: ::c_uint = 13; |
| 599 | pub const PTRACE_GETFPREGS: ::c_uint = 14; |
| 600 | pub const PTRACE_SETFPREGS: ::c_uint = 15; |
| 601 | pub const PTRACE_ATTACH: ::c_uint = 16; |
| 602 | pub const PTRACE_DETACH: ::c_uint = 17; |
| 603 | pub const PTRACE_SYSCALL: ::c_uint = 24; |
| 604 | pub const PTRACE_SETOPTIONS: ::c_uint = 0x4200; |
| 605 | pub const PTRACE_GETEVENTMSG: ::c_uint = 0x4201; |
| 606 | pub const PTRACE_GETSIGINFO: ::c_uint = 0x4202; |
| 607 | pub const PTRACE_SETSIGINFO: ::c_uint = 0x4203; |
| 608 | pub const PTRACE_GETREGSET: ::c_uint = 0x4204; |
| 609 | pub const PTRACE_SETREGSET: ::c_uint = 0x4205; |
| 610 | pub const PTRACE_SEIZE: ::c_uint = 0x4206; |
| 611 | pub const PTRACE_INTERRUPT: ::c_uint = 0x4207; |
| 612 | pub const PTRACE_LISTEN: ::c_uint = 0x4208; |
| 613 | pub const PTRACE_PEEKSIGINFO: ::c_uint = 0x4209; |
| 614 | |
| 615 | pub const MADV_DODUMP: ::c_int = 17; |
| 616 | pub const MADV_DONTDUMP: ::c_int = 16; |
| 617 | |
| 618 | pub const EPOLLWAKEUP: ::c_int = 0x20000000; |
| 619 | |
| 620 | pub const MADV_HUGEPAGE: ::c_int = 14; |
| 621 | pub const MADV_NOHUGEPAGE: ::c_int = 15; |
| 622 | pub const MAP_HUGETLB: ::c_int = 0x040000; |
| 623 | |
| 624 | pub const EFD_NONBLOCK: ::c_int = 0x800; |
| 625 | |
| 626 | pub const F_GETLK: ::c_int = 5; |
| 627 | pub const F_GETOWN: ::c_int = 9; |
| 628 | pub const F_SETOWN: ::c_int = 8; |
| 629 | pub const F_SETLK: ::c_int = 6; |
| 630 | pub const F_SETLKW: ::c_int = 7; |
| 631 | |
| 632 | pub const SEEK_DATA: ::c_int = 3; |
| 633 | pub const SEEK_HOLE: ::c_int = 4; |
| 634 | |
| 635 | pub const SFD_NONBLOCK: ::c_int = 0x0800; |
| 636 | |
| 637 | pub const TCSANOW: ::c_int = 0; |
| 638 | pub const TCSADRAIN: ::c_int = 1; |
| 639 | pub const TCSAFLUSH: ::c_int = 2; |
| 640 | |
| 641 | pub const TCGETS: ::c_ulong = 0x5401; |
| 642 | pub const TCSETS: ::c_ulong = 0x5402; |
| 643 | pub const TCSETSW: ::c_ulong = 0x5403; |
| 644 | pub const TCSETSF: ::c_ulong = 0x5404; |
| 645 | pub const TCGETA: ::c_ulong = 0x5405; |
| 646 | pub const TCSETA: ::c_ulong = 0x5406; |
| 647 | pub const TCSETAW: ::c_ulong = 0x5407; |
| 648 | pub const TCSETAF: ::c_ulong = 0x5408; |
| 649 | pub const TCSBRK: ::c_ulong = 0x5409; |
| 650 | pub const TCXONC: ::c_ulong = 0x540A; |
| 651 | pub const TCFLSH: ::c_ulong = 0x540B; |
| 652 | pub const TIOCGSOFTCAR: ::c_ulong = 0x5419; |
| 653 | pub const TIOCSSOFTCAR: ::c_ulong = 0x541A; |
| 654 | pub const TIOCINQ: ::c_ulong = 0x541B; |
| 655 | pub const TIOCLINUX: ::c_ulong = 0x541C; |
| 656 | pub const TIOCGSERIAL: ::c_ulong = 0x541E; |
| 657 | pub const TIOCEXCL: ::c_ulong = 0x540C; |
| 658 | pub const TIOCNXCL: ::c_ulong = 0x540D; |
| 659 | pub const TIOCSCTTY: ::c_ulong = 0x540E; |
| 660 | pub const TIOCGPGRP: ::c_ulong = 0x540F; |
| 661 | pub const TIOCSPGRP: ::c_ulong = 0x5410; |
| 662 | pub const TIOCOUTQ: ::c_ulong = 0x5411; |
| 663 | pub const TIOCSTI: ::c_ulong = 0x5412; |
| 664 | pub const TIOCGWINSZ: ::c_ulong = 0x5413; |
| 665 | pub const TIOCSWINSZ: ::c_ulong = 0x5414; |
| 666 | pub const TIOCMGET: ::c_ulong = 0x5415; |
| 667 | pub const TIOCMBIS: ::c_ulong = 0x5416; |
| 668 | pub const TIOCMBIC: ::c_ulong = 0x5417; |
| 669 | pub const TIOCMSET: ::c_ulong = 0x5418; |
| 670 | pub const FIONREAD: ::c_ulong = 0x541B; |
| 671 | pub const TIOCCONS: ::c_ulong = 0x541D; |
| 672 | |
| 673 | pub const RTLD_DEEPBIND: ::c_int = 0x8; |
| 674 | pub const RTLD_GLOBAL: ::c_int = 0x100; |
| 675 | pub const RTLD_NOLOAD: ::c_int = 0x4; |
| 676 | |
| 677 | pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead; |
| 678 | pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793; |
| 679 | pub const LINUX_REBOOT_MAGIC2A: ::c_int = 85072278; |
| 680 | pub const LINUX_REBOOT_MAGIC2B: ::c_int = 369367448; |
| 681 | pub const LINUX_REBOOT_MAGIC2C: ::c_int = 537993216; |
| 682 | |
| 683 | pub const LINUX_REBOOT_CMD_RESTART: ::c_int = 0x01234567; |
| 684 | pub const LINUX_REBOOT_CMD_HALT: ::c_int = 0xCDEF0123; |
| 685 | pub const LINUX_REBOOT_CMD_CAD_ON: ::c_int = 0x89ABCDEF; |
| 686 | pub const LINUX_REBOOT_CMD_CAD_OFF: ::c_int = 0x00000000; |
| 687 | pub const LINUX_REBOOT_CMD_POWER_OFF: ::c_int = 0x4321FEDC; |
| 688 | pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4; |
| 689 | pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2; |
| 690 | pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543; |
| 691 | |
| 692 | pub const SYS_gettid: ::c_long = 236; |
| 693 | pub const SYS_perf_event_open: ::c_long = 331; |
| 694 | |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 695 | #[link(name = "util")] |
| 696 | extern { |
Ulrich Weigand | 38569c7 | 2016-09-05 19:50:10 +0200 | [diff] [blame] | 697 | pub fn sysctl(name: *mut ::c_int, |
| 698 | namelen: ::c_int, |
| 699 | oldp: *mut ::c_void, |
| 700 | oldlenp: *mut ::size_t, |
| 701 | newp: *mut ::c_void, |
| 702 | newlen: ::size_t) |
| 703 | -> ::c_int; |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 704 | pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; |
Ulrich Weigand | 38569c7 | 2016-09-05 19:50:10 +0200 | [diff] [blame] | 705 | pub fn backtrace(buf: *mut *mut ::c_void, |
| 706 | sz: ::c_int) -> ::c_int; |
| 707 | pub fn glob64(pattern: *const ::c_char, |
| 708 | flags: ::c_int, |
| 709 | errfunc: ::dox::Option<extern fn(epath: *const ::c_char, |
| 710 | errno: ::c_int) |
| 711 | -> ::c_int>, |
| 712 | pglob: *mut glob64_t) -> ::c_int; |
| 713 | pub fn globfree64(pglob: *mut glob64_t); |
| 714 | pub fn ptrace(request: ::c_uint, ...) -> ::c_long; |
| 715 | pub fn pthread_attr_getaffinity_np(attr: *const ::pthread_attr_t, |
| 716 | cpusetsize: ::size_t, |
| 717 | cpuset: *mut ::cpu_set_t) -> ::c_int; |
| 718 | pub fn pthread_attr_setaffinity_np(attr: *mut ::pthread_attr_t, |
| 719 | cpusetsize: ::size_t, |
| 720 | cpuset: *const ::cpu_set_t) -> ::c_int; |
| 721 | pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int; |
| 722 | pub fn setpriority(which: ::__priority_which_t, who: ::id_t, |
| 723 | prio: ::c_int) -> ::c_int; |
| 724 | pub fn pthread_getaffinity_np(thread: ::pthread_t, |
| 725 | cpusetsize: ::size_t, |
| 726 | cpuset: *mut ::cpu_set_t) -> ::c_int; |
| 727 | pub fn pthread_setaffinity_np(thread: ::pthread_t, |
| 728 | cpusetsize: ::size_t, |
| 729 | cpuset: *const ::cpu_set_t) -> ::c_int; |
| 730 | pub fn sched_getcpu() -> ::c_int; |
| 731 | pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int; |
| 732 | pub fn setcontext(ucp: *const ucontext_t) -> ::c_int; |
| 733 | pub fn makecontext(ucp: *mut ucontext_t, |
| 734 | func: extern fn (), |
| 735 | argc: ::c_int, ...); |
| 736 | pub fn swapcontext(uocp: *mut ucontext_t, |
| 737 | ucp: *const ucontext_t) -> ::c_int; |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 738 | } |