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