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