1 pub type clock_t = ::c_uint;
2 pub type suseconds_t = ::c_int;
3 pub type dev_t = u64;
4 pub type blksize_t = i32;
5 pub type fsblkcnt_t = u64;
6 pub type fsfilcnt_t = u64;
7 pub type idtype_t = ::c_int;
8 pub type mqd_t = ::c_int;
9 type __pthread_spin_t = __cpu_simple_lock_nv_t;
10 pub type vm_size_t = ::uintptr_t; // FIXME: deprecated since long time
11 pub type lwpid_t = ::c_uint;
12 pub type shmatt_t = ::c_uint;
13 pub type cpuid_t = u64;
14 pub type cpuset_t = _cpuset;
15 pub type pthread_spin_t = ::c_uchar;
16 pub type timer_t = ::c_int;
17 
18 // elf.h
19 
20 pub type Elf32_Addr = u32;
21 pub type Elf32_Half = u16;
22 pub type Elf32_Lword = u64;
23 pub type Elf32_Off = u32;
24 pub type Elf32_Sword = i32;
25 pub type Elf32_Word = u32;
26 
27 pub type Elf64_Addr = u64;
28 pub type Elf64_Half = u16;
29 pub type Elf64_Lword = u64;
30 pub type Elf64_Off = u64;
31 pub type Elf64_Sword = i32;
32 pub type Elf64_Sxword = i64;
33 pub type Elf64_Word = u32;
34 pub type Elf64_Xword = u64;
35 
36 pub type iconv_t = *mut ::c_void;
37 
38 e! {
39     pub enum fae_action {
40         FAE_OPEN,
41         FAE_DUP2,
42         FAE_CLOSE,
43     }
44 }
45 
46 cfg_if! {
47     if #[cfg(target_pointer_width = "64")] {
48         type Elf_Addr = Elf64_Addr;
49         type Elf_Half = Elf64_Half;
50         type Elf_Phdr = Elf64_Phdr;
51     } else if #[cfg(target_pointer_width = "32")] {
52         type Elf_Addr = Elf32_Addr;
53         type Elf_Half = Elf32_Half;
54         type Elf_Phdr = Elf32_Phdr;
55     }
56 }
57 
58 impl siginfo_t {
si_addr(&self) -> *mut ::c_void59     pub unsafe fn si_addr(&self) -> *mut ::c_void {
60         self.si_addr
61     }
62 
si_value(&self) -> ::sigval63     pub unsafe fn si_value(&self) -> ::sigval {
64         #[repr(C)]
65         struct siginfo_timer {
66             _si_signo: ::c_int,
67             _si_errno: ::c_int,
68             _si_code: ::c_int,
69             __pad1: ::c_int,
70             _pid: ::pid_t,
71             _uid: ::uid_t,
72             value: ::sigval,
73         }
74         (*(self as *const siginfo_t as *const siginfo_timer)).value
75     }
76 
si_status(&self) -> ::c_int77     pub unsafe fn si_status(&self) -> ::c_int {
78         #[repr(C)]
79         struct siginfo_timer {
80             _si_signo: ::c_int,
81             _si_errno: ::c_int,
82             _si_code: ::c_int,
83             __pad1: ::c_int,
84             _pid: ::pid_t,
85             _uid: ::uid_t,
86             _value: ::sigval,
87             _cpid: ::pid_t,
88             _cuid: ::uid_t,
89             status: ::c_int,
90         }
91         (*(self as *const siginfo_t as *const siginfo_timer)).status
92     }
93 }
94 
95 s! {
96     pub struct aiocb {
97         pub aio_offset: ::off_t,
98         pub aio_buf: *mut ::c_void,
99         pub aio_nbytes: ::size_t,
100         pub aio_fildes: ::c_int,
101         pub aio_lio_opcode: ::c_int,
102         pub aio_reqprio: ::c_int,
103         pub aio_sigevent: ::sigevent,
104         _state: ::c_int,
105         _errno: ::c_int,
106         _retval: ::ssize_t
107     }
108 
109     pub struct glob_t {
110         pub gl_pathc:   ::size_t,
111         pub gl_matchc:  ::size_t,
112         pub gl_offs:    ::size_t,
113         pub gl_flags:   ::c_int,
114         pub gl_pathv:   *mut *mut ::c_char,
115 
116         __unused3: *mut ::c_void,
117 
118         __unused4: *mut ::c_void,
119         __unused5: *mut ::c_void,
120         __unused6: *mut ::c_void,
121         __unused7: *mut ::c_void,
122         __unused8: *mut ::c_void,
123     }
124 
125     pub struct mq_attr {
126         pub mq_flags: ::c_long,
127         pub mq_maxmsg: ::c_long,
128         pub mq_msgsize: ::c_long,
129         pub mq_curmsgs: ::c_long,
130     }
131 
132     pub struct itimerspec {
133         pub it_interval: ::timespec,
134         pub it_value: ::timespec,
135     }
136 
137     pub struct sigset_t {
138         __bits: [u32; 4],
139     }
140 
141     pub struct stat {
142         pub st_dev: ::dev_t,
143         pub st_mode: ::mode_t,
144         pub st_ino: ::ino_t,
145         pub st_nlink: ::nlink_t,
146         pub st_uid: ::uid_t,
147         pub st_gid: ::gid_t,
148         pub st_rdev: ::dev_t,
149         pub st_atime: ::time_t,
150         pub st_atimensec: ::c_long,
151         pub st_mtime: ::time_t,
152         pub st_mtimensec: ::c_long,
153         pub st_ctime: ::time_t,
154         pub st_ctimensec: ::c_long,
155         pub st_birthtime: ::time_t,
156         pub st_birthtimensec: ::c_long,
157         pub st_size: ::off_t,
158         pub st_blocks: ::blkcnt_t,
159         pub st_blksize: ::blksize_t,
160         pub st_flags: u32,
161         pub st_gen: u32,
162         pub st_spare: [u32; 2],
163     }
164 
165     pub struct addrinfo {
166         pub ai_flags: ::c_int,
167         pub ai_family: ::c_int,
168         pub ai_socktype: ::c_int,
169         pub ai_protocol: ::c_int,
170         pub ai_addrlen: ::socklen_t,
171         pub ai_canonname: *mut ::c_char,
172         pub ai_addr: *mut ::sockaddr,
173         pub ai_next: *mut ::addrinfo,
174     }
175 
176     pub struct siginfo_t {
177         pub si_signo: ::c_int,
178         pub si_code: ::c_int,
179         pub si_errno: ::c_int,
180         __pad1: ::c_int,
181         pub si_addr: *mut ::c_void,
182         __pad2: [u64; 13],
183     }
184 
185     pub struct pthread_attr_t {
186         pta_magic: ::c_uint,
187         pta_flags: ::c_int,
188         pta_private: *mut ::c_void,
189     }
190 
191     pub struct pthread_mutex_t {
192         ptm_magic: ::c_uint,
193         ptm_errorcheck: __pthread_spin_t,
194         #[cfg(any(target_arch = "sparc", target_arch = "sparc64",
195                   target_arch = "x86", target_arch = "x86_64"))]
196         ptm_pad1: [u8; 3],
197         // actually a union with a non-unused, 0-initialized field
198         ptm_unused: __pthread_spin_t,
199         #[cfg(any(target_arch = "sparc", target_arch = "sparc64",
200                   target_arch = "x86", target_arch = "x86_64"))]
201         ptm_pad2: [u8; 3],
202         ptm_owner: ::pthread_t,
203         ptm_waiters: *mut u8,
204         ptm_recursed: ::c_uint,
205         ptm_spare2: *mut ::c_void,
206     }
207 
208     pub struct pthread_mutexattr_t {
209         ptma_magic: ::c_uint,
210         ptma_private: *mut ::c_void,
211     }
212 
213     pub struct pthread_rwlockattr_t {
214         ptra_magic: ::c_uint,
215         ptra_private: *mut ::c_void,
216     }
217 
218     pub struct pthread_cond_t {
219         ptc_magic: ::c_uint,
220         ptc_lock: __pthread_spin_t,
221         ptc_waiters_first: *mut u8,
222         ptc_waiters_last: *mut u8,
223         ptc_mutex: *mut ::pthread_mutex_t,
224         ptc_private: *mut ::c_void,
225     }
226 
227     pub struct pthread_condattr_t {
228         ptca_magic: ::c_uint,
229         ptca_private: *mut ::c_void,
230     }
231 
232     pub struct pthread_rwlock_t {
233         ptr_magic: ::c_uint,
234         ptr_interlock: __pthread_spin_t,
235         ptr_rblocked_first: *mut u8,
236         ptr_rblocked_last: *mut u8,
237         ptr_wblocked_first: *mut u8,
238         ptr_wblocked_last: *mut u8,
239         ptr_nreaders: ::c_uint,
240         ptr_owner: ::pthread_t,
241         ptr_private: *mut ::c_void,
242     }
243 
244     pub struct pthread_spinlock_t {
245         pts_magic: ::c_uint,
246         pts_spin: ::pthread_spin_t,
247         pts_flags: ::c_int,
248     }
249 
250     pub struct kevent {
251         pub ident: ::uintptr_t,
252         pub filter: u32,
253         pub flags: u32,
254         pub fflags: u32,
255         pub data: i64,
256         pub udata: ::intptr_t, /* FIXME: NetBSD 10.0 will finally have same layout as other BSD */
257     }
258 
259     pub struct dqblk {
260         pub dqb_bhardlimit: u32,
261         pub dqb_bsoftlimit: u32,
262         pub dqb_curblocks: u32,
263         pub dqb_ihardlimit: u32,
264         pub dqb_isoftlimit: u32,
265         pub dqb_curinodes: u32,
266         pub dqb_btime: i32,
267         pub dqb_itime: i32,
268     }
269 
270     pub struct Dl_info {
271         pub dli_fname: *const ::c_char,
272         pub dli_fbase: *mut ::c_void,
273         pub dli_sname: *const ::c_char,
274         pub dli_saddr: *const ::c_void,
275     }
276 
277     pub struct lconv {
278         pub decimal_point: *mut ::c_char,
279         pub thousands_sep: *mut ::c_char,
280         pub grouping: *mut ::c_char,
281         pub int_curr_symbol: *mut ::c_char,
282         pub currency_symbol: *mut ::c_char,
283         pub mon_decimal_point: *mut ::c_char,
284         pub mon_thousands_sep: *mut ::c_char,
285         pub mon_grouping: *mut ::c_char,
286         pub positive_sign: *mut ::c_char,
287         pub negative_sign: *mut ::c_char,
288         pub int_frac_digits: ::c_char,
289         pub frac_digits: ::c_char,
290         pub p_cs_precedes: ::c_char,
291         pub p_sep_by_space: ::c_char,
292         pub n_cs_precedes: ::c_char,
293         pub n_sep_by_space: ::c_char,
294         pub p_sign_posn: ::c_char,
295         pub n_sign_posn: ::c_char,
296         pub int_p_cs_precedes: ::c_char,
297         pub int_n_cs_precedes: ::c_char,
298         pub int_p_sep_by_space: ::c_char,
299         pub int_n_sep_by_space: ::c_char,
300         pub int_p_sign_posn: ::c_char,
301         pub int_n_sign_posn: ::c_char,
302     }
303 
304     pub struct if_data {
305         pub ifi_type: ::c_uchar,
306         pub ifi_addrlen: ::c_uchar,
307         pub ifi_hdrlen: ::c_uchar,
308         pub ifi_link_state: ::c_int,
309         pub ifi_mtu: u64,
310         pub ifi_metric: u64,
311         pub ifi_baudrate: u64,
312         pub ifi_ipackets: u64,
313         pub ifi_ierrors: u64,
314         pub ifi_opackets: u64,
315         pub ifi_oerrors: u64,
316         pub ifi_collisions: u64,
317         pub ifi_ibytes: u64,
318         pub ifi_obytes: u64,
319         pub ifi_imcasts: u64,
320         pub ifi_omcasts: u64,
321         pub ifi_iqdrops: u64,
322         pub ifi_noproto: u64,
323         pub ifi_lastchange: ::timespec,
324     }
325 
326     pub struct if_msghdr {
327         pub ifm_msglen: ::c_ushort,
328         pub ifm_version: ::c_uchar,
329         pub ifm_type: ::c_uchar,
330         pub ifm_addrs: ::c_int,
331         pub ifm_flags: ::c_int,
332         pub ifm_index: ::c_ushort,
333         pub ifm_data: if_data,
334     }
335 
336     pub struct sockcred {
337         pub sc_pid: ::pid_t,
338         pub sc_uid: ::uid_t,
339         pub sc_euid: ::uid_t,
340         pub sc_gid: ::gid_t,
341         pub sc_egid: ::gid_t,
342         pub sc_ngroups: ::c_int,
343         pub sc_groups: [::gid_t; 1],
344     }
345 
346     pub struct uucred {
347         pub cr_unused: ::c_ushort,
348         pub cr_uid: ::uid_t,
349         pub cr_gid: ::gid_t,
350         pub cr_ngroups: ::c_int,
351         pub cr_groups: [::gid_t; NGROUPS_MAX as usize],
352     }
353 
354     pub struct unpcbid {
355         pub unp_pid: ::pid_t,
356         pub unp_euid: ::uid_t,
357         pub unp_egid: ::gid_t,
358     }
359 
360     pub struct sockaddr_dl {
361         pub sdl_len: ::c_uchar,
362         pub sdl_family: ::c_uchar,
363         pub sdl_index: ::c_ushort,
364         pub sdl_type: u8,
365         pub sdl_nlen: u8,
366         pub sdl_alen: u8,
367         pub sdl_slen: u8,
368         pub sdl_data: [::c_char; 12],
369     }
370 
371     pub struct mmsghdr {
372         pub msg_hdr: ::msghdr,
373         pub msg_len: ::c_uint,
374     }
375 
376     pub struct __exit_status {
377         pub e_termination: u16,
378         pub e_exit: u16,
379     }
380 
381     pub struct shmid_ds {
382         pub shm_perm: ::ipc_perm,
383         pub shm_segsz: ::size_t,
384         pub shm_lpid: ::pid_t,
385         pub shm_cpid: ::pid_t,
386         pub shm_nattch: ::shmatt_t,
387         pub shm_atime: ::time_t,
388         pub shm_dtime: ::time_t,
389         pub shm_ctime: ::time_t,
390         _shm_internal: *mut ::c_void,
391     }
392 
393     pub struct utmp {
394         pub ut_line: [::c_char; UT_LINESIZE],
395         pub ut_name: [::c_char; UT_NAMESIZE],
396         pub ut_host: [::c_char; UT_HOSTSIZE],
397         pub ut_time: ::time_t
398     }
399 
400     pub struct lastlog {
401         pub ll_line: [::c_char; UT_LINESIZE],
402         pub ll_host: [::c_char; UT_HOSTSIZE],
403         pub ll_time: ::time_t
404     }
405 
406     pub struct timex {
407         pub modes: ::c_uint,
408         pub offset: ::c_long,
409         pub freq: ::c_long,
410         pub maxerror: ::c_long,
411         pub esterror: ::c_long,
412         pub status: ::c_int,
413         pub constant: ::c_long,
414         pub precision: ::c_long,
415         pub tolerance: ::c_long,
416         pub ppsfreq: ::c_long,
417         pub jitter: ::c_long,
418         pub shift: ::c_int,
419         pub stabil: ::c_long,
420         pub jitcnt: ::c_long,
421         pub calcnt: ::c_long,
422         pub errcnt: ::c_long,
423         pub stbcnt: ::c_long,
424     }
425 
426     pub struct ntptimeval {
427         pub time: ::timespec,
428         pub maxerror: ::c_long,
429         pub esterror: ::c_long,
430         pub tai: ::c_long,
431         pub time_state: ::c_int,
432     }
433 
434     // elf.h
435 
436     pub struct Elf32_Phdr {
437         pub p_type: Elf32_Word,
438         pub p_offset: Elf32_Off,
439         pub p_vaddr: Elf32_Addr,
440         pub p_paddr: Elf32_Addr,
441         pub p_filesz: Elf32_Word,
442         pub p_memsz: Elf32_Word,
443         pub p_flags: Elf32_Word,
444         pub p_align: Elf32_Word,
445     }
446 
447     pub struct Elf64_Phdr {
448         pub p_type: Elf64_Word,
449         pub p_flags: Elf64_Word,
450         pub p_offset: Elf64_Off,
451         pub p_vaddr: Elf64_Addr,
452         pub p_paddr: Elf64_Addr,
453         pub p_filesz: Elf64_Xword,
454         pub p_memsz: Elf64_Xword,
455         pub p_align: Elf64_Xword,
456     }
457 
458     pub struct Aux32Info {
459         pub a_type: Elf32_Word,
460         pub a_v: Elf32_Word,
461     }
462 
463     pub struct Aux64Info {
464         pub a_type: Elf64_Word,
465         pub a_v: Elf64_Xword,
466     }
467 
468     // link.h
469 
470     pub struct dl_phdr_info {
471         pub dlpi_addr: Elf_Addr,
472         pub dlpi_name: *const ::c_char,
473         pub dlpi_phdr: *const Elf_Phdr,
474         pub dlpi_phnum: Elf_Half,
475         pub dlpi_adds: ::c_ulonglong,
476         pub dlpi_subs: ::c_ulonglong,
477         pub dlpi_tls_modid: usize,
478         pub dlpi_tls_data: *mut ::c_void,
479     }
480 
481     pub struct _cpuset {
482         bits: [u32; 0]
483     }
484 
485     pub struct accept_filter_arg {
486         pub af_name: [::c_char; 16],
487         af_arg: [[::c_char; 10]; 24],
488     }
489 
490     pub struct sched_param {
491         pub sched_priority: ::c_int,
492     }
493 
494     pub struct kinfo_vmentry {
495         pub kve_start: u64,
496         pub kve_end: u64,
497         pub kve_offset: u64,
498         pub kve_type: u32,
499         pub kve_flags: u32,
500         pub kve_count: u32,
501         pub kve_wired_count: u32,
502         pub kve_advice: u32,
503         pub kve_attributes: u32,
504         pub kve_protection: u32,
505         pub kve_max_protection: u32,
506         pub kve_ref_count: u32,
507         pub kve_inheritance: u32,
508         pub kve_vn_fileid: u64,
509         pub kve_vn_size: u64,
510         pub kve_vn_fsid: u64,
511         pub kve_vn_rdev: u64,
512         pub kve_vn_type: u32,
513         pub kve_vn_mode: u32,
514         pub kve_path: [[::c_char; 32]; 32],
515     }
516 
517     pub struct __c_anonymous_posix_spawn_fae_open {
518         pub path: *mut ::c_char,
519         pub oflag: ::c_int,
520         pub mode: ::mode_t,
521     }
522 
523     pub struct __c_anonymous_posix_spawn_fae_dup2 {
524         pub newfildes: ::c_int,
525     }
526 
527     pub struct posix_spawnattr_t {
528         pub sa_flags: ::c_short,
529         pub sa_pgroup: ::pid_t,
530         pub sa_schedparam: sched_param,
531         pub sa_schedpolicy: ::c_int,
532         pub sa_sigdefault: sigset_t,
533         pub sa_sigmask: sigset_t,
534     }
535 
536     pub struct posix_spawn_file_actions_entry_t {
537         pub fae_action: fae_action,
538         pub fae_fildes: ::c_int,
539         #[cfg(libc_union)]
540         pub fae_data: __c_anonymous_posix_spawn_fae,
541     }
542 
543     pub struct posix_spawn_file_actions_t {
544         pub size: ::c_uint,
545         pub len: ::c_uint,
546         #[cfg(libc_union)]
547         pub fae: *mut posix_spawn_file_actions_entry_t,
548     }
549 
550     pub struct ptrace_lwpinfo {
551         pub pl_lwpid: lwpid_t,
552         pub pl_event: ::c_int,
553     }
554 
555     pub struct ptrace_lwpstatus {
556         pub pl_lwpid: lwpid_t,
557         pub pl_sigpend: sigset_t,
558         pub pl_sigmask: sigset_t,
559         pub pl_name: [::c_char; 20],
560         pub pl_private: *mut ::c_void,
561     }
562 
563     pub struct ptrace_siginfo {
564         pub psi_siginfo: siginfo_t,
565         pub psi_lwpid: lwpid_t,
566     }
567 
568     pub struct ptrace_event {
569         pub pe_set_event: ::c_int,
570     }
571 
572     pub struct sysctldesc {
573         pub descr_num: i32,
574         pub descr_ver: u32,
575         pub descr_len: u32,
576         pub descr_str: [::c_char; 1],
577     }
578 
579     pub struct ifreq {
580         pub _priv: [[::c_char; 6]; 24],
581     }
582 
583     pub struct ifconf {
584         pub ifc_len: ::c_int,
585         #[cfg(libc_union)]
586         pub ifc_ifcu: __c_anonymous_ifc_ifcu,
587     }
588 }
589 
590 s_no_extra_traits! {
591 
592     pub struct utmpx {
593         pub ut_name: [::c_char; _UTX_USERSIZE],
594         pub ut_id: [::c_char; _UTX_IDSIZE],
595         pub ut_line: [::c_char; _UTX_LINESIZE],
596         pub ut_host: [::c_char; _UTX_HOSTSIZE],
597         pub ut_session: u16,
598         pub ut_type: u16,
599         pub ut_pid: ::pid_t,
600         pub ut_exit: __exit_status, // FIXME: when anonymous struct are supported
601         pub ut_ss: sockaddr_storage,
602         pub ut_tv: ::timeval,
603         pub ut_pad: [u8; _UTX_PADSIZE],
604     }
605 
606     pub struct lastlogx {
607         pub ll_tv: ::timeval,
608         pub ll_line: [::c_char; _UTX_LINESIZE],
609         pub ll_host: [::c_char; _UTX_HOSTSIZE],
610         pub ll_ss: sockaddr_storage,
611     }
612 
613     pub struct in_pktinfo {
614         pub ipi_addr: ::in_addr,
615         pub ipi_ifindex: ::c_uint,
616     }
617 
618     pub struct arphdr {
619         pub ar_hrd: u16,
620         pub ar_pro: u16,
621         pub ar_hln: u8,
622         pub ar_pln: u8,
623         pub ar_op: u16,
624     }
625 
626     pub struct in_addr {
627         pub s_addr: ::in_addr_t,
628     }
629 
630     pub struct ip_mreq {
631         pub imr_multiaddr: in_addr,
632         pub imr_interface: in_addr,
633     }
634 
635     pub struct sockaddr_in {
636         pub sin_len: u8,
637         pub sin_family: ::sa_family_t,
638         pub sin_port: ::in_port_t,
639         pub sin_addr: ::in_addr,
640         pub sin_zero: [i8; 8],
641     }
642 
643     pub struct dirent {
644         pub d_fileno: ::ino_t,
645         pub d_reclen: u16,
646         pub d_namlen: u16,
647         pub d_type: u8,
648         pub d_name: [::c_char; 512],
649     }
650 
651     pub struct statvfs {
652         pub f_flag: ::c_ulong,
653         pub f_bsize: ::c_ulong,
654         pub f_frsize: ::c_ulong,
655         pub f_iosize: ::c_ulong,
656 
657         pub f_blocks: ::fsblkcnt_t,
658         pub f_bfree: ::fsblkcnt_t,
659         pub f_bavail: ::fsblkcnt_t,
660         pub f_bresvd: ::fsblkcnt_t,
661 
662         pub f_files: ::fsfilcnt_t,
663         pub f_ffree: ::fsfilcnt_t,
664         pub f_favail: ::fsfilcnt_t,
665         pub f_fresvd: ::fsfilcnt_t,
666 
667         pub f_syncreads: u64,
668         pub f_syncwrites: u64,
669 
670         pub f_asyncreads: u64,
671         pub f_asyncwrites: u64,
672 
673         pub f_fsidx: ::fsid_t,
674         pub f_fsid: ::c_ulong,
675         pub f_namemax: ::c_ulong,
676         pub f_owner: ::uid_t,
677 
678         pub f_spare: [u32; 4],
679 
680         pub f_fstypename: [::c_char; 32],
681         pub f_mntonname: [::c_char; 1024],
682         pub f_mntfromname: [::c_char; 1024],
683     }
684 
685     pub struct sockaddr_storage {
686         pub ss_len: u8,
687         pub ss_family: ::sa_family_t,
688         __ss_pad1: [u8; 6],
689         __ss_pad2: i64,
690         __ss_pad3: [u8; 112],
691     }
692 
693     pub struct sigevent {
694         pub sigev_notify: ::c_int,
695         pub sigev_signo: ::c_int,
696         pub sigev_value: ::sigval,
697         __unused1: *mut ::c_void,       //actually a function pointer
698         pub sigev_notify_attributes: *mut ::c_void
699     }
700 
701     #[cfg(libc_union)]
702     pub union __c_anonymous_posix_spawn_fae {
703         pub open: __c_anonymous_posix_spawn_fae_open,
704         pub dup2: __c_anonymous_posix_spawn_fae_dup2,
705     }
706 
707     #[cfg(libc_union)]
708     pub union __c_anonymous_ifc_ifcu {
709         pub ifcu_buf: *mut ::c_void,
710         pub ifcu_req: *mut ifreq,
711     }
712 }
713 
714 cfg_if! {
715     if #[cfg(feature = "extra_traits")] {
716         impl PartialEq for utmpx {
717             fn eq(&self, other: &utmpx) -> bool {
718                 self.ut_type == other.ut_type
719                     && self.ut_pid == other.ut_pid
720                     && self.ut_name == other.ut_name
721                     && self.ut_line == other.ut_line
722                     && self.ut_id == other.ut_id
723                     && self.ut_exit == other.ut_exit
724                     && self.ut_session == other.ut_session
725                     && self.ut_tv == other.ut_tv
726                     && self.ut_ss == other.ut_ss
727                     && self
728                     .ut_pad
729                     .iter()
730                     .zip(other.ut_pad.iter())
731                     .all(|(a,b)| a == b)
732                     && self
733                     .ut_host
734                     .iter()
735                     .zip(other.ut_host.iter())
736                     .all(|(a,b)| a == b)
737             }
738         }
739 
740         impl Eq for utmpx {}
741 
742         impl ::fmt::Debug for utmpx {
743             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
744                 f.debug_struct("utmpx")
745                     .field("ut_name", &self.ut_name)
746                     .field("ut_id", &self.ut_id)
747                     .field("ut_line", &self.ut_line)
748                 // FIXME .field("ut_host", &self.ut_host)
749                     .field("ut_session", &self.ut_session)
750                     .field("ut_type", &self.ut_type)
751                     .field("ut_pid", &self.ut_pid)
752                     .field("ut_exit", &self.ut_exit)
753                     .field("ut_ss", &self.ut_ss)
754                     .field("ut_tv", &self.ut_tv)
755                 // FIXME .field("ut_pad", &self.ut_pad)
756                     .finish()
757             }
758         }
759 
760         impl ::hash::Hash for utmpx {
761             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
762                 self.ut_name.hash(state);
763                 self.ut_type.hash(state);
764                 self.ut_pid.hash(state);
765                 self.ut_line.hash(state);
766                 self.ut_id.hash(state);
767                 self.ut_host.hash(state);
768                 self.ut_exit.hash(state);
769                 self.ut_session.hash(state);
770                 self.ut_tv.hash(state);
771                 self.ut_ss.hash(state);
772                 self.ut_pad.hash(state);
773             }
774         }
775 
776         impl PartialEq for lastlogx {
777             fn eq(&self, other: &lastlogx) -> bool {
778                 self.ll_tv == other.ll_tv
779                     && self.ll_line == other.ll_line
780                     && self.ll_ss == other.ll_ss
781                     && self
782                     .ll_host
783                     .iter()
784                     .zip(other.ll_host.iter())
785                     .all(|(a,b)| a == b)
786             }
787         }
788 
789         impl Eq for lastlogx {}
790 
791         impl ::fmt::Debug for lastlogx {
792             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
793                 f.debug_struct("lastlogx")
794                     .field("ll_tv", &self.ll_tv)
795                     .field("ll_line", &self.ll_line)
796                 // FIXME.field("ll_host", &self.ll_host)
797                     .field("ll_ss", &self.ll_ss)
798                     .finish()
799             }
800         }
801 
802         impl ::hash::Hash for lastlogx {
803             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
804                 self.ll_tv.hash(state);
805                 self.ll_line.hash(state);
806                 self.ll_host.hash(state);
807                 self.ll_ss.hash(state);
808             }
809         }
810 
811         impl PartialEq for in_pktinfo {
812             fn eq(&self, other: &in_pktinfo) -> bool {
813                 self.ipi_addr == other.ipi_addr
814                     && self.ipi_ifindex == other.ipi_ifindex
815             }
816         }
817         impl Eq for in_pktinfo {}
818         impl ::fmt::Debug for in_pktinfo {
819             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
820                 f.debug_struct("in_pktinfo")
821                     .field("ipi_addr", &self.ipi_addr)
822                     .field("ipi_ifindex", &self.ipi_ifindex)
823                     .finish()
824             }
825         }
826         impl ::hash::Hash for in_pktinfo {
827             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
828                 self.ipi_addr.hash(state);
829                 self.ipi_ifindex.hash(state);
830             }
831         }
832 
833         impl PartialEq for arphdr {
834             fn eq(&self, other: &arphdr) -> bool {
835                 self.ar_hrd == other.ar_hrd
836                     && self.ar_pro == other.ar_pro
837                     && self.ar_hln == other.ar_hln
838                     && self.ar_pln == other.ar_pln
839                     && self.ar_op == other.ar_op
840             }
841         }
842         impl Eq for arphdr {}
843         impl ::fmt::Debug for arphdr {
844             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
845                 let ar_hrd = self.ar_hrd;
846                 let ar_pro = self.ar_pro;
847                 let ar_op = self.ar_op;
848                 f.debug_struct("arphdr")
849                     .field("ar_hrd", &ar_hrd)
850                     .field("ar_pro", &ar_pro)
851                     .field("ar_hln", &self.ar_hln)
852                     .field("ar_pln", &self.ar_pln)
853                     .field("ar_op", &ar_op)
854                     .finish()
855             }
856         }
857         impl ::hash::Hash for arphdr {
858             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
859                 let ar_hrd = self.ar_hrd;
860                 let ar_pro = self.ar_pro;
861                 let ar_op = self.ar_op;
862                 ar_hrd.hash(state);
863                 ar_pro.hash(state);
864                 self.ar_hln.hash(state);
865                 self.ar_pln.hash(state);
866                 ar_op.hash(state);
867             }
868         }
869 
870         impl PartialEq for in_addr {
871             fn eq(&self, other: &in_addr) -> bool {
872                 self.s_addr == other.s_addr
873             }
874         }
875         impl Eq for in_addr {}
876         impl ::fmt::Debug for in_addr {
877             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
878                 let s_addr = self.s_addr;
879                 f.debug_struct("in_addr")
880                     .field("s_addr", &s_addr)
881                     .finish()
882             }
883         }
884         impl ::hash::Hash for in_addr {
885             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
886                 let s_addr = self.s_addr;
887                 s_addr.hash(state);
888             }
889         }
890 
891         impl PartialEq for ip_mreq {
892             fn eq(&self, other: &ip_mreq) -> bool {
893                 self.imr_multiaddr == other.imr_multiaddr
894                     && self.imr_interface == other.imr_interface
895             }
896         }
897         impl Eq for ip_mreq {}
898         impl ::fmt::Debug for ip_mreq {
899             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
900                 f.debug_struct("ip_mreq")
901                     .field("imr_multiaddr", &self.imr_multiaddr)
902                     .field("imr_interface", &self.imr_interface)
903                     .finish()
904             }
905         }
906         impl ::hash::Hash for ip_mreq {
907             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
908                 self.imr_multiaddr.hash(state);
909                 self.imr_interface.hash(state);
910             }
911         }
912 
913         impl PartialEq for sockaddr_in {
914             fn eq(&self, other: &sockaddr_in) -> bool {
915                 self.sin_len == other.sin_len
916                     && self.sin_family == other.sin_family
917                     && self.sin_port == other.sin_port
918                     && self.sin_addr == other.sin_addr
919                     && self.sin_zero == other.sin_zero
920             }
921         }
922         impl Eq for sockaddr_in {}
923         impl ::fmt::Debug for sockaddr_in {
924             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
925                 f.debug_struct("sockaddr_in")
926                     .field("sin_len", &self.sin_len)
927                     .field("sin_family", &self.sin_family)
928                     .field("sin_port", &self.sin_port)
929                     .field("sin_addr", &self.sin_addr)
930                     .field("sin_zero", &self.sin_zero)
931                     .finish()
932             }
933         }
934         impl ::hash::Hash for sockaddr_in {
935             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
936                 self.sin_len.hash(state);
937                 self.sin_family.hash(state);
938                 self.sin_port.hash(state);
939                 self.sin_addr.hash(state);
940                 self.sin_zero.hash(state);
941             }
942         }
943 
944         impl PartialEq for dirent {
945             fn eq(&self, other: &dirent) -> bool {
946                 self.d_fileno == other.d_fileno
947                     && self.d_reclen == other.d_reclen
948                     && self.d_namlen == other.d_namlen
949                     && self.d_type == other.d_type
950                     && self
951                     .d_name
952                     .iter()
953                     .zip(other.d_name.iter())
954                     .all(|(a,b)| a == b)
955             }
956         }
957         impl Eq for dirent {}
958         impl ::fmt::Debug for dirent {
959             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
960                 f.debug_struct("dirent")
961                     .field("d_fileno", &self.d_fileno)
962                     .field("d_reclen", &self.d_reclen)
963                     .field("d_namlen", &self.d_namlen)
964                     .field("d_type", &self.d_type)
965                     // FIXME: .field("d_name", &self.d_name)
966                     .finish()
967             }
968         }
969         impl ::hash::Hash for dirent {
970             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
971                 self.d_fileno.hash(state);
972                 self.d_reclen.hash(state);
973                 self.d_namlen.hash(state);
974                 self.d_type.hash(state);
975                 self.d_name.hash(state);
976             }
977         }
978 
979         impl PartialEq for statvfs {
980             fn eq(&self, other: &statvfs) -> bool {
981                 self.f_flag == other.f_flag
982                     && self.f_bsize == other.f_bsize
983                     && self.f_frsize == other.f_frsize
984                     && self.f_iosize == other.f_iosize
985                     && self.f_blocks == other.f_blocks
986                     && self.f_bfree == other.f_bfree
987                     && self.f_bavail == other.f_bavail
988                     && self.f_bresvd == other.f_bresvd
989                     && self.f_files == other.f_files
990                     && self.f_ffree == other.f_ffree
991                     && self.f_favail == other.f_favail
992                     && self.f_fresvd == other.f_fresvd
993                     && self.f_syncreads == other.f_syncreads
994                     && self.f_syncwrites == other.f_syncwrites
995                     && self.f_asyncreads == other.f_asyncreads
996                     && self.f_asyncwrites == other.f_asyncwrites
997                     && self.f_fsidx == other.f_fsidx
998                     && self.f_fsid == other.f_fsid
999                     && self.f_namemax == other.f_namemax
1000                     && self.f_owner == other.f_owner
1001                     && self.f_spare == other.f_spare
1002                     && self.f_fstypename == other.f_fstypename
1003                     && self
1004                     .f_mntonname
1005                     .iter()
1006                     .zip(other.f_mntonname.iter())
1007                     .all(|(a,b)| a == b)
1008                     && self
1009                     .f_mntfromname
1010                     .iter()
1011                     .zip(other.f_mntfromname.iter())
1012                     .all(|(a,b)| a == b)
1013             }
1014         }
1015         impl Eq for statvfs {}
1016         impl ::fmt::Debug for statvfs {
1017             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1018                 f.debug_struct("statvfs")
1019                     .field("f_flag", &self.f_flag)
1020                     .field("f_bsize", &self.f_bsize)
1021                     .field("f_frsize", &self.f_frsize)
1022                     .field("f_iosize", &self.f_iosize)
1023                     .field("f_blocks", &self.f_blocks)
1024                     .field("f_bfree", &self.f_bfree)
1025                     .field("f_bavail", &self.f_bavail)
1026                     .field("f_bresvd", &self.f_bresvd)
1027                     .field("f_files", &self.f_files)
1028                     .field("f_ffree", &self.f_ffree)
1029                     .field("f_favail", &self.f_favail)
1030                     .field("f_fresvd", &self.f_fresvd)
1031                     .field("f_syncreads", &self.f_syncreads)
1032                     .field("f_syncwrites", &self.f_syncwrites)
1033                     .field("f_asyncreads", &self.f_asyncreads)
1034                     .field("f_asyncwrites", &self.f_asyncwrites)
1035                     .field("f_fsidx", &self.f_fsidx)
1036                     .field("f_fsid", &self.f_fsid)
1037                     .field("f_namemax", &self.f_namemax)
1038                     .field("f_owner", &self.f_owner)
1039                     .field("f_spare", &self.f_spare)
1040                     .field("f_fstypename", &self.f_fstypename)
1041                     // FIXME: .field("f_mntonname", &self.f_mntonname)
1042                     // FIXME: .field("f_mntfromname", &self.f_mntfromname)
1043                     .finish()
1044             }
1045         }
1046         impl ::hash::Hash for statvfs {
1047             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1048                 self.f_flag.hash(state);
1049                 self.f_bsize.hash(state);
1050                 self.f_frsize.hash(state);
1051                 self.f_iosize.hash(state);
1052                 self.f_blocks.hash(state);
1053                 self.f_bfree.hash(state);
1054                 self.f_bavail.hash(state);
1055                 self.f_bresvd.hash(state);
1056                 self.f_files.hash(state);
1057                 self.f_ffree.hash(state);
1058                 self.f_favail.hash(state);
1059                 self.f_fresvd.hash(state);
1060                 self.f_syncreads.hash(state);
1061                 self.f_syncwrites.hash(state);
1062                 self.f_asyncreads.hash(state);
1063                 self.f_asyncwrites.hash(state);
1064                 self.f_fsidx.hash(state);
1065                 self.f_fsid.hash(state);
1066                 self.f_namemax.hash(state);
1067                 self.f_owner.hash(state);
1068                 self.f_spare.hash(state);
1069                 self.f_fstypename.hash(state);
1070                 self.f_mntonname.hash(state);
1071                 self.f_mntfromname.hash(state);
1072             }
1073         }
1074 
1075         impl PartialEq for sockaddr_storage {
1076             fn eq(&self, other: &sockaddr_storage) -> bool {
1077                 self.ss_len == other.ss_len
1078                     && self.ss_family == other.ss_family
1079                     && self.__ss_pad1 == other.__ss_pad1
1080                     && self.__ss_pad2 == other.__ss_pad2
1081                     && self
1082                     .__ss_pad3
1083                     .iter()
1084                     .zip(other.__ss_pad3.iter())
1085                     .all(|(a,b)| a == b)
1086             }
1087         }
1088         impl Eq for sockaddr_storage {}
1089         impl ::fmt::Debug for sockaddr_storage {
1090             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1091                 f.debug_struct("sockaddr_storage")
1092                     .field("ss_len", &self.ss_len)
1093                     .field("ss_family", &self.ss_family)
1094                     .field("__ss_pad1", &self.__ss_pad1)
1095                     .field("__ss_pad2", &self.__ss_pad2)
1096                     // FIXME: .field("__ss_pad3", &self.__ss_pad3)
1097                     .finish()
1098             }
1099         }
1100         impl ::hash::Hash for sockaddr_storage {
1101             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1102                 self.ss_len.hash(state);
1103                 self.ss_family.hash(state);
1104                 self.__ss_pad1.hash(state);
1105                 self.__ss_pad2.hash(state);
1106                 self.__ss_pad3.hash(state);
1107             }
1108         }
1109 
1110         impl PartialEq for sigevent {
1111             fn eq(&self, other: &sigevent) -> bool {
1112                 self.sigev_notify == other.sigev_notify
1113                     && self.sigev_signo == other.sigev_signo
1114                     && self.sigev_value == other.sigev_value
1115                     && self.sigev_notify_attributes
1116                         == other.sigev_notify_attributes
1117             }
1118         }
1119         impl Eq for sigevent {}
1120         impl ::fmt::Debug for sigevent {
1121             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1122                 f.debug_struct("sigevent")
1123                     .field("sigev_notify", &self.sigev_notify)
1124                     .field("sigev_signo", &self.sigev_signo)
1125                     .field("sigev_value", &self.sigev_value)
1126                     .field("sigev_notify_attributes",
1127                            &self.sigev_notify_attributes)
1128                     .finish()
1129             }
1130         }
1131         impl ::hash::Hash for sigevent {
1132             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1133                 self.sigev_notify.hash(state);
1134                 self.sigev_signo.hash(state);
1135                 self.sigev_value.hash(state);
1136                 self.sigev_notify_attributes.hash(state);
1137             }
1138         }
1139 
1140         #[cfg(libc_union)]
1141         impl Eq for __c_anonymous_posix_spawn_fae {}
1142 
1143         #[cfg(libc_union)]
1144         impl PartialEq for __c_anonymous_posix_spawn_fae {
1145             fn eq(&self, other: &__c_anonymous_posix_spawn_fae) -> bool {
1146                 unsafe {
1147                     self.open == other.open
1148                         || self.dup2 == other.dup2
1149                 }
1150             }
1151         }
1152 
1153         #[cfg(libc_union)]
1154         impl ::fmt::Debug for __c_anonymous_posix_spawn_fae {
1155             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1156                 unsafe {
1157                     f.debug_struct("__c_anonymous_posix_fae")
1158                         .field("open", &self.open)
1159                         .field("dup2", &self.dup2)
1160                         .finish()
1161                 }
1162             }
1163         }
1164 
1165         #[cfg(libc_union)]
1166         impl ::hash::Hash for __c_anonymous_posix_spawn_fae {
1167             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1168                 unsafe {
1169                     self.open.hash(state);
1170                     self.dup2.hash(state);
1171                 }
1172             }
1173         }
1174 
1175         #[cfg(libc_union)]
1176         impl Eq for __c_anonymous_ifc_ifcu {}
1177 
1178         #[cfg(libc_union)]
1179         impl PartialEq for __c_anonymous_ifc_ifcu {
1180             fn eq(&self, other: &__c_anonymous_ifc_ifcu) -> bool {
1181                 unsafe {
1182                     self.ifcu_buf == other.ifcu_buf
1183                         || self.ifcu_req == other.ifcu_req
1184                 }
1185             }
1186         }
1187 
1188         #[cfg(libc_union)]
1189         impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
1190             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1191                 unsafe {
1192                     f.debug_struct("__c_anonymous_ifc_ifcu")
1193                         .field("ifcu_buf", &self.ifcu_buf)
1194                         .field("ifcu_req", &self.ifcu_req)
1195                         .finish()
1196                 }
1197             }
1198         }
1199 
1200         #[cfg(libc_union)]
1201         impl ::hash::Hash for __c_anonymous_ifc_ifcu {
1202             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1203                 unsafe {
1204                     self.ifcu_buf.hash(state);
1205                     self.ifcu_req.hash(state);
1206                 }
1207             }
1208         }
1209     }
1210 }
1211 
1212 pub const AT_FDCWD: ::c_int = -100;
1213 pub const AT_EACCESS: ::c_int = 0x100;
1214 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
1215 pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
1216 pub const AT_REMOVEDIR: ::c_int = 0x800;
1217 
1218 pub const AT_NULL: ::c_int = 0;
1219 pub const AT_IGNORE: ::c_int = 1;
1220 pub const AT_EXECFD: ::c_int = 2;
1221 pub const AT_PHDR: ::c_int = 3;
1222 pub const AT_PHENT: ::c_int = 4;
1223 pub const AT_PHNUM: ::c_int = 5;
1224 pub const AT_PAGESZ: ::c_int = 6;
1225 pub const AT_BASE: ::c_int = 7;
1226 pub const AT_FLAGS: ::c_int = 8;
1227 pub const AT_ENTRY: ::c_int = 9;
1228 pub const AT_DCACHEBSIZE: ::c_int = 10;
1229 pub const AT_ICACHEBSIZE: ::c_int = 11;
1230 pub const AT_UCACHEBSIZE: ::c_int = 12;
1231 pub const AT_STACKBASE: ::c_int = 13;
1232 pub const AT_EUID: ::c_int = 2000;
1233 pub const AT_RUID: ::c_int = 2001;
1234 pub const AT_EGID: ::c_int = 2002;
1235 pub const AT_RGID: ::c_int = 2003;
1236 pub const AT_SUN_LDELF: ::c_int = 2004;
1237 pub const AT_SUN_LDSHDR: ::c_int = 2005;
1238 pub const AT_SUN_LDNAME: ::c_int = 2006;
1239 pub const AT_SUN_LDPGSIZE: ::c_int = 2007;
1240 pub const AT_SUN_PLATFORM: ::c_int = 2008;
1241 pub const AT_SUN_HWCAP: ::c_int = 2009;
1242 pub const AT_SUN_IFLUSH: ::c_int = 2010;
1243 pub const AT_SUN_CPU: ::c_int = 2011;
1244 pub const AT_SUN_EMUL_ENTRY: ::c_int = 2012;
1245 pub const AT_SUN_EMUL_EXECFD: ::c_int = 2013;
1246 pub const AT_SUN_EXECNAME: ::c_int = 2014;
1247 
1248 pub const EXTATTR_NAMESPACE_USER: ::c_int = 1;
1249 pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2;
1250 
1251 pub const LC_COLLATE_MASK: ::c_int = 1 << ::LC_COLLATE;
1252 pub const LC_CTYPE_MASK: ::c_int = 1 << ::LC_CTYPE;
1253 pub const LC_MONETARY_MASK: ::c_int = 1 << ::LC_MONETARY;
1254 pub const LC_NUMERIC_MASK: ::c_int = 1 << ::LC_NUMERIC;
1255 pub const LC_TIME_MASK: ::c_int = 1 << ::LC_TIME;
1256 pub const LC_MESSAGES_MASK: ::c_int = 1 << ::LC_MESSAGES;
1257 pub const LC_ALL_MASK: ::c_int = !0;
1258 
1259 pub const ERA: ::nl_item = 52;
1260 pub const ERA_D_FMT: ::nl_item = 53;
1261 pub const ERA_D_T_FMT: ::nl_item = 54;
1262 pub const ERA_T_FMT: ::nl_item = 55;
1263 pub const ALT_DIGITS: ::nl_item = 56;
1264 
1265 pub const O_CLOEXEC: ::c_int = 0x400000;
1266 pub const O_ALT_IO: ::c_int = 0x40000;
1267 pub const O_NOSIGPIPE: ::c_int = 0x1000000;
1268 pub const O_SEARCH: ::c_int = 0x800000;
1269 pub const O_DIRECTORY: ::c_int = 0x200000;
1270 pub const O_DIRECT: ::c_int = 0x00080000;
1271 pub const O_RSYNC: ::c_int = 0x00020000;
1272 
1273 pub const MS_SYNC: ::c_int = 0x4;
1274 pub const MS_INVALIDATE: ::c_int = 0x2;
1275 
1276 // Here because they are not present on OpenBSD
1277 // (https://github.com/openbsd/src/blob/master/sys/sys/resource.h)
1278 pub const RLIMIT_SBSIZE: ::c_int = 9;
1279 pub const RLIMIT_AS: ::c_int = 10;
1280 pub const RLIMIT_NTHR: ::c_int = 11;
1281 
1282 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
1283 pub const RLIM_NLIMITS: ::c_int = 12;
1284 
1285 pub const EIDRM: ::c_int = 82;
1286 pub const ENOMSG: ::c_int = 83;
1287 pub const EOVERFLOW: ::c_int = 84;
1288 pub const EILSEQ: ::c_int = 85;
1289 pub const ENOTSUP: ::c_int = 86;
1290 pub const ECANCELED: ::c_int = 87;
1291 pub const EBADMSG: ::c_int = 88;
1292 pub const ENODATA: ::c_int = 89;
1293 pub const ENOSR: ::c_int = 90;
1294 pub const ENOSTR: ::c_int = 91;
1295 pub const ETIME: ::c_int = 92;
1296 pub const ENOATTR: ::c_int = 93;
1297 pub const EMULTIHOP: ::c_int = 94;
1298 pub const ENOLINK: ::c_int = 95;
1299 pub const EPROTO: ::c_int = 96;
1300 pub const ELAST: ::c_int = 96;
1301 
1302 pub const F_DUPFD_CLOEXEC: ::c_int = 12;
1303 pub const F_CLOSEM: ::c_int = 10;
1304 pub const F_GETNOSIGPIPE: ::c_int = 13;
1305 pub const F_SETNOSIGPIPE: ::c_int = 14;
1306 pub const F_MAXFD: ::c_int = 11;
1307 pub const F_GETPATH: ::c_int = 15;
1308 
1309 pub const IP_RECVDSTADDR: ::c_int = 7;
1310 pub const IP_SENDSRCADDR: ::c_int = IP_RECVDSTADDR;
1311 pub const IP_RECVIF: ::c_int = 20;
1312 pub const IP_PKTINFO: ::c_int = 25;
1313 pub const IP_RECVPKTINFO: ::c_int = 26;
1314 pub const IPV6_JOIN_GROUP: ::c_int = 12;
1315 pub const IPV6_LEAVE_GROUP: ::c_int = 13;
1316 
1317 pub const TCP_KEEPIDLE: ::c_int = 3;
1318 pub const TCP_KEEPINTVL: ::c_int = 5;
1319 pub const TCP_KEEPCNT: ::c_int = 6;
1320 pub const TCP_KEEPINIT: ::c_int = 7;
1321 pub const TCP_INFO: ::c_int = 9;
1322 pub const TCP_MD5SIG: ::c_int = 0x10;
1323 pub const TCP_CONGCTL: ::c_int = 0x20;
1324 
1325 pub const SOCK_CONN_DGRAM: ::c_int = 6;
1326 pub const SOCK_DCCP: ::c_int = SOCK_CONN_DGRAM;
1327 pub const SOCK_NOSIGPIPE: ::c_int = 0x40000000;
1328 pub const SOCK_FLAGS_MASK: ::c_int = 0xf0000000;
1329 
1330 pub const SO_SNDTIMEO: ::c_int = 0x100b;
1331 pub const SO_RCVTIMEO: ::c_int = 0x100c;
1332 pub const SO_ACCEPTFILTER: ::c_int = 0x1000;
1333 pub const SO_TIMESTAMP: ::c_int = 0x2000;
1334 pub const SO_OVERFLOWED: ::c_int = 0x1009;
1335 pub const SO_NOHEADER: ::c_int = 0x100a;
1336 
1337 // http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/un.h?annotate
1338 pub const LOCAL_OCREDS: ::c_int = 0x0001; // pass credentials to receiver
1339 pub const LOCAL_CONNWAIT: ::c_int = 0x0002; // connects block until accepted
1340 pub const LOCAL_PEEREID: ::c_int = 0x0003; // get peer identification
1341 pub const LOCAL_CREDS: ::c_int = 0x0004; // pass credentials to receiver
1342 
1343 // https://github.com/NetBSD/src/blob/trunk/sys/net/if.h#L373
1344 pub const IFF_UP: ::c_int = 0x0001; // interface is up
1345 pub const IFF_BROADCAST: ::c_int = 0x0002; // broadcast address valid
1346 pub const IFF_DEBUG: ::c_int = 0x0004; // turn on debugging
1347 pub const IFF_LOOPBACK: ::c_int = 0x0008; // is a loopback net
1348 pub const IFF_POINTOPOINT: ::c_int = 0x0010; // interface is point-to-point link
1349 pub const IFF_NOTRAILERS: ::c_int = 0x0020; // avoid use of trailers
1350 pub const IFF_RUNNING: ::c_int = 0x0040; // resources allocated
1351 pub const IFF_NOARP: ::c_int = 0x0080; // no address resolution protocol
1352 pub const IFF_PROMISC: ::c_int = 0x0100; // receive all packets
1353 pub const IFF_ALLMULTI: ::c_int = 0x0200; // receive all multicast packets
1354 pub const IFF_OACTIVE: ::c_int = 0x0400; // transmission in progress
1355 pub const IFF_SIMPLEX: ::c_int = 0x0800; // can't hear own transmissions
1356 pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
1357 pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
1358 pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
1359 pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
1360 
1361 // sys/netinet/in.h
1362 // Protocols (RFC 1700)
1363 // NOTE: These are in addition to the constants defined in src/unix/mod.rs
1364 
1365 // IPPROTO_IP defined in src/unix/mod.rs
1366 /// Hop-by-hop option header
1367 pub const IPPROTO_HOPOPTS: ::c_int = 0;
1368 // IPPROTO_ICMP defined in src/unix/mod.rs
1369 /// group mgmt protocol
1370 pub const IPPROTO_IGMP: ::c_int = 2;
1371 /// gateway^2 (deprecated)
1372 pub const IPPROTO_GGP: ::c_int = 3;
1373 /// for compatibility
1374 pub const IPPROTO_IPIP: ::c_int = 4;
1375 // IPPROTO_TCP defined in src/unix/mod.rs
1376 /// exterior gateway protocol
1377 pub const IPPROTO_EGP: ::c_int = 8;
1378 /// pup
1379 pub const IPPROTO_PUP: ::c_int = 12;
1380 // IPPROTO_UDP defined in src/unix/mod.rs
1381 /// xns idp
1382 pub const IPPROTO_IDP: ::c_int = 22;
1383 /// tp-4 w/ class negotiation
1384 pub const IPPROTO_TP: ::c_int = 29;
1385 /// DCCP
1386 pub const IPPROTO_DCCP: ::c_int = 33;
1387 // IPPROTO_IPV6 defined in src/unix/mod.rs
1388 /// IP6 routing header
1389 pub const IPPROTO_ROUTING: ::c_int = 43;
1390 /// IP6 fragmentation header
1391 pub const IPPROTO_FRAGMENT: ::c_int = 44;
1392 /// resource reservation
1393 pub const IPPROTO_RSVP: ::c_int = 46;
1394 /// General Routing Encap.
1395 pub const IPPROTO_GRE: ::c_int = 47;
1396 /// IP6 Encap Sec. Payload
1397 pub const IPPROTO_ESP: ::c_int = 50;
1398 /// IP6 Auth Header
1399 pub const IPPROTO_AH: ::c_int = 51;
1400 /// IP Mobility RFC 2004
1401 pub const IPPROTO_MOBILE: ::c_int = 55;
1402 /// IPv6 ICMP
1403 pub const IPPROTO_IPV6_ICMP: ::c_int = 58;
1404 // IPPROTO_ICMPV6 defined in src/unix/mod.rs
1405 /// IP6 no next header
1406 pub const IPPROTO_NONE: ::c_int = 59;
1407 /// IP6 destination option
1408 pub const IPPROTO_DSTOPTS: ::c_int = 60;
1409 /// ISO cnlp
1410 pub const IPPROTO_EON: ::c_int = 80;
1411 /// Ethernet-in-IP
1412 pub const IPPROTO_ETHERIP: ::c_int = 97;
1413 /// encapsulation header
1414 pub const IPPROTO_ENCAP: ::c_int = 98;
1415 /// Protocol indep. multicast
1416 pub const IPPROTO_PIM: ::c_int = 103;
1417 /// IP Payload Comp. Protocol
1418 pub const IPPROTO_IPCOMP: ::c_int = 108;
1419 /// VRRP RFC 2338
1420 pub const IPPROTO_VRRP: ::c_int = 112;
1421 /// Common Address Resolution Protocol
1422 pub const IPPROTO_CARP: ::c_int = 112;
1423 /// L2TPv3
1424 // TEMP: Disabled for now; this constant was added to NetBSD on 2017-02-16,
1425 // but isn't yet supported by the NetBSD rumprun kernel image used for
1426 // libc testing.
1427 //pub const IPPROTO_L2TP: ::c_int = 115;
1428 /// SCTP
1429 pub const IPPROTO_SCTP: ::c_int = 132;
1430 /// PFSYNC
1431 pub const IPPROTO_PFSYNC: ::c_int = 240;
1432 pub const IPPROTO_MAX: ::c_int = 256;
1433 
1434 /// last return value of *_input(), meaning "all job for this pkt is done".
1435 pub const IPPROTO_DONE: ::c_int = 257;
1436 
1437 /// sysctl placeholder for (FAST_)IPSEC
1438 pub const CTL_IPPROTO_IPSEC: ::c_int = 258;
1439 
1440 pub const AF_OROUTE: ::c_int = 17;
1441 pub const AF_ARP: ::c_int = 28;
1442 pub const pseudo_AF_KEY: ::c_int = 29;
1443 pub const pseudo_AF_HDRCMPLT: ::c_int = 30;
1444 pub const AF_BLUETOOTH: ::c_int = 31;
1445 pub const AF_IEEE80211: ::c_int = 32;
1446 pub const AF_MPLS: ::c_int = 33;
1447 pub const AF_ROUTE: ::c_int = 34;
1448 pub const NET_RT_DUMP: ::c_int = 1;
1449 pub const NET_RT_FLAGS: ::c_int = 2;
1450 pub const NET_RT_OOOIFLIST: ::c_int = 3;
1451 pub const NET_RT_OOIFLIST: ::c_int = 4;
1452 pub const NET_RT_OIFLIST: ::c_int = 5;
1453 pub const NET_RT_IFLIST: ::c_int = 6;
1454 pub const NET_RT_MAXID: ::c_int = 7;
1455 
1456 pub const PF_OROUTE: ::c_int = AF_OROUTE;
1457 pub const PF_ARP: ::c_int = AF_ARP;
1458 pub const PF_KEY: ::c_int = pseudo_AF_KEY;
1459 pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
1460 pub const PF_MPLS: ::c_int = AF_MPLS;
1461 pub const PF_ROUTE: ::c_int = AF_ROUTE;
1462 
1463 pub const MSG_NBIO: ::c_int = 0x1000;
1464 pub const MSG_WAITFORONE: ::c_int = 0x2000;
1465 pub const MSG_NOTIFICATION: ::c_int = 0x4000;
1466 
1467 pub const SCM_TIMESTAMP: ::c_int = 0x08;
1468 pub const SCM_CREDS: ::c_int = 0x10;
1469 
1470 pub const O_DSYNC: ::c_int = 0x10000;
1471 
1472 pub const MAP_RENAME: ::c_int = 0x20;
1473 pub const MAP_NORESERVE: ::c_int = 0x40;
1474 pub const MAP_HASSEMAPHORE: ::c_int = 0x200;
1475 pub const MAP_WIRED: ::c_int = 0x800;
1476 pub const MAP_STACK: ::c_int = 0x2000;
1477 // map alignment aliases for MAP_ALIGNED
1478 pub const MAP_ALIGNMENT_SHIFT: ::c_int = 24;
1479 pub const MAP_ALIGNMENT_MASK: ::c_int = 0xff << MAP_ALIGNMENT_SHIFT;
1480 pub const MAP_ALIGNMENT_64KB: ::c_int = 16 << MAP_ALIGNMENT_SHIFT;
1481 pub const MAP_ALIGNMENT_16MB: ::c_int = 24 << MAP_ALIGNMENT_SHIFT;
1482 pub const MAP_ALIGNMENT_4GB: ::c_int = 32 << MAP_ALIGNMENT_SHIFT;
1483 pub const MAP_ALIGNMENT_1TB: ::c_int = 40 << MAP_ALIGNMENT_SHIFT;
1484 pub const MAP_ALIGNMENT_256TB: ::c_int = 48 << MAP_ALIGNMENT_SHIFT;
1485 pub const MAP_ALIGNMENT_64PB: ::c_int = 56 << MAP_ALIGNMENT_SHIFT;
1486 // mremap flag
1487 pub const MAP_REMAPDUP: ::c_int = 0x004;
1488 
1489 pub const DCCP_TYPE_REQUEST: ::c_int = 0;
1490 pub const DCCP_TYPE_RESPONSE: ::c_int = 1;
1491 pub const DCCP_TYPE_DATA: ::c_int = 2;
1492 pub const DCCP_TYPE_ACK: ::c_int = 3;
1493 pub const DCCP_TYPE_DATAACK: ::c_int = 4;
1494 pub const DCCP_TYPE_CLOSEREQ: ::c_int = 5;
1495 pub const DCCP_TYPE_CLOSE: ::c_int = 6;
1496 pub const DCCP_TYPE_RESET: ::c_int = 7;
1497 pub const DCCP_TYPE_MOVE: ::c_int = 8;
1498 
1499 pub const DCCP_FEATURE_CC: ::c_int = 1;
1500 pub const DCCP_FEATURE_ECN: ::c_int = 2;
1501 pub const DCCP_FEATURE_ACKRATIO: ::c_int = 3;
1502 pub const DCCP_FEATURE_ACKVECTOR: ::c_int = 4;
1503 pub const DCCP_FEATURE_MOBILITY: ::c_int = 5;
1504 pub const DCCP_FEATURE_LOSSWINDOW: ::c_int = 6;
1505 pub const DCCP_FEATURE_CONN_NONCE: ::c_int = 8;
1506 pub const DCCP_FEATURE_IDENTREG: ::c_int = 7;
1507 
1508 pub const DCCP_OPT_PADDING: ::c_int = 0;
1509 pub const DCCP_OPT_DATA_DISCARD: ::c_int = 1;
1510 pub const DCCP_OPT_SLOW_RECV: ::c_int = 2;
1511 pub const DCCP_OPT_BUF_CLOSED: ::c_int = 3;
1512 pub const DCCP_OPT_CHANGE_L: ::c_int = 32;
1513 pub const DCCP_OPT_CONFIRM_L: ::c_int = 33;
1514 pub const DCCP_OPT_CHANGE_R: ::c_int = 34;
1515 pub const DCCP_OPT_CONFIRM_R: ::c_int = 35;
1516 pub const DCCP_OPT_INIT_COOKIE: ::c_int = 36;
1517 pub const DCCP_OPT_NDP_COUNT: ::c_int = 37;
1518 pub const DCCP_OPT_ACK_VECTOR0: ::c_int = 38;
1519 pub const DCCP_OPT_ACK_VECTOR1: ::c_int = 39;
1520 pub const DCCP_OPT_RECV_BUF_DROPS: ::c_int = 40;
1521 pub const DCCP_OPT_TIMESTAMP: ::c_int = 41;
1522 pub const DCCP_OPT_TIMESTAMP_ECHO: ::c_int = 42;
1523 pub const DCCP_OPT_ELAPSEDTIME: ::c_int = 43;
1524 pub const DCCP_OPT_DATACHECKSUM: ::c_int = 44;
1525 
1526 pub const DCCP_REASON_UNSPEC: ::c_int = 0;
1527 pub const DCCP_REASON_CLOSED: ::c_int = 1;
1528 pub const DCCP_REASON_INVALID: ::c_int = 2;
1529 pub const DCCP_REASON_OPTION_ERR: ::c_int = 3;
1530 pub const DCCP_REASON_FEA_ERR: ::c_int = 4;
1531 pub const DCCP_REASON_CONN_REF: ::c_int = 5;
1532 pub const DCCP_REASON_BAD_SNAME: ::c_int = 6;
1533 pub const DCCP_REASON_BAD_COOKIE: ::c_int = 7;
1534 pub const DCCP_REASON_INV_MOVE: ::c_int = 8;
1535 pub const DCCP_REASON_UNANSW_CH: ::c_int = 10;
1536 pub const DCCP_REASON_FRUITLESS_NEG: ::c_int = 11;
1537 
1538 pub const DCCP_CCID: ::c_int = 1;
1539 pub const DCCP_CSLEN: ::c_int = 2;
1540 pub const DCCP_MAXSEG: ::c_int = 4;
1541 pub const DCCP_SERVICE: ::c_int = 8;
1542 
1543 pub const DCCP_NDP_LIMIT: ::c_int = 16;
1544 pub const DCCP_SEQ_NUM_LIMIT: ::c_int = 16777216;
1545 pub const DCCP_MAX_OPTIONS: ::c_int = 32;
1546 pub const DCCP_MAX_PKTS: ::c_int = 100;
1547 
1548 pub const _PC_LINK_MAX: ::c_int = 1;
1549 pub const _PC_MAX_CANON: ::c_int = 2;
1550 pub const _PC_MAX_INPUT: ::c_int = 3;
1551 pub const _PC_NAME_MAX: ::c_int = 4;
1552 pub const _PC_PATH_MAX: ::c_int = 5;
1553 pub const _PC_PIPE_BUF: ::c_int = 6;
1554 pub const _PC_CHOWN_RESTRICTED: ::c_int = 7;
1555 pub const _PC_NO_TRUNC: ::c_int = 8;
1556 pub const _PC_VDISABLE: ::c_int = 9;
1557 pub const _PC_SYNC_IO: ::c_int = 10;
1558 pub const _PC_FILESIZEBITS: ::c_int = 11;
1559 pub const _PC_SYMLINK_MAX: ::c_int = 12;
1560 pub const _PC_2_SYMLINKS: ::c_int = 13;
1561 pub const _PC_ACL_EXTENDED: ::c_int = 14;
1562 pub const _PC_MIN_HOLE_SIZE: ::c_int = 15;
1563 
1564 pub const _SC_SYNCHRONIZED_IO: ::c_int = 31;
1565 pub const _SC_IOV_MAX: ::c_int = 32;
1566 pub const _SC_MAPPED_FILES: ::c_int = 33;
1567 pub const _SC_MEMLOCK: ::c_int = 34;
1568 pub const _SC_MEMLOCK_RANGE: ::c_int = 35;
1569 pub const _SC_MEMORY_PROTECTION: ::c_int = 36;
1570 pub const _SC_LOGIN_NAME_MAX: ::c_int = 37;
1571 pub const _SC_MONOTONIC_CLOCK: ::c_int = 38;
1572 pub const _SC_CLK_TCK: ::c_int = 39;
1573 pub const _SC_ATEXIT_MAX: ::c_int = 40;
1574 pub const _SC_THREADS: ::c_int = 41;
1575 pub const _SC_SEMAPHORES: ::c_int = 42;
1576 pub const _SC_BARRIERS: ::c_int = 43;
1577 pub const _SC_TIMERS: ::c_int = 44;
1578 pub const _SC_SPIN_LOCKS: ::c_int = 45;
1579 pub const _SC_READER_WRITER_LOCKS: ::c_int = 46;
1580 pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 47;
1581 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 48;
1582 pub const _SC_CLOCK_SELECTION: ::c_int = 49;
1583 pub const _SC_ASYNCHRONOUS_IO: ::c_int = 50;
1584 pub const _SC_AIO_LISTIO_MAX: ::c_int = 51;
1585 pub const _SC_AIO_MAX: ::c_int = 52;
1586 pub const _SC_MESSAGE_PASSING: ::c_int = 53;
1587 pub const _SC_MQ_OPEN_MAX: ::c_int = 54;
1588 pub const _SC_MQ_PRIO_MAX: ::c_int = 55;
1589 pub const _SC_PRIORITY_SCHEDULING: ::c_int = 56;
1590 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 57;
1591 pub const _SC_THREAD_KEYS_MAX: ::c_int = 58;
1592 pub const _SC_THREAD_STACK_MIN: ::c_int = 59;
1593 pub const _SC_THREAD_THREADS_MAX: ::c_int = 60;
1594 pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 61;
1595 pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 62;
1596 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 63;
1597 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 64;
1598 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 65;
1599 pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 66;
1600 pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 67;
1601 pub const _SC_TTY_NAME_MAX: ::c_int = 68;
1602 pub const _SC_HOST_NAME_MAX: ::c_int = 69;
1603 pub const _SC_PASS_MAX: ::c_int = 70;
1604 pub const _SC_REGEXP: ::c_int = 71;
1605 pub const _SC_SHELL: ::c_int = 72;
1606 pub const _SC_SYMLOOP_MAX: ::c_int = 73;
1607 pub const _SC_V6_ILP32_OFF32: ::c_int = 74;
1608 pub const _SC_V6_ILP32_OFFBIG: ::c_int = 75;
1609 pub const _SC_V6_LP64_OFF64: ::c_int = 76;
1610 pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 77;
1611 pub const _SC_2_PBS: ::c_int = 80;
1612 pub const _SC_2_PBS_ACCOUNTING: ::c_int = 81;
1613 pub const _SC_2_PBS_CHECKPOINT: ::c_int = 82;
1614 pub const _SC_2_PBS_LOCATE: ::c_int = 83;
1615 pub const _SC_2_PBS_MESSAGE: ::c_int = 84;
1616 pub const _SC_2_PBS_TRACK: ::c_int = 85;
1617 pub const _SC_SPAWN: ::c_int = 86;
1618 pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 87;
1619 pub const _SC_TIMER_MAX: ::c_int = 88;
1620 pub const _SC_SEM_NSEMS_MAX: ::c_int = 89;
1621 pub const _SC_CPUTIME: ::c_int = 90;
1622 pub const _SC_THREAD_CPUTIME: ::c_int = 91;
1623 pub const _SC_DELAYTIMER_MAX: ::c_int = 92;
1624 // These two variables will be supported in NetBSD 8.0
1625 // pub const _SC_SIGQUEUE_MAX : ::c_int = 93;
1626 // pub const _SC_REALTIME_SIGNALS : ::c_int = 94;
1627 pub const _SC_PHYS_PAGES: ::c_int = 121;
1628 pub const _SC_NPROCESSORS_CONF: ::c_int = 1001;
1629 pub const _SC_NPROCESSORS_ONLN: ::c_int = 1002;
1630 pub const _SC_SCHED_RT_TS: ::c_int = 2001;
1631 pub const _SC_SCHED_PRI_MIN: ::c_int = 2002;
1632 pub const _SC_SCHED_PRI_MAX: ::c_int = 2003;
1633 
1634 pub const FD_SETSIZE: usize = 0x100;
1635 
1636 pub const ST_NOSUID: ::c_ulong = 8;
1637 
1638 pub const BIOCGRSIG: ::c_ulong = 0x40044272;
1639 pub const BIOCSRSIG: ::c_ulong = 0x80044273;
1640 pub const BIOCSDLT: ::c_ulong = 0x80044278;
1641 pub const BIOCGSEESENT: ::c_ulong = 0x40044276;
1642 pub const BIOCSSEESENT: ::c_ulong = 0x80044277;
1643 
1644 //<sys/timex.h>
1645 pub const NTP_API: ::c_int = 4;
1646 pub const MAXPHASE: ::c_long = 500000000;
1647 pub const MAXFREQ: ::c_long = 500000;
1648 pub const MINSEC: ::c_int = 256;
1649 pub const MAXSEC: ::c_int = 2048;
1650 pub const NANOSECOND: ::c_long = 1000000000;
1651 pub const SCALE_PPM: ::c_int = 65;
1652 pub const MAXTC: ::c_int = 10;
1653 pub const MOD_OFFSET: ::c_uint = 0x0001;
1654 pub const MOD_FREQUENCY: ::c_uint = 0x0002;
1655 pub const MOD_MAXERROR: ::c_uint = 0x0004;
1656 pub const MOD_ESTERROR: ::c_uint = 0x0008;
1657 pub const MOD_STATUS: ::c_uint = 0x0010;
1658 pub const MOD_TIMECONST: ::c_uint = 0x0020;
1659 pub const MOD_PPSMAX: ::c_uint = 0x0040;
1660 pub const MOD_TAI: ::c_uint = 0x0080;
1661 pub const MOD_MICRO: ::c_uint = 0x1000;
1662 pub const MOD_NANO: ::c_uint = 0x2000;
1663 pub const MOD_CLKB: ::c_uint = 0x4000;
1664 pub const MOD_CLKA: ::c_uint = 0x8000;
1665 pub const STA_PLL: ::c_int = 0x0001;
1666 pub const STA_PPSFREQ: ::c_int = 0x0002;
1667 pub const STA_PPSTIME: ::c_int = 0x0004;
1668 pub const STA_FLL: ::c_int = 0x0008;
1669 pub const STA_INS: ::c_int = 0x0010;
1670 pub const STA_DEL: ::c_int = 0x0020;
1671 pub const STA_UNSYNC: ::c_int = 0x0040;
1672 pub const STA_FREQHOLD: ::c_int = 0x0080;
1673 pub const STA_PPSSIGNAL: ::c_int = 0x0100;
1674 pub const STA_PPSJITTER: ::c_int = 0x0200;
1675 pub const STA_PPSWANDER: ::c_int = 0x0400;
1676 pub const STA_PPSERROR: ::c_int = 0x0800;
1677 pub const STA_CLOCKERR: ::c_int = 0x1000;
1678 pub const STA_NANO: ::c_int = 0x2000;
1679 pub const STA_MODE: ::c_int = 0x4000;
1680 pub const STA_CLK: ::c_int = 0x8000;
1681 pub const STA_RONLY: ::c_int = STA_PPSSIGNAL
1682     | STA_PPSJITTER
1683     | STA_PPSWANDER
1684     | STA_PPSERROR
1685     | STA_CLOCKERR
1686     | STA_NANO
1687     | STA_MODE
1688     | STA_CLK;
1689 pub const TIME_OK: ::c_int = 0;
1690 pub const TIME_INS: ::c_int = 1;
1691 pub const TIME_DEL: ::c_int = 2;
1692 pub const TIME_OOP: ::c_int = 3;
1693 pub const TIME_WAIT: ::c_int = 4;
1694 pub const TIME_ERROR: ::c_int = 5;
1695 
1696 pub const LITTLE_ENDIAN: ::c_int = 1234;
1697 pub const BIG_ENDIAN: ::c_int = 4321;
1698 
1699 pub const PL_EVENT_NONE: ::c_int = 0;
1700 pub const PL_EVENT_SIGNAL: ::c_int = 1;
1701 pub const PL_EVENT_SUSPENDED: ::c_int = 2;
1702 
1703 cfg_if! {
1704     if #[cfg(any(target_arch = "sparc", target_arch = "sparc64",
1705                  target_arch = "x86", target_arch = "x86_64"))] {
1706         pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t
1707           = pthread_mutex_t {
1708             ptm_magic: 0x33330003,
1709             ptm_errorcheck: 0,
1710             ptm_pad1: [0; 3],
1711             ptm_unused: 0,
1712             ptm_pad2: [0; 3],
1713             ptm_waiters: 0 as *mut _,
1714             ptm_owner: 0,
1715             ptm_recursed: 0,
1716             ptm_spare2: 0 as *mut _,
1717         };
1718     } else {
1719         pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t
1720           = pthread_mutex_t {
1721             ptm_magic: 0x33330003,
1722             ptm_errorcheck: 0,
1723             ptm_unused: 0,
1724             ptm_waiters: 0 as *mut _,
1725             ptm_owner: 0,
1726             ptm_recursed: 0,
1727             ptm_spare2: 0 as *mut _,
1728         };
1729     }
1730 }
1731 
1732 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
1733     ptc_magic: 0x55550005,
1734     ptc_lock: 0,
1735     ptc_waiters_first: 0 as *mut _,
1736     ptc_waiters_last: 0 as *mut _,
1737     ptc_mutex: 0 as *mut _,
1738     ptc_private: 0 as *mut _,
1739 };
1740 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
1741     ptr_magic: 0x99990009,
1742     ptr_interlock: 0,
1743     ptr_rblocked_first: 0 as *mut _,
1744     ptr_rblocked_last: 0 as *mut _,
1745     ptr_wblocked_first: 0 as *mut _,
1746     ptr_wblocked_last: 0 as *mut _,
1747     ptr_nreaders: 0,
1748     ptr_owner: 0,
1749     ptr_private: 0 as *mut _,
1750 };
1751 pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
1752 pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
1753 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
1754 pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
1755 
1756 pub const SCHED_NONE: ::c_int = -1;
1757 pub const SCHED_OTHER: ::c_int = 0;
1758 pub const SCHED_FIFO: ::c_int = 1;
1759 pub const SCHED_RR: ::c_int = 2;
1760 
1761 pub const EVFILT_AIO: u32 = 2;
1762 pub const EVFILT_PROC: u32 = 4;
1763 pub const EVFILT_READ: u32 = 0;
1764 pub const EVFILT_SIGNAL: u32 = 5;
1765 pub const EVFILT_TIMER: u32 = 6;
1766 pub const EVFILT_VNODE: u32 = 3;
1767 pub const EVFILT_WRITE: u32 = 1;
1768 
1769 pub const EV_ADD: u32 = 0x1;
1770 pub const EV_DELETE: u32 = 0x2;
1771 pub const EV_ENABLE: u32 = 0x4;
1772 pub const EV_DISABLE: u32 = 0x8;
1773 pub const EV_ONESHOT: u32 = 0x10;
1774 pub const EV_CLEAR: u32 = 0x20;
1775 pub const EV_RECEIPT: u32 = 0x40;
1776 pub const EV_DISPATCH: u32 = 0x80;
1777 pub const EV_FLAG1: u32 = 0x2000;
1778 pub const EV_ERROR: u32 = 0x4000;
1779 pub const EV_EOF: u32 = 0x8000;
1780 pub const EV_SYSFLAGS: u32 = 0xf000;
1781 
1782 pub const NOTE_LOWAT: u32 = 0x00000001;
1783 pub const NOTE_DELETE: u32 = 0x00000001;
1784 pub const NOTE_WRITE: u32 = 0x00000002;
1785 pub const NOTE_EXTEND: u32 = 0x00000004;
1786 pub const NOTE_ATTRIB: u32 = 0x00000008;
1787 pub const NOTE_LINK: u32 = 0x00000010;
1788 pub const NOTE_RENAME: u32 = 0x00000020;
1789 pub const NOTE_REVOKE: u32 = 0x00000040;
1790 pub const NOTE_EXIT: u32 = 0x80000000;
1791 pub const NOTE_FORK: u32 = 0x40000000;
1792 pub const NOTE_EXEC: u32 = 0x20000000;
1793 pub const NOTE_PDATAMASK: u32 = 0x000fffff;
1794 pub const NOTE_PCTRLMASK: u32 = 0xf0000000;
1795 pub const NOTE_TRACK: u32 = 0x00000001;
1796 pub const NOTE_TRACKERR: u32 = 0x00000002;
1797 pub const NOTE_CHILD: u32 = 0x00000004;
1798 
1799 pub const TMP_MAX: ::c_uint = 308915776;
1800 
1801 pub const AI_PASSIVE: ::c_int = 0x00000001;
1802 pub const AI_CANONNAME: ::c_int = 0x00000002;
1803 pub const AI_NUMERICHOST: ::c_int = 0x00000004;
1804 pub const AI_NUMERICSERV: ::c_int = 0x00000008;
1805 pub const AI_ADDRCONFIG: ::c_int = 0x00000400;
1806 pub const AI_SRV: ::c_int = 0x00000800;
1807 
1808 pub const NI_MAXHOST: ::socklen_t = 1025;
1809 pub const NI_MAXSERV: ::socklen_t = 32;
1810 
1811 pub const NI_NOFQDN: ::c_int = 0x00000001;
1812 pub const NI_NUMERICHOST: ::c_int = 0x000000002;
1813 pub const NI_NAMEREQD: ::c_int = 0x000000004;
1814 pub const NI_NUMERICSERV: ::c_int = 0x000000008;
1815 pub const NI_DGRAM: ::c_int = 0x00000010;
1816 pub const NI_WITHSCOPEID: ::c_int = 0x00000020;
1817 pub const NI_NUMERICSCOPE: ::c_int = 0x00000040;
1818 
1819 pub const RTLD_NOLOAD: ::c_int = 0x2000;
1820 pub const RTLD_LOCAL: ::c_int = 0x200;
1821 
1822 pub const CTL_MAXNAME: ::c_int = 12;
1823 pub const SYSCTL_NAMELEN: ::c_int = 32;
1824 pub const SYSCTL_DEFSIZE: ::c_int = 8;
1825 pub const CTLTYPE_NODE: ::c_int = 1;
1826 pub const CTLTYPE_INT: ::c_int = 2;
1827 pub const CTLTYPE_STRING: ::c_int = 3;
1828 pub const CTLTYPE_QUAD: ::c_int = 4;
1829 pub const CTLTYPE_STRUCT: ::c_int = 5;
1830 pub const CTLTYPE_BOOL: ::c_int = 6;
1831 pub const CTLFLAG_READONLY: ::c_int = 0x00000000;
1832 pub const CTLFLAG_READWRITE: ::c_int = 0x00000070;
1833 pub const CTLFLAG_ANYWRITE: ::c_int = 0x00000080;
1834 pub const CTLFLAG_PRIVATE: ::c_int = 0x00000100;
1835 pub const CTLFLAG_PERMANENT: ::c_int = 0x00000200;
1836 pub const CTLFLAG_OWNDATA: ::c_int = 0x00000400;
1837 pub const CTLFLAG_IMMEDIATE: ::c_int = 0x00000800;
1838 pub const CTLFLAG_HEX: ::c_int = 0x00001000;
1839 pub const CTLFLAG_ROOT: ::c_int = 0x00002000;
1840 pub const CTLFLAG_ANYNUMBER: ::c_int = 0x00004000;
1841 pub const CTLFLAG_HIDDEN: ::c_int = 0x00008000;
1842 pub const CTLFLAG_ALIAS: ::c_int = 0x00010000;
1843 pub const CTLFLAG_MMAP: ::c_int = 0x00020000;
1844 pub const CTLFLAG_OWNDESC: ::c_int = 0x00040000;
1845 pub const CTLFLAG_UNSIGNED: ::c_int = 0x00080000;
1846 pub const SYSCTL_VERS_MASK: ::c_int = 0xff000000;
1847 pub const SYSCTL_VERS_0: ::c_int = 0x00000000;
1848 pub const SYSCTL_VERS_1: ::c_int = 0x01000000;
1849 pub const SYSCTL_VERSION: ::c_int = SYSCTL_VERS_1;
1850 pub const CTL_EOL: ::c_int = -1;
1851 pub const CTL_QUERY: ::c_int = -2;
1852 pub const CTL_CREATE: ::c_int = -3;
1853 pub const CTL_CREATESYM: ::c_int = -4;
1854 pub const CTL_DESTROY: ::c_int = -5;
1855 pub const CTL_MMAP: ::c_int = -6;
1856 pub const CTL_DESCRIBE: ::c_int = -7;
1857 pub const CTL_UNSPEC: ::c_int = 0;
1858 pub const CTL_KERN: ::c_int = 1;
1859 pub const CTL_VM: ::c_int = 2;
1860 pub const CTL_VFS: ::c_int = 3;
1861 pub const CTL_NET: ::c_int = 4;
1862 pub const CTL_DEBUG: ::c_int = 5;
1863 pub const CTL_HW: ::c_int = 6;
1864 pub const CTL_MACHDEP: ::c_int = 7;
1865 pub const CTL_USER: ::c_int = 8;
1866 pub const CTL_DDB: ::c_int = 9;
1867 pub const CTL_PROC: ::c_int = 10;
1868 pub const CTL_VENDOR: ::c_int = 11;
1869 pub const CTL_EMUL: ::c_int = 12;
1870 pub const CTL_SECURITY: ::c_int = 13;
1871 pub const CTL_MAXID: ::c_int = 14;
1872 pub const KERN_OSTYPE: ::c_int = 1;
1873 pub const KERN_OSRELEASE: ::c_int = 2;
1874 pub const KERN_OSREV: ::c_int = 3;
1875 pub const KERN_VERSION: ::c_int = 4;
1876 pub const KERN_MAXVNODES: ::c_int = 5;
1877 pub const KERN_MAXPROC: ::c_int = 6;
1878 pub const KERN_MAXFILES: ::c_int = 7;
1879 pub const KERN_ARGMAX: ::c_int = 8;
1880 pub const KERN_SECURELVL: ::c_int = 9;
1881 pub const KERN_HOSTNAME: ::c_int = 10;
1882 pub const KERN_HOSTID: ::c_int = 11;
1883 pub const KERN_CLOCKRATE: ::c_int = 12;
1884 pub const KERN_VNODE: ::c_int = 13;
1885 pub const KERN_PROC: ::c_int = 14;
1886 pub const KERN_FILE: ::c_int = 15;
1887 pub const KERN_PROF: ::c_int = 16;
1888 pub const KERN_POSIX1: ::c_int = 17;
1889 pub const KERN_NGROUPS: ::c_int = 18;
1890 pub const KERN_JOB_CONTROL: ::c_int = 19;
1891 pub const KERN_SAVED_IDS: ::c_int = 20;
1892 pub const KERN_OBOOTTIME: ::c_int = 21;
1893 pub const KERN_DOMAINNAME: ::c_int = 22;
1894 pub const KERN_MAXPARTITIONS: ::c_int = 23;
1895 pub const KERN_RAWPARTITION: ::c_int = 24;
1896 pub const KERN_NTPTIME: ::c_int = 25;
1897 pub const KERN_TIMEX: ::c_int = 26;
1898 pub const KERN_AUTONICETIME: ::c_int = 27;
1899 pub const KERN_AUTONICEVAL: ::c_int = 28;
1900 pub const KERN_RTC_OFFSET: ::c_int = 29;
1901 pub const KERN_ROOT_DEVICE: ::c_int = 30;
1902 pub const KERN_MSGBUFSIZE: ::c_int = 31;
1903 pub const KERN_FSYNC: ::c_int = 32;
1904 pub const KERN_OLDSYSVMSG: ::c_int = 33;
1905 pub const KERN_OLDSYSVSEM: ::c_int = 34;
1906 pub const KERN_OLDSYSVSHM: ::c_int = 35;
1907 pub const KERN_OLDSHORTCORENAME: ::c_int = 36;
1908 pub const KERN_SYNCHRONIZED_IO: ::c_int = 37;
1909 pub const KERN_IOV_MAX: ::c_int = 38;
1910 pub const KERN_MBUF: ::c_int = 39;
1911 pub const KERN_MAPPED_FILES: ::c_int = 40;
1912 pub const KERN_MEMLOCK: ::c_int = 41;
1913 pub const KERN_MEMLOCK_RANGE: ::c_int = 42;
1914 pub const KERN_MEMORY_PROTECTION: ::c_int = 43;
1915 pub const KERN_LOGIN_NAME_MAX: ::c_int = 44;
1916 pub const KERN_DEFCORENAME: ::c_int = 45;
1917 pub const KERN_LOGSIGEXIT: ::c_int = 46;
1918 pub const KERN_PROC2: ::c_int = 47;
1919 pub const KERN_PROC_ARGS: ::c_int = 48;
1920 pub const KERN_FSCALE: ::c_int = 49;
1921 pub const KERN_CCPU: ::c_int = 50;
1922 pub const KERN_CP_TIME: ::c_int = 51;
1923 pub const KERN_OLDSYSVIPC_INFO: ::c_int = 52;
1924 pub const KERN_MSGBUF: ::c_int = 53;
1925 pub const KERN_CONSDEV: ::c_int = 54;
1926 pub const KERN_MAXPTYS: ::c_int = 55;
1927 pub const KERN_PIPE: ::c_int = 56;
1928 pub const KERN_MAXPHYS: ::c_int = 57;
1929 pub const KERN_SBMAX: ::c_int = 58;
1930 pub const KERN_TKSTAT: ::c_int = 59;
1931 pub const KERN_MONOTONIC_CLOCK: ::c_int = 60;
1932 pub const KERN_URND: ::c_int = 61;
1933 pub const KERN_LABELSECTOR: ::c_int = 62;
1934 pub const KERN_LABELOFFSET: ::c_int = 63;
1935 pub const KERN_LWP: ::c_int = 64;
1936 pub const KERN_FORKFSLEEP: ::c_int = 65;
1937 pub const KERN_POSIX_THREADS: ::c_int = 66;
1938 pub const KERN_POSIX_SEMAPHORES: ::c_int = 67;
1939 pub const KERN_POSIX_BARRIERS: ::c_int = 68;
1940 pub const KERN_POSIX_TIMERS: ::c_int = 69;
1941 pub const KERN_POSIX_SPIN_LOCKS: ::c_int = 70;
1942 pub const KERN_POSIX_READER_WRITER_LOCKS: ::c_int = 71;
1943 pub const KERN_DUMP_ON_PANIC: ::c_int = 72;
1944 pub const KERN_SOMAXKVA: ::c_int = 73;
1945 pub const KERN_ROOT_PARTITION: ::c_int = 74;
1946 pub const KERN_DRIVERS: ::c_int = 75;
1947 pub const KERN_BUF: ::c_int = 76;
1948 pub const KERN_FILE2: ::c_int = 77;
1949 pub const KERN_VERIEXEC: ::c_int = 78;
1950 pub const KERN_CP_ID: ::c_int = 79;
1951 pub const KERN_HARDCLOCK_TICKS: ::c_int = 80;
1952 pub const KERN_ARND: ::c_int = 81;
1953 pub const KERN_SYSVIPC: ::c_int = 82;
1954 pub const KERN_BOOTTIME: ::c_int = 83;
1955 pub const KERN_EVCNT: ::c_int = 84;
1956 pub const KERN_MAXID: ::c_int = 85;
1957 pub const KERN_PROC_ALL: ::c_int = 0;
1958 pub const KERN_PROC_PID: ::c_int = 1;
1959 pub const KERN_PROC_PGRP: ::c_int = 2;
1960 pub const KERN_PROC_SESSION: ::c_int = 3;
1961 pub const KERN_PROC_TTY: ::c_int = 4;
1962 pub const KERN_PROC_UID: ::c_int = 5;
1963 pub const KERN_PROC_RUID: ::c_int = 6;
1964 pub const KERN_PROC_GID: ::c_int = 7;
1965 pub const KERN_PROC_RGID: ::c_int = 8;
1966 pub const KERN_PROC_ARGV: ::c_int = 1;
1967 pub const KERN_PROC_NARGV: ::c_int = 2;
1968 pub const KERN_PROC_ENV: ::c_int = 3;
1969 pub const KERN_PROC_NENV: ::c_int = 4;
1970 pub const KERN_PROC_PATHNAME: ::c_int = 5;
1971 pub const VM_PROC: ::c_int = 16;
1972 pub const VM_PROC_MAP: ::c_int = 1;
1973 
1974 pub const EAI_AGAIN: ::c_int = 2;
1975 pub const EAI_BADFLAGS: ::c_int = 3;
1976 pub const EAI_FAIL: ::c_int = 4;
1977 pub const EAI_FAMILY: ::c_int = 5;
1978 pub const EAI_MEMORY: ::c_int = 6;
1979 pub const EAI_NODATA: ::c_int = 7;
1980 pub const EAI_NONAME: ::c_int = 8;
1981 pub const EAI_SERVICE: ::c_int = 9;
1982 pub const EAI_SOCKTYPE: ::c_int = 10;
1983 pub const EAI_SYSTEM: ::c_int = 11;
1984 pub const EAI_OVERFLOW: ::c_int = 14;
1985 
1986 pub const AIO_CANCELED: ::c_int = 1;
1987 pub const AIO_NOTCANCELED: ::c_int = 2;
1988 pub const AIO_ALLDONE: ::c_int = 3;
1989 pub const LIO_NOP: ::c_int = 0;
1990 pub const LIO_WRITE: ::c_int = 1;
1991 pub const LIO_READ: ::c_int = 2;
1992 pub const LIO_WAIT: ::c_int = 1;
1993 pub const LIO_NOWAIT: ::c_int = 0;
1994 
1995 pub const SIGEV_NONE: ::c_int = 0;
1996 pub const SIGEV_SIGNAL: ::c_int = 1;
1997 pub const SIGEV_THREAD: ::c_int = 2;
1998 
1999 pub const WSTOPPED: ::c_int = 0x00000002; // same as WUNTRACED
2000 pub const WCONTINUED: ::c_int = 0x00000010;
2001 pub const WEXITED: ::c_int = 0x000000020;
2002 pub const WNOWAIT: ::c_int = 0x00010000;
2003 
2004 pub const P_ALL: idtype_t = 0;
2005 pub const P_PID: idtype_t = 1;
2006 pub const P_PGID: idtype_t = 4;
2007 
2008 pub const UTIME_OMIT: c_long = 1073741822;
2009 pub const UTIME_NOW: c_long = 1073741823;
2010 
2011 pub const B460800: ::speed_t = 460800;
2012 pub const B921600: ::speed_t = 921600;
2013 
2014 pub const ONOCR: ::tcflag_t = 0x20;
2015 pub const ONLRET: ::tcflag_t = 0x40;
2016 pub const CDTRCTS: ::tcflag_t = 0x00020000;
2017 pub const CHWFLOW: ::tcflag_t = ::MDMBUF | ::CRTSCTS | ::CDTRCTS;
2018 
2019 // pub const _PATH_UTMPX: &[::c_char; 14] = b"/var/run/utmpx";
2020 // pub const _PATH_WTMPX: &[::c_char; 14] = b"/var/log/wtmpx";
2021 // pub const _PATH_LASTLOGX: &[::c_char; 17] = b"/var/log/lastlogx";
2022 // pub const _PATH_UTMP_UPDATE: &[::c_char; 24] = b"/usr/libexec/utmp_update";
2023 pub const UT_NAMESIZE: usize = 8;
2024 pub const UT_LINESIZE: usize = 8;
2025 pub const UT_HOSTSIZE: usize = 16;
2026 pub const _UTX_USERSIZE: usize = 32;
2027 pub const _UTX_LINESIZE: usize = 32;
2028 pub const _UTX_PADSIZE: usize = 40;
2029 pub const _UTX_IDSIZE: usize = 4;
2030 pub const _UTX_HOSTSIZE: usize = 256;
2031 pub const EMPTY: u16 = 0;
2032 pub const RUN_LVL: u16 = 1;
2033 pub const BOOT_TIME: u16 = 2;
2034 pub const OLD_TIME: u16 = 3;
2035 pub const NEW_TIME: u16 = 4;
2036 pub const INIT_PROCESS: u16 = 5;
2037 pub const LOGIN_PROCESS: u16 = 6;
2038 pub const USER_PROCESS: u16 = 7;
2039 pub const DEAD_PROCESS: u16 = 8;
2040 pub const ACCOUNTING: u16 = 9;
2041 pub const SIGNATURE: u16 = 10;
2042 pub const DOWN_TIME: u16 = 11;
2043 
2044 pub const SOCK_CLOEXEC: ::c_int = 0x10000000;
2045 pub const SOCK_NONBLOCK: ::c_int = 0x20000000;
2046 
2047 // Uncomment on next NetBSD release
2048 // pub const FIOSEEKDATA: ::c_ulong = 0xc0086661;
2049 // pub const FIOSEEKHOLE: ::c_ulong = 0xc0086662;
2050 pub const OFIOGETBMAP: ::c_ulong = 0xc004667a;
2051 pub const FIOGETBMAP: ::c_ulong = 0xc008667a;
2052 pub const FIONWRITE: ::c_ulong = 0x40046679;
2053 pub const FIONSPACE: ::c_ulong = 0x40046678;
2054 pub const FIBMAP: ::c_ulong = 0xc008667a;
2055 
2056 pub const SIGSTKSZ: ::size_t = 40960;
2057 
2058 pub const REG_ENOSYS: ::c_int = 17;
2059 
2060 pub const PT_DUMPCORE: ::c_int = 12;
2061 pub const PT_LWPINFO: ::c_int = 13;
2062 pub const PT_SYSCALL: ::c_int = 14;
2063 pub const PT_SYSCALLEMU: ::c_int = 15;
2064 pub const PT_SET_EVENT_MASK: ::c_int = 16;
2065 pub const PT_GET_EVENT_MASK: ::c_int = 17;
2066 pub const PT_GET_PROCESS_STATE: ::c_int = 18;
2067 pub const PT_SET_SIGINFO: ::c_int = 19;
2068 pub const PT_GET_SIGINFO: ::c_int = 20;
2069 pub const PT_RESUME: ::c_int = 21;
2070 pub const PT_SUSPEND: ::c_int = 23;
2071 pub const PT_STOP: ::c_int = 23;
2072 pub const PT_LWPSTATUS: ::c_int = 24;
2073 pub const PT_LWPNEXT: ::c_int = 25;
2074 pub const PT_SET_SIGPASS: ::c_int = 26;
2075 pub const PT_GET_SIGPASS: ::c_int = 27;
2076 pub const PT_FIRSTMACH: ::c_int = 32;
2077 
2078 pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
2079 pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
2080 pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x04;
2081 pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x08;
2082 pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10;
2083 pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20;
2084 pub const POSIX_SPAWN_RETURNERROR: ::c_int = 0x40;
2085 
2086 // Flags for chflags(2)
2087 pub const SF_SNAPSHOT: ::c_ulong = 0x00200000;
2088 pub const SF_LOG: ::c_ulong = 0x00400000;
2089 pub const SF_SNAPINVAL: ::c_ulong = 0x00800000;
2090 
2091 // sys/sysctl.h
2092 pub const KVME_PROT_READ: ::c_int = 0x00000001;
2093 pub const KVME_PROT_WRITE: ::c_int = 0x00000002;
2094 pub const KVME_PROT_EXEC: ::c_int = 0x00000004;
2095 
2096 pub const KVME_FLAG_COW: ::c_int = 0x00000001;
2097 pub const KVME_FLAG_NEEDS_COPY: ::c_int = 0x00000002;
2098 pub const KVME_FLAG_NOCOREDUMP: ::c_int = 0x000000004;
2099 pub const KVME_FLAG_PAGEABLE: ::c_int = 0x000000008;
2100 pub const KVME_FLAG_GROWS_UP: ::c_int = 0x000000010;
2101 pub const KVME_FLAG_GROWS_DOWN: ::c_int = 0x000000020;
2102 
2103 pub const NGROUPS_MAX: ::c_int = 16;
2104 
2105 const_fn! {
2106     {const} fn _ALIGN(p: usize) -> usize {
2107         (p + _ALIGNBYTES) & !_ALIGNBYTES
2108     }
2109 }
2110 
2111 f! {
2112     pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
2113         (cmsg as *mut ::c_uchar)
2114             .offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
2115     }
2116 
2117     pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
2118         _ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
2119     }
2120 
2121     pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
2122         -> *mut ::cmsghdr
2123     {
2124         if cmsg.is_null() {
2125             return ::CMSG_FIRSTHDR(mhdr);
2126         };
2127         let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)
2128             + _ALIGN(::mem::size_of::<::cmsghdr>());
2129         let max = (*mhdr).msg_control as usize
2130             + (*mhdr).msg_controllen as usize;
2131         if next > max {
2132             0 as *mut ::cmsghdr
2133         } else {
2134             (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize))
2135                 as *mut ::cmsghdr
2136         }
2137     }
2138 
2139     pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
2140         (_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize))
2141             as ::c_uint
2142     }
2143 
2144     // dirfd() is a macro on netbsd to access
2145     // the first field of the struct where dirp points to:
2146     // http://cvsweb.netbsd.org/bsdweb.cgi/src/include/dirent.h?rev=1.36
2147     pub fn dirfd(dirp: *mut ::DIR) -> ::c_int {
2148         *(dirp as *const ::c_int)
2149     }
2150 
2151     pub fn SOCKCREDSIZE(ngrps: usize) -> usize {
2152         let ngrps = if ngrps > 0 {
2153             ngrps - 1
2154         } else {
2155             0
2156         };
2157         ::mem::size_of::<sockcred>() + ::mem::size_of::<::gid_t>() * ngrps
2158     }
2159 
2160     pub fn PROT_MPROTECT(x: ::c_int) -> ::c_int {
2161         x << 3
2162     }
2163 
2164     pub fn PROT_MPROTECT_EXTRACT(x: ::c_int) -> ::c_int {
2165         (x >> 3) & 0x7
2166     }
2167 }
2168 
2169 safe_f! {
2170     pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
2171         status >> 8
2172     }
2173 
2174     pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
2175         (status & 0o177) != 0o177 && (status & 0o177) != 0
2176     }
2177 
2178     pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
2179         (status & 0o177) == 0o177
2180     }
2181 
2182     pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
2183         status == 0xffff
2184     }
2185 }
2186 
2187 extern "C" {
ntp_adjtime(buf: *mut timex) -> ::c_int2188     pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
ntp_gettime(buf: *mut ntptimeval) -> ::c_int2189     pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
clock_nanosleep( clk_id: ::clockid_t, flags: ::c_int, rqtp: *const ::timespec, rmtp: *mut ::timespec, ) -> ::c_int2190     pub fn clock_nanosleep(
2191         clk_id: ::clockid_t,
2192         flags: ::c_int,
2193         rqtp: *const ::timespec,
2194         rmtp: *mut ::timespec,
2195     ) -> ::c_int;
2196 
reallocarr(ptr: *mut ::c_void, number: ::size_t, size: ::size_t) -> ::c_int2197     pub fn reallocarr(ptr: *mut ::c_void, number: ::size_t, size: ::size_t) -> ::c_int;
2198 }
2199 
2200 #[link(name = "rt")]
2201 extern "C" {
aio_read(aiocbp: *mut aiocb) -> ::c_int2202     pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
aio_write(aiocbp: *mut aiocb) -> ::c_int2203     pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int2204     pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
aio_error(aiocbp: *const aiocb) -> ::c_int2205     pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
aio_return(aiocbp: *mut aiocb) -> ::ssize_t2206     pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
2207     #[link_name = "__aio_suspend50"]
aio_suspend( aiocb_list: *const *const aiocb, nitems: ::c_int, timeout: *const ::timespec, ) -> ::c_int2208     pub fn aio_suspend(
2209         aiocb_list: *const *const aiocb,
2210         nitems: ::c_int,
2211         timeout: *const ::timespec,
2212     ) -> ::c_int;
aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int2213     pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
lio_listio( mode: ::c_int, aiocb_list: *const *mut aiocb, nitems: ::c_int, sevp: *mut sigevent, ) -> ::c_int2214     pub fn lio_listio(
2215         mode: ::c_int,
2216         aiocb_list: *const *mut aiocb,
2217         nitems: ::c_int,
2218         sevp: *mut sigevent,
2219     ) -> ::c_int;
2220 }
2221 
2222 extern "C" {
chflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int2223     pub fn chflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int2224     pub fn fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int;
lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int2225     pub fn lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
2226 
execvpe( file: *const ::c_char, argv: *const *const ::c_char, envp: *const *const ::c_char, ) -> ::c_int2227     pub fn execvpe(
2228         file: *const ::c_char,
2229         argv: *const *const ::c_char,
2230         envp: *const *const ::c_char,
2231     ) -> ::c_int;
2232 
extattr_delete_fd( fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, ) -> ::c_int2233     pub fn extattr_delete_fd(
2234         fd: ::c_int,
2235         attrnamespace: ::c_int,
2236         attrname: *const ::c_char,
2237     ) -> ::c_int;
extattr_delete_file( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, ) -> ::c_int2238     pub fn extattr_delete_file(
2239         path: *const ::c_char,
2240         attrnamespace: ::c_int,
2241         attrname: *const ::c_char,
2242     ) -> ::c_int;
extattr_delete_link( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, ) -> ::c_int2243     pub fn extattr_delete_link(
2244         path: *const ::c_char,
2245         attrnamespace: ::c_int,
2246         attrname: *const ::c_char,
2247     ) -> ::c_int;
extattr_get_fd( fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t2248     pub fn extattr_get_fd(
2249         fd: ::c_int,
2250         attrnamespace: ::c_int,
2251         attrname: *const ::c_char,
2252         data: *mut ::c_void,
2253         nbytes: ::size_t,
2254     ) -> ::ssize_t;
extattr_get_file( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t2255     pub fn extattr_get_file(
2256         path: *const ::c_char,
2257         attrnamespace: ::c_int,
2258         attrname: *const ::c_char,
2259         data: *mut ::c_void,
2260         nbytes: ::size_t,
2261     ) -> ::ssize_t;
extattr_get_link( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t2262     pub fn extattr_get_link(
2263         path: *const ::c_char,
2264         attrnamespace: ::c_int,
2265         attrname: *const ::c_char,
2266         data: *mut ::c_void,
2267         nbytes: ::size_t,
2268     ) -> ::ssize_t;
extattr_namespace_to_string( attrnamespace: ::c_int, string: *mut *mut ::c_char, ) -> ::c_int2269     pub fn extattr_namespace_to_string(
2270         attrnamespace: ::c_int,
2271         string: *mut *mut ::c_char,
2272     ) -> ::c_int;
extattr_set_fd( fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t, ) -> ::c_int2273     pub fn extattr_set_fd(
2274         fd: ::c_int,
2275         attrnamespace: ::c_int,
2276         attrname: *const ::c_char,
2277         data: *const ::c_void,
2278         nbytes: ::size_t,
2279     ) -> ::c_int;
extattr_set_file( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t, ) -> ::c_int2280     pub fn extattr_set_file(
2281         path: *const ::c_char,
2282         attrnamespace: ::c_int,
2283         attrname: *const ::c_char,
2284         data: *const ::c_void,
2285         nbytes: ::size_t,
2286     ) -> ::c_int;
extattr_set_link( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t, ) -> ::c_int2287     pub fn extattr_set_link(
2288         path: *const ::c_char,
2289         attrnamespace: ::c_int,
2290         attrname: *const ::c_char,
2291         data: *const ::c_void,
2292         nbytes: ::size_t,
2293     ) -> ::c_int;
extattr_string_to_namespace( string: *const ::c_char, attrnamespace: *mut ::c_int, ) -> ::c_int2294     pub fn extattr_string_to_namespace(
2295         string: *const ::c_char,
2296         attrnamespace: *mut ::c_int,
2297     ) -> ::c_int;
2298 
2299     #[link_name = "__lutimes50"]
lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int2300     pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
2301     #[link_name = "__gettimeofday50"]
gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int2302     pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
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_int2303     pub fn getnameinfo(
2304         sa: *const ::sockaddr,
2305         salen: ::socklen_t,
2306         host: *mut ::c_char,
2307         hostlen: ::socklen_t,
2308         serv: *mut ::c_char,
2309         sevlen: ::socklen_t,
2310         flags: ::c_int,
2311     ) -> ::c_int;
mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int2312     pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
sysctl( name: *const ::c_int, namelen: ::c_uint, oldp: *mut ::c_void, oldlenp: *mut ::size_t, newp: *const ::c_void, newlen: ::size_t, ) -> ::c_int2313     pub fn sysctl(
2314         name: *const ::c_int,
2315         namelen: ::c_uint,
2316         oldp: *mut ::c_void,
2317         oldlenp: *mut ::size_t,
2318         newp: *const ::c_void,
2319         newlen: ::size_t,
2320     ) -> ::c_int;
sysctlbyname( name: *const ::c_char, oldp: *mut ::c_void, oldlenp: *mut ::size_t, newp: *const ::c_void, newlen: ::size_t, ) -> ::c_int2321     pub fn sysctlbyname(
2322         name: *const ::c_char,
2323         oldp: *mut ::c_void,
2324         oldlenp: *mut ::size_t,
2325         newp: *const ::c_void,
2326         newlen: ::size_t,
2327     ) -> ::c_int;
2328     #[link_name = "__kevent50"]
kevent( kq: ::c_int, changelist: *const ::kevent, nchanges: ::size_t, eventlist: *mut ::kevent, nevents: ::size_t, timeout: *const ::timespec, ) -> ::c_int2329     pub fn kevent(
2330         kq: ::c_int,
2331         changelist: *const ::kevent,
2332         nchanges: ::size_t,
2333         eventlist: *mut ::kevent,
2334         nevents: ::size_t,
2335         timeout: *const ::timespec,
2336     ) -> ::c_int;
2337     #[link_name = "__mount50"]
mount( src: *const ::c_char, target: *const ::c_char, flags: ::c_int, data: *mut ::c_void, size: ::size_t, ) -> ::c_int2338     pub fn mount(
2339         src: *const ::c_char,
2340         target: *const ::c_char,
2341         flags: ::c_int,
2342         data: *mut ::c_void,
2343         size: ::size_t,
2344     ) -> ::c_int;
mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t2345     pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
mq_close(mqd: ::mqd_t) -> ::c_int2346     pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int2347     pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int2348     pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int;
mq_receive( mqd: ::mqd_t, msg_ptr: *mut ::c_char, msg_len: ::size_t, msg_prio: *mut ::c_uint, ) -> ::ssize_t2349     pub fn mq_receive(
2350         mqd: ::mqd_t,
2351         msg_ptr: *mut ::c_char,
2352         msg_len: ::size_t,
2353         msg_prio: *mut ::c_uint,
2354     ) -> ::ssize_t;
mq_send( mqd: ::mqd_t, msg_ptr: *const ::c_char, msg_len: ::size_t, msg_prio: ::c_uint, ) -> ::c_int2355     pub fn mq_send(
2356         mqd: ::mqd_t,
2357         msg_ptr: *const ::c_char,
2358         msg_len: ::size_t,
2359         msg_prio: ::c_uint,
2360     ) -> ::c_int;
mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int2361     pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
2362     #[link_name = "__mq_timedreceive50"]
mq_timedreceive( mqd: ::mqd_t, msg_ptr: *mut ::c_char, msg_len: ::size_t, msg_prio: *mut ::c_uint, abs_timeout: *const ::timespec, ) -> ::ssize_t2363     pub fn mq_timedreceive(
2364         mqd: ::mqd_t,
2365         msg_ptr: *mut ::c_char,
2366         msg_len: ::size_t,
2367         msg_prio: *mut ::c_uint,
2368         abs_timeout: *const ::timespec,
2369     ) -> ::ssize_t;
2370     #[link_name = "__mq_timedsend50"]
mq_timedsend( mqd: ::mqd_t, msg_ptr: *const ::c_char, msg_len: ::size_t, msg_prio: ::c_uint, abs_timeout: *const ::timespec, ) -> ::c_int2371     pub fn mq_timedsend(
2372         mqd: ::mqd_t,
2373         msg_ptr: *const ::c_char,
2374         msg_len: ::size_t,
2375         msg_prio: ::c_uint,
2376         abs_timeout: *const ::timespec,
2377     ) -> ::c_int;
mq_unlink(name: *const ::c_char) -> ::c_int2378     pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_void, data: ::c_int) -> ::c_int2379     pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_void, data: ::c_int) -> ::c_int;
utrace(label: *const ::c_char, addr: *mut ::c_void, len: ::size_t) -> ::c_int2380     pub fn utrace(label: *const ::c_char, addr: *mut ::c_void, len: ::size_t) -> ::c_int;
pthread_getname_np(t: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int2381     pub fn pthread_getname_np(t: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
pthread_setname_np( t: ::pthread_t, name: *const ::c_char, arg: *const ::c_void, ) -> ::c_int2382     pub fn pthread_setname_np(
2383         t: ::pthread_t,
2384         name: *const ::c_char,
2385         arg: *const ::c_void,
2386     ) -> ::c_int;
pthread_attr_get_np(thread: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int2387     pub fn pthread_attr_get_np(thread: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int2388     pub fn pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
pthread_attr_getguardsize( attr: *const ::pthread_attr_t, guardsize: *mut ::size_t, ) -> ::c_int2389     pub fn pthread_attr_getguardsize(
2390         attr: *const ::pthread_attr_t,
2391         guardsize: *mut ::size_t,
2392     ) -> ::c_int;
pthread_attr_getstack( attr: *const ::pthread_attr_t, stackaddr: *mut *mut ::c_void, stacksize: *mut ::size_t, ) -> ::c_int2393     pub fn pthread_attr_getstack(
2394         attr: *const ::pthread_attr_t,
2395         stackaddr: *mut *mut ::c_void,
2396         stacksize: *mut ::size_t,
2397     ) -> ::c_int;
pthread_getaffinity_np( thread: ::pthread_t, size: ::size_t, set: *mut cpuset_t, ) -> ::c_int2398     pub fn pthread_getaffinity_np(
2399         thread: ::pthread_t,
2400         size: ::size_t,
2401         set: *mut cpuset_t,
2402     ) -> ::c_int;
pthread_setaffinity_np( thread: ::pthread_t, size: ::size_t, set: *mut cpuset_t, ) -> ::c_int2403     pub fn pthread_setaffinity_np(
2404         thread: ::pthread_t,
2405         size: ::size_t,
2406         set: *mut cpuset_t,
2407     ) -> ::c_int;
2408 
_cpuset_create() -> *mut cpuset_t2409     pub fn _cpuset_create() -> *mut cpuset_t;
_cpuset_destroy(set: *mut cpuset_t)2410     pub fn _cpuset_destroy(set: *mut cpuset_t);
_cpuset_clr(cpu: cpuid_t, set: *mut cpuset_t) -> ::c_int2411     pub fn _cpuset_clr(cpu: cpuid_t, set: *mut cpuset_t) -> ::c_int;
_cpuset_set(cpu: cpuid_t, set: *mut cpuset_t) -> ::c_int2412     pub fn _cpuset_set(cpu: cpuid_t, set: *mut cpuset_t) -> ::c_int;
_cpuset_isset(cpu: cpuid_t, set: *const cpuset_t) -> ::c_int2413     pub fn _cpuset_isset(cpu: cpuid_t, set: *const cpuset_t) -> ::c_int;
_cpuset_size(set: *const cpuset_t) -> ::size_t2414     pub fn _cpuset_size(set: *const cpuset_t) -> ::size_t;
_cpuset_zero(set: *mut cpuset_t)2415     pub fn _cpuset_zero(set: *mut cpuset_t);
2416     #[link_name = "__sigtimedwait50"]
sigtimedwait( set: *const sigset_t, info: *mut siginfo_t, timeout: *const ::timespec, ) -> ::c_int2417     pub fn sigtimedwait(
2418         set: *const sigset_t,
2419         info: *mut siginfo_t,
2420         timeout: *const ::timespec,
2421     ) -> ::c_int;
sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int2422     pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
waitid( idtype: idtype_t, id: ::id_t, infop: *mut ::siginfo_t, options: ::c_int, ) -> ::c_int2423     pub fn waitid(
2424         idtype: idtype_t,
2425         id: ::id_t,
2426         infop: *mut ::siginfo_t,
2427         options: ::c_int,
2428     ) -> ::c_int;
2429 
duplocale(base: ::locale_t) -> ::locale_t2430     pub fn duplocale(base: ::locale_t) -> ::locale_t;
freelocale(loc: ::locale_t)2431     pub fn freelocale(loc: ::locale_t);
localeconv_l(loc: ::locale_t) -> *mut lconv2432     pub fn localeconv_l(loc: ::locale_t) -> *mut lconv;
newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t2433     pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
2434     #[link_name = "__settimeofday50"]
settimeofday(tv: *const ::timeval, tz: *const ::c_void) -> ::c_int2435     pub fn settimeofday(tv: *const ::timeval, tz: *const ::c_void) -> ::c_int;
2436 
dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int2437     pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
2438 
kqueue1(flags: ::c_int) -> ::c_int2439     pub fn kqueue1(flags: ::c_int) -> ::c_int;
2440 
sendmmsg( sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, flags: ::c_int, ) -> ::c_int2441     pub fn sendmmsg(
2442         sockfd: ::c_int,
2443         msgvec: *mut ::mmsghdr,
2444         vlen: ::c_uint,
2445         flags: ::c_int,
2446     ) -> ::c_int;
recvmmsg( sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, flags: ::c_int, timeout: *mut ::timespec, ) -> ::c_int2447     pub fn recvmmsg(
2448         sockfd: ::c_int,
2449         msgvec: *mut ::mmsghdr,
2450         vlen: ::c_uint,
2451         flags: ::c_int,
2452         timeout: *mut ::timespec,
2453     ) -> ::c_int;
2454 
_lwp_self() -> lwpid_t2455     pub fn _lwp_self() -> lwpid_t;
memmem( haystack: *const ::c_void, haystacklen: ::size_t, needle: *const ::c_void, needlelen: ::size_t, ) -> *mut ::c_void2456     pub fn memmem(
2457         haystack: *const ::c_void,
2458         haystacklen: ::size_t,
2459         needle: *const ::c_void,
2460         needlelen: ::size_t,
2461     ) -> *mut ::c_void;
2462 
2463     // link.h
2464 
dl_iterate_phdr( callback: ::Option< unsafe extern "C" fn( info: *mut dl_phdr_info, size: usize, data: *mut ::c_void, ) -> ::c_int, >, data: *mut ::c_void, ) -> ::c_int2465     pub fn dl_iterate_phdr(
2466         callback: ::Option<
2467             unsafe extern "C" fn(
2468                 info: *mut dl_phdr_info,
2469                 size: usize,
2470                 data: *mut ::c_void,
2471             ) -> ::c_int,
2472         >,
2473         data: *mut ::c_void,
2474     ) -> ::c_int;
2475 
2476     // dlfcn.h
2477 
_dlauxinfo() -> *mut ::c_void2478     pub fn _dlauxinfo() -> *mut ::c_void;
2479 
iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t2480     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_t2481     pub fn iconv(
2482         cd: iconv_t,
2483         inbuf: *mut *mut ::c_char,
2484         inbytesleft: *mut ::size_t,
2485         outbuf: *mut *mut ::c_char,
2486         outbytesleft: *mut ::size_t,
2487     ) -> ::size_t;
iconv_close(cd: iconv_t) -> ::c_int2488     pub fn iconv_close(cd: iconv_t) -> ::c_int;
2489 
timer_create( clockid: ::clockid_t, sevp: *mut ::sigevent, timerid: *mut ::timer_t, ) -> ::c_int2490     pub fn timer_create(
2491         clockid: ::clockid_t,
2492         sevp: *mut ::sigevent,
2493         timerid: *mut ::timer_t,
2494     ) -> ::c_int;
timer_delete(timerid: ::timer_t) -> ::c_int2495     pub fn timer_delete(timerid: ::timer_t) -> ::c_int;
timer_getoverrun(timerid: ::timer_t) -> ::c_int2496     pub fn timer_getoverrun(timerid: ::timer_t) -> ::c_int;
timer_gettime(timerid: ::timer_t, curr_value: *mut ::itimerspec) -> ::c_int2497     pub fn timer_gettime(timerid: ::timer_t, curr_value: *mut ::itimerspec) -> ::c_int;
timer_settime( timerid: ::timer_t, flags: ::c_int, new_value: *const ::itimerspec, old_value: *mut ::itimerspec, ) -> ::c_int2498     pub fn timer_settime(
2499         timerid: ::timer_t,
2500         flags: ::c_int,
2501         new_value: *const ::itimerspec,
2502         old_value: *mut ::itimerspec,
2503     ) -> ::c_int;
2504 
2505     // Added in `NetBSD` 7.0
explicit_memset(b: *mut ::c_void, c: ::c_int, len: ::size_t)2506     pub fn explicit_memset(b: *mut ::c_void, c: ::c_int, len: ::size_t);
consttime_memequal(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int2507     pub fn consttime_memequal(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;
2508 
setproctitle(fmt: *const ::c_char, ...)2509     pub fn setproctitle(fmt: *const ::c_char, ...);
mremap( oldp: *mut ::c_void, oldsize: ::size_t, newp: *mut ::c_void, newsize: ::size_t, flags: ::c_int, ) -> *mut ::c_void2510     pub fn mremap(
2511         oldp: *mut ::c_void,
2512         oldsize: ::size_t,
2513         newp: *mut ::c_void,
2514         newsize: ::size_t,
2515         flags: ::c_int,
2516     ) -> *mut ::c_void;
2517 
sched_setparam(pid: ::pid_t, param: *const sched_param) -> ::c_int2518     pub fn sched_setparam(pid: ::pid_t, param: *const sched_param) -> ::c_int;
sched_getparam(pid: ::pid_t, param: *mut sched_param) -> ::c_int2519     pub fn sched_getparam(pid: ::pid_t, param: *mut sched_param) -> ::c_int;
sched_getscheduler(pid: ::pid_t) -> ::c_int2520     pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
sched_setscheduler( pid: ::pid_t, policy: ::c_int, param: *const ::sched_param, ) -> ::c_int2521     pub fn sched_setscheduler(
2522         pid: ::pid_t,
2523         policy: ::c_int,
2524         param: *const ::sched_param,
2525     ) -> ::c_int;
2526 
2527     #[link_name = "__pollts50"]
pollts( fds: *mut ::pollfd, nfds: ::nfds_t, ts: *const ::timespec, sigmask: *const ::sigset_t, ) -> ::c_int2528     pub fn pollts(
2529         fds: *mut ::pollfd,
2530         nfds: ::nfds_t,
2531         ts: *const ::timespec,
2532         sigmask: *const ::sigset_t,
2533     ) -> ::c_int;
2534 
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_int2535     pub fn posix_spawn(
2536         pid: *mut ::pid_t,
2537         path: *const ::c_char,
2538         file_actions: *const ::posix_spawn_file_actions_t,
2539         attrp: *const ::posix_spawnattr_t,
2540         argv: *const *mut ::c_char,
2541         envp: *const *mut ::c_char,
2542     ) -> ::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_int2543     pub fn posix_spawnp(
2544         pid: *mut ::pid_t,
2545         file: *const ::c_char,
2546         file_actions: *const ::posix_spawn_file_actions_t,
2547         attrp: *const ::posix_spawnattr_t,
2548         argv: *const *mut ::c_char,
2549         envp: *const *mut ::c_char,
2550     ) -> ::c_int;
posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int2551     pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int2552     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_int2553     pub fn posix_spawnattr_getsigdefault(
2554         attr: *const posix_spawnattr_t,
2555         default: *mut ::sigset_t,
2556     ) -> ::c_int;
posix_spawnattr_setsigdefault( attr: *mut posix_spawnattr_t, default: *const ::sigset_t, ) -> ::c_int2557     pub fn posix_spawnattr_setsigdefault(
2558         attr: *mut posix_spawnattr_t,
2559         default: *const ::sigset_t,
2560     ) -> ::c_int;
posix_spawnattr_getsigmask( attr: *const posix_spawnattr_t, default: *mut ::sigset_t, ) -> ::c_int2561     pub fn posix_spawnattr_getsigmask(
2562         attr: *const posix_spawnattr_t,
2563         default: *mut ::sigset_t,
2564     ) -> ::c_int;
posix_spawnattr_setsigmask( attr: *mut posix_spawnattr_t, default: *const ::sigset_t, ) -> ::c_int2565     pub fn posix_spawnattr_setsigmask(
2566         attr: *mut posix_spawnattr_t,
2567         default: *const ::sigset_t,
2568     ) -> ::c_int;
posix_spawnattr_getflags( attr: *const posix_spawnattr_t, flags: *mut ::c_short, ) -> ::c_int2569     pub fn posix_spawnattr_getflags(
2570         attr: *const posix_spawnattr_t,
2571         flags: *mut ::c_short,
2572     ) -> ::c_int;
posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int2573     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_int2574     pub fn posix_spawnattr_getpgroup(
2575         attr: *const posix_spawnattr_t,
2576         flags: *mut ::pid_t,
2577     ) -> ::c_int;
posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int2578     pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
posix_spawnattr_getschedpolicy( attr: *const posix_spawnattr_t, flags: *mut ::c_int, ) -> ::c_int2579     pub fn posix_spawnattr_getschedpolicy(
2580         attr: *const posix_spawnattr_t,
2581         flags: *mut ::c_int,
2582     ) -> ::c_int;
posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int2583     pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int;
posix_spawnattr_getschedparam( attr: *const posix_spawnattr_t, param: *mut ::sched_param, ) -> ::c_int2584     pub fn posix_spawnattr_getschedparam(
2585         attr: *const posix_spawnattr_t,
2586         param: *mut ::sched_param,
2587     ) -> ::c_int;
posix_spawnattr_setschedparam( attr: *mut posix_spawnattr_t, param: *const ::sched_param, ) -> ::c_int2588     pub fn posix_spawnattr_setschedparam(
2589         attr: *mut posix_spawnattr_t,
2590         param: *const ::sched_param,
2591     ) -> ::c_int;
2592 
posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int2593     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_int2594     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_int2595     pub fn posix_spawn_file_actions_addopen(
2596         actions: *mut posix_spawn_file_actions_t,
2597         fd: ::c_int,
2598         path: *const ::c_char,
2599         oflag: ::c_int,
2600         mode: ::mode_t,
2601     ) -> ::c_int;
posix_spawn_file_actions_addclose( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, ) -> ::c_int2602     pub fn posix_spawn_file_actions_addclose(
2603         actions: *mut posix_spawn_file_actions_t,
2604         fd: ::c_int,
2605     ) -> ::c_int;
posix_spawn_file_actions_adddup2( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, newfd: ::c_int, ) -> ::c_int2606     pub fn posix_spawn_file_actions_adddup2(
2607         actions: *mut posix_spawn_file_actions_t,
2608         fd: ::c_int,
2609         newfd: ::c_int,
2610     ) -> ::c_int;
2611 }
2612 
2613 #[link(name = "util")]
2614 extern "C" {
2615     #[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
getpwent_r( pwd: *mut ::passwd, buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut ::passwd, ) -> ::c_int2616     pub fn getpwent_r(
2617         pwd: *mut ::passwd,
2618         buf: *mut ::c_char,
2619         buflen: ::size_t,
2620         result: *mut *mut ::passwd,
2621     ) -> ::c_int;
getgrent_r( grp: *mut ::group, buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut ::group, ) -> ::c_int2622     pub fn getgrent_r(
2623         grp: *mut ::group,
2624         buf: *mut ::c_char,
2625         buflen: ::size_t,
2626         result: *mut *mut ::group,
2627     ) -> ::c_int;
2628 
updwtmpx(file: *const ::c_char, ut: *const utmpx) -> ::c_int2629     pub fn updwtmpx(file: *const ::c_char, ut: *const utmpx) -> ::c_int;
getlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> *mut lastlogx2630     pub fn getlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> *mut lastlogx;
updlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> ::c_int2631     pub fn updlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> ::c_int;
utmpxname(file: *const ::c_char) -> ::c_int2632     pub fn utmpxname(file: *const ::c_char) -> ::c_int;
getutxent() -> *mut utmpx2633     pub fn getutxent() -> *mut utmpx;
getutxid(ut: *const utmpx) -> *mut utmpx2634     pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
getutxline(ut: *const utmpx) -> *mut utmpx2635     pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
pututxline(ut: *const utmpx) -> *mut utmpx2636     pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
setutxent()2637     pub fn setutxent();
endutxent()2638     pub fn endutxent();
2639 
getutmp(ux: *const utmpx, u: *mut utmp)2640     pub fn getutmp(ux: *const utmpx, u: *mut utmp);
getutmpx(u: *const utmp, ux: *mut utmpx)2641     pub fn getutmpx(u: *const utmp, ux: *mut utmpx);
2642 
utpname(file: *const ::c_char) -> ::c_int2643     pub fn utpname(file: *const ::c_char) -> ::c_int;
setutent()2644     pub fn setutent();
endutent()2645     pub fn endutent();
getutent() -> *mut utmp2646     pub fn getutent() -> *mut utmp;
2647 
efopen(p: *const ::c_char, m: *const ::c_char) -> ::FILE2648     pub fn efopen(p: *const ::c_char, m: *const ::c_char) -> ::FILE;
emalloc(n: ::size_t) -> *mut ::c_void2649     pub fn emalloc(n: ::size_t) -> *mut ::c_void;
ecalloc(n: ::size_t, c: ::size_t) -> *mut ::c_void2650     pub fn ecalloc(n: ::size_t, c: ::size_t) -> *mut ::c_void;
erealloc(p: *mut ::c_void, n: ::size_t) -> *mut ::c_void2651     pub fn erealloc(p: *mut ::c_void, n: ::size_t) -> *mut ::c_void;
ereallocarr(p: *mut ::c_void, n: ::size_t, s: ::size_t)2652     pub fn ereallocarr(p: *mut ::c_void, n: ::size_t, s: ::size_t);
estrdup(s: *const ::c_char) -> *mut ::c_char2653     pub fn estrdup(s: *const ::c_char) -> *mut ::c_char;
estrndup(s: *const ::c_char, len: ::size_t) -> *mut ::c_char2654     pub fn estrndup(s: *const ::c_char, len: ::size_t) -> *mut ::c_char;
estrlcpy(dst: *mut ::c_char, src: *const ::c_char, len: ::size_t) -> ::size_t2655     pub fn estrlcpy(dst: *mut ::c_char, src: *const ::c_char, len: ::size_t) -> ::size_t;
estrlcat(dst: *mut ::c_char, src: *const ::c_char, len: ::size_t) -> ::size_t2656     pub fn estrlcat(dst: *mut ::c_char, src: *const ::c_char, len: ::size_t) -> ::size_t;
estrtoi( nptr: *const ::c_char, base: ::c_int, lo: ::intmax_t, hi: ::intmax_t, ) -> ::intmax_t2657     pub fn estrtoi(
2658         nptr: *const ::c_char,
2659         base: ::c_int,
2660         lo: ::intmax_t,
2661         hi: ::intmax_t,
2662     ) -> ::intmax_t;
estrtou( nptr: *const ::c_char, base: ::c_int, lo: ::uintmax_t, hi: ::uintmax_t, ) -> ::uintmax_t2663     pub fn estrtou(
2664         nptr: *const ::c_char,
2665         base: ::c_int,
2666         lo: ::uintmax_t,
2667         hi: ::uintmax_t,
2668     ) -> ::uintmax_t;
easprintf(string: *mut *mut ::c_char, fmt: *const ::c_char, ...) -> ::c_int2669     pub fn easprintf(string: *mut *mut ::c_char, fmt: *const ::c_char, ...) -> ::c_int;
evasprintf(string: *mut *mut ::c_char, fmt: *const ::c_char, ...) -> ::c_int2670     pub fn evasprintf(string: *mut *mut ::c_char, fmt: *const ::c_char, ...) -> ::c_int;
esetfunc( cb: ::Option<unsafe extern "C" fn(::c_int, *const ::c_char, ...)>, ) -> ::Option<unsafe extern "C" fn(::c_int, *const ::c_char, ...)>2671     pub fn esetfunc(
2672         cb: ::Option<unsafe extern "C" fn(::c_int, *const ::c_char, ...)>,
2673     ) -> ::Option<unsafe extern "C" fn(::c_int, *const ::c_char, ...)>;
secure_path(path: *const ::c_char) -> ::c_int2674     pub fn secure_path(path: *const ::c_char) -> ::c_int;
snprintb( buf: *mut ::c_char, buflen: ::size_t, fmt: *const ::c_char, val: u64, ) -> ::c_int2675     pub fn snprintb(
2676         buf: *mut ::c_char,
2677         buflen: ::size_t,
2678         fmt: *const ::c_char,
2679         val: u64,
2680     ) -> ::c_int;
snprintb_m( buf: *mut ::c_char, buflen: ::size_t, fmt: *const ::c_char, val: u64, max: ::size_t, ) -> ::c_int2681     pub fn snprintb_m(
2682         buf: *mut ::c_char,
2683         buflen: ::size_t,
2684         fmt: *const ::c_char,
2685         val: u64,
2686         max: ::size_t,
2687     ) -> ::c_int;
2688 
getbootfile() -> *const ::c_char2689     pub fn getbootfile() -> *const ::c_char;
getbyteorder() -> ::c_int2690     pub fn getbyteorder() -> ::c_int;
getdiskrawname( buf: *mut ::c_char, buflen: ::size_t, name: *const ::c_char, ) -> *const ::c_char2691     pub fn getdiskrawname(
2692         buf: *mut ::c_char,
2693         buflen: ::size_t,
2694         name: *const ::c_char,
2695     ) -> *const ::c_char;
getdiskcookedname( buf: *mut ::c_char, buflen: ::size_t, name: *const ::c_char, ) -> *const ::c_char2696     pub fn getdiskcookedname(
2697         buf: *mut ::c_char,
2698         buflen: ::size_t,
2699         name: *const ::c_char,
2700     ) -> *const ::c_char;
getfsspecname( buf: *mut ::c_char, buflen: ::size_t, spec: *const ::c_char, ) -> *const ::c_char2701     pub fn getfsspecname(
2702         buf: *mut ::c_char,
2703         buflen: ::size_t,
2704         spec: *const ::c_char,
2705     ) -> *const ::c_char;
2706 
strpct( buf: *mut ::c_char, bufsiz: ::size_t, numerator: ::uintmax_t, denominator: ::uintmax_t, precision: ::size_t, ) -> *mut ::c_char2707     pub fn strpct(
2708         buf: *mut ::c_char,
2709         bufsiz: ::size_t,
2710         numerator: ::uintmax_t,
2711         denominator: ::uintmax_t,
2712         precision: ::size_t,
2713     ) -> *mut ::c_char;
strspct( buf: *mut ::c_char, bufsiz: ::size_t, numerator: ::intmax_t, denominator: ::intmax_t, precision: ::size_t, ) -> *mut ::c_char2714     pub fn strspct(
2715         buf: *mut ::c_char,
2716         bufsiz: ::size_t,
2717         numerator: ::intmax_t,
2718         denominator: ::intmax_t,
2719         precision: ::size_t,
2720     ) -> *mut ::c_char;
2721     #[link_name = "__login50"]
login(ut: *const utmp)2722     pub fn login(ut: *const utmp);
2723     #[link_name = "__loginx50"]
loginx(ut: *const utmpx)2724     pub fn loginx(ut: *const utmpx);
logout(line: *const ::c_char)2725     pub fn logout(line: *const ::c_char);
logoutx(line: *const ::c_char, status: ::c_int, tpe: ::c_int)2726     pub fn logoutx(line: *const ::c_char, status: ::c_int, tpe: ::c_int);
logwtmp(line: *const ::c_char, name: *const ::c_char, host: *const ::c_char)2727     pub fn logwtmp(line: *const ::c_char, name: *const ::c_char, host: *const ::c_char);
logwtmpx( line: *const ::c_char, name: *const ::c_char, host: *const ::c_char, status: ::c_int, tpe: ::c_int, )2728     pub fn logwtmpx(
2729         line: *const ::c_char,
2730         name: *const ::c_char,
2731         host: *const ::c_char,
2732         status: ::c_int,
2733         tpe: ::c_int,
2734     );
2735 
getxattr( path: *const ::c_char, name: *const ::c_char, value: *mut ::c_void, size: ::size_t, ) -> ::ssize_t2736     pub fn getxattr(
2737         path: *const ::c_char,
2738         name: *const ::c_char,
2739         value: *mut ::c_void,
2740         size: ::size_t,
2741     ) -> ::ssize_t;
lgetxattr( path: *const ::c_char, name: *const ::c_char, value: *mut ::c_void, size: ::size_t, ) -> ::ssize_t2742     pub fn lgetxattr(
2743         path: *const ::c_char,
2744         name: *const ::c_char,
2745         value: *mut ::c_void,
2746         size: ::size_t,
2747     ) -> ::ssize_t;
fgetxattr( filedes: ::c_int, name: *const ::c_char, value: *mut ::c_void, size: ::size_t, ) -> ::ssize_t2748     pub fn fgetxattr(
2749         filedes: ::c_int,
2750         name: *const ::c_char,
2751         value: *mut ::c_void,
2752         size: ::size_t,
2753     ) -> ::ssize_t;
setxattr( path: *const ::c_char, name: *const ::c_char, value: *const ::c_void, size: ::size_t, ) -> ::c_int2754     pub fn setxattr(
2755         path: *const ::c_char,
2756         name: *const ::c_char,
2757         value: *const ::c_void,
2758         size: ::size_t,
2759     ) -> ::c_int;
lsetxattr( path: *const ::c_char, name: *const ::c_char, value: *const ::c_void, size: ::size_t, ) -> ::c_int2760     pub fn lsetxattr(
2761         path: *const ::c_char,
2762         name: *const ::c_char,
2763         value: *const ::c_void,
2764         size: ::size_t,
2765     ) -> ::c_int;
fsetxattr( filedes: ::c_int, name: *const ::c_char, value: *const ::c_void, size: ::size_t, flags: ::c_int, ) -> ::c_int2766     pub fn fsetxattr(
2767         filedes: ::c_int,
2768         name: *const ::c_char,
2769         value: *const ::c_void,
2770         size: ::size_t,
2771         flags: ::c_int,
2772     ) -> ::c_int;
listxattr(path: *const ::c_char, list: *mut ::c_char, size: ::size_t) -> ::ssize_t2773     pub fn listxattr(path: *const ::c_char, list: *mut ::c_char, size: ::size_t) -> ::ssize_t;
llistxattr(path: *const ::c_char, list: *mut ::c_char, size: ::size_t) -> ::ssize_t2774     pub fn llistxattr(path: *const ::c_char, list: *mut ::c_char, size: ::size_t) -> ::ssize_t;
flistxattr(filedes: ::c_int, list: *mut ::c_char, size: ::size_t) -> ::ssize_t2775     pub fn flistxattr(filedes: ::c_int, list: *mut ::c_char, size: ::size_t) -> ::ssize_t;
removexattr(path: *const ::c_char, name: *const ::c_char) -> ::c_int2776     pub fn removexattr(path: *const ::c_char, name: *const ::c_char) -> ::c_int;
lremovexattr(path: *const ::c_char, name: *const ::c_char) -> ::c_int2777     pub fn lremovexattr(path: *const ::c_char, name: *const ::c_char) -> ::c_int;
fremovexattr(fd: ::c_int, path: *const ::c_char, name: *const ::c_char) -> ::c_int2778     pub fn fremovexattr(fd: ::c_int, path: *const ::c_char, name: *const ::c_char) -> ::c_int;
2779 
string_to_flags( string_p: *mut *mut ::c_char, setp: *mut ::c_ulong, clrp: *mut ::c_ulong, ) -> ::c_int2780     pub fn string_to_flags(
2781         string_p: *mut *mut ::c_char,
2782         setp: *mut ::c_ulong,
2783         clrp: *mut ::c_ulong,
2784     ) -> ::c_int;
flags_to_string(flags: ::c_ulong, def: *const ::c_char) -> ::c_int2785     pub fn flags_to_string(flags: ::c_ulong, def: *const ::c_char) -> ::c_int;
2786 
kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::size_t) -> *mut kinfo_vmentry2787     pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::size_t) -> *mut kinfo_vmentry;
2788 }
2789 
2790 cfg_if! {
2791     if #[cfg(target_arch = "aarch64")] {
2792         mod aarch64;
2793         pub use self::aarch64::*;
2794     } else if #[cfg(target_arch = "arm")] {
2795         mod arm;
2796         pub use self::arm::*;
2797     } else if #[cfg(target_arch = "powerpc")] {
2798         mod powerpc;
2799         pub use self::powerpc::*;
2800     } else if #[cfg(target_arch = "sparc64")] {
2801         mod sparc64;
2802         pub use self::sparc64::*;
2803     } else if #[cfg(target_arch = "x86_64")] {
2804         mod x86_64;
2805         pub use self::x86_64::*;
2806     } else if #[cfg(target_arch = "x86")] {
2807         mod x86;
2808         pub use self::x86::*;
2809     } else {
2810         // Unknown target_arch
2811     }
2812 }
2813