1 //! Apple (ios/darwin)-specific definitions 2 //! 3 //! This covers *-apple-* triples currently 4 pub type c_char = i8; 5 pub type wchar_t = i32; 6 pub type clock_t = c_ulong; 7 pub type time_t = c_long; 8 pub type suseconds_t = i32; 9 pub type dev_t = i32; 10 pub type ino_t = u64; 11 pub type mode_t = u16; 12 pub type nlink_t = u16; 13 pub type blksize_t = i32; 14 pub type rlim_t = u64; 15 pub type pthread_key_t = c_ulong; 16 pub type sigset_t = u32; 17 pub type clockid_t = ::c_uint; 18 pub type fsblkcnt_t = ::c_uint; 19 pub type fsfilcnt_t = ::c_uint; 20 pub type speed_t = ::c_ulong; 21 pub type tcflag_t = ::c_ulong; 22 pub type nl_item = ::c_int; 23 pub type id_t = ::c_uint; 24 pub type sem_t = ::c_int; 25 pub type idtype_t = ::c_uint; 26 pub type integer_t = ::c_int; 27 pub type cpu_type_t = integer_t; 28 pub type cpu_subtype_t = integer_t; 29 pub type natural_t = u32; 30 pub type mach_msg_type_number_t = natural_t; 31 pub type kern_return_t = ::c_int; 32 pub type uuid_t = [u8; 16]; 33 34 pub type posix_spawnattr_t = *mut ::c_void; 35 pub type posix_spawn_file_actions_t = *mut ::c_void; 36 pub type key_t = ::c_int; 37 pub type shmatt_t = ::c_ushort; 38 39 pub type sae_associd_t = u32; 40 pub type sae_connid_t = u32; 41 42 pub type mach_port_t = ::c_uint; 43 pub type processor_flavor_t = ::c_int; 44 pub type thread_flavor_t = natural_t; 45 pub type thread_inspect_t = mach_port_t; 46 pub type policy_t = ::c_int; 47 pub type mach_vm_address_t = u64; 48 pub type mach_vm_offset_t = u64; 49 pub type mach_vm_size_t = u64; 50 pub type vm_map_t = ::mach_port_t; 51 pub type mem_entry_name_port_t = ::mach_port_t; 52 pub type memory_object_t = ::mach_port_t; 53 pub type memory_object_offset_t = ::c_ulonglong; 54 pub type vm_inherit_t = ::c_uint; 55 pub type vm_prot_t = ::c_int; 56 57 pub type iconv_t = *mut ::c_void; 58 59 pub type processor_cpu_load_info_t = *mut processor_cpu_load_info; 60 pub type processor_cpu_load_info_data_t = processor_cpu_load_info; 61 pub type processor_basic_info_t = *mut processor_basic_info; 62 pub type processor_basic_info_data_t = processor_basic_info; 63 pub type processor_set_basic_info_data_t = processor_set_basic_info; 64 pub type processor_set_basic_info_t = *mut processor_set_basic_info; 65 pub type processor_set_load_info_data_t = processor_set_load_info; 66 pub type processor_set_load_info_t = *mut processor_set_load_info; 67 pub type processor_info_t = *mut integer_t; 68 pub type processor_info_array_t = *mut integer_t; 69 70 pub type thread_info_t = *mut integer_t; 71 pub type thread_basic_info_t = *mut thread_basic_info; 72 pub type thread_basic_info_data_t = thread_basic_info; 73 pub type thread_identifier_info_t = *mut thread_identifier_info; 74 pub type thread_identifier_info_data_t = thread_identifier_info; 75 pub type thread_extended_info_t = *mut thread_extended_info; 76 pub type thread_extended_info_data_t = thread_extended_info; 77 78 pub type thread_t = mach_port_t; 79 pub type thread_policy_flavor_t = natural_t; 80 pub type thread_policy_t = *mut integer_t; 81 pub type thread_latency_qos_t = integer_t; 82 pub type thread_throughput_qos_t = integer_t; 83 pub type thread_standard_policy_data_t = thread_standard_policy; 84 pub type thread_standard_policy_t = *mut thread_standard_policy; 85 pub type thread_extended_policy_data_t = thread_extended_policy; 86 pub type thread_extended_policy_t = *mut thread_extended_policy; 87 pub type thread_time_constraint_policy_data_t = thread_time_constraint_policy; 88 pub type thread_time_constraint_policy_t = *mut thread_time_constraint_policy; 89 pub type thread_precedence_policy_data_t = thread_precedence_policy; 90 pub type thread_precedence_policy_t = *mut thread_precedence_policy; 91 pub type thread_affinity_policy_data_t = thread_affinity_policy; 92 pub type thread_affinity_policy_t = *mut thread_affinity_policy; 93 pub type thread_background_policy_data_t = thread_background_policy; 94 pub type thread_background_policy_t = *mut thread_background_policy; 95 pub type thread_latency_qos_policy_data_t = thread_latency_qos_policy; 96 pub type thread_latency_qos_policy_t = *mut thread_latency_qos_policy; 97 pub type thread_throughput_qos_policy_data_t = thread_throughput_qos_policy; 98 pub type thread_throughput_qos_policy_t = *mut thread_throughput_qos_policy; 99 100 pub type CCStatus = i32; 101 pub type CCCryptorStatus = i32; 102 pub type CCRNGStatus = ::CCCryptorStatus; 103 104 deprecated_mach! { 105 pub type vm_size_t = ::uintptr_t; 106 pub type mach_timebase_info_data_t = mach_timebase_info; 107 } 108 109 #[cfg_attr(feature = "extra_traits", derive(Debug))] 110 pub enum timezone {} 111 impl ::Copy for timezone {} 112 impl ::Clone for timezone { clone(&self) -> timezone113 fn clone(&self) -> timezone { 114 *self 115 } 116 } 117 118 #[cfg_attr(feature = "extra_traits", derive(Debug))] 119 #[repr(u32)] 120 pub enum qos_class_t { 121 QOS_CLASS_USER_INTERACTIVE = 0x21, 122 QOS_CLASS_USER_INITIATED = 0x19, 123 QOS_CLASS_DEFAULT = 0x15, 124 QOS_CLASS_UTILITY = 0x11, 125 QOS_CLASS_BACKGROUND = 0x09, 126 QOS_CLASS_UNSPECIFIED = 0x00, 127 } 128 impl ::Copy for qos_class_t {} 129 impl ::Clone for qos_class_t { clone(&self) -> qos_class_t130 fn clone(&self) -> qos_class_t { 131 *self 132 } 133 } 134 135 s! { 136 pub struct ip_mreq { 137 pub imr_multiaddr: in_addr, 138 pub imr_interface: in_addr, 139 } 140 141 pub struct aiocb { 142 pub aio_fildes: ::c_int, 143 pub aio_offset: ::off_t, 144 pub aio_buf: *mut ::c_void, 145 pub aio_nbytes: ::size_t, 146 pub aio_reqprio: ::c_int, 147 pub aio_sigevent: sigevent, 148 pub aio_lio_opcode: ::c_int 149 } 150 151 pub struct glob_t { 152 pub gl_pathc: ::size_t, 153 __unused1: ::c_int, 154 pub gl_offs: ::size_t, 155 __unused2: ::c_int, 156 pub gl_pathv: *mut *mut ::c_char, 157 158 __unused3: *mut ::c_void, 159 160 __unused4: *mut ::c_void, 161 __unused5: *mut ::c_void, 162 __unused6: *mut ::c_void, 163 __unused7: *mut ::c_void, 164 __unused8: *mut ::c_void, 165 } 166 167 pub struct addrinfo { 168 pub ai_flags: ::c_int, 169 pub ai_family: ::c_int, 170 pub ai_socktype: ::c_int, 171 pub ai_protocol: ::c_int, 172 pub ai_addrlen: ::socklen_t, 173 pub ai_canonname: *mut ::c_char, 174 pub ai_addr: *mut ::sockaddr, 175 pub ai_next: *mut addrinfo, 176 } 177 178 #[deprecated( 179 since = "0.2.55", 180 note = "Use the `mach` crate instead", 181 )] 182 pub struct mach_timebase_info { 183 pub numer: u32, 184 pub denom: u32, 185 } 186 187 pub struct stat { 188 pub st_dev: dev_t, 189 pub st_mode: mode_t, 190 pub st_nlink: nlink_t, 191 pub st_ino: ino_t, 192 pub st_uid: ::uid_t, 193 pub st_gid: ::gid_t, 194 pub st_rdev: dev_t, 195 pub st_atime: time_t, 196 pub st_atime_nsec: c_long, 197 pub st_mtime: time_t, 198 pub st_mtime_nsec: c_long, 199 pub st_ctime: time_t, 200 pub st_ctime_nsec: c_long, 201 pub st_birthtime: time_t, 202 pub st_birthtime_nsec: c_long, 203 pub st_size: ::off_t, 204 pub st_blocks: ::blkcnt_t, 205 pub st_blksize: blksize_t, 206 pub st_flags: u32, 207 pub st_gen: u32, 208 pub st_lspare: i32, 209 pub st_qspare: [i64; 2], 210 } 211 212 pub struct pthread_mutexattr_t { 213 __sig: ::c_long, 214 __opaque: [u8; 8], 215 } 216 217 pub struct pthread_condattr_t { 218 __sig: ::c_long, 219 __opaque: [u8; __PTHREAD_CONDATTR_SIZE__], 220 } 221 222 pub struct pthread_rwlockattr_t { 223 __sig: ::c_long, 224 __opaque: [u8; __PTHREAD_RWLOCKATTR_SIZE__], 225 } 226 227 pub struct siginfo_t { 228 pub si_signo: ::c_int, 229 pub si_errno: ::c_int, 230 pub si_code: ::c_int, 231 pub si_pid: ::pid_t, 232 pub si_uid: ::uid_t, 233 pub si_status: ::c_int, 234 pub si_addr: *mut ::c_void, 235 //Requires it to be union for tests 236 //pub si_value: ::sigval, 237 _pad: [usize; 9], 238 } 239 240 pub struct sigaction { 241 // FIXME: this field is actually a union 242 pub sa_sigaction: ::sighandler_t, 243 pub sa_mask: sigset_t, 244 pub sa_flags: ::c_int, 245 } 246 247 pub struct stack_t { 248 pub ss_sp: *mut ::c_void, 249 pub ss_size: ::size_t, 250 pub ss_flags: ::c_int, 251 } 252 253 pub struct fstore_t { 254 pub fst_flags: ::c_uint, 255 pub fst_posmode: ::c_int, 256 pub fst_offset: ::off_t, 257 pub fst_length: ::off_t, 258 pub fst_bytesalloc: ::off_t, 259 } 260 261 pub struct radvisory { 262 pub ra_offset: ::off_t, 263 pub ra_count: ::c_int, 264 } 265 266 pub struct statvfs { 267 pub f_bsize: ::c_ulong, 268 pub f_frsize: ::c_ulong, 269 pub f_blocks: ::fsblkcnt_t, 270 pub f_bfree: ::fsblkcnt_t, 271 pub f_bavail: ::fsblkcnt_t, 272 pub f_files: ::fsfilcnt_t, 273 pub f_ffree: ::fsfilcnt_t, 274 pub f_favail: ::fsfilcnt_t, 275 pub f_fsid: ::c_ulong, 276 pub f_flag: ::c_ulong, 277 pub f_namemax: ::c_ulong, 278 } 279 280 pub struct Dl_info { 281 pub dli_fname: *const ::c_char, 282 pub dli_fbase: *mut ::c_void, 283 pub dli_sname: *const ::c_char, 284 pub dli_saddr: *mut ::c_void, 285 } 286 287 pub struct sockaddr_in { 288 pub sin_len: u8, 289 pub sin_family: ::sa_family_t, 290 pub sin_port: ::in_port_t, 291 pub sin_addr: ::in_addr, 292 pub sin_zero: [::c_char; 8], 293 } 294 295 pub struct kevent64_s { 296 pub ident: u64, 297 pub filter: i16, 298 pub flags: u16, 299 pub fflags: u32, 300 pub data: i64, 301 pub udata: u64, 302 pub ext: [u64; 2], 303 } 304 305 pub struct dqblk { 306 pub dqb_bhardlimit: u64, 307 pub dqb_bsoftlimit: u64, 308 pub dqb_curbytes: u64, 309 pub dqb_ihardlimit: u32, 310 pub dqb_isoftlimit: u32, 311 pub dqb_curinodes: u32, 312 pub dqb_btime: u32, 313 pub dqb_itime: u32, 314 pub dqb_id: u32, 315 pub dqb_spare: [u32; 4], 316 } 317 318 pub struct if_msghdr { 319 pub ifm_msglen: ::c_ushort, 320 pub ifm_version: ::c_uchar, 321 pub ifm_type: ::c_uchar, 322 pub ifm_addrs: ::c_int, 323 pub ifm_flags: ::c_int, 324 pub ifm_index: ::c_ushort, 325 pub ifm_data: if_data, 326 } 327 328 pub struct termios { 329 pub c_iflag: ::tcflag_t, 330 pub c_oflag: ::tcflag_t, 331 pub c_cflag: ::tcflag_t, 332 pub c_lflag: ::tcflag_t, 333 pub c_cc: [::cc_t; ::NCCS], 334 pub c_ispeed: ::speed_t, 335 pub c_ospeed: ::speed_t, 336 } 337 338 pub struct flock { 339 pub l_start: ::off_t, 340 pub l_len: ::off_t, 341 pub l_pid: ::pid_t, 342 pub l_type: ::c_short, 343 pub l_whence: ::c_short, 344 } 345 346 pub struct sf_hdtr { 347 pub headers: *mut ::iovec, 348 pub hdr_cnt: ::c_int, 349 pub trailers: *mut ::iovec, 350 pub trl_cnt: ::c_int, 351 } 352 353 pub struct lconv { 354 pub decimal_point: *mut ::c_char, 355 pub thousands_sep: *mut ::c_char, 356 pub grouping: *mut ::c_char, 357 pub int_curr_symbol: *mut ::c_char, 358 pub currency_symbol: *mut ::c_char, 359 pub mon_decimal_point: *mut ::c_char, 360 pub mon_thousands_sep: *mut ::c_char, 361 pub mon_grouping: *mut ::c_char, 362 pub positive_sign: *mut ::c_char, 363 pub negative_sign: *mut ::c_char, 364 pub int_frac_digits: ::c_char, 365 pub frac_digits: ::c_char, 366 pub p_cs_precedes: ::c_char, 367 pub p_sep_by_space: ::c_char, 368 pub n_cs_precedes: ::c_char, 369 pub n_sep_by_space: ::c_char, 370 pub p_sign_posn: ::c_char, 371 pub n_sign_posn: ::c_char, 372 pub int_p_cs_precedes: ::c_char, 373 pub int_n_cs_precedes: ::c_char, 374 pub int_p_sep_by_space: ::c_char, 375 pub int_n_sep_by_space: ::c_char, 376 pub int_p_sign_posn: ::c_char, 377 pub int_n_sign_posn: ::c_char, 378 } 379 380 pub struct proc_taskinfo { 381 pub pti_virtual_size: u64, 382 pub pti_resident_size: u64, 383 pub pti_total_user: u64, 384 pub pti_total_system: u64, 385 pub pti_threads_user: u64, 386 pub pti_threads_system: u64, 387 pub pti_policy: i32, 388 pub pti_faults: i32, 389 pub pti_pageins: i32, 390 pub pti_cow_faults: i32, 391 pub pti_messages_sent: i32, 392 pub pti_messages_received: i32, 393 pub pti_syscalls_mach: i32, 394 pub pti_syscalls_unix: i32, 395 pub pti_csw: i32, 396 pub pti_threadnum: i32, 397 pub pti_numrunning: i32, 398 pub pti_priority: i32, 399 } 400 401 pub struct proc_bsdinfo { 402 pub pbi_flags: u32, 403 pub pbi_status: u32, 404 pub pbi_xstatus: u32, 405 pub pbi_pid: u32, 406 pub pbi_ppid: u32, 407 pub pbi_uid: ::uid_t, 408 pub pbi_gid: ::gid_t, 409 pub pbi_ruid: ::uid_t, 410 pub pbi_rgid: ::gid_t, 411 pub pbi_svuid: ::uid_t, 412 pub pbi_svgid: ::gid_t, 413 pub rfu_1: u32, 414 pub pbi_comm: [::c_char; MAXCOMLEN], 415 pub pbi_name: [::c_char; 32], // MAXCOMLEN * 2, but macro isn't happy... 416 pub pbi_nfiles: u32, 417 pub pbi_pgid: u32, 418 pub pbi_pjobc: u32, 419 pub e_tdev: u32, 420 pub e_tpgid: u32, 421 pub pbi_nice: i32, 422 pub pbi_start_tvsec: u64, 423 pub pbi_start_tvusec: u64, 424 } 425 426 pub struct proc_taskallinfo { 427 pub pbsd: proc_bsdinfo, 428 pub ptinfo: proc_taskinfo, 429 } 430 431 pub struct xsw_usage { 432 pub xsu_total: u64, 433 pub xsu_avail: u64, 434 pub xsu_used: u64, 435 pub xsu_pagesize: u32, 436 pub xsu_encrypted: ::boolean_t, 437 } 438 439 pub struct xucred { 440 pub cr_version: ::c_uint, 441 pub cr_uid: ::uid_t, 442 pub cr_ngroups: ::c_short, 443 pub cr_groups: [::gid_t;16] 444 } 445 446 #[deprecated( 447 since = "0.2.55", 448 note = "Use the `mach` crate instead", 449 )] 450 pub struct mach_header { 451 pub magic: u32, 452 pub cputype: cpu_type_t, 453 pub cpusubtype: cpu_subtype_t, 454 pub filetype: u32, 455 pub ncmds: u32, 456 pub sizeofcmds: u32, 457 pub flags: u32, 458 } 459 460 #[deprecated( 461 since = "0.2.55", 462 note = "Use the `mach` crate instead", 463 )] 464 pub struct mach_header_64 { 465 pub magic: u32, 466 pub cputype: cpu_type_t, 467 pub cpusubtype: cpu_subtype_t, 468 pub filetype: u32, 469 pub ncmds: u32, 470 pub sizeofcmds: u32, 471 pub flags: u32, 472 pub reserved: u32, 473 } 474 475 pub struct segment_command { 476 pub cmd: u32, 477 pub cmdsize: u32, 478 pub segname: [::c_char; 16], 479 pub vmaddr: u32, 480 pub vmsize: u32, 481 pub fileoff: u32, 482 pub filesize: u32, 483 pub maxprot: vm_prot_t, 484 pub initprot: vm_prot_t, 485 pub nsects: u32, 486 pub flags: u32, 487 } 488 489 pub struct segment_command_64 { 490 pub cmd: u32, 491 pub cmdsize: u32, 492 pub segname: [::c_char; 16], 493 pub vmaddr: u64, 494 pub vmsize: u64, 495 pub fileoff: u64, 496 pub filesize: u64, 497 pub maxprot: vm_prot_t, 498 pub initprot: vm_prot_t, 499 pub nsects: u32, 500 pub flags: u32, 501 } 502 503 pub struct load_command { 504 pub cmd: u32, 505 pub cmdsize: u32, 506 } 507 508 pub struct sockaddr_dl { 509 pub sdl_len: ::c_uchar, 510 pub sdl_family: ::c_uchar, 511 pub sdl_index: ::c_ushort, 512 pub sdl_type: ::c_uchar, 513 pub sdl_nlen: ::c_uchar, 514 pub sdl_alen: ::c_uchar, 515 pub sdl_slen: ::c_uchar, 516 pub sdl_data: [::c_char; 12], 517 } 518 519 pub struct sockaddr_inarp { 520 pub sin_len: ::c_uchar, 521 pub sin_family: ::c_uchar, 522 pub sin_port: ::c_ushort, 523 pub sin_addr: ::in_addr, 524 pub sin_srcaddr: ::in_addr, 525 pub sin_tos: ::c_ushort, 526 pub sin_other: ::c_ushort, 527 } 528 529 pub struct sockaddr_ctl { 530 pub sc_len: ::c_uchar, 531 pub sc_family: ::c_uchar, 532 pub ss_sysaddr: u16, 533 pub sc_id: u32, 534 pub sc_unit: u32, 535 pub sc_reserved: [u32; 5], 536 } 537 538 pub struct in_pktinfo { 539 pub ipi_ifindex: ::c_uint, 540 pub ipi_spec_dst: ::in_addr, 541 pub ipi_addr: ::in_addr, 542 } 543 544 pub struct in6_pktinfo { 545 pub ipi6_addr: ::in6_addr, 546 pub ipi6_ifindex: ::c_uint, 547 } 548 549 // sys/ipc.h: 550 551 pub struct ipc_perm { 552 pub uid: ::uid_t, 553 pub gid: ::gid_t, 554 pub cuid: ::uid_t, 555 pub cgid: ::gid_t, 556 pub mode: ::mode_t, 557 pub _seq: ::c_ushort, 558 pub _key: ::key_t, 559 } 560 561 // sys/sem.h 562 563 pub struct sembuf { 564 pub sem_num: ::c_ushort, 565 pub sem_op: ::c_short, 566 pub sem_flg: ::c_short, 567 } 568 569 // sys/shm.h 570 571 pub struct arphdr { 572 pub ar_hrd: u16, 573 pub ar_pro: u16, 574 pub ar_hln: u8, 575 pub ar_pln: u8, 576 pub ar_op: u16, 577 } 578 579 pub struct in_addr { 580 pub s_addr: ::in_addr_t, 581 } 582 583 // sys/socket.h 584 585 pub struct sa_endpoints_t { 586 pub sae_srcif: ::c_uint, // optional source interface 587 pub sae_srcaddr: *const ::sockaddr, // optional source address 588 pub sae_srcaddrlen: ::socklen_t, // size of source address 589 pub sae_dstaddr: *const ::sockaddr, // destination address 590 pub sae_dstaddrlen: ::socklen_t, // size of destination address 591 } 592 593 pub struct timex { 594 pub modes: ::c_uint, 595 pub offset: ::c_long, 596 pub freq: ::c_long, 597 pub maxerror: ::c_long, 598 pub esterror: ::c_long, 599 pub status: ::c_int, 600 pub constant: ::c_long, 601 pub precision: ::c_long, 602 pub tolerance: ::c_long, 603 pub ppsfreq: ::c_long, 604 pub jitter: ::c_long, 605 pub shift: ::c_int, 606 pub stabil: ::c_long, 607 pub jitcnt: ::c_long, 608 pub calcnt: ::c_long, 609 pub errcnt: ::c_long, 610 pub stbcnt: ::c_long, 611 } 612 613 pub struct ntptimeval { 614 pub time: ::timespec, 615 pub maxerror: ::c_long, 616 pub esterror: ::c_long, 617 pub tai: ::c_long, 618 pub time_state: ::c_int, 619 } 620 621 pub struct thread_standard_policy { 622 pub no_data: natural_t, 623 } 624 625 pub struct thread_extended_policy { 626 pub timeshare: boolean_t, 627 } 628 629 pub struct thread_time_constraint_policy { 630 pub period: u32, 631 pub computation: u32, 632 pub constraint: u32, 633 pub preemptible: boolean_t, 634 } 635 636 pub struct thread_precedence_policy { 637 pub importance: integer_t, 638 } 639 640 pub struct thread_affinity_policy { 641 pub affinity_tag: integer_t, 642 } 643 644 pub struct thread_background_policy { 645 pub priority: integer_t, 646 } 647 648 pub struct thread_latency_qos_policy { 649 pub thread_latency_qos_tier: thread_latency_qos_t, 650 } 651 652 pub struct thread_throughput_qos_policy { 653 pub thread_throughput_qos_tier: thread_throughput_qos_t, 654 } 655 656 // malloc/malloc.h 657 pub struct malloc_statistics_t { 658 pub blocks_in_use: ::c_uint, 659 pub size_in_use: ::size_t, 660 pub max_size_in_use: ::size_t, 661 pub size_allocated: ::size_t, 662 } 663 664 pub struct mstats { 665 pub bytes_total: ::size_t, 666 pub chunks_used: ::size_t, 667 pub bytes_used: ::size_t, 668 pub chunks_free: ::size_t, 669 pub bytes_free: ::size_t, 670 } 671 672 pub struct malloc_zone_t { 673 __private: [::uintptr_t; 18], // FIXME: keeping private for now 674 } 675 676 // sched.h 677 pub struct sched_param { 678 pub sched_priority: ::c_int, 679 __opaque: [::c_char; 4], 680 } 681 682 pub struct vinfo_stat { 683 pub vst_dev: u32, 684 pub vst_mode: u16, 685 pub vst_nlink: u16, 686 pub vst_ino: u64, 687 pub vst_uid: ::uid_t, 688 pub vst_gid: ::gid_t, 689 pub vst_atime: i64, 690 pub vst_atimensec: i64, 691 pub vst_mtime: i64, 692 pub vst_mtimensec: i64, 693 pub vst_ctime: i64, 694 pub vst_ctimensec: i64, 695 pub vst_birthtime: i64, 696 pub vst_birthtimensec: i64, 697 pub vst_size: ::off_t, 698 pub vst_blocks: i64, 699 pub vst_blksize: i32, 700 pub vst_flags: u32, 701 pub vst_gen: u32, 702 pub vst_rdev: u32, 703 pub vst_qspare: [i64; 2], 704 } 705 706 pub struct vnode_info { 707 pub vi_stat: vinfo_stat, 708 pub vi_type: ::c_int, 709 pub vi_pad: ::c_int, 710 pub vi_fsid: ::fsid_t, 711 } 712 713 pub struct vnode_info_path { 714 pub vip_vi: vnode_info, 715 // Normally it's `vip_path: [::c_char; MAXPATHLEN]` but because libc supports an old rustc 716 // version, we go around this limitation like this. 717 pub vip_path: [[::c_char; 32]; 32], 718 } 719 720 pub struct proc_vnodepathinfo { 721 pub pvi_cdir: vnode_info_path, 722 pub pvi_rdir: vnode_info_path, 723 } 724 } 725 726 s_no_extra_traits! { 727 #[cfg_attr(libc_packedN, repr(packed(4)))] 728 pub struct kevent { 729 pub ident: ::uintptr_t, 730 pub filter: i16, 731 pub flags: u16, 732 pub fflags: u32, 733 pub data: ::intptr_t, 734 pub udata: *mut ::c_void, 735 } 736 737 #[cfg_attr(libc_packedN, repr(packed(4)))] 738 pub struct semid_ds { 739 // Note the manpage shows different types than the system header. 740 pub sem_perm: ipc_perm, 741 pub sem_base: i32, 742 pub sem_nsems: ::c_ushort, 743 pub sem_otime: ::time_t, 744 pub sem_pad1: i32, 745 pub sem_ctime: ::time_t, 746 pub sem_pad2: i32, 747 pub sem_pad3: [i32; 4], 748 } 749 750 #[cfg_attr(libc_packedN, repr(packed(4)))] 751 pub struct shmid_ds { 752 pub shm_perm: ipc_perm, 753 pub shm_segsz: ::size_t, 754 pub shm_lpid: ::pid_t, 755 pub shm_cpid: ::pid_t, 756 pub shm_nattch: ::shmatt_t, 757 pub shm_atime: ::time_t, // FIXME: 64-bit wrong align => wrong offset 758 pub shm_dtime: ::time_t, // FIXME: 64-bit wrong align => wrong offset 759 pub shm_ctime: ::time_t, // FIXME: 64-bit wrong align => wrong offset 760 // FIXME: 64-bit wrong align => wrong offset: 761 pub shm_internal: *mut ::c_void, 762 } 763 764 pub struct proc_threadinfo { 765 pub pth_user_time: u64, 766 pub pth_system_time: u64, 767 pub pth_cpu_usage: i32, 768 pub pth_policy: i32, 769 pub pth_run_state: i32, 770 pub pth_flags: i32, 771 pub pth_sleep_time: i32, 772 pub pth_curpri: i32, 773 pub pth_priority: i32, 774 pub pth_maxpriority: i32, 775 pub pth_name: [::c_char; MAXTHREADNAMESIZE], 776 } 777 778 pub struct statfs { 779 pub f_bsize: u32, 780 pub f_iosize: i32, 781 pub f_blocks: u64, 782 pub f_bfree: u64, 783 pub f_bavail: u64, 784 pub f_files: u64, 785 pub f_ffree: u64, 786 pub f_fsid: ::fsid_t, 787 pub f_owner: ::uid_t, 788 pub f_type: u32, 789 pub f_flags: u32, 790 pub f_fssubtype: u32, 791 pub f_fstypename: [::c_char; 16], 792 pub f_mntonname: [::c_char; 1024], 793 pub f_mntfromname: [::c_char; 1024], 794 pub f_reserved: [u32; 8], 795 } 796 797 pub struct dirent { 798 pub d_ino: u64, 799 pub d_seekoff: u64, 800 pub d_reclen: u16, 801 pub d_namlen: u16, 802 pub d_type: u8, 803 pub d_name: [::c_char; 1024], 804 } 805 806 pub struct pthread_rwlock_t { 807 __sig: ::c_long, 808 __opaque: [u8; __PTHREAD_RWLOCK_SIZE__], 809 } 810 811 pub struct pthread_mutex_t { 812 __sig: ::c_long, 813 __opaque: [u8; __PTHREAD_MUTEX_SIZE__], 814 } 815 816 pub struct pthread_cond_t { 817 __sig: ::c_long, 818 __opaque: [u8; __PTHREAD_COND_SIZE__], 819 } 820 821 pub struct sockaddr_storage { 822 pub ss_len: u8, 823 pub ss_family: ::sa_family_t, 824 __ss_pad1: [u8; 6], 825 __ss_align: i64, 826 __ss_pad2: [u8; 112], 827 } 828 829 pub struct utmpx { 830 pub ut_user: [::c_char; _UTX_USERSIZE], 831 pub ut_id: [::c_char; _UTX_IDSIZE], 832 pub ut_line: [::c_char; _UTX_LINESIZE], 833 pub ut_pid: ::pid_t, 834 pub ut_type: ::c_short, 835 pub ut_tv: ::timeval, 836 pub ut_host: [::c_char; _UTX_HOSTSIZE], 837 ut_pad: [u32; 16], 838 } 839 840 pub struct sigevent { 841 pub sigev_notify: ::c_int, 842 pub sigev_signo: ::c_int, 843 pub sigev_value: ::sigval, 844 __unused1: *mut ::c_void, //actually a function pointer 845 pub sigev_notify_attributes: *mut ::pthread_attr_t 846 } 847 848 pub struct processor_cpu_load_info { 849 pub cpu_ticks: [::c_uint; CPU_STATE_MAX as usize], 850 } 851 852 pub struct processor_basic_info { 853 pub cpu_type: cpu_type_t, 854 pub cpu_subtype: cpu_subtype_t, 855 pub running: ::boolean_t, 856 pub slot_num: ::c_int, 857 pub is_master: ::boolean_t, 858 } 859 860 pub struct processor_set_basic_info { 861 pub processor_count: ::c_int, 862 pub default_policy: ::c_int, 863 } 864 865 pub struct processor_set_load_info { 866 pub task_count: ::c_int, 867 pub thread_count: ::c_int, 868 pub load_average: integer_t, 869 pub mach_factor: integer_t, 870 } 871 872 pub struct time_value_t { 873 pub seconds: integer_t, 874 pub microseconds: integer_t, 875 } 876 877 pub struct thread_basic_info { 878 pub user_time: time_value_t, 879 pub system_time: time_value_t, 880 pub cpu_usage: ::integer_t, 881 pub policy: ::policy_t, 882 pub run_state: ::integer_t, 883 pub flags: ::integer_t, 884 pub suspend_count: ::integer_t, 885 pub sleep_time: ::integer_t, 886 } 887 888 pub struct thread_identifier_info { 889 pub thread_id: u64, 890 pub thread_handle: u64, 891 pub dispatch_qaddr: u64, 892 } 893 894 pub struct thread_extended_info { 895 pub pth_user_time: u64, 896 pub pth_system_time: u64, 897 pub pth_cpu_usage: i32, 898 pub pth_policy: i32, 899 pub pth_run_state: i32, 900 pub pth_flags: i32, 901 pub pth_sleep_time: i32, 902 pub pth_curpri: i32, 903 pub pth_priority: i32, 904 pub pth_maxpriority: i32, 905 pub pth_name: [::c_char; MAXTHREADNAMESIZE], 906 } 907 } 908 909 impl siginfo_t { si_addr(&self) -> *mut ::c_void910 pub unsafe fn si_addr(&self) -> *mut ::c_void { 911 self.si_addr 912 } 913 si_value(&self) -> ::sigval914 pub unsafe fn si_value(&self) -> ::sigval { 915 #[repr(C)] 916 struct siginfo_timer { 917 _si_signo: ::c_int, 918 _si_errno: ::c_int, 919 _si_code: ::c_int, 920 _si_pid: ::pid_t, 921 _si_uid: ::uid_t, 922 _si_status: ::c_int, 923 _si_addr: *mut ::c_void, 924 si_value: ::sigval, 925 } 926 927 (*(self as *const siginfo_t as *const siginfo_timer)).si_value 928 } 929 si_pid(&self) -> ::pid_t930 pub unsafe fn si_pid(&self) -> ::pid_t { 931 self.si_pid 932 } 933 si_uid(&self) -> ::uid_t934 pub unsafe fn si_uid(&self) -> ::uid_t { 935 self.si_uid 936 } 937 si_status(&self) -> ::c_int938 pub unsafe fn si_status(&self) -> ::c_int { 939 self.si_status 940 } 941 } 942 943 cfg_if! { 944 if #[cfg(libc_union)] { 945 s_no_extra_traits! { 946 pub union semun { 947 pub val: ::c_int, 948 pub buf: *mut semid_ds, 949 pub array: *mut ::c_ushort, 950 } 951 } 952 953 cfg_if! { 954 if #[cfg(feature = "extra_traits")] { 955 impl PartialEq for semun { 956 fn eq(&self, other: &semun) -> bool { 957 unsafe { self.val == other.val } 958 } 959 } 960 impl Eq for semun {} 961 impl ::fmt::Debug for semun { 962 fn fmt(&self, f: &mut ::fmt::Formatter) 963 -> ::fmt::Result { 964 f.debug_struct("semun") 965 .field("val", unsafe { &self.val }) 966 .finish() 967 } 968 } 969 impl ::hash::Hash for semun { 970 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 971 unsafe { self.val.hash(state) }; 972 } 973 } 974 } 975 } 976 } 977 } 978 979 cfg_if! { 980 if #[cfg(feature = "extra_traits")] { 981 impl PartialEq for kevent { 982 fn eq(&self, other: &kevent) -> bool { 983 self.ident == other.ident 984 && self.filter == other.filter 985 && self.flags == other.flags 986 && self.fflags == other.fflags 987 && self.data == other.data 988 && self.udata == other.udata 989 } 990 } 991 impl Eq for kevent {} 992 impl ::fmt::Debug for kevent { 993 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 994 let ident = self.ident; 995 let filter = self.filter; 996 let flags = self.flags; 997 let fflags = self.fflags; 998 let data = self.data; 999 let udata = self.udata; 1000 f.debug_struct("kevent") 1001 .field("ident", &ident) 1002 .field("filter", &filter) 1003 .field("flags", &flags) 1004 .field("fflags", &fflags) 1005 .field("data", &data) 1006 .field("udata", &udata) 1007 .finish() 1008 } 1009 } 1010 impl ::hash::Hash for kevent { 1011 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1012 let ident = self.ident; 1013 let filter = self.filter; 1014 let flags = self.flags; 1015 let fflags = self.fflags; 1016 let data = self.data; 1017 let udata = self.udata; 1018 ident.hash(state); 1019 filter.hash(state); 1020 flags.hash(state); 1021 fflags.hash(state); 1022 data.hash(state); 1023 udata.hash(state); 1024 } 1025 } 1026 1027 impl PartialEq for semid_ds { 1028 fn eq(&self, other: &semid_ds) -> bool { 1029 let sem_perm = self.sem_perm; 1030 let sem_pad3 = self.sem_pad3; 1031 let other_sem_perm = other.sem_perm; 1032 let other_sem_pad3 = other.sem_pad3; 1033 sem_perm == other_sem_perm 1034 && self.sem_base == other.sem_base 1035 && self.sem_nsems == other.sem_nsems 1036 && self.sem_otime == other.sem_otime 1037 && self.sem_pad1 == other.sem_pad1 1038 && self.sem_ctime == other.sem_ctime 1039 && self.sem_pad2 == other.sem_pad2 1040 && sem_pad3 == other_sem_pad3 1041 } 1042 } 1043 impl Eq for semid_ds {} 1044 impl ::fmt::Debug for semid_ds { 1045 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1046 let sem_perm = self.sem_perm; 1047 let sem_base = self.sem_base; 1048 let sem_nsems = self.sem_nsems; 1049 let sem_otime = self.sem_otime; 1050 let sem_pad1 = self.sem_pad1; 1051 let sem_ctime = self.sem_ctime; 1052 let sem_pad2 = self.sem_pad2; 1053 let sem_pad3 = self.sem_pad3; 1054 f.debug_struct("semid_ds") 1055 .field("sem_perm", &sem_perm) 1056 .field("sem_base", &sem_base) 1057 .field("sem_nsems", &sem_nsems) 1058 .field("sem_otime", &sem_otime) 1059 .field("sem_pad1", &sem_pad1) 1060 .field("sem_ctime", &sem_ctime) 1061 .field("sem_pad2", &sem_pad2) 1062 .field("sem_pad3", &sem_pad3) 1063 .finish() 1064 } 1065 } 1066 impl ::hash::Hash for semid_ds { 1067 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1068 let sem_perm = self.sem_perm; 1069 let sem_base = self.sem_base; 1070 let sem_nsems = self.sem_nsems; 1071 let sem_otime = self.sem_otime; 1072 let sem_pad1 = self.sem_pad1; 1073 let sem_ctime = self.sem_ctime; 1074 let sem_pad2 = self.sem_pad2; 1075 let sem_pad3 = self.sem_pad3; 1076 sem_perm.hash(state); 1077 sem_base.hash(state); 1078 sem_nsems.hash(state); 1079 sem_otime.hash(state); 1080 sem_pad1.hash(state); 1081 sem_ctime.hash(state); 1082 sem_pad2.hash(state); 1083 sem_pad3.hash(state); 1084 } 1085 } 1086 1087 impl PartialEq for shmid_ds { 1088 fn eq(&self, other: &shmid_ds) -> bool { 1089 let shm_perm = self.shm_perm; 1090 let other_shm_perm = other.shm_perm; 1091 shm_perm == other_shm_perm 1092 && self.shm_segsz == other.shm_segsz 1093 && self.shm_lpid == other.shm_lpid 1094 && self.shm_cpid == other.shm_cpid 1095 && self.shm_nattch == other.shm_nattch 1096 && self.shm_atime == other.shm_atime 1097 && self.shm_dtime == other.shm_dtime 1098 && self.shm_ctime == other.shm_ctime 1099 && self.shm_internal == other.shm_internal 1100 } 1101 } 1102 impl Eq for shmid_ds {} 1103 impl ::fmt::Debug for shmid_ds { 1104 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1105 let shm_perm = self.shm_perm; 1106 let shm_segsz = self.shm_segsz; 1107 let shm_lpid = self.shm_lpid; 1108 let shm_cpid = self.shm_cpid; 1109 let shm_nattch = self.shm_nattch; 1110 let shm_atime = self.shm_atime; 1111 let shm_dtime = self.shm_dtime; 1112 let shm_ctime = self.shm_ctime; 1113 let shm_internal = self.shm_internal; 1114 f.debug_struct("shmid_ds") 1115 .field("shm_perm", &shm_perm) 1116 .field("shm_segsz", &shm_segsz) 1117 .field("shm_lpid", &shm_lpid) 1118 .field("shm_cpid", &shm_cpid) 1119 .field("shm_nattch", &shm_nattch) 1120 .field("shm_atime", &shm_atime) 1121 .field("shm_dtime", &shm_dtime) 1122 .field("shm_ctime", &shm_ctime) 1123 .field("shm_internal", &shm_internal) 1124 .finish() 1125 } 1126 } 1127 impl ::hash::Hash for shmid_ds { 1128 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1129 let shm_perm = self.shm_perm; 1130 let shm_segsz = self.shm_segsz; 1131 let shm_lpid = self.shm_lpid; 1132 let shm_cpid = self.shm_cpid; 1133 let shm_nattch = self.shm_nattch; 1134 let shm_atime = self.shm_atime; 1135 let shm_dtime = self.shm_dtime; 1136 let shm_ctime = self.shm_ctime; 1137 let shm_internal = self.shm_internal; 1138 shm_perm.hash(state); 1139 shm_segsz.hash(state); 1140 shm_lpid.hash(state); 1141 shm_cpid.hash(state); 1142 shm_nattch.hash(state); 1143 shm_atime.hash(state); 1144 shm_dtime.hash(state); 1145 shm_ctime.hash(state); 1146 shm_internal.hash(state); 1147 } 1148 } 1149 1150 impl PartialEq for proc_threadinfo { 1151 fn eq(&self, other: &proc_threadinfo) -> bool { 1152 self.pth_user_time == other.pth_user_time 1153 && self.pth_system_time == other.pth_system_time 1154 && self.pth_cpu_usage == other.pth_cpu_usage 1155 && self.pth_policy == other.pth_policy 1156 && self.pth_run_state == other.pth_run_state 1157 && self.pth_flags == other.pth_flags 1158 && self.pth_sleep_time == other.pth_sleep_time 1159 && self.pth_curpri == other.pth_curpri 1160 && self.pth_priority == other.pth_priority 1161 && self.pth_maxpriority == other.pth_maxpriority 1162 && self.pth_name 1163 .iter() 1164 .zip(other.pth_name.iter()) 1165 .all(|(a,b)| a == b) 1166 } 1167 } 1168 impl Eq for proc_threadinfo {} 1169 impl ::fmt::Debug for proc_threadinfo { 1170 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1171 f.debug_struct("proc_threadinfo") 1172 .field("pth_user_time", &self.pth_user_time) 1173 .field("pth_system_time", &self.pth_system_time) 1174 .field("pth_cpu_usage", &self.pth_cpu_usage) 1175 .field("pth_policy", &self.pth_policy) 1176 .field("pth_run_state", &self.pth_run_state) 1177 .field("pth_flags", &self.pth_flags) 1178 .field("pth_sleep_time", &self.pth_sleep_time) 1179 .field("pth_curpri", &self.pth_curpri) 1180 .field("pth_priority", &self.pth_priority) 1181 .field("pth_maxpriority", &self.pth_maxpriority) 1182 // FIXME: .field("pth_name", &self.pth_name) 1183 .finish() 1184 } 1185 } 1186 impl ::hash::Hash for proc_threadinfo { 1187 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1188 self.pth_user_time.hash(state); 1189 self.pth_system_time.hash(state); 1190 self.pth_cpu_usage.hash(state); 1191 self.pth_policy.hash(state); 1192 self.pth_run_state.hash(state); 1193 self.pth_flags.hash(state); 1194 self.pth_sleep_time.hash(state); 1195 self.pth_curpri.hash(state); 1196 self.pth_priority.hash(state); 1197 self.pth_maxpriority.hash(state); 1198 self.pth_name.hash(state); 1199 } 1200 } 1201 1202 impl PartialEq for statfs { 1203 fn eq(&self, other: &statfs) -> bool { 1204 self.f_bsize == other.f_bsize 1205 && self.f_iosize == other.f_iosize 1206 && self.f_blocks == other.f_blocks 1207 && self.f_bfree == other.f_bfree 1208 && self.f_bavail == other.f_bavail 1209 && self.f_files == other.f_files 1210 && self.f_ffree == other.f_ffree 1211 && self.f_fsid == other.f_fsid 1212 && self.f_owner == other.f_owner 1213 && self.f_flags == other.f_flags 1214 && self.f_fssubtype == other.f_fssubtype 1215 && self.f_fstypename == other.f_fstypename 1216 && self.f_type == other.f_type 1217 && self 1218 .f_mntonname 1219 .iter() 1220 .zip(other.f_mntonname.iter()) 1221 .all(|(a,b)| a == b) 1222 && self 1223 .f_mntfromname 1224 .iter() 1225 .zip(other.f_mntfromname.iter()) 1226 .all(|(a,b)| a == b) 1227 && self.f_reserved == other.f_reserved 1228 } 1229 } 1230 1231 impl Eq for statfs {} 1232 impl ::fmt::Debug for statfs { 1233 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1234 f.debug_struct("statfs") 1235 .field("f_bsize", &self.f_bsize) 1236 .field("f_iosize", &self.f_iosize) 1237 .field("f_blocks", &self.f_blocks) 1238 .field("f_bfree", &self.f_bfree) 1239 .field("f_bavail", &self.f_bavail) 1240 .field("f_files", &self.f_files) 1241 .field("f_ffree", &self.f_ffree) 1242 .field("f_fsid", &self.f_fsid) 1243 .field("f_owner", &self.f_owner) 1244 .field("f_flags", &self.f_flags) 1245 .field("f_fssubtype", &self.f_fssubtype) 1246 .field("f_fstypename", &self.f_fstypename) 1247 .field("f_type", &self.f_type) 1248 // FIXME: .field("f_mntonname", &self.f_mntonname) 1249 // FIXME: .field("f_mntfromname", &self.f_mntfromname) 1250 .field("f_reserved", &self.f_reserved) 1251 .finish() 1252 } 1253 } 1254 1255 impl ::hash::Hash for statfs { 1256 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1257 self.f_bsize.hash(state); 1258 self.f_iosize.hash(state); 1259 self.f_blocks.hash(state); 1260 self.f_bfree.hash(state); 1261 self.f_bavail.hash(state); 1262 self.f_files.hash(state); 1263 self.f_ffree.hash(state); 1264 self.f_fsid.hash(state); 1265 self.f_owner.hash(state); 1266 self.f_flags.hash(state); 1267 self.f_fssubtype.hash(state); 1268 self.f_fstypename.hash(state); 1269 self.f_type.hash(state); 1270 self.f_mntonname.hash(state); 1271 self.f_mntfromname.hash(state); 1272 self.f_reserved.hash(state); 1273 } 1274 } 1275 1276 impl PartialEq for dirent { 1277 fn eq(&self, other: &dirent) -> bool { 1278 self.d_ino == other.d_ino 1279 && self.d_seekoff == other.d_seekoff 1280 && self.d_reclen == other.d_reclen 1281 && self.d_namlen == other.d_namlen 1282 && self.d_type == other.d_type 1283 && self 1284 .d_name 1285 .iter() 1286 .zip(other.d_name.iter()) 1287 .all(|(a,b)| a == b) 1288 } 1289 } 1290 impl Eq for dirent {} 1291 impl ::fmt::Debug for dirent { 1292 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1293 f.debug_struct("dirent") 1294 .field("d_ino", &self.d_ino) 1295 .field("d_seekoff", &self.d_seekoff) 1296 .field("d_reclen", &self.d_reclen) 1297 .field("d_namlen", &self.d_namlen) 1298 .field("d_type", &self.d_type) 1299 // FIXME: .field("d_name", &self.d_name) 1300 .finish() 1301 } 1302 } 1303 impl ::hash::Hash for dirent { 1304 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1305 self.d_ino.hash(state); 1306 self.d_seekoff.hash(state); 1307 self.d_reclen.hash(state); 1308 self.d_namlen.hash(state); 1309 self.d_type.hash(state); 1310 self.d_name.hash(state); 1311 } 1312 } 1313 impl PartialEq for pthread_rwlock_t { 1314 fn eq(&self, other: &pthread_rwlock_t) -> bool { 1315 self.__sig == other.__sig 1316 && self. 1317 __opaque 1318 .iter() 1319 .zip(other.__opaque.iter()) 1320 .all(|(a,b)| a == b) 1321 } 1322 } 1323 impl Eq for pthread_rwlock_t {} 1324 impl ::fmt::Debug for pthread_rwlock_t { 1325 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1326 f.debug_struct("pthread_rwlock_t") 1327 .field("__sig", &self.__sig) 1328 // FIXME: .field("__opaque", &self.__opaque) 1329 .finish() 1330 } 1331 } 1332 impl ::hash::Hash for pthread_rwlock_t { 1333 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1334 self.__sig.hash(state); 1335 self.__opaque.hash(state); 1336 } 1337 } 1338 1339 impl PartialEq for pthread_mutex_t { 1340 fn eq(&self, other: &pthread_mutex_t) -> bool { 1341 self.__sig == other.__sig 1342 && self. 1343 __opaque 1344 .iter() 1345 .zip(other.__opaque.iter()) 1346 .all(|(a,b)| a == b) 1347 } 1348 } 1349 1350 impl Eq for pthread_mutex_t {} 1351 1352 impl ::fmt::Debug for pthread_mutex_t { 1353 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1354 f.debug_struct("pthread_mutex_t") 1355 .field("__sig", &self.__sig) 1356 // FIXME: .field("__opaque", &self.__opaque) 1357 .finish() 1358 } 1359 } 1360 1361 impl ::hash::Hash for pthread_mutex_t { 1362 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1363 self.__sig.hash(state); 1364 self.__opaque.hash(state); 1365 } 1366 } 1367 1368 impl PartialEq for pthread_cond_t { 1369 fn eq(&self, other: &pthread_cond_t) -> bool { 1370 self.__sig == other.__sig 1371 && self. 1372 __opaque 1373 .iter() 1374 .zip(other.__opaque.iter()) 1375 .all(|(a,b)| a == b) 1376 } 1377 } 1378 1379 impl Eq for pthread_cond_t {} 1380 1381 impl ::fmt::Debug for pthread_cond_t { 1382 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1383 f.debug_struct("pthread_cond_t") 1384 .field("__sig", &self.__sig) 1385 // FIXME: .field("__opaque", &self.__opaque) 1386 .finish() 1387 } 1388 } 1389 1390 impl ::hash::Hash for pthread_cond_t { 1391 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1392 self.__sig.hash(state); 1393 self.__opaque.hash(state); 1394 } 1395 } 1396 1397 impl PartialEq for sockaddr_storage { 1398 fn eq(&self, other: &sockaddr_storage) -> bool { 1399 self.ss_len == other.ss_len 1400 && self.ss_family == other.ss_family 1401 && self 1402 .__ss_pad1 1403 .iter() 1404 .zip(other.__ss_pad1.iter()) 1405 .all(|(a, b)| a == b) 1406 && self.__ss_align == other.__ss_align 1407 && self 1408 .__ss_pad2 1409 .iter() 1410 .zip(other.__ss_pad2.iter()) 1411 .all(|(a, b)| a == b) 1412 } 1413 } 1414 1415 impl Eq for sockaddr_storage {} 1416 1417 impl ::fmt::Debug for sockaddr_storage { 1418 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1419 f.debug_struct("sockaddr_storage") 1420 .field("ss_len", &self.ss_len) 1421 .field("ss_family", &self.ss_family) 1422 .field("__ss_pad1", &self.__ss_pad1) 1423 .field("__ss_align", &self.__ss_align) 1424 // FIXME: .field("__ss_pad2", &self.__ss_pad2) 1425 .finish() 1426 } 1427 } 1428 1429 impl ::hash::Hash for sockaddr_storage { 1430 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1431 self.ss_len.hash(state); 1432 self.ss_family.hash(state); 1433 self.__ss_pad1.hash(state); 1434 self.__ss_align.hash(state); 1435 self.__ss_pad2.hash(state); 1436 } 1437 } 1438 1439 impl PartialEq for utmpx { 1440 fn eq(&self, other: &utmpx) -> bool { 1441 self.ut_user 1442 .iter() 1443 .zip(other.ut_user.iter()) 1444 .all(|(a,b)| a == b) 1445 && self.ut_id == other.ut_id 1446 && self.ut_line == other.ut_line 1447 && self.ut_pid == other.ut_pid 1448 && self.ut_type == other.ut_type 1449 && self.ut_tv == other.ut_tv 1450 && self 1451 .ut_host 1452 .iter() 1453 .zip(other.ut_host.iter()) 1454 .all(|(a,b)| a == b) 1455 && self.ut_pad == other.ut_pad 1456 } 1457 } 1458 1459 impl Eq for utmpx {} 1460 1461 impl ::fmt::Debug for utmpx { 1462 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1463 f.debug_struct("utmpx") 1464 // FIXME: .field("ut_user", &self.ut_user) 1465 .field("ut_id", &self.ut_id) 1466 .field("ut_line", &self.ut_line) 1467 .field("ut_pid", &self.ut_pid) 1468 .field("ut_type", &self.ut_type) 1469 .field("ut_tv", &self.ut_tv) 1470 // FIXME: .field("ut_host", &self.ut_host) 1471 .field("ut_pad", &self.ut_pad) 1472 .finish() 1473 } 1474 } 1475 1476 impl ::hash::Hash for utmpx { 1477 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1478 self.ut_user.hash(state); 1479 self.ut_id.hash(state); 1480 self.ut_line.hash(state); 1481 self.ut_pid.hash(state); 1482 self.ut_type.hash(state); 1483 self.ut_tv.hash(state); 1484 self.ut_host.hash(state); 1485 self.ut_pad.hash(state); 1486 } 1487 } 1488 1489 impl PartialEq for sigevent { 1490 fn eq(&self, other: &sigevent) -> bool { 1491 self.sigev_notify == other.sigev_notify 1492 && self.sigev_signo == other.sigev_signo 1493 && self.sigev_value == other.sigev_value 1494 && self.sigev_notify_attributes 1495 == other.sigev_notify_attributes 1496 } 1497 } 1498 1499 impl Eq for sigevent {} 1500 1501 impl ::fmt::Debug for sigevent { 1502 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1503 f.debug_struct("sigevent") 1504 .field("sigev_notify", &self.sigev_notify) 1505 .field("sigev_signo", &self.sigev_signo) 1506 .field("sigev_value", &self.sigev_value) 1507 .field("sigev_notify_attributes", 1508 &self.sigev_notify_attributes) 1509 .finish() 1510 } 1511 } 1512 1513 impl ::hash::Hash for sigevent { 1514 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1515 self.sigev_notify.hash(state); 1516 self.sigev_signo.hash(state); 1517 self.sigev_value.hash(state); 1518 self.sigev_notify_attributes.hash(state); 1519 } 1520 } 1521 1522 impl PartialEq for processor_cpu_load_info { 1523 fn eq(&self, other: &processor_cpu_load_info) -> bool { 1524 self.cpu_ticks == other.cpu_ticks 1525 } 1526 } 1527 impl Eq for processor_cpu_load_info {} 1528 impl ::fmt::Debug for processor_cpu_load_info { 1529 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1530 f.debug_struct("processor_cpu_load_info") 1531 .field("cpu_ticks", &self.cpu_ticks) 1532 .finish() 1533 } 1534 } 1535 impl ::hash::Hash for processor_cpu_load_info { 1536 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1537 self.cpu_ticks.hash(state); 1538 } 1539 } 1540 1541 impl PartialEq for processor_basic_info { 1542 fn eq(&self, other: &processor_basic_info) -> bool { 1543 self.cpu_type == other.cpu_type 1544 && self.cpu_subtype == other.cpu_subtype 1545 && self.running == other.running 1546 && self.slot_num == other.slot_num 1547 && self.is_master == other.is_master 1548 } 1549 } 1550 impl Eq for processor_basic_info {} 1551 impl ::fmt::Debug for processor_basic_info { 1552 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1553 f.debug_struct("processor_basic_info") 1554 .field("cpu_type", &self.cpu_type) 1555 .field("cpu_subtype", &self.cpu_subtype) 1556 .field("running", &self.running) 1557 .field("slot_num", &self.slot_num) 1558 .field("is_master", &self.is_master) 1559 .finish() 1560 } 1561 } 1562 impl ::hash::Hash for processor_basic_info { 1563 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1564 self.cpu_type.hash(state); 1565 self.cpu_subtype.hash(state); 1566 self.running.hash(state); 1567 self.slot_num.hash(state); 1568 self.is_master.hash(state); 1569 } 1570 } 1571 1572 impl PartialEq for processor_set_basic_info { 1573 fn eq(&self, other: &processor_set_basic_info) -> bool { 1574 self.processor_count == other.processor_count 1575 && self.default_policy == other.default_policy 1576 } 1577 } 1578 impl Eq for processor_set_basic_info {} 1579 impl ::fmt::Debug for processor_set_basic_info { 1580 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1581 f.debug_struct("processor_set_basic_info") 1582 .field("processor_count", &self.processor_count) 1583 .field("default_policy", &self.default_policy) 1584 .finish() 1585 } 1586 } 1587 impl ::hash::Hash for processor_set_basic_info { 1588 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1589 self.processor_count.hash(state); 1590 self.default_policy.hash(state); 1591 } 1592 } 1593 1594 impl PartialEq for processor_set_load_info { 1595 fn eq(&self, other: &processor_set_load_info) -> bool { 1596 self.task_count == other.task_count 1597 && self.thread_count == other.thread_count 1598 && self.load_average == other.load_average 1599 && self.mach_factor == other.mach_factor 1600 } 1601 } 1602 impl Eq for processor_set_load_info {} 1603 impl ::fmt::Debug for processor_set_load_info { 1604 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1605 f.debug_struct("processor_set_load_info") 1606 .field("task_count", &self.task_count) 1607 .field("thread_count", &self.thread_count) 1608 .field("load_average", &self.load_average) 1609 .field("mach_factor", &self.mach_factor) 1610 .finish() 1611 } 1612 } 1613 impl ::hash::Hash for processor_set_load_info { 1614 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1615 self.task_count.hash(state); 1616 self.thread_count.hash(state); 1617 self.load_average.hash(state); 1618 self.mach_factor.hash(state); 1619 } 1620 } 1621 1622 impl PartialEq for time_value_t { 1623 fn eq(&self, other: &time_value_t) -> bool { 1624 self.seconds == other.seconds 1625 && self.microseconds == other.microseconds 1626 } 1627 } 1628 impl Eq for time_value_t {} 1629 impl ::fmt::Debug for time_value_t { 1630 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1631 f.debug_struct("time_value_t") 1632 .field("seconds", &self.seconds) 1633 .field("microseconds", &self.microseconds) 1634 .finish() 1635 } 1636 } 1637 impl ::hash::Hash for time_value_t { 1638 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1639 self.seconds.hash(state); 1640 self.microseconds.hash(state); 1641 } 1642 } 1643 impl PartialEq for thread_basic_info { 1644 fn eq(&self, other: &thread_basic_info) -> bool { 1645 self.user_time == other.user_time 1646 && self.system_time == other.system_time 1647 && self.cpu_usage == other.cpu_usage 1648 && self.policy == other.policy 1649 && self.run_state == other.run_state 1650 && self.flags == other.flags 1651 && self.suspend_count == other.suspend_count 1652 && self.sleep_time == other.sleep_time 1653 } 1654 } 1655 impl Eq for thread_basic_info {} 1656 impl ::fmt::Debug for thread_basic_info { 1657 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1658 f.debug_struct("thread_basic_info") 1659 .field("user_time", &self.user_time) 1660 .field("system_time", &self.system_time) 1661 .field("cpu_usage", &self.cpu_usage) 1662 .field("policy", &self.policy) 1663 .field("run_state", &self.run_state) 1664 .field("flags", &self.flags) 1665 .field("suspend_count", &self.suspend_count) 1666 .field("sleep_time", &self.sleep_time) 1667 .finish() 1668 } 1669 } 1670 impl ::hash::Hash for thread_basic_info { 1671 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1672 self.user_time.hash(state); 1673 self.system_time.hash(state); 1674 self.cpu_usage.hash(state); 1675 self.policy.hash(state); 1676 self.run_state.hash(state); 1677 self.flags.hash(state); 1678 self.suspend_count.hash(state); 1679 self.sleep_time.hash(state); 1680 } 1681 } 1682 impl PartialEq for thread_extended_info { 1683 fn eq(&self, other: &thread_extended_info) -> bool { 1684 self.pth_user_time == other.pth_user_time 1685 && self.pth_system_time == other.pth_system_time 1686 && self.pth_cpu_usage == other.pth_cpu_usage 1687 && self.pth_policy == other.pth_policy 1688 && self.pth_run_state == other.pth_run_state 1689 && self.pth_flags == other.pth_flags 1690 && self.pth_sleep_time == other.pth_sleep_time 1691 && self.pth_curpri == other.pth_curpri 1692 && self.pth_priority == other.pth_priority 1693 && self.pth_maxpriority == other.pth_maxpriority 1694 && self.pth_name 1695 .iter() 1696 .zip(other.pth_name.iter()) 1697 .all(|(a,b)| a == b) 1698 } 1699 } 1700 impl Eq for thread_extended_info {} 1701 impl ::fmt::Debug for thread_extended_info { 1702 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1703 f.debug_struct("proc_threadinfo") 1704 .field("pth_user_time", &self.pth_user_time) 1705 .field("pth_system_time", &self.pth_system_time) 1706 .field("pth_cpu_usage", &self.pth_cpu_usage) 1707 .field("pth_policy", &self.pth_policy) 1708 .field("pth_run_state", &self.pth_run_state) 1709 .field("pth_flags", &self.pth_flags) 1710 .field("pth_sleep_time", &self.pth_sleep_time) 1711 .field("pth_curpri", &self.pth_curpri) 1712 .field("pth_priority", &self.pth_priority) 1713 .field("pth_maxpriority", &self.pth_maxpriority) 1714 // FIXME: .field("pth_name", &self.pth_name) 1715 .finish() 1716 } 1717 } 1718 impl ::hash::Hash for thread_extended_info { 1719 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1720 self.pth_user_time.hash(state); 1721 self.pth_system_time.hash(state); 1722 self.pth_cpu_usage.hash(state); 1723 self.pth_policy.hash(state); 1724 self.pth_run_state.hash(state); 1725 self.pth_flags.hash(state); 1726 self.pth_sleep_time.hash(state); 1727 self.pth_curpri.hash(state); 1728 self.pth_priority.hash(state); 1729 self.pth_maxpriority.hash(state); 1730 self.pth_name.hash(state); 1731 } 1732 } 1733 impl PartialEq for thread_identifier_info { 1734 fn eq(&self, other: &thread_identifier_info) -> bool { 1735 self.thread_id == other.thread_id 1736 && self.thread_handle == other.thread_handle 1737 && self.dispatch_qaddr == other.dispatch_qaddr 1738 } 1739 } 1740 impl Eq for thread_identifier_info {} 1741 impl ::fmt::Debug for thread_identifier_info { 1742 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 1743 f.debug_struct("thread_identifier_info") 1744 .field("thread_id", &self.thread_id) 1745 .field("thread_handle", &self.thread_handle) 1746 .field("dispatch_qaddr", &self.dispatch_qaddr) 1747 .finish() 1748 } 1749 } 1750 impl ::hash::Hash for thread_identifier_info { 1751 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 1752 self.thread_id.hash(state); 1753 self.thread_handle.hash(state); 1754 self.dispatch_qaddr.hash(state); 1755 } 1756 } 1757 } 1758 } 1759 1760 pub const _UTX_USERSIZE: usize = 256; 1761 pub const _UTX_LINESIZE: usize = 32; 1762 pub const _UTX_IDSIZE: usize = 4; 1763 pub const _UTX_HOSTSIZE: usize = 256; 1764 1765 pub const EMPTY: ::c_short = 0; 1766 pub const RUN_LVL: ::c_short = 1; 1767 pub const BOOT_TIME: ::c_short = 2; 1768 pub const OLD_TIME: ::c_short = 3; 1769 pub const NEW_TIME: ::c_short = 4; 1770 pub const INIT_PROCESS: ::c_short = 5; 1771 pub const LOGIN_PROCESS: ::c_short = 6; 1772 pub const USER_PROCESS: ::c_short = 7; 1773 pub const DEAD_PROCESS: ::c_short = 8; 1774 pub const ACCOUNTING: ::c_short = 9; 1775 pub const SIGNATURE: ::c_short = 10; 1776 pub const SHUTDOWN_TIME: ::c_short = 11; 1777 1778 pub const LC_COLLATE_MASK: ::c_int = 1 << 0; 1779 pub const LC_CTYPE_MASK: ::c_int = 1 << 1; 1780 pub const LC_MESSAGES_MASK: ::c_int = 1 << 2; 1781 pub const LC_MONETARY_MASK: ::c_int = 1 << 3; 1782 pub const LC_NUMERIC_MASK: ::c_int = 1 << 4; 1783 pub const LC_TIME_MASK: ::c_int = 1 << 5; 1784 pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK 1785 | LC_CTYPE_MASK 1786 | LC_MESSAGES_MASK 1787 | LC_MONETARY_MASK 1788 | LC_NUMERIC_MASK 1789 | LC_TIME_MASK; 1790 1791 pub const CODESET: ::nl_item = 0; 1792 pub const D_T_FMT: ::nl_item = 1; 1793 pub const D_FMT: ::nl_item = 2; 1794 pub const T_FMT: ::nl_item = 3; 1795 pub const T_FMT_AMPM: ::nl_item = 4; 1796 pub const AM_STR: ::nl_item = 5; 1797 pub const PM_STR: ::nl_item = 6; 1798 1799 pub const DAY_1: ::nl_item = 7; 1800 pub const DAY_2: ::nl_item = 8; 1801 pub const DAY_3: ::nl_item = 9; 1802 pub const DAY_4: ::nl_item = 10; 1803 pub const DAY_5: ::nl_item = 11; 1804 pub const DAY_6: ::nl_item = 12; 1805 pub const DAY_7: ::nl_item = 13; 1806 1807 pub const ABDAY_1: ::nl_item = 14; 1808 pub const ABDAY_2: ::nl_item = 15; 1809 pub const ABDAY_3: ::nl_item = 16; 1810 pub const ABDAY_4: ::nl_item = 17; 1811 pub const ABDAY_5: ::nl_item = 18; 1812 pub const ABDAY_6: ::nl_item = 19; 1813 pub const ABDAY_7: ::nl_item = 20; 1814 1815 pub const MON_1: ::nl_item = 21; 1816 pub const MON_2: ::nl_item = 22; 1817 pub const MON_3: ::nl_item = 23; 1818 pub const MON_4: ::nl_item = 24; 1819 pub const MON_5: ::nl_item = 25; 1820 pub const MON_6: ::nl_item = 26; 1821 pub const MON_7: ::nl_item = 27; 1822 pub const MON_8: ::nl_item = 28; 1823 pub const MON_9: ::nl_item = 29; 1824 pub const MON_10: ::nl_item = 30; 1825 pub const MON_11: ::nl_item = 31; 1826 pub const MON_12: ::nl_item = 32; 1827 1828 pub const ABMON_1: ::nl_item = 33; 1829 pub const ABMON_2: ::nl_item = 34; 1830 pub const ABMON_3: ::nl_item = 35; 1831 pub const ABMON_4: ::nl_item = 36; 1832 pub const ABMON_5: ::nl_item = 37; 1833 pub const ABMON_6: ::nl_item = 38; 1834 pub const ABMON_7: ::nl_item = 39; 1835 pub const ABMON_8: ::nl_item = 40; 1836 pub const ABMON_9: ::nl_item = 41; 1837 pub const ABMON_10: ::nl_item = 42; 1838 pub const ABMON_11: ::nl_item = 43; 1839 pub const ABMON_12: ::nl_item = 44; 1840 1841 pub const CLOCK_REALTIME: ::clockid_t = 0; 1842 pub const CLOCK_MONOTONIC: ::clockid_t = 6; 1843 pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 12; 1844 pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 16; 1845 1846 pub const ERA: ::nl_item = 45; 1847 pub const ERA_D_FMT: ::nl_item = 46; 1848 pub const ERA_D_T_FMT: ::nl_item = 47; 1849 pub const ERA_T_FMT: ::nl_item = 48; 1850 pub const ALT_DIGITS: ::nl_item = 49; 1851 1852 pub const RADIXCHAR: ::nl_item = 50; 1853 pub const THOUSEP: ::nl_item = 51; 1854 1855 pub const YESEXPR: ::nl_item = 52; 1856 pub const NOEXPR: ::nl_item = 53; 1857 1858 pub const YESSTR: ::nl_item = 54; 1859 pub const NOSTR: ::nl_item = 55; 1860 1861 pub const CRNCYSTR: ::nl_item = 56; 1862 1863 pub const D_MD_ORDER: ::nl_item = 57; 1864 1865 pub const EXIT_FAILURE: ::c_int = 1; 1866 pub const EXIT_SUCCESS: ::c_int = 0; 1867 pub const RAND_MAX: ::c_int = 2147483647; 1868 pub const EOF: ::c_int = -1; 1869 pub const SEEK_SET: ::c_int = 0; 1870 pub const SEEK_CUR: ::c_int = 1; 1871 pub const SEEK_END: ::c_int = 2; 1872 pub const _IOFBF: ::c_int = 0; 1873 pub const _IONBF: ::c_int = 2; 1874 pub const _IOLBF: ::c_int = 1; 1875 pub const BUFSIZ: ::c_uint = 1024; 1876 pub const FOPEN_MAX: ::c_uint = 20; 1877 pub const FILENAME_MAX: ::c_uint = 1024; 1878 pub const L_tmpnam: ::c_uint = 1024; 1879 pub const TMP_MAX: ::c_uint = 308915776; 1880 pub const _PC_LINK_MAX: ::c_int = 1; 1881 pub const _PC_MAX_CANON: ::c_int = 2; 1882 pub const _PC_MAX_INPUT: ::c_int = 3; 1883 pub const _PC_NAME_MAX: ::c_int = 4; 1884 pub const _PC_PATH_MAX: ::c_int = 5; 1885 pub const _PC_PIPE_BUF: ::c_int = 6; 1886 pub const _PC_CHOWN_RESTRICTED: ::c_int = 7; 1887 pub const _PC_NO_TRUNC: ::c_int = 8; 1888 pub const _PC_VDISABLE: ::c_int = 9; 1889 pub const O_DSYNC: ::c_int = 0x400000; 1890 pub const O_NOCTTY: ::c_int = 0x20000; 1891 pub const O_CLOEXEC: ::c_int = 0x1000000; 1892 pub const O_DIRECTORY: ::c_int = 0x100000; 1893 pub const O_SYMLINK: ::c_int = 0x200000; 1894 pub const S_IFIFO: mode_t = 4096; 1895 pub const S_IFCHR: mode_t = 8192; 1896 pub const S_IFBLK: mode_t = 24576; 1897 pub const S_IFDIR: mode_t = 16384; 1898 pub const S_IFREG: mode_t = 32768; 1899 pub const S_IFLNK: mode_t = 40960; 1900 pub const S_IFSOCK: mode_t = 49152; 1901 pub const S_IFMT: mode_t = 61440; 1902 pub const S_IEXEC: mode_t = 64; 1903 pub const S_IWRITE: mode_t = 128; 1904 pub const S_IREAD: mode_t = 256; 1905 pub const S_IRWXU: mode_t = 448; 1906 pub const S_IXUSR: mode_t = 64; 1907 pub const S_IWUSR: mode_t = 128; 1908 pub const S_IRUSR: mode_t = 256; 1909 pub const S_IRWXG: mode_t = 56; 1910 pub const S_IXGRP: mode_t = 8; 1911 pub const S_IWGRP: mode_t = 16; 1912 pub const S_IRGRP: mode_t = 32; 1913 pub const S_IRWXO: mode_t = 7; 1914 pub const S_IXOTH: mode_t = 1; 1915 pub const S_IWOTH: mode_t = 2; 1916 pub const S_IROTH: mode_t = 4; 1917 pub const F_OK: ::c_int = 0; 1918 pub const R_OK: ::c_int = 4; 1919 pub const W_OK: ::c_int = 2; 1920 pub const X_OK: ::c_int = 1; 1921 pub const STDIN_FILENO: ::c_int = 0; 1922 pub const STDOUT_FILENO: ::c_int = 1; 1923 pub const STDERR_FILENO: ::c_int = 2; 1924 pub const F_LOCK: ::c_int = 1; 1925 pub const F_TEST: ::c_int = 3; 1926 pub const F_TLOCK: ::c_int = 2; 1927 pub const F_ULOCK: ::c_int = 0; 1928 pub const F_GETLK: ::c_int = 7; 1929 pub const F_SETLK: ::c_int = 8; 1930 pub const F_SETLKW: ::c_int = 9; 1931 pub const SIGHUP: ::c_int = 1; 1932 pub const SIGINT: ::c_int = 2; 1933 pub const SIGQUIT: ::c_int = 3; 1934 pub const SIGILL: ::c_int = 4; 1935 pub const SIGABRT: ::c_int = 6; 1936 pub const SIGEMT: ::c_int = 7; 1937 pub const SIGFPE: ::c_int = 8; 1938 pub const SIGKILL: ::c_int = 9; 1939 pub const SIGSEGV: ::c_int = 11; 1940 pub const SIGPIPE: ::c_int = 13; 1941 pub const SIGALRM: ::c_int = 14; 1942 pub const SIGTERM: ::c_int = 15; 1943 1944 pub const PROT_NONE: ::c_int = 0; 1945 pub const PROT_READ: ::c_int = 1; 1946 pub const PROT_WRITE: ::c_int = 2; 1947 pub const PROT_EXEC: ::c_int = 4; 1948 1949 pub const PT_TRACE_ME: ::c_int = 0; 1950 pub const PT_READ_I: ::c_int = 1; 1951 pub const PT_READ_D: ::c_int = 2; 1952 pub const PT_READ_U: ::c_int = 3; 1953 pub const PT_WRITE_I: ::c_int = 4; 1954 pub const PT_WRITE_D: ::c_int = 5; 1955 pub const PT_WRITE_U: ::c_int = 6; 1956 pub const PT_CONTINUE: ::c_int = 7; 1957 pub const PT_KILL: ::c_int = 8; 1958 pub const PT_STEP: ::c_int = 9; 1959 pub const PT_ATTACH: ::c_int = 10; 1960 pub const PT_DETACH: ::c_int = 11; 1961 pub const PT_SIGEXC: ::c_int = 12; 1962 pub const PT_THUPDATE: ::c_int = 13; 1963 pub const PT_ATTACHEXC: ::c_int = 14; 1964 1965 pub const PT_FORCEQUOTA: ::c_int = 30; 1966 pub const PT_DENY_ATTACH: ::c_int = 31; 1967 pub const PT_FIRSTMACH: ::c_int = 32; 1968 1969 pub const MAP_FILE: ::c_int = 0x0000; 1970 pub const MAP_SHARED: ::c_int = 0x0001; 1971 pub const MAP_PRIVATE: ::c_int = 0x0002; 1972 pub const MAP_FIXED: ::c_int = 0x0010; 1973 pub const MAP_ANON: ::c_int = 0x1000; 1974 pub const MAP_ANONYMOUS: ::c_int = MAP_ANON; 1975 1976 pub const CPU_STATE_USER: ::c_int = 0; 1977 pub const CPU_STATE_SYSTEM: ::c_int = 1; 1978 pub const CPU_STATE_IDLE: ::c_int = 2; 1979 pub const CPU_STATE_NICE: ::c_int = 3; 1980 pub const CPU_STATE_MAX: ::c_int = 4; 1981 1982 pub const PROCESSOR_BASIC_INFO: ::c_int = 1; 1983 pub const PROCESSOR_CPU_LOAD_INFO: ::c_int = 2; 1984 pub const PROCESSOR_PM_REGS_INFO: ::c_int = 0x10000001; 1985 pub const PROCESSOR_TEMPERATURE: ::c_int = 0x10000002; 1986 pub const PROCESSOR_SET_LOAD_INFO: ::c_int = 4; 1987 pub const PROCESSOR_SET_BASIC_INFO: ::c_int = 5; 1988 1989 deprecated_mach! { 1990 pub const VM_FLAGS_FIXED: ::c_int = 0x0000; 1991 pub const VM_FLAGS_ANYWHERE: ::c_int = 0x0001; 1992 pub const VM_FLAGS_PURGABLE: ::c_int = 0x0002; 1993 pub const VM_FLAGS_RANDOM_ADDR: ::c_int = 0x0008; 1994 pub const VM_FLAGS_NO_CACHE: ::c_int = 0x0010; 1995 pub const VM_FLAGS_RESILIENT_CODESIGN: ::c_int = 0x0020; 1996 pub const VM_FLAGS_RESILIENT_MEDIA: ::c_int = 0x0040; 1997 pub const VM_FLAGS_OVERWRITE: ::c_int = 0x4000; 1998 pub const VM_FLAGS_SUPERPAGE_MASK: ::c_int = 0x70000; 1999 pub const VM_FLAGS_RETURN_DATA_ADDR: ::c_int = 0x100000; 2000 pub const VM_FLAGS_RETURN_4K_DATA_ADDR: ::c_int = 0x800000; 2001 pub const VM_FLAGS_ALIAS_MASK: ::c_int = 0xFF000000; 2002 pub const VM_FLAGS_USER_ALLOCATE: ::c_int = 0xff07401f; 2003 pub const VM_FLAGS_USER_MAP: ::c_int = 0xff97401f; 2004 pub const VM_FLAGS_USER_REMAP: ::c_int = VM_FLAGS_FIXED | 2005 VM_FLAGS_ANYWHERE | 2006 VM_FLAGS_RANDOM_ADDR | 2007 VM_FLAGS_OVERWRITE | 2008 VM_FLAGS_RETURN_DATA_ADDR | 2009 VM_FLAGS_RESILIENT_CODESIGN; 2010 2011 pub const VM_FLAGS_SUPERPAGE_SHIFT: ::c_int = 16; 2012 pub const SUPERPAGE_NONE: ::c_int = 0; 2013 pub const SUPERPAGE_SIZE_ANY: ::c_int = 1; 2014 pub const VM_FLAGS_SUPERPAGE_NONE: ::c_int = SUPERPAGE_NONE << 2015 VM_FLAGS_SUPERPAGE_SHIFT; 2016 pub const VM_FLAGS_SUPERPAGE_SIZE_ANY: ::c_int = SUPERPAGE_SIZE_ANY << 2017 VM_FLAGS_SUPERPAGE_SHIFT; 2018 pub const SUPERPAGE_SIZE_2MB: ::c_int = 2; 2019 pub const VM_FLAGS_SUPERPAGE_SIZE_2MB: ::c_int = SUPERPAGE_SIZE_2MB << 2020 VM_FLAGS_SUPERPAGE_SHIFT; 2021 2022 pub const VM_MEMORY_MALLOC: ::c_int = 1; 2023 pub const VM_MEMORY_MALLOC_SMALL: ::c_int = 2; 2024 pub const VM_MEMORY_MALLOC_LARGE: ::c_int = 3; 2025 pub const VM_MEMORY_MALLOC_HUGE: ::c_int = 4; 2026 pub const VM_MEMORY_SBRK: ::c_int = 5; 2027 pub const VM_MEMORY_REALLOC: ::c_int = 6; 2028 pub const VM_MEMORY_MALLOC_TINY: ::c_int = 7; 2029 pub const VM_MEMORY_MALLOC_LARGE_REUSABLE: ::c_int = 8; 2030 pub const VM_MEMORY_MALLOC_LARGE_REUSED: ::c_int = 9; 2031 pub const VM_MEMORY_ANALYSIS_TOOL: ::c_int = 10; 2032 pub const VM_MEMORY_MALLOC_NANO: ::c_int = 11; 2033 pub const VM_MEMORY_MACH_MSG: ::c_int = 20; 2034 pub const VM_MEMORY_IOKIT: ::c_int = 21; 2035 pub const VM_MEMORY_STACK: ::c_int = 30; 2036 pub const VM_MEMORY_GUARD: ::c_int = 31; 2037 pub const VM_MEMORY_SHARED_PMAP: ::c_int = 32; 2038 pub const VM_MEMORY_DYLIB: ::c_int = 33; 2039 pub const VM_MEMORY_OBJC_DISPATCHERS: ::c_int = 34; 2040 pub const VM_MEMORY_UNSHARED_PMAP: ::c_int = 35; 2041 pub const VM_MEMORY_APPKIT: ::c_int = 40; 2042 pub const VM_MEMORY_FOUNDATION: ::c_int = 41; 2043 pub const VM_MEMORY_COREGRAPHICS: ::c_int = 42; 2044 pub const VM_MEMORY_CORESERVICES: ::c_int = 43; 2045 pub const VM_MEMORY_CARBON: ::c_int = VM_MEMORY_CORESERVICES; 2046 pub const VM_MEMORY_JAVA: ::c_int = 44; 2047 pub const VM_MEMORY_COREDATA: ::c_int = 45; 2048 pub const VM_MEMORY_COREDATA_OBJECTIDS: ::c_int = 46; 2049 pub const VM_MEMORY_ATS: ::c_int = 50; 2050 pub const VM_MEMORY_LAYERKIT: ::c_int = 51; 2051 pub const VM_MEMORY_CGIMAGE: ::c_int = 52; 2052 pub const VM_MEMORY_TCMALLOC: ::c_int = 53; 2053 pub const VM_MEMORY_COREGRAPHICS_DATA: ::c_int = 54; 2054 pub const VM_MEMORY_COREGRAPHICS_SHARED: ::c_int = 55; 2055 pub const VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS: ::c_int = 56; 2056 pub const VM_MEMORY_COREGRAPHICS_BACKINGSTORES: ::c_int = 57; 2057 pub const VM_MEMORY_COREGRAPHICS_XALLOC: ::c_int = 58; 2058 pub const VM_MEMORY_COREGRAPHICS_MISC: ::c_int = VM_MEMORY_COREGRAPHICS; 2059 pub const VM_MEMORY_DYLD: ::c_int = 60; 2060 pub const VM_MEMORY_DYLD_MALLOC: ::c_int = 61; 2061 pub const VM_MEMORY_SQLITE: ::c_int = 62; 2062 pub const VM_MEMORY_JAVASCRIPT_CORE: ::c_int = 63; 2063 pub const VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR: ::c_int = 64; 2064 pub const VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE: ::c_int = 65; 2065 pub const VM_MEMORY_GLSL: ::c_int = 66; 2066 pub const VM_MEMORY_OPENCL: ::c_int = 67; 2067 pub const VM_MEMORY_COREIMAGE: ::c_int = 68; 2068 pub const VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS: ::c_int = 69; 2069 pub const VM_MEMORY_IMAGEIO: ::c_int = 70; 2070 pub const VM_MEMORY_COREPROFILE: ::c_int = 71; 2071 pub const VM_MEMORY_ASSETSD: ::c_int = 72; 2072 pub const VM_MEMORY_OS_ALLOC_ONCE: ::c_int = 73; 2073 pub const VM_MEMORY_LIBDISPATCH: ::c_int = 74; 2074 pub const VM_MEMORY_ACCELERATE: ::c_int = 75; 2075 pub const VM_MEMORY_COREUI: ::c_int = 76; 2076 pub const VM_MEMORY_COREUIFILE: ::c_int = 77; 2077 pub const VM_MEMORY_GENEALOGY: ::c_int = 78; 2078 pub const VM_MEMORY_RAWCAMERA: ::c_int = 79; 2079 pub const VM_MEMORY_CORPSEINFO: ::c_int = 80; 2080 pub const VM_MEMORY_ASL: ::c_int = 81; 2081 pub const VM_MEMORY_SWIFT_RUNTIME: ::c_int = 82; 2082 pub const VM_MEMORY_SWIFT_METADATA: ::c_int = 83; 2083 pub const VM_MEMORY_DHMM: ::c_int = 84; 2084 pub const VM_MEMORY_SCENEKIT: ::c_int = 86; 2085 pub const VM_MEMORY_SKYWALK: ::c_int = 87; 2086 pub const VM_MEMORY_APPLICATION_SPECIFIC_1: ::c_int = 240; 2087 pub const VM_MEMORY_APPLICATION_SPECIFIC_16: ::c_int = 255; 2088 } 2089 2090 pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; 2091 2092 pub const MCL_CURRENT: ::c_int = 0x0001; 2093 pub const MCL_FUTURE: ::c_int = 0x0002; 2094 2095 pub const MS_ASYNC: ::c_int = 0x0001; 2096 pub const MS_INVALIDATE: ::c_int = 0x0002; 2097 pub const MS_SYNC: ::c_int = 0x0010; 2098 2099 pub const MS_KILLPAGES: ::c_int = 0x0004; 2100 pub const MS_DEACTIVATE: ::c_int = 0x0008; 2101 2102 pub const EPERM: ::c_int = 1; 2103 pub const ENOENT: ::c_int = 2; 2104 pub const ESRCH: ::c_int = 3; 2105 pub const EINTR: ::c_int = 4; 2106 pub const EIO: ::c_int = 5; 2107 pub const ENXIO: ::c_int = 6; 2108 pub const E2BIG: ::c_int = 7; 2109 pub const ENOEXEC: ::c_int = 8; 2110 pub const EBADF: ::c_int = 9; 2111 pub const ECHILD: ::c_int = 10; 2112 pub const EDEADLK: ::c_int = 11; 2113 pub const ENOMEM: ::c_int = 12; 2114 pub const EACCES: ::c_int = 13; 2115 pub const EFAULT: ::c_int = 14; 2116 pub const ENOTBLK: ::c_int = 15; 2117 pub const EBUSY: ::c_int = 16; 2118 pub const EEXIST: ::c_int = 17; 2119 pub const EXDEV: ::c_int = 18; 2120 pub const ENODEV: ::c_int = 19; 2121 pub const ENOTDIR: ::c_int = 20; 2122 pub const EISDIR: ::c_int = 21; 2123 pub const EINVAL: ::c_int = 22; 2124 pub const ENFILE: ::c_int = 23; 2125 pub const EMFILE: ::c_int = 24; 2126 pub const ENOTTY: ::c_int = 25; 2127 pub const ETXTBSY: ::c_int = 26; 2128 pub const EFBIG: ::c_int = 27; 2129 pub const ENOSPC: ::c_int = 28; 2130 pub const ESPIPE: ::c_int = 29; 2131 pub const EROFS: ::c_int = 30; 2132 pub const EMLINK: ::c_int = 31; 2133 pub const EPIPE: ::c_int = 32; 2134 pub const EDOM: ::c_int = 33; 2135 pub const ERANGE: ::c_int = 34; 2136 pub const EAGAIN: ::c_int = 35; 2137 pub const EWOULDBLOCK: ::c_int = EAGAIN; 2138 pub const EINPROGRESS: ::c_int = 36; 2139 pub const EALREADY: ::c_int = 37; 2140 pub const ENOTSOCK: ::c_int = 38; 2141 pub const EDESTADDRREQ: ::c_int = 39; 2142 pub const EMSGSIZE: ::c_int = 40; 2143 pub const EPROTOTYPE: ::c_int = 41; 2144 pub const ENOPROTOOPT: ::c_int = 42; 2145 pub const EPROTONOSUPPORT: ::c_int = 43; 2146 pub const ESOCKTNOSUPPORT: ::c_int = 44; 2147 pub const ENOTSUP: ::c_int = 45; 2148 pub const EPFNOSUPPORT: ::c_int = 46; 2149 pub const EAFNOSUPPORT: ::c_int = 47; 2150 pub const EADDRINUSE: ::c_int = 48; 2151 pub const EADDRNOTAVAIL: ::c_int = 49; 2152 pub const ENETDOWN: ::c_int = 50; 2153 pub const ENETUNREACH: ::c_int = 51; 2154 pub const ENETRESET: ::c_int = 52; 2155 pub const ECONNABORTED: ::c_int = 53; 2156 pub const ECONNRESET: ::c_int = 54; 2157 pub const ENOBUFS: ::c_int = 55; 2158 pub const EISCONN: ::c_int = 56; 2159 pub const ENOTCONN: ::c_int = 57; 2160 pub const ESHUTDOWN: ::c_int = 58; 2161 pub const ETOOMANYREFS: ::c_int = 59; 2162 pub const ETIMEDOUT: ::c_int = 60; 2163 pub const ECONNREFUSED: ::c_int = 61; 2164 pub const ELOOP: ::c_int = 62; 2165 pub const ENAMETOOLONG: ::c_int = 63; 2166 pub const EHOSTDOWN: ::c_int = 64; 2167 pub const EHOSTUNREACH: ::c_int = 65; 2168 pub const ENOTEMPTY: ::c_int = 66; 2169 pub const EPROCLIM: ::c_int = 67; 2170 pub const EUSERS: ::c_int = 68; 2171 pub const EDQUOT: ::c_int = 69; 2172 pub const ESTALE: ::c_int = 70; 2173 pub const EREMOTE: ::c_int = 71; 2174 pub const EBADRPC: ::c_int = 72; 2175 pub const ERPCMISMATCH: ::c_int = 73; 2176 pub const EPROGUNAVAIL: ::c_int = 74; 2177 pub const EPROGMISMATCH: ::c_int = 75; 2178 pub const EPROCUNAVAIL: ::c_int = 76; 2179 pub const ENOLCK: ::c_int = 77; 2180 pub const ENOSYS: ::c_int = 78; 2181 pub const EFTYPE: ::c_int = 79; 2182 pub const EAUTH: ::c_int = 80; 2183 pub const ENEEDAUTH: ::c_int = 81; 2184 pub const EPWROFF: ::c_int = 82; 2185 pub const EDEVERR: ::c_int = 83; 2186 pub const EOVERFLOW: ::c_int = 84; 2187 pub const EBADEXEC: ::c_int = 85; 2188 pub const EBADARCH: ::c_int = 86; 2189 pub const ESHLIBVERS: ::c_int = 87; 2190 pub const EBADMACHO: ::c_int = 88; 2191 pub const ECANCELED: ::c_int = 89; 2192 pub const EIDRM: ::c_int = 90; 2193 pub const ENOMSG: ::c_int = 91; 2194 pub const EILSEQ: ::c_int = 92; 2195 pub const ENOATTR: ::c_int = 93; 2196 pub const EBADMSG: ::c_int = 94; 2197 pub const EMULTIHOP: ::c_int = 95; 2198 pub const ENODATA: ::c_int = 96; 2199 pub const ENOLINK: ::c_int = 97; 2200 pub const ENOSR: ::c_int = 98; 2201 pub const ENOSTR: ::c_int = 99; 2202 pub const EPROTO: ::c_int = 100; 2203 pub const ETIME: ::c_int = 101; 2204 pub const EOPNOTSUPP: ::c_int = 102; 2205 pub const ENOPOLICY: ::c_int = 103; 2206 pub const ENOTRECOVERABLE: ::c_int = 104; 2207 pub const EOWNERDEAD: ::c_int = 105; 2208 pub const EQFULL: ::c_int = 106; 2209 pub const ELAST: ::c_int = 106; 2210 2211 pub const EAI_AGAIN: ::c_int = 2; 2212 pub const EAI_BADFLAGS: ::c_int = 3; 2213 pub const EAI_FAIL: ::c_int = 4; 2214 pub const EAI_FAMILY: ::c_int = 5; 2215 pub const EAI_MEMORY: ::c_int = 6; 2216 pub const EAI_NODATA: ::c_int = 7; 2217 pub const EAI_NONAME: ::c_int = 8; 2218 pub const EAI_SERVICE: ::c_int = 9; 2219 pub const EAI_SOCKTYPE: ::c_int = 10; 2220 pub const EAI_SYSTEM: ::c_int = 11; 2221 pub const EAI_OVERFLOW: ::c_int = 14; 2222 2223 pub const F_DUPFD: ::c_int = 0; 2224 pub const F_DUPFD_CLOEXEC: ::c_int = 67; 2225 pub const F_GETFD: ::c_int = 1; 2226 pub const F_SETFD: ::c_int = 2; 2227 pub const F_GETFL: ::c_int = 3; 2228 pub const F_SETFL: ::c_int = 4; 2229 pub const F_PREALLOCATE: ::c_int = 42; 2230 pub const F_RDADVISE: ::c_int = 44; 2231 pub const F_RDAHEAD: ::c_int = 45; 2232 pub const F_NOCACHE: ::c_int = 48; 2233 pub const F_GETPATH: ::c_int = 50; 2234 pub const F_FULLFSYNC: ::c_int = 51; 2235 pub const F_FREEZE_FS: ::c_int = 53; 2236 pub const F_THAW_FS: ::c_int = 54; 2237 pub const F_GLOBAL_NOCACHE: ::c_int = 55; 2238 pub const F_NODIRECT: ::c_int = 62; 2239 2240 pub const F_ALLOCATECONTIG: ::c_uint = 0x02; 2241 pub const F_ALLOCATEALL: ::c_uint = 0x04; 2242 2243 pub const F_PEOFPOSMODE: ::c_int = 3; 2244 pub const F_VOLPOSMODE: ::c_int = 4; 2245 2246 pub const AT_FDCWD: ::c_int = -2; 2247 pub const AT_EACCESS: ::c_int = 0x0010; 2248 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x0020; 2249 pub const AT_SYMLINK_FOLLOW: ::c_int = 0x0040; 2250 pub const AT_REMOVEDIR: ::c_int = 0x0080; 2251 2252 pub const TIOCMODG: ::c_ulong = 0x40047403; 2253 pub const TIOCMODS: ::c_ulong = 0x80047404; 2254 pub const TIOCM_LE: ::c_int = 0x1; 2255 pub const TIOCM_DTR: ::c_int = 0x2; 2256 pub const TIOCM_RTS: ::c_int = 0x4; 2257 pub const TIOCM_ST: ::c_int = 0x8; 2258 pub const TIOCM_SR: ::c_int = 0x10; 2259 pub const TIOCM_CTS: ::c_int = 0x20; 2260 pub const TIOCM_CAR: ::c_int = 0x40; 2261 pub const TIOCM_CD: ::c_int = 0x40; 2262 pub const TIOCM_RNG: ::c_int = 0x80; 2263 pub const TIOCM_RI: ::c_int = 0x80; 2264 pub const TIOCM_DSR: ::c_int = 0x100; 2265 pub const TIOCEXCL: ::c_int = 0x2000740d; 2266 pub const TIOCNXCL: ::c_int = 0x2000740e; 2267 pub const TIOCFLUSH: ::c_ulong = 0x80047410; 2268 pub const TIOCGETD: ::c_ulong = 0x4004741a; 2269 pub const TIOCSETD: ::c_ulong = 0x8004741b; 2270 pub const TIOCIXON: ::c_uint = 0x20007481; 2271 pub const TIOCIXOFF: ::c_uint = 0x20007480; 2272 pub const TIOCSDTR: ::c_uint = 0x20007479; 2273 pub const TIOCCDTR: ::c_uint = 0x20007478; 2274 pub const TIOCGPGRP: ::c_ulong = 0x40047477; 2275 pub const TIOCSPGRP: ::c_ulong = 0x80047476; 2276 pub const TIOCOUTQ: ::c_ulong = 0x40047473; 2277 pub const TIOCSTI: ::c_ulong = 0x80017472; 2278 pub const TIOCNOTTY: ::c_uint = 0x20007471; 2279 pub const TIOCPKT: ::c_ulong = 0x80047470; 2280 pub const TIOCPKT_DATA: ::c_int = 0x0; 2281 pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1; 2282 pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x2; 2283 pub const TIOCPKT_STOP: ::c_int = 0x4; 2284 pub const TIOCPKT_START: ::c_int = 0x8; 2285 pub const TIOCPKT_NOSTOP: ::c_int = 0x10; 2286 pub const TIOCPKT_DOSTOP: ::c_int = 0x20; 2287 pub const TIOCPKT_IOCTL: ::c_int = 0x40; 2288 pub const TIOCSTOP: ::c_uint = 0x2000746f; 2289 pub const TIOCSTART: ::c_uint = 0x2000746e; 2290 pub const TIOCMSET: ::c_ulong = 0x8004746d; 2291 pub const TIOCMBIS: ::c_ulong = 0x8004746c; 2292 pub const TIOCMBIC: ::c_ulong = 0x8004746b; 2293 pub const TIOCMGET: ::c_ulong = 0x4004746a; 2294 pub const TIOCREMOTE: ::c_ulong = 0x80047469; 2295 pub const TIOCGWINSZ: ::c_ulong = 0x40087468; 2296 pub const TIOCSWINSZ: ::c_ulong = 0x80087467; 2297 pub const TIOCUCNTL: ::c_ulong = 0x80047466; 2298 pub const TIOCSTAT: ::c_uint = 0x20007465; 2299 pub const TIOCSCONS: ::c_uint = 0x20007463; 2300 pub const TIOCCONS: ::c_ulong = 0x80047462; 2301 pub const TIOCSCTTY: ::c_uint = 0x20007461; 2302 pub const TIOCEXT: ::c_ulong = 0x80047460; 2303 pub const TIOCSIG: ::c_uint = 0x2000745f; 2304 pub const TIOCDRAIN: ::c_uint = 0x2000745e; 2305 pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b; 2306 pub const TIOCMGDTRWAIT: ::c_ulong = 0x4004745a; 2307 pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457; 2308 pub const TIOCGDRAINWAIT: ::c_ulong = 0x40047456; 2309 pub const TIOCDSIMICROCODE: ::c_uint = 0x20007455; 2310 pub const TIOCPTYGRANT: ::c_uint = 0x20007454; 2311 pub const TIOCPTYGNAME: ::c_uint = 0x40807453; 2312 pub const TIOCPTYUNLK: ::c_uint = 0x20007452; 2313 2314 pub const BIOCGRSIG: ::c_ulong = 0x40044272; 2315 pub const BIOCSRSIG: ::c_ulong = 0x80044273; 2316 pub const BIOCSDLT: ::c_ulong = 0x80044278; 2317 pub const BIOCGSEESENT: ::c_ulong = 0x40044276; 2318 pub const BIOCSSEESENT: ::c_ulong = 0x80044277; 2319 pub const BIOCGDLTLIST: ::c_ulong = 0xc00c4279; 2320 2321 pub const FIODTYPE: ::c_ulong = 0x4004667a; 2322 2323 pub const B0: speed_t = 0; 2324 pub const B50: speed_t = 50; 2325 pub const B75: speed_t = 75; 2326 pub const B110: speed_t = 110; 2327 pub const B134: speed_t = 134; 2328 pub const B150: speed_t = 150; 2329 pub const B200: speed_t = 200; 2330 pub const B300: speed_t = 300; 2331 pub const B600: speed_t = 600; 2332 pub const B1200: speed_t = 1200; 2333 pub const B1800: speed_t = 1800; 2334 pub const B2400: speed_t = 2400; 2335 pub const B4800: speed_t = 4800; 2336 pub const B9600: speed_t = 9600; 2337 pub const B19200: speed_t = 19200; 2338 pub const B38400: speed_t = 38400; 2339 pub const B7200: speed_t = 7200; 2340 pub const B14400: speed_t = 14400; 2341 pub const B28800: speed_t = 28800; 2342 pub const B57600: speed_t = 57600; 2343 pub const B76800: speed_t = 76800; 2344 pub const B115200: speed_t = 115200; 2345 pub const B230400: speed_t = 230400; 2346 pub const EXTA: speed_t = 19200; 2347 pub const EXTB: speed_t = 38400; 2348 2349 pub const SIGTRAP: ::c_int = 5; 2350 2351 pub const GLOB_APPEND: ::c_int = 0x0001; 2352 pub const GLOB_DOOFFS: ::c_int = 0x0002; 2353 pub const GLOB_ERR: ::c_int = 0x0004; 2354 pub const GLOB_MARK: ::c_int = 0x0008; 2355 pub const GLOB_NOCHECK: ::c_int = 0x0010; 2356 pub const GLOB_NOSORT: ::c_int = 0x0020; 2357 pub const GLOB_NOESCAPE: ::c_int = 0x2000; 2358 2359 pub const GLOB_NOSPACE: ::c_int = -1; 2360 pub const GLOB_ABORTED: ::c_int = -2; 2361 pub const GLOB_NOMATCH: ::c_int = -3; 2362 2363 pub const POSIX_MADV_NORMAL: ::c_int = 0; 2364 pub const POSIX_MADV_RANDOM: ::c_int = 1; 2365 pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; 2366 pub const POSIX_MADV_WILLNEED: ::c_int = 3; 2367 pub const POSIX_MADV_DONTNEED: ::c_int = 4; 2368 2369 pub const _SC_IOV_MAX: ::c_int = 56; 2370 pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 70; 2371 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 71; 2372 pub const _SC_LOGIN_NAME_MAX: ::c_int = 73; 2373 pub const _SC_MQ_PRIO_MAX: ::c_int = 75; 2374 pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 82; 2375 pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 83; 2376 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 85; 2377 pub const _SC_THREAD_KEYS_MAX: ::c_int = 86; 2378 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 87; 2379 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 88; 2380 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 89; 2381 pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 90; 2382 pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 91; 2383 pub const _SC_THREAD_STACK_MIN: ::c_int = 93; 2384 pub const _SC_THREAD_THREADS_MAX: ::c_int = 94; 2385 pub const _SC_THREADS: ::c_int = 96; 2386 pub const _SC_TTY_NAME_MAX: ::c_int = 101; 2387 pub const _SC_ATEXIT_MAX: ::c_int = 107; 2388 pub const _SC_XOPEN_CRYPT: ::c_int = 108; 2389 pub const _SC_XOPEN_ENH_I18N: ::c_int = 109; 2390 pub const _SC_XOPEN_LEGACY: ::c_int = 110; 2391 pub const _SC_XOPEN_REALTIME: ::c_int = 111; 2392 pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 112; 2393 pub const _SC_XOPEN_SHM: ::c_int = 113; 2394 pub const _SC_XOPEN_UNIX: ::c_int = 115; 2395 pub const _SC_XOPEN_VERSION: ::c_int = 116; 2396 pub const _SC_XOPEN_XCU_VERSION: ::c_int = 121; 2397 pub const _SC_PHYS_PAGES: ::c_int = 200; 2398 2399 pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 2; 2400 pub const PTHREAD_PROCESS_SHARED: ::c_int = 1; 2401 pub const PTHREAD_CREATE_JOINABLE: ::c_int = 1; 2402 pub const PTHREAD_CREATE_DETACHED: ::c_int = 2; 2403 #[cfg(target_arch = "aarch64")] 2404 pub const PTHREAD_STACK_MIN: ::size_t = 16384; 2405 #[cfg(not(target_arch = "aarch64"))] 2406 pub const PTHREAD_STACK_MIN: ::size_t = 8192; 2407 2408 pub const RLIMIT_CPU: ::c_int = 0; 2409 pub const RLIMIT_FSIZE: ::c_int = 1; 2410 pub const RLIMIT_DATA: ::c_int = 2; 2411 pub const RLIMIT_STACK: ::c_int = 3; 2412 pub const RLIMIT_CORE: ::c_int = 4; 2413 pub const RLIMIT_AS: ::c_int = 5; 2414 pub const RLIMIT_RSS: ::c_int = RLIMIT_AS; 2415 pub const RLIMIT_MEMLOCK: ::c_int = 6; 2416 pub const RLIMIT_NPROC: ::c_int = 7; 2417 pub const RLIMIT_NOFILE: ::c_int = 8; 2418 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] 2419 pub const RLIM_NLIMITS: ::c_int = 9; 2420 pub const _RLIMIT_POSIX_FLAG: ::c_int = 0x1000; 2421 2422 pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff; 2423 2424 pub const RUSAGE_SELF: ::c_int = 0; 2425 pub const RUSAGE_CHILDREN: ::c_int = -1; 2426 2427 pub const MADV_NORMAL: ::c_int = 0; 2428 pub const MADV_RANDOM: ::c_int = 1; 2429 pub const MADV_SEQUENTIAL: ::c_int = 2; 2430 pub const MADV_WILLNEED: ::c_int = 3; 2431 pub const MADV_DONTNEED: ::c_int = 4; 2432 pub const MADV_FREE: ::c_int = 5; 2433 pub const MADV_ZERO_WIRED_PAGES: ::c_int = 6; 2434 pub const MADV_FREE_REUSABLE: ::c_int = 7; 2435 pub const MADV_FREE_REUSE: ::c_int = 8; 2436 pub const MADV_CAN_REUSE: ::c_int = 9; 2437 2438 pub const MINCORE_INCORE: ::c_int = 0x1; 2439 pub const MINCORE_REFERENCED: ::c_int = 0x2; 2440 pub const MINCORE_MODIFIED: ::c_int = 0x4; 2441 pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8; 2442 pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10; 2443 2444 // 2445 // sys/netinet/in.h 2446 // Protocols (RFC 1700) 2447 // NOTE: These are in addition to the constants defined in src/unix/mod.rs 2448 2449 // IPPROTO_IP defined in src/unix/mod.rs 2450 /// IP6 hop-by-hop options 2451 pub const IPPROTO_HOPOPTS: ::c_int = 0; 2452 // IPPROTO_ICMP defined in src/unix/mod.rs 2453 /// group mgmt protocol 2454 pub const IPPROTO_IGMP: ::c_int = 2; 2455 /// gateway<sup>2</sup> (deprecated) 2456 pub const IPPROTO_GGP: ::c_int = 3; 2457 /// for compatibility 2458 pub const IPPROTO_IPIP: ::c_int = 4; 2459 // IPPROTO_TCP defined in src/unix/mod.rs 2460 /// Stream protocol II. 2461 pub const IPPROTO_ST: ::c_int = 7; 2462 /// exterior gateway protocol 2463 pub const IPPROTO_EGP: ::c_int = 8; 2464 /// private interior gateway 2465 pub const IPPROTO_PIGP: ::c_int = 9; 2466 /// BBN RCC Monitoring 2467 pub const IPPROTO_RCCMON: ::c_int = 10; 2468 /// network voice protocol 2469 pub const IPPROTO_NVPII: ::c_int = 11; 2470 /// pup 2471 pub const IPPROTO_PUP: ::c_int = 12; 2472 /// Argus 2473 pub const IPPROTO_ARGUS: ::c_int = 13; 2474 /// EMCON 2475 pub const IPPROTO_EMCON: ::c_int = 14; 2476 /// Cross Net Debugger 2477 pub const IPPROTO_XNET: ::c_int = 15; 2478 /// Chaos 2479 pub const IPPROTO_CHAOS: ::c_int = 16; 2480 // IPPROTO_UDP defined in src/unix/mod.rs 2481 /// Multiplexing 2482 pub const IPPROTO_MUX: ::c_int = 18; 2483 /// DCN Measurement Subsystems 2484 pub const IPPROTO_MEAS: ::c_int = 19; 2485 /// Host Monitoring 2486 pub const IPPROTO_HMP: ::c_int = 20; 2487 /// Packet Radio Measurement 2488 pub const IPPROTO_PRM: ::c_int = 21; 2489 /// xns idp 2490 pub const IPPROTO_IDP: ::c_int = 22; 2491 /// Trunk-1 2492 pub const IPPROTO_TRUNK1: ::c_int = 23; 2493 /// Trunk-2 2494 pub const IPPROTO_TRUNK2: ::c_int = 24; 2495 /// Leaf-1 2496 pub const IPPROTO_LEAF1: ::c_int = 25; 2497 /// Leaf-2 2498 pub const IPPROTO_LEAF2: ::c_int = 26; 2499 /// Reliable Data 2500 pub const IPPROTO_RDP: ::c_int = 27; 2501 /// Reliable Transaction 2502 pub const IPPROTO_IRTP: ::c_int = 28; 2503 /// tp-4 w/ class negotiation 2504 pub const IPPROTO_TP: ::c_int = 29; 2505 /// Bulk Data Transfer 2506 pub const IPPROTO_BLT: ::c_int = 30; 2507 /// Network Services 2508 pub const IPPROTO_NSP: ::c_int = 31; 2509 /// Merit Internodal 2510 pub const IPPROTO_INP: ::c_int = 32; 2511 /// Sequential Exchange 2512 pub const IPPROTO_SEP: ::c_int = 33; 2513 /// Third Party Connect 2514 pub const IPPROTO_3PC: ::c_int = 34; 2515 /// InterDomain Policy Routing 2516 pub const IPPROTO_IDPR: ::c_int = 35; 2517 /// XTP 2518 pub const IPPROTO_XTP: ::c_int = 36; 2519 /// Datagram Delivery 2520 pub const IPPROTO_DDP: ::c_int = 37; 2521 /// Control Message Transport 2522 pub const IPPROTO_CMTP: ::c_int = 38; 2523 /// TP++ Transport 2524 pub const IPPROTO_TPXX: ::c_int = 39; 2525 /// IL transport protocol 2526 pub const IPPROTO_IL: ::c_int = 40; 2527 // IPPROTO_IPV6 defined in src/unix/mod.rs 2528 /// Source Demand Routing 2529 pub const IPPROTO_SDRP: ::c_int = 42; 2530 /// IP6 routing header 2531 pub const IPPROTO_ROUTING: ::c_int = 43; 2532 /// IP6 fragmentation header 2533 pub const IPPROTO_FRAGMENT: ::c_int = 44; 2534 /// InterDomain Routing 2535 pub const IPPROTO_IDRP: ::c_int = 45; 2536 /// resource reservation 2537 pub const IPPROTO_RSVP: ::c_int = 46; 2538 /// General Routing Encap. 2539 pub const IPPROTO_GRE: ::c_int = 47; 2540 /// Mobile Host Routing 2541 pub const IPPROTO_MHRP: ::c_int = 48; 2542 /// BHA 2543 pub const IPPROTO_BHA: ::c_int = 49; 2544 /// IP6 Encap Sec. Payload 2545 pub const IPPROTO_ESP: ::c_int = 50; 2546 /// IP6 Auth Header 2547 pub const IPPROTO_AH: ::c_int = 51; 2548 /// Integ. Net Layer Security 2549 pub const IPPROTO_INLSP: ::c_int = 52; 2550 /// IP with encryption 2551 pub const IPPROTO_SWIPE: ::c_int = 53; 2552 /// Next Hop Resolution 2553 pub const IPPROTO_NHRP: ::c_int = 54; 2554 /* 55-57: Unassigned */ 2555 // IPPROTO_ICMPV6 defined in src/unix/mod.rs 2556 /// IP6 no next header 2557 pub const IPPROTO_NONE: ::c_int = 59; 2558 /// IP6 destination option 2559 pub const IPPROTO_DSTOPTS: ::c_int = 60; 2560 /// any host internal protocol 2561 pub const IPPROTO_AHIP: ::c_int = 61; 2562 /// CFTP 2563 pub const IPPROTO_CFTP: ::c_int = 62; 2564 /// "hello" routing protocol 2565 pub const IPPROTO_HELLO: ::c_int = 63; 2566 /// SATNET/Backroom EXPAK 2567 pub const IPPROTO_SATEXPAK: ::c_int = 64; 2568 /// Kryptolan 2569 pub const IPPROTO_KRYPTOLAN: ::c_int = 65; 2570 /// Remote Virtual Disk 2571 pub const IPPROTO_RVD: ::c_int = 66; 2572 /// Pluribus Packet Core 2573 pub const IPPROTO_IPPC: ::c_int = 67; 2574 /// Any distributed FS 2575 pub const IPPROTO_ADFS: ::c_int = 68; 2576 /// Satnet Monitoring 2577 pub const IPPROTO_SATMON: ::c_int = 69; 2578 /// VISA Protocol 2579 pub const IPPROTO_VISA: ::c_int = 70; 2580 /// Packet Core Utility 2581 pub const IPPROTO_IPCV: ::c_int = 71; 2582 /// Comp. Prot. Net. Executive 2583 pub const IPPROTO_CPNX: ::c_int = 72; 2584 /// Comp. Prot. HeartBeat 2585 pub const IPPROTO_CPHB: ::c_int = 73; 2586 /// Wang Span Network 2587 pub const IPPROTO_WSN: ::c_int = 74; 2588 /// Packet Video Protocol 2589 pub const IPPROTO_PVP: ::c_int = 75; 2590 /// BackRoom SATNET Monitoring 2591 pub const IPPROTO_BRSATMON: ::c_int = 76; 2592 /// Sun net disk proto (temp.) 2593 pub const IPPROTO_ND: ::c_int = 77; 2594 /// WIDEBAND Monitoring 2595 pub const IPPROTO_WBMON: ::c_int = 78; 2596 /// WIDEBAND EXPAK 2597 pub const IPPROTO_WBEXPAK: ::c_int = 79; 2598 /// ISO cnlp 2599 pub const IPPROTO_EON: ::c_int = 80; 2600 /// VMTP 2601 pub const IPPROTO_VMTP: ::c_int = 81; 2602 /// Secure VMTP 2603 pub const IPPROTO_SVMTP: ::c_int = 82; 2604 /// Banyon VINES 2605 pub const IPPROTO_VINES: ::c_int = 83; 2606 /// TTP 2607 pub const IPPROTO_TTP: ::c_int = 84; 2608 /// NSFNET-IGP 2609 pub const IPPROTO_IGP: ::c_int = 85; 2610 /// dissimilar gateway prot. 2611 pub const IPPROTO_DGP: ::c_int = 86; 2612 /// TCF 2613 pub const IPPROTO_TCF: ::c_int = 87; 2614 /// Cisco/GXS IGRP 2615 pub const IPPROTO_IGRP: ::c_int = 88; 2616 /// OSPFIGP 2617 pub const IPPROTO_OSPFIGP: ::c_int = 89; 2618 /// Strite RPC protocol 2619 pub const IPPROTO_SRPC: ::c_int = 90; 2620 /// Locus Address Resoloution 2621 pub const IPPROTO_LARP: ::c_int = 91; 2622 /// Multicast Transport 2623 pub const IPPROTO_MTP: ::c_int = 92; 2624 /// AX.25 Frames 2625 pub const IPPROTO_AX25: ::c_int = 93; 2626 /// IP encapsulated in IP 2627 pub const IPPROTO_IPEIP: ::c_int = 94; 2628 /// Mobile Int.ing control 2629 pub const IPPROTO_MICP: ::c_int = 95; 2630 /// Semaphore Comm. security 2631 pub const IPPROTO_SCCSP: ::c_int = 96; 2632 /// Ethernet IP encapsulation 2633 pub const IPPROTO_ETHERIP: ::c_int = 97; 2634 /// encapsulation header 2635 pub const IPPROTO_ENCAP: ::c_int = 98; 2636 /// any private encr. scheme 2637 pub const IPPROTO_APES: ::c_int = 99; 2638 /// GMTP 2639 pub const IPPROTO_GMTP: ::c_int = 100; 2640 2641 /* 101-254: Partly Unassigned */ 2642 /// Protocol Independent Mcast 2643 pub const IPPROTO_PIM: ::c_int = 103; 2644 /// payload compression (IPComp) 2645 pub const IPPROTO_IPCOMP: ::c_int = 108; 2646 /// PGM 2647 pub const IPPROTO_PGM: ::c_int = 113; 2648 /// SCTP 2649 pub const IPPROTO_SCTP: ::c_int = 132; 2650 2651 /* 255: Reserved */ 2652 /* BSD Private, local use, namespace incursion */ 2653 /// divert pseudo-protocol 2654 pub const IPPROTO_DIVERT: ::c_int = 254; 2655 /// raw IP packet 2656 pub const IPPROTO_RAW: ::c_int = 255; 2657 pub const IPPROTO_MAX: ::c_int = 256; 2658 /// last return value of *_input(), meaning "all job for this pkt is done". 2659 pub const IPPROTO_DONE: ::c_int = 257; 2660 2661 pub const AF_UNSPEC: ::c_int = 0; 2662 pub const AF_LOCAL: ::c_int = 1; 2663 pub const AF_UNIX: ::c_int = AF_LOCAL; 2664 pub const AF_INET: ::c_int = 2; 2665 pub const AF_IMPLINK: ::c_int = 3; 2666 pub const AF_PUP: ::c_int = 4; 2667 pub const AF_CHAOS: ::c_int = 5; 2668 pub const AF_NS: ::c_int = 6; 2669 pub const AF_ISO: ::c_int = 7; 2670 pub const AF_OSI: ::c_int = AF_ISO; 2671 pub const AF_ECMA: ::c_int = 8; 2672 pub const AF_DATAKIT: ::c_int = 9; 2673 pub const AF_CCITT: ::c_int = 10; 2674 pub const AF_SNA: ::c_int = 11; 2675 pub const AF_DECnet: ::c_int = 12; 2676 pub const AF_DLI: ::c_int = 13; 2677 pub const AF_LAT: ::c_int = 14; 2678 pub const AF_HYLINK: ::c_int = 15; 2679 pub const AF_APPLETALK: ::c_int = 16; 2680 pub const AF_ROUTE: ::c_int = 17; 2681 pub const AF_LINK: ::c_int = 18; 2682 pub const pseudo_AF_XTP: ::c_int = 19; 2683 pub const AF_COIP: ::c_int = 20; 2684 pub const AF_CNT: ::c_int = 21; 2685 pub const pseudo_AF_RTIP: ::c_int = 22; 2686 pub const AF_IPX: ::c_int = 23; 2687 pub const AF_SIP: ::c_int = 24; 2688 pub const pseudo_AF_PIP: ::c_int = 25; 2689 pub const AF_ISDN: ::c_int = 28; 2690 pub const AF_E164: ::c_int = AF_ISDN; 2691 pub const pseudo_AF_KEY: ::c_int = 29; 2692 pub const AF_INET6: ::c_int = 30; 2693 pub const AF_NATM: ::c_int = 31; 2694 pub const AF_SYSTEM: ::c_int = 32; 2695 pub const AF_NETBIOS: ::c_int = 33; 2696 pub const AF_PPP: ::c_int = 34; 2697 pub const pseudo_AF_HDRCMPLT: ::c_int = 35; 2698 pub const AF_SYS_CONTROL: ::c_int = 2; 2699 2700 pub const SYSPROTO_EVENT: ::c_int = 1; 2701 pub const SYSPROTO_CONTROL: ::c_int = 2; 2702 2703 pub const PF_UNSPEC: ::c_int = AF_UNSPEC; 2704 pub const PF_LOCAL: ::c_int = AF_LOCAL; 2705 pub const PF_UNIX: ::c_int = PF_LOCAL; 2706 pub const PF_INET: ::c_int = AF_INET; 2707 pub const PF_IMPLINK: ::c_int = AF_IMPLINK; 2708 pub const PF_PUP: ::c_int = AF_PUP; 2709 pub const PF_CHAOS: ::c_int = AF_CHAOS; 2710 pub const PF_NS: ::c_int = AF_NS; 2711 pub const PF_ISO: ::c_int = AF_ISO; 2712 pub const PF_OSI: ::c_int = AF_ISO; 2713 pub const PF_ECMA: ::c_int = AF_ECMA; 2714 pub const PF_DATAKIT: ::c_int = AF_DATAKIT; 2715 pub const PF_CCITT: ::c_int = AF_CCITT; 2716 pub const PF_SNA: ::c_int = AF_SNA; 2717 pub const PF_DECnet: ::c_int = AF_DECnet; 2718 pub const PF_DLI: ::c_int = AF_DLI; 2719 pub const PF_LAT: ::c_int = AF_LAT; 2720 pub const PF_HYLINK: ::c_int = AF_HYLINK; 2721 pub const PF_APPLETALK: ::c_int = AF_APPLETALK; 2722 pub const PF_ROUTE: ::c_int = AF_ROUTE; 2723 pub const PF_LINK: ::c_int = AF_LINK; 2724 pub const PF_XTP: ::c_int = pseudo_AF_XTP; 2725 pub const PF_COIP: ::c_int = AF_COIP; 2726 pub const PF_CNT: ::c_int = AF_CNT; 2727 pub const PF_SIP: ::c_int = AF_SIP; 2728 pub const PF_IPX: ::c_int = AF_IPX; 2729 pub const PF_RTIP: ::c_int = pseudo_AF_RTIP; 2730 pub const PF_PIP: ::c_int = pseudo_AF_PIP; 2731 pub const PF_ISDN: ::c_int = AF_ISDN; 2732 pub const PF_KEY: ::c_int = pseudo_AF_KEY; 2733 pub const PF_INET6: ::c_int = AF_INET6; 2734 pub const PF_NATM: ::c_int = AF_NATM; 2735 pub const PF_SYSTEM: ::c_int = AF_SYSTEM; 2736 pub const PF_NETBIOS: ::c_int = AF_NETBIOS; 2737 pub const PF_PPP: ::c_int = AF_PPP; 2738 2739 pub const NET_RT_DUMP: ::c_int = 1; 2740 pub const NET_RT_FLAGS: ::c_int = 2; 2741 pub const NET_RT_IFLIST: ::c_int = 3; 2742 2743 pub const SOMAXCONN: ::c_int = 128; 2744 2745 pub const SOCK_MAXADDRLEN: ::c_int = 255; 2746 2747 pub const SOCK_STREAM: ::c_int = 1; 2748 pub const SOCK_DGRAM: ::c_int = 2; 2749 pub const SOCK_RAW: ::c_int = 3; 2750 pub const SOCK_RDM: ::c_int = 4; 2751 pub const SOCK_SEQPACKET: ::c_int = 5; 2752 pub const IP_TTL: ::c_int = 4; 2753 pub const IP_HDRINCL: ::c_int = 2; 2754 pub const IP_RECVDSTADDR: ::c_int = 7; 2755 pub const IP_ADD_MEMBERSHIP: ::c_int = 12; 2756 pub const IP_DROP_MEMBERSHIP: ::c_int = 13; 2757 pub const IP_RECVIF: ::c_int = 20; 2758 pub const IP_BOUND_IF: ::c_int = 25; 2759 pub const IP_PKTINFO: ::c_int = 26; 2760 pub const IP_RECVTOS: ::c_int = 27; 2761 pub const IPV6_JOIN_GROUP: ::c_int = 12; 2762 pub const IPV6_LEAVE_GROUP: ::c_int = 13; 2763 pub const IPV6_CHECKSUM: ::c_int = 26; 2764 pub const IPV6_RECVTCLASS: ::c_int = 35; 2765 pub const IPV6_TCLASS: ::c_int = 36; 2766 pub const IPV6_PKTINFO: ::c_int = 46; 2767 pub const IPV6_HOPLIMIT: ::c_int = 47; 2768 pub const IPV6_RECVPKTINFO: ::c_int = 61; 2769 2770 pub const TCP_NOPUSH: ::c_int = 4; 2771 pub const TCP_NOOPT: ::c_int = 8; 2772 pub const TCP_KEEPALIVE: ::c_int = 0x10; 2773 pub const TCP_KEEPINTVL: ::c_int = 0x101; 2774 pub const TCP_KEEPCNT: ::c_int = 0x102; 2775 /// Enable/Disable TCP Fastopen on this socket 2776 pub const TCP_FASTOPEN: ::c_int = 0x105; 2777 2778 pub const SOL_LOCAL: ::c_int = 0; 2779 2780 pub const LOCAL_PEERCRED: ::c_int = 0x001; 2781 pub const LOCAL_PEERPID: ::c_int = 0x002; 2782 pub const LOCAL_PEEREPID: ::c_int = 0x003; 2783 pub const LOCAL_PEERUUID: ::c_int = 0x004; 2784 pub const LOCAL_PEEREUUID: ::c_int = 0x005; 2785 2786 pub const SOL_SOCKET: ::c_int = 0xffff; 2787 2788 pub const SO_DEBUG: ::c_int = 0x01; 2789 pub const SO_ACCEPTCONN: ::c_int = 0x0002; 2790 pub const SO_REUSEADDR: ::c_int = 0x0004; 2791 pub const SO_KEEPALIVE: ::c_int = 0x0008; 2792 pub const SO_DONTROUTE: ::c_int = 0x0010; 2793 pub const SO_BROADCAST: ::c_int = 0x0020; 2794 pub const SO_USELOOPBACK: ::c_int = 0x0040; 2795 pub const SO_LINGER: ::c_int = 0x0080; 2796 pub const SO_OOBINLINE: ::c_int = 0x0100; 2797 pub const SO_REUSEPORT: ::c_int = 0x0200; 2798 pub const SO_TIMESTAMP: ::c_int = 0x0400; 2799 pub const SO_TIMESTAMP_MONOTONIC: ::c_int = 0x0800; 2800 pub const SO_DONTTRUNC: ::c_int = 0x2000; 2801 pub const SO_WANTMORE: ::c_int = 0x4000; 2802 pub const SO_WANTOOBFLAG: ::c_int = 0x8000; 2803 pub const SO_SNDBUF: ::c_int = 0x1001; 2804 pub const SO_RCVBUF: ::c_int = 0x1002; 2805 pub const SO_SNDLOWAT: ::c_int = 0x1003; 2806 pub const SO_RCVLOWAT: ::c_int = 0x1004; 2807 pub const SO_SNDTIMEO: ::c_int = 0x1005; 2808 pub const SO_RCVTIMEO: ::c_int = 0x1006; 2809 pub const SO_ERROR: ::c_int = 0x1007; 2810 pub const SO_TYPE: ::c_int = 0x1008; 2811 pub const SO_LABEL: ::c_int = 0x1010; 2812 pub const SO_PEERLABEL: ::c_int = 0x1011; 2813 pub const SO_NREAD: ::c_int = 0x1020; 2814 pub const SO_NKE: ::c_int = 0x1021; 2815 pub const SO_NOSIGPIPE: ::c_int = 0x1022; 2816 pub const SO_NOADDRERR: ::c_int = 0x1023; 2817 pub const SO_NWRITE: ::c_int = 0x1024; 2818 pub const SO_REUSESHAREUID: ::c_int = 0x1025; 2819 pub const SO_NOTIFYCONFLICT: ::c_int = 0x1026; 2820 pub const SO_LINGER_SEC: ::c_int = 0x1080; 2821 pub const SO_RANDOMPORT: ::c_int = 0x1082; 2822 pub const SO_NP_EXTENSIONS: ::c_int = 0x1083; 2823 2824 pub const MSG_OOB: ::c_int = 0x1; 2825 pub const MSG_PEEK: ::c_int = 0x2; 2826 pub const MSG_DONTROUTE: ::c_int = 0x4; 2827 pub const MSG_EOR: ::c_int = 0x8; 2828 pub const MSG_TRUNC: ::c_int = 0x10; 2829 pub const MSG_CTRUNC: ::c_int = 0x20; 2830 pub const MSG_WAITALL: ::c_int = 0x40; 2831 pub const MSG_DONTWAIT: ::c_int = 0x80; 2832 pub const MSG_EOF: ::c_int = 0x100; 2833 pub const MSG_FLUSH: ::c_int = 0x400; 2834 pub const MSG_HOLD: ::c_int = 0x800; 2835 pub const MSG_SEND: ::c_int = 0x1000; 2836 pub const MSG_HAVEMORE: ::c_int = 0x2000; 2837 pub const MSG_RCVMORE: ::c_int = 0x4000; 2838 // pub const MSG_COMPAT: ::c_int = 0x8000; 2839 2840 pub const SCM_TIMESTAMP: ::c_int = 0x02; 2841 pub const SCM_CREDS: ::c_int = 0x03; 2842 2843 // https://github.com/aosm/xnu/blob/master/bsd/net/if.h#L140-L156 2844 pub const IFF_UP: ::c_int = 0x1; // interface is up 2845 pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid 2846 pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging 2847 pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net 2848 pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link 2849 pub const IFF_NOTRAILERS: ::c_int = 0x20; // obsolete: avoid use of trailers 2850 pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated 2851 pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol 2852 pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets 2853 pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets 2854 pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress 2855 pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions 2856 pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit 2857 pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit 2858 pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit 2859 pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection 2860 pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast 2861 2862 pub const SHUT_RD: ::c_int = 0; 2863 pub const SHUT_WR: ::c_int = 1; 2864 pub const SHUT_RDWR: ::c_int = 2; 2865 2866 pub const SAE_ASSOCID_ANY: ::sae_associd_t = 0; 2867 /// ((sae_associd_t)(-1ULL)) 2868 pub const SAE_ASSOCID_ALL: ::sae_associd_t = 0xffffffff; 2869 2870 pub const SAE_CONNID_ANY: ::sae_connid_t = 0; 2871 /// ((sae_connid_t)(-1ULL)) 2872 pub const SAE_CONNID_ALL: ::sae_connid_t = 0xffffffff; 2873 2874 // connectx() flag parameters 2875 2876 /// resume connect() on read/write 2877 pub const CONNECT_RESUME_ON_READ_WRITE: ::c_uint = 0x1; 2878 /// data is idempotent 2879 pub const CONNECT_DATA_IDEMPOTENT: ::c_uint = 0x2; 2880 /// data includes security that replaces the TFO-cookie 2881 pub const CONNECT_DATA_AUTHENTICATED: ::c_uint = 0x4; 2882 2883 pub const LOCK_SH: ::c_int = 1; 2884 pub const LOCK_EX: ::c_int = 2; 2885 pub const LOCK_NB: ::c_int = 4; 2886 pub const LOCK_UN: ::c_int = 8; 2887 2888 pub const MAP_COPY: ::c_int = 0x0002; 2889 pub const MAP_RENAME: ::c_int = 0x0020; 2890 pub const MAP_NORESERVE: ::c_int = 0x0040; 2891 pub const MAP_NOEXTEND: ::c_int = 0x0100; 2892 pub const MAP_HASSEMAPHORE: ::c_int = 0x0200; 2893 pub const MAP_NOCACHE: ::c_int = 0x0400; 2894 pub const MAP_JIT: ::c_int = 0x0800; 2895 2896 pub const _SC_ARG_MAX: ::c_int = 1; 2897 pub const _SC_CHILD_MAX: ::c_int = 2; 2898 pub const _SC_CLK_TCK: ::c_int = 3; 2899 pub const _SC_NGROUPS_MAX: ::c_int = 4; 2900 pub const _SC_OPEN_MAX: ::c_int = 5; 2901 pub const _SC_JOB_CONTROL: ::c_int = 6; 2902 pub const _SC_SAVED_IDS: ::c_int = 7; 2903 pub const _SC_VERSION: ::c_int = 8; 2904 pub const _SC_BC_BASE_MAX: ::c_int = 9; 2905 pub const _SC_BC_DIM_MAX: ::c_int = 10; 2906 pub const _SC_BC_SCALE_MAX: ::c_int = 11; 2907 pub const _SC_BC_STRING_MAX: ::c_int = 12; 2908 pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13; 2909 pub const _SC_EXPR_NEST_MAX: ::c_int = 14; 2910 pub const _SC_LINE_MAX: ::c_int = 15; 2911 pub const _SC_RE_DUP_MAX: ::c_int = 16; 2912 pub const _SC_2_VERSION: ::c_int = 17; 2913 pub const _SC_2_C_BIND: ::c_int = 18; 2914 pub const _SC_2_C_DEV: ::c_int = 19; 2915 pub const _SC_2_CHAR_TERM: ::c_int = 20; 2916 pub const _SC_2_FORT_DEV: ::c_int = 21; 2917 pub const _SC_2_FORT_RUN: ::c_int = 22; 2918 pub const _SC_2_LOCALEDEF: ::c_int = 23; 2919 pub const _SC_2_SW_DEV: ::c_int = 24; 2920 pub const _SC_2_UPE: ::c_int = 25; 2921 pub const _SC_STREAM_MAX: ::c_int = 26; 2922 pub const _SC_TZNAME_MAX: ::c_int = 27; 2923 pub const _SC_ASYNCHRONOUS_IO: ::c_int = 28; 2924 pub const _SC_PAGESIZE: ::c_int = 29; 2925 pub const _SC_MEMLOCK: ::c_int = 30; 2926 pub const _SC_MEMLOCK_RANGE: ::c_int = 31; 2927 pub const _SC_MEMORY_PROTECTION: ::c_int = 32; 2928 pub const _SC_MESSAGE_PASSING: ::c_int = 33; 2929 pub const _SC_PRIORITIZED_IO: ::c_int = 34; 2930 pub const _SC_PRIORITY_SCHEDULING: ::c_int = 35; 2931 pub const _SC_REALTIME_SIGNALS: ::c_int = 36; 2932 pub const _SC_SEMAPHORES: ::c_int = 37; 2933 pub const _SC_FSYNC: ::c_int = 38; 2934 pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 39; 2935 pub const _SC_SYNCHRONIZED_IO: ::c_int = 40; 2936 pub const _SC_TIMERS: ::c_int = 41; 2937 pub const _SC_AIO_LISTIO_MAX: ::c_int = 42; 2938 pub const _SC_AIO_MAX: ::c_int = 43; 2939 pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44; 2940 pub const _SC_DELAYTIMER_MAX: ::c_int = 45; 2941 pub const _SC_MQ_OPEN_MAX: ::c_int = 46; 2942 pub const _SC_MAPPED_FILES: ::c_int = 47; 2943 pub const _SC_RTSIG_MAX: ::c_int = 48; 2944 pub const _SC_SEM_NSEMS_MAX: ::c_int = 49; 2945 pub const _SC_SEM_VALUE_MAX: ::c_int = 50; 2946 pub const _SC_SIGQUEUE_MAX: ::c_int = 51; 2947 pub const _SC_TIMER_MAX: ::c_int = 52; 2948 pub const _SC_NPROCESSORS_CONF: ::c_int = 57; 2949 pub const _SC_NPROCESSORS_ONLN: ::c_int = 58; 2950 pub const _SC_2_PBS: ::c_int = 59; 2951 pub const _SC_2_PBS_ACCOUNTING: ::c_int = 60; 2952 pub const _SC_2_PBS_CHECKPOINT: ::c_int = 61; 2953 pub const _SC_2_PBS_LOCATE: ::c_int = 62; 2954 pub const _SC_2_PBS_MESSAGE: ::c_int = 63; 2955 pub const _SC_2_PBS_TRACK: ::c_int = 64; 2956 pub const _SC_ADVISORY_INFO: ::c_int = 65; 2957 pub const _SC_BARRIERS: ::c_int = 66; 2958 pub const _SC_CLOCK_SELECTION: ::c_int = 67; 2959 pub const _SC_CPUTIME: ::c_int = 68; 2960 pub const _SC_FILE_LOCKING: ::c_int = 69; 2961 pub const _SC_HOST_NAME_MAX: ::c_int = 72; 2962 pub const _SC_MONOTONIC_CLOCK: ::c_int = 74; 2963 pub const _SC_READER_WRITER_LOCKS: ::c_int = 76; 2964 pub const _SC_REGEXP: ::c_int = 77; 2965 pub const _SC_SHELL: ::c_int = 78; 2966 pub const _SC_SPAWN: ::c_int = 79; 2967 pub const _SC_SPIN_LOCKS: ::c_int = 80; 2968 pub const _SC_SPORADIC_SERVER: ::c_int = 81; 2969 pub const _SC_THREAD_CPUTIME: ::c_int = 84; 2970 pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 92; 2971 pub const _SC_TIMEOUTS: ::c_int = 95; 2972 pub const _SC_TRACE: ::c_int = 97; 2973 pub const _SC_TRACE_EVENT_FILTER: ::c_int = 98; 2974 pub const _SC_TRACE_INHERIT: ::c_int = 99; 2975 pub const _SC_TRACE_LOG: ::c_int = 100; 2976 pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 102; 2977 pub const _SC_V6_ILP32_OFF32: ::c_int = 103; 2978 pub const _SC_V6_ILP32_OFFBIG: ::c_int = 104; 2979 pub const _SC_V6_LP64_OFF64: ::c_int = 105; 2980 pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 106; 2981 pub const _SC_IPV6: ::c_int = 118; 2982 pub const _SC_RAW_SOCKETS: ::c_int = 119; 2983 pub const _SC_SYMLOOP_MAX: ::c_int = 120; 2984 pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; 2985 pub const _SC_XOPEN_STREAMS: ::c_int = 114; 2986 pub const _SC_XBS5_ILP32_OFF32: ::c_int = 122; 2987 pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 123; 2988 pub const _SC_XBS5_LP64_OFF64: ::c_int = 124; 2989 pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 125; 2990 pub const _SC_SS_REPL_MAX: ::c_int = 126; 2991 pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 127; 2992 pub const _SC_TRACE_NAME_MAX: ::c_int = 128; 2993 pub const _SC_TRACE_SYS_MAX: ::c_int = 129; 2994 pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 130; 2995 pub const _SC_PASS_MAX: ::c_int = 131; 2996 2997 pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; 2998 pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1; 2999 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2; 3000 pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL; 3001 pub const _PTHREAD_MUTEX_SIG_init: ::c_long = 0x32AAABA7; 3002 pub const _PTHREAD_COND_SIG_init: ::c_long = 0x3CB0B1BB; 3003 pub const _PTHREAD_RWLOCK_SIG_init: ::c_long = 0x2DA8B3B4; 3004 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { 3005 __sig: _PTHREAD_MUTEX_SIG_init, 3006 __opaque: [0; __PTHREAD_MUTEX_SIZE__], 3007 }; 3008 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { 3009 __sig: _PTHREAD_COND_SIG_init, 3010 __opaque: [0; __PTHREAD_COND_SIZE__], 3011 }; 3012 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { 3013 __sig: _PTHREAD_RWLOCK_SIG_init, 3014 __opaque: [0; __PTHREAD_RWLOCK_SIZE__], 3015 }; 3016 3017 pub const MINSIGSTKSZ: ::size_t = 32768; 3018 pub const SIGSTKSZ: ::size_t = 131072; 3019 3020 pub const FD_SETSIZE: usize = 1024; 3021 3022 pub const ST_NOSUID: ::c_ulong = 2; 3023 3024 pub const EVFILT_READ: i16 = -1; 3025 pub const EVFILT_WRITE: i16 = -2; 3026 pub const EVFILT_AIO: i16 = -3; 3027 pub const EVFILT_VNODE: i16 = -4; 3028 pub const EVFILT_PROC: i16 = -5; 3029 pub const EVFILT_SIGNAL: i16 = -6; 3030 pub const EVFILT_TIMER: i16 = -7; 3031 pub const EVFILT_MACHPORT: i16 = -8; 3032 pub const EVFILT_FS: i16 = -9; 3033 pub const EVFILT_USER: i16 = -10; 3034 pub const EVFILT_VM: i16 = -12; 3035 3036 pub const EV_ADD: u16 = 0x1; 3037 pub const EV_DELETE: u16 = 0x2; 3038 pub const EV_ENABLE: u16 = 0x4; 3039 pub const EV_DISABLE: u16 = 0x8; 3040 pub const EV_ONESHOT: u16 = 0x10; 3041 pub const EV_CLEAR: u16 = 0x20; 3042 pub const EV_RECEIPT: u16 = 0x40; 3043 pub const EV_DISPATCH: u16 = 0x80; 3044 pub const EV_FLAG0: u16 = 0x1000; 3045 pub const EV_POLL: u16 = 0x1000; 3046 pub const EV_FLAG1: u16 = 0x2000; 3047 pub const EV_OOBAND: u16 = 0x2000; 3048 pub const EV_ERROR: u16 = 0x4000; 3049 pub const EV_EOF: u16 = 0x8000; 3050 pub const EV_SYSFLAGS: u16 = 0xf000; 3051 3052 pub const NOTE_TRIGGER: u32 = 0x01000000; 3053 pub const NOTE_FFNOP: u32 = 0x00000000; 3054 pub const NOTE_FFAND: u32 = 0x40000000; 3055 pub const NOTE_FFOR: u32 = 0x80000000; 3056 pub const NOTE_FFCOPY: u32 = 0xc0000000; 3057 pub const NOTE_FFCTRLMASK: u32 = 0xc0000000; 3058 pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff; 3059 pub const NOTE_LOWAT: u32 = 0x00000001; 3060 pub const NOTE_DELETE: u32 = 0x00000001; 3061 pub const NOTE_WRITE: u32 = 0x00000002; 3062 pub const NOTE_EXTEND: u32 = 0x00000004; 3063 pub const NOTE_ATTRIB: u32 = 0x00000008; 3064 pub const NOTE_LINK: u32 = 0x00000010; 3065 pub const NOTE_RENAME: u32 = 0x00000020; 3066 pub const NOTE_REVOKE: u32 = 0x00000040; 3067 pub const NOTE_NONE: u32 = 0x00000080; 3068 pub const NOTE_EXIT: u32 = 0x80000000; 3069 pub const NOTE_FORK: u32 = 0x40000000; 3070 pub const NOTE_EXEC: u32 = 0x20000000; 3071 #[doc(hidden)] 3072 #[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")] 3073 pub const NOTE_REAP: u32 = 0x10000000; 3074 pub const NOTE_SIGNAL: u32 = 0x08000000; 3075 pub const NOTE_EXITSTATUS: u32 = 0x04000000; 3076 pub const NOTE_EXIT_DETAIL: u32 = 0x02000000; 3077 pub const NOTE_PDATAMASK: u32 = 0x000fffff; 3078 pub const NOTE_PCTRLMASK: u32 = 0xfff00000; 3079 #[doc(hidden)] 3080 #[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")] 3081 pub const NOTE_EXIT_REPARENTED: u32 = 0x00080000; 3082 pub const NOTE_EXIT_DETAIL_MASK: u32 = 0x00070000; 3083 pub const NOTE_EXIT_DECRYPTFAIL: u32 = 0x00010000; 3084 pub const NOTE_EXIT_MEMORY: u32 = 0x00020000; 3085 pub const NOTE_EXIT_CSERROR: u32 = 0x00040000; 3086 pub const NOTE_VM_PRESSURE: u32 = 0x80000000; 3087 pub const NOTE_VM_PRESSURE_TERMINATE: u32 = 0x40000000; 3088 pub const NOTE_VM_PRESSURE_SUDDEN_TERMINATE: u32 = 0x20000000; 3089 pub const NOTE_VM_ERROR: u32 = 0x10000000; 3090 pub const NOTE_SECONDS: u32 = 0x00000001; 3091 pub const NOTE_USECONDS: u32 = 0x00000002; 3092 pub const NOTE_NSECONDS: u32 = 0x00000004; 3093 pub const NOTE_ABSOLUTE: u32 = 0x00000008; 3094 pub const NOTE_LEEWAY: u32 = 0x00000010; 3095 pub const NOTE_CRITICAL: u32 = 0x00000020; 3096 pub const NOTE_BACKGROUND: u32 = 0x00000040; 3097 pub const NOTE_TRACK: u32 = 0x00000001; 3098 pub const NOTE_TRACKERR: u32 = 0x00000002; 3099 pub const NOTE_CHILD: u32 = 0x00000004; 3100 3101 pub const OCRNL: ::tcflag_t = 0x00000010; 3102 pub const ONOCR: ::tcflag_t = 0x00000020; 3103 pub const ONLRET: ::tcflag_t = 0x00000040; 3104 pub const OFILL: ::tcflag_t = 0x00000080; 3105 pub const NLDLY: ::tcflag_t = 0x00000300; 3106 pub const TABDLY: ::tcflag_t = 0x00000c04; 3107 pub const CRDLY: ::tcflag_t = 0x00003000; 3108 pub const FFDLY: ::tcflag_t = 0x00004000; 3109 pub const BSDLY: ::tcflag_t = 0x00008000; 3110 pub const VTDLY: ::tcflag_t = 0x00010000; 3111 pub const OFDEL: ::tcflag_t = 0x00020000; 3112 3113 pub const NL0: ::tcflag_t = 0x00000000; 3114 pub const NL1: ::tcflag_t = 0x00000100; 3115 pub const TAB0: ::tcflag_t = 0x00000000; 3116 pub const TAB1: ::tcflag_t = 0x00000400; 3117 pub const TAB2: ::tcflag_t = 0x00000800; 3118 pub const CR0: ::tcflag_t = 0x00000000; 3119 pub const CR1: ::tcflag_t = 0x00001000; 3120 pub const CR2: ::tcflag_t = 0x00002000; 3121 pub const CR3: ::tcflag_t = 0x00003000; 3122 pub const FF0: ::tcflag_t = 0x00000000; 3123 pub const FF1: ::tcflag_t = 0x00004000; 3124 pub const BS0: ::tcflag_t = 0x00000000; 3125 pub const BS1: ::tcflag_t = 0x00008000; 3126 pub const TAB3: ::tcflag_t = 0x00000004; 3127 pub const VT0: ::tcflag_t = 0x00000000; 3128 pub const VT1: ::tcflag_t = 0x00010000; 3129 pub const IUTF8: ::tcflag_t = 0x00004000; 3130 pub const CRTSCTS: ::tcflag_t = 0x00030000; 3131 3132 pub const NI_MAXHOST: ::socklen_t = 1025; 3133 pub const NI_MAXSERV: ::socklen_t = 32; 3134 pub const NI_NOFQDN: ::c_int = 0x00000001; 3135 pub const NI_NUMERICHOST: ::c_int = 0x00000002; 3136 pub const NI_NAMEREQD: ::c_int = 0x00000004; 3137 pub const NI_NUMERICSERV: ::c_int = 0x00000008; 3138 pub const NI_NUMERICSCOPE: ::c_int = 0x00000100; 3139 pub const NI_DGRAM: ::c_int = 0x00000010; 3140 3141 pub const Q_GETQUOTA: ::c_int = 0x300; 3142 pub const Q_SETQUOTA: ::c_int = 0x400; 3143 3144 pub const RENAME_SWAP: ::c_uint = 0x00000002; 3145 pub const RENAME_EXCL: ::c_uint = 0x00000004; 3146 3147 pub const RTLD_LOCAL: ::c_int = 0x4; 3148 pub const RTLD_FIRST: ::c_int = 0x100; 3149 pub const RTLD_NODELETE: ::c_int = 0x80; 3150 pub const RTLD_NOLOAD: ::c_int = 0x10; 3151 pub const RTLD_GLOBAL: ::c_int = 0x8; 3152 3153 pub const _WSTOPPED: ::c_int = 0o177; 3154 3155 pub const LOG_NETINFO: ::c_int = 12 << 3; 3156 pub const LOG_REMOTEAUTH: ::c_int = 13 << 3; 3157 pub const LOG_INSTALL: ::c_int = 14 << 3; 3158 pub const LOG_RAS: ::c_int = 15 << 3; 3159 pub const LOG_LAUNCHD: ::c_int = 24 << 3; 3160 pub const LOG_NFACILITIES: ::c_int = 25; 3161 3162 pub const CTLTYPE: ::c_int = 0xf; 3163 pub const CTLTYPE_NODE: ::c_int = 1; 3164 pub const CTLTYPE_INT: ::c_int = 2; 3165 pub const CTLTYPE_STRING: ::c_int = 3; 3166 pub const CTLTYPE_QUAD: ::c_int = 4; 3167 pub const CTLTYPE_OPAQUE: ::c_int = 5; 3168 pub const CTLTYPE_STRUCT: ::c_int = CTLTYPE_OPAQUE; 3169 pub const CTLFLAG_RD: ::c_int = 0x80000000; 3170 pub const CTLFLAG_WR: ::c_int = 0x40000000; 3171 pub const CTLFLAG_RW: ::c_int = CTLFLAG_RD | CTLFLAG_WR; 3172 pub const CTLFLAG_NOLOCK: ::c_int = 0x20000000; 3173 pub const CTLFLAG_ANYBODY: ::c_int = 0x10000000; 3174 pub const CTLFLAG_SECURE: ::c_int = 0x08000000; 3175 pub const CTLFLAG_MASKED: ::c_int = 0x04000000; 3176 pub const CTLFLAG_NOAUTO: ::c_int = 0x02000000; 3177 pub const CTLFLAG_KERN: ::c_int = 0x01000000; 3178 pub const CTLFLAG_LOCKED: ::c_int = 0x00800000; 3179 pub const CTLFLAG_OID2: ::c_int = 0x00400000; 3180 pub const CTL_UNSPEC: ::c_int = 0; 3181 pub const CTL_KERN: ::c_int = 1; 3182 pub const CTL_VM: ::c_int = 2; 3183 pub const CTL_VFS: ::c_int = 3; 3184 pub const CTL_NET: ::c_int = 4; 3185 pub const CTL_DEBUG: ::c_int = 5; 3186 pub const CTL_HW: ::c_int = 6; 3187 pub const CTL_MACHDEP: ::c_int = 7; 3188 pub const CTL_USER: ::c_int = 8; 3189 pub const CTL_MAXID: ::c_int = 9; 3190 pub const KERN_OSTYPE: ::c_int = 1; 3191 pub const KERN_OSRELEASE: ::c_int = 2; 3192 pub const KERN_OSREV: ::c_int = 3; 3193 pub const KERN_VERSION: ::c_int = 4; 3194 pub const KERN_MAXVNODES: ::c_int = 5; 3195 pub const KERN_MAXPROC: ::c_int = 6; 3196 pub const KERN_MAXFILES: ::c_int = 7; 3197 pub const KERN_ARGMAX: ::c_int = 8; 3198 pub const KERN_SECURELVL: ::c_int = 9; 3199 pub const KERN_HOSTNAME: ::c_int = 10; 3200 pub const KERN_HOSTID: ::c_int = 11; 3201 pub const KERN_CLOCKRATE: ::c_int = 12; 3202 pub const KERN_VNODE: ::c_int = 13; 3203 pub const KERN_PROC: ::c_int = 14; 3204 pub const KERN_FILE: ::c_int = 15; 3205 pub const KERN_PROF: ::c_int = 16; 3206 pub const KERN_POSIX1: ::c_int = 17; 3207 pub const KERN_NGROUPS: ::c_int = 18; 3208 pub const KERN_JOB_CONTROL: ::c_int = 19; 3209 pub const KERN_SAVED_IDS: ::c_int = 20; 3210 pub const KERN_BOOTTIME: ::c_int = 21; 3211 pub const KERN_NISDOMAINNAME: ::c_int = 22; 3212 pub const KERN_DOMAINNAME: ::c_int = KERN_NISDOMAINNAME; 3213 pub const KERN_MAXPARTITIONS: ::c_int = 23; 3214 pub const KERN_KDEBUG: ::c_int = 24; 3215 pub const KERN_UPDATEINTERVAL: ::c_int = 25; 3216 pub const KERN_OSRELDATE: ::c_int = 26; 3217 pub const KERN_NTP_PLL: ::c_int = 27; 3218 pub const KERN_BOOTFILE: ::c_int = 28; 3219 pub const KERN_MAXFILESPERPROC: ::c_int = 29; 3220 pub const KERN_MAXPROCPERUID: ::c_int = 30; 3221 pub const KERN_DUMPDEV: ::c_int = 31; 3222 pub const KERN_IPC: ::c_int = 32; 3223 pub const KERN_DUMMY: ::c_int = 33; 3224 pub const KERN_PS_STRINGS: ::c_int = 34; 3225 pub const KERN_USRSTACK32: ::c_int = 35; 3226 pub const KERN_LOGSIGEXIT: ::c_int = 36; 3227 pub const KERN_SYMFILE: ::c_int = 37; 3228 pub const KERN_PROCARGS: ::c_int = 38; 3229 pub const KERN_NETBOOT: ::c_int = 40; 3230 pub const KERN_SYSV: ::c_int = 42; 3231 pub const KERN_AFFINITY: ::c_int = 43; 3232 pub const KERN_TRANSLATE: ::c_int = 44; 3233 pub const KERN_CLASSIC: ::c_int = KERN_TRANSLATE; 3234 pub const KERN_EXEC: ::c_int = 45; 3235 pub const KERN_CLASSICHANDLER: ::c_int = KERN_EXEC; 3236 pub const KERN_AIOMAX: ::c_int = 46; 3237 pub const KERN_AIOPROCMAX: ::c_int = 47; 3238 pub const KERN_AIOTHREADS: ::c_int = 48; 3239 pub const KERN_COREFILE: ::c_int = 50; 3240 pub const KERN_COREDUMP: ::c_int = 51; 3241 pub const KERN_SUGID_COREDUMP: ::c_int = 52; 3242 pub const KERN_PROCDELAYTERM: ::c_int = 53; 3243 pub const KERN_SHREG_PRIVATIZABLE: ::c_int = 54; 3244 pub const KERN_LOW_PRI_WINDOW: ::c_int = 56; 3245 pub const KERN_LOW_PRI_DELAY: ::c_int = 57; 3246 pub const KERN_POSIX: ::c_int = 58; 3247 pub const KERN_USRSTACK64: ::c_int = 59; 3248 pub const KERN_NX_PROTECTION: ::c_int = 60; 3249 pub const KERN_TFP: ::c_int = 61; 3250 pub const KERN_PROCNAME: ::c_int = 62; 3251 pub const KERN_THALTSTACK: ::c_int = 63; 3252 pub const KERN_SPECULATIVE_READS: ::c_int = 64; 3253 pub const KERN_OSVERSION: ::c_int = 65; 3254 pub const KERN_SAFEBOOT: ::c_int = 66; 3255 pub const KERN_RAGEVNODE: ::c_int = 68; 3256 pub const KERN_TTY: ::c_int = 69; 3257 pub const KERN_CHECKOPENEVT: ::c_int = 70; 3258 pub const KERN_THREADNAME: ::c_int = 71; 3259 pub const KERN_MAXID: ::c_int = 72; 3260 pub const KERN_RAGE_PROC: ::c_int = 1; 3261 pub const KERN_RAGE_THREAD: ::c_int = 2; 3262 pub const KERN_UNRAGE_PROC: ::c_int = 3; 3263 pub const KERN_UNRAGE_THREAD: ::c_int = 4; 3264 pub const KERN_OPENEVT_PROC: ::c_int = 1; 3265 pub const KERN_UNOPENEVT_PROC: ::c_int = 2; 3266 pub const KERN_TFP_POLICY: ::c_int = 1; 3267 pub const KERN_TFP_POLICY_DENY: ::c_int = 0; 3268 pub const KERN_TFP_POLICY_DEFAULT: ::c_int = 2; 3269 pub const KERN_KDEFLAGS: ::c_int = 1; 3270 pub const KERN_KDDFLAGS: ::c_int = 2; 3271 pub const KERN_KDENABLE: ::c_int = 3; 3272 pub const KERN_KDSETBUF: ::c_int = 4; 3273 pub const KERN_KDGETBUF: ::c_int = 5; 3274 pub const KERN_KDSETUP: ::c_int = 6; 3275 pub const KERN_KDREMOVE: ::c_int = 7; 3276 pub const KERN_KDSETREG: ::c_int = 8; 3277 pub const KERN_KDGETREG: ::c_int = 9; 3278 pub const KERN_KDREADTR: ::c_int = 10; 3279 pub const KERN_KDPIDTR: ::c_int = 11; 3280 pub const KERN_KDTHRMAP: ::c_int = 12; 3281 pub const KERN_KDPIDEX: ::c_int = 14; 3282 pub const KERN_KDSETRTCDEC: ::c_int = 15; 3283 pub const KERN_KDGETENTROPY: ::c_int = 16; 3284 pub const KERN_KDWRITETR: ::c_int = 17; 3285 pub const KERN_KDWRITEMAP: ::c_int = 18; 3286 #[doc(hidden)] 3287 #[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")] 3288 pub const KERN_KDENABLE_BG_TRACE: ::c_int = 19; 3289 #[doc(hidden)] 3290 #[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")] 3291 pub const KERN_KDDISABLE_BG_TRACE: ::c_int = 20; 3292 pub const KERN_KDREADCURTHRMAP: ::c_int = 21; 3293 pub const KERN_KDSET_TYPEFILTER: ::c_int = 22; 3294 pub const KERN_KDBUFWAIT: ::c_int = 23; 3295 pub const KERN_KDCPUMAP: ::c_int = 24; 3296 pub const KERN_PROC_ALL: ::c_int = 0; 3297 pub const KERN_PROC_PID: ::c_int = 1; 3298 pub const KERN_PROC_PGRP: ::c_int = 2; 3299 pub const KERN_PROC_SESSION: ::c_int = 3; 3300 pub const KERN_PROC_TTY: ::c_int = 4; 3301 pub const KERN_PROC_UID: ::c_int = 5; 3302 pub const KERN_PROC_RUID: ::c_int = 6; 3303 pub const KERN_PROC_LCID: ::c_int = 7; 3304 pub const KERN_SUCCESS: ::c_int = 0; 3305 pub const KERN_INVALID_ADDRESS: ::c_int = 1; 3306 pub const KERN_PROTECTION_FAILURE: ::c_int = 2; 3307 pub const KERN_NO_SPACE: ::c_int = 3; 3308 pub const KERN_INVALID_ARGUMENT: ::c_int = 4; 3309 pub const KERN_FAILURE: ::c_int = 5; 3310 pub const KERN_RESOURCE_SHORTAGE: ::c_int = 6; 3311 pub const KERN_NOT_RECEIVER: ::c_int = 7; 3312 pub const KERN_NO_ACCESS: ::c_int = 8; 3313 pub const KERN_MEMORY_FAILURE: ::c_int = 9; 3314 pub const KERN_MEMORY_ERROR: ::c_int = 10; 3315 pub const KERN_ALREADY_IN_SET: ::c_int = 11; 3316 pub const KERN_NOT_IN_SET: ::c_int = 12; 3317 pub const KERN_NAME_EXISTS: ::c_int = 13; 3318 pub const KERN_ABORTED: ::c_int = 14; 3319 pub const KERN_INVALID_NAME: ::c_int = 15; 3320 pub const KERN_INVALID_TASK: ::c_int = 16; 3321 pub const KERN_INVALID_RIGHT: ::c_int = 17; 3322 pub const KERN_INVALID_VALUE: ::c_int = 18; 3323 pub const KERN_UREFS_OVERFLOW: ::c_int = 19; 3324 pub const KERN_INVALID_CAPABILITY: ::c_int = 20; 3325 pub const KERN_RIGHT_EXISTS: ::c_int = 21; 3326 pub const KERN_INVALID_HOST: ::c_int = 22; 3327 pub const KERN_MEMORY_PRESENT: ::c_int = 23; 3328 pub const KERN_MEMORY_DATA_MOVED: ::c_int = 24; 3329 pub const KERN_MEMORY_RESTART_COPY: ::c_int = 25; 3330 pub const KERN_INVALID_PROCESSOR_SET: ::c_int = 26; 3331 pub const KERN_POLICY_LIMIT: ::c_int = 27; 3332 pub const KERN_INVALID_POLICY: ::c_int = 28; 3333 pub const KERN_INVALID_OBJECT: ::c_int = 29; 3334 pub const KERN_ALREADY_WAITING: ::c_int = 30; 3335 pub const KERN_DEFAULT_SET: ::c_int = 31; 3336 pub const KERN_EXCEPTION_PROTECTED: ::c_int = 32; 3337 pub const KERN_INVALID_LEDGER: ::c_int = 33; 3338 pub const KERN_INVALID_MEMORY_CONTROL: ::c_int = 34; 3339 pub const KERN_INVALID_SECURITY: ::c_int = 35; 3340 pub const KERN_NOT_DEPRESSED: ::c_int = 36; 3341 pub const KERN_TERMINATED: ::c_int = 37; 3342 pub const KERN_LOCK_SET_DESTROYED: ::c_int = 38; 3343 pub const KERN_LOCK_UNSTABLE: ::c_int = 39; 3344 pub const KERN_LOCK_OWNED: ::c_int = 40; 3345 pub const KERN_LOCK_OWNED_SELF: ::c_int = 41; 3346 pub const KERN_SEMAPHORE_DESTROYED: ::c_int = 42; 3347 pub const KERN_RPC_SERVER_TERMINATED: ::c_int = 43; 3348 pub const KERN_RPC_TERMINATE_ORPHAN: ::c_int = 44; 3349 pub const KERN_RPC_CONTINUE_ORPHAN: ::c_int = 45; 3350 pub const KERN_NOT_SUPPORTED: ::c_int = 46; 3351 pub const KERN_NODE_DOWN: ::c_int = 47; 3352 pub const KERN_NOT_WAITING: ::c_int = 48; 3353 pub const KERN_OPERATION_TIMED_OUT: ::c_int = 49; 3354 pub const KERN_CODESIGN_ERROR: ::c_int = 50; 3355 pub const KERN_POLICY_STATIC: ::c_int = 51; 3356 pub const KERN_INSUFFICIENT_BUFFER_SIZE: ::c_int = 52; 3357 pub const KIPC_MAXSOCKBUF: ::c_int = 1; 3358 pub const KIPC_SOCKBUF_WASTE: ::c_int = 2; 3359 pub const KIPC_SOMAXCONN: ::c_int = 3; 3360 pub const KIPC_MAX_LINKHDR: ::c_int = 4; 3361 pub const KIPC_MAX_PROTOHDR: ::c_int = 5; 3362 pub const KIPC_MAX_HDR: ::c_int = 6; 3363 pub const KIPC_MAX_DATALEN: ::c_int = 7; 3364 pub const KIPC_MBSTAT: ::c_int = 8; 3365 pub const KIPC_NMBCLUSTERS: ::c_int = 9; 3366 pub const KIPC_SOQLIMITCOMPAT: ::c_int = 10; 3367 pub const VM_METER: ::c_int = 1; 3368 pub const VM_LOADAVG: ::c_int = 2; 3369 pub const VM_MACHFACTOR: ::c_int = 4; 3370 pub const VM_SWAPUSAGE: ::c_int = 5; 3371 pub const VM_MAXID: ::c_int = 6; 3372 pub const VM_PROT_NONE: ::vm_prot_t = 0x00; 3373 pub const VM_PROT_READ: ::vm_prot_t = 0x01; 3374 pub const VM_PROT_WRITE: ::vm_prot_t = 0x02; 3375 pub const VM_PROT_EXECUTE: ::vm_prot_t = 0x04; 3376 pub const MEMORY_OBJECT_NULL: ::memory_object_t = 0; 3377 pub const HW_MACHINE: ::c_int = 1; 3378 pub const HW_MODEL: ::c_int = 2; 3379 pub const HW_NCPU: ::c_int = 3; 3380 pub const HW_BYTEORDER: ::c_int = 4; 3381 pub const HW_PHYSMEM: ::c_int = 5; 3382 pub const HW_USERMEM: ::c_int = 6; 3383 pub const HW_PAGESIZE: ::c_int = 7; 3384 pub const HW_DISKNAMES: ::c_int = 8; 3385 pub const HW_DISKSTATS: ::c_int = 9; 3386 pub const HW_EPOCH: ::c_int = 10; 3387 pub const HW_FLOATINGPT: ::c_int = 11; 3388 pub const HW_MACHINE_ARCH: ::c_int = 12; 3389 pub const HW_VECTORUNIT: ::c_int = 13; 3390 pub const HW_BUS_FREQ: ::c_int = 14; 3391 pub const HW_CPU_FREQ: ::c_int = 15; 3392 pub const HW_CACHELINE: ::c_int = 16; 3393 pub const HW_L1ICACHESIZE: ::c_int = 17; 3394 pub const HW_L1DCACHESIZE: ::c_int = 18; 3395 pub const HW_L2SETTINGS: ::c_int = 19; 3396 pub const HW_L2CACHESIZE: ::c_int = 20; 3397 pub const HW_L3SETTINGS: ::c_int = 21; 3398 pub const HW_L3CACHESIZE: ::c_int = 22; 3399 pub const HW_TB_FREQ: ::c_int = 23; 3400 pub const HW_MEMSIZE: ::c_int = 24; 3401 pub const HW_AVAILCPU: ::c_int = 25; 3402 pub const HW_TARGET: ::c_int = 26; 3403 pub const HW_PRODUCT: ::c_int = 27; 3404 pub const HW_MAXID: ::c_int = 28; 3405 pub const USER_CS_PATH: ::c_int = 1; 3406 pub const USER_BC_BASE_MAX: ::c_int = 2; 3407 pub const USER_BC_DIM_MAX: ::c_int = 3; 3408 pub const USER_BC_SCALE_MAX: ::c_int = 4; 3409 pub const USER_BC_STRING_MAX: ::c_int = 5; 3410 pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6; 3411 pub const USER_EXPR_NEST_MAX: ::c_int = 7; 3412 pub const USER_LINE_MAX: ::c_int = 8; 3413 pub const USER_RE_DUP_MAX: ::c_int = 9; 3414 pub const USER_POSIX2_VERSION: ::c_int = 10; 3415 pub const USER_POSIX2_C_BIND: ::c_int = 11; 3416 pub const USER_POSIX2_C_DEV: ::c_int = 12; 3417 pub const USER_POSIX2_CHAR_TERM: ::c_int = 13; 3418 pub const USER_POSIX2_FORT_DEV: ::c_int = 14; 3419 pub const USER_POSIX2_FORT_RUN: ::c_int = 15; 3420 pub const USER_POSIX2_LOCALEDEF: ::c_int = 16; 3421 pub const USER_POSIX2_SW_DEV: ::c_int = 17; 3422 pub const USER_POSIX2_UPE: ::c_int = 18; 3423 pub const USER_STREAM_MAX: ::c_int = 19; 3424 pub const USER_TZNAME_MAX: ::c_int = 20; 3425 pub const USER_MAXID: ::c_int = 21; 3426 pub const CTL_DEBUG_NAME: ::c_int = 0; 3427 pub const CTL_DEBUG_VALUE: ::c_int = 1; 3428 pub const CTL_DEBUG_MAXID: ::c_int = 20; 3429 3430 pub const PRIO_DARWIN_THREAD: ::c_int = 3; 3431 pub const PRIO_DARWIN_PROCESS: ::c_int = 4; 3432 pub const PRIO_DARWIN_BG: ::c_int = 0x1000; 3433 pub const PRIO_DARWIN_NONUI: ::c_int = 0x1001; 3434 3435 pub const SEM_FAILED: *mut sem_t = -1isize as *mut ::sem_t; 3436 3437 pub const AI_PASSIVE: ::c_int = 0x00000001; 3438 pub const AI_CANONNAME: ::c_int = 0x00000002; 3439 pub const AI_NUMERICHOST: ::c_int = 0x00000004; 3440 pub const AI_NUMERICSERV: ::c_int = 0x00001000; 3441 pub const AI_MASK: ::c_int = 3442 AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_ADDRCONFIG; 3443 pub const AI_ALL: ::c_int = 0x00000100; 3444 pub const AI_V4MAPPED_CFG: ::c_int = 0x00000200; 3445 pub const AI_ADDRCONFIG: ::c_int = 0x00000400; 3446 pub const AI_V4MAPPED: ::c_int = 0x00000800; 3447 pub const AI_DEFAULT: ::c_int = AI_V4MAPPED_CFG | AI_ADDRCONFIG; 3448 pub const AI_UNUSABLE: ::c_int = 0x10000000; 3449 3450 pub const SIGEV_NONE: ::c_int = 0; 3451 pub const SIGEV_SIGNAL: ::c_int = 1; 3452 pub const SIGEV_THREAD: ::c_int = 3; 3453 3454 pub const AIO_CANCELED: ::c_int = 2; 3455 pub const AIO_NOTCANCELED: ::c_int = 4; 3456 pub const AIO_ALLDONE: ::c_int = 1; 3457 #[deprecated( 3458 since = "0.2.64", 3459 note = "Can vary at runtime. Use sysconf(3) instead" 3460 )] 3461 pub const AIO_LISTIO_MAX: ::c_int = 16; 3462 pub const LIO_NOP: ::c_int = 0; 3463 pub const LIO_WRITE: ::c_int = 2; 3464 pub const LIO_READ: ::c_int = 1; 3465 pub const LIO_WAIT: ::c_int = 2; 3466 pub const LIO_NOWAIT: ::c_int = 1; 3467 3468 pub const WEXITED: ::c_int = 0x00000004; 3469 pub const WSTOPPED: ::c_int = 0x00000008; 3470 pub const WCONTINUED: ::c_int = 0x00000010; 3471 pub const WNOWAIT: ::c_int = 0x00000020; 3472 3473 pub const P_ALL: idtype_t = 0; 3474 pub const P_PID: idtype_t = 1; 3475 pub const P_PGID: idtype_t = 2; 3476 3477 pub const UTIME_OMIT: c_long = -2; 3478 pub const UTIME_NOW: c_long = -1; 3479 3480 pub const XATTR_NOFOLLOW: ::c_int = 0x0001; 3481 pub const XATTR_CREATE: ::c_int = 0x0002; 3482 pub const XATTR_REPLACE: ::c_int = 0x0004; 3483 pub const XATTR_NOSECURITY: ::c_int = 0x0008; 3484 pub const XATTR_NODEFAULT: ::c_int = 0x0010; 3485 pub const XATTR_SHOWCOMPRESSION: ::c_int = 0x0020; 3486 3487 pub const NET_RT_IFLIST2: ::c_int = 0x0006; 3488 3489 // net/route.h 3490 pub const RTF_UP: ::c_int = 0x1; 3491 pub const RTF_GATEWAY: ::c_int = 0x2; 3492 pub const RTF_HOST: ::c_int = 0x4; 3493 pub const RTF_REJECT: ::c_int = 0x8; 3494 pub const RTF_DYNAMIC: ::c_int = 0x10; 3495 pub const RTF_MODIFIED: ::c_int = 0x20; 3496 pub const RTF_DONE: ::c_int = 0x40; 3497 pub const RTF_DELCLONE: ::c_int = 0x80; 3498 pub const RTF_CLONING: ::c_int = 0x100; 3499 pub const RTF_XRESOLVE: ::c_int = 0x200; 3500 pub const RTF_LLINFO: ::c_int = 0x400; 3501 pub const RTF_STATIC: ::c_int = 0x800; 3502 pub const RTF_BLACKHOLE: ::c_int = 0x1000; 3503 pub const RTF_NOIFREF: ::c_int = 0x2000; 3504 pub const RTF_PROTO2: ::c_int = 0x4000; 3505 pub const RTF_PROTO1: ::c_int = 0x8000; 3506 pub const RTF_PRCLONING: ::c_int = 0x10000; 3507 pub const RTF_WASCLONED: ::c_int = 0x20000; 3508 pub const RTF_PROTO3: ::c_int = 0x40000; 3509 pub const RTF_PINNED: ::c_int = 0x100000; 3510 pub const RTF_LOCAL: ::c_int = 0x200000; 3511 pub const RTF_BROADCAST: ::c_int = 0x400000; 3512 pub const RTF_MULTICAST: ::c_int = 0x800000; 3513 pub const RTF_IFSCOPE: ::c_int = 0x1000000; 3514 pub const RTF_CONDEMNED: ::c_int = 0x2000000; 3515 pub const RTF_IFREF: ::c_int = 0x4000000; 3516 pub const RTF_PROXY: ::c_int = 0x8000000; 3517 pub const RTF_ROUTER: ::c_int = 0x10000000; 3518 3519 pub const RTM_VERSION: ::c_int = 5; 3520 3521 // Message types 3522 pub const RTM_ADD: ::c_int = 0x1; 3523 pub const RTM_DELETE: ::c_int = 0x2; 3524 pub const RTM_CHANGE: ::c_int = 0x3; 3525 pub const RTM_GET: ::c_int = 0x4; 3526 pub const RTM_LOSING: ::c_int = 0x5; 3527 pub const RTM_REDIRECT: ::c_int = 0x6; 3528 pub const RTM_MISS: ::c_int = 0x7; 3529 pub const RTM_LOCK: ::c_int = 0x8; 3530 pub const RTM_OLDADD: ::c_int = 0x9; 3531 pub const RTM_OLDDEL: ::c_int = 0xa; 3532 pub const RTM_RESOLVE: ::c_int = 0xb; 3533 pub const RTM_NEWADDR: ::c_int = 0xc; 3534 pub const RTM_DELADDR: ::c_int = 0xd; 3535 pub const RTM_IFINFO: ::c_int = 0xe; 3536 pub const RTM_NEWMADDR: ::c_int = 0xf; 3537 pub const RTM_DELMADDR: ::c_int = 0x10; 3538 pub const RTM_IFINFO2: ::c_int = 0x12; 3539 pub const RTM_NEWMADDR2: ::c_int = 0x13; 3540 pub const RTM_GET2: ::c_int = 0x14; 3541 3542 // Bitmask values for rtm_inits and rmx_locks. 3543 pub const RTV_MTU: ::c_int = 0x1; 3544 pub const RTV_HOPCOUNT: ::c_int = 0x2; 3545 pub const RTV_EXPIRE: ::c_int = 0x4; 3546 pub const RTV_RPIPE: ::c_int = 0x8; 3547 pub const RTV_SPIPE: ::c_int = 0x10; 3548 pub const RTV_SSTHRESH: ::c_int = 0x20; 3549 pub const RTV_RTT: ::c_int = 0x40; 3550 pub const RTV_RTTVAR: ::c_int = 0x80; 3551 3552 // Bitmask values for rtm_addrs. 3553 pub const RTA_DST: ::c_int = 0x1; 3554 pub const RTA_GATEWAY: ::c_int = 0x2; 3555 pub const RTA_NETMASK: ::c_int = 0x4; 3556 pub const RTA_GENMASK: ::c_int = 0x8; 3557 pub const RTA_IFP: ::c_int = 0x10; 3558 pub const RTA_IFA: ::c_int = 0x20; 3559 pub const RTA_AUTHOR: ::c_int = 0x40; 3560 pub const RTA_BRD: ::c_int = 0x80; 3561 3562 // Index offsets for sockaddr array for alternate internal encoding. 3563 pub const RTAX_DST: ::c_int = 0; 3564 pub const RTAX_GATEWAY: ::c_int = 1; 3565 pub const RTAX_NETMASK: ::c_int = 2; 3566 pub const RTAX_GENMASK: ::c_int = 3; 3567 pub const RTAX_IFP: ::c_int = 4; 3568 pub const RTAX_IFA: ::c_int = 5; 3569 pub const RTAX_AUTHOR: ::c_int = 6; 3570 pub const RTAX_BRD: ::c_int = 7; 3571 pub const RTAX_MAX: ::c_int = 8; 3572 3573 pub const KERN_PROCARGS2: ::c_int = 49; 3574 3575 pub const PROC_PIDTASKALLINFO: ::c_int = 2; 3576 pub const PROC_PIDTBSDINFO: ::c_int = 3; 3577 pub const PROC_PIDTASKINFO: ::c_int = 4; 3578 pub const PROC_PIDTHREADINFO: ::c_int = 5; 3579 pub const PROC_PIDVNODEPATHINFO: ::c_int = 9; 3580 pub const PROC_PIDPATHINFO_MAXSIZE: ::c_int = 4096; 3581 pub const MAXCOMLEN: usize = 16; 3582 pub const MAXTHREADNAMESIZE: usize = 64; 3583 3584 pub const XUCRED_VERSION: ::c_uint = 0; 3585 3586 pub const LC_SEGMENT: u32 = 0x1; 3587 pub const LC_SEGMENT_64: u32 = 0x19; 3588 3589 pub const MH_MAGIC: u32 = 0xfeedface; 3590 pub const MH_MAGIC_64: u32 = 0xfeedfacf; 3591 3592 // net/if_utun.h 3593 pub const UTUN_OPT_FLAGS: ::c_int = 1; 3594 pub const UTUN_OPT_IFNAME: ::c_int = 2; 3595 3596 // net/bpf.h 3597 pub const DLT_NULL: ::c_uint = 0; // no link-layer encapsulation 3598 pub const DLT_EN10MB: ::c_uint = 1; // Ethernet (10Mb) 3599 pub const DLT_EN3MB: ::c_uint = 2; // Experimental Ethernet (3Mb) 3600 pub const DLT_AX25: ::c_uint = 3; // Amateur Radio AX.25 3601 pub const DLT_PRONET: ::c_uint = 4; // Proteon ProNET Token Ring 3602 pub const DLT_CHAOS: ::c_uint = 5; // Chaos 3603 pub const DLT_IEEE802: ::c_uint = 6; // IEEE 802 Networks 3604 pub const DLT_ARCNET: ::c_uint = 7; // ARCNET 3605 pub const DLT_SLIP: ::c_uint = 8; // Serial Line IP 3606 pub const DLT_PPP: ::c_uint = 9; // Point-to-point Protocol 3607 pub const DLT_FDDI: ::c_uint = 10; // FDDI 3608 pub const DLT_ATM_RFC1483: ::c_uint = 11; // LLC/SNAP encapsulated atm 3609 pub const DLT_RAW: ::c_uint = 12; // raw IP 3610 pub const DLT_LOOP: ::c_uint = 108; 3611 3612 // https://github.com/apple/darwin-xnu/blob/master/bsd/net/bpf.h#L100 3613 // sizeof(i32) 3614 pub const BPF_ALIGNMENT: ::c_int = 4; 3615 3616 // sys/mount.h 3617 pub const MNT_NODEV: ::c_int = 0x00000010; 3618 pub const MNT_UNION: ::c_int = 0x00000020; 3619 pub const MNT_CPROTECT: ::c_int = 0x00000080; 3620 3621 // MAC labeled / "quarantined" flag 3622 pub const MNT_QUARANTINE: ::c_int = 0x00000400; 3623 3624 // Flags set by internal operations. 3625 pub const MNT_LOCAL: ::c_int = 0x00001000; 3626 pub const MNT_QUOTA: ::c_int = 0x00002000; 3627 pub const MNT_ROOTFS: ::c_int = 0x00004000; 3628 pub const MNT_DOVOLFS: ::c_int = 0x00008000; 3629 3630 pub const MNT_DONTBROWSE: ::c_int = 0x00100000; 3631 pub const MNT_IGNORE_OWNERSHIP: ::c_int = 0x00200000; 3632 pub const MNT_AUTOMOUNTED: ::c_int = 0x00400000; 3633 pub const MNT_JOURNALED: ::c_int = 0x00800000; 3634 pub const MNT_NOUSERXATTR: ::c_int = 0x01000000; 3635 pub const MNT_DEFWRITE: ::c_int = 0x02000000; 3636 pub const MNT_MULTILABEL: ::c_int = 0x04000000; 3637 pub const MNT_NOATIME: ::c_int = 0x10000000; 3638 pub const MNT_SNAPSHOT: ::c_int = 0x40000000; 3639 3640 // External filesystem command modifier flags. 3641 pub const MNT_NOBLOCK: ::c_int = 0x00020000; 3642 3643 // sys/spawn.h: 3644 pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01; 3645 pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02; 3646 pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x04; 3647 pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x08; 3648 pub const POSIX_SPAWN_SETEXEC: ::c_int = 0x40; 3649 pub const POSIX_SPAWN_START_SUSPENDED: ::c_int = 0x80; 3650 pub const POSIX_SPAWN_CLOEXEC_DEFAULT: ::c_int = 0x4000; 3651 3652 // sys/ipc.h: 3653 pub const IPC_CREAT: ::c_int = 0x200; 3654 pub const IPC_EXCL: ::c_int = 0x400; 3655 pub const IPC_NOWAIT: ::c_int = 0x800; 3656 pub const IPC_PRIVATE: key_t = 0; 3657 3658 pub const IPC_RMID: ::c_int = 0; 3659 pub const IPC_SET: ::c_int = 1; 3660 pub const IPC_STAT: ::c_int = 2; 3661 3662 pub const IPC_R: ::c_int = 0x100; 3663 pub const IPC_W: ::c_int = 0x80; 3664 pub const IPC_M: ::c_int = 0x1000; 3665 3666 // sys/sem.h 3667 pub const SEM_UNDO: ::c_int = 0o10000; 3668 3669 pub const GETNCNT: ::c_int = 3; 3670 pub const GETPID: ::c_int = 4; 3671 pub const GETVAL: ::c_int = 5; 3672 pub const GETALL: ::c_int = 6; 3673 pub const GETZCNT: ::c_int = 7; 3674 pub const SETVAL: ::c_int = 8; 3675 pub const SETALL: ::c_int = 9; 3676 3677 // sys/shm.h 3678 pub const SHM_RDONLY: ::c_int = 0x1000; 3679 pub const SHM_RND: ::c_int = 0x2000; 3680 #[cfg(target_arch = "aarch64")] 3681 pub const SHMLBA: ::c_int = 16 * 1024; 3682 #[cfg(not(target_arch = "aarch64"))] 3683 pub const SHMLBA: ::c_int = 4096; 3684 pub const SHM_R: ::c_int = IPC_R; 3685 pub const SHM_W: ::c_int = IPC_W; 3686 3687 // Flags for chflags(2) 3688 pub const UF_SETTABLE: ::c_uint = 0x0000ffff; 3689 pub const UF_NODUMP: ::c_uint = 0x00000001; 3690 pub const UF_IMMUTABLE: ::c_uint = 0x00000002; 3691 pub const UF_APPEND: ::c_uint = 0x00000004; 3692 pub const UF_OPAQUE: ::c_uint = 0x00000008; 3693 pub const UF_COMPRESSED: ::c_uint = 0x00000020; 3694 pub const UF_TRACKED: ::c_uint = 0x00000040; 3695 pub const SF_SETTABLE: ::c_uint = 0xffff0000; 3696 pub const SF_ARCHIVED: ::c_uint = 0x00010000; 3697 pub const SF_IMMUTABLE: ::c_uint = 0x00020000; 3698 pub const SF_APPEND: ::c_uint = 0x00040000; 3699 pub const UF_HIDDEN: ::c_uint = 0x00008000; 3700 3701 //<sys/timex.h> 3702 pub const NTP_API: ::c_int = 4; 3703 pub const MAXPHASE: ::c_long = 500000000; 3704 pub const MAXFREQ: ::c_long = 500000; 3705 pub const MINSEC: ::c_int = 256; 3706 pub const MAXSEC: ::c_int = 2048; 3707 pub const NANOSECOND: ::c_long = 1000000000; 3708 pub const SCALE_PPM: ::c_int = 65; 3709 pub const MAXTC: ::c_int = 10; 3710 pub const MOD_OFFSET: ::c_uint = 0x0001; 3711 pub const MOD_FREQUENCY: ::c_uint = 0x0002; 3712 pub const MOD_MAXERROR: ::c_uint = 0x0004; 3713 pub const MOD_ESTERROR: ::c_uint = 0x0008; 3714 pub const MOD_STATUS: ::c_uint = 0x0010; 3715 pub const MOD_TIMECONST: ::c_uint = 0x0020; 3716 pub const MOD_PPSMAX: ::c_uint = 0x0040; 3717 pub const MOD_TAI: ::c_uint = 0x0080; 3718 pub const MOD_MICRO: ::c_uint = 0x1000; 3719 pub const MOD_NANO: ::c_uint = 0x2000; 3720 pub const MOD_CLKB: ::c_uint = 0x4000; 3721 pub const MOD_CLKA: ::c_uint = 0x8000; 3722 pub const STA_PLL: ::c_int = 0x0001; 3723 pub const STA_PPSFREQ: ::c_int = 0x0002; 3724 pub const STA_PPSTIME: ::c_int = 0x0004; 3725 pub const STA_FLL: ::c_int = 0x0008; 3726 pub const STA_INS: ::c_int = 0x0010; 3727 pub const STA_DEL: ::c_int = 0x0020; 3728 pub const STA_UNSYNC: ::c_int = 0x0040; 3729 pub const STA_FREQHOLD: ::c_int = 0x0080; 3730 pub const STA_PPSSIGNAL: ::c_int = 0x0100; 3731 pub const STA_PPSJITTER: ::c_int = 0x0200; 3732 pub const STA_PPSWANDER: ::c_int = 0x0400; 3733 pub const STA_PPSERROR: ::c_int = 0x0800; 3734 pub const STA_CLOCKERR: ::c_int = 0x1000; 3735 pub const STA_NANO: ::c_int = 0x2000; 3736 pub const STA_MODE: ::c_int = 0x4000; 3737 pub const STA_CLK: ::c_int = 0x8000; 3738 pub const STA_RONLY: ::c_int = STA_PPSSIGNAL 3739 | STA_PPSJITTER 3740 | STA_PPSWANDER 3741 | STA_PPSERROR 3742 | STA_CLOCKERR 3743 | STA_NANO 3744 | STA_MODE 3745 | STA_CLK; 3746 pub const TIME_OK: ::c_int = 0; 3747 pub const TIME_INS: ::c_int = 1; 3748 pub const TIME_DEL: ::c_int = 2; 3749 pub const TIME_OOP: ::c_int = 3; 3750 pub const TIME_WAIT: ::c_int = 4; 3751 pub const TIME_ERROR: ::c_int = 5; 3752 3753 // <sys/mount.h> 3754 pub const MNT_WAIT: ::c_int = 1; 3755 pub const MNT_NOWAIT: ::c_int = 2; 3756 3757 // <mach/thread_policy.h> 3758 pub const THREAD_STANDARD_POLICY: ::c_int = 1; 3759 pub const THREAD_STANDARD_POLICY_COUNT: ::c_int = 0; 3760 pub const THREAD_EXTENDED_POLICY: ::c_int = 1; 3761 pub const THREAD_TIME_CONSTRAINT_POLICY: ::c_int = 2; 3762 pub const THREAD_PRECEDENCE_POLICY: ::c_int = 3; 3763 pub const THREAD_AFFINITY_POLICY: ::c_int = 4; 3764 pub const THREAD_AFFINITY_TAG_NULL: ::c_int = 0; 3765 pub const THREAD_BACKGROUND_POLICY: ::c_int = 5; 3766 pub const THREAD_BACKGROUND_POLICY_DARWIN_BG: ::c_int = 0x1000; 3767 pub const THREAD_LATENCY_QOS_POLICY: ::c_int = 7; 3768 pub const THREAD_THROUGHPUT_QOS_POLICY: ::c_int = 8; 3769 3770 // <mach/thread_info.h> 3771 pub const TH_STATE_RUNNING: ::c_int = 1; 3772 pub const TH_STATE_STOPPED: ::c_int = 2; 3773 pub const TH_STATE_WAITING: ::c_int = 3; 3774 pub const TH_STATE_UNINTERRUPTIBLE: ::c_int = 4; 3775 pub const TH_STATE_HALTED: ::c_int = 5; 3776 pub const TH_FLAGS_SWAPPED: ::c_int = 0x1; 3777 pub const TH_FLAGS_IDLE: ::c_int = 0x2; 3778 pub const TH_FLAGS_GLOBAL_FORCED_IDLE: ::c_int = 0x4; 3779 pub const THREAD_BASIC_INFO: ::c_int = 3; 3780 pub const THREAD_IDENTIFIER_INFO: ::c_int = 4; 3781 pub const THREAD_EXTENDED_INFO: ::c_int = 5; 3782 3783 // CommonCrypto/CommonCryptoError.h 3784 pub const kCCSuccess: i32 = 0; 3785 pub const kCCParamError: i32 = -4300; 3786 pub const kCCBufferTooSmall: i32 = -4301; 3787 pub const kCCMemoryFailure: i32 = -4302; 3788 pub const kCCAlignmentError: i32 = -4303; 3789 pub const kCCDecodeError: i32 = -4304; 3790 pub const kCCUnimplemented: i32 = -4305; 3791 pub const kCCOverflow: i32 = -4306; 3792 pub const kCCRNGFailure: i32 = -4307; 3793 pub const kCCUnspecifiedError: i32 = -4308; 3794 pub const kCCCallSequenceError: i32 = -4309; 3795 pub const kCCKeySizeError: i32 = -4310; 3796 pub const kCCInvalidKey: i32 = -4311; 3797 3798 cfg_if! { 3799 if #[cfg(libc_const_extern_fn)] { 3800 const fn __DARWIN_ALIGN32(p: usize) -> usize { 3801 const __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1; 3802 p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32 3803 } 3804 } else if #[cfg(libc_const_size_of)] { 3805 fn __DARWIN_ALIGN32(p: usize) -> usize { 3806 const __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1; 3807 p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32 3808 } 3809 pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t = 3810 (::mem::size_of::<thread_extended_policy_data_t>() / ::mem::size_of::<integer_t>()) 3811 as mach_msg_type_number_t; 3812 pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t = 3813 (::mem::size_of::<thread_time_constraint_policy_data_t>() / 3814 ::mem::size_of::<integer_t>()) as mach_msg_type_number_t; 3815 pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t = 3816 (::mem::size_of::<thread_precedence_policy_data_t>() / ::mem::size_of::<integer_t>()) 3817 as mach_msg_type_number_t; 3818 pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t = 3819 (::mem::size_of::<thread_affinity_policy_data_t>() / ::mem::size_of::<integer_t>()) 3820 as mach_msg_type_number_t; 3821 pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t = 3822 (::mem::size_of::<thread_background_policy_data_t>() / ::mem::size_of::<integer_t>()) 3823 as mach_msg_type_number_t; 3824 pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t = 3825 (::mem::size_of::<thread_latency_qos_policy_data_t>() / ::mem::size_of::<integer_t>()) 3826 as mach_msg_type_number_t; 3827 pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t = 3828 (::mem::size_of::<thread_throughput_qos_policy_data_t>() / 3829 ::mem::size_of::<integer_t>()) as mach_msg_type_number_t; 3830 pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t = 3831 (::mem::size_of::<thread_basic_info_data_t>() / ::mem::size_of::<integer_t>()) 3832 as mach_msg_type_number_t; 3833 pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t = 3834 (::mem::size_of::<thread_identifier_info_data_t>() / ::mem::size_of::<integer_t>()) 3835 as mach_msg_type_number_t; 3836 pub const THREAD_EXTENDED_INFO_COUNT: mach_msg_type_number_t = 3837 (::mem::size_of::<thread_extended_info_data_t>() / ::mem::size_of::<integer_t>()) 3838 as mach_msg_type_number_t; 3839 } else { 3840 fn __DARWIN_ALIGN32(p: usize) -> usize { 3841 let __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1; 3842 p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32 3843 } 3844 pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t = 1; 3845 pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t = 4; 3846 pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t = 1; 3847 pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t = 1; 3848 pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t = 1; 3849 pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t = 1; 3850 pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t = 1; 3851 pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t = 10; 3852 pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t = 6; 3853 pub const THREAD_EXTENDED_INFO_COUNT: mach_msg_type_number_t = 28; 3854 } 3855 } 3856 3857 f! { 3858 pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, 3859 cmsg: *const ::cmsghdr) -> *mut ::cmsghdr { 3860 if cmsg.is_null() { 3861 return ::CMSG_FIRSTHDR(mhdr); 3862 }; 3863 let cmsg_len = (*cmsg).cmsg_len as usize; 3864 let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len as usize); 3865 let max = (*mhdr).msg_control as usize 3866 + (*mhdr).msg_controllen as usize; 3867 if next + __DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) > max { 3868 0 as *mut ::cmsghdr 3869 } else { 3870 next as *mut ::cmsghdr 3871 } 3872 } 3873 3874 pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar { 3875 (cmsg as *mut ::c_uchar) 3876 .offset(__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) as isize) 3877 } 3878 3879 pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { 3880 (__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) 3881 + __DARWIN_ALIGN32(length as usize)) 3882 as ::c_uint 3883 } 3884 3885 pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { 3886 (__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) + length as usize) 3887 as ::c_uint 3888 } 3889 3890 pub {const} fn VM_MAKE_TAG(id: u8) -> u32 { 3891 (id as u32) << 24u32 3892 } 3893 } 3894 3895 safe_f! { 3896 pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int { 3897 status >> 8 3898 } 3899 3900 pub {const} fn _WSTATUS(status: ::c_int) -> ::c_int { 3901 status & 0x7f 3902 } 3903 3904 pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { 3905 _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) == 0x13 3906 } 3907 3908 pub {const} fn WIFSIGNALED(status: ::c_int) -> bool { 3909 _WSTATUS(status) != _WSTOPPED && _WSTATUS(status) != 0 3910 } 3911 3912 pub {const} fn WIFSTOPPED(status: ::c_int) -> bool { 3913 _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) != 0x13 3914 } 3915 } 3916 3917 extern "C" { setgrent()3918 pub fn setgrent(); 3919 #[doc(hidden)] 3920 #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.5")] 3921 #[cfg_attr(not(target_arch = "aarch64"), link_name = "daemon$1050")] daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int3922 pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; 3923 #[doc(hidden)] 3924 #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")] sem_destroy(sem: *mut sem_t) -> ::c_int3925 pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; 3926 #[doc(hidden)] 3927 #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")] sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int3928 pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int; aio_read(aiocbp: *mut aiocb) -> ::c_int3929 pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int; aio_write(aiocbp: *mut aiocb) -> ::c_int3930 pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int; aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int3931 pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int; aio_error(aiocbp: *const aiocb) -> ::c_int3932 pub fn aio_error(aiocbp: *const aiocb) -> ::c_int; aio_return(aiocbp: *mut aiocb) -> ::ssize_t3933 pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t; 3934 #[cfg_attr( 3935 all(target_os = "macos", target_arch = "x86"), 3936 link_name = "aio_suspend$UNIX2003" 3937 )] aio_suspend( aiocb_list: *const *const aiocb, nitems: ::c_int, timeout: *const ::timespec, ) -> ::c_int3938 pub fn aio_suspend( 3939 aiocb_list: *const *const aiocb, 3940 nitems: ::c_int, 3941 timeout: *const ::timespec, 3942 ) -> ::c_int; aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int3943 pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; chflags(path: *const ::c_char, flags: ::c_uint) -> ::c_int3944 pub fn chflags(path: *const ::c_char, flags: ::c_uint) -> ::c_int; fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int3945 pub fn fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int; clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int3946 pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int3947 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_int3948 pub fn lio_listio( 3949 mode: ::c_int, 3950 aiocb_list: *const *mut aiocb, 3951 nitems: ::c_int, 3952 sevp: *mut sigevent, 3953 ) -> ::c_int; 3954 dirfd(dirp: *mut ::DIR) -> ::c_int3955 pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; 3956 lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int3957 pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; 3958 gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int3959 pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; getutxent() -> *mut utmpx3960 pub fn getutxent() -> *mut utmpx; getutxid(ut: *const utmpx) -> *mut utmpx3961 pub fn getutxid(ut: *const utmpx) -> *mut utmpx; getutxline(ut: *const utmpx) -> *mut utmpx3962 pub fn getutxline(ut: *const utmpx) -> *mut utmpx; pututxline(ut: *const utmpx) -> *mut utmpx3963 pub fn pututxline(ut: *const utmpx) -> *mut utmpx; setutxent()3964 pub fn setutxent(); endutxent()3965 pub fn endutxent(); utmpxname(file: *const ::c_char) -> ::c_int3966 pub fn utmpxname(file: *const ::c_char) -> ::c_int; 3967 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_int3968 pub fn getnameinfo( 3969 sa: *const ::sockaddr, 3970 salen: ::socklen_t, 3971 host: *mut ::c_char, 3972 hostlen: ::socklen_t, 3973 serv: *mut ::c_char, 3974 sevlen: ::socklen_t, 3975 flags: ::c_int, 3976 ) -> ::c_int; mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int3977 pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int; sysctlnametomib( name: *const ::c_char, mibp: *mut ::c_int, sizep: *mut ::size_t, ) -> ::c_int3978 pub fn sysctlnametomib( 3979 name: *const ::c_char, 3980 mibp: *mut ::c_int, 3981 sizep: *mut ::size_t, 3982 ) -> ::c_int; 3983 #[cfg_attr( 3984 all(target_os = "macos", target_arch = "x86"), 3985 link_name = "mprotect$UNIX2003" 3986 )] mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int3987 pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; semget(key: key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int3988 pub fn semget(key: key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int; 3989 #[cfg_attr( 3990 all(target_os = "macos", target_arch = "x86"), 3991 link_name = "semctl$UNIX2003" 3992 )] semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int3993 pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int; semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int3994 pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int; shm_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::c_int3995 pub fn shm_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::c_int; ftok(pathname: *const c_char, proj_id: ::c_int) -> key_t3996 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_void3997 pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void; shmdt(shmaddr: *const ::c_void) -> ::c_int3998 pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int; 3999 #[cfg_attr( 4000 all(target_os = "macos", target_arch = "x86"), 4001 link_name = "shmctl$UNIX2003" 4002 )] shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int4003 pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int; shmget(key: key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int4004 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_int4005 pub fn sysctl( 4006 name: *mut ::c_int, 4007 namelen: ::c_uint, 4008 oldp: *mut ::c_void, 4009 oldlenp: *mut ::size_t, 4010 newp: *mut ::c_void, 4011 newlen: ::size_t, 4012 ) -> ::c_int; sysctlbyname( name: *const ::c_char, oldp: *mut ::c_void, oldlenp: *mut ::size_t, newp: *mut ::c_void, newlen: ::size_t, ) -> ::c_int4013 pub fn sysctlbyname( 4014 name: *const ::c_char, 4015 oldp: *mut ::c_void, 4016 oldlenp: *mut ::size_t, 4017 newp: *mut ::c_void, 4018 newlen: ::size_t, 4019 ) -> ::c_int; 4020 #[deprecated(since = "0.2.55", note = "Use the mach crate")] mach_absolute_time() -> u644021 pub fn mach_absolute_time() -> u64; 4022 #[deprecated(since = "0.2.55", note = "Use the mach crate")] 4023 #[allow(deprecated)] mach_timebase_info(info: *mut ::mach_timebase_info) -> ::c_int4024 pub fn mach_timebase_info(info: *mut ::mach_timebase_info) -> ::c_int; mach_host_self() -> mach_port_t4025 pub fn mach_host_self() -> mach_port_t; mach_thread_self() -> mach_port_t4026 pub fn mach_thread_self() -> mach_port_t; pthread_setname_np(name: *const ::c_char) -> ::c_int4027 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_int4028 pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int; pthread_mach_thread_np(thread: ::pthread_t) -> ::mach_port_t4029 pub fn pthread_mach_thread_np(thread: ::pthread_t) -> ::mach_port_t; pthread_from_mach_thread_np(port: ::mach_port_t) -> ::pthread_t4030 pub fn pthread_from_mach_thread_np(port: ::mach_port_t) -> ::pthread_t; pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void4031 pub fn pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void; pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t4032 pub fn pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t; pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int4033 pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int; pthread_condattr_getpshared( attr: *const pthread_condattr_t, pshared: *mut ::c_int, ) -> ::c_int4034 pub fn pthread_condattr_getpshared( 4035 attr: *const pthread_condattr_t, 4036 pshared: *mut ::c_int, 4037 ) -> ::c_int; pthread_mutexattr_setpshared( attr: *mut pthread_mutexattr_t, pshared: ::c_int, ) -> ::c_int4038 pub fn pthread_mutexattr_setpshared( 4039 attr: *mut pthread_mutexattr_t, 4040 pshared: ::c_int, 4041 ) -> ::c_int; pthread_mutexattr_getpshared( attr: *const pthread_mutexattr_t, pshared: *mut ::c_int, ) -> ::c_int4042 pub fn pthread_mutexattr_getpshared( 4043 attr: *const pthread_mutexattr_t, 4044 pshared: *mut ::c_int, 4045 ) -> ::c_int; pthread_rwlockattr_getpshared( attr: *const pthread_rwlockattr_t, val: *mut ::c_int, ) -> ::c_int4046 pub fn pthread_rwlockattr_getpshared( 4047 attr: *const pthread_rwlockattr_t, 4048 val: *mut ::c_int, 4049 ) -> ::c_int; pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int4050 pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int; pthread_threadid_np(thread: ::pthread_t, thread_id: *mut u64) -> ::c_int4051 pub fn pthread_threadid_np(thread: ::pthread_t, thread_id: *mut u64) -> ::c_int; pthread_attr_set_qos_class_np( attr: *mut pthread_attr_t, class: qos_class_t, priority: ::c_int, ) -> ::c_int4052 pub fn pthread_attr_set_qos_class_np( 4053 attr: *mut pthread_attr_t, 4054 class: qos_class_t, 4055 priority: ::c_int, 4056 ) -> ::c_int; pthread_attr_get_qos_class_np( attr: *mut pthread_attr_t, class: *mut qos_class_t, priority: *mut ::c_int, ) -> ::c_int4057 pub fn pthread_attr_get_qos_class_np( 4058 attr: *mut pthread_attr_t, 4059 class: *mut qos_class_t, 4060 priority: *mut ::c_int, 4061 ) -> ::c_int; pthread_set_qos_class_self_np(class: qos_class_t, priority: ::c_int) -> ::c_int4062 pub fn pthread_set_qos_class_self_np(class: qos_class_t, priority: ::c_int) -> ::c_int; pthread_get_qos_class_np( thread: ::pthread_t, class: *mut qos_class_t, priority: *mut ::c_int, ) -> ::c_int4063 pub fn pthread_get_qos_class_np( 4064 thread: ::pthread_t, 4065 class: *mut qos_class_t, 4066 priority: *mut ::c_int, 4067 ) -> ::c_int; pthread_attr_getschedparam( attr: *const ::pthread_attr_t, param: *mut sched_param, ) -> ::c_int4068 pub fn pthread_attr_getschedparam( 4069 attr: *const ::pthread_attr_t, 4070 param: *mut sched_param, 4071 ) -> ::c_int; pthread_attr_setschedparam( attr: *mut ::pthread_attr_t, param: *const sched_param, ) -> ::c_int4072 pub fn pthread_attr_setschedparam( 4073 attr: *mut ::pthread_attr_t, 4074 param: *const sched_param, 4075 ) -> ::c_int; pthread_getschedparam( thread: ::pthread_t, policy: *mut ::c_int, param: *mut sched_param, ) -> ::c_int4076 pub fn pthread_getschedparam( 4077 thread: ::pthread_t, 4078 policy: *mut ::c_int, 4079 param: *mut sched_param, 4080 ) -> ::c_int; pthread_setschedparam( thread: ::pthread_t, policy: ::c_int, param: *const sched_param, ) -> ::c_int4081 pub fn pthread_setschedparam( 4082 thread: ::pthread_t, 4083 policy: ::c_int, 4084 param: *const sched_param, 4085 ) -> ::c_int; thread_policy_set( thread: thread_t, flavor: thread_policy_flavor_t, policy_info: thread_policy_t, count: mach_msg_type_number_t, ) -> kern_return_t4086 pub fn thread_policy_set( 4087 thread: thread_t, 4088 flavor: thread_policy_flavor_t, 4089 policy_info: thread_policy_t, 4090 count: mach_msg_type_number_t, 4091 ) -> kern_return_t; thread_policy_get( thread: thread_t, flavor: thread_policy_flavor_t, policy_info: thread_policy_t, count: *mut mach_msg_type_number_t, get_default: *mut boolean_t, ) -> kern_return_t4092 pub fn thread_policy_get( 4093 thread: thread_t, 4094 flavor: thread_policy_flavor_t, 4095 policy_info: thread_policy_t, 4096 count: *mut mach_msg_type_number_t, 4097 get_default: *mut boolean_t, 4098 ) -> kern_return_t; thread_info( target_act: thread_inspect_t, flavor: thread_flavor_t, thread_info_out: thread_info_t, thread_info_outCnt: *mut mach_msg_type_number_t, ) -> kern_return_t4099 pub fn thread_info( 4100 target_act: thread_inspect_t, 4101 flavor: thread_flavor_t, 4102 thread_info_out: thread_info_t, 4103 thread_info_outCnt: *mut mach_msg_type_number_t, 4104 ) -> kern_return_t; __error() -> *mut ::c_int4105 pub fn __error() -> *mut ::c_int; backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int4106 pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int; 4107 #[cfg_attr( 4108 all(target_os = "macos", not(target_arch = "aarch64")), 4109 link_name = "statfs$INODE64" 4110 )] statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int4111 pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; 4112 #[cfg_attr( 4113 all(target_os = "macos", not(target_arch = "aarch64")), 4114 link_name = "fstatfs$INODE64" 4115 )] fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int4116 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_int4117 pub fn kevent( 4118 kq: ::c_int, 4119 changelist: *const ::kevent, 4120 nchanges: ::c_int, 4121 eventlist: *mut ::kevent, 4122 nevents: ::c_int, 4123 timeout: *const ::timespec, 4124 ) -> ::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_int4125 pub fn kevent64( 4126 kq: ::c_int, 4127 changelist: *const ::kevent64_s, 4128 nchanges: ::c_int, 4129 eventlist: *mut ::kevent64_s, 4130 nevents: ::c_int, 4131 flags: ::c_uint, 4132 timeout: *const ::timespec, 4133 ) -> ::c_int; mount( src: *const ::c_char, target: *const ::c_char, flags: ::c_int, data: *mut ::c_void, ) -> ::c_int4134 pub fn mount( 4135 src: *const ::c_char, 4136 target: *const ::c_char, 4137 flags: ::c_int, 4138 data: *mut ::c_void, 4139 ) -> ::c_int; ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_char, data: ::c_int) -> ::c_int4140 pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_char, data: ::c_int) -> ::c_int; quotactl( special: *const ::c_char, cmd: ::c_int, id: ::c_int, data: *mut ::c_char, ) -> ::c_int4141 pub fn quotactl( 4142 special: *const ::c_char, 4143 cmd: ::c_int, 4144 id: ::c_int, 4145 data: *mut ::c_char, 4146 ) -> ::c_int; sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int4147 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_int4148 pub fn sendfile( 4149 fd: ::c_int, 4150 s: ::c_int, 4151 offset: ::off_t, 4152 len: *mut ::off_t, 4153 hdtr: *mut ::sf_hdtr, 4154 flags: ::c_int, 4155 ) -> ::c_int; futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int4156 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_int4157 pub fn utimensat( 4158 dirfd: ::c_int, 4159 path: *const ::c_char, 4160 times: *const ::timespec, 4161 flag: ::c_int, 4162 ) -> ::c_int; openpty( amaster: *mut ::c_int, aslave: *mut ::c_int, name: *mut ::c_char, termp: *mut termios, winp: *mut ::winsize, ) -> ::c_int4163 pub fn openpty( 4164 amaster: *mut ::c_int, 4165 aslave: *mut ::c_int, 4166 name: *mut ::c_char, 4167 termp: *mut termios, 4168 winp: *mut ::winsize, 4169 ) -> ::c_int; forkpty( amaster: *mut ::c_int, name: *mut ::c_char, termp: *mut termios, winp: *mut ::winsize, ) -> ::pid_t4170 pub fn forkpty( 4171 amaster: *mut ::c_int, 4172 name: *mut ::c_char, 4173 termp: *mut termios, 4174 winp: *mut ::winsize, 4175 ) -> ::pid_t; login_tty(fd: ::c_int) -> ::c_int4176 pub fn login_tty(fd: ::c_int) -> ::c_int; duplocale(base: ::locale_t) -> ::locale_t4177 pub fn duplocale(base: ::locale_t) -> ::locale_t; freelocale(loc: ::locale_t) -> ::c_int4178 pub fn freelocale(loc: ::locale_t) -> ::c_int; localeconv_l(loc: ::locale_t) -> *mut lconv4179 pub fn localeconv_l(loc: ::locale_t) -> *mut lconv; newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t4180 pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t; uselocale(loc: ::locale_t) -> ::locale_t4181 pub fn uselocale(loc: ::locale_t) -> ::locale_t; querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char4182 pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char; getpriority(which: ::c_int, who: ::id_t) -> ::c_int4183 pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int; setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int4184 pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int; getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int4185 pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int; setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int4186 pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int; preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t4187 pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t; pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t4188 pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) 4189 -> ::ssize_t; getxattr( path: *const ::c_char, name: *const ::c_char, value: *mut ::c_void, size: ::size_t, position: u32, flags: ::c_int, ) -> ::ssize_t4190 pub fn getxattr( 4191 path: *const ::c_char, 4192 name: *const ::c_char, 4193 value: *mut ::c_void, 4194 size: ::size_t, 4195 position: u32, 4196 flags: ::c_int, 4197 ) -> ::ssize_t; fgetxattr( filedes: ::c_int, name: *const ::c_char, value: *mut ::c_void, size: ::size_t, position: u32, flags: ::c_int, ) -> ::ssize_t4198 pub fn fgetxattr( 4199 filedes: ::c_int, 4200 name: *const ::c_char, 4201 value: *mut ::c_void, 4202 size: ::size_t, 4203 position: u32, 4204 flags: ::c_int, 4205 ) -> ::ssize_t; setxattr( path: *const ::c_char, name: *const ::c_char, value: *const ::c_void, size: ::size_t, position: u32, flags: ::c_int, ) -> ::c_int4206 pub fn setxattr( 4207 path: *const ::c_char, 4208 name: *const ::c_char, 4209 value: *const ::c_void, 4210 size: ::size_t, 4211 position: u32, 4212 flags: ::c_int, 4213 ) -> ::c_int; fsetxattr( filedes: ::c_int, name: *const ::c_char, value: *const ::c_void, size: ::size_t, position: u32, flags: ::c_int, ) -> ::c_int4214 pub fn fsetxattr( 4215 filedes: ::c_int, 4216 name: *const ::c_char, 4217 value: *const ::c_void, 4218 size: ::size_t, 4219 position: u32, 4220 flags: ::c_int, 4221 ) -> ::c_int; listxattr( path: *const ::c_char, list: *mut ::c_char, size: ::size_t, flags: ::c_int, ) -> ::ssize_t4222 pub fn listxattr( 4223 path: *const ::c_char, 4224 list: *mut ::c_char, 4225 size: ::size_t, 4226 flags: ::c_int, 4227 ) -> ::ssize_t; flistxattr( filedes: ::c_int, list: *mut ::c_char, size: ::size_t, flags: ::c_int, ) -> ::ssize_t4228 pub fn flistxattr( 4229 filedes: ::c_int, 4230 list: *mut ::c_char, 4231 size: ::size_t, 4232 flags: ::c_int, 4233 ) -> ::ssize_t; removexattr(path: *const ::c_char, name: *const ::c_char, flags: ::c_int) -> ::c_int4234 pub fn removexattr(path: *const ::c_char, name: *const ::c_char, flags: ::c_int) -> ::c_int; renamex_np(from: *const ::c_char, to: *const ::c_char, flags: ::c_uint) -> ::c_int4235 pub fn renamex_np(from: *const ::c_char, to: *const ::c_char, flags: ::c_uint) -> ::c_int; renameatx_np( fromfd: ::c_int, from: *const ::c_char, tofd: ::c_int, to: *const ::c_char, flags: ::c_uint, ) -> ::c_int4236 pub fn renameatx_np( 4237 fromfd: ::c_int, 4238 from: *const ::c_char, 4239 tofd: ::c_int, 4240 to: *const ::c_char, 4241 flags: ::c_uint, 4242 ) -> ::c_int; fremovexattr(filedes: ::c_int, name: *const ::c_char, flags: ::c_int) -> ::c_int4243 pub fn fremovexattr(filedes: ::c_int, name: *const ::c_char, flags: ::c_int) -> ::c_int; 4244 getgrouplist( name: *const ::c_char, basegid: ::c_int, groups: *mut ::c_int, ngroups: *mut ::c_int, ) -> ::c_int4245 pub fn getgrouplist( 4246 name: *const ::c_char, 4247 basegid: ::c_int, 4248 groups: *mut ::c_int, 4249 ngroups: *mut ::c_int, 4250 ) -> ::c_int; initgroups(user: *const ::c_char, basegroup: ::c_int) -> ::c_int4251 pub fn initgroups(user: *const ::c_char, basegroup: ::c_int) -> ::c_int; 4252 4253 #[cfg_attr( 4254 all(target_os = "macos", target_arch = "x86"), 4255 link_name = "waitid$UNIX2003" 4256 )] waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int) -> ::c_int4257 pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int) 4258 -> ::c_int; brk(addr: *const ::c_void) -> *mut ::c_void4259 pub fn brk(addr: *const ::c_void) -> *mut ::c_void; sbrk(increment: ::c_int) -> *mut ::c_void4260 pub fn sbrk(increment: ::c_int) -> *mut ::c_void; settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int4261 pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int; 4262 #[deprecated(since = "0.2.55", note = "Use the mach crate")] _dyld_image_count() -> u324263 pub fn _dyld_image_count() -> u32; 4264 #[deprecated(since = "0.2.55", note = "Use the mach crate")] 4265 #[allow(deprecated)] _dyld_get_image_header(image_index: u32) -> *const mach_header4266 pub fn _dyld_get_image_header(image_index: u32) -> *const mach_header; 4267 #[deprecated(since = "0.2.55", note = "Use the mach crate")] _dyld_get_image_vmaddr_slide(image_index: u32) -> ::intptr_t4268 pub fn _dyld_get_image_vmaddr_slide(image_index: u32) -> ::intptr_t; 4269 #[deprecated(since = "0.2.55", note = "Use the mach crate")] _dyld_get_image_name(image_index: u32) -> *const ::c_char4270 pub fn _dyld_get_image_name(image_index: u32) -> *const ::c_char; 4271 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_int4272 pub fn posix_spawn( 4273 pid: *mut ::pid_t, 4274 path: *const ::c_char, 4275 file_actions: *const ::posix_spawn_file_actions_t, 4276 attrp: *const ::posix_spawnattr_t, 4277 argv: *const *mut ::c_char, 4278 envp: *const *mut ::c_char, 4279 ) -> ::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_int4280 pub fn posix_spawnp( 4281 pid: *mut ::pid_t, 4282 file: *const ::c_char, 4283 file_actions: *const ::posix_spawn_file_actions_t, 4284 attrp: *const ::posix_spawnattr_t, 4285 argv: *const *mut ::c_char, 4286 envp: *const *mut ::c_char, 4287 ) -> ::c_int; posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int4288 pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int; posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int4289 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_int4290 pub fn posix_spawnattr_getsigdefault( 4291 attr: *const posix_spawnattr_t, 4292 default: *mut ::sigset_t, 4293 ) -> ::c_int; posix_spawnattr_setsigdefault( attr: *mut posix_spawnattr_t, default: *const ::sigset_t, ) -> ::c_int4294 pub fn posix_spawnattr_setsigdefault( 4295 attr: *mut posix_spawnattr_t, 4296 default: *const ::sigset_t, 4297 ) -> ::c_int; posix_spawnattr_getsigmask( attr: *const posix_spawnattr_t, default: *mut ::sigset_t, ) -> ::c_int4298 pub fn posix_spawnattr_getsigmask( 4299 attr: *const posix_spawnattr_t, 4300 default: *mut ::sigset_t, 4301 ) -> ::c_int; posix_spawnattr_setsigmask( attr: *mut posix_spawnattr_t, default: *const ::sigset_t, ) -> ::c_int4302 pub fn posix_spawnattr_setsigmask( 4303 attr: *mut posix_spawnattr_t, 4304 default: *const ::sigset_t, 4305 ) -> ::c_int; posix_spawnattr_getflags( attr: *const posix_spawnattr_t, flags: *mut ::c_short, ) -> ::c_int4306 pub fn posix_spawnattr_getflags( 4307 attr: *const posix_spawnattr_t, 4308 flags: *mut ::c_short, 4309 ) -> ::c_int; posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int4310 pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int; posix_spawnattr_getpgroup( attr: *const posix_spawnattr_t, flags: *mut ::pid_t, ) -> ::c_int4311 pub fn posix_spawnattr_getpgroup( 4312 attr: *const posix_spawnattr_t, 4313 flags: *mut ::pid_t, 4314 ) -> ::c_int; posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int4315 pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int; 4316 posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int4317 pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int; posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int4318 pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::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_int4319 pub fn posix_spawn_file_actions_addopen( 4320 actions: *mut posix_spawn_file_actions_t, 4321 fd: ::c_int, 4322 path: *const ::c_char, 4323 oflag: ::c_int, 4324 mode: ::mode_t, 4325 ) -> ::c_int; posix_spawn_file_actions_addclose( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, ) -> ::c_int4326 pub fn posix_spawn_file_actions_addclose( 4327 actions: *mut posix_spawn_file_actions_t, 4328 fd: ::c_int, 4329 ) -> ::c_int; posix_spawn_file_actions_adddup2( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, newfd: ::c_int, ) -> ::c_int4330 pub fn posix_spawn_file_actions_adddup2( 4331 actions: *mut posix_spawn_file_actions_t, 4332 fd: ::c_int, 4333 newfd: ::c_int, 4334 ) -> ::c_int; uname(buf: *mut ::utsname) -> ::c_int4335 pub fn uname(buf: *mut ::utsname) -> ::c_int; 4336 connectx( socket: ::c_int, endpoints: *const sa_endpoints_t, associd: sae_associd_t, flags: ::c_uint, iov: *const ::iovec, iovcnt: ::c_uint, len: *mut ::size_t, connid: *mut sae_connid_t, ) -> ::c_int4337 pub fn connectx( 4338 socket: ::c_int, 4339 endpoints: *const sa_endpoints_t, 4340 associd: sae_associd_t, 4341 flags: ::c_uint, 4342 iov: *const ::iovec, 4343 iovcnt: ::c_uint, 4344 len: *mut ::size_t, 4345 connid: *mut sae_connid_t, 4346 ) -> ::c_int; disconnectx(socket: ::c_int, associd: sae_associd_t, connid: sae_connid_t) -> ::c_int4347 pub fn disconnectx(socket: ::c_int, associd: sae_associd_t, connid: sae_connid_t) -> ::c_int; 4348 ntp_adjtime(buf: *mut timex) -> ::c_int4349 pub fn ntp_adjtime(buf: *mut timex) -> ::c_int; ntp_gettime(buf: *mut ntptimeval) -> ::c_int4350 pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int; 4351 4352 #[cfg_attr( 4353 all(target_os = "macos", not(target_arch = "aarch64")), 4354 link_name = "getmntinfo$INODE64" 4355 )] getmntinfo(mntbufp: *mut *mut statfs, flags: ::c_int) -> ::c_int4356 pub fn getmntinfo(mntbufp: *mut *mut statfs, flags: ::c_int) -> ::c_int; 4357 #[cfg_attr( 4358 all(target_os = "macos", not(target_arch = "aarch64")), 4359 link_name = "getfsstat$INODE64" 4360 )] getfsstat(mntbufp: *mut statfs, bufsize: ::c_int, flags: ::c_int) -> ::c_int4361 pub fn getfsstat(mntbufp: *mut statfs, bufsize: ::c_int, flags: ::c_int) -> ::c_int; 4362 4363 // Copy-on-write functions. 4364 // According to the man page `flags` is an `int` but in the header 4365 // this is a `uint32_t`. clonefile(src: *const ::c_char, dst: *const ::c_char, flags: u32) -> ::c_int4366 pub fn clonefile(src: *const ::c_char, dst: *const ::c_char, flags: u32) -> ::c_int; clonefileat( src_dirfd: ::c_int, src: *const ::c_char, dst_dirfd: ::c_int, dst: *const ::c_char, flags: u32, ) -> ::c_int4367 pub fn clonefileat( 4368 src_dirfd: ::c_int, 4369 src: *const ::c_char, 4370 dst_dirfd: ::c_int, 4371 dst: *const ::c_char, 4372 flags: u32, 4373 ) -> ::c_int; fclonefileat( srcfd: ::c_int, dst_dirfd: ::c_int, dst: *const ::c_char, flags: u32, ) -> ::c_int4374 pub fn fclonefileat( 4375 srcfd: ::c_int, 4376 dst_dirfd: ::c_int, 4377 dst: *const ::c_char, 4378 flags: u32, 4379 ) -> ::c_int; 4380 4381 // Added in macOS 10.13 4382 // ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1 memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int4383 pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int; 4384 // Added in macOS 10.5 memset_pattern4(b: *mut ::c_void, pattern4: *const ::c_void, len: ::size_t)4385 pub fn memset_pattern4(b: *mut ::c_void, pattern4: *const ::c_void, len: ::size_t); memset_pattern8(b: *mut ::c_void, pattern8: *const ::c_void, len: ::size_t)4386 pub fn memset_pattern8(b: *mut ::c_void, pattern8: *const ::c_void, len: ::size_t); memset_pattern16(b: *mut ::c_void, pattern16: *const ::c_void, len: ::size_t)4387 pub fn memset_pattern16(b: *mut ::c_void, pattern16: *const ::c_void, len: ::size_t); 4388 mstats() -> mstats4389 pub fn mstats() -> mstats; malloc_printf(format: *const ::c_char, ...)4390 pub fn malloc_printf(format: *const ::c_char, ...); malloc_zone_check(zone: *mut ::malloc_zone_t) -> ::boolean_t4391 pub fn malloc_zone_check(zone: *mut ::malloc_zone_t) -> ::boolean_t; malloc_zone_print(zone: *mut ::malloc_zone_t, verbose: ::boolean_t)4392 pub fn malloc_zone_print(zone: *mut ::malloc_zone_t, verbose: ::boolean_t); malloc_zone_statistics(zone: *mut ::malloc_zone_t, stats: *mut malloc_statistics_t)4393 pub fn malloc_zone_statistics(zone: *mut ::malloc_zone_t, stats: *mut malloc_statistics_t); malloc_zone_log(zone: *mut ::malloc_zone_t, address: *mut ::c_void)4394 pub fn malloc_zone_log(zone: *mut ::malloc_zone_t, address: *mut ::c_void); malloc_zone_print_ptr_info(ptr: *mut ::c_void)4395 pub fn malloc_zone_print_ptr_info(ptr: *mut ::c_void); malloc_default_zone() -> *mut ::malloc_zone_t4396 pub fn malloc_default_zone() -> *mut ::malloc_zone_t; malloc_zone_from_ptr(ptr: *const ::c_void) -> *mut ::malloc_zone_t4397 pub fn malloc_zone_from_ptr(ptr: *const ::c_void) -> *mut ::malloc_zone_t; malloc_zone_malloc(zone: *mut ::malloc_zone_t, size: ::size_t) -> *mut ::c_void4398 pub fn malloc_zone_malloc(zone: *mut ::malloc_zone_t, size: ::size_t) -> *mut ::c_void; malloc_zone_valloc(zone: *mut ::malloc_zone_t, size: ::size_t) -> *mut ::c_void4399 pub fn malloc_zone_valloc(zone: *mut ::malloc_zone_t, size: ::size_t) -> *mut ::c_void; malloc_zone_calloc( zone: *mut ::malloc_zone_t, num_items: ::size_t, size: ::size_t, ) -> *mut ::c_void4400 pub fn malloc_zone_calloc( 4401 zone: *mut ::malloc_zone_t, 4402 num_items: ::size_t, 4403 size: ::size_t, 4404 ) -> *mut ::c_void; malloc_zone_realloc( zone: *mut ::malloc_zone_t, ptr: *mut ::c_void, size: ::size_t, ) -> *mut ::c_void4405 pub fn malloc_zone_realloc( 4406 zone: *mut ::malloc_zone_t, 4407 ptr: *mut ::c_void, 4408 size: ::size_t, 4409 ) -> *mut ::c_void; malloc_zone_free(zone: *mut ::malloc_zone_t, ptr: *mut ::c_void)4410 pub fn malloc_zone_free(zone: *mut ::malloc_zone_t, ptr: *mut ::c_void); 4411 proc_listpids( t: u32, typeinfo: u32, buffer: *mut ::c_void, buffersize: ::c_int, ) -> ::c_int4412 pub fn proc_listpids( 4413 t: u32, 4414 typeinfo: u32, 4415 buffer: *mut ::c_void, 4416 buffersize: ::c_int, 4417 ) -> ::c_int; proc_listallpids(buffer: *mut ::c_void, buffersize: ::c_int) -> ::c_int4418 pub fn proc_listallpids(buffer: *mut ::c_void, buffersize: ::c_int) -> ::c_int; proc_listpgrppids( pgrpid: ::pid_t, buffer: *mut ::c_void, buffersize: ::c_int, ) -> ::c_int4419 pub fn proc_listpgrppids( 4420 pgrpid: ::pid_t, 4421 buffer: *mut ::c_void, 4422 buffersize: ::c_int, 4423 ) -> ::c_int; proc_listchildpids(ppid: ::pid_t, buffer: *mut ::c_void, buffersize: ::c_int) -> ::c_int4424 pub fn proc_listchildpids(ppid: ::pid_t, buffer: *mut ::c_void, buffersize: ::c_int) 4425 -> ::c_int; proc_pidinfo( pid: ::c_int, flavor: ::c_int, arg: u64, buffer: *mut ::c_void, buffersize: ::c_int, ) -> ::c_int4426 pub fn proc_pidinfo( 4427 pid: ::c_int, 4428 flavor: ::c_int, 4429 arg: u64, 4430 buffer: *mut ::c_void, 4431 buffersize: ::c_int, 4432 ) -> ::c_int; proc_pidfdinfo( pid: ::c_int, fd: ::c_int, flavor: ::c_int, buffer: *mut ::c_void, buffersize: ::c_int, ) -> ::c_int4433 pub fn proc_pidfdinfo( 4434 pid: ::c_int, 4435 fd: ::c_int, 4436 flavor: ::c_int, 4437 buffer: *mut ::c_void, 4438 buffersize: ::c_int, 4439 ) -> ::c_int; proc_pidfileportinfo( pid: ::c_int, fileport: u32, flavor: ::c_int, buffer: *mut ::c_void, buffersize: ::c_int, ) -> ::c_int4440 pub fn proc_pidfileportinfo( 4441 pid: ::c_int, 4442 fileport: u32, 4443 flavor: ::c_int, 4444 buffer: *mut ::c_void, 4445 buffersize: ::c_int, 4446 ) -> ::c_int; proc_pidpath(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int4447 pub fn proc_pidpath(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int; proc_name(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int4448 pub fn proc_name(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int; proc_regionfilename( pid: ::c_int, address: u64, buffer: *mut ::c_void, buffersize: u32, ) -> ::c_int4449 pub fn proc_regionfilename( 4450 pid: ::c_int, 4451 address: u64, 4452 buffer: *mut ::c_void, 4453 buffersize: u32, 4454 ) -> ::c_int; proc_kmsgbuf(buffer: *mut ::c_void, buffersize: u32) -> ::c_int4455 pub fn proc_kmsgbuf(buffer: *mut ::c_void, buffersize: u32) -> ::c_int; proc_libversion(major: *mut ::c_int, mintor: *mut ::c_int) -> ::c_int4456 pub fn proc_libversion(major: *mut ::c_int, mintor: *mut ::c_int) -> ::c_int; 4457 /// # Notes 4458 /// 4459 /// `id` is of type [`uuid_t`]. gethostuuid(id: *mut u8, timeout: *const ::timespec) -> ::c_int4460 pub fn gethostuuid(id: *mut u8, timeout: *const ::timespec) -> ::c_int; 4461 gethostid() -> ::c_long4462 pub fn gethostid() -> ::c_long; sethostid(hostid: ::c_long)4463 pub fn sethostid(hostid: ::c_long); 4464 CCRandomGenerateBytes(bytes: *mut ::c_void, size: ::size_t) -> ::CCRNGStatus4465 pub fn CCRandomGenerateBytes(bytes: *mut ::c_void, size: ::size_t) -> ::CCRNGStatus; 4466 _NSGetExecutablePath(buf: *mut ::c_char, bufsize: *mut u32) -> ::c_int4467 pub fn _NSGetExecutablePath(buf: *mut ::c_char, bufsize: *mut u32) -> ::c_int; _NSGetEnviron() -> *mut *mut *mut ::c_char4468 pub fn _NSGetEnviron() -> *mut *mut *mut ::c_char; 4469 mach_vm_map( target_task: ::vm_map_t, address: *mut ::mach_vm_address_t, size: ::mach_vm_size_t, mask: ::mach_vm_offset_t, flags: ::c_int, object: ::mem_entry_name_port_t, offset: ::memory_object_offset_t, copy: ::boolean_t, cur_protection: ::vm_prot_t, max_protection: ::vm_prot_t, inheritance: ::vm_inherit_t, ) -> ::kern_return_t4470 pub fn mach_vm_map( 4471 target_task: ::vm_map_t, 4472 address: *mut ::mach_vm_address_t, 4473 size: ::mach_vm_size_t, 4474 mask: ::mach_vm_offset_t, 4475 flags: ::c_int, 4476 object: ::mem_entry_name_port_t, 4477 offset: ::memory_object_offset_t, 4478 copy: ::boolean_t, 4479 cur_protection: ::vm_prot_t, 4480 max_protection: ::vm_prot_t, 4481 inheritance: ::vm_inherit_t, 4482 ) -> ::kern_return_t; 4483 } 4484 4485 cfg_if! { 4486 if #[cfg(target_os = "macos")] { 4487 extern "C" { 4488 pub fn memmem( 4489 haystack: *const ::c_void, 4490 haystacklen: ::size_t, 4491 needle: *const ::c_void, 4492 needlelen: ::size_t, 4493 ) -> *mut ::c_void; 4494 } 4495 } 4496 } 4497 4498 #[link(name = "iconv")] 4499 extern "C" { iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t4500 pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t; iconv( cd: iconv_t, inbuf: *mut *mut ::c_char, inbytesleft: *mut ::size_t, outbuf: *mut *mut ::c_char, outbytesleft: *mut ::size_t, ) -> ::size_t4501 pub fn iconv( 4502 cd: iconv_t, 4503 inbuf: *mut *mut ::c_char, 4504 inbytesleft: *mut ::size_t, 4505 outbuf: *mut *mut ::c_char, 4506 outbytesleft: *mut ::size_t, 4507 ) -> ::size_t; iconv_close(cd: iconv_t) -> ::c_int4508 pub fn iconv_close(cd: iconv_t) -> ::c_int; 4509 } 4510 4511 cfg_if! { 4512 if #[cfg(any(target_arch = "arm", target_arch = "x86"))] { 4513 mod b32; 4514 pub use self::b32::*; 4515 } else if #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] { 4516 mod b64; 4517 pub use self::b64::*; 4518 } else { 4519 // Unknown target_arch 4520 } 4521 } 4522