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 
34 pub type posix_spawnattr_t = *mut ::c_void;
35 pub type posix_spawn_file_actions_t = *mut ::c_void;
36 pub type key_t = ::c_int;
37 pub type shmatt_t = ::c_ushort;
38 
39 pub type sae_associd_t = u32;
40 pub type sae_connid_t = u32;
41 
42 pub type mach_port_t = ::c_uint;
43 pub type processor_flavor_t = ::c_int;
44 
45 pub type iconv_t = *mut ::c_void;
46 
47 pub type processor_cpu_load_info_t = *mut processor_cpu_load_info;
48 pub type processor_cpu_load_info_data_t = processor_cpu_load_info;
49 pub type processor_basic_info_t = *mut processor_basic_info;
50 pub type processor_basic_info_data_t = processor_basic_info;
51 pub type processor_set_basic_info_data_t = processor_set_basic_info;
52 pub type processor_set_basic_info_t = *mut processor_set_basic_info;
53 pub type processor_set_load_info_data_t = processor_set_load_info;
54 pub type processor_set_load_info_t = *mut processor_set_load_info;
55 pub type processor_info_t = *mut integer_t;
56 pub type processor_info_array_t = *mut integer_t;
57 
58 pub type thread_t = mach_port_t;
59 pub type thread_policy_flavor_t = natural_t;
60 pub type thread_policy_t = *mut integer_t;
61 pub type thread_latency_qos_t = integer_t;
62 pub type thread_throughput_qos_t = integer_t;
63 pub type thread_standard_policy_data_t = thread_standard_policy;
64 pub type thread_standard_policy_t = *mut thread_standard_policy;
65 pub type thread_extended_policy_data_t = thread_extended_policy;
66 pub type thread_extended_policy_t = *mut thread_extended_policy;
67 pub type thread_time_constraint_policy_data_t = thread_time_constraint_policy;
68 pub type thread_time_constraint_policy_t = *mut thread_time_constraint_policy;
69 pub type thread_precedence_policy_data_t = thread_precedence_policy;
70 pub type thread_precedence_policy_t = *mut thread_precedence_policy;
71 pub type thread_affinity_policy_data_t = thread_affinity_policy;
72 pub type thread_affinity_policy_t = *mut thread_affinity_policy;
73 pub type thread_background_policy_data_t = thread_background_policy;
74 pub type thread_background_policy_t = *mut thread_background_policy;
75 pub type thread_latency_qos_policy_data_t = thread_latency_qos_policy;
76 pub type thread_latency_qos_policy_t = *mut thread_latency_qos_policy;
77 pub type thread_throughput_qos_policy_data_t = thread_throughput_qos_policy;
78 pub type thread_throughput_qos_policy_t = *mut thread_throughput_qos_policy;
79 
80 deprecated_mach! {
81     pub type vm_prot_t = ::c_int;
82     pub type vm_size_t = ::uintptr_t;
83     pub type mach_timebase_info_data_t = mach_timebase_info;
84 }
85 
86 #[cfg_attr(feature = "extra_traits", derive(Debug))]
87 pub enum timezone {}
88 impl ::Copy for timezone {}
89 impl ::Clone for timezone {
clone(&self) -> timezone90     fn clone(&self) -> timezone {
91         *self
92     }
93 }
94 
95 #[cfg_attr(feature = "extra_traits", derive(Debug))]
96 #[repr(u32)]
97 pub enum qos_class_t {
98     QOS_CLASS_USER_INTERACTIVE = 0x21,
99     QOS_CLASS_USER_INITIATED = 0x19,
100     QOS_CLASS_DEFAULT = 0x15,
101     QOS_CLASS_UTILITY = 0x11,
102     QOS_CLASS_BACKGROUND = 0x09,
103     QOS_CLASS_UNSPECIFIED = 0x00,
104 }
105 impl ::Copy for qos_class_t {}
106 impl ::Clone for qos_class_t {
clone(&self) -> qos_class_t107     fn clone(&self) -> qos_class_t {
108         *self
109     }
110 }
111 
112 s! {
113     pub struct ip_mreq {
114         pub imr_multiaddr: in_addr,
115         pub imr_interface: in_addr,
116     }
117 
118     pub struct aiocb {
119         pub aio_fildes: ::c_int,
120         pub aio_offset: ::off_t,
121         pub aio_buf: *mut ::c_void,
122         pub aio_nbytes: ::size_t,
123         pub aio_reqprio: ::c_int,
124         pub aio_sigevent: sigevent,
125         pub aio_lio_opcode: ::c_int
126     }
127 
128     pub struct glob_t {
129         pub gl_pathc:  ::size_t,
130         __unused1: ::c_int,
131         pub gl_offs:   ::size_t,
132         __unused2: ::c_int,
133         pub gl_pathv:  *mut *mut ::c_char,
134 
135         __unused3: *mut ::c_void,
136 
137         __unused4: *mut ::c_void,
138         __unused5: *mut ::c_void,
139         __unused6: *mut ::c_void,
140         __unused7: *mut ::c_void,
141         __unused8: *mut ::c_void,
142     }
143 
144     pub struct addrinfo {
145         pub ai_flags: ::c_int,
146         pub ai_family: ::c_int,
147         pub ai_socktype: ::c_int,
148         pub ai_protocol: ::c_int,
149         pub ai_addrlen: ::socklen_t,
150         pub ai_canonname: *mut ::c_char,
151         pub ai_addr: *mut ::sockaddr,
152         pub ai_next: *mut addrinfo,
153     }
154 
155     #[deprecated(
156         since = "0.2.55",
157         note = "Use the `mach` crate instead",
158     )]
159     pub struct mach_timebase_info {
160         pub numer: u32,
161         pub denom: u32,
162     }
163 
164     pub struct stat {
165         pub st_dev: dev_t,
166         pub st_mode: mode_t,
167         pub st_nlink: nlink_t,
168         pub st_ino: ino_t,
169         pub st_uid: ::uid_t,
170         pub st_gid: ::gid_t,
171         pub st_rdev: dev_t,
172         pub st_atime: time_t,
173         pub st_atime_nsec: c_long,
174         pub st_mtime: time_t,
175         pub st_mtime_nsec: c_long,
176         pub st_ctime: time_t,
177         pub st_ctime_nsec: c_long,
178         pub st_birthtime: time_t,
179         pub st_birthtime_nsec: c_long,
180         pub st_size: ::off_t,
181         pub st_blocks: ::blkcnt_t,
182         pub st_blksize: blksize_t,
183         pub st_flags: u32,
184         pub st_gen: u32,
185         pub st_lspare: i32,
186         pub st_qspare: [i64; 2],
187     }
188 
189     pub struct pthread_mutexattr_t {
190         __sig: ::c_long,
191         __opaque: [u8; 8],
192     }
193 
194     pub struct pthread_condattr_t {
195         __sig: ::c_long,
196         __opaque: [u8; __PTHREAD_CONDATTR_SIZE__],
197     }
198 
199     pub struct pthread_rwlockattr_t {
200         __sig: ::c_long,
201         __opaque: [u8; __PTHREAD_RWLOCKATTR_SIZE__],
202     }
203 
204     pub struct siginfo_t {
205         pub si_signo: ::c_int,
206         pub si_errno: ::c_int,
207         pub si_code: ::c_int,
208         pub si_pid: ::pid_t,
209         pub si_uid: ::uid_t,
210         pub si_status: ::c_int,
211         pub si_addr: *mut ::c_void,
212         //Requires it to be union for tests
213         //pub si_value: ::sigval,
214         _pad: [usize; 9],
215     }
216 
217     pub struct sigaction {
218         // FIXME: this field is actually a union
219         pub sa_sigaction: ::sighandler_t,
220         pub sa_mask: sigset_t,
221         pub sa_flags: ::c_int,
222     }
223 
224     pub struct stack_t {
225         pub ss_sp: *mut ::c_void,
226         pub ss_size: ::size_t,
227         pub ss_flags: ::c_int,
228     }
229 
230     pub struct fstore_t {
231         pub fst_flags: ::c_uint,
232         pub fst_posmode: ::c_int,
233         pub fst_offset: ::off_t,
234         pub fst_length: ::off_t,
235         pub fst_bytesalloc: ::off_t,
236     }
237 
238     pub struct radvisory {
239         pub ra_offset: ::off_t,
240         pub ra_count: ::c_int,
241     }
242 
243     pub struct statvfs {
244         pub f_bsize: ::c_ulong,
245         pub f_frsize: ::c_ulong,
246         pub f_blocks: ::fsblkcnt_t,
247         pub f_bfree: ::fsblkcnt_t,
248         pub f_bavail: ::fsblkcnt_t,
249         pub f_files: ::fsfilcnt_t,
250         pub f_ffree: ::fsfilcnt_t,
251         pub f_favail: ::fsfilcnt_t,
252         pub f_fsid: ::c_ulong,
253         pub f_flag: ::c_ulong,
254         pub f_namemax: ::c_ulong,
255     }
256 
257     pub struct Dl_info {
258         pub dli_fname: *const ::c_char,
259         pub dli_fbase: *mut ::c_void,
260         pub dli_sname: *const ::c_char,
261         pub dli_saddr: *mut ::c_void,
262     }
263 
264     pub struct sockaddr_in {
265         pub sin_len: u8,
266         pub sin_family: ::sa_family_t,
267         pub sin_port: ::in_port_t,
268         pub sin_addr: ::in_addr,
269         pub sin_zero: [::c_char; 8],
270     }
271 
272     pub struct kevent64_s {
273         pub ident: u64,
274         pub filter: i16,
275         pub flags: u16,
276         pub fflags: u32,
277         pub data: i64,
278         pub udata: u64,
279         pub ext: [u64; 2],
280     }
281 
282     pub struct dqblk {
283         pub dqb_bhardlimit: u64,
284         pub dqb_bsoftlimit: u64,
285         pub dqb_curbytes: u64,
286         pub dqb_ihardlimit: u32,
287         pub dqb_isoftlimit: u32,
288         pub dqb_curinodes: u32,
289         pub dqb_btime: u32,
290         pub dqb_itime: u32,
291         pub dqb_id: u32,
292         pub dqb_spare: [u32; 4],
293     }
294 
295     pub struct if_msghdr {
296         pub ifm_msglen: ::c_ushort,
297         pub ifm_version: ::c_uchar,
298         pub ifm_type: ::c_uchar,
299         pub ifm_addrs: ::c_int,
300         pub ifm_flags: ::c_int,
301         pub ifm_index: ::c_ushort,
302         pub ifm_data: if_data,
303     }
304 
305     pub struct termios {
306         pub c_iflag: ::tcflag_t,
307         pub c_oflag: ::tcflag_t,
308         pub c_cflag: ::tcflag_t,
309         pub c_lflag: ::tcflag_t,
310         pub c_cc: [::cc_t; ::NCCS],
311         pub c_ispeed: ::speed_t,
312         pub c_ospeed: ::speed_t,
313     }
314 
315     pub struct flock {
316         pub l_start: ::off_t,
317         pub l_len: ::off_t,
318         pub l_pid: ::pid_t,
319         pub l_type: ::c_short,
320         pub l_whence: ::c_short,
321     }
322 
323     pub struct sf_hdtr {
324         pub headers: *mut ::iovec,
325         pub hdr_cnt: ::c_int,
326         pub trailers: *mut ::iovec,
327         pub trl_cnt: ::c_int,
328     }
329 
330     pub struct lconv {
331         pub decimal_point: *mut ::c_char,
332         pub thousands_sep: *mut ::c_char,
333         pub grouping: *mut ::c_char,
334         pub int_curr_symbol: *mut ::c_char,
335         pub currency_symbol: *mut ::c_char,
336         pub mon_decimal_point: *mut ::c_char,
337         pub mon_thousands_sep: *mut ::c_char,
338         pub mon_grouping: *mut ::c_char,
339         pub positive_sign: *mut ::c_char,
340         pub negative_sign: *mut ::c_char,
341         pub int_frac_digits: ::c_char,
342         pub frac_digits: ::c_char,
343         pub p_cs_precedes: ::c_char,
344         pub p_sep_by_space: ::c_char,
345         pub n_cs_precedes: ::c_char,
346         pub n_sep_by_space: ::c_char,
347         pub p_sign_posn: ::c_char,
348         pub n_sign_posn: ::c_char,
349         pub int_p_cs_precedes: ::c_char,
350         pub int_n_cs_precedes: ::c_char,
351         pub int_p_sep_by_space: ::c_char,
352         pub int_n_sep_by_space: ::c_char,
353         pub int_p_sign_posn: ::c_char,
354         pub int_n_sign_posn: ::c_char,
355     }
356 
357     pub struct proc_taskinfo {
358         pub pti_virtual_size: u64,
359         pub pti_resident_size: u64,
360         pub pti_total_user: u64,
361         pub pti_total_system: u64,
362         pub pti_threads_user: u64,
363         pub pti_threads_system: u64,
364         pub pti_policy: i32,
365         pub pti_faults: i32,
366         pub pti_pageins: i32,
367         pub pti_cow_faults: i32,
368         pub pti_messages_sent: i32,
369         pub pti_messages_received: i32,
370         pub pti_syscalls_mach: i32,
371         pub pti_syscalls_unix: i32,
372         pub pti_csw: i32,
373         pub pti_threadnum: i32,
374         pub pti_numrunning: i32,
375         pub pti_priority: i32,
376     }
377 
378     pub struct proc_bsdinfo {
379         pub pbi_flags: u32,
380         pub pbi_status: u32,
381         pub pbi_xstatus: u32,
382         pub pbi_pid: u32,
383         pub pbi_ppid: u32,
384         pub pbi_uid: ::uid_t,
385         pub pbi_gid: ::gid_t,
386         pub pbi_ruid: ::uid_t,
387         pub pbi_rgid: ::gid_t,
388         pub pbi_svuid: ::uid_t,
389         pub pbi_svgid: ::gid_t,
390         pub rfu_1: u32,
391         pub pbi_comm: [::c_char; MAXCOMLEN],
392         pub pbi_name: [::c_char; 32], // MAXCOMLEN * 2, but macro isn't happy...
393         pub pbi_nfiles: u32,
394         pub pbi_pgid: u32,
395         pub pbi_pjobc: u32,
396         pub e_tdev: u32,
397         pub e_tpgid: u32,
398         pub pbi_nice: i32,
399         pub pbi_start_tvsec: u64,
400         pub pbi_start_tvusec: u64,
401     }
402 
403     pub struct proc_taskallinfo {
404         pub pbsd: proc_bsdinfo,
405         pub ptinfo: proc_taskinfo,
406     }
407 
408     pub struct xsw_usage {
409         pub xsu_total: u64,
410         pub xsu_avail: u64,
411         pub xsu_used: u64,
412         pub xsu_pagesize: u32,
413         pub xsu_encrypted: ::boolean_t,
414     }
415 
416     pub struct xucred {
417         pub cr_version: ::c_uint,
418         pub cr_uid: ::uid_t,
419         pub cr_ngroups: ::c_short,
420         pub cr_groups: [::gid_t;16]
421     }
422 
423     #[deprecated(
424         since = "0.2.55",
425         note = "Use the `mach` crate instead",
426     )]
427     pub struct mach_header {
428         pub magic: u32,
429         pub cputype: cpu_type_t,
430         pub cpusubtype: cpu_subtype_t,
431         pub filetype: u32,
432         pub ncmds: u32,
433         pub sizeofcmds: u32,
434         pub flags: u32,
435     }
436 
437     #[deprecated(
438         since = "0.2.55",
439         note = "Use the `mach` crate instead",
440     )]
441     pub struct mach_header_64 {
442         pub magic: u32,
443         pub cputype: cpu_type_t,
444         pub cpusubtype: cpu_subtype_t,
445         pub filetype: u32,
446         pub ncmds: u32,
447         pub sizeofcmds: u32,
448         pub flags: u32,
449         pub reserved: u32,
450     }
451 
452     pub struct segment_command {
453         pub cmd: u32,
454         pub cmdsize: u32,
455         pub segname: [::c_char; 16],
456         pub vmaddr: u32,
457         pub vmsize: u32,
458         pub fileoff: u32,
459         pub filesize: u32,
460         pub maxprot: vm_prot_t,
461         pub initprot: vm_prot_t,
462         pub nsects: u32,
463         pub flags: u32,
464     }
465 
466     pub struct segment_command_64 {
467         pub cmd: u32,
468         pub cmdsize: u32,
469         pub segname: [::c_char; 16],
470         pub vmaddr: u64,
471         pub vmsize: u64,
472         pub fileoff: u64,
473         pub filesize: u64,
474         pub maxprot: vm_prot_t,
475         pub initprot: vm_prot_t,
476         pub nsects: u32,
477         pub flags: u32,
478     }
479 
480     pub struct load_command {
481         pub cmd: u32,
482         pub cmdsize: u32,
483     }
484 
485     pub struct sockaddr_dl {
486         pub sdl_len: ::c_uchar,
487         pub sdl_family: ::c_uchar,
488         pub sdl_index: ::c_ushort,
489         pub sdl_type: ::c_uchar,
490         pub sdl_nlen: ::c_uchar,
491         pub sdl_alen: ::c_uchar,
492         pub sdl_slen: ::c_uchar,
493         pub sdl_data: [::c_char; 12],
494     }
495 
496     pub struct sockaddr_inarp {
497         pub sin_len: ::c_uchar,
498         pub sin_family: ::c_uchar,
499         pub sin_port: ::c_ushort,
500         pub sin_addr: ::in_addr,
501         pub sin_srcaddr: ::in_addr,
502         pub sin_tos: ::c_ushort,
503         pub sin_other: ::c_ushort,
504     }
505 
506     pub struct sockaddr_ctl {
507         pub sc_len: ::c_uchar,
508         pub sc_family: ::c_uchar,
509         pub ss_sysaddr: u16,
510         pub sc_id: u32,
511         pub sc_unit: u32,
512         pub sc_reserved: [u32; 5],
513     }
514 
515     pub struct in_pktinfo {
516         pub ipi_ifindex: ::c_uint,
517         pub ipi_spec_dst: ::in_addr,
518         pub ipi_addr: ::in_addr,
519     }
520 
521     pub struct in6_pktinfo {
522         pub ipi6_addr: ::in6_addr,
523         pub ipi6_ifindex: ::c_uint,
524     }
525 
526     // sys/ipc.h:
527 
528     pub struct ipc_perm {
529         pub uid: ::uid_t,
530         pub gid: ::gid_t,
531         pub cuid: ::uid_t,
532         pub cgid: ::gid_t,
533         pub mode: ::mode_t,
534         pub _seq: ::c_ushort,
535         pub _key: ::key_t,
536     }
537 
538     // sys/sem.h
539 
540     pub struct sembuf {
541         pub sem_num: ::c_ushort,
542         pub sem_op: ::c_short,
543         pub sem_flg: ::c_short,
544     }
545 
546     // sys/shm.h
547 
548     pub struct arphdr {
549         pub ar_hrd: u16,
550         pub ar_pro: u16,
551         pub ar_hln: u8,
552         pub ar_pln: u8,
553         pub ar_op: u16,
554     }
555 
556     pub struct in_addr {
557         pub s_addr: ::in_addr_t,
558     }
559 
560     // sys/socket.h
561 
562     pub struct sa_endpoints_t {
563         pub sae_srcif: ::c_uint, // optional source interface
564         pub sae_srcaddr: *const ::sockaddr, // optional source address
565         pub sae_srcaddrlen: ::socklen_t, // size of source address
566         pub sae_dstaddr: *const ::sockaddr, // destination address
567         pub sae_dstaddrlen: ::socklen_t, // size of destination address
568     }
569 
570     pub struct timex {
571         pub modes: ::c_uint,
572         pub offset: ::c_long,
573         pub freq: ::c_long,
574         pub maxerror: ::c_long,
575         pub esterror: ::c_long,
576         pub status: ::c_int,
577         pub constant: ::c_long,
578         pub precision: ::c_long,
579         pub tolerance: ::c_long,
580         pub ppsfreq: ::c_long,
581         pub jitter: ::c_long,
582         pub shift: ::c_int,
583         pub stabil: ::c_long,
584         pub jitcnt: ::c_long,
585         pub calcnt: ::c_long,
586         pub errcnt: ::c_long,
587         pub stbcnt: ::c_long,
588     }
589 
590     pub struct ntptimeval {
591         pub time: ::timespec,
592         pub maxerror: ::c_long,
593         pub esterror: ::c_long,
594         pub tai: ::c_long,
595         pub time_state: ::c_int,
596     }
597 
598     pub struct thread_standard_policy {
599         pub no_data: natural_t,
600     }
601 
602     pub struct thread_extended_policy {
603         pub timeshare: boolean_t,
604     }
605 
606     pub struct thread_time_constraint_policy {
607         pub period: u32,
608         pub computation: u32,
609         pub constraint: u32,
610         pub preemptible: boolean_t,
611     }
612 
613     pub struct thread_precedence_policy {
614         pub importance: integer_t,
615     }
616 
617     pub struct thread_affinity_policy {
618         pub affinity_tag: integer_t,
619     }
620 
621     pub struct thread_background_policy {
622         pub priority: integer_t,
623     }
624 
625     pub struct thread_latency_qos_policy {
626         pub thread_latency_qos_tier: thread_latency_qos_t,
627     }
628 
629     pub struct thread_throughput_qos_policy {
630         pub thread_throughput_qos_tier: thread_throughput_qos_t,
631     }
632 
633     // malloc/malloc.h
634     pub struct malloc_statistics_t {
635         pub blocks_in_use: ::c_uint,
636         pub size_in_use: ::size_t,
637         pub max_size_in_use: ::size_t,
638         pub size_allocated: ::size_t,
639     }
640 
641     pub struct mstats {
642         pub bytes_total: ::size_t,
643         pub chunks_used: ::size_t,
644         pub bytes_used: ::size_t,
645         pub chunks_free: ::size_t,
646         pub bytes_free: ::size_t,
647     }
648 }
649 
650 s_no_extra_traits! {
651     #[cfg_attr(libc_packedN, repr(packed(4)))]
652     pub struct kevent {
653         pub ident: ::uintptr_t,
654         pub filter: i16,
655         pub flags: u16,
656         pub fflags: u32,
657         pub data: ::intptr_t,
658         pub udata: *mut ::c_void,
659     }
660 
661     #[cfg_attr(libc_packedN, repr(packed(4)))]
662     pub struct semid_ds {
663         // Note the manpage shows different types than the system header.
664         pub sem_perm: ipc_perm,
665         pub sem_base: i32,
666         pub sem_nsems: ::c_ushort,
667         pub sem_otime: ::time_t,
668         pub sem_pad1: i32,
669         pub sem_ctime: ::time_t,
670         pub sem_pad2: i32,
671         pub sem_pad3: [i32; 4],
672     }
673 
674     #[cfg_attr(libc_packedN, repr(packed(4)))]
675     pub struct shmid_ds {
676         pub shm_perm: ipc_perm,
677         pub shm_segsz: ::size_t,
678         pub shm_lpid: ::pid_t,
679         pub shm_cpid: ::pid_t,
680         pub shm_nattch: ::shmatt_t,
681         pub shm_atime: ::time_t,  // FIXME: 64-bit wrong align => wrong offset
682         pub shm_dtime: ::time_t,  // FIXME: 64-bit wrong align => wrong offset
683         pub shm_ctime: ::time_t,  // FIXME: 64-bit wrong align => wrong offset
684         // FIXME: 64-bit wrong align => wrong offset:
685         pub shm_internal: *mut ::c_void,
686     }
687 
688     pub struct proc_threadinfo {
689         pub pth_user_time: u64,
690         pub pth_system_time: u64,
691         pub pth_cpu_usage: i32,
692         pub pth_policy: i32,
693         pub pth_run_state: i32,
694         pub pth_flags: i32,
695         pub pth_sleep_time: i32,
696         pub pth_curpri: i32,
697         pub pth_priority: i32,
698         pub pth_maxpriority: i32,
699         pub pth_name: [::c_char; MAXTHREADNAMESIZE],
700     }
701 
702     pub struct statfs {
703         pub f_bsize: u32,
704         pub f_iosize: i32,
705         pub f_blocks: u64,
706         pub f_bfree: u64,
707         pub f_bavail: u64,
708         pub f_files: u64,
709         pub f_ffree: u64,
710         pub f_fsid: ::fsid_t,
711         pub f_owner: ::uid_t,
712         pub f_type: u32,
713         pub f_flags: u32,
714         pub f_fssubtype: u32,
715         pub f_fstypename: [::c_char; 16],
716         pub f_mntonname: [::c_char; 1024],
717         pub f_mntfromname: [::c_char; 1024],
718         pub f_reserved: [u32; 8],
719     }
720 
721     pub struct dirent {
722         pub d_ino: u64,
723         pub d_seekoff: u64,
724         pub d_reclen: u16,
725         pub d_namlen: u16,
726         pub d_type: u8,
727         pub d_name: [::c_char; 1024],
728     }
729 
730     pub struct pthread_rwlock_t {
731         __sig: ::c_long,
732         __opaque: [u8; __PTHREAD_RWLOCK_SIZE__],
733     }
734 
735     pub struct pthread_mutex_t {
736         __sig: ::c_long,
737         __opaque: [u8; __PTHREAD_MUTEX_SIZE__],
738     }
739 
740     pub struct pthread_cond_t {
741         __sig: ::c_long,
742         __opaque: [u8; __PTHREAD_COND_SIZE__],
743     }
744 
745     pub struct sockaddr_storage {
746         pub ss_len: u8,
747         pub ss_family: ::sa_family_t,
748         __ss_pad1: [u8; 6],
749         __ss_align: i64,
750         __ss_pad2: [u8; 112],
751     }
752 
753     pub struct utmpx {
754         pub ut_user: [::c_char; _UTX_USERSIZE],
755         pub ut_id: [::c_char; _UTX_IDSIZE],
756         pub ut_line: [::c_char; _UTX_LINESIZE],
757         pub ut_pid: ::pid_t,
758         pub ut_type: ::c_short,
759         pub ut_tv: ::timeval,
760         pub ut_host: [::c_char; _UTX_HOSTSIZE],
761         ut_pad: [u32; 16],
762     }
763 
764     pub struct sigevent {
765         pub sigev_notify: ::c_int,
766         pub sigev_signo: ::c_int,
767         pub sigev_value: ::sigval,
768         __unused1: *mut ::c_void,       //actually a function pointer
769         pub sigev_notify_attributes: *mut ::pthread_attr_t
770     }
771 
772     pub struct processor_cpu_load_info {
773         pub cpu_ticks: [::c_uint; CPU_STATE_MAX as usize],
774     }
775 
776     pub struct processor_basic_info {
777         pub cpu_type: cpu_type_t,
778         pub cpu_subtype: cpu_subtype_t,
779         pub running: ::boolean_t,
780         pub slot_num: ::c_int,
781         pub is_master: ::boolean_t,
782     }
783 
784     pub struct processor_set_basic_info {
785         pub processor_count: ::c_int,
786         pub default_policy: ::c_int,
787     }
788 
789     pub struct processor_set_load_info {
790         pub task_count: ::c_int,
791         pub thread_count: ::c_int,
792         pub load_average: integer_t,
793         pub mach_factor: integer_t,
794     }
795 }
796 
797 impl siginfo_t {
si_addr(&self) -> *mut ::c_void798     pub unsafe fn si_addr(&self) -> *mut ::c_void {
799         self.si_addr
800     }
801 
si_value(&self) -> ::sigval802     pub unsafe fn si_value(&self) -> ::sigval {
803         #[repr(C)]
804         struct siginfo_timer {
805             _si_signo: ::c_int,
806             _si_errno: ::c_int,
807             _si_code: ::c_int,
808             _si_pid: ::pid_t,
809             _si_uid: ::uid_t,
810             _si_status: ::c_int,
811             _si_addr: *mut ::c_void,
812             si_value: ::sigval,
813         }
814 
815         (*(self as *const siginfo_t as *const siginfo_timer)).si_value
816     }
817 
si_pid(&self) -> ::pid_t818     pub unsafe fn si_pid(&self) -> ::pid_t {
819         self.si_pid
820     }
821 
si_uid(&self) -> ::uid_t822     pub unsafe fn si_uid(&self) -> ::uid_t {
823         self.si_uid
824     }
825 
si_status(&self) -> ::c_int826     pub unsafe fn si_status(&self) -> ::c_int {
827         self.si_status
828     }
829 }
830 
831 cfg_if! {
832     if #[cfg(libc_union)] {
833         s_no_extra_traits! {
834             pub union semun {
835                 pub val: ::c_int,
836                 pub buf: *mut semid_ds,
837                 pub array: *mut ::c_ushort,
838             }
839         }
840 
841         cfg_if! {
842             if #[cfg(feature = "extra_traits")] {
843                 impl PartialEq for semun {
844                     fn eq(&self, other: &semun) -> bool {
845                         unsafe { self.val == other.val }
846                     }
847                 }
848                 impl Eq for semun {}
849                 impl ::fmt::Debug for semun {
850                     fn fmt(&self, f: &mut ::fmt::Formatter)
851                            -> ::fmt::Result {
852                         f.debug_struct("semun")
853                             .field("val", unsafe { &self.val })
854                             .finish()
855                     }
856                 }
857                 impl ::hash::Hash for semun {
858                     fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
859                         unsafe { self.val.hash(state) };
860                     }
861                 }
862             }
863         }
864     }
865 }
866 
867 cfg_if! {
868     if #[cfg(feature = "extra_traits")] {
869         impl PartialEq for kevent {
870             fn eq(&self, other: &kevent) -> bool {
871                 self.ident == other.ident
872                     && self.filter == other.filter
873                     && self.flags == other.flags
874                     && self.fflags == other.fflags
875                     && self.data == other.data
876                     && self.udata == other.udata
877             }
878         }
879         impl Eq for kevent {}
880         impl ::fmt::Debug for kevent {
881             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
882                 let ident = self.ident;
883                 let filter = self.filter;
884                 let flags = self.flags;
885                 let fflags = self.fflags;
886                 let data = self.data;
887                 let udata = self.udata;
888                 f.debug_struct("kevent")
889                     .field("ident", &ident)
890                     .field("filter", &filter)
891                     .field("flags", &flags)
892                     .field("fflags", &fflags)
893                     .field("data", &data)
894                     .field("udata", &udata)
895                     .finish()
896             }
897         }
898         impl ::hash::Hash for kevent {
899             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
900                 let ident = self.ident;
901                 let filter = self.filter;
902                 let flags = self.flags;
903                 let fflags = self.fflags;
904                 let data = self.data;
905                 let udata = self.udata;
906                 ident.hash(state);
907                 filter.hash(state);
908                 flags.hash(state);
909                 fflags.hash(state);
910                 data.hash(state);
911                 udata.hash(state);
912             }
913         }
914 
915         impl PartialEq for semid_ds {
916             fn eq(&self, other: &semid_ds) -> bool {
917                 let sem_perm = self.sem_perm;
918                 let sem_pad3 = self.sem_pad3;
919                 let other_sem_perm = other.sem_perm;
920                 let other_sem_pad3 = other.sem_pad3;
921                 sem_perm == other_sem_perm
922                     && self.sem_base == other.sem_base
923                     && self.sem_nsems == other.sem_nsems
924                     && self.sem_otime == other.sem_otime
925                     && self.sem_pad1 == other.sem_pad1
926                     && self.sem_ctime == other.sem_ctime
927                     && self.sem_pad2 == other.sem_pad2
928                     && sem_pad3 == other_sem_pad3
929             }
930         }
931         impl Eq for semid_ds {}
932         impl ::fmt::Debug for semid_ds {
933             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
934                 let sem_perm = self.sem_perm;
935                 let sem_base = self.sem_base;
936                 let sem_nsems = self.sem_nsems;
937                 let sem_otime = self.sem_otime;
938                 let sem_pad1 = self.sem_pad1;
939                 let sem_ctime = self.sem_ctime;
940                 let sem_pad2 = self.sem_pad2;
941                 let sem_pad3 = self.sem_pad3;
942                 f.debug_struct("semid_ds")
943                     .field("sem_perm", &sem_perm)
944                     .field("sem_base", &sem_base)
945                     .field("sem_nsems", &sem_nsems)
946                     .field("sem_otime", &sem_otime)
947                     .field("sem_pad1", &sem_pad1)
948                     .field("sem_ctime", &sem_ctime)
949                     .field("sem_pad2", &sem_pad2)
950                     .field("sem_pad3", &sem_pad3)
951                     .finish()
952             }
953         }
954         impl ::hash::Hash for semid_ds {
955             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
956                 let sem_perm = self.sem_perm;
957                 let sem_base = self.sem_base;
958                 let sem_nsems = self.sem_nsems;
959                 let sem_otime = self.sem_otime;
960                 let sem_pad1 = self.sem_pad1;
961                 let sem_ctime = self.sem_ctime;
962                 let sem_pad2 = self.sem_pad2;
963                 let sem_pad3 = self.sem_pad3;
964                 sem_perm.hash(state);
965                 sem_base.hash(state);
966                 sem_nsems.hash(state);
967                 sem_otime.hash(state);
968                 sem_pad1.hash(state);
969                 sem_ctime.hash(state);
970                 sem_pad2.hash(state);
971                 sem_pad3.hash(state);
972             }
973         }
974 
975         impl PartialEq for shmid_ds {
976             fn eq(&self, other: &shmid_ds) -> bool {
977                 let shm_perm = self.shm_perm;
978                 let other_shm_perm = other.shm_perm;
979                 shm_perm == other_shm_perm
980                     && self.shm_segsz == other.shm_segsz
981                     && self.shm_lpid == other.shm_lpid
982                     && self.shm_cpid == other.shm_cpid
983                     && self.shm_nattch == other.shm_nattch
984                     && self.shm_atime == other.shm_atime
985                     && self.shm_dtime == other.shm_dtime
986                     && self.shm_ctime == other.shm_ctime
987                     && self.shm_internal == other.shm_internal
988             }
989         }
990         impl Eq for shmid_ds {}
991         impl ::fmt::Debug for shmid_ds {
992             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
993                 let shm_perm = self.shm_perm;
994                 let shm_segsz = self.shm_segsz;
995                 let shm_lpid = self.shm_lpid;
996                 let shm_cpid = self.shm_cpid;
997                 let shm_nattch = self.shm_nattch;
998                 let shm_atime = self.shm_atime;
999                 let shm_dtime = self.shm_dtime;
1000                 let shm_ctime = self.shm_ctime;
1001                 let shm_internal = self.shm_internal;
1002                 f.debug_struct("shmid_ds")
1003                     .field("shm_perm", &shm_perm)
1004                     .field("shm_segsz", &shm_segsz)
1005                     .field("shm_lpid", &shm_lpid)
1006                     .field("shm_cpid", &shm_cpid)
1007                     .field("shm_nattch", &shm_nattch)
1008                     .field("shm_atime", &shm_atime)
1009                     .field("shm_dtime", &shm_dtime)
1010                     .field("shm_ctime", &shm_ctime)
1011                     .field("shm_internal", &shm_internal)
1012                     .finish()
1013             }
1014         }
1015         impl ::hash::Hash for shmid_ds {
1016             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1017                 let shm_perm = self.shm_perm;
1018                 let shm_segsz = self.shm_segsz;
1019                 let shm_lpid = self.shm_lpid;
1020                 let shm_cpid = self.shm_cpid;
1021                 let shm_nattch = self.shm_nattch;
1022                 let shm_atime = self.shm_atime;
1023                 let shm_dtime = self.shm_dtime;
1024                 let shm_ctime = self.shm_ctime;
1025                 let shm_internal = self.shm_internal;
1026                 shm_perm.hash(state);
1027                 shm_segsz.hash(state);
1028                 shm_lpid.hash(state);
1029                 shm_cpid.hash(state);
1030                 shm_nattch.hash(state);
1031                 shm_atime.hash(state);
1032                 shm_dtime.hash(state);
1033                 shm_ctime.hash(state);
1034                 shm_internal.hash(state);
1035             }
1036         }
1037 
1038         impl PartialEq for proc_threadinfo {
1039             fn eq(&self, other: &proc_threadinfo) -> bool {
1040                 self.pth_user_time == other.pth_user_time
1041                     && self.pth_system_time == other.pth_system_time
1042                     && self.pth_cpu_usage == other.pth_cpu_usage
1043                     && self.pth_policy == other.pth_policy
1044                     && self.pth_run_state == other.pth_run_state
1045                     && self.pth_flags == other.pth_flags
1046                     && self.pth_sleep_time == other.pth_sleep_time
1047                     && self.pth_curpri == other.pth_curpri
1048                     && self.pth_priority == other.pth_priority
1049                     && self.pth_maxpriority == other.pth_maxpriority
1050                     && self.pth_name
1051                            .iter()
1052                            .zip(other.pth_name.iter())
1053                            .all(|(a,b)| a == b)
1054             }
1055         }
1056         impl Eq for proc_threadinfo {}
1057         impl ::fmt::Debug for proc_threadinfo {
1058             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1059                 f.debug_struct("proc_threadinfo")
1060                     .field("pth_user_time", &self.pth_user_time)
1061                     .field("pth_system_time", &self.pth_system_time)
1062                     .field("pth_cpu_usage", &self.pth_cpu_usage)
1063                     .field("pth_policy", &self.pth_policy)
1064                     .field("pth_run_state", &self.pth_run_state)
1065                     .field("pth_flags", &self.pth_flags)
1066                     .field("pth_sleep_time", &self.pth_sleep_time)
1067                     .field("pth_curpri", &self.pth_curpri)
1068                     .field("pth_priority", &self.pth_priority)
1069                     .field("pth_maxpriority", &self.pth_maxpriority)
1070                       // FIXME: .field("pth_name", &self.pth_name)
1071                     .finish()
1072             }
1073         }
1074         impl ::hash::Hash for proc_threadinfo {
1075             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1076                 self.pth_user_time.hash(state);
1077                 self.pth_system_time.hash(state);
1078                 self.pth_cpu_usage.hash(state);
1079                 self.pth_policy.hash(state);
1080                 self.pth_run_state.hash(state);
1081                 self.pth_flags.hash(state);
1082                 self.pth_sleep_time.hash(state);
1083                 self.pth_curpri.hash(state);
1084                 self.pth_priority.hash(state);
1085                 self.pth_maxpriority.hash(state);
1086                 self.pth_name.hash(state);
1087             }
1088         }
1089 
1090         impl PartialEq for statfs {
1091             fn eq(&self, other: &statfs) -> bool {
1092                 self.f_bsize == other.f_bsize
1093                     && self.f_iosize == other.f_iosize
1094                     && self.f_blocks == other.f_blocks
1095                     && self.f_bfree == other.f_bfree
1096                     && self.f_bavail == other.f_bavail
1097                     && self.f_files == other.f_files
1098                     && self.f_ffree == other.f_ffree
1099                     && self.f_fsid == other.f_fsid
1100                     && self.f_owner == other.f_owner
1101                     && self.f_flags == other.f_flags
1102                     && self.f_fssubtype == other.f_fssubtype
1103                     && self.f_fstypename == other.f_fstypename
1104                     && self.f_type == other.f_type
1105                     && self
1106                     .f_mntonname
1107                     .iter()
1108                     .zip(other.f_mntonname.iter())
1109                     .all(|(a,b)| a == b)
1110                     && self
1111                     .f_mntfromname
1112                     .iter()
1113                     .zip(other.f_mntfromname.iter())
1114                     .all(|(a,b)| a == b)
1115                     && self.f_reserved == other.f_reserved
1116             }
1117         }
1118 
1119         impl Eq for statfs {}
1120         impl ::fmt::Debug for statfs {
1121             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1122                 f.debug_struct("statfs")
1123                     .field("f_bsize", &self.f_bsize)
1124                     .field("f_iosize", &self.f_iosize)
1125                     .field("f_blocks", &self.f_blocks)
1126                     .field("f_bfree", &self.f_bfree)
1127                     .field("f_bavail", &self.f_bavail)
1128                     .field("f_files", &self.f_files)
1129                     .field("f_ffree", &self.f_ffree)
1130                     .field("f_fsid", &self.f_fsid)
1131                     .field("f_owner", &self.f_owner)
1132                     .field("f_flags", &self.f_flags)
1133                     .field("f_fssubtype", &self.f_fssubtype)
1134                     .field("f_fstypename", &self.f_fstypename)
1135                     .field("f_type", &self.f_type)
1136                 // FIXME: .field("f_mntonname", &self.f_mntonname)
1137                 // FIXME: .field("f_mntfromname", &self.f_mntfromname)
1138                     .field("f_reserved", &self.f_reserved)
1139                     .finish()
1140             }
1141         }
1142 
1143         impl ::hash::Hash for statfs {
1144             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1145                 self.f_bsize.hash(state);
1146                 self.f_iosize.hash(state);
1147                 self.f_blocks.hash(state);
1148                 self.f_bfree.hash(state);
1149                 self.f_bavail.hash(state);
1150                 self.f_files.hash(state);
1151                 self.f_ffree.hash(state);
1152                 self.f_fsid.hash(state);
1153                 self.f_owner.hash(state);
1154                 self.f_flags.hash(state);
1155                 self.f_fssubtype.hash(state);
1156                 self.f_fstypename.hash(state);
1157                 self.f_type.hash(state);
1158                 self.f_mntonname.hash(state);
1159                 self.f_mntfromname.hash(state);
1160                 self.f_reserved.hash(state);
1161             }
1162         }
1163 
1164         impl PartialEq for dirent {
1165             fn eq(&self, other: &dirent) -> bool {
1166                 self.d_ino == other.d_ino
1167                     && self.d_seekoff == other.d_seekoff
1168                     && self.d_reclen == other.d_reclen
1169                     && self.d_namlen == other.d_namlen
1170                     && self.d_type == other.d_type
1171                     && self
1172                     .d_name
1173                     .iter()
1174                     .zip(other.d_name.iter())
1175                     .all(|(a,b)| a == b)
1176             }
1177         }
1178         impl Eq for dirent {}
1179         impl ::fmt::Debug for dirent {
1180             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1181                 f.debug_struct("dirent")
1182                     .field("d_ino", &self.d_ino)
1183                     .field("d_seekoff", &self.d_seekoff)
1184                     .field("d_reclen", &self.d_reclen)
1185                     .field("d_namlen", &self.d_namlen)
1186                     .field("d_type", &self.d_type)
1187                     // FIXME: .field("d_name", &self.d_name)
1188                     .finish()
1189             }
1190         }
1191         impl ::hash::Hash for dirent {
1192             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1193                 self.d_ino.hash(state);
1194                 self.d_seekoff.hash(state);
1195                 self.d_reclen.hash(state);
1196                 self.d_namlen.hash(state);
1197                 self.d_type.hash(state);
1198                 self.d_name.hash(state);
1199             }
1200         }
1201         impl PartialEq for pthread_rwlock_t {
1202             fn eq(&self, other: &pthread_rwlock_t) -> bool {
1203                 self.__sig == other.__sig
1204                     && self.
1205                     __opaque
1206                     .iter()
1207                     .zip(other.__opaque.iter())
1208                     .all(|(a,b)| a == b)
1209             }
1210         }
1211         impl Eq for pthread_rwlock_t {}
1212         impl ::fmt::Debug for pthread_rwlock_t {
1213             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1214                 f.debug_struct("pthread_rwlock_t")
1215                     .field("__sig", &self.__sig)
1216                     // FIXME: .field("__opaque", &self.__opaque)
1217                     .finish()
1218             }
1219         }
1220         impl ::hash::Hash for pthread_rwlock_t {
1221             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1222                 self.__sig.hash(state);
1223                 self.__opaque.hash(state);
1224             }
1225         }
1226 
1227         impl PartialEq for pthread_mutex_t {
1228             fn eq(&self, other: &pthread_mutex_t) -> bool {
1229                 self.__sig == other.__sig
1230                     && self.
1231                     __opaque
1232                     .iter()
1233                     .zip(other.__opaque.iter())
1234                     .all(|(a,b)| a == b)
1235             }
1236         }
1237 
1238         impl Eq for pthread_mutex_t {}
1239 
1240         impl ::fmt::Debug for pthread_mutex_t {
1241             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1242                 f.debug_struct("pthread_mutex_t")
1243                     .field("__sig", &self.__sig)
1244                     // FIXME: .field("__opaque", &self.__opaque)
1245                     .finish()
1246             }
1247         }
1248 
1249         impl ::hash::Hash for pthread_mutex_t {
1250             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1251                 self.__sig.hash(state);
1252                 self.__opaque.hash(state);
1253             }
1254         }
1255 
1256         impl PartialEq for pthread_cond_t {
1257             fn eq(&self, other: &pthread_cond_t) -> bool {
1258                 self.__sig == other.__sig
1259                     && self.
1260                     __opaque
1261                     .iter()
1262                     .zip(other.__opaque.iter())
1263                     .all(|(a,b)| a == b)
1264             }
1265         }
1266 
1267         impl Eq for pthread_cond_t {}
1268 
1269         impl ::fmt::Debug for pthread_cond_t {
1270             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1271                 f.debug_struct("pthread_cond_t")
1272                     .field("__sig", &self.__sig)
1273                     // FIXME: .field("__opaque", &self.__opaque)
1274                     .finish()
1275             }
1276         }
1277 
1278         impl ::hash::Hash for pthread_cond_t {
1279             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1280                 self.__sig.hash(state);
1281                 self.__opaque.hash(state);
1282             }
1283         }
1284 
1285         impl PartialEq for sockaddr_storage {
1286             fn eq(&self, other: &sockaddr_storage) -> bool {
1287                 self.ss_len == other.ss_len
1288                     && self.ss_family == other.ss_family
1289                     && self
1290                     .__ss_pad1
1291                     .iter()
1292                     .zip(other.__ss_pad1.iter())
1293                     .all(|(a, b)| a == b)
1294                     && self.__ss_align == other.__ss_align
1295                     && self
1296                     .__ss_pad2
1297                     .iter()
1298                     .zip(other.__ss_pad2.iter())
1299                     .all(|(a, b)| a == b)
1300             }
1301         }
1302 
1303         impl Eq for sockaddr_storage {}
1304 
1305         impl ::fmt::Debug for sockaddr_storage {
1306             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1307                 f.debug_struct("sockaddr_storage")
1308                     .field("ss_len", &self.ss_len)
1309                     .field("ss_family", &self.ss_family)
1310                     .field("__ss_pad1", &self.__ss_pad1)
1311                     .field("__ss_align", &self.__ss_align)
1312                     // FIXME: .field("__ss_pad2", &self.__ss_pad2)
1313                     .finish()
1314             }
1315         }
1316 
1317         impl ::hash::Hash for sockaddr_storage {
1318             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1319                 self.ss_len.hash(state);
1320                 self.ss_family.hash(state);
1321                 self.__ss_pad1.hash(state);
1322                 self.__ss_align.hash(state);
1323                 self.__ss_pad2.hash(state);
1324             }
1325         }
1326 
1327         impl PartialEq for utmpx {
1328             fn eq(&self, other: &utmpx) -> bool {
1329                 self.ut_user
1330                     .iter()
1331                     .zip(other.ut_user.iter())
1332                     .all(|(a,b)| a == b)
1333                     && self.ut_id == other.ut_id
1334                     && self.ut_line == other.ut_line
1335                     && self.ut_pid == other.ut_pid
1336                     && self.ut_type == other.ut_type
1337                     && self.ut_tv == other.ut_tv
1338                     && self
1339                     .ut_host
1340                     .iter()
1341                     .zip(other.ut_host.iter())
1342                     .all(|(a,b)| a == b)
1343                     && self.ut_pad == other.ut_pad
1344             }
1345         }
1346 
1347         impl Eq for utmpx {}
1348 
1349         impl ::fmt::Debug for utmpx {
1350             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1351                 f.debug_struct("utmpx")
1352                     // FIXME: .field("ut_user", &self.ut_user)
1353                     .field("ut_id", &self.ut_id)
1354                     .field("ut_line", &self.ut_line)
1355                     .field("ut_pid", &self.ut_pid)
1356                     .field("ut_type", &self.ut_type)
1357                     .field("ut_tv", &self.ut_tv)
1358                     // FIXME: .field("ut_host", &self.ut_host)
1359                     .field("ut_pad", &self.ut_pad)
1360                     .finish()
1361             }
1362         }
1363 
1364         impl ::hash::Hash for utmpx {
1365             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1366                 self.ut_user.hash(state);
1367                 self.ut_id.hash(state);
1368                 self.ut_line.hash(state);
1369                 self.ut_pid.hash(state);
1370                 self.ut_type.hash(state);
1371                 self.ut_tv.hash(state);
1372                 self.ut_host.hash(state);
1373                 self.ut_pad.hash(state);
1374             }
1375         }
1376 
1377         impl PartialEq for sigevent {
1378             fn eq(&self, other: &sigevent) -> bool {
1379                 self.sigev_notify == other.sigev_notify
1380                     && self.sigev_signo == other.sigev_signo
1381                     && self.sigev_value == other.sigev_value
1382                     && self.sigev_notify_attributes
1383                         == other.sigev_notify_attributes
1384             }
1385         }
1386 
1387         impl Eq for sigevent {}
1388 
1389         impl ::fmt::Debug for sigevent {
1390             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1391                 f.debug_struct("sigevent")
1392                     .field("sigev_notify", &self.sigev_notify)
1393                     .field("sigev_signo", &self.sigev_signo)
1394                     .field("sigev_value", &self.sigev_value)
1395                     .field("sigev_notify_attributes",
1396                            &self.sigev_notify_attributes)
1397                     .finish()
1398             }
1399         }
1400 
1401         impl ::hash::Hash for sigevent {
1402             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1403                 self.sigev_notify.hash(state);
1404                 self.sigev_signo.hash(state);
1405                 self.sigev_value.hash(state);
1406                 self.sigev_notify_attributes.hash(state);
1407             }
1408         }
1409 
1410         impl PartialEq for processor_cpu_load_info {
1411             fn eq(&self, other: &processor_cpu_load_info) -> bool {
1412                 self.cpu_ticks == other.cpu_ticks
1413             }
1414         }
1415         impl Eq for processor_cpu_load_info {}
1416         impl ::fmt::Debug for processor_cpu_load_info {
1417             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1418                 f.debug_struct("processor_cpu_load_info")
1419                     .field("cpu_ticks", &self.cpu_ticks)
1420                     .finish()
1421             }
1422         }
1423         impl ::hash::Hash for processor_cpu_load_info {
1424             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1425                 self.cpu_ticks.hash(state);
1426             }
1427         }
1428 
1429         impl PartialEq for processor_basic_info {
1430             fn eq(&self, other: &processor_basic_info) -> bool {
1431                 self.cpu_type == other.cpu_type
1432                     && self.cpu_subtype == other.cpu_subtype
1433                     && self.running == other.running
1434                     && self.slot_num == other.slot_num
1435                     && self.is_master == other.is_master
1436             }
1437         }
1438         impl Eq for processor_basic_info {}
1439         impl ::fmt::Debug for processor_basic_info {
1440             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1441                 f.debug_struct("processor_basic_info")
1442                     .field("cpu_type", &self.cpu_type)
1443                     .field("cpu_subtype", &self.cpu_subtype)
1444                     .field("running", &self.running)
1445                     .field("slot_num", &self.slot_num)
1446                     .field("is_master", &self.is_master)
1447                     .finish()
1448             }
1449         }
1450         impl ::hash::Hash for processor_basic_info {
1451             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1452                 self.cpu_type.hash(state);
1453                 self.cpu_subtype.hash(state);
1454                 self.running.hash(state);
1455                 self.slot_num.hash(state);
1456                 self.is_master.hash(state);
1457             }
1458         }
1459 
1460         impl PartialEq for processor_set_basic_info {
1461             fn eq(&self, other: &processor_set_basic_info) -> bool {
1462                 self.processor_count == other.processor_count
1463                     && self.default_policy == other.default_policy
1464             }
1465         }
1466         impl Eq for processor_set_basic_info {}
1467         impl ::fmt::Debug for processor_set_basic_info {
1468             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1469                 f.debug_struct("processor_set_basic_info")
1470                     .field("processor_count", &self.processor_count)
1471                     .field("default_policy", &self.default_policy)
1472                     .finish()
1473             }
1474         }
1475         impl ::hash::Hash for processor_set_basic_info {
1476             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1477                 self.processor_count.hash(state);
1478                 self.default_policy.hash(state);
1479             }
1480         }
1481 
1482         impl PartialEq for processor_set_load_info {
1483             fn eq(&self, other: &processor_set_load_info) -> bool {
1484                 self.task_count == other.task_count
1485                     && self.thread_count == other.thread_count
1486                     && self.load_average == other.load_average
1487                     && self.mach_factor == other.mach_factor
1488             }
1489         }
1490         impl Eq for processor_set_load_info {}
1491         impl ::fmt::Debug for processor_set_load_info {
1492             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1493                 f.debug_struct("processor_set_load_info")
1494                     .field("task_count", &self.task_count)
1495                     .field("thread_count", &self.thread_count)
1496                     .field("load_average", &self.load_average)
1497                     .field("mach_factor", &self.mach_factor)
1498                     .finish()
1499             }
1500         }
1501         impl ::hash::Hash for processor_set_load_info {
1502             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1503                 self.task_count.hash(state);
1504                 self.thread_count.hash(state);
1505                 self.load_average.hash(state);
1506                 self.mach_factor.hash(state);
1507             }
1508         }
1509     }
1510 }
1511 
1512 pub const _UTX_USERSIZE: usize = 256;
1513 pub const _UTX_LINESIZE: usize = 32;
1514 pub const _UTX_IDSIZE: usize = 4;
1515 pub const _UTX_HOSTSIZE: usize = 256;
1516 
1517 pub const EMPTY: ::c_short = 0;
1518 pub const RUN_LVL: ::c_short = 1;
1519 pub const BOOT_TIME: ::c_short = 2;
1520 pub const OLD_TIME: ::c_short = 3;
1521 pub const NEW_TIME: ::c_short = 4;
1522 pub const INIT_PROCESS: ::c_short = 5;
1523 pub const LOGIN_PROCESS: ::c_short = 6;
1524 pub const USER_PROCESS: ::c_short = 7;
1525 pub const DEAD_PROCESS: ::c_short = 8;
1526 pub const ACCOUNTING: ::c_short = 9;
1527 pub const SIGNATURE: ::c_short = 10;
1528 pub const SHUTDOWN_TIME: ::c_short = 11;
1529 
1530 pub const LC_COLLATE_MASK: ::c_int = 1 << 0;
1531 pub const LC_CTYPE_MASK: ::c_int = 1 << 1;
1532 pub const LC_MESSAGES_MASK: ::c_int = 1 << 2;
1533 pub const LC_MONETARY_MASK: ::c_int = 1 << 3;
1534 pub const LC_NUMERIC_MASK: ::c_int = 1 << 4;
1535 pub const LC_TIME_MASK: ::c_int = 1 << 5;
1536 pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
1537     | LC_CTYPE_MASK
1538     | LC_MESSAGES_MASK
1539     | LC_MONETARY_MASK
1540     | LC_NUMERIC_MASK
1541     | LC_TIME_MASK;
1542 
1543 pub const CODESET: ::nl_item = 0;
1544 pub const D_T_FMT: ::nl_item = 1;
1545 pub const D_FMT: ::nl_item = 2;
1546 pub const T_FMT: ::nl_item = 3;
1547 pub const T_FMT_AMPM: ::nl_item = 4;
1548 pub const AM_STR: ::nl_item = 5;
1549 pub const PM_STR: ::nl_item = 6;
1550 
1551 pub const DAY_1: ::nl_item = 7;
1552 pub const DAY_2: ::nl_item = 8;
1553 pub const DAY_3: ::nl_item = 9;
1554 pub const DAY_4: ::nl_item = 10;
1555 pub const DAY_5: ::nl_item = 11;
1556 pub const DAY_6: ::nl_item = 12;
1557 pub const DAY_7: ::nl_item = 13;
1558 
1559 pub const ABDAY_1: ::nl_item = 14;
1560 pub const ABDAY_2: ::nl_item = 15;
1561 pub const ABDAY_3: ::nl_item = 16;
1562 pub const ABDAY_4: ::nl_item = 17;
1563 pub const ABDAY_5: ::nl_item = 18;
1564 pub const ABDAY_6: ::nl_item = 19;
1565 pub const ABDAY_7: ::nl_item = 20;
1566 
1567 pub const MON_1: ::nl_item = 21;
1568 pub const MON_2: ::nl_item = 22;
1569 pub const MON_3: ::nl_item = 23;
1570 pub const MON_4: ::nl_item = 24;
1571 pub const MON_5: ::nl_item = 25;
1572 pub const MON_6: ::nl_item = 26;
1573 pub const MON_7: ::nl_item = 27;
1574 pub const MON_8: ::nl_item = 28;
1575 pub const MON_9: ::nl_item = 29;
1576 pub const MON_10: ::nl_item = 30;
1577 pub const MON_11: ::nl_item = 31;
1578 pub const MON_12: ::nl_item = 32;
1579 
1580 pub const ABMON_1: ::nl_item = 33;
1581 pub const ABMON_2: ::nl_item = 34;
1582 pub const ABMON_3: ::nl_item = 35;
1583 pub const ABMON_4: ::nl_item = 36;
1584 pub const ABMON_5: ::nl_item = 37;
1585 pub const ABMON_6: ::nl_item = 38;
1586 pub const ABMON_7: ::nl_item = 39;
1587 pub const ABMON_8: ::nl_item = 40;
1588 pub const ABMON_9: ::nl_item = 41;
1589 pub const ABMON_10: ::nl_item = 42;
1590 pub const ABMON_11: ::nl_item = 43;
1591 pub const ABMON_12: ::nl_item = 44;
1592 
1593 pub const CLOCK_REALTIME: ::clockid_t = 0;
1594 pub const CLOCK_MONOTONIC: ::clockid_t = 6;
1595 pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 12;
1596 pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 16;
1597 
1598 pub const ERA: ::nl_item = 45;
1599 pub const ERA_D_FMT: ::nl_item = 46;
1600 pub const ERA_D_T_FMT: ::nl_item = 47;
1601 pub const ERA_T_FMT: ::nl_item = 48;
1602 pub const ALT_DIGITS: ::nl_item = 49;
1603 
1604 pub const RADIXCHAR: ::nl_item = 50;
1605 pub const THOUSEP: ::nl_item = 51;
1606 
1607 pub const YESEXPR: ::nl_item = 52;
1608 pub const NOEXPR: ::nl_item = 53;
1609 
1610 pub const YESSTR: ::nl_item = 54;
1611 pub const NOSTR: ::nl_item = 55;
1612 
1613 pub const CRNCYSTR: ::nl_item = 56;
1614 
1615 pub const D_MD_ORDER: ::nl_item = 57;
1616 
1617 pub const EXIT_FAILURE: ::c_int = 1;
1618 pub const EXIT_SUCCESS: ::c_int = 0;
1619 pub const RAND_MAX: ::c_int = 2147483647;
1620 pub const EOF: ::c_int = -1;
1621 pub const SEEK_SET: ::c_int = 0;
1622 pub const SEEK_CUR: ::c_int = 1;
1623 pub const SEEK_END: ::c_int = 2;
1624 pub const _IOFBF: ::c_int = 0;
1625 pub const _IONBF: ::c_int = 2;
1626 pub const _IOLBF: ::c_int = 1;
1627 pub const BUFSIZ: ::c_uint = 1024;
1628 pub const FOPEN_MAX: ::c_uint = 20;
1629 pub const FILENAME_MAX: ::c_uint = 1024;
1630 pub const L_tmpnam: ::c_uint = 1024;
1631 pub const TMP_MAX: ::c_uint = 308915776;
1632 pub const _PC_LINK_MAX: ::c_int = 1;
1633 pub const _PC_MAX_CANON: ::c_int = 2;
1634 pub const _PC_MAX_INPUT: ::c_int = 3;
1635 pub const _PC_NAME_MAX: ::c_int = 4;
1636 pub const _PC_PATH_MAX: ::c_int = 5;
1637 pub const _PC_PIPE_BUF: ::c_int = 6;
1638 pub const _PC_CHOWN_RESTRICTED: ::c_int = 7;
1639 pub const _PC_NO_TRUNC: ::c_int = 8;
1640 pub const _PC_VDISABLE: ::c_int = 9;
1641 pub const O_DSYNC: ::c_int = 0x400000;
1642 pub const O_NOCTTY: ::c_int = 0x20000;
1643 pub const O_CLOEXEC: ::c_int = 0x1000000;
1644 pub const O_DIRECTORY: ::c_int = 0x100000;
1645 pub const O_SYMLINK: ::c_int = 0x200000;
1646 pub const S_IFIFO: mode_t = 4096;
1647 pub const S_IFCHR: mode_t = 8192;
1648 pub const S_IFBLK: mode_t = 24576;
1649 pub const S_IFDIR: mode_t = 16384;
1650 pub const S_IFREG: mode_t = 32768;
1651 pub const S_IFLNK: mode_t = 40960;
1652 pub const S_IFSOCK: mode_t = 49152;
1653 pub const S_IFMT: mode_t = 61440;
1654 pub const S_IEXEC: mode_t = 64;
1655 pub const S_IWRITE: mode_t = 128;
1656 pub const S_IREAD: mode_t = 256;
1657 pub const S_IRWXU: mode_t = 448;
1658 pub const S_IXUSR: mode_t = 64;
1659 pub const S_IWUSR: mode_t = 128;
1660 pub const S_IRUSR: mode_t = 256;
1661 pub const S_IRWXG: mode_t = 56;
1662 pub const S_IXGRP: mode_t = 8;
1663 pub const S_IWGRP: mode_t = 16;
1664 pub const S_IRGRP: mode_t = 32;
1665 pub const S_IRWXO: mode_t = 7;
1666 pub const S_IXOTH: mode_t = 1;
1667 pub const S_IWOTH: mode_t = 2;
1668 pub const S_IROTH: mode_t = 4;
1669 pub const F_OK: ::c_int = 0;
1670 pub const R_OK: ::c_int = 4;
1671 pub const W_OK: ::c_int = 2;
1672 pub const X_OK: ::c_int = 1;
1673 pub const STDIN_FILENO: ::c_int = 0;
1674 pub const STDOUT_FILENO: ::c_int = 1;
1675 pub const STDERR_FILENO: ::c_int = 2;
1676 pub const F_LOCK: ::c_int = 1;
1677 pub const F_TEST: ::c_int = 3;
1678 pub const F_TLOCK: ::c_int = 2;
1679 pub const F_ULOCK: ::c_int = 0;
1680 pub const F_GETLK: ::c_int = 7;
1681 pub const F_SETLK: ::c_int = 8;
1682 pub const F_SETLKW: ::c_int = 9;
1683 pub const SIGHUP: ::c_int = 1;
1684 pub const SIGINT: ::c_int = 2;
1685 pub const SIGQUIT: ::c_int = 3;
1686 pub const SIGILL: ::c_int = 4;
1687 pub const SIGABRT: ::c_int = 6;
1688 pub const SIGEMT: ::c_int = 7;
1689 pub const SIGFPE: ::c_int = 8;
1690 pub const SIGKILL: ::c_int = 9;
1691 pub const SIGSEGV: ::c_int = 11;
1692 pub const SIGPIPE: ::c_int = 13;
1693 pub const SIGALRM: ::c_int = 14;
1694 pub const SIGTERM: ::c_int = 15;
1695 
1696 pub const PROT_NONE: ::c_int = 0;
1697 pub const PROT_READ: ::c_int = 1;
1698 pub const PROT_WRITE: ::c_int = 2;
1699 pub const PROT_EXEC: ::c_int = 4;
1700 
1701 pub const PT_TRACE_ME: ::c_int = 0;
1702 pub const PT_READ_I: ::c_int = 1;
1703 pub const PT_READ_D: ::c_int = 2;
1704 pub const PT_READ_U: ::c_int = 3;
1705 pub const PT_WRITE_I: ::c_int = 4;
1706 pub const PT_WRITE_D: ::c_int = 5;
1707 pub const PT_WRITE_U: ::c_int = 6;
1708 pub const PT_CONTINUE: ::c_int = 7;
1709 pub const PT_KILL: ::c_int = 8;
1710 pub const PT_STEP: ::c_int = 9;
1711 pub const PT_ATTACH: ::c_int = 10;
1712 pub const PT_DETACH: ::c_int = 11;
1713 pub const PT_SIGEXC: ::c_int = 12;
1714 pub const PT_THUPDATE: ::c_int = 13;
1715 pub const PT_ATTACHEXC: ::c_int = 14;
1716 
1717 pub const PT_FORCEQUOTA: ::c_int = 30;
1718 pub const PT_DENY_ATTACH: ::c_int = 31;
1719 pub const PT_FIRSTMACH: ::c_int = 32;
1720 
1721 pub const MAP_FILE: ::c_int = 0x0000;
1722 pub const MAP_SHARED: ::c_int = 0x0001;
1723 pub const MAP_PRIVATE: ::c_int = 0x0002;
1724 pub const MAP_FIXED: ::c_int = 0x0010;
1725 pub const MAP_ANON: ::c_int = 0x1000;
1726 pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
1727 
1728 pub const CPU_STATE_USER: ::c_int = 0;
1729 pub const CPU_STATE_SYSTEM: ::c_int = 1;
1730 pub const CPU_STATE_IDLE: ::c_int = 2;
1731 pub const CPU_STATE_NICE: ::c_int = 3;
1732 pub const CPU_STATE_MAX: ::c_int = 4;
1733 
1734 pub const PROCESSOR_BASIC_INFO: ::c_int = 1;
1735 pub const PROCESSOR_CPU_LOAD_INFO: ::c_int = 2;
1736 pub const PROCESSOR_PM_REGS_INFO: ::c_int = 0x10000001;
1737 pub const PROCESSOR_TEMPERATURE: ::c_int = 0x10000002;
1738 pub const PROCESSOR_SET_LOAD_INFO: ::c_int = 4;
1739 pub const PROCESSOR_SET_BASIC_INFO: ::c_int = 5;
1740 
1741 deprecated_mach! {
1742     pub const VM_FLAGS_FIXED: ::c_int = 0x0000;
1743     pub const VM_FLAGS_ANYWHERE: ::c_int = 0x0001;
1744     pub const VM_FLAGS_PURGABLE: ::c_int = 0x0002;
1745     pub const VM_FLAGS_RANDOM_ADDR: ::c_int = 0x0008;
1746     pub const VM_FLAGS_NO_CACHE: ::c_int = 0x0010;
1747     pub const VM_FLAGS_RESILIENT_CODESIGN: ::c_int = 0x0020;
1748     pub const VM_FLAGS_RESILIENT_MEDIA: ::c_int = 0x0040;
1749     pub const VM_FLAGS_OVERWRITE: ::c_int = 0x4000;
1750     pub const VM_FLAGS_SUPERPAGE_MASK: ::c_int = 0x70000;
1751     pub const VM_FLAGS_RETURN_DATA_ADDR: ::c_int = 0x100000;
1752     pub const VM_FLAGS_RETURN_4K_DATA_ADDR: ::c_int = 0x800000;
1753     pub const VM_FLAGS_ALIAS_MASK: ::c_int = 0xFF000000;
1754     pub const VM_FLAGS_USER_ALLOCATE: ::c_int = 0xff07401f;
1755     pub const VM_FLAGS_USER_MAP: ::c_int = 0xff97401f;
1756     pub const VM_FLAGS_USER_REMAP: ::c_int = VM_FLAGS_FIXED |
1757                                              VM_FLAGS_ANYWHERE |
1758                                              VM_FLAGS_RANDOM_ADDR |
1759                                              VM_FLAGS_OVERWRITE |
1760                                              VM_FLAGS_RETURN_DATA_ADDR |
1761                                              VM_FLAGS_RESILIENT_CODESIGN;
1762 
1763     pub const VM_FLAGS_SUPERPAGE_SHIFT: ::c_int = 16;
1764     pub const SUPERPAGE_NONE: ::c_int = 0;
1765     pub const SUPERPAGE_SIZE_ANY: ::c_int = 1;
1766     pub const VM_FLAGS_SUPERPAGE_NONE: ::c_int = SUPERPAGE_NONE <<
1767                                                  VM_FLAGS_SUPERPAGE_SHIFT;
1768     pub const VM_FLAGS_SUPERPAGE_SIZE_ANY: ::c_int = SUPERPAGE_SIZE_ANY <<
1769                                                      VM_FLAGS_SUPERPAGE_SHIFT;
1770     pub const SUPERPAGE_SIZE_2MB: ::c_int = 2;
1771     pub const VM_FLAGS_SUPERPAGE_SIZE_2MB: ::c_int = SUPERPAGE_SIZE_2MB <<
1772                                                      VM_FLAGS_SUPERPAGE_SHIFT;
1773 
1774     pub const VM_MEMORY_MALLOC: ::c_int = 1;
1775     pub const VM_MEMORY_MALLOC_SMALL: ::c_int = 2;
1776     pub const VM_MEMORY_MALLOC_LARGE: ::c_int = 3;
1777     pub const VM_MEMORY_MALLOC_HUGE: ::c_int = 4;
1778     pub const VM_MEMORY_SBRK: ::c_int = 5;
1779     pub const VM_MEMORY_REALLOC: ::c_int = 6;
1780     pub const VM_MEMORY_MALLOC_TINY: ::c_int = 7;
1781     pub const VM_MEMORY_MALLOC_LARGE_REUSABLE: ::c_int = 8;
1782     pub const VM_MEMORY_MALLOC_LARGE_REUSED: ::c_int = 9;
1783     pub const VM_MEMORY_ANALYSIS_TOOL: ::c_int = 10;
1784     pub const VM_MEMORY_MALLOC_NANO: ::c_int = 11;
1785     pub const VM_MEMORY_MACH_MSG: ::c_int = 20;
1786     pub const VM_MEMORY_IOKIT: ::c_int = 21;
1787     pub const VM_MEMORY_STACK: ::c_int = 30;
1788     pub const VM_MEMORY_GUARD: ::c_int = 31;
1789     pub const VM_MEMORY_SHARED_PMAP: ::c_int = 32;
1790     pub const VM_MEMORY_DYLIB: ::c_int = 33;
1791     pub const VM_MEMORY_OBJC_DISPATCHERS: ::c_int = 34;
1792     pub const VM_MEMORY_UNSHARED_PMAP: ::c_int = 35;
1793     pub const VM_MEMORY_APPKIT: ::c_int = 40;
1794     pub const VM_MEMORY_FOUNDATION: ::c_int = 41;
1795     pub const VM_MEMORY_COREGRAPHICS: ::c_int = 42;
1796     pub const VM_MEMORY_CORESERVICES: ::c_int = 43;
1797     pub const VM_MEMORY_CARBON: ::c_int = VM_MEMORY_CORESERVICES;
1798     pub const VM_MEMORY_JAVA: ::c_int = 44;
1799     pub const VM_MEMORY_COREDATA: ::c_int = 45;
1800     pub const VM_MEMORY_COREDATA_OBJECTIDS: ::c_int = 46;
1801     pub const VM_MEMORY_ATS: ::c_int = 50;
1802     pub const VM_MEMORY_LAYERKIT: ::c_int = 51;
1803     pub const VM_MEMORY_CGIMAGE: ::c_int = 52;
1804     pub const VM_MEMORY_TCMALLOC: ::c_int = 53;
1805     pub const VM_MEMORY_COREGRAPHICS_DATA: ::c_int = 54;
1806     pub const VM_MEMORY_COREGRAPHICS_SHARED: ::c_int = 55;
1807     pub const VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS: ::c_int = 56;
1808     pub const VM_MEMORY_COREGRAPHICS_BACKINGSTORES: ::c_int = 57;
1809     pub const VM_MEMORY_COREGRAPHICS_XALLOC: ::c_int = 58;
1810     pub const VM_MEMORY_COREGRAPHICS_MISC: ::c_int = VM_MEMORY_COREGRAPHICS;
1811     pub const VM_MEMORY_DYLD: ::c_int = 60;
1812     pub const VM_MEMORY_DYLD_MALLOC: ::c_int = 61;
1813     pub const VM_MEMORY_SQLITE: ::c_int = 62;
1814     pub const VM_MEMORY_JAVASCRIPT_CORE: ::c_int = 63;
1815     pub const VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR: ::c_int = 64;
1816     pub const VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE: ::c_int = 65;
1817     pub const VM_MEMORY_GLSL: ::c_int = 66;
1818     pub const VM_MEMORY_OPENCL: ::c_int = 67;
1819     pub const VM_MEMORY_COREIMAGE: ::c_int = 68;
1820     pub const VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS: ::c_int = 69;
1821     pub const VM_MEMORY_IMAGEIO: ::c_int = 70;
1822     pub const VM_MEMORY_COREPROFILE: ::c_int = 71;
1823     pub const VM_MEMORY_ASSETSD: ::c_int = 72;
1824     pub const VM_MEMORY_OS_ALLOC_ONCE: ::c_int = 73;
1825     pub const VM_MEMORY_LIBDISPATCH: ::c_int = 74;
1826     pub const VM_MEMORY_ACCELERATE: ::c_int = 75;
1827     pub const VM_MEMORY_COREUI: ::c_int = 76;
1828     pub const VM_MEMORY_COREUIFILE: ::c_int = 77;
1829     pub const VM_MEMORY_GENEALOGY: ::c_int = 78;
1830     pub const VM_MEMORY_RAWCAMERA: ::c_int = 79;
1831     pub const VM_MEMORY_CORPSEINFO: ::c_int = 80;
1832     pub const VM_MEMORY_ASL: ::c_int = 81;
1833     pub const VM_MEMORY_SWIFT_RUNTIME: ::c_int = 82;
1834     pub const VM_MEMORY_SWIFT_METADATA: ::c_int = 83;
1835     pub const VM_MEMORY_DHMM: ::c_int = 84;
1836     pub const VM_MEMORY_SCENEKIT: ::c_int = 86;
1837     pub const VM_MEMORY_SKYWALK: ::c_int = 87;
1838     pub const VM_MEMORY_APPLICATION_SPECIFIC_1: ::c_int = 240;
1839     pub const VM_MEMORY_APPLICATION_SPECIFIC_16: ::c_int = 255;
1840 }
1841 
1842 pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
1843 
1844 pub const MCL_CURRENT: ::c_int = 0x0001;
1845 pub const MCL_FUTURE: ::c_int = 0x0002;
1846 
1847 pub const MS_ASYNC: ::c_int = 0x0001;
1848 pub const MS_INVALIDATE: ::c_int = 0x0002;
1849 pub const MS_SYNC: ::c_int = 0x0010;
1850 
1851 pub const MS_KILLPAGES: ::c_int = 0x0004;
1852 pub const MS_DEACTIVATE: ::c_int = 0x0008;
1853 
1854 pub const EPERM: ::c_int = 1;
1855 pub const ENOENT: ::c_int = 2;
1856 pub const ESRCH: ::c_int = 3;
1857 pub const EINTR: ::c_int = 4;
1858 pub const EIO: ::c_int = 5;
1859 pub const ENXIO: ::c_int = 6;
1860 pub const E2BIG: ::c_int = 7;
1861 pub const ENOEXEC: ::c_int = 8;
1862 pub const EBADF: ::c_int = 9;
1863 pub const ECHILD: ::c_int = 10;
1864 pub const EDEADLK: ::c_int = 11;
1865 pub const ENOMEM: ::c_int = 12;
1866 pub const EACCES: ::c_int = 13;
1867 pub const EFAULT: ::c_int = 14;
1868 pub const ENOTBLK: ::c_int = 15;
1869 pub const EBUSY: ::c_int = 16;
1870 pub const EEXIST: ::c_int = 17;
1871 pub const EXDEV: ::c_int = 18;
1872 pub const ENODEV: ::c_int = 19;
1873 pub const ENOTDIR: ::c_int = 20;
1874 pub const EISDIR: ::c_int = 21;
1875 pub const EINVAL: ::c_int = 22;
1876 pub const ENFILE: ::c_int = 23;
1877 pub const EMFILE: ::c_int = 24;
1878 pub const ENOTTY: ::c_int = 25;
1879 pub const ETXTBSY: ::c_int = 26;
1880 pub const EFBIG: ::c_int = 27;
1881 pub const ENOSPC: ::c_int = 28;
1882 pub const ESPIPE: ::c_int = 29;
1883 pub const EROFS: ::c_int = 30;
1884 pub const EMLINK: ::c_int = 31;
1885 pub const EPIPE: ::c_int = 32;
1886 pub const EDOM: ::c_int = 33;
1887 pub const ERANGE: ::c_int = 34;
1888 pub const EAGAIN: ::c_int = 35;
1889 pub const EWOULDBLOCK: ::c_int = EAGAIN;
1890 pub const EINPROGRESS: ::c_int = 36;
1891 pub const EALREADY: ::c_int = 37;
1892 pub const ENOTSOCK: ::c_int = 38;
1893 pub const EDESTADDRREQ: ::c_int = 39;
1894 pub const EMSGSIZE: ::c_int = 40;
1895 pub const EPROTOTYPE: ::c_int = 41;
1896 pub const ENOPROTOOPT: ::c_int = 42;
1897 pub const EPROTONOSUPPORT: ::c_int = 43;
1898 pub const ESOCKTNOSUPPORT: ::c_int = 44;
1899 pub const ENOTSUP: ::c_int = 45;
1900 pub const EPFNOSUPPORT: ::c_int = 46;
1901 pub const EAFNOSUPPORT: ::c_int = 47;
1902 pub const EADDRINUSE: ::c_int = 48;
1903 pub const EADDRNOTAVAIL: ::c_int = 49;
1904 pub const ENETDOWN: ::c_int = 50;
1905 pub const ENETUNREACH: ::c_int = 51;
1906 pub const ENETRESET: ::c_int = 52;
1907 pub const ECONNABORTED: ::c_int = 53;
1908 pub const ECONNRESET: ::c_int = 54;
1909 pub const ENOBUFS: ::c_int = 55;
1910 pub const EISCONN: ::c_int = 56;
1911 pub const ENOTCONN: ::c_int = 57;
1912 pub const ESHUTDOWN: ::c_int = 58;
1913 pub const ETOOMANYREFS: ::c_int = 59;
1914 pub const ETIMEDOUT: ::c_int = 60;
1915 pub const ECONNREFUSED: ::c_int = 61;
1916 pub const ELOOP: ::c_int = 62;
1917 pub const ENAMETOOLONG: ::c_int = 63;
1918 pub const EHOSTDOWN: ::c_int = 64;
1919 pub const EHOSTUNREACH: ::c_int = 65;
1920 pub const ENOTEMPTY: ::c_int = 66;
1921 pub const EPROCLIM: ::c_int = 67;
1922 pub const EUSERS: ::c_int = 68;
1923 pub const EDQUOT: ::c_int = 69;
1924 pub const ESTALE: ::c_int = 70;
1925 pub const EREMOTE: ::c_int = 71;
1926 pub const EBADRPC: ::c_int = 72;
1927 pub const ERPCMISMATCH: ::c_int = 73;
1928 pub const EPROGUNAVAIL: ::c_int = 74;
1929 pub const EPROGMISMATCH: ::c_int = 75;
1930 pub const EPROCUNAVAIL: ::c_int = 76;
1931 pub const ENOLCK: ::c_int = 77;
1932 pub const ENOSYS: ::c_int = 78;
1933 pub const EFTYPE: ::c_int = 79;
1934 pub const EAUTH: ::c_int = 80;
1935 pub const ENEEDAUTH: ::c_int = 81;
1936 pub const EPWROFF: ::c_int = 82;
1937 pub const EDEVERR: ::c_int = 83;
1938 pub const EOVERFLOW: ::c_int = 84;
1939 pub const EBADEXEC: ::c_int = 85;
1940 pub const EBADARCH: ::c_int = 86;
1941 pub const ESHLIBVERS: ::c_int = 87;
1942 pub const EBADMACHO: ::c_int = 88;
1943 pub const ECANCELED: ::c_int = 89;
1944 pub const EIDRM: ::c_int = 90;
1945 pub const ENOMSG: ::c_int = 91;
1946 pub const EILSEQ: ::c_int = 92;
1947 pub const ENOATTR: ::c_int = 93;
1948 pub const EBADMSG: ::c_int = 94;
1949 pub const EMULTIHOP: ::c_int = 95;
1950 pub const ENODATA: ::c_int = 96;
1951 pub const ENOLINK: ::c_int = 97;
1952 pub const ENOSR: ::c_int = 98;
1953 pub const ENOSTR: ::c_int = 99;
1954 pub const EPROTO: ::c_int = 100;
1955 pub const ETIME: ::c_int = 101;
1956 pub const EOPNOTSUPP: ::c_int = 102;
1957 pub const ENOPOLICY: ::c_int = 103;
1958 pub const ENOTRECOVERABLE: ::c_int = 104;
1959 pub const EOWNERDEAD: ::c_int = 105;
1960 pub const EQFULL: ::c_int = 106;
1961 pub const ELAST: ::c_int = 106;
1962 
1963 pub const EAI_AGAIN: ::c_int = 2;
1964 pub const EAI_BADFLAGS: ::c_int = 3;
1965 pub const EAI_FAIL: ::c_int = 4;
1966 pub const EAI_FAMILY: ::c_int = 5;
1967 pub const EAI_MEMORY: ::c_int = 6;
1968 pub const EAI_NODATA: ::c_int = 7;
1969 pub const EAI_NONAME: ::c_int = 8;
1970 pub const EAI_SERVICE: ::c_int = 9;
1971 pub const EAI_SOCKTYPE: ::c_int = 10;
1972 pub const EAI_SYSTEM: ::c_int = 11;
1973 pub const EAI_OVERFLOW: ::c_int = 14;
1974 
1975 pub const F_DUPFD: ::c_int = 0;
1976 pub const F_DUPFD_CLOEXEC: ::c_int = 67;
1977 pub const F_GETFD: ::c_int = 1;
1978 pub const F_SETFD: ::c_int = 2;
1979 pub const F_GETFL: ::c_int = 3;
1980 pub const F_SETFL: ::c_int = 4;
1981 pub const F_PREALLOCATE: ::c_int = 42;
1982 pub const F_RDADVISE: ::c_int = 44;
1983 pub const F_RDAHEAD: ::c_int = 45;
1984 pub const F_NOCACHE: ::c_int = 48;
1985 pub const F_GETPATH: ::c_int = 50;
1986 pub const F_FULLFSYNC: ::c_int = 51;
1987 pub const F_FREEZE_FS: ::c_int = 53;
1988 pub const F_THAW_FS: ::c_int = 54;
1989 pub const F_GLOBAL_NOCACHE: ::c_int = 55;
1990 pub const F_NODIRECT: ::c_int = 62;
1991 
1992 pub const F_ALLOCATECONTIG: ::c_uint = 0x02;
1993 pub const F_ALLOCATEALL: ::c_uint = 0x04;
1994 
1995 pub const F_PEOFPOSMODE: ::c_int = 3;
1996 pub const F_VOLPOSMODE: ::c_int = 4;
1997 
1998 pub const AT_FDCWD: ::c_int = -2;
1999 pub const AT_EACCESS: ::c_int = 0x0010;
2000 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x0020;
2001 pub const AT_SYMLINK_FOLLOW: ::c_int = 0x0040;
2002 pub const AT_REMOVEDIR: ::c_int = 0x0080;
2003 
2004 pub const TIOCMODG: ::c_ulong = 0x40047403;
2005 pub const TIOCMODS: ::c_ulong = 0x80047404;
2006 pub const TIOCM_LE: ::c_int = 0x1;
2007 pub const TIOCM_DTR: ::c_int = 0x2;
2008 pub const TIOCM_RTS: ::c_int = 0x4;
2009 pub const TIOCM_ST: ::c_int = 0x8;
2010 pub const TIOCM_SR: ::c_int = 0x10;
2011 pub const TIOCM_CTS: ::c_int = 0x20;
2012 pub const TIOCM_CAR: ::c_int = 0x40;
2013 pub const TIOCM_CD: ::c_int = 0x40;
2014 pub const TIOCM_RNG: ::c_int = 0x80;
2015 pub const TIOCM_RI: ::c_int = 0x80;
2016 pub const TIOCM_DSR: ::c_int = 0x100;
2017 pub const TIOCEXCL: ::c_int = 0x2000740d;
2018 pub const TIOCNXCL: ::c_int = 0x2000740e;
2019 pub const TIOCFLUSH: ::c_ulong = 0x80047410;
2020 pub const TIOCGETD: ::c_ulong = 0x4004741a;
2021 pub const TIOCSETD: ::c_ulong = 0x8004741b;
2022 pub const TIOCIXON: ::c_uint = 0x20007481;
2023 pub const TIOCIXOFF: ::c_uint = 0x20007480;
2024 pub const TIOCSDTR: ::c_uint = 0x20007479;
2025 pub const TIOCCDTR: ::c_uint = 0x20007478;
2026 pub const TIOCGPGRP: ::c_ulong = 0x40047477;
2027 pub const TIOCSPGRP: ::c_ulong = 0x80047476;
2028 pub const TIOCOUTQ: ::c_ulong = 0x40047473;
2029 pub const TIOCSTI: ::c_ulong = 0x80017472;
2030 pub const TIOCNOTTY: ::c_uint = 0x20007471;
2031 pub const TIOCPKT: ::c_ulong = 0x80047470;
2032 pub const TIOCPKT_DATA: ::c_int = 0x0;
2033 pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1;
2034 pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x2;
2035 pub const TIOCPKT_STOP: ::c_int = 0x4;
2036 pub const TIOCPKT_START: ::c_int = 0x8;
2037 pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
2038 pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
2039 pub const TIOCPKT_IOCTL: ::c_int = 0x40;
2040 pub const TIOCSTOP: ::c_uint = 0x2000746f;
2041 pub const TIOCSTART: ::c_uint = 0x2000746e;
2042 pub const TIOCMSET: ::c_ulong = 0x8004746d;
2043 pub const TIOCMBIS: ::c_ulong = 0x8004746c;
2044 pub const TIOCMBIC: ::c_ulong = 0x8004746b;
2045 pub const TIOCMGET: ::c_ulong = 0x4004746a;
2046 pub const TIOCREMOTE: ::c_ulong = 0x80047469;
2047 pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
2048 pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
2049 pub const TIOCUCNTL: ::c_ulong = 0x80047466;
2050 pub const TIOCSTAT: ::c_uint = 0x20007465;
2051 pub const TIOCSCONS: ::c_uint = 0x20007463;
2052 pub const TIOCCONS: ::c_ulong = 0x80047462;
2053 pub const TIOCSCTTY: ::c_uint = 0x20007461;
2054 pub const TIOCEXT: ::c_ulong = 0x80047460;
2055 pub const TIOCSIG: ::c_uint = 0x2000745f;
2056 pub const TIOCDRAIN: ::c_uint = 0x2000745e;
2057 pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b;
2058 pub const TIOCMGDTRWAIT: ::c_ulong = 0x4004745a;
2059 pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457;
2060 pub const TIOCGDRAINWAIT: ::c_ulong = 0x40047456;
2061 pub const TIOCDSIMICROCODE: ::c_uint = 0x20007455;
2062 pub const TIOCPTYGRANT: ::c_uint = 0x20007454;
2063 pub const TIOCPTYGNAME: ::c_uint = 0x40807453;
2064 pub const TIOCPTYUNLK: ::c_uint = 0x20007452;
2065 
2066 pub const BIOCGRSIG: ::c_ulong = 0x40044272;
2067 pub const BIOCSRSIG: ::c_ulong = 0x80044273;
2068 pub const BIOCSDLT: ::c_ulong = 0x80044278;
2069 pub const BIOCGSEESENT: ::c_ulong = 0x40044276;
2070 pub const BIOCSSEESENT: ::c_ulong = 0x80044277;
2071 pub const BIOCGDLTLIST: ::c_ulong = 0xc00c4279;
2072 
2073 pub const FIODTYPE: ::c_ulong = 0x4004667a;
2074 
2075 pub const B0: speed_t = 0;
2076 pub const B50: speed_t = 50;
2077 pub const B75: speed_t = 75;
2078 pub const B110: speed_t = 110;
2079 pub const B134: speed_t = 134;
2080 pub const B150: speed_t = 150;
2081 pub const B200: speed_t = 200;
2082 pub const B300: speed_t = 300;
2083 pub const B600: speed_t = 600;
2084 pub const B1200: speed_t = 1200;
2085 pub const B1800: speed_t = 1800;
2086 pub const B2400: speed_t = 2400;
2087 pub const B4800: speed_t = 4800;
2088 pub const B9600: speed_t = 9600;
2089 pub const B19200: speed_t = 19200;
2090 pub const B38400: speed_t = 38400;
2091 pub const B7200: speed_t = 7200;
2092 pub const B14400: speed_t = 14400;
2093 pub const B28800: speed_t = 28800;
2094 pub const B57600: speed_t = 57600;
2095 pub const B76800: speed_t = 76800;
2096 pub const B115200: speed_t = 115200;
2097 pub const B230400: speed_t = 230400;
2098 pub const EXTA: speed_t = 19200;
2099 pub const EXTB: speed_t = 38400;
2100 
2101 pub const SIGTRAP: ::c_int = 5;
2102 
2103 pub const GLOB_APPEND: ::c_int = 0x0001;
2104 pub const GLOB_DOOFFS: ::c_int = 0x0002;
2105 pub const GLOB_ERR: ::c_int = 0x0004;
2106 pub const GLOB_MARK: ::c_int = 0x0008;
2107 pub const GLOB_NOCHECK: ::c_int = 0x0010;
2108 pub const GLOB_NOSORT: ::c_int = 0x0020;
2109 pub const GLOB_NOESCAPE: ::c_int = 0x2000;
2110 
2111 pub const GLOB_NOSPACE: ::c_int = -1;
2112 pub const GLOB_ABORTED: ::c_int = -2;
2113 pub const GLOB_NOMATCH: ::c_int = -3;
2114 
2115 pub const POSIX_MADV_NORMAL: ::c_int = 0;
2116 pub const POSIX_MADV_RANDOM: ::c_int = 1;
2117 pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
2118 pub const POSIX_MADV_WILLNEED: ::c_int = 3;
2119 pub const POSIX_MADV_DONTNEED: ::c_int = 4;
2120 
2121 pub const _SC_IOV_MAX: ::c_int = 56;
2122 pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 70;
2123 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 71;
2124 pub const _SC_LOGIN_NAME_MAX: ::c_int = 73;
2125 pub const _SC_MQ_PRIO_MAX: ::c_int = 75;
2126 pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 82;
2127 pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 83;
2128 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 85;
2129 pub const _SC_THREAD_KEYS_MAX: ::c_int = 86;
2130 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 87;
2131 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 88;
2132 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 89;
2133 pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 90;
2134 pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 91;
2135 pub const _SC_THREAD_STACK_MIN: ::c_int = 93;
2136 pub const _SC_THREAD_THREADS_MAX: ::c_int = 94;
2137 pub const _SC_THREADS: ::c_int = 96;
2138 pub const _SC_TTY_NAME_MAX: ::c_int = 101;
2139 pub const _SC_ATEXIT_MAX: ::c_int = 107;
2140 pub const _SC_XOPEN_CRYPT: ::c_int = 108;
2141 pub const _SC_XOPEN_ENH_I18N: ::c_int = 109;
2142 pub const _SC_XOPEN_LEGACY: ::c_int = 110;
2143 pub const _SC_XOPEN_REALTIME: ::c_int = 111;
2144 pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 112;
2145 pub const _SC_XOPEN_SHM: ::c_int = 113;
2146 pub const _SC_XOPEN_UNIX: ::c_int = 115;
2147 pub const _SC_XOPEN_VERSION: ::c_int = 116;
2148 pub const _SC_XOPEN_XCU_VERSION: ::c_int = 121;
2149 pub const _SC_PHYS_PAGES: ::c_int = 200;
2150 
2151 pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 2;
2152 pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
2153 pub const PTHREAD_CREATE_JOINABLE: ::c_int = 1;
2154 pub const PTHREAD_CREATE_DETACHED: ::c_int = 2;
2155 #[cfg(target_arch = "aarch64")]
2156 pub const PTHREAD_STACK_MIN: ::size_t = 16384;
2157 #[cfg(not(target_arch = "aarch64"))]
2158 pub const PTHREAD_STACK_MIN: ::size_t = 8192;
2159 
2160 pub const RLIMIT_CPU: ::c_int = 0;
2161 pub const RLIMIT_FSIZE: ::c_int = 1;
2162 pub const RLIMIT_DATA: ::c_int = 2;
2163 pub const RLIMIT_STACK: ::c_int = 3;
2164 pub const RLIMIT_CORE: ::c_int = 4;
2165 pub const RLIMIT_AS: ::c_int = 5;
2166 pub const RLIMIT_RSS: ::c_int = RLIMIT_AS;
2167 pub const RLIMIT_MEMLOCK: ::c_int = 6;
2168 pub const RLIMIT_NPROC: ::c_int = 7;
2169 pub const RLIMIT_NOFILE: ::c_int = 8;
2170 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
2171 pub const RLIM_NLIMITS: ::c_int = 9;
2172 pub const _RLIMIT_POSIX_FLAG: ::c_int = 0x1000;
2173 
2174 pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
2175 
2176 pub const RUSAGE_SELF: ::c_int = 0;
2177 pub const RUSAGE_CHILDREN: ::c_int = -1;
2178 
2179 pub const MADV_NORMAL: ::c_int = 0;
2180 pub const MADV_RANDOM: ::c_int = 1;
2181 pub const MADV_SEQUENTIAL: ::c_int = 2;
2182 pub const MADV_WILLNEED: ::c_int = 3;
2183 pub const MADV_DONTNEED: ::c_int = 4;
2184 pub const MADV_FREE: ::c_int = 5;
2185 pub const MADV_ZERO_WIRED_PAGES: ::c_int = 6;
2186 pub const MADV_FREE_REUSABLE: ::c_int = 7;
2187 pub const MADV_FREE_REUSE: ::c_int = 8;
2188 pub const MADV_CAN_REUSE: ::c_int = 9;
2189 
2190 pub const MINCORE_INCORE: ::c_int = 0x1;
2191 pub const MINCORE_REFERENCED: ::c_int = 0x2;
2192 pub const MINCORE_MODIFIED: ::c_int = 0x4;
2193 pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8;
2194 pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10;
2195 
2196 //
2197 // sys/netinet/in.h
2198 // Protocols (RFC 1700)
2199 // NOTE: These are in addition to the constants defined in src/unix/mod.rs
2200 
2201 // IPPROTO_IP defined in src/unix/mod.rs
2202 /// IP6 hop-by-hop options
2203 pub const IPPROTO_HOPOPTS: ::c_int = 0;
2204 // IPPROTO_ICMP defined in src/unix/mod.rs
2205 /// group mgmt protocol
2206 pub const IPPROTO_IGMP: ::c_int = 2;
2207 /// gateway<sup>2</sup> (deprecated)
2208 pub const IPPROTO_GGP: ::c_int = 3;
2209 /// for compatibility
2210 pub const IPPROTO_IPIP: ::c_int = 4;
2211 // IPPROTO_TCP defined in src/unix/mod.rs
2212 /// Stream protocol II.
2213 pub const IPPROTO_ST: ::c_int = 7;
2214 /// exterior gateway protocol
2215 pub const IPPROTO_EGP: ::c_int = 8;
2216 /// private interior gateway
2217 pub const IPPROTO_PIGP: ::c_int = 9;
2218 /// BBN RCC Monitoring
2219 pub const IPPROTO_RCCMON: ::c_int = 10;
2220 /// network voice protocol
2221 pub const IPPROTO_NVPII: ::c_int = 11;
2222 /// pup
2223 pub const IPPROTO_PUP: ::c_int = 12;
2224 /// Argus
2225 pub const IPPROTO_ARGUS: ::c_int = 13;
2226 /// EMCON
2227 pub const IPPROTO_EMCON: ::c_int = 14;
2228 /// Cross Net Debugger
2229 pub const IPPROTO_XNET: ::c_int = 15;
2230 /// Chaos
2231 pub const IPPROTO_CHAOS: ::c_int = 16;
2232 // IPPROTO_UDP defined in src/unix/mod.rs
2233 /// Multiplexing
2234 pub const IPPROTO_MUX: ::c_int = 18;
2235 /// DCN Measurement Subsystems
2236 pub const IPPROTO_MEAS: ::c_int = 19;
2237 /// Host Monitoring
2238 pub const IPPROTO_HMP: ::c_int = 20;
2239 /// Packet Radio Measurement
2240 pub const IPPROTO_PRM: ::c_int = 21;
2241 /// xns idp
2242 pub const IPPROTO_IDP: ::c_int = 22;
2243 /// Trunk-1
2244 pub const IPPROTO_TRUNK1: ::c_int = 23;
2245 /// Trunk-2
2246 pub const IPPROTO_TRUNK2: ::c_int = 24;
2247 /// Leaf-1
2248 pub const IPPROTO_LEAF1: ::c_int = 25;
2249 /// Leaf-2
2250 pub const IPPROTO_LEAF2: ::c_int = 26;
2251 /// Reliable Data
2252 pub const IPPROTO_RDP: ::c_int = 27;
2253 /// Reliable Transaction
2254 pub const IPPROTO_IRTP: ::c_int = 28;
2255 /// tp-4 w/ class negotiation
2256 pub const IPPROTO_TP: ::c_int = 29;
2257 /// Bulk Data Transfer
2258 pub const IPPROTO_BLT: ::c_int = 30;
2259 /// Network Services
2260 pub const IPPROTO_NSP: ::c_int = 31;
2261 /// Merit Internodal
2262 pub const IPPROTO_INP: ::c_int = 32;
2263 /// Sequential Exchange
2264 pub const IPPROTO_SEP: ::c_int = 33;
2265 /// Third Party Connect
2266 pub const IPPROTO_3PC: ::c_int = 34;
2267 /// InterDomain Policy Routing
2268 pub const IPPROTO_IDPR: ::c_int = 35;
2269 /// XTP
2270 pub const IPPROTO_XTP: ::c_int = 36;
2271 /// Datagram Delivery
2272 pub const IPPROTO_DDP: ::c_int = 37;
2273 /// Control Message Transport
2274 pub const IPPROTO_CMTP: ::c_int = 38;
2275 /// TP++ Transport
2276 pub const IPPROTO_TPXX: ::c_int = 39;
2277 /// IL transport protocol
2278 pub const IPPROTO_IL: ::c_int = 40;
2279 // IPPROTO_IPV6 defined in src/unix/mod.rs
2280 /// Source Demand Routing
2281 pub const IPPROTO_SDRP: ::c_int = 42;
2282 /// IP6 routing header
2283 pub const IPPROTO_ROUTING: ::c_int = 43;
2284 /// IP6 fragmentation header
2285 pub const IPPROTO_FRAGMENT: ::c_int = 44;
2286 /// InterDomain Routing
2287 pub const IPPROTO_IDRP: ::c_int = 45;
2288 /// resource reservation
2289 pub const IPPROTO_RSVP: ::c_int = 46;
2290 /// General Routing Encap.
2291 pub const IPPROTO_GRE: ::c_int = 47;
2292 /// Mobile Host Routing
2293 pub const IPPROTO_MHRP: ::c_int = 48;
2294 /// BHA
2295 pub const IPPROTO_BHA: ::c_int = 49;
2296 /// IP6 Encap Sec. Payload
2297 pub const IPPROTO_ESP: ::c_int = 50;
2298 /// IP6 Auth Header
2299 pub const IPPROTO_AH: ::c_int = 51;
2300 /// Integ. Net Layer Security
2301 pub const IPPROTO_INLSP: ::c_int = 52;
2302 /// IP with encryption
2303 pub const IPPROTO_SWIPE: ::c_int = 53;
2304 /// Next Hop Resolution
2305 pub const IPPROTO_NHRP: ::c_int = 54;
2306 /* 55-57: Unassigned */
2307 // IPPROTO_ICMPV6 defined in src/unix/mod.rs
2308 /// IP6 no next header
2309 pub const IPPROTO_NONE: ::c_int = 59;
2310 /// IP6 destination option
2311 pub const IPPROTO_DSTOPTS: ::c_int = 60;
2312 /// any host internal protocol
2313 pub const IPPROTO_AHIP: ::c_int = 61;
2314 /// CFTP
2315 pub const IPPROTO_CFTP: ::c_int = 62;
2316 /// "hello" routing protocol
2317 pub const IPPROTO_HELLO: ::c_int = 63;
2318 /// SATNET/Backroom EXPAK
2319 pub const IPPROTO_SATEXPAK: ::c_int = 64;
2320 /// Kryptolan
2321 pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
2322 /// Remote Virtual Disk
2323 pub const IPPROTO_RVD: ::c_int = 66;
2324 /// Pluribus Packet Core
2325 pub const IPPROTO_IPPC: ::c_int = 67;
2326 /// Any distributed FS
2327 pub const IPPROTO_ADFS: ::c_int = 68;
2328 /// Satnet Monitoring
2329 pub const IPPROTO_SATMON: ::c_int = 69;
2330 /// VISA Protocol
2331 pub const IPPROTO_VISA: ::c_int = 70;
2332 /// Packet Core Utility
2333 pub const IPPROTO_IPCV: ::c_int = 71;
2334 /// Comp. Prot. Net. Executive
2335 pub const IPPROTO_CPNX: ::c_int = 72;
2336 /// Comp. Prot. HeartBeat
2337 pub const IPPROTO_CPHB: ::c_int = 73;
2338 /// Wang Span Network
2339 pub const IPPROTO_WSN: ::c_int = 74;
2340 /// Packet Video Protocol
2341 pub const IPPROTO_PVP: ::c_int = 75;
2342 /// BackRoom SATNET Monitoring
2343 pub const IPPROTO_BRSATMON: ::c_int = 76;
2344 /// Sun net disk proto (temp.)
2345 pub const IPPROTO_ND: ::c_int = 77;
2346 /// WIDEBAND Monitoring
2347 pub const IPPROTO_WBMON: ::c_int = 78;
2348 /// WIDEBAND EXPAK
2349 pub const IPPROTO_WBEXPAK: ::c_int = 79;
2350 /// ISO cnlp
2351 pub const IPPROTO_EON: ::c_int = 80;
2352 /// VMTP
2353 pub const IPPROTO_VMTP: ::c_int = 81;
2354 /// Secure VMTP
2355 pub const IPPROTO_SVMTP: ::c_int = 82;
2356 /// Banyon VINES
2357 pub const IPPROTO_VINES: ::c_int = 83;
2358 /// TTP
2359 pub const IPPROTO_TTP: ::c_int = 84;
2360 /// NSFNET-IGP
2361 pub const IPPROTO_IGP: ::c_int = 85;
2362 /// dissimilar gateway prot.
2363 pub const IPPROTO_DGP: ::c_int = 86;
2364 /// TCF
2365 pub const IPPROTO_TCF: ::c_int = 87;
2366 /// Cisco/GXS IGRP
2367 pub const IPPROTO_IGRP: ::c_int = 88;
2368 /// OSPFIGP
2369 pub const IPPROTO_OSPFIGP: ::c_int = 89;
2370 /// Strite RPC protocol
2371 pub const IPPROTO_SRPC: ::c_int = 90;
2372 /// Locus Address Resoloution
2373 pub const IPPROTO_LARP: ::c_int = 91;
2374 /// Multicast Transport
2375 pub const IPPROTO_MTP: ::c_int = 92;
2376 /// AX.25 Frames
2377 pub const IPPROTO_AX25: ::c_int = 93;
2378 /// IP encapsulated in IP
2379 pub const IPPROTO_IPEIP: ::c_int = 94;
2380 /// Mobile Int.ing control
2381 pub const IPPROTO_MICP: ::c_int = 95;
2382 /// Semaphore Comm. security
2383 pub const IPPROTO_SCCSP: ::c_int = 96;
2384 /// Ethernet IP encapsulation
2385 pub const IPPROTO_ETHERIP: ::c_int = 97;
2386 /// encapsulation header
2387 pub const IPPROTO_ENCAP: ::c_int = 98;
2388 /// any private encr. scheme
2389 pub const IPPROTO_APES: ::c_int = 99;
2390 /// GMTP
2391 pub const IPPROTO_GMTP: ::c_int = 100;
2392 
2393 /* 101-254: Partly Unassigned */
2394 /// Protocol Independent Mcast
2395 pub const IPPROTO_PIM: ::c_int = 103;
2396 /// payload compression (IPComp)
2397 pub const IPPROTO_IPCOMP: ::c_int = 108;
2398 /// PGM
2399 pub const IPPROTO_PGM: ::c_int = 113;
2400 /// SCTP
2401 pub const IPPROTO_SCTP: ::c_int = 132;
2402 
2403 /* 255: Reserved */
2404 /* BSD Private, local use, namespace incursion */
2405 /// divert pseudo-protocol
2406 pub const IPPROTO_DIVERT: ::c_int = 254;
2407 /// raw IP packet
2408 pub const IPPROTO_RAW: ::c_int = 255;
2409 pub const IPPROTO_MAX: ::c_int = 256;
2410 /// last return value of *_input(), meaning "all job for this pkt is done".
2411 pub const IPPROTO_DONE: ::c_int = 257;
2412 
2413 pub const AF_UNSPEC: ::c_int = 0;
2414 pub const AF_LOCAL: ::c_int = 1;
2415 pub const AF_UNIX: ::c_int = AF_LOCAL;
2416 pub const AF_INET: ::c_int = 2;
2417 pub const AF_IMPLINK: ::c_int = 3;
2418 pub const AF_PUP: ::c_int = 4;
2419 pub const AF_CHAOS: ::c_int = 5;
2420 pub const AF_NS: ::c_int = 6;
2421 pub const AF_ISO: ::c_int = 7;
2422 pub const AF_OSI: ::c_int = AF_ISO;
2423 pub const AF_ECMA: ::c_int = 8;
2424 pub const AF_DATAKIT: ::c_int = 9;
2425 pub const AF_CCITT: ::c_int = 10;
2426 pub const AF_SNA: ::c_int = 11;
2427 pub const AF_DECnet: ::c_int = 12;
2428 pub const AF_DLI: ::c_int = 13;
2429 pub const AF_LAT: ::c_int = 14;
2430 pub const AF_HYLINK: ::c_int = 15;
2431 pub const AF_APPLETALK: ::c_int = 16;
2432 pub const AF_ROUTE: ::c_int = 17;
2433 pub const AF_LINK: ::c_int = 18;
2434 pub const pseudo_AF_XTP: ::c_int = 19;
2435 pub const AF_COIP: ::c_int = 20;
2436 pub const AF_CNT: ::c_int = 21;
2437 pub const pseudo_AF_RTIP: ::c_int = 22;
2438 pub const AF_IPX: ::c_int = 23;
2439 pub const AF_SIP: ::c_int = 24;
2440 pub const pseudo_AF_PIP: ::c_int = 25;
2441 pub const AF_ISDN: ::c_int = 28;
2442 pub const AF_E164: ::c_int = AF_ISDN;
2443 pub const pseudo_AF_KEY: ::c_int = 29;
2444 pub const AF_INET6: ::c_int = 30;
2445 pub const AF_NATM: ::c_int = 31;
2446 pub const AF_SYSTEM: ::c_int = 32;
2447 pub const AF_NETBIOS: ::c_int = 33;
2448 pub const AF_PPP: ::c_int = 34;
2449 pub const pseudo_AF_HDRCMPLT: ::c_int = 35;
2450 pub const AF_SYS_CONTROL: ::c_int = 2;
2451 
2452 pub const SYSPROTO_EVENT: ::c_int = 1;
2453 pub const SYSPROTO_CONTROL: ::c_int = 2;
2454 
2455 pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
2456 pub const PF_LOCAL: ::c_int = AF_LOCAL;
2457 pub const PF_UNIX: ::c_int = PF_LOCAL;
2458 pub const PF_INET: ::c_int = AF_INET;
2459 pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
2460 pub const PF_PUP: ::c_int = AF_PUP;
2461 pub const PF_CHAOS: ::c_int = AF_CHAOS;
2462 pub const PF_NS: ::c_int = AF_NS;
2463 pub const PF_ISO: ::c_int = AF_ISO;
2464 pub const PF_OSI: ::c_int = AF_ISO;
2465 pub const PF_ECMA: ::c_int = AF_ECMA;
2466 pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
2467 pub const PF_CCITT: ::c_int = AF_CCITT;
2468 pub const PF_SNA: ::c_int = AF_SNA;
2469 pub const PF_DECnet: ::c_int = AF_DECnet;
2470 pub const PF_DLI: ::c_int = AF_DLI;
2471 pub const PF_LAT: ::c_int = AF_LAT;
2472 pub const PF_HYLINK: ::c_int = AF_HYLINK;
2473 pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
2474 pub const PF_ROUTE: ::c_int = AF_ROUTE;
2475 pub const PF_LINK: ::c_int = AF_LINK;
2476 pub const PF_XTP: ::c_int = pseudo_AF_XTP;
2477 pub const PF_COIP: ::c_int = AF_COIP;
2478 pub const PF_CNT: ::c_int = AF_CNT;
2479 pub const PF_SIP: ::c_int = AF_SIP;
2480 pub const PF_IPX: ::c_int = AF_IPX;
2481 pub const PF_RTIP: ::c_int = pseudo_AF_RTIP;
2482 pub const PF_PIP: ::c_int = pseudo_AF_PIP;
2483 pub const PF_ISDN: ::c_int = AF_ISDN;
2484 pub const PF_KEY: ::c_int = pseudo_AF_KEY;
2485 pub const PF_INET6: ::c_int = AF_INET6;
2486 pub const PF_NATM: ::c_int = AF_NATM;
2487 pub const PF_SYSTEM: ::c_int = AF_SYSTEM;
2488 pub const PF_NETBIOS: ::c_int = AF_NETBIOS;
2489 pub const PF_PPP: ::c_int = AF_PPP;
2490 
2491 pub const NET_RT_DUMP: ::c_int = 1;
2492 pub const NET_RT_FLAGS: ::c_int = 2;
2493 pub const NET_RT_IFLIST: ::c_int = 3;
2494 
2495 pub const SOMAXCONN: ::c_int = 128;
2496 
2497 pub const SOCK_MAXADDRLEN: ::c_int = 255;
2498 
2499 pub const SOCK_STREAM: ::c_int = 1;
2500 pub const SOCK_DGRAM: ::c_int = 2;
2501 pub const SOCK_RAW: ::c_int = 3;
2502 pub const SOCK_RDM: ::c_int = 4;
2503 pub const SOCK_SEQPACKET: ::c_int = 5;
2504 pub const IP_TTL: ::c_int = 4;
2505 pub const IP_HDRINCL: ::c_int = 2;
2506 pub const IP_RECVDSTADDR: ::c_int = 7;
2507 pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
2508 pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
2509 pub const IP_RECVIF: ::c_int = 20;
2510 pub const IP_BOUND_IF: ::c_int = 25;
2511 pub const IP_PKTINFO: ::c_int = 26;
2512 pub const IP_RECVTOS: ::c_int = 27;
2513 pub const IPV6_JOIN_GROUP: ::c_int = 12;
2514 pub const IPV6_LEAVE_GROUP: ::c_int = 13;
2515 pub const IPV6_CHECKSUM: ::c_int = 26;
2516 pub const IPV6_RECVTCLASS: ::c_int = 35;
2517 pub const IPV6_TCLASS: ::c_int = 36;
2518 pub const IPV6_PKTINFO: ::c_int = 46;
2519 pub const IPV6_HOPLIMIT: ::c_int = 47;
2520 pub const IPV6_RECVPKTINFO: ::c_int = 61;
2521 
2522 pub const TCP_NOPUSH: ::c_int = 4;
2523 pub const TCP_NOOPT: ::c_int = 8;
2524 pub const TCP_KEEPALIVE: ::c_int = 0x10;
2525 pub const TCP_KEEPINTVL: ::c_int = 0x101;
2526 pub const TCP_KEEPCNT: ::c_int = 0x102;
2527 /// Enable/Disable TCP Fastopen on this socket
2528 pub const TCP_FASTOPEN: ::c_int = 0x105;
2529 
2530 pub const SOL_LOCAL: ::c_int = 0;
2531 
2532 pub const LOCAL_PEERCRED: ::c_int = 0x001;
2533 pub const LOCAL_PEERPID: ::c_int = 0x002;
2534 pub const LOCAL_PEEREPID: ::c_int = 0x003;
2535 pub const LOCAL_PEERUUID: ::c_int = 0x004;
2536 pub const LOCAL_PEEREUUID: ::c_int = 0x005;
2537 
2538 pub const SOL_SOCKET: ::c_int = 0xffff;
2539 
2540 pub const SO_DEBUG: ::c_int = 0x01;
2541 pub const SO_ACCEPTCONN: ::c_int = 0x0002;
2542 pub const SO_REUSEADDR: ::c_int = 0x0004;
2543 pub const SO_KEEPALIVE: ::c_int = 0x0008;
2544 pub const SO_DONTROUTE: ::c_int = 0x0010;
2545 pub const SO_BROADCAST: ::c_int = 0x0020;
2546 pub const SO_USELOOPBACK: ::c_int = 0x0040;
2547 pub const SO_LINGER: ::c_int = 0x0080;
2548 pub const SO_OOBINLINE: ::c_int = 0x0100;
2549 pub const SO_REUSEPORT: ::c_int = 0x0200;
2550 pub const SO_TIMESTAMP: ::c_int = 0x0400;
2551 pub const SO_TIMESTAMP_MONOTONIC: ::c_int = 0x0800;
2552 pub const SO_DONTTRUNC: ::c_int = 0x2000;
2553 pub const SO_WANTMORE: ::c_int = 0x4000;
2554 pub const SO_WANTOOBFLAG: ::c_int = 0x8000;
2555 pub const SO_SNDBUF: ::c_int = 0x1001;
2556 pub const SO_RCVBUF: ::c_int = 0x1002;
2557 pub const SO_SNDLOWAT: ::c_int = 0x1003;
2558 pub const SO_RCVLOWAT: ::c_int = 0x1004;
2559 pub const SO_SNDTIMEO: ::c_int = 0x1005;
2560 pub const SO_RCVTIMEO: ::c_int = 0x1006;
2561 pub const SO_ERROR: ::c_int = 0x1007;
2562 pub const SO_TYPE: ::c_int = 0x1008;
2563 pub const SO_LABEL: ::c_int = 0x1010;
2564 pub const SO_PEERLABEL: ::c_int = 0x1011;
2565 pub const SO_NREAD: ::c_int = 0x1020;
2566 pub const SO_NKE: ::c_int = 0x1021;
2567 pub const SO_NOSIGPIPE: ::c_int = 0x1022;
2568 pub const SO_NOADDRERR: ::c_int = 0x1023;
2569 pub const SO_NWRITE: ::c_int = 0x1024;
2570 pub const SO_REUSESHAREUID: ::c_int = 0x1025;
2571 pub const SO_NOTIFYCONFLICT: ::c_int = 0x1026;
2572 pub const SO_LINGER_SEC: ::c_int = 0x1080;
2573 pub const SO_RANDOMPORT: ::c_int = 0x1082;
2574 pub const SO_NP_EXTENSIONS: ::c_int = 0x1083;
2575 
2576 pub const MSG_OOB: ::c_int = 0x1;
2577 pub const MSG_PEEK: ::c_int = 0x2;
2578 pub const MSG_DONTROUTE: ::c_int = 0x4;
2579 pub const MSG_EOR: ::c_int = 0x8;
2580 pub const MSG_TRUNC: ::c_int = 0x10;
2581 pub const MSG_CTRUNC: ::c_int = 0x20;
2582 pub const MSG_WAITALL: ::c_int = 0x40;
2583 pub const MSG_DONTWAIT: ::c_int = 0x80;
2584 pub const MSG_EOF: ::c_int = 0x100;
2585 pub const MSG_FLUSH: ::c_int = 0x400;
2586 pub const MSG_HOLD: ::c_int = 0x800;
2587 pub const MSG_SEND: ::c_int = 0x1000;
2588 pub const MSG_HAVEMORE: ::c_int = 0x2000;
2589 pub const MSG_RCVMORE: ::c_int = 0x4000;
2590 // pub const MSG_COMPAT: ::c_int = 0x8000;
2591 
2592 pub const SCM_TIMESTAMP: ::c_int = 0x02;
2593 pub const SCM_CREDS: ::c_int = 0x03;
2594 
2595 // https://github.com/aosm/xnu/blob/master/bsd/net/if.h#L140-L156
2596 pub const IFF_UP: ::c_int = 0x1; // interface is up
2597 pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
2598 pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
2599 pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
2600 pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
2601 pub const IFF_NOTRAILERS: ::c_int = 0x20; // obsolete: avoid use of trailers
2602 pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
2603 pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
2604 pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets
2605 pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets
2606 pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress
2607 pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions
2608 pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
2609 pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
2610 pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
2611 pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
2612 pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
2613 
2614 pub const SHUT_RD: ::c_int = 0;
2615 pub const SHUT_WR: ::c_int = 1;
2616 pub const SHUT_RDWR: ::c_int = 2;
2617 
2618 pub const SAE_ASSOCID_ANY: ::sae_associd_t = 0;
2619 /// ((sae_associd_t)(-1ULL))
2620 pub const SAE_ASSOCID_ALL: ::sae_associd_t = 0xffffffff;
2621 
2622 pub const SAE_CONNID_ANY: ::sae_connid_t = 0;
2623 /// ((sae_connid_t)(-1ULL))
2624 pub const SAE_CONNID_ALL: ::sae_connid_t = 0xffffffff;
2625 
2626 // connectx() flag parameters
2627 
2628 /// resume connect() on read/write
2629 pub const CONNECT_RESUME_ON_READ_WRITE: ::c_uint = 0x1;
2630 /// data is idempotent
2631 pub const CONNECT_DATA_IDEMPOTENT: ::c_uint = 0x2;
2632 /// data includes security that replaces the TFO-cookie
2633 pub const CONNECT_DATA_AUTHENTICATED: ::c_uint = 0x4;
2634 
2635 pub const LOCK_SH: ::c_int = 1;
2636 pub const LOCK_EX: ::c_int = 2;
2637 pub const LOCK_NB: ::c_int = 4;
2638 pub const LOCK_UN: ::c_int = 8;
2639 
2640 pub const MAP_COPY: ::c_int = 0x0002;
2641 pub const MAP_RENAME: ::c_int = 0x0020;
2642 pub const MAP_NORESERVE: ::c_int = 0x0040;
2643 pub const MAP_NOEXTEND: ::c_int = 0x0100;
2644 pub const MAP_HASSEMAPHORE: ::c_int = 0x0200;
2645 pub const MAP_NOCACHE: ::c_int = 0x0400;
2646 pub const MAP_JIT: ::c_int = 0x0800;
2647 
2648 pub const _SC_ARG_MAX: ::c_int = 1;
2649 pub const _SC_CHILD_MAX: ::c_int = 2;
2650 pub const _SC_CLK_TCK: ::c_int = 3;
2651 pub const _SC_NGROUPS_MAX: ::c_int = 4;
2652 pub const _SC_OPEN_MAX: ::c_int = 5;
2653 pub const _SC_JOB_CONTROL: ::c_int = 6;
2654 pub const _SC_SAVED_IDS: ::c_int = 7;
2655 pub const _SC_VERSION: ::c_int = 8;
2656 pub const _SC_BC_BASE_MAX: ::c_int = 9;
2657 pub const _SC_BC_DIM_MAX: ::c_int = 10;
2658 pub const _SC_BC_SCALE_MAX: ::c_int = 11;
2659 pub const _SC_BC_STRING_MAX: ::c_int = 12;
2660 pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13;
2661 pub const _SC_EXPR_NEST_MAX: ::c_int = 14;
2662 pub const _SC_LINE_MAX: ::c_int = 15;
2663 pub const _SC_RE_DUP_MAX: ::c_int = 16;
2664 pub const _SC_2_VERSION: ::c_int = 17;
2665 pub const _SC_2_C_BIND: ::c_int = 18;
2666 pub const _SC_2_C_DEV: ::c_int = 19;
2667 pub const _SC_2_CHAR_TERM: ::c_int = 20;
2668 pub const _SC_2_FORT_DEV: ::c_int = 21;
2669 pub const _SC_2_FORT_RUN: ::c_int = 22;
2670 pub const _SC_2_LOCALEDEF: ::c_int = 23;
2671 pub const _SC_2_SW_DEV: ::c_int = 24;
2672 pub const _SC_2_UPE: ::c_int = 25;
2673 pub const _SC_STREAM_MAX: ::c_int = 26;
2674 pub const _SC_TZNAME_MAX: ::c_int = 27;
2675 pub const _SC_ASYNCHRONOUS_IO: ::c_int = 28;
2676 pub const _SC_PAGESIZE: ::c_int = 29;
2677 pub const _SC_MEMLOCK: ::c_int = 30;
2678 pub const _SC_MEMLOCK_RANGE: ::c_int = 31;
2679 pub const _SC_MEMORY_PROTECTION: ::c_int = 32;
2680 pub const _SC_MESSAGE_PASSING: ::c_int = 33;
2681 pub const _SC_PRIORITIZED_IO: ::c_int = 34;
2682 pub const _SC_PRIORITY_SCHEDULING: ::c_int = 35;
2683 pub const _SC_REALTIME_SIGNALS: ::c_int = 36;
2684 pub const _SC_SEMAPHORES: ::c_int = 37;
2685 pub const _SC_FSYNC: ::c_int = 38;
2686 pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 39;
2687 pub const _SC_SYNCHRONIZED_IO: ::c_int = 40;
2688 pub const _SC_TIMERS: ::c_int = 41;
2689 pub const _SC_AIO_LISTIO_MAX: ::c_int = 42;
2690 pub const _SC_AIO_MAX: ::c_int = 43;
2691 pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44;
2692 pub const _SC_DELAYTIMER_MAX: ::c_int = 45;
2693 pub const _SC_MQ_OPEN_MAX: ::c_int = 46;
2694 pub const _SC_MAPPED_FILES: ::c_int = 47;
2695 pub const _SC_RTSIG_MAX: ::c_int = 48;
2696 pub const _SC_SEM_NSEMS_MAX: ::c_int = 49;
2697 pub const _SC_SEM_VALUE_MAX: ::c_int = 50;
2698 pub const _SC_SIGQUEUE_MAX: ::c_int = 51;
2699 pub const _SC_TIMER_MAX: ::c_int = 52;
2700 pub const _SC_NPROCESSORS_CONF: ::c_int = 57;
2701 pub const _SC_NPROCESSORS_ONLN: ::c_int = 58;
2702 pub const _SC_2_PBS: ::c_int = 59;
2703 pub const _SC_2_PBS_ACCOUNTING: ::c_int = 60;
2704 pub const _SC_2_PBS_CHECKPOINT: ::c_int = 61;
2705 pub const _SC_2_PBS_LOCATE: ::c_int = 62;
2706 pub const _SC_2_PBS_MESSAGE: ::c_int = 63;
2707 pub const _SC_2_PBS_TRACK: ::c_int = 64;
2708 pub const _SC_ADVISORY_INFO: ::c_int = 65;
2709 pub const _SC_BARRIERS: ::c_int = 66;
2710 pub const _SC_CLOCK_SELECTION: ::c_int = 67;
2711 pub const _SC_CPUTIME: ::c_int = 68;
2712 pub const _SC_FILE_LOCKING: ::c_int = 69;
2713 pub const _SC_HOST_NAME_MAX: ::c_int = 72;
2714 pub const _SC_MONOTONIC_CLOCK: ::c_int = 74;
2715 pub const _SC_READER_WRITER_LOCKS: ::c_int = 76;
2716 pub const _SC_REGEXP: ::c_int = 77;
2717 pub const _SC_SHELL: ::c_int = 78;
2718 pub const _SC_SPAWN: ::c_int = 79;
2719 pub const _SC_SPIN_LOCKS: ::c_int = 80;
2720 pub const _SC_SPORADIC_SERVER: ::c_int = 81;
2721 pub const _SC_THREAD_CPUTIME: ::c_int = 84;
2722 pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 92;
2723 pub const _SC_TIMEOUTS: ::c_int = 95;
2724 pub const _SC_TRACE: ::c_int = 97;
2725 pub const _SC_TRACE_EVENT_FILTER: ::c_int = 98;
2726 pub const _SC_TRACE_INHERIT: ::c_int = 99;
2727 pub const _SC_TRACE_LOG: ::c_int = 100;
2728 pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 102;
2729 pub const _SC_V6_ILP32_OFF32: ::c_int = 103;
2730 pub const _SC_V6_ILP32_OFFBIG: ::c_int = 104;
2731 pub const _SC_V6_LP64_OFF64: ::c_int = 105;
2732 pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 106;
2733 pub const _SC_IPV6: ::c_int = 118;
2734 pub const _SC_RAW_SOCKETS: ::c_int = 119;
2735 pub const _SC_SYMLOOP_MAX: ::c_int = 120;
2736 pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
2737 pub const _SC_XOPEN_STREAMS: ::c_int = 114;
2738 pub const _SC_XBS5_ILP32_OFF32: ::c_int = 122;
2739 pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 123;
2740 pub const _SC_XBS5_LP64_OFF64: ::c_int = 124;
2741 pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 125;
2742 pub const _SC_SS_REPL_MAX: ::c_int = 126;
2743 pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 127;
2744 pub const _SC_TRACE_NAME_MAX: ::c_int = 128;
2745 pub const _SC_TRACE_SYS_MAX: ::c_int = 129;
2746 pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 130;
2747 pub const _SC_PASS_MAX: ::c_int = 131;
2748 
2749 pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
2750 pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
2751 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
2752 pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
2753 pub const _PTHREAD_MUTEX_SIG_init: ::c_long = 0x32AAABA7;
2754 pub const _PTHREAD_COND_SIG_init: ::c_long = 0x3CB0B1BB;
2755 pub const _PTHREAD_RWLOCK_SIG_init: ::c_long = 0x2DA8B3B4;
2756 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
2757     __sig: _PTHREAD_MUTEX_SIG_init,
2758     __opaque: [0; __PTHREAD_MUTEX_SIZE__],
2759 };
2760 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
2761     __sig: _PTHREAD_COND_SIG_init,
2762     __opaque: [0; __PTHREAD_COND_SIZE__],
2763 };
2764 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
2765     __sig: _PTHREAD_RWLOCK_SIG_init,
2766     __opaque: [0; __PTHREAD_RWLOCK_SIZE__],
2767 };
2768 
2769 pub const MINSIGSTKSZ: ::size_t = 32768;
2770 pub const SIGSTKSZ: ::size_t = 131072;
2771 
2772 pub const FD_SETSIZE: usize = 1024;
2773 
2774 pub const ST_NOSUID: ::c_ulong = 2;
2775 
2776 pub const EVFILT_READ: i16 = -1;
2777 pub const EVFILT_WRITE: i16 = -2;
2778 pub const EVFILT_AIO: i16 = -3;
2779 pub const EVFILT_VNODE: i16 = -4;
2780 pub const EVFILT_PROC: i16 = -5;
2781 pub const EVFILT_SIGNAL: i16 = -6;
2782 pub const EVFILT_TIMER: i16 = -7;
2783 pub const EVFILT_MACHPORT: i16 = -8;
2784 pub const EVFILT_FS: i16 = -9;
2785 pub const EVFILT_USER: i16 = -10;
2786 pub const EVFILT_VM: i16 = -12;
2787 
2788 pub const EV_ADD: u16 = 0x1;
2789 pub const EV_DELETE: u16 = 0x2;
2790 pub const EV_ENABLE: u16 = 0x4;
2791 pub const EV_DISABLE: u16 = 0x8;
2792 pub const EV_ONESHOT: u16 = 0x10;
2793 pub const EV_CLEAR: u16 = 0x20;
2794 pub const EV_RECEIPT: u16 = 0x40;
2795 pub const EV_DISPATCH: u16 = 0x80;
2796 pub const EV_FLAG0: u16 = 0x1000;
2797 pub const EV_POLL: u16 = 0x1000;
2798 pub const EV_FLAG1: u16 = 0x2000;
2799 pub const EV_OOBAND: u16 = 0x2000;
2800 pub const EV_ERROR: u16 = 0x4000;
2801 pub const EV_EOF: u16 = 0x8000;
2802 pub const EV_SYSFLAGS: u16 = 0xf000;
2803 
2804 pub const NOTE_TRIGGER: u32 = 0x01000000;
2805 pub const NOTE_FFNOP: u32 = 0x00000000;
2806 pub const NOTE_FFAND: u32 = 0x40000000;
2807 pub const NOTE_FFOR: u32 = 0x80000000;
2808 pub const NOTE_FFCOPY: u32 = 0xc0000000;
2809 pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
2810 pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
2811 pub const NOTE_LOWAT: u32 = 0x00000001;
2812 pub const NOTE_DELETE: u32 = 0x00000001;
2813 pub const NOTE_WRITE: u32 = 0x00000002;
2814 pub const NOTE_EXTEND: u32 = 0x00000004;
2815 pub const NOTE_ATTRIB: u32 = 0x00000008;
2816 pub const NOTE_LINK: u32 = 0x00000010;
2817 pub const NOTE_RENAME: u32 = 0x00000020;
2818 pub const NOTE_REVOKE: u32 = 0x00000040;
2819 pub const NOTE_NONE: u32 = 0x00000080;
2820 pub const NOTE_EXIT: u32 = 0x80000000;
2821 pub const NOTE_FORK: u32 = 0x40000000;
2822 pub const NOTE_EXEC: u32 = 0x20000000;
2823 #[doc(hidden)]
2824 #[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")]
2825 pub const NOTE_REAP: u32 = 0x10000000;
2826 pub const NOTE_SIGNAL: u32 = 0x08000000;
2827 pub const NOTE_EXITSTATUS: u32 = 0x04000000;
2828 pub const NOTE_EXIT_DETAIL: u32 = 0x02000000;
2829 pub const NOTE_PDATAMASK: u32 = 0x000fffff;
2830 pub const NOTE_PCTRLMASK: u32 = 0xfff00000;
2831 #[doc(hidden)]
2832 #[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")]
2833 pub const NOTE_EXIT_REPARENTED: u32 = 0x00080000;
2834 pub const NOTE_EXIT_DETAIL_MASK: u32 = 0x00070000;
2835 pub const NOTE_EXIT_DECRYPTFAIL: u32 = 0x00010000;
2836 pub const NOTE_EXIT_MEMORY: u32 = 0x00020000;
2837 pub const NOTE_EXIT_CSERROR: u32 = 0x00040000;
2838 pub const NOTE_VM_PRESSURE: u32 = 0x80000000;
2839 pub const NOTE_VM_PRESSURE_TERMINATE: u32 = 0x40000000;
2840 pub const NOTE_VM_PRESSURE_SUDDEN_TERMINATE: u32 = 0x20000000;
2841 pub const NOTE_VM_ERROR: u32 = 0x10000000;
2842 pub const NOTE_SECONDS: u32 = 0x00000001;
2843 pub const NOTE_USECONDS: u32 = 0x00000002;
2844 pub const NOTE_NSECONDS: u32 = 0x00000004;
2845 pub const NOTE_ABSOLUTE: u32 = 0x00000008;
2846 pub const NOTE_LEEWAY: u32 = 0x00000010;
2847 pub const NOTE_CRITICAL: u32 = 0x00000020;
2848 pub const NOTE_BACKGROUND: u32 = 0x00000040;
2849 pub const NOTE_TRACK: u32 = 0x00000001;
2850 pub const NOTE_TRACKERR: u32 = 0x00000002;
2851 pub const NOTE_CHILD: u32 = 0x00000004;
2852 
2853 pub const OCRNL: ::tcflag_t = 0x00000010;
2854 pub const ONOCR: ::tcflag_t = 0x00000020;
2855 pub const ONLRET: ::tcflag_t = 0x00000040;
2856 pub const OFILL: ::tcflag_t = 0x00000080;
2857 pub const NLDLY: ::tcflag_t = 0x00000300;
2858 pub const TABDLY: ::tcflag_t = 0x00000c04;
2859 pub const CRDLY: ::tcflag_t = 0x00003000;
2860 pub const FFDLY: ::tcflag_t = 0x00004000;
2861 pub const BSDLY: ::tcflag_t = 0x00008000;
2862 pub const VTDLY: ::tcflag_t = 0x00010000;
2863 pub const OFDEL: ::tcflag_t = 0x00020000;
2864 
2865 pub const NL0: ::tcflag_t = 0x00000000;
2866 pub const NL1: ::tcflag_t = 0x00000100;
2867 pub const TAB0: ::tcflag_t = 0x00000000;
2868 pub const TAB1: ::tcflag_t = 0x00000400;
2869 pub const TAB2: ::tcflag_t = 0x00000800;
2870 pub const CR0: ::tcflag_t = 0x00000000;
2871 pub const CR1: ::tcflag_t = 0x00001000;
2872 pub const CR2: ::tcflag_t = 0x00002000;
2873 pub const CR3: ::tcflag_t = 0x00003000;
2874 pub const FF0: ::tcflag_t = 0x00000000;
2875 pub const FF1: ::tcflag_t = 0x00004000;
2876 pub const BS0: ::tcflag_t = 0x00000000;
2877 pub const BS1: ::tcflag_t = 0x00008000;
2878 pub const TAB3: ::tcflag_t = 0x00000004;
2879 pub const VT0: ::tcflag_t = 0x00000000;
2880 pub const VT1: ::tcflag_t = 0x00010000;
2881 pub const IUTF8: ::tcflag_t = 0x00004000;
2882 pub const CRTSCTS: ::tcflag_t = 0x00030000;
2883 
2884 pub const NI_MAXHOST: ::socklen_t = 1025;
2885 pub const NI_MAXSERV: ::socklen_t = 32;
2886 pub const NI_NOFQDN: ::c_int = 0x00000001;
2887 pub const NI_NUMERICHOST: ::c_int = 0x00000002;
2888 pub const NI_NAMEREQD: ::c_int = 0x00000004;
2889 pub const NI_NUMERICSERV: ::c_int = 0x00000008;
2890 pub const NI_NUMERICSCOPE: ::c_int = 0x00000100;
2891 pub const NI_DGRAM: ::c_int = 0x00000010;
2892 
2893 pub const Q_GETQUOTA: ::c_int = 0x300;
2894 pub const Q_SETQUOTA: ::c_int = 0x400;
2895 
2896 pub const RENAME_SWAP: ::c_uint = 0x00000002;
2897 pub const RENAME_EXCL: ::c_uint = 0x00000004;
2898 
2899 pub const RTLD_LOCAL: ::c_int = 0x4;
2900 pub const RTLD_FIRST: ::c_int = 0x100;
2901 pub const RTLD_NODELETE: ::c_int = 0x80;
2902 pub const RTLD_NOLOAD: ::c_int = 0x10;
2903 pub const RTLD_GLOBAL: ::c_int = 0x8;
2904 
2905 pub const _WSTOPPED: ::c_int = 0o177;
2906 
2907 pub const LOG_NETINFO: ::c_int = 12 << 3;
2908 pub const LOG_REMOTEAUTH: ::c_int = 13 << 3;
2909 pub const LOG_INSTALL: ::c_int = 14 << 3;
2910 pub const LOG_RAS: ::c_int = 15 << 3;
2911 pub const LOG_LAUNCHD: ::c_int = 24 << 3;
2912 pub const LOG_NFACILITIES: ::c_int = 25;
2913 
2914 pub const CTLTYPE: ::c_int = 0xf;
2915 pub const CTLTYPE_NODE: ::c_int = 1;
2916 pub const CTLTYPE_INT: ::c_int = 2;
2917 pub const CTLTYPE_STRING: ::c_int = 3;
2918 pub const CTLTYPE_QUAD: ::c_int = 4;
2919 pub const CTLTYPE_OPAQUE: ::c_int = 5;
2920 pub const CTLTYPE_STRUCT: ::c_int = CTLTYPE_OPAQUE;
2921 pub const CTLFLAG_RD: ::c_int = 0x80000000;
2922 pub const CTLFLAG_WR: ::c_int = 0x40000000;
2923 pub const CTLFLAG_RW: ::c_int = CTLFLAG_RD | CTLFLAG_WR;
2924 pub const CTLFLAG_NOLOCK: ::c_int = 0x20000000;
2925 pub const CTLFLAG_ANYBODY: ::c_int = 0x10000000;
2926 pub const CTLFLAG_SECURE: ::c_int = 0x08000000;
2927 pub const CTLFLAG_MASKED: ::c_int = 0x04000000;
2928 pub const CTLFLAG_NOAUTO: ::c_int = 0x02000000;
2929 pub const CTLFLAG_KERN: ::c_int = 0x01000000;
2930 pub const CTLFLAG_LOCKED: ::c_int = 0x00800000;
2931 pub const CTLFLAG_OID2: ::c_int = 0x00400000;
2932 pub const CTL_UNSPEC: ::c_int = 0;
2933 pub const CTL_KERN: ::c_int = 1;
2934 pub const CTL_VM: ::c_int = 2;
2935 pub const CTL_VFS: ::c_int = 3;
2936 pub const CTL_NET: ::c_int = 4;
2937 pub const CTL_DEBUG: ::c_int = 5;
2938 pub const CTL_HW: ::c_int = 6;
2939 pub const CTL_MACHDEP: ::c_int = 7;
2940 pub const CTL_USER: ::c_int = 8;
2941 pub const CTL_MAXID: ::c_int = 9;
2942 pub const KERN_OSTYPE: ::c_int = 1;
2943 pub const KERN_OSRELEASE: ::c_int = 2;
2944 pub const KERN_OSREV: ::c_int = 3;
2945 pub const KERN_VERSION: ::c_int = 4;
2946 pub const KERN_MAXVNODES: ::c_int = 5;
2947 pub const KERN_MAXPROC: ::c_int = 6;
2948 pub const KERN_MAXFILES: ::c_int = 7;
2949 pub const KERN_ARGMAX: ::c_int = 8;
2950 pub const KERN_SECURELVL: ::c_int = 9;
2951 pub const KERN_HOSTNAME: ::c_int = 10;
2952 pub const KERN_HOSTID: ::c_int = 11;
2953 pub const KERN_CLOCKRATE: ::c_int = 12;
2954 pub const KERN_VNODE: ::c_int = 13;
2955 pub const KERN_PROC: ::c_int = 14;
2956 pub const KERN_FILE: ::c_int = 15;
2957 pub const KERN_PROF: ::c_int = 16;
2958 pub const KERN_POSIX1: ::c_int = 17;
2959 pub const KERN_NGROUPS: ::c_int = 18;
2960 pub const KERN_JOB_CONTROL: ::c_int = 19;
2961 pub const KERN_SAVED_IDS: ::c_int = 20;
2962 pub const KERN_BOOTTIME: ::c_int = 21;
2963 pub const KERN_NISDOMAINNAME: ::c_int = 22;
2964 pub const KERN_DOMAINNAME: ::c_int = KERN_NISDOMAINNAME;
2965 pub const KERN_MAXPARTITIONS: ::c_int = 23;
2966 pub const KERN_KDEBUG: ::c_int = 24;
2967 pub const KERN_UPDATEINTERVAL: ::c_int = 25;
2968 pub const KERN_OSRELDATE: ::c_int = 26;
2969 pub const KERN_NTP_PLL: ::c_int = 27;
2970 pub const KERN_BOOTFILE: ::c_int = 28;
2971 pub const KERN_MAXFILESPERPROC: ::c_int = 29;
2972 pub const KERN_MAXPROCPERUID: ::c_int = 30;
2973 pub const KERN_DUMPDEV: ::c_int = 31;
2974 pub const KERN_IPC: ::c_int = 32;
2975 pub const KERN_DUMMY: ::c_int = 33;
2976 pub const KERN_PS_STRINGS: ::c_int = 34;
2977 pub const KERN_USRSTACK32: ::c_int = 35;
2978 pub const KERN_LOGSIGEXIT: ::c_int = 36;
2979 pub const KERN_SYMFILE: ::c_int = 37;
2980 pub const KERN_PROCARGS: ::c_int = 38;
2981 pub const KERN_NETBOOT: ::c_int = 40;
2982 pub const KERN_SYSV: ::c_int = 42;
2983 pub const KERN_AFFINITY: ::c_int = 43;
2984 pub const KERN_TRANSLATE: ::c_int = 44;
2985 pub const KERN_CLASSIC: ::c_int = KERN_TRANSLATE;
2986 pub const KERN_EXEC: ::c_int = 45;
2987 pub const KERN_CLASSICHANDLER: ::c_int = KERN_EXEC;
2988 pub const KERN_AIOMAX: ::c_int = 46;
2989 pub const KERN_AIOPROCMAX: ::c_int = 47;
2990 pub const KERN_AIOTHREADS: ::c_int = 48;
2991 pub const KERN_COREFILE: ::c_int = 50;
2992 pub const KERN_COREDUMP: ::c_int = 51;
2993 pub const KERN_SUGID_COREDUMP: ::c_int = 52;
2994 pub const KERN_PROCDELAYTERM: ::c_int = 53;
2995 pub const KERN_SHREG_PRIVATIZABLE: ::c_int = 54;
2996 pub const KERN_LOW_PRI_WINDOW: ::c_int = 56;
2997 pub const KERN_LOW_PRI_DELAY: ::c_int = 57;
2998 pub const KERN_POSIX: ::c_int = 58;
2999 pub const KERN_USRSTACK64: ::c_int = 59;
3000 pub const KERN_NX_PROTECTION: ::c_int = 60;
3001 pub const KERN_TFP: ::c_int = 61;
3002 pub const KERN_PROCNAME: ::c_int = 62;
3003 pub const KERN_THALTSTACK: ::c_int = 63;
3004 pub const KERN_SPECULATIVE_READS: ::c_int = 64;
3005 pub const KERN_OSVERSION: ::c_int = 65;
3006 pub const KERN_SAFEBOOT: ::c_int = 66;
3007 pub const KERN_RAGEVNODE: ::c_int = 68;
3008 pub const KERN_TTY: ::c_int = 69;
3009 pub const KERN_CHECKOPENEVT: ::c_int = 70;
3010 pub const KERN_THREADNAME: ::c_int = 71;
3011 pub const KERN_MAXID: ::c_int = 72;
3012 pub const KERN_RAGE_PROC: ::c_int = 1;
3013 pub const KERN_RAGE_THREAD: ::c_int = 2;
3014 pub const KERN_UNRAGE_PROC: ::c_int = 3;
3015 pub const KERN_UNRAGE_THREAD: ::c_int = 4;
3016 pub const KERN_OPENEVT_PROC: ::c_int = 1;
3017 pub const KERN_UNOPENEVT_PROC: ::c_int = 2;
3018 pub const KERN_TFP_POLICY: ::c_int = 1;
3019 pub const KERN_TFP_POLICY_DENY: ::c_int = 0;
3020 pub const KERN_TFP_POLICY_DEFAULT: ::c_int = 2;
3021 pub const KERN_KDEFLAGS: ::c_int = 1;
3022 pub const KERN_KDDFLAGS: ::c_int = 2;
3023 pub const KERN_KDENABLE: ::c_int = 3;
3024 pub const KERN_KDSETBUF: ::c_int = 4;
3025 pub const KERN_KDGETBUF: ::c_int = 5;
3026 pub const KERN_KDSETUP: ::c_int = 6;
3027 pub const KERN_KDREMOVE: ::c_int = 7;
3028 pub const KERN_KDSETREG: ::c_int = 8;
3029 pub const KERN_KDGETREG: ::c_int = 9;
3030 pub const KERN_KDREADTR: ::c_int = 10;
3031 pub const KERN_KDPIDTR: ::c_int = 11;
3032 pub const KERN_KDTHRMAP: ::c_int = 12;
3033 pub const KERN_KDPIDEX: ::c_int = 14;
3034 pub const KERN_KDSETRTCDEC: ::c_int = 15;
3035 pub const KERN_KDGETENTROPY: ::c_int = 16;
3036 pub const KERN_KDWRITETR: ::c_int = 17;
3037 pub const KERN_KDWRITEMAP: ::c_int = 18;
3038 #[doc(hidden)]
3039 #[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")]
3040 pub const KERN_KDENABLE_BG_TRACE: ::c_int = 19;
3041 #[doc(hidden)]
3042 #[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")]
3043 pub const KERN_KDDISABLE_BG_TRACE: ::c_int = 20;
3044 pub const KERN_KDREADCURTHRMAP: ::c_int = 21;
3045 pub const KERN_KDSET_TYPEFILTER: ::c_int = 22;
3046 pub const KERN_KDBUFWAIT: ::c_int = 23;
3047 pub const KERN_KDCPUMAP: ::c_int = 24;
3048 pub const KERN_PROC_ALL: ::c_int = 0;
3049 pub const KERN_PROC_PID: ::c_int = 1;
3050 pub const KERN_PROC_PGRP: ::c_int = 2;
3051 pub const KERN_PROC_SESSION: ::c_int = 3;
3052 pub const KERN_PROC_TTY: ::c_int = 4;
3053 pub const KERN_PROC_UID: ::c_int = 5;
3054 pub const KERN_PROC_RUID: ::c_int = 6;
3055 pub const KERN_PROC_LCID: ::c_int = 7;
3056 pub const KERN_SUCCESS: ::c_int = 0;
3057 pub const KERN_INVALID_ADDRESS: ::c_int = 1;
3058 pub const KERN_PROTECTION_FAILURE: ::c_int = 2;
3059 pub const KERN_NO_SPACE: ::c_int = 3;
3060 pub const KERN_INVALID_ARGUMENT: ::c_int = 4;
3061 pub const KERN_FAILURE: ::c_int = 5;
3062 pub const KERN_RESOURCE_SHORTAGE: ::c_int = 6;
3063 pub const KERN_NOT_RECEIVER: ::c_int = 7;
3064 pub const KERN_NO_ACCESS: ::c_int = 8;
3065 pub const KERN_MEMORY_FAILURE: ::c_int = 9;
3066 pub const KERN_MEMORY_ERROR: ::c_int = 10;
3067 pub const KERN_ALREADY_IN_SET: ::c_int = 11;
3068 pub const KERN_NOT_IN_SET: ::c_int = 12;
3069 pub const KERN_NAME_EXISTS: ::c_int = 13;
3070 pub const KERN_ABORTED: ::c_int = 14;
3071 pub const KERN_INVALID_NAME: ::c_int = 15;
3072 pub const KERN_INVALID_TASK: ::c_int = 16;
3073 pub const KERN_INVALID_RIGHT: ::c_int = 17;
3074 pub const KERN_INVALID_VALUE: ::c_int = 18;
3075 pub const KERN_UREFS_OVERFLOW: ::c_int = 19;
3076 pub const KERN_INVALID_CAPABILITY: ::c_int = 20;
3077 pub const KERN_RIGHT_EXISTS: ::c_int = 21;
3078 pub const KERN_INVALID_HOST: ::c_int = 22;
3079 pub const KERN_MEMORY_PRESENT: ::c_int = 23;
3080 pub const KERN_MEMORY_DATA_MOVED: ::c_int = 24;
3081 pub const KERN_MEMORY_RESTART_COPY: ::c_int = 25;
3082 pub const KERN_INVALID_PROCESSOR_SET: ::c_int = 26;
3083 pub const KERN_POLICY_LIMIT: ::c_int = 27;
3084 pub const KERN_INVALID_POLICY: ::c_int = 28;
3085 pub const KERN_INVALID_OBJECT: ::c_int = 29;
3086 pub const KERN_ALREADY_WAITING: ::c_int = 30;
3087 pub const KERN_DEFAULT_SET: ::c_int = 31;
3088 pub const KERN_EXCEPTION_PROTECTED: ::c_int = 32;
3089 pub const KERN_INVALID_LEDGER: ::c_int = 33;
3090 pub const KERN_INVALID_MEMORY_CONTROL: ::c_int = 34;
3091 pub const KERN_INVALID_SECURITY: ::c_int = 35;
3092 pub const KERN_NOT_DEPRESSED: ::c_int = 36;
3093 pub const KERN_TERMINATED: ::c_int = 37;
3094 pub const KERN_LOCK_SET_DESTROYED: ::c_int = 38;
3095 pub const KERN_LOCK_UNSTABLE: ::c_int = 39;
3096 pub const KERN_LOCK_OWNED: ::c_int = 40;
3097 pub const KERN_LOCK_OWNED_SELF: ::c_int = 41;
3098 pub const KERN_SEMAPHORE_DESTROYED: ::c_int = 42;
3099 pub const KERN_RPC_SERVER_TERMINATED: ::c_int = 43;
3100 pub const KERN_RPC_TERMINATE_ORPHAN: ::c_int = 44;
3101 pub const KERN_RPC_CONTINUE_ORPHAN: ::c_int = 45;
3102 pub const KERN_NOT_SUPPORTED: ::c_int = 46;
3103 pub const KERN_NODE_DOWN: ::c_int = 47;
3104 pub const KERN_NOT_WAITING: ::c_int = 48;
3105 pub const KERN_OPERATION_TIMED_OUT: ::c_int = 49;
3106 pub const KERN_CODESIGN_ERROR: ::c_int = 50;
3107 pub const KERN_POLICY_STATIC: ::c_int = 51;
3108 pub const KERN_INSUFFICIENT_BUFFER_SIZE: ::c_int = 52;
3109 pub const KIPC_MAXSOCKBUF: ::c_int = 1;
3110 pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
3111 pub const KIPC_SOMAXCONN: ::c_int = 3;
3112 pub const KIPC_MAX_LINKHDR: ::c_int = 4;
3113 pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
3114 pub const KIPC_MAX_HDR: ::c_int = 6;
3115 pub const KIPC_MAX_DATALEN: ::c_int = 7;
3116 pub const KIPC_MBSTAT: ::c_int = 8;
3117 pub const KIPC_NMBCLUSTERS: ::c_int = 9;
3118 pub const KIPC_SOQLIMITCOMPAT: ::c_int = 10;
3119 pub const VM_METER: ::c_int = 1;
3120 pub const VM_LOADAVG: ::c_int = 2;
3121 pub const VM_MACHFACTOR: ::c_int = 4;
3122 pub const VM_SWAPUSAGE: ::c_int = 5;
3123 pub const VM_MAXID: ::c_int = 6;
3124 pub const HW_MACHINE: ::c_int = 1;
3125 pub const HW_MODEL: ::c_int = 2;
3126 pub const HW_NCPU: ::c_int = 3;
3127 pub const HW_BYTEORDER: ::c_int = 4;
3128 pub const HW_PHYSMEM: ::c_int = 5;
3129 pub const HW_USERMEM: ::c_int = 6;
3130 pub const HW_PAGESIZE: ::c_int = 7;
3131 pub const HW_DISKNAMES: ::c_int = 8;
3132 pub const HW_DISKSTATS: ::c_int = 9;
3133 pub const HW_EPOCH: ::c_int = 10;
3134 pub const HW_FLOATINGPT: ::c_int = 11;
3135 pub const HW_MACHINE_ARCH: ::c_int = 12;
3136 pub const HW_VECTORUNIT: ::c_int = 13;
3137 pub const HW_BUS_FREQ: ::c_int = 14;
3138 pub const HW_CPU_FREQ: ::c_int = 15;
3139 pub const HW_CACHELINE: ::c_int = 16;
3140 pub const HW_L1ICACHESIZE: ::c_int = 17;
3141 pub const HW_L1DCACHESIZE: ::c_int = 18;
3142 pub const HW_L2SETTINGS: ::c_int = 19;
3143 pub const HW_L2CACHESIZE: ::c_int = 20;
3144 pub const HW_L3SETTINGS: ::c_int = 21;
3145 pub const HW_L3CACHESIZE: ::c_int = 22;
3146 pub const HW_TB_FREQ: ::c_int = 23;
3147 pub const HW_MEMSIZE: ::c_int = 24;
3148 pub const HW_AVAILCPU: ::c_int = 25;
3149 pub const HW_TARGET: ::c_int = 26;
3150 pub const HW_PRODUCT: ::c_int = 27;
3151 pub const HW_MAXID: ::c_int = 28;
3152 pub const USER_CS_PATH: ::c_int = 1;
3153 pub const USER_BC_BASE_MAX: ::c_int = 2;
3154 pub const USER_BC_DIM_MAX: ::c_int = 3;
3155 pub const USER_BC_SCALE_MAX: ::c_int = 4;
3156 pub const USER_BC_STRING_MAX: ::c_int = 5;
3157 pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
3158 pub const USER_EXPR_NEST_MAX: ::c_int = 7;
3159 pub const USER_LINE_MAX: ::c_int = 8;
3160 pub const USER_RE_DUP_MAX: ::c_int = 9;
3161 pub const USER_POSIX2_VERSION: ::c_int = 10;
3162 pub const USER_POSIX2_C_BIND: ::c_int = 11;
3163 pub const USER_POSIX2_C_DEV: ::c_int = 12;
3164 pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
3165 pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
3166 pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
3167 pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
3168 pub const USER_POSIX2_SW_DEV: ::c_int = 17;
3169 pub const USER_POSIX2_UPE: ::c_int = 18;
3170 pub const USER_STREAM_MAX: ::c_int = 19;
3171 pub const USER_TZNAME_MAX: ::c_int = 20;
3172 pub const USER_MAXID: ::c_int = 21;
3173 pub const CTL_DEBUG_NAME: ::c_int = 0;
3174 pub const CTL_DEBUG_VALUE: ::c_int = 1;
3175 pub const CTL_DEBUG_MAXID: ::c_int = 20;
3176 
3177 pub const PRIO_DARWIN_THREAD: ::c_int = 3;
3178 pub const PRIO_DARWIN_PROCESS: ::c_int = 4;
3179 pub const PRIO_DARWIN_BG: ::c_int = 0x1000;
3180 pub const PRIO_DARWIN_NONUI: ::c_int = 0x1001;
3181 
3182 pub const SEM_FAILED: *mut sem_t = -1isize as *mut ::sem_t;
3183 
3184 pub const AI_PASSIVE: ::c_int = 0x00000001;
3185 pub const AI_CANONNAME: ::c_int = 0x00000002;
3186 pub const AI_NUMERICHOST: ::c_int = 0x00000004;
3187 pub const AI_NUMERICSERV: ::c_int = 0x00001000;
3188 pub const AI_MASK: ::c_int =
3189     AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_ADDRCONFIG;
3190 pub const AI_ALL: ::c_int = 0x00000100;
3191 pub const AI_V4MAPPED_CFG: ::c_int = 0x00000200;
3192 pub const AI_ADDRCONFIG: ::c_int = 0x00000400;
3193 pub const AI_V4MAPPED: ::c_int = 0x00000800;
3194 pub const AI_DEFAULT: ::c_int = AI_V4MAPPED_CFG | AI_ADDRCONFIG;
3195 pub const AI_UNUSABLE: ::c_int = 0x10000000;
3196 
3197 pub const SIGEV_NONE: ::c_int = 0;
3198 pub const SIGEV_SIGNAL: ::c_int = 1;
3199 pub const SIGEV_THREAD: ::c_int = 3;
3200 
3201 pub const AIO_CANCELED: ::c_int = 2;
3202 pub const AIO_NOTCANCELED: ::c_int = 4;
3203 pub const AIO_ALLDONE: ::c_int = 1;
3204 #[deprecated(
3205     since = "0.2.64",
3206     note = "Can vary at runtime.  Use sysconf(3) instead"
3207 )]
3208 pub const AIO_LISTIO_MAX: ::c_int = 16;
3209 pub const LIO_NOP: ::c_int = 0;
3210 pub const LIO_WRITE: ::c_int = 2;
3211 pub const LIO_READ: ::c_int = 1;
3212 pub const LIO_WAIT: ::c_int = 2;
3213 pub const LIO_NOWAIT: ::c_int = 1;
3214 
3215 pub const WEXITED: ::c_int = 0x00000004;
3216 pub const WSTOPPED: ::c_int = 0x00000008;
3217 pub const WCONTINUED: ::c_int = 0x00000010;
3218 pub const WNOWAIT: ::c_int = 0x00000020;
3219 
3220 pub const P_ALL: idtype_t = 0;
3221 pub const P_PID: idtype_t = 1;
3222 pub const P_PGID: idtype_t = 2;
3223 
3224 pub const UTIME_OMIT: c_long = -2;
3225 pub const UTIME_NOW: c_long = -1;
3226 
3227 pub const XATTR_NOFOLLOW: ::c_int = 0x0001;
3228 pub const XATTR_CREATE: ::c_int = 0x0002;
3229 pub const XATTR_REPLACE: ::c_int = 0x0004;
3230 pub const XATTR_NOSECURITY: ::c_int = 0x0008;
3231 pub const XATTR_NODEFAULT: ::c_int = 0x0010;
3232 pub const XATTR_SHOWCOMPRESSION: ::c_int = 0x0020;
3233 
3234 pub const NET_RT_IFLIST2: ::c_int = 0x0006;
3235 
3236 // net/route.h
3237 pub const RTF_UP: ::c_int = 0x1;
3238 pub const RTF_GATEWAY: ::c_int = 0x2;
3239 pub const RTF_HOST: ::c_int = 0x4;
3240 pub const RTF_REJECT: ::c_int = 0x8;
3241 pub const RTF_DYNAMIC: ::c_int = 0x10;
3242 pub const RTF_MODIFIED: ::c_int = 0x20;
3243 pub const RTF_DONE: ::c_int = 0x40;
3244 pub const RTF_DELCLONE: ::c_int = 0x80;
3245 pub const RTF_CLONING: ::c_int = 0x100;
3246 pub const RTF_XRESOLVE: ::c_int = 0x200;
3247 pub const RTF_LLINFO: ::c_int = 0x400;
3248 pub const RTF_STATIC: ::c_int = 0x800;
3249 pub const RTF_BLACKHOLE: ::c_int = 0x1000;
3250 pub const RTF_NOIFREF: ::c_int = 0x2000;
3251 pub const RTF_PROTO2: ::c_int = 0x4000;
3252 pub const RTF_PROTO1: ::c_int = 0x8000;
3253 pub const RTF_PRCLONING: ::c_int = 0x10000;
3254 pub const RTF_WASCLONED: ::c_int = 0x20000;
3255 pub const RTF_PROTO3: ::c_int = 0x40000;
3256 pub const RTF_PINNED: ::c_int = 0x100000;
3257 pub const RTF_LOCAL: ::c_int = 0x200000;
3258 pub const RTF_BROADCAST: ::c_int = 0x400000;
3259 pub const RTF_MULTICAST: ::c_int = 0x800000;
3260 pub const RTF_IFSCOPE: ::c_int = 0x1000000;
3261 pub const RTF_CONDEMNED: ::c_int = 0x2000000;
3262 pub const RTF_IFREF: ::c_int = 0x4000000;
3263 pub const RTF_PROXY: ::c_int = 0x8000000;
3264 pub const RTF_ROUTER: ::c_int = 0x10000000;
3265 
3266 pub const RTM_VERSION: ::c_int = 5;
3267 
3268 // Message types
3269 pub const RTM_ADD: ::c_int = 0x1;
3270 pub const RTM_DELETE: ::c_int = 0x2;
3271 pub const RTM_CHANGE: ::c_int = 0x3;
3272 pub const RTM_GET: ::c_int = 0x4;
3273 pub const RTM_LOSING: ::c_int = 0x5;
3274 pub const RTM_REDIRECT: ::c_int = 0x6;
3275 pub const RTM_MISS: ::c_int = 0x7;
3276 pub const RTM_LOCK: ::c_int = 0x8;
3277 pub const RTM_OLDADD: ::c_int = 0x9;
3278 pub const RTM_OLDDEL: ::c_int = 0xa;
3279 pub const RTM_RESOLVE: ::c_int = 0xb;
3280 pub const RTM_NEWADDR: ::c_int = 0xc;
3281 pub const RTM_DELADDR: ::c_int = 0xd;
3282 pub const RTM_IFINFO: ::c_int = 0xe;
3283 pub const RTM_NEWMADDR: ::c_int = 0xf;
3284 pub const RTM_DELMADDR: ::c_int = 0x10;
3285 pub const RTM_IFINFO2: ::c_int = 0x12;
3286 pub const RTM_NEWMADDR2: ::c_int = 0x13;
3287 pub const RTM_GET2: ::c_int = 0x14;
3288 
3289 // Bitmask values for rtm_inits and rmx_locks.
3290 pub const RTV_MTU: ::c_int = 0x1;
3291 pub const RTV_HOPCOUNT: ::c_int = 0x2;
3292 pub const RTV_EXPIRE: ::c_int = 0x4;
3293 pub const RTV_RPIPE: ::c_int = 0x8;
3294 pub const RTV_SPIPE: ::c_int = 0x10;
3295 pub const RTV_SSTHRESH: ::c_int = 0x20;
3296 pub const RTV_RTT: ::c_int = 0x40;
3297 pub const RTV_RTTVAR: ::c_int = 0x80;
3298 
3299 // Bitmask values for rtm_addrs.
3300 pub const RTA_DST: ::c_int = 0x1;
3301 pub const RTA_GATEWAY: ::c_int = 0x2;
3302 pub const RTA_NETMASK: ::c_int = 0x4;
3303 pub const RTA_GENMASK: ::c_int = 0x8;
3304 pub const RTA_IFP: ::c_int = 0x10;
3305 pub const RTA_IFA: ::c_int = 0x20;
3306 pub const RTA_AUTHOR: ::c_int = 0x40;
3307 pub const RTA_BRD: ::c_int = 0x80;
3308 
3309 // Index offsets for sockaddr array for alternate internal encoding.
3310 pub const RTAX_DST: ::c_int = 0;
3311 pub const RTAX_GATEWAY: ::c_int = 1;
3312 pub const RTAX_NETMASK: ::c_int = 2;
3313 pub const RTAX_GENMASK: ::c_int = 3;
3314 pub const RTAX_IFP: ::c_int = 4;
3315 pub const RTAX_IFA: ::c_int = 5;
3316 pub const RTAX_AUTHOR: ::c_int = 6;
3317 pub const RTAX_BRD: ::c_int = 7;
3318 pub const RTAX_MAX: ::c_int = 8;
3319 
3320 pub const KERN_PROCARGS2: ::c_int = 49;
3321 
3322 pub const PROC_PIDTASKALLINFO: ::c_int = 2;
3323 pub const PROC_PIDTASKINFO: ::c_int = 4;
3324 pub const PROC_PIDTHREADINFO: ::c_int = 5;
3325 pub const MAXCOMLEN: usize = 16;
3326 pub const MAXTHREADNAMESIZE: usize = 64;
3327 
3328 pub const XUCRED_VERSION: ::c_uint = 0;
3329 
3330 pub const LC_SEGMENT: u32 = 0x1;
3331 pub const LC_SEGMENT_64: u32 = 0x19;
3332 
3333 pub const MH_MAGIC: u32 = 0xfeedface;
3334 pub const MH_MAGIC_64: u32 = 0xfeedfacf;
3335 
3336 // net/if_utun.h
3337 pub const UTUN_OPT_FLAGS: ::c_int = 1;
3338 pub const UTUN_OPT_IFNAME: ::c_int = 2;
3339 
3340 // net/bpf.h
3341 pub const DLT_NULL: ::c_uint = 0; // no link-layer encapsulation
3342 pub const DLT_EN10MB: ::c_uint = 1; // Ethernet (10Mb)
3343 pub const DLT_EN3MB: ::c_uint = 2; // Experimental Ethernet (3Mb)
3344 pub const DLT_AX25: ::c_uint = 3; // Amateur Radio AX.25
3345 pub const DLT_PRONET: ::c_uint = 4; // Proteon ProNET Token Ring
3346 pub const DLT_CHAOS: ::c_uint = 5; // Chaos
3347 pub const DLT_IEEE802: ::c_uint = 6; // IEEE 802 Networks
3348 pub const DLT_ARCNET: ::c_uint = 7; // ARCNET
3349 pub const DLT_SLIP: ::c_uint = 8; // Serial Line IP
3350 pub const DLT_PPP: ::c_uint = 9; // Point-to-point Protocol
3351 pub const DLT_FDDI: ::c_uint = 10; // FDDI
3352 pub const DLT_ATM_RFC1483: ::c_uint = 11; // LLC/SNAP encapsulated atm
3353 pub const DLT_RAW: ::c_uint = 12; // raw IP
3354 pub const DLT_LOOP: ::c_uint = 108;
3355 
3356 // https://github.com/apple/darwin-xnu/blob/master/bsd/net/bpf.h#L100
3357 // sizeof(i32)
3358 pub const BPF_ALIGNMENT: ::c_int = 4;
3359 
3360 // sys/mount.h
3361 pub const MNT_RDONLY: ::c_int = 0x00000001;
3362 pub const MNT_SYNCHRONOUS: ::c_int = 0x00000002;
3363 pub const MNT_NOEXEC: ::c_int = 0x00000004;
3364 pub const MNT_NOSUID: ::c_int = 0x00000008;
3365 pub const MNT_NODEV: ::c_int = 0x00000010;
3366 pub const MNT_UNION: ::c_int = 0x00000020;
3367 pub const MNT_ASYNC: ::c_int = 0x00000040;
3368 pub const MNT_CPROTECT: ::c_int = 0x00000080;
3369 
3370 // NFS export related mount flags.
3371 pub const MNT_EXPORTED: ::c_int = 0x00000100;
3372 
3373 // MAC labeled / "quarantined" flag
3374 pub const MNT_QUARANTINE: ::c_int = 0x00000400;
3375 
3376 // Flags set by internal operations.
3377 pub const MNT_LOCAL: ::c_int = 0x00001000;
3378 pub const MNT_QUOTA: ::c_int = 0x00002000;
3379 pub const MNT_ROOTFS: ::c_int = 0x00004000;
3380 pub const MNT_DOVOLFS: ::c_int = 0x00008000;
3381 
3382 pub const MNT_DONTBROWSE: ::c_int = 0x00100000;
3383 pub const MNT_IGNORE_OWNERSHIP: ::c_int = 0x00200000;
3384 pub const MNT_AUTOMOUNTED: ::c_int = 0x00400000;
3385 pub const MNT_JOURNALED: ::c_int = 0x00800000;
3386 pub const MNT_NOUSERXATTR: ::c_int = 0x01000000;
3387 pub const MNT_DEFWRITE: ::c_int = 0x02000000;
3388 pub const MNT_MULTILABEL: ::c_int = 0x04000000;
3389 pub const MNT_NOATIME: ::c_int = 0x10000000;
3390 pub const MNT_SNAPSHOT: ::c_int = 0x40000000;
3391 
3392 // External filesystem command modifier flags.
3393 pub const MNT_UPDATE: ::c_int = 0x00010000;
3394 pub const MNT_NOBLOCK: ::c_int = 0x00020000;
3395 pub const MNT_RELOAD: ::c_int = 0x00040000;
3396 
3397 // sys/spawn.h:
3398 pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
3399 pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
3400 pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x04;
3401 pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x08;
3402 pub const POSIX_SPAWN_SETEXEC: ::c_int = 0x40;
3403 pub const POSIX_SPAWN_START_SUSPENDED: ::c_int = 0x80;
3404 pub const POSIX_SPAWN_CLOEXEC_DEFAULT: ::c_int = 0x4000;
3405 
3406 // sys/ipc.h:
3407 pub const IPC_CREAT: ::c_int = 0x200;
3408 pub const IPC_EXCL: ::c_int = 0x400;
3409 pub const IPC_NOWAIT: ::c_int = 0x800;
3410 pub const IPC_PRIVATE: key_t = 0;
3411 
3412 pub const IPC_RMID: ::c_int = 0;
3413 pub const IPC_SET: ::c_int = 1;
3414 pub const IPC_STAT: ::c_int = 2;
3415 
3416 pub const IPC_R: ::c_int = 0x100;
3417 pub const IPC_W: ::c_int = 0x80;
3418 pub const IPC_M: ::c_int = 0x1000;
3419 
3420 // sys/sem.h
3421 pub const SEM_UNDO: ::c_int = 0o10000;
3422 
3423 pub const GETNCNT: ::c_int = 3;
3424 pub const GETPID: ::c_int = 4;
3425 pub const GETVAL: ::c_int = 5;
3426 pub const GETALL: ::c_int = 6;
3427 pub const GETZCNT: ::c_int = 7;
3428 pub const SETVAL: ::c_int = 8;
3429 pub const SETALL: ::c_int = 9;
3430 
3431 // sys/shm.h
3432 pub const SHM_RDONLY: ::c_int = 0x1000;
3433 pub const SHM_RND: ::c_int = 0x2000;
3434 #[cfg(target_arch = "aarch64")]
3435 pub const SHMLBA: ::c_int = 16 * 1024;
3436 #[cfg(not(target_arch = "aarch64"))]
3437 pub const SHMLBA: ::c_int = 4096;
3438 pub const SHM_R: ::c_int = IPC_R;
3439 pub const SHM_W: ::c_int = IPC_W;
3440 
3441 // Flags for chflags(2)
3442 pub const UF_SETTABLE: ::c_uint = 0x0000ffff;
3443 pub const UF_NODUMP: ::c_uint = 0x00000001;
3444 pub const UF_IMMUTABLE: ::c_uint = 0x00000002;
3445 pub const UF_APPEND: ::c_uint = 0x00000004;
3446 pub const UF_OPAQUE: ::c_uint = 0x00000008;
3447 pub const UF_COMPRESSED: ::c_uint = 0x00000020;
3448 pub const UF_TRACKED: ::c_uint = 0x00000040;
3449 pub const SF_SETTABLE: ::c_uint = 0xffff0000;
3450 pub const SF_ARCHIVED: ::c_uint = 0x00010000;
3451 pub const SF_IMMUTABLE: ::c_uint = 0x00020000;
3452 pub const SF_APPEND: ::c_uint = 0x00040000;
3453 pub const UF_HIDDEN: ::c_uint = 0x00008000;
3454 
3455 //<sys/timex.h>
3456 pub const NTP_API: ::c_int = 4;
3457 pub const MAXPHASE: ::c_long = 500000000;
3458 pub const MAXFREQ: ::c_long = 500000;
3459 pub const MINSEC: ::c_int = 256;
3460 pub const MAXSEC: ::c_int = 2048;
3461 pub const NANOSECOND: ::c_long = 1000000000;
3462 pub const SCALE_PPM: ::c_int = 65;
3463 pub const MAXTC: ::c_int = 10;
3464 pub const MOD_OFFSET: ::c_uint = 0x0001;
3465 pub const MOD_FREQUENCY: ::c_uint = 0x0002;
3466 pub const MOD_MAXERROR: ::c_uint = 0x0004;
3467 pub const MOD_ESTERROR: ::c_uint = 0x0008;
3468 pub const MOD_STATUS: ::c_uint = 0x0010;
3469 pub const MOD_TIMECONST: ::c_uint = 0x0020;
3470 pub const MOD_PPSMAX: ::c_uint = 0x0040;
3471 pub const MOD_TAI: ::c_uint = 0x0080;
3472 pub const MOD_MICRO: ::c_uint = 0x1000;
3473 pub const MOD_NANO: ::c_uint = 0x2000;
3474 pub const MOD_CLKB: ::c_uint = 0x4000;
3475 pub const MOD_CLKA: ::c_uint = 0x8000;
3476 pub const STA_PLL: ::c_int = 0x0001;
3477 pub const STA_PPSFREQ: ::c_int = 0x0002;
3478 pub const STA_PPSTIME: ::c_int = 0x0004;
3479 pub const STA_FLL: ::c_int = 0x0008;
3480 pub const STA_INS: ::c_int = 0x0010;
3481 pub const STA_DEL: ::c_int = 0x0020;
3482 pub const STA_UNSYNC: ::c_int = 0x0040;
3483 pub const STA_FREQHOLD: ::c_int = 0x0080;
3484 pub const STA_PPSSIGNAL: ::c_int = 0x0100;
3485 pub const STA_PPSJITTER: ::c_int = 0x0200;
3486 pub const STA_PPSWANDER: ::c_int = 0x0400;
3487 pub const STA_PPSERROR: ::c_int = 0x0800;
3488 pub const STA_CLOCKERR: ::c_int = 0x1000;
3489 pub const STA_NANO: ::c_int = 0x2000;
3490 pub const STA_MODE: ::c_int = 0x4000;
3491 pub const STA_CLK: ::c_int = 0x8000;
3492 pub const STA_RONLY: ::c_int = STA_PPSSIGNAL
3493     | STA_PPSJITTER
3494     | STA_PPSWANDER
3495     | STA_PPSERROR
3496     | STA_CLOCKERR
3497     | STA_NANO
3498     | STA_MODE
3499     | STA_CLK;
3500 pub const TIME_OK: ::c_int = 0;
3501 pub const TIME_INS: ::c_int = 1;
3502 pub const TIME_DEL: ::c_int = 2;
3503 pub const TIME_OOP: ::c_int = 3;
3504 pub const TIME_WAIT: ::c_int = 4;
3505 pub const TIME_ERROR: ::c_int = 5;
3506 
3507 // <sys/mount.h>
3508 pub const MNT_WAIT: ::c_int = 1;
3509 pub const MNT_NOWAIT: ::c_int = 2;
3510 
3511 // <mach/thread_policy.h>
3512 pub const THREAD_STANDARD_POLICY: ::c_int = 1;
3513 pub const THREAD_STANDARD_POLICY_COUNT: ::c_int = 0;
3514 pub const THREAD_EXTENDED_POLICY: ::c_int = 1;
3515 pub const THREAD_TIME_CONSTRAINT_POLICY: ::c_int = 2;
3516 pub const THREAD_PRECEDENCE_POLICY: ::c_int = 3;
3517 pub const THREAD_AFFINITY_POLICY: ::c_int = 4;
3518 pub const THREAD_AFFINITY_TAG_NULL: ::c_int = 0;
3519 pub const THREAD_BACKGROUND_POLICY: ::c_int = 5;
3520 pub const THREAD_BACKGROUND_POLICY_DARWIN_BG: ::c_int = 0x1000;
3521 pub const THREAD_LATENCY_QOS_POLICY: ::c_int = 7;
3522 pub const THREAD_THROUGHPUT_QOS_POLICY: ::c_int = 8;
3523 
3524 cfg_if! {
3525     if #[cfg(libc_const_extern_fn)] {
3526         const fn __DARWIN_ALIGN32(p: usize) -> usize {
3527             const __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1;
3528             p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32
3529         }
3530     } else if #[cfg(libc_const_size_of)] {
3531         fn __DARWIN_ALIGN32(p: usize) -> usize {
3532             const __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1;
3533             p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32
3534         }
3535         pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t =
3536             (::mem::size_of::<thread_extended_policy_data_t>() / ::mem::size_of::<integer_t>())
3537             as mach_msg_type_number_t;
3538         pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t =
3539             (::mem::size_of::<thread_time_constraint_policy_data_t>() /
3540              ::mem::size_of::<integer_t>()) as mach_msg_type_number_t;
3541         pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t =
3542             (::mem::size_of::<thread_precedence_policy_data_t>() / ::mem::size_of::<integer_t>())
3543             as mach_msg_type_number_t;
3544         pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t =
3545             (::mem::size_of::<thread_affinity_policy_data_t>() / ::mem::size_of::<integer_t>())
3546             as mach_msg_type_number_t;
3547         pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t =
3548             (::mem::size_of::<thread_background_policy_data_t>() / ::mem::size_of::<integer_t>())
3549             as mach_msg_type_number_t;
3550         pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t =
3551             (::mem::size_of::<thread_latency_qos_policy_data_t>() / ::mem::size_of::<integer_t>())
3552             as mach_msg_type_number_t;
3553         pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t =
3554             (::mem::size_of::<thread_throughput_qos_policy_data_t>() /
3555              ::mem::size_of::<integer_t>()) as mach_msg_type_number_t;
3556     } else {
3557         fn __DARWIN_ALIGN32(p: usize) -> usize {
3558             let __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1;
3559             p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32
3560         }
3561         pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t = 1;
3562         pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t = 4;
3563         pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t = 1;
3564         pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t = 1;
3565         pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t = 1;
3566         pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t = 1;
3567         pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t = 1;
3568     }
3569 }
3570 
3571 f! {
3572     pub fn CMSG_NXTHDR(mhdr: *const ::msghdr,
3573                        cmsg: *const ::cmsghdr) -> *mut ::cmsghdr {
3574         if cmsg.is_null() {
3575             return ::CMSG_FIRSTHDR(mhdr);
3576         };
3577         let cmsg_len = (*cmsg).cmsg_len as usize;
3578         let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len as usize);
3579         let max = (*mhdr).msg_control as usize
3580                     + (*mhdr).msg_controllen as usize;
3581         if next + __DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) > max {
3582             0 as *mut ::cmsghdr
3583         } else {
3584             next as *mut ::cmsghdr
3585         }
3586     }
3587 
3588     pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
3589         (cmsg as *mut ::c_uchar)
3590             .offset(__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) as isize)
3591     }
3592 
3593     pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
3594         (__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>())
3595             + __DARWIN_ALIGN32(length as usize))
3596             as ::c_uint
3597     }
3598 
3599     pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
3600         (__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) + length as usize)
3601             as ::c_uint
3602     }
3603 }
3604 
3605 safe_f! {
3606     pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
3607         status >> 8
3608     }
3609 
3610     pub {const} fn _WSTATUS(status: ::c_int) -> ::c_int {
3611         status & 0x7f
3612     }
3613 
3614     pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
3615         _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) == 0x13
3616     }
3617 
3618     pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
3619         _WSTATUS(status) != _WSTOPPED && _WSTATUS(status) != 0
3620     }
3621 
3622     pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
3623         _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) != 0x13
3624     }
3625 }
3626 
3627 extern "C" {
setgrent()3628     pub fn setgrent();
3629     #[doc(hidden)]
3630     #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.5")]
3631     #[cfg_attr(not(target_arch = "aarch64"), link_name = "daemon$1050")]
daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int3632     pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
3633     #[doc(hidden)]
3634     #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")]
sem_destroy(sem: *mut sem_t) -> ::c_int3635     pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
3636     #[doc(hidden)]
3637     #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")]
sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int3638     pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
aio_read(aiocbp: *mut aiocb) -> ::c_int3639     pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
aio_write(aiocbp: *mut aiocb) -> ::c_int3640     pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int3641     pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
aio_error(aiocbp: *const aiocb) -> ::c_int3642     pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
aio_return(aiocbp: *mut aiocb) -> ::ssize_t3643     pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
3644     #[cfg_attr(
3645         all(target_os = "macos", target_arch = "x86"),
3646         link_name = "aio_suspend$UNIX2003"
3647     )]
aio_suspend( aiocb_list: *const *const aiocb, nitems: ::c_int, timeout: *const ::timespec, ) -> ::c_int3648     pub fn aio_suspend(
3649         aiocb_list: *const *const aiocb,
3650         nitems: ::c_int,
3651         timeout: *const ::timespec,
3652     ) -> ::c_int;
aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int3653     pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
chflags(path: *const ::c_char, flags: ::c_uint) -> ::c_int3654     pub fn chflags(path: *const ::c_char, flags: ::c_uint) -> ::c_int;
fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int3655     pub fn fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int;
clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int3656     pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int3657     pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
lio_listio( mode: ::c_int, aiocb_list: *const *mut aiocb, nitems: ::c_int, sevp: *mut sigevent, ) -> ::c_int3658     pub fn lio_listio(
3659         mode: ::c_int,
3660         aiocb_list: *const *mut aiocb,
3661         nitems: ::c_int,
3662         sevp: *mut sigevent,
3663     ) -> ::c_int;
3664 
dirfd(dirp: *mut ::DIR) -> ::c_int3665     pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
3666 
lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int3667     pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
3668 
gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int3669     pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
getutxent() -> *mut utmpx3670     pub fn getutxent() -> *mut utmpx;
getutxid(ut: *const utmpx) -> *mut utmpx3671     pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
getutxline(ut: *const utmpx) -> *mut utmpx3672     pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
pututxline(ut: *const utmpx) -> *mut utmpx3673     pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
setutxent()3674     pub fn setutxent();
endutxent()3675     pub fn endutxent();
utmpxname(file: *const ::c_char) -> ::c_int3676     pub fn utmpxname(file: *const ::c_char) -> ::c_int;
3677 
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_int3678     pub fn getnameinfo(
3679         sa: *const ::sockaddr,
3680         salen: ::socklen_t,
3681         host: *mut ::c_char,
3682         hostlen: ::socklen_t,
3683         serv: *mut ::c_char,
3684         sevlen: ::socklen_t,
3685         flags: ::c_int,
3686     ) -> ::c_int;
mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int3687     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_int3688     pub fn sysctlnametomib(
3689         name: *const ::c_char,
3690         mibp: *mut ::c_int,
3691         sizep: *mut ::size_t,
3692     ) -> ::c_int;
3693     #[cfg_attr(
3694         all(target_os = "macos", target_arch = "x86"),
3695         link_name = "mprotect$UNIX2003"
3696     )]
mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int3697     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_int3698     pub fn semget(key: key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int;
3699     #[cfg_attr(
3700         all(target_os = "macos", target_arch = "x86"),
3701         link_name = "semctl$UNIX2003"
3702     )]
semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int3703     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_int3704     pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int;
shm_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::c_int3705     pub fn shm_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::c_int;
ftok(pathname: *const c_char, proj_id: ::c_int) -> key_t3706     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_void3707     pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
shmdt(shmaddr: *const ::c_void) -> ::c_int3708     pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
3709     #[cfg_attr(
3710         all(target_os = "macos", target_arch = "x86"),
3711         link_name = "shmctl$UNIX2003"
3712     )]
shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int3713     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_int3714     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_int3715     pub fn sysctl(
3716         name: *mut ::c_int,
3717         namelen: ::c_uint,
3718         oldp: *mut ::c_void,
3719         oldlenp: *mut ::size_t,
3720         newp: *mut ::c_void,
3721         newlen: ::size_t,
3722     ) -> ::c_int;
sysctlbyname( name: *const ::c_char, oldp: *mut ::c_void, oldlenp: *mut ::size_t, newp: *mut ::c_void, newlen: ::size_t, ) -> ::c_int3723     pub fn sysctlbyname(
3724         name: *const ::c_char,
3725         oldp: *mut ::c_void,
3726         oldlenp: *mut ::size_t,
3727         newp: *mut ::c_void,
3728         newlen: ::size_t,
3729     ) -> ::c_int;
3730     #[deprecated(since = "0.2.55", note = "Use the mach crate")]
mach_absolute_time() -> u643731     pub fn mach_absolute_time() -> u64;
3732     #[deprecated(since = "0.2.55", note = "Use the mach crate")]
3733     #[allow(deprecated)]
mach_timebase_info(info: *mut ::mach_timebase_info) -> ::c_int3734     pub fn mach_timebase_info(info: *mut ::mach_timebase_info) -> ::c_int;
mach_host_self() -> mach_port_t3735     pub fn mach_host_self() -> mach_port_t;
mach_thread_self() -> mach_port_t3736     pub fn mach_thread_self() -> mach_port_t;
pthread_setname_np(name: *const ::c_char) -> ::c_int3737     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_int3738     pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
pthread_from_mach_thread_np(port: ::mach_port_t) -> ::pthread_t3739     pub fn pthread_from_mach_thread_np(port: ::mach_port_t) -> ::pthread_t;
pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void3740     pub fn pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void;
pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t3741     pub fn pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t;
pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int3742     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_int3743     pub fn pthread_condattr_getpshared(
3744         attr: *const pthread_condattr_t,
3745         pshared: *mut ::c_int,
3746     ) -> ::c_int;
pthread_mutexattr_setpshared( attr: *mut pthread_mutexattr_t, pshared: ::c_int, ) -> ::c_int3747     pub fn pthread_mutexattr_setpshared(
3748         attr: *mut pthread_mutexattr_t,
3749         pshared: ::c_int,
3750     ) -> ::c_int;
pthread_mutexattr_getpshared( attr: *const pthread_mutexattr_t, pshared: *mut ::c_int, ) -> ::c_int3751     pub fn pthread_mutexattr_getpshared(
3752         attr: *const pthread_mutexattr_t,
3753         pshared: *mut ::c_int,
3754     ) -> ::c_int;
pthread_rwlockattr_getpshared( attr: *const pthread_rwlockattr_t, val: *mut ::c_int, ) -> ::c_int3755     pub fn pthread_rwlockattr_getpshared(
3756         attr: *const pthread_rwlockattr_t,
3757         val: *mut ::c_int,
3758     ) -> ::c_int;
pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int3759     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_int3760     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_int3761     pub fn pthread_attr_set_qos_class_np(
3762         attr: *mut pthread_attr_t,
3763         class: qos_class_t,
3764         priority: ::c_int,
3765     ) -> ::c_int;
pthread_attr_get_qos_class_np( attr: *mut pthread_attr_t, class: *mut qos_class_t, priority: *mut ::c_int, ) -> ::c_int3766     pub fn pthread_attr_get_qos_class_np(
3767         attr: *mut pthread_attr_t,
3768         class: *mut qos_class_t,
3769         priority: *mut ::c_int,
3770     ) -> ::c_int;
pthread_set_qos_class_self_np(class: qos_class_t, priority: ::c_int) -> ::c_int3771     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_int3772     pub fn pthread_get_qos_class_np(
3773         thread: ::pthread_t,
3774         class: *mut qos_class_t,
3775         priority: *mut ::c_int,
3776     ) -> ::c_int;
thread_policy_set( thread: thread_t, flavor: thread_policy_flavor_t, policy_info: thread_policy_t, count: mach_msg_type_number_t, ) -> kern_return_t3777     pub fn thread_policy_set(
3778         thread: thread_t,
3779         flavor: thread_policy_flavor_t,
3780         policy_info: thread_policy_t,
3781         count: mach_msg_type_number_t,
3782     ) -> 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_t3783     pub fn thread_policy_get(
3784         thread: thread_t,
3785         flavor: thread_policy_flavor_t,
3786         policy_info: thread_policy_t,
3787         count: *mut mach_msg_type_number_t,
3788         get_default: *mut boolean_t,
3789     ) -> kern_return_t;
__error() -> *mut ::c_int3790     pub fn __error() -> *mut ::c_int;
backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int3791     pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int;
3792     #[cfg_attr(
3793         all(target_os = "macos", not(target_arch = "aarch64")),
3794         link_name = "statfs$INODE64"
3795     )]
statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int3796     pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
3797     #[cfg_attr(
3798         all(target_os = "macos", not(target_arch = "aarch64")),
3799         link_name = "fstatfs$INODE64"
3800     )]
fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int3801     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_int3802     pub fn kevent(
3803         kq: ::c_int,
3804         changelist: *const ::kevent,
3805         nchanges: ::c_int,
3806         eventlist: *mut ::kevent,
3807         nevents: ::c_int,
3808         timeout: *const ::timespec,
3809     ) -> ::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_int3810     pub fn kevent64(
3811         kq: ::c_int,
3812         changelist: *const ::kevent64_s,
3813         nchanges: ::c_int,
3814         eventlist: *mut ::kevent64_s,
3815         nevents: ::c_int,
3816         flags: ::c_uint,
3817         timeout: *const ::timespec,
3818     ) -> ::c_int;
mount( src: *const ::c_char, target: *const ::c_char, flags: ::c_int, data: *mut ::c_void, ) -> ::c_int3819     pub fn mount(
3820         src: *const ::c_char,
3821         target: *const ::c_char,
3822         flags: ::c_int,
3823         data: *mut ::c_void,
3824     ) -> ::c_int;
ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_char, data: ::c_int) -> ::c_int3825     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_int3826     pub fn quotactl(
3827         special: *const ::c_char,
3828         cmd: ::c_int,
3829         id: ::c_int,
3830         data: *mut ::c_char,
3831     ) -> ::c_int;
sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int3832     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_int3833     pub fn sendfile(
3834         fd: ::c_int,
3835         s: ::c_int,
3836         offset: ::off_t,
3837         len: *mut ::off_t,
3838         hdtr: *mut ::sf_hdtr,
3839         flags: ::c_int,
3840     ) -> ::c_int;
futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int3841     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_int3842     pub fn utimensat(
3843         dirfd: ::c_int,
3844         path: *const ::c_char,
3845         times: *const ::timespec,
3846         flag: ::c_int,
3847     ) -> ::c_int;
openpty( amaster: *mut ::c_int, aslave: *mut ::c_int, name: *mut ::c_char, termp: *mut termios, winp: *mut ::winsize, ) -> ::c_int3848     pub fn openpty(
3849         amaster: *mut ::c_int,
3850         aslave: *mut ::c_int,
3851         name: *mut ::c_char,
3852         termp: *mut termios,
3853         winp: *mut ::winsize,
3854     ) -> ::c_int;
forkpty( amaster: *mut ::c_int, name: *mut ::c_char, termp: *mut termios, winp: *mut ::winsize, ) -> ::pid_t3855     pub fn forkpty(
3856         amaster: *mut ::c_int,
3857         name: *mut ::c_char,
3858         termp: *mut termios,
3859         winp: *mut ::winsize,
3860     ) -> ::pid_t;
login_tty(fd: ::c_int) -> ::c_int3861     pub fn login_tty(fd: ::c_int) -> ::c_int;
duplocale(base: ::locale_t) -> ::locale_t3862     pub fn duplocale(base: ::locale_t) -> ::locale_t;
freelocale(loc: ::locale_t) -> ::c_int3863     pub fn freelocale(loc: ::locale_t) -> ::c_int;
localeconv_l(loc: ::locale_t) -> *mut lconv3864     pub fn localeconv_l(loc: ::locale_t) -> *mut lconv;
newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t3865     pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
uselocale(loc: ::locale_t) -> ::locale_t3866     pub fn uselocale(loc: ::locale_t) -> ::locale_t;
querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char3867     pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
getpriority(which: ::c_int, who: ::id_t) -> ::c_int3868     pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int3869     pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int3870     pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int3871     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_t3872     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_t3873     pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
3874         -> ::ssize_t;
getxattr( path: *const ::c_char, name: *const ::c_char, value: *mut ::c_void, size: ::size_t, position: u32, flags: ::c_int, ) -> ::ssize_t3875     pub fn getxattr(
3876         path: *const ::c_char,
3877         name: *const ::c_char,
3878         value: *mut ::c_void,
3879         size: ::size_t,
3880         position: u32,
3881         flags: ::c_int,
3882     ) -> ::ssize_t;
fgetxattr( filedes: ::c_int, name: *const ::c_char, value: *mut ::c_void, size: ::size_t, position: u32, flags: ::c_int, ) -> ::ssize_t3883     pub fn fgetxattr(
3884         filedes: ::c_int,
3885         name: *const ::c_char,
3886         value: *mut ::c_void,
3887         size: ::size_t,
3888         position: u32,
3889         flags: ::c_int,
3890     ) -> ::ssize_t;
setxattr( path: *const ::c_char, name: *const ::c_char, value: *const ::c_void, size: ::size_t, position: u32, flags: ::c_int, ) -> ::c_int3891     pub fn setxattr(
3892         path: *const ::c_char,
3893         name: *const ::c_char,
3894         value: *const ::c_void,
3895         size: ::size_t,
3896         position: u32,
3897         flags: ::c_int,
3898     ) -> ::c_int;
fsetxattr( filedes: ::c_int, name: *const ::c_char, value: *const ::c_void, size: ::size_t, position: u32, flags: ::c_int, ) -> ::c_int3899     pub fn fsetxattr(
3900         filedes: ::c_int,
3901         name: *const ::c_char,
3902         value: *const ::c_void,
3903         size: ::size_t,
3904         position: u32,
3905         flags: ::c_int,
3906     ) -> ::c_int;
listxattr( path: *const ::c_char, list: *mut ::c_char, size: ::size_t, flags: ::c_int, ) -> ::ssize_t3907     pub fn listxattr(
3908         path: *const ::c_char,
3909         list: *mut ::c_char,
3910         size: ::size_t,
3911         flags: ::c_int,
3912     ) -> ::ssize_t;
flistxattr( filedes: ::c_int, list: *mut ::c_char, size: ::size_t, flags: ::c_int, ) -> ::ssize_t3913     pub fn flistxattr(
3914         filedes: ::c_int,
3915         list: *mut ::c_char,
3916         size: ::size_t,
3917         flags: ::c_int,
3918     ) -> ::ssize_t;
removexattr(path: *const ::c_char, name: *const ::c_char, flags: ::c_int) -> ::c_int3919     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_int3920     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_int3921     pub fn renameatx_np(
3922         fromfd: ::c_int,
3923         from: *const ::c_char,
3924         tofd: ::c_int,
3925         to: *const ::c_char,
3926         flags: ::c_uint,
3927     ) -> ::c_int;
fremovexattr(filedes: ::c_int, name: *const ::c_char, flags: ::c_int) -> ::c_int3928     pub fn fremovexattr(filedes: ::c_int, name: *const ::c_char, flags: ::c_int) -> ::c_int;
3929 
getgrouplist( name: *const ::c_char, basegid: ::c_int, groups: *mut ::c_int, ngroups: *mut ::c_int, ) -> ::c_int3930     pub fn getgrouplist(
3931         name: *const ::c_char,
3932         basegid: ::c_int,
3933         groups: *mut ::c_int,
3934         ngroups: *mut ::c_int,
3935     ) -> ::c_int;
initgroups(user: *const ::c_char, basegroup: ::c_int) -> ::c_int3936     pub fn initgroups(user: *const ::c_char, basegroup: ::c_int) -> ::c_int;
3937 
3938     #[cfg_attr(
3939         all(target_os = "macos", target_arch = "x86"),
3940         link_name = "waitid$UNIX2003"
3941     )]
waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int) -> ::c_int3942     pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
3943         -> ::c_int;
brk(addr: *const ::c_void) -> *mut ::c_void3944     pub fn brk(addr: *const ::c_void) -> *mut ::c_void;
sbrk(increment: ::c_int) -> *mut ::c_void3945     pub fn sbrk(increment: ::c_int) -> *mut ::c_void;
settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int3946     pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
3947     #[deprecated(since = "0.2.55", note = "Use the mach crate")]
_dyld_image_count() -> u323948     pub fn _dyld_image_count() -> u32;
3949     #[deprecated(since = "0.2.55", note = "Use the mach crate")]
3950     #[allow(deprecated)]
_dyld_get_image_header(image_index: u32) -> *const mach_header3951     pub fn _dyld_get_image_header(image_index: u32) -> *const mach_header;
3952     #[deprecated(since = "0.2.55", note = "Use the mach crate")]
_dyld_get_image_vmaddr_slide(image_index: u32) -> ::intptr_t3953     pub fn _dyld_get_image_vmaddr_slide(image_index: u32) -> ::intptr_t;
3954     #[deprecated(since = "0.2.55", note = "Use the mach crate")]
_dyld_get_image_name(image_index: u32) -> *const ::c_char3955     pub fn _dyld_get_image_name(image_index: u32) -> *const ::c_char;
3956 
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_int3957     pub fn posix_spawn(
3958         pid: *mut ::pid_t,
3959         path: *const ::c_char,
3960         file_actions: *const ::posix_spawn_file_actions_t,
3961         attrp: *const ::posix_spawnattr_t,
3962         argv: *const *mut ::c_char,
3963         envp: *const *mut ::c_char,
3964     ) -> ::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_int3965     pub fn posix_spawnp(
3966         pid: *mut ::pid_t,
3967         file: *const ::c_char,
3968         file_actions: *const ::posix_spawn_file_actions_t,
3969         attrp: *const ::posix_spawnattr_t,
3970         argv: *const *mut ::c_char,
3971         envp: *const *mut ::c_char,
3972     ) -> ::c_int;
posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int3973     pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int3974     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_int3975     pub fn posix_spawnattr_getsigdefault(
3976         attr: *const posix_spawnattr_t,
3977         default: *mut ::sigset_t,
3978     ) -> ::c_int;
posix_spawnattr_setsigdefault( attr: *mut posix_spawnattr_t, default: *const ::sigset_t, ) -> ::c_int3979     pub fn posix_spawnattr_setsigdefault(
3980         attr: *mut posix_spawnattr_t,
3981         default: *const ::sigset_t,
3982     ) -> ::c_int;
posix_spawnattr_getsigmask( attr: *const posix_spawnattr_t, default: *mut ::sigset_t, ) -> ::c_int3983     pub fn posix_spawnattr_getsigmask(
3984         attr: *const posix_spawnattr_t,
3985         default: *mut ::sigset_t,
3986     ) -> ::c_int;
posix_spawnattr_setsigmask( attr: *mut posix_spawnattr_t, default: *const ::sigset_t, ) -> ::c_int3987     pub fn posix_spawnattr_setsigmask(
3988         attr: *mut posix_spawnattr_t,
3989         default: *const ::sigset_t,
3990     ) -> ::c_int;
posix_spawnattr_getflags( attr: *const posix_spawnattr_t, flags: *mut ::c_short, ) -> ::c_int3991     pub fn posix_spawnattr_getflags(
3992         attr: *const posix_spawnattr_t,
3993         flags: *mut ::c_short,
3994     ) -> ::c_int;
posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int3995     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_int3996     pub fn posix_spawnattr_getpgroup(
3997         attr: *const posix_spawnattr_t,
3998         flags: *mut ::pid_t,
3999     ) -> ::c_int;
posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int4000     pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
4001 
posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int4002     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_int4003     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_int4004     pub fn posix_spawn_file_actions_addopen(
4005         actions: *mut posix_spawn_file_actions_t,
4006         fd: ::c_int,
4007         path: *const ::c_char,
4008         oflag: ::c_int,
4009         mode: ::mode_t,
4010     ) -> ::c_int;
posix_spawn_file_actions_addclose( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, ) -> ::c_int4011     pub fn posix_spawn_file_actions_addclose(
4012         actions: *mut posix_spawn_file_actions_t,
4013         fd: ::c_int,
4014     ) -> ::c_int;
posix_spawn_file_actions_adddup2( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, newfd: ::c_int, ) -> ::c_int4015     pub fn posix_spawn_file_actions_adddup2(
4016         actions: *mut posix_spawn_file_actions_t,
4017         fd: ::c_int,
4018         newfd: ::c_int,
4019     ) -> ::c_int;
uname(buf: *mut ::utsname) -> ::c_int4020     pub fn uname(buf: *mut ::utsname) -> ::c_int;
4021 
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_int4022     pub fn connectx(
4023         socket: ::c_int,
4024         endpoints: *const sa_endpoints_t,
4025         associd: sae_associd_t,
4026         flags: ::c_uint,
4027         iov: *const ::iovec,
4028         iovcnt: ::c_uint,
4029         len: *mut ::size_t,
4030         connid: *mut sae_connid_t,
4031     ) -> ::c_int;
disconnectx(socket: ::c_int, associd: sae_associd_t, connid: sae_connid_t) -> ::c_int4032     pub fn disconnectx(socket: ::c_int, associd: sae_associd_t, connid: sae_connid_t) -> ::c_int;
4033 
ntp_adjtime(buf: *mut timex) -> ::c_int4034     pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
ntp_gettime(buf: *mut ntptimeval) -> ::c_int4035     pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
4036 
4037     #[cfg_attr(
4038         all(target_os = "macos", not(target_arch = "aarch64")),
4039         link_name = "getmntinfo$INODE64"
4040     )]
getmntinfo(mntbufp: *mut *mut statfs, flags: ::c_int) -> ::c_int4041     pub fn getmntinfo(mntbufp: *mut *mut statfs, flags: ::c_int) -> ::c_int;
4042     #[cfg_attr(
4043         all(target_os = "macos", not(target_arch = "aarch64")),
4044         link_name = "getfsstat$INODE64"
4045     )]
getfsstat(mntbufp: *mut statfs, bufsize: ::c_int, flags: ::c_int) -> ::c_int4046     pub fn getfsstat(mntbufp: *mut statfs, bufsize: ::c_int, flags: ::c_int) -> ::c_int;
4047 
4048     // Copy-on-write functions.
4049     // According to the man page `flags` is an `int` but in the header
4050     // this is a `uint32_t`.
clonefile(src: *const ::c_char, dst: *const ::c_char, flags: u32) -> ::c_int4051     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_int4052     pub fn clonefileat(
4053         src_dirfd: ::c_int,
4054         src: *const ::c_char,
4055         dst_dirfd: ::c_int,
4056         dst: *const ::c_char,
4057         flags: u32,
4058     ) -> ::c_int;
fclonefileat( srcfd: ::c_int, dst_dirfd: ::c_int, dst: *const ::c_char, flags: u32, ) -> ::c_int4059     pub fn fclonefileat(
4060         srcfd: ::c_int,
4061         dst_dirfd: ::c_int,
4062         dst: *const ::c_char,
4063         flags: u32,
4064     ) -> ::c_int;
4065 
4066     // Added in macOS 10.13
4067     // 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_int4068     pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
4069     // Added in macOS 10.5
memset_pattern4(b: *mut ::c_void, pattern4: *const ::c_void, len: ::size_t)4070     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)4071     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)4072     pub fn memset_pattern16(b: *mut ::c_void, pattern16: *const ::c_void, len: ::size_t);
4073 
mstats() -> mstats4074     pub fn mstats() -> mstats;
4075 
proc_listpids( t: u32, typeinfo: u32, buffer: *mut ::c_void, buffersize: ::c_int, ) -> ::c_int4076     pub fn proc_listpids(
4077         t: u32,
4078         typeinfo: u32,
4079         buffer: *mut ::c_void,
4080         buffersize: ::c_int,
4081     ) -> ::c_int;
proc_listallpids(buffer: *mut ::c_void, buffersize: ::c_int) -> ::c_int4082     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_int4083     pub fn proc_listpgrppids(
4084         pgrpid: ::pid_t,
4085         buffer: *mut ::c_void,
4086         buffersize: ::c_int,
4087     ) -> ::c_int;
proc_listchildpids(ppid: ::pid_t, buffer: *mut ::c_void, buffersize: ::c_int) -> ::c_int4088     pub fn proc_listchildpids(ppid: ::pid_t, buffer: *mut ::c_void, buffersize: ::c_int)
4089         -> ::c_int;
proc_pidinfo( pid: ::c_int, flavor: ::c_int, arg: u64, buffer: *mut ::c_void, buffersize: ::c_int, ) -> ::c_int4090     pub fn proc_pidinfo(
4091         pid: ::c_int,
4092         flavor: ::c_int,
4093         arg: u64,
4094         buffer: *mut ::c_void,
4095         buffersize: ::c_int,
4096     ) -> ::c_int;
proc_pidfdinfo( pid: ::c_int, fd: ::c_int, flavor: ::c_int, buffer: *mut ::c_void, buffersize: ::c_int, ) -> ::c_int4097     pub fn proc_pidfdinfo(
4098         pid: ::c_int,
4099         fd: ::c_int,
4100         flavor: ::c_int,
4101         buffer: *mut ::c_void,
4102         buffersize: ::c_int,
4103     ) -> ::c_int;
proc_pidfileportinfo( pid: ::c_int, fileport: u32, flavor: ::c_int, buffer: *mut ::c_void, buffersize: ::c_int, ) -> ::c_int4104     pub fn proc_pidfileportinfo(
4105         pid: ::c_int,
4106         fileport: u32,
4107         flavor: ::c_int,
4108         buffer: *mut ::c_void,
4109         buffersize: ::c_int,
4110     ) -> ::c_int;
proc_pidpath(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int4111     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_int4112     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_int4113     pub fn proc_regionfilename(
4114         pid: ::c_int,
4115         address: u64,
4116         buffer: *mut ::c_void,
4117         buffersize: u32,
4118     ) -> ::c_int;
proc_libversion(major: *mut ::c_int, mintor: *mut ::c_int) -> ::c_int4119     pub fn proc_libversion(major: *mut ::c_int, mintor: *mut ::c_int) -> ::c_int;
4120     /// # Notes
4121     ///
4122     /// `id` is of type [`uuid_t`].
gethostuuid(id: *mut u8, timeout: *const ::timespec) -> ::c_int4123     pub fn gethostuuid(id: *mut u8, timeout: *const ::timespec) -> ::c_int;
4124 }
4125 
4126 cfg_if! {
4127     if #[cfg(target_os = "macos")] {
4128         extern "C" {
4129             pub fn memmem(
4130                 haystack: *const ::c_void,
4131                 haystacklen: ::size_t,
4132                 needle: *const ::c_void,
4133                 needlelen: ::size_t,
4134             ) -> *mut ::c_void;
4135         }
4136     }
4137 }
4138 
4139 #[link(name = "iconv")]
4140 extern "C" {
iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t4141     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_t4142     pub fn iconv(
4143         cd: iconv_t,
4144         inbuf: *mut *mut ::c_char,
4145         inbytesleft: *mut ::size_t,
4146         outbuf: *mut *mut ::c_char,
4147         outbytesleft: *mut ::size_t,
4148     ) -> ::size_t;
iconv_close(cd: iconv_t) -> ::c_int4149     pub fn iconv_close(cd: iconv_t) -> ::c_int;
4150 }
4151 
4152 cfg_if! {
4153     if #[cfg(any(target_arch = "arm", target_arch = "x86"))] {
4154         mod b32;
4155         pub use self::b32::*;
4156     } else if #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] {
4157         mod b64;
4158         pub use self::b64::*;
4159     } else {
4160         // Unknown target_arch
4161     }
4162 }
4163