1 pub type clock_t = u32; 2 3 pub type sa_family_t = u8; 4 pub type speed_t = ::c_uint; 5 pub type tcflag_t = ::c_uint; 6 pub type clockid_t = ::c_int; 7 pub type timer_t = ::c_int; 8 pub type key_t = ::c_uint; 9 pub type id_t = ::c_int; 10 11 pub type useconds_t = u32; 12 pub type dev_t = u32; 13 pub type socklen_t = u32; 14 pub type mode_t = u32; 15 pub type rlim64_t = u64; 16 pub type mqd_t = ::c_int; 17 pub type nfds_t = ::c_uint; 18 pub type idtype_t = ::c_uint; 19 pub type errno_t = ::c_int; 20 pub type rsize_t = c_ulong; 21 22 pub type Elf32_Half = u16; 23 pub type Elf32_Word = u32; 24 pub type Elf32_Off = u32; 25 pub type Elf32_Addr = u32; 26 pub type Elf32_Lword = u64; 27 pub type Elf32_Sword = i32; 28 29 pub type Elf64_Half = u16; 30 pub type Elf64_Word = u32; 31 pub type Elf64_Off = u64; 32 pub type Elf64_Addr = u64; 33 pub type Elf64_Xword = u64; 34 pub type Elf64_Sxword = i64; 35 pub type Elf64_Lword = u64; 36 pub type Elf64_Sword = i32; 37 38 pub type Elf32_Section = u16; 39 pub type Elf64_Section = u16; 40 41 pub type _Time32t = u32; 42 43 pub type pthread_t = ::c_int; 44 pub type regoff_t = ::ssize_t; 45 46 pub type nlink_t = u32; 47 pub type blksize_t = u32; 48 pub type suseconds_t = i32; 49 50 pub type ino_t = u64; 51 pub type off_t = i64; 52 pub type blkcnt_t = u64; 53 pub type msgqnum_t = u64; 54 pub type msglen_t = u64; 55 pub type fsblkcnt_t = u64; 56 pub type fsfilcnt_t = u64; 57 pub type rlim_t = u64; 58 pub type posix_spawn_file_actions_t = *mut ::c_void; 59 pub type posix_spawnattr_t = ::uintptr_t; 60 61 pub type pthread_mutex_t = ::sync_t; 62 pub type pthread_mutexattr_t = ::_sync_attr; 63 pub type pthread_cond_t = ::sync_t; 64 pub type pthread_condattr_t = ::_sync_attr; 65 pub type pthread_rwlockattr_t = ::_sync_attr; 66 pub type pthread_key_t = ::c_int; 67 pub type pthread_spinlock_t = sync_t; 68 pub type pthread_barrierattr_t = _sync_attr; 69 pub type sem_t = sync_t; 70 71 pub type nl_item = ::c_int; 72 73 #[cfg_attr(feature = "extra_traits", derive(Debug))] 74 pub enum timezone {} 75 impl ::Copy for timezone {} 76 impl ::Clone for timezone { 77 fn clone(&self) -> timezone { 78 *self 79 } 80 } 81 82 s! { 83 pub struct dirent_extra { 84 pub d_datalen: u16, 85 pub d_type: u16, 86 pub d_reserved: u32, 87 } 88 89 pub struct stat { 90 pub st_ino: ::ino_t, 91 pub st_size: ::off_t, 92 pub st_dev: ::dev_t, 93 pub st_rdev: ::dev_t, 94 pub st_uid: ::uid_t, 95 pub st_gid: ::gid_t, 96 pub __old_st_mtime: ::_Time32t, 97 pub __old_st_atime: ::_Time32t, 98 pub __old_st_ctime: ::_Time32t, 99 pub st_mode: ::mode_t, 100 pub st_nlink: ::nlink_t, 101 pub st_blocksize: ::blksize_t, 102 pub st_nblocks: i32, 103 pub st_blksize: ::blksize_t, 104 pub st_blocks: ::blkcnt_t, 105 pub st_mtim: ::timespec, 106 pub st_atim: ::timespec, 107 pub st_ctim: ::timespec, 108 } 109 110 pub struct ip_mreq { 111 pub imr_multiaddr: in_addr, 112 pub imr_interface: in_addr, 113 } 114 115 #[repr(packed)] 116 pub struct in_addr { 117 pub s_addr: ::in_addr_t, 118 } 119 120 pub struct sockaddr { 121 pub sa_len: u8, 122 pub sa_family: sa_family_t, 123 pub sa_data: [::c_char; 14], 124 } 125 126 pub struct sockaddr_in { 127 pub sin_len: u8, 128 pub sin_family: sa_family_t, 129 pub sin_port: ::in_port_t, 130 pub sin_addr: ::in_addr, 131 pub sin_zero: [i8; 8], 132 } 133 134 pub struct sockaddr_in6 { 135 pub sin6_len: u8, 136 pub sin6_family: sa_family_t, 137 pub sin6_port: ::in_port_t, 138 pub sin6_flowinfo: u32, 139 pub sin6_addr: ::in6_addr, 140 pub sin6_scope_id: u32, 141 } 142 143 // The order of the `ai_addr` field in this struct is crucial 144 // for converting between the Rust and C types. 145 pub struct addrinfo { 146 pub ai_flags: ::c_int, 147 pub ai_family: ::c_int, 148 pub ai_socktype: ::c_int, 149 pub ai_protocol: ::c_int, 150 pub ai_addrlen: socklen_t, 151 pub ai_canonname: *mut c_char, 152 pub ai_addr: *mut ::sockaddr, 153 pub ai_next: *mut addrinfo, 154 } 155 156 pub struct fd_set { 157 fds_bits: [::c_uint; 2 * FD_SETSIZE / ULONG_SIZE], 158 } 159 160 pub struct tm { 161 pub tm_sec: ::c_int, 162 pub tm_min: ::c_int, 163 pub tm_hour: ::c_int, 164 pub tm_mday: ::c_int, 165 pub tm_mon: ::c_int, 166 pub tm_year: ::c_int, 167 pub tm_wday: ::c_int, 168 pub tm_yday: ::c_int, 169 pub tm_isdst: ::c_int, 170 pub tm_gmtoff: ::c_long, 171 pub tm_zone: *const ::c_char, 172 } 173 174 #[repr(align(8))] 175 pub struct sched_param { 176 pub sched_priority: ::c_int, 177 pub sched_curpriority: ::c_int, 178 pub reserved: [::c_int; 10], 179 } 180 181 #[repr(align(8))] 182 pub struct __sched_param { 183 pub __sched_priority: ::c_int, 184 pub __sched_curpriority: ::c_int, 185 pub reserved: [::c_int; 10], 186 } 187 188 pub struct Dl_info { 189 pub dli_fname: *const ::c_char, 190 pub dli_fbase: *mut ::c_void, 191 pub dli_sname: *const ::c_char, 192 pub dli_saddr: *mut ::c_void, 193 } 194 195 pub struct lconv { 196 pub currency_symbol: *mut ::c_char, 197 pub int_curr_symbol: *mut ::c_char, 198 pub mon_decimal_point: *mut ::c_char, 199 pub mon_grouping: *mut ::c_char, 200 pub mon_thousands_sep: *mut ::c_char, 201 pub negative_sign: *mut ::c_char, 202 pub positive_sign: *mut ::c_char, 203 pub frac_digits: ::c_char, 204 pub int_frac_digits: ::c_char, 205 pub n_cs_precedes: ::c_char, 206 pub n_sep_by_space: ::c_char, 207 pub n_sign_posn: ::c_char, 208 pub p_cs_precedes: ::c_char, 209 pub p_sep_by_space: ::c_char, 210 pub p_sign_posn: ::c_char, 211 212 pub int_n_cs_precedes: ::c_char, 213 pub int_n_sep_by_space: ::c_char, 214 pub int_n_sign_posn: ::c_char, 215 pub int_p_cs_precedes: ::c_char, 216 pub int_p_sep_by_space: ::c_char, 217 pub int_p_sign_posn: ::c_char, 218 219 pub decimal_point: *mut ::c_char, 220 pub grouping: *mut ::c_char, 221 pub thousands_sep: *mut ::c_char, 222 223 pub _Frac_grouping: *mut ::c_char, 224 pub _Frac_sep: *mut ::c_char, 225 pub _False: *mut ::c_char, 226 pub _True: *mut ::c_char, 227 228 pub _No: *mut ::c_char, 229 pub _Yes: *mut ::c_char, 230 pub _Nostr: *mut ::c_char, 231 pub _Yesstr: *mut ::c_char, 232 pub _Reserved: [*mut ::c_char; 8], 233 } 234 235 pub struct in_pktinfo { 236 pub ipi_addr: ::in_addr, 237 pub ipi_ifindex: ::c_uint, 238 } 239 240 pub struct ifaddrs { 241 pub ifa_next: *mut ifaddrs, 242 pub ifa_name: *mut c_char, 243 pub ifa_flags: ::c_uint, 244 pub ifa_addr: *mut ::sockaddr, 245 pub ifa_netmask: *mut ::sockaddr, 246 pub ifa_dstaddr: *mut ::sockaddr, 247 pub ifa_data: *mut ::c_void 248 } 249 250 pub struct arpreq { 251 pub arp_pa: ::sockaddr, 252 pub arp_ha: ::sockaddr, 253 pub arp_flags: ::c_int, 254 } 255 256 #[repr(packed)] 257 pub struct arphdr { 258 pub ar_hrd: u16, 259 pub ar_pro: u16, 260 pub ar_hln: u8, 261 pub ar_pln: u8, 262 pub ar_op: u16, 263 } 264 265 pub struct mmsghdr { 266 pub msg_hdr: ::msghdr, 267 pub msg_len: ::c_uint, 268 } 269 270 #[repr(align(8))] 271 pub struct siginfo_t { 272 pub si_signo: ::c_int, 273 pub si_code: ::c_int, 274 pub si_errno: ::c_int, 275 __data: [u8; 36], // union 276 } 277 278 pub struct sigaction { 279 pub sa_sigaction: ::sighandler_t, 280 pub sa_flags: ::c_int, 281 pub sa_mask: ::sigset_t, 282 } 283 284 pub struct _sync { 285 _union: ::c_uint, 286 __owner: ::c_uint, 287 } 288 pub struct rlimit64 { 289 pub rlim_cur: rlim64_t, 290 pub rlim_max: rlim64_t, 291 } 292 293 pub struct glob_t { 294 pub gl_pathc: ::size_t, 295 pub gl_matchc: ::c_int, 296 pub gl_pathv: *mut *mut c_char, 297 pub gl_offs: ::size_t, 298 pub gl_flags: ::c_int, 299 pub gl_errfunc: extern "C" fn(*const ::c_char, ::c_int) -> ::c_int, 300 301 __unused1: *mut ::c_void, 302 __unused2: *mut ::c_void, 303 __unused3: *mut ::c_void, 304 __unused4: *mut ::c_void, 305 __unused5: *mut ::c_void, 306 } 307 308 pub struct passwd { 309 pub pw_name: *mut ::c_char, 310 pub pw_passwd: *mut ::c_char, 311 pub pw_uid: ::uid_t, 312 pub pw_gid: ::gid_t, 313 pub pw_age: *mut ::c_char, 314 pub pw_comment: *mut ::c_char, 315 pub pw_gecos: *mut ::c_char, 316 pub pw_dir: *mut ::c_char, 317 pub pw_shell: *mut ::c_char, 318 } 319 320 pub struct if_nameindex { 321 pub if_index: ::c_uint, 322 pub if_name: *mut ::c_char, 323 } 324 325 pub struct sembuf { 326 pub sem_num: ::c_ushort, 327 pub sem_op: ::c_short, 328 pub sem_flg: ::c_short, 329 } 330 331 pub struct Elf32_Ehdr { 332 pub e_ident: [::c_uchar; 16], 333 pub e_type: Elf32_Half, 334 pub e_machine: Elf32_Half, 335 pub e_version: Elf32_Word, 336 pub e_entry: Elf32_Addr, 337 pub e_phoff: Elf32_Off, 338 pub e_shoff: Elf32_Off, 339 pub e_flags: Elf32_Word, 340 pub e_ehsize: Elf32_Half, 341 pub e_phentsize: Elf32_Half, 342 pub e_phnum: Elf32_Half, 343 pub e_shentsize: Elf32_Half, 344 pub e_shnum: Elf32_Half, 345 pub e_shstrndx: Elf32_Half, 346 } 347 348 pub struct Elf64_Ehdr { 349 pub e_ident: [::c_uchar; 16], 350 pub e_type: Elf64_Half, 351 pub e_machine: Elf64_Half, 352 pub e_version: Elf64_Word, 353 pub e_entry: Elf64_Addr, 354 pub e_phoff: Elf64_Off, 355 pub e_shoff: Elf64_Off, 356 pub e_flags: Elf64_Word, 357 pub e_ehsize: Elf64_Half, 358 pub e_phentsize: Elf64_Half, 359 pub e_phnum: Elf64_Half, 360 pub e_shentsize: Elf64_Half, 361 pub e_shnum: Elf64_Half, 362 pub e_shstrndx: Elf64_Half, 363 } 364 365 pub struct Elf32_Sym { 366 pub st_name: Elf32_Word, 367 pub st_value: Elf32_Addr, 368 pub st_size: Elf32_Word, 369 pub st_info: ::c_uchar, 370 pub st_other: ::c_uchar, 371 pub st_shndx: Elf32_Section, 372 } 373 374 pub struct Elf64_Sym { 375 pub st_name: Elf64_Word, 376 pub st_info: ::c_uchar, 377 pub st_other: ::c_uchar, 378 pub st_shndx: Elf64_Section, 379 pub st_value: Elf64_Addr, 380 pub st_size: Elf64_Xword, 381 } 382 383 pub struct Elf32_Phdr { 384 pub p_type: Elf32_Word, 385 pub p_offset: Elf32_Off, 386 pub p_vaddr: Elf32_Addr, 387 pub p_paddr: Elf32_Addr, 388 pub p_filesz: Elf32_Word, 389 pub p_memsz: Elf32_Word, 390 pub p_flags: Elf32_Word, 391 pub p_align: Elf32_Word, 392 } 393 394 pub struct Elf64_Phdr { 395 pub p_type: Elf64_Word, 396 pub p_flags: Elf64_Word, 397 pub p_offset: Elf64_Off, 398 pub p_vaddr: Elf64_Addr, 399 pub p_paddr: Elf64_Addr, 400 pub p_filesz: Elf64_Xword, 401 pub p_memsz: Elf64_Xword, 402 pub p_align: Elf64_Xword, 403 } 404 405 pub struct Elf32_Shdr { 406 pub sh_name: Elf32_Word, 407 pub sh_type: Elf32_Word, 408 pub sh_flags: Elf32_Word, 409 pub sh_addr: Elf32_Addr, 410 pub sh_offset: Elf32_Off, 411 pub sh_size: Elf32_Word, 412 pub sh_link: Elf32_Word, 413 pub sh_info: Elf32_Word, 414 pub sh_addralign: Elf32_Word, 415 pub sh_entsize: Elf32_Word, 416 } 417 418 pub struct Elf64_Shdr { 419 pub sh_name: Elf64_Word, 420 pub sh_type: Elf64_Word, 421 pub sh_flags: Elf64_Xword, 422 pub sh_addr: Elf64_Addr, 423 pub sh_offset: Elf64_Off, 424 pub sh_size: Elf64_Xword, 425 pub sh_link: Elf64_Word, 426 pub sh_info: Elf64_Word, 427 pub sh_addralign: Elf64_Xword, 428 pub sh_entsize: Elf64_Xword, 429 } 430 431 pub struct in6_pktinfo { 432 pub ipi6_addr: ::in6_addr, 433 pub ipi6_ifindex: ::c_uint, 434 } 435 436 pub struct inotify_event { 437 pub wd: ::c_int, 438 pub mask: u32, 439 pub cookie: u32, 440 pub len: u32 441 } 442 443 pub struct regmatch_t { 444 pub rm_so: regoff_t, 445 pub rm_eo: regoff_t, 446 } 447 448 pub struct msghdr { 449 pub msg_name: *mut ::c_void, 450 pub msg_namelen: ::socklen_t, 451 pub msg_iov: *mut ::iovec, 452 pub msg_iovlen: ::c_int, 453 pub msg_control: *mut ::c_void, 454 pub msg_controllen: ::socklen_t, 455 pub msg_flags: ::c_int, 456 } 457 458 pub struct cmsghdr { 459 pub cmsg_len: ::socklen_t, 460 pub cmsg_level: ::c_int, 461 pub cmsg_type: ::c_int, 462 } 463 464 pub struct termios { 465 pub c_iflag: ::tcflag_t, 466 pub c_oflag: ::tcflag_t, 467 pub c_cflag: ::tcflag_t, 468 pub c_lflag: ::tcflag_t, 469 pub c_cc: [::cc_t; ::NCCS], 470 __reserved: [::c_uint; 3], 471 pub c_ispeed: ::speed_t, 472 pub c_ospeed: ::speed_t, 473 } 474 475 pub struct mallinfo { 476 pub arena: ::c_int, 477 pub ordblks: ::c_int, 478 pub smblks: ::c_int, 479 pub hblks: ::c_int, 480 pub hblkhd: ::c_int, 481 pub usmblks: ::c_int, 482 pub fsmblks: ::c_int, 483 pub uordblks: ::c_int, 484 pub fordblks: ::c_int, 485 pub keepcost: ::c_int, 486 } 487 488 pub struct flock { 489 pub l_type: i16, 490 pub l_whence: i16, 491 pub l_zero1: i32, 492 pub l_start: ::off_t, 493 pub l_len: ::off_t, 494 pub l_pid: ::pid_t, 495 pub l_sysid: u32, 496 } 497 498 pub struct statvfs { 499 pub f_bsize: ::c_ulong, 500 pub f_frsize: ::c_ulong, 501 pub f_blocks: ::fsblkcnt_t, 502 pub f_bfree: ::fsblkcnt_t, 503 pub f_bavail: ::fsblkcnt_t, 504 pub f_files: ::fsfilcnt_t, 505 pub f_ffree: ::fsfilcnt_t, 506 pub f_favail: ::fsfilcnt_t, 507 pub f_fsid: ::c_ulong, 508 pub f_basetype: [::c_char; 16], 509 pub f_flag: ::c_ulong, 510 pub f_namemax: ::c_ulong, 511 f_filler: [::c_uint; 21], 512 } 513 514 pub struct aiocb { 515 pub aio_fildes: ::c_int, 516 pub aio_reqprio: ::c_int, 517 pub aio_offset: off_t, 518 pub aio_buf: *mut ::c_void, 519 pub aio_nbytes: ::size_t, 520 pub aio_sigevent: ::sigevent, 521 pub aio_lio_opcode: ::c_int, 522 pub _aio_lio_state: *mut ::c_void, 523 _aio_pad: [::c_int; 3], 524 pub _aio_next: *mut ::aiocb, 525 pub _aio_flag: ::c_uint, 526 pub _aio_iotype: ::c_uint, 527 pub _aio_result: ::ssize_t, 528 pub _aio_error: ::c_uint, 529 pub _aio_suspend: *mut ::c_void, 530 pub _aio_plist: *mut ::c_void, 531 pub _aio_policy: ::c_int, 532 pub _aio_param: ::__sched_param, 533 } 534 535 pub struct pthread_attr_t { 536 __data1: ::c_long, 537 __data2: [u8; 96] 538 } 539 540 pub struct ipc_perm { 541 pub uid: ::uid_t, 542 pub gid: ::gid_t, 543 pub cuid: ::uid_t, 544 pub cgid: ::gid_t, 545 pub mode: ::mode_t, 546 pub seq: ::c_uint, 547 pub key: ::key_t, 548 _reserved: [::c_int; 4], 549 } 550 551 pub struct regex_t { 552 re_magic: ::c_int, 553 re_nsub: ::size_t, 554 re_endp: *const ::c_char, 555 re_g: *mut ::c_void, 556 } 557 558 pub struct _thread_attr { 559 pub __flags: ::c_int, 560 pub __stacksize: ::size_t, 561 pub __stackaddr: *mut ::c_void, 562 pub __exitfunc: ::Option<unsafe extern "C" fn(_fake: *mut ::c_void)>, 563 pub __policy: ::c_int, 564 pub __param: ::__sched_param, 565 pub __guardsize: ::c_uint, 566 pub __prealloc: ::c_uint, 567 __spare: [::c_int; 2], 568 } 569 570 pub struct _sync_attr { 571 pub __protocol: ::c_int, 572 pub __flags: ::c_int, 573 pub __prioceiling: ::c_int, 574 pub __clockid: ::c_int, 575 pub __count: ::c_int, 576 __reserved: [::c_int; 3], 577 } 578 579 pub struct sockcred { 580 pub sc_uid: ::uid_t, 581 pub sc_euid: ::uid_t, 582 pub sc_gid: ::gid_t, 583 pub sc_egid: ::gid_t, 584 pub sc_ngroups: ::c_int, 585 pub sc_groups: [::gid_t; 1], 586 } 587 588 pub struct bpf_program { 589 pub bf_len: ::c_uint, 590 pub bf_insns: *mut ::bpf_insn, 591 } 592 593 pub struct bpf_stat { 594 pub bs_recv: u64, 595 pub bs_drop: u64, 596 pub bs_capt: u64, 597 bs_padding: [u64; 13], 598 } 599 600 pub struct bpf_version { 601 pub bv_major: ::c_ushort, 602 pub bv_minor: ::c_ushort, 603 } 604 605 pub struct bpf_hdr { 606 pub bh_tstamp: ::timeval, 607 pub bh_caplen: u32, 608 pub bh_datalen: u32, 609 pub bh_hdrlen: u16, 610 } 611 612 pub struct bpf_insn { 613 pub code: u16, 614 pub jt: ::c_uchar, 615 pub jf: ::c_uchar, 616 pub k: u32, 617 } 618 619 pub struct bpf_dltlist { 620 pub bfl_len: ::c_uint, 621 pub bfl_list: *mut ::c_uint, 622 } 623 624 pub struct unpcbid { 625 pub unp_pid: ::pid_t, 626 pub unp_euid: ::uid_t, 627 pub unp_egid: ::gid_t, 628 } 629 630 pub struct dl_phdr_info { 631 pub dlpi_addr: ::Elf64_Addr, 632 pub dlpi_name: *const ::c_char, 633 pub dlpi_phdr: *const ::Elf64_Phdr, 634 pub dlpi_phnum: ::Elf64_Half, 635 } 636 637 #[repr(align(8))] 638 pub struct ucontext_t { 639 pub uc_link: *mut ucontext_t, 640 pub uc_sigmask: ::sigset_t, 641 pub uc_stack: stack_t, 642 pub uc_mcontext: mcontext_t, 643 } 644 } 645 646 s_no_extra_traits! { 647 pub struct sockaddr_un { 648 pub sun_len: u8, 649 pub sun_family: sa_family_t, 650 pub sun_path: [::c_char; 104] 651 } 652 653 pub struct sockaddr_storage { 654 pub ss_len: u8, 655 pub ss_family: sa_family_t, 656 __ss_pad1: [::c_char; 6], 657 __ss_align: i64, 658 __ss_pad2: [::c_char; 112], 659 } 660 661 pub struct utsname { 662 pub sysname: [::c_char; _SYSNAME_SIZE], 663 pub nodename: [::c_char; _SYSNAME_SIZE], 664 pub release: [::c_char; _SYSNAME_SIZE], 665 pub version: [::c_char; _SYSNAME_SIZE], 666 pub machine: [::c_char; _SYSNAME_SIZE], 667 } 668 669 pub struct sigevent { 670 pub sigev_notify: ::c_int, 671 pub __padding1: ::c_int, 672 pub sigev_signo: ::c_int, // union 673 pub __padding2: ::c_int, 674 pub sigev_value: ::sigval, 675 __sigev_un2: usize, // union 676 677 } 678 pub struct dirent { 679 pub d_ino: ::ino_t, 680 pub d_offset: ::off_t, 681 pub d_reclen: ::c_short, 682 pub d_namelen: ::c_short, 683 pub d_name: [::c_char; 1], // flex array 684 } 685 686 pub struct sigset_t { 687 __val: [u32; 2], 688 } 689 690 pub struct mq_attr { 691 pub mq_maxmsg: ::c_long, 692 pub mq_msgsize: ::c_long, 693 pub mq_flags: ::c_long, 694 pub mq_curmsgs: ::c_long, 695 pub mq_sendwait: ::c_long, 696 pub mq_recvwait: ::c_long, 697 } 698 699 pub struct msg { 700 pub msg_next: *mut ::msg, 701 pub msg_type: ::c_long, 702 pub msg_ts: ::c_ushort, 703 pub msg_spot: ::c_short, 704 _pad: [u8; 4], 705 } 706 707 pub struct msqid_ds { 708 pub msg_perm: ::ipc_perm, 709 pub msg_first: *mut ::msg, 710 pub msg_last: *mut ::msg, 711 pub msg_cbytes: ::msglen_t, 712 pub msg_qnum: ::msgqnum_t, 713 pub msg_qbytes: ::msglen_t, 714 pub msg_lspid: ::pid_t, 715 pub msg_lrpid: ::pid_t, 716 pub msg_stime: ::time_t, 717 msg_pad1: ::c_long, 718 pub msg_rtime: ::time_t, 719 msg_pad2: ::c_long, 720 pub msg_ctime: ::time_t, 721 msg_pad3: ::c_long, 722 msg_pad4: [::c_long; 4], 723 } 724 725 pub struct sockaddr_dl { 726 pub sdl_len: ::c_uchar, 727 pub sdl_family: ::sa_family_t, 728 pub sdl_index: u16, 729 pub sdl_type: ::c_uchar, 730 pub sdl_nlen: ::c_uchar, 731 pub sdl_alen: ::c_uchar, 732 pub sdl_slen: ::c_uchar, 733 pub sdl_data: [::c_char; 12], 734 } 735 736 pub struct sync_t { 737 __u: ::c_uint, // union 738 pub __owner: ::c_uint, 739 } 740 741 #[repr(align(4))] 742 pub struct pthread_barrier_t { // union 743 __pad: [u8; 28], // union 744 } 745 746 pub struct pthread_rwlock_t { 747 pub __active: ::c_int, 748 pub __blockedwriters: ::c_int, 749 pub __blockedreaders: ::c_int, 750 pub __heavy: ::c_int, 751 pub __lock: ::pthread_mutex_t, // union 752 pub __rcond: ::pthread_cond_t, // union 753 pub __wcond: ::pthread_cond_t, // union 754 pub __owner: ::c_uint, 755 pub __spare: ::c_uint, 756 } 757 } 758 759 cfg_if! { 760 if #[cfg(feature = "extra_traits")] { 761 // sigevent 762 impl PartialEq for sigevent { 763 fn eq(&self, other: &sigevent) -> bool { 764 self.sigev_notify == other.sigev_notify 765 && self.sigev_signo == other.sigev_signo 766 && self.sigev_value == other.sigev_value 767 && self.__sigev_un2 768 == other.__sigev_un2 769 } 770 } 771 impl Eq for sigevent {} 772 impl ::fmt::Debug for sigevent { 773 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 774 f.debug_struct("sigevent") 775 .field("sigev_notify", &self.sigev_notify) 776 .field("sigev_signo", &self.sigev_signo) 777 .field("sigev_value", &self.sigev_value) 778 .field("__sigev_un2", 779 &self.__sigev_un2) 780 .finish() 781 } 782 } 783 impl ::hash::Hash for sigevent { 784 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 785 self.sigev_notify.hash(state); 786 self.sigev_signo.hash(state); 787 self.sigev_value.hash(state); 788 self.__sigev_un2.hash(state); 789 } 790 } 791 792 impl PartialEq for sockaddr_un { 793 fn eq(&self, other: &sockaddr_un) -> bool { 794 self.sun_len == other.sun_len 795 && self.sun_family == other.sun_family 796 && self 797 .sun_path 798 .iter() 799 .zip(other.sun_path.iter()) 800 .all(|(a,b)| a == b) 801 } 802 } 803 impl Eq for sockaddr_un {} 804 impl ::fmt::Debug for sockaddr_un { 805 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 806 f.debug_struct("sockaddr_un") 807 .field("sun_len", &self.sun_len) 808 .field("sun_family", &self.sun_family) 809 // FIXME: .field("sun_path", &self.sun_path) 810 .finish() 811 } 812 } 813 814 impl ::hash::Hash for sockaddr_un { 815 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 816 self.sun_len.hash(state); 817 self.sun_family.hash(state); 818 self.sun_path.hash(state); 819 } 820 } 821 822 // sigset_t 823 impl PartialEq for sigset_t { 824 fn eq(&self, other: &sigset_t) -> bool { 825 self.__val == other.__val 826 } 827 } 828 impl Eq for sigset_t {} 829 impl ::fmt::Debug for sigset_t { 830 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 831 f.debug_struct("sigset_t") 832 .field("__val", &self.__val) 833 .finish() 834 } 835 } 836 impl ::hash::Hash for sigset_t { 837 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 838 self.__val.hash(state); 839 } 840 } 841 842 // msg 843 impl ::fmt::Debug for msg { 844 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 845 f.debug_struct("msg") 846 .field("msg_next", &self.msg_next) 847 .field("msg_type", &self.msg_type) 848 .field("msg_ts", &self.msg_ts) 849 .field("msg_spot", &self.msg_spot) 850 .finish() 851 } 852 } 853 854 // msqid_ds 855 impl ::fmt::Debug for msqid_ds { 856 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 857 f.debug_struct("msqid_ds") 858 .field("msg_perm", &self.msg_perm) 859 .field("msg_first", &self.msg_first) 860 .field("msg_cbytes", &self.msg_cbytes) 861 .field("msg_qnum", &self.msg_qnum) 862 .field("msg_qbytes", &self.msg_qbytes) 863 .field("msg_lspid", &self.msg_lspid) 864 .field("msg_lrpid", &self.msg_lrpid) 865 .field("msg_stime", &self.msg_stime) 866 .field("msg_rtime", &self.msg_rtime) 867 .field("msg_ctime", &self.msg_ctime) 868 .finish() 869 } 870 } 871 872 // sockaddr_dl 873 impl ::fmt::Debug for sockaddr_dl { 874 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 875 f.debug_struct("sockaddr_dl") 876 .field("sdl_len", &self.sdl_len) 877 .field("sdl_family", &self.sdl_family) 878 .field("sdl_index", &self.sdl_index) 879 .field("sdl_type", &self.sdl_type) 880 .field("sdl_nlen", &self.sdl_nlen) 881 .field("sdl_alen", &self.sdl_alen) 882 .field("sdl_slen", &self.sdl_slen) 883 .field("sdl_data", &self.sdl_data) 884 .finish() 885 } 886 } 887 impl PartialEq for sockaddr_dl { 888 fn eq(&self, other: &sockaddr_dl) -> bool { 889 self.sdl_len == other.sdl_len 890 && self.sdl_family == other.sdl_family 891 && self.sdl_index == other.sdl_index 892 && self.sdl_type == other.sdl_type 893 && self.sdl_nlen == other.sdl_nlen 894 && self.sdl_alen == other.sdl_alen 895 && self.sdl_slen == other.sdl_slen 896 && self 897 .sdl_data 898 .iter() 899 .zip(other.sdl_data.iter()) 900 .all(|(a,b)| a == b) 901 } 902 } 903 impl Eq for sockaddr_dl {} 904 impl ::hash::Hash for sockaddr_dl { 905 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 906 self.sdl_len.hash(state); 907 self.sdl_family.hash(state); 908 self.sdl_index.hash(state); 909 self.sdl_type.hash(state); 910 self.sdl_nlen.hash(state); 911 self.sdl_alen.hash(state); 912 self.sdl_slen.hash(state); 913 self.sdl_data.hash(state); 914 } 915 } 916 917 // sync_t 918 impl ::fmt::Debug for sync_t { 919 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 920 f.debug_struct("sync_t") 921 .field("__owner", &self.__owner) 922 .field("__u", &self.__u) 923 .finish() 924 } 925 } 926 927 // pthread_barrier_t 928 impl ::fmt::Debug for pthread_barrier_t { 929 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 930 f.debug_struct("pthread_barrier_t") 931 .field("__pad", &self.__pad) 932 .finish() 933 } 934 } 935 936 // pthread_rwlock_t 937 impl ::fmt::Debug for pthread_rwlock_t { 938 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 939 f.debug_struct("pthread_rwlock_t") 940 .field("__active", &self.__active) 941 .field("__blockedwriters", &self.__blockedwriters) 942 .field("__blockedreaders", &self.__blockedreaders) 943 .field("__heavy", &self.__heavy) 944 .field("__lock", &self.__lock) 945 .field("__rcond", &self.__rcond) 946 .field("__wcond", &self.__wcond) 947 .field("__owner", &self.__owner) 948 .field("__spare", &self.__spare) 949 .finish() 950 } 951 } 952 953 // syspage_entry 954 impl ::fmt::Debug for syspage_entry { 955 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 956 f.debug_struct("syspage_entry") 957 .field("size", &self.size) 958 .field("total_size", &self.total_size) 959 .field("type_", &self.type_) 960 .field("num_cpu", &self.num_cpu) 961 .field("system_private", &self.system_private) 962 .field("old_asinfo", &self.old_asinfo) 963 .field("hwinfo", &self.hwinfo) 964 .field("old_cpuinfo", &self.old_cpuinfo) 965 .field("old_cacheattr", &self.old_cacheattr) 966 .field("qtime", &self.qtime) 967 .field("callout", &self.callout) 968 .field("callin", &self.callin) 969 .field("typed_strings", &self.typed_strings) 970 .field("strings", &self.strings) 971 .field("old_intrinfo", &self.old_intrinfo) 972 .field("smp", &self.smp) 973 .field("pminfo", &self.pminfo) 974 .field("old_mdriver", &self.old_mdriver) 975 .field("new_asinfo", &self.new_asinfo) 976 .field("new_cpuinfo", &self.new_cpuinfo) 977 .field("new_cacheattr", &self.new_cacheattr) 978 .field("new_intrinfo", &self.new_intrinfo) 979 .field("new_mdriver", &self.new_mdriver) 980 .finish() 981 } 982 } 983 984 impl PartialEq for utsname { 985 fn eq(&self, other: &utsname) -> bool { 986 self.sysname 987 .iter() 988 .zip(other.sysname.iter()) 989 .all(|(a,b)| a == b) 990 && self 991 .nodename 992 .iter() 993 .zip(other.nodename.iter()) 994 .all(|(a,b)| a == b) 995 && self 996 .release 997 .iter() 998 .zip(other.release.iter()) 999 .all(|(a,b)| a == b) 1000 && self 1001 .version 1002 .iter() 1003 .zip(other.version.iter()) 1004 .all(|(a,b)| a == b) 1005 && self 1006 .machine 1007 .iter() 1008 .zip(other.machine.iter()) 1009 .all(|(a,b)| a == b) 1010 } 1011 } 1012 1013 impl Eq for utsname {} 1014 1015 impl ::fmt::Debug for utsname { 1016 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1017 f.debug_struct("utsname") 1018 // FIXME: .field("sysname", &self.sysname) 1019 // FIXME: .field("nodename", &self.nodename) 1020 // FIXME: .field("release", &self.release) 1021 // FIXME: .field("version", &self.version) 1022 // FIXME: .field("machine", &self.machine) 1023 .finish() 1024 } 1025 } 1026 1027 impl ::hash::Hash for utsname { 1028 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1029 self.sysname.hash(state); 1030 self.nodename.hash(state); 1031 self.release.hash(state); 1032 self.version.hash(state); 1033 self.machine.hash(state); 1034 } 1035 } 1036 1037 impl PartialEq for mq_attr { 1038 fn eq(&self, other: &mq_attr) -> bool { 1039 self.mq_maxmsg == other.mq_maxmsg && 1040 self.mq_msgsize == other.mq_msgsize && 1041 self.mq_flags == other.mq_flags && 1042 self.mq_curmsgs == other.mq_curmsgs && 1043 self.mq_msgsize == other.mq_msgsize && 1044 self.mq_sendwait == other.mq_sendwait && 1045 self.mq_recvwait == other.mq_recvwait 1046 } 1047 } 1048 1049 impl Eq for mq_attr {} 1050 1051 impl ::fmt::Debug for mq_attr { 1052 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1053 f.debug_struct("mq_attr") 1054 .field("mq_maxmsg", &self.mq_maxmsg) 1055 .field("mq_msgsize", &self.mq_msgsize) 1056 .field("mq_flags", &self.mq_flags) 1057 .field("mq_curmsgs", &self.mq_curmsgs) 1058 .field("mq_msgsize", &self.mq_msgsize) 1059 .field("mq_sendwait", &self.mq_sendwait) 1060 .field("mq_recvwait", &self.mq_recvwait) 1061 .finish() 1062 } 1063 } 1064 impl ::hash::Hash for mq_attr { 1065 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1066 self.mq_maxmsg.hash(state); 1067 self.mq_msgsize.hash(state); 1068 self.mq_flags.hash(state); 1069 self.mq_curmsgs.hash(state); 1070 self.mq_sendwait.hash(state); 1071 self.mq_recvwait.hash(state); 1072 } 1073 } 1074 1075 impl PartialEq for sockaddr_storage { 1076 fn eq(&self, other: &sockaddr_storage) -> bool { 1077 self.ss_len == other.ss_len 1078 && self.ss_family == other.ss_family 1079 && self.__ss_pad1 == other.__ss_pad1 1080 && self.__ss_align == other.__ss_align 1081 && self 1082 .__ss_pad2 1083 .iter() 1084 .zip(other.__ss_pad2.iter()) 1085 .all(|(a, b)| a == b) 1086 } 1087 } 1088 1089 impl Eq for sockaddr_storage {} 1090 1091 impl ::fmt::Debug for sockaddr_storage { 1092 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1093 f.debug_struct("sockaddr_storage") 1094 .field("ss_len", &self.ss_len) 1095 .field("ss_family", &self.ss_family) 1096 .field("__ss_pad1", &self.__ss_pad1) 1097 .field("__ss_align", &self.__ss_align) 1098 // FIXME: .field("__ss_pad2", &self.__ss_pad2) 1099 .finish() 1100 } 1101 } 1102 1103 impl ::hash::Hash for sockaddr_storage { 1104 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1105 self.ss_len.hash(state); 1106 self.ss_family.hash(state); 1107 self.__ss_pad1.hash(state); 1108 self.__ss_align.hash(state); 1109 self.__ss_pad2.hash(state); 1110 } 1111 } 1112 1113 impl PartialEq for dirent { 1114 fn eq(&self, other: &dirent) -> bool { 1115 self.d_ino == other.d_ino 1116 && self.d_offset == other.d_offset 1117 && self.d_reclen == other.d_reclen 1118 && self.d_namelen == other.d_namelen 1119 && self 1120 .d_name[..self.d_namelen as _] 1121 .iter() 1122 .zip(other.d_name.iter()) 1123 .all(|(a,b)| a == b) 1124 } 1125 } 1126 1127 impl Eq for dirent {} 1128 1129 impl ::fmt::Debug for dirent { 1130 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1131 f.debug_struct("dirent") 1132 .field("d_ino", &self.d_ino) 1133 .field("d_offset", &self.d_offset) 1134 .field("d_reclen", &self.d_reclen) 1135 .field("d_namelen", &self.d_namelen) 1136 .field("d_name", &&self.d_name[..self.d_namelen as _]) 1137 .finish() 1138 } 1139 } 1140 1141 impl ::hash::Hash for dirent { 1142 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1143 self.d_ino.hash(state); 1144 self.d_offset.hash(state); 1145 self.d_reclen.hash(state); 1146 self.d_namelen.hash(state); 1147 self.d_name[..self.d_namelen as _].hash(state); 1148 } 1149 } 1150 } 1151 } 1152 1153 pub const _SYSNAME_SIZE: usize = 256 + 1; 1154 pub const RLIM_INFINITY: ::rlim_t = 0xfffffffffffffffd; 1155 pub const O_LARGEFILE: ::c_int = 0o0100000; 1156 1157 // intentionally not public, only used for fd_set 1158 cfg_if! { 1159 if #[cfg(target_pointer_width = "32")] { 1160 const ULONG_SIZE: usize = 32; 1161 } else if #[cfg(target_pointer_width = "64")] { 1162 const ULONG_SIZE: usize = 64; 1163 } else { 1164 // Unknown target_pointer_width 1165 } 1166 } 1167 1168 pub const EXIT_FAILURE: ::c_int = 1; 1169 pub const EXIT_SUCCESS: ::c_int = 0; 1170 pub const RAND_MAX: ::c_int = 32767; 1171 pub const EOF: ::c_int = -1; 1172 pub const SEEK_SET: ::c_int = 0; 1173 pub const SEEK_CUR: ::c_int = 1; 1174 pub const SEEK_END: ::c_int = 2; 1175 pub const _IOFBF: ::c_int = 0; 1176 pub const _IONBF: ::c_int = 2; 1177 pub const _IOLBF: ::c_int = 1; 1178 1179 pub const F_DUPFD: ::c_int = 0; 1180 pub const F_GETFD: ::c_int = 1; 1181 pub const F_SETFD: ::c_int = 2; 1182 pub const F_GETFL: ::c_int = 3; 1183 pub const F_SETFL: ::c_int = 4; 1184 1185 pub const F_DUPFD_CLOEXEC: ::c_int = 5; 1186 1187 pub const SIGTRAP: ::c_int = 5; 1188 1189 pub const CLOCK_REALTIME: ::clockid_t = 0; 1190 pub const CLOCK_MONOTONIC: ::clockid_t = 2; 1191 pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 3; 1192 pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 4; 1193 pub const TIMER_ABSTIME: ::c_uint = 0x80000000; 1194 1195 pub const RUSAGE_SELF: ::c_int = 0; 1196 1197 pub const F_OK: ::c_int = 0; 1198 pub const X_OK: ::c_int = 1; 1199 pub const W_OK: ::c_int = 2; 1200 pub const R_OK: ::c_int = 4; 1201 1202 pub const STDIN_FILENO: ::c_int = 0; 1203 pub const STDOUT_FILENO: ::c_int = 1; 1204 pub const STDERR_FILENO: ::c_int = 2; 1205 1206 pub const SIGHUP: ::c_int = 1; 1207 pub const SIGINT: ::c_int = 2; 1208 pub const SIGQUIT: ::c_int = 3; 1209 pub const SIGILL: ::c_int = 4; 1210 pub const SIGABRT: ::c_int = 6; 1211 pub const SIGFPE: ::c_int = 8; 1212 pub const SIGKILL: ::c_int = 9; 1213 pub const SIGSEGV: ::c_int = 11; 1214 pub const SIGPIPE: ::c_int = 13; 1215 pub const SIGALRM: ::c_int = 14; 1216 pub const SIGTERM: ::c_int = 15; 1217 1218 pub const PROT_NONE: ::c_int = 0x00000000; 1219 pub const PROT_READ: ::c_int = 0x00000100; 1220 pub const PROT_WRITE: ::c_int = 0x00000200; 1221 pub const PROT_EXEC: ::c_int = 0x00000400; 1222 1223 pub const MAP_FILE: ::c_int = 0; 1224 pub const MAP_SHARED: ::c_int = 1; 1225 pub const MAP_PRIVATE: ::c_int = 2; 1226 pub const MAP_FIXED: ::c_int = 0x10; 1227 1228 pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; 1229 1230 pub const MS_ASYNC: ::c_int = 1; 1231 pub const MS_INVALIDATE: ::c_int = 4; 1232 pub const MS_SYNC: ::c_int = 2; 1233 1234 pub const SCM_RIGHTS: ::c_int = 0x01; 1235 pub const SCM_TIMESTAMP: ::c_int = 0x02; 1236 pub const SCM_CREDS: ::c_int = 0x04; 1237 1238 pub const MAP_TYPE: ::c_int = 0x3; 1239 1240 pub const IFF_UP: ::c_int = 0x00000001; 1241 pub const IFF_BROADCAST: ::c_int = 0x00000002; 1242 pub const IFF_DEBUG: ::c_int = 0x00000004; 1243 pub const IFF_LOOPBACK: ::c_int = 0x00000008; 1244 pub const IFF_POINTOPOINT: ::c_int = 0x00000010; 1245 pub const IFF_NOTRAILERS: ::c_int = 0x00000020; 1246 pub const IFF_RUNNING: ::c_int = 0x00000040; 1247 pub const IFF_NOARP: ::c_int = 0x00000080; 1248 pub const IFF_PROMISC: ::c_int = 0x00000100; 1249 pub const IFF_ALLMULTI: ::c_int = 0x00000200; 1250 pub const IFF_MULTICAST: ::c_int = 0x00008000; 1251 1252 pub const AF_UNSPEC: ::c_int = 0; 1253 pub const AF_UNIX: ::c_int = AF_LOCAL; 1254 pub const AF_LOCAL: ::c_int = 1; 1255 pub const AF_INET: ::c_int = 2; 1256 pub const AF_IPX: ::c_int = 23; 1257 pub const AF_APPLETALK: ::c_int = 16; 1258 pub const AF_INET6: ::c_int = 24; 1259 pub const AF_ROUTE: ::c_int = 17; 1260 pub const AF_SNA: ::c_int = 11; 1261 pub const AF_BLUETOOTH: ::c_int = 31; 1262 pub const AF_ISDN: ::c_int = 26; 1263 1264 pub const PF_UNSPEC: ::c_int = AF_UNSPEC; 1265 pub const PF_UNIX: ::c_int = PF_LOCAL; 1266 pub const PF_LOCAL: ::c_int = AF_LOCAL; 1267 pub const PF_INET: ::c_int = AF_INET; 1268 pub const PF_IPX: ::c_int = AF_IPX; 1269 pub const PF_APPLETALK: ::c_int = AF_APPLETALK; 1270 pub const PF_INET6: ::c_int = AF_INET6; 1271 pub const pseudo_AF_KEY: ::c_int = 29; 1272 pub const PF_KEY: ::c_int = pseudo_AF_KEY; 1273 pub const PF_ROUTE: ::c_int = AF_ROUTE; 1274 pub const PF_SNA: ::c_int = AF_SNA; 1275 1276 pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH; 1277 pub const PF_ISDN: ::c_int = AF_ISDN; 1278 1279 pub const SOMAXCONN: ::c_int = 128; 1280 1281 pub const MSG_OOB: ::c_int = 0x0001; 1282 pub const MSG_PEEK: ::c_int = 0x0002; 1283 pub const MSG_DONTROUTE: ::c_int = 0x0004; 1284 pub const MSG_CTRUNC: ::c_int = 0x0020; 1285 pub const MSG_TRUNC: ::c_int = 0x0010; 1286 pub const MSG_DONTWAIT: ::c_int = 0x0080; 1287 pub const MSG_EOR: ::c_int = 0x0008; 1288 pub const MSG_WAITALL: ::c_int = 0x0040; 1289 pub const MSG_NOSIGNAL: ::c_int = 0x0800; 1290 pub const MSG_WAITFORONE: ::c_int = 0x2000; 1291 1292 pub const IP_TOS: ::c_int = 3; 1293 pub const IP_TTL: ::c_int = 4; 1294 pub const IP_HDRINCL: ::c_int = 2; 1295 pub const IP_OPTIONS: ::c_int = 1; 1296 pub const IP_RECVOPTS: ::c_int = 5; 1297 pub const IP_RETOPTS: ::c_int = 8; 1298 pub const IP_PKTINFO: ::c_int = 25; 1299 pub const IP_IPSEC_POLICY_COMPAT: ::c_int = 22; 1300 pub const IP_MULTICAST_IF: ::c_int = 9; 1301 pub const IP_MULTICAST_TTL: ::c_int = 10; 1302 pub const IP_MULTICAST_LOOP: ::c_int = 11; 1303 pub const IP_ADD_MEMBERSHIP: ::c_int = 12; 1304 pub const IP_DROP_MEMBERSHIP: ::c_int = 13; 1305 pub const IP_DEFAULT_MULTICAST_TTL: ::c_int = 1; 1306 pub const IP_DEFAULT_MULTICAST_LOOP: ::c_int = 1; 1307 1308 pub const IPPROTO_HOPOPTS: ::c_int = 0; 1309 pub const IPPROTO_IGMP: ::c_int = 2; 1310 pub const IPPROTO_IPIP: ::c_int = 4; 1311 pub const IPPROTO_EGP: ::c_int = 8; 1312 pub const IPPROTO_PUP: ::c_int = 12; 1313 pub const IPPROTO_IDP: ::c_int = 22; 1314 pub const IPPROTO_TP: ::c_int = 29; 1315 pub const IPPROTO_ROUTING: ::c_int = 43; 1316 pub const IPPROTO_FRAGMENT: ::c_int = 44; 1317 pub const IPPROTO_RSVP: ::c_int = 46; 1318 pub const IPPROTO_GRE: ::c_int = 47; 1319 pub const IPPROTO_ESP: ::c_int = 50; 1320 pub const IPPROTO_AH: ::c_int = 51; 1321 pub const IPPROTO_NONE: ::c_int = 59; 1322 pub const IPPROTO_DSTOPTS: ::c_int = 60; 1323 pub const IPPROTO_ENCAP: ::c_int = 98; 1324 pub const IPPROTO_PIM: ::c_int = 103; 1325 pub const IPPROTO_SCTP: ::c_int = 132; 1326 pub const IPPROTO_RAW: ::c_int = 255; 1327 pub const IPPROTO_MAX: ::c_int = 256; 1328 pub const IPPROTO_CARP: ::c_int = 112; 1329 pub const IPPROTO_DIVERT: ::c_int = 259; 1330 pub const IPPROTO_DONE: ::c_int = 257; 1331 pub const IPPROTO_EON: ::c_int = 80; 1332 pub const IPPROTO_ETHERIP: ::c_int = 97; 1333 pub const IPPROTO_GGP: ::c_int = 3; 1334 pub const IPPROTO_IPCOMP: ::c_int = 108; 1335 pub const IPPROTO_MOBILE: ::c_int = 55; 1336 1337 pub const IPV6_RTHDR_LOOSE: ::c_int = 0; 1338 pub const IPV6_RTHDR_STRICT: ::c_int = 1; 1339 pub const IPV6_UNICAST_HOPS: ::c_int = 4; 1340 pub const IPV6_MULTICAST_IF: ::c_int = 9; 1341 pub const IPV6_MULTICAST_HOPS: ::c_int = 10; 1342 pub const IPV6_MULTICAST_LOOP: ::c_int = 11; 1343 pub const IPV6_JOIN_GROUP: ::c_int = 12; 1344 pub const IPV6_LEAVE_GROUP: ::c_int = 13; 1345 pub const IPV6_CHECKSUM: ::c_int = 26; 1346 pub const IPV6_V6ONLY: ::c_int = 27; 1347 pub const IPV6_IPSEC_POLICY_COMPAT: ::c_int = 28; 1348 pub const IPV6_RTHDRDSTOPTS: ::c_int = 35; 1349 pub const IPV6_RECVPKTINFO: ::c_int = 36; 1350 pub const IPV6_RECVHOPLIMIT: ::c_int = 37; 1351 pub const IPV6_RECVRTHDR: ::c_int = 38; 1352 pub const IPV6_RECVHOPOPTS: ::c_int = 39; 1353 pub const IPV6_RECVDSTOPTS: ::c_int = 40; 1354 pub const IPV6_RECVPATHMTU: ::c_int = 43; 1355 pub const IPV6_PATHMTU: ::c_int = 44; 1356 pub const IPV6_PKTINFO: ::c_int = 46; 1357 pub const IPV6_HOPLIMIT: ::c_int = 47; 1358 pub const IPV6_NEXTHOP: ::c_int = 48; 1359 pub const IPV6_HOPOPTS: ::c_int = 49; 1360 pub const IPV6_DSTOPTS: ::c_int = 50; 1361 pub const IPV6_RECVTCLASS: ::c_int = 57; 1362 pub const IPV6_TCLASS: ::c_int = 61; 1363 pub const IPV6_DONTFRAG: ::c_int = 62; 1364 1365 pub const TCP_NODELAY: ::c_int = 0x01; 1366 pub const TCP_MAXSEG: ::c_int = 0x02; 1367 pub const TCP_MD5SIG: ::c_int = 0x10; 1368 pub const TCP_KEEPALIVE: ::c_int = 0x04; 1369 1370 pub const SHUT_RD: ::c_int = 0; 1371 pub const SHUT_WR: ::c_int = 1; 1372 pub const SHUT_RDWR: ::c_int = 2; 1373 1374 pub const LOCK_SH: ::c_int = 0x1; 1375 pub const LOCK_EX: ::c_int = 0x2; 1376 pub const LOCK_NB: ::c_int = 0x4; 1377 pub const LOCK_UN: ::c_int = 0x8; 1378 1379 pub const SS_ONSTACK: ::c_int = 1; 1380 pub const SS_DISABLE: ::c_int = 2; 1381 1382 pub const PATH_MAX: ::c_int = 1024; 1383 1384 pub const UIO_MAXIOV: ::c_int = 1024; 1385 1386 pub const FD_SETSIZE: usize = 256; 1387 1388 pub const TCIOFF: ::c_int = 0x0002; 1389 pub const TCION: ::c_int = 0x0003; 1390 pub const TCOOFF: ::c_int = 0x0000; 1391 pub const TCOON: ::c_int = 0x0001; 1392 pub const TCIFLUSH: ::c_int = 0; 1393 pub const TCOFLUSH: ::c_int = 1; 1394 pub const TCIOFLUSH: ::c_int = 2; 1395 pub const NL0: ::tcflag_t = 0x000; 1396 pub const NL1: ::tcflag_t = 0x100; 1397 pub const TAB0: ::tcflag_t = 0x0000; 1398 pub const CR0: ::tcflag_t = 0x000; 1399 pub const FF0: ::tcflag_t = 0x0000; 1400 pub const BS0: ::tcflag_t = 0x0000; 1401 pub const VT0: ::tcflag_t = 0x0000; 1402 pub const VERASE: usize = 2; 1403 pub const VKILL: usize = 3; 1404 pub const VINTR: usize = 0; 1405 pub const VQUIT: usize = 1; 1406 pub const VLNEXT: usize = 15; 1407 pub const IGNBRK: ::tcflag_t = 0x00000001; 1408 pub const BRKINT: ::tcflag_t = 0x00000002; 1409 pub const IGNPAR: ::tcflag_t = 0x00000004; 1410 pub const PARMRK: ::tcflag_t = 0x00000008; 1411 pub const INPCK: ::tcflag_t = 0x00000010; 1412 pub const ISTRIP: ::tcflag_t = 0x00000020; 1413 pub const INLCR: ::tcflag_t = 0x00000040; 1414 pub const IGNCR: ::tcflag_t = 0x00000080; 1415 pub const ICRNL: ::tcflag_t = 0x00000100; 1416 pub const IXANY: ::tcflag_t = 0x00000800; 1417 pub const IMAXBEL: ::tcflag_t = 0x00002000; 1418 pub const OPOST: ::tcflag_t = 0x00000001; 1419 pub const CS5: ::tcflag_t = 0x00; 1420 pub const ECHO: ::tcflag_t = 0x00000008; 1421 pub const OCRNL: ::tcflag_t = 0x00000008; 1422 pub const ONOCR: ::tcflag_t = 0x00000010; 1423 pub const ONLRET: ::tcflag_t = 0x00000020; 1424 pub const OFILL: ::tcflag_t = 0x00000040; 1425 pub const OFDEL: ::tcflag_t = 0x00000080; 1426 1427 pub const WNOHANG: ::c_int = 0x0040; 1428 pub const WUNTRACED: ::c_int = 0x0004; 1429 pub const WSTOPPED: ::c_int = WUNTRACED; 1430 pub const WEXITED: ::c_int = 0x0001; 1431 pub const WCONTINUED: ::c_int = 0x0008; 1432 pub const WNOWAIT: ::c_int = 0x0080; 1433 pub const WTRAPPED: ::c_int = 0x0002; 1434 1435 pub const RTLD_LOCAL: ::c_int = 0x0200; 1436 pub const RTLD_LAZY: ::c_int = 0x0001; 1437 1438 pub const POSIX_FADV_NORMAL: ::c_int = 0; 1439 pub const POSIX_FADV_RANDOM: ::c_int = 2; 1440 pub const POSIX_FADV_SEQUENTIAL: ::c_int = 1; 1441 pub const POSIX_FADV_WILLNEED: ::c_int = 3; 1442 1443 pub const AT_FDCWD: ::c_int = -100; 1444 pub const AT_EACCESS: ::c_int = 0x0001; 1445 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x0002; 1446 pub const AT_SYMLINK_FOLLOW: ::c_int = 0x0004; 1447 pub const AT_REMOVEDIR: ::c_int = 0x0008; 1448 1449 pub const LOG_CRON: ::c_int = 9 << 3; 1450 pub const LOG_AUTHPRIV: ::c_int = 10 << 3; 1451 pub const LOG_FTP: ::c_int = 11 << 3; 1452 pub const LOG_PERROR: ::c_int = 0x20; 1453 1454 pub const PIPE_BUF: usize = 5120; 1455 1456 pub const CLD_EXITED: ::c_int = 1; 1457 pub const CLD_KILLED: ::c_int = 2; 1458 pub const CLD_DUMPED: ::c_int = 3; 1459 pub const CLD_TRAPPED: ::c_int = 4; 1460 pub const CLD_STOPPED: ::c_int = 5; 1461 pub const CLD_CONTINUED: ::c_int = 6; 1462 1463 pub const UTIME_OMIT: c_long = 0x40000002; 1464 pub const UTIME_NOW: c_long = 0x40000001; 1465 1466 pub const POLLIN: ::c_short = POLLRDNORM | POLLRDBAND; 1467 pub const POLLPRI: ::c_short = 0x0008; 1468 pub const POLLOUT: ::c_short = 0x0002; 1469 pub const POLLERR: ::c_short = 0x0020; 1470 pub const POLLHUP: ::c_short = 0x0040; 1471 pub const POLLNVAL: ::c_short = 0x1000; 1472 pub const POLLRDNORM: ::c_short = 0x0001; 1473 pub const POLLRDBAND: ::c_short = 0x0004; 1474 1475 pub const IPTOS_LOWDELAY: u8 = 0x10; 1476 pub const IPTOS_THROUGHPUT: u8 = 0x08; 1477 pub const IPTOS_RELIABILITY: u8 = 0x04; 1478 pub const IPTOS_MINCOST: u8 = 0x02; 1479 1480 pub const IPTOS_PREC_NETCONTROL: u8 = 0xe0; 1481 pub const IPTOS_PREC_INTERNETCONTROL: u8 = 0xc0; 1482 pub const IPTOS_PREC_CRITIC_ECP: u8 = 0xa0; 1483 pub const IPTOS_PREC_FLASHOVERRIDE: u8 = 0x80; 1484 pub const IPTOS_PREC_FLASH: u8 = 0x60; 1485 pub const IPTOS_PREC_IMMEDIATE: u8 = 0x40; 1486 pub const IPTOS_PREC_PRIORITY: u8 = 0x20; 1487 pub const IPTOS_PREC_ROUTINE: u8 = 0x00; 1488 1489 pub const IPTOS_ECN_MASK: u8 = 0x03; 1490 pub const IPTOS_ECN_ECT1: u8 = 0x01; 1491 pub const IPTOS_ECN_ECT0: u8 = 0x02; 1492 pub const IPTOS_ECN_CE: u8 = 0x03; 1493 1494 pub const IPOPT_CONTROL: u8 = 0x00; 1495 pub const IPOPT_RESERVED1: u8 = 0x20; 1496 pub const IPOPT_RESERVED2: u8 = 0x60; 1497 pub const IPOPT_LSRR: u8 = 131; 1498 pub const IPOPT_RR: u8 = 7; 1499 pub const IPOPT_SSRR: u8 = 137; 1500 pub const IPDEFTTL: u8 = 64; 1501 pub const IPOPT_OPTVAL: u8 = 0; 1502 pub const IPOPT_OLEN: u8 = 1; 1503 pub const IPOPT_OFFSET: u8 = 2; 1504 pub const IPOPT_MINOFF: u8 = 4; 1505 pub const IPOPT_NOP: u8 = 1; 1506 pub const IPOPT_EOL: u8 = 0; 1507 pub const IPOPT_TS: u8 = 68; 1508 pub const IPOPT_TS_TSONLY: u8 = 0; 1509 pub const IPOPT_TS_TSANDADDR: u8 = 1; 1510 pub const IPOPT_TS_PRESPEC: u8 = 3; 1511 1512 pub const MAX_IPOPTLEN: u8 = 40; 1513 pub const IPVERSION: u8 = 4; 1514 pub const MAXTTL: u8 = 255; 1515 1516 pub const ARPHRD_ETHER: u16 = 1; 1517 pub const ARPHRD_IEEE802: u16 = 6; 1518 pub const ARPHRD_ARCNET: u16 = 7; 1519 pub const ARPHRD_IEEE1394: u16 = 24; 1520 1521 pub const SOL_SOCKET: ::c_int = 0xffff; 1522 1523 pub const SO_DEBUG: ::c_int = 0x0001; 1524 pub const SO_REUSEADDR: ::c_int = 0x0004; 1525 pub const SO_TYPE: ::c_int = 0x1008; 1526 pub const SO_ERROR: ::c_int = 0x1007; 1527 pub const SO_DONTROUTE: ::c_int = 0x0010; 1528 pub const SO_BROADCAST: ::c_int = 0x0020; 1529 pub const SO_SNDBUF: ::c_int = 0x1001; 1530 pub const SO_RCVBUF: ::c_int = 0x1002; 1531 pub const SO_KEEPALIVE: ::c_int = 0x0008; 1532 pub const SO_OOBINLINE: ::c_int = 0x0100; 1533 pub const SO_LINGER: ::c_int = 0x0080; 1534 pub const SO_REUSEPORT: ::c_int = 0x0200; 1535 pub const SO_RCVLOWAT: ::c_int = 0x1004; 1536 pub const SO_SNDLOWAT: ::c_int = 0x1003; 1537 pub const SO_RCVTIMEO: ::c_int = 0x1006; 1538 pub const SO_SNDTIMEO: ::c_int = 0x1005; 1539 pub const SO_BINDTODEVICE: ::c_int = 0x0800; 1540 pub const SO_TIMESTAMP: ::c_int = 0x0400; 1541 pub const SO_ACCEPTCONN: ::c_int = 0x0002; 1542 1543 pub const TIOCM_LE: ::c_int = 0x0100; 1544 pub const TIOCM_DTR: ::c_int = 0x0001; 1545 pub const TIOCM_RTS: ::c_int = 0x0002; 1546 pub const TIOCM_ST: ::c_int = 0x0200; 1547 pub const TIOCM_SR: ::c_int = 0x0400; 1548 pub const TIOCM_CTS: ::c_int = 0x1000; 1549 pub const TIOCM_CAR: ::c_int = TIOCM_CD; 1550 pub const TIOCM_CD: ::c_int = 0x8000; 1551 pub const TIOCM_RNG: ::c_int = TIOCM_RI; 1552 pub const TIOCM_RI: ::c_int = 0x4000; 1553 pub const TIOCM_DSR: ::c_int = 0x2000; 1554 1555 pub const SCHED_OTHER: ::c_int = 3; 1556 pub const SCHED_FIFO: ::c_int = 1; 1557 pub const SCHED_RR: ::c_int = 2; 1558 1559 pub const IPC_PRIVATE: ::key_t = 0; 1560 1561 pub const IPC_CREAT: ::c_int = 0o001000; 1562 pub const IPC_EXCL: ::c_int = 0o002000; 1563 pub const IPC_NOWAIT: ::c_int = 0o004000; 1564 1565 pub const IPC_RMID: ::c_int = 0; 1566 pub const IPC_SET: ::c_int = 1; 1567 pub const IPC_STAT: ::c_int = 2; 1568 1569 pub const MSG_NOERROR: ::c_int = 0o010000; 1570 1571 pub const LOG_NFACILITIES: ::c_int = 24; 1572 1573 pub const SEM_FAILED: *mut ::sem_t = 0xFFFFFFFFFFFFFFFF as *mut sem_t; 1574 1575 pub const AI_PASSIVE: ::c_int = 0x00000001; 1576 pub const AI_CANONNAME: ::c_int = 0x00000002; 1577 pub const AI_NUMERICHOST: ::c_int = 0x00000004; 1578 1579 pub const AI_NUMERICSERV: ::c_int = 0x00000008; 1580 1581 pub const EAI_BADFLAGS: ::c_int = 3; 1582 pub const EAI_NONAME: ::c_int = 8; 1583 pub const EAI_AGAIN: ::c_int = 2; 1584 pub const EAI_FAIL: ::c_int = 4; 1585 pub const EAI_NODATA: ::c_int = 7; 1586 pub const EAI_FAMILY: ::c_int = 5; 1587 pub const EAI_SOCKTYPE: ::c_int = 10; 1588 pub const EAI_SERVICE: ::c_int = 9; 1589 pub const EAI_MEMORY: ::c_int = 6; 1590 pub const EAI_SYSTEM: ::c_int = 11; 1591 pub const EAI_OVERFLOW: ::c_int = 14; 1592 1593 pub const NI_NUMERICHOST: ::c_int = 0x00000002; 1594 pub const NI_NUMERICSERV: ::c_int = 0x00000008; 1595 pub const NI_NOFQDN: ::c_int = 0x00000001; 1596 pub const NI_NAMEREQD: ::c_int = 0x00000004; 1597 pub const NI_DGRAM: ::c_int = 0x00000010; 1598 1599 pub const AIO_CANCELED: ::c_int = 0; 1600 pub const AIO_NOTCANCELED: ::c_int = 2; 1601 pub const AIO_ALLDONE: ::c_int = 1; 1602 pub const LIO_READ: ::c_int = 1; 1603 pub const LIO_WRITE: ::c_int = 2; 1604 pub const LIO_NOP: ::c_int = 0; 1605 pub const LIO_WAIT: ::c_int = 1; 1606 pub const LIO_NOWAIT: ::c_int = 0; 1607 1608 pub const ITIMER_REAL: ::c_int = 0; 1609 pub const ITIMER_VIRTUAL: ::c_int = 1; 1610 pub const ITIMER_PROF: ::c_int = 2; 1611 1612 pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x00000010; 1613 pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x00000001; 1614 pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x00000004; 1615 pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x00000002; 1616 pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x00000400; 1617 pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x00000040; 1618 1619 pub const IPTOS_ECN_NOT_ECT: u8 = 0x00; 1620 1621 pub const RTF_UP: ::c_ushort = 0x0001; 1622 pub const RTF_GATEWAY: ::c_ushort = 0x0002; 1623 1624 pub const RTF_HOST: ::c_ushort = 0x0004; 1625 pub const RTF_DYNAMIC: ::c_ushort = 0x0010; 1626 pub const RTF_MODIFIED: ::c_ushort = 0x0020; 1627 pub const RTF_REJECT: ::c_ushort = 0x0008; 1628 pub const RTF_STATIC: ::c_ushort = 0x0800; 1629 pub const RTF_XRESOLVE: ::c_ushort = 0x0200; 1630 pub const RTF_BROADCAST: u32 = 0x80000; 1631 pub const RTM_NEWADDR: u16 = 0xc; 1632 pub const RTM_DELADDR: u16 = 0xd; 1633 pub const RTA_DST: ::c_ushort = 0x1; 1634 pub const RTA_GATEWAY: ::c_ushort = 0x2; 1635 1636 pub const UDP_ENCAP: ::c_int = 100; 1637 1638 pub const IN_ACCESS: u32 = 0x00000001; 1639 pub const IN_MODIFY: u32 = 0x00000002; 1640 pub const IN_ATTRIB: u32 = 0x00000004; 1641 pub const IN_CLOSE_WRITE: u32 = 0x00000008; 1642 pub const IN_CLOSE_NOWRITE: u32 = 0x00000010; 1643 pub const IN_CLOSE: u32 = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE; 1644 pub const IN_OPEN: u32 = 0x00000020; 1645 pub const IN_MOVED_FROM: u32 = 0x00000040; 1646 pub const IN_MOVED_TO: u32 = 0x00000080; 1647 pub const IN_MOVE: u32 = IN_MOVED_FROM | IN_MOVED_TO; 1648 pub const IN_CREATE: u32 = 0x00000100; 1649 pub const IN_DELETE: u32 = 0x00000200; 1650 pub const IN_DELETE_SELF: u32 = 0x00000400; 1651 pub const IN_MOVE_SELF: u32 = 0x00000800; 1652 pub const IN_UNMOUNT: u32 = 0x00002000; 1653 pub const IN_Q_OVERFLOW: u32 = 0x00004000; 1654 pub const IN_IGNORED: u32 = 0x00008000; 1655 pub const IN_ONLYDIR: u32 = 0x01000000; 1656 pub const IN_DONT_FOLLOW: u32 = 0x02000000; 1657 1658 pub const IN_ISDIR: u32 = 0x40000000; 1659 pub const IN_ONESHOT: u32 = 0x80000000; 1660 1661 pub const REG_EXTENDED: ::c_int = 0o0001; 1662 pub const REG_ICASE: ::c_int = 0o0002; 1663 pub const REG_NEWLINE: ::c_int = 0o0010; 1664 pub const REG_NOSUB: ::c_int = 0o0004; 1665 1666 pub const REG_NOTBOL: ::c_int = 0o00001; 1667 pub const REG_NOTEOL: ::c_int = 0o00002; 1668 1669 pub const REG_ENOSYS: ::c_int = 17; 1670 pub const REG_NOMATCH: ::c_int = 1; 1671 pub const REG_BADPAT: ::c_int = 2; 1672 pub const REG_ECOLLATE: ::c_int = 3; 1673 pub const REG_ECTYPE: ::c_int = 4; 1674 pub const REG_EESCAPE: ::c_int = 5; 1675 pub const REG_ESUBREG: ::c_int = 6; 1676 pub const REG_EBRACK: ::c_int = 7; 1677 pub const REG_EPAREN: ::c_int = 8; 1678 pub const REG_EBRACE: ::c_int = 9; 1679 pub const REG_BADBR: ::c_int = 10; 1680 pub const REG_ERANGE: ::c_int = 11; 1681 pub const REG_ESPACE: ::c_int = 12; 1682 pub const REG_BADRPT: ::c_int = 13; 1683 1684 // errno.h 1685 pub const EOK: ::c_int = 0; 1686 pub const EWOULDBLOCK: ::c_int = EAGAIN; 1687 pub const EPERM: ::c_int = 1; 1688 pub const ENOENT: ::c_int = 2; 1689 pub const ESRCH: ::c_int = 3; 1690 pub const EINTR: ::c_int = 4; 1691 pub const EIO: ::c_int = 5; 1692 pub const ENXIO: ::c_int = 6; 1693 pub const E2BIG: ::c_int = 7; 1694 pub const ENOEXEC: ::c_int = 8; 1695 pub const EBADF: ::c_int = 9; 1696 pub const ECHILD: ::c_int = 10; 1697 pub const EAGAIN: ::c_int = 11; 1698 pub const ENOMEM: ::c_int = 12; 1699 pub const EACCES: ::c_int = 13; 1700 pub const EFAULT: ::c_int = 14; 1701 pub const ENOTBLK: ::c_int = 15; 1702 pub const EBUSY: ::c_int = 16; 1703 pub const EEXIST: ::c_int = 17; 1704 pub const EXDEV: ::c_int = 18; 1705 pub const ENODEV: ::c_int = 19; 1706 pub const ENOTDIR: ::c_int = 20; 1707 pub const EISDIR: ::c_int = 21; 1708 pub const EINVAL: ::c_int = 22; 1709 pub const ENFILE: ::c_int = 23; 1710 pub const EMFILE: ::c_int = 24; 1711 pub const ENOTTY: ::c_int = 25; 1712 pub const ETXTBSY: ::c_int = 26; 1713 pub const EFBIG: ::c_int = 27; 1714 pub const ENOSPC: ::c_int = 28; 1715 pub const ESPIPE: ::c_int = 29; 1716 pub const EROFS: ::c_int = 30; 1717 pub const EMLINK: ::c_int = 31; 1718 pub const EPIPE: ::c_int = 32; 1719 pub const EDOM: ::c_int = 33; 1720 pub const ERANGE: ::c_int = 34; 1721 pub const ENOMSG: ::c_int = 35; 1722 pub const EIDRM: ::c_int = 36; 1723 pub const ECHRNG: ::c_int = 37; 1724 pub const EL2NSYNC: ::c_int = 38; 1725 pub const EL3HLT: ::c_int = 39; 1726 pub const EL3RST: ::c_int = 40; 1727 pub const ELNRNG: ::c_int = 41; 1728 pub const EUNATCH: ::c_int = 42; 1729 pub const ENOCSI: ::c_int = 43; 1730 pub const EL2HLT: ::c_int = 44; 1731 pub const EDEADLK: ::c_int = 45; 1732 pub const ENOLCK: ::c_int = 46; 1733 pub const ECANCELED: ::c_int = 47; 1734 pub const EDQUOT: ::c_int = 49; 1735 pub const EBADE: ::c_int = 50; 1736 pub const EBADR: ::c_int = 51; 1737 pub const EXFULL: ::c_int = 52; 1738 pub const ENOANO: ::c_int = 53; 1739 pub const EBADRQC: ::c_int = 54; 1740 pub const EBADSLT: ::c_int = 55; 1741 pub const EDEADLOCK: ::c_int = 56; 1742 pub const EBFONT: ::c_int = 57; 1743 pub const EOWNERDEAD: ::c_int = 58; 1744 pub const ENOSTR: ::c_int = 60; 1745 pub const ENODATA: ::c_int = 61; 1746 pub const ETIME: ::c_int = 62; 1747 pub const ENOSR: ::c_int = 63; 1748 pub const ENONET: ::c_int = 64; 1749 pub const ENOPKG: ::c_int = 65; 1750 pub const EREMOTE: ::c_int = 66; 1751 pub const ENOLINK: ::c_int = 67; 1752 pub const EADV: ::c_int = 68; 1753 pub const ESRMNT: ::c_int = 69; 1754 pub const ECOMM: ::c_int = 70; 1755 pub const EPROTO: ::c_int = 71; 1756 pub const EMULTIHOP: ::c_int = 74; 1757 pub const EBADMSG: ::c_int = 77; 1758 pub const ENAMETOOLONG: ::c_int = 78; 1759 pub const EOVERFLOW: ::c_int = 79; 1760 pub const ENOTUNIQ: ::c_int = 80; 1761 pub const EBADFD: ::c_int = 81; 1762 pub const EREMCHG: ::c_int = 82; 1763 pub const ELIBACC: ::c_int = 83; 1764 pub const ELIBBAD: ::c_int = 84; 1765 pub const ELIBSCN: ::c_int = 85; 1766 pub const ELIBMAX: ::c_int = 86; 1767 pub const ELIBEXEC: ::c_int = 87; 1768 pub const EILSEQ: ::c_int = 88; 1769 pub const ENOSYS: ::c_int = 89; 1770 pub const ELOOP: ::c_int = 90; 1771 pub const ERESTART: ::c_int = 91; 1772 pub const ESTRPIPE: ::c_int = 92; 1773 pub const ENOTEMPTY: ::c_int = 93; 1774 pub const EUSERS: ::c_int = 94; 1775 pub const ENOTRECOVERABLE: ::c_int = 95; 1776 pub const EOPNOTSUPP: ::c_int = 103; 1777 pub const EFPOS: ::c_int = 110; 1778 pub const ESTALE: ::c_int = 122; 1779 pub const EINPROGRESS: ::c_int = 236; 1780 pub const EALREADY: ::c_int = 237; 1781 pub const ENOTSOCK: ::c_int = 238; 1782 pub const EDESTADDRREQ: ::c_int = 239; 1783 pub const EMSGSIZE: ::c_int = 240; 1784 pub const EPROTOTYPE: ::c_int = 241; 1785 pub const ENOPROTOOPT: ::c_int = 242; 1786 pub const EPROTONOSUPPORT: ::c_int = 243; 1787 pub const ESOCKTNOSUPPORT: ::c_int = 244; 1788 pub const EPFNOSUPPORT: ::c_int = 246; 1789 pub const EAFNOSUPPORT: ::c_int = 247; 1790 pub const EADDRINUSE: ::c_int = 248; 1791 pub const EADDRNOTAVAIL: ::c_int = 249; 1792 pub const ENETDOWN: ::c_int = 250; 1793 pub const ENETUNREACH: ::c_int = 251; 1794 pub const ENETRESET: ::c_int = 252; 1795 pub const ECONNABORTED: ::c_int = 253; 1796 pub const ECONNRESET: ::c_int = 254; 1797 pub const ENOBUFS: ::c_int = 255; 1798 pub const EISCONN: ::c_int = 256; 1799 pub const ENOTCONN: ::c_int = 257; 1800 pub const ESHUTDOWN: ::c_int = 258; 1801 pub const ETOOMANYREFS: ::c_int = 259; 1802 pub const ETIMEDOUT: ::c_int = 260; 1803 pub const ECONNREFUSED: ::c_int = 261; 1804 pub const EHOSTDOWN: ::c_int = 264; 1805 pub const EHOSTUNREACH: ::c_int = 265; 1806 pub const EBADRPC: ::c_int = 272; 1807 pub const ERPCMISMATCH: ::c_int = 273; 1808 pub const EPROGUNAVAIL: ::c_int = 274; 1809 pub const EPROGMISMATCH: ::c_int = 275; 1810 pub const EPROCUNAVAIL: ::c_int = 276; 1811 pub const ENOREMOTE: ::c_int = 300; 1812 pub const ENONDP: ::c_int = 301; 1813 pub const EBADFSYS: ::c_int = 302; 1814 pub const EMORE: ::c_int = 309; 1815 pub const ECTRLTERM: ::c_int = 310; 1816 pub const ENOLIC: ::c_int = 311; 1817 pub const ESRVRFAULT: ::c_int = 312; 1818 pub const EENDIAN: ::c_int = 313; 1819 pub const ESECTYPEINVAL: ::c_int = 314; 1820 1821 pub const RUSAGE_CHILDREN: ::c_int = -1; 1822 pub const L_tmpnam: ::c_uint = 255; 1823 1824 pub const _PC_LINK_MAX: ::c_int = 1; 1825 pub const _PC_MAX_CANON: ::c_int = 2; 1826 pub const _PC_MAX_INPUT: ::c_int = 3; 1827 pub const _PC_NAME_MAX: ::c_int = 4; 1828 pub const _PC_PATH_MAX: ::c_int = 5; 1829 pub const _PC_PIPE_BUF: ::c_int = 6; 1830 pub const _PC_CHOWN_RESTRICTED: ::c_int = 9; 1831 pub const _PC_NO_TRUNC: ::c_int = 7; 1832 pub const _PC_VDISABLE: ::c_int = 8; 1833 pub const _PC_SYNC_IO: ::c_int = 14; 1834 pub const _PC_ASYNC_IO: ::c_int = 12; 1835 pub const _PC_PRIO_IO: ::c_int = 13; 1836 pub const _PC_SOCK_MAXBUF: ::c_int = 15; 1837 pub const _PC_FILESIZEBITS: ::c_int = 16; 1838 pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 22; 1839 pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 23; 1840 pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 24; 1841 pub const _PC_REC_XFER_ALIGN: ::c_int = 25; 1842 pub const _PC_ALLOC_SIZE_MIN: ::c_int = 21; 1843 pub const _PC_SYMLINK_MAX: ::c_int = 17; 1844 pub const _PC_2_SYMLINKS: ::c_int = 20; 1845 1846 pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; 1847 pub const _SC_ARG_MAX: ::c_int = 1; 1848 pub const _SC_CHILD_MAX: ::c_int = 2; 1849 pub const _SC_CLK_TCK: ::c_int = 3; 1850 pub const _SC_NGROUPS_MAX: ::c_int = 4; 1851 pub const _SC_OPEN_MAX: ::c_int = 5; 1852 pub const _SC_JOB_CONTROL: ::c_int = 6; 1853 pub const _SC_SAVED_IDS: ::c_int = 7; 1854 pub const _SC_VERSION: ::c_int = 8; 1855 pub const _SC_PASS_MAX: ::c_int = 9; 1856 pub const _SC_PAGESIZE: ::c_int = 11; 1857 pub const _SC_XOPEN_VERSION: ::c_int = 12; 1858 pub const _SC_STREAM_MAX: ::c_int = 13; 1859 pub const _SC_TZNAME_MAX: ::c_int = 14; 1860 pub const _SC_AIO_LISTIO_MAX: ::c_int = 15; 1861 pub const _SC_AIO_MAX: ::c_int = 16; 1862 pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 17; 1863 pub const _SC_DELAYTIMER_MAX: ::c_int = 18; 1864 pub const _SC_MQ_OPEN_MAX: ::c_int = 19; 1865 pub const _SC_MQ_PRIO_MAX: ::c_int = 20; 1866 pub const _SC_RTSIG_MAX: ::c_int = 21; 1867 pub const _SC_SEM_NSEMS_MAX: ::c_int = 22; 1868 pub const _SC_SEM_VALUE_MAX: ::c_int = 23; 1869 pub const _SC_SIGQUEUE_MAX: ::c_int = 24; 1870 pub const _SC_TIMER_MAX: ::c_int = 25; 1871 pub const _SC_ASYNCHRONOUS_IO: ::c_int = 26; 1872 pub const _SC_FSYNC: ::c_int = 27; 1873 pub const _SC_MAPPED_FILES: ::c_int = 28; 1874 pub const _SC_MEMLOCK: ::c_int = 29; 1875 pub const _SC_MEMLOCK_RANGE: ::c_int = 30; 1876 pub const _SC_MEMORY_PROTECTION: ::c_int = 31; 1877 pub const _SC_MESSAGE_PASSING: ::c_int = 32; 1878 pub const _SC_PRIORITIZED_IO: ::c_int = 33; 1879 pub const _SC_PRIORITY_SCHEDULING: ::c_int = 34; 1880 pub const _SC_REALTIME_SIGNALS: ::c_int = 35; 1881 pub const _SC_SEMAPHORES: ::c_int = 36; 1882 pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 37; 1883 pub const _SC_SYNCHRONIZED_IO: ::c_int = 38; 1884 pub const _SC_TIMERS: ::c_int = 39; 1885 pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 40; 1886 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 41; 1887 pub const _SC_LOGIN_NAME_MAX: ::c_int = 42; 1888 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 43; 1889 pub const _SC_THREAD_KEYS_MAX: ::c_int = 44; 1890 pub const _SC_THREAD_STACK_MIN: ::c_int = 45; 1891 pub const _SC_THREAD_THREADS_MAX: ::c_int = 46; 1892 pub const _SC_TTY_NAME_MAX: ::c_int = 47; 1893 pub const _SC_THREADS: ::c_int = 48; 1894 pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 49; 1895 pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 50; 1896 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 51; 1897 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 52; 1898 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 53; 1899 pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 54; 1900 pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 55; 1901 pub const _SC_2_CHAR_TERM: ::c_int = 56; 1902 pub const _SC_2_C_BIND: ::c_int = 57; 1903 pub const _SC_2_C_DEV: ::c_int = 58; 1904 pub const _SC_2_C_VERSION: ::c_int = 59; 1905 pub const _SC_2_FORT_DEV: ::c_int = 60; 1906 pub const _SC_2_FORT_RUN: ::c_int = 61; 1907 pub const _SC_2_LOCALEDEF: ::c_int = 62; 1908 pub const _SC_2_SW_DEV: ::c_int = 63; 1909 pub const _SC_2_UPE: ::c_int = 64; 1910 pub const _SC_2_VERSION: ::c_int = 65; 1911 pub const _SC_ATEXIT_MAX: ::c_int = 66; 1912 pub const _SC_AVPHYS_PAGES: ::c_int = 67; 1913 pub const _SC_BC_BASE_MAX: ::c_int = 68; 1914 pub const _SC_BC_DIM_MAX: ::c_int = 69; 1915 pub const _SC_BC_SCALE_MAX: ::c_int = 70; 1916 pub const _SC_BC_STRING_MAX: ::c_int = 71; 1917 pub const _SC_CHARCLASS_NAME_MAX: ::c_int = 72; 1918 pub const _SC_CHAR_BIT: ::c_int = 73; 1919 pub const _SC_CHAR_MAX: ::c_int = 74; 1920 pub const _SC_CHAR_MIN: ::c_int = 75; 1921 pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 76; 1922 pub const _SC_EQUIV_CLASS_MAX: ::c_int = 77; 1923 pub const _SC_EXPR_NEST_MAX: ::c_int = 78; 1924 pub const _SC_INT_MAX: ::c_int = 79; 1925 pub const _SC_INT_MIN: ::c_int = 80; 1926 pub const _SC_LINE_MAX: ::c_int = 81; 1927 pub const _SC_LONG_BIT: ::c_int = 82; 1928 pub const _SC_MB_LEN_MAX: ::c_int = 83; 1929 pub const _SC_NL_ARGMAX: ::c_int = 84; 1930 pub const _SC_NL_LANGMAX: ::c_int = 85; 1931 pub const _SC_NL_MSGMAX: ::c_int = 86; 1932 pub const _SC_NL_NMAX: ::c_int = 87; 1933 pub const _SC_NL_SETMAX: ::c_int = 88; 1934 pub const _SC_NL_TEXTMAX: ::c_int = 89; 1935 pub const _SC_NPROCESSORS_CONF: ::c_int = 90; 1936 pub const _SC_NPROCESSORS_ONLN: ::c_int = 91; 1937 pub const _SC_NZERO: ::c_int = 92; 1938 pub const _SC_PHYS_PAGES: ::c_int = 93; 1939 pub const _SC_PII: ::c_int = 94; 1940 pub const _SC_PII_INTERNET: ::c_int = 95; 1941 pub const _SC_PII_INTERNET_DGRAM: ::c_int = 96; 1942 pub const _SC_PII_INTERNET_STREAM: ::c_int = 97; 1943 pub const _SC_PII_OSI: ::c_int = 98; 1944 pub const _SC_PII_OSI_CLTS: ::c_int = 99; 1945 pub const _SC_PII_OSI_COTS: ::c_int = 100; 1946 pub const _SC_PII_OSI_M: ::c_int = 101; 1947 pub const _SC_PII_SOCKET: ::c_int = 102; 1948 pub const _SC_PII_XTI: ::c_int = 103; 1949 pub const _SC_POLL: ::c_int = 104; 1950 pub const _SC_RE_DUP_MAX: ::c_int = 105; 1951 pub const _SC_SCHAR_MAX: ::c_int = 106; 1952 pub const _SC_SCHAR_MIN: ::c_int = 107; 1953 pub const _SC_SELECT: ::c_int = 108; 1954 pub const _SC_SHRT_MAX: ::c_int = 109; 1955 pub const _SC_SHRT_MIN: ::c_int = 110; 1956 pub const _SC_SSIZE_MAX: ::c_int = 111; 1957 pub const _SC_T_IOV_MAX: ::c_int = 112; 1958 pub const _SC_UCHAR_MAX: ::c_int = 113; 1959 pub const _SC_UINT_MAX: ::c_int = 114; 1960 pub const _SC_UIO_MAXIOV: ::c_int = 115; 1961 pub const _SC_ULONG_MAX: ::c_int = 116; 1962 pub const _SC_USHRT_MAX: ::c_int = 117; 1963 pub const _SC_WORD_BIT: ::c_int = 118; 1964 pub const _SC_XOPEN_CRYPT: ::c_int = 119; 1965 pub const _SC_XOPEN_ENH_I18N: ::c_int = 120; 1966 pub const _SC_XOPEN_SHM: ::c_int = 121; 1967 pub const _SC_XOPEN_UNIX: ::c_int = 122; 1968 pub const _SC_XOPEN_XCU_VERSION: ::c_int = 123; 1969 pub const _SC_XOPEN_XPG2: ::c_int = 124; 1970 pub const _SC_XOPEN_XPG3: ::c_int = 125; 1971 pub const _SC_XOPEN_XPG4: ::c_int = 126; 1972 pub const _SC_XBS5_ILP32_OFF32: ::c_int = 127; 1973 pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 128; 1974 pub const _SC_XBS5_LP64_OFF64: ::c_int = 129; 1975 pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 130; 1976 pub const _SC_ADVISORY_INFO: ::c_int = 131; 1977 pub const _SC_CPUTIME: ::c_int = 132; 1978 pub const _SC_SPAWN: ::c_int = 133; 1979 pub const _SC_SPORADIC_SERVER: ::c_int = 134; 1980 pub const _SC_THREAD_CPUTIME: ::c_int = 135; 1981 pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 136; 1982 pub const _SC_TIMEOUTS: ::c_int = 137; 1983 pub const _SC_BARRIERS: ::c_int = 138; 1984 pub const _SC_CLOCK_SELECTION: ::c_int = 139; 1985 pub const _SC_MONOTONIC_CLOCK: ::c_int = 140; 1986 pub const _SC_READER_WRITER_LOCKS: ::c_int = 141; 1987 pub const _SC_SPIN_LOCKS: ::c_int = 142; 1988 pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 143; 1989 pub const _SC_TRACE_EVENT_FILTER: ::c_int = 144; 1990 pub const _SC_TRACE: ::c_int = 145; 1991 pub const _SC_TRACE_INHERIT: ::c_int = 146; 1992 pub const _SC_TRACE_LOG: ::c_int = 147; 1993 pub const _SC_2_PBS: ::c_int = 148; 1994 pub const _SC_2_PBS_ACCOUNTING: ::c_int = 149; 1995 pub const _SC_2_PBS_CHECKPOINT: ::c_int = 150; 1996 pub const _SC_2_PBS_LOCATE: ::c_int = 151; 1997 pub const _SC_2_PBS_MESSAGE: ::c_int = 152; 1998 pub const _SC_2_PBS_TRACK: ::c_int = 153; 1999 pub const _SC_HOST_NAME_MAX: ::c_int = 154; 2000 pub const _SC_IOV_MAX: ::c_int = 155; 2001 pub const _SC_IPV6: ::c_int = 156; 2002 pub const _SC_RAW_SOCKETS: ::c_int = 157; 2003 pub const _SC_REGEXP: ::c_int = 158; 2004 pub const _SC_SHELL: ::c_int = 159; 2005 pub const _SC_SS_REPL_MAX: ::c_int = 160; 2006 pub const _SC_SYMLOOP_MAX: ::c_int = 161; 2007 pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 162; 2008 pub const _SC_TRACE_NAME_MAX: ::c_int = 163; 2009 pub const _SC_TRACE_SYS_MAX: ::c_int = 164; 2010 pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 165; 2011 pub const _SC_V6_ILP32_OFF32: ::c_int = 166; 2012 pub const _SC_V6_ILP32_OFFBIG: ::c_int = 167; 2013 pub const _SC_V6_LP64_OFF64: ::c_int = 168; 2014 pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 169; 2015 pub const _SC_XOPEN_REALTIME: ::c_int = 170; 2016 pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 171; 2017 pub const _SC_XOPEN_LEGACY: ::c_int = 172; 2018 pub const _SC_XOPEN_STREAMS: ::c_int = 173; 2019 pub const _SC_V7_ILP32_OFF32: ::c_int = 176; 2020 pub const _SC_V7_ILP32_OFFBIG: ::c_int = 177; 2021 pub const _SC_V7_LP64_OFF64: ::c_int = 178; 2022 pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 179; 2023 2024 pub const GLOB_ERR: ::c_int = 0x0001; 2025 pub const GLOB_MARK: ::c_int = 0x0002; 2026 pub const GLOB_NOSORT: ::c_int = 0x0004; 2027 pub const GLOB_DOOFFS: ::c_int = 0x0008; 2028 pub const GLOB_NOCHECK: ::c_int = 0x0010; 2029 pub const GLOB_APPEND: ::c_int = 0x0020; 2030 pub const GLOB_NOESCAPE: ::c_int = 0x0040; 2031 2032 pub const GLOB_NOSPACE: ::c_int = 1; 2033 pub const GLOB_ABORTED: ::c_int = 2; 2034 pub const GLOB_NOMATCH: ::c_int = 3; 2035 2036 pub const S_IEXEC: mode_t = ::S_IXUSR; 2037 pub const S_IWRITE: mode_t = ::S_IWUSR; 2038 pub const S_IREAD: mode_t = ::S_IRUSR; 2039 2040 pub const S_IFIFO: ::mode_t = 0x1000; 2041 pub const S_IFCHR: ::mode_t = 0x2000; 2042 pub const S_IFDIR: ::mode_t = 0x4000; 2043 pub const S_IFBLK: ::mode_t = 0x6000; 2044 pub const S_IFREG: ::mode_t = 0x8000; 2045 pub const S_IFLNK: ::mode_t = 0xA000; 2046 pub const S_IFSOCK: ::mode_t = 0xC000; 2047 pub const S_IFMT: ::mode_t = 0xF000; 2048 2049 pub const S_IXOTH: ::mode_t = 0o000001; 2050 pub const S_IWOTH: ::mode_t = 0o000002; 2051 pub const S_IROTH: ::mode_t = 0o000004; 2052 pub const S_IRWXO: ::mode_t = 0o000007; 2053 pub const S_IXGRP: ::mode_t = 0o000010; 2054 pub const S_IWGRP: ::mode_t = 0o000020; 2055 pub const S_IRGRP: ::mode_t = 0o000040; 2056 pub const S_IRWXG: ::mode_t = 0o000070; 2057 pub const S_IXUSR: ::mode_t = 0o000100; 2058 pub const S_IWUSR: ::mode_t = 0o000200; 2059 pub const S_IRUSR: ::mode_t = 0o000400; 2060 pub const S_IRWXU: ::mode_t = 0o000700; 2061 2062 pub const F_LOCK: ::c_int = 1; 2063 pub const F_TEST: ::c_int = 3; 2064 pub const F_TLOCK: ::c_int = 2; 2065 pub const F_ULOCK: ::c_int = 0; 2066 2067 pub const ST_RDONLY: ::c_ulong = 0x01; 2068 pub const ST_NOSUID: ::c_ulong = 0x04; 2069 pub const ST_NOEXEC: ::c_ulong = 0x02; 2070 pub const ST_NOATIME: ::c_ulong = 0x20; 2071 2072 pub const RTLD_NEXT: *mut ::c_void = -3i64 as *mut ::c_void; 2073 pub const RTLD_DEFAULT: *mut ::c_void = -2i64 as *mut ::c_void; 2074 pub const RTLD_NODELETE: ::c_int = 0x1000; 2075 pub const RTLD_NOW: ::c_int = 0x0002; 2076 2077 pub const EMPTY: ::c_short = 0; 2078 pub const RUN_LVL: ::c_short = 1; 2079 pub const BOOT_TIME: ::c_short = 2; 2080 pub const NEW_TIME: ::c_short = 4; 2081 pub const OLD_TIME: ::c_short = 3; 2082 pub const INIT_PROCESS: ::c_short = 5; 2083 pub const LOGIN_PROCESS: ::c_short = 6; 2084 pub const USER_PROCESS: ::c_short = 7; 2085 pub const DEAD_PROCESS: ::c_short = 8; 2086 pub const ACCOUNTING: ::c_short = 9; 2087 2088 pub const ENOTSUP: ::c_int = 48; 2089 2090 pub const BUFSIZ: ::c_uint = 1024; 2091 pub const TMP_MAX: ::c_uint = 26 * 26 * 26; 2092 pub const FOPEN_MAX: ::c_uint = 16; 2093 pub const FILENAME_MAX: ::c_uint = 255; 2094 2095 pub const NI_MAXHOST: ::socklen_t = 1025; 2096 pub const M_KEEP: ::c_int = 4; 2097 pub const REG_STARTEND: ::c_int = 0o00004; 2098 pub const VEOF: usize = 4; 2099 2100 pub const RTLD_GLOBAL: ::c_int = 0x0100; 2101 pub const RTLD_NOLOAD: ::c_int = 0x0004; 2102 2103 pub const O_RDONLY: ::c_int = 0o000000; 2104 pub const O_WRONLY: ::c_int = 0o000001; 2105 pub const O_RDWR: ::c_int = 0o000002; 2106 2107 pub const O_EXEC: ::c_int = 0o00003; 2108 pub const O_ASYNC: ::c_int = 0o0200000; 2109 pub const O_NDELAY: ::c_int = O_NONBLOCK; 2110 pub const O_TRUNC: ::c_int = 0o001000; 2111 pub const O_CLOEXEC: ::c_int = 0o020000; 2112 pub const O_DIRECTORY: ::c_int = 0o4000000; 2113 pub const O_ACCMODE: ::c_int = 0o000007; 2114 pub const O_APPEND: ::c_int = 0o000010; 2115 pub const O_CREAT: ::c_int = 0o000400; 2116 pub const O_EXCL: ::c_int = 0o002000; 2117 pub const O_NOCTTY: ::c_int = 0o004000; 2118 pub const O_NONBLOCK: ::c_int = 0o000200; 2119 pub const O_SYNC: ::c_int = 0o000040; 2120 pub const O_RSYNC: ::c_int = 0o000100; 2121 pub const O_DSYNC: ::c_int = 0o000020; 2122 pub const O_NOFOLLOW: ::c_int = 0o010000; 2123 2124 pub const POSIX_FADV_DONTNEED: ::c_int = 4; 2125 pub const POSIX_FADV_NOREUSE: ::c_int = 5; 2126 2127 pub const SOCK_SEQPACKET: ::c_int = 5; 2128 pub const SOCK_STREAM: ::c_int = 1; 2129 pub const SOCK_DGRAM: ::c_int = 2; 2130 pub const SOCK_RAW: ::c_int = 3; 2131 pub const SOCK_RDM: ::c_int = 4; 2132 pub const SOCK_CLOEXEC: ::c_int = 0x10000000; 2133 2134 pub const SA_SIGINFO: ::c_int = 0x0002; 2135 pub const SA_NOCLDWAIT: ::c_int = 0x0020; 2136 pub const SA_NODEFER: ::c_int = 0x0010; 2137 pub const SA_RESETHAND: ::c_int = 0x0004; 2138 pub const SA_NOCLDSTOP: ::c_int = 0x0001; 2139 2140 pub const SIGTTIN: ::c_int = 26; 2141 pub const SIGTTOU: ::c_int = 27; 2142 pub const SIGXCPU: ::c_int = 30; 2143 pub const SIGXFSZ: ::c_int = 31; 2144 pub const SIGVTALRM: ::c_int = 28; 2145 pub const SIGPROF: ::c_int = 29; 2146 pub const SIGWINCH: ::c_int = 20; 2147 pub const SIGCHLD: ::c_int = 18; 2148 pub const SIGBUS: ::c_int = 10; 2149 pub const SIGUSR1: ::c_int = 16; 2150 pub const SIGUSR2: ::c_int = 17; 2151 pub const SIGCONT: ::c_int = 25; 2152 pub const SIGSTOP: ::c_int = 23; 2153 pub const SIGTSTP: ::c_int = 24; 2154 pub const SIGURG: ::c_int = 21; 2155 pub const SIGIO: ::c_int = SIGPOLL; 2156 pub const SIGSYS: ::c_int = 12; 2157 pub const SIGPOLL: ::c_int = 22; 2158 pub const SIGPWR: ::c_int = 19; 2159 pub const SIG_SETMASK: ::c_int = 2; 2160 pub const SIG_BLOCK: ::c_int = 0; 2161 pub const SIG_UNBLOCK: ::c_int = 1; 2162 2163 pub const POLLWRNORM: ::c_short = ::POLLOUT; 2164 pub const POLLWRBAND: ::c_short = 0x0010; 2165 2166 pub const F_SETLK: ::c_int = 106; 2167 pub const F_SETLKW: ::c_int = 107; 2168 pub const F_ALLOCSP: ::c_int = 110; 2169 pub const F_FREESP: ::c_int = 111; 2170 pub const F_GETLK: ::c_int = 114; 2171 2172 pub const F_RDLCK: ::c_int = 1; 2173 pub const F_WRLCK: ::c_int = 2; 2174 pub const F_UNLCK: ::c_int = 3; 2175 2176 pub const NCCS: usize = 40; 2177 2178 pub const MAP_ANON: ::c_int = MAP_ANONYMOUS; 2179 pub const MAP_ANONYMOUS: ::c_int = 0x00080000; 2180 2181 pub const MCL_CURRENT: ::c_int = 0x000000001; 2182 pub const MCL_FUTURE: ::c_int = 0x000000002; 2183 2184 pub const _TIO_CBAUD: ::tcflag_t = 15; 2185 pub const CBAUD: ::tcflag_t = _TIO_CBAUD; 2186 pub const TAB1: ::tcflag_t = 0x0800; 2187 pub const TAB2: ::tcflag_t = 0x1000; 2188 pub const TAB3: ::tcflag_t = 0x1800; 2189 pub const CR1: ::tcflag_t = 0x200; 2190 pub const CR2: ::tcflag_t = 0x400; 2191 pub const CR3: ::tcflag_t = 0x600; 2192 pub const FF1: ::tcflag_t = 0x8000; 2193 pub const BS1: ::tcflag_t = 0x2000; 2194 pub const VT1: ::tcflag_t = 0x4000; 2195 pub const VWERASE: usize = 14; 2196 pub const VREPRINT: usize = 12; 2197 pub const VSUSP: usize = 10; 2198 pub const VSTART: usize = 8; 2199 pub const VSTOP: usize = 9; 2200 pub const VDISCARD: usize = 13; 2201 pub const VTIME: usize = 17; 2202 pub const IXON: ::tcflag_t = 0x00000400; 2203 pub const IXOFF: ::tcflag_t = 0x00001000; 2204 pub const ONLCR: ::tcflag_t = 0x00000004; 2205 pub const CSIZE: ::tcflag_t = 0x00000030; 2206 pub const CS6: ::tcflag_t = 0x10; 2207 pub const CS7: ::tcflag_t = 0x20; 2208 pub const CS8: ::tcflag_t = 0x30; 2209 pub const CSTOPB: ::tcflag_t = 0x00000040; 2210 pub const CREAD: ::tcflag_t = 0x00000080; 2211 pub const PARENB: ::tcflag_t = 0x00000100; 2212 pub const PARODD: ::tcflag_t = 0x00000200; 2213 pub const HUPCL: ::tcflag_t = 0x00000400; 2214 pub const CLOCAL: ::tcflag_t = 0x00000800; 2215 pub const ECHOKE: ::tcflag_t = 0x00000800; 2216 pub const ECHOE: ::tcflag_t = 0x00000010; 2217 pub const ECHOK: ::tcflag_t = 0x00000020; 2218 pub const ECHONL: ::tcflag_t = 0x00000040; 2219 pub const ECHOCTL: ::tcflag_t = 0x00000200; 2220 pub const ISIG: ::tcflag_t = 0x00000001; 2221 pub const ICANON: ::tcflag_t = 0x00000002; 2222 pub const NOFLSH: ::tcflag_t = 0x00000080; 2223 pub const OLCUC: ::tcflag_t = 0x00000002; 2224 pub const NLDLY: ::tcflag_t = 0x00000100; 2225 pub const CRDLY: ::tcflag_t = 0x00000600; 2226 pub const TABDLY: ::tcflag_t = 0x00001800; 2227 pub const BSDLY: ::tcflag_t = 0x00002000; 2228 pub const FFDLY: ::tcflag_t = 0x00008000; 2229 pub const VTDLY: ::tcflag_t = 0x00004000; 2230 pub const XTABS: ::tcflag_t = 0x1800; 2231 2232 pub const B0: ::speed_t = 0; 2233 pub const B50: ::speed_t = 1; 2234 pub const B75: ::speed_t = 2; 2235 pub const B110: ::speed_t = 3; 2236 pub const B134: ::speed_t = 4; 2237 pub const B150: ::speed_t = 5; 2238 pub const B200: ::speed_t = 6; 2239 pub const B300: ::speed_t = 7; 2240 pub const B600: ::speed_t = 8; 2241 pub const B1200: ::speed_t = 9; 2242 pub const B1800: ::speed_t = 10; 2243 pub const B2400: ::speed_t = 11; 2244 pub const B4800: ::speed_t = 12; 2245 pub const B9600: ::speed_t = 13; 2246 pub const B19200: ::speed_t = 14; 2247 pub const B38400: ::speed_t = 15; 2248 pub const EXTA: ::speed_t = 14; 2249 pub const EXTB: ::speed_t = 15; 2250 pub const B57600: ::speed_t = 57600; 2251 pub const B115200: ::speed_t = 115200; 2252 2253 pub const VEOL: usize = 5; 2254 pub const VEOL2: usize = 6; 2255 pub const VMIN: usize = 16; 2256 pub const IEXTEN: ::tcflag_t = 0x00008000; 2257 pub const TOSTOP: ::tcflag_t = 0x00000100; 2258 2259 pub const TCSANOW: ::c_int = 0x0001; 2260 pub const TCSADRAIN: ::c_int = 0x0002; 2261 pub const TCSAFLUSH: ::c_int = 0x0004; 2262 2263 pub const HW_MACHINE: ::c_int = 1; 2264 pub const HW_MODEL: ::c_int = 2; 2265 pub const HW_NCPU: ::c_int = 3; 2266 pub const HW_BYTEORDER: ::c_int = 4; 2267 pub const HW_PHYSMEM: ::c_int = 5; 2268 pub const HW_USERMEM: ::c_int = 6; 2269 pub const HW_PAGESIZE: ::c_int = 7; 2270 pub const HW_DISKNAMES: ::c_int = 8; 2271 pub const HW_IOSTATS: ::c_int = 9; 2272 pub const HW_MACHINE_ARCH: ::c_int = 10; 2273 pub const HW_ALIGNBYTES: ::c_int = 11; 2274 pub const HW_CNMAGIC: ::c_int = 12; 2275 pub const HW_PHYSMEM64: ::c_int = 13; 2276 pub const HW_USERMEM64: ::c_int = 14; 2277 pub const HW_IOSTATNAMES: ::c_int = 15; 2278 pub const HW_MAXID: ::c_int = 15; 2279 2280 pub const CTL_UNSPEC: ::c_int = 0; 2281 pub const CTL_KERN: ::c_int = 1; 2282 pub const CTL_VM: ::c_int = 2; 2283 pub const CTL_VFS: ::c_int = 3; 2284 pub const CTL_NET: ::c_int = 4; 2285 pub const CTL_DEBUG: ::c_int = 5; 2286 pub const CTL_HW: ::c_int = 6; 2287 pub const CTL_MACHDEP: ::c_int = 7; 2288 pub const CTL_USER: ::c_int = 8; 2289 pub const CTL_QNX: ::c_int = 9; 2290 pub const CTL_PROC: ::c_int = 10; 2291 pub const CTL_VENDOR: ::c_int = 11; 2292 pub const CTL_EMUL: ::c_int = 12; 2293 pub const CTL_SECURITY: ::c_int = 13; 2294 pub const CTL_MAXID: ::c_int = 14; 2295 2296 pub const DAY_1: ::nl_item = 8; 2297 pub const DAY_2: ::nl_item = 9; 2298 pub const DAY_3: ::nl_item = 10; 2299 pub const DAY_4: ::nl_item = 11; 2300 pub const DAY_5: ::nl_item = 12; 2301 pub const DAY_6: ::nl_item = 13; 2302 pub const DAY_7: ::nl_item = 14; 2303 2304 pub const MON_1: ::nl_item = 22; 2305 pub const MON_2: ::nl_item = 23; 2306 pub const MON_3: ::nl_item = 24; 2307 pub const MON_4: ::nl_item = 25; 2308 pub const MON_5: ::nl_item = 26; 2309 pub const MON_6: ::nl_item = 27; 2310 pub const MON_7: ::nl_item = 28; 2311 pub const MON_8: ::nl_item = 29; 2312 pub const MON_9: ::nl_item = 30; 2313 pub const MON_10: ::nl_item = 31; 2314 pub const MON_11: ::nl_item = 32; 2315 pub const MON_12: ::nl_item = 33; 2316 2317 pub const ABDAY_1: ::nl_item = 15; 2318 pub const ABDAY_2: ::nl_item = 16; 2319 pub const ABDAY_3: ::nl_item = 17; 2320 pub const ABDAY_4: ::nl_item = 18; 2321 pub const ABDAY_5: ::nl_item = 19; 2322 pub const ABDAY_6: ::nl_item = 20; 2323 pub const ABDAY_7: ::nl_item = 21; 2324 2325 pub const ABMON_1: ::nl_item = 34; 2326 pub const ABMON_2: ::nl_item = 35; 2327 pub const ABMON_3: ::nl_item = 36; 2328 pub const ABMON_4: ::nl_item = 37; 2329 pub const ABMON_5: ::nl_item = 38; 2330 pub const ABMON_6: ::nl_item = 39; 2331 pub const ABMON_7: ::nl_item = 40; 2332 pub const ABMON_8: ::nl_item = 41; 2333 pub const ABMON_9: ::nl_item = 42; 2334 pub const ABMON_10: ::nl_item = 43; 2335 pub const ABMON_11: ::nl_item = 44; 2336 pub const ABMON_12: ::nl_item = 45; 2337 2338 pub const AF_ARP: ::c_int = 28; 2339 pub const AF_CCITT: ::c_int = 10; 2340 pub const AF_CHAOS: ::c_int = 5; 2341 pub const AF_CNT: ::c_int = 21; 2342 pub const AF_COIP: ::c_int = 20; 2343 pub const AF_DATAKIT: ::c_int = 9; 2344 pub const AF_DECnet: ::c_int = 12; 2345 pub const AF_DLI: ::c_int = 13; 2346 pub const AF_E164: ::c_int = 26; 2347 pub const AF_ECMA: ::c_int = 8; 2348 pub const AF_HYLINK: ::c_int = 15; 2349 pub const AF_IEEE80211: ::c_int = 32; 2350 pub const AF_IMPLINK: ::c_int = 3; 2351 pub const AF_ISO: ::c_int = 7; 2352 pub const AF_LAT: ::c_int = 14; 2353 pub const AF_LINK: ::c_int = 18; 2354 pub const AF_NATM: ::c_int = 27; 2355 pub const AF_NS: ::c_int = 6; 2356 pub const AF_OSI: ::c_int = 7; 2357 pub const AF_PUP: ::c_int = 4; 2358 pub const ALT_DIGITS: ::nl_item = 50; 2359 pub const AM_STR: ::nl_item = 6; 2360 pub const B76800: ::speed_t = 76800; 2361 2362 pub const BIOCFLUSH: ::c_int = 17000; 2363 pub const BIOCGBLEN: ::c_int = 1074020966; 2364 pub const BIOCGDLT: ::c_int = 1074020970; 2365 pub const BIOCGDLTLIST: ::c_int = -1072676233; 2366 pub const BIOCGETIF: ::c_int = 1083196011; 2367 pub const BIOCGHDRCMPLT: ::c_int = 1074020980; 2368 pub const BIOCGRTIMEOUT: ::c_int = 1074807406; 2369 pub const BIOCGSEESENT: ::c_int = 1074020984; 2370 pub const BIOCGSTATS: ::c_int = 1082147439; 2371 pub const BIOCIMMEDIATE: ::c_int = -2147204496; 2372 pub const BIOCPROMISC: ::c_int = 17001; 2373 pub const BIOCSBLEN: ::c_int = -1073462682; 2374 pub const BIOCSDLT: ::c_int = -2147204490; 2375 pub const BIOCSETF: ::c_int = -2146418073; 2376 pub const BIOCSETIF: ::c_int = -2138029460; 2377 pub const BIOCSHDRCMPLT: ::c_int = -2147204491; 2378 pub const BIOCSRTIMEOUT: ::c_int = -2146418067; 2379 pub const BIOCSSEESENT: ::c_int = -2147204487; 2380 pub const BIOCVERSION: ::c_int = 1074020977; 2381 2382 pub const BPF_ALIGNMENT: usize = ::mem::size_of::<::c_long>(); 2383 pub const CHAR_BIT: usize = 8; 2384 pub const CODESET: ::nl_item = 1; 2385 pub const CRNCYSTR: ::nl_item = 55; 2386 2387 pub const D_FLAG_FILTER: ::c_int = 0x00000001; 2388 pub const D_FLAG_STAT: ::c_int = 0x00000002; 2389 pub const D_FLAG_STAT_FORM_MASK: ::c_int = 0x000000f0; 2390 pub const D_FLAG_STAT_FORM_T32_2001: ::c_int = 0x00000010; 2391 pub const D_FLAG_STAT_FORM_T32_2008: ::c_int = 0x00000020; 2392 pub const D_FLAG_STAT_FORM_T64_2008: ::c_int = 0x00000030; 2393 pub const D_FLAG_STAT_FORM_UNSET: ::c_int = 0x00000000; 2394 2395 pub const D_FMT: ::nl_item = 3; 2396 pub const D_GETFLAG: ::c_int = 1; 2397 pub const D_SETFLAG: ::c_int = 2; 2398 pub const D_T_FMT: ::nl_item = 2; 2399 pub const ERA: ::nl_item = 46; 2400 pub const ERA_D_FMT: ::nl_item = 47; 2401 pub const ERA_D_T_FMT: ::nl_item = 48; 2402 pub const ERA_T_FMT: ::nl_item = 49; 2403 pub const RADIXCHAR: ::nl_item = 51; 2404 pub const THOUSEP: ::nl_item = 52; 2405 pub const YESEXPR: ::nl_item = 53; 2406 pub const NOEXPR: ::nl_item = 54; 2407 pub const F_GETOWN: ::c_int = 35; 2408 2409 pub const FIONBIO: ::c_int = -2147195266; 2410 pub const FIOASYNC: ::c_int = -2147195267; 2411 pub const FIOCLEX: ::c_int = 26113; 2412 pub const FIOGETOWN: ::c_int = 1074030203; 2413 pub const FIONCLEX: ::c_int = 26114; 2414 pub const FIONREAD: ::c_int = 1074030207; 2415 pub const FIONSPACE: ::c_int = 1074030200; 2416 pub const FIONWRITE: ::c_int = 1074030201; 2417 pub const FIOSETOWN: ::c_int = -2147195268; 2418 2419 pub const F_SETOWN: ::c_int = 36; 2420 pub const IFF_ACCEPTRTADV: ::c_int = 0x40000000; 2421 pub const IFF_IP6FORWARDING: ::c_int = 0x20000000; 2422 pub const IFF_LINK0: ::c_int = 0x00001000; 2423 pub const IFF_LINK1: ::c_int = 0x00002000; 2424 pub const IFF_LINK2: ::c_int = 0x00004000; 2425 pub const IFF_OACTIVE: ::c_int = 0x00000400; 2426 pub const IFF_SHIM: ::c_int = 0x80000000; 2427 pub const IFF_SIMPLEX: ::c_int = 0x00000800; 2428 pub const IHFLOW: tcflag_t = 0x00000001; 2429 pub const IIDLE: tcflag_t = 0x00000008; 2430 pub const IP_RECVDSTADDR: ::c_int = 7; 2431 pub const IP_RECVIF: ::c_int = 20; 2432 pub const IPTOS_ECN_NOTECT: u8 = 0x00; 2433 pub const IUCLC: tcflag_t = 0x00000200; 2434 pub const IUTF8: tcflag_t = 0x0004000; 2435 2436 pub const KERN_ARGMAX: ::c_int = 8; 2437 pub const KERN_ARND: ::c_int = 81; 2438 pub const KERN_BOOTTIME: ::c_int = 21; 2439 pub const KERN_CLOCKRATE: ::c_int = 12; 2440 pub const KERN_FILE: ::c_int = 15; 2441 pub const KERN_HOSTID: ::c_int = 11; 2442 pub const KERN_HOSTNAME: ::c_int = 10; 2443 pub const KERN_IOV_MAX: ::c_int = 38; 2444 pub const KERN_JOB_CONTROL: ::c_int = 19; 2445 pub const KERN_LOGSIGEXIT: ::c_int = 46; 2446 pub const KERN_MAXFILES: ::c_int = 7; 2447 pub const KERN_MAXID: ::c_int = 83; 2448 pub const KERN_MAXPROC: ::c_int = 6; 2449 pub const KERN_MAXVNODES: ::c_int = 5; 2450 pub const KERN_NGROUPS: ::c_int = 18; 2451 pub const KERN_OSRELEASE: ::c_int = 2; 2452 pub const KERN_OSREV: ::c_int = 3; 2453 pub const KERN_OSTYPE: ::c_int = 1; 2454 pub const KERN_POSIX1: ::c_int = 17; 2455 pub const KERN_PROC: ::c_int = 14; 2456 pub const KERN_PROC_ALL: ::c_int = 0; 2457 pub const KERN_PROC_ARGS: ::c_int = 48; 2458 pub const KERN_PROC_ENV: ::c_int = 3; 2459 pub const KERN_PROC_GID: ::c_int = 7; 2460 pub const KERN_PROC_PGRP: ::c_int = 2; 2461 pub const KERN_PROC_PID: ::c_int = 1; 2462 pub const KERN_PROC_RGID: ::c_int = 8; 2463 pub const KERN_PROC_RUID: ::c_int = 6; 2464 pub const KERN_PROC_SESSION: ::c_int = 3; 2465 pub const KERN_PROC_TTY: ::c_int = 4; 2466 pub const KERN_PROC_UID: ::c_int = 5; 2467 pub const KERN_PROF: ::c_int = 16; 2468 pub const KERN_SAVED_IDS: ::c_int = 20; 2469 pub const KERN_SECURELVL: ::c_int = 9; 2470 pub const KERN_VERSION: ::c_int = 4; 2471 pub const KERN_VNODE: ::c_int = 13; 2472 2473 pub const LC_ALL: ::c_int = 63; 2474 pub const LC_COLLATE: ::c_int = 1; 2475 pub const LC_CTYPE: ::c_int = 2; 2476 pub const LC_MESSAGES: ::c_int = 32; 2477 pub const LC_MONETARY: ::c_int = 4; 2478 pub const LC_NUMERIC: ::c_int = 8; 2479 pub const LC_TIME: ::c_int = 16; 2480 2481 pub const LOCAL_CONNWAIT: ::c_int = 0x0002; 2482 pub const LOCAL_CREDS: ::c_int = 0x0001; 2483 pub const LOCAL_PEEREID: ::c_int = 0x0003; 2484 2485 pub const MAP_STACK: ::c_int = 0x00001000; 2486 pub const MNT_NOEXEC: ::c_int = 0x02; 2487 pub const MNT_NOSUID: ::c_int = 0x04; 2488 pub const MNT_RDONLY: ::c_int = 0x01; 2489 2490 pub const MSG_NOTIFICATION: ::c_int = 0x0400; 2491 2492 pub const NET_RT_DUMP: ::c_int = 1; 2493 pub const NET_RT_FLAGS: ::c_int = 2; 2494 pub const NET_RT_IFLIST: ::c_int = 4; 2495 pub const NI_NUMERICSCOPE: ::c_int = 0x00000040; 2496 pub const OHFLOW: tcflag_t = 0x00000002; 2497 pub const P_ALL: idtype_t = 0; 2498 pub const PARSTK: tcflag_t = 0x00000004; 2499 pub const PF_ARP: ::c_int = 28; 2500 pub const PF_CCITT: ::c_int = 10; 2501 pub const PF_CHAOS: ::c_int = 5; 2502 pub const PF_CNT: ::c_int = 21; 2503 pub const PF_COIP: ::c_int = 20; 2504 pub const PF_DATAKIT: ::c_int = 9; 2505 pub const PF_DECnet: ::c_int = 12; 2506 pub const PF_DLI: ::c_int = 13; 2507 pub const PF_ECMA: ::c_int = 8; 2508 pub const PF_HYLINK: ::c_int = 15; 2509 pub const PF_IMPLINK: ::c_int = 3; 2510 pub const PF_ISO: ::c_int = 7; 2511 pub const PF_LAT: ::c_int = 14; 2512 pub const PF_LINK: ::c_int = 18; 2513 pub const PF_NATM: ::c_int = 27; 2514 pub const PF_OSI: ::c_int = 7; 2515 pub const PF_PIP: ::c_int = 25; 2516 pub const PF_PUP: ::c_int = 4; 2517 pub const PF_RTIP: ::c_int = 22; 2518 pub const PF_XTP: ::c_int = 19; 2519 pub const PM_STR: ::nl_item = 7; 2520 pub const POSIX_MADV_DONTNEED: ::c_int = 4; 2521 pub const POSIX_MADV_NORMAL: ::c_int = 0; 2522 pub const POSIX_MADV_RANDOM: ::c_int = 2; 2523 pub const POSIX_MADV_SEQUENTIAL: ::c_int = 1; 2524 pub const POSIX_MADV_WILLNEED: ::c_int = 3; 2525 pub const _POSIX_VDISABLE: ::c_int = 0; 2526 pub const P_PGID: idtype_t = 2; 2527 pub const P_PID: idtype_t = 1; 2528 pub const PRIO_PGRP: ::c_int = 1; 2529 pub const PRIO_PROCESS: ::c_int = 0; 2530 pub const PRIO_USER: ::c_int = 2; 2531 pub const pseudo_AF_HDRCMPLT: ::c_int = 30; 2532 pub const pseudo_AF_PIP: ::c_int = 25; 2533 pub const pseudo_AF_RTIP: ::c_int = 22; 2534 pub const pseudo_AF_XTP: ::c_int = 19; 2535 pub const REG_ASSERT: ::c_int = 15; 2536 pub const REG_ATOI: ::c_int = 255; 2537 pub const REG_BACKR: ::c_int = 0x400; 2538 pub const REG_BASIC: ::c_int = 0x00; 2539 pub const REG_DUMP: ::c_int = 0x80; 2540 pub const REG_EMPTY: ::c_int = 14; 2541 pub const REG_INVARG: ::c_int = 16; 2542 pub const REG_ITOA: ::c_int = 0o400; 2543 pub const REG_LARGE: ::c_int = 0x200; 2544 pub const REG_NOSPEC: ::c_int = 0x10; 2545 pub const REG_OK: ::c_int = 0; 2546 pub const REG_PEND: ::c_int = 0x20; 2547 pub const REG_TRACE: ::c_int = 0x100; 2548 2549 pub const RLIMIT_AS: ::c_int = 6; 2550 pub const RLIMIT_CORE: ::c_int = 4; 2551 pub const RLIMIT_CPU: ::c_int = 0; 2552 pub const RLIMIT_DATA: ::c_int = 2; 2553 pub const RLIMIT_FSIZE: ::c_int = 1; 2554 pub const RLIMIT_MEMLOCK: ::c_int = 7; 2555 pub const RLIMIT_NOFILE: ::c_int = 5; 2556 pub const RLIMIT_NPROC: ::c_int = 8; 2557 pub const RLIMIT_RSS: ::c_int = 6; 2558 pub const RLIMIT_STACK: ::c_int = 3; 2559 pub const RLIMIT_VMEM: ::c_int = 6; 2560 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] 2561 pub const RLIM_NLIMITS: ::c_int = 14; 2562 2563 pub const SCHED_ADJTOHEAD: ::c_int = 5; 2564 pub const SCHED_ADJTOTAIL: ::c_int = 6; 2565 pub const SCHED_MAXPOLICY: ::c_int = 7; 2566 pub const SCHED_SETPRIO: ::c_int = 7; 2567 pub const SCHED_SPORADIC: ::c_int = 4; 2568 2569 pub const SHM_ANON: *mut ::c_char = -1isize as *mut ::c_char; 2570 pub const SIGCLD: ::c_int = SIGCHLD; 2571 pub const SIGDEADLK: ::c_int = 7; 2572 pub const SIGEMT: ::c_int = 7; 2573 pub const SIGEV_NONE: ::c_int = 0; 2574 pub const SIGEV_SIGNAL: ::c_int = 129; 2575 pub const SIGEV_THREAD: ::c_int = 135; 2576 pub const SIOCGIFADDR: ::c_int = -1064277727; 2577 pub const SO_FIB: ::c_int = 0x100a; 2578 pub const SO_OVERFLOWED: ::c_int = 0x1009; 2579 pub const SO_SETFIB: ::c_int = 0x100a; 2580 pub const SO_TXPRIO: ::c_int = 0x100b; 2581 pub const SO_USELOOPBACK: ::c_int = 0x0040; 2582 pub const SO_VLANPRIO: ::c_int = 0x100c; 2583 pub const _SS_ALIGNSIZE: usize = ::mem::size_of::<i64>(); 2584 pub const _SS_MAXSIZE: usize = 128; 2585 pub const _SS_PAD1SIZE: usize = _SS_ALIGNSIZE - 2; 2586 pub const _SS_PAD2SIZE: usize = _SS_MAXSIZE - 2 - _SS_PAD1SIZE - _SS_ALIGNSIZE; 2587 pub const TC_CPOSIX: tcflag_t = CLOCAL | CREAD | CSIZE | CSTOPB | HUPCL | PARENB | PARODD; 2588 pub const TCGETS: ::c_int = 0x404c540d; 2589 pub const TC_IPOSIX: tcflag_t = 2590 BRKINT | ICRNL | IGNBRK | IGNPAR | INLCR | INPCK | ISTRIP | IXOFF | IXON | PARMRK; 2591 pub const TC_LPOSIX: tcflag_t = 2592 ECHO | ECHOE | ECHOK | ECHONL | ICANON | IEXTEN | ISIG | NOFLSH | TOSTOP; 2593 pub const TC_OPOSIX: tcflag_t = OPOST; 2594 pub const T_FMT_AMPM: ::nl_item = 5; 2595 2596 pub const TIOCCBRK: ::c_int = 29818; 2597 pub const TIOCCDTR: ::c_int = 29816; 2598 pub const TIOCDRAIN: ::c_int = 29790; 2599 pub const TIOCEXCL: ::c_int = 29709; 2600 pub const TIOCFLUSH: ::c_int = -2147191792; 2601 pub const TIOCGETA: ::c_int = 1078752275; 2602 pub const TIOCGPGRP: ::c_int = 1074033783; 2603 pub const TIOCGWINSZ: ::c_int = 1074295912; 2604 pub const TIOCMBIC: ::c_int = -2147191701; 2605 pub const TIOCMBIS: ::c_int = -2147191700; 2606 pub const TIOCMGET: ::c_int = 1074033770; 2607 pub const TIOCMSET: ::c_int = -2147191699; 2608 pub const TIOCNOTTY: ::c_int = 29809; 2609 pub const TIOCNXCL: ::c_int = 29710; 2610 pub const TIOCOUTQ: ::c_int = 1074033779; 2611 pub const TIOCPKT: ::c_int = -2147191696; 2612 pub const TIOCPKT_DATA: ::c_int = 0x00; 2613 pub const TIOCPKT_DOSTOP: ::c_int = 0x20; 2614 pub const TIOCPKT_FLUSHREAD: ::c_int = 0x01; 2615 pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x02; 2616 pub const TIOCPKT_IOCTL: ::c_int = 0x40; 2617 pub const TIOCPKT_NOSTOP: ::c_int = 0x10; 2618 pub const TIOCPKT_START: ::c_int = 0x08; 2619 pub const TIOCPKT_STOP: ::c_int = 0x04; 2620 pub const TIOCSBRK: ::c_int = 29819; 2621 pub const TIOCSCTTY: ::c_int = 29793; 2622 pub const TIOCSDTR: ::c_int = 29817; 2623 pub const TIOCSETA: ::c_int = -2142473196; 2624 pub const TIOCSETAF: ::c_int = -2142473194; 2625 pub const TIOCSETAW: ::c_int = -2142473195; 2626 pub const TIOCSPGRP: ::c_int = -2147191690; 2627 pub const TIOCSTART: ::c_int = 29806; 2628 pub const TIOCSTI: ::c_int = -2147388302; 2629 pub const TIOCSTOP: ::c_int = 29807; 2630 pub const TIOCSWINSZ: ::c_int = -2146929561; 2631 2632 pub const USER_CS_PATH: ::c_int = 1; 2633 pub const USER_BC_BASE_MAX: ::c_int = 2; 2634 pub const USER_BC_DIM_MAX: ::c_int = 3; 2635 pub const USER_BC_SCALE_MAX: ::c_int = 4; 2636 pub const USER_BC_STRING_MAX: ::c_int = 5; 2637 pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6; 2638 pub const USER_EXPR_NEST_MAX: ::c_int = 7; 2639 pub const USER_LINE_MAX: ::c_int = 8; 2640 pub const USER_RE_DUP_MAX: ::c_int = 9; 2641 pub const USER_POSIX2_VERSION: ::c_int = 10; 2642 pub const USER_POSIX2_C_BIND: ::c_int = 11; 2643 pub const USER_POSIX2_C_DEV: ::c_int = 12; 2644 pub const USER_POSIX2_CHAR_TERM: ::c_int = 13; 2645 pub const USER_POSIX2_FORT_DEV: ::c_int = 14; 2646 pub const USER_POSIX2_FORT_RUN: ::c_int = 15; 2647 pub const USER_POSIX2_LOCALEDEF: ::c_int = 16; 2648 pub const USER_POSIX2_SW_DEV: ::c_int = 17; 2649 pub const USER_POSIX2_UPE: ::c_int = 18; 2650 pub const USER_STREAM_MAX: ::c_int = 19; 2651 pub const USER_TZNAME_MAX: ::c_int = 20; 2652 pub const USER_ATEXIT_MAX: ::c_int = 21; 2653 pub const USER_MAXID: ::c_int = 22; 2654 2655 pub const VDOWN: usize = 31; 2656 pub const VINS: usize = 32; 2657 pub const VDEL: usize = 33; 2658 pub const VRUB: usize = 34; 2659 pub const VCAN: usize = 35; 2660 pub const VHOME: usize = 36; 2661 pub const VEND: usize = 37; 2662 pub const VSPARE3: usize = 38; 2663 pub const VSPARE4: usize = 39; 2664 pub const VSWTCH: usize = 7; 2665 pub const VDSUSP: usize = 11; 2666 pub const VFWD: usize = 18; 2667 pub const VLOGIN: usize = 19; 2668 pub const VPREFIX: usize = 20; 2669 pub const VSUFFIX: usize = 24; 2670 pub const VLEFT: usize = 28; 2671 pub const VRIGHT: usize = 29; 2672 pub const VUP: usize = 30; 2673 pub const XCASE: tcflag_t = 0x00000004; 2674 2675 pub const PTHREAD_BARRIER_SERIAL_THREAD: ::c_int = -1; 2676 pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0x00; 2677 pub const PTHREAD_CREATE_DETACHED: ::c_int = 0x01; 2678 2679 pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1; 2680 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2; 2681 pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3; 2682 pub const PTHREAD_STACK_MIN: ::size_t = 256; 2683 pub const PTHREAD_MUTEX_DEFAULT: ::c_int = 0; 2684 pub const PTHREAD_MUTEX_STALLED: ::c_int = 0x00; 2685 pub const PTHREAD_MUTEX_ROBUST: ::c_int = 0x10; 2686 pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0x00; 2687 pub const PTHREAD_PROCESS_SHARED: ::c_int = 0x01; 2688 2689 pub const PTHREAD_KEYS_MAX: usize = 128; 2690 2691 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { 2692 __u: 0x80000000, 2693 __owner: 0xffffffff, 2694 }; 2695 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { 2696 __u: CLOCK_REALTIME as u32, 2697 __owner: 0xfffffffb, 2698 }; 2699 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { 2700 __active: 0, 2701 __blockedwriters: 0, 2702 __blockedreaders: 0, 2703 __heavy: 0, 2704 __lock: PTHREAD_MUTEX_INITIALIZER, 2705 __rcond: PTHREAD_COND_INITIALIZER, 2706 __wcond: PTHREAD_COND_INITIALIZER, 2707 __owner: -2i32 as ::c_uint, 2708 __spare: 0, 2709 }; 2710 2711 const_fn! { 2712 {const} fn _CMSG_ALIGN(len: usize) -> usize { 2713 len + ::mem::size_of::<usize>() - 1 & !(::mem::size_of::<usize>() - 1) 2714 } 2715 2716 {const} fn _ALIGN(p: usize, b: usize) -> usize { 2717 (p + b - 1) & !(b-1) 2718 } 2719 } 2720 2721 f! { 2722 pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { 2723 if (*mhdr).msg_controllen as usize >= ::mem::size_of::<cmsghdr>() { 2724 (*mhdr).msg_control as *mut cmsghdr 2725 } else { 2726 0 as *mut cmsghdr 2727 } 2728 } 2729 2730 pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr) 2731 -> *mut ::cmsghdr 2732 { 2733 let msg = _CMSG_ALIGN((*cmsg).cmsg_len as usize); 2734 let next = cmsg as usize + msg + _CMSG_ALIGN(::mem::size_of::<::cmsghdr>()); 2735 if next > (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize { 2736 0 as *mut ::cmsghdr 2737 } else { 2738 (cmsg as usize + msg) as *mut ::cmsghdr 2739 } 2740 } 2741 2742 pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar { 2743 (cmsg as *mut ::c_uchar) 2744 .offset(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize) 2745 } 2746 2747 pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint { 2748 _CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length 2749 } 2750 2751 pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { 2752 (_CMSG_ALIGN(::mem::size_of::<cmsghdr>()) + _CMSG_ALIGN(length as usize) ) 2753 as ::c_uint 2754 } 2755 2756 pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { 2757 let fd = fd as usize; 2758 let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; 2759 (*set).fds_bits[fd / size] &= !(1 << (fd % size)); 2760 return 2761 } 2762 2763 pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool { 2764 let fd = fd as usize; 2765 let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; 2766 return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0 2767 } 2768 2769 pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () { 2770 let fd = fd as usize; 2771 let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; 2772 (*set).fds_bits[fd / size] |= 1 << (fd % size); 2773 return 2774 } 2775 2776 pub fn FD_ZERO(set: *mut fd_set) -> () { 2777 for slot in (*set).fds_bits.iter_mut() { 2778 *slot = 0; 2779 } 2780 } 2781 2782 pub fn _DEXTRA_FIRST(_d: *const dirent) -> *mut ::dirent_extra { 2783 let _f = &((*(_d)).d_name) as *const _; 2784 let _s = _d as usize; 2785 2786 _ALIGN(_s + _f as usize - _s + (*_d).d_namelen as usize + 1, 8) as *mut ::dirent_extra 2787 } 2788 2789 pub fn _DEXTRA_VALID(_x: *const ::dirent_extra, _d: *const dirent) -> bool { 2790 let sz = _x as usize - _d as usize + ::mem::size_of::<::dirent_extra>(); 2791 let rsz = (*_d).d_reclen as usize; 2792 2793 if sz > rsz || sz + (*_x).d_datalen as usize > rsz { 2794 false 2795 } else { 2796 true 2797 } 2798 } 2799 2800 pub fn _DEXTRA_NEXT(_x: *const ::dirent_extra) -> *mut ::dirent_extra { 2801 _ALIGN( 2802 _x as usize + ::mem::size_of::<::dirent_extra>() + (*_x).d_datalen as usize, 8 2803 ) as *mut ::dirent_extra 2804 } 2805 2806 pub fn SOCKCREDSIZE(ngrps: usize) -> usize { 2807 let ngrps = if ngrps > 0 { 2808 ngrps - 1 2809 } else { 2810 0 2811 }; 2812 ::mem::size_of::<sockcred>() + ::mem::size_of::<::gid_t>() * ngrps 2813 } 2814 2815 pub fn major(dev: ::dev_t) -> ::c_uint { 2816 ((dev as ::c_uint) >> 10) & 0x3f 2817 } 2818 2819 pub fn minor(dev: ::dev_t) -> ::c_uint { 2820 (dev as ::c_uint) & 0x3ff 2821 } 2822 } 2823 2824 safe_f! { 2825 pub {const} fn WIFSTOPPED(status: ::c_int) -> bool { 2826 (status & 0xff) == 0x7f 2827 } 2828 2829 pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int { 2830 (status >> 8) & 0xff 2831 } 2832 2833 pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { 2834 status == 0xffff 2835 } 2836 2837 pub {const} fn WIFSIGNALED(status: ::c_int) -> bool { 2838 ((status & 0x7f) + 1) as i8 >= 2 2839 } 2840 2841 pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int { 2842 status & 0x7f 2843 } 2844 2845 pub {const} fn WIFEXITED(status: ::c_int) -> bool { 2846 (status & 0x7f) == 0 2847 } 2848 2849 pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int { 2850 (status >> 8) & 0xff 2851 } 2852 2853 pub {const} fn WCOREDUMP(status: ::c_int) -> bool { 2854 (status & 0x80) != 0 2855 } 2856 2857 pub {const} fn IPTOS_ECN(x: u8) -> u8 { 2858 x & ::IPTOS_ECN_MASK 2859 } 2860 2861 pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t { 2862 ((major << 10) | (minor)) as ::dev_t 2863 } 2864 } 2865 2866 // Network related functions are provided by libsocket and regex 2867 // functions are provided by libregex. 2868 // In QNX <=7.0, libregex functions were included in libc itself. 2869 #[link(name = "socket")] 2870 #[cfg_attr(not(target_env = "nto70"), link(name = "regex"))] 2871 extern "C" { 2872 pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; 2873 pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int; 2874 pub fn fdatasync(fd: ::c_int) -> ::c_int; 2875 pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int; 2876 pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int; 2877 pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int; 2878 pub fn mknodat( 2879 __fd: ::c_int, 2880 pathname: *const ::c_char, 2881 mode: ::mode_t, 2882 dev: ::dev_t, 2883 ) -> ::c_int; 2884 2885 pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; 2886 pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; 2887 pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; 2888 pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int; 2889 2890 pub fn pthread_attr_getstack( 2891 attr: *const ::pthread_attr_t, 2892 stackaddr: *mut *mut ::c_void, 2893 stacksize: *mut ::size_t, 2894 ) -> ::c_int; 2895 pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; 2896 pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int; 2897 2898 pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int; 2899 pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; 2900 pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; 2901 2902 pub fn utimensat( 2903 dirfd: ::c_int, 2904 path: *const ::c_char, 2905 times: *const ::timespec, 2906 flag: ::c_int, 2907 ) -> ::c_int; 2908 2909 pub fn pthread_condattr_getclock( 2910 attr: *const pthread_condattr_t, 2911 clock_id: *mut clockid_t, 2912 ) -> ::c_int; 2913 pub fn pthread_condattr_setclock( 2914 attr: *mut pthread_condattr_t, 2915 clock_id: ::clockid_t, 2916 ) -> ::c_int; 2917 pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int; 2918 pub fn pthread_mutexattr_setpshared( 2919 attr: *mut pthread_mutexattr_t, 2920 pshared: ::c_int, 2921 ) -> ::c_int; 2922 pub fn pthread_rwlockattr_getpshared( 2923 attr: *const pthread_rwlockattr_t, 2924 val: *mut ::c_int, 2925 ) -> ::c_int; 2926 pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int; 2927 pub fn ptsname_r(fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t) -> *mut ::c_char; 2928 pub fn clearenv() -> ::c_int; 2929 pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int) 2930 -> ::c_int; 2931 pub fn wait4( 2932 pid: ::pid_t, 2933 status: *mut ::c_int, 2934 options: ::c_int, 2935 rusage: *mut ::rusage, 2936 ) -> ::pid_t; 2937 pub fn execvpe( 2938 file: *const ::c_char, 2939 argv: *const *const ::c_char, 2940 envp: *const *const ::c_char, 2941 ) -> ::c_int; 2942 2943 pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int; 2944 pub fn freeifaddrs(ifa: *mut ::ifaddrs); 2945 pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int; 2946 2947 pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; 2948 pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; 2949 2950 pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t; 2951 pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t; 2952 pub fn openpty( 2953 amaster: *mut ::c_int, 2954 aslave: *mut ::c_int, 2955 name: *mut ::c_char, 2956 termp: *mut termios, 2957 winp: *mut ::winsize, 2958 ) -> ::c_int; 2959 pub fn forkpty( 2960 amaster: *mut ::c_int, 2961 name: *mut ::c_char, 2962 termp: *mut termios, 2963 winp: *mut ::winsize, 2964 ) -> ::pid_t; 2965 pub fn login_tty(fd: ::c_int) -> ::c_int; 2966 2967 pub fn uname(buf: *mut ::utsname) -> ::c_int; 2968 2969 pub fn getpeereid(socket: ::c_int, euid: *mut ::uid_t, egid: *mut ::gid_t) -> ::c_int; 2970 2971 pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int; 2972 2973 pub fn abs(i: ::c_int) -> ::c_int; 2974 pub fn labs(i: ::c_long) -> ::c_long; 2975 pub fn rand() -> ::c_int; 2976 pub fn srand(seed: ::c_uint); 2977 2978 pub fn setpwent(); 2979 pub fn endpwent(); 2980 pub fn getpwent() -> *mut passwd; 2981 pub fn setgrent(); 2982 pub fn endgrent(); 2983 pub fn getgrent() -> *mut ::group; 2984 pub fn setspent(); 2985 pub fn endspent(); 2986 2987 pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int; 2988 2989 pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t; 2990 pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; 2991 2992 pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int; 2993 pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int; 2994 pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int; 2995 pub fn sigtimedwait( 2996 set: *const sigset_t, 2997 info: *mut siginfo_t, 2998 timeout: *const ::timespec, 2999 ) -> ::c_int; 3000 pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int; 3001 pub fn pthread_setschedprio(native: ::pthread_t, priority: ::c_int) -> ::c_int; 3002 3003 pub fn if_nameindex() -> *mut if_nameindex; 3004 pub fn if_freenameindex(ptr: *mut if_nameindex); 3005 3006 pub fn glob( 3007 pattern: *const c_char, 3008 flags: ::c_int, 3009 errfunc: ::Option<extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int>, 3010 pglob: *mut ::glob_t, 3011 ) -> ::c_int; 3012 pub fn globfree(pglob: *mut ::glob_t); 3013 3014 pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int; 3015 3016 pub fn shm_unlink(name: *const ::c_char) -> ::c_int; 3017 3018 pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); 3019 3020 pub fn telldir(dirp: *mut ::DIR) -> ::c_long; 3021 3022 pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int; 3023 3024 pub fn recvfrom( 3025 socket: ::c_int, 3026 buf: *mut ::c_void, 3027 len: ::size_t, 3028 flags: ::c_int, 3029 addr: *mut ::sockaddr, 3030 addrlen: *mut ::socklen_t, 3031 ) -> ::ssize_t; 3032 pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int; 3033 3034 pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int; 3035 pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int; 3036 pub fn sync(); 3037 pub fn pthread_getschedparam( 3038 native: ::pthread_t, 3039 policy: *mut ::c_int, 3040 param: *mut ::sched_param, 3041 ) -> ::c_int; 3042 pub fn umount(target: *const ::c_char, flags: ::c_int) -> ::c_int; 3043 pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int; 3044 pub fn settimeofday(tv: *const ::timeval, tz: *const ::c_void) -> ::c_int; 3045 pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int; 3046 pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int; 3047 pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int; 3048 pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int; 3049 pub fn mount( 3050 special_device: *const ::c_char, 3051 mount_directory: *const ::c_char, 3052 flags: ::c_int, 3053 mount_type: *const ::c_char, 3054 mount_data: *const ::c_void, 3055 mount_datalen: ::c_int, 3056 ) -> ::c_int; 3057 pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int; 3058 pub fn pthread_mutex_consistent(mutex: *mut pthread_mutex_t) -> ::c_int; 3059 pub fn pthread_mutex_timedlock( 3060 lock: *mut pthread_mutex_t, 3061 abstime: *const ::timespec, 3062 ) -> ::c_int; 3063 pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int; 3064 pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int; 3065 pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int; 3066 pub fn pthread_spin_trylock(lock: *mut ::pthread_spinlock_t) -> ::c_int; 3067 pub fn pthread_spin_unlock(lock: *mut ::pthread_spinlock_t) -> ::c_int; 3068 pub fn pthread_barrierattr_init(__attr: *mut ::pthread_barrierattr_t) -> ::c_int; 3069 pub fn pthread_barrierattr_destroy(__attr: *mut ::pthread_barrierattr_t) -> ::c_int; 3070 pub fn pthread_barrierattr_getpshared( 3071 __attr: *const ::pthread_barrierattr_t, 3072 __pshared: *mut ::c_int, 3073 ) -> ::c_int; 3074 pub fn pthread_barrierattr_setpshared( 3075 __attr: *mut ::pthread_barrierattr_t, 3076 __pshared: ::c_int, 3077 ) -> ::c_int; 3078 pub fn pthread_barrier_init( 3079 __barrier: *mut ::pthread_barrier_t, 3080 __attr: *const ::pthread_barrierattr_t, 3081 __count: ::c_uint, 3082 ) -> ::c_int; 3083 pub fn pthread_barrier_destroy(__barrier: *mut ::pthread_barrier_t) -> ::c_int; 3084 pub fn pthread_barrier_wait(__barrier: *mut ::pthread_barrier_t) -> ::c_int; 3085 3086 pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int; 3087 pub fn clock_nanosleep( 3088 clk_id: ::clockid_t, 3089 flags: ::c_int, 3090 rqtp: *const ::timespec, 3091 rmtp: *mut ::timespec, 3092 ) -> ::c_int; 3093 pub fn pthread_attr_getguardsize( 3094 attr: *const ::pthread_attr_t, 3095 guardsize: *mut ::size_t, 3096 ) -> ::c_int; 3097 pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int; 3098 pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int; 3099 pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int; 3100 pub fn pthread_condattr_getpshared( 3101 attr: *const pthread_condattr_t, 3102 pshared: *mut ::c_int, 3103 ) -> ::c_int; 3104 pub fn pthread_setschedparam( 3105 native: ::pthread_t, 3106 policy: ::c_int, 3107 param: *const ::sched_param, 3108 ) -> ::c_int; 3109 pub fn sched_setscheduler( 3110 pid: ::pid_t, 3111 policy: ::c_int, 3112 param: *const ::sched_param, 3113 ) -> ::c_int; 3114 pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int; 3115 pub fn getgrgid_r( 3116 gid: ::gid_t, 3117 grp: *mut ::group, 3118 buf: *mut ::c_char, 3119 buflen: ::size_t, 3120 result: *mut *mut ::group, 3121 ) -> ::c_int; 3122 pub fn sem_close(sem: *mut sem_t) -> ::c_int; 3123 pub fn getdtablesize() -> ::c_int; 3124 pub fn getgrnam_r( 3125 name: *const ::c_char, 3126 grp: *mut ::group, 3127 buf: *mut ::c_char, 3128 buflen: ::size_t, 3129 result: *mut *mut ::group, 3130 ) -> ::c_int; 3131 pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int; 3132 pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int; 3133 pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; 3134 pub fn getgrnam(name: *const ::c_char) -> *mut ::group; 3135 pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int; 3136 pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; 3137 pub fn sem_unlink(name: *const ::c_char) -> ::c_int; 3138 pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; 3139 pub fn getpwnam_r( 3140 name: *const ::c_char, 3141 pwd: *mut passwd, 3142 buf: *mut ::c_char, 3143 buflen: ::size_t, 3144 result: *mut *mut passwd, 3145 ) -> ::c_int; 3146 pub fn getpwuid_r( 3147 uid: ::uid_t, 3148 pwd: *mut passwd, 3149 buf: *mut ::c_char, 3150 buflen: ::size_t, 3151 result: *mut *mut passwd, 3152 ) -> ::c_int; 3153 pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; 3154 pub fn pthread_atfork( 3155 prepare: ::Option<unsafe extern "C" fn()>, 3156 parent: ::Option<unsafe extern "C" fn()>, 3157 child: ::Option<unsafe extern "C" fn()>, 3158 ) -> ::c_int; 3159 pub fn getgrgid(gid: ::gid_t) -> *mut ::group; 3160 pub fn getgrouplist( 3161 user: *const ::c_char, 3162 group: ::gid_t, 3163 groups: *mut ::gid_t, 3164 ngroups: *mut ::c_int, 3165 ) -> ::c_int; 3166 pub fn pthread_mutexattr_getpshared( 3167 attr: *const pthread_mutexattr_t, 3168 pshared: *mut ::c_int, 3169 ) -> ::c_int; 3170 pub fn pthread_mutexattr_getrobust( 3171 attr: *const pthread_mutexattr_t, 3172 robustness: *mut ::c_int, 3173 ) -> ::c_int; 3174 pub fn pthread_mutexattr_setrobust( 3175 attr: *mut pthread_mutexattr_t, 3176 robustness: ::c_int, 3177 ) -> ::c_int; 3178 pub fn pthread_create( 3179 native: *mut ::pthread_t, 3180 attr: *const ::pthread_attr_t, 3181 f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, 3182 value: *mut ::c_void, 3183 ) -> ::c_int; 3184 pub fn getitimer(which: ::c_int, curr_value: *mut ::itimerval) -> ::c_int; 3185 pub fn setitimer( 3186 which: ::c_int, 3187 value: *const ::itimerval, 3188 ovalue: *mut ::itimerval, 3189 ) -> ::c_int; 3190 pub fn posix_spawn( 3191 pid: *mut ::pid_t, 3192 path: *const ::c_char, 3193 file_actions: *const ::posix_spawn_file_actions_t, 3194 attrp: *const ::posix_spawnattr_t, 3195 argv: *const *mut ::c_char, 3196 envp: *const *mut ::c_char, 3197 ) -> ::c_int; 3198 pub fn posix_spawnp( 3199 pid: *mut ::pid_t, 3200 file: *const ::c_char, 3201 file_actions: *const ::posix_spawn_file_actions_t, 3202 attrp: *const ::posix_spawnattr_t, 3203 argv: *const *mut ::c_char, 3204 envp: *const *mut ::c_char, 3205 ) -> ::c_int; 3206 pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int; 3207 pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int; 3208 pub fn posix_spawnattr_getsigdefault( 3209 attr: *const posix_spawnattr_t, 3210 default: *mut ::sigset_t, 3211 ) -> ::c_int; 3212 pub fn posix_spawnattr_setsigdefault( 3213 attr: *mut posix_spawnattr_t, 3214 default: *const ::sigset_t, 3215 ) -> ::c_int; 3216 pub fn posix_spawnattr_getsigmask( 3217 attr: *const posix_spawnattr_t, 3218 default: *mut ::sigset_t, 3219 ) -> ::c_int; 3220 pub fn posix_spawnattr_setsigmask( 3221 attr: *mut posix_spawnattr_t, 3222 default: *const ::sigset_t, 3223 ) -> ::c_int; 3224 pub fn posix_spawnattr_getflags( 3225 attr: *const posix_spawnattr_t, 3226 flags: *mut ::c_short, 3227 ) -> ::c_int; 3228 pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int; 3229 pub fn posix_spawnattr_getpgroup( 3230 attr: *const posix_spawnattr_t, 3231 flags: *mut ::pid_t, 3232 ) -> ::c_int; 3233 pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int; 3234 pub fn posix_spawnattr_getschedpolicy( 3235 attr: *const posix_spawnattr_t, 3236 flags: *mut ::c_int, 3237 ) -> ::c_int; 3238 pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int; 3239 pub fn posix_spawnattr_getschedparam( 3240 attr: *const posix_spawnattr_t, 3241 param: *mut ::sched_param, 3242 ) -> ::c_int; 3243 pub fn posix_spawnattr_setschedparam( 3244 attr: *mut posix_spawnattr_t, 3245 param: *const ::sched_param, 3246 ) -> ::c_int; 3247 3248 pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int; 3249 pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int; 3250 pub fn posix_spawn_file_actions_addopen( 3251 actions: *mut posix_spawn_file_actions_t, 3252 fd: ::c_int, 3253 path: *const ::c_char, 3254 oflag: ::c_int, 3255 mode: ::mode_t, 3256 ) -> ::c_int; 3257 pub fn posix_spawn_file_actions_addclose( 3258 actions: *mut posix_spawn_file_actions_t, 3259 fd: ::c_int, 3260 ) -> ::c_int; 3261 pub fn posix_spawn_file_actions_adddup2( 3262 actions: *mut posix_spawn_file_actions_t, 3263 fd: ::c_int, 3264 newfd: ::c_int, 3265 ) -> ::c_int; 3266 pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; 3267 pub fn faccessat( 3268 dirfd: ::c_int, 3269 pathname: *const ::c_char, 3270 mode: ::c_int, 3271 flags: ::c_int, 3272 ) -> ::c_int; 3273 pub fn inotify_rm_watch(fd: ::c_int, wd: ::c_int) -> ::c_int; 3274 pub fn inotify_init() -> ::c_int; 3275 pub fn inotify_add_watch(fd: ::c_int, path: *const ::c_char, mask: u32) -> ::c_int; 3276 3277 pub fn gettid() -> ::pid_t; 3278 3279 pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int; 3280 3281 pub fn getnameinfo( 3282 sa: *const ::sockaddr, 3283 salen: ::socklen_t, 3284 host: *mut ::c_char, 3285 hostlen: ::socklen_t, 3286 serv: *mut ::c_char, 3287 servlen: ::socklen_t, 3288 flags: ::c_int, 3289 ) -> ::c_int; 3290 3291 pub fn sendmmsg( 3292 sockfd: ::c_int, 3293 msgvec: *mut ::mmsghdr, 3294 vlen: ::c_uint, 3295 flags: ::c_uint, 3296 ) -> ::c_int; 3297 pub fn recvmmsg( 3298 sockfd: ::c_int, 3299 msgvec: *mut ::mmsghdr, 3300 vlen: ::c_uint, 3301 flags: ::c_uint, 3302 timeout: *mut ::timespec, 3303 ) -> ::c_int; 3304 3305 pub fn mallopt(param: ::c_int, value: i64) -> ::c_int; 3306 pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; 3307 3308 pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char; 3309 pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; 3310 3311 pub fn mallinfo() -> ::mallinfo; 3312 pub fn getpwent_r( 3313 pwd: *mut ::passwd, 3314 buf: *mut ::c_char, 3315 __bufsize: ::c_int, 3316 __result: *mut *mut ::passwd, 3317 ) -> ::c_int; 3318 pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::c_int) -> ::c_int; 3319 pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int; 3320 3321 pub fn sysctl( 3322 _: *const ::c_int, 3323 _: ::c_uint, 3324 _: *mut ::c_void, 3325 _: *mut ::size_t, 3326 _: *const ::c_void, 3327 _: ::size_t, 3328 ) -> ::c_int; 3329 3330 pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; 3331 pub fn setrlimit(resource: ::c_int, rlp: *const ::rlimit) -> ::c_int; 3332 3333 pub fn lio_listio( 3334 __mode: ::c_int, 3335 __list: *const *mut aiocb, 3336 __nent: ::c_int, 3337 __sig: *mut sigevent, 3338 ) -> ::c_int; 3339 3340 pub fn dl_iterate_phdr( 3341 callback: ::Option< 3342 unsafe extern "C" fn( 3343 // The original .h file declares this as *const, but for consistency with other platforms, 3344 // changing this to *mut to make it easier to use. 3345 // Maybe in v0.3 all platforms should use this as a *const. 3346 info: *mut dl_phdr_info, 3347 size: ::size_t, 3348 data: *mut ::c_void, 3349 ) -> ::c_int, 3350 >, 3351 data: *mut ::c_void, 3352 ) -> ::c_int; 3353 3354 pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int; 3355 3356 pub fn regcomp( 3357 __preg: *mut ::regex_t, 3358 __pattern: *const ::c_char, 3359 __cflags: ::c_int, 3360 ) -> ::c_int; 3361 pub fn regexec( 3362 __preg: *const ::regex_t, 3363 __str: *const ::c_char, 3364 __nmatch: ::size_t, 3365 __pmatch: *mut ::regmatch_t, 3366 __eflags: ::c_int, 3367 ) -> ::c_int; 3368 pub fn regerror( 3369 __errcode: ::c_int, 3370 __preg: *const ::regex_t, 3371 __errbuf: *mut ::c_char, 3372 __errbuf_size: ::size_t, 3373 ) -> ::size_t; 3374 pub fn regfree(__preg: *mut ::regex_t); 3375 pub fn dirfd(__dirp: *mut ::DIR) -> ::c_int; 3376 pub fn dircntl(dir: *mut ::DIR, cmd: ::c_int, ...) -> ::c_int; 3377 3378 pub fn aio_cancel(__fd: ::c_int, __aiocbp: *mut ::aiocb) -> ::c_int; 3379 pub fn aio_error(__aiocbp: *const ::aiocb) -> ::c_int; 3380 pub fn aio_fsync(__operation: ::c_int, __aiocbp: *mut ::aiocb) -> ::c_int; 3381 pub fn aio_read(__aiocbp: *mut ::aiocb) -> ::c_int; 3382 pub fn aio_return(__aiocpb: *mut ::aiocb) -> ::ssize_t; 3383 pub fn aio_suspend( 3384 __list: *const *const ::aiocb, 3385 __nent: ::c_int, 3386 __timeout: *const ::timespec, 3387 ) -> ::c_int; 3388 pub fn aio_write(__aiocpb: *mut ::aiocb) -> ::c_int; 3389 3390 pub fn mq_close(__mqdes: ::mqd_t) -> ::c_int; 3391 pub fn mq_getattr(__mqdes: ::mqd_t, __mqstat: *mut ::mq_attr) -> ::c_int; 3392 pub fn mq_notify(__mqdes: ::mqd_t, __notification: *const ::sigevent) -> ::c_int; 3393 pub fn mq_open(__name: *const ::c_char, __oflag: ::c_int, ...) -> ::mqd_t; 3394 pub fn mq_receive( 3395 __mqdes: ::mqd_t, 3396 __msg_ptr: *mut ::c_char, 3397 __msg_len: ::size_t, 3398 __msg_prio: *mut ::c_uint, 3399 ) -> ::ssize_t; 3400 pub fn mq_send( 3401 __mqdes: ::mqd_t, 3402 __msg_ptr: *const ::c_char, 3403 __msg_len: ::size_t, 3404 __msg_prio: ::c_uint, 3405 ) -> ::c_int; 3406 pub fn mq_setattr( 3407 __mqdes: ::mqd_t, 3408 __mqstat: *const mq_attr, 3409 __omqstat: *mut mq_attr, 3410 ) -> ::c_int; 3411 pub fn mq_timedreceive( 3412 __mqdes: ::mqd_t, 3413 __msg_ptr: *mut ::c_char, 3414 __msg_len: ::size_t, 3415 __msg_prio: *mut ::c_uint, 3416 __abs_timeout: *const ::timespec, 3417 ) -> ::ssize_t; 3418 pub fn mq_timedsend( 3419 __mqdes: ::mqd_t, 3420 __msg_ptr: *const ::c_char, 3421 __msg_len: ::size_t, 3422 __msg_prio: ::c_uint, 3423 __abs_timeout: *const ::timespec, 3424 ) -> ::c_int; 3425 pub fn mq_unlink(__name: *const ::c_char) -> ::c_int; 3426 pub fn __get_errno_ptr() -> *mut ::c_int; 3427 3428 // System page, see https://www.qnx.com/developers/docs/7.1#com.qnx.doc.neutrino.building/topic/syspage/syspage_about.html 3429 pub static mut _syspage_ptr: *mut syspage_entry; 3430 3431 // Function on the stack after a call to pthread_create(). This is used 3432 // as a sentinel to work around an infitnite loop in the unwinding code. 3433 pub fn __my_thread_exit(value_ptr: *mut *const ::c_void); 3434 } 3435 3436 // Models the implementation in stdlib.h. Ctest will fail if trying to use the 3437 // default symbol from libc 3438 pub unsafe fn atexit(cb: extern "C" fn()) -> ::c_int { 3439 extern "C" { 3440 static __dso_handle: *mut ::c_void; 3441 pub fn __cxa_atexit( 3442 cb: extern "C" fn(), 3443 __arg: *mut ::c_void, 3444 __dso: *mut ::c_void, 3445 ) -> ::c_int; 3446 } 3447 __cxa_atexit(cb, 0 as *mut ::c_void, __dso_handle) 3448 } 3449 3450 impl siginfo_t { 3451 pub unsafe fn si_addr(&self) -> *mut ::c_void { 3452 #[repr(C)] 3453 struct siginfo_si_addr { 3454 _pad: [u8; 32], 3455 si_addr: *mut ::c_void, 3456 } 3457 (*(self as *const siginfo_t as *const siginfo_si_addr)).si_addr 3458 } 3459 3460 pub unsafe fn si_value(&self) -> ::sigval { 3461 #[repr(C)] 3462 struct siginfo_si_value { 3463 _pad: [u8; 32], 3464 si_value: ::sigval, 3465 } 3466 (*(self as *const siginfo_t as *const siginfo_si_value)).si_value 3467 } 3468 3469 pub unsafe fn si_pid(&self) -> ::pid_t { 3470 #[repr(C)] 3471 struct siginfo_si_pid { 3472 _pad: [u8; 16], 3473 si_pid: ::pid_t, 3474 } 3475 (*(self as *const siginfo_t as *const siginfo_si_pid)).si_pid 3476 } 3477 3478 pub unsafe fn si_uid(&self) -> ::uid_t { 3479 #[repr(C)] 3480 struct siginfo_si_uid { 3481 _pad: [u8; 24], 3482 si_uid: ::uid_t, 3483 } 3484 (*(self as *const siginfo_t as *const siginfo_si_uid)).si_uid 3485 } 3486 3487 pub unsafe fn si_status(&self) -> ::c_int { 3488 #[repr(C)] 3489 struct siginfo_si_status { 3490 _pad: [u8; 28], 3491 si_status: ::c_int, 3492 } 3493 (*(self as *const siginfo_t as *const siginfo_si_status)).si_status 3494 } 3495 } 3496 3497 cfg_if! { 3498 if #[cfg(target_arch = "x86_64")] { 3499 mod x86_64; 3500 pub use self::x86_64::*; 3501 } 3502 else if #[cfg(target_arch = "aarch64")] { 3503 mod aarch64; 3504 pub use self::aarch64::*; 3505 } 3506 else { 3507 panic!("Unsupported arch"); 3508 } 3509 } 3510 3511 mod neutrino; 3512 pub use self::neutrino::*; 3513