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