1 //! Apple (ios/darwin)-specific definitions
2 //!
3 //! This covers *-apple-* triples currently
4
5 use crate::prelude::*;
6 use crate::{cmsghdr, off_t};
7
8 pub type wchar_t = i32;
9 pub type clock_t = c_ulong;
10 pub type time_t = c_long;
11 pub type suseconds_t = i32;
12 pub type dev_t = i32;
13 pub type ino_t = u64;
14 pub type mode_t = u16;
15 pub type nlink_t = u16;
16 pub type blksize_t = i32;
17 pub type rlim_t = u64;
18 pub type pthread_key_t = c_ulong;
19 pub type sigset_t = u32;
20 pub type clockid_t = c_uint;
21 pub type fsblkcnt_t = c_uint;
22 pub type fsfilcnt_t = c_uint;
23 pub type speed_t = c_ulong;
24 pub type tcflag_t = c_ulong;
25 pub type nl_item = c_int;
26 pub type id_t = c_uint;
27 pub type sem_t = c_int;
28 pub type idtype_t = c_uint;
29 pub type integer_t = c_int;
30 pub type cpu_type_t = integer_t;
31 pub type cpu_subtype_t = integer_t;
32 pub type natural_t = u32;
33 pub type mach_msg_type_number_t = natural_t;
34 pub type kern_return_t = c_int;
35 pub type uuid_t = [u8; 16];
36 pub type task_info_t = *mut integer_t;
37 pub type host_info_t = *mut integer_t;
38 pub type task_flavor_t = natural_t;
39 pub type rusage_info_t = *mut c_void;
40 pub type vm_offset_t = crate::uintptr_t;
41 pub type vm_size_t = crate::uintptr_t;
42 pub type vm_address_t = vm_offset_t;
43 pub type quad_t = i64;
44 pub type u_quad_t = u64;
45
46 pub type posix_spawnattr_t = *mut c_void;
47 pub type posix_spawn_file_actions_t = *mut c_void;
48 pub type key_t = c_int;
49 pub type shmatt_t = c_ushort;
50
51 pub type sae_associd_t = u32;
52 pub type sae_connid_t = u32;
53
54 pub type mach_port_t = c_uint;
55 pub type host_t = c_uint;
56 pub type host_flavor_t = integer_t;
57 pub type host_info64_t = *mut integer_t;
58 pub type processor_flavor_t = c_int;
59 pub type thread_flavor_t = natural_t;
60 pub type thread_inspect_t = crate::mach_port_t;
61 pub type thread_act_t = crate::mach_port_t;
62 pub type thread_act_array_t = *mut crate::thread_act_t;
63 pub type policy_t = c_int;
64 pub type mach_error_t = crate::kern_return_t;
65 pub type mach_vm_address_t = u64;
66 pub type mach_vm_offset_t = u64;
67 pub type mach_vm_size_t = u64;
68 pub type vm_map_t = crate::mach_port_t;
69 pub type mem_entry_name_port_t = crate::mach_port_t;
70 pub type memory_object_t = crate::mach_port_t;
71 pub type memory_object_offset_t = c_ulonglong;
72 pub type vm_inherit_t = c_uint;
73 pub type vm_prot_t = c_int;
74
75 pub type ledger_t = crate::mach_port_t;
76 pub type ledger_array_t = *mut crate::ledger_t;
77
78 pub type iconv_t = *mut c_void;
79
80 // mach/host_info.h
81 pub type host_cpu_load_info_t = *mut host_cpu_load_info;
82 pub type host_cpu_load_info_data_t = host_cpu_load_info;
83
84 // mach/processor_info.h
85 pub type processor_cpu_load_info_t = *mut processor_cpu_load_info;
86 pub type processor_cpu_load_info_data_t = processor_cpu_load_info;
87 pub type processor_basic_info_t = *mut processor_basic_info;
88 pub type processor_basic_info_data_t = processor_basic_info;
89 pub type processor_set_basic_info_data_t = processor_set_basic_info;
90 pub type processor_set_basic_info_t = *mut processor_set_basic_info;
91 pub type processor_set_load_info_data_t = processor_set_load_info;
92 pub type processor_set_load_info_t = *mut processor_set_load_info;
93 pub type processor_info_t = *mut integer_t;
94 pub type processor_info_array_t = *mut integer_t;
95
96 pub type mach_task_basic_info_data_t = mach_task_basic_info;
97 pub type mach_task_basic_info_t = *mut mach_task_basic_info;
98 pub type task_thread_times_info_data_t = task_thread_times_info;
99 pub type task_thread_times_info_t = *mut task_thread_times_info;
100
101 pub type thread_info_t = *mut integer_t;
102 pub type thread_basic_info_t = *mut thread_basic_info;
103 pub type thread_basic_info_data_t = thread_basic_info;
104 pub type thread_identifier_info_t = *mut thread_identifier_info;
105 pub type thread_identifier_info_data_t = thread_identifier_info;
106 pub type thread_extended_info_t = *mut thread_extended_info;
107 pub type thread_extended_info_data_t = thread_extended_info;
108
109 pub type thread_t = crate::mach_port_t;
110 pub type thread_policy_flavor_t = natural_t;
111 pub type thread_policy_t = *mut integer_t;
112 pub type thread_latency_qos_t = integer_t;
113 pub type thread_throughput_qos_t = integer_t;
114 pub type thread_standard_policy_data_t = thread_standard_policy;
115 pub type thread_standard_policy_t = *mut thread_standard_policy;
116 pub type thread_extended_policy_data_t = thread_extended_policy;
117 pub type thread_extended_policy_t = *mut thread_extended_policy;
118 pub type thread_time_constraint_policy_data_t = thread_time_constraint_policy;
119 pub type thread_time_constraint_policy_t = *mut thread_time_constraint_policy;
120 pub type thread_precedence_policy_data_t = thread_precedence_policy;
121 pub type thread_precedence_policy_t = *mut thread_precedence_policy;
122 pub type thread_affinity_policy_data_t = thread_affinity_policy;
123 pub type thread_affinity_policy_t = *mut thread_affinity_policy;
124 pub type thread_background_policy_data_t = thread_background_policy;
125 pub type thread_background_policy_t = *mut thread_background_policy;
126 pub type thread_latency_qos_policy_data_t = thread_latency_qos_policy;
127 pub type thread_latency_qos_policy_t = *mut thread_latency_qos_policy;
128 pub type thread_throughput_qos_policy_data_t = thread_throughput_qos_policy;
129 pub type thread_throughput_qos_policy_t = *mut thread_throughput_qos_policy;
130
131 pub type pthread_introspection_hook_t =
132 extern "C" fn(event: c_uint, thread: crate::pthread_t, addr: *mut c_void, size: size_t);
133 pub type pthread_jit_write_callback_t = Option<extern "C" fn(ctx: *mut c_void) -> c_int>;
134
135 pub type os_clockid_t = u32;
136
137 pub type os_sync_wait_on_address_flags_t = u32;
138 pub type os_sync_wake_by_address_flags_t = u32;
139
140 pub type os_unfair_lock = os_unfair_lock_s;
141 pub type os_unfair_lock_t = *mut os_unfair_lock;
142
143 pub type os_log_t = *mut c_void;
144 pub type os_log_type_t = u8;
145 pub type os_signpost_id_t = u64;
146 pub type os_signpost_type_t = u8;
147
148 pub type vm_statistics_t = *mut vm_statistics;
149 pub type vm_statistics_data_t = vm_statistics;
150 pub type vm_statistics64_t = *mut vm_statistics64;
151 pub type vm_statistics64_data_t = vm_statistics64;
152
153 pub type task_t = crate::mach_port_t;
154 pub type task_inspect_t = crate::mach_port_t;
155
156 pub type sysdir_search_path_enumeration_state = c_uint;
157
158 pub type CCStatus = i32;
159 pub type CCCryptorStatus = i32;
160 pub type CCRNGStatus = crate::CCCryptorStatus;
161
162 pub type copyfile_state_t = *mut c_void;
163 pub type copyfile_flags_t = u32;
164 pub type copyfile_callback_t = Option<
165 extern "C" fn(
166 c_int,
167 c_int,
168 copyfile_state_t,
169 *const c_char,
170 *const c_char,
171 *mut c_void,
172 ) -> c_int,
173 >;
174
175 pub type attrgroup_t = u32;
176 pub type vol_capabilities_set_t = [u32; 4];
177
178 deprecated_mach! {
179 pub type mach_timebase_info_data_t = mach_timebase_info;
180 }
181
182 #[cfg_attr(feature = "extra_traits", derive(Debug))]
183 pub enum timezone {}
184 impl Copy for timezone {}
185 impl Clone for timezone {
clone(&self) -> timezone186 fn clone(&self) -> timezone {
187 *self
188 }
189 }
190
191 #[cfg_attr(feature = "extra_traits", derive(Debug))]
192 #[repr(u32)]
193 pub 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 }
201 impl Copy for qos_class_t {}
202 impl Clone for qos_class_t {
clone(&self) -> qos_class_t203 fn clone(&self) -> qos_class_t {
204 *self
205 }
206 }
207
208 #[cfg_attr(feature = "extra_traits", derive(Debug))]
209 #[repr(u32)]
210 pub 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 }
236 impl Copy for sysdir_search_path_directory_t {}
237 impl Clone for sysdir_search_path_directory_t {
clone(&self) -> sysdir_search_path_directory_t238 fn clone(&self) -> sysdir_search_path_directory_t {
239 *self
240 }
241 }
242
243 #[cfg_attr(feature = "extra_traits", derive(Debug))]
244 #[repr(u32)]
245 pub 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 }
252 impl Copy for sysdir_search_path_domain_mask_t {}
253 impl Clone for sysdir_search_path_domain_mask_t {
clone(&self) -> sysdir_search_path_domain_mask_t254 fn clone(&self) -> sysdir_search_path_domain_mask_t {
255 *self
256 }
257 }
258
259 s! {
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 //Requires it to be union for tests
369 //pub si_value: crate::sigval,
370 _pad: [usize; 9],
371 }
372
373 pub struct sigaction {
374 // FIXME(union): this field is actually a union
375 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, /* unused */
396 pub reserved: c_uint, /* (to maintain 8-byte alignment) */
397 pub fp_offset: off_t, /* IN: start of the region */
398 pub fp_length: off_t, /* IN: size of the region */
399 }
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 /// This field does not exist anymore, the u32 is now part of a resized
521 /// `rmx_filler` array.
522 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], // MAXCOMLEN * 2, but macro isn't happy...
644 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 // sys/ipc.h:
772
773 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 // sys/sem.h
784
785 pub struct sembuf {
786 pub sem_num: c_ushort,
787 pub sem_op: c_short,
788 pub sem_flg: c_short,
789 }
790
791 // sys/shm.h
792
793 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 // net/ndrv.h
806 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 // sys/socket.h
813
814 pub struct sa_endpoints_t {
815 pub sae_srcif: c_uint, // optional source interface
816 pub sae_srcaddr: *const crate::sockaddr, // optional source address
817 pub sae_srcaddrlen: crate::socklen_t, // size of source address
818 pub sae_dstaddr: *const crate::sockaddr, // destination address
819 pub sae_dstaddrlen: crate::socklen_t, // size of destination address
820 }
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 // malloc/malloc.h
886 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 // sched.h
907 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 // Normally it's `vip_path: [c_char; MAXPATHLEN]` but because libc supports an old rustc
946 // version, we go around this limitation like this.
947 pub vip_path: [[c_char; 32]; 32],
948 }
949
950 pub struct proc_vnodepathinfo {
951 pub pvi_cdir: vnode_info_path,
952 pub pvi_rdir: vnode_info_path,
953 }
954
955 pub struct vm_statistics {
956 pub free_count: natural_t,
957 pub active_count: natural_t,
958 pub inactive_count: natural_t,
959 pub wire_count: natural_t,
960 pub zero_fill_count: natural_t,
961 pub reactivations: natural_t,
962 pub pageins: natural_t,
963 pub pageouts: natural_t,
964 pub faults: natural_t,
965 pub cow_faults: natural_t,
966 pub lookups: natural_t,
967 pub hits: natural_t,
968 pub purgeable_count: natural_t,
969 pub purges: natural_t,
970 pub speculative_count: natural_t,
971 }
972
973 pub struct task_thread_times_info {
974 pub user_time: time_value_t,
975 pub system_time: time_value_t,
976 }
977
978 pub struct rusage_info_v0 {
979 pub ri_uuid: [u8; 16],
980 pub ri_user_time: u64,
981 pub ri_system_time: u64,
982 pub ri_pkg_idle_wkups: u64,
983 pub ri_interrupt_wkups: u64,
984 pub ri_pageins: u64,
985 pub ri_wired_size: u64,
986 pub ri_resident_size: u64,
987 pub ri_phys_footprint: u64,
988 pub ri_proc_start_abstime: u64,
989 pub ri_proc_exit_abstime: u64,
990 }
991
992 pub struct rusage_info_v1 {
993 pub ri_uuid: [u8; 16],
994 pub ri_user_time: u64,
995 pub ri_system_time: u64,
996 pub ri_pkg_idle_wkups: u64,
997 pub ri_interrupt_wkups: u64,
998 pub ri_pageins: u64,
999 pub ri_wired_size: u64,
1000 pub ri_resident_size: u64,
1001 pub ri_phys_footprint: u64,
1002 pub ri_proc_start_abstime: u64,
1003 pub ri_proc_exit_abstime: u64,
1004 pub ri_child_user_time: u64,
1005 pub ri_child_system_time: u64,
1006 pub ri_child_pkg_idle_wkups: u64,
1007 pub ri_child_interrupt_wkups: u64,
1008 pub ri_child_pageins: u64,
1009 pub ri_child_elapsed_abstime: u64,
1010 }
1011
1012 pub struct rusage_info_v2 {
1013 pub ri_uuid: [u8; 16],
1014 pub ri_user_time: u64,
1015 pub ri_system_time: u64,
1016 pub ri_pkg_idle_wkups: u64,
1017 pub ri_interrupt_wkups: u64,
1018 pub ri_pageins: u64,
1019 pub ri_wired_size: u64,
1020 pub ri_resident_size: u64,
1021 pub ri_phys_footprint: u64,
1022 pub ri_proc_start_abstime: u64,
1023 pub ri_proc_exit_abstime: u64,
1024 pub ri_child_user_time: u64,
1025 pub ri_child_system_time: u64,
1026 pub ri_child_pkg_idle_wkups: u64,
1027 pub ri_child_interrupt_wkups: u64,
1028 pub ri_child_pageins: u64,
1029 pub ri_child_elapsed_abstime: u64,
1030 pub ri_diskio_bytesread: u64,
1031 pub ri_diskio_byteswritten: u64,
1032 }
1033
1034 pub struct rusage_info_v3 {
1035 pub ri_uuid: [u8; 16],
1036 pub ri_user_time: u64,
1037 pub ri_system_time: u64,
1038 pub ri_pkg_idle_wkups: u64,
1039 pub ri_interrupt_wkups: u64,
1040 pub ri_pageins: u64,
1041 pub ri_wired_size: u64,
1042 pub ri_resident_size: u64,
1043 pub ri_phys_footprint: u64,
1044 pub ri_proc_start_abstime: u64,
1045 pub ri_proc_exit_abstime: u64,
1046 pub ri_child_user_time: u64,
1047 pub ri_child_system_time: u64,
1048 pub ri_child_pkg_idle_wkups: u64,
1049 pub ri_child_interrupt_wkups: u64,
1050 pub ri_child_pageins: u64,
1051 pub ri_child_elapsed_abstime: u64,
1052 pub ri_diskio_bytesread: u64,
1053 pub ri_diskio_byteswritten: u64,
1054 pub ri_cpu_time_qos_default: u64,
1055 pub ri_cpu_time_qos_maintenance: u64,
1056 pub ri_cpu_time_qos_background: u64,
1057 pub ri_cpu_time_qos_utility: u64,
1058 pub ri_cpu_time_qos_legacy: u64,
1059 pub ri_cpu_time_qos_user_initiated: u64,
1060 pub ri_cpu_time_qos_user_interactive: u64,
1061 pub ri_billed_system_time: u64,
1062 pub ri_serviced_system_time: u64,
1063 }
1064
1065 pub struct rusage_info_v4 {
1066 pub ri_uuid: [u8; 16],
1067 pub ri_user_time: u64,
1068 pub ri_system_time: u64,
1069 pub ri_pkg_idle_wkups: u64,
1070 pub ri_interrupt_wkups: u64,
1071 pub ri_pageins: u64,
1072 pub ri_wired_size: u64,
1073 pub ri_resident_size: u64,
1074 pub ri_phys_footprint: u64,
1075 pub ri_proc_start_abstime: u64,
1076 pub ri_proc_exit_abstime: u64,
1077 pub ri_child_user_time: u64,
1078 pub ri_child_system_time: u64,
1079 pub ri_child_pkg_idle_wkups: u64,
1080 pub ri_child_interrupt_wkups: u64,
1081 pub ri_child_pageins: u64,
1082 pub ri_child_elapsed_abstime: u64,
1083 pub ri_diskio_bytesread: u64,
1084 pub ri_diskio_byteswritten: u64,
1085 pub ri_cpu_time_qos_default: u64,
1086 pub ri_cpu_time_qos_maintenance: u64,
1087 pub ri_cpu_time_qos_background: u64,
1088 pub ri_cpu_time_qos_utility: u64,
1089 pub ri_cpu_time_qos_legacy: u64,
1090 pub ri_cpu_time_qos_user_initiated: u64,
1091 pub ri_cpu_time_qos_user_interactive: u64,
1092 pub ri_billed_system_time: u64,
1093 pub ri_serviced_system_time: u64,
1094 pub ri_logical_writes: u64,
1095 pub ri_lifetime_max_phys_footprint: u64,
1096 pub ri_instructions: u64,
1097 pub ri_cycles: u64,
1098 pub ri_billed_energy: u64,
1099 pub ri_serviced_energy: u64,
1100 pub ri_interval_max_phys_footprint: u64,
1101 pub ri_runnable_time: u64,
1102 }
1103
1104 pub struct image_offset {
1105 pub uuid: crate::uuid_t,
1106 pub offset: u32,
1107 }
1108
1109 pub struct attrlist {
1110 pub bitmapcount: c_ushort,
1111 pub reserved: u16,
1112 pub commonattr: attrgroup_t,
1113 pub volattr: attrgroup_t,
1114 pub dirattr: attrgroup_t,
1115 pub fileattr: attrgroup_t,
1116 pub forkattr: attrgroup_t,
1117 }
1118
1119 pub struct attrreference_t {
1120 pub attr_dataoffset: i32,
1121 pub attr_length: u32,
1122 }
1123
1124 pub struct vol_capabilities_attr_t {
1125 pub capabilities: vol_capabilities_set_t,
1126 pub valid: vol_capabilities_set_t,
1127 }
1128
1129 pub struct attribute_set_t {
1130 pub commonattr: attrgroup_t,
1131 pub volattr: attrgroup_t,
1132 pub dirattr: attrgroup_t,
1133 pub fileattr: attrgroup_t,
1134 pub forkattr: attrgroup_t,
1135 }
1136
1137 pub struct vol_attributes_attr_t {
1138 pub validattr: attribute_set_t,
1139 pub nativeattr: attribute_set_t,
1140 }
1141
1142 #[repr(align(8))]
1143 pub struct tcp_connection_info {
1144 pub tcpi_state: u8,
1145 pub tcpi_snd_wscale: u8,
1146 pub tcpi_rcv_wscale: u8,
1147 __pad1: 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 // mach/host_info.h
1258 pub struct host_cpu_load_info {
1259 pub cpu_ticks: [crate::natural_t; CPU_STATE_MAX as usize],
1260 }
1261
1262 // net/if_mib.h
1263 pub struct ifmibdata {
1264 /// Name of interface
1265 pub ifmd_name: [c_char; crate::IFNAMSIZ],
1266 /// Number of promiscuous listeners
1267 pub ifmd_pcount: c_uint,
1268 /// Interface flags
1269 pub ifmd_flags: c_uint,
1270 /// Instantaneous length of send queue
1271 pub ifmd_snd_len: c_uint,
1272 /// Maximum length of send queue
1273 pub ifmd_snd_maxlen: c_uint,
1274 /// Number of drops in send queue
1275 pub ifmd_snd_drops: c_uint,
1276 /// For future expansion
1277 pub ifmd_filler: [c_uint; 4],
1278 /// Generic information and statistics
1279 pub ifmd_data: if_data64,
1280 }
1281
1282 pub struct ifs_iso_8802_3 {
1283 pub dot3StatsAlignmentErrors: u32,
1284 pub dot3StatsFCSErrors: u32,
1285 pub dot3StatsSingleCollisionFrames: u32,
1286 pub dot3StatsMultipleCollisionFrames: u32,
1287 pub dot3StatsSQETestErrors: u32,
1288 pub dot3StatsDeferredTransmissions: u32,
1289 pub dot3StatsLateCollisions: u32,
1290 pub dot3StatsExcessiveCollisions: u32,
1291 pub dot3StatsInternalMacTransmitErrors: u32,
1292 pub dot3StatsCarrierSenseErrors: u32,
1293 pub dot3StatsFrameTooLongs: u32,
1294 pub dot3StatsInternalMacReceiveErrors: u32,
1295 pub dot3StatsEtherChipSet: u32,
1296 pub dot3StatsMissedFrames: u32,
1297 pub dot3StatsCollFrequencies: [u32; 16],
1298 pub dot3Compliance: u32,
1299 }
1300
1301 // kern_control.h
1302 pub struct ctl_info {
1303 pub ctl_id: u32,
1304 pub ctl_name: [c_char; MAX_KCTL_NAME],
1305 }
1306
1307 // sys/proc_info.h
1308 pub struct proc_fdinfo {
1309 pub proc_fd: i32,
1310 pub proc_fdtype: u32,
1311 }
1312 }
1313
1314 s_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 // Note the manpage shows different types than the system header.
1334 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, // FIXME(macos): 64-bit wrong align => wrong offset
1352 pub shm_dtime: crate::time_t, // FIXME(macos): 64-bit wrong align => wrong offset
1353 pub shm_ctime: crate::time_t, // FIXME(macos): 64-bit wrong align => wrong offset
1354 // FIXME: 64-bit wrong align => wrong offset:
1355 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, //actually a function pointer
1440 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
1676 impl siginfo_t {
si_addr(&self) -> *mut c_void1677 pub unsafe fn si_addr(&self) -> *mut c_void {
1678 self.si_addr
1679 }
1680
si_value(&self) -> crate::sigval1681 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
si_pid(&self) -> crate::pid_t1697 pub unsafe fn si_pid(&self) -> crate::pid_t {
1698 self.si_pid
1699 }
1700
si_uid(&self) -> crate::uid_t1701 pub unsafe fn si_uid(&self) -> crate::uid_t {
1702 self.si_uid
1703 }
1704
si_status(&self) -> c_int1705 pub unsafe fn si_status(&self) -> c_int {
1706 self.si_status
1707 }
1708 }
1709
1710 s_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
1718 cfg_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
1734 cfg_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 // SAFETY: `ifconf` implements `Copy` so the reads are valid
1747 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 // Otherwise rustfmt crashes...
2398 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 // Otherwise rustfmt crashes...
2452 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
2748 pub const _UTX_USERSIZE: usize = 256;
2749 pub const _UTX_LINESIZE: usize = 32;
2750 pub const _UTX_IDSIZE: usize = 4;
2751 pub const _UTX_HOSTSIZE: usize = 256;
2752
2753 pub const EMPTY: c_short = 0;
2754 pub const RUN_LVL: c_short = 1;
2755 pub const BOOT_TIME: c_short = 2;
2756 pub const OLD_TIME: c_short = 3;
2757 pub const NEW_TIME: c_short = 4;
2758 pub const INIT_PROCESS: c_short = 5;
2759 pub const LOGIN_PROCESS: c_short = 6;
2760 pub const USER_PROCESS: c_short = 7;
2761 pub const DEAD_PROCESS: c_short = 8;
2762 pub const ACCOUNTING: c_short = 9;
2763 pub const SIGNATURE: c_short = 10;
2764 pub const SHUTDOWN_TIME: c_short = 11;
2765
2766 pub const LC_COLLATE_MASK: c_int = 1 << 0;
2767 pub const LC_CTYPE_MASK: c_int = 1 << 1;
2768 pub const LC_MESSAGES_MASK: c_int = 1 << 2;
2769 pub const LC_MONETARY_MASK: c_int = 1 << 3;
2770 pub const LC_NUMERIC_MASK: c_int = 1 << 4;
2771 pub const LC_TIME_MASK: c_int = 1 << 5;
2772 pub 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
2779 pub const CODESET: crate::nl_item = 0;
2780 pub const D_T_FMT: crate::nl_item = 1;
2781 pub const D_FMT: crate::nl_item = 2;
2782 pub const T_FMT: crate::nl_item = 3;
2783 pub const T_FMT_AMPM: crate::nl_item = 4;
2784 pub const AM_STR: crate::nl_item = 5;
2785 pub const PM_STR: crate::nl_item = 6;
2786
2787 pub const DAY_1: crate::nl_item = 7;
2788 pub const DAY_2: crate::nl_item = 8;
2789 pub const DAY_3: crate::nl_item = 9;
2790 pub const DAY_4: crate::nl_item = 10;
2791 pub const DAY_5: crate::nl_item = 11;
2792 pub const DAY_6: crate::nl_item = 12;
2793 pub const DAY_7: crate::nl_item = 13;
2794
2795 pub const ABDAY_1: crate::nl_item = 14;
2796 pub const ABDAY_2: crate::nl_item = 15;
2797 pub const ABDAY_3: crate::nl_item = 16;
2798 pub const ABDAY_4: crate::nl_item = 17;
2799 pub const ABDAY_5: crate::nl_item = 18;
2800 pub const ABDAY_6: crate::nl_item = 19;
2801 pub const ABDAY_7: crate::nl_item = 20;
2802
2803 pub const MON_1: crate::nl_item = 21;
2804 pub const MON_2: crate::nl_item = 22;
2805 pub const MON_3: crate::nl_item = 23;
2806 pub const MON_4: crate::nl_item = 24;
2807 pub const MON_5: crate::nl_item = 25;
2808 pub const MON_6: crate::nl_item = 26;
2809 pub const MON_7: crate::nl_item = 27;
2810 pub const MON_8: crate::nl_item = 28;
2811 pub const MON_9: crate::nl_item = 29;
2812 pub const MON_10: crate::nl_item = 30;
2813 pub const MON_11: crate::nl_item = 31;
2814 pub const MON_12: crate::nl_item = 32;
2815
2816 pub const ABMON_1: crate::nl_item = 33;
2817 pub const ABMON_2: crate::nl_item = 34;
2818 pub const ABMON_3: crate::nl_item = 35;
2819 pub const ABMON_4: crate::nl_item = 36;
2820 pub const ABMON_5: crate::nl_item = 37;
2821 pub const ABMON_6: crate::nl_item = 38;
2822 pub const ABMON_7: crate::nl_item = 39;
2823 pub const ABMON_8: crate::nl_item = 40;
2824 pub const ABMON_9: crate::nl_item = 41;
2825 pub const ABMON_10: crate::nl_item = 42;
2826 pub const ABMON_11: crate::nl_item = 43;
2827 pub const ABMON_12: crate::nl_item = 44;
2828
2829 pub const CLOCK_REALTIME: crate::clockid_t = 0;
2830 pub const CLOCK_MONOTONIC_RAW: crate::clockid_t = 4;
2831 pub const CLOCK_MONOTONIC_RAW_APPROX: crate::clockid_t = 5;
2832 pub const CLOCK_MONOTONIC: crate::clockid_t = 6;
2833 pub const CLOCK_UPTIME_RAW: crate::clockid_t = 8;
2834 pub const CLOCK_UPTIME_RAW_APPROX: crate::clockid_t = 9;
2835 pub const CLOCK_PROCESS_CPUTIME_ID: crate::clockid_t = 12;
2836 pub const CLOCK_THREAD_CPUTIME_ID: crate::clockid_t = 16;
2837
2838 pub const ERA: crate::nl_item = 45;
2839 pub const ERA_D_FMT: crate::nl_item = 46;
2840 pub const ERA_D_T_FMT: crate::nl_item = 47;
2841 pub const ERA_T_FMT: crate::nl_item = 48;
2842 pub const ALT_DIGITS: crate::nl_item = 49;
2843
2844 pub const RADIXCHAR: crate::nl_item = 50;
2845 pub const THOUSEP: crate::nl_item = 51;
2846
2847 pub const YESEXPR: crate::nl_item = 52;
2848 pub const NOEXPR: crate::nl_item = 53;
2849
2850 pub const YESSTR: crate::nl_item = 54;
2851 pub const NOSTR: crate::nl_item = 55;
2852
2853 pub const CRNCYSTR: crate::nl_item = 56;
2854
2855 pub const D_MD_ORDER: crate::nl_item = 57;
2856
2857 pub const EXIT_FAILURE: c_int = 1;
2858 pub const EXIT_SUCCESS: c_int = 0;
2859 pub const RAND_MAX: c_int = 2147483647;
2860 pub const EOF: c_int = -1;
2861 pub const SEEK_SET: c_int = 0;
2862 pub const SEEK_CUR: c_int = 1;
2863 pub const SEEK_END: c_int = 2;
2864 pub const SEEK_HOLE: c_int = 3;
2865 pub const SEEK_DATA: c_int = 4;
2866 pub const _IOFBF: c_int = 0;
2867 pub const _IONBF: c_int = 2;
2868 pub const _IOLBF: c_int = 1;
2869 pub const BUFSIZ: c_uint = 1024;
2870 pub const FOPEN_MAX: c_uint = 20;
2871 pub const FILENAME_MAX: c_uint = 1024;
2872 pub const L_tmpnam: c_uint = 1024;
2873 pub const TMP_MAX: c_uint = 308915776;
2874 pub const _PC_LINK_MAX: c_int = 1;
2875 pub const _PC_MAX_CANON: c_int = 2;
2876 pub const _PC_MAX_INPUT: c_int = 3;
2877 pub const _PC_NAME_MAX: c_int = 4;
2878 pub const _PC_PATH_MAX: c_int = 5;
2879 pub const _PC_PIPE_BUF: c_int = 6;
2880 pub const _PC_CHOWN_RESTRICTED: c_int = 7;
2881 pub const _PC_NO_TRUNC: c_int = 8;
2882 pub const _PC_VDISABLE: c_int = 9;
2883 pub const _PC_NAME_CHARS_MAX: c_int = 10;
2884 pub const _PC_CASE_SENSITIVE: c_int = 11;
2885 pub const _PC_CASE_PRESERVING: c_int = 12;
2886 pub const _PC_EXTENDED_SECURITY_NP: c_int = 13;
2887 pub const _PC_AUTH_OPAQUE_NP: c_int = 14;
2888 pub const _PC_2_SYMLINKS: c_int = 15;
2889 pub const _PC_ALLOC_SIZE_MIN: c_int = 16;
2890 pub const _PC_ASYNC_IO: c_int = 17;
2891 pub const _PC_FILESIZEBITS: c_int = 18;
2892 pub const _PC_PRIO_IO: c_int = 19;
2893 pub const _PC_REC_INCR_XFER_SIZE: c_int = 20;
2894 pub const _PC_REC_MAX_XFER_SIZE: c_int = 21;
2895 pub const _PC_REC_MIN_XFER_SIZE: c_int = 22;
2896 pub const _PC_REC_XFER_ALIGN: c_int = 23;
2897 pub const _PC_SYMLINK_MAX: c_int = 24;
2898 pub const _PC_SYNC_IO: c_int = 25;
2899 pub const _PC_XATTR_SIZE_BITS: c_int = 26;
2900 pub const _PC_MIN_HOLE_SIZE: c_int = 27;
2901 pub const O_EVTONLY: c_int = 0x00008000;
2902 pub const O_NOCTTY: c_int = 0x00020000;
2903 pub const O_DIRECTORY: c_int = 0x00100000;
2904 pub const O_SYMLINK: c_int = 0x00200000;
2905 pub const O_DSYNC: c_int = 0x00400000;
2906 pub const O_CLOEXEC: c_int = 0x01000000;
2907 pub const O_NOFOLLOW_ANY: c_int = 0x20000000;
2908 pub const O_EXEC: c_int = 0x40000000;
2909 pub const O_SEARCH: c_int = O_EXEC | O_DIRECTORY;
2910 pub const S_IFIFO: mode_t = 0o1_0000;
2911 pub const S_IFCHR: mode_t = 0o2_0000;
2912 pub const S_IFBLK: mode_t = 0o6_0000;
2913 pub const S_IFDIR: mode_t = 0o4_0000;
2914 pub const S_IFREG: mode_t = 0o10_0000;
2915 pub const S_IFLNK: mode_t = 0o12_0000;
2916 pub const S_IFSOCK: mode_t = 0o14_0000;
2917 pub const S_IFMT: mode_t = 0o17_0000;
2918 pub const S_IEXEC: mode_t = 0o0100;
2919 pub const S_IWRITE: mode_t = 0o0200;
2920 pub const S_IREAD: mode_t = 0o0400;
2921 pub const S_IRWXU: mode_t = 0o0700;
2922 pub const S_IXUSR: mode_t = 0o0100;
2923 pub const S_IWUSR: mode_t = 0o0200;
2924 pub const S_IRUSR: mode_t = 0o0400;
2925 pub const S_IRWXG: mode_t = 0o0070;
2926 pub const S_IXGRP: mode_t = 0o0010;
2927 pub const S_IWGRP: mode_t = 0o0020;
2928 pub const S_IRGRP: mode_t = 0o0040;
2929 pub const S_IRWXO: mode_t = 0o0007;
2930 pub const S_IXOTH: mode_t = 0o0001;
2931 pub const S_IWOTH: mode_t = 0o0002;
2932 pub const S_IROTH: mode_t = 0o0004;
2933 pub const F_OK: c_int = 0;
2934 pub const R_OK: c_int = 4;
2935 pub const W_OK: c_int = 2;
2936 pub const X_OK: c_int = 1;
2937 pub const STDIN_FILENO: c_int = 0;
2938 pub const STDOUT_FILENO: c_int = 1;
2939 pub const STDERR_FILENO: c_int = 2;
2940 pub const F_LOCK: c_int = 1;
2941 pub const F_TEST: c_int = 3;
2942 pub const F_TLOCK: c_int = 2;
2943 pub const F_ULOCK: c_int = 0;
2944 pub const F_GETLK: c_int = 7;
2945 pub const F_SETLK: c_int = 8;
2946 pub const F_SETLKW: c_int = 9;
2947 pub const SIGHUP: c_int = 1;
2948 pub const SIGINT: c_int = 2;
2949 pub const SIGQUIT: c_int = 3;
2950 pub const SIGILL: c_int = 4;
2951 pub const SIGABRT: c_int = 6;
2952 pub const SIGEMT: c_int = 7;
2953 pub const SIGFPE: c_int = 8;
2954 pub const SIGKILL: c_int = 9;
2955 pub const SIGSEGV: c_int = 11;
2956 pub const SIGPIPE: c_int = 13;
2957 pub const SIGALRM: c_int = 14;
2958 pub const SIGTERM: c_int = 15;
2959
2960 pub const PROT_NONE: c_int = 0;
2961 pub const PROT_READ: c_int = 1;
2962 pub const PROT_WRITE: c_int = 2;
2963 pub const PROT_EXEC: c_int = 4;
2964
2965 pub const PT_TRACE_ME: c_int = 0;
2966 pub const PT_READ_I: c_int = 1;
2967 pub const PT_READ_D: c_int = 2;
2968 pub const PT_READ_U: c_int = 3;
2969 pub const PT_WRITE_I: c_int = 4;
2970 pub const PT_WRITE_D: c_int = 5;
2971 pub const PT_WRITE_U: c_int = 6;
2972 pub const PT_CONTINUE: c_int = 7;
2973 pub const PT_KILL: c_int = 8;
2974 pub const PT_STEP: c_int = 9;
2975 pub const PT_ATTACH: c_int = 10;
2976 pub const PT_DETACH: c_int = 11;
2977 pub const PT_SIGEXC: c_int = 12;
2978 pub const PT_THUPDATE: c_int = 13;
2979 pub const PT_ATTACHEXC: c_int = 14;
2980
2981 pub const PT_FORCEQUOTA: c_int = 30;
2982 pub const PT_DENY_ATTACH: c_int = 31;
2983 pub const PT_FIRSTMACH: c_int = 32;
2984
2985 pub const MAP_FILE: c_int = 0x0000;
2986 pub const MAP_SHARED: c_int = 0x0001;
2987 pub const MAP_PRIVATE: c_int = 0x0002;
2988 pub const MAP_FIXED: c_int = 0x0010;
2989 pub const MAP_ANON: c_int = 0x1000;
2990 pub const MAP_ANONYMOUS: c_int = MAP_ANON;
2991
2992 pub const CPU_STATE_USER: c_int = 0;
2993 pub const CPU_STATE_SYSTEM: c_int = 1;
2994 pub const CPU_STATE_IDLE: c_int = 2;
2995 pub const CPU_STATE_NICE: c_int = 3;
2996 pub const CPU_STATE_MAX: c_int = 4;
2997
2998 pub const PROCESSOR_BASIC_INFO: c_int = 1;
2999 pub const PROCESSOR_CPU_LOAD_INFO: c_int = 2;
3000 pub const PROCESSOR_PM_REGS_INFO: c_int = 0x10000001;
3001 pub const PROCESSOR_TEMPERATURE: c_int = 0x10000002;
3002 pub const PROCESSOR_SET_LOAD_INFO: c_int = 4;
3003 pub const PROCESSOR_SET_BASIC_INFO: c_int = 5;
3004
3005 deprecated_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
3103 pub const MAP_FAILED: *mut c_void = !0 as *mut c_void;
3104
3105 pub const MCL_CURRENT: c_int = 0x0001;
3106 pub const MCL_FUTURE: c_int = 0x0002;
3107
3108 pub const MS_ASYNC: c_int = 0x0001;
3109 pub const MS_INVALIDATE: c_int = 0x0002;
3110 pub const MS_SYNC: c_int = 0x0010;
3111
3112 pub const MS_KILLPAGES: c_int = 0x0004;
3113 pub const MS_DEACTIVATE: c_int = 0x0008;
3114
3115 pub const EPERM: c_int = 1;
3116 pub const ENOENT: c_int = 2;
3117 pub const ESRCH: c_int = 3;
3118 pub const EINTR: c_int = 4;
3119 pub const EIO: c_int = 5;
3120 pub const ENXIO: c_int = 6;
3121 pub const E2BIG: c_int = 7;
3122 pub const ENOEXEC: c_int = 8;
3123 pub const EBADF: c_int = 9;
3124 pub const ECHILD: c_int = 10;
3125 pub const EDEADLK: c_int = 11;
3126 pub const ENOMEM: c_int = 12;
3127 pub const EACCES: c_int = 13;
3128 pub const EFAULT: c_int = 14;
3129 pub const ENOTBLK: c_int = 15;
3130 pub const EBUSY: c_int = 16;
3131 pub const EEXIST: c_int = 17;
3132 pub const EXDEV: c_int = 18;
3133 pub const ENODEV: c_int = 19;
3134 pub const ENOTDIR: c_int = 20;
3135 pub const EISDIR: c_int = 21;
3136 pub const EINVAL: c_int = 22;
3137 pub const ENFILE: c_int = 23;
3138 pub const EMFILE: c_int = 24;
3139 pub const ENOTTY: c_int = 25;
3140 pub const ETXTBSY: c_int = 26;
3141 pub const EFBIG: c_int = 27;
3142 pub const ENOSPC: c_int = 28;
3143 pub const ESPIPE: c_int = 29;
3144 pub const EROFS: c_int = 30;
3145 pub const EMLINK: c_int = 31;
3146 pub const EPIPE: c_int = 32;
3147 pub const EDOM: c_int = 33;
3148 pub const ERANGE: c_int = 34;
3149 pub const EAGAIN: c_int = 35;
3150 pub const EWOULDBLOCK: c_int = EAGAIN;
3151 pub const EINPROGRESS: c_int = 36;
3152 pub const EALREADY: c_int = 37;
3153 pub const ENOTSOCK: c_int = 38;
3154 pub const EDESTADDRREQ: c_int = 39;
3155 pub const EMSGSIZE: c_int = 40;
3156 pub const EPROTOTYPE: c_int = 41;
3157 pub const ENOPROTOOPT: c_int = 42;
3158 pub const EPROTONOSUPPORT: c_int = 43;
3159 pub const ESOCKTNOSUPPORT: c_int = 44;
3160 pub const ENOTSUP: c_int = 45;
3161 pub const EPFNOSUPPORT: c_int = 46;
3162 pub const EAFNOSUPPORT: c_int = 47;
3163 pub const EADDRINUSE: c_int = 48;
3164 pub const EADDRNOTAVAIL: c_int = 49;
3165 pub const ENETDOWN: c_int = 50;
3166 pub const ENETUNREACH: c_int = 51;
3167 pub const ENETRESET: c_int = 52;
3168 pub const ECONNABORTED: c_int = 53;
3169 pub const ECONNRESET: c_int = 54;
3170 pub const ENOBUFS: c_int = 55;
3171 pub const EISCONN: c_int = 56;
3172 pub const ENOTCONN: c_int = 57;
3173 pub const ESHUTDOWN: c_int = 58;
3174 pub const ETOOMANYREFS: c_int = 59;
3175 pub const ETIMEDOUT: c_int = 60;
3176 pub const ECONNREFUSED: c_int = 61;
3177 pub const ELOOP: c_int = 62;
3178 pub const ENAMETOOLONG: c_int = 63;
3179 pub const EHOSTDOWN: c_int = 64;
3180 pub const EHOSTUNREACH: c_int = 65;
3181 pub const ENOTEMPTY: c_int = 66;
3182 pub const EPROCLIM: c_int = 67;
3183 pub const EUSERS: c_int = 68;
3184 pub const EDQUOT: c_int = 69;
3185 pub const ESTALE: c_int = 70;
3186 pub const EREMOTE: c_int = 71;
3187 pub const EBADRPC: c_int = 72;
3188 pub const ERPCMISMATCH: c_int = 73;
3189 pub const EPROGUNAVAIL: c_int = 74;
3190 pub const EPROGMISMATCH: c_int = 75;
3191 pub const EPROCUNAVAIL: c_int = 76;
3192 pub const ENOLCK: c_int = 77;
3193 pub const ENOSYS: c_int = 78;
3194 pub const EFTYPE: c_int = 79;
3195 pub const EAUTH: c_int = 80;
3196 pub const ENEEDAUTH: c_int = 81;
3197 pub const EPWROFF: c_int = 82;
3198 pub const EDEVERR: c_int = 83;
3199 pub const EOVERFLOW: c_int = 84;
3200 pub const EBADEXEC: c_int = 85;
3201 pub const EBADARCH: c_int = 86;
3202 pub const ESHLIBVERS: c_int = 87;
3203 pub const EBADMACHO: c_int = 88;
3204 pub const ECANCELED: c_int = 89;
3205 pub const EIDRM: c_int = 90;
3206 pub const ENOMSG: c_int = 91;
3207 pub const EILSEQ: c_int = 92;
3208 pub const ENOATTR: c_int = 93;
3209 pub const EBADMSG: c_int = 94;
3210 pub const EMULTIHOP: c_int = 95;
3211 pub const ENODATA: c_int = 96;
3212 pub const ENOLINK: c_int = 97;
3213 pub const ENOSR: c_int = 98;
3214 pub const ENOSTR: c_int = 99;
3215 pub const EPROTO: c_int = 100;
3216 pub const ETIME: c_int = 101;
3217 pub const EOPNOTSUPP: c_int = 102;
3218 pub const ENOPOLICY: c_int = 103;
3219 pub const ENOTRECOVERABLE: c_int = 104;
3220 pub const EOWNERDEAD: c_int = 105;
3221 pub const EQFULL: c_int = 106;
3222 pub const ELAST: c_int = 106;
3223
3224 pub const EAI_AGAIN: c_int = 2;
3225 pub const EAI_BADFLAGS: c_int = 3;
3226 pub const EAI_FAIL: c_int = 4;
3227 pub const EAI_FAMILY: c_int = 5;
3228 pub const EAI_MEMORY: c_int = 6;
3229 pub const EAI_NODATA: c_int = 7;
3230 pub const EAI_NONAME: c_int = 8;
3231 pub const EAI_SERVICE: c_int = 9;
3232 pub const EAI_SOCKTYPE: c_int = 10;
3233 pub const EAI_SYSTEM: c_int = 11;
3234 pub const EAI_OVERFLOW: c_int = 14;
3235
3236 pub const F_DUPFD: c_int = 0;
3237 pub const F_DUPFD_CLOEXEC: c_int = 67;
3238 pub const F_GETFD: c_int = 1;
3239 pub const F_SETFD: c_int = 2;
3240 pub const F_GETFL: c_int = 3;
3241 pub const F_SETFL: c_int = 4;
3242 pub const F_PREALLOCATE: c_int = 42;
3243 pub const F_RDADVISE: c_int = 44;
3244 pub const F_RDAHEAD: c_int = 45;
3245 pub const F_NOCACHE: c_int = 48;
3246 pub const F_LOG2PHYS: c_int = 49;
3247 pub const F_GETPATH: c_int = 50;
3248 pub const F_FULLFSYNC: c_int = 51;
3249 pub const F_FREEZE_FS: c_int = 53;
3250 pub const F_THAW_FS: c_int = 54;
3251 pub const F_GLOBAL_NOCACHE: c_int = 55;
3252 pub const F_NODIRECT: c_int = 62;
3253 pub const F_LOG2PHYS_EXT: c_int = 65;
3254 pub const F_BARRIERFSYNC: c_int = 85;
3255 // See https://github.com/apple/darwin-xnu/blob/main/bsd/sys/fcntl.h
3256 pub const F_OFD_SETLK: c_int = 90; /* Acquire or release open file description lock */
3257 pub const F_OFD_SETLKW: c_int = 91; /* (as F_OFD_SETLK but blocking if conflicting lock) */
3258 pub const F_OFD_GETLK: c_int = 92; /* Examine OFD lock */
3259 pub const F_PUNCHHOLE: c_int = 99;
3260 pub const F_TRIM_ACTIVE_FILE: c_int = 100;
3261 pub const F_SPECULATIVE_READ: c_int = 101;
3262 pub const F_GETPATH_NOFIRMLINK: c_int = 102;
3263 pub const F_TRANSFEREXTENTS: c_int = 110;
3264
3265 pub const F_ALLOCATECONTIG: c_uint = 0x02;
3266 pub const F_ALLOCATEALL: c_uint = 0x04;
3267 pub const F_ALLOCATEPERSIST: c_uint = 0x08;
3268
3269 pub const F_PEOFPOSMODE: c_int = 3;
3270 pub const F_VOLPOSMODE: c_int = 4;
3271
3272 pub const AT_FDCWD: c_int = -2;
3273 pub const AT_EACCESS: c_int = 0x0010;
3274 pub const AT_SYMLINK_NOFOLLOW: c_int = 0x0020;
3275 pub const AT_SYMLINK_FOLLOW: c_int = 0x0040;
3276 pub const AT_REMOVEDIR: c_int = 0x0080;
3277
3278 pub const PTHREAD_INTROSPECTION_THREAD_CREATE: c_uint = 1;
3279 pub const PTHREAD_INTROSPECTION_THREAD_START: c_uint = 2;
3280 pub const PTHREAD_INTROSPECTION_THREAD_TERMINATE: c_uint = 3;
3281 pub const PTHREAD_INTROSPECTION_THREAD_DESTROY: c_uint = 4;
3282
3283 pub const TIOCMODG: c_ulong = 0x40047403;
3284 pub const TIOCMODS: c_ulong = 0x80047404;
3285 pub const TIOCM_LE: c_int = 0x1;
3286 pub const TIOCM_DTR: c_int = 0x2;
3287 pub const TIOCM_RTS: c_int = 0x4;
3288 pub const TIOCM_ST: c_int = 0x8;
3289 pub const TIOCM_SR: c_int = 0x10;
3290 pub const TIOCM_CTS: c_int = 0x20;
3291 pub const TIOCM_CAR: c_int = 0x40;
3292 pub const TIOCM_CD: c_int = 0x40;
3293 pub const TIOCM_RNG: c_int = 0x80;
3294 pub const TIOCM_RI: c_int = 0x80;
3295 pub const TIOCM_DSR: c_int = 0x100;
3296 pub const TIOCEXCL: c_int = 0x2000740d;
3297 pub const TIOCNXCL: c_int = 0x2000740e;
3298 pub const TIOCFLUSH: c_ulong = 0x80047410;
3299 pub const TIOCGETD: c_ulong = 0x4004741a;
3300 pub const TIOCSETD: c_ulong = 0x8004741b;
3301 pub const TIOCIXON: c_uint = 0x20007481;
3302 pub const TIOCIXOFF: c_uint = 0x20007480;
3303 pub const TIOCSDTR: c_uint = 0x20007479;
3304 pub const TIOCCDTR: c_uint = 0x20007478;
3305 pub const TIOCGPGRP: c_ulong = 0x40047477;
3306 pub const TIOCSPGRP: c_ulong = 0x80047476;
3307 pub const TIOCOUTQ: c_ulong = 0x40047473;
3308 pub const TIOCSTI: c_ulong = 0x80017472;
3309 pub const TIOCNOTTY: c_uint = 0x20007471;
3310 pub const TIOCPKT: c_ulong = 0x80047470;
3311 pub const TIOCPKT_DATA: c_int = 0x0;
3312 pub const TIOCPKT_FLUSHREAD: c_int = 0x1;
3313 pub const TIOCPKT_FLUSHWRITE: c_int = 0x2;
3314 pub const TIOCPKT_STOP: c_int = 0x4;
3315 pub const TIOCPKT_START: c_int = 0x8;
3316 pub const TIOCPKT_NOSTOP: c_int = 0x10;
3317 pub const TIOCPKT_DOSTOP: c_int = 0x20;
3318 pub const TIOCPKT_IOCTL: c_int = 0x40;
3319 pub const TIOCSTOP: c_uint = 0x2000746f;
3320 pub const TIOCSTART: c_uint = 0x2000746e;
3321 pub const TIOCMSET: c_ulong = 0x8004746d;
3322 pub const TIOCMBIS: c_ulong = 0x8004746c;
3323 pub const TIOCMBIC: c_ulong = 0x8004746b;
3324 pub const TIOCMGET: c_ulong = 0x4004746a;
3325 pub const TIOCREMOTE: c_ulong = 0x80047469;
3326 pub const TIOCGWINSZ: c_ulong = 0x40087468;
3327 pub const TIOCSWINSZ: c_ulong = 0x80087467;
3328 pub const TIOCUCNTL: c_ulong = 0x80047466;
3329 pub const TIOCSTAT: c_uint = 0x20007465;
3330 pub const TIOCSCONS: c_uint = 0x20007463;
3331 pub const TIOCCONS: c_ulong = 0x80047462;
3332 pub const TIOCSCTTY: c_uint = 0x20007461;
3333 pub const TIOCEXT: c_ulong = 0x80047460;
3334 pub const TIOCSIG: c_uint = 0x2000745f;
3335 pub const TIOCDRAIN: c_uint = 0x2000745e;
3336 pub const TIOCMSDTRWAIT: c_ulong = 0x8004745b;
3337 pub const TIOCMGDTRWAIT: c_ulong = 0x4004745a;
3338 pub const TIOCSDRAINWAIT: c_ulong = 0x80047457;
3339 pub const TIOCGDRAINWAIT: c_ulong = 0x40047456;
3340 pub const TIOCDSIMICROCODE: c_uint = 0x20007455;
3341 pub const TIOCPTYGRANT: c_uint = 0x20007454;
3342 pub const TIOCPTYGNAME: c_uint = 0x40807453;
3343 pub const TIOCPTYUNLK: c_uint = 0x20007452;
3344
3345 pub const BIOCGRSIG: c_ulong = 0x40044272;
3346 pub const BIOCSRSIG: c_ulong = 0x80044273;
3347 pub const BIOCSDLT: c_ulong = 0x80044278;
3348 pub const BIOCGSEESENT: c_ulong = 0x40044276;
3349 pub const BIOCSSEESENT: c_ulong = 0x80044277;
3350 pub const BIOCGDLTLIST: c_ulong = 0xc00c4279;
3351
3352 pub const FIODTYPE: c_ulong = 0x4004667a;
3353
3354 pub const B0: speed_t = 0;
3355 pub const B50: speed_t = 50;
3356 pub const B75: speed_t = 75;
3357 pub const B110: speed_t = 110;
3358 pub const B134: speed_t = 134;
3359 pub const B150: speed_t = 150;
3360 pub const B200: speed_t = 200;
3361 pub const B300: speed_t = 300;
3362 pub const B600: speed_t = 600;
3363 pub const B1200: speed_t = 1200;
3364 pub const B1800: speed_t = 1800;
3365 pub const B2400: speed_t = 2400;
3366 pub const B4800: speed_t = 4800;
3367 pub const B9600: speed_t = 9600;
3368 pub const B19200: speed_t = 19200;
3369 pub const B38400: speed_t = 38400;
3370 pub const B7200: speed_t = 7200;
3371 pub const B14400: speed_t = 14400;
3372 pub const B28800: speed_t = 28800;
3373 pub const B57600: speed_t = 57600;
3374 pub const B76800: speed_t = 76800;
3375 pub const B115200: speed_t = 115200;
3376 pub const B230400: speed_t = 230400;
3377 pub const EXTA: speed_t = 19200;
3378 pub const EXTB: speed_t = 38400;
3379
3380 pub const SIGTRAP: c_int = 5;
3381
3382 pub const GLOB_APPEND: c_int = 0x0001;
3383 pub const GLOB_DOOFFS: c_int = 0x0002;
3384 pub const GLOB_ERR: c_int = 0x0004;
3385 pub const GLOB_MARK: c_int = 0x0008;
3386 pub const GLOB_NOCHECK: c_int = 0x0010;
3387 pub const GLOB_NOSORT: c_int = 0x0020;
3388 pub const GLOB_NOESCAPE: c_int = 0x2000;
3389
3390 pub const GLOB_NOSPACE: c_int = -1;
3391 pub const GLOB_ABORTED: c_int = -2;
3392 pub const GLOB_NOMATCH: c_int = -3;
3393
3394 pub const POSIX_MADV_NORMAL: c_int = 0;
3395 pub const POSIX_MADV_RANDOM: c_int = 1;
3396 pub const POSIX_MADV_SEQUENTIAL: c_int = 2;
3397 pub const POSIX_MADV_WILLNEED: c_int = 3;
3398 pub const POSIX_MADV_DONTNEED: c_int = 4;
3399
3400 pub const _SC_IOV_MAX: c_int = 56;
3401 pub const _SC_GETGR_R_SIZE_MAX: c_int = 70;
3402 pub const _SC_GETPW_R_SIZE_MAX: c_int = 71;
3403 pub const _SC_LOGIN_NAME_MAX: c_int = 73;
3404 pub const _SC_MQ_PRIO_MAX: c_int = 75;
3405 pub const _SC_THREAD_ATTR_STACKADDR: c_int = 82;
3406 pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 83;
3407 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 85;
3408 pub const _SC_THREAD_KEYS_MAX: c_int = 86;
3409 pub const _SC_THREAD_PRIO_INHERIT: c_int = 87;
3410 pub const _SC_THREAD_PRIO_PROTECT: c_int = 88;
3411 pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 89;
3412 pub const _SC_THREAD_PROCESS_SHARED: c_int = 90;
3413 pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 91;
3414 pub const _SC_THREAD_STACK_MIN: c_int = 93;
3415 pub const _SC_THREAD_THREADS_MAX: c_int = 94;
3416 pub const _SC_THREADS: c_int = 96;
3417 pub const _SC_TTY_NAME_MAX: c_int = 101;
3418 pub const _SC_ATEXIT_MAX: c_int = 107;
3419 pub const _SC_XOPEN_CRYPT: c_int = 108;
3420 pub const _SC_XOPEN_ENH_I18N: c_int = 109;
3421 pub const _SC_XOPEN_LEGACY: c_int = 110;
3422 pub const _SC_XOPEN_REALTIME: c_int = 111;
3423 pub const _SC_XOPEN_REALTIME_THREADS: c_int = 112;
3424 pub const _SC_XOPEN_SHM: c_int = 113;
3425 pub const _SC_XOPEN_UNIX: c_int = 115;
3426 pub const _SC_XOPEN_VERSION: c_int = 116;
3427 pub const _SC_XOPEN_XCU_VERSION: c_int = 121;
3428 pub const _SC_PHYS_PAGES: c_int = 200;
3429
3430 pub const PTHREAD_PROCESS_PRIVATE: c_int = 2;
3431 pub const PTHREAD_PROCESS_SHARED: c_int = 1;
3432 pub const PTHREAD_CREATE_JOINABLE: c_int = 1;
3433 pub const PTHREAD_CREATE_DETACHED: c_int = 2;
3434 pub const PTHREAD_INHERIT_SCHED: c_int = 1;
3435 pub const PTHREAD_EXPLICIT_SCHED: c_int = 2;
3436 pub const PTHREAD_CANCEL_ENABLE: c_int = 0x01;
3437 pub const PTHREAD_CANCEL_DISABLE: c_int = 0x00;
3438 pub const PTHREAD_CANCEL_DEFERRED: c_int = 0x02;
3439 pub const PTHREAD_CANCEL_ASYNCHRONOUS: c_int = 0x00;
3440 pub const PTHREAD_CANCELED: *mut c_void = 1 as *mut c_void;
3441 pub const PTHREAD_SCOPE_SYSTEM: c_int = 1;
3442 pub const PTHREAD_SCOPE_PROCESS: c_int = 2;
3443 pub const PTHREAD_PRIO_NONE: c_int = 0;
3444 pub const PTHREAD_PRIO_INHERIT: c_int = 1;
3445 pub const PTHREAD_PRIO_PROTECT: c_int = 2;
3446
3447 #[cfg(target_arch = "aarch64")]
3448 pub const PTHREAD_STACK_MIN: size_t = 16384;
3449 #[cfg(not(target_arch = "aarch64"))]
3450 pub const PTHREAD_STACK_MIN: size_t = 8192;
3451
3452 pub const RLIMIT_CPU: c_int = 0;
3453 pub const RLIMIT_FSIZE: c_int = 1;
3454 pub const RLIMIT_DATA: c_int = 2;
3455 pub const RLIMIT_STACK: c_int = 3;
3456 pub const RLIMIT_CORE: c_int = 4;
3457 pub const RLIMIT_AS: c_int = 5;
3458 pub const RLIMIT_RSS: c_int = RLIMIT_AS;
3459 pub const RLIMIT_MEMLOCK: c_int = 6;
3460 pub const RLIMIT_NPROC: c_int = 7;
3461 pub const RLIMIT_NOFILE: c_int = 8;
3462 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
3463 pub const RLIM_NLIMITS: c_int = 9;
3464 pub const _RLIMIT_POSIX_FLAG: c_int = 0x1000;
3465
3466 pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
3467
3468 pub const RUSAGE_SELF: c_int = 0;
3469 pub const RUSAGE_CHILDREN: c_int = -1;
3470
3471 pub const MADV_NORMAL: c_int = 0;
3472 pub const MADV_RANDOM: c_int = 1;
3473 pub const MADV_SEQUENTIAL: c_int = 2;
3474 pub const MADV_WILLNEED: c_int = 3;
3475 pub const MADV_DONTNEED: c_int = 4;
3476 pub const MADV_FREE: c_int = 5;
3477 pub const MADV_ZERO_WIRED_PAGES: c_int = 6;
3478 pub const MADV_FREE_REUSABLE: c_int = 7;
3479 pub const MADV_FREE_REUSE: c_int = 8;
3480 pub const MADV_CAN_REUSE: c_int = 9;
3481
3482 pub const MINCORE_INCORE: c_int = 0x1;
3483 pub const MINCORE_REFERENCED: c_int = 0x2;
3484 pub const MINCORE_MODIFIED: c_int = 0x4;
3485 pub const MINCORE_REFERENCED_OTHER: c_int = 0x8;
3486 pub const MINCORE_MODIFIED_OTHER: c_int = 0x10;
3487
3488 pub const CTLIOCGINFO: c_ulong = 0xc0644e03;
3489
3490 //
3491 // sys/netinet/in.h
3492 // Protocols (RFC 1700)
3493 // NOTE: These are in addition to the constants defined in src/unix/mod.rs
3494
3495 // IPPROTO_IP defined in src/unix/mod.rs
3496 /// IP6 hop-by-hop options
3497 pub const IPPROTO_HOPOPTS: c_int = 0;
3498 // IPPROTO_ICMP defined in src/unix/mod.rs
3499 /// group mgmt protocol
3500 pub const IPPROTO_IGMP: c_int = 2;
3501 /// gateway<sup>2</sup> (deprecated)
3502 pub const IPPROTO_GGP: c_int = 3;
3503 /// for compatibility
3504 pub const IPPROTO_IPIP: c_int = 4;
3505 // IPPROTO_TCP defined in src/unix/mod.rs
3506 /// Stream protocol II.
3507 pub const IPPROTO_ST: c_int = 7;
3508 /// exterior gateway protocol
3509 pub const IPPROTO_EGP: c_int = 8;
3510 /// private interior gateway
3511 pub const IPPROTO_PIGP: c_int = 9;
3512 /// BBN RCC Monitoring
3513 pub const IPPROTO_RCCMON: c_int = 10;
3514 /// network voice protocol
3515 pub const IPPROTO_NVPII: c_int = 11;
3516 /// pup
3517 pub const IPPROTO_PUP: c_int = 12;
3518 /// Argus
3519 pub const IPPROTO_ARGUS: c_int = 13;
3520 /// EMCON
3521 pub const IPPROTO_EMCON: c_int = 14;
3522 /// Cross Net Debugger
3523 pub const IPPROTO_XNET: c_int = 15;
3524 /// Chaos
3525 pub const IPPROTO_CHAOS: c_int = 16;
3526 // IPPROTO_UDP defined in src/unix/mod.rs
3527 /// Multiplexing
3528 pub const IPPROTO_MUX: c_int = 18;
3529 /// DCN Measurement Subsystems
3530 pub const IPPROTO_MEAS: c_int = 19;
3531 /// Host Monitoring
3532 pub const IPPROTO_HMP: c_int = 20;
3533 /// Packet Radio Measurement
3534 pub const IPPROTO_PRM: c_int = 21;
3535 /// xns idp
3536 pub const IPPROTO_IDP: c_int = 22;
3537 /// Trunk-1
3538 pub const IPPROTO_TRUNK1: c_int = 23;
3539 /// Trunk-2
3540 pub const IPPROTO_TRUNK2: c_int = 24;
3541 /// Leaf-1
3542 pub const IPPROTO_LEAF1: c_int = 25;
3543 /// Leaf-2
3544 pub const IPPROTO_LEAF2: c_int = 26;
3545 /// Reliable Data
3546 pub const IPPROTO_RDP: c_int = 27;
3547 /// Reliable Transaction
3548 pub const IPPROTO_IRTP: c_int = 28;
3549 /// tp-4 w/ class negotiation
3550 pub const IPPROTO_TP: c_int = 29;
3551 /// Bulk Data Transfer
3552 pub const IPPROTO_BLT: c_int = 30;
3553 /// Network Services
3554 pub const IPPROTO_NSP: c_int = 31;
3555 /// Merit Internodal
3556 pub const IPPROTO_INP: c_int = 32;
3557 /// Sequential Exchange
3558 pub const IPPROTO_SEP: c_int = 33;
3559 /// Third Party Connect
3560 pub const IPPROTO_3PC: c_int = 34;
3561 /// InterDomain Policy Routing
3562 pub const IPPROTO_IDPR: c_int = 35;
3563 /// XTP
3564 pub const IPPROTO_XTP: c_int = 36;
3565 /// Datagram Delivery
3566 pub const IPPROTO_DDP: c_int = 37;
3567 /// Control Message Transport
3568 pub const IPPROTO_CMTP: c_int = 38;
3569 /// TP++ Transport
3570 pub const IPPROTO_TPXX: c_int = 39;
3571 /// IL transport protocol
3572 pub const IPPROTO_IL: c_int = 40;
3573 // IPPROTO_IPV6 defined in src/unix/mod.rs
3574 /// Source Demand Routing
3575 pub const IPPROTO_SDRP: c_int = 42;
3576 /// IP6 routing header
3577 pub const IPPROTO_ROUTING: c_int = 43;
3578 /// IP6 fragmentation header
3579 pub const IPPROTO_FRAGMENT: c_int = 44;
3580 /// InterDomain Routing
3581 pub const IPPROTO_IDRP: c_int = 45;
3582 /// resource reservation
3583 pub const IPPROTO_RSVP: c_int = 46;
3584 /// General Routing Encap.
3585 pub const IPPROTO_GRE: c_int = 47;
3586 /// Mobile Host Routing
3587 pub const IPPROTO_MHRP: c_int = 48;
3588 /// BHA
3589 pub const IPPROTO_BHA: c_int = 49;
3590 /// IP6 Encap Sec. Payload
3591 pub const IPPROTO_ESP: c_int = 50;
3592 /// IP6 Auth Header
3593 pub const IPPROTO_AH: c_int = 51;
3594 /// Integ. Net Layer Security
3595 pub const IPPROTO_INLSP: c_int = 52;
3596 /// IP with encryption
3597 pub const IPPROTO_SWIPE: c_int = 53;
3598 /// Next Hop Resolution
3599 pub const IPPROTO_NHRP: c_int = 54;
3600 /* 55-57: Unassigned */
3601 // IPPROTO_ICMPV6 defined in src/unix/mod.rs
3602 /// IP6 no next header
3603 pub const IPPROTO_NONE: c_int = 59;
3604 /// IP6 destination option
3605 pub const IPPROTO_DSTOPTS: c_int = 60;
3606 /// any host internal protocol
3607 pub const IPPROTO_AHIP: c_int = 61;
3608 /// CFTP
3609 pub const IPPROTO_CFTP: c_int = 62;
3610 /// "hello" routing protocol
3611 pub const IPPROTO_HELLO: c_int = 63;
3612 /// SATNET/Backroom EXPAK
3613 pub const IPPROTO_SATEXPAK: c_int = 64;
3614 /// Kryptolan
3615 pub const IPPROTO_KRYPTOLAN: c_int = 65;
3616 /// Remote Virtual Disk
3617 pub const IPPROTO_RVD: c_int = 66;
3618 /// Pluribus Packet Core
3619 pub const IPPROTO_IPPC: c_int = 67;
3620 /// Any distributed FS
3621 pub const IPPROTO_ADFS: c_int = 68;
3622 /// Satnet Monitoring
3623 pub const IPPROTO_SATMON: c_int = 69;
3624 /// VISA Protocol
3625 pub const IPPROTO_VISA: c_int = 70;
3626 /// Packet Core Utility
3627 pub const IPPROTO_IPCV: c_int = 71;
3628 /// Comp. Prot. Net. Executive
3629 pub const IPPROTO_CPNX: c_int = 72;
3630 /// Comp. Prot. HeartBeat
3631 pub const IPPROTO_CPHB: c_int = 73;
3632 /// Wang Span Network
3633 pub const IPPROTO_WSN: c_int = 74;
3634 /// Packet Video Protocol
3635 pub const IPPROTO_PVP: c_int = 75;
3636 /// BackRoom SATNET Monitoring
3637 pub const IPPROTO_BRSATMON: c_int = 76;
3638 /// Sun net disk proto (temp.)
3639 pub const IPPROTO_ND: c_int = 77;
3640 /// WIDEBAND Monitoring
3641 pub const IPPROTO_WBMON: c_int = 78;
3642 /// WIDEBAND EXPAK
3643 pub const IPPROTO_WBEXPAK: c_int = 79;
3644 /// ISO cnlp
3645 pub const IPPROTO_EON: c_int = 80;
3646 /// VMTP
3647 pub const IPPROTO_VMTP: c_int = 81;
3648 /// Secure VMTP
3649 pub const IPPROTO_SVMTP: c_int = 82;
3650 /// Banyon VINES
3651 pub const IPPROTO_VINES: c_int = 83;
3652 /// TTP
3653 pub const IPPROTO_TTP: c_int = 84;
3654 /// NSFNET-IGP
3655 pub const IPPROTO_IGP: c_int = 85;
3656 /// dissimilar gateway prot.
3657 pub const IPPROTO_DGP: c_int = 86;
3658 /// TCF
3659 pub const IPPROTO_TCF: c_int = 87;
3660 /// Cisco/GXS IGRP
3661 pub const IPPROTO_IGRP: c_int = 88;
3662 /// OSPFIGP
3663 pub const IPPROTO_OSPFIGP: c_int = 89;
3664 /// Strite RPC protocol
3665 pub const IPPROTO_SRPC: c_int = 90;
3666 /// Locus Address Resoloution
3667 pub const IPPROTO_LARP: c_int = 91;
3668 /// Multicast Transport
3669 pub const IPPROTO_MTP: c_int = 92;
3670 /// AX.25 Frames
3671 pub const IPPROTO_AX25: c_int = 93;
3672 /// IP encapsulated in IP
3673 pub const IPPROTO_IPEIP: c_int = 94;
3674 /// Mobile Int.ing control
3675 pub const IPPROTO_MICP: c_int = 95;
3676 /// Semaphore Comm. security
3677 pub const IPPROTO_SCCSP: c_int = 96;
3678 /// Ethernet IP encapsulation
3679 pub const IPPROTO_ETHERIP: c_int = 97;
3680 /// encapsulation header
3681 pub const IPPROTO_ENCAP: c_int = 98;
3682 /// any private encr. scheme
3683 pub const IPPROTO_APES: c_int = 99;
3684 /// GMTP
3685 pub const IPPROTO_GMTP: c_int = 100;
3686
3687 /* 101-254: Partly Unassigned */
3688 /// Protocol Independent Mcast
3689 pub const IPPROTO_PIM: c_int = 103;
3690 /// payload compression (IPComp)
3691 pub const IPPROTO_IPCOMP: c_int = 108;
3692 /// PGM
3693 pub const IPPROTO_PGM: c_int = 113;
3694 /// SCTP
3695 pub const IPPROTO_SCTP: c_int = 132;
3696
3697 /* 255: Reserved */
3698 /* BSD Private, local use, namespace incursion */
3699 /// divert pseudo-protocol
3700 pub const IPPROTO_DIVERT: c_int = 254;
3701 /// raw IP packet
3702 pub const IPPROTO_RAW: c_int = 255;
3703 pub const IPPROTO_MAX: c_int = 256;
3704 /// last return value of *_input(), meaning "all job for this pkt is done".
3705 pub const IPPROTO_DONE: c_int = 257;
3706
3707 pub const AF_UNSPEC: c_int = 0;
3708 pub const AF_LOCAL: c_int = 1;
3709 pub const AF_UNIX: c_int = AF_LOCAL;
3710 pub const AF_INET: c_int = 2;
3711 pub const AF_IMPLINK: c_int = 3;
3712 pub const AF_PUP: c_int = 4;
3713 pub const AF_CHAOS: c_int = 5;
3714 pub const AF_NS: c_int = 6;
3715 pub const AF_ISO: c_int = 7;
3716 pub const AF_OSI: c_int = AF_ISO;
3717 pub const AF_ECMA: c_int = 8;
3718 pub const AF_DATAKIT: c_int = 9;
3719 pub const AF_CCITT: c_int = 10;
3720 pub const AF_SNA: c_int = 11;
3721 pub const AF_DECnet: c_int = 12;
3722 pub const AF_DLI: c_int = 13;
3723 pub const AF_LAT: c_int = 14;
3724 pub const AF_HYLINK: c_int = 15;
3725 pub const AF_APPLETALK: c_int = 16;
3726 pub const AF_ROUTE: c_int = 17;
3727 pub const AF_LINK: c_int = 18;
3728 pub const pseudo_AF_XTP: c_int = 19;
3729 pub const AF_COIP: c_int = 20;
3730 pub const AF_CNT: c_int = 21;
3731 pub const pseudo_AF_RTIP: c_int = 22;
3732 pub const AF_IPX: c_int = 23;
3733 pub const AF_SIP: c_int = 24;
3734 pub const pseudo_AF_PIP: c_int = 25;
3735 pub const AF_NDRV: c_int = 27;
3736 pub const AF_ISDN: c_int = 28;
3737 pub const AF_E164: c_int = AF_ISDN;
3738 pub const pseudo_AF_KEY: c_int = 29;
3739 pub const AF_INET6: c_int = 30;
3740 pub const AF_NATM: c_int = 31;
3741 pub const AF_SYSTEM: c_int = 32;
3742 pub const AF_NETBIOS: c_int = 33;
3743 pub const AF_PPP: c_int = 34;
3744 pub const pseudo_AF_HDRCMPLT: c_int = 35;
3745 pub const AF_IEEE80211: c_int = 37;
3746 pub const AF_UTUN: c_int = 38;
3747 pub const AF_VSOCK: c_int = 40;
3748 pub const AF_SYS_CONTROL: c_int = 2;
3749
3750 pub const SYSPROTO_EVENT: c_int = 1;
3751 pub const SYSPROTO_CONTROL: c_int = 2;
3752
3753 pub const PF_UNSPEC: c_int = AF_UNSPEC;
3754 pub const PF_LOCAL: c_int = AF_LOCAL;
3755 pub const PF_UNIX: c_int = PF_LOCAL;
3756 pub const PF_INET: c_int = AF_INET;
3757 pub const PF_IMPLINK: c_int = AF_IMPLINK;
3758 pub const PF_PUP: c_int = AF_PUP;
3759 pub const PF_CHAOS: c_int = AF_CHAOS;
3760 pub const PF_NS: c_int = AF_NS;
3761 pub const PF_ISO: c_int = AF_ISO;
3762 pub const PF_OSI: c_int = AF_ISO;
3763 pub const PF_ECMA: c_int = AF_ECMA;
3764 pub const PF_DATAKIT: c_int = AF_DATAKIT;
3765 pub const PF_CCITT: c_int = AF_CCITT;
3766 pub const PF_SNA: c_int = AF_SNA;
3767 pub const PF_DECnet: c_int = AF_DECnet;
3768 pub const PF_DLI: c_int = AF_DLI;
3769 pub const PF_LAT: c_int = AF_LAT;
3770 pub const PF_HYLINK: c_int = AF_HYLINK;
3771 pub const PF_APPLETALK: c_int = AF_APPLETALK;
3772 pub const PF_ROUTE: c_int = AF_ROUTE;
3773 pub const PF_LINK: c_int = AF_LINK;
3774 pub const PF_XTP: c_int = pseudo_AF_XTP;
3775 pub const PF_COIP: c_int = AF_COIP;
3776 pub const PF_CNT: c_int = AF_CNT;
3777 pub const PF_SIP: c_int = AF_SIP;
3778 pub const PF_IPX: c_int = AF_IPX;
3779 pub const PF_RTIP: c_int = pseudo_AF_RTIP;
3780 pub const PF_PIP: c_int = pseudo_AF_PIP;
3781 pub const PF_NDRV: c_int = AF_NDRV;
3782 pub const PF_ISDN: c_int = AF_ISDN;
3783 pub const PF_KEY: c_int = pseudo_AF_KEY;
3784 pub const PF_INET6: c_int = AF_INET6;
3785 pub const PF_NATM: c_int = AF_NATM;
3786 pub const PF_SYSTEM: c_int = AF_SYSTEM;
3787 pub const PF_NETBIOS: c_int = AF_NETBIOS;
3788 pub const PF_PPP: c_int = AF_PPP;
3789 pub const PF_VSOCK: c_int = AF_VSOCK;
3790
3791 pub const NET_RT_DUMP: c_int = 1;
3792 pub const NET_RT_FLAGS: c_int = 2;
3793 pub const NET_RT_IFLIST: c_int = 3;
3794
3795 pub const SOMAXCONN: c_int = 128;
3796
3797 pub const SOCK_MAXADDRLEN: c_int = 255;
3798
3799 pub const SOCK_STREAM: c_int = 1;
3800 pub const SOCK_DGRAM: c_int = 2;
3801 pub const SOCK_RAW: c_int = 3;
3802 pub const SOCK_RDM: c_int = 4;
3803 pub const SOCK_SEQPACKET: c_int = 5;
3804 pub const IP_TTL: c_int = 4;
3805 pub const IP_HDRINCL: c_int = 2;
3806 pub const IP_RECVDSTADDR: c_int = 7;
3807 pub const IP_ADD_MEMBERSHIP: c_int = 12;
3808 pub const IP_DROP_MEMBERSHIP: c_int = 13;
3809 pub const IP_RECVIF: c_int = 20;
3810 pub const IP_RECVTTL: c_int = 24;
3811 pub const IP_BOUND_IF: c_int = 25;
3812 pub const IP_PKTINFO: c_int = 26;
3813 pub const IP_RECVTOS: c_int = 27;
3814 pub const IP_DONTFRAG: c_int = 28;
3815 pub const IPV6_JOIN_GROUP: c_int = 12;
3816 pub const IPV6_LEAVE_GROUP: c_int = 13;
3817 pub const IPV6_CHECKSUM: c_int = 26;
3818 pub const IPV6_RECVTCLASS: c_int = 35;
3819 pub const IPV6_TCLASS: c_int = 36;
3820 pub const IPV6_RECVHOPLIMIT: c_int = 37;
3821 pub const IPV6_PKTINFO: c_int = 46;
3822 pub const IPV6_HOPLIMIT: c_int = 47;
3823 pub const IPV6_RECVPKTINFO: c_int = 61;
3824 pub const IP_ADD_SOURCE_MEMBERSHIP: c_int = 70;
3825 pub const IP_DROP_SOURCE_MEMBERSHIP: c_int = 71;
3826 pub const IP_BLOCK_SOURCE: c_int = 72;
3827 pub const IP_UNBLOCK_SOURCE: c_int = 73;
3828 pub const IPV6_BOUND_IF: c_int = 125;
3829
3830 pub const TCP_NOPUSH: c_int = 4;
3831 pub const TCP_NOOPT: c_int = 8;
3832 pub const TCP_KEEPALIVE: c_int = 0x10;
3833 pub const TCP_KEEPINTVL: c_int = 0x101;
3834 pub const TCP_KEEPCNT: c_int = 0x102;
3835 /// Enable/Disable TCP Fastopen on this socket
3836 pub const TCP_FASTOPEN: c_int = 0x105;
3837 pub const TCP_CONNECTION_INFO: c_int = 0x106;
3838
3839 pub const SOL_LOCAL: c_int = 0;
3840
3841 /// Retrieve peer credentials.
3842 pub const LOCAL_PEERCRED: c_int = 0x001;
3843 /// Retrieve peer PID.
3844 pub const LOCAL_PEERPID: c_int = 0x002;
3845 /// Retrieve effective peer PID.
3846 pub const LOCAL_PEEREPID: c_int = 0x003;
3847 /// Retrieve peer UUID.
3848 pub const LOCAL_PEERUUID: c_int = 0x004;
3849 /// Retrieve effective peer UUID.
3850 pub const LOCAL_PEEREUUID: c_int = 0x005;
3851 /// Retrieve peer audit token.
3852 pub const LOCAL_PEERTOKEN: c_int = 0x006;
3853
3854 pub const SOL_SOCKET: c_int = 0xffff;
3855
3856 pub const SO_DEBUG: c_int = 0x01;
3857 pub const SO_ACCEPTCONN: c_int = 0x0002;
3858 pub const SO_REUSEADDR: c_int = 0x0004;
3859 pub const SO_KEEPALIVE: c_int = 0x0008;
3860 pub const SO_DONTROUTE: c_int = 0x0010;
3861 pub const SO_BROADCAST: c_int = 0x0020;
3862 pub const SO_USELOOPBACK: c_int = 0x0040;
3863 pub const SO_LINGER: c_int = 0x0080;
3864 pub const SO_OOBINLINE: c_int = 0x0100;
3865 pub const SO_REUSEPORT: c_int = 0x0200;
3866 pub const SO_TIMESTAMP: c_int = 0x0400;
3867 pub const SO_TIMESTAMP_MONOTONIC: c_int = 0x0800;
3868 pub const SO_DONTTRUNC: c_int = 0x2000;
3869 pub const SO_WANTMORE: c_int = 0x4000;
3870 pub const SO_WANTOOBFLAG: c_int = 0x8000;
3871 pub const SO_SNDBUF: c_int = 0x1001;
3872 pub const SO_RCVBUF: c_int = 0x1002;
3873 pub const SO_SNDLOWAT: c_int = 0x1003;
3874 pub const SO_RCVLOWAT: c_int = 0x1004;
3875 pub const SO_SNDTIMEO: c_int = 0x1005;
3876 pub const SO_RCVTIMEO: c_int = 0x1006;
3877 pub const SO_ERROR: c_int = 0x1007;
3878 pub const SO_TYPE: c_int = 0x1008;
3879 pub const SO_LABEL: c_int = 0x1010;
3880 pub const SO_PEERLABEL: c_int = 0x1011;
3881 pub const SO_NREAD: c_int = 0x1020;
3882 pub const SO_NKE: c_int = 0x1021;
3883 pub const SO_NOSIGPIPE: c_int = 0x1022;
3884 pub const SO_NOADDRERR: c_int = 0x1023;
3885 pub const SO_NWRITE: c_int = 0x1024;
3886 pub const SO_REUSESHAREUID: c_int = 0x1025;
3887 pub const SO_NOTIFYCONFLICT: c_int = 0x1026;
3888 pub const SO_LINGER_SEC: c_int = 0x1080;
3889 pub const SO_RANDOMPORT: c_int = 0x1082;
3890 pub const SO_NP_EXTENSIONS: c_int = 0x1083;
3891
3892 pub const MSG_OOB: c_int = 0x1;
3893 pub const MSG_PEEK: c_int = 0x2;
3894 pub const MSG_DONTROUTE: c_int = 0x4;
3895 pub const MSG_EOR: c_int = 0x8;
3896 pub const MSG_TRUNC: c_int = 0x10;
3897 pub const MSG_CTRUNC: c_int = 0x20;
3898 pub const MSG_WAITALL: c_int = 0x40;
3899 pub const MSG_DONTWAIT: c_int = 0x80;
3900 pub const MSG_EOF: c_int = 0x100;
3901 pub const MSG_FLUSH: c_int = 0x400;
3902 pub const MSG_HOLD: c_int = 0x800;
3903 pub const MSG_SEND: c_int = 0x1000;
3904 pub const MSG_HAVEMORE: c_int = 0x2000;
3905 pub const MSG_RCVMORE: c_int = 0x4000;
3906 pub const MSG_NEEDSA: c_int = 0x10000;
3907 pub const MSG_NOSIGNAL: c_int = 0x80000;
3908
3909 pub const SCM_TIMESTAMP: c_int = 0x02;
3910 pub const SCM_CREDS: c_int = 0x03;
3911
3912 // https://github.com/aosm/xnu/blob/HEAD/bsd/net/if.h#L140-L156
3913 pub const IFF_UP: c_int = 0x1; // interface is up
3914 pub const IFF_BROADCAST: c_int = 0x2; // broadcast address valid
3915 pub const IFF_DEBUG: c_int = 0x4; // turn on debugging
3916 pub const IFF_LOOPBACK: c_int = 0x8; // is a loopback net
3917 pub const IFF_POINTOPOINT: c_int = 0x10; // interface is point-to-point link
3918 pub const IFF_NOTRAILERS: c_int = 0x20; // obsolete: avoid use of trailers
3919 pub const IFF_RUNNING: c_int = 0x40; // resources allocated
3920 pub const IFF_NOARP: c_int = 0x80; // no address resolution protocol
3921 pub const IFF_PROMISC: c_int = 0x100; // receive all packets
3922 pub const IFF_ALLMULTI: c_int = 0x200; // receive all multicast packets
3923 pub const IFF_OACTIVE: c_int = 0x400; // transmission in progress
3924 pub const IFF_SIMPLEX: c_int = 0x800; // can't hear own transmissions
3925 pub const IFF_LINK0: c_int = 0x1000; // per link layer defined bit
3926 pub const IFF_LINK1: c_int = 0x2000; // per link layer defined bit
3927 pub const IFF_LINK2: c_int = 0x4000; // per link layer defined bit
3928 pub const IFF_ALTPHYS: c_int = IFF_LINK2; // use alternate physical connection
3929 pub const IFF_MULTICAST: c_int = 0x8000; // supports multicast
3930
3931 pub const SCOPE6_ID_MAX: size_t = 16;
3932
3933 pub const SHUT_RD: c_int = 0;
3934 pub const SHUT_WR: c_int = 1;
3935 pub const SHUT_RDWR: c_int = 2;
3936
3937 pub const SAE_ASSOCID_ANY: crate::sae_associd_t = 0;
3938 /// ((sae_associd_t)(-1ULL))
3939 pub const SAE_ASSOCID_ALL: crate::sae_associd_t = 0xffffffff;
3940
3941 pub const SAE_CONNID_ANY: crate::sae_connid_t = 0;
3942 /// ((sae_connid_t)(-1ULL))
3943 pub const SAE_CONNID_ALL: crate::sae_connid_t = 0xffffffff;
3944
3945 // connectx() flag parameters
3946
3947 /// resume connect() on read/write
3948 pub const CONNECT_RESUME_ON_READ_WRITE: c_uint = 0x1;
3949 /// data is idempotent
3950 pub const CONNECT_DATA_IDEMPOTENT: c_uint = 0x2;
3951 /// data includes security that replaces the TFO-cookie
3952 pub const CONNECT_DATA_AUTHENTICATED: c_uint = 0x4;
3953
3954 pub const LOCK_SH: c_int = 1;
3955 pub const LOCK_EX: c_int = 2;
3956 pub const LOCK_NB: c_int = 4;
3957 pub const LOCK_UN: c_int = 8;
3958
3959 pub const MAP_COPY: c_int = 0x0002;
3960 pub const MAP_RENAME: c_int = 0x0020;
3961 pub const MAP_NORESERVE: c_int = 0x0040;
3962 pub const MAP_NOEXTEND: c_int = 0x0100;
3963 pub const MAP_HASSEMAPHORE: c_int = 0x0200;
3964 pub const MAP_NOCACHE: c_int = 0x0400;
3965 pub const MAP_JIT: c_int = 0x0800;
3966
3967 pub const _SC_ARG_MAX: c_int = 1;
3968 pub const _SC_CHILD_MAX: c_int = 2;
3969 pub const _SC_CLK_TCK: c_int = 3;
3970 pub const _SC_NGROUPS_MAX: c_int = 4;
3971 pub const _SC_OPEN_MAX: c_int = 5;
3972 pub const _SC_JOB_CONTROL: c_int = 6;
3973 pub const _SC_SAVED_IDS: c_int = 7;
3974 pub const _SC_VERSION: c_int = 8;
3975 pub const _SC_BC_BASE_MAX: c_int = 9;
3976 pub const _SC_BC_DIM_MAX: c_int = 10;
3977 pub const _SC_BC_SCALE_MAX: c_int = 11;
3978 pub const _SC_BC_STRING_MAX: c_int = 12;
3979 pub const _SC_COLL_WEIGHTS_MAX: c_int = 13;
3980 pub const _SC_EXPR_NEST_MAX: c_int = 14;
3981 pub const _SC_LINE_MAX: c_int = 15;
3982 pub const _SC_RE_DUP_MAX: c_int = 16;
3983 pub const _SC_2_VERSION: c_int = 17;
3984 pub const _SC_2_C_BIND: c_int = 18;
3985 pub const _SC_2_C_DEV: c_int = 19;
3986 pub const _SC_2_CHAR_TERM: c_int = 20;
3987 pub const _SC_2_FORT_DEV: c_int = 21;
3988 pub const _SC_2_FORT_RUN: c_int = 22;
3989 pub const _SC_2_LOCALEDEF: c_int = 23;
3990 pub const _SC_2_SW_DEV: c_int = 24;
3991 pub const _SC_2_UPE: c_int = 25;
3992 pub const _SC_STREAM_MAX: c_int = 26;
3993 pub const _SC_TZNAME_MAX: c_int = 27;
3994 pub const _SC_ASYNCHRONOUS_IO: c_int = 28;
3995 pub const _SC_PAGESIZE: c_int = 29;
3996 pub const _SC_MEMLOCK: c_int = 30;
3997 pub const _SC_MEMLOCK_RANGE: c_int = 31;
3998 pub const _SC_MEMORY_PROTECTION: c_int = 32;
3999 pub const _SC_MESSAGE_PASSING: c_int = 33;
4000 pub const _SC_PRIORITIZED_IO: c_int = 34;
4001 pub const _SC_PRIORITY_SCHEDULING: c_int = 35;
4002 pub const _SC_REALTIME_SIGNALS: c_int = 36;
4003 pub const _SC_SEMAPHORES: c_int = 37;
4004 pub const _SC_FSYNC: c_int = 38;
4005 pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 39;
4006 pub const _SC_SYNCHRONIZED_IO: c_int = 40;
4007 pub const _SC_TIMERS: c_int = 41;
4008 pub const _SC_AIO_LISTIO_MAX: c_int = 42;
4009 pub const _SC_AIO_MAX: c_int = 43;
4010 pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 44;
4011 pub const _SC_DELAYTIMER_MAX: c_int = 45;
4012 pub const _SC_MQ_OPEN_MAX: c_int = 46;
4013 pub const _SC_MAPPED_FILES: c_int = 47;
4014 pub const _SC_RTSIG_MAX: c_int = 48;
4015 pub const _SC_SEM_NSEMS_MAX: c_int = 49;
4016 pub const _SC_SEM_VALUE_MAX: c_int = 50;
4017 pub const _SC_SIGQUEUE_MAX: c_int = 51;
4018 pub const _SC_TIMER_MAX: c_int = 52;
4019 pub const _SC_NPROCESSORS_CONF: c_int = 57;
4020 pub const _SC_NPROCESSORS_ONLN: c_int = 58;
4021 pub const _SC_2_PBS: c_int = 59;
4022 pub const _SC_2_PBS_ACCOUNTING: c_int = 60;
4023 pub const _SC_2_PBS_CHECKPOINT: c_int = 61;
4024 pub const _SC_2_PBS_LOCATE: c_int = 62;
4025 pub const _SC_2_PBS_MESSAGE: c_int = 63;
4026 pub const _SC_2_PBS_TRACK: c_int = 64;
4027 pub const _SC_ADVISORY_INFO: c_int = 65;
4028 pub const _SC_BARRIERS: c_int = 66;
4029 pub const _SC_CLOCK_SELECTION: c_int = 67;
4030 pub const _SC_CPUTIME: c_int = 68;
4031 pub const _SC_FILE_LOCKING: c_int = 69;
4032 pub const _SC_HOST_NAME_MAX: c_int = 72;
4033 pub const _SC_MONOTONIC_CLOCK: c_int = 74;
4034 pub const _SC_READER_WRITER_LOCKS: c_int = 76;
4035 pub const _SC_REGEXP: c_int = 77;
4036 pub const _SC_SHELL: c_int = 78;
4037 pub const _SC_SPAWN: c_int = 79;
4038 pub const _SC_SPIN_LOCKS: c_int = 80;
4039 pub const _SC_SPORADIC_SERVER: c_int = 81;
4040 pub const _SC_THREAD_CPUTIME: c_int = 84;
4041 pub const _SC_THREAD_SPORADIC_SERVER: c_int = 92;
4042 pub const _SC_TIMEOUTS: c_int = 95;
4043 pub const _SC_TRACE: c_int = 97;
4044 pub const _SC_TRACE_EVENT_FILTER: c_int = 98;
4045 pub const _SC_TRACE_INHERIT: c_int = 99;
4046 pub const _SC_TRACE_LOG: c_int = 100;
4047 pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 102;
4048 pub const _SC_V6_ILP32_OFF32: c_int = 103;
4049 pub const _SC_V6_ILP32_OFFBIG: c_int = 104;
4050 pub const _SC_V6_LP64_OFF64: c_int = 105;
4051 pub const _SC_V6_LPBIG_OFFBIG: c_int = 106;
4052 pub const _SC_IPV6: c_int = 118;
4053 pub const _SC_RAW_SOCKETS: c_int = 119;
4054 pub const _SC_SYMLOOP_MAX: c_int = 120;
4055 pub const _SC_PAGE_SIZE: c_int = _SC_PAGESIZE;
4056 pub const _SC_XOPEN_STREAMS: c_int = 114;
4057 pub const _SC_XBS5_ILP32_OFF32: c_int = 122;
4058 pub const _SC_XBS5_ILP32_OFFBIG: c_int = 123;
4059 pub const _SC_XBS5_LP64_OFF64: c_int = 124;
4060 pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 125;
4061 pub const _SC_SS_REPL_MAX: c_int = 126;
4062 pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 127;
4063 pub const _SC_TRACE_NAME_MAX: c_int = 128;
4064 pub const _SC_TRACE_SYS_MAX: c_int = 129;
4065 pub const _SC_TRACE_USER_EVENT_MAX: c_int = 130;
4066 pub const _SC_PASS_MAX: c_int = 131;
4067 // `confstr` keys (only the values guaranteed by `man confstr`).
4068 pub const _CS_PATH: c_int = 1;
4069 pub const _CS_DARWIN_USER_DIR: c_int = 65536;
4070 pub const _CS_DARWIN_USER_TEMP_DIR: c_int = 65537;
4071 pub const _CS_DARWIN_USER_CACHE_DIR: c_int = 65538;
4072
4073 pub const PTHREAD_MUTEX_NORMAL: c_int = 0;
4074 pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 1;
4075 pub const PTHREAD_MUTEX_RECURSIVE: c_int = 2;
4076 pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL;
4077 pub const _PTHREAD_MUTEX_SIG_init: c_long = 0x32AAABA7;
4078 pub const _PTHREAD_COND_SIG_init: c_long = 0x3CB0B1BB;
4079 pub const _PTHREAD_RWLOCK_SIG_init: c_long = 0x2DA8B3B4;
4080 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
4081 __sig: _PTHREAD_MUTEX_SIG_init,
4082 __opaque: [0; __PTHREAD_MUTEX_SIZE__],
4083 };
4084 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
4085 __sig: _PTHREAD_COND_SIG_init,
4086 __opaque: [0; __PTHREAD_COND_SIZE__],
4087 };
4088 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
4089 __sig: _PTHREAD_RWLOCK_SIG_init,
4090 __opaque: [0; __PTHREAD_RWLOCK_SIZE__],
4091 };
4092
4093 pub const OS_UNFAIR_LOCK_INIT: os_unfair_lock = os_unfair_lock {
4094 _os_unfair_lock_opaque: 0,
4095 };
4096
4097 pub const OS_LOG_TYPE_DEFAULT: crate::os_log_type_t = 0x00;
4098 pub const OS_LOG_TYPE_INFO: crate::os_log_type_t = 0x01;
4099 pub const OS_LOG_TYPE_DEBUG: crate::os_log_type_t = 0x02;
4100 pub const OS_LOG_TYPE_ERROR: crate::os_log_type_t = 0x10;
4101 pub const OS_LOG_TYPE_FAULT: crate::os_log_type_t = 0x11;
4102
4103 pub const OS_SIGNPOST_EVENT: crate::os_signpost_type_t = 0x00;
4104 pub const OS_SIGNPOST_INTERVAL_BEGIN: crate::os_signpost_type_t = 0x01;
4105 pub const OS_SIGNPOST_INTERVAL_END: crate::os_signpost_type_t = 0x02;
4106
4107 pub const MINSIGSTKSZ: size_t = 32768;
4108 pub const SIGSTKSZ: size_t = 131072;
4109
4110 pub const FD_SETSIZE: usize = 1024;
4111
4112 pub const ST_NOSUID: c_ulong = 2;
4113
4114 pub const SCHED_OTHER: c_int = 1;
4115 pub const SCHED_FIFO: c_int = 4;
4116 pub const SCHED_RR: c_int = 2;
4117
4118 pub const EVFILT_READ: i16 = -1;
4119 pub const EVFILT_WRITE: i16 = -2;
4120 pub const EVFILT_AIO: i16 = -3;
4121 pub const EVFILT_VNODE: i16 = -4;
4122 pub const EVFILT_PROC: i16 = -5;
4123 pub const EVFILT_SIGNAL: i16 = -6;
4124 pub const EVFILT_TIMER: i16 = -7;
4125 pub const EVFILT_MACHPORT: i16 = -8;
4126 pub const EVFILT_FS: i16 = -9;
4127 pub const EVFILT_USER: i16 = -10;
4128 pub const EVFILT_VM: i16 = -12;
4129
4130 pub const EV_ADD: u16 = 0x1;
4131 pub const EV_DELETE: u16 = 0x2;
4132 pub const EV_ENABLE: u16 = 0x4;
4133 pub const EV_DISABLE: u16 = 0x8;
4134 pub const EV_ONESHOT: u16 = 0x10;
4135 pub const EV_CLEAR: u16 = 0x20;
4136 pub const EV_RECEIPT: u16 = 0x40;
4137 pub const EV_DISPATCH: u16 = 0x80;
4138 pub const EV_FLAG0: u16 = 0x1000;
4139 pub const EV_POLL: u16 = 0x1000;
4140 pub const EV_FLAG1: u16 = 0x2000;
4141 pub const EV_OOBAND: u16 = 0x2000;
4142 pub const EV_ERROR: u16 = 0x4000;
4143 pub const EV_EOF: u16 = 0x8000;
4144 pub const EV_SYSFLAGS: u16 = 0xf000;
4145
4146 pub const NOTE_TRIGGER: u32 = 0x01000000;
4147 pub const NOTE_FFNOP: u32 = 0x00000000;
4148 pub const NOTE_FFAND: u32 = 0x40000000;
4149 pub const NOTE_FFOR: u32 = 0x80000000;
4150 pub const NOTE_FFCOPY: u32 = 0xc0000000;
4151 pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
4152 pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
4153 pub const NOTE_LOWAT: u32 = 0x00000001;
4154 pub const NOTE_DELETE: u32 = 0x00000001;
4155 pub const NOTE_WRITE: u32 = 0x00000002;
4156 pub const NOTE_EXTEND: u32 = 0x00000004;
4157 pub const NOTE_ATTRIB: u32 = 0x00000008;
4158 pub const NOTE_LINK: u32 = 0x00000010;
4159 pub const NOTE_RENAME: u32 = 0x00000020;
4160 pub const NOTE_REVOKE: u32 = 0x00000040;
4161 pub const NOTE_NONE: u32 = 0x00000080;
4162 pub const NOTE_EXIT: u32 = 0x80000000;
4163 pub const NOTE_FORK: u32 = 0x40000000;
4164 pub const NOTE_EXEC: u32 = 0x20000000;
4165 #[doc(hidden)]
4166 #[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")]
4167 pub const NOTE_REAP: u32 = 0x10000000;
4168 pub const NOTE_SIGNAL: u32 = 0x08000000;
4169 pub const NOTE_EXITSTATUS: u32 = 0x04000000;
4170 pub const NOTE_EXIT_DETAIL: u32 = 0x02000000;
4171 pub const NOTE_PDATAMASK: u32 = 0x000fffff;
4172 pub const NOTE_PCTRLMASK: u32 = 0xfff00000;
4173 #[doc(hidden)]
4174 #[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")]
4175 pub const NOTE_EXIT_REPARENTED: u32 = 0x00080000;
4176 pub const NOTE_EXIT_DETAIL_MASK: u32 = 0x00070000;
4177 pub const NOTE_EXIT_DECRYPTFAIL: u32 = 0x00010000;
4178 pub const NOTE_EXIT_MEMORY: u32 = 0x00020000;
4179 pub const NOTE_EXIT_CSERROR: u32 = 0x00040000;
4180 pub const NOTE_VM_PRESSURE: u32 = 0x80000000;
4181 pub const NOTE_VM_PRESSURE_TERMINATE: u32 = 0x40000000;
4182 pub const NOTE_VM_PRESSURE_SUDDEN_TERMINATE: u32 = 0x20000000;
4183 pub const NOTE_VM_ERROR: u32 = 0x10000000;
4184 pub const NOTE_SECONDS: u32 = 0x00000001;
4185 pub const NOTE_USECONDS: u32 = 0x00000002;
4186 pub const NOTE_NSECONDS: u32 = 0x00000004;
4187 pub const NOTE_ABSOLUTE: u32 = 0x00000008;
4188 pub const NOTE_LEEWAY: u32 = 0x00000010;
4189 pub const NOTE_CRITICAL: u32 = 0x00000020;
4190 pub const NOTE_BACKGROUND: u32 = 0x00000040;
4191 pub const NOTE_MACH_CONTINUOUS_TIME: u32 = 0x00000080;
4192 pub const NOTE_MACHTIME: u32 = 0x00000100;
4193 pub const NOTE_TRACK: u32 = 0x00000001;
4194 pub const NOTE_TRACKERR: u32 = 0x00000002;
4195 pub const NOTE_CHILD: u32 = 0x00000004;
4196
4197 pub const OCRNL: crate::tcflag_t = 0x00000010;
4198 pub const ONOCR: crate::tcflag_t = 0x00000020;
4199 pub const ONLRET: crate::tcflag_t = 0x00000040;
4200 pub const OFILL: crate::tcflag_t = 0x00000080;
4201 pub const NLDLY: crate::tcflag_t = 0x00000300;
4202 pub const TABDLY: crate::tcflag_t = 0x00000c04;
4203 pub const CRDLY: crate::tcflag_t = 0x00003000;
4204 pub const FFDLY: crate::tcflag_t = 0x00004000;
4205 pub const BSDLY: crate::tcflag_t = 0x00008000;
4206 pub const VTDLY: crate::tcflag_t = 0x00010000;
4207 pub const OFDEL: crate::tcflag_t = 0x00020000;
4208
4209 pub const NL0: crate::tcflag_t = 0x00000000;
4210 pub const NL1: crate::tcflag_t = 0x00000100;
4211 pub const TAB0: crate::tcflag_t = 0x00000000;
4212 pub const TAB1: crate::tcflag_t = 0x00000400;
4213 pub const TAB2: crate::tcflag_t = 0x00000800;
4214 pub const CR0: crate::tcflag_t = 0x00000000;
4215 pub const CR1: crate::tcflag_t = 0x00001000;
4216 pub const CR2: crate::tcflag_t = 0x00002000;
4217 pub const CR3: crate::tcflag_t = 0x00003000;
4218 pub const FF0: crate::tcflag_t = 0x00000000;
4219 pub const FF1: crate::tcflag_t = 0x00004000;
4220 pub const BS0: crate::tcflag_t = 0x00000000;
4221 pub const BS1: crate::tcflag_t = 0x00008000;
4222 pub const TAB3: crate::tcflag_t = 0x00000004;
4223 pub const VT0: crate::tcflag_t = 0x00000000;
4224 pub const VT1: crate::tcflag_t = 0x00010000;
4225 pub const IUTF8: crate::tcflag_t = 0x00004000;
4226 pub const CRTSCTS: crate::tcflag_t = 0x00030000;
4227
4228 pub const NI_MAXHOST: crate::socklen_t = 1025;
4229 pub const NI_MAXSERV: crate::socklen_t = 32;
4230 pub const NI_NOFQDN: c_int = 0x00000001;
4231 pub const NI_NUMERICHOST: c_int = 0x00000002;
4232 pub const NI_NAMEREQD: c_int = 0x00000004;
4233 pub const NI_NUMERICSERV: c_int = 0x00000008;
4234 pub const NI_NUMERICSCOPE: c_int = 0x00000100;
4235 pub const NI_DGRAM: c_int = 0x00000010;
4236
4237 pub const Q_GETQUOTA: c_int = 0x300;
4238 pub const Q_SETQUOTA: c_int = 0x400;
4239
4240 pub const RENAME_SWAP: c_uint = 0x00000002;
4241 pub const RENAME_EXCL: c_uint = 0x00000004;
4242
4243 pub const RTLD_LOCAL: c_int = 0x4;
4244 pub const RTLD_FIRST: c_int = 0x100;
4245 pub const RTLD_NODELETE: c_int = 0x80;
4246 pub const RTLD_NOLOAD: c_int = 0x10;
4247 pub const RTLD_GLOBAL: c_int = 0x8;
4248 pub const RTLD_MAIN_ONLY: *mut c_void = -5isize as *mut c_void;
4249
4250 pub const _WSTOPPED: c_int = 0o177;
4251
4252 pub const LOG_NETINFO: c_int = 12 << 3;
4253 pub const LOG_REMOTEAUTH: c_int = 13 << 3;
4254 pub const LOG_INSTALL: c_int = 14 << 3;
4255 pub const LOG_RAS: c_int = 15 << 3;
4256 pub const LOG_LAUNCHD: c_int = 24 << 3;
4257 pub const LOG_NFACILITIES: c_int = 25;
4258
4259 pub const CTLTYPE: c_int = 0xf;
4260 pub const CTLTYPE_NODE: c_int = 1;
4261 pub const CTLTYPE_INT: c_int = 2;
4262 pub const CTLTYPE_STRING: c_int = 3;
4263 pub const CTLTYPE_QUAD: c_int = 4;
4264 pub const CTLTYPE_OPAQUE: c_int = 5;
4265 pub const CTLTYPE_STRUCT: c_int = CTLTYPE_OPAQUE;
4266 pub const CTLFLAG_RD: c_int = 0x80000000;
4267 pub const CTLFLAG_WR: c_int = 0x40000000;
4268 pub const CTLFLAG_RW: c_int = CTLFLAG_RD | CTLFLAG_WR;
4269 pub const CTLFLAG_NOLOCK: c_int = 0x20000000;
4270 pub const CTLFLAG_ANYBODY: c_int = 0x10000000;
4271 pub const CTLFLAG_SECURE: c_int = 0x08000000;
4272 pub const CTLFLAG_MASKED: c_int = 0x04000000;
4273 pub const CTLFLAG_NOAUTO: c_int = 0x02000000;
4274 pub const CTLFLAG_KERN: c_int = 0x01000000;
4275 pub const CTLFLAG_LOCKED: c_int = 0x00800000;
4276 pub const CTLFLAG_OID2: c_int = 0x00400000;
4277 pub const CTL_UNSPEC: c_int = 0;
4278 pub const CTL_KERN: c_int = 1;
4279 pub const CTL_VM: c_int = 2;
4280 pub const CTL_VFS: c_int = 3;
4281 pub const CTL_NET: c_int = 4;
4282 pub const CTL_DEBUG: c_int = 5;
4283 pub const CTL_HW: c_int = 6;
4284 pub const CTL_MACHDEP: c_int = 7;
4285 pub const CTL_USER: c_int = 8;
4286 pub const CTL_MAXID: c_int = 9;
4287 pub const KERN_OSTYPE: c_int = 1;
4288 pub const KERN_OSRELEASE: c_int = 2;
4289 pub const KERN_OSREV: c_int = 3;
4290 pub const KERN_VERSION: c_int = 4;
4291 pub const KERN_MAXVNODES: c_int = 5;
4292 pub const KERN_MAXPROC: c_int = 6;
4293 pub const KERN_MAXFILES: c_int = 7;
4294 pub const KERN_ARGMAX: c_int = 8;
4295 pub const KERN_SECURELVL: c_int = 9;
4296 pub const KERN_HOSTNAME: c_int = 10;
4297 pub const KERN_HOSTID: c_int = 11;
4298 pub const KERN_CLOCKRATE: c_int = 12;
4299 pub const KERN_VNODE: c_int = 13;
4300 pub const KERN_PROC: c_int = 14;
4301 pub const KERN_FILE: c_int = 15;
4302 pub const KERN_PROF: c_int = 16;
4303 pub const KERN_POSIX1: c_int = 17;
4304 pub const KERN_NGROUPS: c_int = 18;
4305 pub const KERN_JOB_CONTROL: c_int = 19;
4306 pub const KERN_SAVED_IDS: c_int = 20;
4307 pub const KERN_BOOTTIME: c_int = 21;
4308 pub const KERN_NISDOMAINNAME: c_int = 22;
4309 pub const KERN_DOMAINNAME: c_int = KERN_NISDOMAINNAME;
4310 pub const KERN_MAXPARTITIONS: c_int = 23;
4311 pub const KERN_KDEBUG: c_int = 24;
4312 pub const KERN_UPDATEINTERVAL: c_int = 25;
4313 pub const KERN_OSRELDATE: c_int = 26;
4314 pub const KERN_NTP_PLL: c_int = 27;
4315 pub const KERN_BOOTFILE: c_int = 28;
4316 pub const KERN_MAXFILESPERPROC: c_int = 29;
4317 pub const KERN_MAXPROCPERUID: c_int = 30;
4318 pub const KERN_DUMPDEV: c_int = 31;
4319 pub const KERN_IPC: c_int = 32;
4320 pub const KERN_DUMMY: c_int = 33;
4321 pub const KERN_PS_STRINGS: c_int = 34;
4322 pub const KERN_USRSTACK32: c_int = 35;
4323 pub const KERN_LOGSIGEXIT: c_int = 36;
4324 pub const KERN_SYMFILE: c_int = 37;
4325 pub const KERN_PROCARGS: c_int = 38;
4326 pub const KERN_NETBOOT: c_int = 40;
4327 pub const KERN_SYSV: c_int = 42;
4328 pub const KERN_AFFINITY: c_int = 43;
4329 pub const KERN_TRANSLATE: c_int = 44;
4330 pub const KERN_CLASSIC: c_int = KERN_TRANSLATE;
4331 pub const KERN_EXEC: c_int = 45;
4332 pub const KERN_CLASSICHANDLER: c_int = KERN_EXEC;
4333 pub const KERN_AIOMAX: c_int = 46;
4334 pub const KERN_AIOPROCMAX: c_int = 47;
4335 pub const KERN_AIOTHREADS: c_int = 48;
4336 pub const KERN_COREFILE: c_int = 50;
4337 pub const KERN_COREDUMP: c_int = 51;
4338 pub const KERN_SUGID_COREDUMP: c_int = 52;
4339 pub const KERN_PROCDELAYTERM: c_int = 53;
4340 pub const KERN_SHREG_PRIVATIZABLE: c_int = 54;
4341 pub const KERN_LOW_PRI_WINDOW: c_int = 56;
4342 pub const KERN_LOW_PRI_DELAY: c_int = 57;
4343 pub const KERN_POSIX: c_int = 58;
4344 pub const KERN_USRSTACK64: c_int = 59;
4345 pub const KERN_NX_PROTECTION: c_int = 60;
4346 pub const KERN_TFP: c_int = 61;
4347 pub const KERN_PROCNAME: c_int = 62;
4348 pub const KERN_THALTSTACK: c_int = 63;
4349 pub const KERN_SPECULATIVE_READS: c_int = 64;
4350 pub const KERN_OSVERSION: c_int = 65;
4351 pub const KERN_SAFEBOOT: c_int = 66;
4352 pub const KERN_RAGEVNODE: c_int = 68;
4353 pub const KERN_TTY: c_int = 69;
4354 pub const KERN_CHECKOPENEVT: c_int = 70;
4355 pub const KERN_THREADNAME: c_int = 71;
4356 pub const KERN_MAXID: c_int = 72;
4357 pub const KERN_RAGE_PROC: c_int = 1;
4358 pub const KERN_RAGE_THREAD: c_int = 2;
4359 pub const KERN_UNRAGE_PROC: c_int = 3;
4360 pub const KERN_UNRAGE_THREAD: c_int = 4;
4361 pub const KERN_OPENEVT_PROC: c_int = 1;
4362 pub const KERN_UNOPENEVT_PROC: c_int = 2;
4363 pub const KERN_TFP_POLICY: c_int = 1;
4364 pub const KERN_TFP_POLICY_DENY: c_int = 0;
4365 pub const KERN_TFP_POLICY_DEFAULT: c_int = 2;
4366 pub const KERN_KDEFLAGS: c_int = 1;
4367 pub const KERN_KDDFLAGS: c_int = 2;
4368 pub const KERN_KDENABLE: c_int = 3;
4369 pub const KERN_KDSETBUF: c_int = 4;
4370 pub const KERN_KDGETBUF: c_int = 5;
4371 pub const KERN_KDSETUP: c_int = 6;
4372 pub const KERN_KDREMOVE: c_int = 7;
4373 pub const KERN_KDSETREG: c_int = 8;
4374 pub const KERN_KDGETREG: c_int = 9;
4375 pub const KERN_KDREADTR: c_int = 10;
4376 pub const KERN_KDPIDTR: c_int = 11;
4377 pub const KERN_KDTHRMAP: c_int = 12;
4378 pub const KERN_KDPIDEX: c_int = 14;
4379 pub const KERN_KDSETRTCDEC: c_int = 15;
4380 pub const KERN_KDGETENTROPY: c_int = 16;
4381 pub const KERN_KDWRITETR: c_int = 17;
4382 pub const KERN_KDWRITEMAP: c_int = 18;
4383 #[doc(hidden)]
4384 #[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")]
4385 pub const KERN_KDENABLE_BG_TRACE: c_int = 19;
4386 #[doc(hidden)]
4387 #[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")]
4388 pub const KERN_KDDISABLE_BG_TRACE: c_int = 20;
4389 pub const KERN_KDREADCURTHRMAP: c_int = 21;
4390 pub const KERN_KDSET_TYPEFILTER: c_int = 22;
4391 pub const KERN_KDBUFWAIT: c_int = 23;
4392 pub const KERN_KDCPUMAP: c_int = 24;
4393 pub const KERN_PROC_ALL: c_int = 0;
4394 pub const KERN_PROC_PID: c_int = 1;
4395 pub const KERN_PROC_PGRP: c_int = 2;
4396 pub const KERN_PROC_SESSION: c_int = 3;
4397 pub const KERN_PROC_TTY: c_int = 4;
4398 pub const KERN_PROC_UID: c_int = 5;
4399 pub const KERN_PROC_RUID: c_int = 6;
4400 pub const KERN_PROC_LCID: c_int = 7;
4401 pub const KERN_SUCCESS: c_int = 0;
4402 pub const KERN_INVALID_ADDRESS: c_int = 1;
4403 pub const KERN_PROTECTION_FAILURE: c_int = 2;
4404 pub const KERN_NO_SPACE: c_int = 3;
4405 pub const KERN_INVALID_ARGUMENT: c_int = 4;
4406 pub const KERN_FAILURE: c_int = 5;
4407 pub const KERN_RESOURCE_SHORTAGE: c_int = 6;
4408 pub const KERN_NOT_RECEIVER: c_int = 7;
4409 pub const KERN_NO_ACCESS: c_int = 8;
4410 pub const KERN_MEMORY_FAILURE: c_int = 9;
4411 pub const KERN_MEMORY_ERROR: c_int = 10;
4412 pub const KERN_ALREADY_IN_SET: c_int = 11;
4413 pub const KERN_NOT_IN_SET: c_int = 12;
4414 pub const KERN_NAME_EXISTS: c_int = 13;
4415 pub const KERN_ABORTED: c_int = 14;
4416 pub const KERN_INVALID_NAME: c_int = 15;
4417 pub const KERN_INVALID_TASK: c_int = 16;
4418 pub const KERN_INVALID_RIGHT: c_int = 17;
4419 pub const KERN_INVALID_VALUE: c_int = 18;
4420 pub const KERN_UREFS_OVERFLOW: c_int = 19;
4421 pub const KERN_INVALID_CAPABILITY: c_int = 20;
4422 pub const KERN_RIGHT_EXISTS: c_int = 21;
4423 pub const KERN_INVALID_HOST: c_int = 22;
4424 pub const KERN_MEMORY_PRESENT: c_int = 23;
4425 pub const KERN_MEMORY_DATA_MOVED: c_int = 24;
4426 pub const KERN_MEMORY_RESTART_COPY: c_int = 25;
4427 pub const KERN_INVALID_PROCESSOR_SET: c_int = 26;
4428 pub const KERN_POLICY_LIMIT: c_int = 27;
4429 pub const KERN_INVALID_POLICY: c_int = 28;
4430 pub const KERN_INVALID_OBJECT: c_int = 29;
4431 pub const KERN_ALREADY_WAITING: c_int = 30;
4432 pub const KERN_DEFAULT_SET: c_int = 31;
4433 pub const KERN_EXCEPTION_PROTECTED: c_int = 32;
4434 pub const KERN_INVALID_LEDGER: c_int = 33;
4435 pub const KERN_INVALID_MEMORY_CONTROL: c_int = 34;
4436 pub const KERN_INVALID_SECURITY: c_int = 35;
4437 pub const KERN_NOT_DEPRESSED: c_int = 36;
4438 pub const KERN_TERMINATED: c_int = 37;
4439 pub const KERN_LOCK_SET_DESTROYED: c_int = 38;
4440 pub const KERN_LOCK_UNSTABLE: c_int = 39;
4441 pub const KERN_LOCK_OWNED: c_int = 40;
4442 pub const KERN_LOCK_OWNED_SELF: c_int = 41;
4443 pub const KERN_SEMAPHORE_DESTROYED: c_int = 42;
4444 pub const KERN_RPC_SERVER_TERMINATED: c_int = 43;
4445 pub const KERN_RPC_TERMINATE_ORPHAN: c_int = 44;
4446 pub const KERN_RPC_CONTINUE_ORPHAN: c_int = 45;
4447 pub const KERN_NOT_SUPPORTED: c_int = 46;
4448 pub const KERN_NODE_DOWN: c_int = 47;
4449 pub const KERN_NOT_WAITING: c_int = 48;
4450 pub const KERN_OPERATION_TIMED_OUT: c_int = 49;
4451 pub const KERN_CODESIGN_ERROR: c_int = 50;
4452 pub const KERN_POLICY_STATIC: c_int = 51;
4453 pub const KERN_INSUFFICIENT_BUFFER_SIZE: c_int = 52;
4454 pub const KIPC_MAXSOCKBUF: c_int = 1;
4455 pub const KIPC_SOCKBUF_WASTE: c_int = 2;
4456 pub const KIPC_SOMAXCONN: c_int = 3;
4457 pub const KIPC_MAX_LINKHDR: c_int = 4;
4458 pub const KIPC_MAX_PROTOHDR: c_int = 5;
4459 pub const KIPC_MAX_HDR: c_int = 6;
4460 pub const KIPC_MAX_DATALEN: c_int = 7;
4461 pub const KIPC_MBSTAT: c_int = 8;
4462 pub const KIPC_NMBCLUSTERS: c_int = 9;
4463 pub const KIPC_SOQLIMITCOMPAT: c_int = 10;
4464 pub const VM_METER: c_int = 1;
4465 pub const VM_LOADAVG: c_int = 2;
4466 pub const VM_MACHFACTOR: c_int = 4;
4467 pub const VM_SWAPUSAGE: c_int = 5;
4468 pub const VM_MAXID: c_int = 6;
4469 pub const VM_PROT_NONE: crate::vm_prot_t = 0x00;
4470 pub const VM_PROT_READ: crate::vm_prot_t = 0x01;
4471 pub const VM_PROT_WRITE: crate::vm_prot_t = 0x02;
4472 pub const VM_PROT_EXECUTE: crate::vm_prot_t = 0x04;
4473 pub const MEMORY_OBJECT_NULL: crate::memory_object_t = 0;
4474 pub const HW_MACHINE: c_int = 1;
4475 pub const HW_MODEL: c_int = 2;
4476 pub const HW_NCPU: c_int = 3;
4477 pub const HW_BYTEORDER: c_int = 4;
4478 pub const HW_PHYSMEM: c_int = 5;
4479 pub const HW_USERMEM: c_int = 6;
4480 pub const HW_PAGESIZE: c_int = 7;
4481 pub const HW_DISKNAMES: c_int = 8;
4482 pub const HW_DISKSTATS: c_int = 9;
4483 pub const HW_EPOCH: c_int = 10;
4484 pub const HW_FLOATINGPT: c_int = 11;
4485 pub const HW_MACHINE_ARCH: c_int = 12;
4486 pub const HW_VECTORUNIT: c_int = 13;
4487 pub const HW_BUS_FREQ: c_int = 14;
4488 pub const HW_CPU_FREQ: c_int = 15;
4489 pub const HW_CACHELINE: c_int = 16;
4490 pub const HW_L1ICACHESIZE: c_int = 17;
4491 pub const HW_L1DCACHESIZE: c_int = 18;
4492 pub const HW_L2SETTINGS: c_int = 19;
4493 pub const HW_L2CACHESIZE: c_int = 20;
4494 pub const HW_L3SETTINGS: c_int = 21;
4495 pub const HW_L3CACHESIZE: c_int = 22;
4496 pub const HW_TB_FREQ: c_int = 23;
4497 pub const HW_MEMSIZE: c_int = 24;
4498 pub const HW_AVAILCPU: c_int = 25;
4499 pub const HW_TARGET: c_int = 26;
4500 pub const HW_PRODUCT: c_int = 27;
4501 pub const HW_MAXID: c_int = 28;
4502 pub const USER_CS_PATH: c_int = 1;
4503 pub const USER_BC_BASE_MAX: c_int = 2;
4504 pub const USER_BC_DIM_MAX: c_int = 3;
4505 pub const USER_BC_SCALE_MAX: c_int = 4;
4506 pub const USER_BC_STRING_MAX: c_int = 5;
4507 pub const USER_COLL_WEIGHTS_MAX: c_int = 6;
4508 pub const USER_EXPR_NEST_MAX: c_int = 7;
4509 pub const USER_LINE_MAX: c_int = 8;
4510 pub const USER_RE_DUP_MAX: c_int = 9;
4511 pub const USER_POSIX2_VERSION: c_int = 10;
4512 pub const USER_POSIX2_C_BIND: c_int = 11;
4513 pub const USER_POSIX2_C_DEV: c_int = 12;
4514 pub const USER_POSIX2_CHAR_TERM: c_int = 13;
4515 pub const USER_POSIX2_FORT_DEV: c_int = 14;
4516 pub const USER_POSIX2_FORT_RUN: c_int = 15;
4517 pub const USER_POSIX2_LOCALEDEF: c_int = 16;
4518 pub const USER_POSIX2_SW_DEV: c_int = 17;
4519 pub const USER_POSIX2_UPE: c_int = 18;
4520 pub const USER_STREAM_MAX: c_int = 19;
4521 pub const USER_TZNAME_MAX: c_int = 20;
4522 pub const USER_MAXID: c_int = 21;
4523 pub const CTL_DEBUG_NAME: c_int = 0;
4524 pub const CTL_DEBUG_VALUE: c_int = 1;
4525 pub const CTL_DEBUG_MAXID: c_int = 20;
4526
4527 pub const PRIO_DARWIN_THREAD: c_int = 3;
4528 pub const PRIO_DARWIN_PROCESS: c_int = 4;
4529 pub const PRIO_DARWIN_BG: c_int = 0x1000;
4530 pub const PRIO_DARWIN_NONUI: c_int = 0x1001;
4531
4532 pub const SEM_FAILED: *mut sem_t = -1isize as *mut crate::sem_t;
4533
4534 pub const AI_PASSIVE: c_int = 0x00000001;
4535 pub const AI_CANONNAME: c_int = 0x00000002;
4536 pub const AI_NUMERICHOST: c_int = 0x00000004;
4537 pub const AI_NUMERICSERV: c_int = 0x00001000;
4538 pub const AI_MASK: c_int =
4539 AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_ADDRCONFIG;
4540 pub const AI_ALL: c_int = 0x00000100;
4541 pub const AI_V4MAPPED_CFG: c_int = 0x00000200;
4542 pub const AI_ADDRCONFIG: c_int = 0x00000400;
4543 pub const AI_V4MAPPED: c_int = 0x00000800;
4544 pub const AI_DEFAULT: c_int = AI_V4MAPPED_CFG | AI_ADDRCONFIG;
4545 pub const AI_UNUSABLE: c_int = 0x10000000;
4546
4547 pub const SIGEV_NONE: c_int = 0;
4548 pub const SIGEV_SIGNAL: c_int = 1;
4549 pub const SIGEV_THREAD: c_int = 3;
4550
4551 pub const AIO_CANCELED: c_int = 2;
4552 pub const AIO_NOTCANCELED: c_int = 4;
4553 pub const AIO_ALLDONE: c_int = 1;
4554 #[deprecated(
4555 since = "0.2.64",
4556 note = "Can vary at runtime. Use sysconf(3) instead"
4557 )]
4558 pub const AIO_LISTIO_MAX: c_int = 16;
4559 pub const LIO_NOP: c_int = 0;
4560 pub const LIO_WRITE: c_int = 2;
4561 pub const LIO_READ: c_int = 1;
4562 pub const LIO_WAIT: c_int = 2;
4563 pub const LIO_NOWAIT: c_int = 1;
4564
4565 pub const WEXITED: c_int = 0x00000004;
4566 pub const WSTOPPED: c_int = 0x00000008;
4567 pub const WCONTINUED: c_int = 0x00000010;
4568 pub const WNOWAIT: c_int = 0x00000020;
4569
4570 pub const P_ALL: idtype_t = 0;
4571 pub const P_PID: idtype_t = 1;
4572 pub const P_PGID: idtype_t = 2;
4573
4574 pub const UTIME_OMIT: c_long = -2;
4575 pub const UTIME_NOW: c_long = -1;
4576
4577 pub const XATTR_NOFOLLOW: c_int = 0x0001;
4578 pub const XATTR_CREATE: c_int = 0x0002;
4579 pub const XATTR_REPLACE: c_int = 0x0004;
4580 pub const XATTR_NOSECURITY: c_int = 0x0008;
4581 pub const XATTR_NODEFAULT: c_int = 0x0010;
4582 pub const XATTR_SHOWCOMPRESSION: c_int = 0x0020;
4583
4584 pub const NET_RT_IFLIST2: c_int = 0x0006;
4585
4586 // net/route.h
4587 pub const RTF_DELCLONE: c_int = 0x80;
4588 pub const RTF_CLONING: c_int = 0x100;
4589 pub const RTF_XRESOLVE: c_int = 0x200;
4590 pub const RTF_LLINFO: c_int = 0x400;
4591 pub const RTF_NOIFREF: c_int = 0x2000;
4592 pub const RTF_PRCLONING: c_int = 0x10000;
4593 pub const RTF_WASCLONED: c_int = 0x20000;
4594 pub const RTF_PROTO3: c_int = 0x40000;
4595 pub const RTF_PINNED: c_int = 0x100000;
4596 pub const RTF_LOCAL: c_int = 0x200000;
4597 pub const RTF_BROADCAST: c_int = 0x400000;
4598 pub const RTF_MULTICAST: c_int = 0x800000;
4599 pub const RTF_IFSCOPE: c_int = 0x1000000;
4600 pub const RTF_CONDEMNED: c_int = 0x2000000;
4601 pub const RTF_IFREF: c_int = 0x4000000;
4602 pub const RTF_PROXY: c_int = 0x8000000;
4603 pub const RTF_ROUTER: c_int = 0x10000000;
4604 pub const RTF_DEAD: c_int = 0x20000000;
4605 pub const RTF_GLOBAL: c_int = 0x40000000;
4606
4607 pub const RTM_VERSION: c_int = 5;
4608
4609 // Message types
4610 pub const RTM_LOCK: c_int = 0x8;
4611 pub const RTM_OLDADD: c_int = 0x9;
4612 pub const RTM_OLDDEL: c_int = 0xa;
4613 pub const RTM_RESOLVE: c_int = 0xb;
4614 pub const RTM_NEWADDR: c_int = 0xc;
4615 pub const RTM_DELADDR: c_int = 0xd;
4616 pub const RTM_IFINFO: c_int = 0xe;
4617 pub const RTM_NEWMADDR: c_int = 0xf;
4618 pub const RTM_DELMADDR: c_int = 0x10;
4619 pub const RTM_IFINFO2: c_int = 0x12;
4620 pub const RTM_NEWMADDR2: c_int = 0x13;
4621 pub const RTM_GET2: c_int = 0x14;
4622
4623 // Bitmask values for rtm_inits and rmx_locks.
4624 pub const RTV_MTU: c_int = 0x1;
4625 pub const RTV_HOPCOUNT: c_int = 0x2;
4626 pub const RTV_EXPIRE: c_int = 0x4;
4627 pub const RTV_RPIPE: c_int = 0x8;
4628 pub const RTV_SPIPE: c_int = 0x10;
4629 pub const RTV_SSTHRESH: c_int = 0x20;
4630 pub const RTV_RTT: c_int = 0x40;
4631 pub const RTV_RTTVAR: c_int = 0x80;
4632
4633 pub const RTAX_MAX: c_int = 8;
4634
4635 pub const KERN_PROCARGS2: c_int = 49;
4636
4637 pub const PROC_PIDTASKALLINFO: c_int = 2;
4638 pub const PROC_PIDTBSDINFO: c_int = 3;
4639 pub const PROC_PIDTASKINFO: c_int = 4;
4640 pub const PROC_PIDTHREADINFO: c_int = 5;
4641 pub const PROC_PIDVNODEPATHINFO: c_int = 9;
4642 pub const PROC_PIDPATHINFO_MAXSIZE: c_int = 4096;
4643
4644 pub const PROC_PIDLISTFDS: c_int = 1;
4645 pub const PROC_PIDLISTFD_SIZE: c_int = mem::size_of::<proc_fdinfo>() as c_int;
4646 pub const PROX_FDTYPE_ATALK: c_int = 0;
4647 pub const PROX_FDTYPE_VNODE: c_int = 1;
4648 pub const PROX_FDTYPE_SOCKET: c_int = 2;
4649 pub const PROX_FDTYPE_PSHM: c_int = 3;
4650 pub const PROX_FDTYPE_PSEM: c_int = 4;
4651 pub const PROX_FDTYPE_KQUEUE: c_int = 5;
4652 pub const PROX_FDTYPE_PIPE: c_int = 6;
4653 pub const PROX_FDTYPE_FSEVENTS: c_int = 7;
4654 pub const PROX_FDTYPE_NETPOLICY: c_int = 9;
4655 pub const PROX_FDTYPE_CHANNEL: c_int = 10;
4656 pub const PROX_FDTYPE_NEXUS: c_int = 11;
4657
4658 pub const PROC_CSM_ALL: c_uint = 0x0001;
4659 pub const PROC_CSM_NOSMT: c_uint = 0x0002;
4660 pub const PROC_CSM_TECS: c_uint = 0x0004;
4661 pub const MAXCOMLEN: usize = 16;
4662 pub const MAXTHREADNAMESIZE: usize = 64;
4663
4664 pub const XUCRED_VERSION: c_uint = 0;
4665
4666 pub const LC_SEGMENT: u32 = 0x1;
4667 pub const LC_SEGMENT_64: u32 = 0x19;
4668
4669 pub const MH_MAGIC: u32 = 0xfeedface;
4670 pub const MH_MAGIC_64: u32 = 0xfeedfacf;
4671
4672 // net/if_utun.h
4673 pub const UTUN_OPT_FLAGS: c_int = 1;
4674 pub const UTUN_OPT_IFNAME: c_int = 2;
4675
4676 // net/bpf.h
4677 pub const DLT_NULL: c_uint = 0; // no link-layer encapsulation
4678 pub const DLT_EN10MB: c_uint = 1; // Ethernet (10Mb)
4679 pub const DLT_EN3MB: c_uint = 2; // Experimental Ethernet (3Mb)
4680 pub const DLT_AX25: c_uint = 3; // Amateur Radio AX.25
4681 pub const DLT_PRONET: c_uint = 4; // Proteon ProNET Token Ring
4682 pub const DLT_CHAOS: c_uint = 5; // Chaos
4683 pub const DLT_IEEE802: c_uint = 6; // IEEE 802 Networks
4684 pub const DLT_ARCNET: c_uint = 7; // ARCNET
4685 pub const DLT_SLIP: c_uint = 8; // Serial Line IP
4686 pub const DLT_PPP: c_uint = 9; // Point-to-point Protocol
4687 pub const DLT_FDDI: c_uint = 10; // FDDI
4688 pub const DLT_ATM_RFC1483: c_uint = 11; // LLC/SNAP encapsulated atm
4689 pub const DLT_RAW: c_uint = 12; // raw IP
4690 pub const DLT_LOOP: c_uint = 108;
4691
4692 // https://github.com/apple/darwin-xnu/blob/HEAD/bsd/net/bpf.h#L100
4693 // sizeof(i32)
4694 pub const BPF_ALIGNMENT: c_int = 4;
4695
4696 // sys/mount.h
4697 pub const MNT_NODEV: c_int = 0x00000010;
4698 pub const MNT_UNION: c_int = 0x00000020;
4699 pub const MNT_CPROTECT: c_int = 0x00000080;
4700
4701 // MAC labeled / "quarantined" flag
4702 pub const MNT_QUARANTINE: c_int = 0x00000400;
4703
4704 // Flags set by internal operations.
4705 pub const MNT_LOCAL: c_int = 0x00001000;
4706 pub const MNT_QUOTA: c_int = 0x00002000;
4707 pub const MNT_ROOTFS: c_int = 0x00004000;
4708 pub const MNT_DOVOLFS: c_int = 0x00008000;
4709
4710 pub const MNT_DONTBROWSE: c_int = 0x00100000;
4711 pub const MNT_IGNORE_OWNERSHIP: c_int = 0x00200000;
4712 pub const MNT_AUTOMOUNTED: c_int = 0x00400000;
4713 pub const MNT_JOURNALED: c_int = 0x00800000;
4714 pub const MNT_NOUSERXATTR: c_int = 0x01000000;
4715 pub const MNT_DEFWRITE: c_int = 0x02000000;
4716 pub const MNT_MULTILABEL: c_int = 0x04000000;
4717 pub const MNT_NOATIME: c_int = 0x10000000;
4718 pub const MNT_SNAPSHOT: c_int = 0x40000000;
4719
4720 // External filesystem command modifier flags.
4721 pub const MNT_NOBLOCK: c_int = 0x00020000;
4722
4723 // sys/spawn.h:
4724 // DIFF(main): changed to `c_short` in f62eb023ab
4725 pub const POSIX_SPAWN_RESETIDS: c_int = 0x0001;
4726 pub const POSIX_SPAWN_SETPGROUP: c_int = 0x0002;
4727 pub const POSIX_SPAWN_SETSIGDEF: c_int = 0x0004;
4728 pub const POSIX_SPAWN_SETSIGMASK: c_int = 0x0008;
4729 pub const POSIX_SPAWN_SETEXEC: c_int = 0x0040;
4730 pub const POSIX_SPAWN_START_SUSPENDED: c_int = 0x0080;
4731 pub const POSIX_SPAWN_CLOEXEC_DEFAULT: c_int = 0x4000;
4732
4733 // sys/ipc.h:
4734 pub const IPC_CREAT: c_int = 0x200;
4735 pub const IPC_EXCL: c_int = 0x400;
4736 pub const IPC_NOWAIT: c_int = 0x800;
4737 pub const IPC_PRIVATE: key_t = 0;
4738
4739 pub const IPC_RMID: c_int = 0;
4740 pub const IPC_SET: c_int = 1;
4741 pub const IPC_STAT: c_int = 2;
4742
4743 pub const IPC_R: c_int = 0x100;
4744 pub const IPC_W: c_int = 0x80;
4745 pub const IPC_M: c_int = 0x1000;
4746
4747 // sys/sem.h
4748 pub const SEM_UNDO: c_int = 0o10000;
4749
4750 pub const GETNCNT: c_int = 3;
4751 pub const GETPID: c_int = 4;
4752 pub const GETVAL: c_int = 5;
4753 pub const GETALL: c_int = 6;
4754 pub const GETZCNT: c_int = 7;
4755 pub const SETVAL: c_int = 8;
4756 pub const SETALL: c_int = 9;
4757
4758 // sys/shm.h
4759 pub const SHM_RDONLY: c_int = 0x1000;
4760 pub const SHM_RND: c_int = 0x2000;
4761 #[cfg(target_arch = "aarch64")]
4762 pub const SHMLBA: c_int = 16 * 1024;
4763 #[cfg(not(target_arch = "aarch64"))]
4764 pub const SHMLBA: c_int = 4096;
4765 pub const SHM_R: c_int = IPC_R;
4766 pub const SHM_W: c_int = IPC_W;
4767
4768 // Flags for chflags(2)
4769 pub const UF_SETTABLE: c_uint = 0x0000ffff;
4770 pub const UF_NODUMP: c_uint = 0x00000001;
4771 pub const UF_IMMUTABLE: c_uint = 0x00000002;
4772 pub const UF_APPEND: c_uint = 0x00000004;
4773 pub const UF_OPAQUE: c_uint = 0x00000008;
4774 pub const UF_COMPRESSED: c_uint = 0x00000020;
4775 pub const UF_TRACKED: c_uint = 0x00000040;
4776 pub const SF_SETTABLE: c_uint = 0xffff0000;
4777 pub const SF_ARCHIVED: c_uint = 0x00010000;
4778 pub const SF_IMMUTABLE: c_uint = 0x00020000;
4779 pub const SF_APPEND: c_uint = 0x00040000;
4780 pub const UF_HIDDEN: c_uint = 0x00008000;
4781
4782 //<sys/timex.h>
4783 pub const NTP_API: c_int = 4;
4784 pub const MAXPHASE: c_long = 500000000;
4785 pub const MAXFREQ: c_long = 500000;
4786 pub const MINSEC: c_int = 256;
4787 pub const MAXSEC: c_int = 2048;
4788 pub const NANOSECOND: c_long = 1000000000;
4789 pub const SCALE_PPM: c_int = 65;
4790 pub const MAXTC: c_int = 10;
4791 pub const MOD_OFFSET: c_uint = 0x0001;
4792 pub const MOD_FREQUENCY: c_uint = 0x0002;
4793 pub const MOD_MAXERROR: c_uint = 0x0004;
4794 pub const MOD_ESTERROR: c_uint = 0x0008;
4795 pub const MOD_STATUS: c_uint = 0x0010;
4796 pub const MOD_TIMECONST: c_uint = 0x0020;
4797 pub const MOD_PPSMAX: c_uint = 0x0040;
4798 pub const MOD_TAI: c_uint = 0x0080;
4799 pub const MOD_MICRO: c_uint = 0x1000;
4800 pub const MOD_NANO: c_uint = 0x2000;
4801 pub const MOD_CLKB: c_uint = 0x4000;
4802 pub const MOD_CLKA: c_uint = 0x8000;
4803 pub const STA_PLL: c_int = 0x0001;
4804 pub const STA_PPSFREQ: c_int = 0x0002;
4805 pub const STA_PPSTIME: c_int = 0x0004;
4806 pub const STA_FLL: c_int = 0x0008;
4807 pub const STA_INS: c_int = 0x0010;
4808 pub const STA_DEL: c_int = 0x0020;
4809 pub const STA_UNSYNC: c_int = 0x0040;
4810 pub const STA_FREQHOLD: c_int = 0x0080;
4811 pub const STA_PPSSIGNAL: c_int = 0x0100;
4812 pub const STA_PPSJITTER: c_int = 0x0200;
4813 pub const STA_PPSWANDER: c_int = 0x0400;
4814 pub const STA_PPSERROR: c_int = 0x0800;
4815 pub const STA_CLOCKERR: c_int = 0x1000;
4816 pub const STA_NANO: c_int = 0x2000;
4817 pub const STA_MODE: c_int = 0x4000;
4818 pub const STA_CLK: c_int = 0x8000;
4819 pub 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;
4827 pub const TIME_OK: c_int = 0;
4828 pub const TIME_INS: c_int = 1;
4829 pub const TIME_DEL: c_int = 2;
4830 pub const TIME_OOP: c_int = 3;
4831 pub const TIME_WAIT: c_int = 4;
4832 pub const TIME_ERROR: c_int = 5;
4833
4834 // <sys/mount.h>
4835 pub const MNT_WAIT: c_int = 1;
4836 pub const MNT_NOWAIT: c_int = 2;
4837
4838 // <mach/thread_policy.h>
4839 pub const THREAD_STANDARD_POLICY: c_int = 1;
4840 pub const THREAD_STANDARD_POLICY_COUNT: c_int = 0;
4841 pub const THREAD_EXTENDED_POLICY: c_int = 1;
4842 pub const THREAD_TIME_CONSTRAINT_POLICY: c_int = 2;
4843 pub const THREAD_PRECEDENCE_POLICY: c_int = 3;
4844 pub const THREAD_AFFINITY_POLICY: c_int = 4;
4845 pub const THREAD_AFFINITY_TAG_NULL: c_int = 0;
4846 pub const THREAD_BACKGROUND_POLICY: c_int = 5;
4847 pub const THREAD_BACKGROUND_POLICY_DARWIN_BG: c_int = 0x1000;
4848 pub const THREAD_LATENCY_QOS_POLICY: c_int = 7;
4849 pub const THREAD_THROUGHPUT_QOS_POLICY: c_int = 8;
4850
4851 // <mach/thread_info.h>
4852 pub const TH_STATE_RUNNING: c_int = 1;
4853 pub const TH_STATE_STOPPED: c_int = 2;
4854 pub const TH_STATE_WAITING: c_int = 3;
4855 pub const TH_STATE_UNINTERRUPTIBLE: c_int = 4;
4856 pub const TH_STATE_HALTED: c_int = 5;
4857 pub const TH_FLAGS_SWAPPED: c_int = 0x1;
4858 pub const TH_FLAGS_IDLE: c_int = 0x2;
4859 pub const TH_FLAGS_GLOBAL_FORCED_IDLE: c_int = 0x4;
4860 pub const THREAD_BASIC_INFO: c_int = 3;
4861 pub const THREAD_IDENTIFIER_INFO: c_int = 4;
4862 pub const THREAD_EXTENDED_INFO: c_int = 5;
4863
4864 // CommonCrypto/CommonCryptoError.h
4865 pub const kCCSuccess: i32 = 0;
4866 pub const kCCParamError: i32 = -4300;
4867 pub const kCCBufferTooSmall: i32 = -4301;
4868 pub const kCCMemoryFailure: i32 = -4302;
4869 pub const kCCAlignmentError: i32 = -4303;
4870 pub const kCCDecodeError: i32 = -4304;
4871 pub const kCCUnimplemented: i32 = -4305;
4872 pub const kCCOverflow: i32 = -4306;
4873 pub const kCCRNGFailure: i32 = -4307;
4874 pub const kCCUnspecifiedError: i32 = -4308;
4875 pub const kCCCallSequenceError: i32 = -4309;
4876 pub const kCCKeySizeError: i32 = -4310;
4877 pub const kCCInvalidKey: i32 = -4311;
4878
4879 // mach/host_info.h
4880 pub const HOST_LOAD_INFO: i32 = 1;
4881 pub const HOST_VM_INFO: i32 = 2;
4882 pub const HOST_CPU_LOAD_INFO: i32 = 3;
4883 pub const HOST_VM_INFO64: i32 = 4;
4884 pub const HOST_EXTMOD_INFO64: i32 = 5;
4885 pub const HOST_EXPIRED_TASK_INFO: i32 = 6;
4886
4887 // mach/vm_statistics.h
4888 pub const VM_PAGE_QUERY_PAGE_PRESENT: i32 = 0x1;
4889 pub const VM_PAGE_QUERY_PAGE_FICTITIOUS: i32 = 0x2;
4890 pub const VM_PAGE_QUERY_PAGE_REF: i32 = 0x4;
4891 pub const VM_PAGE_QUERY_PAGE_DIRTY: i32 = 0x8;
4892 pub const VM_PAGE_QUERY_PAGE_PAGED_OUT: i32 = 0x10;
4893 pub const VM_PAGE_QUERY_PAGE_COPIED: i32 = 0x20;
4894 pub const VM_PAGE_QUERY_PAGE_SPECULATIVE: i32 = 0x40;
4895 pub const VM_PAGE_QUERY_PAGE_EXTERNAL: i32 = 0x80;
4896 pub const VM_PAGE_QUERY_PAGE_CS_VALIDATED: i32 = 0x100;
4897 pub const VM_PAGE_QUERY_PAGE_CS_TAINTED: i32 = 0x200;
4898 pub const VM_PAGE_QUERY_PAGE_CS_NX: i32 = 0x400;
4899
4900 // mach/task_info.h
4901 pub const TASK_THREAD_TIMES_INFO: u32 = 3;
4902 pub const HOST_CPU_LOAD_INFO_COUNT: u32 = 4;
4903 pub const MACH_TASK_BASIC_INFO: u32 = 20;
4904
4905 pub const MACH_PORT_NULL: i32 = 0;
4906
4907 pub const RUSAGE_INFO_V0: c_int = 0;
4908 pub const RUSAGE_INFO_V1: c_int = 1;
4909 pub const RUSAGE_INFO_V2: c_int = 2;
4910 pub const RUSAGE_INFO_V3: c_int = 3;
4911 pub const RUSAGE_INFO_V4: c_int = 4;
4912
4913 // copyfile.h
4914 pub const COPYFILE_ACL: crate::copyfile_flags_t = 1 << 0;
4915 pub const COPYFILE_STAT: crate::copyfile_flags_t = 1 << 1;
4916 pub const COPYFILE_XATTR: crate::copyfile_flags_t = 1 << 2;
4917 pub const COPYFILE_DATA: crate::copyfile_flags_t = 1 << 3;
4918 pub const COPYFILE_SECURITY: crate::copyfile_flags_t = COPYFILE_STAT | COPYFILE_ACL;
4919 pub const COPYFILE_METADATA: crate::copyfile_flags_t = COPYFILE_SECURITY | COPYFILE_XATTR;
4920 pub const COPYFILE_RECURSIVE: crate::copyfile_flags_t = 1 << 15;
4921 pub const COPYFILE_CHECK: crate::copyfile_flags_t = 1 << 16;
4922 pub const COPYFILE_EXCL: crate::copyfile_flags_t = 1 << 17;
4923 pub const COPYFILE_NOFOLLOW_SRC: crate::copyfile_flags_t = 1 << 18;
4924 pub const COPYFILE_NOFOLLOW_DST: crate::copyfile_flags_t = 1 << 19;
4925 pub const COPYFILE_MOVE: crate::copyfile_flags_t = 1 << 20;
4926 pub const COPYFILE_UNLINK: crate::copyfile_flags_t = 1 << 21;
4927 pub const COPYFILE_NOFOLLOW: crate::copyfile_flags_t =
4928 COPYFILE_NOFOLLOW_SRC | COPYFILE_NOFOLLOW_DST;
4929 pub const COPYFILE_PACK: crate::copyfile_flags_t = 1 << 22;
4930 pub const COPYFILE_UNPACK: crate::copyfile_flags_t = 1 << 23;
4931 pub const COPYFILE_CLONE: crate::copyfile_flags_t = 1 << 24;
4932 pub const COPYFILE_CLONE_FORCE: crate::copyfile_flags_t = 1 << 25;
4933 pub const COPYFILE_RUN_IN_PLACE: crate::copyfile_flags_t = 1 << 26;
4934 pub const COPYFILE_DATA_SPARSE: crate::copyfile_flags_t = 1 << 27;
4935 pub const COPYFILE_PRESERVE_DST_TRACKED: crate::copyfile_flags_t = 1 << 28;
4936 pub const COPYFILE_VERBOSE: crate::copyfile_flags_t = 1 << 30;
4937 pub const COPYFILE_RECURSE_ERROR: c_int = 0;
4938 pub const COPYFILE_RECURSE_FILE: c_int = 1;
4939 pub const COPYFILE_RECURSE_DIR: c_int = 2;
4940 pub const COPYFILE_RECURSE_DIR_CLEANUP: c_int = 3;
4941 pub const COPYFILE_COPY_DATA: c_int = 4;
4942 pub const COPYFILE_COPY_XATTR: c_int = 5;
4943 pub const COPYFILE_START: c_int = 1;
4944 pub const COPYFILE_FINISH: c_int = 2;
4945 pub const COPYFILE_ERR: c_int = 3;
4946 pub const COPYFILE_PROGRESS: c_int = 4;
4947 pub const COPYFILE_CONTINUE: c_int = 0;
4948 pub const COPYFILE_SKIP: c_int = 1;
4949 pub const COPYFILE_QUIT: c_int = 2;
4950 pub const COPYFILE_STATE_SRC_FD: c_int = 1;
4951 pub const COPYFILE_STATE_SRC_FILENAME: c_int = 2;
4952 pub const COPYFILE_STATE_DST_FD: c_int = 3;
4953 pub const COPYFILE_STATE_DST_FILENAME: c_int = 4;
4954 pub const COPYFILE_STATE_QUARANTINE: c_int = 5;
4955 pub const COPYFILE_STATE_STATUS_CB: c_int = 6;
4956 pub const COPYFILE_STATE_STATUS_CTX: c_int = 7;
4957 pub const COPYFILE_STATE_COPIED: c_int = 8;
4958 pub const COPYFILE_STATE_XATTRNAME: c_int = 9;
4959 pub const COPYFILE_STATE_WAS_CLONED: c_int = 10;
4960 pub const COPYFILE_STATE_SRC_BSIZE: c_int = 11;
4961 pub const COPYFILE_STATE_DST_BSIZE: c_int = 12;
4962 pub const COPYFILE_STATE_BSIZE: c_int = 13;
4963
4964 // <sys/attr.h>
4965 pub const ATTR_BIT_MAP_COUNT: c_ushort = 5;
4966 pub const FSOPT_NOFOLLOW: u32 = 0x1;
4967 pub const FSOPT_NOFOLLOW_ANY: u32 = 0x800;
4968 pub const FSOPT_REPORT_FULLSIZE: u32 = 0x4;
4969 pub const FSOPT_PACK_INVAL_ATTRS: u32 = 0x8;
4970 pub const FSOPT_ATTR_CMN_EXTENDED: u32 = 0x20;
4971 pub const FSOPT_RETURN_REALDEV: u32 = 0x200;
4972 pub const ATTR_CMN_NAME: attrgroup_t = 0x00000001;
4973 pub const ATTR_CMN_DEVID: attrgroup_t = 0x00000002;
4974 pub const ATTR_CMN_FSID: attrgroup_t = 0x00000004;
4975 pub const ATTR_CMN_OBJTYPE: attrgroup_t = 0x00000008;
4976 pub const ATTR_CMN_OBJTAG: attrgroup_t = 0x00000010;
4977 pub const ATTR_CMN_OBJID: attrgroup_t = 0x00000020;
4978 pub const ATTR_CMN_OBJPERMANENTID: attrgroup_t = 0x00000040;
4979 pub const ATTR_CMN_PAROBJID: attrgroup_t = 0x00000080;
4980 pub const ATTR_CMN_SCRIPT: attrgroup_t = 0x00000100;
4981 pub const ATTR_CMN_CRTIME: attrgroup_t = 0x00000200;
4982 pub const ATTR_CMN_MODTIME: attrgroup_t = 0x00000400;
4983 pub const ATTR_CMN_CHGTIME: attrgroup_t = 0x00000800;
4984 pub const ATTR_CMN_ACCTIME: attrgroup_t = 0x00001000;
4985 pub const ATTR_CMN_BKUPTIME: attrgroup_t = 0x00002000;
4986 pub const ATTR_CMN_FNDRINFO: attrgroup_t = 0x00004000;
4987 pub const ATTR_CMN_OWNERID: attrgroup_t = 0x00008000;
4988 pub const ATTR_CMN_GRPID: attrgroup_t = 0x00010000;
4989 pub const ATTR_CMN_ACCESSMASK: attrgroup_t = 0x00020000;
4990 pub const ATTR_CMN_FLAGS: attrgroup_t = 0x00040000;
4991 pub const ATTR_CMN_GEN_COUNT: attrgroup_t = 0x00080000;
4992 pub const ATTR_CMN_DOCUMENT_ID: attrgroup_t = 0x00100000;
4993 pub const ATTR_CMN_USERACCESS: attrgroup_t = 0x00200000;
4994 pub const ATTR_CMN_EXTENDED_SECURITY: attrgroup_t = 0x00400000;
4995 pub const ATTR_CMN_UUID: attrgroup_t = 0x00800000;
4996 pub const ATTR_CMN_GRPUUID: attrgroup_t = 0x01000000;
4997 pub const ATTR_CMN_FILEID: attrgroup_t = 0x02000000;
4998 pub const ATTR_CMN_PARENTID: attrgroup_t = 0x04000000;
4999 pub const ATTR_CMN_FULLPATH: attrgroup_t = 0x08000000;
5000 pub const ATTR_CMN_ADDEDTIME: attrgroup_t = 0x10000000;
5001 pub const ATTR_CMN_DATA_PROTECT_FLAGS: attrgroup_t = 0x40000000;
5002 pub const ATTR_CMN_RETURNED_ATTRS: attrgroup_t = 0x80000000;
5003 pub const ATTR_VOL_FSTYPE: attrgroup_t = 0x00000001;
5004 pub const ATTR_VOL_SIGNATURE: attrgroup_t = 0x00000002;
5005 pub const ATTR_VOL_SIZE: attrgroup_t = 0x00000004;
5006 pub const ATTR_VOL_SPACEFREE: attrgroup_t = 0x00000008;
5007 pub const ATTR_VOL_SPACEAVAIL: attrgroup_t = 0x00000010;
5008 pub const ATTR_VOL_MINALLOCATION: attrgroup_t = 0x00000020;
5009 pub const ATTR_VOL_ALLOCATIONCLUMP: attrgroup_t = 0x00000040;
5010 pub const ATTR_VOL_IOBLOCKSIZE: attrgroup_t = 0x00000080;
5011 pub const ATTR_VOL_OBJCOUNT: attrgroup_t = 0x00000100;
5012 pub const ATTR_VOL_FILECOUNT: attrgroup_t = 0x00000200;
5013 pub const ATTR_VOL_DIRCOUNT: attrgroup_t = 0x00000400;
5014 pub const ATTR_VOL_MAXOBJCOUNT: attrgroup_t = 0x00000800;
5015 pub const ATTR_VOL_MOUNTPOINT: attrgroup_t = 0x00001000;
5016 pub const ATTR_VOL_NAME: attrgroup_t = 0x00002000;
5017 pub const ATTR_VOL_MOUNTFLAGS: attrgroup_t = 0x00004000;
5018 pub const ATTR_VOL_MOUNTEDDEVICE: attrgroup_t = 0x00008000;
5019 pub const ATTR_VOL_ENCODINGSUSED: attrgroup_t = 0x00010000;
5020 pub const ATTR_VOL_CAPABILITIES: attrgroup_t = 0x00020000;
5021 pub const ATTR_VOL_UUID: attrgroup_t = 0x00040000;
5022 pub const ATTR_VOL_SPACEUSED: attrgroup_t = 0x00800000;
5023 pub const ATTR_VOL_QUOTA_SIZE: attrgroup_t = 0x10000000;
5024 pub const ATTR_VOL_RESERVED_SIZE: attrgroup_t = 0x20000000;
5025 pub const ATTR_VOL_ATTRIBUTES: attrgroup_t = 0x40000000;
5026 pub const ATTR_VOL_INFO: attrgroup_t = 0x80000000;
5027 pub const ATTR_DIR_LINKCOUNT: attrgroup_t = 0x00000001;
5028 pub const ATTR_DIR_ENTRYCOUNT: attrgroup_t = 0x00000002;
5029 pub const ATTR_DIR_MOUNTSTATUS: attrgroup_t = 0x00000004;
5030 pub const ATTR_DIR_ALLOCSIZE: attrgroup_t = 0x00000008;
5031 pub const ATTR_DIR_IOBLOCKSIZE: attrgroup_t = 0x00000010;
5032 pub const ATTR_DIR_DATALENGTH: attrgroup_t = 0x00000020;
5033 pub const ATTR_FILE_LINKCOUNT: attrgroup_t = 0x00000001;
5034 pub const ATTR_FILE_TOTALSIZE: attrgroup_t = 0x00000002;
5035 pub const ATTR_FILE_ALLOCSIZE: attrgroup_t = 0x00000004;
5036 pub const ATTR_FILE_IOBLOCKSIZE: attrgroup_t = 0x00000008;
5037 pub const ATTR_FILE_DEVTYPE: attrgroup_t = 0x00000020;
5038 pub const ATTR_FILE_FORKCOUNT: attrgroup_t = 0x00000080;
5039 pub const ATTR_FILE_FORKLIST: attrgroup_t = 0x00000100;
5040 pub const ATTR_FILE_DATALENGTH: attrgroup_t = 0x00000200;
5041 pub const ATTR_FILE_DATAALLOCSIZE: attrgroup_t = 0x00000400;
5042 pub const ATTR_FILE_RSRCLENGTH: attrgroup_t = 0x00001000;
5043 pub const ATTR_FILE_RSRCALLOCSIZE: attrgroup_t = 0x00002000;
5044 pub const ATTR_CMNEXT_RELPATH: attrgroup_t = 0x00000004;
5045 pub const ATTR_CMNEXT_PRIVATESIZE: attrgroup_t = 0x00000008;
5046 pub const ATTR_CMNEXT_LINKID: attrgroup_t = 0x00000010;
5047 pub const ATTR_CMNEXT_NOFIRMLINKPATH: attrgroup_t = 0x00000020;
5048 pub const ATTR_CMNEXT_REALDEVID: attrgroup_t = 0x00000040;
5049 pub const ATTR_CMNEXT_REALFSID: attrgroup_t = 0x00000080;
5050 pub const ATTR_CMNEXT_CLONEID: attrgroup_t = 0x00000100;
5051 pub const ATTR_CMNEXT_EXT_FLAGS: attrgroup_t = 0x00000200;
5052 pub const ATTR_CMNEXT_RECURSIVE_GENCOUNT: attrgroup_t = 0x00000400;
5053 pub const DIR_MNTSTATUS_MNTPOINT: u32 = 0x1;
5054 pub const VOL_CAPABILITIES_FORMAT: usize = 0;
5055 pub const VOL_CAPABILITIES_INTERFACES: usize = 1;
5056 pub const VOL_CAP_FMT_PERSISTENTOBJECTIDS: attrgroup_t = 0x00000001;
5057 pub const VOL_CAP_FMT_SYMBOLICLINKS: attrgroup_t = 0x00000002;
5058 pub const VOL_CAP_FMT_HARDLINKS: attrgroup_t = 0x00000004;
5059 pub const VOL_CAP_FMT_JOURNAL: attrgroup_t = 0x00000008;
5060 pub const VOL_CAP_FMT_JOURNAL_ACTIVE: attrgroup_t = 0x00000010;
5061 pub const VOL_CAP_FMT_NO_ROOT_TIMES: attrgroup_t = 0x00000020;
5062 pub const VOL_CAP_FMT_SPARSE_FILES: attrgroup_t = 0x00000040;
5063 pub const VOL_CAP_FMT_ZERO_RUNS: attrgroup_t = 0x00000080;
5064 pub const VOL_CAP_FMT_CASE_SENSITIVE: attrgroup_t = 0x00000100;
5065 pub const VOL_CAP_FMT_CASE_PRESERVING: attrgroup_t = 0x00000200;
5066 pub const VOL_CAP_FMT_FAST_STATFS: attrgroup_t = 0x00000400;
5067 pub const VOL_CAP_FMT_2TB_FILESIZE: attrgroup_t = 0x00000800;
5068 pub const VOL_CAP_FMT_OPENDENYMODES: attrgroup_t = 0x00001000;
5069 pub const VOL_CAP_FMT_HIDDEN_FILES: attrgroup_t = 0x00002000;
5070 pub const VOL_CAP_FMT_PATH_FROM_ID: attrgroup_t = 0x00004000;
5071 pub const VOL_CAP_FMT_NO_VOLUME_SIZES: attrgroup_t = 0x00008000;
5072 pub const VOL_CAP_FMT_DECMPFS_COMPRESSION: attrgroup_t = 0x00010000;
5073 pub const VOL_CAP_FMT_64BIT_OBJECT_IDS: attrgroup_t = 0x00020000;
5074 pub const VOL_CAP_FMT_DIR_HARDLINKS: attrgroup_t = 0x00040000;
5075 pub const VOL_CAP_FMT_DOCUMENT_ID: attrgroup_t = 0x00080000;
5076 pub const VOL_CAP_FMT_WRITE_GENERATION_COUNT: attrgroup_t = 0x00100000;
5077 pub const VOL_CAP_FMT_NO_IMMUTABLE_FILES: attrgroup_t = 0x00200000;
5078 pub const VOL_CAP_FMT_NO_PERMISSIONS: attrgroup_t = 0x00400000;
5079 pub const VOL_CAP_FMT_SHARED_SPACE: attrgroup_t = 0x00800000;
5080 pub const VOL_CAP_FMT_VOL_GROUPS: attrgroup_t = 0x01000000;
5081 pub const VOL_CAP_FMT_SEALED: attrgroup_t = 0x02000000;
5082 pub const VOL_CAP_INT_SEARCHFS: attrgroup_t = 0x00000001;
5083 pub const VOL_CAP_INT_ATTRLIST: attrgroup_t = 0x00000002;
5084 pub const VOL_CAP_INT_NFSEXPORT: attrgroup_t = 0x00000004;
5085 pub const VOL_CAP_INT_READDIRATTR: attrgroup_t = 0x00000008;
5086 pub const VOL_CAP_INT_EXCHANGEDATA: attrgroup_t = 0x00000010;
5087 pub const VOL_CAP_INT_COPYFILE: attrgroup_t = 0x00000020;
5088 pub const VOL_CAP_INT_ALLOCATE: attrgroup_t = 0x00000040;
5089 pub const VOL_CAP_INT_VOL_RENAME: attrgroup_t = 0x00000080;
5090 pub const VOL_CAP_INT_ADVLOCK: attrgroup_t = 0x00000100;
5091 pub const VOL_CAP_INT_FLOCK: attrgroup_t = 0x00000200;
5092 pub const VOL_CAP_INT_EXTENDED_SECURITY: attrgroup_t = 0x00000400;
5093 pub const VOL_CAP_INT_USERACCESS: attrgroup_t = 0x00000800;
5094 pub const VOL_CAP_INT_MANLOCK: attrgroup_t = 0x00001000;
5095 pub const VOL_CAP_INT_NAMEDSTREAMS: attrgroup_t = 0x00002000;
5096 pub const VOL_CAP_INT_EXTENDED_ATTR: attrgroup_t = 0x00004000;
5097 pub const VOL_CAP_INT_CLONE: attrgroup_t = 0x00010000;
5098 pub const VOL_CAP_INT_SNAPSHOT: attrgroup_t = 0x00020000;
5099 pub const VOL_CAP_INT_RENAME_SWAP: attrgroup_t = 0x00040000;
5100 pub const VOL_CAP_INT_RENAME_EXCL: attrgroup_t = 0x00080000;
5101 pub const VOL_CAP_INT_RENAME_OPENFAIL: attrgroup_t = 0x00100000;
5102
5103 // os/clock.h
5104 pub const OS_CLOCK_MACH_ABSOLUTE_TIME: os_clockid_t = 32;
5105
5106 // os/os_sync_wait_on_address.h
5107 pub const OS_SYNC_WAIT_ON_ADDRESS_NONE: os_sync_wait_on_address_flags_t = 0x00000000;
5108 pub const OS_SYNC_WAIT_ON_ADDRESS_SHARED: os_sync_wait_on_address_flags_t = 0x00000001;
5109 pub const OS_SYNC_WAKE_BY_ADDRESS_NONE: os_sync_wake_by_address_flags_t = 0x00000000;
5110 pub const OS_SYNC_WAKE_BY_ADDRESS_SHARED: os_sync_wake_by_address_flags_t = 0x00000001;
5111
5112 // <proc.h>
5113 /// Process being created by fork.
5114 pub const SIDL: u32 = 1;
5115 /// Currently runnable.
5116 pub const SRUN: u32 = 2;
5117 /// Sleeping on an address.
5118 pub const SSLEEP: u32 = 3;
5119 /// Process debugging or suspension.
5120 pub const SSTOP: u32 = 4;
5121 /// Awaiting collection by parent.
5122 pub const SZOMB: u32 = 5;
5123
5124 // sys/vsock.h
5125 pub const VMADDR_CID_ANY: c_uint = 0xFFFFFFFF;
5126 pub const VMADDR_CID_HYPERVISOR: c_uint = 0;
5127 pub const VMADDR_CID_RESERVED: c_uint = 1;
5128 pub const VMADDR_CID_HOST: c_uint = 2;
5129 pub const VMADDR_PORT_ANY: c_uint = 0xFFFFFFFF;
5130
__DARWIN_ALIGN32(p: usize) -> usize5131 const fn __DARWIN_ALIGN32(p: usize) -> usize {
5132 const __DARWIN_ALIGNBYTES32: usize = mem::size_of::<u32>() - 1;
5133 (p + __DARWIN_ALIGNBYTES32) & !__DARWIN_ALIGNBYTES32
5134 }
5135
5136 pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t =
5137 (mem::size_of::<thread_extended_policy_data_t>() / mem::size_of::<integer_t>())
5138 as mach_msg_type_number_t;
5139 pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t =
5140 (mem::size_of::<thread_time_constraint_policy_data_t>() / mem::size_of::<integer_t>())
5141 as mach_msg_type_number_t;
5142 pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t =
5143 (mem::size_of::<thread_precedence_policy_data_t>() / mem::size_of::<integer_t>())
5144 as mach_msg_type_number_t;
5145 pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t =
5146 (mem::size_of::<thread_affinity_policy_data_t>() / mem::size_of::<integer_t>())
5147 as mach_msg_type_number_t;
5148 pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t =
5149 (mem::size_of::<thread_background_policy_data_t>() / mem::size_of::<integer_t>())
5150 as mach_msg_type_number_t;
5151 pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t =
5152 (mem::size_of::<thread_latency_qos_policy_data_t>() / mem::size_of::<integer_t>())
5153 as mach_msg_type_number_t;
5154 pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t =
5155 (mem::size_of::<thread_throughput_qos_policy_data_t>() / mem::size_of::<integer_t>())
5156 as mach_msg_type_number_t;
5157 pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t =
5158 (mem::size_of::<thread_basic_info_data_t>() / mem::size_of::<integer_t>())
5159 as mach_msg_type_number_t;
5160 pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t =
5161 (mem::size_of::<thread_identifier_info_data_t>() / mem::size_of::<integer_t>())
5162 as mach_msg_type_number_t;
5163 pub const THREAD_EXTENDED_INFO_COUNT: mach_msg_type_number_t =
5164 (mem::size_of::<thread_extended_info_data_t>() / mem::size_of::<integer_t>())
5165 as mach_msg_type_number_t;
5166
5167 pub const TASK_THREAD_TIMES_INFO_COUNT: u32 =
5168 (mem::size_of::<task_thread_times_info_data_t>() / mem::size_of::<natural_t>()) as u32;
5169 pub const MACH_TASK_BASIC_INFO_COUNT: u32 =
5170 (mem::size_of::<mach_task_basic_info_data_t>() / mem::size_of::<natural_t>()) as u32;
5171 pub const HOST_VM_INFO64_COUNT: mach_msg_type_number_t = (mem::size_of::<vm_statistics64_data_t>()
5172 / mem::size_of::<integer_t>())
5173 as mach_msg_type_number_t;
5174
5175 // bsd/net/if_mib.h
5176 /// Non-interface-specific
5177 pub const IFMIB_SYSTEM: c_int = 1;
5178 /// Per-interface data table
5179 pub const IFMIB_IFDATA: c_int = 2;
5180 /// All interfaces data at once
5181 pub const IFMIB_IFALLDATA: c_int = 3;
5182
5183 /// Generic stats for all kinds of ifaces
5184 pub const IFDATA_GENERAL: c_int = 1;
5185 /// Specific to the type of interface
5186 pub const IFDATA_LINKSPECIFIC: c_int = 2;
5187 /// Addresses assigned to interface
5188 pub const IFDATA_ADDRS: c_int = 3;
5189 /// Multicast addresses assigned to interface
5190 pub const IFDATA_MULTIADDRS: c_int = 4;
5191
5192 /// Number of interfaces configured
5193 pub const IFMIB_IFCOUNT: c_int = 1;
5194
5195 /// Functions not specific to a type of iface
5196 pub const NETLINK_GENERIC: c_int = 0;
5197
5198 pub const DOT3COMPLIANCE_STATS: c_int = 1;
5199 pub const DOT3COMPLIANCE_COLLS: c_int = 2;
5200
5201 // kern_control.h
5202 pub const MAX_KCTL_NAME: usize = 96;
5203
5204 f! {
5205 pub fn CMSG_NXTHDR(mhdr: *const crate::msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr {
5206 if cmsg.is_null() {
5207 return crate::CMSG_FIRSTHDR(mhdr);
5208 }
5209 let cmsg_len = (*cmsg).cmsg_len as usize;
5210 let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len);
5211 let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize;
5212 if next + __DARWIN_ALIGN32(mem::size_of::<cmsghdr>()) > max {
5213 core::ptr::null_mut()
5214 } else {
5215 next as *mut cmsghdr
5216 }
5217 }
5218
5219 pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar {
5220 (cmsg as *mut c_uchar).add(__DARWIN_ALIGN32(mem::size_of::<cmsghdr>()))
5221 }
5222
5223 pub {const} fn CMSG_SPACE(length: c_uint) -> c_uint {
5224 (__DARWIN_ALIGN32(mem::size_of::<cmsghdr>()) + __DARWIN_ALIGN32(length as usize)) as c_uint
5225 }
5226
5227 pub {const} fn CMSG_LEN(length: c_uint) -> c_uint {
5228 (__DARWIN_ALIGN32(mem::size_of::<cmsghdr>()) + length as usize) as c_uint
5229 }
5230
5231 pub {const} fn VM_MAKE_TAG(id: u8) -> u32 {
5232 (id as u32) << 24u32
5233 }
5234 }
5235
5236 safe_f! {
5237 pub {const} fn WSTOPSIG(status: c_int) -> c_int {
5238 status >> 8
5239 }
5240
5241 pub {const} fn _WSTATUS(status: c_int) -> c_int {
5242 status & 0x7f
5243 }
5244
5245 pub {const} fn WIFCONTINUED(status: c_int) -> bool {
5246 _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) == 0x13
5247 }
5248
5249 pub {const} fn WIFSIGNALED(status: c_int) -> bool {
5250 _WSTATUS(status) != _WSTOPPED && _WSTATUS(status) != 0
5251 }
5252
5253 pub {const} fn WIFSTOPPED(status: c_int) -> bool {
5254 _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) != 0x13
5255 }
5256
5257 pub {const} fn makedev(major: i32, minor: i32) -> dev_t {
5258 (major << 24) | minor
5259 }
5260
5261 pub {const} fn major(dev: dev_t) -> i32 {
5262 (dev >> 24) & 0xff
5263 }
5264
5265 pub {const} fn minor(dev: dev_t) -> i32 {
5266 dev & 0xffffff
5267 }
5268 }
5269
5270 extern "C" {
setgrent()5271 pub fn setgrent();
5272 #[doc(hidden)]
5273 #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.5")]
5274 #[cfg_attr(not(target_arch = "aarch64"), link_name = "daemon$1050")]
daemon(nochdir: c_int, noclose: c_int) -> c_int5275 pub fn daemon(nochdir: c_int, noclose: c_int) -> c_int;
5276 #[doc(hidden)]
5277 #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")]
sem_destroy(sem: *mut sem_t) -> c_int5278 pub fn sem_destroy(sem: *mut sem_t) -> c_int;
5279 #[doc(hidden)]
5280 #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")]
sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int5281 pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int;
aio_read(aiocbp: *mut aiocb) -> c_int5282 pub fn aio_read(aiocbp: *mut aiocb) -> c_int;
aio_write(aiocbp: *mut aiocb) -> c_int5283 pub fn aio_write(aiocbp: *mut aiocb) -> c_int;
aio_fsync(op: c_int, aiocbp: *mut aiocb) -> c_int5284 pub fn aio_fsync(op: c_int, aiocbp: *mut aiocb) -> c_int;
aio_error(aiocbp: *const aiocb) -> c_int5285 pub fn aio_error(aiocbp: *const aiocb) -> c_int;
aio_return(aiocbp: *mut aiocb) -> ssize_t5286 pub fn aio_return(aiocbp: *mut aiocb) -> ssize_t;
5287 #[cfg_attr(
5288 all(target_os = "macos", target_arch = "x86"),
5289 link_name = "aio_suspend$UNIX2003"
5290 )]
aio_suspend( aiocb_list: *const *const aiocb, nitems: c_int, timeout: *const crate::timespec, ) -> c_int5291 pub fn aio_suspend(
5292 aiocb_list: *const *const aiocb,
5293 nitems: c_int,
5294 timeout: *const crate::timespec,
5295 ) -> c_int;
aio_cancel(fd: c_int, aiocbp: *mut aiocb) -> c_int5296 pub fn aio_cancel(fd: c_int, aiocbp: *mut aiocb) -> c_int;
chflags(path: *const c_char, flags: c_uint) -> c_int5297 pub fn chflags(path: *const c_char, flags: c_uint) -> c_int;
fchflags(fd: c_int, flags: c_uint) -> c_int5298 pub fn fchflags(fd: c_int, flags: c_uint) -> c_int;
clock_getres(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int5299 pub fn clock_getres(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int;
clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int5300 pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int;
lio_listio( mode: c_int, aiocb_list: *const *mut aiocb, nitems: c_int, sevp: *mut sigevent, ) -> c_int5301 pub fn lio_listio(
5302 mode: c_int,
5303 aiocb_list: *const *mut aiocb,
5304 nitems: c_int,
5305 sevp: *mut sigevent,
5306 ) -> c_int;
5307
dirfd(dirp: *mut crate::DIR) -> c_int5308 pub fn dirfd(dirp: *mut crate::DIR) -> c_int;
5309
lutimes(file: *const c_char, times: *const crate::timeval) -> c_int5310 pub fn lutimes(file: *const c_char, times: *const crate::timeval) -> c_int;
5311
gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int5312 pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int;
getutxent() -> *mut utmpx5313 pub fn getutxent() -> *mut utmpx;
getutxid(ut: *const utmpx) -> *mut utmpx5314 pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
getutxline(ut: *const utmpx) -> *mut utmpx5315 pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
pututxline(ut: *const utmpx) -> *mut utmpx5316 pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
setutxent()5317 pub fn setutxent();
endutxent()5318 pub fn endutxent();
utmpxname(file: *const c_char) -> c_int5319 pub fn utmpxname(file: *const c_char) -> c_int;
5320
asctime(tm: *const crate::tm) -> *mut c_char5321 pub fn asctime(tm: *const crate::tm) -> *mut c_char;
ctime(clock: *const time_t) -> *mut c_char5322 pub fn ctime(clock: *const time_t) -> *mut c_char;
getdate(datestr: *const c_char) -> *mut crate::tm5323 pub fn getdate(datestr: *const c_char) -> *mut crate::tm;
strptime( buf: *const c_char, format: *const c_char, timeptr: *mut crate::tm, ) -> *mut c_char5324 pub fn strptime(
5325 buf: *const c_char,
5326 format: *const c_char,
5327 timeptr: *mut crate::tm,
5328 ) -> *mut c_char;
asctime_r(tm: *const crate::tm, result: *mut c_char) -> *mut c_char5329 pub fn asctime_r(tm: *const crate::tm, result: *mut c_char) -> *mut c_char;
ctime_r(clock: *const time_t, result: *mut c_char) -> *mut c_char5330 pub fn ctime_r(clock: *const time_t, result: *mut c_char) -> *mut c_char;
5331
getnameinfo( sa: *const crate::sockaddr, salen: crate::socklen_t, host: *mut c_char, hostlen: crate::socklen_t, serv: *mut c_char, servlen: crate::socklen_t, flags: c_int, ) -> c_int5332 pub fn getnameinfo(
5333 sa: *const crate::sockaddr,
5334 salen: crate::socklen_t,
5335 host: *mut c_char,
5336 hostlen: crate::socklen_t,
5337 serv: *mut c_char,
5338 servlen: crate::socklen_t,
5339 flags: c_int,
5340 ) -> c_int;
mincore(addr: *const c_void, len: size_t, vec: *mut c_char) -> c_int5341 pub fn mincore(addr: *const c_void, len: size_t, vec: *mut c_char) -> c_int;
sysctlnametomib(name: *const c_char, mibp: *mut c_int, sizep: *mut size_t) -> c_int5342 pub fn sysctlnametomib(name: *const c_char, mibp: *mut c_int, sizep: *mut size_t) -> c_int;
5343 #[cfg_attr(
5344 all(target_os = "macos", target_arch = "x86"),
5345 link_name = "mprotect$UNIX2003"
5346 )]
mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int5347 pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int;
semget(key: key_t, nsems: c_int, semflg: c_int) -> c_int5348 pub fn semget(key: key_t, nsems: c_int, semflg: c_int) -> c_int;
5349 #[cfg_attr(
5350 all(target_os = "macos", target_arch = "x86"),
5351 link_name = "semctl$UNIX2003"
5352 )]
semctl(semid: c_int, semnum: c_int, cmd: c_int, ...) -> c_int5353 pub fn semctl(semid: c_int, semnum: c_int, cmd: c_int, ...) -> c_int;
semop(semid: c_int, sops: *mut sembuf, nsops: size_t) -> c_int5354 pub fn semop(semid: c_int, sops: *mut sembuf, nsops: size_t) -> c_int;
shm_open(name: *const c_char, oflag: c_int, ...) -> c_int5355 pub fn shm_open(name: *const c_char, oflag: c_int, ...) -> c_int;
ftok(pathname: *const c_char, proj_id: c_int) -> key_t5356 pub fn ftok(pathname: *const c_char, proj_id: c_int) -> key_t;
shmat(shmid: c_int, shmaddr: *const c_void, shmflg: c_int) -> *mut c_void5357 pub fn shmat(shmid: c_int, shmaddr: *const c_void, shmflg: c_int) -> *mut c_void;
shmdt(shmaddr: *const c_void) -> c_int5358 pub fn shmdt(shmaddr: *const c_void) -> c_int;
5359 #[cfg_attr(
5360 all(target_os = "macos", target_arch = "x86"),
5361 link_name = "shmctl$UNIX2003"
5362 )]
shmctl(shmid: c_int, cmd: c_int, buf: *mut crate::shmid_ds) -> c_int5363 pub fn shmctl(shmid: c_int, cmd: c_int, buf: *mut crate::shmid_ds) -> c_int;
shmget(key: key_t, size: size_t, shmflg: c_int) -> c_int5364 pub fn shmget(key: key_t, size: size_t, shmflg: c_int) -> c_int;
sysctl( name: *mut c_int, namelen: c_uint, oldp: *mut c_void, oldlenp: *mut size_t, newp: *mut c_void, newlen: size_t, ) -> c_int5365 pub fn sysctl(
5366 name: *mut c_int,
5367 namelen: c_uint,
5368 oldp: *mut c_void,
5369 oldlenp: *mut size_t,
5370 newp: *mut c_void,
5371 newlen: size_t,
5372 ) -> c_int;
sysctlbyname( name: *const c_char, oldp: *mut c_void, oldlenp: *mut size_t, newp: *mut c_void, newlen: size_t, ) -> c_int5373 pub fn sysctlbyname(
5374 name: *const c_char,
5375 oldp: *mut c_void,
5376 oldlenp: *mut size_t,
5377 newp: *mut c_void,
5378 newlen: size_t,
5379 ) -> c_int;
5380 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
mach_absolute_time() -> u645381 pub fn mach_absolute_time() -> u64;
5382 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
5383 #[allow(deprecated)]
mach_timebase_info(info: *mut crate::mach_timebase_info) -> c_int5384 pub fn mach_timebase_info(info: *mut crate::mach_timebase_info) -> c_int;
5385 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
mach_host_self() -> mach_port_t5386 pub fn mach_host_self() -> mach_port_t;
5387 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
mach_thread_self() -> mach_port_t5388 pub fn mach_thread_self() -> mach_port_t;
pthread_once( once_control: *mut crate::pthread_once_t, init_routine: Option<unsafe extern "C" fn()>, ) -> c_int5389 pub fn pthread_once(
5390 once_control: *mut crate::pthread_once_t,
5391 init_routine: Option<unsafe extern "C" fn()>,
5392 ) -> c_int;
pthread_attr_getinheritsched( attr: *const crate::pthread_attr_t, inheritsched: *mut c_int, ) -> c_int5393 pub fn pthread_attr_getinheritsched(
5394 attr: *const crate::pthread_attr_t,
5395 inheritsched: *mut c_int,
5396 ) -> c_int;
pthread_attr_getschedpolicy( attr: *const crate::pthread_attr_t, policy: *mut c_int, ) -> c_int5397 pub fn pthread_attr_getschedpolicy(
5398 attr: *const crate::pthread_attr_t,
5399 policy: *mut c_int,
5400 ) -> c_int;
pthread_attr_getscope( attr: *const crate::pthread_attr_t, contentionscope: *mut c_int, ) -> c_int5401 pub fn pthread_attr_getscope(
5402 attr: *const crate::pthread_attr_t,
5403 contentionscope: *mut c_int,
5404 ) -> c_int;
pthread_attr_getstackaddr( attr: *const crate::pthread_attr_t, stackaddr: *mut *mut c_void, ) -> c_int5405 pub fn pthread_attr_getstackaddr(
5406 attr: *const crate::pthread_attr_t,
5407 stackaddr: *mut *mut c_void,
5408 ) -> c_int;
pthread_attr_getdetachstate( attr: *const crate::pthread_attr_t, detachstate: *mut c_int, ) -> c_int5409 pub fn pthread_attr_getdetachstate(
5410 attr: *const crate::pthread_attr_t,
5411 detachstate: *mut c_int,
5412 ) -> c_int;
pthread_attr_setinheritsched( attr: *mut crate::pthread_attr_t, inheritsched: c_int, ) -> c_int5413 pub fn pthread_attr_setinheritsched(
5414 attr: *mut crate::pthread_attr_t,
5415 inheritsched: c_int,
5416 ) -> c_int;
pthread_attr_setschedpolicy(attr: *mut crate::pthread_attr_t, policy: c_int) -> c_int5417 pub fn pthread_attr_setschedpolicy(attr: *mut crate::pthread_attr_t, policy: c_int) -> c_int;
pthread_attr_setscope(attr: *mut crate::pthread_attr_t, contentionscope: c_int) -> c_int5418 pub fn pthread_attr_setscope(attr: *mut crate::pthread_attr_t, contentionscope: c_int)
5419 -> c_int;
pthread_attr_setstackaddr( attr: *mut crate::pthread_attr_t, stackaddr: *mut c_void, ) -> c_int5420 pub fn pthread_attr_setstackaddr(
5421 attr: *mut crate::pthread_attr_t,
5422 stackaddr: *mut c_void,
5423 ) -> c_int;
pthread_setname_np(name: *const c_char) -> c_int5424 pub fn pthread_setname_np(name: *const c_char) -> c_int;
pthread_getname_np(thread: crate::pthread_t, name: *mut c_char, len: size_t) -> c_int5425 pub fn pthread_getname_np(thread: crate::pthread_t, name: *mut c_char, len: size_t) -> c_int;
pthread_mach_thread_np(thread: crate::pthread_t) -> crate::mach_port_t5426 pub fn pthread_mach_thread_np(thread: crate::pthread_t) -> crate::mach_port_t;
pthread_from_mach_thread_np(port: crate::mach_port_t) -> crate::pthread_t5427 pub fn pthread_from_mach_thread_np(port: crate::mach_port_t) -> crate::pthread_t;
pthread_create_from_mach_thread( thread: *mut crate::pthread_t, attr: *const crate::pthread_attr_t, f: extern "C" fn(*mut c_void) -> *mut c_void, value: *mut c_void, ) -> c_int5428 pub fn pthread_create_from_mach_thread(
5429 thread: *mut crate::pthread_t,
5430 attr: *const crate::pthread_attr_t,
5431 f: extern "C" fn(*mut c_void) -> *mut c_void,
5432 value: *mut c_void,
5433 ) -> c_int;
pthread_stack_frame_decode_np( frame_addr: crate::uintptr_t, return_addr: *mut crate::uintptr_t, ) -> crate::uintptr_t5434 pub fn pthread_stack_frame_decode_np(
5435 frame_addr: crate::uintptr_t,
5436 return_addr: *mut crate::uintptr_t,
5437 ) -> crate::uintptr_t;
pthread_get_stackaddr_np(thread: crate::pthread_t) -> *mut c_void5438 pub fn pthread_get_stackaddr_np(thread: crate::pthread_t) -> *mut c_void;
pthread_get_stacksize_np(thread: crate::pthread_t) -> size_t5439 pub fn pthread_get_stacksize_np(thread: crate::pthread_t) -> size_t;
pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: c_int) -> c_int5440 pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: c_int) -> c_int;
pthread_condattr_getpshared( attr: *const pthread_condattr_t, pshared: *mut c_int, ) -> c_int5441 pub fn pthread_condattr_getpshared(
5442 attr: *const pthread_condattr_t,
5443 pshared: *mut c_int,
5444 ) -> c_int;
pthread_main_np() -> c_int5445 pub fn pthread_main_np() -> c_int;
pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, pshared: c_int) -> c_int5446 pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, pshared: c_int) -> c_int;
pthread_mutexattr_getpshared( attr: *const pthread_mutexattr_t, pshared: *mut c_int, ) -> c_int5447 pub fn pthread_mutexattr_getpshared(
5448 attr: *const pthread_mutexattr_t,
5449 pshared: *mut c_int,
5450 ) -> c_int;
pthread_rwlockattr_getpshared( attr: *const pthread_rwlockattr_t, val: *mut c_int, ) -> c_int5451 pub fn pthread_rwlockattr_getpshared(
5452 attr: *const pthread_rwlockattr_t,
5453 val: *mut c_int,
5454 ) -> c_int;
pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: c_int) -> c_int5455 pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: c_int) -> c_int;
pthread_threadid_np(thread: crate::pthread_t, thread_id: *mut u64) -> c_int5456 pub fn pthread_threadid_np(thread: crate::pthread_t, thread_id: *mut u64) -> c_int;
pthread_attr_set_qos_class_np( attr: *mut pthread_attr_t, class: qos_class_t, priority: c_int, ) -> c_int5457 pub fn pthread_attr_set_qos_class_np(
5458 attr: *mut pthread_attr_t,
5459 class: qos_class_t,
5460 priority: c_int,
5461 ) -> c_int;
pthread_attr_get_qos_class_np( attr: *mut pthread_attr_t, class: *mut qos_class_t, priority: *mut c_int, ) -> c_int5462 pub fn pthread_attr_get_qos_class_np(
5463 attr: *mut pthread_attr_t,
5464 class: *mut qos_class_t,
5465 priority: *mut c_int,
5466 ) -> c_int;
pthread_set_qos_class_self_np(class: qos_class_t, priority: c_int) -> c_int5467 pub fn pthread_set_qos_class_self_np(class: qos_class_t, priority: c_int) -> c_int;
pthread_get_qos_class_np( thread: crate::pthread_t, class: *mut qos_class_t, priority: *mut c_int, ) -> c_int5468 pub fn pthread_get_qos_class_np(
5469 thread: crate::pthread_t,
5470 class: *mut qos_class_t,
5471 priority: *mut c_int,
5472 ) -> c_int;
pthread_attr_getschedparam( attr: *const crate::pthread_attr_t, param: *mut sched_param, ) -> c_int5473 pub fn pthread_attr_getschedparam(
5474 attr: *const crate::pthread_attr_t,
5475 param: *mut sched_param,
5476 ) -> c_int;
pthread_attr_setschedparam( attr: *mut crate::pthread_attr_t, param: *const sched_param, ) -> c_int5477 pub fn pthread_attr_setschedparam(
5478 attr: *mut crate::pthread_attr_t,
5479 param: *const sched_param,
5480 ) -> c_int;
pthread_getschedparam( thread: crate::pthread_t, policy: *mut c_int, param: *mut sched_param, ) -> c_int5481 pub fn pthread_getschedparam(
5482 thread: crate::pthread_t,
5483 policy: *mut c_int,
5484 param: *mut sched_param,
5485 ) -> c_int;
pthread_setschedparam( thread: crate::pthread_t, policy: c_int, param: *const sched_param, ) -> c_int5486 pub fn pthread_setschedparam(
5487 thread: crate::pthread_t,
5488 policy: c_int,
5489 param: *const sched_param,
5490 ) -> c_int;
5491
5492 // Available from Big Sur
pthread_introspection_hook_install( hook: crate::pthread_introspection_hook_t, ) -> crate::pthread_introspection_hook_t5493 pub fn pthread_introspection_hook_install(
5494 hook: crate::pthread_introspection_hook_t,
5495 ) -> crate::pthread_introspection_hook_t;
pthread_introspection_setspecific_np( thread: crate::pthread_t, key: crate::pthread_key_t, value: *const c_void, ) -> c_int5496 pub fn pthread_introspection_setspecific_np(
5497 thread: crate::pthread_t,
5498 key: crate::pthread_key_t,
5499 value: *const c_void,
5500 ) -> c_int;
pthread_introspection_getspecific_np( thread: crate::pthread_t, key: crate::pthread_key_t, ) -> *mut c_void5501 pub fn pthread_introspection_getspecific_np(
5502 thread: crate::pthread_t,
5503 key: crate::pthread_key_t,
5504 ) -> *mut c_void;
pthread_jit_write_protect_np(enabled: c_int)5505 pub fn pthread_jit_write_protect_np(enabled: c_int);
pthread_jit_write_protect_supported_np() -> c_int5506 pub fn pthread_jit_write_protect_supported_np() -> c_int;
5507 // An array of pthread_jit_write_with_callback_np must declare
5508 // the list of callbacks e.g.
5509 // #[link_section = "__DATA_CONST,__pth_jit_func"]
5510 // static callbacks: [libc::pthread_jit_write_callback_t; 2] = [native_jit_write_cb,
5511 // std::mem::transmute::<libc::pthread_jit_write_callback_t>(std::ptr::null())];
5512 // (a handy PTHREAD_JIT_WRITE_CALLBACK_NP macro for other languages).
pthread_jit_write_with_callback_np( callback: crate::pthread_jit_write_callback_t, ctx: *mut c_void, ) -> c_int5513 pub fn pthread_jit_write_with_callback_np(
5514 callback: crate::pthread_jit_write_callback_t,
5515 ctx: *mut c_void,
5516 ) -> c_int;
pthread_jit_write_freeze_callbacks_np()5517 pub fn pthread_jit_write_freeze_callbacks_np();
pthread_cpu_number_np(cpu_number_out: *mut size_t) -> c_int5518 pub fn pthread_cpu_number_np(cpu_number_out: *mut size_t) -> c_int;
5519
5520 // Available starting with macOS 14.4.
os_sync_wait_on_address( addr: *mut c_void, value: u64, size: size_t, flags: os_sync_wait_on_address_flags_t, ) -> c_int5521 pub fn os_sync_wait_on_address(
5522 addr: *mut c_void,
5523 value: u64,
5524 size: size_t,
5525 flags: os_sync_wait_on_address_flags_t,
5526 ) -> c_int;
os_sync_wait_on_address_with_deadline( addr: *mut c_void, value: u64, size: size_t, flags: os_sync_wait_on_address_flags_t, clockid: os_clockid_t, deadline: u64, ) -> c_int5527 pub fn os_sync_wait_on_address_with_deadline(
5528 addr: *mut c_void,
5529 value: u64,
5530 size: size_t,
5531 flags: os_sync_wait_on_address_flags_t,
5532 clockid: os_clockid_t,
5533 deadline: u64,
5534 ) -> c_int;
os_sync_wait_on_address_with_timeout( addr: *mut c_void, value: u64, size: size_t, flags: os_sync_wait_on_address_flags_t, clockid: os_clockid_t, timeout_ns: u64, ) -> c_int5535 pub fn os_sync_wait_on_address_with_timeout(
5536 addr: *mut c_void,
5537 value: u64,
5538 size: size_t,
5539 flags: os_sync_wait_on_address_flags_t,
5540 clockid: os_clockid_t,
5541 timeout_ns: u64,
5542 ) -> c_int;
os_sync_wake_by_address_any( addr: *mut c_void, size: size_t, flags: os_sync_wake_by_address_flags_t, ) -> c_int5543 pub fn os_sync_wake_by_address_any(
5544 addr: *mut c_void,
5545 size: size_t,
5546 flags: os_sync_wake_by_address_flags_t,
5547 ) -> c_int;
os_sync_wake_by_address_all( addr: *mut c_void, size: size_t, flags: os_sync_wake_by_address_flags_t, ) -> c_int5548 pub fn os_sync_wake_by_address_all(
5549 addr: *mut c_void,
5550 size: size_t,
5551 flags: os_sync_wake_by_address_flags_t,
5552 ) -> c_int;
5553
os_unfair_lock_lock(lock: os_unfair_lock_t)5554 pub fn os_unfair_lock_lock(lock: os_unfair_lock_t);
os_unfair_lock_trylock(lock: os_unfair_lock_t) -> bool5555 pub fn os_unfair_lock_trylock(lock: os_unfair_lock_t) -> bool;
os_unfair_lock_unlock(lock: os_unfair_lock_t)5556 pub fn os_unfair_lock_unlock(lock: os_unfair_lock_t);
os_unfair_lock_assert_owner(lock: os_unfair_lock_t)5557 pub fn os_unfair_lock_assert_owner(lock: os_unfair_lock_t);
os_unfair_lock_assert_not_owner(lock: os_unfair_lock_t)5558 pub fn os_unfair_lock_assert_not_owner(lock: os_unfair_lock_t);
5559
os_log_create(subsystem: *const c_char, category: *const c_char) -> crate::os_log_t5560 pub fn os_log_create(subsystem: *const c_char, category: *const c_char) -> crate::os_log_t;
os_log_type_enabled(oslog: crate::os_log_t, tpe: crate::os_log_type_t) -> bool5561 pub fn os_log_type_enabled(oslog: crate::os_log_t, tpe: crate::os_log_type_t) -> bool;
os_signpost_id_make_with_pointer( log: crate::os_log_t, ptr: *const c_void, ) -> crate::os_signpost_id_t5562 pub fn os_signpost_id_make_with_pointer(
5563 log: crate::os_log_t,
5564 ptr: *const c_void,
5565 ) -> crate::os_signpost_id_t;
os_signpost_id_generate(log: crate::os_log_t) -> crate::os_signpost_id_t5566 pub fn os_signpost_id_generate(log: crate::os_log_t) -> crate::os_signpost_id_t;
os_signpost_enabled(log: crate::os_log_t) -> bool5567 pub fn os_signpost_enabled(log: crate::os_log_t) -> bool;
5568
thread_policy_set( thread: thread_t, flavor: thread_policy_flavor_t, policy_info: thread_policy_t, count: mach_msg_type_number_t, ) -> kern_return_t5569 pub fn thread_policy_set(
5570 thread: thread_t,
5571 flavor: thread_policy_flavor_t,
5572 policy_info: thread_policy_t,
5573 count: mach_msg_type_number_t,
5574 ) -> kern_return_t;
thread_policy_get( thread: thread_t, flavor: thread_policy_flavor_t, policy_info: thread_policy_t, count: *mut mach_msg_type_number_t, get_default: *mut boolean_t, ) -> kern_return_t5575 pub fn thread_policy_get(
5576 thread: thread_t,
5577 flavor: thread_policy_flavor_t,
5578 policy_info: thread_policy_t,
5579 count: *mut mach_msg_type_number_t,
5580 get_default: *mut boolean_t,
5581 ) -> kern_return_t;
thread_info( target_act: thread_inspect_t, flavor: thread_flavor_t, thread_info_out: thread_info_t, thread_info_outCnt: *mut mach_msg_type_number_t, ) -> kern_return_t5582 pub fn thread_info(
5583 target_act: thread_inspect_t,
5584 flavor: thread_flavor_t,
5585 thread_info_out: thread_info_t,
5586 thread_info_outCnt: *mut mach_msg_type_number_t,
5587 ) -> kern_return_t;
5588 #[cfg_attr(doc, doc(alias = "__errno_location"))]
5589 #[cfg_attr(doc, doc(alias = "errno"))]
__error() -> *mut c_int5590 pub fn __error() -> *mut c_int;
backtrace(buf: *mut *mut c_void, sz: c_int) -> c_int5591 pub fn backtrace(buf: *mut *mut c_void, sz: c_int) -> c_int;
backtrace_symbols(addrs: *const *mut c_void, sz: c_int) -> *mut *mut c_char5592 pub fn backtrace_symbols(addrs: *const *mut c_void, sz: c_int) -> *mut *mut c_char;
backtrace_symbols_fd(addrs: *const *mut c_void, sz: c_int, fd: c_int)5593 pub fn backtrace_symbols_fd(addrs: *const *mut c_void, sz: c_int, fd: c_int);
backtrace_from_fp(startfp: *mut c_void, array: *mut *mut c_void, size: c_int) -> c_int5594 pub fn backtrace_from_fp(startfp: *mut c_void, array: *mut *mut c_void, size: c_int) -> c_int;
backtrace_image_offsets( array: *const *mut c_void, image_offsets: *mut image_offset, size: c_int, )5595 pub fn backtrace_image_offsets(
5596 array: *const *mut c_void,
5597 image_offsets: *mut image_offset,
5598 size: c_int,
5599 );
backtrace_async(array: *mut *mut c_void, length: size_t, task_id: *mut u32) -> size_t5600 pub fn backtrace_async(array: *mut *mut c_void, length: size_t, task_id: *mut u32) -> size_t;
5601 #[cfg_attr(
5602 all(target_os = "macos", not(target_arch = "aarch64")),
5603 link_name = "statfs$INODE64"
5604 )]
statfs(path: *const c_char, buf: *mut statfs) -> c_int5605 pub fn statfs(path: *const c_char, buf: *mut statfs) -> c_int;
5606 #[cfg_attr(
5607 all(target_os = "macos", not(target_arch = "aarch64")),
5608 link_name = "fstatfs$INODE64"
5609 )]
fstatfs(fd: c_int, buf: *mut statfs) -> c_int5610 pub fn fstatfs(fd: c_int, buf: *mut statfs) -> c_int;
kevent( kq: c_int, changelist: *const crate::kevent, nchanges: c_int, eventlist: *mut crate::kevent, nevents: c_int, timeout: *const crate::timespec, ) -> c_int5611 pub fn kevent(
5612 kq: c_int,
5613 changelist: *const crate::kevent,
5614 nchanges: c_int,
5615 eventlist: *mut crate::kevent,
5616 nevents: c_int,
5617 timeout: *const crate::timespec,
5618 ) -> c_int;
kevent64( kq: c_int, changelist: *const crate::kevent64_s, nchanges: c_int, eventlist: *mut crate::kevent64_s, nevents: c_int, flags: c_uint, timeout: *const crate::timespec, ) -> c_int5619 pub fn kevent64(
5620 kq: c_int,
5621 changelist: *const crate::kevent64_s,
5622 nchanges: c_int,
5623 eventlist: *mut crate::kevent64_s,
5624 nevents: c_int,
5625 flags: c_uint,
5626 timeout: *const crate::timespec,
5627 ) -> c_int;
mount( src: *const c_char, target: *const c_char, flags: c_int, data: *mut c_void, ) -> c_int5628 pub fn mount(
5629 src: *const c_char,
5630 target: *const c_char,
5631 flags: c_int,
5632 data: *mut c_void,
5633 ) -> c_int;
fmount(src: *const c_char, fd: c_int, flags: c_int, data: *mut c_void) -> c_int5634 pub fn fmount(src: *const c_char, fd: c_int, flags: c_int, data: *mut c_void) -> c_int;
ptrace(request: c_int, pid: crate::pid_t, addr: *mut c_char, data: c_int) -> c_int5635 pub fn ptrace(request: c_int, pid: crate::pid_t, addr: *mut c_char, data: c_int) -> c_int;
quotactl(special: *const c_char, cmd: c_int, id: c_int, data: *mut c_char) -> c_int5636 pub fn quotactl(special: *const c_char, cmd: c_int, id: c_int, data: *mut c_char) -> c_int;
sethostname(name: *const c_char, len: c_int) -> c_int5637 pub fn sethostname(name: *const c_char, len: c_int) -> c_int;
sendfile( fd: c_int, s: c_int, offset: off_t, len: *mut off_t, hdtr: *mut crate::sf_hdtr, flags: c_int, ) -> c_int5638 pub fn sendfile(
5639 fd: c_int,
5640 s: c_int,
5641 offset: off_t,
5642 len: *mut off_t,
5643 hdtr: *mut crate::sf_hdtr,
5644 flags: c_int,
5645 ) -> c_int;
futimens(fd: c_int, times: *const crate::timespec) -> c_int5646 pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int;
utimensat( dirfd: c_int, path: *const c_char, times: *const crate::timespec, flag: c_int, ) -> c_int5647 pub fn utimensat(
5648 dirfd: c_int,
5649 path: *const c_char,
5650 times: *const crate::timespec,
5651 flag: c_int,
5652 ) -> c_int;
openpty( amaster: *mut c_int, aslave: *mut c_int, name: *mut c_char, termp: *mut termios, winp: *mut crate::winsize, ) -> c_int5653 pub fn openpty(
5654 amaster: *mut c_int,
5655 aslave: *mut c_int,
5656 name: *mut c_char,
5657 termp: *mut termios,
5658 winp: *mut crate::winsize,
5659 ) -> c_int;
forkpty( amaster: *mut c_int, name: *mut c_char, termp: *mut termios, winp: *mut crate::winsize, ) -> crate::pid_t5660 pub fn forkpty(
5661 amaster: *mut c_int,
5662 name: *mut c_char,
5663 termp: *mut termios,
5664 winp: *mut crate::winsize,
5665 ) -> crate::pid_t;
login_tty(fd: c_int) -> c_int5666 pub fn login_tty(fd: c_int) -> c_int;
duplocale(base: crate::locale_t) -> crate::locale_t5667 pub fn duplocale(base: crate::locale_t) -> crate::locale_t;
freelocale(loc: crate::locale_t) -> c_int5668 pub fn freelocale(loc: crate::locale_t) -> c_int;
localeconv_l(loc: crate::locale_t) -> *mut lconv5669 pub fn localeconv_l(loc: crate::locale_t) -> *mut lconv;
newlocale(mask: c_int, locale: *const c_char, base: crate::locale_t) -> crate::locale_t5670 pub fn newlocale(mask: c_int, locale: *const c_char, base: crate::locale_t) -> crate::locale_t;
uselocale(loc: crate::locale_t) -> crate::locale_t5671 pub fn uselocale(loc: crate::locale_t) -> crate::locale_t;
querylocale(mask: c_int, loc: crate::locale_t) -> *const c_char5672 pub fn querylocale(mask: c_int, loc: crate::locale_t) -> *const c_char;
getpriority(which: c_int, who: crate::id_t) -> c_int5673 pub fn getpriority(which: c_int, who: crate::id_t) -> c_int;
setpriority(which: c_int, who: crate::id_t, prio: c_int) -> c_int5674 pub fn setpriority(which: c_int, who: crate::id_t, prio: c_int) -> c_int;
getdomainname(name: *mut c_char, len: c_int) -> c_int5675 pub fn getdomainname(name: *mut c_char, len: c_int) -> c_int;
setdomainname(name: *const c_char, len: c_int) -> c_int5676 pub fn setdomainname(name: *const c_char, len: c_int) -> c_int;
preadv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t5677 pub fn preadv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t;
pwritev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t5678 pub fn pwritev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t;
getxattr( path: *const c_char, name: *const c_char, value: *mut c_void, size: size_t, position: u32, flags: c_int, ) -> ssize_t5679 pub fn getxattr(
5680 path: *const c_char,
5681 name: *const c_char,
5682 value: *mut c_void,
5683 size: size_t,
5684 position: u32,
5685 flags: c_int,
5686 ) -> ssize_t;
fgetxattr( filedes: c_int, name: *const c_char, value: *mut c_void, size: size_t, position: u32, flags: c_int, ) -> ssize_t5687 pub fn fgetxattr(
5688 filedes: c_int,
5689 name: *const c_char,
5690 value: *mut c_void,
5691 size: size_t,
5692 position: u32,
5693 flags: c_int,
5694 ) -> ssize_t;
setxattr( path: *const c_char, name: *const c_char, value: *const c_void, size: size_t, position: u32, flags: c_int, ) -> c_int5695 pub fn setxattr(
5696 path: *const c_char,
5697 name: *const c_char,
5698 value: *const c_void,
5699 size: size_t,
5700 position: u32,
5701 flags: c_int,
5702 ) -> c_int;
fsetxattr( filedes: c_int, name: *const c_char, value: *const c_void, size: size_t, position: u32, flags: c_int, ) -> c_int5703 pub fn fsetxattr(
5704 filedes: c_int,
5705 name: *const c_char,
5706 value: *const c_void,
5707 size: size_t,
5708 position: u32,
5709 flags: c_int,
5710 ) -> c_int;
listxattr(path: *const c_char, list: *mut c_char, size: size_t, flags: c_int) -> ssize_t5711 pub fn listxattr(path: *const c_char, list: *mut c_char, size: size_t, flags: c_int)
5712 -> ssize_t;
flistxattr(filedes: c_int, list: *mut c_char, size: size_t, flags: c_int) -> ssize_t5713 pub fn flistxattr(filedes: c_int, list: *mut c_char, size: size_t, flags: c_int) -> ssize_t;
removexattr(path: *const c_char, name: *const c_char, flags: c_int) -> c_int5714 pub fn removexattr(path: *const c_char, name: *const c_char, flags: c_int) -> c_int;
renamex_np(from: *const c_char, to: *const c_char, flags: c_uint) -> c_int5715 pub fn renamex_np(from: *const c_char, to: *const c_char, flags: c_uint) -> c_int;
renameatx_np( fromfd: c_int, from: *const c_char, tofd: c_int, to: *const c_char, flags: c_uint, ) -> c_int5716 pub fn renameatx_np(
5717 fromfd: c_int,
5718 from: *const c_char,
5719 tofd: c_int,
5720 to: *const c_char,
5721 flags: c_uint,
5722 ) -> c_int;
fremovexattr(filedes: c_int, name: *const c_char, flags: c_int) -> c_int5723 pub fn fremovexattr(filedes: c_int, name: *const c_char, flags: c_int) -> c_int;
5724
getgrouplist( name: *const c_char, basegid: c_int, groups: *mut c_int, ngroups: *mut c_int, ) -> c_int5725 pub fn getgrouplist(
5726 name: *const c_char,
5727 basegid: c_int,
5728 groups: *mut c_int,
5729 ngroups: *mut c_int,
5730 ) -> c_int;
initgroups(user: *const c_char, basegroup: c_int) -> c_int5731 pub fn initgroups(user: *const c_char, basegroup: c_int) -> c_int;
5732
5733 #[cfg_attr(
5734 all(target_os = "macos", target_arch = "x86"),
5735 link_name = "waitid$UNIX2003"
5736 )]
waitid( idtype: idtype_t, id: id_t, infop: *mut crate::siginfo_t, options: c_int, ) -> c_int5737 pub fn waitid(
5738 idtype: idtype_t,
5739 id: id_t,
5740 infop: *mut crate::siginfo_t,
5741 options: c_int,
5742 ) -> c_int;
brk(addr: *const c_void) -> *mut c_void5743 pub fn brk(addr: *const c_void) -> *mut c_void;
sbrk(increment: c_int) -> *mut c_void5744 pub fn sbrk(increment: c_int) -> *mut c_void;
settimeofday(tv: *const crate::timeval, tz: *const crate::timezone) -> c_int5745 pub fn settimeofday(tv: *const crate::timeval, tz: *const crate::timezone) -> c_int;
5746 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
_dyld_image_count() -> u325747 pub fn _dyld_image_count() -> u32;
5748 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
5749 #[allow(deprecated)]
_dyld_get_image_header(image_index: u32) -> *const mach_header5750 pub fn _dyld_get_image_header(image_index: u32) -> *const mach_header;
5751 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
_dyld_get_image_vmaddr_slide(image_index: u32) -> intptr_t5752 pub fn _dyld_get_image_vmaddr_slide(image_index: u32) -> intptr_t;
5753 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
_dyld_get_image_name(image_index: u32) -> *const c_char5754 pub fn _dyld_get_image_name(image_index: u32) -> *const c_char;
5755
posix_spawn( pid: *mut crate::pid_t, path: *const c_char, file_actions: *const crate::posix_spawn_file_actions_t, attrp: *const crate::posix_spawnattr_t, argv: *const *mut c_char, envp: *const *mut c_char, ) -> c_int5756 pub fn posix_spawn(
5757 pid: *mut crate::pid_t,
5758 path: *const c_char,
5759 file_actions: *const crate::posix_spawn_file_actions_t,
5760 attrp: *const crate::posix_spawnattr_t,
5761 argv: *const *mut c_char,
5762 envp: *const *mut c_char,
5763 ) -> c_int;
posix_spawnp( pid: *mut crate::pid_t, file: *const c_char, file_actions: *const crate::posix_spawn_file_actions_t, attrp: *const crate::posix_spawnattr_t, argv: *const *mut c_char, envp: *const *mut c_char, ) -> c_int5764 pub fn posix_spawnp(
5765 pid: *mut crate::pid_t,
5766 file: *const c_char,
5767 file_actions: *const crate::posix_spawn_file_actions_t,
5768 attrp: *const crate::posix_spawnattr_t,
5769 argv: *const *mut c_char,
5770 envp: *const *mut c_char,
5771 ) -> c_int;
posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> c_int5772 pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> c_int;
posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> c_int5773 pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> c_int;
posix_spawnattr_getsigdefault( attr: *const posix_spawnattr_t, default: *mut crate::sigset_t, ) -> c_int5774 pub fn posix_spawnattr_getsigdefault(
5775 attr: *const posix_spawnattr_t,
5776 default: *mut crate::sigset_t,
5777 ) -> c_int;
posix_spawnattr_setsigdefault( attr: *mut posix_spawnattr_t, default: *const crate::sigset_t, ) -> c_int5778 pub fn posix_spawnattr_setsigdefault(
5779 attr: *mut posix_spawnattr_t,
5780 default: *const crate::sigset_t,
5781 ) -> c_int;
posix_spawnattr_getsigmask( attr: *const posix_spawnattr_t, default: *mut crate::sigset_t, ) -> c_int5782 pub fn posix_spawnattr_getsigmask(
5783 attr: *const posix_spawnattr_t,
5784 default: *mut crate::sigset_t,
5785 ) -> c_int;
posix_spawnattr_setsigmask( attr: *mut posix_spawnattr_t, default: *const crate::sigset_t, ) -> c_int5786 pub fn posix_spawnattr_setsigmask(
5787 attr: *mut posix_spawnattr_t,
5788 default: *const crate::sigset_t,
5789 ) -> c_int;
posix_spawnattr_getflags(attr: *const posix_spawnattr_t, flags: *mut c_short) -> c_int5790 pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t, flags: *mut c_short) -> c_int;
posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: c_short) -> c_int5791 pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: c_short) -> c_int;
posix_spawnattr_getpgroup( attr: *const posix_spawnattr_t, flags: *mut crate::pid_t, ) -> c_int5792 pub fn posix_spawnattr_getpgroup(
5793 attr: *const posix_spawnattr_t,
5794 flags: *mut crate::pid_t,
5795 ) -> c_int;
posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int5796 pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int;
posix_spawnattr_setarchpref_np( attr: *mut posix_spawnattr_t, count: size_t, pref: *mut crate::cpu_type_t, subpref: *mut crate::cpu_subtype_t, ocount: *mut size_t, ) -> c_int5797 pub fn posix_spawnattr_setarchpref_np(
5798 attr: *mut posix_spawnattr_t,
5799 count: size_t,
5800 pref: *mut crate::cpu_type_t,
5801 subpref: *mut crate::cpu_subtype_t,
5802 ocount: *mut size_t,
5803 ) -> c_int;
posix_spawnattr_getarchpref_np( attr: *const posix_spawnattr_t, count: size_t, pref: *mut crate::cpu_type_t, subpref: *mut crate::cpu_subtype_t, ocount: *mut size_t, ) -> c_int5804 pub fn posix_spawnattr_getarchpref_np(
5805 attr: *const posix_spawnattr_t,
5806 count: size_t,
5807 pref: *mut crate::cpu_type_t,
5808 subpref: *mut crate::cpu_subtype_t,
5809 ocount: *mut size_t,
5810 ) -> c_int;
posix_spawnattr_getbinpref_np( attr: *const posix_spawnattr_t, count: size_t, pref: *mut crate::cpu_type_t, ocount: *mut size_t, ) -> c_int5811 pub fn posix_spawnattr_getbinpref_np(
5812 attr: *const posix_spawnattr_t,
5813 count: size_t,
5814 pref: *mut crate::cpu_type_t,
5815 ocount: *mut size_t,
5816 ) -> c_int;
posix_spawnattr_setbinpref_np( attr: *mut posix_spawnattr_t, count: size_t, pref: *mut crate::cpu_type_t, ocount: *mut size_t, ) -> c_int5817 pub fn posix_spawnattr_setbinpref_np(
5818 attr: *mut posix_spawnattr_t,
5819 count: size_t,
5820 pref: *mut crate::cpu_type_t,
5821 ocount: *mut size_t,
5822 ) -> c_int;
posix_spawnattr_set_qos_class_np( attr: *mut posix_spawnattr_t, qos_class: crate::qos_class_t, ) -> c_int5823 pub fn posix_spawnattr_set_qos_class_np(
5824 attr: *mut posix_spawnattr_t,
5825 qos_class: crate::qos_class_t,
5826 ) -> c_int;
posix_spawnattr_get_qos_class_np( attr: *const posix_spawnattr_t, qos_class: *mut crate::qos_class_t, ) -> c_int5827 pub fn posix_spawnattr_get_qos_class_np(
5828 attr: *const posix_spawnattr_t,
5829 qos_class: *mut crate::qos_class_t,
5830 ) -> c_int;
5831
posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int5832 pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int;
posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int5833 pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int;
posix_spawn_file_actions_addopen( actions: *mut posix_spawn_file_actions_t, fd: c_int, path: *const c_char, oflag: c_int, mode: mode_t, ) -> c_int5834 pub fn posix_spawn_file_actions_addopen(
5835 actions: *mut posix_spawn_file_actions_t,
5836 fd: c_int,
5837 path: *const c_char,
5838 oflag: c_int,
5839 mode: mode_t,
5840 ) -> c_int;
posix_spawn_file_actions_addclose( actions: *mut posix_spawn_file_actions_t, fd: c_int, ) -> c_int5841 pub fn posix_spawn_file_actions_addclose(
5842 actions: *mut posix_spawn_file_actions_t,
5843 fd: c_int,
5844 ) -> c_int;
posix_spawn_file_actions_adddup2( actions: *mut posix_spawn_file_actions_t, fd: c_int, newfd: c_int, ) -> c_int5845 pub fn posix_spawn_file_actions_adddup2(
5846 actions: *mut posix_spawn_file_actions_t,
5847 fd: c_int,
5848 newfd: c_int,
5849 ) -> c_int;
uname(buf: *mut crate::utsname) -> c_int5850 pub fn uname(buf: *mut crate::utsname) -> c_int;
5851
connectx( socket: c_int, endpoints: *const sa_endpoints_t, associd: sae_associd_t, flags: c_uint, iov: *const crate::iovec, iovcnt: c_uint, len: *mut size_t, connid: *mut sae_connid_t, ) -> c_int5852 pub fn connectx(
5853 socket: c_int,
5854 endpoints: *const sa_endpoints_t,
5855 associd: sae_associd_t,
5856 flags: c_uint,
5857 iov: *const crate::iovec,
5858 iovcnt: c_uint,
5859 len: *mut size_t,
5860 connid: *mut sae_connid_t,
5861 ) -> c_int;
disconnectx(socket: c_int, associd: sae_associd_t, connid: sae_connid_t) -> c_int5862 pub fn disconnectx(socket: c_int, associd: sae_associd_t, connid: sae_connid_t) -> c_int;
5863
ntp_adjtime(buf: *mut timex) -> c_int5864 pub fn ntp_adjtime(buf: *mut timex) -> c_int;
ntp_gettime(buf: *mut ntptimeval) -> c_int5865 pub fn ntp_gettime(buf: *mut ntptimeval) -> c_int;
5866
5867 #[cfg_attr(
5868 all(target_os = "macos", not(target_arch = "aarch64")),
5869 link_name = "getmntinfo$INODE64"
5870 )]
getmntinfo(mntbufp: *mut *mut statfs, flags: c_int) -> c_int5871 pub fn getmntinfo(mntbufp: *mut *mut statfs, flags: c_int) -> c_int;
5872 #[cfg_attr(
5873 all(target_os = "macos", not(target_arch = "aarch64")),
5874 link_name = "getfsstat$INODE64"
5875 )]
getfsstat(mntbufp: *mut statfs, bufsize: c_int, flags: c_int) -> c_int5876 pub fn getfsstat(mntbufp: *mut statfs, bufsize: c_int, flags: c_int) -> c_int;
5877
5878 // Copy-on-write functions.
5879 // According to the man page `flags` is an `int` but in the header
5880 // this is a `uint32_t`.
clonefile(src: *const c_char, dst: *const c_char, flags: u32) -> c_int5881 pub fn clonefile(src: *const c_char, dst: *const c_char, flags: u32) -> c_int;
clonefileat( src_dirfd: c_int, src: *const c_char, dst_dirfd: c_int, dst: *const c_char, flags: u32, ) -> c_int5882 pub fn clonefileat(
5883 src_dirfd: c_int,
5884 src: *const c_char,
5885 dst_dirfd: c_int,
5886 dst: *const c_char,
5887 flags: u32,
5888 ) -> c_int;
fclonefileat(srcfd: c_int, dst_dirfd: c_int, dst: *const c_char, flags: u32) -> c_int5889 pub fn fclonefileat(srcfd: c_int, dst_dirfd: c_int, dst: *const c_char, flags: u32) -> c_int;
5890
copyfile( from: *const c_char, to: *const c_char, state: copyfile_state_t, flags: copyfile_flags_t, ) -> c_int5891 pub fn copyfile(
5892 from: *const c_char,
5893 to: *const c_char,
5894 state: copyfile_state_t,
5895 flags: copyfile_flags_t,
5896 ) -> c_int;
fcopyfile( from: c_int, to: c_int, state: copyfile_state_t, flags: copyfile_flags_t, ) -> c_int5897 pub fn fcopyfile(
5898 from: c_int,
5899 to: c_int,
5900 state: copyfile_state_t,
5901 flags: copyfile_flags_t,
5902 ) -> c_int;
copyfile_state_free(s: copyfile_state_t) -> c_int5903 pub fn copyfile_state_free(s: copyfile_state_t) -> c_int;
copyfile_state_alloc() -> copyfile_state_t5904 pub fn copyfile_state_alloc() -> copyfile_state_t;
copyfile_state_get(s: copyfile_state_t, flags: u32, dst: *mut c_void) -> c_int5905 pub fn copyfile_state_get(s: copyfile_state_t, flags: u32, dst: *mut c_void) -> c_int;
copyfile_state_set(s: copyfile_state_t, flags: u32, src: *const c_void) -> c_int5906 pub fn copyfile_state_set(s: copyfile_state_t, flags: u32, src: *const c_void) -> c_int;
5907
mach_error_string(error_value: crate::mach_error_t) -> *mut c_char5908 pub fn mach_error_string(error_value: crate::mach_error_t) -> *mut c_char;
5909
5910 // Added in macOS 10.13
5911 // ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1
memset_s(s: *mut c_void, smax: size_t, c: c_int, n: size_t) -> c_int5912 pub fn memset_s(s: *mut c_void, smax: size_t, c: c_int, n: size_t) -> c_int;
5913 // Added in macOS 10.5
memset_pattern4(b: *mut c_void, pattern4: *const c_void, len: size_t)5914 pub fn memset_pattern4(b: *mut c_void, pattern4: *const c_void, len: size_t);
memset_pattern8(b: *mut c_void, pattern8: *const c_void, len: size_t)5915 pub fn memset_pattern8(b: *mut c_void, pattern8: *const c_void, len: size_t);
memset_pattern16(b: *mut c_void, pattern16: *const c_void, len: size_t)5916 pub fn memset_pattern16(b: *mut c_void, pattern16: *const c_void, len: size_t);
5917
5918 // Inherited from BSD but available from Big Sur only
strtonum( __numstr: *const c_char, __minval: c_longlong, __maxval: c_longlong, errstrp: *mut *const c_char, ) -> c_longlong5919 pub fn strtonum(
5920 __numstr: *const c_char,
5921 __minval: c_longlong,
5922 __maxval: c_longlong,
5923 errstrp: *mut *const c_char,
5924 ) -> c_longlong;
5925
mstats() -> mstats5926 pub fn mstats() -> mstats;
malloc_printf(format: *const c_char, ...)5927 pub fn malloc_printf(format: *const c_char, ...);
malloc_zone_check(zone: *mut crate::malloc_zone_t) -> crate::boolean_t5928 pub fn malloc_zone_check(zone: *mut crate::malloc_zone_t) -> crate::boolean_t;
malloc_zone_print(zone: *mut crate::malloc_zone_t, verbose: crate::boolean_t)5929 pub fn malloc_zone_print(zone: *mut crate::malloc_zone_t, verbose: crate::boolean_t);
malloc_zone_statistics(zone: *mut crate::malloc_zone_t, stats: *mut malloc_statistics_t)5930 pub fn malloc_zone_statistics(zone: *mut crate::malloc_zone_t, stats: *mut malloc_statistics_t);
malloc_zone_log(zone: *mut crate::malloc_zone_t, address: *mut c_void)5931 pub fn malloc_zone_log(zone: *mut crate::malloc_zone_t, address: *mut c_void);
malloc_zone_print_ptr_info(ptr: *mut c_void)5932 pub fn malloc_zone_print_ptr_info(ptr: *mut c_void);
malloc_default_zone() -> *mut crate::malloc_zone_t5933 pub fn malloc_default_zone() -> *mut crate::malloc_zone_t;
malloc_zone_from_ptr(ptr: *const c_void) -> *mut crate::malloc_zone_t5934 pub fn malloc_zone_from_ptr(ptr: *const c_void) -> *mut crate::malloc_zone_t;
malloc_zone_malloc(zone: *mut crate::malloc_zone_t, size: size_t) -> *mut c_void5935 pub fn malloc_zone_malloc(zone: *mut crate::malloc_zone_t, size: size_t) -> *mut c_void;
malloc_zone_valloc(zone: *mut crate::malloc_zone_t, size: size_t) -> *mut c_void5936 pub fn malloc_zone_valloc(zone: *mut crate::malloc_zone_t, size: size_t) -> *mut c_void;
malloc_zone_calloc( zone: *mut crate::malloc_zone_t, num_items: size_t, size: size_t, ) -> *mut c_void5937 pub fn malloc_zone_calloc(
5938 zone: *mut crate::malloc_zone_t,
5939 num_items: size_t,
5940 size: size_t,
5941 ) -> *mut c_void;
malloc_zone_realloc( zone: *mut crate::malloc_zone_t, ptr: *mut c_void, size: size_t, ) -> *mut c_void5942 pub fn malloc_zone_realloc(
5943 zone: *mut crate::malloc_zone_t,
5944 ptr: *mut c_void,
5945 size: size_t,
5946 ) -> *mut c_void;
malloc_zone_free(zone: *mut crate::malloc_zone_t, ptr: *mut c_void)5947 pub fn malloc_zone_free(zone: *mut crate::malloc_zone_t, ptr: *mut c_void);
5948
proc_listpids(t: u32, typeinfo: u32, buffer: *mut c_void, buffersize: c_int) -> c_int5949 pub fn proc_listpids(t: u32, typeinfo: u32, buffer: *mut c_void, buffersize: c_int) -> c_int;
proc_listallpids(buffer: *mut c_void, buffersize: c_int) -> c_int5950 pub fn proc_listallpids(buffer: *mut c_void, buffersize: c_int) -> c_int;
proc_listpgrppids(pgrpid: crate::pid_t, buffer: *mut c_void, buffersize: c_int) -> c_int5951 pub fn proc_listpgrppids(pgrpid: crate::pid_t, buffer: *mut c_void, buffersize: c_int)
5952 -> c_int;
proc_listchildpids(ppid: crate::pid_t, buffer: *mut c_void, buffersize: c_int) -> c_int5953 pub fn proc_listchildpids(ppid: crate::pid_t, buffer: *mut c_void, buffersize: c_int) -> c_int;
proc_pidinfo( pid: c_int, flavor: c_int, arg: u64, buffer: *mut c_void, buffersize: c_int, ) -> c_int5954 pub fn proc_pidinfo(
5955 pid: c_int,
5956 flavor: c_int,
5957 arg: u64,
5958 buffer: *mut c_void,
5959 buffersize: c_int,
5960 ) -> c_int;
proc_pidfdinfo( pid: c_int, fd: c_int, flavor: c_int, buffer: *mut c_void, buffersize: c_int, ) -> c_int5961 pub fn proc_pidfdinfo(
5962 pid: c_int,
5963 fd: c_int,
5964 flavor: c_int,
5965 buffer: *mut c_void,
5966 buffersize: c_int,
5967 ) -> c_int;
proc_pidfileportinfo( pid: c_int, fileport: u32, flavor: c_int, buffer: *mut c_void, buffersize: c_int, ) -> c_int5968 pub fn proc_pidfileportinfo(
5969 pid: c_int,
5970 fileport: u32,
5971 flavor: c_int,
5972 buffer: *mut c_void,
5973 buffersize: c_int,
5974 ) -> c_int;
proc_pidpath(pid: c_int, buffer: *mut c_void, buffersize: u32) -> c_int5975 pub fn proc_pidpath(pid: c_int, buffer: *mut c_void, buffersize: u32) -> c_int;
proc_name(pid: c_int, buffer: *mut c_void, buffersize: u32) -> c_int5976 pub fn proc_name(pid: c_int, buffer: *mut c_void, buffersize: u32) -> c_int;
proc_regionfilename( pid: c_int, address: u64, buffer: *mut c_void, buffersize: u32, ) -> c_int5977 pub fn proc_regionfilename(
5978 pid: c_int,
5979 address: u64,
5980 buffer: *mut c_void,
5981 buffersize: u32,
5982 ) -> c_int;
proc_kmsgbuf(buffer: *mut c_void, buffersize: u32) -> c_int5983 pub fn proc_kmsgbuf(buffer: *mut c_void, buffersize: u32) -> c_int;
proc_libversion(major: *mut c_int, minor: *mut c_int) -> c_int5984 pub fn proc_libversion(major: *mut c_int, minor: *mut c_int) -> c_int;
proc_pid_rusage(pid: c_int, flavor: c_int, buffer: *mut rusage_info_t) -> c_int5985 pub fn proc_pid_rusage(pid: c_int, flavor: c_int, buffer: *mut rusage_info_t) -> c_int;
5986
5987 // Available from Big Sur
proc_set_no_smt() -> c_int5988 pub fn proc_set_no_smt() -> c_int;
proc_setthread_no_smt() -> c_int5989 pub fn proc_setthread_no_smt() -> c_int;
proc_set_csm(flags: u32) -> c_int5990 pub fn proc_set_csm(flags: u32) -> c_int;
proc_setthread_csm(flags: u32) -> c_int5991 pub fn proc_setthread_csm(flags: u32) -> c_int;
5992 /// # Notes
5993 ///
5994 /// `id` is of type [`uuid_t`].
gethostuuid(id: *mut u8, timeout: *const crate::timespec) -> c_int5995 pub fn gethostuuid(id: *mut u8, timeout: *const crate::timespec) -> c_int;
5996
gethostid() -> c_long5997 pub fn gethostid() -> c_long;
sethostid(hostid: c_long)5998 pub fn sethostid(hostid: c_long);
5999
CCRandomGenerateBytes(bytes: *mut c_void, size: size_t) -> crate::CCRNGStatus6000 pub fn CCRandomGenerateBytes(bytes: *mut c_void, size: size_t) -> crate::CCRNGStatus;
getentropy(buf: *mut c_void, buflen: size_t) -> c_int6001 pub fn getentropy(buf: *mut c_void, buflen: size_t) -> c_int;
6002
6003 // FIXME(1.0): should this actually be deprecated?
6004 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
_NSGetExecutablePath(buf: *mut c_char, bufsize: *mut u32) -> c_int6005 pub fn _NSGetExecutablePath(buf: *mut c_char, bufsize: *mut u32) -> c_int;
6006
6007 // crt_externs.h
_NSGetArgv() -> *mut *mut *mut c_char6008 pub fn _NSGetArgv() -> *mut *mut *mut c_char;
_NSGetArgc() -> *mut c_int6009 pub fn _NSGetArgc() -> *mut c_int;
_NSGetEnviron() -> *mut *mut *mut c_char6010 pub fn _NSGetEnviron() -> *mut *mut *mut c_char;
_NSGetProgname() -> *mut *mut c_char6011 pub fn _NSGetProgname() -> *mut *mut c_char;
6012
6013 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
mach_vm_map( target_task: crate::vm_map_t, address: *mut crate::mach_vm_address_t, size: crate::mach_vm_size_t, mask: crate::mach_vm_offset_t, flags: c_int, object: crate::mem_entry_name_port_t, offset: crate::memory_object_offset_t, copy: crate::boolean_t, cur_protection: crate::vm_prot_t, max_protection: crate::vm_prot_t, inheritance: crate::vm_inherit_t, ) -> crate::kern_return_t6014 pub fn mach_vm_map(
6015 target_task: crate::vm_map_t,
6016 address: *mut crate::mach_vm_address_t,
6017 size: crate::mach_vm_size_t,
6018 mask: crate::mach_vm_offset_t,
6019 flags: c_int,
6020 object: crate::mem_entry_name_port_t,
6021 offset: crate::memory_object_offset_t,
6022 copy: crate::boolean_t,
6023 cur_protection: crate::vm_prot_t,
6024 max_protection: crate::vm_prot_t,
6025 inheritance: crate::vm_inherit_t,
6026 ) -> crate::kern_return_t;
6027
vm_allocate( target_task: vm_map_t, address: *mut vm_address_t, size: vm_size_t, flags: c_int, ) -> crate::kern_return_t6028 pub fn vm_allocate(
6029 target_task: vm_map_t,
6030 address: *mut vm_address_t,
6031 size: vm_size_t,
6032 flags: c_int,
6033 ) -> crate::kern_return_t;
6034
vm_deallocate( target_task: vm_map_t, address: vm_address_t, size: vm_size_t, ) -> crate::kern_return_t6035 pub fn vm_deallocate(
6036 target_task: vm_map_t,
6037 address: vm_address_t,
6038 size: vm_size_t,
6039 ) -> crate::kern_return_t;
6040
host_statistics64( host_priv: host_t, flavor: host_flavor_t, host_info64_out: host_info64_t, host_info64_outCnt: *mut mach_msg_type_number_t, ) -> crate::kern_return_t6041 pub fn host_statistics64(
6042 host_priv: host_t,
6043 flavor: host_flavor_t,
6044 host_info64_out: host_info64_t,
6045 host_info64_outCnt: *mut mach_msg_type_number_t,
6046 ) -> crate::kern_return_t;
host_processor_info( host: host_t, flavor: processor_flavor_t, out_processor_count: *mut natural_t, out_processor_info: *mut processor_info_array_t, out_processor_infoCnt: *mut mach_msg_type_number_t, ) -> crate::kern_return_t6047 pub fn host_processor_info(
6048 host: host_t,
6049 flavor: processor_flavor_t,
6050 out_processor_count: *mut natural_t,
6051 out_processor_info: *mut processor_info_array_t,
6052 out_processor_infoCnt: *mut mach_msg_type_number_t,
6053 ) -> crate::kern_return_t;
6054
6055 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
6056 pub static mut mach_task_self_: crate::mach_port_t;
task_for_pid( host: crate::mach_port_t, pid: crate::pid_t, task: *mut crate::mach_port_t, ) -> crate::kern_return_t6057 pub fn task_for_pid(
6058 host: crate::mach_port_t,
6059 pid: crate::pid_t,
6060 task: *mut crate::mach_port_t,
6061 ) -> crate::kern_return_t;
task_info( host: crate::mach_port_t, flavor: task_flavor_t, task_info_out: task_info_t, task_info_count: *mut mach_msg_type_number_t, ) -> crate::kern_return_t6062 pub fn task_info(
6063 host: crate::mach_port_t,
6064 flavor: task_flavor_t,
6065 task_info_out: task_info_t,
6066 task_info_count: *mut mach_msg_type_number_t,
6067 ) -> crate::kern_return_t;
task_create( target_task: crate::task_t, ledgers: crate::ledger_array_t, ledgersCnt: crate::mach_msg_type_number_t, inherit_memory: crate::boolean_t, child_task: *mut crate::task_t, ) -> crate::kern_return_t6068 pub fn task_create(
6069 target_task: crate::task_t,
6070 ledgers: crate::ledger_array_t,
6071 ledgersCnt: crate::mach_msg_type_number_t,
6072 inherit_memory: crate::boolean_t,
6073 child_task: *mut crate::task_t,
6074 ) -> crate::kern_return_t;
task_terminate(target_task: crate::task_t) -> crate::kern_return_t6075 pub fn task_terminate(target_task: crate::task_t) -> crate::kern_return_t;
task_threads( target_task: crate::task_inspect_t, act_list: *mut crate::thread_act_array_t, act_listCnt: *mut crate::mach_msg_type_number_t, ) -> crate::kern_return_t6076 pub fn task_threads(
6077 target_task: crate::task_inspect_t,
6078 act_list: *mut crate::thread_act_array_t,
6079 act_listCnt: *mut crate::mach_msg_type_number_t,
6080 ) -> crate::kern_return_t;
host_statistics( host_priv: host_t, flavor: host_flavor_t, host_info_out: host_info_t, host_info_outCnt: *mut mach_msg_type_number_t, ) -> crate::kern_return_t6081 pub fn host_statistics(
6082 host_priv: host_t,
6083 flavor: host_flavor_t,
6084 host_info_out: host_info_t,
6085 host_info_outCnt: *mut mach_msg_type_number_t,
6086 ) -> crate::kern_return_t;
6087
6088 // sysdir.h
sysdir_start_search_path_enumeration( dir: sysdir_search_path_directory_t, domainMask: sysdir_search_path_domain_mask_t, ) -> crate::sysdir_search_path_enumeration_state6089 pub fn sysdir_start_search_path_enumeration(
6090 dir: sysdir_search_path_directory_t,
6091 domainMask: sysdir_search_path_domain_mask_t,
6092 ) -> crate::sysdir_search_path_enumeration_state;
sysdir_get_next_search_path_enumeration( state: crate::sysdir_search_path_enumeration_state, path: *mut c_char, ) -> crate::sysdir_search_path_enumeration_state6093 pub fn sysdir_get_next_search_path_enumeration(
6094 state: crate::sysdir_search_path_enumeration_state,
6095 path: *mut c_char,
6096 ) -> crate::sysdir_search_path_enumeration_state;
6097
6098 pub static vm_page_size: vm_size_t;
6099
getattrlist( path: *const c_char, attrList: *mut c_void, attrBuf: *mut c_void, attrBufSize: size_t, options: u32, ) -> c_int6100 pub fn getattrlist(
6101 path: *const c_char,
6102 attrList: *mut c_void,
6103 attrBuf: *mut c_void,
6104 attrBufSize: size_t,
6105 options: u32,
6106 ) -> c_int;
fgetattrlist( fd: c_int, attrList: *mut c_void, attrBuf: *mut c_void, attrBufSize: size_t, options: u32, ) -> c_int6107 pub fn fgetattrlist(
6108 fd: c_int,
6109 attrList: *mut c_void,
6110 attrBuf: *mut c_void,
6111 attrBufSize: size_t,
6112 options: u32,
6113 ) -> c_int;
getattrlistat( fd: c_int, path: *const c_char, attrList: *mut c_void, attrBuf: *mut c_void, attrBufSize: size_t, options: c_ulong, ) -> c_int6114 pub fn getattrlistat(
6115 fd: c_int,
6116 path: *const c_char,
6117 attrList: *mut c_void,
6118 attrBuf: *mut c_void,
6119 attrBufSize: size_t,
6120 options: c_ulong,
6121 ) -> c_int;
setattrlist( path: *const c_char, attrList: *mut c_void, attrBuf: *mut c_void, attrBufSize: size_t, options: u32, ) -> c_int6122 pub fn setattrlist(
6123 path: *const c_char,
6124 attrList: *mut c_void,
6125 attrBuf: *mut c_void,
6126 attrBufSize: size_t,
6127 options: u32,
6128 ) -> c_int;
fsetattrlist( fd: c_int, attrList: *mut c_void, attrBuf: *mut c_void, attrBufSize: size_t, options: u32, ) -> c_int6129 pub fn fsetattrlist(
6130 fd: c_int,
6131 attrList: *mut c_void,
6132 attrBuf: *mut c_void,
6133 attrBufSize: size_t,
6134 options: u32,
6135 ) -> c_int;
setattrlistat( dir_fd: c_int, path: *const c_char, attrList: *mut c_void, attrBuf: *mut c_void, attrBufSize: size_t, options: u32, ) -> c_int6136 pub fn setattrlistat(
6137 dir_fd: c_int,
6138 path: *const c_char,
6139 attrList: *mut c_void,
6140 attrBuf: *mut c_void,
6141 attrBufSize: size_t,
6142 options: u32,
6143 ) -> c_int;
getattrlistbulk( dirfd: c_int, attrList: *mut c_void, attrBuf: *mut c_void, attrBufSize: size_t, options: u64, ) -> c_int6144 pub fn getattrlistbulk(
6145 dirfd: c_int,
6146 attrList: *mut c_void,
6147 attrBuf: *mut c_void,
6148 attrBufSize: size_t,
6149 options: u64,
6150 ) -> c_int;
6151
malloc_size(ptr: *const c_void) -> size_t6152 pub fn malloc_size(ptr: *const c_void) -> size_t;
malloc_good_size(size: size_t) -> size_t6153 pub fn malloc_good_size(size: size_t) -> size_t;
6154
dirname(path: *mut c_char) -> *mut c_char6155 pub fn dirname(path: *mut c_char) -> *mut c_char;
basename(path: *mut c_char) -> *mut c_char6156 pub fn basename(path: *mut c_char) -> *mut c_char;
6157
mkfifoat(dirfd: c_int, pathname: *const c_char, mode: mode_t) -> c_int6158 pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: mode_t) -> c_int;
mknodat(dirfd: c_int, pathname: *const c_char, mode: mode_t, dev: dev_t) -> c_int6159 pub fn mknodat(dirfd: c_int, pathname: *const c_char, mode: mode_t, dev: dev_t) -> c_int;
freadlink(fd: c_int, buf: *mut c_char, size: size_t) -> c_int6160 pub fn freadlink(fd: c_int, buf: *mut c_char, size: size_t) -> c_int;
execvP( file: *const c_char, search_path: *const c_char, argv: *const *mut c_char, ) -> c_int6161 pub fn execvP(
6162 file: *const c_char,
6163 search_path: *const c_char,
6164 argv: *const *mut c_char,
6165 ) -> c_int;
6166 }
6167
6168 #[allow(deprecated)]
6169 #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
mach_task_self() -> crate::mach_port_t6170 pub unsafe fn mach_task_self() -> crate::mach_port_t {
6171 mach_task_self_
6172 }
6173
6174 cfg_if! {
6175 if #[cfg(target_os = "macos")] {
6176 extern "C" {
6177 pub fn clock_settime(clock_id: crate::clockid_t, tp: *const crate::timespec) -> c_int;
6178 }
6179 }
6180 }
6181 cfg_if! {
6182 if #[cfg(any(
6183 target_os = "macos",
6184 target_os = "ios",
6185 target_os = "tvos",
6186 target_os = "visionos"
6187 ))] {
6188 extern "C" {
6189 pub fn memmem(
6190 haystack: *const c_void,
6191 haystacklen: size_t,
6192 needle: *const c_void,
6193 needlelen: size_t,
6194 ) -> *mut c_void;
6195 pub fn task_set_info(
6196 target_task: crate::task_t,
6197 flavor: crate::task_flavor_t,
6198 task_info_in: crate::task_info_t,
6199 task_info_inCnt: crate::mach_msg_type_number_t,
6200 ) -> crate::kern_return_t;
6201 }
6202 }
6203 }
6204
6205 // These require a dependency on `libiconv`, and including this when built as
6206 // part of `std` means every Rust program gets it. Ideally we would have a link
6207 // modifier to only include these if they are used, but we do not.
6208 #[deprecated(note = "Will be removed in 1.0 to avoid the `iconv` dependency")]
6209 #[cfg_attr(not(feature = "rustc-dep-of-std"), link(name = "iconv"))]
6210 extern "C" {
iconv_open(tocode: *const c_char, fromcode: *const c_char) -> iconv_t6211 pub fn iconv_open(tocode: *const c_char, fromcode: *const c_char) -> iconv_t;
iconv( cd: iconv_t, inbuf: *mut *mut c_char, inbytesleft: *mut size_t, outbuf: *mut *mut c_char, outbytesleft: *mut size_t, ) -> size_t6212 pub fn iconv(
6213 cd: iconv_t,
6214 inbuf: *mut *mut c_char,
6215 inbytesleft: *mut size_t,
6216 outbuf: *mut *mut c_char,
6217 outbytesleft: *mut size_t,
6218 ) -> size_t;
iconv_close(cd: iconv_t) -> c_int6219 pub fn iconv_close(cd: iconv_t) -> c_int;
6220 }
6221
6222 cfg_if! {
6223 if #[cfg(target_pointer_width = "32")] {
6224 mod b32;
6225 pub use self::b32::*;
6226 } else if #[cfg(target_pointer_width = "64")] {
6227 mod b64;
6228 pub use self::b64::*;
6229 } else {
6230 // Unknown target_arch
6231 }
6232 }
6233