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