1 pub type sa_family_t = u16; 2 pub type pthread_key_t = ::c_uint; 3 pub type speed_t = ::c_uint; 4 pub type tcflag_t = ::c_uint; 5 pub type loff_t = ::c_longlong; 6 pub type clockid_t = ::c_int; 7 pub type key_t = ::c_int; 8 pub type id_t = ::c_uint; 9 pub type useconds_t = u32; 10 pub type dev_t = u64; 11 pub type socklen_t = u32; 12 pub type mode_t = u32; 13 pub type ino64_t = u64; 14 pub type off64_t = i64; 15 pub type blkcnt64_t = i64; 16 pub type rlim64_t = u64; 17 pub type shmatt_t = ::c_ulong; 18 pub type mqd_t = ::c_int; 19 pub type msgqnum_t = ::c_ulong; 20 pub type msglen_t = ::c_ulong; 21 pub type nfds_t = ::c_ulong; 22 pub type nl_item = ::c_int; 23 pub type idtype_t = ::c_uint; 24 pub type Elf32_Half = u16; 25 pub type Elf32_Word = u32; 26 pub type Elf32_Off = u32; 27 pub type Elf32_Addr = u32; 28 pub type Elf64_Half = u16; 29 pub type Elf64_Word = u32; 30 pub type Elf64_Off = u64; 31 pub type Elf64_Addr = u64; 32 pub type Elf64_Xword = u64; 33 pub type Elf64_Sxword = i64; 34 35 #[cfg_attr(feature = "extra_traits", derive(Debug))] 36 pub enum fpos64_t {} // FIXME: fill this out with a struct 37 impl ::Copy for fpos64_t {} 38 impl ::Clone for fpos64_t { clone(&self) -> fpos64_t39 fn clone(&self) -> fpos64_t { 40 *self 41 } 42 } 43 44 #[cfg_attr(feature = "extra_traits", derive(Debug))] 45 pub enum timezone {} 46 impl ::Copy for timezone {} 47 impl ::Clone for timezone { clone(&self) -> timezone48 fn clone(&self) -> timezone { 49 *self 50 } 51 } 52 53 s! { 54 pub struct in_addr { 55 pub s_addr: ::in_addr_t, 56 } 57 58 pub struct ip_mreq { 59 pub imr_multiaddr: in_addr, 60 pub imr_interface: in_addr, 61 } 62 63 pub struct sockaddr { 64 pub sa_family: sa_family_t, 65 pub sa_data: [::c_char; 14], 66 } 67 68 pub struct sockaddr_in { 69 pub sin_family: sa_family_t, 70 pub sin_port: ::in_port_t, 71 pub sin_addr: ::in_addr, 72 pub sin_zero: [u8; 8], 73 } 74 75 pub struct sockaddr_in6 { 76 pub sin6_family: sa_family_t, 77 pub sin6_port: ::in_port_t, 78 pub sin6_flowinfo: u32, 79 pub sin6_addr: ::in6_addr, 80 pub sin6_scope_id: u32, 81 } 82 83 pub struct addrinfo { 84 pub ai_flags: ::c_int, 85 pub ai_family: ::c_int, 86 pub ai_socktype: ::c_int, 87 pub ai_protocol: ::c_int, 88 pub ai_addrlen: socklen_t, 89 90 pub ai_addr: *mut ::sockaddr, 91 92 pub ai_canonname: *mut c_char, 93 94 pub ai_next: *mut addrinfo, 95 } 96 97 pub struct sockaddr_ll { 98 pub sll_family: ::c_ushort, 99 pub sll_protocol: ::c_ushort, 100 pub sll_ifindex: ::c_int, 101 pub sll_hatype: ::c_ushort, 102 pub sll_pkttype: ::c_uchar, 103 pub sll_halen: ::c_uchar, 104 pub sll_addr: [::c_uchar; 8] 105 } 106 107 pub struct fd_set { 108 fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE], 109 } 110 111 pub struct tm { 112 pub tm_sec: ::c_int, 113 pub tm_min: ::c_int, 114 pub tm_hour: ::c_int, 115 pub tm_mday: ::c_int, 116 pub tm_mon: ::c_int, 117 pub tm_year: ::c_int, 118 pub tm_wday: ::c_int, 119 pub tm_yday: ::c_int, 120 pub tm_isdst: ::c_int, 121 pub tm_gmtoff: ::c_long, 122 pub tm_zone: *const ::c_char, 123 } 124 125 pub struct sched_param { 126 pub sched_priority: ::c_int, 127 } 128 129 pub struct Dl_info { 130 pub dli_fname: *const ::c_char, 131 pub dli_fbase: *mut ::c_void, 132 pub dli_sname: *const ::c_char, 133 pub dli_saddr: *mut ::c_void, 134 } 135 136 pub struct lconv { 137 pub decimal_point: *mut ::c_char, 138 pub thousands_sep: *mut ::c_char, 139 pub grouping: *mut ::c_char, 140 pub int_curr_symbol: *mut ::c_char, 141 pub currency_symbol: *mut ::c_char, 142 pub mon_decimal_point: *mut ::c_char, 143 pub mon_thousands_sep: *mut ::c_char, 144 pub mon_grouping: *mut ::c_char, 145 pub positive_sign: *mut ::c_char, 146 pub negative_sign: *mut ::c_char, 147 pub int_frac_digits: ::c_char, 148 pub frac_digits: ::c_char, 149 pub p_cs_precedes: ::c_char, 150 pub p_sep_by_space: ::c_char, 151 pub n_cs_precedes: ::c_char, 152 pub n_sep_by_space: ::c_char, 153 pub p_sign_posn: ::c_char, 154 pub n_sign_posn: ::c_char, 155 pub int_p_cs_precedes: ::c_char, 156 pub int_p_sep_by_space: ::c_char, 157 pub int_n_cs_precedes: ::c_char, 158 pub int_n_sep_by_space: ::c_char, 159 pub int_p_sign_posn: ::c_char, 160 pub int_n_sign_posn: ::c_char, 161 } 162 163 pub struct rlimit64 { 164 pub rlim_cur: rlim64_t, 165 pub rlim_max: rlim64_t, 166 } 167 168 pub struct glob_t { 169 pub gl_pathc: ::size_t, 170 pub gl_pathv: *mut *mut c_char, 171 pub gl_offs: ::size_t, 172 pub gl_flags: ::c_int, 173 174 __unused1: *mut ::c_void, 175 __unused2: *mut ::c_void, 176 __unused3: *mut ::c_void, 177 __unused4: *mut ::c_void, 178 __unused5: *mut ::c_void, 179 } 180 181 pub struct ifaddrs { 182 pub ifa_next: *mut ifaddrs, 183 pub ifa_name: *mut c_char, 184 pub ifa_flags: ::c_uint, 185 pub ifa_addr: *mut ::sockaddr, 186 pub ifa_netmask: *mut ::sockaddr, 187 pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union 188 pub ifa_data: *mut ::c_void 189 } 190 191 pub struct pthread_rwlockattr_t { 192 __lockkind: ::c_int, 193 __pshared: ::c_int, 194 } 195 196 pub struct passwd { 197 pub pw_name: *mut ::c_char, 198 pub pw_passwd: *mut ::c_char, 199 pub pw_uid: ::uid_t, 200 pub pw_gid: ::gid_t, 201 pub pw_gecos: *mut ::c_char, 202 pub pw_dir: *mut ::c_char, 203 pub pw_shell: *mut ::c_char, 204 } 205 206 pub struct spwd { 207 pub sp_namp: *mut ::c_char, 208 pub sp_pwdp: *mut ::c_char, 209 pub sp_lstchg: ::c_long, 210 pub sp_min: ::c_long, 211 pub sp_max: ::c_long, 212 pub sp_warn: ::c_long, 213 pub sp_inact: ::c_long, 214 pub sp_expire: ::c_long, 215 pub sp_flag: ::c_ulong, 216 } 217 218 pub struct statvfs { 219 pub f_bsize: ::c_ulong, 220 pub f_frsize: ::c_ulong, 221 pub f_blocks: ::fsblkcnt_t, 222 pub f_bfree: ::fsblkcnt_t, 223 pub f_bavail: ::fsblkcnt_t, 224 pub f_files: ::fsfilcnt_t, 225 pub f_ffree: ::fsfilcnt_t, 226 pub f_favail: ::fsfilcnt_t, 227 #[cfg(target_endian = "little")] 228 pub f_fsid: ::c_ulong, 229 #[cfg(target_pointer_width = "32")] 230 __f_unused: ::c_int, 231 #[cfg(target_endian = "big")] 232 pub f_fsid: ::c_ulong, 233 pub f_flag: ::c_ulong, 234 pub f_namemax: ::c_ulong, 235 __f_spare: [::c_int; 6], 236 } 237 238 pub struct dqblk { 239 pub dqb_bhardlimit: u32, 240 pub dqb_bsoftlimit: u32, 241 pub dqb_curblocks: u32, 242 pub dqb_ihardlimit: u32, 243 pub dqb_isoftlimit: u32, 244 pub dqb_curinodes: u32, 245 pub dqb_btime: ::time_t, 246 pub dqb_itime: ::time_t, 247 } 248 249 pub struct signalfd_siginfo { 250 pub ssi_signo: u32, 251 pub ssi_errno: i32, 252 pub ssi_code: i32, 253 pub ssi_pid: u32, 254 pub ssi_uid: u32, 255 pub ssi_fd: i32, 256 pub ssi_tid: u32, 257 pub ssi_band: u32, 258 pub ssi_overrun: u32, 259 pub ssi_trapno: u32, 260 pub ssi_status: i32, 261 pub ssi_int: i32, 262 pub ssi_ptr: u64, 263 pub ssi_utime: u64, 264 pub ssi_stime: u64, 265 pub ssi_addr: u64, 266 pub ssi_addr_lsb: u16, 267 _pad2: u16, 268 pub ssi_syscall: i32, 269 pub ssi_call_addr: u64, 270 pub ssi_arch: u32, 271 _pad: [u8; 28], 272 } 273 274 pub struct fsid_t { 275 __val: [::c_int; 2], 276 } 277 278 pub struct cpu_set_t { 279 #[cfg(target_pointer_width = "32")] 280 bits: [u32; 32], 281 #[cfg(target_pointer_width = "64")] 282 bits: [u64; 16], 283 } 284 285 pub struct if_nameindex { 286 pub if_index: ::c_uint, 287 pub if_name: *mut ::c_char, 288 } 289 290 // System V IPC 291 pub struct msginfo { 292 pub msgpool: ::c_int, 293 pub msgmap: ::c_int, 294 pub msgmax: ::c_int, 295 pub msgmnb: ::c_int, 296 pub msgmni: ::c_int, 297 pub msgssz: ::c_int, 298 pub msgtql: ::c_int, 299 pub msgseg: ::c_ushort, 300 } 301 302 pub struct Elf32_Phdr { 303 pub p_type: Elf32_Word, 304 pub p_offset: Elf32_Off, 305 pub p_vaddr: Elf32_Addr, 306 pub p_paddr: Elf32_Addr, 307 pub p_filesz: Elf32_Word, 308 pub p_memsz: Elf32_Word, 309 pub p_flags: Elf32_Word, 310 pub p_align: Elf32_Word, 311 } 312 313 pub struct Elf64_Phdr { 314 pub p_type: Elf64_Word, 315 pub p_flags: Elf64_Word, 316 pub p_offset: Elf64_Off, 317 pub p_vaddr: Elf64_Addr, 318 pub p_paddr: Elf64_Addr, 319 pub p_filesz: Elf64_Xword, 320 pub p_memsz: Elf64_Xword, 321 pub p_align: Elf64_Xword, 322 } 323 324 pub struct dl_phdr_info { 325 #[cfg(target_pointer_width = "64")] 326 pub dlpi_addr: Elf64_Addr, 327 #[cfg(target_pointer_width = "32")] 328 pub dlpi_addr: Elf32_Addr, 329 pub dlpi_name: *const ::c_char, 330 #[cfg(target_pointer_width = "64")] 331 pub dlpi_phdr: *const Elf64_Phdr, 332 #[cfg(target_pointer_width = "32")] 333 pub dlpi_phdr: *const Elf32_Phdr, 334 #[cfg(target_pointer_width = "64")] 335 pub dlpi_phnum: Elf64_Half, 336 #[cfg(target_pointer_width = "32")] 337 pub dlpi_phnum: Elf32_Half, 338 // As of uClibc 1.0.36, the following fields are 339 // gated behind a "#if 0" block which always evaluates 340 // to false. So I'm just commenting these out and if uClibc changes 341 // the #if block in the future to include the following fields, these 342 // will probably need including here. tsidea 343 // 344 // pub dlpi_adds: ::c_ulonglong, 345 // pub dlpi_subs: ::c_ulonglong, 346 // pub dlpi_tls_modid: ::size_t, 347 // pub dlpi_tls_data: *mut ::c_void, 348 } 349 350 pub struct ucred { 351 pub pid: ::pid_t, 352 pub uid: ::uid_t, 353 pub gid: ::gid_t, 354 } 355 } 356 357 s_no_extra_traits! { 358 #[cfg_attr( 359 any(target_arch = "x86", target_arch = "x86_64"), 360 repr(packed) 361 )] 362 #[allow(missing_debug_implementations)] 363 pub struct epoll_event { 364 pub events: u32, 365 pub u64: u64, 366 } 367 368 #[allow(missing_debug_implementations)] 369 pub struct sockaddr_un { 370 pub sun_family: sa_family_t, 371 pub sun_path: [::c_char; 108] 372 } 373 374 #[allow(missing_debug_implementations)] 375 pub struct sockaddr_storage { 376 pub ss_family: sa_family_t, 377 __ss_align: ::size_t, 378 #[cfg(target_pointer_width = "32")] 379 __ss_pad2: [u8; 128 - 2 * 4], 380 #[cfg(target_pointer_width = "64")] 381 __ss_pad2: [u8; 128 - 2 * 8], 382 } 383 384 #[allow(missing_debug_implementations)] 385 pub struct utsname { 386 pub sysname: [::c_char; 65], 387 pub nodename: [::c_char; 65], 388 pub release: [::c_char; 65], 389 pub version: [::c_char; 65], 390 pub machine: [::c_char; 65], 391 pub domainname: [::c_char; 65] 392 } 393 394 #[allow(missing_debug_implementations)] 395 pub struct dirent { 396 pub d_ino: ::ino_t, 397 pub d_off: ::off_t, 398 pub d_reclen: ::c_ushort, 399 pub d_type: ::c_uchar, 400 pub d_name: [::c_char; 256], 401 } 402 403 #[allow(missing_debug_implementations)] 404 pub struct dirent64 { 405 pub d_ino: ::ino64_t, 406 pub d_off: ::off64_t, 407 pub d_reclen: ::c_ushort, 408 pub d_type: ::c_uchar, 409 pub d_name: [::c_char; 256], 410 } 411 412 pub struct mq_attr { 413 pub mq_flags: ::c_long, 414 pub mq_maxmsg: ::c_long, 415 pub mq_msgsize: ::c_long, 416 pub mq_curmsgs: ::c_long, 417 pad: [::c_long; 4] 418 } 419 420 pub struct sockaddr_nl { 421 pub nl_family: ::sa_family_t, 422 nl_pad: ::c_ushort, 423 pub nl_pid: u32, 424 pub nl_groups: u32 425 } 426 427 pub struct sigevent { 428 pub sigev_value: ::sigval, 429 pub sigev_signo: ::c_int, 430 pub sigev_notify: ::c_int, 431 // Actually a union. We only expose sigev_notify_thread_id because it's 432 // the most useful member 433 pub sigev_notify_thread_id: ::c_int, 434 #[cfg(target_pointer_width = "64")] 435 __unused1: [::c_int; 11], 436 #[cfg(target_pointer_width = "32")] 437 __unused1: [::c_int; 12] 438 } 439 } 440 441 cfg_if! { 442 if #[cfg(feature = "extra_traits")] { 443 impl PartialEq for mq_attr { 444 fn eq(&self, other: &mq_attr) -> bool { 445 self.mq_flags == other.mq_flags && 446 self.mq_maxmsg == other.mq_maxmsg && 447 self.mq_msgsize == other.mq_msgsize && 448 self.mq_curmsgs == other.mq_curmsgs 449 } 450 } 451 impl Eq for mq_attr {} 452 impl ::fmt::Debug for mq_attr { 453 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 454 f.debug_struct("mq_attr") 455 .field("mq_flags", &self.mq_flags) 456 .field("mq_maxmsg", &self.mq_maxmsg) 457 .field("mq_msgsize", &self.mq_msgsize) 458 .field("mq_curmsgs", &self.mq_curmsgs) 459 .finish() 460 } 461 } 462 impl ::hash::Hash for mq_attr { 463 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 464 self.mq_flags.hash(state); 465 self.mq_maxmsg.hash(state); 466 self.mq_msgsize.hash(state); 467 self.mq_curmsgs.hash(state); 468 } 469 } 470 471 impl PartialEq for sockaddr_nl { 472 fn eq(&self, other: &sockaddr_nl) -> bool { 473 self.nl_family == other.nl_family && 474 self.nl_pid == other.nl_pid && 475 self.nl_groups == other.nl_groups 476 } 477 } 478 impl Eq for sockaddr_nl {} 479 impl ::fmt::Debug for sockaddr_nl { 480 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 481 f.debug_struct("sockaddr_nl") 482 .field("nl_family", &self.nl_family) 483 .field("nl_pid", &self.nl_pid) 484 .field("nl_groups", &self.nl_groups) 485 .finish() 486 } 487 } 488 impl ::hash::Hash for sockaddr_nl { 489 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 490 self.nl_family.hash(state); 491 self.nl_pid.hash(state); 492 self.nl_groups.hash(state); 493 } 494 } 495 496 impl PartialEq for sigevent { 497 fn eq(&self, other: &sigevent) -> bool { 498 self.sigev_value == other.sigev_value 499 && self.sigev_signo == other.sigev_signo 500 && self.sigev_notify == other.sigev_notify 501 && self.sigev_notify_thread_id 502 == other.sigev_notify_thread_id 503 } 504 } 505 impl Eq for sigevent {} 506 impl ::fmt::Debug for sigevent { 507 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 508 f.debug_struct("sigevent") 509 .field("sigev_value", &self.sigev_value) 510 .field("sigev_signo", &self.sigev_signo) 511 .field("sigev_notify", &self.sigev_notify) 512 .field("sigev_notify_thread_id", 513 &self.sigev_notify_thread_id) 514 .finish() 515 } 516 } 517 impl ::hash::Hash for sigevent { 518 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 519 self.sigev_value.hash(state); 520 self.sigev_signo.hash(state); 521 self.sigev_notify.hash(state); 522 self.sigev_notify_thread_id.hash(state); 523 } 524 } 525 } 526 } 527 528 // intentionally not public, only used for fd_set 529 cfg_if! { 530 if #[cfg(target_pointer_width = "32")] { 531 const ULONG_SIZE: usize = 32; 532 } else if #[cfg(target_pointer_width = "64")] { 533 const ULONG_SIZE: usize = 64; 534 } else { 535 // Unknown target_pointer_width 536 } 537 } 538 539 pub const EXIT_FAILURE: ::c_int = 1; 540 pub const EXIT_SUCCESS: ::c_int = 0; 541 pub const RAND_MAX: ::c_int = 2147483647; 542 pub const EOF: ::c_int = -1; 543 pub const SEEK_SET: ::c_int = 0; 544 pub const SEEK_CUR: ::c_int = 1; 545 pub const SEEK_END: ::c_int = 2; 546 pub const _IOFBF: ::c_int = 0; 547 pub const _IONBF: ::c_int = 2; 548 pub const _IOLBF: ::c_int = 1; 549 550 pub const F_DUPFD: ::c_int = 0; 551 pub const F_GETFD: ::c_int = 1; 552 pub const F_SETFD: ::c_int = 2; 553 pub const F_GETFL: ::c_int = 3; 554 pub const F_SETFL: ::c_int = 4; 555 556 // Linux-specific fcntls 557 pub const F_SETLEASE: ::c_int = 1024; 558 pub const F_GETLEASE: ::c_int = 1025; 559 pub const F_NOTIFY: ::c_int = 1026; 560 pub const F_DUPFD_CLOEXEC: ::c_int = 1030; 561 562 // FIXME(#235): Include file sealing fcntls once we have a way to verify them. 563 564 pub const SIGTRAP: ::c_int = 5; 565 566 pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0; 567 pub const PTHREAD_CREATE_DETACHED: ::c_int = 1; 568 569 pub const CLOCK_REALTIME: ::clockid_t = 0; 570 pub const CLOCK_MONOTONIC: ::clockid_t = 1; 571 pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2; 572 pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 3; 573 // FIXME: Add these constants once uclibc gets them. 574 // pub const CLOCK_SGI_CYCLE: ::clockid_t = 10; 575 // pub const CLOCK_TAI: ::clockid_t = 11; 576 pub const TIMER_ABSTIME: ::c_int = 1; 577 578 pub const RLIMIT_CPU: ::c_int = 0; 579 pub const RLIMIT_FSIZE: ::c_int = 1; 580 pub const RLIMIT_DATA: ::c_int = 2; 581 pub const RLIMIT_STACK: ::c_int = 3; 582 pub const RLIMIT_CORE: ::c_int = 4; 583 pub const RLIMIT_LOCKS: ::c_int = 10; 584 pub const RLIMIT_SIGPENDING: ::c_int = 11; 585 pub const RLIMIT_MSGQUEUE: ::c_int = 12; 586 pub const RLIMIT_NICE: ::c_int = 13; 587 pub const RLIMIT_RTPRIO: ::c_int = 14; 588 589 pub const RUSAGE_SELF: ::c_int = 0; 590 591 pub const O_RDONLY: ::c_int = 0; 592 pub const O_WRONLY: ::c_int = 1; 593 pub const O_RDWR: ::c_int = 2; 594 595 pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC; 596 597 pub const S_IFIFO: ::mode_t = 4096; 598 pub const S_IFCHR: ::mode_t = 8192; 599 pub const S_IFBLK: ::mode_t = 24576; 600 pub const S_IFDIR: ::mode_t = 16384; 601 pub const S_IFREG: ::mode_t = 32768; 602 pub const S_IFLNK: ::mode_t = 40960; 603 pub const S_IFSOCK: ::mode_t = 49152; 604 pub const S_IFMT: ::mode_t = 61440; 605 pub const S_IRWXU: ::mode_t = 448; 606 pub const S_IXUSR: ::mode_t = 64; 607 pub const S_IWUSR: ::mode_t = 128; 608 pub const S_IRUSR: ::mode_t = 256; 609 pub const S_IRWXG: ::mode_t = 56; 610 pub const S_IXGRP: ::mode_t = 8; 611 pub const S_IWGRP: ::mode_t = 16; 612 pub const S_IRGRP: ::mode_t = 32; 613 pub const S_IRWXO: ::mode_t = 7; 614 pub const S_IXOTH: ::mode_t = 1; 615 pub const S_IWOTH: ::mode_t = 2; 616 pub const S_IROTH: ::mode_t = 4; 617 pub const F_OK: ::c_int = 0; 618 pub const R_OK: ::c_int = 4; 619 pub const W_OK: ::c_int = 2; 620 pub const X_OK: ::c_int = 1; 621 pub const STDIN_FILENO: ::c_int = 0; 622 pub const STDOUT_FILENO: ::c_int = 1; 623 pub const STDERR_FILENO: ::c_int = 2; 624 pub const SIGHUP: ::c_int = 1; 625 pub const SIGINT: ::c_int = 2; 626 pub const SIGQUIT: ::c_int = 3; 627 pub const SIGILL: ::c_int = 4; 628 pub const SIGABRT: ::c_int = 6; 629 pub const SIGFPE: ::c_int = 8; 630 pub const SIGKILL: ::c_int = 9; 631 pub const SIGSEGV: ::c_int = 11; 632 pub const SIGPIPE: ::c_int = 13; 633 pub const SIGALRM: ::c_int = 14; 634 pub const SIGTERM: ::c_int = 15; 635 636 pub const PROT_NONE: ::c_int = 0; 637 pub const PROT_READ: ::c_int = 1; 638 pub const PROT_WRITE: ::c_int = 2; 639 pub const PROT_EXEC: ::c_int = 4; 640 641 pub const LC_CTYPE: ::c_int = 0; 642 pub const LC_NUMERIC: ::c_int = 1; 643 pub const LC_MONETARY: ::c_int = 2; 644 pub const LC_TIME: ::c_int = 3; 645 pub const LC_COLLATE: ::c_int = 4; 646 pub const LC_MESSAGES: ::c_int = 5; 647 pub const LC_ALL: ::c_int = 6; 648 pub const LC_CTYPE_MASK: ::c_int = 1 << LC_CTYPE; 649 pub const LC_NUMERIC_MASK: ::c_int = 1 << LC_NUMERIC; 650 pub const LC_TIME_MASK: ::c_int = 1 << LC_TIME; 651 pub const LC_COLLATE_MASK: ::c_int = 1 << LC_COLLATE; 652 pub const LC_MONETARY_MASK: ::c_int = 1 << LC_MONETARY; 653 pub const LC_MESSAGES_MASK: ::c_int = 1 << LC_MESSAGES; 654 // LC_ALL_MASK defined per platform 655 656 pub const MAP_FILE: ::c_int = 0x0000; 657 pub const MAP_SHARED: ::c_int = 0x0001; 658 pub const MAP_PRIVATE: ::c_int = 0x0002; 659 pub const MAP_FIXED: ::c_int = 0x0010; 660 661 pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; 662 663 // MS_ flags for msync(2) 664 pub const MS_ASYNC: ::c_int = 0x0001; 665 pub const MS_INVALIDATE: ::c_int = 0x0002; 666 pub const MS_SYNC: ::c_int = 0x0004; 667 668 // MS_ flags for mount(2) 669 pub const MS_RDONLY: ::c_ulong = 0x01; 670 pub const MS_NOSUID: ::c_ulong = 0x02; 671 pub const MS_NODEV: ::c_ulong = 0x04; 672 pub const MS_NOEXEC: ::c_ulong = 0x08; 673 pub const MS_SYNCHRONOUS: ::c_ulong = 0x10; 674 pub const MS_REMOUNT: ::c_ulong = 0x20; 675 pub const MS_MANDLOCK: ::c_ulong = 0x40; 676 pub const MS_NOATIME: ::c_ulong = 0x0400; 677 pub const MS_NODIRATIME: ::c_ulong = 0x0800; 678 pub const MS_BIND: ::c_ulong = 0x1000; 679 pub const MS_NOUSER: ::c_ulong = 0x80000000; 680 pub const MS_MGC_VAL: ::c_ulong = 0xc0ed0000; 681 pub const MS_MGC_MSK: ::c_ulong = 0xffff0000; 682 pub const MS_RMT_MASK: ::c_ulong = 0x800051; 683 684 pub const EPERM: ::c_int = 1; 685 pub const ENOENT: ::c_int = 2; 686 pub const ESRCH: ::c_int = 3; 687 pub const EINTR: ::c_int = 4; 688 pub const EIO: ::c_int = 5; 689 pub const ENXIO: ::c_int = 6; 690 pub const E2BIG: ::c_int = 7; 691 pub const ENOEXEC: ::c_int = 8; 692 pub const EBADF: ::c_int = 9; 693 pub const ECHILD: ::c_int = 10; 694 pub const EAGAIN: ::c_int = 11; 695 pub const ENOMEM: ::c_int = 12; 696 pub const EACCES: ::c_int = 13; 697 pub const EFAULT: ::c_int = 14; 698 pub const ENOTBLK: ::c_int = 15; 699 pub const EBUSY: ::c_int = 16; 700 pub const EEXIST: ::c_int = 17; 701 pub const EXDEV: ::c_int = 18; 702 pub const ENODEV: ::c_int = 19; 703 pub const ENOTDIR: ::c_int = 20; 704 pub const EISDIR: ::c_int = 21; 705 pub const EINVAL: ::c_int = 22; 706 pub const ENFILE: ::c_int = 23; 707 pub const EMFILE: ::c_int = 24; 708 pub const ENOTTY: ::c_int = 25; 709 pub const ETXTBSY: ::c_int = 26; 710 pub const EFBIG: ::c_int = 27; 711 pub const ENOSPC: ::c_int = 28; 712 pub const ESPIPE: ::c_int = 29; 713 pub const EROFS: ::c_int = 30; 714 pub const EMLINK: ::c_int = 31; 715 pub const EPIPE: ::c_int = 32; 716 pub const EDOM: ::c_int = 33; 717 pub const ERANGE: ::c_int = 34; 718 pub const EWOULDBLOCK: ::c_int = EAGAIN; 719 720 pub const SCM_RIGHTS: ::c_int = 0x01; 721 pub const SCM_CREDENTIALS: ::c_int = 0x02; 722 723 // netinet/in.h 724 // NOTE: These are in addition to the constants defined in src/unix/mod.rs 725 726 // IPPROTO_IP defined in src/unix/mod.rs 727 /// Hop-by-hop option header 728 pub const IPPROTO_HOPOPTS: ::c_int = 0; 729 // IPPROTO_ICMP defined in src/unix/mod.rs 730 /// group mgmt protocol 731 pub const IPPROTO_IGMP: ::c_int = 2; 732 /// for compatibility 733 pub const IPPROTO_IPIP: ::c_int = 4; 734 // IPPROTO_TCP defined in src/unix/mod.rs 735 /// exterior gateway protocol 736 pub const IPPROTO_EGP: ::c_int = 8; 737 /// pup 738 pub const IPPROTO_PUP: ::c_int = 12; 739 // IPPROTO_UDP defined in src/unix/mod.rs 740 /// xns idp 741 pub const IPPROTO_IDP: ::c_int = 22; 742 /// tp-4 w/ class negotiation 743 pub const IPPROTO_TP: ::c_int = 29; 744 /// DCCP 745 pub const IPPROTO_DCCP: ::c_int = 33; 746 // IPPROTO_IPV6 defined in src/unix/mod.rs 747 /// IP6 routing header 748 pub const IPPROTO_ROUTING: ::c_int = 43; 749 /// IP6 fragmentation header 750 pub const IPPROTO_FRAGMENT: ::c_int = 44; 751 /// resource reservation 752 pub const IPPROTO_RSVP: ::c_int = 46; 753 /// General Routing Encap. 754 pub const IPPROTO_GRE: ::c_int = 47; 755 /// IP6 Encap Sec. Payload 756 pub const IPPROTO_ESP: ::c_int = 50; 757 /// IP6 Auth Header 758 pub const IPPROTO_AH: ::c_int = 51; 759 // IPPROTO_ICMPV6 defined in src/unix/mod.rs 760 /// IP6 no next header 761 pub const IPPROTO_NONE: ::c_int = 59; 762 /// IP6 destination option 763 pub const IPPROTO_DSTOPTS: ::c_int = 60; 764 pub const IPPROTO_MTP: ::c_int = 92; 765 pub const IPPROTO_BEETPH: ::c_int = 94; 766 /// encapsulation header 767 pub const IPPROTO_ENCAP: ::c_int = 98; 768 /// Protocol indep. multicast 769 pub const IPPROTO_PIM: ::c_int = 103; 770 /// IP Payload Comp. Protocol 771 pub const IPPROTO_COMP: ::c_int = 108; 772 /// SCTP 773 pub const IPPROTO_SCTP: ::c_int = 132; 774 pub const IPPROTO_MH: ::c_int = 135; 775 pub const IPPROTO_UDPLITE: ::c_int = 136; 776 pub const IPPROTO_MPLS: ::c_int = 137; 777 /// raw IP packet 778 pub const IPPROTO_RAW: ::c_int = 255; 779 pub const IPPROTO_MAX: ::c_int = 256; 780 781 pub const PROT_GROWSDOWN: ::c_int = 0x1000000; 782 pub const PROT_GROWSUP: ::c_int = 0x2000000; 783 784 pub const MAP_TYPE: ::c_int = 0x000f; 785 786 pub const MADV_NORMAL: ::c_int = 0; 787 pub const MADV_RANDOM: ::c_int = 1; 788 pub const MADV_SEQUENTIAL: ::c_int = 2; 789 pub const MADV_WILLNEED: ::c_int = 3; 790 pub const MADV_DONTNEED: ::c_int = 4; 791 pub const MADV_REMOVE: ::c_int = 9; 792 pub const MADV_DONTFORK: ::c_int = 10; 793 pub const MADV_DOFORK: ::c_int = 11; 794 pub const MADV_MERGEABLE: ::c_int = 12; 795 pub const MADV_UNMERGEABLE: ::c_int = 13; 796 pub const MADV_HWPOISON: ::c_int = 100; 797 798 // https://github.com/kraj/uClibc/blob/master/include/net/if.h#L44 799 pub const IFF_UP: ::c_int = 0x1; // Interface is up. 800 pub const IFF_BROADCAST: ::c_int = 0x2; // Broadcast address valid. 801 pub const IFF_DEBUG: ::c_int = 0x4; // Turn on debugging. 802 pub const IFF_LOOPBACK: ::c_int = 0x8; // Is a loopback net. 803 pub const IFF_POINTOPOINT: ::c_int = 0x10; // Interface is point-to-point link. 804 pub const IFF_NOTRAILERS: ::c_int = 0x20; // Avoid use of trailers. 805 pub const IFF_RUNNING: ::c_int = 0x40; // Resources allocated. 806 pub const IFF_NOARP: ::c_int = 0x80; // No address resolution protocol. 807 pub const IFF_PROMISC: ::c_int = 0x100; // Receive all packets. 808 809 // Not supported 810 pub const IFF_ALLMULTI: ::c_int = 0x200; // Receive all multicast packets. 811 pub const IFF_MASTER: ::c_int = 0x400; // Master of a load balancer. 812 pub const IFF_SLAVE: ::c_int = 0x800; // Slave of a load balancer. 813 pub const IFF_MULTICAST: ::c_int = 0x1000; // Supports multicast. 814 pub const IFF_PORTSEL: ::c_int = 0x2000; // Can set media type. 815 pub const IFF_AUTOMEDIA: ::c_int = 0x4000; // Auto media select active. 816 817 // Dialup device with changing addresses. 818 pub const IFF_DYNAMIC: ::c_int = 0x8000; 819 820 pub const SOL_IP: ::c_int = 0; 821 pub const SOL_TCP: ::c_int = 6; 822 pub const SOL_IPV6: ::c_int = 41; 823 pub const SOL_ICMPV6: ::c_int = 58; 824 pub const SOL_RAW: ::c_int = 255; 825 pub const SOL_DECNET: ::c_int = 261; 826 pub const SOL_X25: ::c_int = 262; 827 pub const SOL_PACKET: ::c_int = 263; 828 pub const SOL_ATM: ::c_int = 264; 829 pub const SOL_AAL: ::c_int = 265; 830 pub const SOL_IRDA: ::c_int = 266; 831 832 pub const AF_UNSPEC: ::c_int = 0; 833 pub const AF_UNIX: ::c_int = 1; 834 pub const AF_LOCAL: ::c_int = 1; 835 pub const AF_INET: ::c_int = 2; 836 pub const AF_AX25: ::c_int = 3; 837 pub const AF_IPX: ::c_int = 4; 838 pub const AF_APPLETALK: ::c_int = 5; 839 pub const AF_NETROM: ::c_int = 6; 840 pub const AF_BRIDGE: ::c_int = 7; 841 pub const AF_ATMPVC: ::c_int = 8; 842 pub const AF_X25: ::c_int = 9; 843 pub const AF_INET6: ::c_int = 10; 844 pub const AF_ROSE: ::c_int = 11; 845 pub const AF_DECnet: ::c_int = 12; 846 pub const AF_NETBEUI: ::c_int = 13; 847 pub const AF_SECURITY: ::c_int = 14; 848 pub const AF_KEY: ::c_int = 15; 849 pub const AF_NETLINK: ::c_int = 16; 850 pub const AF_ROUTE: ::c_int = AF_NETLINK; 851 pub const AF_PACKET: ::c_int = 17; 852 pub const AF_ASH: ::c_int = 18; 853 pub const AF_ECONET: ::c_int = 19; 854 pub const AF_ATMSVC: ::c_int = 20; 855 pub const AF_SNA: ::c_int = 22; 856 pub const AF_IRDA: ::c_int = 23; 857 pub const AF_PPPOX: ::c_int = 24; 858 pub const AF_WANPIPE: ::c_int = 25; 859 pub const AF_LLC: ::c_int = 26; 860 pub const AF_CAN: ::c_int = 29; 861 pub const AF_TIPC: ::c_int = 30; 862 pub const AF_BLUETOOTH: ::c_int = 31; 863 pub const AF_IUCV: ::c_int = 32; 864 pub const AF_RXRPC: ::c_int = 33; 865 pub const AF_ISDN: ::c_int = 34; 866 pub const AF_PHONET: ::c_int = 35; 867 pub const AF_IEEE802154: ::c_int = 36; 868 pub const AF_CAIF: ::c_int = 37; 869 pub const AF_ALG: ::c_int = 38; 870 871 pub const PF_UNSPEC: ::c_int = AF_UNSPEC; 872 pub const PF_UNIX: ::c_int = AF_UNIX; 873 pub const PF_LOCAL: ::c_int = AF_LOCAL; 874 pub const PF_INET: ::c_int = AF_INET; 875 pub const PF_AX25: ::c_int = AF_AX25; 876 pub const PF_IPX: ::c_int = AF_IPX; 877 pub const PF_APPLETALK: ::c_int = AF_APPLETALK; 878 pub const PF_NETROM: ::c_int = AF_NETROM; 879 pub const PF_BRIDGE: ::c_int = AF_BRIDGE; 880 pub const PF_ATMPVC: ::c_int = AF_ATMPVC; 881 pub const PF_X25: ::c_int = AF_X25; 882 pub const PF_INET6: ::c_int = AF_INET6; 883 pub const PF_ROSE: ::c_int = AF_ROSE; 884 pub const PF_DECnet: ::c_int = AF_DECnet; 885 pub const PF_NETBEUI: ::c_int = AF_NETBEUI; 886 pub const PF_SECURITY: ::c_int = AF_SECURITY; 887 pub const PF_KEY: ::c_int = AF_KEY; 888 pub const PF_NETLINK: ::c_int = AF_NETLINK; 889 pub const PF_ROUTE: ::c_int = AF_ROUTE; 890 pub const PF_PACKET: ::c_int = AF_PACKET; 891 pub const PF_ASH: ::c_int = AF_ASH; 892 pub const PF_ECONET: ::c_int = AF_ECONET; 893 pub const PF_ATMSVC: ::c_int = AF_ATMSVC; 894 pub const PF_SNA: ::c_int = AF_SNA; 895 pub const PF_IRDA: ::c_int = AF_IRDA; 896 pub const PF_PPPOX: ::c_int = AF_PPPOX; 897 pub const PF_WANPIPE: ::c_int = AF_WANPIPE; 898 pub const PF_LLC: ::c_int = AF_LLC; 899 pub const PF_CAN: ::c_int = AF_CAN; 900 pub const PF_TIPC: ::c_int = AF_TIPC; 901 pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH; 902 pub const PF_IUCV: ::c_int = AF_IUCV; 903 pub const PF_RXRPC: ::c_int = AF_RXRPC; 904 pub const PF_ISDN: ::c_int = AF_ISDN; 905 pub const PF_PHONET: ::c_int = AF_PHONET; 906 pub const PF_IEEE802154: ::c_int = AF_IEEE802154; 907 pub const PF_CAIF: ::c_int = AF_CAIF; 908 pub const PF_ALG: ::c_int = AF_ALG; 909 910 pub const SOMAXCONN: ::c_int = 128; 911 912 pub const MSG_OOB: ::c_int = 1; 913 pub const MSG_PEEK: ::c_int = 2; 914 pub const MSG_DONTROUTE: ::c_int = 4; 915 pub const MSG_CTRUNC: ::c_int = 8; 916 pub const MSG_TRUNC: ::c_int = 0x20; 917 pub const MSG_DONTWAIT: ::c_int = 0x40; 918 pub const MSG_EOR: ::c_int = 0x80; 919 pub const MSG_WAITALL: ::c_int = 0x100; 920 pub const MSG_FIN: ::c_int = 0x200; 921 pub const MSG_SYN: ::c_int = 0x400; 922 pub const MSG_CONFIRM: ::c_int = 0x800; 923 pub const MSG_RST: ::c_int = 0x1000; 924 pub const MSG_ERRQUEUE: ::c_int = 0x2000; 925 pub const MSG_NOSIGNAL: ::c_int = 0x4000; 926 pub const MSG_MORE: ::c_int = 0x8000; 927 pub const MSG_WAITFORONE: ::c_int = 0x10000; 928 pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000; 929 930 pub const SOCK_RAW: ::c_int = 3; 931 pub const SOCK_RDM: ::c_int = 4; 932 pub const IP_MULTICAST_TTL: ::c_int = 33; 933 pub const IP_MULTICAST_LOOP: ::c_int = 34; 934 pub const IP_TTL: ::c_int = 2; 935 pub const IP_HDRINCL: ::c_int = 3; 936 pub const IP_ADD_MEMBERSHIP: ::c_int = 35; 937 pub const IP_DROP_MEMBERSHIP: ::c_int = 36; 938 pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20; 939 pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21; 940 941 pub const IPV6_JOIN_GROUP: ::c_int = 20; 942 pub const IPV6_LEAVE_GROUP: ::c_int = 21; 943 944 pub const TCP_NODELAY: ::c_int = 1; 945 pub const TCP_MAXSEG: ::c_int = 2; 946 pub const TCP_CORK: ::c_int = 3; 947 pub const TCP_KEEPIDLE: ::c_int = 4; 948 pub const TCP_KEEPINTVL: ::c_int = 5; 949 pub const TCP_KEEPCNT: ::c_int = 6; 950 pub const TCP_SYNCNT: ::c_int = 7; 951 pub const TCP_LINGER2: ::c_int = 8; 952 pub const TCP_DEFER_ACCEPT: ::c_int = 9; 953 pub const TCP_WINDOW_CLAMP: ::c_int = 10; 954 pub const TCP_INFO: ::c_int = 11; 955 pub const TCP_QUICKACK: ::c_int = 12; 956 pub const TCP_CONGESTION: ::c_int = 13; 957 958 // Source: 959 // https://github.com/kraj/uClibc/blob/ca1c74d67dd115d059a875150e10b8560a9c35a8 960 // /libc/sysdeps/linux/common/bits/in.h 961 // Same for all architectures 962 pub const IPV6_MULTICAST_HOPS: ::c_int = 18; 963 pub const IP_MULTICAST_IF: ::c_int = 32; 964 pub const IPV6_MULTICAST_IF: ::c_int = 17; 965 pub const IPV6_UNICAST_HOPS: ::c_int = 16; 966 967 // Source: 968 // https://github.com/kraj/uClibc/tree/ca1c74d67dd115d059a875150e10b8560a9c35a8 969 // Same for all architectures 970 pub const FUTEX_WAIT: ::c_int = 0; 971 pub const FUTEX_PRIVATE_FLAG: ::c_int = 128; 972 pub const FUTEX_WAKE: ::c_int = 1; 973 974 pub const IPV6_MULTICAST_LOOP: ::c_int = 19; 975 pub const IPV6_V6ONLY: ::c_int = 26; 976 977 pub const SO_DEBUG: ::c_int = 1; 978 979 pub const SHUT_RD: ::c_int = 0; 980 pub const SHUT_WR: ::c_int = 1; 981 pub const SHUT_RDWR: ::c_int = 2; 982 983 pub const LOCK_SH: ::c_int = 1; 984 pub const LOCK_EX: ::c_int = 2; 985 pub const LOCK_NB: ::c_int = 4; 986 pub const LOCK_UN: ::c_int = 8; 987 988 pub const SS_ONSTACK: ::c_int = 1; 989 pub const SS_DISABLE: ::c_int = 2; 990 991 pub const PATH_MAX: ::c_int = 4096; 992 993 pub const UIO_MAXIOV: ::c_int = 1024; 994 995 pub const FD_SETSIZE: usize = 1024; 996 997 pub const EPOLLIN: ::c_int = 0x1; 998 pub const EPOLLPRI: ::c_int = 0x2; 999 pub const EPOLLOUT: ::c_int = 0x4; 1000 pub const EPOLLRDNORM: ::c_int = 0x40; 1001 pub const EPOLLRDBAND: ::c_int = 0x80; 1002 pub const EPOLLWRNORM: ::c_int = 0x100; 1003 pub const EPOLLWRBAND: ::c_int = 0x200; 1004 pub const EPOLLMSG: ::c_int = 0x400; 1005 pub const EPOLLERR: ::c_int = 0x8; 1006 pub const EPOLLHUP: ::c_int = 0x10; 1007 pub const EPOLLET: ::c_int = 0x80000000; 1008 1009 pub const EPOLL_CTL_ADD: ::c_int = 1; 1010 pub const EPOLL_CTL_MOD: ::c_int = 3; 1011 pub const EPOLL_CTL_DEL: ::c_int = 2; 1012 1013 pub const MNT_DETACH: ::c_int = 0x2; 1014 pub const MNT_EXPIRE: ::c_int = 0x4; 1015 1016 pub const MNT_FORCE: ::c_int = 0x1; 1017 1018 pub const Q_SYNC: ::c_int = 0x600; 1019 pub const Q_QUOTAON: ::c_int = 0x100; 1020 pub const Q_QUOTAOFF: ::c_int = 0x200; 1021 pub const Q_GETQUOTA: ::c_int = 0x300; 1022 pub const Q_SETQUOTA: ::c_int = 0x400; 1023 1024 pub const TCIOFF: ::c_int = 2; 1025 pub const TCION: ::c_int = 3; 1026 pub const TCOOFF: ::c_int = 0; 1027 pub const TCOON: ::c_int = 1; 1028 pub const TCIFLUSH: ::c_int = 0; 1029 pub const TCOFLUSH: ::c_int = 1; 1030 pub const TCIOFLUSH: ::c_int = 2; 1031 pub const NL0: ::tcflag_t = 0x00000000; 1032 pub const NL1: ::tcflag_t = 0x00000100; 1033 pub const TAB0: ::tcflag_t = 0x00000000; 1034 pub const CR0: ::tcflag_t = 0x00000000; 1035 pub const FF0: ::tcflag_t = 0x00000000; 1036 pub const BS0: ::tcflag_t = 0x00000000; 1037 pub const VT0: ::tcflag_t = 0x00000000; 1038 pub const VERASE: usize = 2; 1039 pub const VKILL: usize = 3; 1040 pub const VINTR: usize = 0; 1041 pub const VQUIT: usize = 1; 1042 pub const VLNEXT: usize = 15; 1043 pub const IGNBRK: ::tcflag_t = 0x00000001; 1044 pub const BRKINT: ::tcflag_t = 0x00000002; 1045 pub const IGNPAR: ::tcflag_t = 0x00000004; 1046 pub const PARMRK: ::tcflag_t = 0x00000008; 1047 pub const INPCK: ::tcflag_t = 0x00000010; 1048 pub const ISTRIP: ::tcflag_t = 0x00000020; 1049 pub const INLCR: ::tcflag_t = 0x00000040; 1050 pub const IGNCR: ::tcflag_t = 0x00000080; 1051 pub const ICRNL: ::tcflag_t = 0x00000100; 1052 pub const IXANY: ::tcflag_t = 0x00000800; 1053 pub const IMAXBEL: ::tcflag_t = 0x00002000; 1054 pub const OPOST: ::tcflag_t = 0x1; 1055 pub const CS5: ::tcflag_t = 0x00000000; 1056 pub const CRTSCTS: ::tcflag_t = 0x80000000; 1057 pub const ECHO: ::tcflag_t = 0x00000008; 1058 1059 pub const CLONE_VM: ::c_int = 0x100; 1060 pub const CLONE_FS: ::c_int = 0x200; 1061 pub const CLONE_FILES: ::c_int = 0x400; 1062 pub const CLONE_SIGHAND: ::c_int = 0x800; 1063 pub const CLONE_PTRACE: ::c_int = 0x2000; 1064 pub const CLONE_VFORK: ::c_int = 0x4000; 1065 pub const CLONE_PARENT: ::c_int = 0x8000; 1066 pub const CLONE_THREAD: ::c_int = 0x10000; 1067 pub const CLONE_NEWNS: ::c_int = 0x20000; 1068 pub const CLONE_SYSVSEM: ::c_int = 0x40000; 1069 pub const CLONE_SETTLS: ::c_int = 0x80000; 1070 pub const CLONE_PARENT_SETTID: ::c_int = 0x100000; 1071 pub const CLONE_CHILD_CLEARTID: ::c_int = 0x200000; 1072 pub const CLONE_DETACHED: ::c_int = 0x400000; 1073 pub const CLONE_UNTRACED: ::c_int = 0x800000; 1074 pub const CLONE_CHILD_SETTID: ::c_int = 0x01000000; 1075 pub const CLONE_NEWUTS: ::c_int = 0x04000000; 1076 pub const CLONE_NEWIPC: ::c_int = 0x08000000; 1077 pub const CLONE_NEWUSER: ::c_int = 0x10000000; 1078 pub const CLONE_NEWPID: ::c_int = 0x20000000; 1079 pub const CLONE_NEWNET: ::c_int = 0x40000000; 1080 pub const CLONE_IO: ::c_int = 0x80000000; 1081 1082 pub const WNOHANG: ::c_int = 0x00000001; 1083 pub const WUNTRACED: ::c_int = 0x00000002; 1084 pub const WSTOPPED: ::c_int = WUNTRACED; 1085 pub const WEXITED: ::c_int = 0x00000004; 1086 pub const WCONTINUED: ::c_int = 0x00000008; 1087 pub const WNOWAIT: ::c_int = 0x01000000; 1088 1089 pub const __WNOTHREAD: ::c_int = 0x20000000; 1090 pub const __WALL: ::c_int = 0x40000000; 1091 pub const __WCLONE: ::c_int = 0x80000000; 1092 1093 pub const SPLICE_F_MOVE: ::c_uint = 0x01; 1094 pub const SPLICE_F_NONBLOCK: ::c_uint = 0x02; 1095 pub const SPLICE_F_MORE: ::c_uint = 0x04; 1096 pub const SPLICE_F_GIFT: ::c_uint = 0x08; 1097 1098 pub const RTLD_LOCAL: ::c_int = 0; 1099 pub const RTLD_LAZY: ::c_int = 1; 1100 1101 pub const POSIX_FADV_NORMAL: ::c_int = 0; 1102 pub const POSIX_FADV_RANDOM: ::c_int = 1; 1103 pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2; 1104 pub const POSIX_FADV_WILLNEED: ::c_int = 3; 1105 1106 pub const AT_FDCWD: ::c_int = -100; 1107 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x100; 1108 pub const AT_REMOVEDIR: ::c_int = 0x200; 1109 pub const AT_EACCESS: ::c_int = 0x200; 1110 pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400; 1111 1112 pub const LOG_CRON: ::c_int = 9 << 3; 1113 pub const LOG_AUTHPRIV: ::c_int = 10 << 3; 1114 pub const LOG_FTP: ::c_int = 11 << 3; 1115 pub const LOG_PERROR: ::c_int = 0x20; 1116 1117 pub const POLLIN: ::c_short = 0x1; 1118 pub const POLLPRI: ::c_short = 0x2; 1119 pub const POLLOUT: ::c_short = 0x4; 1120 pub const POLLERR: ::c_short = 0x8; 1121 pub const POLLHUP: ::c_short = 0x10; 1122 pub const POLLNVAL: ::c_short = 0x20; 1123 1124 pub const PIPE_BUF: usize = 4096; 1125 1126 pub const SI_LOAD_SHIFT: ::c_uint = 16; 1127 1128 pub const SIGEV_SIGNAL: ::c_int = 0; 1129 pub const SIGEV_NONE: ::c_int = 1; 1130 pub const SIGEV_THREAD: ::c_int = 2; 1131 1132 pub const P_ALL: idtype_t = 0; 1133 pub const P_PID: idtype_t = 1; 1134 pub const P_PGID: idtype_t = 2; 1135 1136 pub const UTIME_OMIT: c_long = 1073741822; 1137 pub const UTIME_NOW: c_long = 1073741823; 1138 1139 pub const L_tmpnam: ::c_uint = 20; 1140 pub const _PC_LINK_MAX: ::c_int = 0; 1141 pub const _PC_MAX_CANON: ::c_int = 1; 1142 pub const _PC_MAX_INPUT: ::c_int = 2; 1143 pub const _PC_NAME_MAX: ::c_int = 3; 1144 pub const _PC_PATH_MAX: ::c_int = 4; 1145 pub const _PC_PIPE_BUF: ::c_int = 5; 1146 pub const _PC_CHOWN_RESTRICTED: ::c_int = 6; 1147 pub const _PC_NO_TRUNC: ::c_int = 7; 1148 pub const _PC_VDISABLE: ::c_int = 8; 1149 1150 pub const _SC_ARG_MAX: ::c_int = 0; 1151 pub const _SC_CHILD_MAX: ::c_int = 1; 1152 pub const _SC_CLK_TCK: ::c_int = 2; 1153 pub const _SC_NGROUPS_MAX: ::c_int = 3; 1154 pub const _SC_OPEN_MAX: ::c_int = 4; 1155 pub const _SC_STREAM_MAX: ::c_int = 5; 1156 pub const _SC_TZNAME_MAX: ::c_int = 6; 1157 pub const _SC_JOB_CONTROL: ::c_int = 7; 1158 pub const _SC_SAVED_IDS: ::c_int = 8; 1159 pub const _SC_REALTIME_SIGNALS: ::c_int = 9; 1160 pub const _SC_PRIORITY_SCHEDULING: ::c_int = 10; 1161 pub const _SC_TIMERS: ::c_int = 11; 1162 pub const _SC_ASYNCHRONOUS_IO: ::c_int = 12; 1163 pub const _SC_PRIORITIZED_IO: ::c_int = 13; 1164 pub const _SC_SYNCHRONIZED_IO: ::c_int = 14; 1165 pub const _SC_FSYNC: ::c_int = 15; 1166 pub const _SC_MAPPED_FILES: ::c_int = 16; 1167 pub const _SC_MEMLOCK: ::c_int = 17; 1168 pub const _SC_MEMLOCK_RANGE: ::c_int = 18; 1169 pub const _SC_MEMORY_PROTECTION: ::c_int = 19; 1170 pub const _SC_MESSAGE_PASSING: ::c_int = 20; 1171 pub const _SC_SEMAPHORES: ::c_int = 21; 1172 pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 22; 1173 pub const _SC_AIO_LISTIO_MAX: ::c_int = 23; 1174 pub const _SC_AIO_MAX: ::c_int = 24; 1175 pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 25; 1176 pub const _SC_DELAYTIMER_MAX: ::c_int = 26; 1177 pub const _SC_MQ_OPEN_MAX: ::c_int = 27; 1178 pub const _SC_MQ_PRIO_MAX: ::c_int = 28; 1179 pub const _SC_VERSION: ::c_int = 29; 1180 pub const _SC_PAGESIZE: ::c_int = 30; 1181 pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; 1182 pub const _SC_RTSIG_MAX: ::c_int = 31; 1183 pub const _SC_SEM_NSEMS_MAX: ::c_int = 32; 1184 pub const _SC_SEM_VALUE_MAX: ::c_int = 33; 1185 pub const _SC_SIGQUEUE_MAX: ::c_int = 34; 1186 pub const _SC_TIMER_MAX: ::c_int = 35; 1187 pub const _SC_BC_BASE_MAX: ::c_int = 36; 1188 pub const _SC_BC_DIM_MAX: ::c_int = 37; 1189 pub const _SC_BC_SCALE_MAX: ::c_int = 38; 1190 pub const _SC_BC_STRING_MAX: ::c_int = 39; 1191 pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 40; 1192 pub const _SC_EXPR_NEST_MAX: ::c_int = 42; 1193 pub const _SC_LINE_MAX: ::c_int = 43; 1194 pub const _SC_RE_DUP_MAX: ::c_int = 44; 1195 pub const _SC_2_VERSION: ::c_int = 46; 1196 pub const _SC_2_C_BIND: ::c_int = 47; 1197 pub const _SC_2_C_DEV: ::c_int = 48; 1198 pub const _SC_2_FORT_DEV: ::c_int = 49; 1199 pub const _SC_2_FORT_RUN: ::c_int = 50; 1200 pub const _SC_2_SW_DEV: ::c_int = 51; 1201 pub const _SC_2_LOCALEDEF: ::c_int = 52; 1202 pub const _SC_IOV_MAX: ::c_int = 60; 1203 pub const _SC_THREADS: ::c_int = 67; 1204 pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 68; 1205 pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 69; 1206 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 70; 1207 pub const _SC_LOGIN_NAME_MAX: ::c_int = 71; 1208 pub const _SC_TTY_NAME_MAX: ::c_int = 72; 1209 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 73; 1210 pub const _SC_THREAD_KEYS_MAX: ::c_int = 74; 1211 pub const _SC_THREAD_STACK_MIN: ::c_int = 75; 1212 pub const _SC_THREAD_THREADS_MAX: ::c_int = 76; 1213 pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77; 1214 pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78; 1215 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79; 1216 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80; 1217 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81; 1218 pub const _SC_NPROCESSORS_ONLN: ::c_int = 84; 1219 pub const _SC_ATEXIT_MAX: ::c_int = 87; 1220 pub const _SC_XOPEN_VERSION: ::c_int = 89; 1221 pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90; 1222 pub const _SC_XOPEN_UNIX: ::c_int = 91; 1223 pub const _SC_XOPEN_CRYPT: ::c_int = 92; 1224 pub const _SC_XOPEN_ENH_I18N: ::c_int = 93; 1225 pub const _SC_XOPEN_SHM: ::c_int = 94; 1226 pub const _SC_2_CHAR_TERM: ::c_int = 95; 1227 pub const _SC_2_UPE: ::c_int = 97; 1228 pub const _SC_XBS5_ILP32_OFF32: ::c_int = 125; 1229 pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126; 1230 pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 128; 1231 pub const _SC_XOPEN_LEGACY: ::c_int = 129; 1232 pub const _SC_XOPEN_REALTIME: ::c_int = 130; 1233 pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 131; 1234 pub const _SC_HOST_NAME_MAX: ::c_int = 180; 1235 1236 pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY; 1237 pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY; 1238 1239 pub const GLOB_ERR: ::c_int = 1 << 0; 1240 pub const GLOB_MARK: ::c_int = 1 << 1; 1241 pub const GLOB_NOSORT: ::c_int = 1 << 2; 1242 pub const GLOB_DOOFFS: ::c_int = 1 << 3; 1243 pub const GLOB_NOCHECK: ::c_int = 1 << 4; 1244 pub const GLOB_APPEND: ::c_int = 1 << 5; 1245 pub const GLOB_NOESCAPE: ::c_int = 1 << 6; 1246 1247 pub const GLOB_NOSPACE: ::c_int = 1; 1248 pub const GLOB_ABORTED: ::c_int = 2; 1249 pub const GLOB_NOMATCH: ::c_int = 3; 1250 1251 pub const POSIX_MADV_NORMAL: ::c_int = 0; 1252 pub const POSIX_MADV_RANDOM: ::c_int = 1; 1253 pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; 1254 pub const POSIX_MADV_WILLNEED: ::c_int = 3; 1255 1256 pub const S_IEXEC: mode_t = 64; 1257 pub const S_IWRITE: mode_t = 128; 1258 pub const S_IREAD: mode_t = 256; 1259 1260 pub const F_LOCK: ::c_int = 1; 1261 pub const F_TEST: ::c_int = 3; 1262 pub const F_TLOCK: ::c_int = 2; 1263 pub const F_ULOCK: ::c_int = 0; 1264 1265 pub const ST_RDONLY: ::c_ulong = 1; 1266 pub const ST_NOSUID: ::c_ulong = 2; 1267 pub const ST_NODEV: ::c_ulong = 4; 1268 pub const ST_NOEXEC: ::c_ulong = 8; 1269 pub const ST_SYNCHRONOUS: ::c_ulong = 16; 1270 pub const ST_MANDLOCK: ::c_ulong = 64; 1271 pub const ST_WRITE: ::c_ulong = 128; 1272 pub const ST_APPEND: ::c_ulong = 256; 1273 pub const ST_IMMUTABLE: ::c_ulong = 512; 1274 pub const ST_NOATIME: ::c_ulong = 1024; 1275 pub const ST_NODIRATIME: ::c_ulong = 2048; 1276 1277 pub const RTLD_NEXT: *mut ::c_void = -1i64 as *mut ::c_void; 1278 pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void; 1279 pub const RTLD_NODELETE: ::c_int = 0x1000; 1280 pub const RTLD_NOW: ::c_int = 0x2; 1281 1282 pub const TCP_MD5SIG: ::c_int = 14; 1283 1284 align_const! { 1285 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { 1286 size: [0; __SIZEOF_PTHREAD_MUTEX_T], 1287 }; 1288 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { 1289 size: [0; __SIZEOF_PTHREAD_COND_T], 1290 }; 1291 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { 1292 size: [0; __SIZEOF_PTHREAD_RWLOCK_T], 1293 }; 1294 } 1295 pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; 1296 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1; 1297 pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2; 1298 pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL; 1299 pub const __SIZEOF_PTHREAD_COND_T: usize = 48; 1300 1301 pub const SCHED_OTHER: ::c_int = 0; 1302 pub const SCHED_FIFO: ::c_int = 1; 1303 pub const SCHED_RR: ::c_int = 2; 1304 pub const SCHED_BATCH: ::c_int = 3; 1305 pub const SCHED_IDLE: ::c_int = 5; 1306 1307 // System V IPC 1308 pub const IPC_PRIVATE: ::key_t = 0; 1309 1310 pub const IPC_CREAT: ::c_int = 0o1000; 1311 pub const IPC_EXCL: ::c_int = 0o2000; 1312 pub const IPC_NOWAIT: ::c_int = 0o4000; 1313 1314 pub const IPC_RMID: ::c_int = 0; 1315 pub const IPC_SET: ::c_int = 1; 1316 pub const IPC_STAT: ::c_int = 2; 1317 pub const IPC_INFO: ::c_int = 3; 1318 pub const MSG_STAT: ::c_int = 11; 1319 pub const MSG_INFO: ::c_int = 12; 1320 1321 pub const MSG_NOERROR: ::c_int = 0o10000; 1322 pub const MSG_EXCEPT: ::c_int = 0o20000; 1323 1324 pub const SHM_R: ::c_int = 0o400; 1325 pub const SHM_W: ::c_int = 0o200; 1326 1327 pub const SHM_RDONLY: ::c_int = 0o10000; 1328 pub const SHM_RND: ::c_int = 0o20000; 1329 pub const SHM_REMAP: ::c_int = 0o40000; 1330 1331 pub const SHM_LOCK: ::c_int = 11; 1332 pub const SHM_UNLOCK: ::c_int = 12; 1333 1334 pub const SHM_HUGETLB: ::c_int = 0o4000; 1335 pub const SHM_NORESERVE: ::c_int = 0o10000; 1336 1337 pub const EPOLLRDHUP: ::c_int = 0x2000; 1338 pub const EPOLLONESHOT: ::c_int = 0x40000000; 1339 1340 pub const QFMT_VFS_OLD: ::c_int = 1; 1341 pub const QFMT_VFS_V0: ::c_int = 2; 1342 1343 pub const EFD_SEMAPHORE: ::c_int = 0x1; 1344 1345 pub const LOG_NFACILITIES: ::c_int = 24; 1346 1347 pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t; 1348 1349 pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32; 1350 pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32; 1351 pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32; 1352 pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32; 1353 pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32; 1354 1355 pub const AI_PASSIVE: ::c_int = 0x0001; 1356 pub const AI_CANONNAME: ::c_int = 0x0002; 1357 pub const AI_NUMERICHOST: ::c_int = 0x0004; 1358 pub const AI_V4MAPPED: ::c_int = 0x0008; 1359 pub const AI_ALL: ::c_int = 0x0010; 1360 pub const AI_ADDRCONFIG: ::c_int = 0x0020; 1361 1362 pub const AI_NUMERICSERV: ::c_int = 0x0400; 1363 1364 pub const EAI_BADFLAGS: ::c_int = -1; 1365 pub const EAI_NONAME: ::c_int = -2; 1366 pub const EAI_AGAIN: ::c_int = -3; 1367 pub const EAI_FAIL: ::c_int = -4; 1368 pub const EAI_NODATA: ::c_int = -5; 1369 pub const EAI_FAMILY: ::c_int = -6; 1370 pub const EAI_SOCKTYPE: ::c_int = -7; 1371 pub const EAI_SERVICE: ::c_int = -8; 1372 pub const EAI_MEMORY: ::c_int = -10; 1373 pub const EAI_OVERFLOW: ::c_int = -12; 1374 1375 pub const NI_NUMERICHOST: ::c_int = 1; 1376 pub const NI_NUMERICSERV: ::c_int = 2; 1377 pub const NI_NOFQDN: ::c_int = 4; 1378 pub const NI_NAMEREQD: ::c_int = 8; 1379 pub const NI_DGRAM: ::c_int = 16; 1380 1381 pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1; 1382 pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2; 1383 pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4; 1384 1385 pub const EAI_SYSTEM: ::c_int = -11; 1386 1387 pub const MREMAP_MAYMOVE: ::c_int = 1; 1388 pub const MREMAP_FIXED: ::c_int = 2; 1389 1390 pub const PR_SET_PDEATHSIG: ::c_int = 1; 1391 pub const PR_GET_PDEATHSIG: ::c_int = 2; 1392 1393 pub const PR_GET_DUMPABLE: ::c_int = 3; 1394 pub const PR_SET_DUMPABLE: ::c_int = 4; 1395 1396 pub const PR_GET_UNALIGN: ::c_int = 5; 1397 pub const PR_SET_UNALIGN: ::c_int = 6; 1398 pub const PR_UNALIGN_NOPRINT: ::c_int = 1; 1399 pub const PR_UNALIGN_SIGBUS: ::c_int = 2; 1400 1401 pub const PR_GET_KEEPCAPS: ::c_int = 7; 1402 pub const PR_SET_KEEPCAPS: ::c_int = 8; 1403 1404 pub const PR_GET_FPEMU: ::c_int = 9; 1405 pub const PR_SET_FPEMU: ::c_int = 10; 1406 pub const PR_FPEMU_NOPRINT: ::c_int = 1; 1407 pub const PR_FPEMU_SIGFPE: ::c_int = 2; 1408 1409 pub const PR_GET_FPEXC: ::c_int = 11; 1410 pub const PR_SET_FPEXC: ::c_int = 12; 1411 pub const PR_FP_EXC_SW_ENABLE: ::c_int = 0x80; 1412 pub const PR_FP_EXC_DIV: ::c_int = 0x010000; 1413 pub const PR_FP_EXC_OVF: ::c_int = 0x020000; 1414 pub const PR_FP_EXC_UND: ::c_int = 0x040000; 1415 pub const PR_FP_EXC_RES: ::c_int = 0x080000; 1416 pub const PR_FP_EXC_INV: ::c_int = 0x100000; 1417 pub const PR_FP_EXC_DISABLED: ::c_int = 0; 1418 pub const PR_FP_EXC_NONRECOV: ::c_int = 1; 1419 pub const PR_FP_EXC_ASYNC: ::c_int = 2; 1420 pub const PR_FP_EXC_PRECISE: ::c_int = 3; 1421 1422 pub const PR_GET_TIMING: ::c_int = 13; 1423 pub const PR_SET_TIMING: ::c_int = 14; 1424 pub const PR_TIMING_STATISTICAL: ::c_int = 0; 1425 pub const PR_TIMING_TIMESTAMP: ::c_int = 1; 1426 1427 pub const PR_SET_NAME: ::c_int = 15; 1428 pub const PR_GET_NAME: ::c_int = 16; 1429 1430 pub const PR_GET_ENDIAN: ::c_int = 19; 1431 pub const PR_SET_ENDIAN: ::c_int = 20; 1432 pub const PR_ENDIAN_BIG: ::c_int = 0; 1433 pub const PR_ENDIAN_LITTLE: ::c_int = 1; 1434 pub const PR_ENDIAN_PPC_LITTLE: ::c_int = 2; 1435 1436 pub const PR_GET_SECCOMP: ::c_int = 21; 1437 pub const PR_SET_SECCOMP: ::c_int = 22; 1438 1439 pub const PR_CAPBSET_READ: ::c_int = 23; 1440 pub const PR_CAPBSET_DROP: ::c_int = 24; 1441 1442 pub const PR_GET_TSC: ::c_int = 25; 1443 pub const PR_SET_TSC: ::c_int = 26; 1444 pub const PR_TSC_ENABLE: ::c_int = 1; 1445 pub const PR_TSC_SIGSEGV: ::c_int = 2; 1446 1447 pub const PR_GET_SECUREBITS: ::c_int = 27; 1448 pub const PR_SET_SECUREBITS: ::c_int = 28; 1449 1450 pub const PR_SET_TIMERSLACK: ::c_int = 29; 1451 pub const PR_GET_TIMERSLACK: ::c_int = 30; 1452 1453 pub const PR_TASK_PERF_EVENTS_DISABLE: ::c_int = 31; 1454 pub const PR_TASK_PERF_EVENTS_ENABLE: ::c_int = 32; 1455 1456 pub const PR_MCE_KILL: ::c_int = 33; 1457 pub const PR_MCE_KILL_CLEAR: ::c_int = 0; 1458 pub const PR_MCE_KILL_SET: ::c_int = 1; 1459 1460 pub const PR_MCE_KILL_LATE: ::c_int = 0; 1461 pub const PR_MCE_KILL_EARLY: ::c_int = 1; 1462 pub const PR_MCE_KILL_DEFAULT: ::c_int = 2; 1463 1464 pub const PR_MCE_KILL_GET: ::c_int = 34; 1465 1466 pub const PR_SET_MM: ::c_int = 35; 1467 pub const PR_SET_MM_START_CODE: ::c_int = 1; 1468 pub const PR_SET_MM_END_CODE: ::c_int = 2; 1469 pub const PR_SET_MM_START_DATA: ::c_int = 3; 1470 pub const PR_SET_MM_END_DATA: ::c_int = 4; 1471 pub const PR_SET_MM_START_STACK: ::c_int = 5; 1472 pub const PR_SET_MM_START_BRK: ::c_int = 6; 1473 pub const PR_SET_MM_BRK: ::c_int = 7; 1474 pub const PR_SET_MM_ARG_START: ::c_int = 8; 1475 pub const PR_SET_MM_ARG_END: ::c_int = 9; 1476 pub const PR_SET_MM_ENV_START: ::c_int = 10; 1477 pub const PR_SET_MM_ENV_END: ::c_int = 11; 1478 pub const PR_SET_MM_AUXV: ::c_int = 12; 1479 pub const PR_SET_MM_EXE_FILE: ::c_int = 13; 1480 pub const PR_SET_MM_MAP: ::c_int = 14; 1481 pub const PR_SET_MM_MAP_SIZE: ::c_int = 15; 1482 1483 pub const PR_SET_PTRACER: ::c_int = 0x59616d61; 1484 1485 pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36; 1486 pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37; 1487 1488 pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38; 1489 pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39; 1490 1491 pub const PR_GET_TID_ADDRESS: ::c_int = 40; 1492 1493 pub const PR_SET_THP_DISABLE: ::c_int = 41; 1494 pub const PR_GET_THP_DISABLE: ::c_int = 42; 1495 1496 pub const GRND_NONBLOCK: ::c_uint = 0x0001; 1497 pub const GRND_RANDOM: ::c_uint = 0x0002; 1498 1499 pub const ABDAY_1: ::nl_item = 0x300; 1500 pub const ABDAY_2: ::nl_item = 0x301; 1501 pub const ABDAY_3: ::nl_item = 0x302; 1502 pub const ABDAY_4: ::nl_item = 0x303; 1503 pub const ABDAY_5: ::nl_item = 0x304; 1504 pub const ABDAY_6: ::nl_item = 0x305; 1505 pub const ABDAY_7: ::nl_item = 0x306; 1506 1507 pub const DAY_1: ::nl_item = 0x307; 1508 pub const DAY_2: ::nl_item = 0x308; 1509 pub const DAY_3: ::nl_item = 0x309; 1510 pub const DAY_4: ::nl_item = 0x30A; 1511 pub const DAY_5: ::nl_item = 0x30B; 1512 pub const DAY_6: ::nl_item = 0x30C; 1513 pub const DAY_7: ::nl_item = 0x30D; 1514 1515 pub const ABMON_1: ::nl_item = 0x30E; 1516 pub const ABMON_2: ::nl_item = 0x30F; 1517 pub const ABMON_3: ::nl_item = 0x310; 1518 pub const ABMON_4: ::nl_item = 0x311; 1519 pub const ABMON_5: ::nl_item = 0x312; 1520 pub const ABMON_6: ::nl_item = 0x313; 1521 pub const ABMON_7: ::nl_item = 0x314; 1522 pub const ABMON_8: ::nl_item = 0x315; 1523 pub const ABMON_9: ::nl_item = 0x316; 1524 pub const ABMON_10: ::nl_item = 0x317; 1525 pub const ABMON_11: ::nl_item = 0x318; 1526 pub const ABMON_12: ::nl_item = 0x319; 1527 1528 pub const MON_1: ::nl_item = 0x31A; 1529 pub const MON_2: ::nl_item = 0x31B; 1530 pub const MON_3: ::nl_item = 0x31C; 1531 pub const MON_4: ::nl_item = 0x31D; 1532 pub const MON_5: ::nl_item = 0x31E; 1533 pub const MON_6: ::nl_item = 0x31F; 1534 pub const MON_7: ::nl_item = 0x320; 1535 pub const MON_8: ::nl_item = 0x321; 1536 pub const MON_9: ::nl_item = 0x322; 1537 pub const MON_10: ::nl_item = 0x323; 1538 pub const MON_11: ::nl_item = 0x324; 1539 pub const MON_12: ::nl_item = 0x325; 1540 1541 pub const AM_STR: ::nl_item = 0x326; 1542 pub const PM_STR: ::nl_item = 0x327; 1543 1544 pub const D_T_FMT: ::nl_item = 0x328; 1545 pub const D_FMT: ::nl_item = 0x329; 1546 pub const T_FMT: ::nl_item = 0x32A; 1547 pub const T_FMT_AMPM: ::nl_item = 0x32B; 1548 1549 pub const ERA: ::nl_item = 0x32C; 1550 pub const ERA_D_FMT: ::nl_item = 0x32E; 1551 pub const ALT_DIGITS: ::nl_item = 0x32F; 1552 pub const ERA_D_T_FMT: ::nl_item = 0x330; 1553 pub const ERA_T_FMT: ::nl_item = 0x331; 1554 1555 pub const CODESET: ::nl_item = 10; 1556 1557 pub const CRNCYSTR: ::nl_item = 0x215; 1558 1559 pub const RADIXCHAR: ::nl_item = 0x100; 1560 pub const THOUSEP: ::nl_item = 0x101; 1561 1562 pub const NOEXPR: ::nl_item = 0x501; 1563 pub const YESSTR: ::nl_item = 0x502; 1564 pub const NOSTR: ::nl_item = 0x503; 1565 1566 pub const FILENAME_MAX: ::c_uint = 4095; 1567 1568 pub const PRIO_PROCESS: ::c_int = 0; 1569 pub const PRIO_PGRP: ::c_int = 1; 1570 pub const PRIO_USER: ::c_int = 2; 1571 1572 f! { 1573 pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { 1574 let fd = fd as usize; 1575 let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; 1576 (*set).fds_bits[fd / size] &= !(1 << (fd % size)); 1577 return 1578 } 1579 1580 pub fn FD_ISSET(fd: ::c_int, set: *mut fd_set) -> bool { 1581 let fd = fd as usize; 1582 let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; 1583 return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0 1584 } 1585 1586 pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () { 1587 let fd = fd as usize; 1588 let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; 1589 (*set).fds_bits[fd / size] |= 1 << (fd % size); 1590 return 1591 } 1592 1593 pub fn FD_ZERO(set: *mut fd_set) -> () { 1594 for slot in (*set).fds_bits.iter_mut() { 1595 *slot = 0; 1596 } 1597 } 1598 1599 pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { 1600 for slot in cpuset.bits.iter_mut() { 1601 *slot = 0; 1602 } 1603 } 1604 1605 pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { 1606 let size_in_bits 1607 = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc 1608 let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); 1609 cpuset.bits[idx] |= 1 << offset; 1610 () 1611 } 1612 1613 pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () { 1614 let size_in_bits 1615 = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc 1616 let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); 1617 cpuset.bits[idx] &= !(1 << offset); 1618 () 1619 } 1620 1621 pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool { 1622 let size_in_bits = 8 * ::mem::size_of_val(&cpuset.bits[0]); 1623 let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); 1624 0 != (cpuset.bits[idx] & (1 << offset)) 1625 } 1626 1627 pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool { 1628 set1.bits == set2.bits 1629 } 1630 } 1631 1632 safe_f! { 1633 pub {const} fn WIFSTOPPED(status: ::c_int) -> bool { 1634 (status & 0xff) == 0x7f 1635 } 1636 1637 pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int { 1638 (status >> 8) & 0xff 1639 } 1640 1641 pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { 1642 status == 0xffff 1643 } 1644 1645 pub {const} fn WIFSIGNALED(status: ::c_int) -> bool { 1646 ((status & 0x7f) + 1) as i8 >= 2 1647 } 1648 1649 pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int { 1650 status & 0x7f 1651 } 1652 1653 pub {const} fn WIFEXITED(status: ::c_int) -> bool { 1654 (status & 0x7f) == 0 1655 } 1656 1657 pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int { 1658 (status >> 8) & 0xff 1659 } 1660 1661 pub {const} fn WCOREDUMP(status: ::c_int) -> bool { 1662 (status & 0x80) != 0 1663 } 1664 1665 pub {const} fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int { 1666 (cmd << 8) | (type_ & 0x00ff) 1667 } 1668 } 1669 1670 extern "C" { 1671 #[cfg_attr(target_os = "linux", link_name = "__xpg_strerror_r")] strerror_r( errnum: ::c_int, buf: *mut c_char, buflen: ::size_t, ) -> ::c_int1672 pub fn strerror_r( 1673 errnum: ::c_int, 1674 buf: *mut c_char, 1675 buflen: ::size_t, 1676 ) -> ::c_int; 1677 sem_destroy(sem: *mut sem_t) -> ::c_int1678 pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; sem_init( sem: *mut sem_t, pshared: ::c_int, value: ::c_uint, ) -> ::c_int1679 pub fn sem_init( 1680 sem: *mut sem_t, 1681 pshared: ::c_int, 1682 value: ::c_uint, 1683 ) -> ::c_int; 1684 abs(i: ::c_int) -> ::c_int1685 pub fn abs(i: ::c_int) -> ::c_int; atof(s: *const ::c_char) -> ::c_double1686 pub fn atof(s: *const ::c_char) -> ::c_double; labs(i: ::c_long) -> ::c_long1687 pub fn labs(i: ::c_long) -> ::c_long; rand() -> ::c_int1688 pub fn rand() -> ::c_int; srand(seed: ::c_uint)1689 pub fn srand(seed: ::c_uint); 1690 fdatasync(fd: ::c_int) -> ::c_int1691 pub fn fdatasync(fd: ::c_int) -> ::c_int; gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int1692 pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; mincore( addr: *mut ::c_void, len: ::size_t, vec: *mut ::c_uchar, ) -> ::c_int1693 pub fn mincore( 1694 addr: *mut ::c_void, 1695 len: ::size_t, 1696 vec: *mut ::c_uchar, 1697 ) -> ::c_int; clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int1698 pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int1699 pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; clock_nanosleep( clk_id: ::clockid_t, flags: ::c_int, rqtp: *const ::timespec, rmtp: *mut ::timespec, ) -> ::c_int1700 pub fn clock_nanosleep( 1701 clk_id: ::clockid_t, 1702 flags: ::c_int, 1703 rqtp: *const ::timespec, 1704 rmtp: *mut ::timespec, 1705 ) -> ::c_int; clock_settime( clk_id: ::clockid_t, tp: *const ::timespec, ) -> ::c_int1706 pub fn clock_settime( 1707 clk_id: ::clockid_t, 1708 tp: *const ::timespec, 1709 ) -> ::c_int; prctl(option: ::c_int, ...) -> ::c_int1710 pub fn prctl(option: ::c_int, ...) -> ::c_int; pthread_getattr_np( native: ::pthread_t, attr: *mut ::pthread_attr_t, ) -> ::c_int1711 pub fn pthread_getattr_np( 1712 native: ::pthread_t, 1713 attr: *mut ::pthread_attr_t, 1714 ) -> ::c_int; pthread_attr_getguardsize( attr: *const ::pthread_attr_t, guardsize: *mut ::size_t, ) -> ::c_int1715 pub fn pthread_attr_getguardsize( 1716 attr: *const ::pthread_attr_t, 1717 guardsize: *mut ::size_t, 1718 ) -> ::c_int; pthread_attr_getstack( attr: *const ::pthread_attr_t, stackaddr: *mut *mut ::c_void, stacksize: *mut ::size_t, ) -> ::c_int1719 pub fn pthread_attr_getstack( 1720 attr: *const ::pthread_attr_t, 1721 stackaddr: *mut *mut ::c_void, 1722 stacksize: *mut ::size_t, 1723 ) -> ::c_int; memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void1724 pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int1725 pub fn setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int; initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int1726 pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int; sched_setscheduler( pid: ::pid_t, policy: ::c_int, param: *const ::sched_param, ) -> ::c_int1727 pub fn sched_setscheduler( 1728 pid: ::pid_t, 1729 policy: ::c_int, 1730 param: *const ::sched_param, 1731 ) -> ::c_int; sched_getscheduler(pid: ::pid_t) -> ::c_int1732 pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int; sched_get_priority_max(policy: ::c_int) -> ::c_int1733 pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int; sched_get_priority_min(policy: ::c_int) -> ::c_int1734 pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int; epoll_create(size: ::c_int) -> ::c_int1735 pub fn epoll_create(size: ::c_int) -> ::c_int; epoll_create1(flags: ::c_int) -> ::c_int1736 pub fn epoll_create1(flags: ::c_int) -> ::c_int; epoll_ctl( epfd: ::c_int, op: ::c_int, fd: ::c_int, event: *mut ::epoll_event, ) -> ::c_int1737 pub fn epoll_ctl( 1738 epfd: ::c_int, 1739 op: ::c_int, 1740 fd: ::c_int, 1741 event: *mut ::epoll_event, 1742 ) -> ::c_int; epoll_wait( epfd: ::c_int, events: *mut ::epoll_event, maxevents: ::c_int, timeout: ::c_int, ) -> ::c_int1743 pub fn epoll_wait( 1744 epfd: ::c_int, 1745 events: *mut ::epoll_event, 1746 maxevents: ::c_int, 1747 timeout: ::c_int, 1748 ) -> ::c_int; pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int1749 pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; mount( src: *const ::c_char, target: *const ::c_char, fstype: *const ::c_char, flags: ::c_ulong, data: *const ::c_void, ) -> ::c_int1750 pub fn mount( 1751 src: *const ::c_char, 1752 target: *const ::c_char, 1753 fstype: *const ::c_char, 1754 flags: ::c_ulong, 1755 data: *const ::c_void, 1756 ) -> ::c_int; umount(target: *const ::c_char) -> ::c_int1757 pub fn umount(target: *const ::c_char) -> ::c_int; umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int1758 pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int; clone( cb: extern "C" fn(*mut ::c_void) -> ::c_int, child_stack: *mut ::c_void, flags: ::c_int, arg: *mut ::c_void, ... ) -> ::c_int1759 pub fn clone( 1760 cb: extern "C" fn(*mut ::c_void) -> ::c_int, 1761 child_stack: *mut ::c_void, 1762 flags: ::c_int, 1763 arg: *mut ::c_void, 1764 ... 1765 ) -> ::c_int; statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int1766 pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int1767 pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; memrchr( cx: *const ::c_void, c: ::c_int, n: ::size_t, ) -> *mut ::c_void1768 pub fn memrchr( 1769 cx: *const ::c_void, 1770 c: ::c_int, 1771 n: ::size_t, 1772 ) -> *mut ::c_void; syscall(num: ::c_long, ...) -> ::c_long1773 pub fn syscall(num: ::c_long, ...) -> ::c_long; sendfile( out_fd: ::c_int, in_fd: ::c_int, offset: *mut off_t, count: ::size_t, ) -> ::ssize_t1774 pub fn sendfile( 1775 out_fd: ::c_int, 1776 in_fd: ::c_int, 1777 offset: *mut off_t, 1778 count: ::size_t, 1779 ) -> ::ssize_t; splice( fd_in: ::c_int, off_in: *mut ::loff_t, fd_out: ::c_int, off_out: *mut ::loff_t, len: ::size_t, flags: ::c_uint, ) -> ::ssize_t1780 pub fn splice( 1781 fd_in: ::c_int, 1782 off_in: *mut ::loff_t, 1783 fd_out: ::c_int, 1784 off_out: *mut ::loff_t, 1785 len: ::size_t, 1786 flags: ::c_uint, 1787 ) -> ::ssize_t; tee( fd_in: ::c_int, fd_out: ::c_int, len: ::size_t, flags: ::c_uint, ) -> ::ssize_t1788 pub fn tee( 1789 fd_in: ::c_int, 1790 fd_out: ::c_int, 1791 len: ::size_t, 1792 flags: ::c_uint, 1793 ) -> ::ssize_t; vmsplice( fd: ::c_int, iov: *const ::iovec, nr_segs: ::size_t, flags: ::c_uint, ) -> ::ssize_t1794 pub fn vmsplice( 1795 fd: ::c_int, 1796 iov: *const ::iovec, 1797 nr_segs: ::size_t, 1798 flags: ::c_uint, 1799 ) -> ::ssize_t; 1800 posix_fadvise( fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int, ) -> ::c_int1801 pub fn posix_fadvise( 1802 fd: ::c_int, 1803 offset: ::off_t, 1804 len: ::off_t, 1805 advise: ::c_int, 1806 ) -> ::c_int; getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int1807 pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int1808 pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int1809 pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; utimensat( dirfd: ::c_int, path: *const ::c_char, times: *const ::timespec, flag: ::c_int, ) -> ::c_int1810 pub fn utimensat( 1811 dirfd: ::c_int, 1812 path: *const ::c_char, 1813 times: *const ::timespec, 1814 flag: ::c_int, 1815 ) -> ::c_int; duplocale(base: ::locale_t) -> ::locale_t1816 pub fn duplocale(base: ::locale_t) -> ::locale_t; freelocale(loc: ::locale_t)1817 pub fn freelocale(loc: ::locale_t); newlocale( mask: ::c_int, locale: *const ::c_char, base: ::locale_t, ) -> ::locale_t1818 pub fn newlocale( 1819 mask: ::c_int, 1820 locale: *const ::c_char, 1821 base: ::locale_t, 1822 ) -> ::locale_t; uselocale(loc: ::locale_t) -> ::locale_t1823 pub fn uselocale(loc: ::locale_t) -> ::locale_t; creat64(path: *const c_char, mode: mode_t) -> ::c_int1824 pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int; fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int1825 pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int; fstatat64( fildes: ::c_int, path: *const ::c_char, buf: *mut stat64, flag: ::c_int, ) -> ::c_int1826 pub fn fstatat64( 1827 fildes: ::c_int, 1828 path: *const ::c_char, 1829 buf: *mut stat64, 1830 flag: ::c_int, 1831 ) -> ::c_int; ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int1832 pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int; getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int1833 pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int; lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t1834 pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t; lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int1835 pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int; mmap64( addr: *mut ::c_void, len: ::size_t, prot: ::c_int, flags: ::c_int, fd: ::c_int, offset: off64_t, ) -> *mut ::c_void1836 pub fn mmap64( 1837 addr: *mut ::c_void, 1838 len: ::size_t, 1839 prot: ::c_int, 1840 flags: ::c_int, 1841 fd: ::c_int, 1842 offset: off64_t, 1843 ) -> *mut ::c_void; open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int1844 pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int; openat64( fd: ::c_int, path: *const c_char, oflag: ::c_int, ... ) -> ::c_int1845 pub fn openat64( 1846 fd: ::c_int, 1847 path: *const c_char, 1848 oflag: ::c_int, 1849 ... 1850 ) -> ::c_int; pread64( fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off64_t, ) -> ::ssize_t1851 pub fn pread64( 1852 fd: ::c_int, 1853 buf: *mut ::c_void, 1854 count: ::size_t, 1855 offset: off64_t, 1856 ) -> ::ssize_t; pwrite64( fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off64_t, ) -> ::ssize_t1857 pub fn pwrite64( 1858 fd: ::c_int, 1859 buf: *const ::c_void, 1860 count: ::size_t, 1861 offset: off64_t, 1862 ) -> ::ssize_t; readdir64(dirp: *mut ::DIR) -> *mut ::dirent641863 pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64; readdir64_r( dirp: *mut ::DIR, entry: *mut ::dirent64, result: *mut *mut ::dirent64, ) -> ::c_int1864 pub fn readdir64_r( 1865 dirp: *mut ::DIR, 1866 entry: *mut ::dirent64, 1867 result: *mut *mut ::dirent64, 1868 ) -> ::c_int; setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int1869 pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int; stat64(path: *const c_char, buf: *mut stat64) -> ::c_int1870 pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int; truncate64(path: *const c_char, length: off64_t) -> ::c_int1871 pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int; eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int1872 pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; 1873 mknodat( dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t, dev: dev_t, ) -> ::c_int1874 pub fn mknodat( 1875 dirfd: ::c_int, 1876 pathname: *const ::c_char, 1877 mode: ::mode_t, 1878 dev: dev_t, 1879 ) -> ::c_int; ppoll( fds: *mut ::pollfd, nfds: nfds_t, timeout: *const ::timespec, sigmask: *const sigset_t, ) -> ::c_int1880 pub fn ppoll( 1881 fds: *mut ::pollfd, 1882 nfds: nfds_t, 1883 timeout: *const ::timespec, 1884 sigmask: *const sigset_t, 1885 ) -> ::c_int; pthread_condattr_getclock( attr: *const pthread_condattr_t, clock_id: *mut clockid_t, ) -> ::c_int1886 pub fn pthread_condattr_getclock( 1887 attr: *const pthread_condattr_t, 1888 clock_id: *mut clockid_t, 1889 ) -> ::c_int; pthread_condattr_setclock( attr: *mut pthread_condattr_t, clock_id: ::clockid_t, ) -> ::c_int1890 pub fn pthread_condattr_setclock( 1891 attr: *mut pthread_condattr_t, 1892 clock_id: ::clockid_t, 1893 ) -> ::c_int; pthread_condattr_setpshared( attr: *mut pthread_condattr_t, pshared: ::c_int, ) -> ::c_int1894 pub fn pthread_condattr_setpshared( 1895 attr: *mut pthread_condattr_t, 1896 pshared: ::c_int, 1897 ) -> ::c_int; pthread_condattr_getpshared( attr: *const pthread_condattr_t, pshared: *mut ::c_int, ) -> ::c_int1898 pub fn pthread_condattr_getpshared( 1899 attr: *const pthread_condattr_t, 1900 pshared: *mut ::c_int, 1901 ) -> ::c_int; sched_getaffinity( pid: ::pid_t, cpusetsize: ::size_t, cpuset: *mut cpu_set_t, ) -> ::c_int1902 pub fn sched_getaffinity( 1903 pid: ::pid_t, 1904 cpusetsize: ::size_t, 1905 cpuset: *mut cpu_set_t, 1906 ) -> ::c_int; sched_setaffinity( pid: ::pid_t, cpusetsize: ::size_t, cpuset: *const cpu_set_t, ) -> ::c_int1907 pub fn sched_setaffinity( 1908 pid: ::pid_t, 1909 cpusetsize: ::size_t, 1910 cpuset: *const cpu_set_t, 1911 ) -> ::c_int; unshare(flags: ::c_int) -> ::c_int1912 pub fn unshare(flags: ::c_int) -> ::c_int; sem_timedwait( sem: *mut sem_t, abstime: *const ::timespec, ) -> ::c_int1913 pub fn sem_timedwait( 1914 sem: *mut sem_t, 1915 abstime: *const ::timespec, 1916 ) -> ::c_int; sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int1917 pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int; accept4( fd: ::c_int, addr: *mut ::sockaddr, len: *mut ::socklen_t, flg: ::c_int, ) -> ::c_int1918 pub fn accept4( 1919 fd: ::c_int, 1920 addr: *mut ::sockaddr, 1921 len: *mut ::socklen_t, 1922 flg: ::c_int, 1923 ) -> ::c_int; pthread_mutex_timedlock( lock: *mut pthread_mutex_t, abstime: *const ::timespec, ) -> ::c_int1924 pub fn pthread_mutex_timedlock( 1925 lock: *mut pthread_mutex_t, 1926 abstime: *const ::timespec, 1927 ) -> ::c_int; pthread_mutexattr_setpshared( attr: *mut pthread_mutexattr_t, pshared: ::c_int, ) -> ::c_int1928 pub fn pthread_mutexattr_setpshared( 1929 attr: *mut pthread_mutexattr_t, 1930 pshared: ::c_int, 1931 ) -> ::c_int; pthread_mutexattr_getpshared( attr: *const pthread_mutexattr_t, pshared: *mut ::c_int, ) -> ::c_int1932 pub fn pthread_mutexattr_getpshared( 1933 attr: *const pthread_mutexattr_t, 1934 pshared: *mut ::c_int, 1935 ) -> ::c_int; pthread_rwlockattr_getkind_np( attr: *const pthread_rwlockattr_t, val: *mut ::c_int, ) -> ::c_int1936 pub fn pthread_rwlockattr_getkind_np( 1937 attr: *const pthread_rwlockattr_t, 1938 val: *mut ::c_int, 1939 ) -> ::c_int; pthread_rwlockattr_setkind_np( attr: *mut pthread_rwlockattr_t, val: ::c_int, ) -> ::c_int1940 pub fn pthread_rwlockattr_setkind_np( 1941 attr: *mut pthread_rwlockattr_t, 1942 val: ::c_int, 1943 ) -> ::c_int; pthread_rwlockattr_getpshared( attr: *const pthread_rwlockattr_t, val: *mut ::c_int, ) -> ::c_int1944 pub fn pthread_rwlockattr_getpshared( 1945 attr: *const pthread_rwlockattr_t, 1946 val: *mut ::c_int, 1947 ) -> ::c_int; pthread_rwlockattr_setpshared( attr: *mut pthread_rwlockattr_t, val: ::c_int, ) -> ::c_int1948 pub fn pthread_rwlockattr_setpshared( 1949 attr: *mut pthread_rwlockattr_t, 1950 val: ::c_int, 1951 ) -> ::c_int; ptsname_r( fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t, ) -> ::c_int1952 pub fn ptsname_r( 1953 fd: ::c_int, 1954 buf: *mut ::c_char, 1955 buflen: ::size_t, 1956 ) -> ::c_int; clearenv() -> ::c_int1957 pub fn clearenv() -> ::c_int; waitid( idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int, ) -> ::c_int1958 pub fn waitid( 1959 idtype: idtype_t, 1960 id: id_t, 1961 infop: *mut ::siginfo_t, 1962 options: ::c_int, 1963 ) -> ::c_int; 1964 lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int1965 pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; 1966 setpwent()1967 pub fn setpwent(); endpwent()1968 pub fn endpwent(); getpwent() -> *mut passwd1969 pub fn getpwent() -> *mut passwd; setspent()1970 pub fn setspent(); endspent()1971 pub fn endspent(); getspent() -> *mut spwd1972 pub fn getspent() -> *mut spwd; getspnam(__name: *const ::c_char) -> *mut spwd1973 pub fn getspnam(__name: *const ::c_char) -> *mut spwd; 1974 shm_open( name: *const c_char, oflag: ::c_int, mode: mode_t, ) -> ::c_int1975 pub fn shm_open( 1976 name: *const c_char, 1977 oflag: ::c_int, 1978 mode: mode_t, 1979 ) -> ::c_int; 1980 1981 // System V IPC shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int1982 pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int; shmat( shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int, ) -> *mut ::c_void1983 pub fn shmat( 1984 shmid: ::c_int, 1985 shmaddr: *const ::c_void, 1986 shmflg: ::c_int, 1987 ) -> *mut ::c_void; shmdt(shmaddr: *const ::c_void) -> ::c_int1988 pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int; shmctl( shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds, ) -> ::c_int1989 pub fn shmctl( 1990 shmid: ::c_int, 1991 cmd: ::c_int, 1992 buf: *mut ::shmid_ds, 1993 ) -> ::c_int; ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t1994 pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t; msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int1995 pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) 1996 -> ::c_int; msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int1997 pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int; msgrcv( msqid: ::c_int, msgp: *mut ::c_void, msgsz: ::size_t, msgtyp: ::c_long, msgflg: ::c_int, ) -> ::ssize_t1998 pub fn msgrcv( 1999 msqid: ::c_int, 2000 msgp: *mut ::c_void, 2001 msgsz: ::size_t, 2002 msgtyp: ::c_long, 2003 msgflg: ::c_int, 2004 ) -> ::ssize_t; msgsnd( msqid: ::c_int, msgp: *const ::c_void, msgsz: ::size_t, msgflg: ::c_int, ) -> ::c_int2005 pub fn msgsnd( 2006 msqid: ::c_int, 2007 msgp: *const ::c_void, 2008 msgsz: ::size_t, 2009 msgflg: ::c_int, 2010 ) -> ::c_int; 2011 mprotect( addr: *mut ::c_void, len: ::size_t, prot: ::c_int, ) -> ::c_int2012 pub fn mprotect( 2013 addr: *mut ::c_void, 2014 len: ::size_t, 2015 prot: ::c_int, 2016 ) -> ::c_int; __errno_location() -> *mut ::c_int2017 pub fn __errno_location() -> *mut ::c_int; 2018 fopen64( filename: *const c_char, mode: *const c_char, ) -> *mut ::FILE2019 pub fn fopen64( 2020 filename: *const c_char, 2021 mode: *const c_char, 2022 ) -> *mut ::FILE; freopen64( filename: *const c_char, mode: *const c_char, file: *mut ::FILE, ) -> *mut ::FILE2023 pub fn freopen64( 2024 filename: *const c_char, 2025 mode: *const c_char, 2026 file: *mut ::FILE, 2027 ) -> *mut ::FILE; tmpfile64() -> *mut ::FILE2028 pub fn tmpfile64() -> *mut ::FILE; fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int2029 pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int; fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int2030 pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int; fseeko64( stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int, ) -> ::c_int2031 pub fn fseeko64( 2032 stream: *mut ::FILE, 2033 offset: ::off64_t, 2034 whence: ::c_int, 2035 ) -> ::c_int; ftello64(stream: *mut ::FILE) -> ::off64_t2036 pub fn ftello64(stream: *mut ::FILE) -> ::off64_t; readahead( fd: ::c_int, offset: ::off64_t, count: ::size_t, ) -> ::ssize_t2037 pub fn readahead( 2038 fd: ::c_int, 2039 offset: ::off64_t, 2040 count: ::size_t, 2041 ) -> ::ssize_t; getxattr( path: *const c_char, name: *const c_char, value: *mut ::c_void, size: ::size_t, ) -> ::ssize_t2042 pub fn getxattr( 2043 path: *const c_char, 2044 name: *const c_char, 2045 value: *mut ::c_void, 2046 size: ::size_t, 2047 ) -> ::ssize_t; lgetxattr( path: *const c_char, name: *const c_char, value: *mut ::c_void, size: ::size_t, ) -> ::ssize_t2048 pub fn lgetxattr( 2049 path: *const c_char, 2050 name: *const c_char, 2051 value: *mut ::c_void, 2052 size: ::size_t, 2053 ) -> ::ssize_t; fgetxattr( filedes: ::c_int, name: *const c_char, value: *mut ::c_void, size: ::size_t, ) -> ::ssize_t2054 pub fn fgetxattr( 2055 filedes: ::c_int, 2056 name: *const c_char, 2057 value: *mut ::c_void, 2058 size: ::size_t, 2059 ) -> ::ssize_t; setxattr( path: *const c_char, name: *const c_char, value: *const ::c_void, size: ::size_t, flags: ::c_int, ) -> ::c_int2060 pub fn setxattr( 2061 path: *const c_char, 2062 name: *const c_char, 2063 value: *const ::c_void, 2064 size: ::size_t, 2065 flags: ::c_int, 2066 ) -> ::c_int; lsetxattr( path: *const c_char, name: *const c_char, value: *const ::c_void, size: ::size_t, flags: ::c_int, ) -> ::c_int2067 pub fn lsetxattr( 2068 path: *const c_char, 2069 name: *const c_char, 2070 value: *const ::c_void, 2071 size: ::size_t, 2072 flags: ::c_int, 2073 ) -> ::c_int; fsetxattr( filedes: ::c_int, name: *const c_char, value: *const ::c_void, size: ::size_t, flags: ::c_int, ) -> ::c_int2074 pub fn fsetxattr( 2075 filedes: ::c_int, 2076 name: *const c_char, 2077 value: *const ::c_void, 2078 size: ::size_t, 2079 flags: ::c_int, 2080 ) -> ::c_int; listxattr( path: *const c_char, list: *mut c_char, size: ::size_t, ) -> ::ssize_t2081 pub fn listxattr( 2082 path: *const c_char, 2083 list: *mut c_char, 2084 size: ::size_t, 2085 ) -> ::ssize_t; llistxattr( path: *const c_char, list: *mut c_char, size: ::size_t, ) -> ::ssize_t2086 pub fn llistxattr( 2087 path: *const c_char, 2088 list: *mut c_char, 2089 size: ::size_t, 2090 ) -> ::ssize_t; flistxattr( filedes: ::c_int, list: *mut c_char, size: ::size_t, ) -> ::ssize_t2091 pub fn flistxattr( 2092 filedes: ::c_int, 2093 list: *mut c_char, 2094 size: ::size_t, 2095 ) -> ::ssize_t; removexattr(path: *const c_char, name: *const c_char) -> ::c_int2096 pub fn removexattr(path: *const c_char, name: *const c_char) -> ::c_int; lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int2097 pub fn lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int; fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int2098 pub fn fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int; signalfd( fd: ::c_int, mask: *const ::sigset_t, flags: ::c_int, ) -> ::c_int2099 pub fn signalfd( 2100 fd: ::c_int, 2101 mask: *const ::sigset_t, 2102 flags: ::c_int, 2103 ) -> ::c_int; quotactl( cmd: ::c_int, special: *const ::c_char, id: ::c_int, data: *mut ::c_char, ) -> ::c_int2104 pub fn quotactl( 2105 cmd: ::c_int, 2106 special: *const ::c_char, 2107 id: ::c_int, 2108 data: *mut ::c_char, 2109 ) -> ::c_int; mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t2110 pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t; mq_close(mqd: ::mqd_t) -> ::c_int2111 pub fn mq_close(mqd: ::mqd_t) -> ::c_int; mq_unlink(name: *const ::c_char) -> ::c_int2112 pub fn mq_unlink(name: *const ::c_char) -> ::c_int; mq_receive( mqd: ::mqd_t, msg_ptr: *mut ::c_char, msg_len: ::size_t, msg_prio: *mut ::c_uint, ) -> ::ssize_t2113 pub fn mq_receive( 2114 mqd: ::mqd_t, 2115 msg_ptr: *mut ::c_char, 2116 msg_len: ::size_t, 2117 msg_prio: *mut ::c_uint, 2118 ) -> ::ssize_t; mq_send( mqd: ::mqd_t, msg_ptr: *const ::c_char, msg_len: ::size_t, msg_prio: ::c_uint, ) -> ::c_int2119 pub fn mq_send( 2120 mqd: ::mqd_t, 2121 msg_ptr: *const ::c_char, 2122 msg_len: ::size_t, 2123 msg_prio: ::c_uint, 2124 ) -> ::c_int; mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int2125 pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int; mq_setattr( mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr, ) -> ::c_int2126 pub fn mq_setattr( 2127 mqd: ::mqd_t, 2128 newattr: *const ::mq_attr, 2129 oldattr: *mut ::mq_attr, 2130 ) -> ::c_int; epoll_pwait( epfd: ::c_int, events: *mut ::epoll_event, maxevents: ::c_int, timeout: ::c_int, sigmask: *const ::sigset_t, ) -> ::c_int2131 pub fn epoll_pwait( 2132 epfd: ::c_int, 2133 events: *mut ::epoll_event, 2134 maxevents: ::c_int, 2135 timeout: ::c_int, 2136 sigmask: *const ::sigset_t, 2137 ) -> ::c_int; sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int2138 pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int; sigtimedwait( set: *const sigset_t, info: *mut siginfo_t, timeout: *const ::timespec, ) -> ::c_int2139 pub fn sigtimedwait( 2140 set: *const sigset_t, 2141 info: *mut siginfo_t, 2142 timeout: *const ::timespec, 2143 ) -> ::c_int; sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int2144 pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int; nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char2145 pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) 2146 -> *mut ::c_char; prlimit( pid: ::pid_t, resource: ::c_int, new_limit: *const ::rlimit, old_limit: *mut ::rlimit, ) -> ::c_int2147 pub fn prlimit( 2148 pid: ::pid_t, 2149 resource: ::c_int, 2150 new_limit: *const ::rlimit, 2151 old_limit: *mut ::rlimit, 2152 ) -> ::c_int; prlimit64( pid: ::pid_t, resource: ::c_int, new_limit: *const ::rlimit64, old_limit: *mut ::rlimit64, ) -> ::c_int2153 pub fn prlimit64( 2154 pid: ::pid_t, 2155 resource: ::c_int, 2156 new_limit: *const ::rlimit64, 2157 old_limit: *mut ::rlimit64, 2158 ) -> ::c_int; reboot(how_to: ::c_int) -> ::c_int2159 pub fn reboot(how_to: ::c_int) -> ::c_int; setfsgid(gid: ::gid_t) -> ::c_int2160 pub fn setfsgid(gid: ::gid_t) -> ::c_int; setfsuid(uid: ::uid_t) -> ::c_int2161 pub fn setfsuid(uid: ::uid_t) -> ::c_int; setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int2162 pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int; setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int2163 pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int; 2164 2165 // Not available now on Android mkfifoat( dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t, ) -> ::c_int2166 pub fn mkfifoat( 2167 dirfd: ::c_int, 2168 pathname: *const ::c_char, 2169 mode: ::mode_t, 2170 ) -> ::c_int; if_nameindex() -> *mut if_nameindex2171 pub fn if_nameindex() -> *mut if_nameindex; if_freenameindex(ptr: *mut if_nameindex)2172 pub fn if_freenameindex(ptr: *mut if_nameindex); sync_file_range( fd: ::c_int, offset: ::off64_t, nbytes: ::off64_t, flags: ::c_uint, ) -> ::c_int2173 pub fn sync_file_range( 2174 fd: ::c_int, 2175 offset: ::off64_t, 2176 nbytes: ::off64_t, 2177 flags: ::c_uint, 2178 ) -> ::c_int; getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int2179 pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int; freeifaddrs(ifa: *mut ::ifaddrs)2180 pub fn freeifaddrs(ifa: *mut ::ifaddrs); 2181 mremap( addr: *mut ::c_void, len: ::size_t, new_len: ::size_t, flags: ::c_int, ... ) -> *mut ::c_void2182 pub fn mremap( 2183 addr: *mut ::c_void, 2184 len: ::size_t, 2185 new_len: ::size_t, 2186 flags: ::c_int, 2187 ... 2188 ) -> *mut ::c_void; 2189 glob( pattern: *const c_char, flags: ::c_int, errfunc: ::Option< extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int, >, pglob: *mut ::glob_t, ) -> ::c_int2190 pub fn glob( 2191 pattern: *const c_char, 2192 flags: ::c_int, 2193 errfunc: ::Option< 2194 extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int, 2195 >, 2196 pglob: *mut ::glob_t, 2197 ) -> ::c_int; globfree(pglob: *mut ::glob_t)2198 pub fn globfree(pglob: *mut ::glob_t); 2199 shm_unlink(name: *const ::c_char) -> ::c_int2200 pub fn shm_unlink(name: *const ::c_char) -> ::c_int; 2201 seekdir(dirp: *mut ::DIR, loc: ::c_long)2202 pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); 2203 dirfd(dirp: *mut ::DIR) -> ::c_int2204 pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; 2205 telldir(dirp: *mut ::DIR) -> ::c_long2206 pub fn telldir(dirp: *mut ::DIR) -> ::c_long; madvise( addr: *mut ::c_void, len: ::size_t, advice: ::c_int, ) -> ::c_int2207 pub fn madvise( 2208 addr: *mut ::c_void, 2209 len: ::size_t, 2210 advice: ::c_int, 2211 ) -> ::c_int; 2212 msync( addr: *mut ::c_void, len: ::size_t, flags: ::c_int, ) -> ::c_int2213 pub fn msync( 2214 addr: *mut ::c_void, 2215 len: ::size_t, 2216 flags: ::c_int, 2217 ) -> ::c_int; 2218 recvfrom( socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int, addr: *mut ::sockaddr, addrlen: *mut ::socklen_t, ) -> ::ssize_t2219 pub fn recvfrom( 2220 socket: ::c_int, 2221 buf: *mut ::c_void, 2222 len: ::size_t, 2223 flags: ::c_int, 2224 addr: *mut ::sockaddr, 2225 addrlen: *mut ::socklen_t, 2226 ) -> ::ssize_t; nl_langinfo(item: ::nl_item) -> *mut ::c_char2227 pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; 2228 bind( socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t, ) -> ::c_int2229 pub fn bind( 2230 socket: ::c_int, 2231 address: *const ::sockaddr, 2232 address_len: ::socklen_t, 2233 ) -> ::c_int; 2234 writev( fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, ) -> ::ssize_t2235 pub fn writev( 2236 fd: ::c_int, 2237 iov: *const ::iovec, 2238 iovcnt: ::c_int, 2239 ) -> ::ssize_t; readv( fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, ) -> ::ssize_t2240 pub fn readv( 2241 fd: ::c_int, 2242 iov: *const ::iovec, 2243 iovcnt: ::c_int, 2244 ) -> ::ssize_t; 2245 sendmsg( fd: ::c_int, msg: *const ::msghdr, flags: ::c_int, ) -> ::ssize_t2246 pub fn sendmsg( 2247 fd: ::c_int, 2248 msg: *const ::msghdr, 2249 flags: ::c_int, 2250 ) -> ::ssize_t; recvmsg( fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int, ) -> ::ssize_t2251 pub fn recvmsg( 2252 fd: ::c_int, 2253 msg: *mut ::msghdr, 2254 flags: ::c_int, 2255 ) -> ::ssize_t; getgrgid_r( gid: ::gid_t, grp: *mut ::group, buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut ::group, ) -> ::c_int2256 pub fn getgrgid_r( 2257 gid: ::gid_t, 2258 grp: *mut ::group, 2259 buf: *mut ::c_char, 2260 buflen: ::size_t, 2261 result: *mut *mut ::group, 2262 ) -> ::c_int; sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int2263 pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; sem_close(sem: *mut sem_t) -> ::c_int2264 pub fn sem_close(sem: *mut sem_t) -> ::c_int; getdtablesize() -> ::c_int2265 pub fn getdtablesize() -> ::c_int; getgrnam_r( name: *const ::c_char, grp: *mut ::group, buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut ::group, ) -> ::c_int2266 pub fn getgrnam_r( 2267 name: *const ::c_char, 2268 grp: *mut ::group, 2269 buf: *mut ::c_char, 2270 buflen: ::size_t, 2271 result: *mut *mut ::group, 2272 ) -> ::c_int; pthread_sigmask( how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t, ) -> ::c_int2273 pub fn pthread_sigmask( 2274 how: ::c_int, 2275 set: *const sigset_t, 2276 oldset: *mut sigset_t, 2277 ) -> ::c_int; sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t2278 pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; getgrnam(name: *const ::c_char) -> *mut ::group2279 pub fn getgrnam(name: *const ::c_char) -> *mut ::group; pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int2280 pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; sem_unlink(name: *const ::c_char) -> ::c_int2281 pub fn sem_unlink(name: *const ::c_char) -> ::c_int; daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int2282 pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; getpwnam_r( name: *const ::c_char, pwd: *mut passwd, buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut passwd, ) -> ::c_int2283 pub fn getpwnam_r( 2284 name: *const ::c_char, 2285 pwd: *mut passwd, 2286 buf: *mut ::c_char, 2287 buflen: ::size_t, 2288 result: *mut *mut passwd, 2289 ) -> ::c_int; getpwuid_r( uid: ::uid_t, pwd: *mut passwd, buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut passwd, ) -> ::c_int2290 pub fn getpwuid_r( 2291 uid: ::uid_t, 2292 pwd: *mut passwd, 2293 buf: *mut ::c_char, 2294 buflen: ::size_t, 2295 result: *mut *mut passwd, 2296 ) -> ::c_int; sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int2297 pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; pthread_atfork( prepare: ::Option<unsafe extern "C" fn()>, parent: ::Option<unsafe extern "C" fn()>, child: ::Option<unsafe extern "C" fn()>, ) -> ::c_int2298 pub fn pthread_atfork( 2299 prepare: ::Option<unsafe extern "C" fn()>, 2300 parent: ::Option<unsafe extern "C" fn()>, 2301 child: ::Option<unsafe extern "C" fn()>, 2302 ) -> ::c_int; pthread_create( native: *mut ::pthread_t, attr: *const ::pthread_attr_t, f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, value: *mut ::c_void, ) -> ::c_int2303 pub fn pthread_create( 2304 native: *mut ::pthread_t, 2305 attr: *const ::pthread_attr_t, 2306 f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, 2307 value: *mut ::c_void, 2308 ) -> ::c_int; dl_iterate_phdr( callback: ::Option< unsafe extern "C" fn( info: *mut ::dl_phdr_info, size: ::size_t, data: *mut ::c_void, ) -> ::c_int, >, data: *mut ::c_void, ) -> ::c_int2309 pub fn dl_iterate_phdr( 2310 callback: ::Option< 2311 unsafe extern "C" fn( 2312 info: *mut ::dl_phdr_info, 2313 size: ::size_t, 2314 data: *mut ::c_void, 2315 ) -> ::c_int, 2316 >, 2317 data: *mut ::c_void, 2318 ) -> ::c_int; getgrgid(gid: ::gid_t) -> *mut ::group2319 pub fn getgrgid(gid: ::gid_t) -> *mut ::group; popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE2320 pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; uname(buf: *mut ::utsname) -> ::c_int2321 pub fn uname(buf: *mut ::utsname) -> ::c_int; getnameinfo( sa: *const ::sockaddr, salen: ::socklen_t, host: *mut ::c_char, hostlen: ::socklen_t, serv: *mut ::c_char, sevlen: ::socklen_t, flags: ::c_uint, ) -> ::c_int2322 pub fn getnameinfo( 2323 sa: *const ::sockaddr, 2324 salen: ::socklen_t, 2325 host: *mut ::c_char, 2326 hostlen: ::socklen_t, 2327 serv: *mut ::c_char, 2328 sevlen: ::socklen_t, 2329 flags: ::c_uint, 2330 ) -> ::c_int; 2331 } 2332 2333 cfg_if! { 2334 if #[cfg(any(target_arch = "mips", target_arch = "mips64"))] { 2335 mod mips; 2336 pub use self::mips::*; 2337 } else if #[cfg(target_arch = "x86_64")] { 2338 mod x86_64; 2339 pub use self::x86_64::*; 2340 } else if #[cfg(target_arch = "arm")] { 2341 mod arm; 2342 pub use self::arm::*; 2343 } else { 2344 pub use unsupported_target; 2345 } 2346 } 2347 2348 cfg_if! { 2349 if #[cfg(libc_align)] { 2350 #[macro_use] 2351 mod align; 2352 } else { 2353 #[macro_use] 2354 mod no_align; 2355 } 2356 } 2357 2358 expand_align!(); 2359