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