1use crate::prelude::*;
6use crate::{cmsghdr, off_t};
7
8pub type wchar_t = i32;
9pub type clock_t = c_ulong;
10pub type time_t = c_long;
11pub type suseconds_t = i32;
12pub type dev_t = i32;
13pub type ino_t = u64;
14pub type mode_t = u16;
15pub type nlink_t = u16;
16pub type blksize_t = i32;
17pub type rlim_t = u64;
18pub type pthread_key_t = c_ulong;
19pub type sigset_t = u32;
20pub type clockid_t = c_uint;
21pub type fsblkcnt_t = c_uint;
22pub type fsfilcnt_t = c_uint;
23pub type speed_t = c_ulong;
24pub type tcflag_t = c_ulong;
25pub type nl_item = c_int;
26pub type id_t = c_uint;
27pub type sem_t = c_int;
28pub type idtype_t = c_uint;
29pub type integer_t = c_int;
30pub type cpu_type_t = integer_t;
31pub type cpu_subtype_t = integer_t;
32pub type natural_t = u32;
33pub type mach_msg_type_number_t = natural_t;
34pub type kern_return_t = c_int;
35pub type uuid_t = [u8; 16];
36pub type task_info_t = *mut integer_t;
37pub type host_info_t = *mut integer_t;
38pub type task_flavor_t = natural_t;
39pub type rusage_info_t = *mut c_void;
40pub type vm_offset_t = crate::uintptr_t;
41pub type vm_size_t = crate::uintptr_t;
42pub type vm_address_t = vm_offset_t;
43pub type quad_t = i64;
44pub type u_quad_t = u64;
45
46pub type posix_spawnattr_t = *mut c_void;
47pub type posix_spawn_file_actions_t = *mut c_void;
48pub type key_t = c_int;
49pub type shmatt_t = c_ushort;
50
51pub type sae_associd_t = u32;
52pub type sae_connid_t = u32;
53
54pub type mach_port_t = c_uint;
55pub type host_t = c_uint;
56pub type host_flavor_t = integer_t;
57pub type host_info64_t = *mut integer_t;
58pub type processor_flavor_t = c_int;
59pub type thread_flavor_t = natural_t;
60pub type thread_inspect_t = crate::mach_port_t;
61pub type thread_act_t = crate::mach_port_t;
62pub type thread_act_array_t = *mut crate::thread_act_t;
63pub type policy_t = c_int;
64pub type mach_error_t = crate::kern_return_t;
65pub type mach_vm_address_t = u64;
66pub type mach_vm_offset_t = u64;
67pub type mach_vm_size_t = u64;
68pub type vm_map_t = crate::mach_port_t;
69pub type mem_entry_name_port_t = crate::mach_port_t;
70pub type memory_object_t = crate::mach_port_t;
71pub type memory_object_offset_t = c_ulonglong;
72pub type vm_inherit_t = c_uint;
73pub type vm_prot_t = c_int;
74
75pub type ledger_t = crate::mach_port_t;
76pub type ledger_array_t = *mut crate::ledger_t;
77
78pub type iconv_t = *mut c_void;
79
80pub type host_cpu_load_info_t = *mut host_cpu_load_info;
82pub type host_cpu_load_info_data_t = host_cpu_load_info;
83
84pub type processor_cpu_load_info_t = *mut processor_cpu_load_info;
86pub type processor_cpu_load_info_data_t = processor_cpu_load_info;
87pub type processor_basic_info_t = *mut processor_basic_info;
88pub type processor_basic_info_data_t = processor_basic_info;
89pub type processor_set_basic_info_data_t = processor_set_basic_info;
90pub type processor_set_basic_info_t = *mut processor_set_basic_info;
91pub type processor_set_load_info_data_t = processor_set_load_info;
92pub type processor_set_load_info_t = *mut processor_set_load_info;
93pub type processor_info_t = *mut integer_t;
94pub type processor_info_array_t = *mut integer_t;
95
96pub type mach_task_basic_info_data_t = mach_task_basic_info;
97pub type mach_task_basic_info_t = *mut mach_task_basic_info;
98pub type task_thread_times_info_data_t = task_thread_times_info;
99pub type task_thread_times_info_t = *mut task_thread_times_info;
100
101pub type thread_info_t = *mut integer_t;
102pub type thread_basic_info_t = *mut thread_basic_info;
103pub type thread_basic_info_data_t = thread_basic_info;
104pub type thread_identifier_info_t = *mut thread_identifier_info;
105pub type thread_identifier_info_data_t = thread_identifier_info;
106pub type thread_extended_info_t = *mut thread_extended_info;
107pub type thread_extended_info_data_t = thread_extended_info;
108
109pub type thread_t = crate::mach_port_t;
110pub type thread_policy_flavor_t = natural_t;
111pub type thread_policy_t = *mut integer_t;
112pub type thread_latency_qos_t = integer_t;
113pub type thread_throughput_qos_t = integer_t;
114pub type thread_standard_policy_data_t = thread_standard_policy;
115pub type thread_standard_policy_t = *mut thread_standard_policy;
116pub type thread_extended_policy_data_t = thread_extended_policy;
117pub type thread_extended_policy_t = *mut thread_extended_policy;
118pub type thread_time_constraint_policy_data_t = thread_time_constraint_policy;
119pub type thread_time_constraint_policy_t = *mut thread_time_constraint_policy;
120pub type thread_precedence_policy_data_t = thread_precedence_policy;
121pub type thread_precedence_policy_t = *mut thread_precedence_policy;
122pub type thread_affinity_policy_data_t = thread_affinity_policy;
123pub type thread_affinity_policy_t = *mut thread_affinity_policy;
124pub type thread_background_policy_data_t = thread_background_policy;
125pub type thread_background_policy_t = *mut thread_background_policy;
126pub type thread_latency_qos_policy_data_t = thread_latency_qos_policy;
127pub type thread_latency_qos_policy_t = *mut thread_latency_qos_policy;
128pub type thread_throughput_qos_policy_data_t = thread_throughput_qos_policy;
129pub type thread_throughput_qos_policy_t = *mut thread_throughput_qos_policy;
130
131pub type pthread_introspection_hook_t =
132 extern "C" fn(event: c_uint, thread: crate::pthread_t, addr: *mut c_void, size: size_t);
133pub type pthread_jit_write_callback_t = Option<extern "C" fn(ctx: *mut c_void) -> c_int>;
134
135pub type os_clockid_t = u32;
136
137pub type os_sync_wait_on_address_flags_t = u32;
138pub type os_sync_wake_by_address_flags_t = u32;
139
140pub type os_unfair_lock = os_unfair_lock_s;
141pub type os_unfair_lock_t = *mut os_unfair_lock;
142
143pub type os_log_t = *mut c_void;
144pub type os_log_type_t = u8;
145pub type os_signpost_id_t = u64;
146pub type os_signpost_type_t = u8;
147
148pub type vm_statistics_t = *mut vm_statistics;
149pub type vm_statistics_data_t = vm_statistics;
150pub type vm_statistics64_t = *mut vm_statistics64;
151pub type vm_statistics64_data_t = vm_statistics64;
152
153pub type task_t = crate::mach_port_t;
154pub type task_inspect_t = crate::mach_port_t;
155
156pub type sysdir_search_path_enumeration_state = c_uint;
157
158pub type CCStatus = i32;
159pub type CCCryptorStatus = i32;
160pub type CCRNGStatus = crate::CCCryptorStatus;
161
162pub type copyfile_state_t = *mut c_void;
163pub type copyfile_flags_t = u32;
164pub 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
175pub type attrgroup_t = u32;
176pub type vol_capabilities_set_t = [u32; 4];
177
178deprecated_mach! {
179 pub type mach_timebase_info_data_t = mach_timebase_info;
180}
181
182#[cfg_attr(feature = "extra_traits", derive(Debug))]
183pub enum timezone {}
184impl Copy for timezone {}
185impl Clone for timezone {
186 fn clone(&self) -> timezone {
187 *self
188 }
189}
190
191#[cfg_attr(feature = "extra_traits", derive(Debug))]
192#[repr(u32)]
193pub enum qos_class_t {
194 QOS_CLASS_USER_INTERACTIVE = 0x21,
195 QOS_CLASS_USER_INITIATED = 0x19,
196 QOS_CLASS_DEFAULT = 0x15,
197 QOS_CLASS_UTILITY = 0x11,
198 QOS_CLASS_BACKGROUND = 0x09,
199 QOS_CLASS_UNSPECIFIED = 0x00,
200}
201impl Copy for qos_class_t {}
202impl Clone for qos_class_t {
203 fn clone(&self) -> qos_class_t {
204 *self
205 }
206}
207
208#[cfg_attr(feature = "extra_traits", derive(Debug))]
209#[repr(u32)]
210pub enum sysdir_search_path_directory_t {
211 SYSDIR_DIRECTORY_APPLICATION = 1,
212 SYSDIR_DIRECTORY_DEMO_APPLICATION = 2,
213 SYSDIR_DIRECTORY_DEVELOPER_APPLICATION = 3,
214 SYSDIR_DIRECTORY_ADMIN_APPLICATION = 4,
215 SYSDIR_DIRECTORY_LIBRARY = 5,
216 SYSDIR_DIRECTORY_DEVELOPER = 6,
217 SYSDIR_DIRECTORY_USER = 7,
218 SYSDIR_DIRECTORY_DOCUMENTATION = 8,
219 SYSDIR_DIRECTORY_DOCUMENT = 9,
220 SYSDIR_DIRECTORY_CORESERVICE = 10,
221 SYSDIR_DIRECTORY_AUTOSAVED_INFORMATION = 11,
222 SYSDIR_DIRECTORY_DESKTOP = 12,
223 SYSDIR_DIRECTORY_CACHES = 13,
224 SYSDIR_DIRECTORY_APPLICATION_SUPPORT = 14,
225 SYSDIR_DIRECTORY_DOWNLOADS = 15,
226 SYSDIR_DIRECTORY_INPUT_METHODS = 16,
227 SYSDIR_DIRECTORY_MOVIES = 17,
228 SYSDIR_DIRECTORY_MUSIC = 18,
229 SYSDIR_DIRECTORY_PICTURES = 19,
230 SYSDIR_DIRECTORY_PRINTER_DESCRIPTION = 20,
231 SYSDIR_DIRECTORY_SHARED_PUBLIC = 21,
232 SYSDIR_DIRECTORY_PREFERENCE_PANES = 22,
233 SYSDIR_DIRECTORY_ALL_APPLICATIONS = 100,
234 SYSDIR_DIRECTORY_ALL_LIBRARIES = 101,
235}
236impl Copy for sysdir_search_path_directory_t {}
237impl Clone for sysdir_search_path_directory_t {
238 fn clone(&self) -> sysdir_search_path_directory_t {
239 *self
240 }
241}
242
243#[cfg_attr(feature = "extra_traits", derive(Debug))]
244#[repr(u32)]
245pub enum sysdir_search_path_domain_mask_t {
246 SYSDIR_DOMAIN_MASK_USER = (1 << 0),
247 SYSDIR_DOMAIN_MASK_LOCAL = (1 << 1),
248 SYSDIR_DOMAIN_MASK_NETWORK = (1 << 2),
249 SYSDIR_DOMAIN_MASK_SYSTEM = (1 << 3),
250 SYSDIR_DOMAIN_MASK_ALL = 0x0ffff,
251}
252impl Copy for sysdir_search_path_domain_mask_t {}
253impl Clone for sysdir_search_path_domain_mask_t {
254 fn clone(&self) -> sysdir_search_path_domain_mask_t {
255 *self
256 }
257}
258
259s! {
260 pub struct ip_mreq {
261 pub imr_multiaddr: in_addr,
262 pub imr_interface: in_addr,
263 }
264
265 pub struct ip_mreqn {
266 pub imr_multiaddr: in_addr,
267 pub imr_address: in_addr,
268 pub imr_ifindex: c_int,
269 }
270
271 pub struct ip_mreq_source {
272 pub imr_multiaddr: in_addr,
273 pub imr_sourceaddr: in_addr,
274 pub imr_interface: in_addr,
275 }
276
277 pub struct aiocb {
278 pub aio_fildes: c_int,
279 pub aio_offset: off_t,
280 pub aio_buf: *mut c_void,
281 pub aio_nbytes: size_t,
282 pub aio_reqprio: c_int,
283 pub aio_sigevent: sigevent,
284 pub aio_lio_opcode: c_int,
285 }
286
287 pub struct glob_t {
288 pub gl_pathc: size_t,
289 __unused1: c_int,
290 pub gl_offs: size_t,
291 __unused2: c_int,
292 pub gl_pathv: *mut *mut c_char,
293
294 __unused3: *mut c_void,
295
296 __unused4: *mut c_void,
297 __unused5: *mut c_void,
298 __unused6: *mut c_void,
299 __unused7: *mut c_void,
300 __unused8: *mut c_void,
301 }
302
303 pub struct addrinfo {
304 pub ai_flags: c_int,
305 pub ai_family: c_int,
306 pub ai_socktype: c_int,
307 pub ai_protocol: c_int,
308 pub ai_addrlen: crate::socklen_t,
309 pub ai_canonname: *mut c_char,
310 pub ai_addr: *mut crate::sockaddr,
311 pub ai_next: *mut addrinfo,
312 }
313
314 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
315 pub struct mach_timebase_info {
316 pub numer: u32,
317 pub denom: u32,
318 }
319
320 pub struct stat {
321 pub st_dev: dev_t,
322 pub st_mode: mode_t,
323 pub st_nlink: nlink_t,
324 pub st_ino: ino_t,
325 pub st_uid: crate::uid_t,
326 pub st_gid: crate::gid_t,
327 pub st_rdev: dev_t,
328 pub st_atime: time_t,
329 pub st_atime_nsec: c_long,
330 pub st_mtime: time_t,
331 pub st_mtime_nsec: c_long,
332 pub st_ctime: time_t,
333 pub st_ctime_nsec: c_long,
334 pub st_birthtime: time_t,
335 pub st_birthtime_nsec: c_long,
336 pub st_size: off_t,
337 pub st_blocks: crate::blkcnt_t,
338 pub st_blksize: blksize_t,
339 pub st_flags: u32,
340 pub st_gen: u32,
341 pub st_lspare: i32,
342 pub st_qspare: [i64; 2],
343 }
344
345 pub struct pthread_mutexattr_t {
346 __sig: c_long,
347 __opaque: [u8; 8],
348 }
349
350 pub struct pthread_condattr_t {
351 __sig: c_long,
352 __opaque: [u8; __PTHREAD_CONDATTR_SIZE__],
353 }
354
355 pub struct pthread_rwlockattr_t {
356 __sig: c_long,
357 __opaque: [u8; __PTHREAD_RWLOCKATTR_SIZE__],
358 }
359
360 pub struct siginfo_t {
361 pub si_signo: c_int,
362 pub si_errno: c_int,
363 pub si_code: c_int,
364 pub si_pid: crate::pid_t,
365 pub si_uid: crate::uid_t,
366 pub si_status: c_int,
367 pub si_addr: *mut c_void,
368 _pad: [usize; 9],
371 }
372
373 pub struct sigaction {
374 pub sa_sigaction: crate::sighandler_t,
376 pub sa_mask: sigset_t,
377 pub sa_flags: c_int,
378 }
379
380 pub struct stack_t {
381 pub ss_sp: *mut c_void,
382 pub ss_size: size_t,
383 pub ss_flags: c_int,
384 }
385
386 pub struct fstore_t {
387 pub fst_flags: c_uint,
388 pub fst_posmode: c_int,
389 pub fst_offset: off_t,
390 pub fst_length: off_t,
391 pub fst_bytesalloc: off_t,
392 }
393
394 pub struct fpunchhole_t {
395 pub fp_flags: c_uint, pub reserved: c_uint, pub fp_offset: off_t, pub fp_length: off_t, }
400
401 pub struct ftrimactivefile_t {
402 pub fta_offset: off_t,
403 pub fta_length: off_t,
404 }
405
406 pub struct fspecread_t {
407 pub fsr_flags: c_uint,
408 pub reserved: c_uint,
409 pub fsr_offset: off_t,
410 pub fsr_length: off_t,
411 }
412
413 pub struct radvisory {
414 pub ra_offset: off_t,
415 pub ra_count: c_int,
416 }
417
418 pub struct statvfs {
419 pub f_bsize: c_ulong,
420 pub f_frsize: c_ulong,
421 pub f_blocks: crate::fsblkcnt_t,
422 pub f_bfree: crate::fsblkcnt_t,
423 pub f_bavail: crate::fsblkcnt_t,
424 pub f_files: crate::fsfilcnt_t,
425 pub f_ffree: crate::fsfilcnt_t,
426 pub f_favail: crate::fsfilcnt_t,
427 pub f_fsid: c_ulong,
428 pub f_flag: c_ulong,
429 pub f_namemax: c_ulong,
430 }
431
432 pub struct Dl_info {
433 pub dli_fname: *const c_char,
434 pub dli_fbase: *mut c_void,
435 pub dli_sname: *const c_char,
436 pub dli_saddr: *mut c_void,
437 }
438
439 pub struct sockaddr_in {
440 pub sin_len: u8,
441 pub sin_family: crate::sa_family_t,
442 pub sin_port: crate::in_port_t,
443 pub sin_addr: crate::in_addr,
444 pub sin_zero: [c_char; 8],
445 }
446
447 pub struct kevent64_s {
448 pub ident: u64,
449 pub filter: i16,
450 pub flags: u16,
451 pub fflags: u32,
452 pub data: i64,
453 pub udata: u64,
454 pub ext: [u64; 2],
455 }
456
457 pub struct dqblk {
458 pub dqb_bhardlimit: u64,
459 pub dqb_bsoftlimit: u64,
460 pub dqb_curbytes: u64,
461 pub dqb_ihardlimit: u32,
462 pub dqb_isoftlimit: u32,
463 pub dqb_curinodes: u32,
464 pub dqb_btime: u32,
465 pub dqb_itime: u32,
466 pub dqb_id: u32,
467 pub dqb_spare: [u32; 4],
468 }
469
470 pub struct if_msghdr {
471 pub ifm_msglen: c_ushort,
472 pub ifm_version: c_uchar,
473 pub ifm_type: c_uchar,
474 pub ifm_addrs: c_int,
475 pub ifm_flags: c_int,
476 pub ifm_index: c_ushort,
477 pub ifm_data: if_data,
478 }
479
480 pub struct ifa_msghdr {
481 pub ifam_msglen: c_ushort,
482 pub ifam_version: c_uchar,
483 pub ifam_type: c_uchar,
484 pub ifam_addrs: c_int,
485 pub ifam_flags: c_int,
486 pub ifam_index: c_ushort,
487 pub ifam_metric: c_int,
488 }
489
490 pub struct ifma_msghdr {
491 pub ifmam_msglen: c_ushort,
492 pub ifmam_version: c_uchar,
493 pub ifmam_type: c_uchar,
494 pub ifmam_addrs: c_int,
495 pub ifmam_flags: c_int,
496 pub ifmam_index: c_ushort,
497 }
498
499 pub struct ifma_msghdr2 {
500 pub ifmam_msglen: c_ushort,
501 pub ifmam_version: c_uchar,
502 pub ifmam_type: c_uchar,
503 pub ifmam_addrs: c_int,
504 pub ifmam_flags: c_int,
505 pub ifmam_index: c_ushort,
506 pub ifmam_refcount: i32,
507 }
508
509 pub struct rt_metrics {
510 pub rmx_locks: u32,
511 pub rmx_mtu: u32,
512 pub rmx_hopcount: u32,
513 pub rmx_expire: i32,
514 pub rmx_recvpipe: u32,
515 pub rmx_sendpipe: u32,
516 pub rmx_ssthresh: u32,
517 pub rmx_rtt: u32,
518 pub rmx_rttvar: u32,
519 pub rmx_pksent: u32,
520 pub rmx_state: u32,
523 pub rmx_filler: [u32; 3],
524 }
525
526 pub struct rt_msghdr {
527 pub rtm_msglen: c_ushort,
528 pub rtm_version: c_uchar,
529 pub rtm_type: c_uchar,
530 pub rtm_index: c_ushort,
531 pub rtm_flags: c_int,
532 pub rtm_addrs: c_int,
533 pub rtm_pid: crate::pid_t,
534 pub rtm_seq: c_int,
535 pub rtm_errno: c_int,
536 pub rtm_use: c_int,
537 pub rtm_inits: u32,
538 pub rtm_rmx: rt_metrics,
539 }
540
541 pub struct rt_msghdr2 {
542 pub rtm_msglen: c_ushort,
543 pub rtm_version: c_uchar,
544 pub rtm_type: c_uchar,
545 pub rtm_index: c_ushort,
546 pub rtm_flags: c_int,
547 pub rtm_addrs: c_int,
548 pub rtm_refcnt: i32,
549 pub rtm_parentflags: c_int,
550 pub rtm_reserved: c_int,
551 pub rtm_use: c_int,
552 pub rtm_inits: u32,
553 pub rtm_rmx: rt_metrics,
554 }
555
556 pub struct termios {
557 pub c_iflag: crate::tcflag_t,
558 pub c_oflag: crate::tcflag_t,
559 pub c_cflag: crate::tcflag_t,
560 pub c_lflag: crate::tcflag_t,
561 pub c_cc: [crate::cc_t; crate::NCCS],
562 pub c_ispeed: crate::speed_t,
563 pub c_ospeed: crate::speed_t,
564 }
565
566 pub struct flock {
567 pub l_start: off_t,
568 pub l_len: off_t,
569 pub l_pid: crate::pid_t,
570 pub l_type: c_short,
571 pub l_whence: c_short,
572 }
573
574 pub struct sf_hdtr {
575 pub headers: *mut crate::iovec,
576 pub hdr_cnt: c_int,
577 pub trailers: *mut crate::iovec,
578 pub trl_cnt: c_int,
579 }
580
581 pub struct lconv {
582 pub decimal_point: *mut c_char,
583 pub thousands_sep: *mut c_char,
584 pub grouping: *mut c_char,
585 pub int_curr_symbol: *mut c_char,
586 pub currency_symbol: *mut c_char,
587 pub mon_decimal_point: *mut c_char,
588 pub mon_thousands_sep: *mut c_char,
589 pub mon_grouping: *mut c_char,
590 pub positive_sign: *mut c_char,
591 pub negative_sign: *mut c_char,
592 pub int_frac_digits: c_char,
593 pub frac_digits: c_char,
594 pub p_cs_precedes: c_char,
595 pub p_sep_by_space: c_char,
596 pub n_cs_precedes: c_char,
597 pub n_sep_by_space: c_char,
598 pub p_sign_posn: c_char,
599 pub n_sign_posn: c_char,
600 pub int_p_cs_precedes: c_char,
601 pub int_n_cs_precedes: c_char,
602 pub int_p_sep_by_space: c_char,
603 pub int_n_sep_by_space: c_char,
604 pub int_p_sign_posn: c_char,
605 pub int_n_sign_posn: c_char,
606 }
607
608 pub struct proc_taskinfo {
609 pub pti_virtual_size: u64,
610 pub pti_resident_size: u64,
611 pub pti_total_user: u64,
612 pub pti_total_system: u64,
613 pub pti_threads_user: u64,
614 pub pti_threads_system: u64,
615 pub pti_policy: i32,
616 pub pti_faults: i32,
617 pub pti_pageins: i32,
618 pub pti_cow_faults: i32,
619 pub pti_messages_sent: i32,
620 pub pti_messages_received: i32,
621 pub pti_syscalls_mach: i32,
622 pub pti_syscalls_unix: i32,
623 pub pti_csw: i32,
624 pub pti_threadnum: i32,
625 pub pti_numrunning: i32,
626 pub pti_priority: i32,
627 }
628
629 pub struct proc_bsdinfo {
630 pub pbi_flags: u32,
631 pub pbi_status: u32,
632 pub pbi_xstatus: u32,
633 pub pbi_pid: u32,
634 pub pbi_ppid: u32,
635 pub pbi_uid: crate::uid_t,
636 pub pbi_gid: crate::gid_t,
637 pub pbi_ruid: crate::uid_t,
638 pub pbi_rgid: crate::gid_t,
639 pub pbi_svuid: crate::uid_t,
640 pub pbi_svgid: crate::gid_t,
641 pub rfu_1: u32,
642 pub pbi_comm: [c_char; MAXCOMLEN],
643 pub pbi_name: [c_char; 32], pub pbi_nfiles: u32,
645 pub pbi_pgid: u32,
646 pub pbi_pjobc: u32,
647 pub e_tdev: u32,
648 pub e_tpgid: u32,
649 pub pbi_nice: i32,
650 pub pbi_start_tvsec: u64,
651 pub pbi_start_tvusec: u64,
652 }
653
654 pub struct proc_taskallinfo {
655 pub pbsd: proc_bsdinfo,
656 pub ptinfo: proc_taskinfo,
657 }
658
659 pub struct xsw_usage {
660 pub xsu_total: u64,
661 pub xsu_avail: u64,
662 pub xsu_used: u64,
663 pub xsu_pagesize: u32,
664 pub xsu_encrypted: crate::boolean_t,
665 }
666
667 pub struct xucred {
668 pub cr_version: c_uint,
669 pub cr_uid: crate::uid_t,
670 pub cr_ngroups: c_short,
671 pub cr_groups: [crate::gid_t; 16],
672 }
673
674 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
675 pub struct mach_header {
676 pub magic: u32,
677 pub cputype: cpu_type_t,
678 pub cpusubtype: cpu_subtype_t,
679 pub filetype: u32,
680 pub ncmds: u32,
681 pub sizeofcmds: u32,
682 pub flags: u32,
683 }
684
685 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
686 pub struct mach_header_64 {
687 pub magic: u32,
688 pub cputype: cpu_type_t,
689 pub cpusubtype: cpu_subtype_t,
690 pub filetype: u32,
691 pub ncmds: u32,
692 pub sizeofcmds: u32,
693 pub flags: u32,
694 pub reserved: u32,
695 }
696
697 pub struct segment_command {
698 pub cmd: u32,
699 pub cmdsize: u32,
700 pub segname: [c_char; 16],
701 pub vmaddr: u32,
702 pub vmsize: u32,
703 pub fileoff: u32,
704 pub filesize: u32,
705 pub maxprot: vm_prot_t,
706 pub initprot: vm_prot_t,
707 pub nsects: u32,
708 pub flags: u32,
709 }
710
711 pub struct segment_command_64 {
712 pub cmd: u32,
713 pub cmdsize: u32,
714 pub segname: [c_char; 16],
715 pub vmaddr: u64,
716 pub vmsize: u64,
717 pub fileoff: u64,
718 pub filesize: u64,
719 pub maxprot: vm_prot_t,
720 pub initprot: vm_prot_t,
721 pub nsects: u32,
722 pub flags: u32,
723 }
724
725 pub struct load_command {
726 pub cmd: u32,
727 pub cmdsize: u32,
728 }
729
730 pub struct sockaddr_dl {
731 pub sdl_len: c_uchar,
732 pub sdl_family: c_uchar,
733 pub sdl_index: c_ushort,
734 pub sdl_type: c_uchar,
735 pub sdl_nlen: c_uchar,
736 pub sdl_alen: c_uchar,
737 pub sdl_slen: c_uchar,
738 pub sdl_data: [c_char; 12],
739 }
740
741 pub struct sockaddr_inarp {
742 pub sin_len: c_uchar,
743 pub sin_family: c_uchar,
744 pub sin_port: c_ushort,
745 pub sin_addr: crate::in_addr,
746 pub sin_srcaddr: crate::in_addr,
747 pub sin_tos: c_ushort,
748 pub sin_other: c_ushort,
749 }
750
751 pub struct sockaddr_ctl {
752 pub sc_len: c_uchar,
753 pub sc_family: c_uchar,
754 pub ss_sysaddr: u16,
755 pub sc_id: u32,
756 pub sc_unit: u32,
757 pub sc_reserved: [u32; 5],
758 }
759
760 pub struct in_pktinfo {
761 pub ipi_ifindex: c_uint,
762 pub ipi_spec_dst: crate::in_addr,
763 pub ipi_addr: crate::in_addr,
764 }
765
766 pub struct in6_pktinfo {
767 pub ipi6_addr: crate::in6_addr,
768 pub ipi6_ifindex: c_uint,
769 }
770
771 pub struct ipc_perm {
774 pub uid: crate::uid_t,
775 pub gid: crate::gid_t,
776 pub cuid: crate::uid_t,
777 pub cgid: crate::gid_t,
778 pub mode: mode_t,
779 pub _seq: c_ushort,
780 pub _key: crate::key_t,
781 }
782
783 pub struct sembuf {
786 pub sem_num: c_ushort,
787 pub sem_op: c_short,
788 pub sem_flg: c_short,
789 }
790
791 pub struct arphdr {
794 pub ar_hrd: u16,
795 pub ar_pro: u16,
796 pub ar_hln: u8,
797 pub ar_pln: u8,
798 pub ar_op: u16,
799 }
800
801 pub struct in_addr {
802 pub s_addr: crate::in_addr_t,
803 }
804
805 pub struct sockaddr_ndrv {
807 pub snd_len: c_uchar,
808 pub snd_family: c_uchar,
809 pub snd_name: [c_uchar; crate::IFNAMSIZ],
810 }
811
812 pub struct sa_endpoints_t {
815 pub sae_srcif: c_uint, pub sae_srcaddr: *const crate::sockaddr, pub sae_srcaddrlen: crate::socklen_t, pub sae_dstaddr: *const crate::sockaddr, pub sae_dstaddrlen: crate::socklen_t, }
821
822 pub struct timex {
823 pub modes: c_uint,
824 pub offset: c_long,
825 pub freq: c_long,
826 pub maxerror: c_long,
827 pub esterror: c_long,
828 pub status: c_int,
829 pub constant: c_long,
830 pub precision: c_long,
831 pub tolerance: c_long,
832 pub ppsfreq: c_long,
833 pub jitter: c_long,
834 pub shift: c_int,
835 pub stabil: c_long,
836 pub jitcnt: c_long,
837 pub calcnt: c_long,
838 pub errcnt: c_long,
839 pub stbcnt: c_long,
840 }
841
842 pub struct ntptimeval {
843 pub time: crate::timespec,
844 pub maxerror: c_long,
845 pub esterror: c_long,
846 pub tai: c_long,
847 pub time_state: c_int,
848 }
849
850 pub struct thread_standard_policy {
851 pub no_data: natural_t,
852 }
853
854 pub struct thread_extended_policy {
855 pub timeshare: boolean_t,
856 }
857
858 pub struct thread_time_constraint_policy {
859 pub period: u32,
860 pub computation: u32,
861 pub constraint: u32,
862 pub preemptible: boolean_t,
863 }
864
865 pub struct thread_precedence_policy {
866 pub importance: integer_t,
867 }
868
869 pub struct thread_affinity_policy {
870 pub affinity_tag: integer_t,
871 }
872
873 pub struct thread_background_policy {
874 pub priority: integer_t,
875 }
876
877 pub struct thread_latency_qos_policy {
878 pub thread_latency_qos_tier: thread_latency_qos_t,
879 }
880
881 pub struct thread_throughput_qos_policy {
882 pub thread_throughput_qos_tier: thread_throughput_qos_t,
883 }
884
885 pub struct malloc_statistics_t {
887 pub blocks_in_use: c_uint,
888 pub size_in_use: size_t,
889 pub max_size_in_use: size_t,
890 pub size_allocated: size_t,
891 }
892
893 pub struct mstats {
894 pub bytes_total: size_t,
895 pub chunks_used: size_t,
896 pub bytes_used: size_t,
897 pub chunks_free: size_t,
898 pub bytes_free: size_t,
899 }
900
901 pub struct vm_range_t {
902 pub address: crate::vm_address_t,
903 pub size: crate::vm_size_t,
904 }
905
906 pub struct sched_param {
908 pub sched_priority: c_int,
909 __opaque: [c_char; 4],
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 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: u8,
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: u32,
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 pub struct host_cpu_load_info {
1259 pub cpu_ticks: [crate::natural_t; CPU_STATE_MAX as usize],
1260 }
1261
1262 pub struct ifmibdata {
1264 pub ifmd_name: [c_char; crate::IFNAMSIZ],
1266 pub ifmd_pcount: c_uint,
1268 pub ifmd_flags: c_uint,
1270 pub ifmd_snd_len: c_uint,
1272 pub ifmd_snd_maxlen: c_uint,
1274 pub ifmd_snd_drops: c_uint,
1276 pub ifmd_filler: [c_uint; 4],
1278 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 pub struct ctl_info {
1303 pub ctl_id: u32,
1304 pub ctl_name: [c_char; MAX_KCTL_NAME],
1305 }
1306
1307 pub struct proc_fdinfo {
1309 pub proc_fd: i32,
1310 pub proc_fdtype: u32,
1311 }
1312}
1313
1314s_no_extra_traits! {
1315 #[repr(packed(4))]
1316 pub struct ifconf {
1317 pub ifc_len: c_int,
1318 pub ifc_ifcu: __c_anonymous_ifc_ifcu,
1319 }
1320
1321 #[repr(packed(4))]
1322 pub struct kevent {
1323 pub ident: crate::uintptr_t,
1324 pub filter: i16,
1325 pub flags: u16,
1326 pub fflags: u32,
1327 pub data: intptr_t,
1328 pub udata: *mut c_void,
1329 }
1330
1331 #[repr(packed(4))]
1332 pub struct semid_ds {
1333 pub sem_perm: ipc_perm,
1335 pub sem_base: i32,
1336 pub sem_nsems: c_ushort,
1337 pub sem_otime: crate::time_t,
1338 pub sem_pad1: i32,
1339 pub sem_ctime: crate::time_t,
1340 pub sem_pad2: i32,
1341 pub sem_pad3: [i32; 4],
1342 }
1343
1344 #[repr(packed(4))]
1345 pub struct shmid_ds {
1346 pub shm_perm: ipc_perm,
1347 pub shm_segsz: size_t,
1348 pub shm_lpid: crate::pid_t,
1349 pub shm_cpid: crate::pid_t,
1350 pub shm_nattch: crate::shmatt_t,
1351 pub shm_atime: crate::time_t, pub shm_dtime: crate::time_t, pub shm_ctime: crate::time_t, pub shm_internal: *mut c_void,
1356 }
1357
1358 pub struct proc_threadinfo {
1359 pub pth_user_time: u64,
1360 pub pth_system_time: u64,
1361 pub pth_cpu_usage: i32,
1362 pub pth_policy: i32,
1363 pub pth_run_state: i32,
1364 pub pth_flags: i32,
1365 pub pth_sleep_time: i32,
1366 pub pth_curpri: i32,
1367 pub pth_priority: i32,
1368 pub pth_maxpriority: i32,
1369 pub pth_name: [c_char; MAXTHREADNAMESIZE],
1370 }
1371
1372 pub struct statfs {
1373 pub f_bsize: u32,
1374 pub f_iosize: i32,
1375 pub f_blocks: u64,
1376 pub f_bfree: u64,
1377 pub f_bavail: u64,
1378 pub f_files: u64,
1379 pub f_ffree: u64,
1380 pub f_fsid: crate::fsid_t,
1381 pub f_owner: crate::uid_t,
1382 pub f_type: u32,
1383 pub f_flags: u32,
1384 pub f_fssubtype: u32,
1385 pub f_fstypename: [c_char; 16],
1386 pub f_mntonname: [c_char; 1024],
1387 pub f_mntfromname: [c_char; 1024],
1388 pub f_flags_ext: u32,
1389 pub f_reserved: [u32; 7],
1390 }
1391
1392 pub struct dirent {
1393 pub d_ino: u64,
1394 pub d_seekoff: u64,
1395 pub d_reclen: u16,
1396 pub d_namlen: u16,
1397 pub d_type: u8,
1398 pub d_name: [c_char; 1024],
1399 }
1400
1401 pub struct pthread_rwlock_t {
1402 __sig: c_long,
1403 __opaque: [u8; __PTHREAD_RWLOCK_SIZE__],
1404 }
1405
1406 pub struct pthread_mutex_t {
1407 __sig: c_long,
1408 __opaque: [u8; __PTHREAD_MUTEX_SIZE__],
1409 }
1410
1411 pub struct pthread_cond_t {
1412 __sig: c_long,
1413 __opaque: [u8; __PTHREAD_COND_SIZE__],
1414 }
1415
1416 pub struct sockaddr_storage {
1417 pub ss_len: u8,
1418 pub ss_family: crate::sa_family_t,
1419 __ss_pad1: [u8; 6],
1420 __ss_align: i64,
1421 __ss_pad2: [u8; 112],
1422 }
1423
1424 pub struct utmpx {
1425 pub ut_user: [c_char; _UTX_USERSIZE],
1426 pub ut_id: [c_char; _UTX_IDSIZE],
1427 pub ut_line: [c_char; _UTX_LINESIZE],
1428 pub ut_pid: crate::pid_t,
1429 pub ut_type: c_short,
1430 pub ut_tv: crate::timeval,
1431 pub ut_host: [c_char; _UTX_HOSTSIZE],
1432 ut_pad: [u32; 16],
1433 }
1434
1435 pub struct sigevent {
1436 pub sigev_notify: c_int,
1437 pub sigev_signo: c_int,
1438 pub sigev_value: crate::sigval,
1439 __unused1: *mut c_void, pub sigev_notify_attributes: *mut crate::pthread_attr_t,
1441 }
1442
1443 pub struct processor_cpu_load_info {
1444 pub cpu_ticks: [c_uint; CPU_STATE_MAX as usize],
1445 }
1446
1447 pub struct processor_basic_info {
1448 pub cpu_type: cpu_type_t,
1449 pub cpu_subtype: cpu_subtype_t,
1450 pub running: crate::boolean_t,
1451 pub slot_num: c_int,
1452 pub is_master: crate::boolean_t,
1453 }
1454
1455 pub struct processor_set_basic_info {
1456 pub processor_count: c_int,
1457 pub default_policy: c_int,
1458 }
1459
1460 pub struct processor_set_load_info {
1461 pub task_count: c_int,
1462 pub thread_count: c_int,
1463 pub load_average: integer_t,
1464 pub mach_factor: integer_t,
1465 }
1466
1467 pub struct time_value_t {
1468 pub seconds: integer_t,
1469 pub microseconds: integer_t,
1470 }
1471
1472 pub struct thread_basic_info {
1473 pub user_time: time_value_t,
1474 pub system_time: time_value_t,
1475 pub cpu_usage: crate::integer_t,
1476 pub policy: crate::policy_t,
1477 pub run_state: crate::integer_t,
1478 pub flags: crate::integer_t,
1479 pub suspend_count: crate::integer_t,
1480 pub sleep_time: crate::integer_t,
1481 }
1482
1483 pub struct thread_identifier_info {
1484 pub thread_id: u64,
1485 pub thread_handle: u64,
1486 pub dispatch_qaddr: u64,
1487 }
1488
1489 pub struct thread_extended_info {
1490 pub pth_user_time: u64,
1491 pub pth_system_time: u64,
1492 pub pth_cpu_usage: i32,
1493 pub pth_policy: i32,
1494 pub pth_run_state: i32,
1495 pub pth_flags: i32,
1496 pub pth_sleep_time: i32,
1497 pub pth_curpri: i32,
1498 pub pth_priority: i32,
1499 pub pth_maxpriority: i32,
1500 pub pth_name: [c_char; MAXTHREADNAMESIZE],
1501 }
1502
1503 #[repr(packed(4))]
1504 pub struct if_data64 {
1505 pub ifi_type: c_uchar,
1506 pub ifi_typelen: c_uchar,
1507 pub ifi_physical: c_uchar,
1508 pub ifi_addrlen: c_uchar,
1509 pub ifi_hdrlen: c_uchar,
1510 pub ifi_recvquota: c_uchar,
1511 pub ifi_xmitquota: c_uchar,
1512 pub ifi_unused1: c_uchar,
1513 pub ifi_mtu: u32,
1514 pub ifi_metric: u32,
1515 pub ifi_baudrate: u64,
1516 pub ifi_ipackets: u64,
1517 pub ifi_ierrors: u64,
1518 pub ifi_opackets: u64,
1519 pub ifi_oerrors: u64,
1520 pub ifi_collisions: u64,
1521 pub ifi_ibytes: u64,
1522 pub ifi_obytes: u64,
1523 pub ifi_imcasts: u64,
1524 pub ifi_omcasts: u64,
1525 pub ifi_iqdrops: u64,
1526 pub ifi_noproto: u64,
1527 pub ifi_recvtiming: u32,
1528 pub ifi_xmittiming: u32,
1529 #[cfg(target_pointer_width = "32")]
1530 pub ifi_lastchange: crate::timeval,
1531 #[cfg(not(target_pointer_width = "32"))]
1532 pub ifi_lastchange: timeval32,
1533 }
1534
1535 #[repr(packed(4))]
1536 pub struct if_msghdr2 {
1537 pub ifm_msglen: c_ushort,
1538 pub ifm_version: c_uchar,
1539 pub ifm_type: c_uchar,
1540 pub ifm_addrs: c_int,
1541 pub ifm_flags: c_int,
1542 pub ifm_index: c_ushort,
1543 pub ifm_snd_len: c_int,
1544 pub ifm_snd_maxlen: c_int,
1545 pub ifm_snd_drops: c_int,
1546 pub ifm_timer: c_int,
1547 pub ifm_data: if_data64,
1548 }
1549
1550 #[repr(packed(8))]
1551 pub struct vm_statistics64 {
1552 pub free_count: natural_t,
1553 pub active_count: natural_t,
1554 pub inactive_count: natural_t,
1555 pub wire_count: natural_t,
1556 pub zero_fill_count: u64,
1557 pub reactivations: u64,
1558 pub pageins: u64,
1559 pub pageouts: u64,
1560 pub faults: u64,
1561 pub cow_faults: u64,
1562 pub lookups: u64,
1563 pub hits: u64,
1564 pub purges: u64,
1565 pub purgeable_count: natural_t,
1566 pub speculative_count: natural_t,
1567 pub decompressions: u64,
1568 pub compressions: u64,
1569 pub swapins: u64,
1570 pub swapouts: u64,
1571 pub compressor_page_count: natural_t,
1572 pub throttled_count: natural_t,
1573 pub external_page_count: natural_t,
1574 pub internal_page_count: natural_t,
1575 pub total_uncompressed_pages_in_compressor: u64,
1576 }
1577
1578 #[repr(packed(4))]
1579 pub struct mach_task_basic_info {
1580 pub virtual_size: mach_vm_size_t,
1581 pub resident_size: mach_vm_size_t,
1582 pub resident_size_max: mach_vm_size_t,
1583 pub user_time: time_value_t,
1584 pub system_time: time_value_t,
1585 pub policy: crate::policy_t,
1586 pub suspend_count: integer_t,
1587 }
1588
1589 #[repr(packed(4))]
1590 pub struct log2phys {
1591 pub l2p_flags: c_uint,
1592 pub l2p_contigbytes: off_t,
1593 pub l2p_devoffset: off_t,
1594 }
1595
1596 pub struct os_unfair_lock_s {
1597 _os_unfair_lock_opaque: u32,
1598 }
1599
1600 #[repr(packed(1))]
1601 pub struct sockaddr_vm {
1602 pub svm_len: c_uchar,
1603 pub svm_family: crate::sa_family_t,
1604 pub svm_reserved1: c_ushort,
1605 pub svm_port: c_uint,
1606 pub svm_cid: c_uint,
1607 }
1608
1609 pub struct ifdevmtu {
1610 pub ifdm_current: c_int,
1611 pub ifdm_min: c_int,
1612 pub ifdm_max: c_int,
1613 }
1614
1615 pub union __c_anonymous_ifk_data {
1616 pub ifk_ptr: *mut c_void,
1617 pub ifk_value: c_int,
1618 }
1619
1620 #[repr(packed(4))]
1621 pub struct ifkpi {
1622 pub ifk_module_id: c_uint,
1623 pub ifk_type: c_uint,
1624 pub ifk_data: __c_anonymous_ifk_data,
1625 }
1626
1627 pub union __c_anonymous_ifr_ifru {
1628 pub ifru_addr: crate::sockaddr,
1629 pub ifru_dstaddr: crate::sockaddr,
1630 pub ifru_broadaddr: crate::sockaddr,
1631 pub ifru_flags: c_short,
1632 pub ifru_metrics: c_int,
1633 pub ifru_mtu: c_int,
1634 pub ifru_phys: c_int,
1635 pub ifru_media: c_int,
1636 pub ifru_intval: c_int,
1637 pub ifru_data: *mut c_char,
1638 pub ifru_devmtu: ifdevmtu,
1639 pub ifru_kpi: ifkpi,
1640 pub ifru_wake_flags: u32,
1641 pub ifru_route_refcnt: u32,
1642 pub ifru_cap: [c_int; 2],
1643 pub ifru_functional_type: u32,
1644 }
1645
1646 pub struct ifreq {
1647 pub ifr_name: [c_char; crate::IFNAMSIZ],
1648 pub ifr_ifru: __c_anonymous_ifr_ifru,
1649 }
1650
1651 pub union __c_anonymous_ifc_ifcu {
1652 pub ifcu_buf: *mut c_char,
1653 pub ifcu_req: *mut ifreq,
1654 }
1655
1656 pub union __c_anonymous_ifr_ifru6 {
1657 pub ifru_addr: crate::sockaddr_in6,
1658 pub ifru_dstaddr: crate::sockaddr_in6,
1659 pub ifru_flags: c_int,
1660 pub ifru_flags6: c_int,
1661 pub ifru_metrics: c_int,
1662 pub ifru_intval: c_int,
1663 pub ifru_data: *mut c_char,
1664 pub ifru_lifetime: in6_addrlifetime,
1665 pub ifru_stat: in6_ifstat,
1666 pub ifru_icmp6stat: icmp6_ifstat,
1667 pub ifru_scope_id: [u32; SCOPE6_ID_MAX],
1668 }
1669
1670 pub struct in6_ifreq {
1671 pub ifr_name: [c_char; crate::IFNAMSIZ],
1672 pub ifr_ifru: __c_anonymous_ifr_ifru6,
1673 }
1674}
1675
1676impl siginfo_t {
1677 pub unsafe fn si_addr(&self) -> *mut c_void {
1678 self.si_addr
1679 }
1680
1681 pub unsafe fn si_value(&self) -> crate::sigval {
1682 #[repr(C)]
1683 struct siginfo_timer {
1684 _si_signo: c_int,
1685 _si_errno: c_int,
1686 _si_code: c_int,
1687 _si_pid: crate::pid_t,
1688 _si_uid: crate::uid_t,
1689 _si_status: c_int,
1690 _si_addr: *mut c_void,
1691 si_value: crate::sigval,
1692 }
1693
1694 (*(self as *const siginfo_t).cast::<siginfo_timer>()).si_value
1695 }
1696
1697 pub unsafe fn si_pid(&self) -> crate::pid_t {
1698 self.si_pid
1699 }
1700
1701 pub unsafe fn si_uid(&self) -> crate::uid_t {
1702 self.si_uid
1703 }
1704
1705 pub unsafe fn si_status(&self) -> c_int {
1706 self.si_status
1707 }
1708}
1709
1710s_no_extra_traits! {
1711 pub union semun {
1712 pub val: c_int,
1713 pub buf: *mut semid_ds,
1714 pub array: *mut c_ushort,
1715 }
1716}
1717
1718cfg_if! {
1719 if #[cfg(feature = "extra_traits")] {
1720 impl PartialEq for semun {
1721 fn eq(&self, other: &semun) -> bool {
1722 unsafe { self.val == other.val }
1723 }
1724 }
1725 impl Eq for semun {}
1726 impl hash::Hash for semun {
1727 fn hash<H: hash::Hasher>(&self, state: &mut H) {
1728 unsafe { self.val.hash(state) };
1729 }
1730 }
1731 }
1732}
1733
1734cfg_if! {
1735 if #[cfg(feature = "extra_traits")] {
1736 impl PartialEq for ifconf
1737 where
1738 Self: Copy,
1739 {
1740 fn eq(&self, other: &Self) -> bool {
1741 let len_ptr1 = core::ptr::addr_of!(self.ifc_len);
1742 let len_ptr2 = core::ptr::addr_of!(other.ifc_len);
1743 let ifcu_ptr1 = core::ptr::addr_of!(self.ifc_ifcu);
1744 let ifcu_ptr2 = core::ptr::addr_of!(other.ifc_ifcu);
1745
1746 let len1 = unsafe { len_ptr1.read_unaligned() };
1748 let len2 = unsafe { len_ptr2.read_unaligned() };
1749 let ifcu1 = unsafe { ifcu_ptr1.read_unaligned() };
1750 let ifcu2 = unsafe { ifcu_ptr2.read_unaligned() };
1751
1752 len1 == len2 && ifcu1 == ifcu2
1753 }
1754 }
1755 impl Eq for ifconf {}
1756
1757 impl PartialEq for kevent {
1758 fn eq(&self, other: &kevent) -> bool {
1759 self.ident == other.ident
1760 && self.filter == other.filter
1761 && self.flags == other.flags
1762 && self.fflags == other.fflags
1763 && self.data == other.data
1764 && self.udata == other.udata
1765 }
1766 }
1767 impl Eq for kevent {}
1768 impl hash::Hash for kevent {
1769 fn hash<H: hash::Hasher>(&self, state: &mut H) {
1770 let ident = self.ident;
1771 let filter = self.filter;
1772 let flags = self.flags;
1773 let fflags = self.fflags;
1774 let data = self.data;
1775 let udata = self.udata;
1776 ident.hash(state);
1777 filter.hash(state);
1778 flags.hash(state);
1779 fflags.hash(state);
1780 data.hash(state);
1781 udata.hash(state);
1782 }
1783 }
1784
1785 impl PartialEq for semid_ds {
1786 fn eq(&self, other: &semid_ds) -> bool {
1787 let sem_perm = self.sem_perm;
1788 let sem_pad3 = self.sem_pad3;
1789 let other_sem_perm = other.sem_perm;
1790 let other_sem_pad3 = other.sem_pad3;
1791 sem_perm == other_sem_perm
1792 && self.sem_base == other.sem_base
1793 && self.sem_nsems == other.sem_nsems
1794 && self.sem_otime == other.sem_otime
1795 && self.sem_pad1 == other.sem_pad1
1796 && self.sem_ctime == other.sem_ctime
1797 && self.sem_pad2 == other.sem_pad2
1798 && sem_pad3 == other_sem_pad3
1799 }
1800 }
1801 impl Eq for semid_ds {}
1802 impl hash::Hash for semid_ds {
1803 fn hash<H: hash::Hasher>(&self, state: &mut H) {
1804 let sem_perm = self.sem_perm;
1805 let sem_base = self.sem_base;
1806 let sem_nsems = self.sem_nsems;
1807 let sem_otime = self.sem_otime;
1808 let sem_pad1 = self.sem_pad1;
1809 let sem_ctime = self.sem_ctime;
1810 let sem_pad2 = self.sem_pad2;
1811 let sem_pad3 = self.sem_pad3;
1812 sem_perm.hash(state);
1813 sem_base.hash(state);
1814 sem_nsems.hash(state);
1815 sem_otime.hash(state);
1816 sem_pad1.hash(state);
1817 sem_ctime.hash(state);
1818 sem_pad2.hash(state);
1819 sem_pad3.hash(state);
1820 }
1821 }
1822
1823 impl PartialEq for shmid_ds {
1824 fn eq(&self, other: &shmid_ds) -> bool {
1825 let shm_perm = self.shm_perm;
1826 let other_shm_perm = other.shm_perm;
1827 shm_perm == other_shm_perm
1828 && self.shm_segsz == other.shm_segsz
1829 && self.shm_lpid == other.shm_lpid
1830 && self.shm_cpid == other.shm_cpid
1831 && self.shm_nattch == other.shm_nattch
1832 && self.shm_atime == other.shm_atime
1833 && self.shm_dtime == other.shm_dtime
1834 && self.shm_ctime == other.shm_ctime
1835 && self.shm_internal == other.shm_internal
1836 }
1837 }
1838 impl Eq for shmid_ds {}
1839 impl hash::Hash for shmid_ds {
1840 fn hash<H: hash::Hasher>(&self, state: &mut H) {
1841 let shm_perm = self.shm_perm;
1842 let shm_segsz = self.shm_segsz;
1843 let shm_lpid = self.shm_lpid;
1844 let shm_cpid = self.shm_cpid;
1845 let shm_nattch = self.shm_nattch;
1846 let shm_atime = self.shm_atime;
1847 let shm_dtime = self.shm_dtime;
1848 let shm_ctime = self.shm_ctime;
1849 let shm_internal = self.shm_internal;
1850 shm_perm.hash(state);
1851 shm_segsz.hash(state);
1852 shm_lpid.hash(state);
1853 shm_cpid.hash(state);
1854 shm_nattch.hash(state);
1855 shm_atime.hash(state);
1856 shm_dtime.hash(state);
1857 shm_ctime.hash(state);
1858 shm_internal.hash(state);
1859 }
1860 }
1861
1862 impl PartialEq for proc_threadinfo {
1863 fn eq(&self, other: &proc_threadinfo) -> bool {
1864 self.pth_user_time == other.pth_user_time
1865 && self.pth_system_time == other.pth_system_time
1866 && self.pth_cpu_usage == other.pth_cpu_usage
1867 && self.pth_policy == other.pth_policy
1868 && self.pth_run_state == other.pth_run_state
1869 && self.pth_flags == other.pth_flags
1870 && self.pth_sleep_time == other.pth_sleep_time
1871 && self.pth_curpri == other.pth_curpri
1872 && self.pth_priority == other.pth_priority
1873 && self.pth_maxpriority == other.pth_maxpriority
1874 && self
1875 .pth_name
1876 .iter()
1877 .zip(other.pth_name.iter())
1878 .all(|(a, b)| a == b)
1879 }
1880 }
1881 impl Eq for proc_threadinfo {}
1882 impl hash::Hash for proc_threadinfo {
1883 fn hash<H: hash::Hasher>(&self, state: &mut H) {
1884 self.pth_user_time.hash(state);
1885 self.pth_system_time.hash(state);
1886 self.pth_cpu_usage.hash(state);
1887 self.pth_policy.hash(state);
1888 self.pth_run_state.hash(state);
1889 self.pth_flags.hash(state);
1890 self.pth_sleep_time.hash(state);
1891 self.pth_curpri.hash(state);
1892 self.pth_priority.hash(state);
1893 self.pth_maxpriority.hash(state);
1894 self.pth_name.hash(state);
1895 }
1896 }
1897
1898 impl PartialEq for statfs {
1899 fn eq(&self, other: &statfs) -> bool {
1900 self.f_bsize == other.f_bsize
1901 && self.f_iosize == other.f_iosize
1902 && self.f_blocks == other.f_blocks
1903 && self.f_bfree == other.f_bfree
1904 && self.f_bavail == other.f_bavail
1905 && self.f_files == other.f_files
1906 && self.f_ffree == other.f_ffree
1907 && self.f_fsid == other.f_fsid
1908 && self.f_owner == other.f_owner
1909 && self.f_flags == other.f_flags
1910 && self.f_fssubtype == other.f_fssubtype
1911 && self.f_fstypename == other.f_fstypename
1912 && self.f_type == other.f_type
1913 && self
1914 .f_mntonname
1915 .iter()
1916 .zip(other.f_mntonname.iter())
1917 .all(|(a, b)| a == b)
1918 && self
1919 .f_mntfromname
1920 .iter()
1921 .zip(other.f_mntfromname.iter())
1922 .all(|(a, b)| a == b)
1923 && self.f_reserved == other.f_reserved
1924 }
1925 }
1926
1927 impl Eq for statfs {}
1928
1929 impl hash::Hash for statfs {
1930 fn hash<H: hash::Hasher>(&self, state: &mut H) {
1931 self.f_bsize.hash(state);
1932 self.f_iosize.hash(state);
1933 self.f_blocks.hash(state);
1934 self.f_bfree.hash(state);
1935 self.f_bavail.hash(state);
1936 self.f_files.hash(state);
1937 self.f_ffree.hash(state);
1938 self.f_fsid.hash(state);
1939 self.f_owner.hash(state);
1940 self.f_flags.hash(state);
1941 self.f_fssubtype.hash(state);
1942 self.f_fstypename.hash(state);
1943 self.f_type.hash(state);
1944 self.f_mntonname.hash(state);
1945 self.f_mntfromname.hash(state);
1946 self.f_reserved.hash(state);
1947 }
1948 }
1949
1950 impl PartialEq for dirent {
1951 fn eq(&self, other: &dirent) -> bool {
1952 self.d_ino == other.d_ino
1953 && self.d_seekoff == other.d_seekoff
1954 && self.d_reclen == other.d_reclen
1955 && self.d_namlen == other.d_namlen
1956 && self.d_type == other.d_type
1957 && self
1958 .d_name
1959 .iter()
1960 .zip(other.d_name.iter())
1961 .all(|(a, b)| a == b)
1962 }
1963 }
1964 impl Eq for dirent {}
1965 impl hash::Hash for dirent {
1966 fn hash<H: hash::Hasher>(&self, state: &mut H) {
1967 self.d_ino.hash(state);
1968 self.d_seekoff.hash(state);
1969 self.d_reclen.hash(state);
1970 self.d_namlen.hash(state);
1971 self.d_type.hash(state);
1972 self.d_name.hash(state);
1973 }
1974 }
1975 impl PartialEq for pthread_rwlock_t {
1976 fn eq(&self, other: &pthread_rwlock_t) -> bool {
1977 self.__sig == other.__sig
1978 && self
1979 .__opaque
1980 .iter()
1981 .zip(other.__opaque.iter())
1982 .all(|(a, b)| a == b)
1983 }
1984 }
1985 impl Eq for pthread_rwlock_t {}
1986 impl hash::Hash for pthread_rwlock_t {
1987 fn hash<H: hash::Hasher>(&self, state: &mut H) {
1988 self.__sig.hash(state);
1989 self.__opaque.hash(state);
1990 }
1991 }
1992
1993 impl PartialEq for pthread_mutex_t {
1994 fn eq(&self, other: &pthread_mutex_t) -> bool {
1995 self.__sig == other.__sig
1996 && self
1997 .__opaque
1998 .iter()
1999 .zip(other.__opaque.iter())
2000 .all(|(a, b)| a == b)
2001 }
2002 }
2003
2004 impl Eq for pthread_mutex_t {}
2005
2006 impl hash::Hash for pthread_mutex_t {
2007 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2008 self.__sig.hash(state);
2009 self.__opaque.hash(state);
2010 }
2011 }
2012
2013 impl PartialEq for pthread_cond_t {
2014 fn eq(&self, other: &pthread_cond_t) -> bool {
2015 self.__sig == other.__sig
2016 && self
2017 .__opaque
2018 .iter()
2019 .zip(other.__opaque.iter())
2020 .all(|(a, b)| a == b)
2021 }
2022 }
2023
2024 impl Eq for pthread_cond_t {}
2025
2026 impl hash::Hash for pthread_cond_t {
2027 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2028 self.__sig.hash(state);
2029 self.__opaque.hash(state);
2030 }
2031 }
2032
2033 impl PartialEq for sockaddr_storage {
2034 fn eq(&self, other: &sockaddr_storage) -> bool {
2035 self.ss_len == other.ss_len
2036 && self.ss_family == other.ss_family
2037 && self
2038 .__ss_pad1
2039 .iter()
2040 .zip(other.__ss_pad1.iter())
2041 .all(|(a, b)| a == b)
2042 && self.__ss_align == other.__ss_align
2043 && self
2044 .__ss_pad2
2045 .iter()
2046 .zip(other.__ss_pad2.iter())
2047 .all(|(a, b)| a == b)
2048 }
2049 }
2050
2051 impl Eq for sockaddr_storage {}
2052
2053 impl hash::Hash for sockaddr_storage {
2054 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2055 self.ss_len.hash(state);
2056 self.ss_family.hash(state);
2057 self.__ss_pad1.hash(state);
2058 self.__ss_align.hash(state);
2059 self.__ss_pad2.hash(state);
2060 }
2061 }
2062
2063 impl PartialEq for utmpx {
2064 fn eq(&self, other: &utmpx) -> bool {
2065 self.ut_user
2066 .iter()
2067 .zip(other.ut_user.iter())
2068 .all(|(a, b)| a == b)
2069 && self.ut_id == other.ut_id
2070 && self.ut_line == other.ut_line
2071 && self.ut_pid == other.ut_pid
2072 && self.ut_type == other.ut_type
2073 && self.ut_tv == other.ut_tv
2074 && self
2075 .ut_host
2076 .iter()
2077 .zip(other.ut_host.iter())
2078 .all(|(a, b)| a == b)
2079 && self.ut_pad == other.ut_pad
2080 }
2081 }
2082
2083 impl Eq for utmpx {}
2084
2085 impl hash::Hash for utmpx {
2086 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2087 self.ut_user.hash(state);
2088 self.ut_id.hash(state);
2089 self.ut_line.hash(state);
2090 self.ut_pid.hash(state);
2091 self.ut_type.hash(state);
2092 self.ut_tv.hash(state);
2093 self.ut_host.hash(state);
2094 self.ut_pad.hash(state);
2095 }
2096 }
2097
2098 impl PartialEq for sigevent {
2099 fn eq(&self, other: &sigevent) -> bool {
2100 self.sigev_notify == other.sigev_notify
2101 && self.sigev_signo == other.sigev_signo
2102 && self.sigev_value == other.sigev_value
2103 && self.sigev_notify_attributes == other.sigev_notify_attributes
2104 }
2105 }
2106
2107 impl Eq for sigevent {}
2108
2109 impl hash::Hash for sigevent {
2110 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2111 self.sigev_notify.hash(state);
2112 self.sigev_signo.hash(state);
2113 self.sigev_value.hash(state);
2114 self.sigev_notify_attributes.hash(state);
2115 }
2116 }
2117
2118 impl PartialEq for processor_cpu_load_info {
2119 fn eq(&self, other: &processor_cpu_load_info) -> bool {
2120 self.cpu_ticks == other.cpu_ticks
2121 }
2122 }
2123 impl Eq for processor_cpu_load_info {}
2124 impl hash::Hash for processor_cpu_load_info {
2125 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2126 self.cpu_ticks.hash(state);
2127 }
2128 }
2129
2130 impl PartialEq for processor_basic_info {
2131 fn eq(&self, other: &processor_basic_info) -> bool {
2132 self.cpu_type == other.cpu_type
2133 && self.cpu_subtype == other.cpu_subtype
2134 && self.running == other.running
2135 && self.slot_num == other.slot_num
2136 && self.is_master == other.is_master
2137 }
2138 }
2139 impl Eq for processor_basic_info {}
2140 impl hash::Hash for processor_basic_info {
2141 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2142 self.cpu_type.hash(state);
2143 self.cpu_subtype.hash(state);
2144 self.running.hash(state);
2145 self.slot_num.hash(state);
2146 self.is_master.hash(state);
2147 }
2148 }
2149
2150 impl PartialEq for processor_set_basic_info {
2151 fn eq(&self, other: &processor_set_basic_info) -> bool {
2152 self.processor_count == other.processor_count
2153 && self.default_policy == other.default_policy
2154 }
2155 }
2156 impl Eq for processor_set_basic_info {}
2157 impl hash::Hash for processor_set_basic_info {
2158 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2159 self.processor_count.hash(state);
2160 self.default_policy.hash(state);
2161 }
2162 }
2163
2164 impl PartialEq for processor_set_load_info {
2165 fn eq(&self, other: &processor_set_load_info) -> bool {
2166 self.task_count == other.task_count
2167 && self.thread_count == other.thread_count
2168 && self.load_average == other.load_average
2169 && self.mach_factor == other.mach_factor
2170 }
2171 }
2172 impl Eq for processor_set_load_info {}
2173 impl hash::Hash for processor_set_load_info {
2174 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2175 self.task_count.hash(state);
2176 self.thread_count.hash(state);
2177 self.load_average.hash(state);
2178 self.mach_factor.hash(state);
2179 }
2180 }
2181
2182 impl PartialEq for time_value_t {
2183 fn eq(&self, other: &time_value_t) -> bool {
2184 self.seconds == other.seconds && self.microseconds == other.microseconds
2185 }
2186 }
2187 impl Eq for time_value_t {}
2188 impl hash::Hash for time_value_t {
2189 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2190 self.seconds.hash(state);
2191 self.microseconds.hash(state);
2192 }
2193 }
2194 impl PartialEq for thread_basic_info {
2195 fn eq(&self, other: &thread_basic_info) -> bool {
2196 self.user_time == other.user_time
2197 && self.system_time == other.system_time
2198 && self.cpu_usage == other.cpu_usage
2199 && self.policy == other.policy
2200 && self.run_state == other.run_state
2201 && self.flags == other.flags
2202 && self.suspend_count == other.suspend_count
2203 && self.sleep_time == other.sleep_time
2204 }
2205 }
2206 impl Eq for thread_basic_info {}
2207 impl hash::Hash for thread_basic_info {
2208 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2209 self.user_time.hash(state);
2210 self.system_time.hash(state);
2211 self.cpu_usage.hash(state);
2212 self.policy.hash(state);
2213 self.run_state.hash(state);
2214 self.flags.hash(state);
2215 self.suspend_count.hash(state);
2216 self.sleep_time.hash(state);
2217 }
2218 }
2219 impl PartialEq for thread_extended_info {
2220 fn eq(&self, other: &thread_extended_info) -> bool {
2221 self.pth_user_time == other.pth_user_time
2222 && self.pth_system_time == other.pth_system_time
2223 && self.pth_cpu_usage == other.pth_cpu_usage
2224 && self.pth_policy == other.pth_policy
2225 && self.pth_run_state == other.pth_run_state
2226 && self.pth_flags == other.pth_flags
2227 && self.pth_sleep_time == other.pth_sleep_time
2228 && self.pth_curpri == other.pth_curpri
2229 && self.pth_priority == other.pth_priority
2230 && self.pth_maxpriority == other.pth_maxpriority
2231 && self
2232 .pth_name
2233 .iter()
2234 .zip(other.pth_name.iter())
2235 .all(|(a, b)| a == b)
2236 }
2237 }
2238 impl Eq for thread_extended_info {}
2239 impl hash::Hash for thread_extended_info {
2240 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2241 self.pth_user_time.hash(state);
2242 self.pth_system_time.hash(state);
2243 self.pth_cpu_usage.hash(state);
2244 self.pth_policy.hash(state);
2245 self.pth_run_state.hash(state);
2246 self.pth_flags.hash(state);
2247 self.pth_sleep_time.hash(state);
2248 self.pth_curpri.hash(state);
2249 self.pth_priority.hash(state);
2250 self.pth_maxpriority.hash(state);
2251 self.pth_name.hash(state);
2252 }
2253 }
2254 impl PartialEq for thread_identifier_info {
2255 fn eq(&self, other: &thread_identifier_info) -> bool {
2256 self.thread_id == other.thread_id
2257 && self.thread_handle == other.thread_handle
2258 && self.dispatch_qaddr == other.dispatch_qaddr
2259 }
2260 }
2261 impl Eq for thread_identifier_info {}
2262 impl hash::Hash for thread_identifier_info {
2263 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2264 self.thread_id.hash(state);
2265 self.thread_handle.hash(state);
2266 self.dispatch_qaddr.hash(state);
2267 }
2268 }
2269 impl PartialEq for if_data64 {
2270 fn eq(&self, other: &if_data64) -> bool {
2271 self.ifi_type == other.ifi_type
2272 && self.ifi_typelen == other.ifi_typelen
2273 && self.ifi_physical == other.ifi_physical
2274 && self.ifi_addrlen == other.ifi_addrlen
2275 && self.ifi_hdrlen == other.ifi_hdrlen
2276 && self.ifi_recvquota == other.ifi_recvquota
2277 && self.ifi_xmitquota == other.ifi_xmitquota
2278 && self.ifi_unused1 == other.ifi_unused1
2279 && self.ifi_mtu == other.ifi_mtu
2280 && self.ifi_metric == other.ifi_metric
2281 && self.ifi_baudrate == other.ifi_baudrate
2282 && self.ifi_ipackets == other.ifi_ipackets
2283 && self.ifi_ierrors == other.ifi_ierrors
2284 && self.ifi_opackets == other.ifi_opackets
2285 && self.ifi_oerrors == other.ifi_oerrors
2286 && self.ifi_collisions == other.ifi_collisions
2287 && self.ifi_ibytes == other.ifi_ibytes
2288 && self.ifi_obytes == other.ifi_obytes
2289 && self.ifi_imcasts == other.ifi_imcasts
2290 && self.ifi_omcasts == other.ifi_omcasts
2291 && self.ifi_iqdrops == other.ifi_iqdrops
2292 && self.ifi_noproto == other.ifi_noproto
2293 && self.ifi_recvtiming == other.ifi_recvtiming
2294 && self.ifi_xmittiming == other.ifi_xmittiming
2295 && self.ifi_lastchange == other.ifi_lastchange
2296 }
2297 }
2298 impl Eq for if_data64 {}
2299 impl hash::Hash for if_data64 {
2300 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2301 let ifi_type = self.ifi_type;
2302 let ifi_typelen = self.ifi_typelen;
2303 let ifi_physical = self.ifi_physical;
2304 let ifi_addrlen = self.ifi_addrlen;
2305 let ifi_hdrlen = self.ifi_hdrlen;
2306 let ifi_recvquota = self.ifi_recvquota;
2307 let ifi_xmitquota = self.ifi_xmitquota;
2308 let ifi_unused1 = self.ifi_unused1;
2309 let ifi_mtu = self.ifi_mtu;
2310 let ifi_metric = self.ifi_metric;
2311 let ifi_baudrate = self.ifi_baudrate;
2312 let ifi_ipackets = self.ifi_ipackets;
2313 let ifi_ierrors = self.ifi_ierrors;
2314 let ifi_opackets = self.ifi_opackets;
2315 let ifi_oerrors = self.ifi_oerrors;
2316 let ifi_collisions = self.ifi_collisions;
2317 let ifi_ibytes = self.ifi_ibytes;
2318 let ifi_obytes = self.ifi_obytes;
2319 let ifi_imcasts = self.ifi_imcasts;
2320 let ifi_omcasts = self.ifi_omcasts;
2321 let ifi_iqdrops = self.ifi_iqdrops;
2322 let ifi_noproto = self.ifi_noproto;
2323 let ifi_recvtiming = self.ifi_recvtiming;
2324 let ifi_xmittiming = self.ifi_xmittiming;
2325 let ifi_lastchange = self.ifi_lastchange;
2326 ifi_type.hash(state);
2327 ifi_typelen.hash(state);
2328 ifi_physical.hash(state);
2329 ifi_addrlen.hash(state);
2330 ifi_hdrlen.hash(state);
2331 ifi_recvquota.hash(state);
2332 ifi_xmitquota.hash(state);
2333 ifi_unused1.hash(state);
2334 ifi_mtu.hash(state);
2335 ifi_metric.hash(state);
2336 ifi_baudrate.hash(state);
2337 ifi_ipackets.hash(state);
2338 ifi_ierrors.hash(state);
2339 ifi_opackets.hash(state);
2340 ifi_oerrors.hash(state);
2341 ifi_collisions.hash(state);
2342 ifi_ibytes.hash(state);
2343 ifi_obytes.hash(state);
2344 ifi_imcasts.hash(state);
2345 ifi_omcasts.hash(state);
2346 ifi_iqdrops.hash(state);
2347 ifi_noproto.hash(state);
2348 ifi_recvtiming.hash(state);
2349 ifi_xmittiming.hash(state);
2350 ifi_lastchange.hash(state);
2351 }
2352 }
2353 impl PartialEq for if_msghdr2 {
2354 fn eq(&self, other: &if_msghdr2) -> bool {
2355 self.ifm_msglen == other.ifm_msglen
2356 && self.ifm_version == other.ifm_version
2357 && self.ifm_type == other.ifm_type
2358 && self.ifm_addrs == other.ifm_addrs
2359 && self.ifm_flags == other.ifm_flags
2360 && self.ifm_index == other.ifm_index
2361 && self.ifm_snd_len == other.ifm_snd_len
2362 && self.ifm_snd_maxlen == other.ifm_snd_maxlen
2363 && self.ifm_snd_drops == other.ifm_snd_drops
2364 && self.ifm_timer == other.ifm_timer
2365 && self.ifm_data == other.ifm_data
2366 }
2367 }
2368 impl Eq for if_msghdr2 {}
2369 impl hash::Hash for if_msghdr2 {
2370 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2371 let ifm_msglen = self.ifm_msglen;
2372 let ifm_version = self.ifm_version;
2373 let ifm_type = self.ifm_type;
2374 let ifm_addrs = self.ifm_addrs;
2375 let ifm_flags = self.ifm_flags;
2376 let ifm_index = self.ifm_index;
2377 let ifm_snd_len = self.ifm_snd_len;
2378 let ifm_snd_maxlen = self.ifm_snd_maxlen;
2379 let ifm_snd_drops = self.ifm_snd_drops;
2380 let ifm_timer = self.ifm_timer;
2381 let ifm_data = self.ifm_data;
2382 ifm_msglen.hash(state);
2383 ifm_version.hash(state);
2384 ifm_type.hash(state);
2385 ifm_addrs.hash(state);
2386 ifm_flags.hash(state);
2387 ifm_index.hash(state);
2388 ifm_snd_len.hash(state);
2389 ifm_snd_maxlen.hash(state);
2390 ifm_snd_drops.hash(state);
2391 ifm_timer.hash(state);
2392 ifm_data.hash(state);
2393 }
2394 }
2395 impl PartialEq for vm_statistics64 {
2396 fn eq(&self, other: &vm_statistics64) -> bool {
2397 let total_uncompressed = self.total_uncompressed_pages_in_compressor;
2399 self.free_count == other.free_count
2400 && self.active_count == other.active_count
2401 && self.inactive_count == other.inactive_count
2402 && self.wire_count == other.wire_count
2403 && self.zero_fill_count == other.zero_fill_count
2404 && self.reactivations == other.reactivations
2405 && self.pageins == other.pageins
2406 && self.pageouts == other.pageouts
2407 && self.faults == other.faults
2408 && self.cow_faults == other.cow_faults
2409 && self.lookups == other.lookups
2410 && self.hits == other.hits
2411 && self.purges == other.purges
2412 && self.purgeable_count == other.purgeable_count
2413 && self.speculative_count == other.speculative_count
2414 && self.decompressions == other.decompressions
2415 && self.compressions == other.compressions
2416 && self.swapins == other.swapins
2417 && self.swapouts == other.swapouts
2418 && self.compressor_page_count == other.compressor_page_count
2419 && self.throttled_count == other.throttled_count
2420 && self.external_page_count == other.external_page_count
2421 && self.internal_page_count == other.internal_page_count
2422 && total_uncompressed == other.total_uncompressed_pages_in_compressor
2423 }
2424 }
2425 impl Eq for vm_statistics64 {}
2426 impl hash::Hash for vm_statistics64 {
2427 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2428 let free_count = self.free_count;
2429 let active_count = self.active_count;
2430 let inactive_count = self.inactive_count;
2431 let wire_count = self.wire_count;
2432 let zero_fill_count = self.zero_fill_count;
2433 let reactivations = self.reactivations;
2434 let pageins = self.pageins;
2435 let pageouts = self.pageouts;
2436 let faults = self.faults;
2437 let cow_faults = self.cow_faults;
2438 let lookups = self.lookups;
2439 let hits = self.hits;
2440 let purges = self.purges;
2441 let purgeable_count = self.purgeable_count;
2442 let speculative_count = self.speculative_count;
2443 let decompressions = self.decompressions;
2444 let compressions = self.compressions;
2445 let swapins = self.swapins;
2446 let swapouts = self.swapouts;
2447 let compressor_page_count = self.compressor_page_count;
2448 let throttled_count = self.throttled_count;
2449 let external_page_count = self.external_page_count;
2450 let internal_page_count = self.internal_page_count;
2451 let total_uncompressed = self.total_uncompressed_pages_in_compressor;
2453 free_count.hash(state);
2454 active_count.hash(state);
2455 inactive_count.hash(state);
2456 wire_count.hash(state);
2457 zero_fill_count.hash(state);
2458 reactivations.hash(state);
2459 pageins.hash(state);
2460 pageouts.hash(state);
2461 faults.hash(state);
2462 cow_faults.hash(state);
2463 lookups.hash(state);
2464 hits.hash(state);
2465 purges.hash(state);
2466 purgeable_count.hash(state);
2467 speculative_count.hash(state);
2468 decompressions.hash(state);
2469 compressions.hash(state);
2470 swapins.hash(state);
2471 swapouts.hash(state);
2472 compressor_page_count.hash(state);
2473 throttled_count.hash(state);
2474 external_page_count.hash(state);
2475 internal_page_count.hash(state);
2476 total_uncompressed.hash(state);
2477 }
2478 }
2479
2480 impl PartialEq for mach_task_basic_info {
2481 fn eq(&self, other: &mach_task_basic_info) -> bool {
2482 self.virtual_size == other.virtual_size
2483 && self.resident_size == other.resident_size
2484 && self.resident_size_max == other.resident_size_max
2485 && self.user_time == other.user_time
2486 && self.system_time == other.system_time
2487 && self.policy == other.policy
2488 && self.suspend_count == other.suspend_count
2489 }
2490 }
2491 impl Eq for mach_task_basic_info {}
2492 impl hash::Hash for mach_task_basic_info {
2493 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2494 let virtual_size = self.virtual_size;
2495 let resident_size = self.resident_size;
2496 let resident_size_max = self.resident_size_max;
2497 let user_time = self.user_time;
2498 let system_time = self.system_time;
2499 let policy = self.policy;
2500 let suspend_count = self.suspend_count;
2501 virtual_size.hash(state);
2502 resident_size.hash(state);
2503 resident_size_max.hash(state);
2504 user_time.hash(state);
2505 system_time.hash(state);
2506 policy.hash(state);
2507 suspend_count.hash(state);
2508 }
2509 }
2510
2511 impl PartialEq for log2phys {
2512 fn eq(&self, other: &log2phys) -> bool {
2513 self.l2p_flags == other.l2p_flags
2514 && self.l2p_contigbytes == other.l2p_contigbytes
2515 && self.l2p_devoffset == other.l2p_devoffset
2516 }
2517 }
2518 impl Eq for log2phys {}
2519 impl hash::Hash for log2phys {
2520 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2521 let l2p_flags = self.l2p_flags;
2522 let l2p_contigbytes = self.l2p_contigbytes;
2523 let l2p_devoffset = self.l2p_devoffset;
2524 l2p_flags.hash(state);
2525 l2p_contigbytes.hash(state);
2526 l2p_devoffset.hash(state);
2527 }
2528 }
2529 impl PartialEq for os_unfair_lock {
2530 fn eq(&self, other: &os_unfair_lock) -> bool {
2531 self._os_unfair_lock_opaque == other._os_unfair_lock_opaque
2532 }
2533 }
2534
2535 impl Eq for os_unfair_lock {}
2536
2537 impl hash::Hash for os_unfair_lock {
2538 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2539 self._os_unfair_lock_opaque.hash(state);
2540 }
2541 }
2542
2543 impl PartialEq for sockaddr_vm {
2544 fn eq(&self, other: &sockaddr_vm) -> bool {
2545 self.svm_len == other.svm_len
2546 && self.svm_family == other.svm_family
2547 && self.svm_reserved1 == other.svm_reserved1
2548 && self.svm_port == other.svm_port
2549 && self.svm_cid == other.svm_cid
2550 }
2551 }
2552
2553 impl Eq for sockaddr_vm {}
2554
2555 impl hash::Hash for sockaddr_vm {
2556 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2557 let svm_len = self.svm_len;
2558 let svm_family = self.svm_family;
2559 let svm_reserved1 = self.svm_reserved1;
2560 let svm_port = self.svm_port;
2561 let svm_cid = self.svm_cid;
2562
2563 svm_len.hash(state);
2564 svm_family.hash(state);
2565 svm_reserved1.hash(state);
2566 svm_port.hash(state);
2567 svm_cid.hash(state);
2568 }
2569 }
2570
2571 impl PartialEq for ifdevmtu {
2572 fn eq(&self, other: &ifdevmtu) -> bool {
2573 self.ifdm_current == other.ifdm_current
2574 && self.ifdm_min == other.ifdm_min
2575 && self.ifdm_max == other.ifdm_max
2576 }
2577 }
2578
2579 impl Eq for ifdevmtu {}
2580
2581 impl hash::Hash for ifdevmtu {
2582 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2583 self.ifdm_current.hash(state);
2584 self.ifdm_min.hash(state);
2585 self.ifdm_max.hash(state);
2586 }
2587 }
2588
2589 impl PartialEq for __c_anonymous_ifk_data {
2590 fn eq(&self, other: &__c_anonymous_ifk_data) -> bool {
2591 unsafe { self.ifk_ptr == other.ifk_ptr && self.ifk_value == other.ifk_value }
2592 }
2593 }
2594
2595 impl Eq for __c_anonymous_ifk_data {}
2596 impl hash::Hash for __c_anonymous_ifk_data {
2597 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2598 unsafe {
2599 self.ifk_ptr.hash(state);
2600 self.ifk_value.hash(state);
2601 }
2602 }
2603 }
2604
2605 impl PartialEq for ifkpi {
2606 fn eq(&self, other: &ifkpi) -> bool {
2607 self.ifk_module_id == other.ifk_module_id && self.ifk_type == other.ifk_type
2608 }
2609 }
2610
2611 impl Eq for ifkpi {}
2612
2613 impl hash::Hash for ifkpi {
2614 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2615 self.ifk_module_id.hash(state);
2616 self.ifk_type.hash(state);
2617 }
2618 }
2619
2620 impl PartialEq for __c_anonymous_ifr_ifru {
2621 fn eq(&self, other: &__c_anonymous_ifr_ifru) -> bool {
2622 unsafe {
2623 self.ifru_addr == other.ifru_addr
2624 && self.ifru_dstaddr == other.ifru_dstaddr
2625 && self.ifru_broadaddr == other.ifru_broadaddr
2626 && self.ifru_flags == other.ifru_flags
2627 && self.ifru_metrics == other.ifru_metrics
2628 && self.ifru_mtu == other.ifru_mtu
2629 && self.ifru_phys == other.ifru_phys
2630 && self.ifru_media == other.ifru_media
2631 && self.ifru_intval == other.ifru_intval
2632 && self.ifru_data == other.ifru_data
2633 && self.ifru_devmtu == other.ifru_devmtu
2634 && self.ifru_kpi == other.ifru_kpi
2635 && self.ifru_wake_flags == other.ifru_wake_flags
2636 && self.ifru_route_refcnt == other.ifru_route_refcnt
2637 && self
2638 .ifru_cap
2639 .iter()
2640 .zip(other.ifru_cap.iter())
2641 .all(|(a, b)| a == b)
2642 && self.ifru_functional_type == other.ifru_functional_type
2643 }
2644 }
2645 }
2646
2647 impl Eq for __c_anonymous_ifr_ifru {}
2648
2649 impl hash::Hash for __c_anonymous_ifr_ifru {
2650 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2651 unsafe {
2652 self.ifru_addr.hash(state);
2653 self.ifru_dstaddr.hash(state);
2654 self.ifru_broadaddr.hash(state);
2655 self.ifru_flags.hash(state);
2656 self.ifru_metrics.hash(state);
2657 self.ifru_mtu.hash(state);
2658 self.ifru_phys.hash(state);
2659 self.ifru_media.hash(state);
2660 self.ifru_intval.hash(state);
2661 self.ifru_data.hash(state);
2662 self.ifru_devmtu.hash(state);
2663 self.ifru_kpi.hash(state);
2664 self.ifru_wake_flags.hash(state);
2665 self.ifru_route_refcnt.hash(state);
2666 self.ifru_cap.hash(state);
2667 self.ifru_functional_type.hash(state);
2668 }
2669 }
2670 }
2671
2672 impl PartialEq for ifreq {
2673 fn eq(&self, other: &ifreq) -> bool {
2674 self.ifr_name == other.ifr_name && self.ifr_ifru == other.ifr_ifru
2675 }
2676 }
2677
2678 impl Eq for ifreq {}
2679
2680 impl hash::Hash for ifreq {
2681 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2682 self.ifr_name.hash(state);
2683 self.ifr_ifru.hash(state);
2684 }
2685 }
2686
2687 impl Eq for __c_anonymous_ifc_ifcu {}
2688
2689 impl PartialEq for __c_anonymous_ifc_ifcu {
2690 fn eq(&self, other: &__c_anonymous_ifc_ifcu) -> bool {
2691 unsafe { self.ifcu_buf == other.ifcu_buf && self.ifcu_req == other.ifcu_req }
2692 }
2693 }
2694
2695 impl hash::Hash for __c_anonymous_ifc_ifcu {
2696 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2697 unsafe { self.ifcu_buf.hash(state) };
2698 unsafe { self.ifcu_req.hash(state) };
2699 }
2700 }
2701
2702 impl PartialEq for __c_anonymous_ifr_ifru6 {
2703 fn eq(&self, other: &__c_anonymous_ifr_ifru6) -> bool {
2704 unsafe {
2705 self.ifru_addr == other.ifru_addr
2706 && self.ifru_dstaddr == other.ifru_dstaddr
2707 && self.ifru_flags == other.ifru_flags
2708 && self.ifru_flags6 == other.ifru_flags6
2709 && self.ifru_metrics == other.ifru_metrics
2710 && self.ifru_intval == other.ifru_intval
2711 && self.ifru_data == other.ifru_data
2712 && self
2713 .ifru_scope_id
2714 .iter()
2715 .zip(other.ifru_scope_id.iter())
2716 .all(|(a, b)| a == b)
2717 }
2718 }
2719 }
2720
2721 impl Eq for __c_anonymous_ifr_ifru6 {}
2722
2723 impl hash::Hash for __c_anonymous_ifr_ifru6 {
2724 fn hash<H: hash::Hasher>(&self, state: &mut H) {
2725 unsafe {
2726 self.ifru_addr.hash(state);
2727 self.ifru_dstaddr.hash(state);
2728 self.ifru_flags.hash(state);
2729 self.ifru_flags6.hash(state);
2730 self.ifru_metrics.hash(state);
2731 self.ifru_intval.hash(state);
2732 self.ifru_data.hash(state);
2733 self.ifru_scope_id.hash(state);
2734 }
2735 }
2736 }
2737
2738 impl PartialEq for in6_ifreq {
2739 fn eq(&self, other: &in6_ifreq) -> bool {
2740 self.ifr_name == other.ifr_name && self.ifr_ifru == other.ifr_ifru
2741 }
2742 }
2743
2744 impl Eq for in6_ifreq {}
2745 }
2746}
2747
2748pub const _UTX_USERSIZE: usize = 256;
2749pub const _UTX_LINESIZE: usize = 32;
2750pub const _UTX_IDSIZE: usize = 4;
2751pub const _UTX_HOSTSIZE: usize = 256;
2752
2753pub const EMPTY: c_short = 0;
2754pub const RUN_LVL: c_short = 1;
2755pub const BOOT_TIME: c_short = 2;
2756pub const OLD_TIME: c_short = 3;
2757pub const NEW_TIME: c_short = 4;
2758pub const INIT_PROCESS: c_short = 5;
2759pub const LOGIN_PROCESS: c_short = 6;
2760pub const USER_PROCESS: c_short = 7;
2761pub const DEAD_PROCESS: c_short = 8;
2762pub const ACCOUNTING: c_short = 9;
2763pub const SIGNATURE: c_short = 10;
2764pub const SHUTDOWN_TIME: c_short = 11;
2765
2766pub const LC_COLLATE_MASK: c_int = 1 << 0;
2767pub const LC_CTYPE_MASK: c_int = 1 << 1;
2768pub const LC_MESSAGES_MASK: c_int = 1 << 2;
2769pub const LC_MONETARY_MASK: c_int = 1 << 3;
2770pub const LC_NUMERIC_MASK: c_int = 1 << 4;
2771pub const LC_TIME_MASK: c_int = 1 << 5;
2772pub const LC_ALL_MASK: c_int = LC_COLLATE_MASK
2773 | LC_CTYPE_MASK
2774 | LC_MESSAGES_MASK
2775 | LC_MONETARY_MASK
2776 | LC_NUMERIC_MASK
2777 | LC_TIME_MASK;
2778
2779pub const CODESET: crate::nl_item = 0;
2780pub const D_T_FMT: crate::nl_item = 1;
2781pub const D_FMT: crate::nl_item = 2;
2782pub const T_FMT: crate::nl_item = 3;
2783pub const T_FMT_AMPM: crate::nl_item = 4;
2784pub const AM_STR: crate::nl_item = 5;
2785pub const PM_STR: crate::nl_item = 6;
2786
2787pub const DAY_1: crate::nl_item = 7;
2788pub const DAY_2: crate::nl_item = 8;
2789pub const DAY_3: crate::nl_item = 9;
2790pub const DAY_4: crate::nl_item = 10;
2791pub const DAY_5: crate::nl_item = 11;
2792pub const DAY_6: crate::nl_item = 12;
2793pub const DAY_7: crate::nl_item = 13;
2794
2795pub const ABDAY_1: crate::nl_item = 14;
2796pub const ABDAY_2: crate::nl_item = 15;
2797pub const ABDAY_3: crate::nl_item = 16;
2798pub const ABDAY_4: crate::nl_item = 17;
2799pub const ABDAY_5: crate::nl_item = 18;
2800pub const ABDAY_6: crate::nl_item = 19;
2801pub const ABDAY_7: crate::nl_item = 20;
2802
2803pub const MON_1: crate::nl_item = 21;
2804pub const MON_2: crate::nl_item = 22;
2805pub const MON_3: crate::nl_item = 23;
2806pub const MON_4: crate::nl_item = 24;
2807pub const MON_5: crate::nl_item = 25;
2808pub const MON_6: crate::nl_item = 26;
2809pub const MON_7: crate::nl_item = 27;
2810pub const MON_8: crate::nl_item = 28;
2811pub const MON_9: crate::nl_item = 29;
2812pub const MON_10: crate::nl_item = 30;
2813pub const MON_11: crate::nl_item = 31;
2814pub const MON_12: crate::nl_item = 32;
2815
2816pub const ABMON_1: crate::nl_item = 33;
2817pub const ABMON_2: crate::nl_item = 34;
2818pub const ABMON_3: crate::nl_item = 35;
2819pub const ABMON_4: crate::nl_item = 36;
2820pub const ABMON_5: crate::nl_item = 37;
2821pub const ABMON_6: crate::nl_item = 38;
2822pub const ABMON_7: crate::nl_item = 39;
2823pub const ABMON_8: crate::nl_item = 40;
2824pub const ABMON_9: crate::nl_item = 41;
2825pub const ABMON_10: crate::nl_item = 42;
2826pub const ABMON_11: crate::nl_item = 43;
2827pub const ABMON_12: crate::nl_item = 44;
2828
2829pub const CLOCK_REALTIME: crate::clockid_t = 0;
2830pub const CLOCK_MONOTONIC_RAW: crate::clockid_t = 4;
2831pub const CLOCK_MONOTONIC_RAW_APPROX: crate::clockid_t = 5;
2832pub const CLOCK_MONOTONIC: crate::clockid_t = 6;
2833pub const CLOCK_UPTIME_RAW: crate::clockid_t = 8;
2834pub const CLOCK_UPTIME_RAW_APPROX: crate::clockid_t = 9;
2835pub const CLOCK_PROCESS_CPUTIME_ID: crate::clockid_t = 12;
2836pub const CLOCK_THREAD_CPUTIME_ID: crate::clockid_t = 16;
2837
2838pub const ERA: crate::nl_item = 45;
2839pub const ERA_D_FMT: crate::nl_item = 46;
2840pub const ERA_D_T_FMT: crate::nl_item = 47;
2841pub const ERA_T_FMT: crate::nl_item = 48;
2842pub const ALT_DIGITS: crate::nl_item = 49;
2843
2844pub const RADIXCHAR: crate::nl_item = 50;
2845pub const THOUSEP: crate::nl_item = 51;
2846
2847pub const YESEXPR: crate::nl_item = 52;
2848pub const NOEXPR: crate::nl_item = 53;
2849
2850pub const YESSTR: crate::nl_item = 54;
2851pub const NOSTR: crate::nl_item = 55;
2852
2853pub const CRNCYSTR: crate::nl_item = 56;
2854
2855pub const D_MD_ORDER: crate::nl_item = 57;
2856
2857pub const EXIT_FAILURE: c_int = 1;
2858pub const EXIT_SUCCESS: c_int = 0;
2859pub const RAND_MAX: c_int = 2147483647;
2860pub const EOF: c_int = -1;
2861pub const SEEK_SET: c_int = 0;
2862pub const SEEK_CUR: c_int = 1;
2863pub const SEEK_END: c_int = 2;
2864pub const SEEK_HOLE: c_int = 3;
2865pub const SEEK_DATA: c_int = 4;
2866pub const _IOFBF: c_int = 0;
2867pub const _IONBF: c_int = 2;
2868pub const _IOLBF: c_int = 1;
2869pub const BUFSIZ: c_uint = 1024;
2870pub const FOPEN_MAX: c_uint = 20;
2871pub const FILENAME_MAX: c_uint = 1024;
2872pub const L_tmpnam: c_uint = 1024;
2873pub const TMP_MAX: c_uint = 308915776;
2874pub const _PC_LINK_MAX: c_int = 1;
2875pub const _PC_MAX_CANON: c_int = 2;
2876pub const _PC_MAX_INPUT: c_int = 3;
2877pub const _PC_NAME_MAX: c_int = 4;
2878pub const _PC_PATH_MAX: c_int = 5;
2879pub const _PC_PIPE_BUF: c_int = 6;
2880pub const _PC_CHOWN_RESTRICTED: c_int = 7;
2881pub const _PC_NO_TRUNC: c_int = 8;
2882pub const _PC_VDISABLE: c_int = 9;
2883pub const _PC_NAME_CHARS_MAX: c_int = 10;
2884pub const _PC_CASE_SENSITIVE: c_int = 11;
2885pub const _PC_CASE_PRESERVING: c_int = 12;
2886pub const _PC_EXTENDED_SECURITY_NP: c_int = 13;
2887pub const _PC_AUTH_OPAQUE_NP: c_int = 14;
2888pub const _PC_2_SYMLINKS: c_int = 15;
2889pub const _PC_ALLOC_SIZE_MIN: c_int = 16;
2890pub const _PC_ASYNC_IO: c_int = 17;
2891pub const _PC_FILESIZEBITS: c_int = 18;
2892pub const _PC_PRIO_IO: c_int = 19;
2893pub const _PC_REC_INCR_XFER_SIZE: c_int = 20;
2894pub const _PC_REC_MAX_XFER_SIZE: c_int = 21;
2895pub const _PC_REC_MIN_XFER_SIZE: c_int = 22;
2896pub const _PC_REC_XFER_ALIGN: c_int = 23;
2897pub const _PC_SYMLINK_MAX: c_int = 24;
2898pub const _PC_SYNC_IO: c_int = 25;
2899pub const _PC_XATTR_SIZE_BITS: c_int = 26;
2900pub const _PC_MIN_HOLE_SIZE: c_int = 27;
2901pub const O_EVTONLY: c_int = 0x00008000;
2902pub const O_NOCTTY: c_int = 0x00020000;
2903pub const O_DIRECTORY: c_int = 0x00100000;
2904pub const O_SYMLINK: c_int = 0x00200000;
2905pub const O_DSYNC: c_int = 0x00400000;
2906pub const O_CLOEXEC: c_int = 0x01000000;
2907pub const O_NOFOLLOW_ANY: c_int = 0x20000000;
2908pub const O_EXEC: c_int = 0x40000000;
2909pub const O_SEARCH: c_int = O_EXEC | O_DIRECTORY;
2910pub const S_IFIFO: mode_t = 0o1_0000;
2911pub const S_IFCHR: mode_t = 0o2_0000;
2912pub const S_IFBLK: mode_t = 0o6_0000;
2913pub const S_IFDIR: mode_t = 0o4_0000;
2914pub const S_IFREG: mode_t = 0o10_0000;
2915pub const S_IFLNK: mode_t = 0o12_0000;
2916pub const S_IFSOCK: mode_t = 0o14_0000;
2917pub const S_IFMT: mode_t = 0o17_0000;
2918pub const S_IEXEC: mode_t = 0o0100;
2919pub const S_IWRITE: mode_t = 0o0200;
2920pub const S_IREAD: mode_t = 0o0400;
2921pub const S_IRWXU: mode_t = 0o0700;
2922pub const S_IXUSR: mode_t = 0o0100;
2923pub const S_IWUSR: mode_t = 0o0200;
2924pub const S_IRUSR: mode_t = 0o0400;
2925pub const S_IRWXG: mode_t = 0o0070;
2926pub const S_IXGRP: mode_t = 0o0010;
2927pub const S_IWGRP: mode_t = 0o0020;
2928pub const S_IRGRP: mode_t = 0o0040;
2929pub const S_IRWXO: mode_t = 0o0007;
2930pub const S_IXOTH: mode_t = 0o0001;
2931pub const S_IWOTH: mode_t = 0o0002;
2932pub const S_IROTH: mode_t = 0o0004;
2933pub const F_OK: c_int = 0;
2934pub const R_OK: c_int = 4;
2935pub const W_OK: c_int = 2;
2936pub const X_OK: c_int = 1;
2937pub const STDIN_FILENO: c_int = 0;
2938pub const STDOUT_FILENO: c_int = 1;
2939pub const STDERR_FILENO: c_int = 2;
2940pub const F_LOCK: c_int = 1;
2941pub const F_TEST: c_int = 3;
2942pub const F_TLOCK: c_int = 2;
2943pub const F_ULOCK: c_int = 0;
2944pub const F_GETLK: c_int = 7;
2945pub const F_SETLK: c_int = 8;
2946pub const F_SETLKW: c_int = 9;
2947pub const SIGHUP: c_int = 1;
2948pub const SIGINT: c_int = 2;
2949pub const SIGQUIT: c_int = 3;
2950pub const SIGILL: c_int = 4;
2951pub const SIGABRT: c_int = 6;
2952pub const SIGEMT: c_int = 7;
2953pub const SIGFPE: c_int = 8;
2954pub const SIGKILL: c_int = 9;
2955pub const SIGSEGV: c_int = 11;
2956pub const SIGPIPE: c_int = 13;
2957pub const SIGALRM: c_int = 14;
2958pub const SIGTERM: c_int = 15;
2959
2960pub const PROT_NONE: c_int = 0;
2961pub const PROT_READ: c_int = 1;
2962pub const PROT_WRITE: c_int = 2;
2963pub const PROT_EXEC: c_int = 4;
2964
2965pub const PT_TRACE_ME: c_int = 0;
2966pub const PT_READ_I: c_int = 1;
2967pub const PT_READ_D: c_int = 2;
2968pub const PT_READ_U: c_int = 3;
2969pub const PT_WRITE_I: c_int = 4;
2970pub const PT_WRITE_D: c_int = 5;
2971pub const PT_WRITE_U: c_int = 6;
2972pub const PT_CONTINUE: c_int = 7;
2973pub const PT_KILL: c_int = 8;
2974pub const PT_STEP: c_int = 9;
2975pub const PT_ATTACH: c_int = 10;
2976pub const PT_DETACH: c_int = 11;
2977pub const PT_SIGEXC: c_int = 12;
2978pub const PT_THUPDATE: c_int = 13;
2979pub const PT_ATTACHEXC: c_int = 14;
2980
2981pub const PT_FORCEQUOTA: c_int = 30;
2982pub const PT_DENY_ATTACH: c_int = 31;
2983pub const PT_FIRSTMACH: c_int = 32;
2984
2985pub const MAP_FILE: c_int = 0x0000;
2986pub const MAP_SHARED: c_int = 0x0001;
2987pub const MAP_PRIVATE: c_int = 0x0002;
2988pub const MAP_FIXED: c_int = 0x0010;
2989pub const MAP_ANON: c_int = 0x1000;
2990pub const MAP_ANONYMOUS: c_int = MAP_ANON;
2991
2992pub const CPU_STATE_USER: c_int = 0;
2993pub const CPU_STATE_SYSTEM: c_int = 1;
2994pub const CPU_STATE_IDLE: c_int = 2;
2995pub const CPU_STATE_NICE: c_int = 3;
2996pub const CPU_STATE_MAX: c_int = 4;
2997
2998pub const PROCESSOR_BASIC_INFO: c_int = 1;
2999pub const PROCESSOR_CPU_LOAD_INFO: c_int = 2;
3000pub const PROCESSOR_PM_REGS_INFO: c_int = 0x10000001;
3001pub const PROCESSOR_TEMPERATURE: c_int = 0x10000002;
3002pub const PROCESSOR_SET_LOAD_INFO: c_int = 4;
3003pub const PROCESSOR_SET_BASIC_INFO: c_int = 5;
3004
3005deprecated_mach! {
3006 pub const VM_FLAGS_FIXED: c_int = 0x0000;
3007 pub const VM_FLAGS_ANYWHERE: c_int = 0x0001;
3008 pub const VM_FLAGS_PURGABLE: c_int = 0x0002;
3009 pub const VM_FLAGS_RANDOM_ADDR: c_int = 0x0008;
3010 pub const VM_FLAGS_NO_CACHE: c_int = 0x0010;
3011 pub const VM_FLAGS_RESILIENT_CODESIGN: c_int = 0x0020;
3012 pub const VM_FLAGS_RESILIENT_MEDIA: c_int = 0x0040;
3013 pub const VM_FLAGS_OVERWRITE: c_int = 0x4000;
3014 pub const VM_FLAGS_SUPERPAGE_MASK: c_int = 0x70000;
3015 pub const VM_FLAGS_RETURN_DATA_ADDR: c_int = 0x100000;
3016 pub const VM_FLAGS_RETURN_4K_DATA_ADDR: c_int = 0x800000;
3017 pub const VM_FLAGS_ALIAS_MASK: c_int = 0xFF000000;
3018 pub const VM_FLAGS_USER_ALLOCATE: c_int = 0xff07401f;
3019 pub const VM_FLAGS_USER_MAP: c_int = 0xff97401f;
3020 pub const VM_FLAGS_USER_REMAP: c_int = VM_FLAGS_FIXED
3021 | VM_FLAGS_ANYWHERE
3022 | VM_FLAGS_RANDOM_ADDR
3023 | VM_FLAGS_OVERWRITE
3024 | VM_FLAGS_RETURN_DATA_ADDR
3025 | VM_FLAGS_RESILIENT_CODESIGN;
3026
3027 pub const VM_FLAGS_SUPERPAGE_SHIFT: c_int = 16;
3028 pub const SUPERPAGE_NONE: c_int = 0;
3029 pub const SUPERPAGE_SIZE_ANY: c_int = 1;
3030 pub const VM_FLAGS_SUPERPAGE_NONE: c_int = SUPERPAGE_NONE << VM_FLAGS_SUPERPAGE_SHIFT;
3031 pub const VM_FLAGS_SUPERPAGE_SIZE_ANY: c_int = SUPERPAGE_SIZE_ANY << VM_FLAGS_SUPERPAGE_SHIFT;
3032 pub const SUPERPAGE_SIZE_2MB: c_int = 2;
3033 pub const VM_FLAGS_SUPERPAGE_SIZE_2MB: c_int = SUPERPAGE_SIZE_2MB << VM_FLAGS_SUPERPAGE_SHIFT;
3034
3035 pub const VM_MEMORY_MALLOC: c_int = 1;
3036 pub const VM_MEMORY_MALLOC_SMALL: c_int = 2;
3037 pub const VM_MEMORY_MALLOC_LARGE: c_int = 3;
3038 pub const VM_MEMORY_MALLOC_HUGE: c_int = 4;
3039 pub const VM_MEMORY_SBRK: c_int = 5;
3040 pub const VM_MEMORY_REALLOC: c_int = 6;
3041 pub const VM_MEMORY_MALLOC_TINY: c_int = 7;
3042 pub const VM_MEMORY_MALLOC_LARGE_REUSABLE: c_int = 8;
3043 pub const VM_MEMORY_MALLOC_LARGE_REUSED: c_int = 9;
3044 pub const VM_MEMORY_ANALYSIS_TOOL: c_int = 10;
3045 pub const VM_MEMORY_MALLOC_NANO: c_int = 11;
3046 pub const VM_MEMORY_MACH_MSG: c_int = 20;
3047 pub const VM_MEMORY_IOKIT: c_int = 21;
3048 pub const VM_MEMORY_STACK: c_int = 30;
3049 pub const VM_MEMORY_GUARD: c_int = 31;
3050 pub const VM_MEMORY_SHARED_PMAP: c_int = 32;
3051 pub const VM_MEMORY_DYLIB: c_int = 33;
3052 pub const VM_MEMORY_OBJC_DISPATCHERS: c_int = 34;
3053 pub const VM_MEMORY_UNSHARED_PMAP: c_int = 35;
3054 pub const VM_MEMORY_APPKIT: c_int = 40;
3055 pub const VM_MEMORY_FOUNDATION: c_int = 41;
3056 pub const VM_MEMORY_COREGRAPHICS: c_int = 42;
3057 pub const VM_MEMORY_CORESERVICES: c_int = 43;
3058 pub const VM_MEMORY_CARBON: c_int = VM_MEMORY_CORESERVICES;
3059 pub const VM_MEMORY_JAVA: c_int = 44;
3060 pub const VM_MEMORY_COREDATA: c_int = 45;
3061 pub const VM_MEMORY_COREDATA_OBJECTIDS: c_int = 46;
3062 pub const VM_MEMORY_ATS: c_int = 50;
3063 pub const VM_MEMORY_LAYERKIT: c_int = 51;
3064 pub const VM_MEMORY_CGIMAGE: c_int = 52;
3065 pub const VM_MEMORY_TCMALLOC: c_int = 53;
3066 pub const VM_MEMORY_COREGRAPHICS_DATA: c_int = 54;
3067 pub const VM_MEMORY_COREGRAPHICS_SHARED: c_int = 55;
3068 pub const VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS: c_int = 56;
3069 pub const VM_MEMORY_COREGRAPHICS_BACKINGSTORES: c_int = 57;
3070 pub const VM_MEMORY_COREGRAPHICS_XALLOC: c_int = 58;
3071 pub const VM_MEMORY_COREGRAPHICS_MISC: c_int = VM_MEMORY_COREGRAPHICS;
3072 pub const VM_MEMORY_DYLD: c_int = 60;
3073 pub const VM_MEMORY_DYLD_MALLOC: c_int = 61;
3074 pub const VM_MEMORY_SQLITE: c_int = 62;
3075 pub const VM_MEMORY_JAVASCRIPT_CORE: c_int = 63;
3076 pub const VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR: c_int = 64;
3077 pub const VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE: c_int = 65;
3078 pub const VM_MEMORY_GLSL: c_int = 66;
3079 pub const VM_MEMORY_OPENCL: c_int = 67;
3080 pub const VM_MEMORY_COREIMAGE: c_int = 68;
3081 pub const VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS: c_int = 69;
3082 pub const VM_MEMORY_IMAGEIO: c_int = 70;
3083 pub const VM_MEMORY_COREPROFILE: c_int = 71;
3084 pub const VM_MEMORY_ASSETSD: c_int = 72;
3085 pub const VM_MEMORY_OS_ALLOC_ONCE: c_int = 73;
3086 pub const VM_MEMORY_LIBDISPATCH: c_int = 74;
3087 pub const VM_MEMORY_ACCELERATE: c_int = 75;
3088 pub const VM_MEMORY_COREUI: c_int = 76;
3089 pub const VM_MEMORY_COREUIFILE: c_int = 77;
3090 pub const VM_MEMORY_GENEALOGY: c_int = 78;
3091 pub const VM_MEMORY_RAWCAMERA: c_int = 79;
3092 pub const VM_MEMORY_CORPSEINFO: c_int = 80;
3093 pub const VM_MEMORY_ASL: c_int = 81;
3094 pub const VM_MEMORY_SWIFT_RUNTIME: c_int = 82;
3095 pub const VM_MEMORY_SWIFT_METADATA: c_int = 83;
3096 pub const VM_MEMORY_DHMM: c_int = 84;
3097 pub const VM_MEMORY_SCENEKIT: c_int = 86;
3098 pub const VM_MEMORY_SKYWALK: c_int = 87;
3099 pub const VM_MEMORY_APPLICATION_SPECIFIC_1: c_int = 240;
3100 pub const VM_MEMORY_APPLICATION_SPECIFIC_16: c_int = 255;
3101}
3102
3103pub const MAP_FAILED: *mut c_void = !0 as *mut c_void;
3104
3105pub const MCL_CURRENT: c_int = 0x0001;
3106pub const MCL_FUTURE: c_int = 0x0002;
3107
3108pub const MS_ASYNC: c_int = 0x0001;
3109pub const MS_INVALIDATE: c_int = 0x0002;
3110pub const MS_SYNC: c_int = 0x0010;
3111
3112pub const MS_KILLPAGES: c_int = 0x0004;
3113pub const MS_DEACTIVATE: c_int = 0x0008;
3114
3115pub const EPERM: c_int = 1;
3116pub const ENOENT: c_int = 2;
3117pub const ESRCH: c_int = 3;
3118pub const EINTR: c_int = 4;
3119pub const EIO: c_int = 5;
3120pub const ENXIO: c_int = 6;
3121pub const E2BIG: c_int = 7;
3122pub const ENOEXEC: c_int = 8;
3123pub const EBADF: c_int = 9;
3124pub const ECHILD: c_int = 10;
3125pub const EDEADLK: c_int = 11;
3126pub const ENOMEM: c_int = 12;
3127pub const EACCES: c_int = 13;
3128pub const EFAULT: c_int = 14;
3129pub const ENOTBLK: c_int = 15;
3130pub const EBUSY: c_int = 16;
3131pub const EEXIST: c_int = 17;
3132pub const EXDEV: c_int = 18;
3133pub const ENODEV: c_int = 19;
3134pub const ENOTDIR: c_int = 20;
3135pub const EISDIR: c_int = 21;
3136pub const EINVAL: c_int = 22;
3137pub const ENFILE: c_int = 23;
3138pub const EMFILE: c_int = 24;
3139pub const ENOTTY: c_int = 25;
3140pub const ETXTBSY: c_int = 26;
3141pub const EFBIG: c_int = 27;
3142pub const ENOSPC: c_int = 28;
3143pub const ESPIPE: c_int = 29;
3144pub const EROFS: c_int = 30;
3145pub const EMLINK: c_int = 31;
3146pub const EPIPE: c_int = 32;
3147pub const EDOM: c_int = 33;
3148pub const ERANGE: c_int = 34;
3149pub const EAGAIN: c_int = 35;
3150pub const EWOULDBLOCK: c_int = EAGAIN;
3151pub const EINPROGRESS: c_int = 36;
3152pub const EALREADY: c_int = 37;
3153pub const ENOTSOCK: c_int = 38;
3154pub const EDESTADDRREQ: c_int = 39;
3155pub const EMSGSIZE: c_int = 40;
3156pub const EPROTOTYPE: c_int = 41;
3157pub const ENOPROTOOPT: c_int = 42;
3158pub const EPROTONOSUPPORT: c_int = 43;
3159pub const ESOCKTNOSUPPORT: c_int = 44;
3160pub const ENOTSUP: c_int = 45;
3161pub const EPFNOSUPPORT: c_int = 46;
3162pub const EAFNOSUPPORT: c_int = 47;
3163pub const EADDRINUSE: c_int = 48;
3164pub const EADDRNOTAVAIL: c_int = 49;
3165pub const ENETDOWN: c_int = 50;
3166pub const ENETUNREACH: c_int = 51;
3167pub const ENETRESET: c_int = 52;
3168pub const ECONNABORTED: c_int = 53;
3169pub const ECONNRESET: c_int = 54;
3170pub const ENOBUFS: c_int = 55;
3171pub const EISCONN: c_int = 56;
3172pub const ENOTCONN: c_int = 57;
3173pub const ESHUTDOWN: c_int = 58;
3174pub const ETOOMANYREFS: c_int = 59;
3175pub const ETIMEDOUT: c_int = 60;
3176pub const ECONNREFUSED: c_int = 61;
3177pub const ELOOP: c_int = 62;
3178pub const ENAMETOOLONG: c_int = 63;
3179pub const EHOSTDOWN: c_int = 64;
3180pub const EHOSTUNREACH: c_int = 65;
3181pub const ENOTEMPTY: c_int = 66;
3182pub const EPROCLIM: c_int = 67;
3183pub const EUSERS: c_int = 68;
3184pub const EDQUOT: c_int = 69;
3185pub const ESTALE: c_int = 70;
3186pub const EREMOTE: c_int = 71;
3187pub const EBADRPC: c_int = 72;
3188pub const ERPCMISMATCH: c_int = 73;
3189pub const EPROGUNAVAIL: c_int = 74;
3190pub const EPROGMISMATCH: c_int = 75;
3191pub const EPROCUNAVAIL: c_int = 76;
3192pub const ENOLCK: c_int = 77;
3193pub const ENOSYS: c_int = 78;
3194pub const EFTYPE: c_int = 79;
3195pub const EAUTH: c_int = 80;
3196pub const ENEEDAUTH: c_int = 81;
3197pub const EPWROFF: c_int = 82;
3198pub const EDEVERR: c_int = 83;
3199pub const EOVERFLOW: c_int = 84;
3200pub const EBADEXEC: c_int = 85;
3201pub const EBADARCH: c_int = 86;
3202pub const ESHLIBVERS: c_int = 87;
3203pub const EBADMACHO: c_int = 88;
3204pub const ECANCELED: c_int = 89;
3205pub const EIDRM: c_int = 90;
3206pub const ENOMSG: c_int = 91;
3207pub const EILSEQ: c_int = 92;
3208pub const ENOATTR: c_int = 93;
3209pub const EBADMSG: c_int = 94;
3210pub const EMULTIHOP: c_int = 95;
3211pub const ENODATA: c_int = 96;
3212pub const ENOLINK: c_int = 97;
3213pub const ENOSR: c_int = 98;
3214pub const ENOSTR: c_int = 99;
3215pub const EPROTO: c_int = 100;
3216pub const ETIME: c_int = 101;
3217pub const EOPNOTSUPP: c_int = 102;
3218pub const ENOPOLICY: c_int = 103;
3219pub const ENOTRECOVERABLE: c_int = 104;
3220pub const EOWNERDEAD: c_int = 105;
3221pub const EQFULL: c_int = 106;
3222pub const ELAST: c_int = 106;
3223
3224pub const EAI_AGAIN: c_int = 2;
3225pub const EAI_BADFLAGS: c_int = 3;
3226pub const EAI_FAIL: c_int = 4;
3227pub const EAI_FAMILY: c_int = 5;
3228pub const EAI_MEMORY: c_int = 6;
3229pub const EAI_NODATA: c_int = 7;
3230pub const EAI_NONAME: c_int = 8;
3231pub const EAI_SERVICE: c_int = 9;
3232pub const EAI_SOCKTYPE: c_int = 10;
3233pub const EAI_SYSTEM: c_int = 11;
3234pub const EAI_OVERFLOW: c_int = 14;
3235
3236pub const F_DUPFD: c_int = 0;
3237pub const F_DUPFD_CLOEXEC: c_int = 67;
3238pub const F_GETFD: c_int = 1;
3239pub const F_SETFD: c_int = 2;
3240pub const F_GETFL: c_int = 3;
3241pub const F_SETFL: c_int = 4;
3242pub const F_PREALLOCATE: c_int = 42;
3243pub const F_RDADVISE: c_int = 44;
3244pub const F_RDAHEAD: c_int = 45;
3245pub const F_NOCACHE: c_int = 48;
3246pub const F_LOG2PHYS: c_int = 49;
3247pub const F_GETPATH: c_int = 50;
3248pub const F_FULLFSYNC: c_int = 51;
3249pub const F_FREEZE_FS: c_int = 53;
3250pub const F_THAW_FS: c_int = 54;
3251pub const F_GLOBAL_NOCACHE: c_int = 55;
3252pub const F_NODIRECT: c_int = 62;
3253pub const F_LOG2PHYS_EXT: c_int = 65;
3254pub const F_BARRIERFSYNC: c_int = 85;
3255pub const F_OFD_SETLK: c_int = 90; pub const F_OFD_SETLKW: c_int = 91; pub const F_OFD_GETLK: c_int = 92; pub const F_PUNCHHOLE: c_int = 99;
3260pub const F_TRIM_ACTIVE_FILE: c_int = 100;
3261pub const F_SPECULATIVE_READ: c_int = 101;
3262pub const F_GETPATH_NOFIRMLINK: c_int = 102;
3263pub const F_TRANSFEREXTENTS: c_int = 110;
3264
3265pub const F_ALLOCATECONTIG: c_uint = 0x02;
3266pub const F_ALLOCATEALL: c_uint = 0x04;
3267pub const F_ALLOCATEPERSIST: c_uint = 0x08;
3268
3269pub const F_PEOFPOSMODE: c_int = 3;
3270pub const F_VOLPOSMODE: c_int = 4;
3271
3272pub const AT_FDCWD: c_int = -2;
3273pub const AT_EACCESS: c_int = 0x0010;
3274pub const AT_SYMLINK_NOFOLLOW: c_int = 0x0020;
3275pub const AT_SYMLINK_FOLLOW: c_int = 0x0040;
3276pub const AT_REMOVEDIR: c_int = 0x0080;
3277
3278pub const PTHREAD_INTROSPECTION_THREAD_CREATE: c_uint = 1;
3279pub const PTHREAD_INTROSPECTION_THREAD_START: c_uint = 2;
3280pub const PTHREAD_INTROSPECTION_THREAD_TERMINATE: c_uint = 3;
3281pub const PTHREAD_INTROSPECTION_THREAD_DESTROY: c_uint = 4;
3282
3283pub const TIOCMODG: c_ulong = 0x40047403;
3284pub const TIOCMODS: c_ulong = 0x80047404;
3285pub const TIOCM_LE: c_int = 0x1;
3286pub const TIOCM_DTR: c_int = 0x2;
3287pub const TIOCM_RTS: c_int = 0x4;
3288pub const TIOCM_ST: c_int = 0x8;
3289pub const TIOCM_SR: c_int = 0x10;
3290pub const TIOCM_CTS: c_int = 0x20;
3291pub const TIOCM_CAR: c_int = 0x40;
3292pub const TIOCM_CD: c_int = 0x40;
3293pub const TIOCM_RNG: c_int = 0x80;
3294pub const TIOCM_RI: c_int = 0x80;
3295pub const TIOCM_DSR: c_int = 0x100;
3296pub const TIOCEXCL: c_int = 0x2000740d;
3297pub const TIOCNXCL: c_int = 0x2000740e;
3298pub const TIOCFLUSH: c_ulong = 0x80047410;
3299pub const TIOCGETD: c_ulong = 0x4004741a;
3300pub const TIOCSETD: c_ulong = 0x8004741b;
3301pub const TIOCIXON: c_uint = 0x20007481;
3302pub const TIOCIXOFF: c_uint = 0x20007480;
3303pub const TIOCSDTR: c_uint = 0x20007479;
3304pub const TIOCCDTR: c_uint = 0x20007478;
3305pub const TIOCGPGRP: c_ulong = 0x40047477;
3306pub const TIOCSPGRP: c_ulong = 0x80047476;
3307pub const TIOCOUTQ: c_ulong = 0x40047473;
3308pub const TIOCSTI: c_ulong = 0x80017472;
3309pub const TIOCNOTTY: c_uint = 0x20007471;
3310pub const TIOCPKT: c_ulong = 0x80047470;
3311pub const TIOCPKT_DATA: c_int = 0x0;
3312pub const TIOCPKT_FLUSHREAD: c_int = 0x1;
3313pub const TIOCPKT_FLUSHWRITE: c_int = 0x2;
3314pub const TIOCPKT_STOP: c_int = 0x4;
3315pub const TIOCPKT_START: c_int = 0x8;
3316pub const TIOCPKT_NOSTOP: c_int = 0x10;
3317pub const TIOCPKT_DOSTOP: c_int = 0x20;
3318pub const TIOCPKT_IOCTL: c_int = 0x40;
3319pub const TIOCSTOP: c_uint = 0x2000746f;
3320pub const TIOCSTART: c_uint = 0x2000746e;
3321pub const TIOCMSET: c_ulong = 0x8004746d;
3322pub const TIOCMBIS: c_ulong = 0x8004746c;
3323pub const TIOCMBIC: c_ulong = 0x8004746b;
3324pub const TIOCMGET: c_ulong = 0x4004746a;
3325pub const TIOCREMOTE: c_ulong = 0x80047469;
3326pub const TIOCGWINSZ: c_ulong = 0x40087468;
3327pub const TIOCSWINSZ: c_ulong = 0x80087467;
3328pub const TIOCUCNTL: c_ulong = 0x80047466;
3329pub const TIOCSTAT: c_uint = 0x20007465;
3330pub const TIOCSCONS: c_uint = 0x20007463;
3331pub const TIOCCONS: c_ulong = 0x80047462;
3332pub const TIOCSCTTY: c_uint = 0x20007461;
3333pub const TIOCEXT: c_ulong = 0x80047460;
3334pub const TIOCSIG: c_uint = 0x2000745f;
3335pub const TIOCDRAIN: c_uint = 0x2000745e;
3336pub const TIOCMSDTRWAIT: c_ulong = 0x8004745b;
3337pub const TIOCMGDTRWAIT: c_ulong = 0x4004745a;
3338pub const TIOCSDRAINWAIT: c_ulong = 0x80047457;
3339pub const TIOCGDRAINWAIT: c_ulong = 0x40047456;
3340pub const TIOCDSIMICROCODE: c_uint = 0x20007455;
3341pub const TIOCPTYGRANT: c_uint = 0x20007454;
3342pub const TIOCPTYGNAME: c_uint = 0x40807453;
3343pub const TIOCPTYUNLK: c_uint = 0x20007452;
3344
3345pub const BIOCGRSIG: c_ulong = 0x40044272;
3346pub const BIOCSRSIG: c_ulong = 0x80044273;
3347pub const BIOCSDLT: c_ulong = 0x80044278;
3348pub const BIOCGSEESENT: c_ulong = 0x40044276;
3349pub const BIOCSSEESENT: c_ulong = 0x80044277;
3350pub const BIOCGDLTLIST: c_ulong = 0xc00c4279;
3351
3352pub const FIODTYPE: c_ulong = 0x4004667a;
3353
3354pub const B0: speed_t = 0;
3355pub const B50: speed_t = 50;
3356pub const B75: speed_t = 75;
3357pub const B110: speed_t = 110;
3358pub const B134: speed_t = 134;
3359pub const B150: speed_t = 150;
3360pub const B200: speed_t = 200;
3361pub const B300: speed_t = 300;
3362pub const B600: speed_t = 600;
3363pub const B1200: speed_t = 1200;
3364pub const B1800: speed_t = 1800;
3365pub const B2400: speed_t = 2400;
3366pub const B4800: speed_t = 4800;
3367pub const B9600: speed_t = 9600;
3368pub const B19200: speed_t = 19200;
3369pub const B38400: speed_t = 38400;
3370pub const B7200: speed_t = 7200;
3371pub const B14400: speed_t = 14400;
3372pub const B28800: speed_t = 28800;
3373pub const B57600: speed_t = 57600;
3374pub const B76800: speed_t = 76800;
3375pub const B115200: speed_t = 115200;
3376pub const B230400: speed_t = 230400;
3377pub const EXTA: speed_t = 19200;
3378pub const EXTB: speed_t = 38400;
3379
3380pub const SIGTRAP: c_int = 5;
3381
3382pub const GLOB_APPEND: c_int = 0x0001;
3383pub const GLOB_DOOFFS: c_int = 0x0002;
3384pub const GLOB_ERR: c_int = 0x0004;
3385pub const GLOB_MARK: c_int = 0x0008;
3386pub const GLOB_NOCHECK: c_int = 0x0010;
3387pub const GLOB_NOSORT: c_int = 0x0020;
3388pub const GLOB_NOESCAPE: c_int = 0x2000;
3389
3390pub const GLOB_NOSPACE: c_int = -1;
3391pub const GLOB_ABORTED: c_int = -2;
3392pub const GLOB_NOMATCH: c_int = -3;
3393
3394pub const POSIX_MADV_NORMAL: c_int = 0;
3395pub const POSIX_MADV_RANDOM: c_int = 1;
3396pub const POSIX_MADV_SEQUENTIAL: c_int = 2;
3397pub const POSIX_MADV_WILLNEED: c_int = 3;
3398pub const POSIX_MADV_DONTNEED: c_int = 4;
3399
3400pub const _SC_IOV_MAX: c_int = 56;
3401pub const _SC_GETGR_R_SIZE_MAX: c_int = 70;
3402pub const _SC_GETPW_R_SIZE_MAX: c_int = 71;
3403pub const _SC_LOGIN_NAME_MAX: c_int = 73;
3404pub const _SC_MQ_PRIO_MAX: c_int = 75;
3405pub const _SC_THREAD_ATTR_STACKADDR: c_int = 82;
3406pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 83;
3407pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 85;
3408pub const _SC_THREAD_KEYS_MAX: c_int = 86;
3409pub const _SC_THREAD_PRIO_INHERIT: c_int = 87;
3410pub const _SC_THREAD_PRIO_PROTECT: c_int = 88;
3411pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 89;
3412pub const _SC_THREAD_PROCESS_SHARED: c_int = 90;
3413pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 91;
3414pub const _SC_THREAD_STACK_MIN: c_int = 93;
3415pub const _SC_THREAD_THREADS_MAX: c_int = 94;
3416pub const _SC_THREADS: c_int = 96;
3417pub const _SC_TTY_NAME_MAX: c_int = 101;
3418pub const _SC_ATEXIT_MAX: c_int = 107;
3419pub const _SC_XOPEN_CRYPT: c_int = 108;
3420pub const _SC_XOPEN_ENH_I18N: c_int = 109;
3421pub const _SC_XOPEN_LEGACY: c_int = 110;
3422pub const _SC_XOPEN_REALTIME: c_int = 111;
3423pub const _SC_XOPEN_REALTIME_THREADS: c_int = 112;
3424pub const _SC_XOPEN_SHM: c_int = 113;
3425pub const _SC_XOPEN_UNIX: c_int = 115;
3426pub const _SC_XOPEN_VERSION: c_int = 116;
3427pub const _SC_XOPEN_XCU_VERSION: c_int = 121;
3428pub const _SC_PHYS_PAGES: c_int = 200;
3429
3430pub const PTHREAD_PROCESS_PRIVATE: c_int = 2;
3431pub const PTHREAD_PROCESS_SHARED: c_int = 1;
3432pub const PTHREAD_CREATE_JOINABLE: c_int = 1;
3433pub const PTHREAD_CREATE_DETACHED: c_int = 2;
3434pub const PTHREAD_INHERIT_SCHED: c_int = 1;
3435pub const PTHREAD_EXPLICIT_SCHED: c_int = 2;
3436pub const PTHREAD_CANCEL_ENABLE: c_int = 0x01;
3437pub const PTHREAD_CANCEL_DISABLE: c_int = 0x00;
3438pub const PTHREAD_CANCEL_DEFERRED: c_int = 0x02;
3439pub const PTHREAD_CANCEL_ASYNCHRONOUS: c_int = 0x00;
3440pub const PTHREAD_CANCELED: *mut c_void = 1 as *mut c_void;
3441pub const PTHREAD_SCOPE_SYSTEM: c_int = 1;
3442pub const PTHREAD_SCOPE_PROCESS: c_int = 2;
3443pub const PTHREAD_PRIO_NONE: c_int = 0;
3444pub const PTHREAD_PRIO_INHERIT: c_int = 1;
3445pub const PTHREAD_PRIO_PROTECT: c_int = 2;
3446
3447#[cfg(target_arch = "aarch64")]
3448pub const PTHREAD_STACK_MIN: size_t = 16384;
3449#[cfg(not(target_arch = "aarch64"))]
3450pub const PTHREAD_STACK_MIN: size_t = 8192;
3451
3452pub const RLIMIT_CPU: c_int = 0;
3453pub const RLIMIT_FSIZE: c_int = 1;
3454pub const RLIMIT_DATA: c_int = 2;
3455pub const RLIMIT_STACK: c_int = 3;
3456pub const RLIMIT_CORE: c_int = 4;
3457pub const RLIMIT_AS: c_int = 5;
3458pub const RLIMIT_RSS: c_int = RLIMIT_AS;
3459pub const RLIMIT_MEMLOCK: c_int = 6;
3460pub const RLIMIT_NPROC: c_int = 7;
3461pub const RLIMIT_NOFILE: c_int = 8;
3462#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
3463pub const RLIM_NLIMITS: c_int = 9;
3464pub const _RLIMIT_POSIX_FLAG: c_int = 0x1000;
3465
3466pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
3467
3468pub const RUSAGE_SELF: c_int = 0;
3469pub const RUSAGE_CHILDREN: c_int = -1;
3470
3471pub const MADV_NORMAL: c_int = 0;
3472pub const MADV_RANDOM: c_int = 1;
3473pub const MADV_SEQUENTIAL: c_int = 2;
3474pub const MADV_WILLNEED: c_int = 3;
3475pub const MADV_DONTNEED: c_int = 4;
3476pub const MADV_FREE: c_int = 5;
3477pub const MADV_ZERO_WIRED_PAGES: c_int = 6;
3478pub const MADV_FREE_REUSABLE: c_int = 7;
3479pub const MADV_FREE_REUSE: c_int = 8;
3480pub const MADV_CAN_REUSE: c_int = 9;
3481
3482pub const MINCORE_INCORE: c_int = 0x1;
3483pub const MINCORE_REFERENCED: c_int = 0x2;
3484pub const MINCORE_MODIFIED: c_int = 0x4;
3485pub const MINCORE_REFERENCED_OTHER: c_int = 0x8;
3486pub const MINCORE_MODIFIED_OTHER: c_int = 0x10;
3487
3488pub const CTLIOCGINFO: c_ulong = 0xc0644e03;
3489
3490pub const IPPROTO_HOPOPTS: c_int = 0;
3498pub const IPPROTO_IGMP: c_int = 2;
3501pub const IPPROTO_GGP: c_int = 3;
3503pub const IPPROTO_IPIP: c_int = 4;
3505pub const IPPROTO_ST: c_int = 7;
3508pub const IPPROTO_EGP: c_int = 8;
3510pub const IPPROTO_PIGP: c_int = 9;
3512pub const IPPROTO_RCCMON: c_int = 10;
3514pub const IPPROTO_NVPII: c_int = 11;
3516pub const IPPROTO_PUP: c_int = 12;
3518pub const IPPROTO_ARGUS: c_int = 13;
3520pub const IPPROTO_EMCON: c_int = 14;
3522pub const IPPROTO_XNET: c_int = 15;
3524pub const IPPROTO_CHAOS: c_int = 16;
3526pub const IPPROTO_MUX: c_int = 18;
3529pub const IPPROTO_MEAS: c_int = 19;
3531pub const IPPROTO_HMP: c_int = 20;
3533pub const IPPROTO_PRM: c_int = 21;
3535pub const IPPROTO_IDP: c_int = 22;
3537pub const IPPROTO_TRUNK1: c_int = 23;
3539pub const IPPROTO_TRUNK2: c_int = 24;
3541pub const IPPROTO_LEAF1: c_int = 25;
3543pub const IPPROTO_LEAF2: c_int = 26;
3545pub const IPPROTO_RDP: c_int = 27;
3547pub const IPPROTO_IRTP: c_int = 28;
3549pub const IPPROTO_TP: c_int = 29;
3551pub const IPPROTO_BLT: c_int = 30;
3553pub const IPPROTO_NSP: c_int = 31;
3555pub const IPPROTO_INP: c_int = 32;
3557pub const IPPROTO_SEP: c_int = 33;
3559pub const IPPROTO_3PC: c_int = 34;
3561pub const IPPROTO_IDPR: c_int = 35;
3563pub const IPPROTO_XTP: c_int = 36;
3565pub const IPPROTO_DDP: c_int = 37;
3567pub const IPPROTO_CMTP: c_int = 38;
3569pub const IPPROTO_TPXX: c_int = 39;
3571pub const IPPROTO_IL: c_int = 40;
3573pub const IPPROTO_SDRP: c_int = 42;
3576pub const IPPROTO_ROUTING: c_int = 43;
3578pub const IPPROTO_FRAGMENT: c_int = 44;
3580pub const IPPROTO_IDRP: c_int = 45;
3582pub const IPPROTO_RSVP: c_int = 46;
3584pub const IPPROTO_GRE: c_int = 47;
3586pub const IPPROTO_MHRP: c_int = 48;
3588pub const IPPROTO_BHA: c_int = 49;
3590pub const IPPROTO_ESP: c_int = 50;
3592pub const IPPROTO_AH: c_int = 51;
3594pub const IPPROTO_INLSP: c_int = 52;
3596pub const IPPROTO_SWIPE: c_int = 53;
3598pub const IPPROTO_NHRP: c_int = 54;
3600pub const IPPROTO_NONE: c_int = 59;
3604pub const IPPROTO_DSTOPTS: c_int = 60;
3606pub const IPPROTO_AHIP: c_int = 61;
3608pub const IPPROTO_CFTP: c_int = 62;
3610pub const IPPROTO_HELLO: c_int = 63;
3612pub const IPPROTO_SATEXPAK: c_int = 64;
3614pub const IPPROTO_KRYPTOLAN: c_int = 65;
3616pub const IPPROTO_RVD: c_int = 66;
3618pub const IPPROTO_IPPC: c_int = 67;
3620pub const IPPROTO_ADFS: c_int = 68;
3622pub const IPPROTO_SATMON: c_int = 69;
3624pub const IPPROTO_VISA: c_int = 70;
3626pub const IPPROTO_IPCV: c_int = 71;
3628pub const IPPROTO_CPNX: c_int = 72;
3630pub const IPPROTO_CPHB: c_int = 73;
3632pub const IPPROTO_WSN: c_int = 74;
3634pub const IPPROTO_PVP: c_int = 75;
3636pub const IPPROTO_BRSATMON: c_int = 76;
3638pub const IPPROTO_ND: c_int = 77;
3640pub const IPPROTO_WBMON: c_int = 78;
3642pub const IPPROTO_WBEXPAK: c_int = 79;
3644pub const IPPROTO_EON: c_int = 80;
3646pub const IPPROTO_VMTP: c_int = 81;
3648pub const IPPROTO_SVMTP: c_int = 82;
3650pub const IPPROTO_VINES: c_int = 83;
3652pub const IPPROTO_TTP: c_int = 84;
3654pub const IPPROTO_IGP: c_int = 85;
3656pub const IPPROTO_DGP: c_int = 86;
3658pub const IPPROTO_TCF: c_int = 87;
3660pub const IPPROTO_IGRP: c_int = 88;
3662pub const IPPROTO_OSPFIGP: c_int = 89;
3664pub const IPPROTO_SRPC: c_int = 90;
3666pub const IPPROTO_LARP: c_int = 91;
3668pub const IPPROTO_MTP: c_int = 92;
3670pub const IPPROTO_AX25: c_int = 93;
3672pub const IPPROTO_IPEIP: c_int = 94;
3674pub const IPPROTO_MICP: c_int = 95;
3676pub const IPPROTO_SCCSP: c_int = 96;
3678pub const IPPROTO_ETHERIP: c_int = 97;
3680pub const IPPROTO_ENCAP: c_int = 98;
3682pub const IPPROTO_APES: c_int = 99;
3684pub const IPPROTO_GMTP: c_int = 100;
3686
3687pub const IPPROTO_PIM: c_int = 103;
3690pub const IPPROTO_IPCOMP: c_int = 108;
3692pub const IPPROTO_PGM: c_int = 113;
3694pub const IPPROTO_SCTP: c_int = 132;
3696
3697pub const IPPROTO_DIVERT: c_int = 254;
3701pub const IPPROTO_RAW: c_int = 255;
3703pub const IPPROTO_MAX: c_int = 256;
3704pub const IPPROTO_DONE: c_int = 257;
3706
3707pub const AF_UNSPEC: c_int = 0;
3708pub const AF_LOCAL: c_int = 1;
3709pub const AF_UNIX: c_int = AF_LOCAL;
3710pub const AF_INET: c_int = 2;
3711pub const AF_IMPLINK: c_int = 3;
3712pub const AF_PUP: c_int = 4;
3713pub const AF_CHAOS: c_int = 5;
3714pub const AF_NS: c_int = 6;
3715pub const AF_ISO: c_int = 7;
3716pub const AF_OSI: c_int = AF_ISO;
3717pub const AF_ECMA: c_int = 8;
3718pub const AF_DATAKIT: c_int = 9;
3719pub const AF_CCITT: c_int = 10;
3720pub const AF_SNA: c_int = 11;
3721pub const AF_DECnet: c_int = 12;
3722pub const AF_DLI: c_int = 13;
3723pub const AF_LAT: c_int = 14;
3724pub const AF_HYLINK: c_int = 15;
3725pub const AF_APPLETALK: c_int = 16;
3726pub const AF_ROUTE: c_int = 17;
3727pub const AF_LINK: c_int = 18;
3728pub const pseudo_AF_XTP: c_int = 19;
3729pub const AF_COIP: c_int = 20;
3730pub const AF_CNT: c_int = 21;
3731pub const pseudo_AF_RTIP: c_int = 22;
3732pub const AF_IPX: c_int = 23;
3733pub const AF_SIP: c_int = 24;
3734pub const pseudo_AF_PIP: c_int = 25;
3735pub const AF_NDRV: c_int = 27;
3736pub const AF_ISDN: c_int = 28;
3737pub const AF_E164: c_int = AF_ISDN;
3738pub const pseudo_AF_KEY: c_int = 29;
3739pub const AF_INET6: c_int = 30;
3740pub const AF_NATM: c_int = 31;
3741pub const AF_SYSTEM: c_int = 32;
3742pub const AF_NETBIOS: c_int = 33;
3743pub const AF_PPP: c_int = 34;
3744pub const pseudo_AF_HDRCMPLT: c_int = 35;
3745pub const AF_IEEE80211: c_int = 37;
3746pub const AF_UTUN: c_int = 38;
3747pub const AF_VSOCK: c_int = 40;
3748pub const AF_SYS_CONTROL: c_int = 2;
3749
3750pub const SYSPROTO_EVENT: c_int = 1;
3751pub const SYSPROTO_CONTROL: c_int = 2;
3752
3753pub const PF_UNSPEC: c_int = AF_UNSPEC;
3754pub const PF_LOCAL: c_int = AF_LOCAL;
3755pub const PF_UNIX: c_int = PF_LOCAL;
3756pub const PF_INET: c_int = AF_INET;
3757pub const PF_IMPLINK: c_int = AF_IMPLINK;
3758pub const PF_PUP: c_int = AF_PUP;
3759pub const PF_CHAOS: c_int = AF_CHAOS;
3760pub const PF_NS: c_int = AF_NS;
3761pub const PF_ISO: c_int = AF_ISO;
3762pub const PF_OSI: c_int = AF_ISO;
3763pub const PF_ECMA: c_int = AF_ECMA;
3764pub const PF_DATAKIT: c_int = AF_DATAKIT;
3765pub const PF_CCITT: c_int = AF_CCITT;
3766pub const PF_SNA: c_int = AF_SNA;
3767pub const PF_DECnet: c_int = AF_DECnet;
3768pub const PF_DLI: c_int = AF_DLI;
3769pub const PF_LAT: c_int = AF_LAT;
3770pub const PF_HYLINK: c_int = AF_HYLINK;
3771pub const PF_APPLETALK: c_int = AF_APPLETALK;
3772pub const PF_ROUTE: c_int = AF_ROUTE;
3773pub const PF_LINK: c_int = AF_LINK;
3774pub const PF_XTP: c_int = pseudo_AF_XTP;
3775pub const PF_COIP: c_int = AF_COIP;
3776pub const PF_CNT: c_int = AF_CNT;
3777pub const PF_SIP: c_int = AF_SIP;
3778pub const PF_IPX: c_int = AF_IPX;
3779pub const PF_RTIP: c_int = pseudo_AF_RTIP;
3780pub const PF_PIP: c_int = pseudo_AF_PIP;
3781pub const PF_NDRV: c_int = AF_NDRV;
3782pub const PF_ISDN: c_int = AF_ISDN;
3783pub const PF_KEY: c_int = pseudo_AF_KEY;
3784pub const PF_INET6: c_int = AF_INET6;
3785pub const PF_NATM: c_int = AF_NATM;
3786pub const PF_SYSTEM: c_int = AF_SYSTEM;
3787pub const PF_NETBIOS: c_int = AF_NETBIOS;
3788pub const PF_PPP: c_int = AF_PPP;
3789pub const PF_VSOCK: c_int = AF_VSOCK;
3790
3791pub const NET_RT_DUMP: c_int = 1;
3792pub const NET_RT_FLAGS: c_int = 2;
3793pub const NET_RT_IFLIST: c_int = 3;
3794
3795pub const SOMAXCONN: c_int = 128;
3796
3797pub const SOCK_MAXADDRLEN: c_int = 255;
3798
3799pub const SOCK_STREAM: c_int = 1;
3800pub const SOCK_DGRAM: c_int = 2;
3801pub const SOCK_RAW: c_int = 3;
3802pub const SOCK_RDM: c_int = 4;
3803pub const SOCK_SEQPACKET: c_int = 5;
3804pub const IP_TTL: c_int = 4;
3805pub const IP_HDRINCL: c_int = 2;
3806pub const IP_RECVDSTADDR: c_int = 7;
3807pub const IP_ADD_MEMBERSHIP: c_int = 12;
3808pub const IP_DROP_MEMBERSHIP: c_int = 13;
3809pub const IP_RECVIF: c_int = 20;
3810pub const IP_RECVTTL: c_int = 24;
3811pub const IP_BOUND_IF: c_int = 25;
3812pub const IP_PKTINFO: c_int = 26;
3813pub const IP_RECVTOS: c_int = 27;
3814pub const IP_DONTFRAG: c_int = 28;
3815pub const IPV6_JOIN_GROUP: c_int = 12;
3816pub const IPV6_LEAVE_GROUP: c_int = 13;
3817pub const IPV6_CHECKSUM: c_int = 26;
3818pub const IPV6_RECVTCLASS: c_int = 35;
3819pub const IPV6_TCLASS: c_int = 36;
3820pub const IPV6_RECVHOPLIMIT: c_int = 37;
3821pub const IPV6_PKTINFO: c_int = 46;
3822pub const IPV6_HOPLIMIT: c_int = 47;
3823pub const IPV6_RECVPKTINFO: c_int = 61;
3824pub const IP_ADD_SOURCE_MEMBERSHIP: c_int = 70;
3825pub const IP_DROP_SOURCE_MEMBERSHIP: c_int = 71;
3826pub const IP_BLOCK_SOURCE: c_int = 72;
3827pub const IP_UNBLOCK_SOURCE: c_int = 73;
3828pub const IPV6_BOUND_IF: c_int = 125;
3829
3830pub const TCP_NOPUSH: c_int = 4;
3831pub const TCP_NOOPT: c_int = 8;
3832pub const TCP_KEEPALIVE: c_int = 0x10;
3833pub const TCP_KEEPINTVL: c_int = 0x101;
3834pub const TCP_KEEPCNT: c_int = 0x102;
3835pub const TCP_FASTOPEN: c_int = 0x105;
3837pub const TCP_CONNECTION_INFO: c_int = 0x106;
3838
3839pub const SOL_LOCAL: c_int = 0;
3840
3841pub const LOCAL_PEERCRED: c_int = 0x001;
3843pub const LOCAL_PEERPID: c_int = 0x002;
3845pub const LOCAL_PEEREPID: c_int = 0x003;
3847pub const LOCAL_PEERUUID: c_int = 0x004;
3849pub const LOCAL_PEEREUUID: c_int = 0x005;
3851pub const LOCAL_PEERTOKEN: c_int = 0x006;
3853
3854pub const SOL_SOCKET: c_int = 0xffff;
3855
3856pub const SO_DEBUG: c_int = 0x01;
3857pub const SO_ACCEPTCONN: c_int = 0x0002;
3858pub const SO_REUSEADDR: c_int = 0x0004;
3859pub const SO_KEEPALIVE: c_int = 0x0008;
3860pub const SO_DONTROUTE: c_int = 0x0010;
3861pub const SO_BROADCAST: c_int = 0x0020;
3862pub const SO_USELOOPBACK: c_int = 0x0040;
3863pub const SO_LINGER: c_int = 0x0080;
3864pub const SO_OOBINLINE: c_int = 0x0100;
3865pub const SO_REUSEPORT: c_int = 0x0200;
3866pub const SO_TIMESTAMP: c_int = 0x0400;
3867pub const SO_TIMESTAMP_MONOTONIC: c_int = 0x0800;
3868pub const SO_DONTTRUNC: c_int = 0x2000;
3869pub const SO_WANTMORE: c_int = 0x4000;
3870pub const SO_WANTOOBFLAG: c_int = 0x8000;
3871pub const SO_SNDBUF: c_int = 0x1001;
3872pub const SO_RCVBUF: c_int = 0x1002;
3873pub const SO_SNDLOWAT: c_int = 0x1003;
3874pub const SO_RCVLOWAT: c_int = 0x1004;
3875pub const SO_SNDTIMEO: c_int = 0x1005;
3876pub const SO_RCVTIMEO: c_int = 0x1006;
3877pub const SO_ERROR: c_int = 0x1007;
3878pub const SO_TYPE: c_int = 0x1008;
3879pub const SO_LABEL: c_int = 0x1010;
3880pub const SO_PEERLABEL: c_int = 0x1011;
3881pub const SO_NREAD: c_int = 0x1020;
3882pub const SO_NKE: c_int = 0x1021;
3883pub const SO_NOSIGPIPE: c_int = 0x1022;
3884pub const SO_NOADDRERR: c_int = 0x1023;
3885pub const SO_NWRITE: c_int = 0x1024;
3886pub const SO_REUSESHAREUID: c_int = 0x1025;
3887pub const SO_NOTIFYCONFLICT: c_int = 0x1026;
3888pub const SO_LINGER_SEC: c_int = 0x1080;
3889pub const SO_RANDOMPORT: c_int = 0x1082;
3890pub const SO_NP_EXTENSIONS: c_int = 0x1083;
3891
3892pub const MSG_OOB: c_int = 0x1;
3893pub const MSG_PEEK: c_int = 0x2;
3894pub const MSG_DONTROUTE: c_int = 0x4;
3895pub const MSG_EOR: c_int = 0x8;
3896pub const MSG_TRUNC: c_int = 0x10;
3897pub const MSG_CTRUNC: c_int = 0x20;
3898pub const MSG_WAITALL: c_int = 0x40;
3899pub const MSG_DONTWAIT: c_int = 0x80;
3900pub const MSG_EOF: c_int = 0x100;
3901pub const MSG_FLUSH: c_int = 0x400;
3902pub const MSG_HOLD: c_int = 0x800;
3903pub const MSG_SEND: c_int = 0x1000;
3904pub const MSG_HAVEMORE: c_int = 0x2000;
3905pub const MSG_RCVMORE: c_int = 0x4000;
3906pub const MSG_NEEDSA: c_int = 0x10000;
3907pub const MSG_NOSIGNAL: c_int = 0x80000;
3908
3909pub const SCM_TIMESTAMP: c_int = 0x02;
3910pub const SCM_CREDS: c_int = 0x03;
3911
3912pub const IFF_UP: c_int = 0x1; pub const IFF_BROADCAST: c_int = 0x2; pub const IFF_DEBUG: c_int = 0x4; pub const IFF_LOOPBACK: c_int = 0x8; pub const IFF_POINTOPOINT: c_int = 0x10; pub const IFF_NOTRAILERS: c_int = 0x20; pub const IFF_RUNNING: c_int = 0x40; pub const IFF_NOARP: c_int = 0x80; pub const IFF_PROMISC: c_int = 0x100; pub const IFF_ALLMULTI: c_int = 0x200; pub const IFF_OACTIVE: c_int = 0x400; pub const IFF_SIMPLEX: c_int = 0x800; pub const IFF_LINK0: c_int = 0x1000; pub const IFF_LINK1: c_int = 0x2000; pub const IFF_LINK2: c_int = 0x4000; pub const IFF_ALTPHYS: c_int = IFF_LINK2; pub const IFF_MULTICAST: c_int = 0x8000; pub const SCOPE6_ID_MAX: size_t = 16;
3932
3933pub const SHUT_RD: c_int = 0;
3934pub const SHUT_WR: c_int = 1;
3935pub const SHUT_RDWR: c_int = 2;
3936
3937pub const SAE_ASSOCID_ANY: crate::sae_associd_t = 0;
3938pub const SAE_ASSOCID_ALL: crate::sae_associd_t = 0xffffffff;
3940
3941pub const SAE_CONNID_ANY: crate::sae_connid_t = 0;
3942pub const SAE_CONNID_ALL: crate::sae_connid_t = 0xffffffff;
3944
3945pub const CONNECT_RESUME_ON_READ_WRITE: c_uint = 0x1;
3949pub const CONNECT_DATA_IDEMPOTENT: c_uint = 0x2;
3951pub const CONNECT_DATA_AUTHENTICATED: c_uint = 0x4;
3953
3954pub const LOCK_SH: c_int = 1;
3955pub const LOCK_EX: c_int = 2;
3956pub const LOCK_NB: c_int = 4;
3957pub const LOCK_UN: c_int = 8;
3958
3959pub const MAP_COPY: c_int = 0x0002;
3960pub const MAP_RENAME: c_int = 0x0020;
3961pub const MAP_NORESERVE: c_int = 0x0040;
3962pub const MAP_NOEXTEND: c_int = 0x0100;
3963pub const MAP_HASSEMAPHORE: c_int = 0x0200;
3964pub const MAP_NOCACHE: c_int = 0x0400;
3965pub const MAP_JIT: c_int = 0x0800;
3966
3967pub const _SC_ARG_MAX: c_int = 1;
3968pub const _SC_CHILD_MAX: c_int = 2;
3969pub const _SC_CLK_TCK: c_int = 3;
3970pub const _SC_NGROUPS_MAX: c_int = 4;
3971pub const _SC_OPEN_MAX: c_int = 5;
3972pub const _SC_JOB_CONTROL: c_int = 6;
3973pub const _SC_SAVED_IDS: c_int = 7;
3974pub const _SC_VERSION: c_int = 8;
3975pub const _SC_BC_BASE_MAX: c_int = 9;
3976pub const _SC_BC_DIM_MAX: c_int = 10;
3977pub const _SC_BC_SCALE_MAX: c_int = 11;
3978pub const _SC_BC_STRING_MAX: c_int = 12;
3979pub const _SC_COLL_WEIGHTS_MAX: c_int = 13;
3980pub const _SC_EXPR_NEST_MAX: c_int = 14;
3981pub const _SC_LINE_MAX: c_int = 15;
3982pub const _SC_RE_DUP_MAX: c_int = 16;
3983pub const _SC_2_VERSION: c_int = 17;
3984pub const _SC_2_C_BIND: c_int = 18;
3985pub const _SC_2_C_DEV: c_int = 19;
3986pub const _SC_2_CHAR_TERM: c_int = 20;
3987pub const _SC_2_FORT_DEV: c_int = 21;
3988pub const _SC_2_FORT_RUN: c_int = 22;
3989pub const _SC_2_LOCALEDEF: c_int = 23;
3990pub const _SC_2_SW_DEV: c_int = 24;
3991pub const _SC_2_UPE: c_int = 25;
3992pub const _SC_STREAM_MAX: c_int = 26;
3993pub const _SC_TZNAME_MAX: c_int = 27;
3994pub const _SC_ASYNCHRONOUS_IO: c_int = 28;
3995pub const _SC_PAGESIZE: c_int = 29;
3996pub const _SC_MEMLOCK: c_int = 30;
3997pub const _SC_MEMLOCK_RANGE: c_int = 31;
3998pub const _SC_MEMORY_PROTECTION: c_int = 32;
3999pub const _SC_MESSAGE_PASSING: c_int = 33;
4000pub const _SC_PRIORITIZED_IO: c_int = 34;
4001pub const _SC_PRIORITY_SCHEDULING: c_int = 35;
4002pub const _SC_REALTIME_SIGNALS: c_int = 36;
4003pub const _SC_SEMAPHORES: c_int = 37;
4004pub const _SC_FSYNC: c_int = 38;
4005pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 39;
4006pub const _SC_SYNCHRONIZED_IO: c_int = 40;
4007pub const _SC_TIMERS: c_int = 41;
4008pub const _SC_AIO_LISTIO_MAX: c_int = 42;
4009pub const _SC_AIO_MAX: c_int = 43;
4010pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 44;
4011pub const _SC_DELAYTIMER_MAX: c_int = 45;
4012pub const _SC_MQ_OPEN_MAX: c_int = 46;
4013pub const _SC_MAPPED_FILES: c_int = 47;
4014pub const _SC_RTSIG_MAX: c_int = 48;
4015pub const _SC_SEM_NSEMS_MAX: c_int = 49;
4016pub const _SC_SEM_VALUE_MAX: c_int = 50;
4017pub const _SC_SIGQUEUE_MAX: c_int = 51;
4018pub const _SC_TIMER_MAX: c_int = 52;
4019pub const _SC_NPROCESSORS_CONF: c_int = 57;
4020pub const _SC_NPROCESSORS_ONLN: c_int = 58;
4021pub const _SC_2_PBS: c_int = 59;
4022pub const _SC_2_PBS_ACCOUNTING: c_int = 60;
4023pub const _SC_2_PBS_CHECKPOINT: c_int = 61;
4024pub const _SC_2_PBS_LOCATE: c_int = 62;
4025pub const _SC_2_PBS_MESSAGE: c_int = 63;
4026pub const _SC_2_PBS_TRACK: c_int = 64;
4027pub const _SC_ADVISORY_INFO: c_int = 65;
4028pub const _SC_BARRIERS: c_int = 66;
4029pub const _SC_CLOCK_SELECTION: c_int = 67;
4030pub const _SC_CPUTIME: c_int = 68;
4031pub const _SC_FILE_LOCKING: c_int = 69;
4032pub const _SC_HOST_NAME_MAX: c_int = 72;
4033pub const _SC_MONOTONIC_CLOCK: c_int = 74;
4034pub const _SC_READER_WRITER_LOCKS: c_int = 76;
4035pub const _SC_REGEXP: c_int = 77;
4036pub const _SC_SHELL: c_int = 78;
4037pub const _SC_SPAWN: c_int = 79;
4038pub const _SC_SPIN_LOCKS: c_int = 80;
4039pub const _SC_SPORADIC_SERVER: c_int = 81;
4040pub const _SC_THREAD_CPUTIME: c_int = 84;
4041pub const _SC_THREAD_SPORADIC_SERVER: c_int = 92;
4042pub const _SC_TIMEOUTS: c_int = 95;
4043pub const _SC_TRACE: c_int = 97;
4044pub const _SC_TRACE_EVENT_FILTER: c_int = 98;
4045pub const _SC_TRACE_INHERIT: c_int = 99;
4046pub const _SC_TRACE_LOG: c_int = 100;
4047pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 102;
4048pub const _SC_V6_ILP32_OFF32: c_int = 103;
4049pub const _SC_V6_ILP32_OFFBIG: c_int = 104;
4050pub const _SC_V6_LP64_OFF64: c_int = 105;
4051pub const _SC_V6_LPBIG_OFFBIG: c_int = 106;
4052pub const _SC_IPV6: c_int = 118;
4053pub const _SC_RAW_SOCKETS: c_int = 119;
4054pub const _SC_SYMLOOP_MAX: c_int = 120;
4055pub const _SC_PAGE_SIZE: c_int = _SC_PAGESIZE;
4056pub const _SC_XOPEN_STREAMS: c_int = 114;
4057pub const _SC_XBS5_ILP32_OFF32: c_int = 122;
4058pub const _SC_XBS5_ILP32_OFFBIG: c_int = 123;
4059pub const _SC_XBS5_LP64_OFF64: c_int = 124;
4060pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 125;
4061pub const _SC_SS_REPL_MAX: c_int = 126;
4062pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 127;
4063pub const _SC_TRACE_NAME_MAX: c_int = 128;
4064pub const _SC_TRACE_SYS_MAX: c_int = 129;
4065pub const _SC_TRACE_USER_EVENT_MAX: c_int = 130;
4066pub const _SC_PASS_MAX: c_int = 131;
4067pub const _CS_PATH: c_int = 1;
4069pub const _CS_DARWIN_USER_DIR: c_int = 65536;
4070pub const _CS_DARWIN_USER_TEMP_DIR: c_int = 65537;
4071pub const _CS_DARWIN_USER_CACHE_DIR: c_int = 65538;
4072
4073pub const PTHREAD_MUTEX_NORMAL: c_int = 0;
4074pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 1;
4075pub const PTHREAD_MUTEX_RECURSIVE: c_int = 2;
4076pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL;
4077pub const _PTHREAD_MUTEX_SIG_init: c_long = 0x32AAABA7;
4078pub const _PTHREAD_COND_SIG_init: c_long = 0x3CB0B1BB;
4079pub const _PTHREAD_RWLOCK_SIG_init: c_long = 0x2DA8B3B4;
4080pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
4081 __sig: _PTHREAD_MUTEX_SIG_init,
4082 __opaque: [0; __PTHREAD_MUTEX_SIZE__],
4083};
4084pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
4085 __sig: _PTHREAD_COND_SIG_init,
4086 __opaque: [0; __PTHREAD_COND_SIZE__],
4087};
4088pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
4089 __sig: _PTHREAD_RWLOCK_SIG_init,
4090 __opaque: [0; __PTHREAD_RWLOCK_SIZE__],
4091};
4092
4093pub const OS_UNFAIR_LOCK_INIT: os_unfair_lock = os_unfair_lock {
4094 _os_unfair_lock_opaque: 0,
4095};
4096
4097pub const OS_LOG_TYPE_DEFAULT: crate::os_log_type_t = 0x00;
4098pub const OS_LOG_TYPE_INFO: crate::os_log_type_t = 0x01;
4099pub const OS_LOG_TYPE_DEBUG: crate::os_log_type_t = 0x02;
4100pub const OS_LOG_TYPE_ERROR: crate::os_log_type_t = 0x10;
4101pub const OS_LOG_TYPE_FAULT: crate::os_log_type_t = 0x11;
4102
4103pub const OS_SIGNPOST_EVENT: crate::os_signpost_type_t = 0x00;
4104pub const OS_SIGNPOST_INTERVAL_BEGIN: crate::os_signpost_type_t = 0x01;
4105pub const OS_SIGNPOST_INTERVAL_END: crate::os_signpost_type_t = 0x02;
4106
4107pub const MINSIGSTKSZ: size_t = 32768;
4108pub const SIGSTKSZ: size_t = 131072;
4109
4110pub const FD_SETSIZE: usize = 1024;
4111
4112pub const ST_NOSUID: c_ulong = 2;
4113
4114pub const SCHED_OTHER: c_int = 1;
4115pub const SCHED_FIFO: c_int = 4;
4116pub const SCHED_RR: c_int = 2;
4117
4118pub const EVFILT_READ: i16 = -1;
4119pub const EVFILT_WRITE: i16 = -2;
4120pub const EVFILT_AIO: i16 = -3;
4121pub const EVFILT_VNODE: i16 = -4;
4122pub const EVFILT_PROC: i16 = -5;
4123pub const EVFILT_SIGNAL: i16 = -6;
4124pub const EVFILT_TIMER: i16 = -7;
4125pub const EVFILT_MACHPORT: i16 = -8;
4126pub const EVFILT_FS: i16 = -9;
4127pub const EVFILT_USER: i16 = -10;
4128pub const EVFILT_VM: i16 = -12;
4129
4130pub const EV_ADD: u16 = 0x1;
4131pub const EV_DELETE: u16 = 0x2;
4132pub const EV_ENABLE: u16 = 0x4;
4133pub const EV_DISABLE: u16 = 0x8;
4134pub const EV_ONESHOT: u16 = 0x10;
4135pub const EV_CLEAR: u16 = 0x20;
4136pub const EV_RECEIPT: u16 = 0x40;
4137pub const EV_DISPATCH: u16 = 0x80;
4138pub const EV_FLAG0: u16 = 0x1000;
4139pub const EV_POLL: u16 = 0x1000;
4140pub const EV_FLAG1: u16 = 0x2000;
4141pub const EV_OOBAND: u16 = 0x2000;
4142pub const EV_ERROR: u16 = 0x4000;
4143pub const EV_EOF: u16 = 0x8000;
4144pub const EV_SYSFLAGS: u16 = 0xf000;
4145
4146pub const NOTE_TRIGGER: u32 = 0x01000000;
4147pub const NOTE_FFNOP: u32 = 0x00000000;
4148pub const NOTE_FFAND: u32 = 0x40000000;
4149pub const NOTE_FFOR: u32 = 0x80000000;
4150pub const NOTE_FFCOPY: u32 = 0xc0000000;
4151pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
4152pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
4153pub const NOTE_LOWAT: u32 = 0x00000001;
4154pub const NOTE_DELETE: u32 = 0x00000001;
4155pub const NOTE_WRITE: u32 = 0x00000002;
4156pub const NOTE_EXTEND: u32 = 0x00000004;
4157pub const NOTE_ATTRIB: u32 = 0x00000008;
4158pub const NOTE_LINK: u32 = 0x00000010;
4159pub const NOTE_RENAME: u32 = 0x00000020;
4160pub const NOTE_REVOKE: u32 = 0x00000040;
4161pub const NOTE_NONE: u32 = 0x00000080;
4162pub const NOTE_EXIT: u32 = 0x80000000;
4163pub const NOTE_FORK: u32 = 0x40000000;
4164pub const NOTE_EXEC: u32 = 0x20000000;
4165#[doc(hidden)]
4166#[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")]
4167pub const NOTE_REAP: u32 = 0x10000000;
4168pub const NOTE_SIGNAL: u32 = 0x08000000;
4169pub const NOTE_EXITSTATUS: u32 = 0x04000000;
4170pub const NOTE_EXIT_DETAIL: u32 = 0x02000000;
4171pub const NOTE_PDATAMASK: u32 = 0x000fffff;
4172pub const NOTE_PCTRLMASK: u32 = 0xfff00000;
4173#[doc(hidden)]
4174#[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")]
4175pub const NOTE_EXIT_REPARENTED: u32 = 0x00080000;
4176pub const NOTE_EXIT_DETAIL_MASK: u32 = 0x00070000;
4177pub const NOTE_EXIT_DECRYPTFAIL: u32 = 0x00010000;
4178pub const NOTE_EXIT_MEMORY: u32 = 0x00020000;
4179pub const NOTE_EXIT_CSERROR: u32 = 0x00040000;
4180pub const NOTE_VM_PRESSURE: u32 = 0x80000000;
4181pub const NOTE_VM_PRESSURE_TERMINATE: u32 = 0x40000000;
4182pub const NOTE_VM_PRESSURE_SUDDEN_TERMINATE: u32 = 0x20000000;
4183pub const NOTE_VM_ERROR: u32 = 0x10000000;
4184pub const NOTE_SECONDS: u32 = 0x00000001;
4185pub const NOTE_USECONDS: u32 = 0x00000002;
4186pub const NOTE_NSECONDS: u32 = 0x00000004;
4187pub const NOTE_ABSOLUTE: u32 = 0x00000008;
4188pub const NOTE_LEEWAY: u32 = 0x00000010;
4189pub const NOTE_CRITICAL: u32 = 0x00000020;
4190pub const NOTE_BACKGROUND: u32 = 0x00000040;
4191pub const NOTE_MACH_CONTINUOUS_TIME: u32 = 0x00000080;
4192pub const NOTE_MACHTIME: u32 = 0x00000100;
4193pub const NOTE_TRACK: u32 = 0x00000001;
4194pub const NOTE_TRACKERR: u32 = 0x00000002;
4195pub const NOTE_CHILD: u32 = 0x00000004;
4196
4197pub const OCRNL: crate::tcflag_t = 0x00000010;
4198pub const ONOCR: crate::tcflag_t = 0x00000020;
4199pub const ONLRET: crate::tcflag_t = 0x00000040;
4200pub const OFILL: crate::tcflag_t = 0x00000080;
4201pub const NLDLY: crate::tcflag_t = 0x00000300;
4202pub const TABDLY: crate::tcflag_t = 0x00000c04;
4203pub const CRDLY: crate::tcflag_t = 0x00003000;
4204pub const FFDLY: crate::tcflag_t = 0x00004000;
4205pub const BSDLY: crate::tcflag_t = 0x00008000;
4206pub const VTDLY: crate::tcflag_t = 0x00010000;
4207pub const OFDEL: crate::tcflag_t = 0x00020000;
4208
4209pub const NL0: crate::tcflag_t = 0x00000000;
4210pub const NL1: crate::tcflag_t = 0x00000100;
4211pub const TAB0: crate::tcflag_t = 0x00000000;
4212pub const TAB1: crate::tcflag_t = 0x00000400;
4213pub const TAB2: crate::tcflag_t = 0x00000800;
4214pub const CR0: crate::tcflag_t = 0x00000000;
4215pub const CR1: crate::tcflag_t = 0x00001000;
4216pub const CR2: crate::tcflag_t = 0x00002000;
4217pub const CR3: crate::tcflag_t = 0x00003000;
4218pub const FF0: crate::tcflag_t = 0x00000000;
4219pub const FF1: crate::tcflag_t = 0x00004000;
4220pub const BS0: crate::tcflag_t = 0x00000000;
4221pub const BS1: crate::tcflag_t = 0x00008000;
4222pub const TAB3: crate::tcflag_t = 0x00000004;
4223pub const VT0: crate::tcflag_t = 0x00000000;
4224pub const VT1: crate::tcflag_t = 0x00010000;
4225pub const IUTF8: crate::tcflag_t = 0x00004000;
4226pub const CRTSCTS: crate::tcflag_t = 0x00030000;
4227
4228pub const NI_MAXHOST: crate::socklen_t = 1025;
4229pub const NI_MAXSERV: crate::socklen_t = 32;
4230pub const NI_NOFQDN: c_int = 0x00000001;
4231pub const NI_NUMERICHOST: c_int = 0x00000002;
4232pub const NI_NAMEREQD: c_int = 0x00000004;
4233pub const NI_NUMERICSERV: c_int = 0x00000008;
4234pub const NI_NUMERICSCOPE: c_int = 0x00000100;
4235pub const NI_DGRAM: c_int = 0x00000010;
4236
4237pub const Q_GETQUOTA: c_int = 0x300;
4238pub const Q_SETQUOTA: c_int = 0x400;
4239
4240pub const RENAME_SWAP: c_uint = 0x00000002;
4241pub const RENAME_EXCL: c_uint = 0x00000004;
4242
4243pub const RTLD_LOCAL: c_int = 0x4;
4244pub const RTLD_FIRST: c_int = 0x100;
4245pub const RTLD_NODELETE: c_int = 0x80;
4246pub const RTLD_NOLOAD: c_int = 0x10;
4247pub const RTLD_GLOBAL: c_int = 0x8;
4248pub const RTLD_MAIN_ONLY: *mut c_void = -5isize as *mut c_void;
4249
4250pub const _WSTOPPED: c_int = 0o177;
4251
4252pub const LOG_NETINFO: c_int = 12 << 3;
4253pub const LOG_REMOTEAUTH: c_int = 13 << 3;
4254pub const LOG_INSTALL: c_int = 14 << 3;
4255pub const LOG_RAS: c_int = 15 << 3;
4256pub const LOG_LAUNCHD: c_int = 24 << 3;
4257pub const LOG_NFACILITIES: c_int = 25;
4258
4259pub const CTLTYPE: c_int = 0xf;
4260pub const CTLTYPE_NODE: c_int = 1;
4261pub const CTLTYPE_INT: c_int = 2;
4262pub const CTLTYPE_STRING: c_int = 3;
4263pub const CTLTYPE_QUAD: c_int = 4;
4264pub const CTLTYPE_OPAQUE: c_int = 5;
4265pub const CTLTYPE_STRUCT: c_int = CTLTYPE_OPAQUE;
4266pub const CTLFLAG_RD: c_int = 0x80000000;
4267pub const CTLFLAG_WR: c_int = 0x40000000;
4268pub const CTLFLAG_RW: c_int = CTLFLAG_RD | CTLFLAG_WR;
4269pub const CTLFLAG_NOLOCK: c_int = 0x20000000;
4270pub const CTLFLAG_ANYBODY: c_int = 0x10000000;
4271pub const CTLFLAG_SECURE: c_int = 0x08000000;
4272pub const CTLFLAG_MASKED: c_int = 0x04000000;
4273pub const CTLFLAG_NOAUTO: c_int = 0x02000000;
4274pub const CTLFLAG_KERN: c_int = 0x01000000;
4275pub const CTLFLAG_LOCKED: c_int = 0x00800000;
4276pub const CTLFLAG_OID2: c_int = 0x00400000;
4277pub const CTL_UNSPEC: c_int = 0;
4278pub const CTL_KERN: c_int = 1;
4279pub const CTL_VM: c_int = 2;
4280pub const CTL_VFS: c_int = 3;
4281pub const CTL_NET: c_int = 4;
4282pub const CTL_DEBUG: c_int = 5;
4283pub const CTL_HW: c_int = 6;
4284pub const CTL_MACHDEP: c_int = 7;
4285pub const CTL_USER: c_int = 8;
4286pub const CTL_MAXID: c_int = 9;
4287pub const KERN_OSTYPE: c_int = 1;
4288pub const KERN_OSRELEASE: c_int = 2;
4289pub const KERN_OSREV: c_int = 3;
4290pub const KERN_VERSION: c_int = 4;
4291pub const KERN_MAXVNODES: c_int = 5;
4292pub const KERN_MAXPROC: c_int = 6;
4293pub const KERN_MAXFILES: c_int = 7;
4294pub const KERN_ARGMAX: c_int = 8;
4295pub const KERN_SECURELVL: c_int = 9;
4296pub const KERN_HOSTNAME: c_int = 10;
4297pub const KERN_HOSTID: c_int = 11;
4298pub const KERN_CLOCKRATE: c_int = 12;
4299pub const KERN_VNODE: c_int = 13;
4300pub const KERN_PROC: c_int = 14;
4301pub const KERN_FILE: c_int = 15;
4302pub const KERN_PROF: c_int = 16;
4303pub const KERN_POSIX1: c_int = 17;
4304pub const KERN_NGROUPS: c_int = 18;
4305pub const KERN_JOB_CONTROL: c_int = 19;
4306pub const KERN_SAVED_IDS: c_int = 20;
4307pub const KERN_BOOTTIME: c_int = 21;
4308pub const KERN_NISDOMAINNAME: c_int = 22;
4309pub const KERN_DOMAINNAME: c_int = KERN_NISDOMAINNAME;
4310pub const KERN_MAXPARTITIONS: c_int = 23;
4311pub const KERN_KDEBUG: c_int = 24;
4312pub const KERN_UPDATEINTERVAL: c_int = 25;
4313pub const KERN_OSRELDATE: c_int = 26;
4314pub const KERN_NTP_PLL: c_int = 27;
4315pub const KERN_BOOTFILE: c_int = 28;
4316pub const KERN_MAXFILESPERPROC: c_int = 29;
4317pub const KERN_MAXPROCPERUID: c_int = 30;
4318pub const KERN_DUMPDEV: c_int = 31;
4319pub const KERN_IPC: c_int = 32;
4320pub const KERN_DUMMY: c_int = 33;
4321pub const KERN_PS_STRINGS: c_int = 34;
4322pub const KERN_USRSTACK32: c_int = 35;
4323pub const KERN_LOGSIGEXIT: c_int = 36;
4324pub const KERN_SYMFILE: c_int = 37;
4325pub const KERN_PROCARGS: c_int = 38;
4326pub const KERN_NETBOOT: c_int = 40;
4327pub const KERN_SYSV: c_int = 42;
4328pub const KERN_AFFINITY: c_int = 43;
4329pub const KERN_TRANSLATE: c_int = 44;
4330pub const KERN_CLASSIC: c_int = KERN_TRANSLATE;
4331pub const KERN_EXEC: c_int = 45;
4332pub const KERN_CLASSICHANDLER: c_int = KERN_EXEC;
4333pub const KERN_AIOMAX: c_int = 46;
4334pub const KERN_AIOPROCMAX: c_int = 47;
4335pub const KERN_AIOTHREADS: c_int = 48;
4336pub const KERN_COREFILE: c_int = 50;
4337pub const KERN_COREDUMP: c_int = 51;
4338pub const KERN_SUGID_COREDUMP: c_int = 52;
4339pub const KERN_PROCDELAYTERM: c_int = 53;
4340pub const KERN_SHREG_PRIVATIZABLE: c_int = 54;
4341pub const KERN_LOW_PRI_WINDOW: c_int = 56;
4342pub const KERN_LOW_PRI_DELAY: c_int = 57;
4343pub const KERN_POSIX: c_int = 58;
4344pub const KERN_USRSTACK64: c_int = 59;
4345pub const KERN_NX_PROTECTION: c_int = 60;
4346pub const KERN_TFP: c_int = 61;
4347pub const KERN_PROCNAME: c_int = 62;
4348pub const KERN_THALTSTACK: c_int = 63;
4349pub const KERN_SPECULATIVE_READS: c_int = 64;
4350pub const KERN_OSVERSION: c_int = 65;
4351pub const KERN_SAFEBOOT: c_int = 66;
4352pub const KERN_RAGEVNODE: c_int = 68;
4353pub const KERN_TTY: c_int = 69;
4354pub const KERN_CHECKOPENEVT: c_int = 70;
4355pub const KERN_THREADNAME: c_int = 71;
4356pub const KERN_MAXID: c_int = 72;
4357pub const KERN_RAGE_PROC: c_int = 1;
4358pub const KERN_RAGE_THREAD: c_int = 2;
4359pub const KERN_UNRAGE_PROC: c_int = 3;
4360pub const KERN_UNRAGE_THREAD: c_int = 4;
4361pub const KERN_OPENEVT_PROC: c_int = 1;
4362pub const KERN_UNOPENEVT_PROC: c_int = 2;
4363pub const KERN_TFP_POLICY: c_int = 1;
4364pub const KERN_TFP_POLICY_DENY: c_int = 0;
4365pub const KERN_TFP_POLICY_DEFAULT: c_int = 2;
4366pub const KERN_KDEFLAGS: c_int = 1;
4367pub const KERN_KDDFLAGS: c_int = 2;
4368pub const KERN_KDENABLE: c_int = 3;
4369pub const KERN_KDSETBUF: c_int = 4;
4370pub const KERN_KDGETBUF: c_int = 5;
4371pub const KERN_KDSETUP: c_int = 6;
4372pub const KERN_KDREMOVE: c_int = 7;
4373pub const KERN_KDSETREG: c_int = 8;
4374pub const KERN_KDGETREG: c_int = 9;
4375pub const KERN_KDREADTR: c_int = 10;
4376pub const KERN_KDPIDTR: c_int = 11;
4377pub const KERN_KDTHRMAP: c_int = 12;
4378pub const KERN_KDPIDEX: c_int = 14;
4379pub const KERN_KDSETRTCDEC: c_int = 15;
4380pub const KERN_KDGETENTROPY: c_int = 16;
4381pub const KERN_KDWRITETR: c_int = 17;
4382pub const KERN_KDWRITEMAP: c_int = 18;
4383#[doc(hidden)]
4384#[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")]
4385pub const KERN_KDENABLE_BG_TRACE: c_int = 19;
4386#[doc(hidden)]
4387#[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")]
4388pub const KERN_KDDISABLE_BG_TRACE: c_int = 20;
4389pub const KERN_KDREADCURTHRMAP: c_int = 21;
4390pub const KERN_KDSET_TYPEFILTER: c_int = 22;
4391pub const KERN_KDBUFWAIT: c_int = 23;
4392pub const KERN_KDCPUMAP: c_int = 24;
4393pub const KERN_PROC_ALL: c_int = 0;
4394pub const KERN_PROC_PID: c_int = 1;
4395pub const KERN_PROC_PGRP: c_int = 2;
4396pub const KERN_PROC_SESSION: c_int = 3;
4397pub const KERN_PROC_TTY: c_int = 4;
4398pub const KERN_PROC_UID: c_int = 5;
4399pub const KERN_PROC_RUID: c_int = 6;
4400pub const KERN_PROC_LCID: c_int = 7;
4401pub const KERN_SUCCESS: c_int = 0;
4402pub const KERN_INVALID_ADDRESS: c_int = 1;
4403pub const KERN_PROTECTION_FAILURE: c_int = 2;
4404pub const KERN_NO_SPACE: c_int = 3;
4405pub const KERN_INVALID_ARGUMENT: c_int = 4;
4406pub const KERN_FAILURE: c_int = 5;
4407pub const KERN_RESOURCE_SHORTAGE: c_int = 6;
4408pub const KERN_NOT_RECEIVER: c_int = 7;
4409pub const KERN_NO_ACCESS: c_int = 8;
4410pub const KERN_MEMORY_FAILURE: c_int = 9;
4411pub const KERN_MEMORY_ERROR: c_int = 10;
4412pub const KERN_ALREADY_IN_SET: c_int = 11;
4413pub const KERN_NOT_IN_SET: c_int = 12;
4414pub const KERN_NAME_EXISTS: c_int = 13;
4415pub const KERN_ABORTED: c_int = 14;
4416pub const KERN_INVALID_NAME: c_int = 15;
4417pub const KERN_INVALID_TASK: c_int = 16;
4418pub const KERN_INVALID_RIGHT: c_int = 17;
4419pub const KERN_INVALID_VALUE: c_int = 18;
4420pub const KERN_UREFS_OVERFLOW: c_int = 19;
4421pub const KERN_INVALID_CAPABILITY: c_int = 20;
4422pub const KERN_RIGHT_EXISTS: c_int = 21;
4423pub const KERN_INVALID_HOST: c_int = 22;
4424pub const KERN_MEMORY_PRESENT: c_int = 23;
4425pub const KERN_MEMORY_DATA_MOVED: c_int = 24;
4426pub const KERN_MEMORY_RESTART_COPY: c_int = 25;
4427pub const KERN_INVALID_PROCESSOR_SET: c_int = 26;
4428pub const KERN_POLICY_LIMIT: c_int = 27;
4429pub const KERN_INVALID_POLICY: c_int = 28;
4430pub const KERN_INVALID_OBJECT: c_int = 29;
4431pub const KERN_ALREADY_WAITING: c_int = 30;
4432pub const KERN_DEFAULT_SET: c_int = 31;
4433pub const KERN_EXCEPTION_PROTECTED: c_int = 32;
4434pub const KERN_INVALID_LEDGER: c_int = 33;
4435pub const KERN_INVALID_MEMORY_CONTROL: c_int = 34;
4436pub const KERN_INVALID_SECURITY: c_int = 35;
4437pub const KERN_NOT_DEPRESSED: c_int = 36;
4438pub const KERN_TERMINATED: c_int = 37;
4439pub const KERN_LOCK_SET_DESTROYED: c_int = 38;
4440pub const KERN_LOCK_UNSTABLE: c_int = 39;
4441pub const KERN_LOCK_OWNED: c_int = 40;
4442pub const KERN_LOCK_OWNED_SELF: c_int = 41;
4443pub const KERN_SEMAPHORE_DESTROYED: c_int = 42;
4444pub const KERN_RPC_SERVER_TERMINATED: c_int = 43;
4445pub const KERN_RPC_TERMINATE_ORPHAN: c_int = 44;
4446pub const KERN_RPC_CONTINUE_ORPHAN: c_int = 45;
4447pub const KERN_NOT_SUPPORTED: c_int = 46;
4448pub const KERN_NODE_DOWN: c_int = 47;
4449pub const KERN_NOT_WAITING: c_int = 48;
4450pub const KERN_OPERATION_TIMED_OUT: c_int = 49;
4451pub const KERN_CODESIGN_ERROR: c_int = 50;
4452pub const KERN_POLICY_STATIC: c_int = 51;
4453pub const KERN_INSUFFICIENT_BUFFER_SIZE: c_int = 52;
4454pub const KIPC_MAXSOCKBUF: c_int = 1;
4455pub const KIPC_SOCKBUF_WASTE: c_int = 2;
4456pub const KIPC_SOMAXCONN: c_int = 3;
4457pub const KIPC_MAX_LINKHDR: c_int = 4;
4458pub const KIPC_MAX_PROTOHDR: c_int = 5;
4459pub const KIPC_MAX_HDR: c_int = 6;
4460pub const KIPC_MAX_DATALEN: c_int = 7;
4461pub const KIPC_MBSTAT: c_int = 8;
4462pub const KIPC_NMBCLUSTERS: c_int = 9;
4463pub const KIPC_SOQLIMITCOMPAT: c_int = 10;
4464pub const VM_METER: c_int = 1;
4465pub const VM_LOADAVG: c_int = 2;
4466pub const VM_MACHFACTOR: c_int = 4;
4467pub const VM_SWAPUSAGE: c_int = 5;
4468pub const VM_MAXID: c_int = 6;
4469pub const VM_PROT_NONE: crate::vm_prot_t = 0x00;
4470pub const VM_PROT_READ: crate::vm_prot_t = 0x01;
4471pub const VM_PROT_WRITE: crate::vm_prot_t = 0x02;
4472pub const VM_PROT_EXECUTE: crate::vm_prot_t = 0x04;
4473pub const MEMORY_OBJECT_NULL: crate::memory_object_t = 0;
4474pub const HW_MACHINE: c_int = 1;
4475pub const HW_MODEL: c_int = 2;
4476pub const HW_NCPU: c_int = 3;
4477pub const HW_BYTEORDER: c_int = 4;
4478pub const HW_PHYSMEM: c_int = 5;
4479pub const HW_USERMEM: c_int = 6;
4480pub const HW_PAGESIZE: c_int = 7;
4481pub const HW_DISKNAMES: c_int = 8;
4482pub const HW_DISKSTATS: c_int = 9;
4483pub const HW_EPOCH: c_int = 10;
4484pub const HW_FLOATINGPT: c_int = 11;
4485pub const HW_MACHINE_ARCH: c_int = 12;
4486pub const HW_VECTORUNIT: c_int = 13;
4487pub const HW_BUS_FREQ: c_int = 14;
4488pub const HW_CPU_FREQ: c_int = 15;
4489pub const HW_CACHELINE: c_int = 16;
4490pub const HW_L1ICACHESIZE: c_int = 17;
4491pub const HW_L1DCACHESIZE: c_int = 18;
4492pub const HW_L2SETTINGS: c_int = 19;
4493pub const HW_L2CACHESIZE: c_int = 20;
4494pub const HW_L3SETTINGS: c_int = 21;
4495pub const HW_L3CACHESIZE: c_int = 22;
4496pub const HW_TB_FREQ: c_int = 23;
4497pub const HW_MEMSIZE: c_int = 24;
4498pub const HW_AVAILCPU: c_int = 25;
4499pub const HW_TARGET: c_int = 26;
4500pub const HW_PRODUCT: c_int = 27;
4501pub const HW_MAXID: c_int = 28;
4502pub const USER_CS_PATH: c_int = 1;
4503pub const USER_BC_BASE_MAX: c_int = 2;
4504pub const USER_BC_DIM_MAX: c_int = 3;
4505pub const USER_BC_SCALE_MAX: c_int = 4;
4506pub const USER_BC_STRING_MAX: c_int = 5;
4507pub const USER_COLL_WEIGHTS_MAX: c_int = 6;
4508pub const USER_EXPR_NEST_MAX: c_int = 7;
4509pub const USER_LINE_MAX: c_int = 8;
4510pub const USER_RE_DUP_MAX: c_int = 9;
4511pub const USER_POSIX2_VERSION: c_int = 10;
4512pub const USER_POSIX2_C_BIND: c_int = 11;
4513pub const USER_POSIX2_C_DEV: c_int = 12;
4514pub const USER_POSIX2_CHAR_TERM: c_int = 13;
4515pub const USER_POSIX2_FORT_DEV: c_int = 14;
4516pub const USER_POSIX2_FORT_RUN: c_int = 15;
4517pub const USER_POSIX2_LOCALEDEF: c_int = 16;
4518pub const USER_POSIX2_SW_DEV: c_int = 17;
4519pub const USER_POSIX2_UPE: c_int = 18;
4520pub const USER_STREAM_MAX: c_int = 19;
4521pub const USER_TZNAME_MAX: c_int = 20;
4522pub const USER_MAXID: c_int = 21;
4523pub const CTL_DEBUG_NAME: c_int = 0;
4524pub const CTL_DEBUG_VALUE: c_int = 1;
4525pub const CTL_DEBUG_MAXID: c_int = 20;
4526
4527pub const PRIO_DARWIN_THREAD: c_int = 3;
4528pub const PRIO_DARWIN_PROCESS: c_int = 4;
4529pub const PRIO_DARWIN_BG: c_int = 0x1000;
4530pub const PRIO_DARWIN_NONUI: c_int = 0x1001;
4531
4532pub const SEM_FAILED: *mut sem_t = -1isize as *mut crate::sem_t;
4533
4534pub const AI_PASSIVE: c_int = 0x00000001;
4535pub const AI_CANONNAME: c_int = 0x00000002;
4536pub const AI_NUMERICHOST: c_int = 0x00000004;
4537pub const AI_NUMERICSERV: c_int = 0x00001000;
4538pub const AI_MASK: c_int =
4539 AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_ADDRCONFIG;
4540pub const AI_ALL: c_int = 0x00000100;
4541pub const AI_V4MAPPED_CFG: c_int = 0x00000200;
4542pub const AI_ADDRCONFIG: c_int = 0x00000400;
4543pub const AI_V4MAPPED: c_int = 0x00000800;
4544pub const AI_DEFAULT: c_int = AI_V4MAPPED_CFG | AI_ADDRCONFIG;
4545pub const AI_UNUSABLE: c_int = 0x10000000;
4546
4547pub const SIGEV_NONE: c_int = 0;
4548pub const SIGEV_SIGNAL: c_int = 1;
4549pub const SIGEV_THREAD: c_int = 3;
4550
4551pub const AIO_CANCELED: c_int = 2;
4552pub const AIO_NOTCANCELED: c_int = 4;
4553pub const AIO_ALLDONE: c_int = 1;
4554#[deprecated(
4555 since = "0.2.64",
4556 note = "Can vary at runtime. Use sysconf(3) instead"
4557)]
4558pub const AIO_LISTIO_MAX: c_int = 16;
4559pub const LIO_NOP: c_int = 0;
4560pub const LIO_WRITE: c_int = 2;
4561pub const LIO_READ: c_int = 1;
4562pub const LIO_WAIT: c_int = 2;
4563pub const LIO_NOWAIT: c_int = 1;
4564
4565pub const WEXITED: c_int = 0x00000004;
4566pub const WSTOPPED: c_int = 0x00000008;
4567pub const WCONTINUED: c_int = 0x00000010;
4568pub const WNOWAIT: c_int = 0x00000020;
4569
4570pub const P_ALL: idtype_t = 0;
4571pub const P_PID: idtype_t = 1;
4572pub const P_PGID: idtype_t = 2;
4573
4574pub const UTIME_OMIT: c_long = -2;
4575pub const UTIME_NOW: c_long = -1;
4576
4577pub const XATTR_NOFOLLOW: c_int = 0x0001;
4578pub const XATTR_CREATE: c_int = 0x0002;
4579pub const XATTR_REPLACE: c_int = 0x0004;
4580pub const XATTR_NOSECURITY: c_int = 0x0008;
4581pub const XATTR_NODEFAULT: c_int = 0x0010;
4582pub const XATTR_SHOWCOMPRESSION: c_int = 0x0020;
4583
4584pub const NET_RT_IFLIST2: c_int = 0x0006;
4585
4586pub const RTF_DELCLONE: c_int = 0x80;
4588pub const RTF_CLONING: c_int = 0x100;
4589pub const RTF_XRESOLVE: c_int = 0x200;
4590pub const RTF_LLINFO: c_int = 0x400;
4591pub const RTF_NOIFREF: c_int = 0x2000;
4592pub const RTF_PRCLONING: c_int = 0x10000;
4593pub const RTF_WASCLONED: c_int = 0x20000;
4594pub const RTF_PROTO3: c_int = 0x40000;
4595pub const RTF_PINNED: c_int = 0x100000;
4596pub const RTF_LOCAL: c_int = 0x200000;
4597pub const RTF_BROADCAST: c_int = 0x400000;
4598pub const RTF_MULTICAST: c_int = 0x800000;
4599pub const RTF_IFSCOPE: c_int = 0x1000000;
4600pub const RTF_CONDEMNED: c_int = 0x2000000;
4601pub const RTF_IFREF: c_int = 0x4000000;
4602pub const RTF_PROXY: c_int = 0x8000000;
4603pub const RTF_ROUTER: c_int = 0x10000000;
4604pub const RTF_DEAD: c_int = 0x20000000;
4605pub const RTF_GLOBAL: c_int = 0x40000000;
4606
4607pub const RTM_VERSION: c_int = 5;
4608
4609pub const RTM_LOCK: c_int = 0x8;
4611pub const RTM_OLDADD: c_int = 0x9;
4612pub const RTM_OLDDEL: c_int = 0xa;
4613pub const RTM_RESOLVE: c_int = 0xb;
4614pub const RTM_NEWADDR: c_int = 0xc;
4615pub const RTM_DELADDR: c_int = 0xd;
4616pub const RTM_IFINFO: c_int = 0xe;
4617pub const RTM_NEWMADDR: c_int = 0xf;
4618pub const RTM_DELMADDR: c_int = 0x10;
4619pub const RTM_IFINFO2: c_int = 0x12;
4620pub const RTM_NEWMADDR2: c_int = 0x13;
4621pub const RTM_GET2: c_int = 0x14;
4622
4623pub const RTV_MTU: c_int = 0x1;
4625pub const RTV_HOPCOUNT: c_int = 0x2;
4626pub const RTV_EXPIRE: c_int = 0x4;
4627pub const RTV_RPIPE: c_int = 0x8;
4628pub const RTV_SPIPE: c_int = 0x10;
4629pub const RTV_SSTHRESH: c_int = 0x20;
4630pub const RTV_RTT: c_int = 0x40;
4631pub const RTV_RTTVAR: c_int = 0x80;
4632
4633pub const RTAX_MAX: c_int = 8;
4634
4635pub const KERN_PROCARGS2: c_int = 49;
4636
4637pub const PROC_PIDTASKALLINFO: c_int = 2;
4638pub const PROC_PIDTBSDINFO: c_int = 3;
4639pub const PROC_PIDTASKINFO: c_int = 4;
4640pub const PROC_PIDTHREADINFO: c_int = 5;
4641pub const PROC_PIDVNODEPATHINFO: c_int = 9;
4642pub const PROC_PIDPATHINFO_MAXSIZE: c_int = 4096;
4643
4644pub const PROC_PIDLISTFDS: c_int = 1;
4645pub const PROC_PIDLISTFD_SIZE: c_int = size_of::<proc_fdinfo>() as c_int;
4646pub const PROX_FDTYPE_ATALK: c_int = 0;
4647pub const PROX_FDTYPE_VNODE: c_int = 1;
4648pub const PROX_FDTYPE_SOCKET: c_int = 2;
4649pub const PROX_FDTYPE_PSHM: c_int = 3;
4650pub const PROX_FDTYPE_PSEM: c_int = 4;
4651pub const PROX_FDTYPE_KQUEUE: c_int = 5;
4652pub const PROX_FDTYPE_PIPE: c_int = 6;
4653pub const PROX_FDTYPE_FSEVENTS: c_int = 7;
4654pub const PROX_FDTYPE_NETPOLICY: c_int = 9;
4655pub const PROX_FDTYPE_CHANNEL: c_int = 10;
4656pub const PROX_FDTYPE_NEXUS: c_int = 11;
4657
4658pub const PROC_CSM_ALL: c_uint = 0x0001;
4659pub const PROC_CSM_NOSMT: c_uint = 0x0002;
4660pub const PROC_CSM_TECS: c_uint = 0x0004;
4661pub const MAXCOMLEN: usize = 16;
4662pub const MAXTHREADNAMESIZE: usize = 64;
4663
4664pub const XUCRED_VERSION: c_uint = 0;
4665
4666pub const LC_SEGMENT: u32 = 0x1;
4667pub const LC_SEGMENT_64: u32 = 0x19;
4668
4669pub const MH_MAGIC: u32 = 0xfeedface;
4670pub const MH_MAGIC_64: u32 = 0xfeedfacf;
4671
4672pub const UTUN_OPT_FLAGS: c_int = 1;
4674pub const UTUN_OPT_IFNAME: c_int = 2;
4675
4676pub const DLT_NULL: c_uint = 0; pub const DLT_EN10MB: c_uint = 1; pub const DLT_EN3MB: c_uint = 2; pub const DLT_AX25: c_uint = 3; pub const DLT_PRONET: c_uint = 4; pub const DLT_CHAOS: c_uint = 5; pub const DLT_IEEE802: c_uint = 6; pub const DLT_ARCNET: c_uint = 7; pub const DLT_SLIP: c_uint = 8; pub const DLT_PPP: c_uint = 9; pub const DLT_FDDI: c_uint = 10; pub const DLT_ATM_RFC1483: c_uint = 11; pub const DLT_RAW: c_uint = 12; pub const DLT_LOOP: c_uint = 108;
4691
4692pub const BPF_ALIGNMENT: c_int = 4;
4695
4696pub const MNT_NODEV: c_int = 0x00000010;
4698pub const MNT_UNION: c_int = 0x00000020;
4699pub const MNT_CPROTECT: c_int = 0x00000080;
4700
4701pub const MNT_QUARANTINE: c_int = 0x00000400;
4703
4704pub const MNT_LOCAL: c_int = 0x00001000;
4706pub const MNT_QUOTA: c_int = 0x00002000;
4707pub const MNT_ROOTFS: c_int = 0x00004000;
4708pub const MNT_DOVOLFS: c_int = 0x00008000;
4709
4710pub const MNT_DONTBROWSE: c_int = 0x00100000;
4711pub const MNT_IGNORE_OWNERSHIP: c_int = 0x00200000;
4712pub const MNT_AUTOMOUNTED: c_int = 0x00400000;
4713pub const MNT_JOURNALED: c_int = 0x00800000;
4714pub const MNT_NOUSERXATTR: c_int = 0x01000000;
4715pub const MNT_DEFWRITE: c_int = 0x02000000;
4716pub const MNT_MULTILABEL: c_int = 0x04000000;
4717pub const MNT_NOATIME: c_int = 0x10000000;
4718pub const MNT_SNAPSHOT: c_int = 0x40000000;
4719
4720pub const MNT_NOBLOCK: c_int = 0x00020000;
4722
4723pub const POSIX_SPAWN_RESETIDS: c_int = 0x0001;
4726pub const POSIX_SPAWN_SETPGROUP: c_int = 0x0002;
4727pub const POSIX_SPAWN_SETSIGDEF: c_int = 0x0004;
4728pub const POSIX_SPAWN_SETSIGMASK: c_int = 0x0008;
4729pub const POSIX_SPAWN_SETEXEC: c_int = 0x0040;
4730pub const POSIX_SPAWN_START_SUSPENDED: c_int = 0x0080;
4731pub const POSIX_SPAWN_CLOEXEC_DEFAULT: c_int = 0x4000;
4732
4733pub const IPC_CREAT: c_int = 0x200;
4735pub const IPC_EXCL: c_int = 0x400;
4736pub const IPC_NOWAIT: c_int = 0x800;
4737pub const IPC_PRIVATE: key_t = 0;
4738
4739pub const IPC_RMID: c_int = 0;
4740pub const IPC_SET: c_int = 1;
4741pub const IPC_STAT: c_int = 2;
4742
4743pub const IPC_R: c_int = 0x100;
4744pub const IPC_W: c_int = 0x80;
4745pub const IPC_M: c_int = 0x1000;
4746
4747pub const SEM_UNDO: c_int = 0o10000;
4749
4750pub const GETNCNT: c_int = 3;
4751pub const GETPID: c_int = 4;
4752pub const GETVAL: c_int = 5;
4753pub const GETALL: c_int = 6;
4754pub const GETZCNT: c_int = 7;
4755pub const SETVAL: c_int = 8;
4756pub const SETALL: c_int = 9;
4757
4758pub const SHM_RDONLY: c_int = 0x1000;
4760pub const SHM_RND: c_int = 0x2000;
4761#[cfg(target_arch = "aarch64")]
4762pub const SHMLBA: c_int = 16 * 1024;
4763#[cfg(not(target_arch = "aarch64"))]
4764pub const SHMLBA: c_int = 4096;
4765pub const SHM_R: c_int = IPC_R;
4766pub const SHM_W: c_int = IPC_W;
4767
4768pub const UF_SETTABLE: c_uint = 0x0000ffff;
4770pub const UF_NODUMP: c_uint = 0x00000001;
4771pub const UF_IMMUTABLE: c_uint = 0x00000002;
4772pub const UF_APPEND: c_uint = 0x00000004;
4773pub const UF_OPAQUE: c_uint = 0x00000008;
4774pub const UF_COMPRESSED: c_uint = 0x00000020;
4775pub const UF_TRACKED: c_uint = 0x00000040;
4776pub const SF_SETTABLE: c_uint = 0xffff0000;
4777pub const SF_ARCHIVED: c_uint = 0x00010000;
4778pub const SF_IMMUTABLE: c_uint = 0x00020000;
4779pub const SF_APPEND: c_uint = 0x00040000;
4780pub const UF_HIDDEN: c_uint = 0x00008000;
4781
4782pub const NTP_API: c_int = 4;
4784pub const MAXPHASE: c_long = 500000000;
4785pub const MAXFREQ: c_long = 500000;
4786pub const MINSEC: c_int = 256;
4787pub const MAXSEC: c_int = 2048;
4788pub const NANOSECOND: c_long = 1000000000;
4789pub const SCALE_PPM: c_int = 65;
4790pub const MAXTC: c_int = 10;
4791pub const MOD_OFFSET: c_uint = 0x0001;
4792pub const MOD_FREQUENCY: c_uint = 0x0002;
4793pub const MOD_MAXERROR: c_uint = 0x0004;
4794pub const MOD_ESTERROR: c_uint = 0x0008;
4795pub const MOD_STATUS: c_uint = 0x0010;
4796pub const MOD_TIMECONST: c_uint = 0x0020;
4797pub const MOD_PPSMAX: c_uint = 0x0040;
4798pub const MOD_TAI: c_uint = 0x0080;
4799pub const MOD_MICRO: c_uint = 0x1000;
4800pub const MOD_NANO: c_uint = 0x2000;
4801pub const MOD_CLKB: c_uint = 0x4000;
4802pub const MOD_CLKA: c_uint = 0x8000;
4803pub const STA_PLL: c_int = 0x0001;
4804pub const STA_PPSFREQ: c_int = 0x0002;
4805pub const STA_PPSTIME: c_int = 0x0004;
4806pub const STA_FLL: c_int = 0x0008;
4807pub const STA_INS: c_int = 0x0010;
4808pub const STA_DEL: c_int = 0x0020;
4809pub const STA_UNSYNC: c_int = 0x0040;
4810pub const STA_FREQHOLD: c_int = 0x0080;
4811pub const STA_PPSSIGNAL: c_int = 0x0100;
4812pub const STA_PPSJITTER: c_int = 0x0200;
4813pub const STA_PPSWANDER: c_int = 0x0400;
4814pub const STA_PPSERROR: c_int = 0x0800;
4815pub const STA_CLOCKERR: c_int = 0x1000;
4816pub const STA_NANO: c_int = 0x2000;
4817pub const STA_MODE: c_int = 0x4000;
4818pub const STA_CLK: c_int = 0x8000;
4819pub const STA_RONLY: c_int = STA_PPSSIGNAL
4820 | STA_PPSJITTER
4821 | STA_PPSWANDER
4822 | STA_PPSERROR
4823 | STA_CLOCKERR
4824 | STA_NANO
4825 | STA_MODE
4826 | STA_CLK;
4827pub const TIME_OK: c_int = 0;
4828pub const TIME_INS: c_int = 1;
4829pub const TIME_DEL: c_int = 2;
4830pub const TIME_OOP: c_int = 3;
4831pub const TIME_WAIT: c_int = 4;
4832pub const TIME_ERROR: c_int = 5;
4833
4834pub const MNT_WAIT: c_int = 1;
4836pub const MNT_NOWAIT: c_int = 2;
4837
4838pub const THREAD_STANDARD_POLICY: c_int = 1;
4840pub const THREAD_STANDARD_POLICY_COUNT: c_int = 0;
4841pub const THREAD_EXTENDED_POLICY: c_int = 1;
4842pub const THREAD_TIME_CONSTRAINT_POLICY: c_int = 2;
4843pub const THREAD_PRECEDENCE_POLICY: c_int = 3;
4844pub const THREAD_AFFINITY_POLICY: c_int = 4;
4845pub const THREAD_AFFINITY_TAG_NULL: c_int = 0;
4846pub const THREAD_BACKGROUND_POLICY: c_int = 5;
4847pub const THREAD_BACKGROUND_POLICY_DARWIN_BG: c_int = 0x1000;
4848pub const THREAD_LATENCY_QOS_POLICY: c_int = 7;
4849pub const THREAD_THROUGHPUT_QOS_POLICY: c_int = 8;
4850
4851pub const TH_STATE_RUNNING: c_int = 1;
4853pub const TH_STATE_STOPPED: c_int = 2;
4854pub const TH_STATE_WAITING: c_int = 3;
4855pub const TH_STATE_UNINTERRUPTIBLE: c_int = 4;
4856pub const TH_STATE_HALTED: c_int = 5;
4857pub const TH_FLAGS_SWAPPED: c_int = 0x1;
4858pub const TH_FLAGS_IDLE: c_int = 0x2;
4859pub const TH_FLAGS_GLOBAL_FORCED_IDLE: c_int = 0x4;
4860pub const THREAD_BASIC_INFO: c_int = 3;
4861pub const THREAD_IDENTIFIER_INFO: c_int = 4;
4862pub const THREAD_EXTENDED_INFO: c_int = 5;
4863
4864pub const kCCSuccess: i32 = 0;
4866pub const kCCParamError: i32 = -4300;
4867pub const kCCBufferTooSmall: i32 = -4301;
4868pub const kCCMemoryFailure: i32 = -4302;
4869pub const kCCAlignmentError: i32 = -4303;
4870pub const kCCDecodeError: i32 = -4304;
4871pub const kCCUnimplemented: i32 = -4305;
4872pub const kCCOverflow: i32 = -4306;
4873pub const kCCRNGFailure: i32 = -4307;
4874pub const kCCUnspecifiedError: i32 = -4308;
4875pub const kCCCallSequenceError: i32 = -4309;
4876pub const kCCKeySizeError: i32 = -4310;
4877pub const kCCInvalidKey: i32 = -4311;
4878
4879pub const HOST_LOAD_INFO: i32 = 1;
4881pub const HOST_VM_INFO: i32 = 2;
4882pub const HOST_CPU_LOAD_INFO: i32 = 3;
4883pub const HOST_VM_INFO64: i32 = 4;
4884pub const HOST_EXTMOD_INFO64: i32 = 5;
4885pub const HOST_EXPIRED_TASK_INFO: i32 = 6;
4886
4887pub const VM_PAGE_QUERY_PAGE_PRESENT: i32 = 0x1;
4889pub const VM_PAGE_QUERY_PAGE_FICTITIOUS: i32 = 0x2;
4890pub const VM_PAGE_QUERY_PAGE_REF: i32 = 0x4;
4891pub const VM_PAGE_QUERY_PAGE_DIRTY: i32 = 0x8;
4892pub const VM_PAGE_QUERY_PAGE_PAGED_OUT: i32 = 0x10;
4893pub const VM_PAGE_QUERY_PAGE_COPIED: i32 = 0x20;
4894pub const VM_PAGE_QUERY_PAGE_SPECULATIVE: i32 = 0x40;
4895pub const VM_PAGE_QUERY_PAGE_EXTERNAL: i32 = 0x80;
4896pub const VM_PAGE_QUERY_PAGE_CS_VALIDATED: i32 = 0x100;
4897pub const VM_PAGE_QUERY_PAGE_CS_TAINTED: i32 = 0x200;
4898pub const VM_PAGE_QUERY_PAGE_CS_NX: i32 = 0x400;
4899
4900pub const TASK_THREAD_TIMES_INFO: u32 = 3;
4902pub const HOST_CPU_LOAD_INFO_COUNT: u32 = 4;
4903pub const MACH_TASK_BASIC_INFO: u32 = 20;
4904
4905pub const MACH_PORT_NULL: i32 = 0;
4906
4907pub const RUSAGE_INFO_V0: c_int = 0;
4908pub const RUSAGE_INFO_V1: c_int = 1;
4909pub const RUSAGE_INFO_V2: c_int = 2;
4910pub const RUSAGE_INFO_V3: c_int = 3;
4911pub const RUSAGE_INFO_V4: c_int = 4;
4912
4913pub const COPYFILE_ACL: crate::copyfile_flags_t = 1 << 0;
4915pub const COPYFILE_STAT: crate::copyfile_flags_t = 1 << 1;
4916pub const COPYFILE_XATTR: crate::copyfile_flags_t = 1 << 2;
4917pub const COPYFILE_DATA: crate::copyfile_flags_t = 1 << 3;
4918pub const COPYFILE_SECURITY: crate::copyfile_flags_t = COPYFILE_STAT | COPYFILE_ACL;
4919pub const COPYFILE_METADATA: crate::copyfile_flags_t = COPYFILE_SECURITY | COPYFILE_XATTR;
4920pub const COPYFILE_RECURSIVE: crate::copyfile_flags_t = 1 << 15;
4921pub const COPYFILE_CHECK: crate::copyfile_flags_t = 1 << 16;
4922pub const COPYFILE_EXCL: crate::copyfile_flags_t = 1 << 17;
4923pub const COPYFILE_NOFOLLOW_SRC: crate::copyfile_flags_t = 1 << 18;
4924pub const COPYFILE_NOFOLLOW_DST: crate::copyfile_flags_t = 1 << 19;
4925pub const COPYFILE_MOVE: crate::copyfile_flags_t = 1 << 20;
4926pub const COPYFILE_UNLINK: crate::copyfile_flags_t = 1 << 21;
4927pub const COPYFILE_NOFOLLOW: crate::copyfile_flags_t =
4928 COPYFILE_NOFOLLOW_SRC | COPYFILE_NOFOLLOW_DST;
4929pub const COPYFILE_PACK: crate::copyfile_flags_t = 1 << 22;
4930pub const COPYFILE_UNPACK: crate::copyfile_flags_t = 1 << 23;
4931pub const COPYFILE_CLONE: crate::copyfile_flags_t = 1 << 24;
4932pub const COPYFILE_CLONE_FORCE: crate::copyfile_flags_t = 1 << 25;
4933pub const COPYFILE_RUN_IN_PLACE: crate::copyfile_flags_t = 1 << 26;
4934pub const COPYFILE_DATA_SPARSE: crate::copyfile_flags_t = 1 << 27;
4935pub const COPYFILE_PRESERVE_DST_TRACKED: crate::copyfile_flags_t = 1 << 28;
4936pub const COPYFILE_VERBOSE: crate::copyfile_flags_t = 1 << 30;
4937pub const COPYFILE_RECURSE_ERROR: c_int = 0;
4938pub const COPYFILE_RECURSE_FILE: c_int = 1;
4939pub const COPYFILE_RECURSE_DIR: c_int = 2;
4940pub const COPYFILE_RECURSE_DIR_CLEANUP: c_int = 3;
4941pub const COPYFILE_COPY_DATA: c_int = 4;
4942pub const COPYFILE_COPY_XATTR: c_int = 5;
4943pub const COPYFILE_START: c_int = 1;
4944pub const COPYFILE_FINISH: c_int = 2;
4945pub const COPYFILE_ERR: c_int = 3;
4946pub const COPYFILE_PROGRESS: c_int = 4;
4947pub const COPYFILE_CONTINUE: c_int = 0;
4948pub const COPYFILE_SKIP: c_int = 1;
4949pub const COPYFILE_QUIT: c_int = 2;
4950pub const COPYFILE_STATE_SRC_FD: c_int = 1;
4951pub const COPYFILE_STATE_SRC_FILENAME: c_int = 2;
4952pub const COPYFILE_STATE_DST_FD: c_int = 3;
4953pub const COPYFILE_STATE_DST_FILENAME: c_int = 4;
4954pub const COPYFILE_STATE_QUARANTINE: c_int = 5;
4955pub const COPYFILE_STATE_STATUS_CB: c_int = 6;
4956pub const COPYFILE_STATE_STATUS_CTX: c_int = 7;
4957pub const COPYFILE_STATE_COPIED: c_int = 8;
4958pub const COPYFILE_STATE_XATTRNAME: c_int = 9;
4959pub const COPYFILE_STATE_WAS_CLONED: c_int = 10;
4960pub const COPYFILE_STATE_SRC_BSIZE: c_int = 11;
4961pub const COPYFILE_STATE_DST_BSIZE: c_int = 12;
4962pub const COPYFILE_STATE_BSIZE: c_int = 13;
4963
4964pub const ATTR_BIT_MAP_COUNT: c_ushort = 5;
4966pub const FSOPT_NOFOLLOW: u32 = 0x1;
4967pub const FSOPT_NOFOLLOW_ANY: u32 = 0x800;
4968pub const FSOPT_REPORT_FULLSIZE: u32 = 0x4;
4969pub const FSOPT_PACK_INVAL_ATTRS: u32 = 0x8;
4970pub const FSOPT_ATTR_CMN_EXTENDED: u32 = 0x20;
4971pub const FSOPT_RETURN_REALDEV: u32 = 0x200;
4972pub const ATTR_CMN_NAME: attrgroup_t = 0x00000001;
4973pub const ATTR_CMN_DEVID: attrgroup_t = 0x00000002;
4974pub const ATTR_CMN_FSID: attrgroup_t = 0x00000004;
4975pub const ATTR_CMN_OBJTYPE: attrgroup_t = 0x00000008;
4976pub const ATTR_CMN_OBJTAG: attrgroup_t = 0x00000010;
4977pub const ATTR_CMN_OBJID: attrgroup_t = 0x00000020;
4978pub const ATTR_CMN_OBJPERMANENTID: attrgroup_t = 0x00000040;
4979pub const ATTR_CMN_PAROBJID: attrgroup_t = 0x00000080;
4980pub const ATTR_CMN_SCRIPT: attrgroup_t = 0x00000100;
4981pub const ATTR_CMN_CRTIME: attrgroup_t = 0x00000200;
4982pub const ATTR_CMN_MODTIME: attrgroup_t = 0x00000400;
4983pub const ATTR_CMN_CHGTIME: attrgroup_t = 0x00000800;
4984pub const ATTR_CMN_ACCTIME: attrgroup_t = 0x00001000;
4985pub const ATTR_CMN_BKUPTIME: attrgroup_t = 0x00002000;
4986pub const ATTR_CMN_FNDRINFO: attrgroup_t = 0x00004000;
4987pub const ATTR_CMN_OWNERID: attrgroup_t = 0x00008000;
4988pub const ATTR_CMN_GRPID: attrgroup_t = 0x00010000;
4989pub const ATTR_CMN_ACCESSMASK: attrgroup_t = 0x00020000;
4990pub const ATTR_CMN_FLAGS: attrgroup_t = 0x00040000;
4991pub const ATTR_CMN_GEN_COUNT: attrgroup_t = 0x00080000;
4992pub const ATTR_CMN_DOCUMENT_ID: attrgroup_t = 0x00100000;
4993pub const ATTR_CMN_USERACCESS: attrgroup_t = 0x00200000;
4994pub const ATTR_CMN_EXTENDED_SECURITY: attrgroup_t = 0x00400000;
4995pub const ATTR_CMN_UUID: attrgroup_t = 0x00800000;
4996pub const ATTR_CMN_GRPUUID: attrgroup_t = 0x01000000;
4997pub const ATTR_CMN_FILEID: attrgroup_t = 0x02000000;
4998pub const ATTR_CMN_PARENTID: attrgroup_t = 0x04000000;
4999pub const ATTR_CMN_FULLPATH: attrgroup_t = 0x08000000;
5000pub const ATTR_CMN_ADDEDTIME: attrgroup_t = 0x10000000;
5001pub const ATTR_CMN_DATA_PROTECT_FLAGS: attrgroup_t = 0x40000000;
5002pub const ATTR_CMN_RETURNED_ATTRS: attrgroup_t = 0x80000000;
5003pub const ATTR_VOL_FSTYPE: attrgroup_t = 0x00000001;
5004pub const ATTR_VOL_SIGNATURE: attrgroup_t = 0x00000002;
5005pub const ATTR_VOL_SIZE: attrgroup_t = 0x00000004;
5006pub const ATTR_VOL_SPACEFREE: attrgroup_t = 0x00000008;
5007pub const ATTR_VOL_SPACEAVAIL: attrgroup_t = 0x00000010;
5008pub const ATTR_VOL_MINALLOCATION: attrgroup_t = 0x00000020;
5009pub const ATTR_VOL_ALLOCATIONCLUMP: attrgroup_t = 0x00000040;
5010pub const ATTR_VOL_IOBLOCKSIZE: attrgroup_t = 0x00000080;
5011pub const ATTR_VOL_OBJCOUNT: attrgroup_t = 0x00000100;
5012pub const ATTR_VOL_FILECOUNT: attrgroup_t = 0x00000200;
5013pub const ATTR_VOL_DIRCOUNT: attrgroup_t = 0x00000400;
5014pub const ATTR_VOL_MAXOBJCOUNT: attrgroup_t = 0x00000800;
5015pub const ATTR_VOL_MOUNTPOINT: attrgroup_t = 0x00001000;
5016pub const ATTR_VOL_NAME: attrgroup_t = 0x00002000;
5017pub const ATTR_VOL_MOUNTFLAGS: attrgroup_t = 0x00004000;
5018pub const ATTR_VOL_MOUNTEDDEVICE: attrgroup_t = 0x00008000;
5019pub const ATTR_VOL_ENCODINGSUSED: attrgroup_t = 0x00010000;
5020pub const ATTR_VOL_CAPABILITIES: attrgroup_t = 0x00020000;
5021pub const ATTR_VOL_UUID: attrgroup_t = 0x00040000;
5022pub const ATTR_VOL_SPACEUSED: attrgroup_t = 0x00800000;
5023pub const ATTR_VOL_QUOTA_SIZE: attrgroup_t = 0x10000000;
5024pub const ATTR_VOL_RESERVED_SIZE: attrgroup_t = 0x20000000;
5025pub const ATTR_VOL_ATTRIBUTES: attrgroup_t = 0x40000000;
5026pub const ATTR_VOL_INFO: attrgroup_t = 0x80000000;
5027pub const ATTR_DIR_LINKCOUNT: attrgroup_t = 0x00000001;
5028pub const ATTR_DIR_ENTRYCOUNT: attrgroup_t = 0x00000002;
5029pub const ATTR_DIR_MOUNTSTATUS: attrgroup_t = 0x00000004;
5030pub const ATTR_DIR_ALLOCSIZE: attrgroup_t = 0x00000008;
5031pub const ATTR_DIR_IOBLOCKSIZE: attrgroup_t = 0x00000010;
5032pub const ATTR_DIR_DATALENGTH: attrgroup_t = 0x00000020;
5033pub const ATTR_FILE_LINKCOUNT: attrgroup_t = 0x00000001;
5034pub const ATTR_FILE_TOTALSIZE: attrgroup_t = 0x00000002;
5035pub const ATTR_FILE_ALLOCSIZE: attrgroup_t = 0x00000004;
5036pub const ATTR_FILE_IOBLOCKSIZE: attrgroup_t = 0x00000008;
5037pub const ATTR_FILE_DEVTYPE: attrgroup_t = 0x00000020;
5038pub const ATTR_FILE_FORKCOUNT: attrgroup_t = 0x00000080;
5039pub const ATTR_FILE_FORKLIST: attrgroup_t = 0x00000100;
5040pub const ATTR_FILE_DATALENGTH: attrgroup_t = 0x00000200;
5041pub const ATTR_FILE_DATAALLOCSIZE: attrgroup_t = 0x00000400;
5042pub const ATTR_FILE_RSRCLENGTH: attrgroup_t = 0x00001000;
5043pub const ATTR_FILE_RSRCALLOCSIZE: attrgroup_t = 0x00002000;
5044pub const ATTR_CMNEXT_RELPATH: attrgroup_t = 0x00000004;
5045pub const ATTR_CMNEXT_PRIVATESIZE: attrgroup_t = 0x00000008;
5046pub const ATTR_CMNEXT_LINKID: attrgroup_t = 0x00000010;
5047pub const ATTR_CMNEXT_NOFIRMLINKPATH: attrgroup_t = 0x00000020;
5048pub const ATTR_CMNEXT_REALDEVID: attrgroup_t = 0x00000040;
5049pub const ATTR_CMNEXT_REALFSID: attrgroup_t = 0x00000080;
5050pub const ATTR_CMNEXT_CLONEID: attrgroup_t = 0x00000100;
5051pub const ATTR_CMNEXT_EXT_FLAGS: attrgroup_t = 0x00000200;
5052pub const ATTR_CMNEXT_RECURSIVE_GENCOUNT: attrgroup_t = 0x00000400;
5053pub const DIR_MNTSTATUS_MNTPOINT: u32 = 0x1;
5054pub const VOL_CAPABILITIES_FORMAT: usize = 0;
5055pub const VOL_CAPABILITIES_INTERFACES: usize = 1;
5056pub const VOL_CAP_FMT_PERSISTENTOBJECTIDS: attrgroup_t = 0x00000001;
5057pub const VOL_CAP_FMT_SYMBOLICLINKS: attrgroup_t = 0x00000002;
5058pub const VOL_CAP_FMT_HARDLINKS: attrgroup_t = 0x00000004;
5059pub const VOL_CAP_FMT_JOURNAL: attrgroup_t = 0x00000008;
5060pub const VOL_CAP_FMT_JOURNAL_ACTIVE: attrgroup_t = 0x00000010;
5061pub const VOL_CAP_FMT_NO_ROOT_TIMES: attrgroup_t = 0x00000020;
5062pub const VOL_CAP_FMT_SPARSE_FILES: attrgroup_t = 0x00000040;
5063pub const VOL_CAP_FMT_ZERO_RUNS: attrgroup_t = 0x00000080;
5064pub const VOL_CAP_FMT_CASE_SENSITIVE: attrgroup_t = 0x00000100;
5065pub const VOL_CAP_FMT_CASE_PRESERVING: attrgroup_t = 0x00000200;
5066pub const VOL_CAP_FMT_FAST_STATFS: attrgroup_t = 0x00000400;
5067pub const VOL_CAP_FMT_2TB_FILESIZE: attrgroup_t = 0x00000800;
5068pub const VOL_CAP_FMT_OPENDENYMODES: attrgroup_t = 0x00001000;
5069pub const VOL_CAP_FMT_HIDDEN_FILES: attrgroup_t = 0x00002000;
5070pub const VOL_CAP_FMT_PATH_FROM_ID: attrgroup_t = 0x00004000;
5071pub const VOL_CAP_FMT_NO_VOLUME_SIZES: attrgroup_t = 0x00008000;
5072pub const VOL_CAP_FMT_DECMPFS_COMPRESSION: attrgroup_t = 0x00010000;
5073pub const VOL_CAP_FMT_64BIT_OBJECT_IDS: attrgroup_t = 0x00020000;
5074pub const VOL_CAP_FMT_DIR_HARDLINKS: attrgroup_t = 0x00040000;
5075pub const VOL_CAP_FMT_DOCUMENT_ID: attrgroup_t = 0x00080000;
5076pub const VOL_CAP_FMT_WRITE_GENERATION_COUNT: attrgroup_t = 0x00100000;
5077pub const VOL_CAP_FMT_NO_IMMUTABLE_FILES: attrgroup_t = 0x00200000;
5078pub const VOL_CAP_FMT_NO_PERMISSIONS: attrgroup_t = 0x00400000;
5079pub const VOL_CAP_FMT_SHARED_SPACE: attrgroup_t = 0x00800000;
5080pub const VOL_CAP_FMT_VOL_GROUPS: attrgroup_t = 0x01000000;
5081pub const VOL_CAP_FMT_SEALED: attrgroup_t = 0x02000000;
5082pub const VOL_CAP_INT_SEARCHFS: attrgroup_t = 0x00000001;
5083pub const VOL_CAP_INT_ATTRLIST: attrgroup_t = 0x00000002;
5084pub const VOL_CAP_INT_NFSEXPORT: attrgroup_t = 0x00000004;
5085pub const VOL_CAP_INT_READDIRATTR: attrgroup_t = 0x00000008;
5086pub const VOL_CAP_INT_EXCHANGEDATA: attrgroup_t = 0x00000010;
5087pub const VOL_CAP_INT_COPYFILE: attrgroup_t = 0x00000020;
5088pub const VOL_CAP_INT_ALLOCATE: attrgroup_t = 0x00000040;
5089pub const VOL_CAP_INT_VOL_RENAME: attrgroup_t = 0x00000080;
5090pub const VOL_CAP_INT_ADVLOCK: attrgroup_t = 0x00000100;
5091pub const VOL_CAP_INT_FLOCK: attrgroup_t = 0x00000200;
5092pub const VOL_CAP_INT_EXTENDED_SECURITY: attrgroup_t = 0x00000400;
5093pub const VOL_CAP_INT_USERACCESS: attrgroup_t = 0x00000800;
5094pub const VOL_CAP_INT_MANLOCK: attrgroup_t = 0x00001000;
5095pub const VOL_CAP_INT_NAMEDSTREAMS: attrgroup_t = 0x00002000;
5096pub const VOL_CAP_INT_EXTENDED_ATTR: attrgroup_t = 0x00004000;
5097pub const VOL_CAP_INT_CLONE: attrgroup_t = 0x00010000;
5098pub const VOL_CAP_INT_SNAPSHOT: attrgroup_t = 0x00020000;
5099pub const VOL_CAP_INT_RENAME_SWAP: attrgroup_t = 0x00040000;
5100pub const VOL_CAP_INT_RENAME_EXCL: attrgroup_t = 0x00080000;
5101pub const VOL_CAP_INT_RENAME_OPENFAIL: attrgroup_t = 0x00100000;
5102
5103pub const OS_CLOCK_MACH_ABSOLUTE_TIME: os_clockid_t = 32;
5105
5106pub const OS_SYNC_WAIT_ON_ADDRESS_NONE: os_sync_wait_on_address_flags_t = 0x00000000;
5108pub const OS_SYNC_WAIT_ON_ADDRESS_SHARED: os_sync_wait_on_address_flags_t = 0x00000001;
5109pub const OS_SYNC_WAKE_BY_ADDRESS_NONE: os_sync_wake_by_address_flags_t = 0x00000000;
5110pub const OS_SYNC_WAKE_BY_ADDRESS_SHARED: os_sync_wake_by_address_flags_t = 0x00000001;
5111
5112pub const SIDL: u32 = 1;
5115pub const SRUN: u32 = 2;
5117pub const SSLEEP: u32 = 3;
5119pub const SSTOP: u32 = 4;
5121pub const SZOMB: u32 = 5;
5123
5124pub const VMADDR_CID_ANY: c_uint = 0xFFFFFFFF;
5126pub const VMADDR_CID_HYPERVISOR: c_uint = 0;
5127pub const VMADDR_CID_RESERVED: c_uint = 1;
5128pub const VMADDR_CID_HOST: c_uint = 2;
5129pub const VMADDR_PORT_ANY: c_uint = 0xFFFFFFFF;
5130
5131const fn __DARWIN_ALIGN32(p: usize) -> usize {
5132 const __DARWIN_ALIGNBYTES32: usize = size_of::<u32>() - 1;
5133 (p + __DARWIN_ALIGNBYTES32) & !__DARWIN_ALIGNBYTES32
5134}
5135
5136pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t =
5137 (size_of::<thread_extended_policy_data_t>() / size_of::<integer_t>()) as mach_msg_type_number_t;
5138pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t =
5139 (size_of::<thread_time_constraint_policy_data_t>() / size_of::<integer_t>())
5140 as mach_msg_type_number_t;
5141pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t =
5142 (size_of::<thread_precedence_policy_data_t>() / size_of::<integer_t>())
5143 as mach_msg_type_number_t;
5144pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t =
5145 (size_of::<thread_affinity_policy_data_t>() / size_of::<integer_t>()) as mach_msg_type_number_t;
5146pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t =
5147 (size_of::<thread_background_policy_data_t>() / size_of::<integer_t>())
5148 as mach_msg_type_number_t;
5149pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t =
5150 (size_of::<thread_latency_qos_policy_data_t>() / size_of::<integer_t>())
5151 as mach_msg_type_number_t;
5152pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t =
5153 (size_of::<thread_throughput_qos_policy_data_t>() / size_of::<integer_t>())
5154 as mach_msg_type_number_t;
5155pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t =
5156 (size_of::<thread_basic_info_data_t>() / size_of::<integer_t>()) as mach_msg_type_number_t;
5157pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t =
5158 (size_of::<thread_identifier_info_data_t>() / size_of::<integer_t>()) as mach_msg_type_number_t;
5159pub const THREAD_EXTENDED_INFO_COUNT: mach_msg_type_number_t =
5160 (size_of::<thread_extended_info_data_t>() / size_of::<integer_t>()) as mach_msg_type_number_t;
5161
5162pub const TASK_THREAD_TIMES_INFO_COUNT: u32 =
5163 (size_of::<task_thread_times_info_data_t>() / size_of::<natural_t>()) as u32;
5164pub const MACH_TASK_BASIC_INFO_COUNT: u32 =
5165 (size_of::<mach_task_basic_info_data_t>() / size_of::<natural_t>()) as u32;
5166pub const HOST_VM_INFO64_COUNT: mach_msg_type_number_t =
5167 (size_of::<vm_statistics64_data_t>() / size_of::<integer_t>()) as mach_msg_type_number_t;
5168
5169pub const IFMIB_SYSTEM: c_int = 1;
5172pub const IFMIB_IFDATA: c_int = 2;
5174pub const IFMIB_IFALLDATA: c_int = 3;
5176
5177pub const IFDATA_GENERAL: c_int = 1;
5179pub const IFDATA_LINKSPECIFIC: c_int = 2;
5181pub const IFDATA_ADDRS: c_int = 3;
5183pub const IFDATA_MULTIADDRS: c_int = 4;
5185
5186pub const IFMIB_IFCOUNT: c_int = 1;
5188
5189pub const NETLINK_GENERIC: c_int = 0;
5191
5192pub const DOT3COMPLIANCE_STATS: c_int = 1;
5193pub const DOT3COMPLIANCE_COLLS: c_int = 2;
5194
5195pub const MAX_KCTL_NAME: usize = 96;
5197
5198f! {
5199 pub fn CMSG_NXTHDR(mhdr: *const crate::msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr {
5200 if cmsg.is_null() {
5201 return crate::CMSG_FIRSTHDR(mhdr);
5202 }
5203 let cmsg_len = (*cmsg).cmsg_len as usize;
5204 let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len);
5205 let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize;
5206 if next + __DARWIN_ALIGN32(size_of::<cmsghdr>()) > max {
5207 core::ptr::null_mut()
5208 } else {
5209 next as *mut cmsghdr
5210 }
5211 }
5212
5213 pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar {
5214 (cmsg as *mut c_uchar).add(__DARWIN_ALIGN32(size_of::<cmsghdr>()))
5215 }
5216
5217 pub {const} fn CMSG_SPACE(length: c_uint) -> c_uint {
5218 (__DARWIN_ALIGN32(size_of::<cmsghdr>()) + __DARWIN_ALIGN32(length as usize)) as c_uint
5219 }
5220
5221 pub {const} fn CMSG_LEN(length: c_uint) -> c_uint {
5222 (__DARWIN_ALIGN32(size_of::<cmsghdr>()) + length as usize) as c_uint
5223 }
5224
5225 pub {const} fn VM_MAKE_TAG(id: u8) -> u32 {
5226 (id as u32) << 24u32
5227 }
5228}
5229
5230safe_f! {
5231 pub {const} fn WSTOPSIG(status: c_int) -> c_int {
5232 status >> 8
5233 }
5234
5235 pub {const} fn _WSTATUS(status: c_int) -> c_int {
5236 status & 0x7f
5237 }
5238
5239 pub {const} fn WIFCONTINUED(status: c_int) -> bool {
5240 _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) == 0x13
5241 }
5242
5243 pub {const} fn WIFSIGNALED(status: c_int) -> bool {
5244 _WSTATUS(status) != _WSTOPPED && _WSTATUS(status) != 0
5245 }
5246
5247 pub {const} fn WIFSTOPPED(status: c_int) -> bool {
5248 _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) != 0x13
5249 }
5250
5251 pub {const} fn makedev(major: i32, minor: i32) -> dev_t {
5252 (major << 24) | minor
5253 }
5254
5255 pub {const} fn major(dev: dev_t) -> i32 {
5256 (dev >> 24) & 0xff
5257 }
5258
5259 pub {const} fn minor(dev: dev_t) -> i32 {
5260 dev & 0xffffff
5261 }
5262}
5263
5264extern "C" {
5265 pub fn setgrent();
5266 #[doc(hidden)]
5267 #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.5")]
5268 #[cfg_attr(not(target_arch = "aarch64"), link_name = "daemon$1050")]
5269 pub fn daemon(nochdir: c_int, noclose: c_int) -> c_int;
5270 #[doc(hidden)]
5271 #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")]
5272 pub fn sem_destroy(sem: *mut sem_t) -> c_int;
5273 #[doc(hidden)]
5274 #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")]
5275 pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int;
5276 pub fn aio_read(aiocbp: *mut aiocb) -> c_int;
5277 pub fn aio_write(aiocbp: *mut aiocb) -> c_int;
5278 pub fn aio_fsync(op: c_int, aiocbp: *mut aiocb) -> c_int;
5279 pub fn aio_error(aiocbp: *const aiocb) -> c_int;
5280 pub fn aio_return(aiocbp: *mut aiocb) -> ssize_t;
5281 #[cfg_attr(
5282 all(target_os = "macos", target_arch = "x86"),
5283 link_name = "aio_suspend$UNIX2003"
5284 )]
5285 pub fn aio_suspend(
5286 aiocb_list: *const *const aiocb,
5287 nitems: c_int,
5288 timeout: *const crate::timespec,
5289 ) -> c_int;
5290 pub fn aio_cancel(fd: c_int, aiocbp: *mut aiocb) -> c_int;
5291 pub fn chflags(path: *const c_char, flags: c_uint) -> c_int;
5292 pub fn fchflags(fd: c_int, flags: c_uint) -> c_int;
5293 pub fn clock_getres(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int;
5294 pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int;
5295 pub fn lio_listio(
5296 mode: c_int,
5297 aiocb_list: *const *mut aiocb,
5298 nitems: c_int,
5299 sevp: *mut sigevent,
5300 ) -> c_int;
5301
5302 pub fn dirfd(dirp: *mut crate::DIR) -> c_int;
5303
5304 pub fn lutimes(file: *const c_char, times: *const crate::timeval) -> c_int;
5305
5306 pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int;
5307 pub fn getutxent() -> *mut utmpx;
5308 pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
5309 pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
5310 pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
5311 pub fn setutxent();
5312 pub fn endutxent();
5313 pub fn utmpxname(file: *const c_char) -> c_int;
5314
5315 pub fn asctime(tm: *const crate::tm) -> *mut c_char;
5316 pub fn ctime(clock: *const time_t) -> *mut c_char;
5317 pub fn getdate(datestr: *const c_char) -> *mut crate::tm;
5318 pub fn strptime(
5319 buf: *const c_char,
5320 format: *const c_char,
5321 timeptr: *mut crate::tm,
5322 ) -> *mut c_char;
5323 pub fn asctime_r(tm: *const crate::tm, result: *mut c_char) -> *mut c_char;
5324 pub fn ctime_r(clock: *const time_t, result: *mut c_char) -> *mut c_char;
5325
5326 pub fn getnameinfo(
5327 sa: *const crate::sockaddr,
5328 salen: crate::socklen_t,
5329 host: *mut c_char,
5330 hostlen: crate::socklen_t,
5331 serv: *mut c_char,
5332 servlen: crate::socklen_t,
5333 flags: c_int,
5334 ) -> c_int;
5335 pub fn mincore(addr: *const c_void, len: size_t, vec: *mut c_char) -> c_int;
5336 pub fn sysctlnametomib(name: *const c_char, mibp: *mut c_int, sizep: *mut size_t) -> c_int;
5337 #[cfg_attr(
5338 all(target_os = "macos", target_arch = "x86"),
5339 link_name = "mprotect$UNIX2003"
5340 )]
5341 pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int;
5342 pub fn semget(key: key_t, nsems: c_int, semflg: c_int) -> c_int;
5343 #[cfg_attr(
5344 all(target_os = "macos", target_arch = "x86"),
5345 link_name = "semctl$UNIX2003"
5346 )]
5347 pub fn semctl(semid: c_int, semnum: c_int, cmd: c_int, ...) -> c_int;
5348 pub fn semop(semid: c_int, sops: *mut sembuf, nsops: size_t) -> c_int;
5349 pub fn shm_open(name: *const c_char, oflag: c_int, ...) -> c_int;
5350 pub fn ftok(pathname: *const c_char, proj_id: c_int) -> key_t;
5351 pub fn shmat(shmid: c_int, shmaddr: *const c_void, shmflg: c_int) -> *mut c_void;
5352 pub fn shmdt(shmaddr: *const c_void) -> c_int;
5353 #[cfg_attr(
5354 all(target_os = "macos", target_arch = "x86"),
5355 link_name = "shmctl$UNIX2003"
5356 )]
5357 pub fn shmctl(shmid: c_int, cmd: c_int, buf: *mut crate::shmid_ds) -> c_int;
5358 pub fn shmget(key: key_t, size: size_t, shmflg: c_int) -> c_int;
5359 pub fn sysctl(
5360 name: *mut c_int,
5361 namelen: c_uint,
5362 oldp: *mut c_void,
5363 oldlenp: *mut size_t,
5364 newp: *mut c_void,
5365 newlen: size_t,
5366 ) -> c_int;
5367 pub fn sysctlbyname(
5368 name: *const c_char,
5369 oldp: *mut c_void,
5370 oldlenp: *mut size_t,
5371 newp: *mut c_void,
5372 newlen: size_t,
5373 ) -> c_int;
5374 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
5375 pub fn mach_absolute_time() -> u64;
5376 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
5377 #[allow(deprecated)]
5378 pub fn mach_timebase_info(info: *mut crate::mach_timebase_info) -> c_int;
5379 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
5380 pub fn mach_host_self() -> mach_port_t;
5381 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
5382 pub fn mach_thread_self() -> mach_port_t;
5383 pub fn pthread_once(
5384 once_control: *mut crate::pthread_once_t,
5385 init_routine: Option<unsafe extern "C" fn()>,
5386 ) -> c_int;
5387 pub fn pthread_attr_getinheritsched(
5388 attr: *const crate::pthread_attr_t,
5389 inheritsched: *mut c_int,
5390 ) -> c_int;
5391 pub fn pthread_attr_getschedpolicy(
5392 attr: *const crate::pthread_attr_t,
5393 policy: *mut c_int,
5394 ) -> c_int;
5395 pub fn pthread_attr_getscope(
5396 attr: *const crate::pthread_attr_t,
5397 contentionscope: *mut c_int,
5398 ) -> c_int;
5399 pub fn pthread_attr_getstackaddr(
5400 attr: *const crate::pthread_attr_t,
5401 stackaddr: *mut *mut c_void,
5402 ) -> c_int;
5403 pub fn pthread_attr_getdetachstate(
5404 attr: *const crate::pthread_attr_t,
5405 detachstate: *mut c_int,
5406 ) -> c_int;
5407 pub fn pthread_attr_setinheritsched(
5408 attr: *mut crate::pthread_attr_t,
5409 inheritsched: c_int,
5410 ) -> c_int;
5411 pub fn pthread_attr_setschedpolicy(attr: *mut crate::pthread_attr_t, policy: c_int) -> c_int;
5412 pub fn pthread_attr_setscope(attr: *mut crate::pthread_attr_t, contentionscope: c_int)
5413 -> c_int;
5414 pub fn pthread_attr_setstackaddr(
5415 attr: *mut crate::pthread_attr_t,
5416 stackaddr: *mut c_void,
5417 ) -> c_int;
5418 pub fn pthread_setname_np(name: *const c_char) -> c_int;
5419 pub fn pthread_getname_np(thread: crate::pthread_t, name: *mut c_char, len: size_t) -> c_int;
5420 pub fn pthread_mach_thread_np(thread: crate::pthread_t) -> crate::mach_port_t;
5421 pub fn pthread_from_mach_thread_np(port: crate::mach_port_t) -> crate::pthread_t;
5422 pub fn pthread_create_from_mach_thread(
5423 thread: *mut crate::pthread_t,
5424 attr: *const crate::pthread_attr_t,
5425 f: extern "C" fn(*mut c_void) -> *mut c_void,
5426 value: *mut c_void,
5427 ) -> c_int;
5428 pub fn pthread_stack_frame_decode_np(
5429 frame_addr: crate::uintptr_t,
5430 return_addr: *mut crate::uintptr_t,
5431 ) -> crate::uintptr_t;
5432 pub fn pthread_get_stackaddr_np(thread: crate::pthread_t) -> *mut c_void;
5433 pub fn pthread_get_stacksize_np(thread: crate::pthread_t) -> size_t;
5434 pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: c_int) -> c_int;
5435 pub fn pthread_condattr_getpshared(
5436 attr: *const pthread_condattr_t,
5437 pshared: *mut c_int,
5438 ) -> c_int;
5439 pub fn pthread_main_np() -> c_int;
5440 pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, pshared: c_int) -> c_int;
5441 pub fn pthread_mutexattr_getpshared(
5442 attr: *const pthread_mutexattr_t,
5443 pshared: *mut c_int,
5444 ) -> c_int;
5445 pub fn pthread_rwlockattr_getpshared(
5446 attr: *const pthread_rwlockattr_t,
5447 val: *mut c_int,
5448 ) -> c_int;
5449 pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: c_int) -> c_int;
5450 pub fn pthread_threadid_np(thread: crate::pthread_t, thread_id: *mut u64) -> c_int;
5451 pub fn pthread_attr_set_qos_class_np(
5452 attr: *mut pthread_attr_t,
5453 class: qos_class_t,
5454 priority: c_int,
5455 ) -> c_int;
5456 pub fn pthread_attr_get_qos_class_np(
5457 attr: *mut pthread_attr_t,
5458 class: *mut qos_class_t,
5459 priority: *mut c_int,
5460 ) -> c_int;
5461 pub fn pthread_set_qos_class_self_np(class: qos_class_t, priority: c_int) -> c_int;
5462 pub fn pthread_get_qos_class_np(
5463 thread: crate::pthread_t,
5464 class: *mut qos_class_t,
5465 priority: *mut c_int,
5466 ) -> c_int;
5467 pub fn pthread_attr_getschedparam(
5468 attr: *const crate::pthread_attr_t,
5469 param: *mut sched_param,
5470 ) -> c_int;
5471 pub fn pthread_attr_setschedparam(
5472 attr: *mut crate::pthread_attr_t,
5473 param: *const sched_param,
5474 ) -> c_int;
5475 pub fn pthread_getschedparam(
5476 thread: crate::pthread_t,
5477 policy: *mut c_int,
5478 param: *mut sched_param,
5479 ) -> c_int;
5480 pub fn pthread_setschedparam(
5481 thread: crate::pthread_t,
5482 policy: c_int,
5483 param: *const sched_param,
5484 ) -> c_int;
5485
5486 pub fn pthread_introspection_hook_install(
5488 hook: crate::pthread_introspection_hook_t,
5489 ) -> crate::pthread_introspection_hook_t;
5490 pub fn pthread_introspection_setspecific_np(
5491 thread: crate::pthread_t,
5492 key: crate::pthread_key_t,
5493 value: *const c_void,
5494 ) -> c_int;
5495 pub fn pthread_introspection_getspecific_np(
5496 thread: crate::pthread_t,
5497 key: crate::pthread_key_t,
5498 ) -> *mut c_void;
5499 pub fn pthread_jit_write_protect_np(enabled: c_int);
5500 pub fn pthread_jit_write_protect_supported_np() -> c_int;
5501 pub fn pthread_jit_write_with_callback_np(
5508 callback: crate::pthread_jit_write_callback_t,
5509 ctx: *mut c_void,
5510 ) -> c_int;
5511 pub fn pthread_jit_write_freeze_callbacks_np();
5512 pub fn pthread_cpu_number_np(cpu_number_out: *mut size_t) -> c_int;
5513
5514 pub fn os_sync_wait_on_address(
5516 addr: *mut c_void,
5517 value: u64,
5518 size: size_t,
5519 flags: os_sync_wait_on_address_flags_t,
5520 ) -> c_int;
5521 pub fn os_sync_wait_on_address_with_deadline(
5522 addr: *mut c_void,
5523 value: u64,
5524 size: size_t,
5525 flags: os_sync_wait_on_address_flags_t,
5526 clockid: os_clockid_t,
5527 deadline: u64,
5528 ) -> c_int;
5529 pub fn os_sync_wait_on_address_with_timeout(
5530 addr: *mut c_void,
5531 value: u64,
5532 size: size_t,
5533 flags: os_sync_wait_on_address_flags_t,
5534 clockid: os_clockid_t,
5535 timeout_ns: u64,
5536 ) -> c_int;
5537 pub fn os_sync_wake_by_address_any(
5538 addr: *mut c_void,
5539 size: size_t,
5540 flags: os_sync_wake_by_address_flags_t,
5541 ) -> c_int;
5542 pub fn os_sync_wake_by_address_all(
5543 addr: *mut c_void,
5544 size: size_t,
5545 flags: os_sync_wake_by_address_flags_t,
5546 ) -> c_int;
5547
5548 pub fn os_unfair_lock_lock(lock: os_unfair_lock_t);
5549 pub fn os_unfair_lock_trylock(lock: os_unfair_lock_t) -> bool;
5550 pub fn os_unfair_lock_unlock(lock: os_unfair_lock_t);
5551 pub fn os_unfair_lock_assert_owner(lock: os_unfair_lock_t);
5552 pub fn os_unfair_lock_assert_not_owner(lock: os_unfair_lock_t);
5553
5554 pub fn os_log_create(subsystem: *const c_char, category: *const c_char) -> crate::os_log_t;
5555 pub fn os_log_type_enabled(oslog: crate::os_log_t, tpe: crate::os_log_type_t) -> bool;
5556 pub fn os_signpost_id_make_with_pointer(
5557 log: crate::os_log_t,
5558 ptr: *const c_void,
5559 ) -> crate::os_signpost_id_t;
5560 pub fn os_signpost_id_generate(log: crate::os_log_t) -> crate::os_signpost_id_t;
5561 pub fn os_signpost_enabled(log: crate::os_log_t) -> bool;
5562
5563 pub fn thread_policy_set(
5564 thread: thread_t,
5565 flavor: thread_policy_flavor_t,
5566 policy_info: thread_policy_t,
5567 count: mach_msg_type_number_t,
5568 ) -> kern_return_t;
5569 pub fn thread_policy_get(
5570 thread: thread_t,
5571 flavor: thread_policy_flavor_t,
5572 policy_info: thread_policy_t,
5573 count: *mut mach_msg_type_number_t,
5574 get_default: *mut boolean_t,
5575 ) -> kern_return_t;
5576 pub fn thread_info(
5577 target_act: thread_inspect_t,
5578 flavor: thread_flavor_t,
5579 thread_info_out: thread_info_t,
5580 thread_info_outCnt: *mut mach_msg_type_number_t,
5581 ) -> kern_return_t;
5582 #[cfg_attr(doc, doc(alias = "__errno_location"))]
5583 #[cfg_attr(doc, doc(alias = "errno"))]
5584 pub fn __error() -> *mut c_int;
5585 pub fn backtrace(buf: *mut *mut c_void, sz: c_int) -> c_int;
5586 pub fn backtrace_symbols(addrs: *const *mut c_void, sz: c_int) -> *mut *mut c_char;
5587 pub fn backtrace_symbols_fd(addrs: *const *mut c_void, sz: c_int, fd: c_int);
5588 pub fn backtrace_from_fp(startfp: *mut c_void, array: *mut *mut c_void, size: c_int) -> c_int;
5589 pub fn backtrace_image_offsets(
5590 array: *const *mut c_void,
5591 image_offsets: *mut image_offset,
5592 size: c_int,
5593 );
5594 pub fn backtrace_async(array: *mut *mut c_void, length: size_t, task_id: *mut u32) -> size_t;
5595 #[cfg_attr(
5596 all(target_os = "macos", not(target_arch = "aarch64")),
5597 link_name = "statfs$INODE64"
5598 )]
5599 pub fn statfs(path: *const c_char, buf: *mut statfs) -> c_int;
5600 #[cfg_attr(
5601 all(target_os = "macos", not(target_arch = "aarch64")),
5602 link_name = "fstatfs$INODE64"
5603 )]
5604 pub fn fstatfs(fd: c_int, buf: *mut statfs) -> c_int;
5605 pub fn kevent(
5606 kq: c_int,
5607 changelist: *const crate::kevent,
5608 nchanges: c_int,
5609 eventlist: *mut crate::kevent,
5610 nevents: c_int,
5611 timeout: *const crate::timespec,
5612 ) -> c_int;
5613 pub fn kevent64(
5614 kq: c_int,
5615 changelist: *const crate::kevent64_s,
5616 nchanges: c_int,
5617 eventlist: *mut crate::kevent64_s,
5618 nevents: c_int,
5619 flags: c_uint,
5620 timeout: *const crate::timespec,
5621 ) -> c_int;
5622 pub fn mount(
5623 src: *const c_char,
5624 target: *const c_char,
5625 flags: c_int,
5626 data: *mut c_void,
5627 ) -> c_int;
5628 pub fn fmount(src: *const c_char, fd: c_int, flags: c_int, data: *mut c_void) -> c_int;
5629 pub fn ptrace(request: c_int, pid: crate::pid_t, addr: *mut c_char, data: c_int) -> c_int;
5630 pub fn quotactl(special: *const c_char, cmd: c_int, id: c_int, data: *mut c_char) -> c_int;
5631 pub fn sethostname(name: *const c_char, len: c_int) -> c_int;
5632 pub fn sendfile(
5633 fd: c_int,
5634 s: c_int,
5635 offset: off_t,
5636 len: *mut off_t,
5637 hdtr: *mut crate::sf_hdtr,
5638 flags: c_int,
5639 ) -> c_int;
5640 pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int;
5641 pub fn utimensat(
5642 dirfd: c_int,
5643 path: *const c_char,
5644 times: *const crate::timespec,
5645 flag: c_int,
5646 ) -> c_int;
5647 pub fn openpty(
5648 amaster: *mut c_int,
5649 aslave: *mut c_int,
5650 name: *mut c_char,
5651 termp: *mut termios,
5652 winp: *mut crate::winsize,
5653 ) -> c_int;
5654 pub fn forkpty(
5655 amaster: *mut c_int,
5656 name: *mut c_char,
5657 termp: *mut termios,
5658 winp: *mut crate::winsize,
5659 ) -> crate::pid_t;
5660 pub fn login_tty(fd: c_int) -> c_int;
5661 pub fn duplocale(base: crate::locale_t) -> crate::locale_t;
5662 pub fn freelocale(loc: crate::locale_t) -> c_int;
5663 pub fn localeconv_l(loc: crate::locale_t) -> *mut lconv;
5664 pub fn newlocale(mask: c_int, locale: *const c_char, base: crate::locale_t) -> crate::locale_t;
5665 pub fn uselocale(loc: crate::locale_t) -> crate::locale_t;
5666 pub fn querylocale(mask: c_int, loc: crate::locale_t) -> *const c_char;
5667 pub fn getpriority(which: c_int, who: crate::id_t) -> c_int;
5668 pub fn setpriority(which: c_int, who: crate::id_t, prio: c_int) -> c_int;
5669 pub fn getdomainname(name: *mut c_char, len: c_int) -> c_int;
5670 pub fn setdomainname(name: *const c_char, len: c_int) -> c_int;
5671 pub fn preadv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t;
5672 pub fn pwritev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t;
5673 pub fn getxattr(
5674 path: *const c_char,
5675 name: *const c_char,
5676 value: *mut c_void,
5677 size: size_t,
5678 position: u32,
5679 flags: c_int,
5680 ) -> ssize_t;
5681 pub fn fgetxattr(
5682 filedes: c_int,
5683 name: *const c_char,
5684 value: *mut c_void,
5685 size: size_t,
5686 position: u32,
5687 flags: c_int,
5688 ) -> ssize_t;
5689 pub fn setxattr(
5690 path: *const c_char,
5691 name: *const c_char,
5692 value: *const c_void,
5693 size: size_t,
5694 position: u32,
5695 flags: c_int,
5696 ) -> c_int;
5697 pub fn fsetxattr(
5698 filedes: c_int,
5699 name: *const c_char,
5700 value: *const c_void,
5701 size: size_t,
5702 position: u32,
5703 flags: c_int,
5704 ) -> c_int;
5705 pub fn listxattr(path: *const c_char, list: *mut c_char, size: size_t, flags: c_int)
5706 -> ssize_t;
5707 pub fn flistxattr(filedes: c_int, list: *mut c_char, size: size_t, flags: c_int) -> ssize_t;
5708 pub fn removexattr(path: *const c_char, name: *const c_char, flags: c_int) -> c_int;
5709 pub fn renamex_np(from: *const c_char, to: *const c_char, flags: c_uint) -> c_int;
5710 pub fn renameatx_np(
5711 fromfd: c_int,
5712 from: *const c_char,
5713 tofd: c_int,
5714 to: *const c_char,
5715 flags: c_uint,
5716 ) -> c_int;
5717 pub fn fremovexattr(filedes: c_int, name: *const c_char, flags: c_int) -> c_int;
5718
5719 pub fn getgrouplist(
5720 name: *const c_char,
5721 basegid: c_int,
5722 groups: *mut c_int,
5723 ngroups: *mut c_int,
5724 ) -> c_int;
5725 pub fn initgroups(user: *const c_char, basegroup: c_int) -> c_int;
5726
5727 #[cfg_attr(
5728 all(target_os = "macos", target_arch = "x86"),
5729 link_name = "waitid$UNIX2003"
5730 )]
5731 pub fn waitid(
5732 idtype: idtype_t,
5733 id: id_t,
5734 infop: *mut crate::siginfo_t,
5735 options: c_int,
5736 ) -> c_int;
5737 pub fn brk(addr: *const c_void) -> *mut c_void;
5738 pub fn sbrk(increment: c_int) -> *mut c_void;
5739 pub fn settimeofday(tv: *const crate::timeval, tz: *const crate::timezone) -> c_int;
5740 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
5741 pub fn _dyld_image_count() -> u32;
5742 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
5743 #[allow(deprecated)]
5744 pub fn _dyld_get_image_header(image_index: u32) -> *const mach_header;
5745 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
5746 pub fn _dyld_get_image_vmaddr_slide(image_index: u32) -> intptr_t;
5747 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
5748 pub fn _dyld_get_image_name(image_index: u32) -> *const c_char;
5749
5750 pub fn posix_spawn(
5751 pid: *mut crate::pid_t,
5752 path: *const c_char,
5753 file_actions: *const crate::posix_spawn_file_actions_t,
5754 attrp: *const crate::posix_spawnattr_t,
5755 argv: *const *mut c_char,
5756 envp: *const *mut c_char,
5757 ) -> c_int;
5758 pub fn posix_spawnp(
5759 pid: *mut crate::pid_t,
5760 file: *const c_char,
5761 file_actions: *const crate::posix_spawn_file_actions_t,
5762 attrp: *const crate::posix_spawnattr_t,
5763 argv: *const *mut c_char,
5764 envp: *const *mut c_char,
5765 ) -> c_int;
5766 pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> c_int;
5767 pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> c_int;
5768 pub fn posix_spawnattr_getsigdefault(
5769 attr: *const posix_spawnattr_t,
5770 default: *mut crate::sigset_t,
5771 ) -> c_int;
5772 pub fn posix_spawnattr_setsigdefault(
5773 attr: *mut posix_spawnattr_t,
5774 default: *const crate::sigset_t,
5775 ) -> c_int;
5776 pub fn posix_spawnattr_getsigmask(
5777 attr: *const posix_spawnattr_t,
5778 default: *mut crate::sigset_t,
5779 ) -> c_int;
5780 pub fn posix_spawnattr_setsigmask(
5781 attr: *mut posix_spawnattr_t,
5782 default: *const crate::sigset_t,
5783 ) -> c_int;
5784 pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t, flags: *mut c_short) -> c_int;
5785 pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: c_short) -> c_int;
5786 pub fn posix_spawnattr_getpgroup(
5787 attr: *const posix_spawnattr_t,
5788 flags: *mut crate::pid_t,
5789 ) -> c_int;
5790 pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int;
5791 pub fn posix_spawnattr_setarchpref_np(
5792 attr: *mut posix_spawnattr_t,
5793 count: size_t,
5794 pref: *mut crate::cpu_type_t,
5795 subpref: *mut crate::cpu_subtype_t,
5796 ocount: *mut size_t,
5797 ) -> c_int;
5798 pub fn posix_spawnattr_getarchpref_np(
5799 attr: *const posix_spawnattr_t,
5800 count: size_t,
5801 pref: *mut crate::cpu_type_t,
5802 subpref: *mut crate::cpu_subtype_t,
5803 ocount: *mut size_t,
5804 ) -> c_int;
5805 pub fn posix_spawnattr_getbinpref_np(
5806 attr: *const posix_spawnattr_t,
5807 count: size_t,
5808 pref: *mut crate::cpu_type_t,
5809 ocount: *mut size_t,
5810 ) -> c_int;
5811 pub fn posix_spawnattr_setbinpref_np(
5812 attr: *mut posix_spawnattr_t,
5813 count: size_t,
5814 pref: *mut crate::cpu_type_t,
5815 ocount: *mut size_t,
5816 ) -> c_int;
5817 pub fn posix_spawnattr_set_qos_class_np(
5818 attr: *mut posix_spawnattr_t,
5819 qos_class: crate::qos_class_t,
5820 ) -> c_int;
5821 pub fn posix_spawnattr_get_qos_class_np(
5822 attr: *const posix_spawnattr_t,
5823 qos_class: *mut crate::qos_class_t,
5824 ) -> c_int;
5825
5826 pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int;
5827 pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int;
5828 pub fn posix_spawn_file_actions_addopen(
5829 actions: *mut posix_spawn_file_actions_t,
5830 fd: c_int,
5831 path: *const c_char,
5832 oflag: c_int,
5833 mode: mode_t,
5834 ) -> c_int;
5835 pub fn posix_spawn_file_actions_addclose(
5836 actions: *mut posix_spawn_file_actions_t,
5837 fd: c_int,
5838 ) -> c_int;
5839 pub fn posix_spawn_file_actions_adddup2(
5840 actions: *mut posix_spawn_file_actions_t,
5841 fd: c_int,
5842 newfd: c_int,
5843 ) -> c_int;
5844 pub fn uname(buf: *mut crate::utsname) -> c_int;
5845
5846 pub fn connectx(
5847 socket: c_int,
5848 endpoints: *const sa_endpoints_t,
5849 associd: sae_associd_t,
5850 flags: c_uint,
5851 iov: *const crate::iovec,
5852 iovcnt: c_uint,
5853 len: *mut size_t,
5854 connid: *mut sae_connid_t,
5855 ) -> c_int;
5856 pub fn disconnectx(socket: c_int, associd: sae_associd_t, connid: sae_connid_t) -> c_int;
5857
5858 pub fn ntp_adjtime(buf: *mut timex) -> c_int;
5859 pub fn ntp_gettime(buf: *mut ntptimeval) -> c_int;
5860
5861 #[cfg_attr(
5862 all(target_os = "macos", not(target_arch = "aarch64")),
5863 link_name = "getmntinfo$INODE64"
5864 )]
5865 pub fn getmntinfo(mntbufp: *mut *mut statfs, flags: c_int) -> c_int;
5866 #[cfg_attr(
5867 all(target_os = "macos", not(target_arch = "aarch64")),
5868 link_name = "getfsstat$INODE64"
5869 )]
5870 pub fn getfsstat(mntbufp: *mut statfs, bufsize: c_int, flags: c_int) -> c_int;
5871
5872 pub fn clonefile(src: *const c_char, dst: *const c_char, flags: u32) -> c_int;
5876 pub fn clonefileat(
5877 src_dirfd: c_int,
5878 src: *const c_char,
5879 dst_dirfd: c_int,
5880 dst: *const c_char,
5881 flags: u32,
5882 ) -> c_int;
5883 pub fn fclonefileat(srcfd: c_int, dst_dirfd: c_int, dst: *const c_char, flags: u32) -> c_int;
5884
5885 pub fn copyfile(
5886 from: *const c_char,
5887 to: *const c_char,
5888 state: copyfile_state_t,
5889 flags: copyfile_flags_t,
5890 ) -> c_int;
5891 pub fn fcopyfile(
5892 from: c_int,
5893 to: c_int,
5894 state: copyfile_state_t,
5895 flags: copyfile_flags_t,
5896 ) -> c_int;
5897 pub fn copyfile_state_free(s: copyfile_state_t) -> c_int;
5898 pub fn copyfile_state_alloc() -> copyfile_state_t;
5899 pub fn copyfile_state_get(s: copyfile_state_t, flags: u32, dst: *mut c_void) -> c_int;
5900 pub fn copyfile_state_set(s: copyfile_state_t, flags: u32, src: *const c_void) -> c_int;
5901
5902 pub fn mach_error_string(error_value: crate::mach_error_t) -> *mut c_char;
5903
5904 pub fn memset_s(s: *mut c_void, smax: size_t, c: c_int, n: size_t) -> c_int;
5907 pub fn memset_pattern4(b: *mut c_void, pattern4: *const c_void, len: size_t);
5909 pub fn memset_pattern8(b: *mut c_void, pattern8: *const c_void, len: size_t);
5910 pub fn memset_pattern16(b: *mut c_void, pattern16: *const c_void, len: size_t);
5911
5912 pub fn strtonum(
5914 __numstr: *const c_char,
5915 __minval: c_longlong,
5916 __maxval: c_longlong,
5917 errstrp: *mut *const c_char,
5918 ) -> c_longlong;
5919
5920 pub fn mstats() -> mstats;
5921 pub fn malloc_printf(format: *const c_char, ...);
5922 pub fn malloc_zone_check(zone: *mut crate::malloc_zone_t) -> crate::boolean_t;
5923 pub fn malloc_zone_print(zone: *mut crate::malloc_zone_t, verbose: crate::boolean_t);
5924 pub fn malloc_zone_statistics(zone: *mut crate::malloc_zone_t, stats: *mut malloc_statistics_t);
5925 pub fn malloc_zone_log(zone: *mut crate::malloc_zone_t, address: *mut c_void);
5926 pub fn malloc_zone_print_ptr_info(ptr: *mut c_void);
5927 pub fn malloc_default_zone() -> *mut crate::malloc_zone_t;
5928 pub fn malloc_zone_from_ptr(ptr: *const c_void) -> *mut crate::malloc_zone_t;
5929 pub fn malloc_zone_malloc(zone: *mut crate::malloc_zone_t, size: size_t) -> *mut c_void;
5930 pub fn malloc_zone_valloc(zone: *mut crate::malloc_zone_t, size: size_t) -> *mut c_void;
5931 pub fn malloc_zone_calloc(
5932 zone: *mut crate::malloc_zone_t,
5933 num_items: size_t,
5934 size: size_t,
5935 ) -> *mut c_void;
5936 pub fn malloc_zone_realloc(
5937 zone: *mut crate::malloc_zone_t,
5938 ptr: *mut c_void,
5939 size: size_t,
5940 ) -> *mut c_void;
5941 pub fn malloc_zone_free(zone: *mut crate::malloc_zone_t, ptr: *mut c_void);
5942
5943 pub fn proc_listpids(t: u32, typeinfo: u32, buffer: *mut c_void, buffersize: c_int) -> c_int;
5944 pub fn proc_listallpids(buffer: *mut c_void, buffersize: c_int) -> c_int;
5945 pub fn proc_listpgrppids(pgrpid: crate::pid_t, buffer: *mut c_void, buffersize: c_int)
5946 -> c_int;
5947 pub fn proc_listchildpids(ppid: crate::pid_t, buffer: *mut c_void, buffersize: c_int) -> c_int;
5948 pub fn proc_pidinfo(
5949 pid: c_int,
5950 flavor: c_int,
5951 arg: u64,
5952 buffer: *mut c_void,
5953 buffersize: c_int,
5954 ) -> c_int;
5955 pub fn proc_pidfdinfo(
5956 pid: c_int,
5957 fd: c_int,
5958 flavor: c_int,
5959 buffer: *mut c_void,
5960 buffersize: c_int,
5961 ) -> c_int;
5962 pub fn proc_pidfileportinfo(
5963 pid: c_int,
5964 fileport: u32,
5965 flavor: c_int,
5966 buffer: *mut c_void,
5967 buffersize: c_int,
5968 ) -> c_int;
5969 pub fn proc_pidpath(pid: c_int, buffer: *mut c_void, buffersize: u32) -> c_int;
5970 pub fn proc_name(pid: c_int, buffer: *mut c_void, buffersize: u32) -> c_int;
5971 pub fn proc_regionfilename(
5972 pid: c_int,
5973 address: u64,
5974 buffer: *mut c_void,
5975 buffersize: u32,
5976 ) -> c_int;
5977 pub fn proc_kmsgbuf(buffer: *mut c_void, buffersize: u32) -> c_int;
5978 pub fn proc_libversion(major: *mut c_int, minor: *mut c_int) -> c_int;
5979 pub fn proc_pid_rusage(pid: c_int, flavor: c_int, buffer: *mut rusage_info_t) -> c_int;
5980
5981 pub fn proc_set_no_smt() -> c_int;
5983 pub fn proc_setthread_no_smt() -> c_int;
5984 pub fn proc_set_csm(flags: u32) -> c_int;
5985 pub fn proc_setthread_csm(flags: u32) -> c_int;
5986 pub fn gethostuuid(id: *mut u8, timeout: *const crate::timespec) -> c_int;
5990
5991 pub fn gethostid() -> c_long;
5992 pub fn sethostid(hostid: c_long);
5993
5994 pub fn CCRandomGenerateBytes(bytes: *mut c_void, size: size_t) -> crate::CCRNGStatus;
5995 pub fn getentropy(buf: *mut c_void, buflen: size_t) -> c_int;
5996
5997 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
5999 pub fn _NSGetExecutablePath(buf: *mut c_char, bufsize: *mut u32) -> c_int;
6000
6001 pub fn _NSGetArgv() -> *mut *mut *mut c_char;
6003 pub fn _NSGetArgc() -> *mut c_int;
6004 pub fn _NSGetEnviron() -> *mut *mut *mut c_char;
6005 pub fn _NSGetProgname() -> *mut *mut c_char;
6006
6007 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
6008 pub fn mach_vm_map(
6009 target_task: crate::vm_map_t,
6010 address: *mut crate::mach_vm_address_t,
6011 size: crate::mach_vm_size_t,
6012 mask: crate::mach_vm_offset_t,
6013 flags: c_int,
6014 object: crate::mem_entry_name_port_t,
6015 offset: crate::memory_object_offset_t,
6016 copy: crate::boolean_t,
6017 cur_protection: crate::vm_prot_t,
6018 max_protection: crate::vm_prot_t,
6019 inheritance: crate::vm_inherit_t,
6020 ) -> crate::kern_return_t;
6021
6022 pub fn vm_allocate(
6023 target_task: vm_map_t,
6024 address: *mut vm_address_t,
6025 size: vm_size_t,
6026 flags: c_int,
6027 ) -> crate::kern_return_t;
6028
6029 pub fn vm_deallocate(
6030 target_task: vm_map_t,
6031 address: vm_address_t,
6032 size: vm_size_t,
6033 ) -> crate::kern_return_t;
6034
6035 pub fn host_statistics64(
6036 host_priv: host_t,
6037 flavor: host_flavor_t,
6038 host_info64_out: host_info64_t,
6039 host_info64_outCnt: *mut mach_msg_type_number_t,
6040 ) -> crate::kern_return_t;
6041 pub fn host_processor_info(
6042 host: host_t,
6043 flavor: processor_flavor_t,
6044 out_processor_count: *mut natural_t,
6045 out_processor_info: *mut processor_info_array_t,
6046 out_processor_infoCnt: *mut mach_msg_type_number_t,
6047 ) -> crate::kern_return_t;
6048
6049 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
6050 pub static mut mach_task_self_: crate::mach_port_t;
6051 pub fn task_for_pid(
6052 host: crate::mach_port_t,
6053 pid: crate::pid_t,
6054 task: *mut crate::mach_port_t,
6055 ) -> crate::kern_return_t;
6056 pub fn task_info(
6057 host: crate::mach_port_t,
6058 flavor: task_flavor_t,
6059 task_info_out: task_info_t,
6060 task_info_count: *mut mach_msg_type_number_t,
6061 ) -> crate::kern_return_t;
6062 pub fn task_create(
6063 target_task: crate::task_t,
6064 ledgers: crate::ledger_array_t,
6065 ledgersCnt: crate::mach_msg_type_number_t,
6066 inherit_memory: crate::boolean_t,
6067 child_task: *mut crate::task_t,
6068 ) -> crate::kern_return_t;
6069 pub fn task_terminate(target_task: crate::task_t) -> crate::kern_return_t;
6070 pub fn task_threads(
6071 target_task: crate::task_inspect_t,
6072 act_list: *mut crate::thread_act_array_t,
6073 act_listCnt: *mut crate::mach_msg_type_number_t,
6074 ) -> crate::kern_return_t;
6075 pub fn host_statistics(
6076 host_priv: host_t,
6077 flavor: host_flavor_t,
6078 host_info_out: host_info_t,
6079 host_info_outCnt: *mut mach_msg_type_number_t,
6080 ) -> crate::kern_return_t;
6081
6082 pub fn sysdir_start_search_path_enumeration(
6084 dir: sysdir_search_path_directory_t,
6085 domainMask: sysdir_search_path_domain_mask_t,
6086 ) -> crate::sysdir_search_path_enumeration_state;
6087 pub fn sysdir_get_next_search_path_enumeration(
6088 state: crate::sysdir_search_path_enumeration_state,
6089 path: *mut c_char,
6090 ) -> crate::sysdir_search_path_enumeration_state;
6091
6092 pub static vm_page_size: vm_size_t;
6093
6094 pub fn getattrlist(
6095 path: *const c_char,
6096 attrList: *mut c_void,
6097 attrBuf: *mut c_void,
6098 attrBufSize: size_t,
6099 options: u32,
6100 ) -> c_int;
6101 pub fn fgetattrlist(
6102 fd: c_int,
6103 attrList: *mut c_void,
6104 attrBuf: *mut c_void,
6105 attrBufSize: size_t,
6106 options: u32,
6107 ) -> c_int;
6108 pub fn getattrlistat(
6109 fd: c_int,
6110 path: *const c_char,
6111 attrList: *mut c_void,
6112 attrBuf: *mut c_void,
6113 attrBufSize: size_t,
6114 options: c_ulong,
6115 ) -> c_int;
6116 pub fn setattrlist(
6117 path: *const c_char,
6118 attrList: *mut c_void,
6119 attrBuf: *mut c_void,
6120 attrBufSize: size_t,
6121 options: u32,
6122 ) -> c_int;
6123 pub fn fsetattrlist(
6124 fd: c_int,
6125 attrList: *mut c_void,
6126 attrBuf: *mut c_void,
6127 attrBufSize: size_t,
6128 options: u32,
6129 ) -> c_int;
6130 pub fn setattrlistat(
6131 dir_fd: c_int,
6132 path: *const c_char,
6133 attrList: *mut c_void,
6134 attrBuf: *mut c_void,
6135 attrBufSize: size_t,
6136 options: u32,
6137 ) -> c_int;
6138 pub fn getattrlistbulk(
6139 dirfd: c_int,
6140 attrList: *mut c_void,
6141 attrBuf: *mut c_void,
6142 attrBufSize: size_t,
6143 options: u64,
6144 ) -> c_int;
6145
6146 pub fn malloc_size(ptr: *const c_void) -> size_t;
6147 pub fn malloc_good_size(size: size_t) -> size_t;
6148
6149 pub fn dirname(path: *mut c_char) -> *mut c_char;
6150 pub fn basename(path: *mut c_char) -> *mut c_char;
6151
6152 pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: mode_t) -> c_int;
6153 pub fn mknodat(dirfd: c_int, pathname: *const c_char, mode: mode_t, dev: dev_t) -> c_int;
6154 pub fn freadlink(fd: c_int, buf: *mut c_char, size: size_t) -> c_int;
6155 pub fn execvP(
6156 file: *const c_char,
6157 search_path: *const c_char,
6158 argv: *const *mut c_char,
6159 ) -> c_int;
6160}
6161
6162#[allow(deprecated)]
6163#[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
6164pub unsafe fn mach_task_self() -> crate::mach_port_t {
6165 mach_task_self_
6166}
6167
6168cfg_if! {
6169 if #[cfg(target_os = "macos")] {
6170 extern "C" {
6171 pub fn clock_settime(clock_id: crate::clockid_t, tp: *const crate::timespec) -> c_int;
6172 }
6173 }
6174}
6175cfg_if! {
6176 if #[cfg(any(
6177 target_os = "macos",
6178 target_os = "ios",
6179 target_os = "tvos",
6180 target_os = "visionos"
6181 ))] {
6182 extern "C" {
6183 pub fn memmem(
6184 haystack: *const c_void,
6185 haystacklen: size_t,
6186 needle: *const c_void,
6187 needlelen: size_t,
6188 ) -> *mut c_void;
6189 pub fn task_set_info(
6190 target_task: crate::task_t,
6191 flavor: crate::task_flavor_t,
6192 task_info_in: crate::task_info_t,
6193 task_info_inCnt: crate::mach_msg_type_number_t,
6194 ) -> crate::kern_return_t;
6195 }
6196 }
6197}
6198
6199#[deprecated(note = "Will be removed in 1.0 to avoid the `iconv` dependency")]
6203#[cfg_attr(not(feature = "rustc-dep-of-std"), link(name = "iconv"))]
6204extern "C" {
6205 pub fn iconv_open(tocode: *const c_char, fromcode: *const c_char) -> iconv_t;
6206 pub fn iconv(
6207 cd: iconv_t,
6208 inbuf: *mut *mut c_char,
6209 inbytesleft: *mut size_t,
6210 outbuf: *mut *mut c_char,
6211 outbytesleft: *mut size_t,
6212 ) -> size_t;
6213 pub fn iconv_close(cd: iconv_t) -> c_int;
6214}
6215
6216cfg_if! {
6217 if #[cfg(target_pointer_width = "32")] {
6218 mod b32;
6219 pub use self::b32::*;
6220 } else if #[cfg(target_pointer_width = "64")] {
6221 mod b64;
6222 pub use self::b64::*;
6223 } else {
6224 }
6226}