1 //! Apple (ios/darwin)-specific definitions 2 //! 3 //! This covers *-apple-* triples currently 4 pub type c_char = i8; 5 pub type clock_t = c_ulong; 6 pub type time_t = c_long; 7 pub type suseconds_t = i32; 8 pub type dev_t = i32; 9 pub type ino_t = u64; 10 pub type mode_t = u16; 11 pub type nlink_t = u16; 12 pub type blksize_t = i32; 13 pub type rlim_t = u64; 14 pub type pthread_key_t = c_ulong; 15 pub type sigset_t = u32; 16 pub type clockid_t = ::c_uint; 17 pub type fsblkcnt_t = ::c_uint; 18 pub type fsfilcnt_t = ::c_uint; 19 pub type speed_t = ::c_ulong; 20 pub type tcflag_t = ::c_ulong; 21 pub type nl_item = ::c_int; 22 pub type id_t = ::c_uint; 23 pub type sem_t = ::c_int; 24 pub type idtype_t = ::c_uint; 25 pub type integer_t = ::c_int; 26 pub type cpu_type_t = integer_t; 27 pub type cpu_subtype_t = integer_t; 28 29 pub type posix_spawnattr_t = *mut ::c_void; 30 pub type posix_spawn_file_actions_t = *mut ::c_void; 31 pub type key_t = ::c_int; 32 pub type shmatt_t = ::c_ushort; 33 34 deprecated_mach! { 35 pub type vm_prot_t = ::c_int; 36 pub type vm_size_t = ::uintptr_t; 37 pub type mach_timebase_info_data_t = mach_timebase_info; 38 } 39 40 #[cfg_attr(feature = "extra_traits", derive(Debug))] 41 pub enum timezone {} 42 impl ::Copy for timezone {} 43 impl ::Clone for timezone { clone(&self) -> timezone44 fn clone(&self) -> timezone { 45 *self 46 } 47 } 48 49 s! { 50 pub struct ip_mreq { 51 pub imr_multiaddr: in_addr, 52 pub imr_interface: in_addr, 53 } 54 55 pub struct aiocb { 56 pub aio_fildes: ::c_int, 57 pub aio_offset: ::off_t, 58 pub aio_buf: *mut ::c_void, 59 pub aio_nbytes: ::size_t, 60 pub aio_reqprio: ::c_int, 61 pub aio_sigevent: sigevent, 62 pub aio_lio_opcode: ::c_int 63 } 64 65 pub struct glob_t { 66 pub gl_pathc: ::size_t, 67 __unused1: ::c_int, 68 pub gl_offs: ::size_t, 69 __unused2: ::c_int, 70 pub gl_pathv: *mut *mut ::c_char, 71 72 __unused3: *mut ::c_void, 73 74 __unused4: *mut ::c_void, 75 __unused5: *mut ::c_void, 76 __unused6: *mut ::c_void, 77 __unused7: *mut ::c_void, 78 __unused8: *mut ::c_void, 79 } 80 81 pub struct addrinfo { 82 pub ai_flags: ::c_int, 83 pub ai_family: ::c_int, 84 pub ai_socktype: ::c_int, 85 pub ai_protocol: ::c_int, 86 pub ai_addrlen: ::socklen_t, 87 pub ai_canonname: *mut ::c_char, 88 pub ai_addr: *mut ::sockaddr, 89 pub ai_next: *mut addrinfo, 90 } 91 92 #[deprecated( 93 since = "0.2.55", 94 note = "Use the `mach` crate instead", 95 )] 96 pub struct mach_timebase_info { 97 pub numer: u32, 98 pub denom: u32, 99 } 100 101 pub struct stat { 102 pub st_dev: dev_t, 103 pub st_mode: mode_t, 104 pub st_nlink: nlink_t, 105 pub st_ino: ino_t, 106 pub st_uid: ::uid_t, 107 pub st_gid: ::gid_t, 108 pub st_rdev: dev_t, 109 pub st_atime: time_t, 110 pub st_atime_nsec: c_long, 111 pub st_mtime: time_t, 112 pub st_mtime_nsec: c_long, 113 pub st_ctime: time_t, 114 pub st_ctime_nsec: c_long, 115 pub st_birthtime: time_t, 116 pub st_birthtime_nsec: c_long, 117 pub st_size: ::off_t, 118 pub st_blocks: ::blkcnt_t, 119 pub st_blksize: blksize_t, 120 pub st_flags: u32, 121 pub st_gen: u32, 122 pub st_lspare: i32, 123 pub st_qspare: [i64; 2], 124 } 125 126 pub struct pthread_mutexattr_t { 127 __sig: ::c_long, 128 __opaque: [u8; 8], 129 } 130 131 pub struct pthread_condattr_t { 132 __sig: ::c_long, 133 __opaque: [u8; __PTHREAD_CONDATTR_SIZE__], 134 } 135 136 pub struct pthread_rwlockattr_t { 137 __sig: ::c_long, 138 __opaque: [u8; __PTHREAD_RWLOCKATTR_SIZE__], 139 } 140 141 pub struct siginfo_t { 142 pub si_signo: ::c_int, 143 pub si_errno: ::c_int, 144 pub si_code: ::c_int, 145 pub si_pid: ::pid_t, 146 pub si_uid: ::uid_t, 147 pub si_status: ::c_int, 148 pub si_addr: *mut ::c_void, 149 //Requires it to be union for tests 150 //pub si_value: ::sigval, 151 _pad: [usize; 9], 152 } 153 154 pub struct sigaction { 155 // FIXME: this field is actually a union 156 pub sa_sigaction: ::sighandler_t, 157 pub sa_mask: sigset_t, 158 pub sa_flags: ::c_int, 159 } 160 161 pub struct stack_t { 162 pub ss_sp: *mut ::c_void, 163 pub ss_size: ::size_t, 164 pub ss_flags: ::c_int, 165 } 166 167 pub struct fstore_t { 168 pub fst_flags: ::c_uint, 169 pub fst_posmode: ::c_int, 170 pub fst_offset: ::off_t, 171 pub fst_length: ::off_t, 172 pub fst_bytesalloc: ::off_t, 173 } 174 175 pub struct radvisory { 176 pub ra_offset: ::off_t, 177 pub ra_count: ::c_int, 178 } 179 180 pub struct statvfs { 181 pub f_bsize: ::c_ulong, 182 pub f_frsize: ::c_ulong, 183 pub f_blocks: ::fsblkcnt_t, 184 pub f_bfree: ::fsblkcnt_t, 185 pub f_bavail: ::fsblkcnt_t, 186 pub f_files: ::fsfilcnt_t, 187 pub f_ffree: ::fsfilcnt_t, 188 pub f_favail: ::fsfilcnt_t, 189 pub f_fsid: ::c_ulong, 190 pub f_flag: ::c_ulong, 191 pub f_namemax: ::c_ulong, 192 } 193 194 pub struct Dl_info { 195 pub dli_fname: *const ::c_char, 196 pub dli_fbase: *mut ::c_void, 197 pub dli_sname: *const ::c_char, 198 pub dli_saddr: *mut ::c_void, 199 } 200 201 pub struct sockaddr_in { 202 pub sin_len: u8, 203 pub sin_family: ::sa_family_t, 204 pub sin_port: ::in_port_t, 205 pub sin_addr: ::in_addr, 206 pub sin_zero: [::c_char; 8], 207 } 208 209 pub struct kevent64_s { 210 pub ident: u64, 211 pub filter: i16, 212 pub flags: u16, 213 pub fflags: u32, 214 pub data: i64, 215 pub udata: u64, 216 pub ext: [u64; 2], 217 } 218 219 pub struct dqblk { 220 pub dqb_bhardlimit: u64, 221 pub dqb_bsoftlimit: u64, 222 pub dqb_curbytes: u64, 223 pub dqb_ihardlimit: u32, 224 pub dqb_isoftlimit: u32, 225 pub dqb_curinodes: u32, 226 pub dqb_btime: u32, 227 pub dqb_itime: u32, 228 pub dqb_id: u32, 229 pub dqb_spare: [u32; 4], 230 } 231 232 pub struct if_msghdr { 233 pub ifm_msglen: ::c_ushort, 234 pub ifm_version: ::c_uchar, 235 pub ifm_type: ::c_uchar, 236 pub ifm_addrs: ::c_int, 237 pub ifm_flags: ::c_int, 238 pub ifm_index: ::c_ushort, 239 pub ifm_data: if_data, 240 } 241 242 pub struct termios { 243 pub c_iflag: ::tcflag_t, 244 pub c_oflag: ::tcflag_t, 245 pub c_cflag: ::tcflag_t, 246 pub c_lflag: ::tcflag_t, 247 pub c_cc: [::cc_t; ::NCCS], 248 pub c_ispeed: ::speed_t, 249 pub c_ospeed: ::speed_t, 250 } 251 252 pub struct flock { 253 pub l_start: ::off_t, 254 pub l_len: ::off_t, 255 pub l_pid: ::pid_t, 256 pub l_type: ::c_short, 257 pub l_whence: ::c_short, 258 } 259 260 pub struct sf_hdtr { 261 pub headers: *mut ::iovec, 262 pub hdr_cnt: ::c_int, 263 pub trailers: *mut ::iovec, 264 pub trl_cnt: ::c_int, 265 } 266 267 pub struct lconv { 268 pub decimal_point: *mut ::c_char, 269 pub thousands_sep: *mut ::c_char, 270 pub grouping: *mut ::c_char, 271 pub int_curr_symbol: *mut ::c_char, 272 pub currency_symbol: *mut ::c_char, 273 pub mon_decimal_point: *mut ::c_char, 274 pub mon_thousands_sep: *mut ::c_char, 275 pub mon_grouping: *mut ::c_char, 276 pub positive_sign: *mut ::c_char, 277 pub negative_sign: *mut ::c_char, 278 pub int_frac_digits: ::c_char, 279 pub frac_digits: ::c_char, 280 pub p_cs_precedes: ::c_char, 281 pub p_sep_by_space: ::c_char, 282 pub n_cs_precedes: ::c_char, 283 pub n_sep_by_space: ::c_char, 284 pub p_sign_posn: ::c_char, 285 pub n_sign_posn: ::c_char, 286 pub int_p_cs_precedes: ::c_char, 287 pub int_n_cs_precedes: ::c_char, 288 pub int_p_sep_by_space: ::c_char, 289 pub int_n_sep_by_space: ::c_char, 290 pub int_p_sign_posn: ::c_char, 291 pub int_n_sign_posn: ::c_char, 292 } 293 294 pub struct proc_taskinfo { 295 pub pti_virtual_size: u64, 296 pub pti_resident_size: u64, 297 pub pti_total_user: u64, 298 pub pti_total_system: u64, 299 pub pti_threads_user: u64, 300 pub pti_threads_system: u64, 301 pub pti_policy: i32, 302 pub pti_faults: i32, 303 pub pti_pageins: i32, 304 pub pti_cow_faults: i32, 305 pub pti_messages_sent: i32, 306 pub pti_messages_received: i32, 307 pub pti_syscalls_mach: i32, 308 pub pti_syscalls_unix: i32, 309 pub pti_csw: i32, 310 pub pti_threadnum: i32, 311 pub pti_numrunning: i32, 312 pub pti_priority: i32, 313 } 314 315 pub struct proc_bsdinfo { 316 pub pbi_flags: u32, 317 pub pbi_status: u32, 318 pub pbi_xstatus: u32, 319 pub pbi_pid: u32, 320 pub pbi_ppid: u32, 321 pub pbi_uid: ::uid_t, 322 pub pbi_gid: ::gid_t, 323 pub pbi_ruid: ::uid_t, 324 pub pbi_rgid: ::gid_t, 325 pub pbi_svuid: ::uid_t, 326 pub pbi_svgid: ::gid_t, 327 pub rfu_1: u32, 328 pub pbi_comm: [::c_char; MAXCOMLEN], 329 pub pbi_name: [::c_char; 32], // MAXCOMLEN * 2, but macro isn't happy... 330 pub pbi_nfiles: u32, 331 pub pbi_pgid: u32, 332 pub pbi_pjobc: u32, 333 pub e_tdev: u32, 334 pub e_tpgid: u32, 335 pub pbi_nice: i32, 336 pub pbi_start_tvsec: u64, 337 pub pbi_start_tvusec: u64, 338 } 339 340 pub struct proc_taskallinfo { 341 pub pbsd: proc_bsdinfo, 342 pub ptinfo: proc_taskinfo, 343 } 344 345 pub struct xsw_usage { 346 pub xsu_total: u64, 347 pub xsu_avail: u64, 348 pub xsu_used: u64, 349 pub xsu_pagesize: u32, 350 pub xsu_encrypted: ::boolean_t, 351 } 352 353 pub struct xucred { 354 pub cr_version: ::c_uint, 355 pub cr_uid: ::uid_t, 356 pub cr_ngroups: ::c_short, 357 pub cr_groups: [::gid_t;16] 358 } 359 360 #[deprecated( 361 since = "0.2.55", 362 note = "Use the `mach` crate instead", 363 )] 364 pub struct mach_header { 365 pub magic: u32, 366 pub cputype: cpu_type_t, 367 pub cpusubtype: cpu_subtype_t, 368 pub filetype: u32, 369 pub ncmds: u32, 370 pub sizeofcmds: u32, 371 pub flags: u32, 372 } 373 374 #[deprecated( 375 since = "0.2.55", 376 note = "Use the `mach` crate instead", 377 )] 378 pub struct mach_header_64 { 379 pub magic: u32, 380 pub cputype: cpu_type_t, 381 pub cpusubtype: cpu_subtype_t, 382 pub filetype: u32, 383 pub ncmds: u32, 384 pub sizeofcmds: u32, 385 pub flags: u32, 386 pub reserved: u32, 387 } 388 389 pub struct segment_command { 390 pub cmd: u32, 391 pub cmdsize: u32, 392 pub segname: [::c_char; 16], 393 pub vmaddr: u32, 394 pub vmsize: u32, 395 pub fileoff: u32, 396 pub filesize: u32, 397 pub maxprot: vm_prot_t, 398 pub initprot: vm_prot_t, 399 pub nsects: u32, 400 pub flags: u32, 401 } 402 403 pub struct segment_command_64 { 404 pub cmd: u32, 405 pub cmdsize: u32, 406 pub segname: [::c_char; 16], 407 pub vmaddr: u64, 408 pub vmsize: u64, 409 pub fileoff: u64, 410 pub filesize: u64, 411 pub maxprot: vm_prot_t, 412 pub initprot: vm_prot_t, 413 pub nsects: u32, 414 pub flags: u32, 415 } 416 417 pub struct load_command { 418 pub cmd: u32, 419 pub cmdsize: u32, 420 } 421 422 pub struct sockaddr_dl { 423 pub sdl_len: ::c_uchar, 424 pub sdl_family: ::c_uchar, 425 pub sdl_index: ::c_ushort, 426 pub sdl_type: ::c_uchar, 427 pub sdl_nlen: ::c_uchar, 428 pub sdl_alen: ::c_uchar, 429 pub sdl_slen: ::c_uchar, 430 pub sdl_data: [::c_char; 12], 431 } 432 433 pub struct sockaddr_inarp { 434 pub sin_len: ::c_uchar, 435 pub sin_family: ::c_uchar, 436 pub sin_port: ::c_ushort, 437 pub sin_addr: ::in_addr, 438 pub sin_srcaddr: ::in_addr, 439 pub sin_tos: ::c_ushort, 440 pub sin_other: ::c_ushort, 441 } 442 443 pub struct sockaddr_ctl { 444 pub sc_len: ::c_uchar, 445 pub sc_family: ::c_uchar, 446 pub ss_sysaddr: u16, 447 pub sc_id: u32, 448 pub sc_unit: u32, 449 pub sc_reserved: [u32; 5], 450 } 451 452 pub struct in_pktinfo { 453 pub ipi_ifindex: ::c_uint, 454 pub ipi_spec_dst: ::in_addr, 455 pub ipi_addr: ::in_addr, 456 } 457 458 pub struct in6_pktinfo { 459 pub ipi6_addr: ::in6_addr, 460 pub ipi6_ifindex: ::c_uint, 461 } 462 463 // sys/ipc.h: 464 465 pub struct ipc_perm { 466 pub uid: ::uid_t, 467 pub gid: ::gid_t, 468 pub cuid: ::uid_t, 469 pub cgid: ::gid_t, 470 pub mode: ::mode_t, 471 pub _seq: ::c_ushort, 472 pub _key: ::key_t, 473 } 474 475 // sys/sem.h 476 477 pub struct sembuf { 478 pub sem_num: ::c_ushort, 479 pub sem_op: ::c_short, 480 pub sem_flg: ::c_short, 481 } 482 483 // sys/shm.h 484 485 pub struct arphdr { 486 pub ar_hrd: u16, 487 pub ar_pro: u16, 488 pub ar_hln: u8, 489 pub ar_pln: u8, 490 pub ar_op: u16, 491 } 492 493 pub struct in_addr { 494 pub s_addr: ::in_addr_t, 495 } 496 } 497 498 s_no_extra_traits! { 499 #[cfg_attr(libc_packedN, repr(packed(4)))] 500 pub struct kevent { 501 pub ident: ::uintptr_t, 502 pub filter: i16, 503 pub flags: u16, 504 pub fflags: u32, 505 pub data: ::intptr_t, 506 pub udata: *mut ::c_void, 507 } 508 509 #[cfg_attr(libc_packedN, repr(packed(4)))] 510 pub struct semid_ds { 511 // Note the manpage shows different types than the system header. 512 pub sem_perm: ipc_perm, 513 pub sem_base: i32, 514 pub sem_nsems: ::c_ushort, 515 pub sem_otime: ::time_t, 516 pub sem_pad1: i32, 517 pub sem_ctime: ::time_t, 518 pub sem_pad2: i32, 519 pub sem_pad3: [i32; 4], 520 } 521 522 #[cfg_attr(libc_packedN, repr(packed(4)))] 523 pub struct shmid_ds { 524 pub shm_perm: ipc_perm, 525 pub shm_segsz: ::size_t, 526 pub shm_lpid: ::pid_t, 527 pub shm_cpid: ::pid_t, 528 pub shm_nattch: ::shmatt_t, 529 pub shm_atime: ::time_t, // FIXME: 64-bit wrong align => wrong offset 530 pub shm_dtime: ::time_t, // FIXME: 64-bit wrong align => wrong offset 531 pub shm_ctime: ::time_t, // FIXME: 64-bit wrong align => wrong offset 532 // FIXME: 64-bit wrong align => wrong offset: 533 pub shm_internal: *mut ::c_void, 534 } 535 536 pub struct proc_threadinfo { 537 pub pth_user_time: u64, 538 pub pth_system_time: u64, 539 pub pth_cpu_usage: i32, 540 pub pth_policy: i32, 541 pub pth_run_state: i32, 542 pub pth_flags: i32, 543 pub pth_sleep_time: i32, 544 pub pth_curpri: i32, 545 pub pth_priority: i32, 546 pub pth_maxpriority: i32, 547 pub pth_name: [::c_char; MAXTHREADNAMESIZE], 548 } 549 550 pub struct statfs { 551 pub f_bsize: u32, 552 pub f_iosize: i32, 553 pub f_blocks: u64, 554 pub f_bfree: u64, 555 pub f_bavail: u64, 556 pub f_files: u64, 557 pub f_ffree: u64, 558 pub f_fsid: ::fsid_t, 559 pub f_owner: ::uid_t, 560 pub f_type: u32, 561 pub f_flags: u32, 562 pub f_fssubtype: u32, 563 pub f_fstypename: [::c_char; 16], 564 pub f_mntonname: [::c_char; 1024], 565 pub f_mntfromname: [::c_char; 1024], 566 pub f_reserved: [u32; 8], 567 } 568 569 pub struct dirent { 570 pub d_ino: u64, 571 pub d_seekoff: u64, 572 pub d_reclen: u16, 573 pub d_namlen: u16, 574 pub d_type: u8, 575 pub d_name: [::c_char; 1024], 576 } 577 578 pub struct pthread_rwlock_t { 579 __sig: ::c_long, 580 __opaque: [u8; __PTHREAD_RWLOCK_SIZE__], 581 } 582 583 pub struct pthread_mutex_t { 584 __sig: ::c_long, 585 __opaque: [u8; __PTHREAD_MUTEX_SIZE__], 586 } 587 588 pub struct pthread_cond_t { 589 __sig: ::c_long, 590 __opaque: [u8; __PTHREAD_COND_SIZE__], 591 } 592 593 pub struct sockaddr_storage { 594 pub ss_len: u8, 595 pub ss_family: ::sa_family_t, 596 __ss_pad1: [u8; 6], 597 __ss_align: i64, 598 __ss_pad2: [u8; 112], 599 } 600 601 pub struct utmpx { 602 pub ut_user: [::c_char; _UTX_USERSIZE], 603 pub ut_id: [::c_char; _UTX_IDSIZE], 604 pub ut_line: [::c_char; _UTX_LINESIZE], 605 pub ut_pid: ::pid_t, 606 pub ut_type: ::c_short, 607 pub ut_tv: ::timeval, 608 pub ut_host: [::c_char; _UTX_HOSTSIZE], 609 ut_pad: [u32; 16], 610 } 611 612 pub struct sigevent { 613 pub sigev_notify: ::c_int, 614 pub sigev_signo: ::c_int, 615 pub sigev_value: ::sigval, 616 __unused1: *mut ::c_void, //actually a function pointer 617 pub sigev_notify_attributes: *mut ::pthread_attr_t 618 } 619 } 620 621 impl siginfo_t { si_addr(&self) -> *mut ::c_void622 pub unsafe fn si_addr(&self) -> *mut ::c_void { 623 self.si_addr 624 } 625 si_value(&self) -> ::sigval626 pub unsafe fn si_value(&self) -> ::sigval { 627 #[repr(C)] 628 struct siginfo_timer { 629 _si_signo: ::c_int, 630 _si_errno: ::c_int, 631 _si_code: ::c_int, 632 _si_pid: ::pid_t, 633 _si_uid: ::uid_t, 634 _si_status: ::c_int, 635 _si_addr: *mut ::c_void, 636 si_value: ::sigval, 637 } 638 639 (*(self as *const siginfo_t as *const siginfo_timer)).si_value 640 } 641 } 642 643 cfg_if! { 644 if #[cfg(libc_union)] { 645 s_no_extra_traits! { 646 pub union semun { 647 pub val: ::c_int, 648 pub buf: *mut semid_ds, 649 pub array: *mut ::c_ushort, 650 } 651 } 652 653 cfg_if! { 654 if #[cfg(feature = "extra_traits")] { 655 impl PartialEq for semun { 656 fn eq(&self, other: &semun) -> bool { 657 unsafe { self.val == other.val } 658 } 659 } 660 impl Eq for semun {} 661 impl ::fmt::Debug for semun { 662 fn fmt(&self, f: &mut ::fmt::Formatter) 663 -> ::fmt::Result { 664 f.debug_struct("semun") 665 .field("val", unsafe { &self.val }) 666 .finish() 667 } 668 } 669 impl ::hash::Hash for semun { 670 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 671 unsafe { self.val.hash(state) }; 672 } 673 } 674 } 675 } 676 } 677 } 678 679 cfg_if! { 680 if #[cfg(feature = "extra_traits")] { 681 impl PartialEq for kevent { 682 fn eq(&self, other: &kevent) -> bool { 683 self.ident == other.ident 684 && self.filter == other.filter 685 && self.flags == other.flags 686 && self.fflags == other.fflags 687 && self.data == other.data 688 && self.udata == other.udata 689 } 690 } 691 impl Eq for kevent {} 692 impl ::fmt::Debug for kevent { 693 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 694 let ident = self.ident; 695 let filter = self.filter; 696 let flags = self.flags; 697 let fflags = self.fflags; 698 let data = self.data; 699 let udata = self.udata; 700 f.debug_struct("kevent") 701 .field("ident", &ident) 702 .field("filter", &filter) 703 .field("flags", &flags) 704 .field("fflags", &fflags) 705 .field("data", &data) 706 .field("udata", &udata) 707 .finish() 708 } 709 } 710 impl ::hash::Hash for kevent { 711 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 712 let ident = self.ident; 713 let filter = self.filter; 714 let flags = self.flags; 715 let fflags = self.fflags; 716 let data = self.data; 717 let udata = self.udata; 718 ident.hash(state); 719 filter.hash(state); 720 flags.hash(state); 721 fflags.hash(state); 722 data.hash(state); 723 udata.hash(state); 724 } 725 } 726 727 impl PartialEq for semid_ds { 728 fn eq(&self, other: &semid_ds) -> bool { 729 let sem_perm = self.sem_perm; 730 let sem_pad3 = self.sem_pad3; 731 let other_sem_perm = other.sem_perm; 732 let other_sem_pad3 = other.sem_pad3; 733 sem_perm == other_sem_perm 734 && self.sem_base == other.sem_base 735 && self.sem_nsems == other.sem_nsems 736 && self.sem_otime == other.sem_otime 737 && self.sem_pad1 == other.sem_pad1 738 && self.sem_ctime == other.sem_ctime 739 && self.sem_pad2 == other.sem_pad2 740 && sem_pad3 == other_sem_pad3 741 } 742 } 743 impl Eq for semid_ds {} 744 impl ::fmt::Debug for semid_ds { 745 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 746 let sem_perm = self.sem_perm; 747 let sem_base = self.sem_base; 748 let sem_nsems = self.sem_nsems; 749 let sem_otime = self.sem_otime; 750 let sem_pad1 = self.sem_pad1; 751 let sem_ctime = self.sem_ctime; 752 let sem_pad2 = self.sem_pad2; 753 let sem_pad3 = self.sem_pad3; 754 f.debug_struct("semid_ds") 755 .field("sem_perm", &sem_perm) 756 .field("sem_base", &sem_base) 757 .field("sem_nsems", &sem_nsems) 758 .field("sem_otime", &sem_otime) 759 .field("sem_pad1", &sem_pad1) 760 .field("sem_ctime", &sem_ctime) 761 .field("sem_pad2", &sem_pad2) 762 .field("sem_pad3", &sem_pad3) 763 .finish() 764 } 765 } 766 impl ::hash::Hash for semid_ds { 767 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 768 let sem_perm = self.sem_perm; 769 let sem_base = self.sem_base; 770 let sem_nsems = self.sem_nsems; 771 let sem_otime = self.sem_otime; 772 let sem_pad1 = self.sem_pad1; 773 let sem_ctime = self.sem_ctime; 774 let sem_pad2 = self.sem_pad2; 775 let sem_pad3 = self.sem_pad3; 776 sem_perm.hash(state); 777 sem_base.hash(state); 778 sem_nsems.hash(state); 779 sem_otime.hash(state); 780 sem_pad1.hash(state); 781 sem_ctime.hash(state); 782 sem_pad2.hash(state); 783 sem_pad3.hash(state); 784 } 785 } 786 787 impl PartialEq for shmid_ds { 788 fn eq(&self, other: &shmid_ds) -> bool { 789 let shm_perm = self.shm_perm; 790 let other_shm_perm = other.shm_perm; 791 shm_perm == other_shm_perm 792 && self.shm_segsz == other.shm_segsz 793 && self.shm_lpid == other.shm_lpid 794 && self.shm_cpid == other.shm_cpid 795 && self.shm_nattch == other.shm_nattch 796 && self.shm_atime == other.shm_atime 797 && self.shm_dtime == other.shm_dtime 798 && self.shm_ctime == other.shm_ctime 799 && self.shm_internal == other.shm_internal 800 } 801 } 802 impl Eq for shmid_ds {} 803 impl ::fmt::Debug for shmid_ds { 804 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 805 let shm_perm = self.shm_perm; 806 let shm_segsz = self.shm_segsz; 807 let shm_lpid = self.shm_lpid; 808 let shm_cpid = self.shm_cpid; 809 let shm_nattch = self.shm_nattch; 810 let shm_atime = self.shm_atime; 811 let shm_dtime = self.shm_dtime; 812 let shm_ctime = self.shm_ctime; 813 let shm_internal = self.shm_internal; 814 f.debug_struct("shmid_ds") 815 .field("shm_perm", &shm_perm) 816 .field("shm_segsz", &shm_segsz) 817 .field("shm_lpid", &shm_lpid) 818 .field("shm_cpid", &shm_cpid) 819 .field("shm_nattch", &shm_nattch) 820 .field("shm_atime", &shm_atime) 821 .field("shm_dtime", &shm_dtime) 822 .field("shm_ctime", &shm_ctime) 823 .field("shm_internal", &shm_internal) 824 .finish() 825 } 826 } 827 impl ::hash::Hash for shmid_ds { 828 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 829 let shm_perm = self.shm_perm; 830 let shm_segsz = self.shm_segsz; 831 let shm_lpid = self.shm_lpid; 832 let shm_cpid = self.shm_cpid; 833 let shm_nattch = self.shm_nattch; 834 let shm_atime = self.shm_atime; 835 let shm_dtime = self.shm_dtime; 836 let shm_ctime = self.shm_ctime; 837 let shm_internal = self.shm_internal; 838 shm_perm.hash(state); 839 shm_segsz.hash(state); 840 shm_lpid.hash(state); 841 shm_cpid.hash(state); 842 shm_nattch.hash(state); 843 shm_atime.hash(state); 844 shm_dtime.hash(state); 845 shm_ctime.hash(state); 846 shm_internal.hash(state); 847 } 848 } 849 850 impl PartialEq for proc_threadinfo { 851 fn eq(&self, other: &proc_threadinfo) -> bool { 852 self.pth_user_time == other.pth_user_time 853 && self.pth_system_time == other.pth_system_time 854 && self.pth_cpu_usage == other.pth_cpu_usage 855 && self.pth_policy == other.pth_policy 856 && self.pth_run_state == other.pth_run_state 857 && self.pth_flags == other.pth_flags 858 && self.pth_sleep_time == other.pth_sleep_time 859 && self.pth_curpri == other.pth_curpri 860 && self.pth_priority == other.pth_priority 861 && self.pth_maxpriority == other.pth_maxpriority 862 && self.pth_name 863 .iter() 864 .zip(other.pth_name.iter()) 865 .all(|(a,b)| a == b) 866 } 867 } 868 impl Eq for proc_threadinfo {} 869 impl ::fmt::Debug for proc_threadinfo { 870 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 871 f.debug_struct("proc_threadinfo") 872 .field("pth_user_time", &self.pth_user_time) 873 .field("pth_system_time", &self.pth_system_time) 874 .field("pth_cpu_usage", &self.pth_cpu_usage) 875 .field("pth_policy", &self.pth_policy) 876 .field("pth_run_state", &self.pth_run_state) 877 .field("pth_flags", &self.pth_flags) 878 .field("pth_sleep_time", &self.pth_sleep_time) 879 .field("pth_curpri", &self.pth_curpri) 880 .field("pth_priority", &self.pth_priority) 881 .field("pth_maxpriority", &self.pth_maxpriority) 882 // FIXME: .field("pth_name", &self.pth_name) 883 .finish() 884 } 885 } 886 impl ::hash::Hash for proc_threadinfo { 887 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 888 self.pth_user_time.hash(state); 889 self.pth_system_time.hash(state); 890 self.pth_cpu_usage.hash(state); 891 self.pth_policy.hash(state); 892 self.pth_run_state.hash(state); 893 self.pth_flags.hash(state); 894 self.pth_sleep_time.hash(state); 895 self.pth_curpri.hash(state); 896 self.pth_priority.hash(state); 897 self.pth_maxpriority.hash(state); 898 self.pth_name.hash(state); 899 } 900 } 901 902 impl PartialEq for statfs { 903 fn eq(&self, other: &statfs) -> bool { 904 self.f_bsize == other.f_bsize 905 && self.f_iosize == other.f_iosize 906 && self.f_blocks == other.f_blocks 907 && self.f_bfree == other.f_bfree 908 && self.f_bavail == other.f_bavail 909 && self.f_files == other.f_files 910 && self.f_ffree == other.f_ffree 911 && self.f_fsid == other.f_fsid 912 && self.f_owner == other.f_owner 913 && self.f_flags == other.f_flags 914 && self.f_fssubtype == other.f_fssubtype 915 && self.f_fstypename == other.f_fstypename 916 && self.f_type == other.f_type 917 && self 918 .f_mntonname 919 .iter() 920 .zip(other.f_mntonname.iter()) 921 .all(|(a,b)| a == b) 922 && self 923 .f_mntfromname 924 .iter() 925 .zip(other.f_mntfromname.iter()) 926 .all(|(a,b)| a == b) 927 && self.f_reserved == other.f_reserved 928 } 929 } 930 931 impl Eq for statfs {} 932 impl ::fmt::Debug for statfs { 933 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 934 f.debug_struct("statfs") 935 .field("f_bsize", &self.f_bsize) 936 .field("f_iosize", &self.f_iosize) 937 .field("f_blocks", &self.f_blocks) 938 .field("f_bfree", &self.f_bfree) 939 .field("f_bavail", &self.f_bavail) 940 .field("f_files", &self.f_files) 941 .field("f_ffree", &self.f_ffree) 942 .field("f_fsid", &self.f_fsid) 943 .field("f_owner", &self.f_owner) 944 .field("f_flags", &self.f_flags) 945 .field("f_fssubtype", &self.f_fssubtype) 946 .field("f_fstypename", &self.f_fstypename) 947 .field("f_type", &self.f_type) 948 // FIXME: .field("f_mntonname", &self.f_mntonname) 949 // FIXME: .field("f_mntfromname", &self.f_mntfromname) 950 .field("f_reserved", &self.f_reserved) 951 .finish() 952 } 953 } 954 955 impl ::hash::Hash for statfs { 956 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 957 self.f_bsize.hash(state); 958 self.f_iosize.hash(state); 959 self.f_blocks.hash(state); 960 self.f_bfree.hash(state); 961 self.f_bavail.hash(state); 962 self.f_files.hash(state); 963 self.f_ffree.hash(state); 964 self.f_fsid.hash(state); 965 self.f_owner.hash(state); 966 self.f_flags.hash(state); 967 self.f_fssubtype.hash(state); 968 self.f_fstypename.hash(state); 969 self.f_type.hash(state); 970 self.f_mntonname.hash(state); 971 self.f_mntfromname.hash(state); 972 self.f_reserved.hash(state); 973 } 974 } 975 976 impl PartialEq for dirent { 977 fn eq(&self, other: &dirent) -> bool { 978 self.d_ino == other.d_ino 979 && self.d_seekoff == other.d_seekoff 980 && self.d_reclen == other.d_reclen 981 && self.d_namlen == other.d_namlen 982 && self.d_type == other.d_type 983 && self 984 .d_name 985 .iter() 986 .zip(other.d_name.iter()) 987 .all(|(a,b)| a == b) 988 } 989 } 990 impl Eq for dirent {} 991 impl ::fmt::Debug for dirent { 992 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 993 f.debug_struct("dirent") 994 .field("d_ino", &self.d_ino) 995 .field("d_seekoff", &self.d_seekoff) 996 .field("d_reclen", &self.d_reclen) 997 .field("d_namlen", &self.d_namlen) 998 .field("d_type", &self.d_type) 999 // FIXME: .field("d_name", &self.d_name) 1000 .finish() 1001 } 1002 } 1003 impl ::hash::Hash for dirent { 1004 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1005 self.d_ino.hash(state); 1006 self.d_seekoff.hash(state); 1007 self.d_reclen.hash(state); 1008 self.d_namlen.hash(state); 1009 self.d_type.hash(state); 1010 self.d_name.hash(state); 1011 } 1012 } 1013 impl PartialEq for pthread_rwlock_t { 1014 fn eq(&self, other: &pthread_rwlock_t) -> bool { 1015 self.__sig == other.__sig 1016 && self. 1017 __opaque 1018 .iter() 1019 .zip(other.__opaque.iter()) 1020 .all(|(a,b)| a == b) 1021 } 1022 } 1023 impl Eq for pthread_rwlock_t {} 1024 impl ::fmt::Debug for pthread_rwlock_t { 1025 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1026 f.debug_struct("pthread_rwlock_t") 1027 .field("__sig", &self.__sig) 1028 // FIXME: .field("__opaque", &self.__opaque) 1029 .finish() 1030 } 1031 } 1032 impl ::hash::Hash for pthread_rwlock_t { 1033 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1034 self.__sig.hash(state); 1035 self.__opaque.hash(state); 1036 } 1037 } 1038 1039 impl PartialEq for pthread_mutex_t { 1040 fn eq(&self, other: &pthread_mutex_t) -> bool { 1041 self.__sig == other.__sig 1042 && self. 1043 __opaque 1044 .iter() 1045 .zip(other.__opaque.iter()) 1046 .all(|(a,b)| a == b) 1047 } 1048 } 1049 1050 impl Eq for pthread_mutex_t {} 1051 1052 impl ::fmt::Debug for pthread_mutex_t { 1053 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1054 f.debug_struct("pthread_mutex_t") 1055 .field("__sig", &self.__sig) 1056 // FIXME: .field("__opaque", &self.__opaque) 1057 .finish() 1058 } 1059 } 1060 1061 impl ::hash::Hash for pthread_mutex_t { 1062 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1063 self.__sig.hash(state); 1064 self.__opaque.hash(state); 1065 } 1066 } 1067 1068 impl PartialEq for pthread_cond_t { 1069 fn eq(&self, other: &pthread_cond_t) -> bool { 1070 self.__sig == other.__sig 1071 && self. 1072 __opaque 1073 .iter() 1074 .zip(other.__opaque.iter()) 1075 .all(|(a,b)| a == b) 1076 } 1077 } 1078 1079 impl Eq for pthread_cond_t {} 1080 1081 impl ::fmt::Debug for pthread_cond_t { 1082 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1083 f.debug_struct("pthread_cond_t") 1084 .field("__sig", &self.__sig) 1085 // FIXME: .field("__opaque", &self.__opaque) 1086 .finish() 1087 } 1088 } 1089 1090 impl ::hash::Hash for pthread_cond_t { 1091 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1092 self.__sig.hash(state); 1093 self.__opaque.hash(state); 1094 } 1095 } 1096 1097 impl PartialEq for sockaddr_storage { 1098 fn eq(&self, other: &sockaddr_storage) -> bool { 1099 self.ss_len == other.ss_len 1100 && self.ss_family == other.ss_family 1101 && self 1102 .__ss_pad1 1103 .iter() 1104 .zip(other.__ss_pad1.iter()) 1105 .all(|(a, b)| a == b) 1106 && self.__ss_align == other.__ss_align 1107 && self 1108 .__ss_pad2 1109 .iter() 1110 .zip(other.__ss_pad2.iter()) 1111 .all(|(a, b)| a == b) 1112 } 1113 } 1114 1115 impl Eq for sockaddr_storage {} 1116 1117 impl ::fmt::Debug for sockaddr_storage { 1118 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1119 f.debug_struct("sockaddr_storage") 1120 .field("ss_len", &self.ss_len) 1121 .field("ss_family", &self.ss_family) 1122 .field("__ss_pad1", &self.__ss_pad1) 1123 .field("__ss_align", &self.__ss_align) 1124 // FIXME: .field("__ss_pad2", &self.__ss_pad2) 1125 .finish() 1126 } 1127 } 1128 1129 impl ::hash::Hash for sockaddr_storage { 1130 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1131 self.ss_len.hash(state); 1132 self.ss_family.hash(state); 1133 self.__ss_pad1.hash(state); 1134 self.__ss_align.hash(state); 1135 self.__ss_pad2.hash(state); 1136 } 1137 } 1138 1139 impl PartialEq for utmpx { 1140 fn eq(&self, other: &utmpx) -> bool { 1141 self.ut_user 1142 .iter() 1143 .zip(other.ut_user.iter()) 1144 .all(|(a,b)| a == b) 1145 && self.ut_id == other.ut_id 1146 && self.ut_line == other.ut_line 1147 && self.ut_pid == other.ut_pid 1148 && self.ut_type == other.ut_type 1149 && self.ut_tv == other.ut_tv 1150 && self 1151 .ut_host 1152 .iter() 1153 .zip(other.ut_host.iter()) 1154 .all(|(a,b)| a == b) 1155 && self.ut_pad == other.ut_pad 1156 } 1157 } 1158 1159 impl Eq for utmpx {} 1160 1161 impl ::fmt::Debug for utmpx { 1162 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1163 f.debug_struct("utmpx") 1164 // FIXME: .field("ut_user", &self.ut_user) 1165 .field("ut_id", &self.ut_id) 1166 .field("ut_line", &self.ut_line) 1167 .field("ut_pid", &self.ut_pid) 1168 .field("ut_type", &self.ut_type) 1169 .field("ut_tv", &self.ut_tv) 1170 // FIXME: .field("ut_host", &self.ut_host) 1171 .field("ut_pad", &self.ut_pad) 1172 .finish() 1173 } 1174 } 1175 1176 impl ::hash::Hash for utmpx { 1177 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1178 self.ut_user.hash(state); 1179 self.ut_id.hash(state); 1180 self.ut_line.hash(state); 1181 self.ut_pid.hash(state); 1182 self.ut_type.hash(state); 1183 self.ut_tv.hash(state); 1184 self.ut_host.hash(state); 1185 self.ut_pad.hash(state); 1186 } 1187 } 1188 1189 impl PartialEq for sigevent { 1190 fn eq(&self, other: &sigevent) -> bool { 1191 self.sigev_notify == other.sigev_notify 1192 && self.sigev_signo == other.sigev_signo 1193 && self.sigev_value == other.sigev_value 1194 && self.sigev_notify_attributes 1195 == other.sigev_notify_attributes 1196 } 1197 } 1198 1199 impl Eq for sigevent {} 1200 1201 impl ::fmt::Debug for sigevent { 1202 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1203 f.debug_struct("sigevent") 1204 .field("sigev_notify", &self.sigev_notify) 1205 .field("sigev_signo", &self.sigev_signo) 1206 .field("sigev_value", &self.sigev_value) 1207 .field("sigev_notify_attributes", 1208 &self.sigev_notify_attributes) 1209 .finish() 1210 } 1211 } 1212 1213 impl ::hash::Hash for sigevent { 1214 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1215 self.sigev_notify.hash(state); 1216 self.sigev_signo.hash(state); 1217 self.sigev_value.hash(state); 1218 self.sigev_notify_attributes.hash(state); 1219 } 1220 } 1221 } 1222 } 1223 1224 pub const _UTX_USERSIZE: usize = 256; 1225 pub const _UTX_LINESIZE: usize = 32; 1226 pub const _UTX_IDSIZE: usize = 4; 1227 pub const _UTX_HOSTSIZE: usize = 256; 1228 1229 pub const EMPTY: ::c_short = 0; 1230 pub const RUN_LVL: ::c_short = 1; 1231 pub const BOOT_TIME: ::c_short = 2; 1232 pub const OLD_TIME: ::c_short = 3; 1233 pub const NEW_TIME: ::c_short = 4; 1234 pub const INIT_PROCESS: ::c_short = 5; 1235 pub const LOGIN_PROCESS: ::c_short = 6; 1236 pub const USER_PROCESS: ::c_short = 7; 1237 pub const DEAD_PROCESS: ::c_short = 8; 1238 pub const ACCOUNTING: ::c_short = 9; 1239 pub const SIGNATURE: ::c_short = 10; 1240 pub const SHUTDOWN_TIME: ::c_short = 11; 1241 1242 pub const LC_COLLATE_MASK: ::c_int = (1 << 0); 1243 pub const LC_CTYPE_MASK: ::c_int = (1 << 1); 1244 pub const LC_MESSAGES_MASK: ::c_int = (1 << 2); 1245 pub const LC_MONETARY_MASK: ::c_int = (1 << 3); 1246 pub const LC_NUMERIC_MASK: ::c_int = (1 << 4); 1247 pub const LC_TIME_MASK: ::c_int = (1 << 5); 1248 pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK 1249 | LC_CTYPE_MASK 1250 | LC_MESSAGES_MASK 1251 | LC_MONETARY_MASK 1252 | LC_NUMERIC_MASK 1253 | LC_TIME_MASK; 1254 1255 pub const CODESET: ::nl_item = 0; 1256 pub const D_T_FMT: ::nl_item = 1; 1257 pub const D_FMT: ::nl_item = 2; 1258 pub const T_FMT: ::nl_item = 3; 1259 pub const T_FMT_AMPM: ::nl_item = 4; 1260 pub const AM_STR: ::nl_item = 5; 1261 pub const PM_STR: ::nl_item = 6; 1262 1263 pub const DAY_1: ::nl_item = 7; 1264 pub const DAY_2: ::nl_item = 8; 1265 pub const DAY_3: ::nl_item = 9; 1266 pub const DAY_4: ::nl_item = 10; 1267 pub const DAY_5: ::nl_item = 11; 1268 pub const DAY_6: ::nl_item = 12; 1269 pub const DAY_7: ::nl_item = 13; 1270 1271 pub const ABDAY_1: ::nl_item = 14; 1272 pub const ABDAY_2: ::nl_item = 15; 1273 pub const ABDAY_3: ::nl_item = 16; 1274 pub const ABDAY_4: ::nl_item = 17; 1275 pub const ABDAY_5: ::nl_item = 18; 1276 pub const ABDAY_6: ::nl_item = 19; 1277 pub const ABDAY_7: ::nl_item = 20; 1278 1279 pub const MON_1: ::nl_item = 21; 1280 pub const MON_2: ::nl_item = 22; 1281 pub const MON_3: ::nl_item = 23; 1282 pub const MON_4: ::nl_item = 24; 1283 pub const MON_5: ::nl_item = 25; 1284 pub const MON_6: ::nl_item = 26; 1285 pub const MON_7: ::nl_item = 27; 1286 pub const MON_8: ::nl_item = 28; 1287 pub const MON_9: ::nl_item = 29; 1288 pub const MON_10: ::nl_item = 30; 1289 pub const MON_11: ::nl_item = 31; 1290 pub const MON_12: ::nl_item = 32; 1291 1292 pub const ABMON_1: ::nl_item = 33; 1293 pub const ABMON_2: ::nl_item = 34; 1294 pub const ABMON_3: ::nl_item = 35; 1295 pub const ABMON_4: ::nl_item = 36; 1296 pub const ABMON_5: ::nl_item = 37; 1297 pub const ABMON_6: ::nl_item = 38; 1298 pub const ABMON_7: ::nl_item = 39; 1299 pub const ABMON_8: ::nl_item = 40; 1300 pub const ABMON_9: ::nl_item = 41; 1301 pub const ABMON_10: ::nl_item = 42; 1302 pub const ABMON_11: ::nl_item = 43; 1303 pub const ABMON_12: ::nl_item = 44; 1304 1305 pub const CLOCK_REALTIME: ::clockid_t = 0; 1306 pub const CLOCK_MONOTONIC: ::clockid_t = 6; 1307 pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 12; 1308 pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 16; 1309 1310 pub const ERA: ::nl_item = 45; 1311 pub const ERA_D_FMT: ::nl_item = 46; 1312 pub const ERA_D_T_FMT: ::nl_item = 47; 1313 pub const ERA_T_FMT: ::nl_item = 48; 1314 pub const ALT_DIGITS: ::nl_item = 49; 1315 1316 pub const RADIXCHAR: ::nl_item = 50; 1317 pub const THOUSEP: ::nl_item = 51; 1318 1319 pub const YESEXPR: ::nl_item = 52; 1320 pub const NOEXPR: ::nl_item = 53; 1321 1322 pub const YESSTR: ::nl_item = 54; 1323 pub const NOSTR: ::nl_item = 55; 1324 1325 pub const CRNCYSTR: ::nl_item = 56; 1326 1327 pub const D_MD_ORDER: ::nl_item = 57; 1328 1329 pub const EXIT_FAILURE: ::c_int = 1; 1330 pub const EXIT_SUCCESS: ::c_int = 0; 1331 pub const RAND_MAX: ::c_int = 2147483647; 1332 pub const EOF: ::c_int = -1; 1333 pub const SEEK_SET: ::c_int = 0; 1334 pub const SEEK_CUR: ::c_int = 1; 1335 pub const SEEK_END: ::c_int = 2; 1336 pub const _IOFBF: ::c_int = 0; 1337 pub const _IONBF: ::c_int = 2; 1338 pub const _IOLBF: ::c_int = 1; 1339 pub const BUFSIZ: ::c_uint = 1024; 1340 pub const FOPEN_MAX: ::c_uint = 20; 1341 pub const FILENAME_MAX: ::c_uint = 1024; 1342 pub const L_tmpnam: ::c_uint = 1024; 1343 pub const TMP_MAX: ::c_uint = 308915776; 1344 pub const _PC_LINK_MAX: ::c_int = 1; 1345 pub const _PC_MAX_CANON: ::c_int = 2; 1346 pub const _PC_MAX_INPUT: ::c_int = 3; 1347 pub const _PC_NAME_MAX: ::c_int = 4; 1348 pub const _PC_PATH_MAX: ::c_int = 5; 1349 pub const _PC_PIPE_BUF: ::c_int = 6; 1350 pub const _PC_CHOWN_RESTRICTED: ::c_int = 7; 1351 pub const _PC_NO_TRUNC: ::c_int = 8; 1352 pub const _PC_VDISABLE: ::c_int = 9; 1353 pub const O_DSYNC: ::c_int = 0x400000; 1354 pub const O_NOCTTY: ::c_int = 0x20000; 1355 pub const O_CLOEXEC: ::c_int = 0x1000000; 1356 pub const O_DIRECTORY: ::c_int = 0x100000; 1357 pub const S_IFIFO: mode_t = 4096; 1358 pub const S_IFCHR: mode_t = 8192; 1359 pub const S_IFBLK: mode_t = 24576; 1360 pub const S_IFDIR: mode_t = 16384; 1361 pub const S_IFREG: mode_t = 32768; 1362 pub const S_IFLNK: mode_t = 40960; 1363 pub const S_IFSOCK: mode_t = 49152; 1364 pub const S_IFMT: mode_t = 61440; 1365 pub const S_IEXEC: mode_t = 64; 1366 pub const S_IWRITE: mode_t = 128; 1367 pub const S_IREAD: mode_t = 256; 1368 pub const S_IRWXU: mode_t = 448; 1369 pub const S_IXUSR: mode_t = 64; 1370 pub const S_IWUSR: mode_t = 128; 1371 pub const S_IRUSR: mode_t = 256; 1372 pub const S_IRWXG: mode_t = 56; 1373 pub const S_IXGRP: mode_t = 8; 1374 pub const S_IWGRP: mode_t = 16; 1375 pub const S_IRGRP: mode_t = 32; 1376 pub const S_IRWXO: mode_t = 7; 1377 pub const S_IXOTH: mode_t = 1; 1378 pub const S_IWOTH: mode_t = 2; 1379 pub const S_IROTH: mode_t = 4; 1380 pub const F_OK: ::c_int = 0; 1381 pub const R_OK: ::c_int = 4; 1382 pub const W_OK: ::c_int = 2; 1383 pub const X_OK: ::c_int = 1; 1384 pub const STDIN_FILENO: ::c_int = 0; 1385 pub const STDOUT_FILENO: ::c_int = 1; 1386 pub const STDERR_FILENO: ::c_int = 2; 1387 pub const F_LOCK: ::c_int = 1; 1388 pub const F_TEST: ::c_int = 3; 1389 pub const F_TLOCK: ::c_int = 2; 1390 pub const F_ULOCK: ::c_int = 0; 1391 pub const F_GETLK: ::c_int = 7; 1392 pub const F_SETLK: ::c_int = 8; 1393 pub const F_SETLKW: ::c_int = 9; 1394 pub const SIGHUP: ::c_int = 1; 1395 pub const SIGINT: ::c_int = 2; 1396 pub const SIGQUIT: ::c_int = 3; 1397 pub const SIGILL: ::c_int = 4; 1398 pub const SIGABRT: ::c_int = 6; 1399 pub const SIGEMT: ::c_int = 7; 1400 pub const SIGFPE: ::c_int = 8; 1401 pub const SIGKILL: ::c_int = 9; 1402 pub const SIGSEGV: ::c_int = 11; 1403 pub const SIGPIPE: ::c_int = 13; 1404 pub const SIGALRM: ::c_int = 14; 1405 pub const SIGTERM: ::c_int = 15; 1406 1407 pub const PROT_NONE: ::c_int = 0; 1408 pub const PROT_READ: ::c_int = 1; 1409 pub const PROT_WRITE: ::c_int = 2; 1410 pub const PROT_EXEC: ::c_int = 4; 1411 1412 pub const PT_TRACE_ME: ::c_int = 0; 1413 pub const PT_READ_I: ::c_int = 1; 1414 pub const PT_READ_D: ::c_int = 2; 1415 pub const PT_READ_U: ::c_int = 3; 1416 pub const PT_WRITE_I: ::c_int = 4; 1417 pub const PT_WRITE_D: ::c_int = 5; 1418 pub const PT_WRITE_U: ::c_int = 6; 1419 pub const PT_CONTINUE: ::c_int = 7; 1420 pub const PT_KILL: ::c_int = 8; 1421 pub const PT_STEP: ::c_int = 9; 1422 pub const PT_ATTACH: ::c_int = 10; 1423 pub const PT_DETACH: ::c_int = 11; 1424 pub const PT_SIGEXC: ::c_int = 12; 1425 pub const PT_THUPDATE: ::c_int = 13; 1426 pub const PT_ATTACHEXC: ::c_int = 14; 1427 1428 pub const PT_FORCEQUOTA: ::c_int = 30; 1429 pub const PT_DENY_ATTACH: ::c_int = 31; 1430 pub const PT_FIRSTMACH: ::c_int = 32; 1431 1432 pub const MAP_FILE: ::c_int = 0x0000; 1433 pub const MAP_SHARED: ::c_int = 0x0001; 1434 pub const MAP_PRIVATE: ::c_int = 0x0002; 1435 pub const MAP_FIXED: ::c_int = 0x0010; 1436 pub const MAP_ANON: ::c_int = 0x1000; 1437 pub const MAP_ANONYMOUS: ::c_int = MAP_ANON; 1438 1439 deprecated_mach! { 1440 pub const VM_FLAGS_FIXED: ::c_int = 0x0000; 1441 pub const VM_FLAGS_ANYWHERE: ::c_int = 0x0001; 1442 pub const VM_FLAGS_PURGABLE: ::c_int = 0x0002; 1443 pub const VM_FLAGS_RANDOM_ADDR: ::c_int = 0x0008; 1444 pub const VM_FLAGS_NO_CACHE: ::c_int = 0x0010; 1445 pub const VM_FLAGS_RESILIENT_CODESIGN: ::c_int = 0x0020; 1446 pub const VM_FLAGS_RESILIENT_MEDIA: ::c_int = 0x0040; 1447 pub const VM_FLAGS_OVERWRITE: ::c_int = 0x4000; 1448 pub const VM_FLAGS_SUPERPAGE_MASK: ::c_int = 0x70000; 1449 pub const VM_FLAGS_RETURN_DATA_ADDR: ::c_int = 0x100000; 1450 pub const VM_FLAGS_RETURN_4K_DATA_ADDR: ::c_int = 0x800000; 1451 pub const VM_FLAGS_ALIAS_MASK: ::c_int = 0xFF000000; 1452 pub const VM_FLAGS_USER_ALLOCATE: ::c_int = 0xff07401f; 1453 pub const VM_FLAGS_USER_MAP: ::c_int = 0xff97401f; 1454 pub const VM_FLAGS_USER_REMAP: ::c_int = VM_FLAGS_FIXED | 1455 VM_FLAGS_ANYWHERE | 1456 VM_FLAGS_RANDOM_ADDR | 1457 VM_FLAGS_OVERWRITE | 1458 VM_FLAGS_RETURN_DATA_ADDR | 1459 VM_FLAGS_RESILIENT_CODESIGN; 1460 1461 pub const VM_FLAGS_SUPERPAGE_SHIFT: ::c_int = 16; 1462 pub const SUPERPAGE_NONE: ::c_int = 0; 1463 pub const SUPERPAGE_SIZE_ANY: ::c_int = 1; 1464 pub const VM_FLAGS_SUPERPAGE_NONE: ::c_int = SUPERPAGE_NONE << 1465 VM_FLAGS_SUPERPAGE_SHIFT; 1466 pub const VM_FLAGS_SUPERPAGE_SIZE_ANY: ::c_int = SUPERPAGE_SIZE_ANY << 1467 VM_FLAGS_SUPERPAGE_SHIFT; 1468 pub const SUPERPAGE_SIZE_2MB: ::c_int = 2; 1469 pub const VM_FLAGS_SUPERPAGE_SIZE_2MB: ::c_int = SUPERPAGE_SIZE_2MB << 1470 VM_FLAGS_SUPERPAGE_SHIFT; 1471 1472 pub const VM_MEMORY_MALLOC: ::c_int = 1; 1473 pub const VM_MEMORY_MALLOC_SMALL: ::c_int = 2; 1474 pub const VM_MEMORY_MALLOC_LARGE: ::c_int = 3; 1475 pub const VM_MEMORY_MALLOC_HUGE: ::c_int = 4; 1476 pub const VM_MEMORY_SBRK: ::c_int = 5; 1477 pub const VM_MEMORY_REALLOC: ::c_int = 6; 1478 pub const VM_MEMORY_MALLOC_TINY: ::c_int = 7; 1479 pub const VM_MEMORY_MALLOC_LARGE_REUSABLE: ::c_int = 8; 1480 pub const VM_MEMORY_MALLOC_LARGE_REUSED: ::c_int = 9; 1481 pub const VM_MEMORY_ANALYSIS_TOOL: ::c_int = 10; 1482 pub const VM_MEMORY_MALLOC_NANO: ::c_int = 11; 1483 pub const VM_MEMORY_MACH_MSG: ::c_int = 20; 1484 pub const VM_MEMORY_IOKIT: ::c_int = 21; 1485 pub const VM_MEMORY_STACK: ::c_int = 30; 1486 pub const VM_MEMORY_GUARD: ::c_int = 31; 1487 pub const VM_MEMORY_SHARED_PMAP: ::c_int = 32; 1488 pub const VM_MEMORY_DYLIB: ::c_int = 33; 1489 pub const VM_MEMORY_OBJC_DISPATCHERS: ::c_int = 34; 1490 pub const VM_MEMORY_UNSHARED_PMAP: ::c_int = 35; 1491 pub const VM_MEMORY_APPKIT: ::c_int = 40; 1492 pub const VM_MEMORY_FOUNDATION: ::c_int = 41; 1493 pub const VM_MEMORY_COREGRAPHICS: ::c_int = 42; 1494 pub const VM_MEMORY_CORESERVICES: ::c_int = 43; 1495 pub const VM_MEMORY_CARBON: ::c_int = VM_MEMORY_CORESERVICES; 1496 pub const VM_MEMORY_JAVA: ::c_int = 44; 1497 pub const VM_MEMORY_COREDATA: ::c_int = 45; 1498 pub const VM_MEMORY_COREDATA_OBJECTIDS: ::c_int = 46; 1499 pub const VM_MEMORY_ATS: ::c_int = 50; 1500 pub const VM_MEMORY_LAYERKIT: ::c_int = 51; 1501 pub const VM_MEMORY_CGIMAGE: ::c_int = 52; 1502 pub const VM_MEMORY_TCMALLOC: ::c_int = 53; 1503 pub const VM_MEMORY_COREGRAPHICS_DATA: ::c_int = 54; 1504 pub const VM_MEMORY_COREGRAPHICS_SHARED: ::c_int = 55; 1505 pub const VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS: ::c_int = 56; 1506 pub const VM_MEMORY_COREGRAPHICS_BACKINGSTORES: ::c_int = 57; 1507 pub const VM_MEMORY_COREGRAPHICS_XALLOC: ::c_int = 58; 1508 pub const VM_MEMORY_COREGRAPHICS_MISC: ::c_int = VM_MEMORY_COREGRAPHICS; 1509 pub const VM_MEMORY_DYLD: ::c_int = 60; 1510 pub const VM_MEMORY_DYLD_MALLOC: ::c_int = 61; 1511 pub const VM_MEMORY_SQLITE: ::c_int = 62; 1512 pub const VM_MEMORY_JAVASCRIPT_CORE: ::c_int = 63; 1513 pub const VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR: ::c_int = 64; 1514 pub const VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE: ::c_int = 65; 1515 pub const VM_MEMORY_GLSL: ::c_int = 66; 1516 pub const VM_MEMORY_OPENCL: ::c_int = 67; 1517 pub const VM_MEMORY_COREIMAGE: ::c_int = 68; 1518 pub const VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS: ::c_int = 69; 1519 pub const VM_MEMORY_IMAGEIO: ::c_int = 70; 1520 pub const VM_MEMORY_COREPROFILE: ::c_int = 71; 1521 pub const VM_MEMORY_ASSETSD: ::c_int = 72; 1522 pub const VM_MEMORY_OS_ALLOC_ONCE: ::c_int = 73; 1523 pub const VM_MEMORY_LIBDISPATCH: ::c_int = 74; 1524 pub const VM_MEMORY_ACCELERATE: ::c_int = 75; 1525 pub const VM_MEMORY_COREUI: ::c_int = 76; 1526 pub const VM_MEMORY_COREUIFILE: ::c_int = 77; 1527 pub const VM_MEMORY_GENEALOGY: ::c_int = 78; 1528 pub const VM_MEMORY_RAWCAMERA: ::c_int = 79; 1529 pub const VM_MEMORY_CORPSEINFO: ::c_int = 80; 1530 pub const VM_MEMORY_ASL: ::c_int = 81; 1531 pub const VM_MEMORY_SWIFT_RUNTIME: ::c_int = 82; 1532 pub const VM_MEMORY_SWIFT_METADATA: ::c_int = 83; 1533 pub const VM_MEMORY_DHMM: ::c_int = 84; 1534 pub const VM_MEMORY_SCENEKIT: ::c_int = 86; 1535 pub const VM_MEMORY_SKYWALK: ::c_int = 87; 1536 pub const VM_MEMORY_APPLICATION_SPECIFIC_1: ::c_int = 240; 1537 pub const VM_MEMORY_APPLICATION_SPECIFIC_16: ::c_int = 255; 1538 } 1539 1540 pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; 1541 1542 pub const MCL_CURRENT: ::c_int = 0x0001; 1543 pub const MCL_FUTURE: ::c_int = 0x0002; 1544 1545 pub const MS_ASYNC: ::c_int = 0x0001; 1546 pub const MS_INVALIDATE: ::c_int = 0x0002; 1547 pub const MS_SYNC: ::c_int = 0x0010; 1548 1549 pub const MS_KILLPAGES: ::c_int = 0x0004; 1550 pub const MS_DEACTIVATE: ::c_int = 0x0008; 1551 1552 pub const EPERM: ::c_int = 1; 1553 pub const ENOENT: ::c_int = 2; 1554 pub const ESRCH: ::c_int = 3; 1555 pub const EINTR: ::c_int = 4; 1556 pub const EIO: ::c_int = 5; 1557 pub const ENXIO: ::c_int = 6; 1558 pub const E2BIG: ::c_int = 7; 1559 pub const ENOEXEC: ::c_int = 8; 1560 pub const EBADF: ::c_int = 9; 1561 pub const ECHILD: ::c_int = 10; 1562 pub const EDEADLK: ::c_int = 11; 1563 pub const ENOMEM: ::c_int = 12; 1564 pub const EACCES: ::c_int = 13; 1565 pub const EFAULT: ::c_int = 14; 1566 pub const ENOTBLK: ::c_int = 15; 1567 pub const EBUSY: ::c_int = 16; 1568 pub const EEXIST: ::c_int = 17; 1569 pub const EXDEV: ::c_int = 18; 1570 pub const ENODEV: ::c_int = 19; 1571 pub const ENOTDIR: ::c_int = 20; 1572 pub const EISDIR: ::c_int = 21; 1573 pub const EINVAL: ::c_int = 22; 1574 pub const ENFILE: ::c_int = 23; 1575 pub const EMFILE: ::c_int = 24; 1576 pub const ENOTTY: ::c_int = 25; 1577 pub const ETXTBSY: ::c_int = 26; 1578 pub const EFBIG: ::c_int = 27; 1579 pub const ENOSPC: ::c_int = 28; 1580 pub const ESPIPE: ::c_int = 29; 1581 pub const EROFS: ::c_int = 30; 1582 pub const EMLINK: ::c_int = 31; 1583 pub const EPIPE: ::c_int = 32; 1584 pub const EDOM: ::c_int = 33; 1585 pub const ERANGE: ::c_int = 34; 1586 pub const EAGAIN: ::c_int = 35; 1587 pub const EWOULDBLOCK: ::c_int = EAGAIN; 1588 pub const EINPROGRESS: ::c_int = 36; 1589 pub const EALREADY: ::c_int = 37; 1590 pub const ENOTSOCK: ::c_int = 38; 1591 pub const EDESTADDRREQ: ::c_int = 39; 1592 pub const EMSGSIZE: ::c_int = 40; 1593 pub const EPROTOTYPE: ::c_int = 41; 1594 pub const ENOPROTOOPT: ::c_int = 42; 1595 pub const EPROTONOSUPPORT: ::c_int = 43; 1596 pub const ESOCKTNOSUPPORT: ::c_int = 44; 1597 pub const ENOTSUP: ::c_int = 45; 1598 pub const EPFNOSUPPORT: ::c_int = 46; 1599 pub const EAFNOSUPPORT: ::c_int = 47; 1600 pub const EADDRINUSE: ::c_int = 48; 1601 pub const EADDRNOTAVAIL: ::c_int = 49; 1602 pub const ENETDOWN: ::c_int = 50; 1603 pub const ENETUNREACH: ::c_int = 51; 1604 pub const ENETRESET: ::c_int = 52; 1605 pub const ECONNABORTED: ::c_int = 53; 1606 pub const ECONNRESET: ::c_int = 54; 1607 pub const ENOBUFS: ::c_int = 55; 1608 pub const EISCONN: ::c_int = 56; 1609 pub const ENOTCONN: ::c_int = 57; 1610 pub const ESHUTDOWN: ::c_int = 58; 1611 pub const ETOOMANYREFS: ::c_int = 59; 1612 pub const ETIMEDOUT: ::c_int = 60; 1613 pub const ECONNREFUSED: ::c_int = 61; 1614 pub const ELOOP: ::c_int = 62; 1615 pub const ENAMETOOLONG: ::c_int = 63; 1616 pub const EHOSTDOWN: ::c_int = 64; 1617 pub const EHOSTUNREACH: ::c_int = 65; 1618 pub const ENOTEMPTY: ::c_int = 66; 1619 pub const EPROCLIM: ::c_int = 67; 1620 pub const EUSERS: ::c_int = 68; 1621 pub const EDQUOT: ::c_int = 69; 1622 pub const ESTALE: ::c_int = 70; 1623 pub const EREMOTE: ::c_int = 71; 1624 pub const EBADRPC: ::c_int = 72; 1625 pub const ERPCMISMATCH: ::c_int = 73; 1626 pub const EPROGUNAVAIL: ::c_int = 74; 1627 pub const EPROGMISMATCH: ::c_int = 75; 1628 pub const EPROCUNAVAIL: ::c_int = 76; 1629 pub const ENOLCK: ::c_int = 77; 1630 pub const ENOSYS: ::c_int = 78; 1631 pub const EFTYPE: ::c_int = 79; 1632 pub const EAUTH: ::c_int = 80; 1633 pub const ENEEDAUTH: ::c_int = 81; 1634 pub const EPWROFF: ::c_int = 82; 1635 pub const EDEVERR: ::c_int = 83; 1636 pub const EOVERFLOW: ::c_int = 84; 1637 pub const EBADEXEC: ::c_int = 85; 1638 pub const EBADARCH: ::c_int = 86; 1639 pub const ESHLIBVERS: ::c_int = 87; 1640 pub const EBADMACHO: ::c_int = 88; 1641 pub const ECANCELED: ::c_int = 89; 1642 pub const EIDRM: ::c_int = 90; 1643 pub const ENOMSG: ::c_int = 91; 1644 pub const EILSEQ: ::c_int = 92; 1645 pub const ENOATTR: ::c_int = 93; 1646 pub const EBADMSG: ::c_int = 94; 1647 pub const EMULTIHOP: ::c_int = 95; 1648 pub const ENODATA: ::c_int = 96; 1649 pub const ENOLINK: ::c_int = 97; 1650 pub const ENOSR: ::c_int = 98; 1651 pub const ENOSTR: ::c_int = 99; 1652 pub const EPROTO: ::c_int = 100; 1653 pub const ETIME: ::c_int = 101; 1654 pub const EOPNOTSUPP: ::c_int = 102; 1655 pub const ENOPOLICY: ::c_int = 103; 1656 pub const ENOTRECOVERABLE: ::c_int = 104; 1657 pub const EOWNERDEAD: ::c_int = 105; 1658 pub const EQFULL: ::c_int = 106; 1659 pub const ELAST: ::c_int = 106; 1660 1661 pub const EAI_AGAIN: ::c_int = 2; 1662 pub const EAI_BADFLAGS: ::c_int = 3; 1663 pub const EAI_FAIL: ::c_int = 4; 1664 pub const EAI_FAMILY: ::c_int = 5; 1665 pub const EAI_MEMORY: ::c_int = 6; 1666 pub const EAI_NODATA: ::c_int = 7; 1667 pub const EAI_NONAME: ::c_int = 8; 1668 pub const EAI_SERVICE: ::c_int = 9; 1669 pub const EAI_SOCKTYPE: ::c_int = 10; 1670 pub const EAI_SYSTEM: ::c_int = 11; 1671 pub const EAI_OVERFLOW: ::c_int = 14; 1672 1673 pub const F_DUPFD: ::c_int = 0; 1674 pub const F_DUPFD_CLOEXEC: ::c_int = 67; 1675 pub const F_GETFD: ::c_int = 1; 1676 pub const F_SETFD: ::c_int = 2; 1677 pub const F_GETFL: ::c_int = 3; 1678 pub const F_SETFL: ::c_int = 4; 1679 pub const F_PREALLOCATE: ::c_int = 42; 1680 pub const F_RDADVISE: ::c_int = 44; 1681 pub const F_RDAHEAD: ::c_int = 45; 1682 pub const F_NOCACHE: ::c_int = 48; 1683 pub const F_GETPATH: ::c_int = 50; 1684 pub const F_FULLFSYNC: ::c_int = 51; 1685 pub const F_FREEZE_FS: ::c_int = 53; 1686 pub const F_THAW_FS: ::c_int = 54; 1687 pub const F_GLOBAL_NOCACHE: ::c_int = 55; 1688 pub const F_NODIRECT: ::c_int = 62; 1689 1690 pub const F_ALLOCATECONTIG: ::c_uint = 0x02; 1691 pub const F_ALLOCATEALL: ::c_uint = 0x04; 1692 1693 pub const F_PEOFPOSMODE: ::c_int = 3; 1694 pub const F_VOLPOSMODE: ::c_int = 4; 1695 1696 pub const AT_FDCWD: ::c_int = -2; 1697 pub const AT_EACCESS: ::c_int = 0x0010; 1698 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x0020; 1699 pub const AT_SYMLINK_FOLLOW: ::c_int = 0x0040; 1700 pub const AT_REMOVEDIR: ::c_int = 0x0080; 1701 1702 pub const TIOCMODG: ::c_ulong = 0x40047403; 1703 pub const TIOCMODS: ::c_ulong = 0x80047404; 1704 pub const TIOCM_LE: ::c_int = 0x1; 1705 pub const TIOCM_DTR: ::c_int = 0x2; 1706 pub const TIOCM_RTS: ::c_int = 0x4; 1707 pub const TIOCM_ST: ::c_int = 0x8; 1708 pub const TIOCM_SR: ::c_int = 0x10; 1709 pub const TIOCM_CTS: ::c_int = 0x20; 1710 pub const TIOCM_CAR: ::c_int = 0x40; 1711 pub const TIOCM_CD: ::c_int = 0x40; 1712 pub const TIOCM_RNG: ::c_int = 0x80; 1713 pub const TIOCM_RI: ::c_int = 0x80; 1714 pub const TIOCM_DSR: ::c_int = 0x100; 1715 pub const TIOCEXCL: ::c_int = 0x2000740d; 1716 pub const TIOCNXCL: ::c_int = 0x2000740e; 1717 pub const TIOCFLUSH: ::c_ulong = 0x80047410; 1718 pub const TIOCGETD: ::c_ulong = 0x4004741a; 1719 pub const TIOCSETD: ::c_ulong = 0x8004741b; 1720 pub const TIOCIXON: ::c_uint = 0x20007481; 1721 pub const TIOCIXOFF: ::c_uint = 0x20007480; 1722 pub const TIOCSBRK: ::c_uint = 0x2000747b; 1723 pub const TIOCCBRK: ::c_uint = 0x2000747a; 1724 pub const TIOCSDTR: ::c_uint = 0x20007479; 1725 pub const TIOCCDTR: ::c_uint = 0x20007478; 1726 pub const TIOCGPGRP: ::c_ulong = 0x40047477; 1727 pub const TIOCSPGRP: ::c_ulong = 0x80047476; 1728 pub const TIOCOUTQ: ::c_ulong = 0x40047473; 1729 pub const TIOCSTI: ::c_ulong = 0x80017472; 1730 pub const TIOCNOTTY: ::c_uint = 0x20007471; 1731 pub const TIOCPKT: ::c_ulong = 0x80047470; 1732 pub const TIOCPKT_DATA: ::c_int = 0x0; 1733 pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1; 1734 pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x2; 1735 pub const TIOCPKT_STOP: ::c_int = 0x4; 1736 pub const TIOCPKT_START: ::c_int = 0x8; 1737 pub const TIOCPKT_NOSTOP: ::c_int = 0x10; 1738 pub const TIOCPKT_DOSTOP: ::c_int = 0x20; 1739 pub const TIOCPKT_IOCTL: ::c_int = 0x40; 1740 pub const TIOCSTOP: ::c_uint = 0x2000746f; 1741 pub const TIOCSTART: ::c_uint = 0x2000746e; 1742 pub const TIOCMSET: ::c_ulong = 0x8004746d; 1743 pub const TIOCMBIS: ::c_ulong = 0x8004746c; 1744 pub const TIOCMBIC: ::c_ulong = 0x8004746b; 1745 pub const TIOCMGET: ::c_ulong = 0x4004746a; 1746 pub const TIOCREMOTE: ::c_ulong = 0x80047469; 1747 pub const TIOCGWINSZ: ::c_ulong = 0x40087468; 1748 pub const TIOCSWINSZ: ::c_ulong = 0x80087467; 1749 pub const TIOCUCNTL: ::c_ulong = 0x80047466; 1750 pub const TIOCSTAT: ::c_uint = 0x20007465; 1751 pub const TIOCSCONS: ::c_uint = 0x20007463; 1752 pub const TIOCCONS: ::c_ulong = 0x80047462; 1753 pub const TIOCSCTTY: ::c_uint = 0x20007461; 1754 pub const TIOCEXT: ::c_ulong = 0x80047460; 1755 pub const TIOCSIG: ::c_uint = 0x2000745f; 1756 pub const TIOCDRAIN: ::c_uint = 0x2000745e; 1757 pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b; 1758 pub const TIOCMGDTRWAIT: ::c_ulong = 0x4004745a; 1759 pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457; 1760 pub const TIOCGDRAINWAIT: ::c_ulong = 0x40047456; 1761 pub const TIOCDSIMICROCODE: ::c_uint = 0x20007455; 1762 pub const TIOCPTYGRANT: ::c_uint = 0x20007454; 1763 pub const TIOCPTYGNAME: ::c_uint = 0x40807453; 1764 pub const TIOCPTYUNLK: ::c_uint = 0x20007452; 1765 1766 pub const BIOCGRSIG: ::c_ulong = 0x40044272; 1767 pub const BIOCSRSIG: ::c_ulong = 0x80044273; 1768 pub const BIOCSDLT: ::c_ulong = 0x80044278; 1769 pub const BIOCGSEESENT: ::c_ulong = 0x40044276; 1770 pub const BIOCSSEESENT: ::c_ulong = 0x80044277; 1771 pub const BIOCGDLTLIST: ::c_ulong = 0xc00c4279; 1772 1773 pub const FIODTYPE: ::c_ulong = 0x4004667a; 1774 1775 pub const B0: speed_t = 0; 1776 pub const B50: speed_t = 50; 1777 pub const B75: speed_t = 75; 1778 pub const B110: speed_t = 110; 1779 pub const B134: speed_t = 134; 1780 pub const B150: speed_t = 150; 1781 pub const B200: speed_t = 200; 1782 pub const B300: speed_t = 300; 1783 pub const B600: speed_t = 600; 1784 pub const B1200: speed_t = 1200; 1785 pub const B1800: speed_t = 1800; 1786 pub const B2400: speed_t = 2400; 1787 pub const B4800: speed_t = 4800; 1788 pub const B9600: speed_t = 9600; 1789 pub const B19200: speed_t = 19200; 1790 pub const B38400: speed_t = 38400; 1791 pub const B7200: speed_t = 7200; 1792 pub const B14400: speed_t = 14400; 1793 pub const B28800: speed_t = 28800; 1794 pub const B57600: speed_t = 57600; 1795 pub const B76800: speed_t = 76800; 1796 pub const B115200: speed_t = 115200; 1797 pub const B230400: speed_t = 230400; 1798 pub const EXTA: speed_t = 19200; 1799 pub const EXTB: speed_t = 38400; 1800 1801 pub const SIGTRAP: ::c_int = 5; 1802 1803 pub const GLOB_APPEND: ::c_int = 0x0001; 1804 pub const GLOB_DOOFFS: ::c_int = 0x0002; 1805 pub const GLOB_ERR: ::c_int = 0x0004; 1806 pub const GLOB_MARK: ::c_int = 0x0008; 1807 pub const GLOB_NOCHECK: ::c_int = 0x0010; 1808 pub const GLOB_NOSORT: ::c_int = 0x0020; 1809 pub const GLOB_NOESCAPE: ::c_int = 0x2000; 1810 1811 pub const GLOB_NOSPACE: ::c_int = -1; 1812 pub const GLOB_ABORTED: ::c_int = -2; 1813 pub const GLOB_NOMATCH: ::c_int = -3; 1814 1815 pub const POSIX_MADV_NORMAL: ::c_int = 0; 1816 pub const POSIX_MADV_RANDOM: ::c_int = 1; 1817 pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; 1818 pub const POSIX_MADV_WILLNEED: ::c_int = 3; 1819 pub const POSIX_MADV_DONTNEED: ::c_int = 4; 1820 1821 pub const _SC_IOV_MAX: ::c_int = 56; 1822 pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 70; 1823 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 71; 1824 pub const _SC_LOGIN_NAME_MAX: ::c_int = 73; 1825 pub const _SC_MQ_PRIO_MAX: ::c_int = 75; 1826 pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 82; 1827 pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 83; 1828 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 85; 1829 pub const _SC_THREAD_KEYS_MAX: ::c_int = 86; 1830 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 87; 1831 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 88; 1832 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 89; 1833 pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 90; 1834 pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 91; 1835 pub const _SC_THREAD_STACK_MIN: ::c_int = 93; 1836 pub const _SC_THREAD_THREADS_MAX: ::c_int = 94; 1837 pub const _SC_THREADS: ::c_int = 96; 1838 pub const _SC_TTY_NAME_MAX: ::c_int = 101; 1839 pub const _SC_ATEXIT_MAX: ::c_int = 107; 1840 pub const _SC_XOPEN_CRYPT: ::c_int = 108; 1841 pub const _SC_XOPEN_ENH_I18N: ::c_int = 109; 1842 pub const _SC_XOPEN_LEGACY: ::c_int = 110; 1843 pub const _SC_XOPEN_REALTIME: ::c_int = 111; 1844 pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 112; 1845 pub const _SC_XOPEN_SHM: ::c_int = 113; 1846 pub const _SC_XOPEN_UNIX: ::c_int = 115; 1847 pub const _SC_XOPEN_VERSION: ::c_int = 116; 1848 pub const _SC_XOPEN_XCU_VERSION: ::c_int = 121; 1849 pub const _SC_PHYS_PAGES: ::c_int = 200; 1850 1851 pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 2; 1852 pub const PTHREAD_PROCESS_SHARED: ::c_int = 1; 1853 pub const PTHREAD_CREATE_JOINABLE: ::c_int = 1; 1854 pub const PTHREAD_CREATE_DETACHED: ::c_int = 2; 1855 pub const PTHREAD_STACK_MIN: ::size_t = 8192; 1856 1857 pub const RLIMIT_CPU: ::c_int = 0; 1858 pub const RLIMIT_FSIZE: ::c_int = 1; 1859 pub const RLIMIT_DATA: ::c_int = 2; 1860 pub const RLIMIT_STACK: ::c_int = 3; 1861 pub const RLIMIT_CORE: ::c_int = 4; 1862 pub const RLIMIT_AS: ::c_int = 5; 1863 pub const RLIMIT_RSS: ::c_int = RLIMIT_AS; 1864 pub const RLIMIT_MEMLOCK: ::c_int = 6; 1865 pub const RLIMIT_NPROC: ::c_int = 7; 1866 pub const RLIMIT_NOFILE: ::c_int = 8; 1867 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] 1868 pub const RLIM_NLIMITS: ::c_int = 9; 1869 pub const _RLIMIT_POSIX_FLAG: ::c_int = 0x1000; 1870 1871 pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff; 1872 1873 pub const RUSAGE_SELF: ::c_int = 0; 1874 pub const RUSAGE_CHILDREN: ::c_int = -1; 1875 1876 pub const MADV_NORMAL: ::c_int = 0; 1877 pub const MADV_RANDOM: ::c_int = 1; 1878 pub const MADV_SEQUENTIAL: ::c_int = 2; 1879 pub const MADV_WILLNEED: ::c_int = 3; 1880 pub const MADV_DONTNEED: ::c_int = 4; 1881 pub const MADV_FREE: ::c_int = 5; 1882 pub const MADV_ZERO_WIRED_PAGES: ::c_int = 6; 1883 pub const MADV_FREE_REUSABLE: ::c_int = 7; 1884 pub const MADV_FREE_REUSE: ::c_int = 8; 1885 pub const MADV_CAN_REUSE: ::c_int = 9; 1886 1887 pub const MINCORE_INCORE: ::c_int = 0x1; 1888 pub const MINCORE_REFERENCED: ::c_int = 0x2; 1889 pub const MINCORE_MODIFIED: ::c_int = 0x4; 1890 pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8; 1891 pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10; 1892 1893 // 1894 // sys/netinet/in.h 1895 // Protocols (RFC 1700) 1896 // NOTE: These are in addition to the constants defined in src/unix/mod.rs 1897 1898 // IPPROTO_IP defined in src/unix/mod.rs 1899 /// IP6 hop-by-hop options 1900 pub const IPPROTO_HOPOPTS: ::c_int = 0; 1901 // IPPROTO_ICMP defined in src/unix/mod.rs 1902 /// group mgmt protocol 1903 pub const IPPROTO_IGMP: ::c_int = 2; 1904 /// gateway<sup>2</sup> (deprecated) 1905 pub const IPPROTO_GGP: ::c_int = 3; 1906 /// for compatibility 1907 pub const IPPROTO_IPIP: ::c_int = 4; 1908 // IPPROTO_TCP defined in src/unix/mod.rs 1909 /// Stream protocol II. 1910 pub const IPPROTO_ST: ::c_int = 7; 1911 /// exterior gateway protocol 1912 pub const IPPROTO_EGP: ::c_int = 8; 1913 /// private interior gateway 1914 pub const IPPROTO_PIGP: ::c_int = 9; 1915 /// BBN RCC Monitoring 1916 pub const IPPROTO_RCCMON: ::c_int = 10; 1917 /// network voice protocol 1918 pub const IPPROTO_NVPII: ::c_int = 11; 1919 /// pup 1920 pub const IPPROTO_PUP: ::c_int = 12; 1921 /// Argus 1922 pub const IPPROTO_ARGUS: ::c_int = 13; 1923 /// EMCON 1924 pub const IPPROTO_EMCON: ::c_int = 14; 1925 /// Cross Net Debugger 1926 pub const IPPROTO_XNET: ::c_int = 15; 1927 /// Chaos 1928 pub const IPPROTO_CHAOS: ::c_int = 16; 1929 // IPPROTO_UDP defined in src/unix/mod.rs 1930 /// Multiplexing 1931 pub const IPPROTO_MUX: ::c_int = 18; 1932 /// DCN Measurement Subsystems 1933 pub const IPPROTO_MEAS: ::c_int = 19; 1934 /// Host Monitoring 1935 pub const IPPROTO_HMP: ::c_int = 20; 1936 /// Packet Radio Measurement 1937 pub const IPPROTO_PRM: ::c_int = 21; 1938 /// xns idp 1939 pub const IPPROTO_IDP: ::c_int = 22; 1940 /// Trunk-1 1941 pub const IPPROTO_TRUNK1: ::c_int = 23; 1942 /// Trunk-2 1943 pub const IPPROTO_TRUNK2: ::c_int = 24; 1944 /// Leaf-1 1945 pub const IPPROTO_LEAF1: ::c_int = 25; 1946 /// Leaf-2 1947 pub const IPPROTO_LEAF2: ::c_int = 26; 1948 /// Reliable Data 1949 pub const IPPROTO_RDP: ::c_int = 27; 1950 /// Reliable Transaction 1951 pub const IPPROTO_IRTP: ::c_int = 28; 1952 /// tp-4 w/ class negotiation 1953 pub const IPPROTO_TP: ::c_int = 29; 1954 /// Bulk Data Transfer 1955 pub const IPPROTO_BLT: ::c_int = 30; 1956 /// Network Services 1957 pub const IPPROTO_NSP: ::c_int = 31; 1958 /// Merit Internodal 1959 pub const IPPROTO_INP: ::c_int = 32; 1960 /// Sequential Exchange 1961 pub const IPPROTO_SEP: ::c_int = 33; 1962 /// Third Party Connect 1963 pub const IPPROTO_3PC: ::c_int = 34; 1964 /// InterDomain Policy Routing 1965 pub const IPPROTO_IDPR: ::c_int = 35; 1966 /// XTP 1967 pub const IPPROTO_XTP: ::c_int = 36; 1968 /// Datagram Delivery 1969 pub const IPPROTO_DDP: ::c_int = 37; 1970 /// Control Message Transport 1971 pub const IPPROTO_CMTP: ::c_int = 38; 1972 /// TP++ Transport 1973 pub const IPPROTO_TPXX: ::c_int = 39; 1974 /// IL transport protocol 1975 pub const IPPROTO_IL: ::c_int = 40; 1976 // IPPROTO_IPV6 defined in src/unix/mod.rs 1977 /// Source Demand Routing 1978 pub const IPPROTO_SDRP: ::c_int = 42; 1979 /// IP6 routing header 1980 pub const IPPROTO_ROUTING: ::c_int = 43; 1981 /// IP6 fragmentation header 1982 pub const IPPROTO_FRAGMENT: ::c_int = 44; 1983 /// InterDomain Routing 1984 pub const IPPROTO_IDRP: ::c_int = 45; 1985 /// resource reservation 1986 pub const IPPROTO_RSVP: ::c_int = 46; 1987 /// General Routing Encap. 1988 pub const IPPROTO_GRE: ::c_int = 47; 1989 /// Mobile Host Routing 1990 pub const IPPROTO_MHRP: ::c_int = 48; 1991 /// BHA 1992 pub const IPPROTO_BHA: ::c_int = 49; 1993 /// IP6 Encap Sec. Payload 1994 pub const IPPROTO_ESP: ::c_int = 50; 1995 /// IP6 Auth Header 1996 pub const IPPROTO_AH: ::c_int = 51; 1997 /// Integ. Net Layer Security 1998 pub const IPPROTO_INLSP: ::c_int = 52; 1999 /// IP with encryption 2000 pub const IPPROTO_SWIPE: ::c_int = 53; 2001 /// Next Hop Resolution 2002 pub const IPPROTO_NHRP: ::c_int = 54; 2003 /* 55-57: Unassigned */ 2004 // IPPROTO_ICMPV6 defined in src/unix/mod.rs 2005 /// IP6 no next header 2006 pub const IPPROTO_NONE: ::c_int = 59; 2007 /// IP6 destination option 2008 pub const IPPROTO_DSTOPTS: ::c_int = 60; 2009 /// any host internal protocol 2010 pub const IPPROTO_AHIP: ::c_int = 61; 2011 /// CFTP 2012 pub const IPPROTO_CFTP: ::c_int = 62; 2013 /// "hello" routing protocol 2014 pub const IPPROTO_HELLO: ::c_int = 63; 2015 /// SATNET/Backroom EXPAK 2016 pub const IPPROTO_SATEXPAK: ::c_int = 64; 2017 /// Kryptolan 2018 pub const IPPROTO_KRYPTOLAN: ::c_int = 65; 2019 /// Remote Virtual Disk 2020 pub const IPPROTO_RVD: ::c_int = 66; 2021 /// Pluribus Packet Core 2022 pub const IPPROTO_IPPC: ::c_int = 67; 2023 /// Any distributed FS 2024 pub const IPPROTO_ADFS: ::c_int = 68; 2025 /// Satnet Monitoring 2026 pub const IPPROTO_SATMON: ::c_int = 69; 2027 /// VISA Protocol 2028 pub const IPPROTO_VISA: ::c_int = 70; 2029 /// Packet Core Utility 2030 pub const IPPROTO_IPCV: ::c_int = 71; 2031 /// Comp. Prot. Net. Executive 2032 pub const IPPROTO_CPNX: ::c_int = 72; 2033 /// Comp. Prot. HeartBeat 2034 pub const IPPROTO_CPHB: ::c_int = 73; 2035 /// Wang Span Network 2036 pub const IPPROTO_WSN: ::c_int = 74; 2037 /// Packet Video Protocol 2038 pub const IPPROTO_PVP: ::c_int = 75; 2039 /// BackRoom SATNET Monitoring 2040 pub const IPPROTO_BRSATMON: ::c_int = 76; 2041 /// Sun net disk proto (temp.) 2042 pub const IPPROTO_ND: ::c_int = 77; 2043 /// WIDEBAND Monitoring 2044 pub const IPPROTO_WBMON: ::c_int = 78; 2045 /// WIDEBAND EXPAK 2046 pub const IPPROTO_WBEXPAK: ::c_int = 79; 2047 /// ISO cnlp 2048 pub const IPPROTO_EON: ::c_int = 80; 2049 /// VMTP 2050 pub const IPPROTO_VMTP: ::c_int = 81; 2051 /// Secure VMTP 2052 pub const IPPROTO_SVMTP: ::c_int = 82; 2053 /// Banyon VINES 2054 pub const IPPROTO_VINES: ::c_int = 83; 2055 /// TTP 2056 pub const IPPROTO_TTP: ::c_int = 84; 2057 /// NSFNET-IGP 2058 pub const IPPROTO_IGP: ::c_int = 85; 2059 /// dissimilar gateway prot. 2060 pub const IPPROTO_DGP: ::c_int = 86; 2061 /// TCF 2062 pub const IPPROTO_TCF: ::c_int = 87; 2063 /// Cisco/GXS IGRP 2064 pub const IPPROTO_IGRP: ::c_int = 88; 2065 /// OSPFIGP 2066 pub const IPPROTO_OSPFIGP: ::c_int = 89; 2067 /// Strite RPC protocol 2068 pub const IPPROTO_SRPC: ::c_int = 90; 2069 /// Locus Address Resoloution 2070 pub const IPPROTO_LARP: ::c_int = 91; 2071 /// Multicast Transport 2072 pub const IPPROTO_MTP: ::c_int = 92; 2073 /// AX.25 Frames 2074 pub const IPPROTO_AX25: ::c_int = 93; 2075 /// IP encapsulated in IP 2076 pub const IPPROTO_IPEIP: ::c_int = 94; 2077 /// Mobile Int.ing control 2078 pub const IPPROTO_MICP: ::c_int = 95; 2079 /// Semaphore Comm. security 2080 pub const IPPROTO_SCCSP: ::c_int = 96; 2081 /// Ethernet IP encapsulation 2082 pub const IPPROTO_ETHERIP: ::c_int = 97; 2083 /// encapsulation header 2084 pub const IPPROTO_ENCAP: ::c_int = 98; 2085 /// any private encr. scheme 2086 pub const IPPROTO_APES: ::c_int = 99; 2087 /// GMTP 2088 pub const IPPROTO_GMTP: ::c_int = 100; 2089 2090 /* 101-254: Partly Unassigned */ 2091 /// Protocol Independent Mcast 2092 pub const IPPROTO_PIM: ::c_int = 103; 2093 /// payload compression (IPComp) 2094 pub const IPPROTO_IPCOMP: ::c_int = 108; 2095 /// PGM 2096 pub const IPPROTO_PGM: ::c_int = 113; 2097 /// SCTP 2098 pub const IPPROTO_SCTP: ::c_int = 132; 2099 2100 /* 255: Reserved */ 2101 /* BSD Private, local use, namespace incursion */ 2102 /// divert pseudo-protocol 2103 pub const IPPROTO_DIVERT: ::c_int = 254; 2104 /// raw IP packet 2105 pub const IPPROTO_RAW: ::c_int = 255; 2106 pub const IPPROTO_MAX: ::c_int = 256; 2107 /// last return value of *_input(), meaning "all job for this pkt is done". 2108 pub const IPPROTO_DONE: ::c_int = 257; 2109 2110 pub const AF_UNSPEC: ::c_int = 0; 2111 pub const AF_LOCAL: ::c_int = 1; 2112 pub const AF_UNIX: ::c_int = AF_LOCAL; 2113 pub const AF_INET: ::c_int = 2; 2114 pub const AF_IMPLINK: ::c_int = 3; 2115 pub const AF_PUP: ::c_int = 4; 2116 pub const AF_CHAOS: ::c_int = 5; 2117 pub const AF_NS: ::c_int = 6; 2118 pub const AF_ISO: ::c_int = 7; 2119 pub const AF_OSI: ::c_int = AF_ISO; 2120 pub const AF_ECMA: ::c_int = 8; 2121 pub const AF_DATAKIT: ::c_int = 9; 2122 pub const AF_CCITT: ::c_int = 10; 2123 pub const AF_SNA: ::c_int = 11; 2124 pub const AF_DECnet: ::c_int = 12; 2125 pub const AF_DLI: ::c_int = 13; 2126 pub const AF_LAT: ::c_int = 14; 2127 pub const AF_HYLINK: ::c_int = 15; 2128 pub const AF_APPLETALK: ::c_int = 16; 2129 pub const AF_ROUTE: ::c_int = 17; 2130 pub const AF_LINK: ::c_int = 18; 2131 pub const pseudo_AF_XTP: ::c_int = 19; 2132 pub const AF_COIP: ::c_int = 20; 2133 pub const AF_CNT: ::c_int = 21; 2134 pub const pseudo_AF_RTIP: ::c_int = 22; 2135 pub const AF_IPX: ::c_int = 23; 2136 pub const AF_SIP: ::c_int = 24; 2137 pub const pseudo_AF_PIP: ::c_int = 25; 2138 pub const AF_ISDN: ::c_int = 28; 2139 pub const AF_E164: ::c_int = AF_ISDN; 2140 pub const pseudo_AF_KEY: ::c_int = 29; 2141 pub const AF_INET6: ::c_int = 30; 2142 pub const AF_NATM: ::c_int = 31; 2143 pub const AF_SYSTEM: ::c_int = 32; 2144 pub const AF_NETBIOS: ::c_int = 33; 2145 pub const AF_PPP: ::c_int = 34; 2146 pub const pseudo_AF_HDRCMPLT: ::c_int = 35; 2147 pub const AF_SYS_CONTROL: ::c_int = 2; 2148 2149 pub const SYSPROTO_EVENT: ::c_int = 1; 2150 pub const SYSPROTO_CONTROL: ::c_int = 2; 2151 2152 pub const PF_UNSPEC: ::c_int = AF_UNSPEC; 2153 pub const PF_LOCAL: ::c_int = AF_LOCAL; 2154 pub const PF_UNIX: ::c_int = PF_LOCAL; 2155 pub const PF_INET: ::c_int = AF_INET; 2156 pub const PF_IMPLINK: ::c_int = AF_IMPLINK; 2157 pub const PF_PUP: ::c_int = AF_PUP; 2158 pub const PF_CHAOS: ::c_int = AF_CHAOS; 2159 pub const PF_NS: ::c_int = AF_NS; 2160 pub const PF_ISO: ::c_int = AF_ISO; 2161 pub const PF_OSI: ::c_int = AF_ISO; 2162 pub const PF_ECMA: ::c_int = AF_ECMA; 2163 pub const PF_DATAKIT: ::c_int = AF_DATAKIT; 2164 pub const PF_CCITT: ::c_int = AF_CCITT; 2165 pub const PF_SNA: ::c_int = AF_SNA; 2166 pub const PF_DECnet: ::c_int = AF_DECnet; 2167 pub const PF_DLI: ::c_int = AF_DLI; 2168 pub const PF_LAT: ::c_int = AF_LAT; 2169 pub const PF_HYLINK: ::c_int = AF_HYLINK; 2170 pub const PF_APPLETALK: ::c_int = AF_APPLETALK; 2171 pub const PF_ROUTE: ::c_int = AF_ROUTE; 2172 pub const PF_LINK: ::c_int = AF_LINK; 2173 pub const PF_XTP: ::c_int = pseudo_AF_XTP; 2174 pub const PF_COIP: ::c_int = AF_COIP; 2175 pub const PF_CNT: ::c_int = AF_CNT; 2176 pub const PF_SIP: ::c_int = AF_SIP; 2177 pub const PF_IPX: ::c_int = AF_IPX; 2178 pub const PF_RTIP: ::c_int = pseudo_AF_RTIP; 2179 pub const PF_PIP: ::c_int = pseudo_AF_PIP; 2180 pub const PF_ISDN: ::c_int = AF_ISDN; 2181 pub const PF_KEY: ::c_int = pseudo_AF_KEY; 2182 pub const PF_INET6: ::c_int = AF_INET6; 2183 pub const PF_NATM: ::c_int = AF_NATM; 2184 pub const PF_SYSTEM: ::c_int = AF_SYSTEM; 2185 pub const PF_NETBIOS: ::c_int = AF_NETBIOS; 2186 pub const PF_PPP: ::c_int = AF_PPP; 2187 2188 pub const NET_RT_DUMP: ::c_int = 1; 2189 pub const NET_RT_FLAGS: ::c_int = 2; 2190 pub const NET_RT_IFLIST: ::c_int = 3; 2191 2192 pub const SOMAXCONN: ::c_int = 128; 2193 2194 pub const SOCK_MAXADDRLEN: ::c_int = 255; 2195 2196 pub const SOCK_STREAM: ::c_int = 1; 2197 pub const SOCK_DGRAM: ::c_int = 2; 2198 pub const SOCK_RAW: ::c_int = 3; 2199 pub const SOCK_RDM: ::c_int = 4; 2200 pub const SOCK_SEQPACKET: ::c_int = 5; 2201 pub const IP_TTL: ::c_int = 4; 2202 pub const IP_HDRINCL: ::c_int = 2; 2203 pub const IP_RECVDSTADDR: ::c_int = 7; 2204 pub const IP_ADD_MEMBERSHIP: ::c_int = 12; 2205 pub const IP_DROP_MEMBERSHIP: ::c_int = 13; 2206 pub const IP_RECVIF: ::c_int = 20; 2207 pub const IP_PKTINFO: ::c_int = 26; 2208 pub const IP_RECVTOS: ::c_int = 27; 2209 pub const IPV6_JOIN_GROUP: ::c_int = 12; 2210 pub const IPV6_LEAVE_GROUP: ::c_int = 13; 2211 pub const IPV6_RECVTCLASS: ::c_int = 35; 2212 pub const IPV6_TCLASS: ::c_int = 36; 2213 pub const IPV6_PKTINFO: ::c_int = 46; 2214 pub const IPV6_RECVPKTINFO: ::c_int = 61; 2215 2216 pub const TCP_NOPUSH: ::c_int = 4; 2217 pub const TCP_NOOPT: ::c_int = 8; 2218 pub const TCP_KEEPALIVE: ::c_int = 0x10; 2219 2220 pub const SOL_LOCAL: ::c_int = 0; 2221 2222 pub const LOCAL_PEERCRED: ::c_int = 0x001; 2223 pub const LOCAL_PEERPID: ::c_int = 0x002; 2224 pub const LOCAL_PEEREPID: ::c_int = 0x003; 2225 pub const LOCAL_PEERUUID: ::c_int = 0x004; 2226 pub const LOCAL_PEEREUUID: ::c_int = 0x005; 2227 2228 pub const SOL_SOCKET: ::c_int = 0xffff; 2229 2230 pub const SO_DEBUG: ::c_int = 0x01; 2231 pub const SO_ACCEPTCONN: ::c_int = 0x0002; 2232 pub const SO_REUSEADDR: ::c_int = 0x0004; 2233 pub const SO_KEEPALIVE: ::c_int = 0x0008; 2234 pub const SO_DONTROUTE: ::c_int = 0x0010; 2235 pub const SO_BROADCAST: ::c_int = 0x0020; 2236 pub const SO_USELOOPBACK: ::c_int = 0x0040; 2237 pub const SO_LINGER: ::c_int = 0x0080; 2238 pub const SO_OOBINLINE: ::c_int = 0x0100; 2239 pub const SO_REUSEPORT: ::c_int = 0x0200; 2240 pub const SO_TIMESTAMP: ::c_int = 0x0400; 2241 pub const SO_TIMESTAMP_MONOTONIC: ::c_int = 0x0800; 2242 pub const SO_DONTTRUNC: ::c_int = 0x2000; 2243 pub const SO_WANTMORE: ::c_int = 0x4000; 2244 pub const SO_WANTOOBFLAG: ::c_int = 0x8000; 2245 pub const SO_SNDBUF: ::c_int = 0x1001; 2246 pub const SO_RCVBUF: ::c_int = 0x1002; 2247 pub const SO_SNDLOWAT: ::c_int = 0x1003; 2248 pub const SO_RCVLOWAT: ::c_int = 0x1004; 2249 pub const SO_SNDTIMEO: ::c_int = 0x1005; 2250 pub const SO_RCVTIMEO: ::c_int = 0x1006; 2251 pub const SO_ERROR: ::c_int = 0x1007; 2252 pub const SO_TYPE: ::c_int = 0x1008; 2253 pub const SO_LABEL: ::c_int = 0x1010; 2254 pub const SO_PEERLABEL: ::c_int = 0x1011; 2255 pub const SO_NREAD: ::c_int = 0x1020; 2256 pub const SO_NKE: ::c_int = 0x1021; 2257 pub const SO_NOSIGPIPE: ::c_int = 0x1022; 2258 pub const SO_NOADDRERR: ::c_int = 0x1023; 2259 pub const SO_NWRITE: ::c_int = 0x1024; 2260 pub const SO_REUSESHAREUID: ::c_int = 0x1025; 2261 pub const SO_NOTIFYCONFLICT: ::c_int = 0x1026; 2262 pub const SO_RANDOMPORT: ::c_int = 0x1082; 2263 pub const SO_NP_EXTENSIONS: ::c_int = 0x1083; 2264 2265 pub const MSG_OOB: ::c_int = 0x1; 2266 pub const MSG_PEEK: ::c_int = 0x2; 2267 pub const MSG_DONTROUTE: ::c_int = 0x4; 2268 pub const MSG_EOR: ::c_int = 0x8; 2269 pub const MSG_TRUNC: ::c_int = 0x10; 2270 pub const MSG_CTRUNC: ::c_int = 0x20; 2271 pub const MSG_WAITALL: ::c_int = 0x40; 2272 pub const MSG_DONTWAIT: ::c_int = 0x80; 2273 pub const MSG_EOF: ::c_int = 0x100; 2274 pub const MSG_FLUSH: ::c_int = 0x400; 2275 pub const MSG_HOLD: ::c_int = 0x800; 2276 pub const MSG_SEND: ::c_int = 0x1000; 2277 pub const MSG_HAVEMORE: ::c_int = 0x2000; 2278 pub const MSG_RCVMORE: ::c_int = 0x4000; 2279 // pub const MSG_COMPAT: ::c_int = 0x8000; 2280 2281 pub const SCM_TIMESTAMP: ::c_int = 0x02; 2282 pub const SCM_CREDS: ::c_int = 0x03; 2283 2284 // https://github.com/aosm/xnu/blob/master/bsd/net/if.h#L140-L156 2285 pub const IFF_UP: ::c_int = 0x1; // interface is up 2286 pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid 2287 pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging 2288 pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net 2289 pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link 2290 pub const IFF_NOTRAILERS: ::c_int = 0x20; // obsolete: avoid use of trailers 2291 pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated 2292 pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol 2293 pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets 2294 pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets 2295 pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress 2296 pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions 2297 pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit 2298 pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit 2299 pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit 2300 pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection 2301 pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast 2302 2303 pub const SHUT_RD: ::c_int = 0; 2304 pub const SHUT_WR: ::c_int = 1; 2305 pub const SHUT_RDWR: ::c_int = 2; 2306 2307 pub const LOCK_SH: ::c_int = 1; 2308 pub const LOCK_EX: ::c_int = 2; 2309 pub const LOCK_NB: ::c_int = 4; 2310 pub const LOCK_UN: ::c_int = 8; 2311 2312 pub const MAP_COPY: ::c_int = 0x0002; 2313 pub const MAP_RENAME: ::c_int = 0x0020; 2314 pub const MAP_NORESERVE: ::c_int = 0x0040; 2315 pub const MAP_NOEXTEND: ::c_int = 0x0100; 2316 pub const MAP_HASSEMAPHORE: ::c_int = 0x0200; 2317 pub const MAP_NOCACHE: ::c_int = 0x0400; 2318 pub const MAP_JIT: ::c_int = 0x0800; 2319 2320 pub const _SC_ARG_MAX: ::c_int = 1; 2321 pub const _SC_CHILD_MAX: ::c_int = 2; 2322 pub const _SC_CLK_TCK: ::c_int = 3; 2323 pub const _SC_NGROUPS_MAX: ::c_int = 4; 2324 pub const _SC_OPEN_MAX: ::c_int = 5; 2325 pub const _SC_JOB_CONTROL: ::c_int = 6; 2326 pub const _SC_SAVED_IDS: ::c_int = 7; 2327 pub const _SC_VERSION: ::c_int = 8; 2328 pub const _SC_BC_BASE_MAX: ::c_int = 9; 2329 pub const _SC_BC_DIM_MAX: ::c_int = 10; 2330 pub const _SC_BC_SCALE_MAX: ::c_int = 11; 2331 pub const _SC_BC_STRING_MAX: ::c_int = 12; 2332 pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13; 2333 pub const _SC_EXPR_NEST_MAX: ::c_int = 14; 2334 pub const _SC_LINE_MAX: ::c_int = 15; 2335 pub const _SC_RE_DUP_MAX: ::c_int = 16; 2336 pub const _SC_2_VERSION: ::c_int = 17; 2337 pub const _SC_2_C_BIND: ::c_int = 18; 2338 pub const _SC_2_C_DEV: ::c_int = 19; 2339 pub const _SC_2_CHAR_TERM: ::c_int = 20; 2340 pub const _SC_2_FORT_DEV: ::c_int = 21; 2341 pub const _SC_2_FORT_RUN: ::c_int = 22; 2342 pub const _SC_2_LOCALEDEF: ::c_int = 23; 2343 pub const _SC_2_SW_DEV: ::c_int = 24; 2344 pub const _SC_2_UPE: ::c_int = 25; 2345 pub const _SC_STREAM_MAX: ::c_int = 26; 2346 pub const _SC_TZNAME_MAX: ::c_int = 27; 2347 pub const _SC_ASYNCHRONOUS_IO: ::c_int = 28; 2348 pub const _SC_PAGESIZE: ::c_int = 29; 2349 pub const _SC_MEMLOCK: ::c_int = 30; 2350 pub const _SC_MEMLOCK_RANGE: ::c_int = 31; 2351 pub const _SC_MEMORY_PROTECTION: ::c_int = 32; 2352 pub const _SC_MESSAGE_PASSING: ::c_int = 33; 2353 pub const _SC_PRIORITIZED_IO: ::c_int = 34; 2354 pub const _SC_PRIORITY_SCHEDULING: ::c_int = 35; 2355 pub const _SC_REALTIME_SIGNALS: ::c_int = 36; 2356 pub const _SC_SEMAPHORES: ::c_int = 37; 2357 pub const _SC_FSYNC: ::c_int = 38; 2358 pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 39; 2359 pub const _SC_SYNCHRONIZED_IO: ::c_int = 40; 2360 pub const _SC_TIMERS: ::c_int = 41; 2361 pub const _SC_AIO_LISTIO_MAX: ::c_int = 42; 2362 pub const _SC_AIO_MAX: ::c_int = 43; 2363 pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44; 2364 pub const _SC_DELAYTIMER_MAX: ::c_int = 45; 2365 pub const _SC_MQ_OPEN_MAX: ::c_int = 46; 2366 pub const _SC_MAPPED_FILES: ::c_int = 47; 2367 pub const _SC_RTSIG_MAX: ::c_int = 48; 2368 pub const _SC_SEM_NSEMS_MAX: ::c_int = 49; 2369 pub const _SC_SEM_VALUE_MAX: ::c_int = 50; 2370 pub const _SC_SIGQUEUE_MAX: ::c_int = 51; 2371 pub const _SC_TIMER_MAX: ::c_int = 52; 2372 pub const _SC_NPROCESSORS_CONF: ::c_int = 57; 2373 pub const _SC_NPROCESSORS_ONLN: ::c_int = 58; 2374 pub const _SC_2_PBS: ::c_int = 59; 2375 pub const _SC_2_PBS_ACCOUNTING: ::c_int = 60; 2376 pub const _SC_2_PBS_CHECKPOINT: ::c_int = 61; 2377 pub const _SC_2_PBS_LOCATE: ::c_int = 62; 2378 pub const _SC_2_PBS_MESSAGE: ::c_int = 63; 2379 pub const _SC_2_PBS_TRACK: ::c_int = 64; 2380 pub const _SC_ADVISORY_INFO: ::c_int = 65; 2381 pub const _SC_BARRIERS: ::c_int = 66; 2382 pub const _SC_CLOCK_SELECTION: ::c_int = 67; 2383 pub const _SC_CPUTIME: ::c_int = 68; 2384 pub const _SC_FILE_LOCKING: ::c_int = 69; 2385 pub const _SC_HOST_NAME_MAX: ::c_int = 72; 2386 pub const _SC_MONOTONIC_CLOCK: ::c_int = 74; 2387 pub const _SC_READER_WRITER_LOCKS: ::c_int = 76; 2388 pub const _SC_REGEXP: ::c_int = 77; 2389 pub const _SC_SHELL: ::c_int = 78; 2390 pub const _SC_SPAWN: ::c_int = 79; 2391 pub const _SC_SPIN_LOCKS: ::c_int = 80; 2392 pub const _SC_SPORADIC_SERVER: ::c_int = 81; 2393 pub const _SC_THREAD_CPUTIME: ::c_int = 84; 2394 pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 92; 2395 pub const _SC_TIMEOUTS: ::c_int = 95; 2396 pub const _SC_TRACE: ::c_int = 97; 2397 pub const _SC_TRACE_EVENT_FILTER: ::c_int = 98; 2398 pub const _SC_TRACE_INHERIT: ::c_int = 99; 2399 pub const _SC_TRACE_LOG: ::c_int = 100; 2400 pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 102; 2401 pub const _SC_V6_ILP32_OFF32: ::c_int = 103; 2402 pub const _SC_V6_ILP32_OFFBIG: ::c_int = 104; 2403 pub const _SC_V6_LP64_OFF64: ::c_int = 105; 2404 pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 106; 2405 pub const _SC_IPV6: ::c_int = 118; 2406 pub const _SC_RAW_SOCKETS: ::c_int = 119; 2407 pub const _SC_SYMLOOP_MAX: ::c_int = 120; 2408 pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; 2409 pub const _SC_XOPEN_STREAMS: ::c_int = 114; 2410 pub const _SC_XBS5_ILP32_OFF32: ::c_int = 122; 2411 pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 123; 2412 pub const _SC_XBS5_LP64_OFF64: ::c_int = 124; 2413 pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 125; 2414 pub const _SC_SS_REPL_MAX: ::c_int = 126; 2415 pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 127; 2416 pub const _SC_TRACE_NAME_MAX: ::c_int = 128; 2417 pub const _SC_TRACE_SYS_MAX: ::c_int = 129; 2418 pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 130; 2419 pub const _SC_PASS_MAX: ::c_int = 131; 2420 2421 pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; 2422 pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1; 2423 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2; 2424 pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL; 2425 pub const _PTHREAD_MUTEX_SIG_init: ::c_long = 0x32AAABA7; 2426 pub const _PTHREAD_COND_SIG_init: ::c_long = 0x3CB0B1BB; 2427 pub const _PTHREAD_RWLOCK_SIG_init: ::c_long = 0x2DA8B3B4; 2428 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { 2429 __sig: _PTHREAD_MUTEX_SIG_init, 2430 __opaque: [0; __PTHREAD_MUTEX_SIZE__], 2431 }; 2432 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { 2433 __sig: _PTHREAD_COND_SIG_init, 2434 __opaque: [0; __PTHREAD_COND_SIZE__], 2435 }; 2436 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { 2437 __sig: _PTHREAD_RWLOCK_SIG_init, 2438 __opaque: [0; __PTHREAD_RWLOCK_SIZE__], 2439 }; 2440 2441 pub const SIGSTKSZ: ::size_t = 131072; 2442 2443 pub const FD_SETSIZE: usize = 1024; 2444 2445 pub const ST_NOSUID: ::c_ulong = 2; 2446 2447 pub const EVFILT_READ: i16 = -1; 2448 pub const EVFILT_WRITE: i16 = -2; 2449 pub const EVFILT_AIO: i16 = -3; 2450 pub const EVFILT_VNODE: i16 = -4; 2451 pub const EVFILT_PROC: i16 = -5; 2452 pub const EVFILT_SIGNAL: i16 = -6; 2453 pub const EVFILT_TIMER: i16 = -7; 2454 pub const EVFILT_MACHPORT: i16 = -8; 2455 pub const EVFILT_FS: i16 = -9; 2456 pub const EVFILT_USER: i16 = -10; 2457 pub const EVFILT_VM: i16 = -12; 2458 2459 pub const EV_ADD: u16 = 0x1; 2460 pub const EV_DELETE: u16 = 0x2; 2461 pub const EV_ENABLE: u16 = 0x4; 2462 pub const EV_DISABLE: u16 = 0x8; 2463 pub const EV_ONESHOT: u16 = 0x10; 2464 pub const EV_CLEAR: u16 = 0x20; 2465 pub const EV_RECEIPT: u16 = 0x40; 2466 pub const EV_DISPATCH: u16 = 0x80; 2467 pub const EV_FLAG0: u16 = 0x1000; 2468 pub const EV_POLL: u16 = 0x1000; 2469 pub const EV_FLAG1: u16 = 0x2000; 2470 pub const EV_OOBAND: u16 = 0x2000; 2471 pub const EV_ERROR: u16 = 0x4000; 2472 pub const EV_EOF: u16 = 0x8000; 2473 pub const EV_SYSFLAGS: u16 = 0xf000; 2474 2475 pub const NOTE_TRIGGER: u32 = 0x01000000; 2476 pub const NOTE_FFNOP: u32 = 0x00000000; 2477 pub const NOTE_FFAND: u32 = 0x40000000; 2478 pub const NOTE_FFOR: u32 = 0x80000000; 2479 pub const NOTE_FFCOPY: u32 = 0xc0000000; 2480 pub const NOTE_FFCTRLMASK: u32 = 0xc0000000; 2481 pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff; 2482 pub const NOTE_LOWAT: u32 = 0x00000001; 2483 pub const NOTE_DELETE: u32 = 0x00000001; 2484 pub const NOTE_WRITE: u32 = 0x00000002; 2485 pub const NOTE_EXTEND: u32 = 0x00000004; 2486 pub const NOTE_ATTRIB: u32 = 0x00000008; 2487 pub const NOTE_LINK: u32 = 0x00000010; 2488 pub const NOTE_RENAME: u32 = 0x00000020; 2489 pub const NOTE_REVOKE: u32 = 0x00000040; 2490 pub const NOTE_NONE: u32 = 0x00000080; 2491 pub const NOTE_EXIT: u32 = 0x80000000; 2492 pub const NOTE_FORK: u32 = 0x40000000; 2493 pub const NOTE_EXEC: u32 = 0x20000000; 2494 #[doc(hidden)] 2495 #[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")] 2496 pub const NOTE_REAP: u32 = 0x10000000; 2497 pub const NOTE_SIGNAL: u32 = 0x08000000; 2498 pub const NOTE_EXITSTATUS: u32 = 0x04000000; 2499 pub const NOTE_EXIT_DETAIL: u32 = 0x02000000; 2500 pub const NOTE_PDATAMASK: u32 = 0x000fffff; 2501 pub const NOTE_PCTRLMASK: u32 = 0xfff00000; 2502 #[doc(hidden)] 2503 #[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")] 2504 pub const NOTE_EXIT_REPARENTED: u32 = 0x00080000; 2505 pub const NOTE_EXIT_DETAIL_MASK: u32 = 0x00070000; 2506 pub const NOTE_EXIT_DECRYPTFAIL: u32 = 0x00010000; 2507 pub const NOTE_EXIT_MEMORY: u32 = 0x00020000; 2508 pub const NOTE_EXIT_CSERROR: u32 = 0x00040000; 2509 pub const NOTE_VM_PRESSURE: u32 = 0x80000000; 2510 pub const NOTE_VM_PRESSURE_TERMINATE: u32 = 0x40000000; 2511 pub const NOTE_VM_PRESSURE_SUDDEN_TERMINATE: u32 = 0x20000000; 2512 pub const NOTE_VM_ERROR: u32 = 0x10000000; 2513 pub const NOTE_SECONDS: u32 = 0x00000001; 2514 pub const NOTE_USECONDS: u32 = 0x00000002; 2515 pub const NOTE_NSECONDS: u32 = 0x00000004; 2516 pub const NOTE_ABSOLUTE: u32 = 0x00000008; 2517 pub const NOTE_LEEWAY: u32 = 0x00000010; 2518 pub const NOTE_CRITICAL: u32 = 0x00000020; 2519 pub const NOTE_BACKGROUND: u32 = 0x00000040; 2520 pub const NOTE_TRACK: u32 = 0x00000001; 2521 pub const NOTE_TRACKERR: u32 = 0x00000002; 2522 pub const NOTE_CHILD: u32 = 0x00000004; 2523 2524 pub const OCRNL: ::tcflag_t = 0x00000010; 2525 pub const ONOCR: ::tcflag_t = 0x00000020; 2526 pub const ONLRET: ::tcflag_t = 0x00000040; 2527 pub const OFILL: ::tcflag_t = 0x00000080; 2528 pub const NLDLY: ::tcflag_t = 0x00000300; 2529 pub const TABDLY: ::tcflag_t = 0x00000c04; 2530 pub const CRDLY: ::tcflag_t = 0x00003000; 2531 pub const FFDLY: ::tcflag_t = 0x00004000; 2532 pub const BSDLY: ::tcflag_t = 0x00008000; 2533 pub const VTDLY: ::tcflag_t = 0x00010000; 2534 pub const OFDEL: ::tcflag_t = 0x00020000; 2535 2536 pub const NL0: ::tcflag_t = 0x00000000; 2537 pub const NL1: ::tcflag_t = 0x00000100; 2538 pub const TAB0: ::tcflag_t = 0x00000000; 2539 pub const TAB1: ::tcflag_t = 0x00000400; 2540 pub const TAB2: ::tcflag_t = 0x00000800; 2541 pub const CR0: ::tcflag_t = 0x00000000; 2542 pub const CR1: ::tcflag_t = 0x00001000; 2543 pub const CR2: ::tcflag_t = 0x00002000; 2544 pub const CR3: ::tcflag_t = 0x00003000; 2545 pub const FF0: ::tcflag_t = 0x00000000; 2546 pub const FF1: ::tcflag_t = 0x00004000; 2547 pub const BS0: ::tcflag_t = 0x00000000; 2548 pub const BS1: ::tcflag_t = 0x00008000; 2549 pub const TAB3: ::tcflag_t = 0x00000004; 2550 pub const VT0: ::tcflag_t = 0x00000000; 2551 pub const VT1: ::tcflag_t = 0x00010000; 2552 pub const IUTF8: ::tcflag_t = 0x00004000; 2553 pub const CRTSCTS: ::tcflag_t = 0x00030000; 2554 2555 pub const NI_MAXHOST: ::socklen_t = 1025; 2556 pub const NI_MAXSERV: ::socklen_t = 32; 2557 pub const NI_NOFQDN: ::c_int = 0x00000001; 2558 pub const NI_NUMERICHOST: ::c_int = 0x00000002; 2559 pub const NI_NAMEREQD: ::c_int = 0x00000004; 2560 pub const NI_NUMERICSERV: ::c_int = 0x00000008; 2561 pub const NI_NUMERICSCOPE: ::c_int = 0x00000100; 2562 pub const NI_DGRAM: ::c_int = 0x00000010; 2563 2564 pub const Q_GETQUOTA: ::c_int = 0x300; 2565 pub const Q_SETQUOTA: ::c_int = 0x400; 2566 2567 pub const RENAME_SWAP: ::c_uint = 0x00000002; 2568 pub const RENAME_EXCL: ::c_uint = 0x00000004; 2569 2570 pub const RTLD_LOCAL: ::c_int = 0x4; 2571 pub const RTLD_FIRST: ::c_int = 0x100; 2572 pub const RTLD_NODELETE: ::c_int = 0x80; 2573 pub const RTLD_NOLOAD: ::c_int = 0x10; 2574 pub const RTLD_GLOBAL: ::c_int = 0x8; 2575 2576 pub const _WSTOPPED: ::c_int = 0o177; 2577 2578 pub const LOG_NETINFO: ::c_int = 12 << 3; 2579 pub const LOG_REMOTEAUTH: ::c_int = 13 << 3; 2580 pub const LOG_INSTALL: ::c_int = 14 << 3; 2581 pub const LOG_RAS: ::c_int = 15 << 3; 2582 pub const LOG_LAUNCHD: ::c_int = 24 << 3; 2583 pub const LOG_NFACILITIES: ::c_int = 25; 2584 2585 pub const CTLTYPE: ::c_int = 0xf; 2586 pub const CTLTYPE_NODE: ::c_int = 1; 2587 pub const CTLTYPE_INT: ::c_int = 2; 2588 pub const CTLTYPE_STRING: ::c_int = 3; 2589 pub const CTLTYPE_QUAD: ::c_int = 4; 2590 pub const CTLTYPE_OPAQUE: ::c_int = 5; 2591 pub const CTLTYPE_STRUCT: ::c_int = CTLTYPE_OPAQUE; 2592 pub const CTLFLAG_RD: ::c_int = 0x80000000; 2593 pub const CTLFLAG_WR: ::c_int = 0x40000000; 2594 pub const CTLFLAG_RW: ::c_int = CTLFLAG_RD | CTLFLAG_WR; 2595 pub const CTLFLAG_NOLOCK: ::c_int = 0x20000000; 2596 pub const CTLFLAG_ANYBODY: ::c_int = 0x10000000; 2597 pub const CTLFLAG_SECURE: ::c_int = 0x08000000; 2598 pub const CTLFLAG_MASKED: ::c_int = 0x04000000; 2599 pub const CTLFLAG_NOAUTO: ::c_int = 0x02000000; 2600 pub const CTLFLAG_KERN: ::c_int = 0x01000000; 2601 pub const CTLFLAG_LOCKED: ::c_int = 0x00800000; 2602 pub const CTLFLAG_OID2: ::c_int = 0x00400000; 2603 pub const CTL_UNSPEC: ::c_int = 0; 2604 pub const CTL_KERN: ::c_int = 1; 2605 pub const CTL_VM: ::c_int = 2; 2606 pub const CTL_VFS: ::c_int = 3; 2607 pub const CTL_NET: ::c_int = 4; 2608 pub const CTL_DEBUG: ::c_int = 5; 2609 pub const CTL_HW: ::c_int = 6; 2610 pub const CTL_MACHDEP: ::c_int = 7; 2611 pub const CTL_USER: ::c_int = 8; 2612 pub const CTL_MAXID: ::c_int = 9; 2613 pub const KERN_OSTYPE: ::c_int = 1; 2614 pub const KERN_OSRELEASE: ::c_int = 2; 2615 pub const KERN_OSREV: ::c_int = 3; 2616 pub const KERN_VERSION: ::c_int = 4; 2617 pub const KERN_MAXVNODES: ::c_int = 5; 2618 pub const KERN_MAXPROC: ::c_int = 6; 2619 pub const KERN_MAXFILES: ::c_int = 7; 2620 pub const KERN_ARGMAX: ::c_int = 8; 2621 pub const KERN_SECURELVL: ::c_int = 9; 2622 pub const KERN_HOSTNAME: ::c_int = 10; 2623 pub const KERN_HOSTID: ::c_int = 11; 2624 pub const KERN_CLOCKRATE: ::c_int = 12; 2625 pub const KERN_VNODE: ::c_int = 13; 2626 pub const KERN_PROC: ::c_int = 14; 2627 pub const KERN_FILE: ::c_int = 15; 2628 pub const KERN_PROF: ::c_int = 16; 2629 pub const KERN_POSIX1: ::c_int = 17; 2630 pub const KERN_NGROUPS: ::c_int = 18; 2631 pub const KERN_JOB_CONTROL: ::c_int = 19; 2632 pub const KERN_SAVED_IDS: ::c_int = 20; 2633 pub const KERN_BOOTTIME: ::c_int = 21; 2634 pub const KERN_NISDOMAINNAME: ::c_int = 22; 2635 pub const KERN_DOMAINNAME: ::c_int = KERN_NISDOMAINNAME; 2636 pub const KERN_MAXPARTITIONS: ::c_int = 23; 2637 pub const KERN_KDEBUG: ::c_int = 24; 2638 pub const KERN_UPDATEINTERVAL: ::c_int = 25; 2639 pub const KERN_OSRELDATE: ::c_int = 26; 2640 pub const KERN_NTP_PLL: ::c_int = 27; 2641 pub const KERN_BOOTFILE: ::c_int = 28; 2642 pub const KERN_MAXFILESPERPROC: ::c_int = 29; 2643 pub const KERN_MAXPROCPERUID: ::c_int = 30; 2644 pub const KERN_DUMPDEV: ::c_int = 31; 2645 pub const KERN_IPC: ::c_int = 32; 2646 pub const KERN_DUMMY: ::c_int = 33; 2647 pub const KERN_PS_STRINGS: ::c_int = 34; 2648 pub const KERN_USRSTACK32: ::c_int = 35; 2649 pub const KERN_LOGSIGEXIT: ::c_int = 36; 2650 pub const KERN_SYMFILE: ::c_int = 37; 2651 pub const KERN_PROCARGS: ::c_int = 38; 2652 pub const KERN_NETBOOT: ::c_int = 40; 2653 pub const KERN_SYSV: ::c_int = 42; 2654 pub const KERN_AFFINITY: ::c_int = 43; 2655 pub const KERN_TRANSLATE: ::c_int = 44; 2656 pub const KERN_CLASSIC: ::c_int = KERN_TRANSLATE; 2657 pub const KERN_EXEC: ::c_int = 45; 2658 pub const KERN_CLASSICHANDLER: ::c_int = KERN_EXEC; 2659 pub const KERN_AIOMAX: ::c_int = 46; 2660 pub const KERN_AIOPROCMAX: ::c_int = 47; 2661 pub const KERN_AIOTHREADS: ::c_int = 48; 2662 pub const KERN_COREFILE: ::c_int = 50; 2663 pub const KERN_COREDUMP: ::c_int = 51; 2664 pub const KERN_SUGID_COREDUMP: ::c_int = 52; 2665 pub const KERN_PROCDELAYTERM: ::c_int = 53; 2666 pub const KERN_SHREG_PRIVATIZABLE: ::c_int = 54; 2667 pub const KERN_LOW_PRI_WINDOW: ::c_int = 56; 2668 pub const KERN_LOW_PRI_DELAY: ::c_int = 57; 2669 pub const KERN_POSIX: ::c_int = 58; 2670 pub const KERN_USRSTACK64: ::c_int = 59; 2671 pub const KERN_NX_PROTECTION: ::c_int = 60; 2672 pub const KERN_TFP: ::c_int = 61; 2673 pub const KERN_PROCNAME: ::c_int = 62; 2674 pub const KERN_THALTSTACK: ::c_int = 63; 2675 pub const KERN_SPECULATIVE_READS: ::c_int = 64; 2676 pub const KERN_OSVERSION: ::c_int = 65; 2677 pub const KERN_SAFEBOOT: ::c_int = 66; 2678 pub const KERN_RAGEVNODE: ::c_int = 68; 2679 pub const KERN_TTY: ::c_int = 69; 2680 pub const KERN_CHECKOPENEVT: ::c_int = 70; 2681 pub const KERN_THREADNAME: ::c_int = 71; 2682 pub const KERN_MAXID: ::c_int = 72; 2683 pub const KERN_RAGE_PROC: ::c_int = 1; 2684 pub const KERN_RAGE_THREAD: ::c_int = 2; 2685 pub const KERN_UNRAGE_PROC: ::c_int = 3; 2686 pub const KERN_UNRAGE_THREAD: ::c_int = 4; 2687 pub const KERN_OPENEVT_PROC: ::c_int = 1; 2688 pub const KERN_UNOPENEVT_PROC: ::c_int = 2; 2689 pub const KERN_TFP_POLICY: ::c_int = 1; 2690 pub const KERN_TFP_POLICY_DENY: ::c_int = 0; 2691 pub const KERN_TFP_POLICY_DEFAULT: ::c_int = 2; 2692 pub const KERN_KDEFLAGS: ::c_int = 1; 2693 pub const KERN_KDDFLAGS: ::c_int = 2; 2694 pub const KERN_KDENABLE: ::c_int = 3; 2695 pub const KERN_KDSETBUF: ::c_int = 4; 2696 pub const KERN_KDGETBUF: ::c_int = 5; 2697 pub const KERN_KDSETUP: ::c_int = 6; 2698 pub const KERN_KDREMOVE: ::c_int = 7; 2699 pub const KERN_KDSETREG: ::c_int = 8; 2700 pub const KERN_KDGETREG: ::c_int = 9; 2701 pub const KERN_KDREADTR: ::c_int = 10; 2702 pub const KERN_KDPIDTR: ::c_int = 11; 2703 pub const KERN_KDTHRMAP: ::c_int = 12; 2704 pub const KERN_KDPIDEX: ::c_int = 14; 2705 pub const KERN_KDSETRTCDEC: ::c_int = 15; 2706 pub const KERN_KDGETENTROPY: ::c_int = 16; 2707 pub const KERN_KDWRITETR: ::c_int = 17; 2708 pub const KERN_KDWRITEMAP: ::c_int = 18; 2709 #[doc(hidden)] 2710 #[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")] 2711 pub const KERN_KDENABLE_BG_TRACE: ::c_int = 19; 2712 #[doc(hidden)] 2713 #[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")] 2714 pub const KERN_KDDISABLE_BG_TRACE: ::c_int = 20; 2715 pub const KERN_KDREADCURTHRMAP: ::c_int = 21; 2716 pub const KERN_KDSET_TYPEFILTER: ::c_int = 22; 2717 pub const KERN_KDBUFWAIT: ::c_int = 23; 2718 pub const KERN_KDCPUMAP: ::c_int = 24; 2719 pub const KERN_PROC_ALL: ::c_int = 0; 2720 pub const KERN_PROC_PID: ::c_int = 1; 2721 pub const KERN_PROC_PGRP: ::c_int = 2; 2722 pub const KERN_PROC_SESSION: ::c_int = 3; 2723 pub const KERN_PROC_TTY: ::c_int = 4; 2724 pub const KERN_PROC_UID: ::c_int = 5; 2725 pub const KERN_PROC_RUID: ::c_int = 6; 2726 pub const KERN_PROC_LCID: ::c_int = 7; 2727 pub const KIPC_MAXSOCKBUF: ::c_int = 1; 2728 pub const KIPC_SOCKBUF_WASTE: ::c_int = 2; 2729 pub const KIPC_SOMAXCONN: ::c_int = 3; 2730 pub const KIPC_MAX_LINKHDR: ::c_int = 4; 2731 pub const KIPC_MAX_PROTOHDR: ::c_int = 5; 2732 pub const KIPC_MAX_HDR: ::c_int = 6; 2733 pub const KIPC_MAX_DATALEN: ::c_int = 7; 2734 pub const KIPC_MBSTAT: ::c_int = 8; 2735 pub const KIPC_NMBCLUSTERS: ::c_int = 9; 2736 pub const KIPC_SOQLIMITCOMPAT: ::c_int = 10; 2737 pub const VM_METER: ::c_int = 1; 2738 pub const VM_LOADAVG: ::c_int = 2; 2739 pub const VM_MACHFACTOR: ::c_int = 4; 2740 pub const VM_SWAPUSAGE: ::c_int = 5; 2741 pub const VM_MAXID: ::c_int = 6; 2742 pub const HW_MACHINE: ::c_int = 1; 2743 pub const HW_MODEL: ::c_int = 2; 2744 pub const HW_NCPU: ::c_int = 3; 2745 pub const HW_BYTEORDER: ::c_int = 4; 2746 pub const HW_PHYSMEM: ::c_int = 5; 2747 pub const HW_USERMEM: ::c_int = 6; 2748 pub const HW_PAGESIZE: ::c_int = 7; 2749 pub const HW_DISKNAMES: ::c_int = 8; 2750 pub const HW_DISKSTATS: ::c_int = 9; 2751 pub const HW_EPOCH: ::c_int = 10; 2752 pub const HW_FLOATINGPT: ::c_int = 11; 2753 pub const HW_MACHINE_ARCH: ::c_int = 12; 2754 pub const HW_VECTORUNIT: ::c_int = 13; 2755 pub const HW_BUS_FREQ: ::c_int = 14; 2756 pub const HW_CPU_FREQ: ::c_int = 15; 2757 pub const HW_CACHELINE: ::c_int = 16; 2758 pub const HW_L1ICACHESIZE: ::c_int = 17; 2759 pub const HW_L1DCACHESIZE: ::c_int = 18; 2760 pub const HW_L2SETTINGS: ::c_int = 19; 2761 pub const HW_L2CACHESIZE: ::c_int = 20; 2762 pub const HW_L3SETTINGS: ::c_int = 21; 2763 pub const HW_L3CACHESIZE: ::c_int = 22; 2764 pub const HW_TB_FREQ: ::c_int = 23; 2765 pub const HW_MEMSIZE: ::c_int = 24; 2766 pub const HW_AVAILCPU: ::c_int = 25; 2767 pub const HW_MAXID: ::c_int = 26; 2768 pub const USER_CS_PATH: ::c_int = 1; 2769 pub const USER_BC_BASE_MAX: ::c_int = 2; 2770 pub const USER_BC_DIM_MAX: ::c_int = 3; 2771 pub const USER_BC_SCALE_MAX: ::c_int = 4; 2772 pub const USER_BC_STRING_MAX: ::c_int = 5; 2773 pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6; 2774 pub const USER_EXPR_NEST_MAX: ::c_int = 7; 2775 pub const USER_LINE_MAX: ::c_int = 8; 2776 pub const USER_RE_DUP_MAX: ::c_int = 9; 2777 pub const USER_POSIX2_VERSION: ::c_int = 10; 2778 pub const USER_POSIX2_C_BIND: ::c_int = 11; 2779 pub const USER_POSIX2_C_DEV: ::c_int = 12; 2780 pub const USER_POSIX2_CHAR_TERM: ::c_int = 13; 2781 pub const USER_POSIX2_FORT_DEV: ::c_int = 14; 2782 pub const USER_POSIX2_FORT_RUN: ::c_int = 15; 2783 pub const USER_POSIX2_LOCALEDEF: ::c_int = 16; 2784 pub const USER_POSIX2_SW_DEV: ::c_int = 17; 2785 pub const USER_POSIX2_UPE: ::c_int = 18; 2786 pub const USER_STREAM_MAX: ::c_int = 19; 2787 pub const USER_TZNAME_MAX: ::c_int = 20; 2788 pub const USER_MAXID: ::c_int = 21; 2789 pub const CTL_DEBUG_NAME: ::c_int = 0; 2790 pub const CTL_DEBUG_VALUE: ::c_int = 1; 2791 pub const CTL_DEBUG_MAXID: ::c_int = 20; 2792 2793 pub const PRIO_DARWIN_THREAD: ::c_int = 3; 2794 pub const PRIO_DARWIN_PROCESS: ::c_int = 4; 2795 pub const PRIO_DARWIN_BG: ::c_int = 0x1000; 2796 pub const PRIO_DARWIN_NONUI: ::c_int = 0x1001; 2797 2798 pub const SEM_FAILED: *mut sem_t = -1isize as *mut ::sem_t; 2799 2800 pub const AI_PASSIVE: ::c_int = 0x00000001; 2801 pub const AI_CANONNAME: ::c_int = 0x00000002; 2802 pub const AI_NUMERICHOST: ::c_int = 0x00000004; 2803 pub const AI_NUMERICSERV: ::c_int = 0x00001000; 2804 pub const AI_MASK: ::c_int = AI_PASSIVE 2805 | AI_CANONNAME 2806 | AI_NUMERICHOST 2807 | AI_NUMERICSERV 2808 | AI_ADDRCONFIG; 2809 pub const AI_ALL: ::c_int = 0x00000100; 2810 pub const AI_V4MAPPED_CFG: ::c_int = 0x00000200; 2811 pub const AI_ADDRCONFIG: ::c_int = 0x00000400; 2812 pub const AI_V4MAPPED: ::c_int = 0x00000800; 2813 pub const AI_DEFAULT: ::c_int = AI_V4MAPPED_CFG | AI_ADDRCONFIG; 2814 pub const AI_UNUSABLE: ::c_int = 0x10000000; 2815 2816 pub const SIGEV_NONE: ::c_int = 0; 2817 pub const SIGEV_SIGNAL: ::c_int = 1; 2818 pub const SIGEV_THREAD: ::c_int = 3; 2819 2820 pub const AIO_CANCELED: ::c_int = 2; 2821 pub const AIO_NOTCANCELED: ::c_int = 4; 2822 pub const AIO_ALLDONE: ::c_int = 1; 2823 #[deprecated( 2824 since = "0.2.64", 2825 note = "Can vary at runtime. Use sysconf(3) instead" 2826 )] 2827 pub const AIO_LISTIO_MAX: ::c_int = 16; 2828 pub const LIO_NOP: ::c_int = 0; 2829 pub const LIO_WRITE: ::c_int = 2; 2830 pub const LIO_READ: ::c_int = 1; 2831 pub const LIO_WAIT: ::c_int = 2; 2832 pub const LIO_NOWAIT: ::c_int = 1; 2833 2834 pub const WEXITED: ::c_int = 0x00000004; 2835 pub const WSTOPPED: ::c_int = 0x00000008; 2836 pub const WCONTINUED: ::c_int = 0x00000010; 2837 pub const WNOWAIT: ::c_int = 0x00000020; 2838 2839 pub const P_ALL: idtype_t = 0; 2840 pub const P_PID: idtype_t = 1; 2841 pub const P_PGID: idtype_t = 2; 2842 2843 pub const UTIME_OMIT: c_long = -2; 2844 pub const UTIME_NOW: c_long = -1; 2845 2846 pub const XATTR_NOFOLLOW: ::c_int = 0x0001; 2847 pub const XATTR_CREATE: ::c_int = 0x0002; 2848 pub const XATTR_REPLACE: ::c_int = 0x0004; 2849 pub const XATTR_NOSECURITY: ::c_int = 0x0008; 2850 pub const XATTR_NODEFAULT: ::c_int = 0x0010; 2851 pub const XATTR_SHOWCOMPRESSION: ::c_int = 0x0020; 2852 2853 pub const NET_RT_IFLIST2: ::c_int = 0x0006; 2854 2855 // net/route.h 2856 pub const RTF_UP: ::c_int = 0x1; 2857 pub const RTF_GATEWAY: ::c_int = 0x2; 2858 pub const RTF_HOST: ::c_int = 0x4; 2859 pub const RTF_REJECT: ::c_int = 0x8; 2860 pub const RTF_DYNAMIC: ::c_int = 0x10; 2861 pub const RTF_MODIFIED: ::c_int = 0x20; 2862 pub const RTF_DONE: ::c_int = 0x40; 2863 pub const RTF_DELCLONE: ::c_int = 0x80; 2864 pub const RTF_CLONING: ::c_int = 0x100; 2865 pub const RTF_XRESOLVE: ::c_int = 0x200; 2866 pub const RTF_LLINFO: ::c_int = 0x400; 2867 pub const RTF_STATIC: ::c_int = 0x800; 2868 pub const RTF_BLACKHOLE: ::c_int = 0x1000; 2869 pub const RTF_NOIFREF: ::c_int = 0x2000; 2870 pub const RTF_PROTO2: ::c_int = 0x4000; 2871 pub const RTF_PROTO1: ::c_int = 0x8000; 2872 pub const RTF_PRCLONING: ::c_int = 0x10000; 2873 pub const RTF_WASCLONED: ::c_int = 0x20000; 2874 pub const RTF_PROTO3: ::c_int = 0x40000; 2875 pub const RTF_PINNED: ::c_int = 0x100000; 2876 pub const RTF_LOCAL: ::c_int = 0x200000; 2877 pub const RTF_BROADCAST: ::c_int = 0x400000; 2878 pub const RTF_MULTICAST: ::c_int = 0x800000; 2879 pub const RTF_IFSCOPE: ::c_int = 0x1000000; 2880 pub const RTF_CONDEMNED: ::c_int = 0x2000000; 2881 pub const RTF_IFREF: ::c_int = 0x4000000; 2882 pub const RTF_PROXY: ::c_int = 0x8000000; 2883 pub const RTF_ROUTER: ::c_int = 0x10000000; 2884 2885 pub const RTM_VERSION: ::c_int = 5; 2886 2887 // Message types 2888 pub const RTM_ADD: ::c_int = 0x1; 2889 pub const RTM_DELETE: ::c_int = 0x2; 2890 pub const RTM_CHANGE: ::c_int = 0x3; 2891 pub const RTM_GET: ::c_int = 0x4; 2892 pub const RTM_LOSING: ::c_int = 0x5; 2893 pub const RTM_REDIRECT: ::c_int = 0x6; 2894 pub const RTM_MISS: ::c_int = 0x7; 2895 pub const RTM_LOCK: ::c_int = 0x8; 2896 pub const RTM_OLDADD: ::c_int = 0x9; 2897 pub const RTM_OLDDEL: ::c_int = 0xa; 2898 pub const RTM_RESOLVE: ::c_int = 0xb; 2899 pub const RTM_NEWADDR: ::c_int = 0xc; 2900 pub const RTM_DELADDR: ::c_int = 0xd; 2901 pub const RTM_IFINFO: ::c_int = 0xe; 2902 pub const RTM_NEWMADDR: ::c_int = 0xf; 2903 pub const RTM_DELMADDR: ::c_int = 0x10; 2904 pub const RTM_IFINFO2: ::c_int = 0x12; 2905 pub const RTM_NEWMADDR2: ::c_int = 0x13; 2906 pub const RTM_GET2: ::c_int = 0x14; 2907 2908 // Bitmask values for rtm_inits and rmx_locks. 2909 pub const RTV_MTU: ::c_int = 0x1; 2910 pub const RTV_HOPCOUNT: ::c_int = 0x2; 2911 pub const RTV_EXPIRE: ::c_int = 0x4; 2912 pub const RTV_RPIPE: ::c_int = 0x8; 2913 pub const RTV_SPIPE: ::c_int = 0x10; 2914 pub const RTV_SSTHRESH: ::c_int = 0x20; 2915 pub const RTV_RTT: ::c_int = 0x40; 2916 pub const RTV_RTTVAR: ::c_int = 0x80; 2917 2918 // Bitmask values for rtm_addrs. 2919 pub const RTA_DST: ::c_int = 0x1; 2920 pub const RTA_GATEWAY: ::c_int = 0x2; 2921 pub const RTA_NETMASK: ::c_int = 0x4; 2922 pub const RTA_GENMASK: ::c_int = 0x8; 2923 pub const RTA_IFP: ::c_int = 0x10; 2924 pub const RTA_IFA: ::c_int = 0x20; 2925 pub const RTA_AUTHOR: ::c_int = 0x40; 2926 pub const RTA_BRD: ::c_int = 0x80; 2927 2928 // Index offsets for sockaddr array for alternate internal encoding. 2929 pub const RTAX_DST: ::c_int = 0; 2930 pub const RTAX_GATEWAY: ::c_int = 1; 2931 pub const RTAX_NETMASK: ::c_int = 2; 2932 pub const RTAX_GENMASK: ::c_int = 3; 2933 pub const RTAX_IFP: ::c_int = 4; 2934 pub const RTAX_IFA: ::c_int = 5; 2935 pub const RTAX_AUTHOR: ::c_int = 6; 2936 pub const RTAX_BRD: ::c_int = 7; 2937 pub const RTAX_MAX: ::c_int = 8; 2938 2939 pub const KERN_PROCARGS2: ::c_int = 49; 2940 2941 pub const PROC_PIDTASKALLINFO: ::c_int = 2; 2942 pub const PROC_PIDTASKINFO: ::c_int = 4; 2943 pub const PROC_PIDTHREADINFO: ::c_int = 5; 2944 pub const MAXCOMLEN: usize = 16; 2945 pub const MAXTHREADNAMESIZE: usize = 64; 2946 2947 pub const XUCRED_VERSION: ::c_uint = 0; 2948 2949 pub const LC_SEGMENT: u32 = 0x1; 2950 pub const LC_SEGMENT_64: u32 = 0x19; 2951 2952 pub const MH_MAGIC: u32 = 0xfeedface; 2953 pub const MH_MAGIC_64: u32 = 0xfeedfacf; 2954 2955 // net/if_utun.h 2956 pub const UTUN_OPT_FLAGS: ::c_int = 1; 2957 pub const UTUN_OPT_IFNAME: ::c_int = 2; 2958 2959 // net/bpf.h 2960 pub const DLT_NULL: ::c_uint = 0; // no link-layer encapsulation 2961 pub const DLT_EN10MB: ::c_uint = 1; // Ethernet (10Mb) 2962 pub const DLT_EN3MB: ::c_uint = 2; // Experimental Ethernet (3Mb) 2963 pub const DLT_AX25: ::c_uint = 3; // Amateur Radio AX.25 2964 pub const DLT_PRONET: ::c_uint = 4; // Proteon ProNET Token Ring 2965 pub const DLT_CHAOS: ::c_uint = 5; // Chaos 2966 pub const DLT_IEEE802: ::c_uint = 6; // IEEE 802 Networks 2967 pub const DLT_ARCNET: ::c_uint = 7; // ARCNET 2968 pub const DLT_SLIP: ::c_uint = 8; // Serial Line IP 2969 pub const DLT_PPP: ::c_uint = 9; // Point-to-point Protocol 2970 pub const DLT_FDDI: ::c_uint = 10; // FDDI 2971 pub const DLT_ATM_RFC1483: ::c_uint = 11; // LLC/SNAP encapsulated atm 2972 pub const DLT_RAW: ::c_uint = 12; // raw IP 2973 pub const DLT_LOOP: ::c_uint = 108; 2974 2975 // https://github.com/apple/darwin-xnu/blob/master/bsd/net/bpf.h#L100 2976 // sizeof(i32) 2977 pub const BPF_ALIGNMENT: ::c_int = 4; 2978 2979 // sys/spawn.h: 2980 pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01; 2981 pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02; 2982 pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x04; 2983 pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x08; 2984 pub const POSIX_SPAWN_SETEXEC: ::c_int = 0x40; 2985 pub const POSIX_SPAWN_START_SUSPENDED: ::c_int = 0x80; 2986 pub const POSIX_SPAWN_CLOEXEC_DEFAULT: ::c_int = 0x4000; 2987 2988 // sys/ipc.h: 2989 pub const IPC_CREAT: ::c_int = 0x200; 2990 pub const IPC_EXCL: ::c_int = 0x400; 2991 pub const IPC_NOWAIT: ::c_int = 0x800; 2992 pub const IPC_PRIVATE: key_t = 0; 2993 2994 pub const IPC_RMID: ::c_int = 0; 2995 pub const IPC_SET: ::c_int = 1; 2996 pub const IPC_STAT: ::c_int = 2; 2997 2998 pub const IPC_R: ::c_int = 0x100; 2999 pub const IPC_W: ::c_int = 0x80; 3000 pub const IPC_M: ::c_int = 0x1000; 3001 3002 // sys/sem.h 3003 pub const SEM_UNDO: ::c_int = 0o10000; 3004 3005 pub const GETNCNT: ::c_int = 3; 3006 pub const GETPID: ::c_int = 4; 3007 pub const GETVAL: ::c_int = 5; 3008 pub const GETALL: ::c_int = 6; 3009 pub const GETZCNT: ::c_int = 7; 3010 pub const SETVAL: ::c_int = 8; 3011 pub const SETALL: ::c_int = 9; 3012 3013 // sys/shm.h 3014 pub const SHM_RDONLY: ::c_int = 0x1000; 3015 pub const SHM_RND: ::c_int = 0x2000; 3016 pub const SHMLBA: ::c_int = 4096; 3017 pub const SHM_R: ::c_int = IPC_R; 3018 pub const SHM_W: ::c_int = IPC_W; 3019 3020 // Flags for chflags(2) 3021 pub const UF_SETTABLE: ::c_uint = 0x0000ffff; 3022 pub const UF_NODUMP: ::c_uint = 0x00000001; 3023 pub const UF_IMMUTABLE: ::c_uint = 0x00000002; 3024 pub const UF_APPEND: ::c_uint = 0x00000004; 3025 pub const UF_OPAQUE: ::c_uint = 0x00000008; 3026 pub const UF_COMPRESSED: ::c_uint = 0x00000020; 3027 pub const UF_TRACKED: ::c_uint = 0x00000040; 3028 pub const SF_SETTABLE: ::c_uint = 0xffff0000; 3029 pub const SF_ARCHIVED: ::c_uint = 0x00010000; 3030 pub const SF_IMMUTABLE: ::c_uint = 0x00020000; 3031 pub const SF_APPEND: ::c_uint = 0x00040000; 3032 pub const UF_HIDDEN: ::c_uint = 0x00008000; 3033 3034 cfg_if! { 3035 if #[cfg(libc_const_size_of)] { 3036 fn __DARWIN_ALIGN32(p: usize) -> usize { 3037 const __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1; 3038 p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32 3039 } 3040 } else { 3041 fn __DARWIN_ALIGN32(p: usize) -> usize { 3042 let __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1; 3043 p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32 3044 } 3045 } 3046 } 3047 3048 f! { 3049 pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, 3050 cmsg: *const ::cmsghdr) -> *mut ::cmsghdr { 3051 if cmsg.is_null() { 3052 return ::CMSG_FIRSTHDR(mhdr); 3053 }; 3054 let cmsg_len = (*cmsg).cmsg_len as usize; 3055 let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len as usize); 3056 let max = (*mhdr).msg_control as usize 3057 + (*mhdr).msg_controllen as usize; 3058 if next + __DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) > max { 3059 0 as *mut ::cmsghdr 3060 } else { 3061 next as *mut ::cmsghdr 3062 } 3063 } 3064 3065 pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar { 3066 (cmsg as *mut ::c_uchar) 3067 .offset(__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) as isize) 3068 } 3069 3070 pub fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { 3071 (__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) 3072 + __DARWIN_ALIGN32(length as usize)) 3073 as ::c_uint 3074 } 3075 3076 pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { 3077 (__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) + length as usize) 3078 as ::c_uint 3079 } 3080 3081 pub fn WSTOPSIG(status: ::c_int) -> ::c_int { 3082 status >> 8 3083 } 3084 3085 pub fn _WSTATUS(status: ::c_int) -> ::c_int { 3086 status & 0x7f 3087 } 3088 3089 pub fn WIFCONTINUED(status: ::c_int) -> bool { 3090 _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) == 0x13 3091 } 3092 3093 pub fn WIFSIGNALED(status: ::c_int) -> bool { 3094 _WSTATUS(status) != _WSTOPPED && _WSTATUS(status) != 0 3095 } 3096 3097 pub fn WIFSTOPPED(status: ::c_int) -> bool { 3098 _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) != 0x13 3099 } 3100 } 3101 3102 extern "C" { setgrent()3103 pub fn setgrent(); 3104 #[doc(hidden)] 3105 #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.5")] 3106 #[link_name = "daemon$1050"] daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int3107 pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; 3108 #[doc(hidden)] 3109 #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")] sem_destroy(sem: *mut sem_t) -> ::c_int3110 pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; 3111 #[doc(hidden)] 3112 #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")] sem_init( sem: *mut sem_t, pshared: ::c_int, value: ::c_uint, ) -> ::c_int3113 pub fn sem_init( 3114 sem: *mut sem_t, 3115 pshared: ::c_int, 3116 value: ::c_uint, 3117 ) -> ::c_int; aio_read(aiocbp: *mut aiocb) -> ::c_int3118 pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int; aio_write(aiocbp: *mut aiocb) -> ::c_int3119 pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int; aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int3120 pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int; aio_error(aiocbp: *const aiocb) -> ::c_int3121 pub fn aio_error(aiocbp: *const aiocb) -> ::c_int; aio_return(aiocbp: *mut aiocb) -> ::ssize_t3122 pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t; 3123 #[cfg_attr( 3124 all(target_os = "macos", target_arch = "x86"), 3125 link_name = "aio_suspend$UNIX2003" 3126 )] aio_suspend( aiocb_list: *const *const aiocb, nitems: ::c_int, timeout: *const ::timespec, ) -> ::c_int3127 pub fn aio_suspend( 3128 aiocb_list: *const *const aiocb, 3129 nitems: ::c_int, 3130 timeout: *const ::timespec, 3131 ) -> ::c_int; aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int3132 pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; chflags(path: *const ::c_char, flags: ::c_uint) -> ::c_int3133 pub fn chflags(path: *const ::c_char, flags: ::c_uint) -> ::c_int; fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int3134 pub fn fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int; clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int3135 pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int3136 pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; lio_listio( mode: ::c_int, aiocb_list: *const *mut aiocb, nitems: ::c_int, sevp: *mut sigevent, ) -> ::c_int3137 pub fn lio_listio( 3138 mode: ::c_int, 3139 aiocb_list: *const *mut aiocb, 3140 nitems: ::c_int, 3141 sevp: *mut sigevent, 3142 ) -> ::c_int; 3143 dirfd(dirp: *mut ::DIR) -> ::c_int3144 pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; 3145 lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int3146 pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; 3147 gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int3148 pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; getutxent() -> *mut utmpx3149 pub fn getutxent() -> *mut utmpx; getutxid(ut: *const utmpx) -> *mut utmpx3150 pub fn getutxid(ut: *const utmpx) -> *mut utmpx; getutxline(ut: *const utmpx) -> *mut utmpx3151 pub fn getutxline(ut: *const utmpx) -> *mut utmpx; pututxline(ut: *const utmpx) -> *mut utmpx3152 pub fn pututxline(ut: *const utmpx) -> *mut utmpx; setutxent()3153 pub fn setutxent(); endutxent()3154 pub fn endutxent(); utmpxname(file: *const ::c_char) -> ::c_int3155 pub fn utmpxname(file: *const ::c_char) -> ::c_int; 3156 getnameinfo( sa: *const ::sockaddr, salen: ::socklen_t, host: *mut ::c_char, hostlen: ::socklen_t, serv: *mut ::c_char, sevlen: ::socklen_t, flags: ::c_int, ) -> ::c_int3157 pub fn getnameinfo( 3158 sa: *const ::sockaddr, 3159 salen: ::socklen_t, 3160 host: *mut ::c_char, 3161 hostlen: ::socklen_t, 3162 serv: *mut ::c_char, 3163 sevlen: ::socklen_t, 3164 flags: ::c_int, 3165 ) -> ::c_int; mincore( addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char, ) -> ::c_int3166 pub fn mincore( 3167 addr: *const ::c_void, 3168 len: ::size_t, 3169 vec: *mut ::c_char, 3170 ) -> ::c_int; sysctlnametomib( name: *const ::c_char, mibp: *mut ::c_int, sizep: *mut ::size_t, ) -> ::c_int3171 pub fn sysctlnametomib( 3172 name: *const ::c_char, 3173 mibp: *mut ::c_int, 3174 sizep: *mut ::size_t, 3175 ) -> ::c_int; 3176 #[cfg_attr( 3177 all(target_os = "macos", target_arch = "x86"), 3178 link_name = "mprotect$UNIX2003" 3179 )] mprotect( addr: *mut ::c_void, len: ::size_t, prot: ::c_int, ) -> ::c_int3180 pub fn mprotect( 3181 addr: *mut ::c_void, 3182 len: ::size_t, 3183 prot: ::c_int, 3184 ) -> ::c_int; semget(key: key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int3185 pub fn semget(key: key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int; 3186 #[cfg_attr( 3187 all(target_os = "macos", target_arch = "x86"), 3188 link_name = "semctl$UNIX2003" 3189 )] semctl( semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ... ) -> ::c_int3190 pub fn semctl( 3191 semid: ::c_int, 3192 semnum: ::c_int, 3193 cmd: ::c_int, 3194 ... 3195 ) -> ::c_int; semop( semid: ::c_int, sops: *mut sembuf, nsops: ::size_t, ) -> ::c_int3196 pub fn semop( 3197 semid: ::c_int, 3198 sops: *mut sembuf, 3199 nsops: ::size_t, 3200 ) -> ::c_int; shm_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::c_int3201 pub fn shm_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::c_int; ftok(pathname: *const c_char, proj_id: ::c_int) -> key_t3202 pub fn ftok(pathname: *const c_char, proj_id: ::c_int) -> key_t; shmat( shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int, ) -> *mut ::c_void3203 pub fn shmat( 3204 shmid: ::c_int, 3205 shmaddr: *const ::c_void, 3206 shmflg: ::c_int, 3207 ) -> *mut ::c_void; shmdt(shmaddr: *const ::c_void) -> ::c_int3208 pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int; 3209 #[cfg_attr( 3210 all(target_os = "macos", target_arch = "x86"), 3211 link_name = "shmctl$UNIX2003" 3212 )] shmctl( shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds, ) -> ::c_int3213 pub fn shmctl( 3214 shmid: ::c_int, 3215 cmd: ::c_int, 3216 buf: *mut ::shmid_ds, 3217 ) -> ::c_int; shmget(key: key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int3218 pub fn shmget(key: key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int; sysctl( name: *mut ::c_int, namelen: ::c_uint, oldp: *mut ::c_void, oldlenp: *mut ::size_t, newp: *mut ::c_void, newlen: ::size_t, ) -> ::c_int3219 pub fn sysctl( 3220 name: *mut ::c_int, 3221 namelen: ::c_uint, 3222 oldp: *mut ::c_void, 3223 oldlenp: *mut ::size_t, 3224 newp: *mut ::c_void, 3225 newlen: ::size_t, 3226 ) -> ::c_int; sysctlbyname( name: *const ::c_char, oldp: *mut ::c_void, oldlenp: *mut ::size_t, newp: *mut ::c_void, newlen: ::size_t, ) -> ::c_int3227 pub fn sysctlbyname( 3228 name: *const ::c_char, 3229 oldp: *mut ::c_void, 3230 oldlenp: *mut ::size_t, 3231 newp: *mut ::c_void, 3232 newlen: ::size_t, 3233 ) -> ::c_int; 3234 #[deprecated(since = "0.2.55", note = "Use the mach crate")] mach_absolute_time() -> u643235 pub fn mach_absolute_time() -> u64; 3236 #[deprecated(since = "0.2.55", note = "Use the mach crate")] 3237 #[allow(deprecated)] mach_timebase_info(info: *mut ::mach_timebase_info) -> ::c_int3238 pub fn mach_timebase_info(info: *mut ::mach_timebase_info) -> ::c_int; pthread_setname_np(name: *const ::c_char) -> ::c_int3239 pub fn pthread_setname_np(name: *const ::c_char) -> ::c_int; pthread_getname_np( thread: ::pthread_t, name: *mut ::c_char, len: ::size_t, ) -> ::c_int3240 pub fn pthread_getname_np( 3241 thread: ::pthread_t, 3242 name: *mut ::c_char, 3243 len: ::size_t, 3244 ) -> ::c_int; pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void3245 pub fn pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void; pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t3246 pub fn pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t; pthread_condattr_setpshared( attr: *mut pthread_condattr_t, pshared: ::c_int, ) -> ::c_int3247 pub fn pthread_condattr_setpshared( 3248 attr: *mut pthread_condattr_t, 3249 pshared: ::c_int, 3250 ) -> ::c_int; pthread_condattr_getpshared( attr: *const pthread_condattr_t, pshared: *mut ::c_int, ) -> ::c_int3251 pub fn pthread_condattr_getpshared( 3252 attr: *const pthread_condattr_t, 3253 pshared: *mut ::c_int, 3254 ) -> ::c_int; pthread_mutexattr_setpshared( attr: *mut pthread_mutexattr_t, pshared: ::c_int, ) -> ::c_int3255 pub fn pthread_mutexattr_setpshared( 3256 attr: *mut pthread_mutexattr_t, 3257 pshared: ::c_int, 3258 ) -> ::c_int; pthread_mutexattr_getpshared( attr: *const pthread_mutexattr_t, pshared: *mut ::c_int, ) -> ::c_int3259 pub fn pthread_mutexattr_getpshared( 3260 attr: *const pthread_mutexattr_t, 3261 pshared: *mut ::c_int, 3262 ) -> ::c_int; pthread_rwlockattr_getpshared( attr: *const pthread_rwlockattr_t, val: *mut ::c_int, ) -> ::c_int3263 pub fn pthread_rwlockattr_getpshared( 3264 attr: *const pthread_rwlockattr_t, 3265 val: *mut ::c_int, 3266 ) -> ::c_int; pthread_rwlockattr_setpshared( attr: *mut pthread_rwlockattr_t, val: ::c_int, ) -> ::c_int3267 pub fn pthread_rwlockattr_setpshared( 3268 attr: *mut pthread_rwlockattr_t, 3269 val: ::c_int, 3270 ) -> ::c_int; __error() -> *mut ::c_int3271 pub fn __error() -> *mut ::c_int; backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int3272 pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int; 3273 #[cfg_attr(target_os = "macos", link_name = "statfs$INODE64")] statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int3274 pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; 3275 #[cfg_attr(target_os = "macos", link_name = "fstatfs$INODE64")] fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int3276 pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; kevent( kq: ::c_int, changelist: *const ::kevent, nchanges: ::c_int, eventlist: *mut ::kevent, nevents: ::c_int, timeout: *const ::timespec, ) -> ::c_int3277 pub fn kevent( 3278 kq: ::c_int, 3279 changelist: *const ::kevent, 3280 nchanges: ::c_int, 3281 eventlist: *mut ::kevent, 3282 nevents: ::c_int, 3283 timeout: *const ::timespec, 3284 ) -> ::c_int; kevent64( kq: ::c_int, changelist: *const ::kevent64_s, nchanges: ::c_int, eventlist: *mut ::kevent64_s, nevents: ::c_int, flags: ::c_uint, timeout: *const ::timespec, ) -> ::c_int3285 pub fn kevent64( 3286 kq: ::c_int, 3287 changelist: *const ::kevent64_s, 3288 nchanges: ::c_int, 3289 eventlist: *mut ::kevent64_s, 3290 nevents: ::c_int, 3291 flags: ::c_uint, 3292 timeout: *const ::timespec, 3293 ) -> ::c_int; mount( src: *const ::c_char, target: *const ::c_char, flags: ::c_int, data: *mut ::c_void, ) -> ::c_int3294 pub fn mount( 3295 src: *const ::c_char, 3296 target: *const ::c_char, 3297 flags: ::c_int, 3298 data: *mut ::c_void, 3299 ) -> ::c_int; ptrace( request: ::c_int, pid: ::pid_t, addr: *mut ::c_char, data: ::c_int, ) -> ::c_int3300 pub fn ptrace( 3301 request: ::c_int, 3302 pid: ::pid_t, 3303 addr: *mut ::c_char, 3304 data: ::c_int, 3305 ) -> ::c_int; quotactl( special: *const ::c_char, cmd: ::c_int, id: ::c_int, data: *mut ::c_char, ) -> ::c_int3306 pub fn quotactl( 3307 special: *const ::c_char, 3308 cmd: ::c_int, 3309 id: ::c_int, 3310 data: *mut ::c_char, 3311 ) -> ::c_int; sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int3312 pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int; sendfile( fd: ::c_int, s: ::c_int, offset: ::off_t, len: *mut ::off_t, hdtr: *mut ::sf_hdtr, flags: ::c_int, ) -> ::c_int3313 pub fn sendfile( 3314 fd: ::c_int, 3315 s: ::c_int, 3316 offset: ::off_t, 3317 len: *mut ::off_t, 3318 hdtr: *mut ::sf_hdtr, 3319 flags: ::c_int, 3320 ) -> ::c_int; futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int3321 pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; utimensat( dirfd: ::c_int, path: *const ::c_char, times: *const ::timespec, flag: ::c_int, ) -> ::c_int3322 pub fn utimensat( 3323 dirfd: ::c_int, 3324 path: *const ::c_char, 3325 times: *const ::timespec, 3326 flag: ::c_int, 3327 ) -> ::c_int; openpty( amaster: *mut ::c_int, aslave: *mut ::c_int, name: *mut ::c_char, termp: *mut termios, winp: *mut ::winsize, ) -> ::c_int3328 pub fn openpty( 3329 amaster: *mut ::c_int, 3330 aslave: *mut ::c_int, 3331 name: *mut ::c_char, 3332 termp: *mut termios, 3333 winp: *mut ::winsize, 3334 ) -> ::c_int; forkpty( amaster: *mut ::c_int, name: *mut ::c_char, termp: *mut termios, winp: *mut ::winsize, ) -> ::pid_t3335 pub fn forkpty( 3336 amaster: *mut ::c_int, 3337 name: *mut ::c_char, 3338 termp: *mut termios, 3339 winp: *mut ::winsize, 3340 ) -> ::pid_t; login_tty(fd: ::c_int) -> ::c_int3341 pub fn login_tty(fd: ::c_int) -> ::c_int; duplocale(base: ::locale_t) -> ::locale_t3342 pub fn duplocale(base: ::locale_t) -> ::locale_t; freelocale(loc: ::locale_t) -> ::c_int3343 pub fn freelocale(loc: ::locale_t) -> ::c_int; localeconv_l(loc: ::locale_t) -> *mut lconv3344 pub fn localeconv_l(loc: ::locale_t) -> *mut lconv; newlocale( mask: ::c_int, locale: *const ::c_char, base: ::locale_t, ) -> ::locale_t3345 pub fn newlocale( 3346 mask: ::c_int, 3347 locale: *const ::c_char, 3348 base: ::locale_t, 3349 ) -> ::locale_t; uselocale(loc: ::locale_t) -> ::locale_t3350 pub fn uselocale(loc: ::locale_t) -> ::locale_t; querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char3351 pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char; getpriority(which: ::c_int, who: ::id_t) -> ::c_int3352 pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int; setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int3353 pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int; getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int3354 pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int; setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int3355 pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int; getxattr( path: *const ::c_char, name: *const ::c_char, value: *mut ::c_void, size: ::size_t, position: u32, flags: ::c_int, ) -> ::ssize_t3356 pub fn getxattr( 3357 path: *const ::c_char, 3358 name: *const ::c_char, 3359 value: *mut ::c_void, 3360 size: ::size_t, 3361 position: u32, 3362 flags: ::c_int, 3363 ) -> ::ssize_t; fgetxattr( filedes: ::c_int, name: *const ::c_char, value: *mut ::c_void, size: ::size_t, position: u32, flags: ::c_int, ) -> ::ssize_t3364 pub fn fgetxattr( 3365 filedes: ::c_int, 3366 name: *const ::c_char, 3367 value: *mut ::c_void, 3368 size: ::size_t, 3369 position: u32, 3370 flags: ::c_int, 3371 ) -> ::ssize_t; setxattr( path: *const ::c_char, name: *const ::c_char, value: *const ::c_void, size: ::size_t, position: u32, flags: ::c_int, ) -> ::c_int3372 pub fn setxattr( 3373 path: *const ::c_char, 3374 name: *const ::c_char, 3375 value: *const ::c_void, 3376 size: ::size_t, 3377 position: u32, 3378 flags: ::c_int, 3379 ) -> ::c_int; fsetxattr( filedes: ::c_int, name: *const ::c_char, value: *const ::c_void, size: ::size_t, position: u32, flags: ::c_int, ) -> ::c_int3380 pub fn fsetxattr( 3381 filedes: ::c_int, 3382 name: *const ::c_char, 3383 value: *const ::c_void, 3384 size: ::size_t, 3385 position: u32, 3386 flags: ::c_int, 3387 ) -> ::c_int; listxattr( path: *const ::c_char, list: *mut ::c_char, size: ::size_t, flags: ::c_int, ) -> ::ssize_t3388 pub fn listxattr( 3389 path: *const ::c_char, 3390 list: *mut ::c_char, 3391 size: ::size_t, 3392 flags: ::c_int, 3393 ) -> ::ssize_t; flistxattr( filedes: ::c_int, list: *mut ::c_char, size: ::size_t, flags: ::c_int, ) -> ::ssize_t3394 pub fn flistxattr( 3395 filedes: ::c_int, 3396 list: *mut ::c_char, 3397 size: ::size_t, 3398 flags: ::c_int, 3399 ) -> ::ssize_t; removexattr( path: *const ::c_char, name: *const ::c_char, flags: ::c_int, ) -> ::c_int3400 pub fn removexattr( 3401 path: *const ::c_char, 3402 name: *const ::c_char, 3403 flags: ::c_int, 3404 ) -> ::c_int; renamex_np( from: *const ::c_char, to: *const ::c_char, flags: ::c_uint, ) -> ::c_int3405 pub fn renamex_np( 3406 from: *const ::c_char, 3407 to: *const ::c_char, 3408 flags: ::c_uint, 3409 ) -> ::c_int; renameatx_np( fromfd: ::c_int, from: *const ::c_char, tofd: ::c_int, to: *const ::c_char, flags: ::c_uint, ) -> ::c_int3410 pub fn renameatx_np( 3411 fromfd: ::c_int, 3412 from: *const ::c_char, 3413 tofd: ::c_int, 3414 to: *const ::c_char, 3415 flags: ::c_uint, 3416 ) -> ::c_int; fremovexattr( filedes: ::c_int, name: *const ::c_char, flags: ::c_int, ) -> ::c_int3417 pub fn fremovexattr( 3418 filedes: ::c_int, 3419 name: *const ::c_char, 3420 flags: ::c_int, 3421 ) -> ::c_int; 3422 getgrouplist( name: *const ::c_char, basegid: ::c_int, groups: *mut ::c_int, ngroups: *mut ::c_int, ) -> ::c_int3423 pub fn getgrouplist( 3424 name: *const ::c_char, 3425 basegid: ::c_int, 3426 groups: *mut ::c_int, 3427 ngroups: *mut ::c_int, 3428 ) -> ::c_int; initgroups(user: *const ::c_char, basegroup: ::c_int) -> ::c_int3429 pub fn initgroups(user: *const ::c_char, basegroup: ::c_int) -> ::c_int; 3430 3431 #[cfg_attr( 3432 all(target_os = "macos", target_arch = "x86"), 3433 link_name = "waitid$UNIX2003" 3434 )] waitid( idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int, ) -> ::c_int3435 pub fn waitid( 3436 idtype: idtype_t, 3437 id: id_t, 3438 infop: *mut ::siginfo_t, 3439 options: ::c_int, 3440 ) -> ::c_int; brk(addr: *const ::c_void) -> *mut ::c_void3441 pub fn brk(addr: *const ::c_void) -> *mut ::c_void; sbrk(increment: ::c_int) -> *mut ::c_void3442 pub fn sbrk(increment: ::c_int) -> *mut ::c_void; settimeofday( tv: *const ::timeval, tz: *const ::timezone, ) -> ::c_int3443 pub fn settimeofday( 3444 tv: *const ::timeval, 3445 tz: *const ::timezone, 3446 ) -> ::c_int; 3447 #[deprecated(since = "0.2.55", note = "Use the mach crate")] _dyld_image_count() -> u323448 pub fn _dyld_image_count() -> u32; 3449 #[deprecated(since = "0.2.55", note = "Use the mach crate")] 3450 #[allow(deprecated)] _dyld_get_image_header(image_index: u32) -> *const mach_header3451 pub fn _dyld_get_image_header(image_index: u32) -> *const mach_header; 3452 #[deprecated(since = "0.2.55", note = "Use the mach crate")] _dyld_get_image_vmaddr_slide(image_index: u32) -> ::intptr_t3453 pub fn _dyld_get_image_vmaddr_slide(image_index: u32) -> ::intptr_t; 3454 #[deprecated(since = "0.2.55", note = "Use the mach crate")] _dyld_get_image_name(image_index: u32) -> *const ::c_char3455 pub fn _dyld_get_image_name(image_index: u32) -> *const ::c_char; 3456 posix_spawn( pid: *mut ::pid_t, path: *const ::c_char, file_actions: *const ::posix_spawn_file_actions_t, attrp: *const ::posix_spawnattr_t, argv: *const *mut ::c_char, envp: *const *mut ::c_char, ) -> ::c_int3457 pub fn posix_spawn( 3458 pid: *mut ::pid_t, 3459 path: *const ::c_char, 3460 file_actions: *const ::posix_spawn_file_actions_t, 3461 attrp: *const ::posix_spawnattr_t, 3462 argv: *const *mut ::c_char, 3463 envp: *const *mut ::c_char, 3464 ) -> ::c_int; posix_spawnp( pid: *mut ::pid_t, file: *const ::c_char, file_actions: *const ::posix_spawn_file_actions_t, attrp: *const ::posix_spawnattr_t, argv: *const *mut ::c_char, envp: *const *mut ::c_char, ) -> ::c_int3465 pub fn posix_spawnp( 3466 pid: *mut ::pid_t, 3467 file: *const ::c_char, 3468 file_actions: *const ::posix_spawn_file_actions_t, 3469 attrp: *const ::posix_spawnattr_t, 3470 argv: *const *mut ::c_char, 3471 envp: *const *mut ::c_char, 3472 ) -> ::c_int; posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int3473 pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int; posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int3474 pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int; posix_spawnattr_getsigdefault( attr: *const posix_spawnattr_t, default: *mut ::sigset_t, ) -> ::c_int3475 pub fn posix_spawnattr_getsigdefault( 3476 attr: *const posix_spawnattr_t, 3477 default: *mut ::sigset_t, 3478 ) -> ::c_int; posix_spawnattr_setsigdefault( attr: *mut posix_spawnattr_t, default: *const ::sigset_t, ) -> ::c_int3479 pub fn posix_spawnattr_setsigdefault( 3480 attr: *mut posix_spawnattr_t, 3481 default: *const ::sigset_t, 3482 ) -> ::c_int; posix_spawnattr_getsigmask( attr: *const posix_spawnattr_t, default: *mut ::sigset_t, ) -> ::c_int3483 pub fn posix_spawnattr_getsigmask( 3484 attr: *const posix_spawnattr_t, 3485 default: *mut ::sigset_t, 3486 ) -> ::c_int; posix_spawnattr_setsigmask( attr: *mut posix_spawnattr_t, default: *const ::sigset_t, ) -> ::c_int3487 pub fn posix_spawnattr_setsigmask( 3488 attr: *mut posix_spawnattr_t, 3489 default: *const ::sigset_t, 3490 ) -> ::c_int; posix_spawnattr_getflags( attr: *const posix_spawnattr_t, flags: *mut ::c_short, ) -> ::c_int3491 pub fn posix_spawnattr_getflags( 3492 attr: *const posix_spawnattr_t, 3493 flags: *mut ::c_short, 3494 ) -> ::c_int; posix_spawnattr_setflags( attr: *mut posix_spawnattr_t, flags: ::c_short, ) -> ::c_int3495 pub fn posix_spawnattr_setflags( 3496 attr: *mut posix_spawnattr_t, 3497 flags: ::c_short, 3498 ) -> ::c_int; posix_spawnattr_getpgroup( attr: *const posix_spawnattr_t, flags: *mut ::pid_t, ) -> ::c_int3499 pub fn posix_spawnattr_getpgroup( 3500 attr: *const posix_spawnattr_t, 3501 flags: *mut ::pid_t, 3502 ) -> ::c_int; posix_spawnattr_setpgroup( attr: *mut posix_spawnattr_t, flags: ::pid_t, ) -> ::c_int3503 pub fn posix_spawnattr_setpgroup( 3504 attr: *mut posix_spawnattr_t, 3505 flags: ::pid_t, 3506 ) -> ::c_int; 3507 posix_spawn_file_actions_init( actions: *mut posix_spawn_file_actions_t, ) -> ::c_int3508 pub fn posix_spawn_file_actions_init( 3509 actions: *mut posix_spawn_file_actions_t, 3510 ) -> ::c_int; posix_spawn_file_actions_destroy( actions: *mut posix_spawn_file_actions_t, ) -> ::c_int3511 pub fn posix_spawn_file_actions_destroy( 3512 actions: *mut posix_spawn_file_actions_t, 3513 ) -> ::c_int; posix_spawn_file_actions_addopen( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, path: *const ::c_char, oflag: ::c_int, mode: ::mode_t, ) -> ::c_int3514 pub fn posix_spawn_file_actions_addopen( 3515 actions: *mut posix_spawn_file_actions_t, 3516 fd: ::c_int, 3517 path: *const ::c_char, 3518 oflag: ::c_int, 3519 mode: ::mode_t, 3520 ) -> ::c_int; posix_spawn_file_actions_addclose( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, ) -> ::c_int3521 pub fn posix_spawn_file_actions_addclose( 3522 actions: *mut posix_spawn_file_actions_t, 3523 fd: ::c_int, 3524 ) -> ::c_int; posix_spawn_file_actions_adddup2( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, newfd: ::c_int, ) -> ::c_int3525 pub fn posix_spawn_file_actions_adddup2( 3526 actions: *mut posix_spawn_file_actions_t, 3527 fd: ::c_int, 3528 newfd: ::c_int, 3529 ) -> ::c_int; uname(buf: *mut ::utsname) -> ::c_int3530 pub fn uname(buf: *mut ::utsname) -> ::c_int; 3531 } 3532 3533 cfg_if! { 3534 if #[cfg(any(target_arch = "arm", target_arch = "x86"))] { 3535 mod b32; 3536 pub use self::b32::*; 3537 } else if #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] { 3538 mod b64; 3539 pub use self::b64::*; 3540 } else { 3541 // Unknown target_arch 3542 } 3543 } 3544