xref: /rust-libc-0.2.174/src/fuchsia/mod.rs (revision c55dfcf6)
1 //! Definitions found commonly among almost all Unix derivatives
2 //!
3 //! More functions and definitions can be found in the more specific modules
4 //! according to the platform in question.
5 
6 use c_void;
7 
8 // PUB_TYPE
9 
10 pub type c_schar = i8;
11 pub type c_uchar = u8;
12 pub type c_short = i16;
13 pub type c_ushort = u16;
14 pub type c_int = i32;
15 pub type c_uint = u32;
16 pub type c_float = f32;
17 pub type c_double = f64;
18 pub type c_longlong = i64;
19 pub type c_ulonglong = u64;
20 pub type intmax_t = i64;
21 pub type uintmax_t = u64;
22 
23 pub type locale_t = *mut ::c_void;
24 
25 pub type size_t = usize;
26 pub type ptrdiff_t = isize;
27 pub type intptr_t = isize;
28 pub type uintptr_t = usize;
29 pub type ssize_t = isize;
30 
31 pub type pid_t = i32;
32 pub type uid_t = u32;
33 pub type gid_t = u32;
34 pub type in_addr_t = u32;
35 pub type in_port_t = u16;
36 pub type sighandler_t = ::size_t;
37 pub type cc_t = ::c_uchar;
38 pub type sa_family_t = u16;
39 pub type pthread_key_t = ::c_uint;
40 pub type speed_t = ::c_uint;
41 pub type tcflag_t = ::c_uint;
42 pub type clockid_t = ::c_int;
43 pub type key_t = ::c_int;
44 pub type id_t = ::c_uint;
45 pub type useconds_t = u32;
46 pub type dev_t = u64;
47 pub type socklen_t = u32;
48 pub type pthread_t = c_ulong;
49 pub type mode_t = u32;
50 pub type ino64_t = u64;
51 pub type off64_t = i64;
52 pub type blkcnt64_t = i64;
53 pub type rlim64_t = u64;
54 pub type mqd_t = ::c_int;
55 pub type nfds_t = ::c_ulong;
56 pub type nl_item = ::c_int;
57 pub type idtype_t = ::c_uint;
58 pub type loff_t = ::c_longlong;
59 
60 pub type __u8 = ::c_uchar;
61 pub type __u16 = ::c_ushort;
62 pub type __s16 = ::c_short;
63 pub type __u32 = ::c_uint;
64 pub type __s32 = ::c_int;
65 
66 pub type Elf32_Half = u16;
67 pub type Elf32_Word = u32;
68 pub type Elf32_Off = u32;
69 pub type Elf32_Addr = u32;
70 
71 pub type Elf64_Half = u16;
72 pub type Elf64_Word = u32;
73 pub type Elf64_Off = u64;
74 pub type Elf64_Addr = u64;
75 pub type Elf64_Xword = u64;
76 
77 pub type clock_t = c_long;
78 pub type time_t = c_long;
79 pub type suseconds_t = c_long;
80 pub type ino_t = u64;
81 pub type off_t = i64;
82 pub type blkcnt_t = i64;
83 
84 pub type shmatt_t = ::c_ulong;
85 pub type msgqnum_t = ::c_ulong;
86 pub type msglen_t = ::c_ulong;
87 pub type fsblkcnt_t = ::c_ulonglong;
88 pub type fsfilcnt_t = ::c_ulonglong;
89 pub type rlim_t = ::c_ulonglong;
90 
91 pub type c_long = i64;
92 pub type c_ulong = u64;
93 
94 // FIXME: why are these uninhabited types? that seems... wrong?
95 // Presumably these should be `()` or an `extern type` (when that stabilizes).
96 #[cfg_attr(feature = "extra_traits", derive(Debug))]
97 pub enum timezone {}
98 impl ::Copy for timezone {}
99 impl ::Clone for timezone {
100     fn clone(&self) -> timezone {
101         *self
102     }
103 }
104 #[cfg_attr(feature = "extra_traits", derive(Debug))]
105 pub enum DIR {}
106 impl ::Copy for DIR {}
107 impl ::Clone for DIR {
108     fn clone(&self) -> DIR {
109         *self
110     }
111 }
112 
113 #[cfg_attr(feature = "extra_traits", derive(Debug))]
114 pub enum fpos64_t {} // FIXME: fill this out with a struct
115 impl ::Copy for fpos64_t {}
116 impl ::Clone for fpos64_t {
117     fn clone(&self) -> fpos64_t {
118         *self
119     }
120 }
121 
122 // PUB_STRUCT
123 
124 s! {
125     pub struct group {
126         pub gr_name: *mut ::c_char,
127         pub gr_passwd: *mut ::c_char,
128         pub gr_gid: ::gid_t,
129         pub gr_mem: *mut *mut ::c_char,
130     }
131 
132     pub struct utimbuf {
133         pub actime: time_t,
134         pub modtime: time_t,
135     }
136 
137     pub struct timeval {
138         pub tv_sec: time_t,
139         pub tv_usec: suseconds_t,
140     }
141 
142     pub struct timespec {
143         pub tv_sec: time_t,
144         pub tv_nsec: ::c_long,
145     }
146 
147     // FIXME: the rlimit and rusage related functions and types don't exist
148     // within zircon. Are there reasons for keeping them around?
149     pub struct rlimit {
150         pub rlim_cur: rlim_t,
151         pub rlim_max: rlim_t,
152     }
153 
154     pub struct rusage {
155         pub ru_utime: timeval,
156         pub ru_stime: timeval,
157         pub ru_maxrss: c_long,
158         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
159         __pad1: u32,
160         pub ru_ixrss: c_long,
161         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
162         __pad2: u32,
163         pub ru_idrss: c_long,
164         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
165         __pad3: u32,
166         pub ru_isrss: c_long,
167         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
168         __pad4: u32,
169         pub ru_minflt: c_long,
170         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
171         __pad5: u32,
172         pub ru_majflt: c_long,
173         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
174         __pad6: u32,
175         pub ru_nswap: c_long,
176         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
177         __pad7: u32,
178         pub ru_inblock: c_long,
179         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
180         __pad8: u32,
181         pub ru_oublock: c_long,
182         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
183         __pad9: u32,
184         pub ru_msgsnd: c_long,
185         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
186         __pad10: u32,
187         pub ru_msgrcv: c_long,
188         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
189         __pad11: u32,
190         pub ru_nsignals: c_long,
191         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
192         __pad12: u32,
193         pub ru_nvcsw: c_long,
194         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
195         __pad13: u32,
196         pub ru_nivcsw: c_long,
197         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
198         __pad14: u32,
199     }
200 
201     pub struct in_addr {
202         pub s_addr: in_addr_t,
203     }
204 
205     pub struct in6_addr {
206         pub s6_addr: [u8; 16],
207     }
208 
209     pub struct ip_mreq {
210         pub imr_multiaddr: in_addr,
211         pub imr_interface: in_addr,
212     }
213 
214     pub struct ip_mreqn {
215         pub imr_multiaddr: in_addr,
216         pub imr_address: in_addr,
217         pub imr_ifindex: ::c_int,
218     }
219 
220     pub struct ipv6_mreq {
221         pub ipv6mr_multiaddr: in6_addr,
222         pub ipv6mr_interface: ::c_uint,
223     }
224 
225     pub struct hostent {
226         pub h_name: *mut ::c_char,
227         pub h_aliases: *mut *mut ::c_char,
228         pub h_addrtype: ::c_int,
229         pub h_length: ::c_int,
230         pub h_addr_list: *mut *mut ::c_char,
231     }
232 
233     pub struct iovec {
234         pub iov_base: *mut ::c_void,
235         pub iov_len: ::size_t,
236     }
237 
238     pub struct pollfd {
239         pub fd: ::c_int,
240         pub events: ::c_short,
241         pub revents: ::c_short,
242     }
243 
244     pub struct winsize {
245         pub ws_row: ::c_ushort,
246         pub ws_col: ::c_ushort,
247         pub ws_xpixel: ::c_ushort,
248         pub ws_ypixel: ::c_ushort,
249     }
250 
251     pub struct linger {
252         pub l_onoff: ::c_int,
253         pub l_linger: ::c_int,
254     }
255 
256     pub struct sigval {
257         // Actually a union of an int and a void*
258         pub sival_ptr: *mut ::c_void
259     }
260 
261     // <sys/time.h>
262     pub struct itimerval {
263         pub it_interval: ::timeval,
264         pub it_value: ::timeval,
265     }
266 
267     // <sys/times.h>
268     pub struct tms {
269         pub tms_utime: ::clock_t,
270         pub tms_stime: ::clock_t,
271         pub tms_cutime: ::clock_t,
272         pub tms_cstime: ::clock_t,
273     }
274 
275     pub struct servent {
276         pub s_name: *mut ::c_char,
277         pub s_aliases: *mut *mut ::c_char,
278         pub s_port: ::c_int,
279         pub s_proto: *mut ::c_char,
280     }
281 
282     pub struct protoent {
283         pub p_name: *mut ::c_char,
284         pub p_aliases: *mut *mut ::c_char,
285         pub p_proto: ::c_int,
286     }
287 
288     pub struct aiocb {
289         pub aio_fildes: ::c_int,
290         pub aio_lio_opcode: ::c_int,
291         pub aio_reqprio: ::c_int,
292         pub aio_buf: *mut ::c_void,
293         pub aio_nbytes: ::size_t,
294         pub aio_sigevent: ::sigevent,
295         __td: *mut ::c_void,
296         __lock: [::c_int; 2],
297         __err: ::c_int,
298         __ret: ::ssize_t,
299         pub aio_offset: off_t,
300         __next: *mut ::c_void,
301         __prev: *mut ::c_void,
302         #[cfg(target_pointer_width = "32")]
303         __dummy4: [::c_char; 24],
304         #[cfg(target_pointer_width = "64")]
305         __dummy4: [::c_char; 16],
306     }
307 
308     pub struct sigaction {
309         pub sa_sigaction: ::sighandler_t,
310         pub sa_mask: ::sigset_t,
311         pub sa_flags: ::c_int,
312         pub sa_restorer: ::Option<extern fn()>,
313     }
314 
315     pub struct termios {
316         pub c_iflag: ::tcflag_t,
317         pub c_oflag: ::tcflag_t,
318         pub c_cflag: ::tcflag_t,
319         pub c_lflag: ::tcflag_t,
320         pub c_line: ::cc_t,
321         pub c_cc: [::cc_t; ::NCCS],
322         pub __c_ispeed: ::speed_t,
323         pub __c_ospeed: ::speed_t,
324     }
325 
326     pub struct flock {
327         pub l_type: ::c_short,
328         pub l_whence: ::c_short,
329         pub l_start: ::off_t,
330         pub l_len: ::off_t,
331         pub l_pid: ::pid_t,
332     }
333 
334     pub struct ucred {
335         pub pid: ::pid_t,
336         pub uid: ::uid_t,
337         pub gid: ::gid_t,
338     }
339 
340     pub struct sockaddr {
341         pub sa_family: sa_family_t,
342         pub sa_data: [::c_char; 14],
343     }
344 
345     pub struct sockaddr_in {
346         pub sin_family: sa_family_t,
347         pub sin_port: ::in_port_t,
348         pub sin_addr: ::in_addr,
349         pub sin_zero: [u8; 8],
350     }
351 
352     pub struct sockaddr_in6 {
353         pub sin6_family: sa_family_t,
354         pub sin6_port: ::in_port_t,
355         pub sin6_flowinfo: u32,
356         pub sin6_addr: ::in6_addr,
357         pub sin6_scope_id: u32,
358     }
359 
360     pub struct addrinfo {
361         pub ai_flags: ::c_int,
362         pub ai_family: ::c_int,
363         pub ai_socktype: ::c_int,
364         pub ai_protocol: ::c_int,
365         pub ai_addrlen: socklen_t,
366 
367         pub ai_addr: *mut ::sockaddr,
368 
369         pub ai_canonname: *mut c_char,
370 
371         pub ai_next: *mut addrinfo,
372     }
373 
374     pub struct sockaddr_ll {
375         pub sll_family: ::c_ushort,
376         pub sll_protocol: ::c_ushort,
377         pub sll_ifindex: ::c_int,
378         pub sll_hatype: ::c_ushort,
379         pub sll_pkttype: ::c_uchar,
380         pub sll_halen: ::c_uchar,
381         pub sll_addr: [::c_uchar; 8]
382     }
383 
384     pub struct fd_set {
385         fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
386     }
387 
388     pub struct tm {
389         pub tm_sec: ::c_int,
390         pub tm_min: ::c_int,
391         pub tm_hour: ::c_int,
392         pub tm_mday: ::c_int,
393         pub tm_mon: ::c_int,
394         pub tm_year: ::c_int,
395         pub tm_wday: ::c_int,
396         pub tm_yday: ::c_int,
397         pub tm_isdst: ::c_int,
398         pub tm_gmtoff: ::c_long,
399         pub tm_zone: *const ::c_char,
400     }
401 
402     pub struct sched_param {
403         pub sched_priority: ::c_int,
404         pub sched_ss_low_priority: ::c_int,
405         pub sched_ss_repl_period: ::timespec,
406         pub sched_ss_init_budget: ::timespec,
407         pub sched_ss_max_repl: ::c_int,
408     }
409 
410     pub struct Dl_info {
411         pub dli_fname: *const ::c_char,
412         pub dli_fbase: *mut ::c_void,
413         pub dli_sname: *const ::c_char,
414         pub dli_saddr: *mut ::c_void,
415     }
416 
417     pub struct epoll_event {
418         pub events: u32,
419         pub u64: u64,
420     }
421 
422     pub struct lconv {
423         pub decimal_point: *mut ::c_char,
424         pub thousands_sep: *mut ::c_char,
425         pub grouping: *mut ::c_char,
426         pub int_curr_symbol: *mut ::c_char,
427         pub currency_symbol: *mut ::c_char,
428         pub mon_decimal_point: *mut ::c_char,
429         pub mon_thousands_sep: *mut ::c_char,
430         pub mon_grouping: *mut ::c_char,
431         pub positive_sign: *mut ::c_char,
432         pub negative_sign: *mut ::c_char,
433         pub int_frac_digits: ::c_char,
434         pub frac_digits: ::c_char,
435         pub p_cs_precedes: ::c_char,
436         pub p_sep_by_space: ::c_char,
437         pub n_cs_precedes: ::c_char,
438         pub n_sep_by_space: ::c_char,
439         pub p_sign_posn: ::c_char,
440         pub n_sign_posn: ::c_char,
441         pub int_p_cs_precedes: ::c_char,
442         pub int_p_sep_by_space: ::c_char,
443         pub int_n_cs_precedes: ::c_char,
444         pub int_n_sep_by_space: ::c_char,
445         pub int_p_sign_posn: ::c_char,
446         pub int_n_sign_posn: ::c_char,
447     }
448 
449     pub struct rlimit64 {
450         pub rlim_cur: rlim64_t,
451         pub rlim_max: rlim64_t,
452     }
453 
454     pub struct glob_t {
455         pub gl_pathc: ::size_t,
456         pub gl_pathv: *mut *mut c_char,
457         pub gl_offs: ::size_t,
458         pub gl_flags: ::c_int,
459 
460         __unused1: *mut ::c_void,
461         __unused2: *mut ::c_void,
462         __unused3: *mut ::c_void,
463         __unused4: *mut ::c_void,
464         __unused5: *mut ::c_void,
465     }
466 
467     pub struct ifaddrs {
468         pub ifa_next: *mut ifaddrs,
469         pub ifa_name: *mut c_char,
470         pub ifa_flags: ::c_uint,
471         pub ifa_addr: *mut ::sockaddr,
472         pub ifa_netmask: *mut ::sockaddr,
473         pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union
474         pub ifa_data: *mut ::c_void
475     }
476 
477     pub struct passwd {
478         pub pw_name: *mut ::c_char,
479         pub pw_passwd: *mut ::c_char,
480         pub pw_uid: ::uid_t,
481         pub pw_gid: ::gid_t,
482         pub pw_gecos: *mut ::c_char,
483         pub pw_dir: *mut ::c_char,
484         pub pw_shell: *mut ::c_char,
485     }
486 
487     pub struct spwd {
488         pub sp_namp: *mut ::c_char,
489         pub sp_pwdp: *mut ::c_char,
490         pub sp_lstchg: ::c_long,
491         pub sp_min: ::c_long,
492         pub sp_max: ::c_long,
493         pub sp_warn: ::c_long,
494         pub sp_inact: ::c_long,
495         pub sp_expire: ::c_long,
496         pub sp_flag: ::c_ulong,
497     }
498 
499     pub struct statvfs {
500         pub f_bsize: ::c_ulong,
501         pub f_frsize: ::c_ulong,
502         pub f_blocks: ::fsblkcnt_t,
503         pub f_bfree: ::fsblkcnt_t,
504         pub f_bavail: ::fsblkcnt_t,
505         pub f_files: ::fsfilcnt_t,
506         pub f_ffree: ::fsfilcnt_t,
507         pub f_favail: ::fsfilcnt_t,
508         #[cfg(target_endian = "little")]
509         pub f_fsid: ::c_ulong,
510         #[cfg(all(target_pointer_width = "32", not(target_arch = "x86_64")))]
511         __f_unused: ::c_int,
512         #[cfg(target_endian = "big")]
513         pub f_fsid: ::c_ulong,
514         pub f_flag: ::c_ulong,
515         pub f_namemax: ::c_ulong,
516         __f_spare: [::c_int; 6],
517     }
518 
519     pub struct dqblk {
520         pub dqb_bhardlimit: u64,
521         pub dqb_bsoftlimit: u64,
522         pub dqb_curspace: u64,
523         pub dqb_ihardlimit: u64,
524         pub dqb_isoftlimit: u64,
525         pub dqb_curinodes: u64,
526         pub dqb_btime: u64,
527         pub dqb_itime: u64,
528         pub dqb_valid: u32,
529     }
530 
531     pub struct signalfd_siginfo {
532         pub ssi_signo: u32,
533         pub ssi_errno: i32,
534         pub ssi_code: i32,
535         pub ssi_pid: u32,
536         pub ssi_uid: u32,
537         pub ssi_fd: i32,
538         pub ssi_tid: u32,
539         pub ssi_band: u32,
540         pub ssi_overrun: u32,
541         pub ssi_trapno: u32,
542         pub ssi_status: i32,
543         pub ssi_int: i32,
544         pub ssi_ptr: u64,
545         pub ssi_utime: u64,
546         pub ssi_stime: u64,
547         pub ssi_addr: u64,
548         pub ssi_addr_lsb: u16,
549         _pad2: u16,
550         pub ssi_syscall: i32,
551         pub ssi_call_addr: u64,
552         pub ssi_arch: u32,
553         _pad: [u8; 28],
554     }
555 
556     pub struct itimerspec {
557         pub it_interval: ::timespec,
558         pub it_value: ::timespec,
559     }
560 
561     pub struct fsid_t {
562         __val: [::c_int; 2],
563     }
564 
565     pub struct cpu_set_t {
566         #[cfg(all(target_pointer_width = "32",
567                   not(target_arch = "x86_64")))]
568         bits: [u32; 32],
569         #[cfg(not(all(target_pointer_width = "32",
570                       not(target_arch = "x86_64"))))]
571         bits: [u64; 16],
572     }
573 
574     pub struct if_nameindex {
575         pub if_index: ::c_uint,
576         pub if_name: *mut ::c_char,
577     }
578 
579     // System V IPC
580     pub struct msginfo {
581         pub msgpool: ::c_int,
582         pub msgmap: ::c_int,
583         pub msgmax: ::c_int,
584         pub msgmnb: ::c_int,
585         pub msgmni: ::c_int,
586         pub msgssz: ::c_int,
587         pub msgtql: ::c_int,
588         pub msgseg: ::c_ushort,
589     }
590 
591     pub struct mmsghdr {
592         pub msg_hdr: ::msghdr,
593         pub msg_len: ::c_uint,
594     }
595 
596     pub struct sembuf {
597         pub sem_num: ::c_ushort,
598         pub sem_op: ::c_short,
599         pub sem_flg: ::c_short,
600     }
601 
602     pub struct input_event {
603         pub time: ::timeval,
604         pub type_: ::__u16,
605         pub code: ::__u16,
606         pub value: ::__s32,
607     }
608 
609     pub struct input_id {
610         pub bustype: ::__u16,
611         pub vendor: ::__u16,
612         pub product: ::__u16,
613         pub version: ::__u16,
614     }
615 
616     pub struct input_absinfo {
617         pub value: ::__s32,
618         pub minimum: ::__s32,
619         pub maximum: ::__s32,
620         pub fuzz: ::__s32,
621         pub flat: ::__s32,
622         pub resolution: ::__s32,
623     }
624 
625     pub struct input_keymap_entry {
626         pub flags: ::__u8,
627         pub len: ::__u8,
628         pub index: ::__u16,
629         pub keycode: ::__u32,
630         pub scancode: [::__u8; 32],
631     }
632 
633     pub struct input_mask {
634         pub type_: ::__u32,
635         pub codes_size: ::__u32,
636         pub codes_ptr: ::__u64,
637     }
638 
639     pub struct ff_replay {
640         pub length: ::__u16,
641         pub delay: ::__u16,
642     }
643 
644     pub struct ff_trigger {
645         pub button: ::__u16,
646         pub interval: ::__u16,
647     }
648 
649     pub struct ff_envelope {
650         pub attack_length: ::__u16,
651         pub attack_level: ::__u16,
652         pub fade_length: ::__u16,
653         pub fade_level: ::__u16,
654     }
655 
656     pub struct ff_constant_effect {
657         pub level: ::__s16,
658         pub envelope: ff_envelope,
659     }
660 
661     pub struct ff_ramp_effect {
662         pub start_level: ::__s16,
663         pub end_level: ::__s16,
664         pub envelope: ff_envelope,
665     }
666 
667     pub struct ff_condition_effect {
668         pub right_saturation: ::__u16,
669         pub left_saturation: ::__u16,
670 
671         pub right_coeff: ::__s16,
672         pub left_coeff: ::__s16,
673 
674         pub deadband: ::__u16,
675         pub center: ::__s16,
676     }
677 
678     pub struct ff_periodic_effect {
679         pub waveform: ::__u16,
680         pub period: ::__u16,
681         pub magnitude: ::__s16,
682         pub offset: ::__s16,
683         pub phase: ::__u16,
684 
685         pub envelope: ff_envelope,
686 
687         pub custom_len: ::__u32,
688         pub custom_data: *mut ::__s16,
689     }
690 
691     pub struct ff_rumble_effect {
692         pub strong_magnitude: ::__u16,
693         pub weak_magnitude: ::__u16,
694     }
695 
696     pub struct ff_effect {
697         pub type_: ::__u16,
698         pub id: ::__s16,
699         pub direction: ::__u16,
700         pub trigger: ff_trigger,
701         pub replay: ff_replay,
702         // FIXME(1.0): this is actually a union
703         #[cfg(target_pointer_width = "64")]
704         pub u: [u64; 4],
705         #[cfg(target_pointer_width = "32")]
706         pub u: [u32; 7],
707     }
708 
709     pub struct dl_phdr_info {
710         #[cfg(target_pointer_width = "64")]
711         pub dlpi_addr: Elf64_Addr,
712         #[cfg(target_pointer_width = "32")]
713         pub dlpi_addr: Elf32_Addr,
714 
715         pub dlpi_name: *const ::c_char,
716 
717         #[cfg(target_pointer_width = "64")]
718         pub dlpi_phdr: *const Elf64_Phdr,
719         #[cfg(target_pointer_width = "32")]
720         pub dlpi_phdr: *const Elf32_Phdr,
721 
722         #[cfg(target_pointer_width = "64")]
723         pub dlpi_phnum: Elf64_Half,
724         #[cfg(target_pointer_width = "32")]
725         pub dlpi_phnum: Elf32_Half,
726 
727         pub dlpi_adds: ::c_ulonglong,
728         pub dlpi_subs: ::c_ulonglong,
729         pub dlpi_tls_modid: ::size_t,
730         pub dlpi_tls_data: *mut ::c_void,
731     }
732 
733     pub struct Elf32_Phdr {
734         pub p_type: Elf32_Word,
735         pub p_offset: Elf32_Off,
736         pub p_vaddr: Elf32_Addr,
737         pub p_paddr: Elf32_Addr,
738         pub p_filesz: Elf32_Word,
739         pub p_memsz: Elf32_Word,
740         pub p_flags: Elf32_Word,
741         pub p_align: Elf32_Word,
742     }
743 
744     pub struct Elf64_Phdr {
745         pub p_type: Elf64_Word,
746         pub p_flags: Elf64_Word,
747         pub p_offset: Elf64_Off,
748         pub p_vaddr: Elf64_Addr,
749         pub p_paddr: Elf64_Addr,
750         pub p_filesz: Elf64_Xword,
751         pub p_memsz: Elf64_Xword,
752         pub p_align: Elf64_Xword,
753     }
754 
755     pub struct statfs64 {
756         pub f_type: ::c_ulong,
757         pub f_bsize: ::c_ulong,
758         pub f_blocks: ::fsblkcnt_t,
759         pub f_bfree: ::fsblkcnt_t,
760         pub f_bavail: ::fsblkcnt_t,
761         pub f_files: ::fsfilcnt_t,
762         pub f_ffree: ::fsfilcnt_t,
763         pub f_fsid: ::fsid_t,
764         pub f_namelen: ::c_ulong,
765         pub f_frsize: ::c_ulong,
766         pub f_flags: ::c_ulong,
767         pub f_spare: [::c_ulong; 4],
768     }
769 
770     pub struct statvfs64 {
771         pub f_bsize: ::c_ulong,
772         pub f_frsize: ::c_ulong,
773         pub f_blocks: u64,
774         pub f_bfree: u64,
775         pub f_bavail: u64,
776         pub f_files: u64,
777         pub f_ffree: u64,
778         pub f_favail: u64,
779         pub f_fsid: ::c_ulong,
780         pub f_flag: ::c_ulong,
781         pub f_namemax: ::c_ulong,
782         __f_spare: [::c_int; 6],
783     }
784 
785     pub struct stack_t {
786         pub ss_sp: *mut ::c_void,
787         pub ss_flags: ::c_int,
788         pub ss_size: ::size_t
789     }
790 
791     pub struct pthread_attr_t {
792         __size: [u64; 7]
793     }
794 
795     pub struct sigset_t {
796         __val: [::c_ulong; 16],
797     }
798 
799     pub struct shmid_ds {
800         pub shm_perm: ::ipc_perm,
801         pub shm_segsz: ::size_t,
802         pub shm_atime: ::time_t,
803         pub shm_dtime: ::time_t,
804         pub shm_ctime: ::time_t,
805         pub shm_cpid: ::pid_t,
806         pub shm_lpid: ::pid_t,
807         pub shm_nattch: ::c_ulong,
808         __pad1: ::c_ulong,
809         __pad2: ::c_ulong,
810     }
811 
812     pub struct msqid_ds {
813         pub msg_perm: ::ipc_perm,
814         pub msg_stime: ::time_t,
815         pub msg_rtime: ::time_t,
816         pub msg_ctime: ::time_t,
817         __msg_cbytes: ::c_ulong,
818         pub msg_qnum: ::msgqnum_t,
819         pub msg_qbytes: ::msglen_t,
820         pub msg_lspid: ::pid_t,
821         pub msg_lrpid: ::pid_t,
822         __pad1: ::c_ulong,
823         __pad2: ::c_ulong,
824     }
825 
826     pub struct statfs {
827         pub f_type: ::c_ulong,
828         pub f_bsize: ::c_ulong,
829         pub f_blocks: ::fsblkcnt_t,
830         pub f_bfree: ::fsblkcnt_t,
831         pub f_bavail: ::fsblkcnt_t,
832         pub f_files: ::fsfilcnt_t,
833         pub f_ffree: ::fsfilcnt_t,
834         pub f_fsid: ::fsid_t,
835         pub f_namelen: ::c_ulong,
836         pub f_frsize: ::c_ulong,
837         pub f_flags: ::c_ulong,
838         pub f_spare: [::c_ulong; 4],
839     }
840 
841     pub struct msghdr {
842         pub msg_name: *mut ::c_void,
843         pub msg_namelen: ::socklen_t,
844         pub msg_iov: *mut ::iovec,
845         pub msg_iovlen: ::c_int,
846         __pad1: ::c_int,
847         pub msg_control: *mut ::c_void,
848         pub msg_controllen: ::socklen_t,
849         __pad2: ::socklen_t,
850         pub msg_flags: ::c_int,
851     }
852 
853     pub struct cmsghdr {
854         pub cmsg_len: ::socklen_t,
855         pub __pad1: ::c_int,
856         pub cmsg_level: ::c_int,
857         pub cmsg_type: ::c_int,
858     }
859 
860     pub struct sem_t {
861         __val: [::c_int; 8],
862     }
863 
864     pub struct siginfo_t {
865         pub si_signo: ::c_int,
866         pub si_errno: ::c_int,
867         pub si_code: ::c_int,
868         pub _pad: [::c_int; 29],
869         _align: [usize; 0],
870     }
871 
872     pub struct termios2 {
873         pub c_iflag: ::tcflag_t,
874         pub c_oflag: ::tcflag_t,
875         pub c_cflag: ::tcflag_t,
876         pub c_lflag: ::tcflag_t,
877         pub c_line: ::cc_t,
878         pub c_cc: [::cc_t; 19],
879         pub c_ispeed: ::speed_t,
880         pub c_ospeed: ::speed_t,
881     }
882 
883     pub struct in6_pktinfo {
884         pub ipi6_addr: ::in6_addr,
885         pub ipi6_ifindex: ::c_uint,
886     }
887 
888     #[cfg_attr(
889         any(
890             target_pointer_width = "32",
891             target_arch = "x86_64"
892         ),
893         repr(align(4)))]
894     #[cfg_attr(
895         not(any(
896             target_pointer_width = "32",
897             target_arch = "x86_64"
898         )),
899         repr(align(8)))]
900     pub struct pthread_mutexattr_t {
901         size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
902     }
903 
904     #[cfg_attr(target_pointer_width = "32",
905                repr(align(4)))]
906     #[cfg_attr(target_pointer_width = "64",
907                repr(align(8)))]
908     pub struct pthread_rwlockattr_t {
909         size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
910     }
911 
912     #[repr(align(4))]
913     pub struct pthread_condattr_t {
914         size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
915     }
916 }
917 
918 s_no_extra_traits! {
919     pub struct sysinfo {
920         pub uptime: ::c_ulong,
921         pub loads: [::c_ulong; 3],
922         pub totalram: ::c_ulong,
923         pub freeram: ::c_ulong,
924         pub sharedram: ::c_ulong,
925         pub bufferram: ::c_ulong,
926         pub totalswap: ::c_ulong,
927         pub freeswap: ::c_ulong,
928         pub procs: ::c_ushort,
929         pub pad: ::c_ushort,
930         pub totalhigh: ::c_ulong,
931         pub freehigh: ::c_ulong,
932         pub mem_unit: ::c_uint,
933         pub __reserved: [::c_char; 256],
934     }
935 
936     pub struct sockaddr_un {
937         pub sun_family: sa_family_t,
938         pub sun_path: [::c_char; 108]
939     }
940 
941     pub struct sockaddr_storage {
942         pub ss_family: sa_family_t,
943         __ss_pad2: [u8; 128 - 2 - 8],
944         __ss_align: ::size_t,
945     }
946 
947     pub struct utsname {
948         pub sysname: [::c_char; 65],
949         pub nodename: [::c_char; 65],
950         pub release: [::c_char; 65],
951         pub version: [::c_char; 65],
952         pub machine: [::c_char; 65],
953         pub domainname: [::c_char; 65]
954     }
955 
956     pub struct dirent {
957         pub d_ino: ::ino_t,
958         pub d_off: ::off_t,
959         pub d_reclen: ::c_ushort,
960         pub d_type: ::c_uchar,
961         pub d_name: [::c_char; 256],
962     }
963 
964     pub struct dirent64 {
965         pub d_ino: ::ino64_t,
966         pub d_off: ::off64_t,
967         pub d_reclen: ::c_ushort,
968         pub d_type: ::c_uchar,
969         pub d_name: [::c_char; 256],
970     }
971 
972     // x32 compatibility
973     // See https://sourceware.org/bugzilla/show_bug.cgi?id=21279
974     pub struct mq_attr {
975         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
976         pub mq_flags: i64,
977         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
978         pub mq_maxmsg: i64,
979         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
980         pub mq_msgsize: i64,
981         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
982         pub mq_curmsgs: i64,
983         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
984         pad: [i64; 4],
985 
986         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
987         pub mq_flags: ::c_long,
988         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
989         pub mq_maxmsg: ::c_long,
990         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
991         pub mq_msgsize: ::c_long,
992         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
993         pub mq_curmsgs: ::c_long,
994         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
995         pad: [::c_long; 4],
996     }
997 
998     pub struct sockaddr_nl {
999         pub nl_family: ::sa_family_t,
1000         nl_pad: ::c_ushort,
1001         pub nl_pid: u32,
1002         pub nl_groups: u32
1003     }
1004 
1005     pub struct sigevent {
1006         pub sigev_value: ::sigval,
1007         pub sigev_signo: ::c_int,
1008         pub sigev_notify: ::c_int,
1009         pub sigev_notify_function: fn(::sigval),
1010         pub sigev_notify_attributes: *mut pthread_attr_t,
1011         pub __pad: [::c_char; 56 - 3 * 8 /* 8 == sizeof(long) */],
1012     }
1013 
1014     #[cfg_attr(all(target_pointer_width = "32",
1015                    any(target_arch = "arm",
1016                        target_arch = "x86_64")),
1017                repr(align(4)))]
1018     #[cfg_attr(any(target_pointer_width = "64",
1019                    not(any(target_arch = "arm",
1020                            target_arch = "x86_64"))),
1021                repr(align(8)))]
1022     pub struct pthread_mutex_t {
1023         size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
1024     }
1025 
1026     #[cfg_attr(all(target_pointer_width = "32",
1027                    any(target_arch = "arm",
1028                        target_arch = "x86_64")),
1029                repr(align(4)))]
1030     #[cfg_attr(any(target_pointer_width = "64",
1031                    not(any(target_arch = "arm",
1032                            target_arch = "x86_64"))),
1033                repr(align(8)))]
1034     pub struct pthread_rwlock_t {
1035         size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
1036     }
1037 
1038     #[cfg_attr(target_pointer_width = "32",
1039                repr(align(4)))]
1040     #[cfg_attr(target_pointer_width = "64",
1041                repr(align(8)))]
1042     #[cfg_attr(target_arch = "x86",
1043                repr(align(4)))]
1044     #[cfg_attr(not(target_arch = "x86"),
1045                repr(align(8)))]
1046     pub struct pthread_cond_t {
1047         size: [u8; ::__SIZEOF_PTHREAD_COND_T],
1048     }
1049 }
1050 
1051 cfg_if! {
1052     if #[cfg(feature = "extra_traits")] {
1053         impl PartialEq for sysinfo {
1054             fn eq(&self, other: &sysinfo) -> bool {
1055                 self.uptime == other.uptime
1056                     && self.loads == other.loads
1057                     && self.totalram == other.totalram
1058                     && self.freeram == other.freeram
1059                     && self.sharedram == other.sharedram
1060                     && self.bufferram == other.bufferram
1061                     && self.totalswap == other.totalswap
1062                     && self.freeswap == other.freeswap
1063                     && self.procs == other.procs
1064                     && self.pad == other.pad
1065                     && self.totalhigh == other.totalhigh
1066                     && self.freehigh == other.freehigh
1067                     && self.mem_unit == other.mem_unit
1068                     && self
1069                         .__reserved
1070                         .iter()
1071                         .zip(other.__reserved.iter())
1072                         .all(|(a,b)| a == b)
1073             }
1074         }
1075         impl Eq for sysinfo {}
1076         impl ::fmt::Debug for sysinfo {
1077             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1078                 f.debug_struct("sysinfo")
1079                     .field("uptime", &self.uptime)
1080                     .field("loads", &self.loads)
1081                     .field("totalram", &self.totalram)
1082                     .field("freeram", &self.freeram)
1083                     .field("sharedram", &self.sharedram)
1084                     .field("bufferram", &self.bufferram)
1085                     .field("totalswap", &self.totalswap)
1086                     .field("freeswap", &self.freeswap)
1087                     .field("procs", &self.procs)
1088                     .field("pad", &self.pad)
1089                     .field("totalhigh", &self.totalhigh)
1090                     .field("freehigh", &self.freehigh)
1091                     .field("mem_unit", &self.mem_unit)
1092                     // FIXME: .field("__reserved", &self.__reserved)
1093                     .finish()
1094             }
1095         }
1096         impl ::hash::Hash for sysinfo {
1097             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1098                 self.uptime.hash(state);
1099                 self.loads.hash(state);
1100                 self.totalram.hash(state);
1101                 self.freeram.hash(state);
1102                 self.sharedram.hash(state);
1103                 self.bufferram.hash(state);
1104                 self.totalswap.hash(state);
1105                 self.freeswap.hash(state);
1106                 self.procs.hash(state);
1107                 self.pad.hash(state);
1108                 self.totalhigh.hash(state);
1109                 self.freehigh.hash(state);
1110                 self.mem_unit.hash(state);
1111                 self.__reserved.hash(state);
1112             }
1113         }
1114 
1115         impl PartialEq for sockaddr_un {
1116             fn eq(&self, other: &sockaddr_un) -> bool {
1117                 self.sun_family == other.sun_family
1118                     && self
1119                     .sun_path
1120                     .iter()
1121                     .zip(other.sun_path.iter())
1122                     .all(|(a,b)| a == b)
1123             }
1124         }
1125         impl Eq for sockaddr_un {}
1126         impl ::fmt::Debug for sockaddr_un {
1127             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1128                 f.debug_struct("sockaddr_un")
1129                     .field("sun_family", &self.sun_family)
1130                     // FIXME: .field("sun_path", &self.sun_path)
1131                     .finish()
1132             }
1133         }
1134         impl ::hash::Hash for sockaddr_un {
1135             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1136                 self.sun_family.hash(state);
1137                 self.sun_path.hash(state);
1138             }
1139         }
1140 
1141         impl PartialEq for sockaddr_storage {
1142             fn eq(&self, other: &sockaddr_storage) -> bool {
1143                 self.ss_family == other.ss_family
1144                     && self.__ss_align == other.__ss_align
1145                     && self
1146                     .__ss_pad2
1147                     .iter()
1148                     .zip(other.__ss_pad2.iter())
1149                     .all(|(a, b)| a == b)
1150             }
1151         }
1152         impl Eq for sockaddr_storage {}
1153         impl ::fmt::Debug for sockaddr_storage {
1154             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1155                 f.debug_struct("sockaddr_storage")
1156                     .field("ss_family", &self.ss_family)
1157                     .field("__ss_align", &self.__ss_align)
1158                     // FIXME: .field("__ss_pad2", &self.__ss_pad2)
1159                     .finish()
1160             }
1161         }
1162         impl ::hash::Hash for sockaddr_storage {
1163             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1164                 self.ss_family.hash(state);
1165                 self.__ss_align.hash(state);
1166                 self.__ss_pad2.hash(state);
1167             }
1168         }
1169 
1170         impl PartialEq for utsname {
1171             fn eq(&self, other: &utsname) -> bool {
1172                 self.sysname
1173                     .iter()
1174                     .zip(other.sysname.iter())
1175                     .all(|(a,b)| a == b)
1176                     && self
1177                     .nodename
1178                     .iter()
1179                     .zip(other.nodename.iter())
1180                     .all(|(a,b)| a == b)
1181                     && self
1182                     .release
1183                     .iter()
1184                     .zip(other.release.iter())
1185                     .all(|(a,b)| a == b)
1186                     && self
1187                     .version
1188                     .iter()
1189                     .zip(other.version.iter())
1190                     .all(|(a,b)| a == b)
1191                     && self
1192                     .machine
1193                     .iter()
1194                     .zip(other.machine.iter())
1195                     .all(|(a,b)| a == b)
1196             }
1197         }
1198         impl Eq for utsname {}
1199         impl ::fmt::Debug for utsname {
1200             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1201                 f.debug_struct("utsname")
1202                     // FIXME: .field("sysname", &self.sysname)
1203                     // FIXME: .field("nodename", &self.nodename)
1204                     // FIXME: .field("release", &self.release)
1205                     // FIXME: .field("version", &self.version)
1206                     // FIXME: .field("machine", &self.machine)
1207                     .finish()
1208             }
1209         }
1210         impl ::hash::Hash for utsname {
1211             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1212                 self.sysname.hash(state);
1213                 self.nodename.hash(state);
1214                 self.release.hash(state);
1215                 self.version.hash(state);
1216                 self.machine.hash(state);
1217             }
1218         }
1219 
1220         impl PartialEq for dirent {
1221             fn eq(&self, other: &dirent) -> bool {
1222                 self.d_ino == other.d_ino
1223                     && self.d_off == other.d_off
1224                     && self.d_reclen == other.d_reclen
1225                     && self.d_type == other.d_type
1226                     && self
1227                     .d_name
1228                     .iter()
1229                     .zip(other.d_name.iter())
1230                     .all(|(a,b)| a == b)
1231             }
1232         }
1233         impl Eq for dirent {}
1234         impl ::fmt::Debug for dirent {
1235             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1236                 f.debug_struct("dirent")
1237                     .field("d_ino", &self.d_ino)
1238                     .field("d_off", &self.d_off)
1239                     .field("d_reclen", &self.d_reclen)
1240                     .field("d_type", &self.d_type)
1241                     // FIXME: .field("d_name", &self.d_name)
1242                     .finish()
1243             }
1244         }
1245         impl ::hash::Hash for dirent {
1246             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1247                 self.d_ino.hash(state);
1248                 self.d_off.hash(state);
1249                 self.d_reclen.hash(state);
1250                 self.d_type.hash(state);
1251                 self.d_name.hash(state);
1252             }
1253         }
1254 
1255         impl PartialEq for dirent64 {
1256             fn eq(&self, other: &dirent64) -> bool {
1257                 self.d_ino == other.d_ino
1258                     && self.d_off == other.d_off
1259                     && self.d_reclen == other.d_reclen
1260                     && self.d_type == other.d_type
1261                     && self
1262                     .d_name
1263                     .iter()
1264                     .zip(other.d_name.iter())
1265                     .all(|(a,b)| a == b)
1266             }
1267         }
1268         impl Eq for dirent64 {}
1269         impl ::fmt::Debug for dirent64 {
1270             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1271                 f.debug_struct("dirent64")
1272                     .field("d_ino", &self.d_ino)
1273                     .field("d_off", &self.d_off)
1274                     .field("d_reclen", &self.d_reclen)
1275                     .field("d_type", &self.d_type)
1276                     // FIXME: .field("d_name", &self.d_name)
1277                     .finish()
1278             }
1279         }
1280         impl ::hash::Hash for dirent64 {
1281             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1282                 self.d_ino.hash(state);
1283                 self.d_off.hash(state);
1284                 self.d_reclen.hash(state);
1285                 self.d_type.hash(state);
1286                 self.d_name.hash(state);
1287             }
1288         }
1289 
1290         impl PartialEq for mq_attr {
1291             fn eq(&self, other: &mq_attr) -> bool {
1292                 self.mq_flags == other.mq_flags &&
1293                 self.mq_maxmsg == other.mq_maxmsg &&
1294                 self.mq_msgsize == other.mq_msgsize &&
1295                 self.mq_curmsgs == other.mq_curmsgs
1296             }
1297         }
1298         impl Eq for mq_attr {}
1299         impl ::fmt::Debug for mq_attr {
1300             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1301                 f.debug_struct("mq_attr")
1302                     .field("mq_flags", &self.mq_flags)
1303                     .field("mq_maxmsg", &self.mq_maxmsg)
1304                     .field("mq_msgsize", &self.mq_msgsize)
1305                     .field("mq_curmsgs", &self.mq_curmsgs)
1306                     .finish()
1307             }
1308         }
1309         impl ::hash::Hash for mq_attr {
1310             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1311                 self.mq_flags.hash(state);
1312                 self.mq_maxmsg.hash(state);
1313                 self.mq_msgsize.hash(state);
1314                 self.mq_curmsgs.hash(state);
1315             }
1316         }
1317 
1318         impl PartialEq for sockaddr_nl {
1319             fn eq(&self, other: &sockaddr_nl) -> bool {
1320                 self.nl_family == other.nl_family &&
1321                 self.nl_pid == other.nl_pid &&
1322                 self.nl_groups == other.nl_groups
1323             }
1324         }
1325         impl Eq for sockaddr_nl {}
1326         impl ::fmt::Debug for sockaddr_nl {
1327             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1328                 f.debug_struct("sockaddr_nl")
1329                     .field("nl_family", &self.nl_family)
1330                     .field("nl_pid", &self.nl_pid)
1331                     .field("nl_groups", &self.nl_groups)
1332                     .finish()
1333             }
1334         }
1335         impl ::hash::Hash for sockaddr_nl {
1336             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1337                 self.nl_family.hash(state);
1338                 self.nl_pid.hash(state);
1339                 self.nl_groups.hash(state);
1340             }
1341         }
1342 
1343         impl PartialEq for sigevent {
1344             fn eq(&self, other: &sigevent) -> bool {
1345                 self.sigev_value == other.sigev_value
1346                     && self.sigev_signo == other.sigev_signo
1347                     && self.sigev_notify == other.sigev_notify
1348                     && self.sigev_notify_function
1349                         == other.sigev_notify_function
1350                     && self.sigev_notify_attributes
1351                         == other.sigev_notify_attributes
1352             }
1353         }
1354         impl Eq for sigevent {}
1355         impl ::fmt::Debug for sigevent {
1356             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1357                 f.debug_struct("sigevent")
1358                     .field("sigev_value", &self.sigev_value)
1359                     .field("sigev_signo", &self.sigev_signo)
1360                     .field("sigev_notify", &self.sigev_notify)
1361                     .field("sigev_notify_function", &self.sigev_notify_function)
1362                     .field("sigev_notify_attributes",
1363                            &self.sigev_notify_attributes)
1364                     .finish()
1365             }
1366         }
1367         impl ::hash::Hash for sigevent {
1368             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1369                 self.sigev_value.hash(state);
1370                 self.sigev_signo.hash(state);
1371                 self.sigev_notify.hash(state);
1372                 self.sigev_notify_function.hash(state);
1373                 self.sigev_notify_attributes.hash(state);
1374             }
1375         }
1376 
1377         impl PartialEq for pthread_cond_t {
1378             fn eq(&self, other: &pthread_cond_t) -> bool {
1379                 self.size
1380                     .iter()
1381                     .zip(other.size.iter())
1382                     .all(|(a,b)| a == b)
1383             }
1384         }
1385         impl Eq for pthread_cond_t {}
1386         impl ::fmt::Debug for pthread_cond_t {
1387             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1388                 f.debug_struct("pthread_cond_t")
1389                     // FIXME: .field("size", &self.size)
1390                     .finish()
1391             }
1392         }
1393         impl ::hash::Hash for pthread_cond_t {
1394             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1395                 self.size.hash(state);
1396             }
1397         }
1398 
1399         impl PartialEq for pthread_mutex_t {
1400             fn eq(&self, other: &pthread_mutex_t) -> bool {
1401                 self.size
1402                     .iter()
1403                     .zip(other.size.iter())
1404                     .all(|(a,b)| a == b)
1405             }
1406         }
1407         impl Eq for pthread_mutex_t {}
1408         impl ::fmt::Debug for pthread_mutex_t {
1409             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1410                 f.debug_struct("pthread_mutex_t")
1411                     // FIXME: .field("size", &self.size)
1412                     .finish()
1413             }
1414         }
1415         impl ::hash::Hash for pthread_mutex_t {
1416             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1417                 self.size.hash(state);
1418             }
1419         }
1420 
1421         impl PartialEq for pthread_rwlock_t {
1422             fn eq(&self, other: &pthread_rwlock_t) -> bool {
1423                 self.size
1424                     .iter()
1425                     .zip(other.size.iter())
1426                     .all(|(a,b)| a == b)
1427             }
1428         }
1429         impl Eq for pthread_rwlock_t {}
1430         impl ::fmt::Debug for pthread_rwlock_t {
1431             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1432                 f.debug_struct("pthread_rwlock_t")
1433                     // FIXME: .field("size", &self.size)
1434                     .finish()
1435             }
1436         }
1437         impl ::hash::Hash for pthread_rwlock_t {
1438             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1439                 self.size.hash(state);
1440             }
1441         }
1442     }
1443 }
1444 
1445 // PUB_CONST
1446 
1447 pub const INT_MIN: c_int = -2147483648;
1448 pub const INT_MAX: c_int = 2147483647;
1449 
1450 pub const SIG_DFL: sighandler_t = 0 as sighandler_t;
1451 pub const SIG_IGN: sighandler_t = 1 as sighandler_t;
1452 pub const SIG_ERR: sighandler_t = !0 as sighandler_t;
1453 
1454 pub const DT_UNKNOWN: u8 = 0;
1455 pub const DT_FIFO: u8 = 1;
1456 pub const DT_CHR: u8 = 2;
1457 pub const DT_DIR: u8 = 4;
1458 pub const DT_BLK: u8 = 6;
1459 pub const DT_REG: u8 = 8;
1460 pub const DT_LNK: u8 = 10;
1461 pub const DT_SOCK: u8 = 12;
1462 
1463 pub const FD_CLOEXEC: ::c_int = 0x1;
1464 
1465 pub const USRQUOTA: ::c_int = 0;
1466 pub const GRPQUOTA: ::c_int = 1;
1467 
1468 pub const SIGIOT: ::c_int = 6;
1469 
1470 pub const S_ISUID: ::mode_t = 0o4000;
1471 pub const S_ISGID: ::mode_t = 0o2000;
1472 pub const S_ISVTX: ::mode_t = 0o1000;
1473 
1474 pub const IF_NAMESIZE: ::size_t = 16;
1475 pub const IFNAMSIZ: ::size_t = IF_NAMESIZE;
1476 
1477 pub const LOG_EMERG: ::c_int = 0;
1478 pub const LOG_ALERT: ::c_int = 1;
1479 pub const LOG_CRIT: ::c_int = 2;
1480 pub const LOG_ERR: ::c_int = 3;
1481 pub const LOG_WARNING: ::c_int = 4;
1482 pub const LOG_NOTICE: ::c_int = 5;
1483 pub const LOG_INFO: ::c_int = 6;
1484 pub const LOG_DEBUG: ::c_int = 7;
1485 
1486 pub const LOG_KERN: ::c_int = 0;
1487 pub const LOG_USER: ::c_int = 1 << 3;
1488 pub const LOG_MAIL: ::c_int = 2 << 3;
1489 pub const LOG_DAEMON: ::c_int = 3 << 3;
1490 pub const LOG_AUTH: ::c_int = 4 << 3;
1491 pub const LOG_SYSLOG: ::c_int = 5 << 3;
1492 pub const LOG_LPR: ::c_int = 6 << 3;
1493 pub const LOG_NEWS: ::c_int = 7 << 3;
1494 pub const LOG_UUCP: ::c_int = 8 << 3;
1495 pub const LOG_LOCAL0: ::c_int = 16 << 3;
1496 pub const LOG_LOCAL1: ::c_int = 17 << 3;
1497 pub const LOG_LOCAL2: ::c_int = 18 << 3;
1498 pub const LOG_LOCAL3: ::c_int = 19 << 3;
1499 pub const LOG_LOCAL4: ::c_int = 20 << 3;
1500 pub const LOG_LOCAL5: ::c_int = 21 << 3;
1501 pub const LOG_LOCAL6: ::c_int = 22 << 3;
1502 pub const LOG_LOCAL7: ::c_int = 23 << 3;
1503 
1504 pub const LOG_PID: ::c_int = 0x01;
1505 pub const LOG_CONS: ::c_int = 0x02;
1506 pub const LOG_ODELAY: ::c_int = 0x04;
1507 pub const LOG_NDELAY: ::c_int = 0x08;
1508 pub const LOG_NOWAIT: ::c_int = 0x10;
1509 
1510 pub const LOG_PRIMASK: ::c_int = 7;
1511 pub const LOG_FACMASK: ::c_int = 0x3f8;
1512 
1513 pub const PRIO_PROCESS: ::c_int = 0;
1514 pub const PRIO_PGRP: ::c_int = 1;
1515 pub const PRIO_USER: ::c_int = 2;
1516 
1517 pub const PRIO_MIN: ::c_int = -20;
1518 pub const PRIO_MAX: ::c_int = 20;
1519 
1520 pub const IPPROTO_ICMP: ::c_int = 1;
1521 pub const IPPROTO_ICMPV6: ::c_int = 58;
1522 pub const IPPROTO_TCP: ::c_int = 6;
1523 pub const IPPROTO_UDP: ::c_int = 17;
1524 pub const IPPROTO_IP: ::c_int = 0;
1525 pub const IPPROTO_IPV6: ::c_int = 41;
1526 
1527 pub const INADDR_LOOPBACK: in_addr_t = 2130706433;
1528 pub const INADDR_ANY: in_addr_t = 0;
1529 pub const INADDR_BROADCAST: in_addr_t = 4294967295;
1530 pub const INADDR_NONE: in_addr_t = 4294967295;
1531 
1532 pub const EXIT_FAILURE: ::c_int = 1;
1533 pub const EXIT_SUCCESS: ::c_int = 0;
1534 pub const RAND_MAX: ::c_int = 2147483647;
1535 pub const EOF: ::c_int = -1;
1536 pub const SEEK_SET: ::c_int = 0;
1537 pub const SEEK_CUR: ::c_int = 1;
1538 pub const SEEK_END: ::c_int = 2;
1539 pub const _IOFBF: ::c_int = 0;
1540 pub const _IONBF: ::c_int = 2;
1541 pub const _IOLBF: ::c_int = 1;
1542 
1543 pub const F_DUPFD: ::c_int = 0;
1544 pub const F_GETFD: ::c_int = 1;
1545 pub const F_SETFD: ::c_int = 2;
1546 pub const F_GETFL: ::c_int = 3;
1547 pub const F_SETFL: ::c_int = 4;
1548 
1549 // Linux-specific fcntls
1550 pub const F_SETLEASE: ::c_int = 1024;
1551 pub const F_GETLEASE: ::c_int = 1025;
1552 pub const F_NOTIFY: ::c_int = 1026;
1553 pub const F_CANCELLK: ::c_int = 1029;
1554 pub const F_DUPFD_CLOEXEC: ::c_int = 1030;
1555 pub const F_SETPIPE_SZ: ::c_int = 1031;
1556 pub const F_GETPIPE_SZ: ::c_int = 1032;
1557 pub const F_ADD_SEALS: ::c_int = 1033;
1558 pub const F_GET_SEALS: ::c_int = 1034;
1559 
1560 pub const F_SEAL_SEAL: ::c_int = 0x0001;
1561 pub const F_SEAL_SHRINK: ::c_int = 0x0002;
1562 pub const F_SEAL_GROW: ::c_int = 0x0004;
1563 pub const F_SEAL_WRITE: ::c_int = 0x0008;
1564 
1565 // FIXME(#235): Include file sealing fcntls once we have a way to verify them.
1566 
1567 pub const SIGTRAP: ::c_int = 5;
1568 
1569 pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
1570 pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
1571 
1572 pub const CLOCK_REALTIME: ::clockid_t = 0;
1573 pub const CLOCK_MONOTONIC: ::clockid_t = 1;
1574 pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
1575 pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 3;
1576 pub const CLOCK_MONOTONIC_RAW: ::clockid_t = 4;
1577 pub const CLOCK_REALTIME_COARSE: ::clockid_t = 5;
1578 pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = 6;
1579 pub const CLOCK_BOOTTIME: ::clockid_t = 7;
1580 pub const CLOCK_REALTIME_ALARM: ::clockid_t = 8;
1581 pub const CLOCK_BOOTTIME_ALARM: ::clockid_t = 9;
1582 pub const CLOCK_SGI_CYCLE: ::clockid_t = 10;
1583 pub const CLOCK_TAI: ::clockid_t = 11;
1584 pub const TIMER_ABSTIME: ::c_int = 1;
1585 
1586 pub const RLIMIT_CPU: ::c_int = 0;
1587 pub const RLIMIT_FSIZE: ::c_int = 1;
1588 pub const RLIMIT_DATA: ::c_int = 2;
1589 pub const RLIMIT_STACK: ::c_int = 3;
1590 pub const RLIMIT_CORE: ::c_int = 4;
1591 pub const RLIMIT_LOCKS: ::c_int = 10;
1592 pub const RLIMIT_SIGPENDING: ::c_int = 11;
1593 pub const RLIMIT_MSGQUEUE: ::c_int = 12;
1594 pub const RLIMIT_NICE: ::c_int = 13;
1595 pub const RLIMIT_RTPRIO: ::c_int = 14;
1596 
1597 pub const RUSAGE_SELF: ::c_int = 0;
1598 
1599 pub const O_RDONLY: ::c_int = 0;
1600 pub const O_WRONLY: ::c_int = 1;
1601 pub const O_RDWR: ::c_int = 2;
1602 
1603 pub const S_IFIFO: ::mode_t = 0o1_0000;
1604 pub const S_IFCHR: ::mode_t = 0o2_0000;
1605 pub const S_IFBLK: ::mode_t = 0o6_0000;
1606 pub const S_IFDIR: ::mode_t = 0o4_0000;
1607 pub const S_IFREG: ::mode_t = 0o10_0000;
1608 pub const S_IFLNK: ::mode_t = 0o12_0000;
1609 pub const S_IFSOCK: ::mode_t = 0o14_0000;
1610 pub const S_IFMT: ::mode_t = 0o17_0000;
1611 pub const S_IRWXU: ::mode_t = 0o0700;
1612 pub const S_IXUSR: ::mode_t = 0o0100;
1613 pub const S_IWUSR: ::mode_t = 0o0200;
1614 pub const S_IRUSR: ::mode_t = 0o0400;
1615 pub const S_IRWXG: ::mode_t = 0o0070;
1616 pub const S_IXGRP: ::mode_t = 0o0010;
1617 pub const S_IWGRP: ::mode_t = 0o0020;
1618 pub const S_IRGRP: ::mode_t = 0o0040;
1619 pub const S_IRWXO: ::mode_t = 0o0007;
1620 pub const S_IXOTH: ::mode_t = 0o0001;
1621 pub const S_IWOTH: ::mode_t = 0o0002;
1622 pub const S_IROTH: ::mode_t = 0o0004;
1623 pub const F_OK: ::c_int = 0;
1624 pub const R_OK: ::c_int = 4;
1625 pub const W_OK: ::c_int = 2;
1626 pub const X_OK: ::c_int = 1;
1627 pub const STDIN_FILENO: ::c_int = 0;
1628 pub const STDOUT_FILENO: ::c_int = 1;
1629 pub const STDERR_FILENO: ::c_int = 2;
1630 pub const SIGHUP: ::c_int = 1;
1631 pub const SIGINT: ::c_int = 2;
1632 pub const SIGQUIT: ::c_int = 3;
1633 pub const SIGILL: ::c_int = 4;
1634 pub const SIGABRT: ::c_int = 6;
1635 pub const SIGFPE: ::c_int = 8;
1636 pub const SIGKILL: ::c_int = 9;
1637 pub const SIGSEGV: ::c_int = 11;
1638 pub const SIGPIPE: ::c_int = 13;
1639 pub const SIGALRM: ::c_int = 14;
1640 pub const SIGTERM: ::c_int = 15;
1641 
1642 pub const PROT_NONE: ::c_int = 0;
1643 pub const PROT_READ: ::c_int = 1;
1644 pub const PROT_WRITE: ::c_int = 2;
1645 pub const PROT_EXEC: ::c_int = 4;
1646 
1647 pub const LC_CTYPE: ::c_int = 0;
1648 pub const LC_NUMERIC: ::c_int = 1;
1649 pub const LC_TIME: ::c_int = 2;
1650 pub const LC_COLLATE: ::c_int = 3;
1651 pub const LC_MONETARY: ::c_int = 4;
1652 pub const LC_MESSAGES: ::c_int = 5;
1653 pub const LC_ALL: ::c_int = 6;
1654 pub const LC_CTYPE_MASK: ::c_int = 1 << LC_CTYPE;
1655 pub const LC_NUMERIC_MASK: ::c_int = 1 << LC_NUMERIC;
1656 pub const LC_TIME_MASK: ::c_int = 1 << LC_TIME;
1657 pub const LC_COLLATE_MASK: ::c_int = 1 << LC_COLLATE;
1658 pub const LC_MONETARY_MASK: ::c_int = 1 << LC_MONETARY;
1659 pub const LC_MESSAGES_MASK: ::c_int = 1 << LC_MESSAGES;
1660 // LC_ALL_MASK defined per platform
1661 
1662 pub const MAP_FILE: ::c_int = 0x0000;
1663 pub const MAP_SHARED: ::c_int = 0x0001;
1664 pub const MAP_PRIVATE: ::c_int = 0x0002;
1665 pub const MAP_FIXED: ::c_int = 0x0010;
1666 
1667 pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
1668 
1669 // MS_ flags for msync(2)
1670 pub const MS_ASYNC: ::c_int = 0x0001;
1671 pub const MS_INVALIDATE: ::c_int = 0x0002;
1672 pub const MS_SYNC: ::c_int = 0x0004;
1673 
1674 // MS_ flags for mount(2)
1675 pub const MS_RDONLY: ::c_ulong = 0x01;
1676 pub const MS_NOSUID: ::c_ulong = 0x02;
1677 pub const MS_NODEV: ::c_ulong = 0x04;
1678 pub const MS_NOEXEC: ::c_ulong = 0x08;
1679 pub const MS_SYNCHRONOUS: ::c_ulong = 0x10;
1680 pub const MS_REMOUNT: ::c_ulong = 0x20;
1681 pub const MS_MANDLOCK: ::c_ulong = 0x40;
1682 pub const MS_DIRSYNC: ::c_ulong = 0x80;
1683 pub const MS_NOATIME: ::c_ulong = 0x0400;
1684 pub const MS_NODIRATIME: ::c_ulong = 0x0800;
1685 pub const MS_BIND: ::c_ulong = 0x1000;
1686 pub const MS_MOVE: ::c_ulong = 0x2000;
1687 pub const MS_REC: ::c_ulong = 0x4000;
1688 pub const MS_SILENT: ::c_ulong = 0x8000;
1689 pub const MS_POSIXACL: ::c_ulong = 0x010000;
1690 pub const MS_UNBINDABLE: ::c_ulong = 0x020000;
1691 pub const MS_PRIVATE: ::c_ulong = 0x040000;
1692 pub const MS_SLAVE: ::c_ulong = 0x080000;
1693 pub const MS_SHARED: ::c_ulong = 0x100000;
1694 pub const MS_RELATIME: ::c_ulong = 0x200000;
1695 pub const MS_KERNMOUNT: ::c_ulong = 0x400000;
1696 pub const MS_I_VERSION: ::c_ulong = 0x800000;
1697 pub const MS_STRICTATIME: ::c_ulong = 0x1000000;
1698 pub const MS_ACTIVE: ::c_ulong = 0x40000000;
1699 pub const MS_NOUSER: ::c_ulong = 0x80000000;
1700 pub const MS_MGC_VAL: ::c_ulong = 0xc0ed0000;
1701 pub const MS_MGC_MSK: ::c_ulong = 0xffff0000;
1702 pub const MS_RMT_MASK: ::c_ulong = 0x800051;
1703 
1704 pub const EPERM: ::c_int = 1;
1705 pub const ENOENT: ::c_int = 2;
1706 pub const ESRCH: ::c_int = 3;
1707 pub const EINTR: ::c_int = 4;
1708 pub const EIO: ::c_int = 5;
1709 pub const ENXIO: ::c_int = 6;
1710 pub const E2BIG: ::c_int = 7;
1711 pub const ENOEXEC: ::c_int = 8;
1712 pub const EBADF: ::c_int = 9;
1713 pub const ECHILD: ::c_int = 10;
1714 pub const EAGAIN: ::c_int = 11;
1715 pub const ENOMEM: ::c_int = 12;
1716 pub const EACCES: ::c_int = 13;
1717 pub const EFAULT: ::c_int = 14;
1718 pub const ENOTBLK: ::c_int = 15;
1719 pub const EBUSY: ::c_int = 16;
1720 pub const EEXIST: ::c_int = 17;
1721 pub const EXDEV: ::c_int = 18;
1722 pub const ENODEV: ::c_int = 19;
1723 pub const ENOTDIR: ::c_int = 20;
1724 pub const EISDIR: ::c_int = 21;
1725 pub const EINVAL: ::c_int = 22;
1726 pub const ENFILE: ::c_int = 23;
1727 pub const EMFILE: ::c_int = 24;
1728 pub const ENOTTY: ::c_int = 25;
1729 pub const ETXTBSY: ::c_int = 26;
1730 pub const EFBIG: ::c_int = 27;
1731 pub const ENOSPC: ::c_int = 28;
1732 pub const ESPIPE: ::c_int = 29;
1733 pub const EROFS: ::c_int = 30;
1734 pub const EMLINK: ::c_int = 31;
1735 pub const EPIPE: ::c_int = 32;
1736 pub const EDOM: ::c_int = 33;
1737 pub const ERANGE: ::c_int = 34;
1738 pub const EWOULDBLOCK: ::c_int = EAGAIN;
1739 
1740 pub const SCM_RIGHTS: ::c_int = 0x01;
1741 pub const SCM_CREDENTIALS: ::c_int = 0x02;
1742 
1743 pub const PROT_GROWSDOWN: ::c_int = 0x1000000;
1744 pub const PROT_GROWSUP: ::c_int = 0x2000000;
1745 
1746 pub const MAP_TYPE: ::c_int = 0x000f;
1747 
1748 pub const MADV_NORMAL: ::c_int = 0;
1749 pub const MADV_RANDOM: ::c_int = 1;
1750 pub const MADV_SEQUENTIAL: ::c_int = 2;
1751 pub const MADV_WILLNEED: ::c_int = 3;
1752 pub const MADV_DONTNEED: ::c_int = 4;
1753 pub const MADV_FREE: ::c_int = 8;
1754 pub const MADV_REMOVE: ::c_int = 9;
1755 pub const MADV_DONTFORK: ::c_int = 10;
1756 pub const MADV_DOFORK: ::c_int = 11;
1757 pub const MADV_MERGEABLE: ::c_int = 12;
1758 pub const MADV_UNMERGEABLE: ::c_int = 13;
1759 pub const MADV_HUGEPAGE: ::c_int = 14;
1760 pub const MADV_NOHUGEPAGE: ::c_int = 15;
1761 pub const MADV_DONTDUMP: ::c_int = 16;
1762 pub const MADV_DODUMP: ::c_int = 17;
1763 pub const MADV_HWPOISON: ::c_int = 100;
1764 pub const MADV_SOFT_OFFLINE: ::c_int = 101;
1765 
1766 pub const IFF_UP: ::c_int = 0x1;
1767 pub const IFF_BROADCAST: ::c_int = 0x2;
1768 pub const IFF_DEBUG: ::c_int = 0x4;
1769 pub const IFF_LOOPBACK: ::c_int = 0x8;
1770 pub const IFF_POINTOPOINT: ::c_int = 0x10;
1771 pub const IFF_NOTRAILERS: ::c_int = 0x20;
1772 pub const IFF_RUNNING: ::c_int = 0x40;
1773 pub const IFF_NOARP: ::c_int = 0x80;
1774 pub const IFF_PROMISC: ::c_int = 0x100;
1775 pub const IFF_ALLMULTI: ::c_int = 0x200;
1776 pub const IFF_MASTER: ::c_int = 0x400;
1777 pub const IFF_SLAVE: ::c_int = 0x800;
1778 pub const IFF_MULTICAST: ::c_int = 0x1000;
1779 pub const IFF_PORTSEL: ::c_int = 0x2000;
1780 pub const IFF_AUTOMEDIA: ::c_int = 0x4000;
1781 pub const IFF_DYNAMIC: ::c_int = 0x8000;
1782 pub const IFF_TUN: ::c_int = 0x0001;
1783 pub const IFF_TAP: ::c_int = 0x0002;
1784 pub const IFF_NO_PI: ::c_int = 0x1000;
1785 
1786 pub const SOL_IP: ::c_int = 0;
1787 pub const SOL_TCP: ::c_int = 6;
1788 pub const SOL_UDP: ::c_int = 17;
1789 pub const SOL_IPV6: ::c_int = 41;
1790 pub const SOL_ICMPV6: ::c_int = 58;
1791 pub const SOL_RAW: ::c_int = 255;
1792 pub const SOL_DECNET: ::c_int = 261;
1793 pub const SOL_X25: ::c_int = 262;
1794 pub const SOL_PACKET: ::c_int = 263;
1795 pub const SOL_ATM: ::c_int = 264;
1796 pub const SOL_AAL: ::c_int = 265;
1797 pub const SOL_IRDA: ::c_int = 266;
1798 pub const SOL_NETBEUI: ::c_int = 267;
1799 pub const SOL_LLC: ::c_int = 268;
1800 pub const SOL_DCCP: ::c_int = 269;
1801 pub const SOL_NETLINK: ::c_int = 270;
1802 pub const SOL_TIPC: ::c_int = 271;
1803 
1804 pub const AF_UNSPEC: ::c_int = 0;
1805 pub const AF_UNIX: ::c_int = 1;
1806 pub const AF_LOCAL: ::c_int = 1;
1807 pub const AF_INET: ::c_int = 2;
1808 pub const AF_AX25: ::c_int = 3;
1809 pub const AF_IPX: ::c_int = 4;
1810 pub const AF_APPLETALK: ::c_int = 5;
1811 pub const AF_NETROM: ::c_int = 6;
1812 pub const AF_BRIDGE: ::c_int = 7;
1813 pub const AF_ATMPVC: ::c_int = 8;
1814 pub const AF_X25: ::c_int = 9;
1815 pub const AF_INET6: ::c_int = 10;
1816 pub const AF_ROSE: ::c_int = 11;
1817 pub const AF_DECnet: ::c_int = 12;
1818 pub const AF_NETBEUI: ::c_int = 13;
1819 pub const AF_SECURITY: ::c_int = 14;
1820 pub const AF_KEY: ::c_int = 15;
1821 pub const AF_NETLINK: ::c_int = 16;
1822 pub const AF_ROUTE: ::c_int = AF_NETLINK;
1823 pub const AF_PACKET: ::c_int = 17;
1824 pub const AF_ASH: ::c_int = 18;
1825 pub const AF_ECONET: ::c_int = 19;
1826 pub const AF_ATMSVC: ::c_int = 20;
1827 pub const AF_RDS: ::c_int = 21;
1828 pub const AF_SNA: ::c_int = 22;
1829 pub const AF_IRDA: ::c_int = 23;
1830 pub const AF_PPPOX: ::c_int = 24;
1831 pub const AF_WANPIPE: ::c_int = 25;
1832 pub const AF_LLC: ::c_int = 26;
1833 pub const AF_CAN: ::c_int = 29;
1834 pub const AF_TIPC: ::c_int = 30;
1835 pub const AF_BLUETOOTH: ::c_int = 31;
1836 pub const AF_IUCV: ::c_int = 32;
1837 pub const AF_RXRPC: ::c_int = 33;
1838 pub const AF_ISDN: ::c_int = 34;
1839 pub const AF_PHONET: ::c_int = 35;
1840 pub const AF_IEEE802154: ::c_int = 36;
1841 pub const AF_CAIF: ::c_int = 37;
1842 pub const AF_ALG: ::c_int = 38;
1843 
1844 pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
1845 pub const PF_UNIX: ::c_int = AF_UNIX;
1846 pub const PF_LOCAL: ::c_int = AF_LOCAL;
1847 pub const PF_INET: ::c_int = AF_INET;
1848 pub const PF_AX25: ::c_int = AF_AX25;
1849 pub const PF_IPX: ::c_int = AF_IPX;
1850 pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
1851 pub const PF_NETROM: ::c_int = AF_NETROM;
1852 pub const PF_BRIDGE: ::c_int = AF_BRIDGE;
1853 pub const PF_ATMPVC: ::c_int = AF_ATMPVC;
1854 pub const PF_X25: ::c_int = AF_X25;
1855 pub const PF_INET6: ::c_int = AF_INET6;
1856 pub const PF_ROSE: ::c_int = AF_ROSE;
1857 pub const PF_DECnet: ::c_int = AF_DECnet;
1858 pub const PF_NETBEUI: ::c_int = AF_NETBEUI;
1859 pub const PF_SECURITY: ::c_int = AF_SECURITY;
1860 pub const PF_KEY: ::c_int = AF_KEY;
1861 pub const PF_NETLINK: ::c_int = AF_NETLINK;
1862 pub const PF_ROUTE: ::c_int = AF_ROUTE;
1863 pub const PF_PACKET: ::c_int = AF_PACKET;
1864 pub const PF_ASH: ::c_int = AF_ASH;
1865 pub const PF_ECONET: ::c_int = AF_ECONET;
1866 pub const PF_ATMSVC: ::c_int = AF_ATMSVC;
1867 pub const PF_RDS: ::c_int = AF_RDS;
1868 pub const PF_SNA: ::c_int = AF_SNA;
1869 pub const PF_IRDA: ::c_int = AF_IRDA;
1870 pub const PF_PPPOX: ::c_int = AF_PPPOX;
1871 pub const PF_WANPIPE: ::c_int = AF_WANPIPE;
1872 pub const PF_LLC: ::c_int = AF_LLC;
1873 pub const PF_CAN: ::c_int = AF_CAN;
1874 pub const PF_TIPC: ::c_int = AF_TIPC;
1875 pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
1876 pub const PF_IUCV: ::c_int = AF_IUCV;
1877 pub const PF_RXRPC: ::c_int = AF_RXRPC;
1878 pub const PF_ISDN: ::c_int = AF_ISDN;
1879 pub const PF_PHONET: ::c_int = AF_PHONET;
1880 pub const PF_IEEE802154: ::c_int = AF_IEEE802154;
1881 pub const PF_CAIF: ::c_int = AF_CAIF;
1882 pub const PF_ALG: ::c_int = AF_ALG;
1883 
1884 pub const SOMAXCONN: ::c_int = 128;
1885 
1886 pub const MSG_OOB: ::c_int = 1;
1887 pub const MSG_PEEK: ::c_int = 2;
1888 pub const MSG_DONTROUTE: ::c_int = 4;
1889 pub const MSG_CTRUNC: ::c_int = 8;
1890 pub const MSG_TRUNC: ::c_int = 0x20;
1891 pub const MSG_DONTWAIT: ::c_int = 0x40;
1892 pub const MSG_EOR: ::c_int = 0x80;
1893 pub const MSG_WAITALL: ::c_int = 0x100;
1894 pub const MSG_FIN: ::c_int = 0x200;
1895 pub const MSG_SYN: ::c_int = 0x400;
1896 pub const MSG_CONFIRM: ::c_int = 0x800;
1897 pub const MSG_RST: ::c_int = 0x1000;
1898 pub const MSG_ERRQUEUE: ::c_int = 0x2000;
1899 pub const MSG_NOSIGNAL: ::c_int = 0x4000;
1900 pub const MSG_MORE: ::c_int = 0x8000;
1901 pub const MSG_WAITFORONE: ::c_int = 0x10000;
1902 pub const MSG_FASTOPEN: ::c_int = 0x20000000;
1903 pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000;
1904 
1905 pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
1906 
1907 pub const SOCK_RAW: ::c_int = 3;
1908 pub const SOCK_RDM: ::c_int = 4;
1909 
1910 pub const IP_TOS: ::c_int = 1;
1911 pub const IP_TTL: ::c_int = 2;
1912 pub const IP_HDRINCL: ::c_int = 3;
1913 pub const IP_RECVTOS: ::c_int = 13;
1914 pub const IP_FREEBIND: ::c_int = 15;
1915 pub const IP_TRANSPARENT: ::c_int = 19;
1916 pub const IP_MULTICAST_IF: ::c_int = 32;
1917 pub const IP_MULTICAST_TTL: ::c_int = 33;
1918 pub const IP_MULTICAST_LOOP: ::c_int = 34;
1919 pub const IP_ADD_MEMBERSHIP: ::c_int = 35;
1920 pub const IP_DROP_MEMBERSHIP: ::c_int = 36;
1921 
1922 pub const IPV6_UNICAST_HOPS: ::c_int = 16;
1923 pub const IPV6_MULTICAST_IF: ::c_int = 17;
1924 pub const IPV6_MULTICAST_HOPS: ::c_int = 18;
1925 pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
1926 pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20;
1927 pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21;
1928 pub const IPV6_V6ONLY: ::c_int = 26;
1929 pub const IPV6_RECVPKTINFO: ::c_int = 49;
1930 pub const IPV6_RECVTCLASS: ::c_int = 66;
1931 pub const IPV6_TCLASS: ::c_int = 67;
1932 
1933 pub const TCP_NODELAY: ::c_int = 1;
1934 pub const TCP_MAXSEG: ::c_int = 2;
1935 pub const TCP_CORK: ::c_int = 3;
1936 pub const TCP_KEEPIDLE: ::c_int = 4;
1937 pub const TCP_KEEPINTVL: ::c_int = 5;
1938 pub const TCP_KEEPCNT: ::c_int = 6;
1939 pub const TCP_SYNCNT: ::c_int = 7;
1940 pub const TCP_LINGER2: ::c_int = 8;
1941 pub const TCP_DEFER_ACCEPT: ::c_int = 9;
1942 pub const TCP_WINDOW_CLAMP: ::c_int = 10;
1943 pub const TCP_INFO: ::c_int = 11;
1944 pub const TCP_QUICKACK: ::c_int = 12;
1945 pub const TCP_CONGESTION: ::c_int = 13;
1946 
1947 pub const SO_DEBUG: ::c_int = 1;
1948 
1949 pub const SHUT_RD: ::c_int = 0;
1950 pub const SHUT_WR: ::c_int = 1;
1951 pub const SHUT_RDWR: ::c_int = 2;
1952 
1953 pub const LOCK_SH: ::c_int = 1;
1954 pub const LOCK_EX: ::c_int = 2;
1955 pub const LOCK_NB: ::c_int = 4;
1956 pub const LOCK_UN: ::c_int = 8;
1957 
1958 pub const SS_ONSTACK: ::c_int = 1;
1959 pub const SS_DISABLE: ::c_int = 2;
1960 
1961 pub const PATH_MAX: ::c_int = 4096;
1962 
1963 pub const FD_SETSIZE: usize = 1024;
1964 
1965 pub const EPOLLIN: ::c_int = 0x1;
1966 pub const EPOLLPRI: ::c_int = 0x2;
1967 pub const EPOLLOUT: ::c_int = 0x4;
1968 pub const EPOLLRDNORM: ::c_int = 0x40;
1969 pub const EPOLLRDBAND: ::c_int = 0x80;
1970 pub const EPOLLWRNORM: ::c_int = 0x100;
1971 pub const EPOLLWRBAND: ::c_int = 0x200;
1972 pub const EPOLLMSG: ::c_int = 0x400;
1973 pub const EPOLLERR: ::c_int = 0x8;
1974 pub const EPOLLHUP: ::c_int = 0x10;
1975 pub const EPOLLET: ::c_int = 0x80000000;
1976 
1977 pub const EPOLL_CTL_ADD: ::c_int = 1;
1978 pub const EPOLL_CTL_MOD: ::c_int = 3;
1979 pub const EPOLL_CTL_DEL: ::c_int = 2;
1980 
1981 pub const MNT_DETACH: ::c_int = 0x2;
1982 pub const MNT_EXPIRE: ::c_int = 0x4;
1983 
1984 pub const Q_GETFMT: ::c_int = 0x800004;
1985 pub const Q_GETINFO: ::c_int = 0x800005;
1986 pub const Q_SETINFO: ::c_int = 0x800006;
1987 pub const QIF_BLIMITS: u32 = 1;
1988 pub const QIF_SPACE: u32 = 2;
1989 pub const QIF_ILIMITS: u32 = 4;
1990 pub const QIF_INODES: u32 = 8;
1991 pub const QIF_BTIME: u32 = 16;
1992 pub const QIF_ITIME: u32 = 32;
1993 pub const QIF_LIMITS: u32 = 5;
1994 pub const QIF_USAGE: u32 = 10;
1995 pub const QIF_TIMES: u32 = 48;
1996 pub const QIF_ALL: u32 = 63;
1997 
1998 pub const MNT_FORCE: ::c_int = 0x1;
1999 
2000 pub const Q_SYNC: ::c_int = 0x800001;
2001 pub const Q_QUOTAON: ::c_int = 0x800002;
2002 pub const Q_QUOTAOFF: ::c_int = 0x800003;
2003 pub const Q_GETQUOTA: ::c_int = 0x800007;
2004 pub const Q_SETQUOTA: ::c_int = 0x800008;
2005 
2006 pub const TCIOFF: ::c_int = 2;
2007 pub const TCION: ::c_int = 3;
2008 pub const TCOOFF: ::c_int = 0;
2009 pub const TCOON: ::c_int = 1;
2010 pub const TCIFLUSH: ::c_int = 0;
2011 pub const TCOFLUSH: ::c_int = 1;
2012 pub const TCIOFLUSH: ::c_int = 2;
2013 pub const NL0: ::c_int = 0x00000000;
2014 pub const NL1: ::c_int = 0x00000100;
2015 pub const TAB0: ::c_int = 0x00000000;
2016 pub const CR0: ::c_int = 0x00000000;
2017 pub const FF0: ::c_int = 0x00000000;
2018 pub const BS0: ::c_int = 0x00000000;
2019 pub const VT0: ::c_int = 0x00000000;
2020 pub const VERASE: usize = 2;
2021 pub const VKILL: usize = 3;
2022 pub const VINTR: usize = 0;
2023 pub const VQUIT: usize = 1;
2024 pub const VLNEXT: usize = 15;
2025 pub const IGNBRK: ::tcflag_t = 0x00000001;
2026 pub const BRKINT: ::tcflag_t = 0x00000002;
2027 pub const IGNPAR: ::tcflag_t = 0x00000004;
2028 pub const PARMRK: ::tcflag_t = 0x00000008;
2029 pub const INPCK: ::tcflag_t = 0x00000010;
2030 pub const ISTRIP: ::tcflag_t = 0x00000020;
2031 pub const INLCR: ::tcflag_t = 0x00000040;
2032 pub const IGNCR: ::tcflag_t = 0x00000080;
2033 pub const ICRNL: ::tcflag_t = 0x00000100;
2034 pub const IXANY: ::tcflag_t = 0x00000800;
2035 pub const IMAXBEL: ::tcflag_t = 0x00002000;
2036 pub const OPOST: ::tcflag_t = 0x1;
2037 pub const CS5: ::tcflag_t = 0x00000000;
2038 pub const CRTSCTS: ::tcflag_t = 0x80000000;
2039 pub const ECHO: ::tcflag_t = 0x00000008;
2040 pub const OCRNL: ::tcflag_t = 0o000010;
2041 pub const ONOCR: ::tcflag_t = 0o000020;
2042 pub const ONLRET: ::tcflag_t = 0o000040;
2043 pub const OFILL: ::tcflag_t = 0o000100;
2044 pub const OFDEL: ::tcflag_t = 0o000200;
2045 
2046 pub const CLONE_VM: ::c_int = 0x100;
2047 pub const CLONE_FS: ::c_int = 0x200;
2048 pub const CLONE_FILES: ::c_int = 0x400;
2049 pub const CLONE_SIGHAND: ::c_int = 0x800;
2050 pub const CLONE_PTRACE: ::c_int = 0x2000;
2051 pub const CLONE_VFORK: ::c_int = 0x4000;
2052 pub const CLONE_PARENT: ::c_int = 0x8000;
2053 pub const CLONE_THREAD: ::c_int = 0x10000;
2054 pub const CLONE_NEWNS: ::c_int = 0x20000;
2055 pub const CLONE_SYSVSEM: ::c_int = 0x40000;
2056 pub const CLONE_SETTLS: ::c_int = 0x80000;
2057 pub const CLONE_PARENT_SETTID: ::c_int = 0x100000;
2058 pub const CLONE_CHILD_CLEARTID: ::c_int = 0x200000;
2059 pub const CLONE_DETACHED: ::c_int = 0x400000;
2060 pub const CLONE_UNTRACED: ::c_int = 0x800000;
2061 pub const CLONE_CHILD_SETTID: ::c_int = 0x01000000;
2062 pub const CLONE_NEWUTS: ::c_int = 0x04000000;
2063 pub const CLONE_NEWIPC: ::c_int = 0x08000000;
2064 pub const CLONE_NEWUSER: ::c_int = 0x10000000;
2065 pub const CLONE_NEWPID: ::c_int = 0x20000000;
2066 pub const CLONE_NEWNET: ::c_int = 0x40000000;
2067 pub const CLONE_IO: ::c_int = 0x80000000;
2068 pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
2069 
2070 pub const WNOHANG: ::c_int = 0x00000001;
2071 pub const WUNTRACED: ::c_int = 0x00000002;
2072 pub const WSTOPPED: ::c_int = WUNTRACED;
2073 pub const WEXITED: ::c_int = 0x00000004;
2074 pub const WCONTINUED: ::c_int = 0x00000008;
2075 pub const WNOWAIT: ::c_int = 0x01000000;
2076 
2077 // ::Options set using PTRACE_SETOPTIONS.
2078 pub const PTRACE_O_TRACESYSGOOD: ::c_int = 0x00000001;
2079 pub const PTRACE_O_TRACEFORK: ::c_int = 0x00000002;
2080 pub const PTRACE_O_TRACEVFORK: ::c_int = 0x00000004;
2081 pub const PTRACE_O_TRACECLONE: ::c_int = 0x00000008;
2082 pub const PTRACE_O_TRACEEXEC: ::c_int = 0x00000010;
2083 pub const PTRACE_O_TRACEVFORKDONE: ::c_int = 0x00000020;
2084 pub const PTRACE_O_TRACEEXIT: ::c_int = 0x00000040;
2085 pub const PTRACE_O_TRACESECCOMP: ::c_int = 0x00000080;
2086 pub const PTRACE_O_EXITKILL: ::c_int = 0x00100000;
2087 pub const PTRACE_O_SUSPEND_SECCOMP: ::c_int = 0x00200000;
2088 pub const PTRACE_O_MASK: ::c_int = 0x003000ff;
2089 
2090 // Wait extended result codes for the above trace options.
2091 pub const PTRACE_EVENT_FORK: ::c_int = 1;
2092 pub const PTRACE_EVENT_VFORK: ::c_int = 2;
2093 pub const PTRACE_EVENT_CLONE: ::c_int = 3;
2094 pub const PTRACE_EVENT_EXEC: ::c_int = 4;
2095 pub const PTRACE_EVENT_VFORK_DONE: ::c_int = 5;
2096 pub const PTRACE_EVENT_EXIT: ::c_int = 6;
2097 pub const PTRACE_EVENT_SECCOMP: ::c_int = 7;
2098 // PTRACE_EVENT_STOP was added to glibc in 2.26
2099 // pub const PTRACE_EVENT_STOP: ::c_int = 128;
2100 
2101 pub const __WNOTHREAD: ::c_int = 0x20000000;
2102 pub const __WALL: ::c_int = 0x40000000;
2103 pub const __WCLONE: ::c_int = 0x80000000;
2104 
2105 pub const SPLICE_F_MOVE: ::c_uint = 0x01;
2106 pub const SPLICE_F_NONBLOCK: ::c_uint = 0x02;
2107 pub const SPLICE_F_MORE: ::c_uint = 0x04;
2108 pub const SPLICE_F_GIFT: ::c_uint = 0x08;
2109 
2110 pub const RTLD_LOCAL: ::c_int = 0;
2111 pub const RTLD_LAZY: ::c_int = 1;
2112 
2113 pub const POSIX_FADV_NORMAL: ::c_int = 0;
2114 pub const POSIX_FADV_RANDOM: ::c_int = 1;
2115 pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
2116 pub const POSIX_FADV_WILLNEED: ::c_int = 3;
2117 
2118 pub const AT_FDCWD: ::c_int = -100;
2119 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x100;
2120 pub const AT_REMOVEDIR: ::c_int = 0x200;
2121 pub const AT_EACCESS: ::c_int = 0x200;
2122 pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
2123 pub const AT_NO_AUTOMOUNT: ::c_int = 0x800;
2124 pub const AT_EMPTY_PATH: ::c_int = 0x1000;
2125 
2126 pub const LOG_CRON: ::c_int = 9 << 3;
2127 pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
2128 pub const LOG_FTP: ::c_int = 11 << 3;
2129 pub const LOG_PERROR: ::c_int = 0x20;
2130 
2131 pub const PIPE_BUF: usize = 4096;
2132 
2133 pub const SI_LOAD_SHIFT: ::c_uint = 16;
2134 
2135 pub const CLD_EXITED: ::c_int = 1;
2136 pub const CLD_KILLED: ::c_int = 2;
2137 pub const CLD_DUMPED: ::c_int = 3;
2138 pub const CLD_TRAPPED: ::c_int = 4;
2139 pub const CLD_STOPPED: ::c_int = 5;
2140 pub const CLD_CONTINUED: ::c_int = 6;
2141 
2142 pub const SIGEV_SIGNAL: ::c_int = 0;
2143 pub const SIGEV_NONE: ::c_int = 1;
2144 pub const SIGEV_THREAD: ::c_int = 2;
2145 
2146 pub const P_ALL: idtype_t = 0;
2147 pub const P_PID: idtype_t = 1;
2148 pub const P_PGID: idtype_t = 2;
2149 
2150 pub const UTIME_OMIT: c_long = 1073741822;
2151 pub const UTIME_NOW: c_long = 1073741823;
2152 
2153 pub const POLLIN: ::c_short = 0x1;
2154 pub const POLLPRI: ::c_short = 0x2;
2155 pub const POLLOUT: ::c_short = 0x4;
2156 pub const POLLERR: ::c_short = 0x8;
2157 pub const POLLHUP: ::c_short = 0x10;
2158 pub const POLLNVAL: ::c_short = 0x20;
2159 pub const POLLRDNORM: ::c_short = 0x040;
2160 pub const POLLRDBAND: ::c_short = 0x080;
2161 
2162 pub const ABDAY_1: ::nl_item = 0x20000;
2163 pub const ABDAY_2: ::nl_item = 0x20001;
2164 pub const ABDAY_3: ::nl_item = 0x20002;
2165 pub const ABDAY_4: ::nl_item = 0x20003;
2166 pub const ABDAY_5: ::nl_item = 0x20004;
2167 pub const ABDAY_6: ::nl_item = 0x20005;
2168 pub const ABDAY_7: ::nl_item = 0x20006;
2169 
2170 pub const DAY_1: ::nl_item = 0x20007;
2171 pub const DAY_2: ::nl_item = 0x20008;
2172 pub const DAY_3: ::nl_item = 0x20009;
2173 pub const DAY_4: ::nl_item = 0x2000A;
2174 pub const DAY_5: ::nl_item = 0x2000B;
2175 pub const DAY_6: ::nl_item = 0x2000C;
2176 pub const DAY_7: ::nl_item = 0x2000D;
2177 
2178 pub const ABMON_1: ::nl_item = 0x2000E;
2179 pub const ABMON_2: ::nl_item = 0x2000F;
2180 pub const ABMON_3: ::nl_item = 0x20010;
2181 pub const ABMON_4: ::nl_item = 0x20011;
2182 pub const ABMON_5: ::nl_item = 0x20012;
2183 pub const ABMON_6: ::nl_item = 0x20013;
2184 pub const ABMON_7: ::nl_item = 0x20014;
2185 pub const ABMON_8: ::nl_item = 0x20015;
2186 pub const ABMON_9: ::nl_item = 0x20016;
2187 pub const ABMON_10: ::nl_item = 0x20017;
2188 pub const ABMON_11: ::nl_item = 0x20018;
2189 pub const ABMON_12: ::nl_item = 0x20019;
2190 
2191 pub const MON_1: ::nl_item = 0x2001A;
2192 pub const MON_2: ::nl_item = 0x2001B;
2193 pub const MON_3: ::nl_item = 0x2001C;
2194 pub const MON_4: ::nl_item = 0x2001D;
2195 pub const MON_5: ::nl_item = 0x2001E;
2196 pub const MON_6: ::nl_item = 0x2001F;
2197 pub const MON_7: ::nl_item = 0x20020;
2198 pub const MON_8: ::nl_item = 0x20021;
2199 pub const MON_9: ::nl_item = 0x20022;
2200 pub const MON_10: ::nl_item = 0x20023;
2201 pub const MON_11: ::nl_item = 0x20024;
2202 pub const MON_12: ::nl_item = 0x20025;
2203 
2204 pub const AM_STR: ::nl_item = 0x20026;
2205 pub const PM_STR: ::nl_item = 0x20027;
2206 
2207 pub const D_T_FMT: ::nl_item = 0x20028;
2208 pub const D_FMT: ::nl_item = 0x20029;
2209 pub const T_FMT: ::nl_item = 0x2002A;
2210 pub const T_FMT_AMPM: ::nl_item = 0x2002B;
2211 
2212 pub const ERA: ::nl_item = 0x2002C;
2213 pub const ERA_D_FMT: ::nl_item = 0x2002E;
2214 pub const ALT_DIGITS: ::nl_item = 0x2002F;
2215 pub const ERA_D_T_FMT: ::nl_item = 0x20030;
2216 pub const ERA_T_FMT: ::nl_item = 0x20031;
2217 
2218 pub const CODESET: ::nl_item = 14;
2219 
2220 pub const CRNCYSTR: ::nl_item = 0x4000F;
2221 
2222 pub const RUSAGE_THREAD: ::c_int = 1;
2223 pub const RUSAGE_CHILDREN: ::c_int = -1;
2224 
2225 pub const RADIXCHAR: ::nl_item = 0x10000;
2226 pub const THOUSEP: ::nl_item = 0x10001;
2227 
2228 pub const YESEXPR: ::nl_item = 0x50000;
2229 pub const NOEXPR: ::nl_item = 0x50001;
2230 pub const YESSTR: ::nl_item = 0x50002;
2231 pub const NOSTR: ::nl_item = 0x50003;
2232 
2233 pub const FILENAME_MAX: ::c_uint = 4096;
2234 pub const L_tmpnam: ::c_uint = 20;
2235 pub const _PC_LINK_MAX: ::c_int = 0;
2236 pub const _PC_MAX_CANON: ::c_int = 1;
2237 pub const _PC_MAX_INPUT: ::c_int = 2;
2238 pub const _PC_NAME_MAX: ::c_int = 3;
2239 pub const _PC_PATH_MAX: ::c_int = 4;
2240 pub const _PC_PIPE_BUF: ::c_int = 5;
2241 pub const _PC_CHOWN_RESTRICTED: ::c_int = 6;
2242 pub const _PC_NO_TRUNC: ::c_int = 7;
2243 pub const _PC_VDISABLE: ::c_int = 8;
2244 pub const _PC_SYNC_IO: ::c_int = 9;
2245 pub const _PC_ASYNC_IO: ::c_int = 10;
2246 pub const _PC_PRIO_IO: ::c_int = 11;
2247 pub const _PC_SOCK_MAXBUF: ::c_int = 12;
2248 pub const _PC_FILESIZEBITS: ::c_int = 13;
2249 pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14;
2250 pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15;
2251 pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16;
2252 pub const _PC_REC_XFER_ALIGN: ::c_int = 17;
2253 pub const _PC_ALLOC_SIZE_MIN: ::c_int = 18;
2254 pub const _PC_SYMLINK_MAX: ::c_int = 19;
2255 pub const _PC_2_SYMLINKS: ::c_int = 20;
2256 
2257 pub const _SC_ARG_MAX: ::c_int = 0;
2258 pub const _SC_CHILD_MAX: ::c_int = 1;
2259 pub const _SC_CLK_TCK: ::c_int = 2;
2260 pub const _SC_NGROUPS_MAX: ::c_int = 3;
2261 pub const _SC_OPEN_MAX: ::c_int = 4;
2262 pub const _SC_STREAM_MAX: ::c_int = 5;
2263 pub const _SC_TZNAME_MAX: ::c_int = 6;
2264 pub const _SC_JOB_CONTROL: ::c_int = 7;
2265 pub const _SC_SAVED_IDS: ::c_int = 8;
2266 pub const _SC_REALTIME_SIGNALS: ::c_int = 9;
2267 pub const _SC_PRIORITY_SCHEDULING: ::c_int = 10;
2268 pub const _SC_TIMERS: ::c_int = 11;
2269 pub const _SC_ASYNCHRONOUS_IO: ::c_int = 12;
2270 pub const _SC_PRIORITIZED_IO: ::c_int = 13;
2271 pub const _SC_SYNCHRONIZED_IO: ::c_int = 14;
2272 pub const _SC_FSYNC: ::c_int = 15;
2273 pub const _SC_MAPPED_FILES: ::c_int = 16;
2274 pub const _SC_MEMLOCK: ::c_int = 17;
2275 pub const _SC_MEMLOCK_RANGE: ::c_int = 18;
2276 pub const _SC_MEMORY_PROTECTION: ::c_int = 19;
2277 pub const _SC_MESSAGE_PASSING: ::c_int = 20;
2278 pub const _SC_SEMAPHORES: ::c_int = 21;
2279 pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 22;
2280 pub const _SC_AIO_LISTIO_MAX: ::c_int = 23;
2281 pub const _SC_AIO_MAX: ::c_int = 24;
2282 pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 25;
2283 pub const _SC_DELAYTIMER_MAX: ::c_int = 26;
2284 pub const _SC_MQ_OPEN_MAX: ::c_int = 27;
2285 pub const _SC_MQ_PRIO_MAX: ::c_int = 28;
2286 pub const _SC_VERSION: ::c_int = 29;
2287 pub const _SC_PAGESIZE: ::c_int = 30;
2288 pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
2289 pub const _SC_RTSIG_MAX: ::c_int = 31;
2290 pub const _SC_SEM_NSEMS_MAX: ::c_int = 32;
2291 pub const _SC_SEM_VALUE_MAX: ::c_int = 33;
2292 pub const _SC_SIGQUEUE_MAX: ::c_int = 34;
2293 pub const _SC_TIMER_MAX: ::c_int = 35;
2294 pub const _SC_BC_BASE_MAX: ::c_int = 36;
2295 pub const _SC_BC_DIM_MAX: ::c_int = 37;
2296 pub const _SC_BC_SCALE_MAX: ::c_int = 38;
2297 pub const _SC_BC_STRING_MAX: ::c_int = 39;
2298 pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 40;
2299 pub const _SC_EXPR_NEST_MAX: ::c_int = 42;
2300 pub const _SC_LINE_MAX: ::c_int = 43;
2301 pub const _SC_RE_DUP_MAX: ::c_int = 44;
2302 pub const _SC_2_VERSION: ::c_int = 46;
2303 pub const _SC_2_C_BIND: ::c_int = 47;
2304 pub const _SC_2_C_DEV: ::c_int = 48;
2305 pub const _SC_2_FORT_DEV: ::c_int = 49;
2306 pub const _SC_2_FORT_RUN: ::c_int = 50;
2307 pub const _SC_2_SW_DEV: ::c_int = 51;
2308 pub const _SC_2_LOCALEDEF: ::c_int = 52;
2309 pub const _SC_UIO_MAXIOV: ::c_int = 60;
2310 pub const _SC_IOV_MAX: ::c_int = 60;
2311 pub const _SC_THREADS: ::c_int = 67;
2312 pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 68;
2313 pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 69;
2314 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 70;
2315 pub const _SC_LOGIN_NAME_MAX: ::c_int = 71;
2316 pub const _SC_TTY_NAME_MAX: ::c_int = 72;
2317 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 73;
2318 pub const _SC_THREAD_KEYS_MAX: ::c_int = 74;
2319 pub const _SC_THREAD_STACK_MIN: ::c_int = 75;
2320 pub const _SC_THREAD_THREADS_MAX: ::c_int = 76;
2321 pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77;
2322 pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78;
2323 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79;
2324 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80;
2325 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81;
2326 pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 82;
2327 pub const _SC_NPROCESSORS_CONF: ::c_int = 83;
2328 pub const _SC_NPROCESSORS_ONLN: ::c_int = 84;
2329 pub const _SC_PHYS_PAGES: ::c_int = 85;
2330 pub const _SC_AVPHYS_PAGES: ::c_int = 86;
2331 pub const _SC_ATEXIT_MAX: ::c_int = 87;
2332 pub const _SC_PASS_MAX: ::c_int = 88;
2333 pub const _SC_XOPEN_VERSION: ::c_int = 89;
2334 pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90;
2335 pub const _SC_XOPEN_UNIX: ::c_int = 91;
2336 pub const _SC_XOPEN_CRYPT: ::c_int = 92;
2337 pub const _SC_XOPEN_ENH_I18N: ::c_int = 93;
2338 pub const _SC_XOPEN_SHM: ::c_int = 94;
2339 pub const _SC_2_CHAR_TERM: ::c_int = 95;
2340 pub const _SC_2_UPE: ::c_int = 97;
2341 pub const _SC_XOPEN_XPG2: ::c_int = 98;
2342 pub const _SC_XOPEN_XPG3: ::c_int = 99;
2343 pub const _SC_XOPEN_XPG4: ::c_int = 100;
2344 pub const _SC_NZERO: ::c_int = 109;
2345 pub const _SC_XBS5_ILP32_OFF32: ::c_int = 125;
2346 pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126;
2347 pub const _SC_XBS5_LP64_OFF64: ::c_int = 127;
2348 pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 128;
2349 pub const _SC_XOPEN_LEGACY: ::c_int = 129;
2350 pub const _SC_XOPEN_REALTIME: ::c_int = 130;
2351 pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 131;
2352 pub const _SC_ADVISORY_INFO: ::c_int = 132;
2353 pub const _SC_BARRIERS: ::c_int = 133;
2354 pub const _SC_CLOCK_SELECTION: ::c_int = 137;
2355 pub const _SC_CPUTIME: ::c_int = 138;
2356 pub const _SC_THREAD_CPUTIME: ::c_int = 139;
2357 pub const _SC_MONOTONIC_CLOCK: ::c_int = 149;
2358 pub const _SC_READER_WRITER_LOCKS: ::c_int = 153;
2359 pub const _SC_SPIN_LOCKS: ::c_int = 154;
2360 pub const _SC_REGEXP: ::c_int = 155;
2361 pub const _SC_SHELL: ::c_int = 157;
2362 pub const _SC_SPAWN: ::c_int = 159;
2363 pub const _SC_SPORADIC_SERVER: ::c_int = 160;
2364 pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 161;
2365 pub const _SC_TIMEOUTS: ::c_int = 164;
2366 pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 165;
2367 pub const _SC_2_PBS: ::c_int = 168;
2368 pub const _SC_2_PBS_ACCOUNTING: ::c_int = 169;
2369 pub const _SC_2_PBS_LOCATE: ::c_int = 170;
2370 pub const _SC_2_PBS_MESSAGE: ::c_int = 171;
2371 pub const _SC_2_PBS_TRACK: ::c_int = 172;
2372 pub const _SC_SYMLOOP_MAX: ::c_int = 173;
2373 pub const _SC_STREAMS: ::c_int = 174;
2374 pub const _SC_2_PBS_CHECKPOINT: ::c_int = 175;
2375 pub const _SC_V6_ILP32_OFF32: ::c_int = 176;
2376 pub const _SC_V6_ILP32_OFFBIG: ::c_int = 177;
2377 pub const _SC_V6_LP64_OFF64: ::c_int = 178;
2378 pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 179;
2379 pub const _SC_HOST_NAME_MAX: ::c_int = 180;
2380 pub const _SC_TRACE: ::c_int = 181;
2381 pub const _SC_TRACE_EVENT_FILTER: ::c_int = 182;
2382 pub const _SC_TRACE_INHERIT: ::c_int = 183;
2383 pub const _SC_TRACE_LOG: ::c_int = 184;
2384 pub const _SC_IPV6: ::c_int = 235;
2385 pub const _SC_RAW_SOCKETS: ::c_int = 236;
2386 pub const _SC_V7_ILP32_OFF32: ::c_int = 237;
2387 pub const _SC_V7_ILP32_OFFBIG: ::c_int = 238;
2388 pub const _SC_V7_LP64_OFF64: ::c_int = 239;
2389 pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 240;
2390 pub const _SC_SS_REPL_MAX: ::c_int = 241;
2391 pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 242;
2392 pub const _SC_TRACE_NAME_MAX: ::c_int = 243;
2393 pub const _SC_TRACE_SYS_MAX: ::c_int = 244;
2394 pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 245;
2395 pub const _SC_XOPEN_STREAMS: ::c_int = 246;
2396 pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 247;
2397 pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 248;
2398 
2399 pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY;
2400 pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY;
2401 
2402 pub const GLOB_ERR: ::c_int = 1 << 0;
2403 pub const GLOB_MARK: ::c_int = 1 << 1;
2404 pub const GLOB_NOSORT: ::c_int = 1 << 2;
2405 pub const GLOB_DOOFFS: ::c_int = 1 << 3;
2406 pub const GLOB_NOCHECK: ::c_int = 1 << 4;
2407 pub const GLOB_APPEND: ::c_int = 1 << 5;
2408 pub const GLOB_NOESCAPE: ::c_int = 1 << 6;
2409 
2410 pub const GLOB_NOSPACE: ::c_int = 1;
2411 pub const GLOB_ABORTED: ::c_int = 2;
2412 pub const GLOB_NOMATCH: ::c_int = 3;
2413 
2414 pub const POSIX_MADV_NORMAL: ::c_int = 0;
2415 pub const POSIX_MADV_RANDOM: ::c_int = 1;
2416 pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
2417 pub const POSIX_MADV_WILLNEED: ::c_int = 3;
2418 
2419 pub const S_IEXEC: mode_t = 0o0100;
2420 pub const S_IWRITE: mode_t = 0o0200;
2421 pub const S_IREAD: mode_t = 0o0400;
2422 
2423 pub const F_LOCK: ::c_int = 1;
2424 pub const F_TEST: ::c_int = 3;
2425 pub const F_TLOCK: ::c_int = 2;
2426 pub const F_ULOCK: ::c_int = 0;
2427 
2428 pub const IFF_LOWER_UP: ::c_int = 0x10000;
2429 pub const IFF_DORMANT: ::c_int = 0x20000;
2430 pub const IFF_ECHO: ::c_int = 0x40000;
2431 
2432 pub const ST_RDONLY: ::c_ulong = 1;
2433 pub const ST_NOSUID: ::c_ulong = 2;
2434 pub const ST_NODEV: ::c_ulong = 4;
2435 pub const ST_NOEXEC: ::c_ulong = 8;
2436 pub const ST_SYNCHRONOUS: ::c_ulong = 16;
2437 pub const ST_MANDLOCK: ::c_ulong = 64;
2438 pub const ST_WRITE: ::c_ulong = 128;
2439 pub const ST_APPEND: ::c_ulong = 256;
2440 pub const ST_IMMUTABLE: ::c_ulong = 512;
2441 pub const ST_NOATIME: ::c_ulong = 1024;
2442 pub const ST_NODIRATIME: ::c_ulong = 2048;
2443 
2444 pub const RTLD_NEXT: *mut ::c_void = -1i64 as *mut ::c_void;
2445 pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
2446 pub const RTLD_NODELETE: ::c_int = 0x1000;
2447 pub const RTLD_NOW: ::c_int = 0x2;
2448 
2449 pub const TCP_MD5SIG: ::c_int = 14;
2450 
2451 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
2452     size: [0; __SIZEOF_PTHREAD_MUTEX_T],
2453 };
2454 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
2455     size: [0; __SIZEOF_PTHREAD_COND_T],
2456 };
2457 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
2458     size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
2459 };
2460 pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
2461 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
2462 pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
2463 pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
2464 pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
2465 pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
2466 pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
2467 
2468 pub const RENAME_NOREPLACE: ::c_int = 1;
2469 pub const RENAME_EXCHANGE: ::c_int = 2;
2470 pub const RENAME_WHITEOUT: ::c_int = 4;
2471 
2472 pub const SCHED_OTHER: ::c_int = 0;
2473 pub const SCHED_FIFO: ::c_int = 1;
2474 pub const SCHED_RR: ::c_int = 2;
2475 pub const SCHED_BATCH: ::c_int = 3;
2476 pub const SCHED_IDLE: ::c_int = 5;
2477 
2478 // netinet/in.h
2479 // NOTE: These are in addition to the constants defined in src/unix/mod.rs
2480 
2481 // IPPROTO_IP defined in src/unix/mod.rs
2482 /// Hop-by-hop option header
2483 pub const IPPROTO_HOPOPTS: ::c_int = 0;
2484 // IPPROTO_ICMP defined in src/unix/mod.rs
2485 /// group mgmt protocol
2486 pub const IPPROTO_IGMP: ::c_int = 2;
2487 /// for compatibility
2488 pub const IPPROTO_IPIP: ::c_int = 4;
2489 // IPPROTO_TCP defined in src/unix/mod.rs
2490 /// exterior gateway protocol
2491 pub const IPPROTO_EGP: ::c_int = 8;
2492 /// pup
2493 pub const IPPROTO_PUP: ::c_int = 12;
2494 // IPPROTO_UDP defined in src/unix/mod.rs
2495 /// xns idp
2496 pub const IPPROTO_IDP: ::c_int = 22;
2497 /// tp-4 w/ class negotiation
2498 pub const IPPROTO_TP: ::c_int = 29;
2499 /// DCCP
2500 pub const IPPROTO_DCCP: ::c_int = 33;
2501 // IPPROTO_IPV6 defined in src/unix/mod.rs
2502 /// IP6 routing header
2503 pub const IPPROTO_ROUTING: ::c_int = 43;
2504 /// IP6 fragmentation header
2505 pub const IPPROTO_FRAGMENT: ::c_int = 44;
2506 /// resource reservation
2507 pub const IPPROTO_RSVP: ::c_int = 46;
2508 /// General Routing Encap.
2509 pub const IPPROTO_GRE: ::c_int = 47;
2510 /// IP6 Encap Sec. Payload
2511 pub const IPPROTO_ESP: ::c_int = 50;
2512 /// IP6 Auth Header
2513 pub const IPPROTO_AH: ::c_int = 51;
2514 // IPPROTO_ICMPV6 defined in src/unix/mod.rs
2515 /// IP6 no next header
2516 pub const IPPROTO_NONE: ::c_int = 59;
2517 /// IP6 destination option
2518 pub const IPPROTO_DSTOPTS: ::c_int = 60;
2519 pub const IPPROTO_MTP: ::c_int = 92;
2520 pub const IPPROTO_BEETPH: ::c_int = 94;
2521 /// encapsulation header
2522 pub const IPPROTO_ENCAP: ::c_int = 98;
2523 /// Protocol indep. multicast
2524 pub const IPPROTO_PIM: ::c_int = 103;
2525 /// IP Payload Comp. Protocol
2526 pub const IPPROTO_COMP: ::c_int = 108;
2527 /// SCTP
2528 pub const IPPROTO_SCTP: ::c_int = 132;
2529 pub const IPPROTO_MH: ::c_int = 135;
2530 pub const IPPROTO_UDPLITE: ::c_int = 136;
2531 pub const IPPROTO_MPLS: ::c_int = 137;
2532 /// raw IP packet
2533 pub const IPPROTO_RAW: ::c_int = 255;
2534 pub const IPPROTO_MAX: ::c_int = 256;
2535 
2536 pub const AF_IB: ::c_int = 27;
2537 pub const AF_MPLS: ::c_int = 28;
2538 pub const AF_NFC: ::c_int = 39;
2539 pub const AF_VSOCK: ::c_int = 40;
2540 pub const PF_IB: ::c_int = AF_IB;
2541 pub const PF_MPLS: ::c_int = AF_MPLS;
2542 pub const PF_NFC: ::c_int = AF_NFC;
2543 pub const PF_VSOCK: ::c_int = AF_VSOCK;
2544 
2545 // System V IPC
2546 pub const IPC_PRIVATE: ::key_t = 0;
2547 
2548 pub const IPC_CREAT: ::c_int = 0o1000;
2549 pub const IPC_EXCL: ::c_int = 0o2000;
2550 pub const IPC_NOWAIT: ::c_int = 0o4000;
2551 
2552 pub const IPC_RMID: ::c_int = 0;
2553 pub const IPC_SET: ::c_int = 1;
2554 pub const IPC_STAT: ::c_int = 2;
2555 pub const IPC_INFO: ::c_int = 3;
2556 pub const MSG_STAT: ::c_int = 11;
2557 pub const MSG_INFO: ::c_int = 12;
2558 
2559 pub const MSG_NOERROR: ::c_int = 0o10000;
2560 pub const MSG_EXCEPT: ::c_int = 0o20000;
2561 pub const MSG_COPY: ::c_int = 0o40000;
2562 
2563 pub const SHM_R: ::c_int = 0o400;
2564 pub const SHM_W: ::c_int = 0o200;
2565 
2566 pub const SHM_RDONLY: ::c_int = 0o10000;
2567 pub const SHM_RND: ::c_int = 0o20000;
2568 pub const SHM_REMAP: ::c_int = 0o40000;
2569 pub const SHM_EXEC: ::c_int = 0o100000;
2570 
2571 pub const SHM_LOCK: ::c_int = 11;
2572 pub const SHM_UNLOCK: ::c_int = 12;
2573 
2574 pub const SHM_HUGETLB: ::c_int = 0o4000;
2575 pub const SHM_NORESERVE: ::c_int = 0o10000;
2576 
2577 pub const EPOLLRDHUP: ::c_int = 0x2000;
2578 pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
2579 pub const EPOLLONESHOT: ::c_int = 0x40000000;
2580 
2581 pub const QFMT_VFS_OLD: ::c_int = 1;
2582 pub const QFMT_VFS_V0: ::c_int = 2;
2583 pub const QFMT_VFS_V1: ::c_int = 4;
2584 
2585 pub const EFD_SEMAPHORE: ::c_int = 0x1;
2586 
2587 pub const LOG_NFACILITIES: ::c_int = 24;
2588 
2589 pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t;
2590 
2591 pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32;
2592 pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32;
2593 pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32;
2594 pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32;
2595 pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32;
2596 pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2u32 as i32;
2597 pub const RB_KEXEC: ::c_int = 0x45584543u32 as i32;
2598 
2599 pub const AI_PASSIVE: ::c_int = 0x0001;
2600 pub const AI_CANONNAME: ::c_int = 0x0002;
2601 pub const AI_NUMERICHOST: ::c_int = 0x0004;
2602 pub const AI_V4MAPPED: ::c_int = 0x0008;
2603 pub const AI_ALL: ::c_int = 0x0010;
2604 pub const AI_ADDRCONFIG: ::c_int = 0x0020;
2605 
2606 pub const AI_NUMERICSERV: ::c_int = 0x0400;
2607 
2608 pub const EAI_BADFLAGS: ::c_int = -1;
2609 pub const EAI_NONAME: ::c_int = -2;
2610 pub const EAI_AGAIN: ::c_int = -3;
2611 pub const EAI_FAIL: ::c_int = -4;
2612 pub const EAI_FAMILY: ::c_int = -6;
2613 pub const EAI_SOCKTYPE: ::c_int = -7;
2614 pub const EAI_SERVICE: ::c_int = -8;
2615 pub const EAI_MEMORY: ::c_int = -10;
2616 pub const EAI_OVERFLOW: ::c_int = -12;
2617 
2618 pub const NI_NUMERICHOST: ::c_int = 1;
2619 pub const NI_NUMERICSERV: ::c_int = 2;
2620 pub const NI_NOFQDN: ::c_int = 4;
2621 pub const NI_NAMEREQD: ::c_int = 8;
2622 pub const NI_DGRAM: ::c_int = 16;
2623 
2624 pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1;
2625 pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2;
2626 pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4;
2627 
2628 pub const EAI_SYSTEM: ::c_int = -11;
2629 
2630 pub const AIO_CANCELED: ::c_int = 0;
2631 pub const AIO_NOTCANCELED: ::c_int = 1;
2632 pub const AIO_ALLDONE: ::c_int = 2;
2633 pub const LIO_READ: ::c_int = 0;
2634 pub const LIO_WRITE: ::c_int = 1;
2635 pub const LIO_NOP: ::c_int = 2;
2636 pub const LIO_WAIT: ::c_int = 0;
2637 pub const LIO_NOWAIT: ::c_int = 1;
2638 
2639 pub const MREMAP_MAYMOVE: ::c_int = 1;
2640 pub const MREMAP_FIXED: ::c_int = 2;
2641 
2642 pub const PR_SET_PDEATHSIG: ::c_int = 1;
2643 pub const PR_GET_PDEATHSIG: ::c_int = 2;
2644 
2645 pub const PR_GET_DUMPABLE: ::c_int = 3;
2646 pub const PR_SET_DUMPABLE: ::c_int = 4;
2647 
2648 pub const PR_GET_UNALIGN: ::c_int = 5;
2649 pub const PR_SET_UNALIGN: ::c_int = 6;
2650 pub const PR_UNALIGN_NOPRINT: ::c_int = 1;
2651 pub const PR_UNALIGN_SIGBUS: ::c_int = 2;
2652 
2653 pub const PR_GET_KEEPCAPS: ::c_int = 7;
2654 pub const PR_SET_KEEPCAPS: ::c_int = 8;
2655 
2656 pub const PR_GET_FPEMU: ::c_int = 9;
2657 pub const PR_SET_FPEMU: ::c_int = 10;
2658 pub const PR_FPEMU_NOPRINT: ::c_int = 1;
2659 pub const PR_FPEMU_SIGFPE: ::c_int = 2;
2660 
2661 pub const PR_GET_FPEXC: ::c_int = 11;
2662 pub const PR_SET_FPEXC: ::c_int = 12;
2663 pub const PR_FP_EXC_SW_ENABLE: ::c_int = 0x80;
2664 pub const PR_FP_EXC_DIV: ::c_int = 0x010000;
2665 pub const PR_FP_EXC_OVF: ::c_int = 0x020000;
2666 pub const PR_FP_EXC_UND: ::c_int = 0x040000;
2667 pub const PR_FP_EXC_RES: ::c_int = 0x080000;
2668 pub const PR_FP_EXC_INV: ::c_int = 0x100000;
2669 pub const PR_FP_EXC_DISABLED: ::c_int = 0;
2670 pub const PR_FP_EXC_NONRECOV: ::c_int = 1;
2671 pub const PR_FP_EXC_ASYNC: ::c_int = 2;
2672 pub const PR_FP_EXC_PRECISE: ::c_int = 3;
2673 
2674 pub const PR_GET_TIMING: ::c_int = 13;
2675 pub const PR_SET_TIMING: ::c_int = 14;
2676 pub const PR_TIMING_STATISTICAL: ::c_int = 0;
2677 pub const PR_TIMING_TIMESTAMP: ::c_int = 1;
2678 
2679 pub const PR_SET_NAME: ::c_int = 15;
2680 pub const PR_GET_NAME: ::c_int = 16;
2681 
2682 pub const PR_GET_ENDIAN: ::c_int = 19;
2683 pub const PR_SET_ENDIAN: ::c_int = 20;
2684 pub const PR_ENDIAN_BIG: ::c_int = 0;
2685 pub const PR_ENDIAN_LITTLE: ::c_int = 1;
2686 pub const PR_ENDIAN_PPC_LITTLE: ::c_int = 2;
2687 
2688 pub const PR_GET_SECCOMP: ::c_int = 21;
2689 pub const PR_SET_SECCOMP: ::c_int = 22;
2690 
2691 pub const PR_CAPBSET_READ: ::c_int = 23;
2692 pub const PR_CAPBSET_DROP: ::c_int = 24;
2693 
2694 pub const PR_GET_TSC: ::c_int = 25;
2695 pub const PR_SET_TSC: ::c_int = 26;
2696 pub const PR_TSC_ENABLE: ::c_int = 1;
2697 pub const PR_TSC_SIGSEGV: ::c_int = 2;
2698 
2699 pub const PR_GET_SECUREBITS: ::c_int = 27;
2700 pub const PR_SET_SECUREBITS: ::c_int = 28;
2701 
2702 pub const PR_SET_TIMERSLACK: ::c_int = 29;
2703 pub const PR_GET_TIMERSLACK: ::c_int = 30;
2704 
2705 pub const PR_TASK_PERF_EVENTS_DISABLE: ::c_int = 31;
2706 pub const PR_TASK_PERF_EVENTS_ENABLE: ::c_int = 32;
2707 
2708 pub const PR_MCE_KILL: ::c_int = 33;
2709 pub const PR_MCE_KILL_CLEAR: ::c_int = 0;
2710 pub const PR_MCE_KILL_SET: ::c_int = 1;
2711 
2712 pub const PR_MCE_KILL_LATE: ::c_int = 0;
2713 pub const PR_MCE_KILL_EARLY: ::c_int = 1;
2714 pub const PR_MCE_KILL_DEFAULT: ::c_int = 2;
2715 
2716 pub const PR_MCE_KILL_GET: ::c_int = 34;
2717 
2718 pub const PR_SET_MM: ::c_int = 35;
2719 pub const PR_SET_MM_START_CODE: ::c_int = 1;
2720 pub const PR_SET_MM_END_CODE: ::c_int = 2;
2721 pub const PR_SET_MM_START_DATA: ::c_int = 3;
2722 pub const PR_SET_MM_END_DATA: ::c_int = 4;
2723 pub const PR_SET_MM_START_STACK: ::c_int = 5;
2724 pub const PR_SET_MM_START_BRK: ::c_int = 6;
2725 pub const PR_SET_MM_BRK: ::c_int = 7;
2726 pub const PR_SET_MM_ARG_START: ::c_int = 8;
2727 pub const PR_SET_MM_ARG_END: ::c_int = 9;
2728 pub const PR_SET_MM_ENV_START: ::c_int = 10;
2729 pub const PR_SET_MM_ENV_END: ::c_int = 11;
2730 pub const PR_SET_MM_AUXV: ::c_int = 12;
2731 pub const PR_SET_MM_EXE_FILE: ::c_int = 13;
2732 pub const PR_SET_MM_MAP: ::c_int = 14;
2733 pub const PR_SET_MM_MAP_SIZE: ::c_int = 15;
2734 
2735 pub const PR_SET_PTRACER: ::c_int = 0x59616d61;
2736 pub const PR_SET_PTRACER_ANY: ::c_ulong = 0xffffffffffffffff;
2737 
2738 pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36;
2739 pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37;
2740 
2741 pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38;
2742 pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39;
2743 
2744 pub const PR_GET_TID_ADDRESS: ::c_int = 40;
2745 
2746 pub const PR_SET_THP_DISABLE: ::c_int = 41;
2747 pub const PR_GET_THP_DISABLE: ::c_int = 42;
2748 
2749 pub const PR_MPX_ENABLE_MANAGEMENT: ::c_int = 43;
2750 pub const PR_MPX_DISABLE_MANAGEMENT: ::c_int = 44;
2751 
2752 pub const PR_SET_FP_MODE: ::c_int = 45;
2753 pub const PR_GET_FP_MODE: ::c_int = 46;
2754 pub const PR_FP_MODE_FR: ::c_int = 1 << 0;
2755 pub const PR_FP_MODE_FRE: ::c_int = 1 << 1;
2756 
2757 pub const PR_CAP_AMBIENT: ::c_int = 47;
2758 pub const PR_CAP_AMBIENT_IS_SET: ::c_int = 1;
2759 pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2;
2760 pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3;
2761 pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4;
2762 
2763 pub const ITIMER_REAL: ::c_int = 0;
2764 pub const ITIMER_VIRTUAL: ::c_int = 1;
2765 pub const ITIMER_PROF: ::c_int = 2;
2766 
2767 pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC;
2768 pub const TFD_NONBLOCK: ::c_int = O_NONBLOCK;
2769 pub const TFD_TIMER_ABSTIME: ::c_int = 1;
2770 
2771 pub const XATTR_CREATE: ::c_int = 0x1;
2772 pub const XATTR_REPLACE: ::c_int = 0x2;
2773 
2774 pub const _POSIX_VDISABLE: ::cc_t = 0;
2775 
2776 pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
2777 pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
2778 pub const FALLOC_FL_COLLAPSE_RANGE: ::c_int = 0x08;
2779 pub const FALLOC_FL_ZERO_RANGE: ::c_int = 0x10;
2780 pub const FALLOC_FL_INSERT_RANGE: ::c_int = 0x20;
2781 pub const FALLOC_FL_UNSHARE_RANGE: ::c_int = 0x40;
2782 
2783 // On Linux, libc doesn't define this constant, libattr does instead.
2784 // We still define it for Linux as it's defined by libc on other platforms,
2785 // and it's mentioned in the man pages for getxattr and setxattr.
2786 pub const ENOATTR: ::c_int = ::ENODATA;
2787 
2788 pub const SO_ORIGINAL_DST: ::c_int = 80;
2789 pub const IUTF8: ::tcflag_t = 0x00004000;
2790 pub const CMSPAR: ::tcflag_t = 0o10000000000;
2791 
2792 pub const MFD_CLOEXEC: ::c_uint = 0x0001;
2793 pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
2794 
2795 // these are used in the p_type field of Elf32_Phdr and Elf64_Phdr, which has
2796 // the type Elf32Word and Elf64Word respectively. Luckily, both of those are u32
2797 // so we can use that type here to avoid having to cast.
2798 pub const PT_NULL: u32 = 0;
2799 pub const PT_LOAD: u32 = 1;
2800 pub const PT_DYNAMIC: u32 = 2;
2801 pub const PT_INTERP: u32 = 3;
2802 pub const PT_NOTE: u32 = 4;
2803 pub const PT_SHLIB: u32 = 5;
2804 pub const PT_PHDR: u32 = 6;
2805 pub const PT_TLS: u32 = 7;
2806 pub const PT_NUM: u32 = 8;
2807 pub const PT_LOOS: u32 = 0x60000000;
2808 pub const PT_GNU_EH_FRAME: u32 = 0x6474e550;
2809 pub const PT_GNU_STACK: u32 = 0x6474e551;
2810 pub const PT_GNU_RELRO: u32 = 0x6474e552;
2811 
2812 // Ethernet protocol IDs.
2813 pub const ETH_P_LOOP: ::c_int = 0x0060;
2814 pub const ETH_P_PUP: ::c_int = 0x0200;
2815 pub const ETH_P_PUPAT: ::c_int = 0x0201;
2816 pub const ETH_P_IP: ::c_int = 0x0800;
2817 pub const ETH_P_X25: ::c_int = 0x0805;
2818 pub const ETH_P_ARP: ::c_int = 0x0806;
2819 pub const ETH_P_BPQ: ::c_int = 0x08FF;
2820 pub const ETH_P_IEEEPUP: ::c_int = 0x0a00;
2821 pub const ETH_P_IEEEPUPAT: ::c_int = 0x0a01;
2822 pub const ETH_P_BATMAN: ::c_int = 0x4305;
2823 pub const ETH_P_DEC: ::c_int = 0x6000;
2824 pub const ETH_P_DNA_DL: ::c_int = 0x6001;
2825 pub const ETH_P_DNA_RC: ::c_int = 0x6002;
2826 pub const ETH_P_DNA_RT: ::c_int = 0x6003;
2827 pub const ETH_P_LAT: ::c_int = 0x6004;
2828 pub const ETH_P_DIAG: ::c_int = 0x6005;
2829 pub const ETH_P_CUST: ::c_int = 0x6006;
2830 pub const ETH_P_SCA: ::c_int = 0x6007;
2831 pub const ETH_P_TEB: ::c_int = 0x6558;
2832 pub const ETH_P_RARP: ::c_int = 0x8035;
2833 pub const ETH_P_ATALK: ::c_int = 0x809B;
2834 pub const ETH_P_AARP: ::c_int = 0x80F3;
2835 pub const ETH_P_8021Q: ::c_int = 0x8100;
2836 pub const ETH_P_IPX: ::c_int = 0x8137;
2837 pub const ETH_P_IPV6: ::c_int = 0x86DD;
2838 pub const ETH_P_PAUSE: ::c_int = 0x8808;
2839 pub const ETH_P_SLOW: ::c_int = 0x8809;
2840 pub const ETH_P_WCCP: ::c_int = 0x883E;
2841 pub const ETH_P_MPLS_UC: ::c_int = 0x8847;
2842 pub const ETH_P_MPLS_MC: ::c_int = 0x8848;
2843 pub const ETH_P_ATMMPOA: ::c_int = 0x884c;
2844 pub const ETH_P_PPP_DISC: ::c_int = 0x8863;
2845 pub const ETH_P_PPP_SES: ::c_int = 0x8864;
2846 pub const ETH_P_LINK_CTL: ::c_int = 0x886c;
2847 pub const ETH_P_ATMFATE: ::c_int = 0x8884;
2848 pub const ETH_P_PAE: ::c_int = 0x888E;
2849 pub const ETH_P_AOE: ::c_int = 0x88A2;
2850 pub const ETH_P_8021AD: ::c_int = 0x88A8;
2851 pub const ETH_P_802_EX1: ::c_int = 0x88B5;
2852 pub const ETH_P_TIPC: ::c_int = 0x88CA;
2853 pub const ETH_P_8021AH: ::c_int = 0x88E7;
2854 pub const ETH_P_MVRP: ::c_int = 0x88F5;
2855 pub const ETH_P_1588: ::c_int = 0x88F7;
2856 pub const ETH_P_PRP: ::c_int = 0x88FB;
2857 pub const ETH_P_FCOE: ::c_int = 0x8906;
2858 pub const ETH_P_TDLS: ::c_int = 0x890D;
2859 pub const ETH_P_FIP: ::c_int = 0x8914;
2860 pub const ETH_P_80221: ::c_int = 0x8917;
2861 pub const ETH_P_LOOPBACK: ::c_int = 0x9000;
2862 pub const ETH_P_QINQ1: ::c_int = 0x9100;
2863 pub const ETH_P_QINQ2: ::c_int = 0x9200;
2864 pub const ETH_P_QINQ3: ::c_int = 0x9300;
2865 pub const ETH_P_EDSA: ::c_int = 0xDADA;
2866 pub const ETH_P_AF_IUCV: ::c_int = 0xFBFB;
2867 
2868 pub const ETH_P_802_3_MIN: ::c_int = 0x0600;
2869 
2870 pub const ETH_P_802_3: ::c_int = 0x0001;
2871 pub const ETH_P_AX25: ::c_int = 0x0002;
2872 pub const ETH_P_ALL: ::c_int = 0x0003;
2873 pub const ETH_P_802_2: ::c_int = 0x0004;
2874 pub const ETH_P_SNAP: ::c_int = 0x0005;
2875 pub const ETH_P_DDCMP: ::c_int = 0x0006;
2876 pub const ETH_P_WAN_PPP: ::c_int = 0x0007;
2877 pub const ETH_P_PPP_MP: ::c_int = 0x0008;
2878 pub const ETH_P_LOCALTALK: ::c_int = 0x0009;
2879 pub const ETH_P_CAN: ::c_int = 0x000C;
2880 pub const ETH_P_CANFD: ::c_int = 0x000D;
2881 pub const ETH_P_PPPTALK: ::c_int = 0x0010;
2882 pub const ETH_P_TR_802_2: ::c_int = 0x0011;
2883 pub const ETH_P_MOBITEX: ::c_int = 0x0015;
2884 pub const ETH_P_CONTROL: ::c_int = 0x0016;
2885 pub const ETH_P_IRDA: ::c_int = 0x0017;
2886 pub const ETH_P_ECONET: ::c_int = 0x0018;
2887 pub const ETH_P_HDLC: ::c_int = 0x0019;
2888 pub const ETH_P_ARCNET: ::c_int = 0x001A;
2889 pub const ETH_P_DSA: ::c_int = 0x001B;
2890 pub const ETH_P_TRAILER: ::c_int = 0x001C;
2891 pub const ETH_P_PHONET: ::c_int = 0x00F5;
2892 pub const ETH_P_IEEE802154: ::c_int = 0x00F6;
2893 pub const ETH_P_CAIF: ::c_int = 0x00F7;
2894 
2895 pub const SFD_CLOEXEC: ::c_int = 0x080000;
2896 
2897 pub const NCCS: usize = 32;
2898 
2899 pub const O_TRUNC: ::c_int = 0x00040000;
2900 pub const O_NOATIME: ::c_int = 0x00002000;
2901 pub const O_CLOEXEC: ::c_int = 0x00000100;
2902 pub const O_TMPFILE: ::c_int = 0x00004000;
2903 
2904 pub const EBFONT: ::c_int = 59;
2905 pub const ENOSTR: ::c_int = 60;
2906 pub const ENODATA: ::c_int = 61;
2907 pub const ETIME: ::c_int = 62;
2908 pub const ENOSR: ::c_int = 63;
2909 pub const ENONET: ::c_int = 64;
2910 pub const ENOPKG: ::c_int = 65;
2911 pub const EREMOTE: ::c_int = 66;
2912 pub const ENOLINK: ::c_int = 67;
2913 pub const EADV: ::c_int = 68;
2914 pub const ESRMNT: ::c_int = 69;
2915 pub const ECOMM: ::c_int = 70;
2916 pub const EPROTO: ::c_int = 71;
2917 pub const EDOTDOT: ::c_int = 73;
2918 
2919 pub const SA_NODEFER: ::c_int = 0x40000000;
2920 pub const SA_RESETHAND: ::c_int = 0x80000000;
2921 pub const SA_RESTART: ::c_int = 0x10000000;
2922 pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
2923 
2924 pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
2925 
2926 pub const EFD_CLOEXEC: ::c_int = 0x80000;
2927 
2928 pub const BUFSIZ: ::c_uint = 1024;
2929 pub const TMP_MAX: ::c_uint = 10000;
2930 pub const FOPEN_MAX: ::c_uint = 1000;
2931 pub const O_PATH: ::c_int = 0x00400000;
2932 pub const O_EXEC: ::c_int = O_PATH;
2933 pub const O_SEARCH: ::c_int = O_PATH;
2934 pub const O_ACCMODE: ::c_int = 03 | O_SEARCH;
2935 pub const O_NDELAY: ::c_int = O_NONBLOCK;
2936 pub const NI_MAXHOST: ::socklen_t = 255;
2937 pub const PTHREAD_STACK_MIN: ::size_t = 2048;
2938 pub const POSIX_FADV_DONTNEED: ::c_int = 4;
2939 pub const POSIX_FADV_NOREUSE: ::c_int = 5;
2940 
2941 pub const POSIX_MADV_DONTNEED: ::c_int = 4;
2942 
2943 pub const RLIM_INFINITY: ::rlim_t = !0;
2944 pub const RLIMIT_RTTIME: ::c_int = 15;
2945 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
2946 pub const RLIMIT_NLIMITS: ::c_int = 16;
2947 #[allow(deprecated)]
2948 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
2949 pub const RLIM_NLIMITS: ::c_int = RLIMIT_NLIMITS;
2950 
2951 pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
2952 
2953 pub const SOCK_DCCP: ::c_int = 6;
2954 pub const SOCK_PACKET: ::c_int = 10;
2955 
2956 pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
2957 pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
2958 pub const TCP_THIN_DUPACK: ::c_int = 17;
2959 pub const TCP_USER_TIMEOUT: ::c_int = 18;
2960 pub const TCP_REPAIR: ::c_int = 19;
2961 pub const TCP_REPAIR_QUEUE: ::c_int = 20;
2962 pub const TCP_QUEUE_SEQ: ::c_int = 21;
2963 pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
2964 pub const TCP_FASTOPEN: ::c_int = 23;
2965 pub const TCP_TIMESTAMP: ::c_int = 24;
2966 
2967 pub const SIGUNUSED: ::c_int = ::SIGSYS;
2968 
2969 pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
2970 pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
2971 pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
2972 
2973 pub const CPU_SETSIZE: ::c_int = 128;
2974 
2975 pub const PTRACE_TRACEME: ::c_int = 0;
2976 pub const PTRACE_PEEKTEXT: ::c_int = 1;
2977 pub const PTRACE_PEEKDATA: ::c_int = 2;
2978 pub const PTRACE_PEEKUSER: ::c_int = 3;
2979 pub const PTRACE_POKETEXT: ::c_int = 4;
2980 pub const PTRACE_POKEDATA: ::c_int = 5;
2981 pub const PTRACE_POKEUSER: ::c_int = 6;
2982 pub const PTRACE_CONT: ::c_int = 7;
2983 pub const PTRACE_KILL: ::c_int = 8;
2984 pub const PTRACE_SINGLESTEP: ::c_int = 9;
2985 pub const PTRACE_GETREGS: ::c_int = 12;
2986 pub const PTRACE_SETREGS: ::c_int = 13;
2987 pub const PTRACE_GETFPREGS: ::c_int = 14;
2988 pub const PTRACE_SETFPREGS: ::c_int = 15;
2989 pub const PTRACE_ATTACH: ::c_int = 16;
2990 pub const PTRACE_DETACH: ::c_int = 17;
2991 pub const PTRACE_GETFPXREGS: ::c_int = 18;
2992 pub const PTRACE_SETFPXREGS: ::c_int = 19;
2993 pub const PTRACE_SYSCALL: ::c_int = 24;
2994 pub const PTRACE_SETOPTIONS: ::c_int = 0x4200;
2995 pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201;
2996 pub const PTRACE_GETSIGINFO: ::c_int = 0x4202;
2997 pub const PTRACE_SETSIGINFO: ::c_int = 0x4203;
2998 pub const PTRACE_GETREGSET: ::c_int = 0x4204;
2999 pub const PTRACE_SETREGSET: ::c_int = 0x4205;
3000 pub const PTRACE_SEIZE: ::c_int = 0x4206;
3001 pub const PTRACE_INTERRUPT: ::c_int = 0x4207;
3002 pub const PTRACE_LISTEN: ::c_int = 0x4208;
3003 pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
3004 
3005 pub const EPOLLWAKEUP: ::c_int = 0x20000000;
3006 
3007 pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
3008 
3009 pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
3010 
3011 pub const TCSANOW: ::c_int = 0;
3012 pub const TCSADRAIN: ::c_int = 1;
3013 pub const TCSAFLUSH: ::c_int = 2;
3014 
3015 pub const TIOCINQ: ::c_int = ::FIONREAD;
3016 
3017 pub const RTLD_GLOBAL: ::c_int = 0x100;
3018 pub const RTLD_NOLOAD: ::c_int = 0x4;
3019 
3020 pub const MCL_CURRENT: ::c_int = 0x0001;
3021 pub const MCL_FUTURE: ::c_int = 0x0002;
3022 
3023 pub const CBAUD: ::tcflag_t = 0o0010017;
3024 pub const TAB1: ::c_int = 0x00000800;
3025 pub const TAB2: ::c_int = 0x00001000;
3026 pub const TAB3: ::c_int = 0x00001800;
3027 pub const CR1: ::c_int = 0x00000200;
3028 pub const CR2: ::c_int = 0x00000400;
3029 pub const CR3: ::c_int = 0x00000600;
3030 pub const FF1: ::c_int = 0x00008000;
3031 pub const BS1: ::c_int = 0x00002000;
3032 pub const VT1: ::c_int = 0x00004000;
3033 pub const VWERASE: usize = 14;
3034 pub const VREPRINT: usize = 12;
3035 pub const VSUSP: usize = 10;
3036 pub const VSTART: usize = 8;
3037 pub const VSTOP: usize = 9;
3038 pub const VDISCARD: usize = 13;
3039 pub const VTIME: usize = 5;
3040 pub const IXON: ::tcflag_t = 0x00000400;
3041 pub const IXOFF: ::tcflag_t = 0x00001000;
3042 pub const ONLCR: ::tcflag_t = 0x4;
3043 pub const CSIZE: ::tcflag_t = 0x00000030;
3044 pub const CS6: ::tcflag_t = 0x00000010;
3045 pub const CS7: ::tcflag_t = 0x00000020;
3046 pub const CS8: ::tcflag_t = 0x00000030;
3047 pub const CSTOPB: ::tcflag_t = 0x00000040;
3048 pub const CREAD: ::tcflag_t = 0x00000080;
3049 pub const PARENB: ::tcflag_t = 0x00000100;
3050 pub const PARODD: ::tcflag_t = 0x00000200;
3051 pub const HUPCL: ::tcflag_t = 0x00000400;
3052 pub const CLOCAL: ::tcflag_t = 0x00000800;
3053 pub const ECHOKE: ::tcflag_t = 0x00000800;
3054 pub const ECHOE: ::tcflag_t = 0x00000010;
3055 pub const ECHOK: ::tcflag_t = 0x00000020;
3056 pub const ECHONL: ::tcflag_t = 0x00000040;
3057 pub const ECHOPRT: ::tcflag_t = 0x00000400;
3058 pub const ECHOCTL: ::tcflag_t = 0x00000200;
3059 pub const ISIG: ::tcflag_t = 0x00000001;
3060 pub const ICANON: ::tcflag_t = 0x00000002;
3061 pub const PENDIN: ::tcflag_t = 0x00004000;
3062 pub const NOFLSH: ::tcflag_t = 0x00000080;
3063 pub const CIBAUD: ::tcflag_t = 0o02003600000;
3064 pub const CBAUDEX: ::tcflag_t = 0o010000;
3065 pub const VSWTC: usize = 7;
3066 pub const OLCUC: ::tcflag_t = 0o000002;
3067 pub const NLDLY: ::tcflag_t = 0o000400;
3068 pub const CRDLY: ::tcflag_t = 0o003000;
3069 pub const TABDLY: ::tcflag_t = 0o014000;
3070 pub const BSDLY: ::tcflag_t = 0o020000;
3071 pub const FFDLY: ::tcflag_t = 0o100000;
3072 pub const VTDLY: ::tcflag_t = 0o040000;
3073 pub const XTABS: ::tcflag_t = 0o014000;
3074 
3075 pub const B0: ::speed_t = 0o000000;
3076 pub const B50: ::speed_t = 0o000001;
3077 pub const B75: ::speed_t = 0o000002;
3078 pub const B110: ::speed_t = 0o000003;
3079 pub const B134: ::speed_t = 0o000004;
3080 pub const B150: ::speed_t = 0o000005;
3081 pub const B200: ::speed_t = 0o000006;
3082 pub const B300: ::speed_t = 0o000007;
3083 pub const B600: ::speed_t = 0o000010;
3084 pub const B1200: ::speed_t = 0o000011;
3085 pub const B1800: ::speed_t = 0o000012;
3086 pub const B2400: ::speed_t = 0o000013;
3087 pub const B4800: ::speed_t = 0o000014;
3088 pub const B9600: ::speed_t = 0o000015;
3089 pub const B19200: ::speed_t = 0o000016;
3090 pub const B38400: ::speed_t = 0o000017;
3091 pub const EXTA: ::speed_t = B19200;
3092 pub const EXTB: ::speed_t = B38400;
3093 pub const B57600: ::speed_t = 0o010001;
3094 pub const B115200: ::speed_t = 0o010002;
3095 pub const B230400: ::speed_t = 0o010003;
3096 pub const B460800: ::speed_t = 0o010004;
3097 pub const B500000: ::speed_t = 0o010005;
3098 pub const B576000: ::speed_t = 0o010006;
3099 pub const B921600: ::speed_t = 0o010007;
3100 pub const B1000000: ::speed_t = 0o010010;
3101 pub const B1152000: ::speed_t = 0o010011;
3102 pub const B1500000: ::speed_t = 0o010012;
3103 pub const B2000000: ::speed_t = 0o010013;
3104 pub const B2500000: ::speed_t = 0o010014;
3105 pub const B3000000: ::speed_t = 0o010015;
3106 pub const B3500000: ::speed_t = 0o010016;
3107 pub const B4000000: ::speed_t = 0o010017;
3108 
3109 pub const SO_BINDTODEVICE: ::c_int = 25;
3110 pub const SO_TIMESTAMP: ::c_int = 29;
3111 pub const SO_MARK: ::c_int = 36;
3112 pub const SO_RXQ_OVFL: ::c_int = 40;
3113 pub const SO_PEEK_OFF: ::c_int = 42;
3114 pub const SO_BUSY_POLL: ::c_int = 46;
3115 pub const SO_BINDTOIFINDEX: ::c_int = 62;
3116 
3117 pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
3118 pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
3119 
3120 pub const O_ASYNC: ::c_int = 0x00000400;
3121 
3122 pub const FIOCLEX: ::c_int = 0x5451;
3123 pub const FIONBIO: ::c_int = 0x5421;
3124 
3125 pub const RLIMIT_RSS: ::c_int = 5;
3126 pub const RLIMIT_NOFILE: ::c_int = 7;
3127 pub const RLIMIT_AS: ::c_int = 9;
3128 pub const RLIMIT_NPROC: ::c_int = 6;
3129 pub const RLIMIT_MEMLOCK: ::c_int = 8;
3130 
3131 pub const O_APPEND: ::c_int = 0x00100000;
3132 pub const O_CREAT: ::c_int = 0x00010000;
3133 pub const O_EXCL: ::c_int = 0x00020000;
3134 pub const O_NOCTTY: ::c_int = 0x00000200;
3135 pub const O_NONBLOCK: ::c_int = 0x00000010;
3136 pub const O_SYNC: ::c_int = 0x00000040 | O_DSYNC;
3137 pub const O_RSYNC: ::c_int = O_SYNC;
3138 pub const O_DSYNC: ::c_int = 0x00000020;
3139 
3140 pub const SOCK_CLOEXEC: ::c_int = 0o2000000;
3141 pub const SOCK_NONBLOCK: ::c_int = 0o4000;
3142 
3143 pub const MAP_ANON: ::c_int = 0x0020;
3144 pub const MAP_GROWSDOWN: ::c_int = 0x0100;
3145 pub const MAP_DENYWRITE: ::c_int = 0x0800;
3146 pub const MAP_EXECUTABLE: ::c_int = 0x01000;
3147 pub const MAP_LOCKED: ::c_int = 0x02000;
3148 pub const MAP_NORESERVE: ::c_int = 0x04000;
3149 pub const MAP_POPULATE: ::c_int = 0x08000;
3150 pub const MAP_NONBLOCK: ::c_int = 0x010000;
3151 pub const MAP_STACK: ::c_int = 0x020000;
3152 
3153 pub const SOCK_STREAM: ::c_int = 1;
3154 pub const SOCK_DGRAM: ::c_int = 2;
3155 pub const SOCK_SEQPACKET: ::c_int = 5;
3156 
3157 pub const SOL_SOCKET: ::c_int = 1;
3158 
3159 pub const EDEADLK: ::c_int = 35;
3160 pub const ENAMETOOLONG: ::c_int = 36;
3161 pub const ENOLCK: ::c_int = 37;
3162 pub const ENOSYS: ::c_int = 38;
3163 pub const ENOTEMPTY: ::c_int = 39;
3164 pub const ELOOP: ::c_int = 40;
3165 pub const ENOMSG: ::c_int = 42;
3166 pub const EIDRM: ::c_int = 43;
3167 pub const ECHRNG: ::c_int = 44;
3168 pub const EL2NSYNC: ::c_int = 45;
3169 pub const EL3HLT: ::c_int = 46;
3170 pub const EL3RST: ::c_int = 47;
3171 pub const ELNRNG: ::c_int = 48;
3172 pub const EUNATCH: ::c_int = 49;
3173 pub const ENOCSI: ::c_int = 50;
3174 pub const EL2HLT: ::c_int = 51;
3175 pub const EBADE: ::c_int = 52;
3176 pub const EBADR: ::c_int = 53;
3177 pub const EXFULL: ::c_int = 54;
3178 pub const ENOANO: ::c_int = 55;
3179 pub const EBADRQC: ::c_int = 56;
3180 pub const EBADSLT: ::c_int = 57;
3181 pub const EDEADLOCK: ::c_int = EDEADLK;
3182 pub const EMULTIHOP: ::c_int = 72;
3183 pub const EBADMSG: ::c_int = 74;
3184 pub const EOVERFLOW: ::c_int = 75;
3185 pub const ENOTUNIQ: ::c_int = 76;
3186 pub const EBADFD: ::c_int = 77;
3187 pub const EREMCHG: ::c_int = 78;
3188 pub const ELIBACC: ::c_int = 79;
3189 pub const ELIBBAD: ::c_int = 80;
3190 pub const ELIBSCN: ::c_int = 81;
3191 pub const ELIBMAX: ::c_int = 82;
3192 pub const ELIBEXEC: ::c_int = 83;
3193 pub const EILSEQ: ::c_int = 84;
3194 pub const ERESTART: ::c_int = 85;
3195 pub const ESTRPIPE: ::c_int = 86;
3196 pub const EUSERS: ::c_int = 87;
3197 pub const ENOTSOCK: ::c_int = 88;
3198 pub const EDESTADDRREQ: ::c_int = 89;
3199 pub const EMSGSIZE: ::c_int = 90;
3200 pub const EPROTOTYPE: ::c_int = 91;
3201 pub const ENOPROTOOPT: ::c_int = 92;
3202 pub const EPROTONOSUPPORT: ::c_int = 93;
3203 pub const ESOCKTNOSUPPORT: ::c_int = 94;
3204 pub const EOPNOTSUPP: ::c_int = 95;
3205 pub const ENOTSUP: ::c_int = EOPNOTSUPP;
3206 pub const EPFNOSUPPORT: ::c_int = 96;
3207 pub const EAFNOSUPPORT: ::c_int = 97;
3208 pub const EADDRINUSE: ::c_int = 98;
3209 pub const EADDRNOTAVAIL: ::c_int = 99;
3210 pub const ENETDOWN: ::c_int = 100;
3211 pub const ENETUNREACH: ::c_int = 101;
3212 pub const ENETRESET: ::c_int = 102;
3213 pub const ECONNABORTED: ::c_int = 103;
3214 pub const ECONNRESET: ::c_int = 104;
3215 pub const ENOBUFS: ::c_int = 105;
3216 pub const EISCONN: ::c_int = 106;
3217 pub const ENOTCONN: ::c_int = 107;
3218 pub const ESHUTDOWN: ::c_int = 108;
3219 pub const ETOOMANYREFS: ::c_int = 109;
3220 pub const ETIMEDOUT: ::c_int = 110;
3221 pub const ECONNREFUSED: ::c_int = 111;
3222 pub const EHOSTDOWN: ::c_int = 112;
3223 pub const EHOSTUNREACH: ::c_int = 113;
3224 pub const EALREADY: ::c_int = 114;
3225 pub const EINPROGRESS: ::c_int = 115;
3226 pub const ESTALE: ::c_int = 116;
3227 pub const EUCLEAN: ::c_int = 117;
3228 pub const ENOTNAM: ::c_int = 118;
3229 pub const ENAVAIL: ::c_int = 119;
3230 pub const EISNAM: ::c_int = 120;
3231 pub const EREMOTEIO: ::c_int = 121;
3232 pub const EDQUOT: ::c_int = 122;
3233 pub const ENOMEDIUM: ::c_int = 123;
3234 pub const EMEDIUMTYPE: ::c_int = 124;
3235 pub const ECANCELED: ::c_int = 125;
3236 pub const ENOKEY: ::c_int = 126;
3237 pub const EKEYEXPIRED: ::c_int = 127;
3238 pub const EKEYREVOKED: ::c_int = 128;
3239 pub const EKEYREJECTED: ::c_int = 129;
3240 pub const EOWNERDEAD: ::c_int = 130;
3241 pub const ENOTRECOVERABLE: ::c_int = 131;
3242 pub const ERFKILL: ::c_int = 132;
3243 pub const EHWPOISON: ::c_int = 133;
3244 
3245 pub const SO_REUSEADDR: ::c_int = 2;
3246 pub const SO_TYPE: ::c_int = 3;
3247 pub const SO_ERROR: ::c_int = 4;
3248 pub const SO_DONTROUTE: ::c_int = 5;
3249 pub const SO_BROADCAST: ::c_int = 6;
3250 pub const SO_SNDBUF: ::c_int = 7;
3251 pub const SO_RCVBUF: ::c_int = 8;
3252 pub const SO_KEEPALIVE: ::c_int = 9;
3253 pub const SO_OOBINLINE: ::c_int = 10;
3254 pub const SO_NO_CHECK: ::c_int = 11;
3255 pub const SO_PRIORITY: ::c_int = 12;
3256 pub const SO_LINGER: ::c_int = 13;
3257 pub const SO_BSDCOMPAT: ::c_int = 14;
3258 pub const SO_REUSEPORT: ::c_int = 15;
3259 pub const SO_PASSCRED: ::c_int = 16;
3260 pub const SO_PEERCRED: ::c_int = 17;
3261 pub const SO_RCVLOWAT: ::c_int = 18;
3262 pub const SO_SNDLOWAT: ::c_int = 19;
3263 pub const SO_RCVTIMEO: ::c_int = 20;
3264 pub const SO_SNDTIMEO: ::c_int = 21;
3265 pub const SO_ACCEPTCONN: ::c_int = 30;
3266 pub const SO_SNDBUFFORCE: ::c_int = 32;
3267 pub const SO_RCVBUFFORCE: ::c_int = 33;
3268 pub const SO_PROTOCOL: ::c_int = 38;
3269 pub const SO_DOMAIN: ::c_int = 39;
3270 
3271 pub const SA_ONSTACK: ::c_int = 0x08000000;
3272 pub const SA_SIGINFO: ::c_int = 0x00000004;
3273 pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
3274 
3275 pub const SIGCHLD: ::c_int = 17;
3276 pub const SIGBUS: ::c_int = 7;
3277 pub const SIGTTIN: ::c_int = 21;
3278 pub const SIGTTOU: ::c_int = 22;
3279 pub const SIGXCPU: ::c_int = 24;
3280 pub const SIGXFSZ: ::c_int = 25;
3281 pub const SIGVTALRM: ::c_int = 26;
3282 pub const SIGPROF: ::c_int = 27;
3283 pub const SIGWINCH: ::c_int = 28;
3284 pub const SIGUSR1: ::c_int = 10;
3285 pub const SIGUSR2: ::c_int = 12;
3286 pub const SIGCONT: ::c_int = 18;
3287 pub const SIGSTOP: ::c_int = 19;
3288 pub const SIGTSTP: ::c_int = 20;
3289 pub const SIGURG: ::c_int = 23;
3290 pub const SIGIO: ::c_int = 29;
3291 pub const SIGSYS: ::c_int = 31;
3292 pub const SIGSTKFLT: ::c_int = 16;
3293 pub const SIGPOLL: ::c_int = 29;
3294 pub const SIGPWR: ::c_int = 30;
3295 pub const SIG_SETMASK: ::c_int = 2;
3296 pub const SIG_BLOCK: ::c_int = 0x000000;
3297 pub const SIG_UNBLOCK: ::c_int = 0x01;
3298 
3299 pub const EXTPROC: ::tcflag_t = 0x00010000;
3300 
3301 pub const MAP_HUGETLB: ::c_int = 0x040000;
3302 
3303 pub const F_GETLK: ::c_int = 5;
3304 pub const F_GETOWN: ::c_int = 9;
3305 pub const F_SETLK: ::c_int = 6;
3306 pub const F_SETLKW: ::c_int = 7;
3307 pub const F_SETOWN: ::c_int = 8;
3308 
3309 pub const VEOF: usize = 4;
3310 pub const VEOL: usize = 11;
3311 pub const VEOL2: usize = 16;
3312 pub const VMIN: usize = 6;
3313 pub const IEXTEN: ::tcflag_t = 0x00008000;
3314 pub const TOSTOP: ::tcflag_t = 0x00000100;
3315 pub const FLUSHO: ::tcflag_t = 0x00001000;
3316 
3317 pub const TCGETS: ::c_int = 0x5401;
3318 pub const TCSETS: ::c_int = 0x5402;
3319 pub const TCSETSW: ::c_int = 0x5403;
3320 pub const TCSETSF: ::c_int = 0x5404;
3321 pub const TCGETA: ::c_int = 0x5405;
3322 pub const TCSETA: ::c_int = 0x5406;
3323 pub const TCSETAW: ::c_int = 0x5407;
3324 pub const TCSETAF: ::c_int = 0x5408;
3325 pub const TCSBRK: ::c_int = 0x5409;
3326 pub const TCXONC: ::c_int = 0x540A;
3327 pub const TCFLSH: ::c_int = 0x540B;
3328 pub const TIOCGSOFTCAR: ::c_int = 0x5419;
3329 pub const TIOCSSOFTCAR: ::c_int = 0x541A;
3330 pub const TIOCLINUX: ::c_int = 0x541C;
3331 pub const TIOCGSERIAL: ::c_int = 0x541E;
3332 pub const TIOCEXCL: ::c_int = 0x540C;
3333 pub const TIOCNXCL: ::c_int = 0x540D;
3334 pub const TIOCSCTTY: ::c_int = 0x540E;
3335 pub const TIOCGPGRP: ::c_int = 0x540F;
3336 pub const TIOCSPGRP: ::c_int = 0x5410;
3337 pub const TIOCOUTQ: ::c_int = 0x5411;
3338 pub const TIOCSTI: ::c_int = 0x5412;
3339 pub const TIOCGWINSZ: ::c_int = 0x5413;
3340 pub const TIOCSWINSZ: ::c_int = 0x5414;
3341 pub const TIOCMGET: ::c_int = 0x5415;
3342 pub const TIOCMBIS: ::c_int = 0x5416;
3343 pub const TIOCMBIC: ::c_int = 0x5417;
3344 pub const TIOCMSET: ::c_int = 0x5418;
3345 pub const FIONREAD: ::c_int = 0x541B;
3346 pub const TIOCCONS: ::c_int = 0x541D;
3347 
3348 pub const POLLWRNORM: ::c_short = 0x100;
3349 pub const POLLWRBAND: ::c_short = 0x200;
3350 
3351 pub const TIOCM_LE: ::c_int = 0x001;
3352 pub const TIOCM_DTR: ::c_int = 0x002;
3353 pub const TIOCM_RTS: ::c_int = 0x004;
3354 pub const TIOCM_ST: ::c_int = 0x008;
3355 pub const TIOCM_SR: ::c_int = 0x010;
3356 pub const TIOCM_CTS: ::c_int = 0x020;
3357 pub const TIOCM_CAR: ::c_int = 0x040;
3358 pub const TIOCM_RNG: ::c_int = 0x080;
3359 pub const TIOCM_DSR: ::c_int = 0x100;
3360 pub const TIOCM_CD: ::c_int = TIOCM_CAR;
3361 pub const TIOCM_RI: ::c_int = TIOCM_RNG;
3362 
3363 pub const O_DIRECTORY: ::c_int = 0x00080000;
3364 pub const O_DIRECT: ::c_int = 0x00000800;
3365 pub const O_LARGEFILE: ::c_int = 0x00001000;
3366 pub const O_NOFOLLOW: ::c_int = 0x00000080;
3367 
3368 pub const HUGETLB_FLAG_ENCODE_SHIFT: u32 = 26;
3369 pub const MAP_HUGE_SHIFT: u32 = 26;
3370 
3371 // intentionally not public, only used for fd_set
3372 cfg_if! {
3373     if #[cfg(target_pointer_width = "32")] {
3374         const ULONG_SIZE: usize = 32;
3375     } else if #[cfg(target_pointer_width = "64")] {
3376         const ULONG_SIZE: usize = 64;
3377     } else {
3378         // Unknown target_pointer_width
3379     }
3380 }
3381 
3382 // END_PUB_CONST
3383 
3384 f! {
3385     pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
3386         let fd = fd as usize;
3387         let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
3388         (*set).fds_bits[fd / size] &= !(1 << (fd % size));
3389         return
3390     }
3391 
3392     pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
3393         let fd = fd as usize;
3394         let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
3395         return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
3396     }
3397 
3398     pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
3399         let fd = fd as usize;
3400         let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
3401         (*set).fds_bits[fd / size] |= 1 << (fd % size);
3402         return
3403     }
3404 
3405     pub fn FD_ZERO(set: *mut fd_set) -> () {
3406         for slot in (*set).fds_bits.iter_mut() {
3407             *slot = 0;
3408         }
3409     }
3410 
3411     pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
3412         for slot in cpuset.bits.iter_mut() {
3413             *slot = 0;
3414         }
3415     }
3416 
3417     pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
3418         let size_in_bits
3419             = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
3420         let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
3421         cpuset.bits[idx] |= 1 << offset;
3422         ()
3423     }
3424 
3425     pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
3426         let size_in_bits
3427             = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
3428         let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
3429         cpuset.bits[idx] &= !(1 << offset);
3430         ()
3431     }
3432 
3433     pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
3434         let size_in_bits = 8 * ::mem::size_of_val(&cpuset.bits[0]);
3435         let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
3436         0 != (cpuset.bits[idx] & (1 << offset))
3437     }
3438 
3439     pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
3440         set1.bits == set2.bits
3441     }
3442 
3443     pub fn major(dev: ::dev_t) -> ::c_uint {
3444         let mut major = 0;
3445         major |= (dev & 0x00000000000fff00) >> 8;
3446         major |= (dev & 0xfffff00000000000) >> 32;
3447         major as ::c_uint
3448     }
3449 
3450     pub fn minor(dev: ::dev_t) -> ::c_uint {
3451         let mut minor = 0;
3452         minor |= (dev & 0x00000000000000ff) >> 0;
3453         minor |= (dev & 0x00000ffffff00000) >> 12;
3454         minor as ::c_uint
3455     }
3456 
3457     pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar {
3458         cmsg.offset(1) as *mut c_uchar
3459     }
3460 
3461     pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr)
3462         -> *mut cmsghdr
3463     {
3464         if ((*cmsg).cmsg_len as ::size_t) < ::mem::size_of::<cmsghdr>() {
3465             0 as *mut cmsghdr
3466         } else if __CMSG_NEXT(cmsg).add(::mem::size_of::<cmsghdr>())
3467             >= __MHDR_END(mhdr) {
3468             0 as *mut cmsghdr
3469         } else {
3470             __CMSG_NEXT(cmsg).cast()
3471         }
3472     }
3473 
3474     pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
3475         if (*mhdr).msg_controllen as ::size_t >= ::mem::size_of::<cmsghdr>() {
3476             (*mhdr).msg_control.cast()
3477         } else {
3478             0 as *mut cmsghdr
3479         }
3480     }
3481 
3482     pub {const} fn CMSG_ALIGN(len: ::size_t) -> ::size_t {
3483         (len + ::mem::size_of::<::size_t>() - 1)
3484             & !(::mem::size_of::<::size_t>() - 1)
3485     }
3486 
3487     pub {const} fn CMSG_SPACE(len: ::c_uint) -> ::c_uint {
3488         (CMSG_ALIGN(len as ::size_t) + CMSG_ALIGN(::mem::size_of::<cmsghdr>()))
3489             as ::c_uint
3490     }
3491 
3492     pub {const} fn CMSG_LEN(len: ::c_uint) -> ::c_uint {
3493         (CMSG_ALIGN(::mem::size_of::<cmsghdr>()) + len as ::size_t) as ::c_uint
3494     }
3495 }
3496 
3497 safe_f! {
3498     pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
3499         (status & 0xff) == 0x7f
3500     }
3501 
3502     pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
3503         (status >> 8) & 0xff
3504     }
3505 
3506     pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
3507         status == 0xffff
3508     }
3509 
3510     pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
3511         ((status & 0x7f) + 1) as i8 >= 2
3512     }
3513 
3514     pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int {
3515         status & 0x7f
3516     }
3517 
3518     pub {const} fn WIFEXITED(status: ::c_int) -> bool {
3519         (status & 0x7f) == 0
3520     }
3521 
3522     pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int {
3523         (status >> 8) & 0xff
3524     }
3525 
3526     pub {const} fn WCOREDUMP(status: ::c_int) -> bool {
3527         (status & 0x80) != 0
3528     }
3529 
3530     pub {const} fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int {
3531         (cmd << 8) | (type_ & 0x00ff)
3532     }
3533 
3534     pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
3535         let major = major as ::dev_t;
3536         let minor = minor as ::dev_t;
3537         let mut dev = 0;
3538         dev |= (major & 0x00000fff) << 8;
3539         dev |= (major & 0xfffff000) << 32;
3540         dev |= (minor & 0x000000ff) << 0;
3541         dev |= (minor & 0xffffff00) << 12;
3542         dev
3543     }
3544 }
3545 
3546 fn __CMSG_LEN(cmsg: *const cmsghdr) -> ::ssize_t {
3547     ((unsafe { (*cmsg).cmsg_len as ::size_t } + ::mem::size_of::<::c_long>() - 1)
3548         & !(::mem::size_of::<::c_long>() - 1)) as ::ssize_t
3549 }
3550 
3551 fn __CMSG_NEXT(cmsg: *const cmsghdr) -> *mut c_uchar {
3552     (unsafe { cmsg.offset(__CMSG_LEN(cmsg)) }) as *mut c_uchar
3553 }
3554 
3555 fn __MHDR_END(mhdr: *const msghdr) -> *mut c_uchar {
3556     unsafe { (*mhdr).msg_control.offset((*mhdr).msg_controllen as isize) }.cast()
3557 }
3558 
3559 // EXTERN_FN
3560 
3561 #[link(name = "c")]
3562 #[link(name = "fdio")]
3563 extern "C" {}
3564 
3565 #[cfg_attr(feature = "extra_traits", derive(Debug))]
3566 pub enum FILE {}
3567 impl ::Copy for FILE {}
3568 impl ::Clone for FILE {
3569     fn clone(&self) -> FILE {
3570         *self
3571     }
3572 }
3573 #[cfg_attr(feature = "extra_traits", derive(Debug))]
3574 pub enum fpos_t {} // FIXME: fill this out with a struct
3575 impl ::Copy for fpos_t {}
3576 impl ::Clone for fpos_t {
3577     fn clone(&self) -> fpos_t {
3578         *self
3579     }
3580 }
3581 
3582 extern "C" {
3583     pub fn isalnum(c: c_int) -> c_int;
3584     pub fn isalpha(c: c_int) -> c_int;
3585     pub fn iscntrl(c: c_int) -> c_int;
3586     pub fn isdigit(c: c_int) -> c_int;
3587     pub fn isgraph(c: c_int) -> c_int;
3588     pub fn islower(c: c_int) -> c_int;
3589     pub fn isprint(c: c_int) -> c_int;
3590     pub fn ispunct(c: c_int) -> c_int;
3591     pub fn isspace(c: c_int) -> c_int;
3592     pub fn isupper(c: c_int) -> c_int;
3593     pub fn isxdigit(c: c_int) -> c_int;
3594     pub fn isblank(c: c_int) -> c_int;
3595     pub fn tolower(c: c_int) -> c_int;
3596     pub fn toupper(c: c_int) -> c_int;
3597     pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE;
3598     pub fn freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE;
3599     pub fn fflush(file: *mut FILE) -> c_int;
3600     pub fn fclose(file: *mut FILE) -> c_int;
3601     pub fn remove(filename: *const c_char) -> c_int;
3602     pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int;
3603     pub fn tmpfile() -> *mut FILE;
3604     pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int;
3605     pub fn setbuf(stream: *mut FILE, buf: *mut c_char);
3606     pub fn getchar() -> c_int;
3607     pub fn putchar(c: c_int) -> c_int;
3608     pub fn fgetc(stream: *mut FILE) -> c_int;
3609     pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char;
3610     pub fn fputc(c: c_int, stream: *mut FILE) -> c_int;
3611     pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int;
3612     pub fn puts(s: *const c_char) -> c_int;
3613     pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int;
3614     pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
3615     pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
3616     pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int;
3617     pub fn ftell(stream: *mut FILE) -> c_long;
3618     pub fn rewind(stream: *mut FILE);
3619     pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int;
3620     pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int;
3621     pub fn feof(stream: *mut FILE) -> c_int;
3622     pub fn ferror(stream: *mut FILE) -> c_int;
3623     pub fn perror(s: *const c_char);
3624     pub fn atof(s: *const c_char) -> c_double;
3625     pub fn atoi(s: *const c_char) -> c_int;
3626     pub fn atol(s: *const c_char) -> c_long;
3627     pub fn atoll(s: *const c_char) -> c_longlong;
3628     pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
3629     pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
3630     pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
3631     pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
3632     pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
3633     pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
3634     pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
3635     pub fn malloc(size: size_t) -> *mut c_void;
3636     pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
3637     pub fn free(p: *mut c_void);
3638     pub fn abort() -> !;
3639     pub fn exit(status: c_int) -> !;
3640     pub fn _exit(status: c_int) -> !;
3641     pub fn atexit(cb: extern "C" fn()) -> c_int;
3642     pub fn system(s: *const c_char) -> c_int;
3643     pub fn getenv(s: *const c_char) -> *mut c_char;
3644 
3645     pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char;
3646     pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
3647     pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char;
3648     pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char;
3649     pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int;
3650     pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int;
3651     pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int;
3652     pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char;
3653     pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char;
3654     pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t;
3655     pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t;
3656     pub fn strdup(cs: *const c_char) -> *mut c_char;
3657     pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char;
3658     pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
3659     pub fn strlen(cs: *const c_char) -> size_t;
3660     pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t;
3661     pub fn strerror(n: c_int) -> *mut c_char;
3662     pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char;
3663     pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t;
3664     pub fn wcslen(buf: *const wchar_t) -> size_t;
3665     pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> ::size_t;
3666 
3667     pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
3668     pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t;
3669     pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
3670     pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
3671     pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
3672     pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
3673 
3674     pub fn abs(i: c_int) -> c_int;
3675     pub fn labs(i: c_long) -> c_long;
3676     pub fn rand() -> c_int;
3677     pub fn srand(seed: c_uint);
3678 
3679     pub fn getpwnam(name: *const ::c_char) -> *mut passwd;
3680     pub fn getpwuid(uid: ::uid_t) -> *mut passwd;
3681 
3682     pub fn fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
3683     pub fn printf(format: *const ::c_char, ...) -> ::c_int;
3684     pub fn snprintf(s: *mut ::c_char, n: ::size_t, format: *const ::c_char, ...) -> ::c_int;
3685     pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int;
3686     pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
3687     pub fn scanf(format: *const ::c_char, ...) -> ::c_int;
3688     pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int;
3689     pub fn getchar_unlocked() -> ::c_int;
3690     pub fn putchar_unlocked(c: ::c_int) -> ::c_int;
3691 
3692     pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int;
3693     pub fn connect(socket: ::c_int, address: *const sockaddr, len: socklen_t) -> ::c_int;
3694     pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int;
3695     pub fn accept(socket: ::c_int, address: *mut sockaddr, address_len: *mut socklen_t) -> ::c_int;
3696     pub fn getpeername(
3697         socket: ::c_int,
3698         address: *mut sockaddr,
3699         address_len: *mut socklen_t,
3700     ) -> ::c_int;
3701     pub fn getsockname(
3702         socket: ::c_int,
3703         address: *mut sockaddr,
3704         address_len: *mut socklen_t,
3705     ) -> ::c_int;
3706     pub fn setsockopt(
3707         socket: ::c_int,
3708         level: ::c_int,
3709         name: ::c_int,
3710         value: *const ::c_void,
3711         option_len: socklen_t,
3712     ) -> ::c_int;
3713     pub fn socketpair(
3714         domain: ::c_int,
3715         type_: ::c_int,
3716         protocol: ::c_int,
3717         socket_vector: *mut ::c_int,
3718     ) -> ::c_int;
3719     pub fn sendto(
3720         socket: ::c_int,
3721         buf: *const ::c_void,
3722         len: ::size_t,
3723         flags: ::c_int,
3724         addr: *const sockaddr,
3725         addrlen: socklen_t,
3726     ) -> ::ssize_t;
3727     pub fn shutdown(socket: ::c_int, how: ::c_int) -> ::c_int;
3728 
3729     pub fn chmod(path: *const c_char, mode: mode_t) -> ::c_int;
3730     pub fn fchmod(fd: ::c_int, mode: mode_t) -> ::c_int;
3731 
3732     pub fn fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int;
3733 
3734     pub fn mkdir(path: *const c_char, mode: mode_t) -> ::c_int;
3735 
3736     pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int;
3737 
3738     pub fn pclose(stream: *mut ::FILE) -> ::c_int;
3739     pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE;
3740     pub fn fileno(stream: *mut ::FILE) -> ::c_int;
3741 
3742     pub fn open(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
3743     pub fn creat(path: *const c_char, mode: mode_t) -> ::c_int;
3744     pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int;
3745 
3746     pub fn opendir(dirname: *const c_char) -> *mut ::DIR;
3747     pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
3748     pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent, result: *mut *mut ::dirent)
3749         -> ::c_int;
3750     pub fn closedir(dirp: *mut ::DIR) -> ::c_int;
3751     pub fn rewinddir(dirp: *mut ::DIR);
3752 
3753     pub fn openat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int, ...) -> ::c_int;
3754     pub fn fchmodat(
3755         dirfd: ::c_int,
3756         pathname: *const ::c_char,
3757         mode: ::mode_t,
3758         flags: ::c_int,
3759     ) -> ::c_int;
3760     pub fn fchown(fd: ::c_int, owner: ::uid_t, group: ::gid_t) -> ::c_int;
3761     pub fn fchownat(
3762         dirfd: ::c_int,
3763         pathname: *const ::c_char,
3764         owner: ::uid_t,
3765         group: ::gid_t,
3766         flags: ::c_int,
3767     ) -> ::c_int;
3768     pub fn fstatat(
3769         dirfd: ::c_int,
3770         pathname: *const ::c_char,
3771         buf: *mut stat,
3772         flags: ::c_int,
3773     ) -> ::c_int;
3774     pub fn linkat(
3775         olddirfd: ::c_int,
3776         oldpath: *const ::c_char,
3777         newdirfd: ::c_int,
3778         newpath: *const ::c_char,
3779         flags: ::c_int,
3780     ) -> ::c_int;
3781     pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
3782     pub fn readlinkat(
3783         dirfd: ::c_int,
3784         pathname: *const ::c_char,
3785         buf: *mut ::c_char,
3786         bufsiz: ::size_t,
3787     ) -> ::ssize_t;
3788     pub fn renameat(
3789         olddirfd: ::c_int,
3790         oldpath: *const ::c_char,
3791         newdirfd: ::c_int,
3792         newpath: *const ::c_char,
3793     ) -> ::c_int;
3794     pub fn symlinkat(
3795         target: *const ::c_char,
3796         newdirfd: ::c_int,
3797         linkpath: *const ::c_char,
3798     ) -> ::c_int;
3799     pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int) -> ::c_int;
3800 
3801     pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int;
3802     pub fn alarm(seconds: ::c_uint) -> ::c_uint;
3803     pub fn chdir(dir: *const c_char) -> ::c_int;
3804     pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int;
3805     pub fn lchown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int;
3806     pub fn close(fd: ::c_int) -> ::c_int;
3807     pub fn dup(fd: ::c_int) -> ::c_int;
3808     pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int;
3809     pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> ::c_int;
3810     pub fn execle(path: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int;
3811     pub fn execlp(file: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int;
3812     pub fn execv(prog: *const c_char, argv: *const *const c_char) -> ::c_int;
3813     pub fn execve(
3814         prog: *const c_char,
3815         argv: *const *const c_char,
3816         envp: *const *const c_char,
3817     ) -> ::c_int;
3818     pub fn execvp(c: *const c_char, argv: *const *const c_char) -> ::c_int;
3819     pub fn fork() -> pid_t;
3820     pub fn fpathconf(filedes: ::c_int, name: ::c_int) -> c_long;
3821     pub fn getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char;
3822     pub fn getegid() -> gid_t;
3823     pub fn geteuid() -> uid_t;
3824     pub fn getgid() -> gid_t;
3825     pub fn getgroups(ngroups_max: ::c_int, groups: *mut gid_t) -> ::c_int;
3826     pub fn getlogin() -> *mut c_char;
3827     pub fn getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int;
3828     pub fn getpgid(pid: pid_t) -> pid_t;
3829     pub fn getpgrp() -> pid_t;
3830     pub fn getpid() -> pid_t;
3831     pub fn getppid() -> pid_t;
3832     pub fn getuid() -> uid_t;
3833     pub fn isatty(fd: ::c_int) -> ::c_int;
3834     pub fn link(src: *const c_char, dst: *const c_char) -> ::c_int;
3835     pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t;
3836     pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long;
3837     pub fn pause() -> ::c_int;
3838     pub fn pipe(fds: *mut ::c_int) -> ::c_int;
3839     pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int;
3840     pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) -> ::ssize_t;
3841     pub fn rmdir(path: *const c_char) -> ::c_int;
3842     pub fn seteuid(uid: uid_t) -> ::c_int;
3843     pub fn setegid(gid: gid_t) -> ::c_int;
3844     pub fn setgid(gid: gid_t) -> ::c_int;
3845     pub fn setpgid(pid: pid_t, pgid: pid_t) -> ::c_int;
3846     pub fn setsid() -> pid_t;
3847     pub fn setuid(uid: uid_t) -> ::c_int;
3848     pub fn sleep(secs: ::c_uint) -> ::c_uint;
3849     pub fn nanosleep(rqtp: *const timespec, rmtp: *mut timespec) -> ::c_int;
3850     pub fn tcgetpgrp(fd: ::c_int) -> pid_t;
3851     pub fn tcsetpgrp(fd: ::c_int, pgrp: ::pid_t) -> ::c_int;
3852     pub fn ttyname(fd: ::c_int) -> *mut c_char;
3853     pub fn unlink(c: *const c_char) -> ::c_int;
3854     pub fn wait(status: *mut ::c_int) -> pid_t;
3855     pub fn waitpid(pid: pid_t, status: *mut ::c_int, options: ::c_int) -> pid_t;
3856     pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) -> ::ssize_t;
3857     pub fn pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
3858     pub fn pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
3859     pub fn umask(mask: mode_t) -> mode_t;
3860 
3861     pub fn utime(file: *const c_char, buf: *const utimbuf) -> ::c_int;
3862 
3863     pub fn kill(pid: pid_t, sig: ::c_int) -> ::c_int;
3864 
3865     pub fn mlock(addr: *const ::c_void, len: ::size_t) -> ::c_int;
3866     pub fn munlock(addr: *const ::c_void, len: ::size_t) -> ::c_int;
3867     pub fn mlockall(flags: ::c_int) -> ::c_int;
3868     pub fn munlockall() -> ::c_int;
3869 
3870     pub fn mmap(
3871         addr: *mut ::c_void,
3872         len: ::size_t,
3873         prot: ::c_int,
3874         flags: ::c_int,
3875         fd: ::c_int,
3876         offset: off_t,
3877     ) -> *mut ::c_void;
3878     pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int;
3879 
3880     pub fn if_nametoindex(ifname: *const c_char) -> ::c_uint;
3881     pub fn if_indextoname(ifindex: ::c_uint, ifname: *mut ::c_char) -> *mut ::c_char;
3882 
3883     pub fn lstat(path: *const c_char, buf: *mut stat) -> ::c_int;
3884 
3885     pub fn fsync(fd: ::c_int) -> ::c_int;
3886 
3887     pub fn setenv(name: *const c_char, val: *const c_char, overwrite: ::c_int) -> ::c_int;
3888     pub fn unsetenv(name: *const c_char) -> ::c_int;
3889 
3890     pub fn symlink(path1: *const c_char, path2: *const c_char) -> ::c_int;
3891 
3892     pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int;
3893 
3894     pub fn signal(signum: ::c_int, handler: sighandler_t) -> sighandler_t;
3895 
3896     pub fn realpath(pathname: *const ::c_char, resolved: *mut ::c_char) -> *mut ::c_char;
3897 
3898     pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int;
3899 
3900     pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
3901     pub fn times(buf: *mut ::tms) -> ::clock_t;
3902 
3903     pub fn pthread_self() -> ::pthread_t;
3904     pub fn pthread_join(native: ::pthread_t, value: *mut *mut ::c_void) -> ::c_int;
3905     pub fn pthread_exit(value: *mut ::c_void) -> !;
3906     pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int;
3907     pub fn pthread_attr_destroy(attr: *mut ::pthread_attr_t) -> ::c_int;
3908     pub fn pthread_attr_getstacksize(
3909         attr: *const ::pthread_attr_t,
3910         stacksize: *mut ::size_t,
3911     ) -> ::c_int;
3912     pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, stack_size: ::size_t) -> ::c_int;
3913     pub fn pthread_attr_setdetachstate(attr: *mut ::pthread_attr_t, state: ::c_int) -> ::c_int;
3914     pub fn pthread_detach(thread: ::pthread_t) -> ::c_int;
3915     pub fn sched_yield() -> ::c_int;
3916     pub fn pthread_key_create(
3917         key: *mut pthread_key_t,
3918         dtor: ::Option<unsafe extern "C" fn(*mut ::c_void)>,
3919     ) -> ::c_int;
3920     pub fn pthread_key_delete(key: pthread_key_t) -> ::c_int;
3921     pub fn pthread_getspecific(key: pthread_key_t) -> *mut ::c_void;
3922     pub fn pthread_setspecific(key: pthread_key_t, value: *const ::c_void) -> ::c_int;
3923     pub fn pthread_mutex_init(
3924         lock: *mut pthread_mutex_t,
3925         attr: *const pthread_mutexattr_t,
3926     ) -> ::c_int;
3927     pub fn pthread_mutex_destroy(lock: *mut pthread_mutex_t) -> ::c_int;
3928     pub fn pthread_mutex_lock(lock: *mut pthread_mutex_t) -> ::c_int;
3929     pub fn pthread_mutex_trylock(lock: *mut pthread_mutex_t) -> ::c_int;
3930     pub fn pthread_mutex_unlock(lock: *mut pthread_mutex_t) -> ::c_int;
3931 
3932     pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> ::c_int;
3933     pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> ::c_int;
3934     pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, _type: ::c_int) -> ::c_int;
3935 
3936     pub fn pthread_cond_init(cond: *mut pthread_cond_t, attr: *const pthread_condattr_t)
3937         -> ::c_int;
3938     pub fn pthread_cond_wait(cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t) -> ::c_int;
3939     pub fn pthread_cond_timedwait(
3940         cond: *mut pthread_cond_t,
3941         lock: *mut pthread_mutex_t,
3942         abstime: *const ::timespec,
3943     ) -> ::c_int;
3944     pub fn pthread_cond_signal(cond: *mut pthread_cond_t) -> ::c_int;
3945     pub fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> ::c_int;
3946     pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> ::c_int;
3947     pub fn pthread_condattr_init(attr: *mut pthread_condattr_t) -> ::c_int;
3948     pub fn pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> ::c_int;
3949     pub fn pthread_rwlock_init(
3950         lock: *mut pthread_rwlock_t,
3951         attr: *const pthread_rwlockattr_t,
3952     ) -> ::c_int;
3953     pub fn pthread_rwlock_destroy(lock: *mut pthread_rwlock_t) -> ::c_int;
3954     pub fn pthread_rwlock_rdlock(lock: *mut pthread_rwlock_t) -> ::c_int;
3955     pub fn pthread_rwlock_tryrdlock(lock: *mut pthread_rwlock_t) -> ::c_int;
3956     pub fn pthread_rwlock_wrlock(lock: *mut pthread_rwlock_t) -> ::c_int;
3957     pub fn pthread_rwlock_trywrlock(lock: *mut pthread_rwlock_t) -> ::c_int;
3958     pub fn pthread_rwlock_unlock(lock: *mut pthread_rwlock_t) -> ::c_int;
3959     pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) -> ::c_int;
3960     pub fn pthread_rwlockattr_destroy(attr: *mut pthread_rwlockattr_t) -> ::c_int;
3961     pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
3962     pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
3963     pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
3964 
3965     pub fn getsockopt(
3966         sockfd: ::c_int,
3967         level: ::c_int,
3968         optname: ::c_int,
3969         optval: *mut ::c_void,
3970         optlen: *mut ::socklen_t,
3971     ) -> ::c_int;
3972     pub fn raise(signum: ::c_int) -> ::c_int;
3973     pub fn sigaction(signum: ::c_int, act: *const sigaction, oldact: *mut sigaction) -> ::c_int;
3974 
3975     pub fn utimes(filename: *const ::c_char, times: *const ::timeval) -> ::c_int;
3976     pub fn dlopen(filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void;
3977     pub fn dlerror() -> *mut ::c_char;
3978     pub fn dlsym(handle: *mut ::c_void, symbol: *const ::c_char) -> *mut ::c_void;
3979     pub fn dlclose(handle: *mut ::c_void) -> ::c_int;
3980     pub fn dladdr(addr: *const ::c_void, info: *mut Dl_info) -> ::c_int;
3981 
3982     pub fn getaddrinfo(
3983         node: *const c_char,
3984         service: *const c_char,
3985         hints: *const addrinfo,
3986         res: *mut *mut addrinfo,
3987     ) -> ::c_int;
3988     pub fn freeaddrinfo(res: *mut addrinfo);
3989     pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char;
3990     pub fn res_init() -> ::c_int;
3991 
3992     pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
3993     pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
3994     pub fn mktime(tm: *mut tm) -> time_t;
3995     pub fn time(time: *mut time_t) -> time_t;
3996     pub fn gmtime(time_p: *const time_t) -> *mut tm;
3997     pub fn localtime(time_p: *const time_t) -> *mut tm;
3998 
3999     pub fn mknod(pathname: *const ::c_char, mode: ::mode_t, dev: ::dev_t) -> ::c_int;
4000     pub fn uname(buf: *mut ::utsname) -> ::c_int;
4001     pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
4002     pub fn getservbyname(name: *const ::c_char, proto: *const ::c_char) -> *mut servent;
4003     pub fn getprotobyname(name: *const ::c_char) -> *mut protoent;
4004     pub fn getprotobynumber(proto: ::c_int) -> *mut protoent;
4005     pub fn usleep(secs: ::c_uint) -> ::c_int;
4006     pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
4007     pub fn recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
4008     pub fn putenv(string: *mut c_char) -> ::c_int;
4009     pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int;
4010     pub fn select(
4011         nfds: ::c_int,
4012         readfds: *mut fd_set,
4013         writefds: *mut fd_set,
4014         errorfds: *mut fd_set,
4015         timeout: *mut timeval,
4016     ) -> ::c_int;
4017     pub fn setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char;
4018     pub fn localeconv() -> *mut lconv;
4019 
4020     pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
4021     pub fn sem_wait(sem: *mut sem_t) -> ::c_int;
4022     pub fn sem_trywait(sem: *mut sem_t) -> ::c_int;
4023     pub fn sem_post(sem: *mut sem_t) -> ::c_int;
4024     pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
4025     pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> ::c_int;
4026     pub fn fstatvfs(fd: ::c_int, buf: *mut statvfs) -> ::c_int;
4027 
4028     pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::ssize_t;
4029 
4030     pub fn sigemptyset(set: *mut sigset_t) -> ::c_int;
4031     pub fn sigaddset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
4032     pub fn sigfillset(set: *mut sigset_t) -> ::c_int;
4033     pub fn sigdelset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
4034     pub fn sigismember(set: *const sigset_t, signum: ::c_int) -> ::c_int;
4035 
4036     pub fn sigprocmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
4037     pub fn sigpending(set: *mut sigset_t) -> ::c_int;
4038 
4039     pub fn timegm(tm: *mut ::tm) -> time_t;
4040 
4041     pub fn getsid(pid: pid_t) -> pid_t;
4042 
4043     pub fn sysconf(name: ::c_int) -> ::c_long;
4044 
4045     pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int;
4046 
4047     pub fn pselect(
4048         nfds: ::c_int,
4049         readfds: *mut fd_set,
4050         writefds: *mut fd_set,
4051         errorfds: *mut fd_set,
4052         timeout: *const timespec,
4053         sigmask: *const sigset_t,
4054     ) -> ::c_int;
4055     pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int;
4056     pub fn ftello(stream: *mut ::FILE) -> ::off_t;
4057     pub fn tcdrain(fd: ::c_int) -> ::c_int;
4058     pub fn cfgetispeed(termios: *const ::termios) -> ::speed_t;
4059     pub fn cfgetospeed(termios: *const ::termios) -> ::speed_t;
4060     pub fn cfmakeraw(termios: *mut ::termios);
4061     pub fn cfsetispeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
4062     pub fn cfsetospeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
4063     pub fn cfsetspeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
4064     pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int;
4065     pub fn tcsetattr(fd: ::c_int, optional_actions: ::c_int, termios: *const ::termios) -> ::c_int;
4066     pub fn tcflow(fd: ::c_int, action: ::c_int) -> ::c_int;
4067     pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int;
4068     pub fn tcgetsid(fd: ::c_int) -> ::pid_t;
4069     pub fn tcsendbreak(fd: ::c_int, duration: ::c_int) -> ::c_int;
4070     pub fn mkstemp(template: *mut ::c_char) -> ::c_int;
4071     pub fn mkdtemp(template: *mut ::c_char) -> *mut ::c_char;
4072 
4073     pub fn tmpnam(ptr: *mut ::c_char) -> *mut ::c_char;
4074 
4075     pub fn openlog(ident: *const ::c_char, logopt: ::c_int, facility: ::c_int);
4076     pub fn closelog();
4077     pub fn setlogmask(maskpri: ::c_int) -> ::c_int;
4078     pub fn syslog(priority: ::c_int, message: *const ::c_char, ...);
4079 
4080     pub fn grantpt(fd: ::c_int) -> ::c_int;
4081     pub fn posix_openpt(flags: ::c_int) -> ::c_int;
4082     pub fn ptsname(fd: ::c_int) -> *mut ::c_char;
4083     pub fn unlockpt(fd: ::c_int) -> ::c_int;
4084 
4085     pub fn fdatasync(fd: ::c_int) -> ::c_int;
4086     pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
4087     pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
4088     pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
4089     pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
4090 
4091     pub fn pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
4092     pub fn pthread_attr_getstack(
4093         attr: *const ::pthread_attr_t,
4094         stackaddr: *mut *mut ::c_void,
4095         stacksize: *mut ::size_t,
4096     ) -> ::c_int;
4097     pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
4098     pub fn setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int;
4099     pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
4100     pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
4101     pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
4102     pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
4103 
4104     pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
4105     pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
4106     pub fn utimensat(
4107         dirfd: ::c_int,
4108         path: *const ::c_char,
4109         times: *const ::timespec,
4110         flag: ::c_int,
4111     ) -> ::c_int;
4112     pub fn duplocale(base: ::locale_t) -> ::locale_t;
4113     pub fn freelocale(loc: ::locale_t);
4114     pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
4115     pub fn uselocale(loc: ::locale_t) -> ::locale_t;
4116 
4117     pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
4118 
4119     pub fn mknodat(
4120         dirfd: ::c_int,
4121         pathname: *const ::c_char,
4122         mode: ::mode_t,
4123         dev: dev_t,
4124     ) -> ::c_int;
4125     pub fn pthread_condattr_getclock(
4126         attr: *const pthread_condattr_t,
4127         clock_id: *mut clockid_t,
4128     ) -> ::c_int;
4129     pub fn pthread_condattr_setclock(
4130         attr: *mut pthread_condattr_t,
4131         clock_id: ::clockid_t,
4132     ) -> ::c_int;
4133     pub fn accept4(
4134         fd: ::c_int,
4135         addr: *mut ::sockaddr,
4136         len: *mut ::socklen_t,
4137         flg: ::c_int,
4138     ) -> ::c_int;
4139     pub fn ptsname_r(fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t) -> ::c_int;
4140     pub fn clearenv() -> ::c_int;
4141     pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
4142         -> ::c_int;
4143     pub fn setreuid(ruid: ::uid_t, euid: ::uid_t) -> ::c_int;
4144     pub fn setregid(rgid: ::gid_t, egid: ::gid_t) -> ::c_int;
4145     pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int;
4146     pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int;
4147     pub fn acct(filename: *const ::c_char) -> ::c_int;
4148     pub fn brk(addr: *mut ::c_void) -> ::c_int;
4149     pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
4150     pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
4151     pub fn openpty(
4152         amaster: *mut ::c_int,
4153         aslave: *mut ::c_int,
4154         name: *mut ::c_char,
4155         termp: *const termios,
4156         winp: *const ::winsize,
4157     ) -> ::c_int;
4158     pub fn execvpe(
4159         file: *const ::c_char,
4160         argv: *const *const ::c_char,
4161         envp: *const *const ::c_char,
4162     ) -> ::c_int;
4163     pub fn fexecve(
4164         fd: ::c_int,
4165         argv: *const *const ::c_char,
4166         envp: *const *const ::c_char,
4167     ) -> ::c_int;
4168 
4169     pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
4170 
4171     pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
4172 
4173     pub fn setpwent();
4174     pub fn endpwent();
4175     pub fn getpwent() -> *mut passwd;
4176 
4177     pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;
4178 
4179     // System V IPC
4180     pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
4181     pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
4182     pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
4183     pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
4184     pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
4185     pub fn semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int;
4186     pub fn semop(semid: ::c_int, sops: *mut ::sembuf, nsops: ::size_t) -> ::c_int;
4187     pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
4188     pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
4189     pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
4190     pub fn msgrcv(
4191         msqid: ::c_int,
4192         msgp: *mut ::c_void,
4193         msgsz: ::size_t,
4194         msgtyp: ::c_long,
4195         msgflg: ::c_int,
4196     ) -> ::ssize_t;
4197     pub fn msgsnd(
4198         msqid: ::c_int,
4199         msgp: *const ::c_void,
4200         msgsz: ::size_t,
4201         msgflg: ::c_int,
4202     ) -> ::c_int;
4203 
4204     pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
4205     pub fn __errno_location() -> *mut ::c_int;
4206 
4207     pub fn fallocate(fd: ::c_int, mode: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
4208     pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
4209     pub fn readahead(fd: ::c_int, offset: ::off64_t, count: ::size_t) -> ::ssize_t;
4210     pub fn signalfd(fd: ::c_int, mask: *const ::sigset_t, flags: ::c_int) -> ::c_int;
4211     pub fn timerfd_create(clockid: ::c_int, flags: ::c_int) -> ::c_int;
4212     pub fn timerfd_gettime(fd: ::c_int, curr_value: *mut itimerspec) -> ::c_int;
4213     pub fn timerfd_settime(
4214         fd: ::c_int,
4215         flags: ::c_int,
4216         new_value: *const itimerspec,
4217         old_value: *mut itimerspec,
4218     ) -> ::c_int;
4219     pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
4220         -> ::ssize_t;
4221     pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
4222     pub fn quotactl(
4223         cmd: ::c_int,
4224         special: *const ::c_char,
4225         id: ::c_int,
4226         data: *mut ::c_char,
4227     ) -> ::c_int;
4228     pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int;
4229     pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
4230     pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
4231     pub fn sigtimedwait(
4232         set: *const sigset_t,
4233         info: *mut siginfo_t,
4234         timeout: *const ::timespec,
4235     ) -> ::c_int;
4236     pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
4237     pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
4238     pub fn getnameinfo(
4239         sa: *const ::sockaddr,
4240         salen: ::socklen_t,
4241         host: *mut ::c_char,
4242         hostlen: ::socklen_t,
4243         serv: *mut ::c_char,
4244         servlen: ::socklen_t,
4245         flags: ::c_int,
4246     ) -> ::c_int;
4247     pub fn reboot(how_to: ::c_int) -> ::c_int;
4248     pub fn setfsgid(gid: ::gid_t) -> ::c_int;
4249     pub fn setfsuid(uid: ::uid_t) -> ::c_int;
4250 
4251     // Not available now on Android
4252     pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
4253     pub fn if_nameindex() -> *mut if_nameindex;
4254     pub fn if_freenameindex(ptr: *mut if_nameindex);
4255     pub fn sync_file_range(
4256         fd: ::c_int,
4257         offset: ::off64_t,
4258         nbytes: ::off64_t,
4259         flags: ::c_uint,
4260     ) -> ::c_int;
4261     pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
4262     pub fn freeifaddrs(ifa: *mut ::ifaddrs);
4263 
4264     pub fn glob(
4265         pattern: *const c_char,
4266         flags: ::c_int,
4267         errfunc: ::Option<extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int>,
4268         pglob: *mut ::glob_t,
4269     ) -> ::c_int;
4270     pub fn globfree(pglob: *mut ::glob_t);
4271 
4272     pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
4273 
4274     pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
4275 
4276     pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
4277 
4278     pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
4279     pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
4280 
4281     pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
4282 
4283     pub fn recvfrom(
4284         socket: ::c_int,
4285         buf: *mut ::c_void,
4286         len: ::size_t,
4287         flags: ::c_int,
4288         addr: *mut ::sockaddr,
4289         addrlen: *mut ::socklen_t,
4290     ) -> ::ssize_t;
4291     pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
4292     pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
4293     pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
4294 
4295     pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
4296 
4297     pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
4298     pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
4299 
4300     pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
4301     pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
4302     pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
4303     pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
4304     pub fn vhangup() -> ::c_int;
4305     pub fn sendmmsg(
4306         sockfd: ::c_int,
4307         msgvec: *mut mmsghdr,
4308         vlen: ::c_uint,
4309         flags: ::c_int,
4310     ) -> ::c_int;
4311     pub fn recvmmsg(
4312         sockfd: ::c_int,
4313         msgvec: *mut mmsghdr,
4314         vlen: ::c_uint,
4315         flags: ::c_int,
4316         timeout: *mut ::timespec,
4317     ) -> ::c_int;
4318     pub fn sync();
4319     pub fn syscall(num: ::c_long, ...) -> ::c_long;
4320     pub fn sched_getaffinity(pid: ::pid_t, cpusetsize: ::size_t, cpuset: *mut cpu_set_t)
4321         -> ::c_int;
4322     pub fn sched_setaffinity(
4323         pid: ::pid_t,
4324         cpusetsize: ::size_t,
4325         cpuset: *const cpu_set_t,
4326     ) -> ::c_int;
4327     pub fn umount(target: *const ::c_char) -> ::c_int;
4328     pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
4329     pub fn tee(fd_in: ::c_int, fd_out: ::c_int, len: ::size_t, flags: ::c_uint) -> ::ssize_t;
4330     pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
4331     pub fn splice(
4332         fd_in: ::c_int,
4333         off_in: *mut ::loff_t,
4334         fd_out: ::c_int,
4335         off_out: *mut ::loff_t,
4336         len: ::size_t,
4337         flags: ::c_uint,
4338     ) -> ::ssize_t;
4339     pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
4340     pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
4341     pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
4342     pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
4343     pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
4344     pub fn swapoff(puath: *const ::c_char) -> ::c_int;
4345     pub fn vmsplice(
4346         fd: ::c_int,
4347         iov: *const ::iovec,
4348         nr_segs: ::size_t,
4349         flags: ::c_uint,
4350     ) -> ::ssize_t;
4351     pub fn mount(
4352         src: *const ::c_char,
4353         target: *const ::c_char,
4354         fstype: *const ::c_char,
4355         flags: ::c_ulong,
4356         data: *const ::c_void,
4357     ) -> ::c_int;
4358     pub fn personality(persona: ::c_ulong) -> ::c_int;
4359     pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int;
4360     pub fn ppoll(
4361         fds: *mut ::pollfd,
4362         nfds: nfds_t,
4363         timeout: *const ::timespec,
4364         sigmask: *const sigset_t,
4365     ) -> ::c_int;
4366     pub fn pthread_mutex_timedlock(
4367         lock: *mut pthread_mutex_t,
4368         abstime: *const ::timespec,
4369     ) -> ::c_int;
4370     pub fn clone(
4371         cb: extern "C" fn(*mut ::c_void) -> ::c_int,
4372         child_stack: *mut ::c_void,
4373         flags: ::c_int,
4374         arg: *mut ::c_void,
4375         ...
4376     ) -> ::c_int;
4377     pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
4378     pub fn clock_nanosleep(
4379         clk_id: ::clockid_t,
4380         flags: ::c_int,
4381         rqtp: *const ::timespec,
4382         rmtp: *mut ::timespec,
4383     ) -> ::c_int;
4384     pub fn pthread_attr_getguardsize(
4385         attr: *const ::pthread_attr_t,
4386         guardsize: *mut ::size_t,
4387     ) -> ::c_int;
4388     pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
4389     pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
4390     pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
4391     pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int;
4392     pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int;
4393     pub fn sched_setscheduler(
4394         pid: ::pid_t,
4395         policy: ::c_int,
4396         param: *const ::sched_param,
4397     ) -> ::c_int;
4398     pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
4399     pub fn getgrgid_r(
4400         gid: ::gid_t,
4401         grp: *mut ::group,
4402         buf: *mut ::c_char,
4403         buflen: ::size_t,
4404         result: *mut *mut ::group,
4405     ) -> ::c_int;
4406     pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
4407     pub fn sem_close(sem: *mut sem_t) -> ::c_int;
4408     pub fn getdtablesize() -> ::c_int;
4409     pub fn getgrnam_r(
4410         name: *const ::c_char,
4411         grp: *mut ::group,
4412         buf: *mut ::c_char,
4413         buflen: ::size_t,
4414         result: *mut *mut ::group,
4415     ) -> ::c_int;
4416     pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
4417     pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
4418     pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
4419     pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
4420     pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
4421     pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
4422     pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
4423     pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
4424     pub fn getpwnam_r(
4425         name: *const ::c_char,
4426         pwd: *mut passwd,
4427         buf: *mut ::c_char,
4428         buflen: ::size_t,
4429         result: *mut *mut passwd,
4430     ) -> ::c_int;
4431     pub fn getpwuid_r(
4432         uid: ::uid_t,
4433         pwd: *mut passwd,
4434         buf: *mut ::c_char,
4435         buflen: ::size_t,
4436         result: *mut *mut passwd,
4437     ) -> ::c_int;
4438     pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
4439     pub fn pthread_atfork(
4440         prepare: ::Option<unsafe extern "C" fn()>,
4441         parent: ::Option<unsafe extern "C" fn()>,
4442         child: ::Option<unsafe extern "C" fn()>,
4443     ) -> ::c_int;
4444     pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
4445 
4446     pub fn setgrent();
4447     pub fn endgrent();
4448     pub fn getgrent() -> *mut ::group;
4449 
4450     pub fn getgrouplist(
4451         user: *const ::c_char,
4452         group: ::gid_t,
4453         groups: *mut ::gid_t,
4454         ngroups: *mut ::c_int,
4455     ) -> ::c_int;
4456     pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
4457     pub fn faccessat(
4458         dirfd: ::c_int,
4459         pathname: *const ::c_char,
4460         mode: ::c_int,
4461         flags: ::c_int,
4462     ) -> ::c_int;
4463     pub fn pthread_create(
4464         native: *mut ::pthread_t,
4465         attr: *const ::pthread_attr_t,
4466         f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
4467         value: *mut ::c_void,
4468     ) -> ::c_int;
4469     pub fn dl_iterate_phdr(
4470         callback: ::Option<
4471             unsafe extern "C" fn(
4472                 info: *mut ::dl_phdr_info,
4473                 size: ::size_t,
4474                 data: *mut ::c_void,
4475             ) -> ::c_int,
4476         >,
4477         data: *mut ::c_void,
4478     ) -> ::c_int;
4479 }
4480 
4481 cfg_if! {
4482     if #[cfg(target_arch = "aarch64")] {
4483         mod aarch64;
4484         pub use self::aarch64::*;
4485     } else if #[cfg(any(target_arch = "x86_64"))] {
4486         mod x86_64;
4487         pub use self::x86_64::*;
4488     } else if #[cfg(any(target_arch = "riscv64"))] {
4489         mod riscv64;
4490         pub use self::riscv64::*;
4491     } else {
4492         // Unknown target_arch
4493     }
4494 }
4495