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