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