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