1 pub type sa_family_t = u16;
2 pub type pthread_key_t = ::c_uint;
3 pub type speed_t = ::c_uint;
4 pub type tcflag_t = ::c_uint;
5 pub type loff_t = ::c_longlong;
6 pub type clockid_t = ::c_int;
7 pub type key_t = ::c_int;
8 pub type id_t = ::c_uint;
9 pub type useconds_t = u32;
10 pub type dev_t = u64;
11 pub type socklen_t = u32;
12 pub type mode_t = u32;
13 pub type ino64_t = u64;
14 pub type off64_t = i64;
15 pub type blkcnt64_t = i64;
16 pub type rlim64_t = u64;
17 pub type shmatt_t = ::c_ulong;
18 pub type mqd_t = ::c_int;
19 pub type msgqnum_t = ::c_ulong;
20 pub type msglen_t = ::c_ulong;
21 pub type nfds_t = ::c_ulong;
22 pub type nl_item = ::c_int;
23 pub type idtype_t = ::c_uint;
24 
25 #[cfg_attr(feature = "extra_traits", derive(Debug))]
26 pub enum fpos64_t {} // FIXME: fill this out with a struct
27 impl ::Copy for fpos64_t {}
28 impl ::Clone for fpos64_t {
clone(&self) -> fpos64_t29     fn clone(&self) -> fpos64_t {
30         *self
31     }
32 }
33 
34 #[cfg_attr(feature = "extra_traits", derive(Debug))]
35 pub enum timezone {}
36 impl ::Copy for timezone {}
37 impl ::Clone for timezone {
clone(&self) -> timezone38     fn clone(&self) -> timezone {
39         *self
40     }
41 }
42 
43 s! {
44     pub struct in_addr {
45         pub s_addr: ::in_addr_t,
46     }
47 
48     pub struct ip_mreq {
49         pub imr_multiaddr: in_addr,
50         pub imr_interface: in_addr,
51     }
52 
53     pub struct sockaddr {
54         pub sa_family: sa_family_t,
55         pub sa_data: [::c_char; 14],
56     }
57 
58     pub struct sockaddr_in {
59         pub sin_family: sa_family_t,
60         pub sin_port: ::in_port_t,
61         pub sin_addr: ::in_addr,
62         pub sin_zero: [u8; 8],
63     }
64 
65     pub struct sockaddr_in6 {
66         pub sin6_family: sa_family_t,
67         pub sin6_port: ::in_port_t,
68         pub sin6_flowinfo: u32,
69         pub sin6_addr: ::in6_addr,
70         pub sin6_scope_id: u32,
71     }
72 
73     pub struct addrinfo {
74         pub ai_flags: ::c_int,
75         pub ai_family: ::c_int,
76         pub ai_socktype: ::c_int,
77         pub ai_protocol: ::c_int,
78         pub ai_addrlen: socklen_t,
79 
80         pub ai_addr: *mut ::sockaddr,
81 
82         pub ai_canonname: *mut c_char,
83 
84         pub ai_next: *mut addrinfo,
85     }
86 
87     pub struct sockaddr_ll {
88         pub sll_family: ::c_ushort,
89         pub sll_protocol: ::c_ushort,
90         pub sll_ifindex: ::c_int,
91         pub sll_hatype: ::c_ushort,
92         pub sll_pkttype: ::c_uchar,
93         pub sll_halen: ::c_uchar,
94         pub sll_addr: [::c_uchar; 8]
95     }
96 
97     pub struct fd_set {
98         fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
99     }
100 
101     pub struct tm {
102         pub tm_sec: ::c_int,
103         pub tm_min: ::c_int,
104         pub tm_hour: ::c_int,
105         pub tm_mday: ::c_int,
106         pub tm_mon: ::c_int,
107         pub tm_year: ::c_int,
108         pub tm_wday: ::c_int,
109         pub tm_yday: ::c_int,
110         pub tm_isdst: ::c_int,
111         pub tm_gmtoff: ::c_long,
112         pub tm_zone: *const ::c_char,
113     }
114 
115     pub struct sched_param {
116         pub sched_priority: ::c_int,
117     }
118 
119     pub struct Dl_info {
120         pub dli_fname: *const ::c_char,
121         pub dli_fbase: *mut ::c_void,
122         pub dli_sname: *const ::c_char,
123         pub dli_saddr: *mut ::c_void,
124     }
125 
126     pub struct lconv {
127         pub decimal_point: *mut ::c_char,
128         pub thousands_sep: *mut ::c_char,
129         pub grouping: *mut ::c_char,
130         pub int_curr_symbol: *mut ::c_char,
131         pub currency_symbol: *mut ::c_char,
132         pub mon_decimal_point: *mut ::c_char,
133         pub mon_thousands_sep: *mut ::c_char,
134         pub mon_grouping: *mut ::c_char,
135         pub positive_sign: *mut ::c_char,
136         pub negative_sign: *mut ::c_char,
137         pub int_frac_digits: ::c_char,
138         pub frac_digits: ::c_char,
139         pub p_cs_precedes: ::c_char,
140         pub p_sep_by_space: ::c_char,
141         pub n_cs_precedes: ::c_char,
142         pub n_sep_by_space: ::c_char,
143         pub p_sign_posn: ::c_char,
144         pub n_sign_posn: ::c_char,
145         pub int_p_cs_precedes: ::c_char,
146         pub int_p_sep_by_space: ::c_char,
147         pub int_n_cs_precedes: ::c_char,
148         pub int_n_sep_by_space: ::c_char,
149         pub int_p_sign_posn: ::c_char,
150         pub int_n_sign_posn: ::c_char,
151     }
152 
153     pub struct rlimit64 {
154         pub rlim_cur: rlim64_t,
155         pub rlim_max: rlim64_t,
156     }
157 
158     pub struct glob_t {
159         pub gl_pathc: ::size_t,
160         pub gl_pathv: *mut *mut c_char,
161         pub gl_offs: ::size_t,
162         pub gl_flags: ::c_int,
163 
164         __unused1: *mut ::c_void,
165         __unused2: *mut ::c_void,
166         __unused3: *mut ::c_void,
167         __unused4: *mut ::c_void,
168         __unused5: *mut ::c_void,
169     }
170 
171     pub struct ifaddrs {
172         pub ifa_next: *mut ifaddrs,
173         pub ifa_name: *mut c_char,
174         pub ifa_flags: ::c_uint,
175         pub ifa_addr: *mut ::sockaddr,
176         pub ifa_netmask: *mut ::sockaddr,
177         pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union
178         pub ifa_data: *mut ::c_void
179     }
180 
181     pub struct pthread_rwlockattr_t {
182         __lockkind: ::c_int,
183         __pshared: ::c_int,
184     }
185 
186     pub struct passwd {
187         pub pw_name: *mut ::c_char,
188         pub pw_passwd: *mut ::c_char,
189         pub pw_uid: ::uid_t,
190         pub pw_gid: ::gid_t,
191         pub pw_gecos: *mut ::c_char,
192         pub pw_dir: *mut ::c_char,
193         pub pw_shell: *mut ::c_char,
194     }
195 
196     pub struct spwd {
197         pub sp_namp: *mut ::c_char,
198         pub sp_pwdp: *mut ::c_char,
199         pub sp_lstchg: ::c_long,
200         pub sp_min: ::c_long,
201         pub sp_max: ::c_long,
202         pub sp_warn: ::c_long,
203         pub sp_inact: ::c_long,
204         pub sp_expire: ::c_long,
205         pub sp_flag: ::c_ulong,
206     }
207 
208     pub struct statvfs {
209         pub f_bsize: ::c_ulong,
210         pub f_frsize: ::c_ulong,
211         pub f_blocks: ::fsblkcnt_t,
212         pub f_bfree: ::fsblkcnt_t,
213         pub f_bavail: ::fsblkcnt_t,
214         pub f_files: ::fsfilcnt_t,
215         pub f_ffree: ::fsfilcnt_t,
216         pub f_favail: ::fsfilcnt_t,
217         #[cfg(target_endian = "little")]
218         pub f_fsid: ::c_ulong,
219         #[cfg(target_pointer_width = "32")]
220         __f_unused: ::c_int,
221         #[cfg(target_endian = "big")]
222         pub f_fsid: ::c_ulong,
223         pub f_flag: ::c_ulong,
224         pub f_namemax: ::c_ulong,
225         __f_spare: [::c_int; 6],
226     }
227 
228     pub struct dqblk {
229         pub dqb_bhardlimit: u32,
230         pub dqb_bsoftlimit: u32,
231         pub dqb_curblocks: u32,
232         pub dqb_ihardlimit: u32,
233         pub dqb_isoftlimit: u32,
234         pub dqb_curinodes: u32,
235         pub dqb_btime: ::time_t,
236         pub dqb_itime: ::time_t,
237     }
238 
239     pub struct signalfd_siginfo {
240         pub ssi_signo: u32,
241         pub ssi_errno: i32,
242         pub ssi_code: i32,
243         pub ssi_pid: u32,
244         pub ssi_uid: u32,
245         pub ssi_fd: i32,
246         pub ssi_tid: u32,
247         pub ssi_band: u32,
248         pub ssi_overrun: u32,
249         pub ssi_trapno: u32,
250         pub ssi_status: i32,
251         pub ssi_int: i32,
252         pub ssi_ptr: u64,
253         pub ssi_utime: u64,
254         pub ssi_stime: u64,
255         pub ssi_addr: u64,
256         pub ssi_addr_lsb: u16,
257         _pad2: u16,
258         pub ssi_syscall: i32,
259         pub ssi_call_addr: u64,
260         pub ssi_arch: u32,
261         _pad: [u8; 28],
262     }
263 
264     pub struct fsid_t {
265         __val: [::c_int; 2],
266     }
267 
268     pub struct cpu_set_t {
269         #[cfg(target_pointer_width = "32")]
270         bits: [u32; 32],
271         #[cfg(target_pointer_width = "64")]
272         bits: [u64; 16],
273     }
274 
275     pub struct if_nameindex {
276         pub if_index: ::c_uint,
277         pub if_name: *mut ::c_char,
278     }
279 
280     // System V IPC
281     pub struct msginfo {
282         pub msgpool: ::c_int,
283         pub msgmap: ::c_int,
284         pub msgmax: ::c_int,
285         pub msgmnb: ::c_int,
286         pub msgmni: ::c_int,
287         pub msgssz: ::c_int,
288         pub msgtql: ::c_int,
289         pub msgseg: ::c_ushort,
290     }
291 
292     pub struct ucred {
293         pub pid: ::pid_t,
294         pub uid: ::uid_t,
295         pub gid: ::gid_t,
296     }
297 }
298 
299 s_no_extra_traits! {
300     #[cfg_attr(
301         any(target_arch = "x86", target_arch = "x86_64"),
302         repr(packed)
303     )]
304     #[allow(missing_debug_implementations)]
305     pub struct epoll_event {
306         pub events: u32,
307         pub u64: u64,
308     }
309 
310     #[allow(missing_debug_implementations)]
311     pub struct sockaddr_un {
312         pub sun_family: sa_family_t,
313         pub sun_path: [::c_char; 108]
314     }
315 
316     #[allow(missing_debug_implementations)]
317     pub struct sockaddr_storage {
318         pub ss_family: sa_family_t,
319         __ss_align: ::size_t,
320         #[cfg(target_pointer_width = "32")]
321         __ss_pad2: [u8; 128 - 2 * 4],
322         #[cfg(target_pointer_width = "64")]
323         __ss_pad2: [u8; 128 - 2 * 8],
324     }
325 
326     #[allow(missing_debug_implementations)]
327     pub struct utsname {
328         pub sysname: [::c_char; 65],
329         pub nodename: [::c_char; 65],
330         pub release: [::c_char; 65],
331         pub version: [::c_char; 65],
332         pub machine: [::c_char; 65],
333         pub domainname: [::c_char; 65]
334     }
335 
336     #[allow(missing_debug_implementations)]
337     pub struct dirent {
338         pub d_ino: ::ino_t,
339         pub d_off: ::off_t,
340         pub d_reclen: ::c_ushort,
341         pub d_type: ::c_uchar,
342         pub d_name: [::c_char; 256],
343     }
344 
345     #[allow(missing_debug_implementations)]
346     pub struct dirent64 {
347         pub d_ino: ::ino64_t,
348         pub d_off: ::off64_t,
349         pub d_reclen: ::c_ushort,
350         pub d_type: ::c_uchar,
351         pub d_name: [::c_char; 256],
352     }
353 
354     pub struct mq_attr {
355         pub mq_flags: ::c_long,
356         pub mq_maxmsg: ::c_long,
357         pub mq_msgsize: ::c_long,
358         pub mq_curmsgs: ::c_long,
359         pad: [::c_long; 4]
360     }
361 
362     pub struct sockaddr_nl {
363         pub nl_family: ::sa_family_t,
364         nl_pad: ::c_ushort,
365         pub nl_pid: u32,
366         pub nl_groups: u32
367     }
368 
369     pub struct sigevent {
370         pub sigev_value: ::sigval,
371         pub sigev_signo: ::c_int,
372         pub sigev_notify: ::c_int,
373         // Actually a union.  We only expose sigev_notify_thread_id because it's
374         // the most useful member
375         pub sigev_notify_thread_id: ::c_int,
376         #[cfg(target_pointer_width = "64")]
377         __unused1: [::c_int; 11],
378         #[cfg(target_pointer_width = "32")]
379         __unused1: [::c_int; 12]
380     }
381 }
382 
383 cfg_if! {
384     if #[cfg(feature = "extra_traits")] {
385         impl PartialEq for mq_attr {
386             fn eq(&self, other: &mq_attr) -> bool {
387                 self.mq_flags == other.mq_flags &&
388                 self.mq_maxmsg == other.mq_maxmsg &&
389                 self.mq_msgsize == other.mq_msgsize &&
390                 self.mq_curmsgs == other.mq_curmsgs
391             }
392         }
393         impl Eq for mq_attr {}
394         impl ::fmt::Debug for mq_attr {
395             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
396                 f.debug_struct("mq_attr")
397                     .field("mq_flags", &self.mq_flags)
398                     .field("mq_maxmsg", &self.mq_maxmsg)
399                     .field("mq_msgsize", &self.mq_msgsize)
400                     .field("mq_curmsgs", &self.mq_curmsgs)
401                     .finish()
402             }
403         }
404         impl ::hash::Hash for mq_attr {
405             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
406                 self.mq_flags.hash(state);
407                 self.mq_maxmsg.hash(state);
408                 self.mq_msgsize.hash(state);
409                 self.mq_curmsgs.hash(state);
410             }
411         }
412 
413         impl PartialEq for sockaddr_nl {
414             fn eq(&self, other: &sockaddr_nl) -> bool {
415                 self.nl_family == other.nl_family &&
416                 self.nl_pid == other.nl_pid &&
417                 self.nl_groups == other.nl_groups
418             }
419         }
420         impl Eq for sockaddr_nl {}
421         impl ::fmt::Debug for sockaddr_nl {
422             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
423                 f.debug_struct("sockaddr_nl")
424                     .field("nl_family", &self.nl_family)
425                     .field("nl_pid", &self.nl_pid)
426                     .field("nl_groups", &self.nl_groups)
427                     .finish()
428             }
429         }
430         impl ::hash::Hash for sockaddr_nl {
431             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
432                 self.nl_family.hash(state);
433                 self.nl_pid.hash(state);
434                 self.nl_groups.hash(state);
435             }
436         }
437 
438         impl PartialEq for sigevent {
439             fn eq(&self, other: &sigevent) -> bool {
440                 self.sigev_value == other.sigev_value
441                     && self.sigev_signo == other.sigev_signo
442                     && self.sigev_notify == other.sigev_notify
443                     && self.sigev_notify_thread_id
444                         == other.sigev_notify_thread_id
445             }
446         }
447         impl Eq for sigevent {}
448         impl ::fmt::Debug for sigevent {
449             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
450                 f.debug_struct("sigevent")
451                     .field("sigev_value", &self.sigev_value)
452                     .field("sigev_signo", &self.sigev_signo)
453                     .field("sigev_notify", &self.sigev_notify)
454                     .field("sigev_notify_thread_id",
455                            &self.sigev_notify_thread_id)
456                     .finish()
457             }
458         }
459         impl ::hash::Hash for sigevent {
460             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
461                 self.sigev_value.hash(state);
462                 self.sigev_signo.hash(state);
463                 self.sigev_notify.hash(state);
464                 self.sigev_notify_thread_id.hash(state);
465             }
466         }
467     }
468 }
469 
470 // intentionally not public, only used for fd_set
471 cfg_if! {
472     if #[cfg(target_pointer_width = "32")] {
473         const ULONG_SIZE: usize = 32;
474     } else if #[cfg(target_pointer_width = "64")] {
475         const ULONG_SIZE: usize = 64;
476     } else {
477         // Unknown target_pointer_width
478     }
479 }
480 
481 pub const EXIT_FAILURE: ::c_int = 1;
482 pub const EXIT_SUCCESS: ::c_int = 0;
483 pub const RAND_MAX: ::c_int = 2147483647;
484 pub const EOF: ::c_int = -1;
485 pub const SEEK_SET: ::c_int = 0;
486 pub const SEEK_CUR: ::c_int = 1;
487 pub const SEEK_END: ::c_int = 2;
488 pub const _IOFBF: ::c_int = 0;
489 pub const _IONBF: ::c_int = 2;
490 pub const _IOLBF: ::c_int = 1;
491 
492 pub const F_DUPFD: ::c_int = 0;
493 pub const F_GETFD: ::c_int = 1;
494 pub const F_SETFD: ::c_int = 2;
495 pub const F_GETFL: ::c_int = 3;
496 pub const F_SETFL: ::c_int = 4;
497 
498 // Linux-specific fcntls
499 pub const F_SETLEASE: ::c_int = 1024;
500 pub const F_GETLEASE: ::c_int = 1025;
501 pub const F_NOTIFY: ::c_int = 1026;
502 pub const F_DUPFD_CLOEXEC: ::c_int = 1030;
503 
504 // FIXME(#235): Include file sealing fcntls once we have a way to verify them.
505 
506 pub const SIGTRAP: ::c_int = 5;
507 
508 pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
509 pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
510 
511 pub const CLOCK_REALTIME: ::clockid_t = 0;
512 pub const CLOCK_MONOTONIC: ::clockid_t = 1;
513 pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
514 pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 3;
515 // FIXME: Add these constants once uclibc gets them.
516 // pub const CLOCK_SGI_CYCLE: ::clockid_t = 10;
517 // pub const CLOCK_TAI: ::clockid_t = 11;
518 pub const TIMER_ABSTIME: ::c_int = 1;
519 
520 pub const RLIMIT_CPU: ::c_int = 0;
521 pub const RLIMIT_FSIZE: ::c_int = 1;
522 pub const RLIMIT_DATA: ::c_int = 2;
523 pub const RLIMIT_STACK: ::c_int = 3;
524 pub const RLIMIT_CORE: ::c_int = 4;
525 pub const RLIMIT_LOCKS: ::c_int = 10;
526 pub const RLIMIT_SIGPENDING: ::c_int = 11;
527 pub const RLIMIT_MSGQUEUE: ::c_int = 12;
528 pub const RLIMIT_NICE: ::c_int = 13;
529 pub const RLIMIT_RTPRIO: ::c_int = 14;
530 
531 pub const RUSAGE_SELF: ::c_int = 0;
532 
533 pub const O_RDONLY: ::c_int = 0;
534 pub const O_WRONLY: ::c_int = 1;
535 pub const O_RDWR: ::c_int = 2;
536 
537 pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC;
538 
539 pub const S_IFIFO: ::mode_t = 4096;
540 pub const S_IFCHR: ::mode_t = 8192;
541 pub const S_IFBLK: ::mode_t = 24576;
542 pub const S_IFDIR: ::mode_t = 16384;
543 pub const S_IFREG: ::mode_t = 32768;
544 pub const S_IFLNK: ::mode_t = 40960;
545 pub const S_IFSOCK: ::mode_t = 49152;
546 pub const S_IFMT: ::mode_t = 61440;
547 pub const S_IRWXU: ::mode_t = 448;
548 pub const S_IXUSR: ::mode_t = 64;
549 pub const S_IWUSR: ::mode_t = 128;
550 pub const S_IRUSR: ::mode_t = 256;
551 pub const S_IRWXG: ::mode_t = 56;
552 pub const S_IXGRP: ::mode_t = 8;
553 pub const S_IWGRP: ::mode_t = 16;
554 pub const S_IRGRP: ::mode_t = 32;
555 pub const S_IRWXO: ::mode_t = 7;
556 pub const S_IXOTH: ::mode_t = 1;
557 pub const S_IWOTH: ::mode_t = 2;
558 pub const S_IROTH: ::mode_t = 4;
559 pub const F_OK: ::c_int = 0;
560 pub const R_OK: ::c_int = 4;
561 pub const W_OK: ::c_int = 2;
562 pub const X_OK: ::c_int = 1;
563 pub const STDIN_FILENO: ::c_int = 0;
564 pub const STDOUT_FILENO: ::c_int = 1;
565 pub const STDERR_FILENO: ::c_int = 2;
566 pub const SIGHUP: ::c_int = 1;
567 pub const SIGINT: ::c_int = 2;
568 pub const SIGQUIT: ::c_int = 3;
569 pub const SIGILL: ::c_int = 4;
570 pub const SIGABRT: ::c_int = 6;
571 pub const SIGFPE: ::c_int = 8;
572 pub const SIGKILL: ::c_int = 9;
573 pub const SIGSEGV: ::c_int = 11;
574 pub const SIGPIPE: ::c_int = 13;
575 pub const SIGALRM: ::c_int = 14;
576 pub const SIGTERM: ::c_int = 15;
577 
578 pub const PROT_NONE: ::c_int = 0;
579 pub const PROT_READ: ::c_int = 1;
580 pub const PROT_WRITE: ::c_int = 2;
581 pub const PROT_EXEC: ::c_int = 4;
582 
583 pub const LC_CTYPE: ::c_int = 0;
584 pub const LC_NUMERIC: ::c_int = 1;
585 pub const LC_MONETARY: ::c_int = 2;
586 pub const LC_TIME: ::c_int = 3;
587 pub const LC_COLLATE: ::c_int = 4;
588 pub const LC_MESSAGES: ::c_int = 5;
589 pub const LC_ALL: ::c_int = 6;
590 pub const LC_CTYPE_MASK: ::c_int = 1 << LC_CTYPE;
591 pub const LC_NUMERIC_MASK: ::c_int = 1 << LC_NUMERIC;
592 pub const LC_TIME_MASK: ::c_int = 1 << LC_TIME;
593 pub const LC_COLLATE_MASK: ::c_int = 1 << LC_COLLATE;
594 pub const LC_MONETARY_MASK: ::c_int = 1 << LC_MONETARY;
595 pub const LC_MESSAGES_MASK: ::c_int = 1 << LC_MESSAGES;
596 // LC_ALL_MASK defined per platform
597 
598 pub const MAP_FILE: ::c_int = 0x0000;
599 pub const MAP_SHARED: ::c_int = 0x0001;
600 pub const MAP_PRIVATE: ::c_int = 0x0002;
601 pub const MAP_FIXED: ::c_int = 0x0010;
602 
603 pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
604 
605 // MS_ flags for msync(2)
606 pub const MS_ASYNC: ::c_int = 0x0001;
607 pub const MS_INVALIDATE: ::c_int = 0x0002;
608 pub const MS_SYNC: ::c_int = 0x0004;
609 
610 // MS_ flags for mount(2)
611 pub const MS_RDONLY: ::c_ulong = 0x01;
612 pub const MS_NOSUID: ::c_ulong = 0x02;
613 pub const MS_NODEV: ::c_ulong = 0x04;
614 pub const MS_NOEXEC: ::c_ulong = 0x08;
615 pub const MS_SYNCHRONOUS: ::c_ulong = 0x10;
616 pub const MS_REMOUNT: ::c_ulong = 0x20;
617 pub const MS_MANDLOCK: ::c_ulong = 0x40;
618 pub const MS_NOATIME: ::c_ulong = 0x0400;
619 pub const MS_NODIRATIME: ::c_ulong = 0x0800;
620 pub const MS_BIND: ::c_ulong = 0x1000;
621 pub const MS_NOUSER: ::c_ulong = 0x80000000;
622 pub const MS_MGC_VAL: ::c_ulong = 0xc0ed0000;
623 pub const MS_MGC_MSK: ::c_ulong = 0xffff0000;
624 pub const MS_RMT_MASK: ::c_ulong = 0x800051;
625 
626 pub const EPERM: ::c_int = 1;
627 pub const ENOENT: ::c_int = 2;
628 pub const ESRCH: ::c_int = 3;
629 pub const EINTR: ::c_int = 4;
630 pub const EIO: ::c_int = 5;
631 pub const ENXIO: ::c_int = 6;
632 pub const E2BIG: ::c_int = 7;
633 pub const ENOEXEC: ::c_int = 8;
634 pub const EBADF: ::c_int = 9;
635 pub const ECHILD: ::c_int = 10;
636 pub const EAGAIN: ::c_int = 11;
637 pub const ENOMEM: ::c_int = 12;
638 pub const EACCES: ::c_int = 13;
639 pub const EFAULT: ::c_int = 14;
640 pub const ENOTBLK: ::c_int = 15;
641 pub const EBUSY: ::c_int = 16;
642 pub const EEXIST: ::c_int = 17;
643 pub const EXDEV: ::c_int = 18;
644 pub const ENODEV: ::c_int = 19;
645 pub const ENOTDIR: ::c_int = 20;
646 pub const EISDIR: ::c_int = 21;
647 pub const EINVAL: ::c_int = 22;
648 pub const ENFILE: ::c_int = 23;
649 pub const EMFILE: ::c_int = 24;
650 pub const ENOTTY: ::c_int = 25;
651 pub const ETXTBSY: ::c_int = 26;
652 pub const EFBIG: ::c_int = 27;
653 pub const ENOSPC: ::c_int = 28;
654 pub const ESPIPE: ::c_int = 29;
655 pub const EROFS: ::c_int = 30;
656 pub const EMLINK: ::c_int = 31;
657 pub const EPIPE: ::c_int = 32;
658 pub const EDOM: ::c_int = 33;
659 pub const ERANGE: ::c_int = 34;
660 pub const EWOULDBLOCK: ::c_int = EAGAIN;
661 
662 pub const SCM_RIGHTS: ::c_int = 0x01;
663 pub const SCM_CREDENTIALS: ::c_int = 0x02;
664 
665 // netinet/in.h
666 // NOTE: These are in addition to the constants defined in src/unix/mod.rs
667 
668 // IPPROTO_IP defined in src/unix/mod.rs
669 /// Hop-by-hop option header
670 pub const IPPROTO_HOPOPTS: ::c_int = 0;
671 // IPPROTO_ICMP defined in src/unix/mod.rs
672 /// group mgmt protocol
673 pub const IPPROTO_IGMP: ::c_int = 2;
674 /// for compatibility
675 pub const IPPROTO_IPIP: ::c_int = 4;
676 // IPPROTO_TCP defined in src/unix/mod.rs
677 /// exterior gateway protocol
678 pub const IPPROTO_EGP: ::c_int = 8;
679 /// pup
680 pub const IPPROTO_PUP: ::c_int = 12;
681 // IPPROTO_UDP defined in src/unix/mod.rs
682 /// xns idp
683 pub const IPPROTO_IDP: ::c_int = 22;
684 /// tp-4 w/ class negotiation
685 pub const IPPROTO_TP: ::c_int = 29;
686 /// DCCP
687 pub const IPPROTO_DCCP: ::c_int = 33;
688 // IPPROTO_IPV6 defined in src/unix/mod.rs
689 /// IP6 routing header
690 pub const IPPROTO_ROUTING: ::c_int = 43;
691 /// IP6 fragmentation header
692 pub const IPPROTO_FRAGMENT: ::c_int = 44;
693 /// resource reservation
694 pub const IPPROTO_RSVP: ::c_int = 46;
695 /// General Routing Encap.
696 pub const IPPROTO_GRE: ::c_int = 47;
697 /// IP6 Encap Sec. Payload
698 pub const IPPROTO_ESP: ::c_int = 50;
699 /// IP6 Auth Header
700 pub const IPPROTO_AH: ::c_int = 51;
701 // IPPROTO_ICMPV6 defined in src/unix/mod.rs
702 /// IP6 no next header
703 pub const IPPROTO_NONE: ::c_int = 59;
704 /// IP6 destination option
705 pub const IPPROTO_DSTOPTS: ::c_int = 60;
706 pub const IPPROTO_MTP: ::c_int = 92;
707 pub const IPPROTO_BEETPH: ::c_int = 94;
708 /// encapsulation header
709 pub const IPPROTO_ENCAP: ::c_int = 98;
710 /// Protocol indep. multicast
711 pub const IPPROTO_PIM: ::c_int = 103;
712 /// IP Payload Comp. Protocol
713 pub const IPPROTO_COMP: ::c_int = 108;
714 /// SCTP
715 pub const IPPROTO_SCTP: ::c_int = 132;
716 pub const IPPROTO_MH: ::c_int = 135;
717 pub const IPPROTO_UDPLITE: ::c_int = 136;
718 pub const IPPROTO_MPLS: ::c_int = 137;
719 /// raw IP packet
720 pub const IPPROTO_RAW: ::c_int = 255;
721 pub const IPPROTO_MAX: ::c_int = 256;
722 
723 pub const PROT_GROWSDOWN: ::c_int = 0x1000000;
724 pub const PROT_GROWSUP: ::c_int = 0x2000000;
725 
726 pub const MAP_TYPE: ::c_int = 0x000f;
727 
728 pub const MADV_NORMAL: ::c_int = 0;
729 pub const MADV_RANDOM: ::c_int = 1;
730 pub const MADV_SEQUENTIAL: ::c_int = 2;
731 pub const MADV_WILLNEED: ::c_int = 3;
732 pub const MADV_DONTNEED: ::c_int = 4;
733 pub const MADV_REMOVE: ::c_int = 9;
734 pub const MADV_DONTFORK: ::c_int = 10;
735 pub const MADV_DOFORK: ::c_int = 11;
736 pub const MADV_MERGEABLE: ::c_int = 12;
737 pub const MADV_UNMERGEABLE: ::c_int = 13;
738 pub const MADV_HWPOISON: ::c_int = 100;
739 
740 // https://github.com/kraj/uClibc/blob/master/include/net/if.h#L44
741 pub const IFF_UP: ::c_int = 0x1; // Interface is up.
742 pub const IFF_BROADCAST: ::c_int = 0x2; // Broadcast address valid.
743 pub const IFF_DEBUG: ::c_int = 0x4; // Turn on debugging.
744 pub const IFF_LOOPBACK: ::c_int = 0x8; // Is a loopback net.
745 pub const IFF_POINTOPOINT: ::c_int = 0x10; // Interface is point-to-point link.
746 pub const IFF_NOTRAILERS: ::c_int = 0x20; // Avoid use of trailers.
747 pub const IFF_RUNNING: ::c_int = 0x40; // Resources allocated.
748 pub const IFF_NOARP: ::c_int = 0x80; // No address resolution protocol.
749 pub const IFF_PROMISC: ::c_int = 0x100; // Receive all packets.
750 
751 // Not supported
752 pub const IFF_ALLMULTI: ::c_int = 0x200; // Receive all multicast packets.
753 pub const IFF_MASTER: ::c_int = 0x400; // Master of a load balancer.
754 pub const IFF_SLAVE: ::c_int = 0x800; // Slave of a load balancer.
755 pub const IFF_MULTICAST: ::c_int = 0x1000; // Supports multicast.
756 pub const IFF_PORTSEL: ::c_int = 0x2000; // Can set media type.
757 pub const IFF_AUTOMEDIA: ::c_int = 0x4000; // Auto media select active.
758 
759 // Dialup device with changing addresses.
760 pub const IFF_DYNAMIC: ::c_int = 0x8000;
761 
762 pub const SOL_IP: ::c_int = 0;
763 pub const SOL_TCP: ::c_int = 6;
764 pub const SOL_IPV6: ::c_int = 41;
765 pub const SOL_ICMPV6: ::c_int = 58;
766 pub const SOL_RAW: ::c_int = 255;
767 pub const SOL_DECNET: ::c_int = 261;
768 pub const SOL_X25: ::c_int = 262;
769 pub const SOL_PACKET: ::c_int = 263;
770 pub const SOL_ATM: ::c_int = 264;
771 pub const SOL_AAL: ::c_int = 265;
772 pub const SOL_IRDA: ::c_int = 266;
773 
774 pub const AF_UNSPEC: ::c_int = 0;
775 pub const AF_UNIX: ::c_int = 1;
776 pub const AF_LOCAL: ::c_int = 1;
777 pub const AF_INET: ::c_int = 2;
778 pub const AF_AX25: ::c_int = 3;
779 pub const AF_IPX: ::c_int = 4;
780 pub const AF_APPLETALK: ::c_int = 5;
781 pub const AF_NETROM: ::c_int = 6;
782 pub const AF_BRIDGE: ::c_int = 7;
783 pub const AF_ATMPVC: ::c_int = 8;
784 pub const AF_X25: ::c_int = 9;
785 pub const AF_INET6: ::c_int = 10;
786 pub const AF_ROSE: ::c_int = 11;
787 pub const AF_DECnet: ::c_int = 12;
788 pub const AF_NETBEUI: ::c_int = 13;
789 pub const AF_SECURITY: ::c_int = 14;
790 pub const AF_KEY: ::c_int = 15;
791 pub const AF_NETLINK: ::c_int = 16;
792 pub const AF_ROUTE: ::c_int = AF_NETLINK;
793 pub const AF_PACKET: ::c_int = 17;
794 pub const AF_ASH: ::c_int = 18;
795 pub const AF_ECONET: ::c_int = 19;
796 pub const AF_ATMSVC: ::c_int = 20;
797 pub const AF_SNA: ::c_int = 22;
798 pub const AF_IRDA: ::c_int = 23;
799 pub const AF_PPPOX: ::c_int = 24;
800 pub const AF_WANPIPE: ::c_int = 25;
801 pub const AF_LLC: ::c_int = 26;
802 pub const AF_CAN: ::c_int = 29;
803 pub const AF_TIPC: ::c_int = 30;
804 pub const AF_BLUETOOTH: ::c_int = 31;
805 pub const AF_IUCV: ::c_int = 32;
806 pub const AF_RXRPC: ::c_int = 33;
807 pub const AF_ISDN: ::c_int = 34;
808 pub const AF_PHONET: ::c_int = 35;
809 pub const AF_IEEE802154: ::c_int = 36;
810 pub const AF_CAIF: ::c_int = 37;
811 pub const AF_ALG: ::c_int = 38;
812 
813 pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
814 pub const PF_UNIX: ::c_int = AF_UNIX;
815 pub const PF_LOCAL: ::c_int = AF_LOCAL;
816 pub const PF_INET: ::c_int = AF_INET;
817 pub const PF_AX25: ::c_int = AF_AX25;
818 pub const PF_IPX: ::c_int = AF_IPX;
819 pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
820 pub const PF_NETROM: ::c_int = AF_NETROM;
821 pub const PF_BRIDGE: ::c_int = AF_BRIDGE;
822 pub const PF_ATMPVC: ::c_int = AF_ATMPVC;
823 pub const PF_X25: ::c_int = AF_X25;
824 pub const PF_INET6: ::c_int = AF_INET6;
825 pub const PF_ROSE: ::c_int = AF_ROSE;
826 pub const PF_DECnet: ::c_int = AF_DECnet;
827 pub const PF_NETBEUI: ::c_int = AF_NETBEUI;
828 pub const PF_SECURITY: ::c_int = AF_SECURITY;
829 pub const PF_KEY: ::c_int = AF_KEY;
830 pub const PF_NETLINK: ::c_int = AF_NETLINK;
831 pub const PF_ROUTE: ::c_int = AF_ROUTE;
832 pub const PF_PACKET: ::c_int = AF_PACKET;
833 pub const PF_ASH: ::c_int = AF_ASH;
834 pub const PF_ECONET: ::c_int = AF_ECONET;
835 pub const PF_ATMSVC: ::c_int = AF_ATMSVC;
836 pub const PF_SNA: ::c_int = AF_SNA;
837 pub const PF_IRDA: ::c_int = AF_IRDA;
838 pub const PF_PPPOX: ::c_int = AF_PPPOX;
839 pub const PF_WANPIPE: ::c_int = AF_WANPIPE;
840 pub const PF_LLC: ::c_int = AF_LLC;
841 pub const PF_CAN: ::c_int = AF_CAN;
842 pub const PF_TIPC: ::c_int = AF_TIPC;
843 pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
844 pub const PF_IUCV: ::c_int = AF_IUCV;
845 pub const PF_RXRPC: ::c_int = AF_RXRPC;
846 pub const PF_ISDN: ::c_int = AF_ISDN;
847 pub const PF_PHONET: ::c_int = AF_PHONET;
848 pub const PF_IEEE802154: ::c_int = AF_IEEE802154;
849 pub const PF_CAIF: ::c_int = AF_CAIF;
850 pub const PF_ALG: ::c_int = AF_ALG;
851 
852 pub const SOMAXCONN: ::c_int = 128;
853 
854 pub const MSG_OOB: ::c_int = 1;
855 pub const MSG_PEEK: ::c_int = 2;
856 pub const MSG_DONTROUTE: ::c_int = 4;
857 pub const MSG_CTRUNC: ::c_int = 8;
858 pub const MSG_TRUNC: ::c_int = 0x20;
859 pub const MSG_DONTWAIT: ::c_int = 0x40;
860 pub const MSG_EOR: ::c_int = 0x80;
861 pub const MSG_WAITALL: ::c_int = 0x100;
862 pub const MSG_FIN: ::c_int = 0x200;
863 pub const MSG_SYN: ::c_int = 0x400;
864 pub const MSG_CONFIRM: ::c_int = 0x800;
865 pub const MSG_RST: ::c_int = 0x1000;
866 pub const MSG_ERRQUEUE: ::c_int = 0x2000;
867 pub const MSG_NOSIGNAL: ::c_int = 0x4000;
868 pub const MSG_MORE: ::c_int = 0x8000;
869 pub const MSG_WAITFORONE: ::c_int = 0x10000;
870 pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000;
871 
872 pub const SOCK_RAW: ::c_int = 3;
873 pub const SOCK_RDM: ::c_int = 4;
874 pub const IP_MULTICAST_TTL: ::c_int = 33;
875 pub const IP_MULTICAST_LOOP: ::c_int = 34;
876 pub const IP_TTL: ::c_int = 2;
877 pub const IP_HDRINCL: ::c_int = 3;
878 pub const IP_ADD_MEMBERSHIP: ::c_int = 35;
879 pub const IP_DROP_MEMBERSHIP: ::c_int = 36;
880 pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20;
881 pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21;
882 
883 pub const IPV6_JOIN_GROUP: ::c_int = 20;
884 pub const IPV6_LEAVE_GROUP: ::c_int = 21;
885 
886 pub const TCP_NODELAY: ::c_int = 1;
887 pub const TCP_MAXSEG: ::c_int = 2;
888 pub const TCP_CORK: ::c_int = 3;
889 pub const TCP_KEEPIDLE: ::c_int = 4;
890 pub const TCP_KEEPINTVL: ::c_int = 5;
891 pub const TCP_KEEPCNT: ::c_int = 6;
892 pub const TCP_SYNCNT: ::c_int = 7;
893 pub const TCP_LINGER2: ::c_int = 8;
894 pub const TCP_DEFER_ACCEPT: ::c_int = 9;
895 pub const TCP_WINDOW_CLAMP: ::c_int = 10;
896 pub const TCP_INFO: ::c_int = 11;
897 pub const TCP_QUICKACK: ::c_int = 12;
898 pub const TCP_CONGESTION: ::c_int = 13;
899 
900 // Source:
901 // https://github.com/kraj/uClibc/blob/ca1c74d67dd115d059a875150e10b8560a9c35a8
902 // /libc/sysdeps/linux/common/bits/in.h
903 // Same for all architectures
904 pub const IPV6_MULTICAST_HOPS: ::c_int = 18;
905 pub const IP_MULTICAST_IF: ::c_int = 32;
906 pub const IPV6_MULTICAST_IF: ::c_int = 17;
907 pub const IPV6_UNICAST_HOPS: ::c_int = 16;
908 
909 // Source:
910 // https://github.com/kraj/uClibc/tree/ca1c74d67dd115d059a875150e10b8560a9c35a8
911 // Same for all architectures
912 pub const FUTEX_WAIT: ::c_int = 0;
913 pub const FUTEX_PRIVATE_FLAG: ::c_int = 128;
914 pub const FUTEX_WAKE: ::c_int = 1;
915 
916 pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
917 pub const IPV6_V6ONLY: ::c_int = 26;
918 
919 pub const SO_DEBUG: ::c_int = 1;
920 
921 pub const SHUT_RD: ::c_int = 0;
922 pub const SHUT_WR: ::c_int = 1;
923 pub const SHUT_RDWR: ::c_int = 2;
924 
925 pub const LOCK_SH: ::c_int = 1;
926 pub const LOCK_EX: ::c_int = 2;
927 pub const LOCK_NB: ::c_int = 4;
928 pub const LOCK_UN: ::c_int = 8;
929 
930 pub const SS_ONSTACK: ::c_int = 1;
931 pub const SS_DISABLE: ::c_int = 2;
932 
933 pub const PATH_MAX: ::c_int = 4096;
934 
935 pub const FD_SETSIZE: usize = 1024;
936 
937 pub const EPOLLIN: ::c_int = 0x1;
938 pub const EPOLLPRI: ::c_int = 0x2;
939 pub const EPOLLOUT: ::c_int = 0x4;
940 pub const EPOLLRDNORM: ::c_int = 0x40;
941 pub const EPOLLRDBAND: ::c_int = 0x80;
942 pub const EPOLLWRNORM: ::c_int = 0x100;
943 pub const EPOLLWRBAND: ::c_int = 0x200;
944 pub const EPOLLMSG: ::c_int = 0x400;
945 pub const EPOLLERR: ::c_int = 0x8;
946 pub const EPOLLHUP: ::c_int = 0x10;
947 pub const EPOLLET: ::c_int = 0x80000000;
948 
949 pub const EPOLL_CTL_ADD: ::c_int = 1;
950 pub const EPOLL_CTL_MOD: ::c_int = 3;
951 pub const EPOLL_CTL_DEL: ::c_int = 2;
952 
953 pub const MNT_DETACH: ::c_int = 0x2;
954 pub const MNT_EXPIRE: ::c_int = 0x4;
955 
956 pub const MNT_FORCE: ::c_int = 0x1;
957 
958 pub const Q_SYNC: ::c_int = 0x600;
959 pub const Q_QUOTAON: ::c_int = 0x100;
960 pub const Q_QUOTAOFF: ::c_int = 0x200;
961 pub const Q_GETQUOTA: ::c_int = 0x300;
962 pub const Q_SETQUOTA: ::c_int = 0x400;
963 
964 pub const TCIOFF: ::c_int = 2;
965 pub const TCION: ::c_int = 3;
966 pub const TCOOFF: ::c_int = 0;
967 pub const TCOON: ::c_int = 1;
968 pub const TCIFLUSH: ::c_int = 0;
969 pub const TCOFLUSH: ::c_int = 1;
970 pub const TCIOFLUSH: ::c_int = 2;
971 pub const NL0: ::tcflag_t = 0x00000000;
972 pub const NL1: ::tcflag_t = 0x00000100;
973 pub const TAB0: ::tcflag_t = 0x00000000;
974 pub const CR0: ::tcflag_t = 0x00000000;
975 pub const FF0: ::tcflag_t = 0x00000000;
976 pub const BS0: ::tcflag_t = 0x00000000;
977 pub const VT0: ::tcflag_t = 0x00000000;
978 pub const VERASE: usize = 2;
979 pub const VKILL: usize = 3;
980 pub const VINTR: usize = 0;
981 pub const VQUIT: usize = 1;
982 pub const VLNEXT: usize = 15;
983 pub const IGNBRK: ::tcflag_t = 0x00000001;
984 pub const BRKINT: ::tcflag_t = 0x00000002;
985 pub const IGNPAR: ::tcflag_t = 0x00000004;
986 pub const PARMRK: ::tcflag_t = 0x00000008;
987 pub const INPCK: ::tcflag_t = 0x00000010;
988 pub const ISTRIP: ::tcflag_t = 0x00000020;
989 pub const INLCR: ::tcflag_t = 0x00000040;
990 pub const IGNCR: ::tcflag_t = 0x00000080;
991 pub const ICRNL: ::tcflag_t = 0x00000100;
992 pub const IXANY: ::tcflag_t = 0x00000800;
993 pub const IMAXBEL: ::tcflag_t = 0x00002000;
994 pub const OPOST: ::tcflag_t = 0x1;
995 pub const CS5: ::tcflag_t = 0x00000000;
996 pub const CRTSCTS: ::tcflag_t = 0x80000000;
997 pub const ECHO: ::tcflag_t = 0x00000008;
998 
999 pub const CLONE_VM: ::c_int = 0x100;
1000 pub const CLONE_FS: ::c_int = 0x200;
1001 pub const CLONE_FILES: ::c_int = 0x400;
1002 pub const CLONE_SIGHAND: ::c_int = 0x800;
1003 pub const CLONE_PTRACE: ::c_int = 0x2000;
1004 pub const CLONE_VFORK: ::c_int = 0x4000;
1005 pub const CLONE_PARENT: ::c_int = 0x8000;
1006 pub const CLONE_THREAD: ::c_int = 0x10000;
1007 pub const CLONE_NEWNS: ::c_int = 0x20000;
1008 pub const CLONE_SYSVSEM: ::c_int = 0x40000;
1009 pub const CLONE_SETTLS: ::c_int = 0x80000;
1010 pub const CLONE_PARENT_SETTID: ::c_int = 0x100000;
1011 pub const CLONE_CHILD_CLEARTID: ::c_int = 0x200000;
1012 pub const CLONE_DETACHED: ::c_int = 0x400000;
1013 pub const CLONE_UNTRACED: ::c_int = 0x800000;
1014 pub const CLONE_CHILD_SETTID: ::c_int = 0x01000000;
1015 pub const CLONE_NEWUTS: ::c_int = 0x04000000;
1016 pub const CLONE_NEWIPC: ::c_int = 0x08000000;
1017 pub const CLONE_NEWUSER: ::c_int = 0x10000000;
1018 pub const CLONE_NEWPID: ::c_int = 0x20000000;
1019 pub const CLONE_NEWNET: ::c_int = 0x40000000;
1020 pub const CLONE_IO: ::c_int = 0x80000000;
1021 
1022 pub const WNOHANG: ::c_int = 0x00000001;
1023 pub const WUNTRACED: ::c_int = 0x00000002;
1024 pub const WSTOPPED: ::c_int = WUNTRACED;
1025 pub const WEXITED: ::c_int = 0x00000004;
1026 pub const WCONTINUED: ::c_int = 0x00000008;
1027 pub const WNOWAIT: ::c_int = 0x01000000;
1028 
1029 pub const __WNOTHREAD: ::c_int = 0x20000000;
1030 pub const __WALL: ::c_int = 0x40000000;
1031 pub const __WCLONE: ::c_int = 0x80000000;
1032 
1033 pub const SPLICE_F_MOVE: ::c_uint = 0x01;
1034 pub const SPLICE_F_NONBLOCK: ::c_uint = 0x02;
1035 pub const SPLICE_F_MORE: ::c_uint = 0x04;
1036 pub const SPLICE_F_GIFT: ::c_uint = 0x08;
1037 
1038 pub const RTLD_LOCAL: ::c_int = 0;
1039 pub const RTLD_LAZY: ::c_int = 1;
1040 
1041 pub const POSIX_FADV_NORMAL: ::c_int = 0;
1042 pub const POSIX_FADV_RANDOM: ::c_int = 1;
1043 pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
1044 pub const POSIX_FADV_WILLNEED: ::c_int = 3;
1045 
1046 pub const AT_FDCWD: ::c_int = -100;
1047 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x100;
1048 pub const AT_REMOVEDIR: ::c_int = 0x200;
1049 pub const AT_EACCESS: ::c_int = 0x200;
1050 pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
1051 
1052 pub const LOG_CRON: ::c_int = 9 << 3;
1053 pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
1054 pub const LOG_FTP: ::c_int = 11 << 3;
1055 pub const LOG_PERROR: ::c_int = 0x20;
1056 
1057 pub const POLLIN: ::c_short = 0x1;
1058 pub const POLLPRI: ::c_short = 0x2;
1059 pub const POLLOUT: ::c_short = 0x4;
1060 pub const POLLERR: ::c_short = 0x8;
1061 pub const POLLHUP: ::c_short = 0x10;
1062 pub const POLLNVAL: ::c_short = 0x20;
1063 
1064 pub const PIPE_BUF: usize = 4096;
1065 
1066 pub const SI_LOAD_SHIFT: ::c_uint = 16;
1067 
1068 pub const SIGEV_SIGNAL: ::c_int = 0;
1069 pub const SIGEV_NONE: ::c_int = 1;
1070 pub const SIGEV_THREAD: ::c_int = 2;
1071 
1072 pub const P_ALL: idtype_t = 0;
1073 pub const P_PID: idtype_t = 1;
1074 pub const P_PGID: idtype_t = 2;
1075 
1076 pub const UTIME_OMIT: c_long = 1073741822;
1077 pub const UTIME_NOW: c_long = 1073741823;
1078 
1079 pub const L_tmpnam: ::c_uint = 20;
1080 pub const _PC_LINK_MAX: ::c_int = 0;
1081 pub const _PC_MAX_CANON: ::c_int = 1;
1082 pub const _PC_MAX_INPUT: ::c_int = 2;
1083 pub const _PC_NAME_MAX: ::c_int = 3;
1084 pub const _PC_PATH_MAX: ::c_int = 4;
1085 pub const _PC_PIPE_BUF: ::c_int = 5;
1086 pub const _PC_CHOWN_RESTRICTED: ::c_int = 6;
1087 pub const _PC_NO_TRUNC: ::c_int = 7;
1088 pub const _PC_VDISABLE: ::c_int = 8;
1089 
1090 pub const _SC_ARG_MAX: ::c_int = 0;
1091 pub const _SC_CHILD_MAX: ::c_int = 1;
1092 pub const _SC_CLK_TCK: ::c_int = 2;
1093 pub const _SC_NGROUPS_MAX: ::c_int = 3;
1094 pub const _SC_OPEN_MAX: ::c_int = 4;
1095 pub const _SC_STREAM_MAX: ::c_int = 5;
1096 pub const _SC_TZNAME_MAX: ::c_int = 6;
1097 pub const _SC_JOB_CONTROL: ::c_int = 7;
1098 pub const _SC_SAVED_IDS: ::c_int = 8;
1099 pub const _SC_REALTIME_SIGNALS: ::c_int = 9;
1100 pub const _SC_PRIORITY_SCHEDULING: ::c_int = 10;
1101 pub const _SC_TIMERS: ::c_int = 11;
1102 pub const _SC_ASYNCHRONOUS_IO: ::c_int = 12;
1103 pub const _SC_PRIORITIZED_IO: ::c_int = 13;
1104 pub const _SC_SYNCHRONIZED_IO: ::c_int = 14;
1105 pub const _SC_FSYNC: ::c_int = 15;
1106 pub const _SC_MAPPED_FILES: ::c_int = 16;
1107 pub const _SC_MEMLOCK: ::c_int = 17;
1108 pub const _SC_MEMLOCK_RANGE: ::c_int = 18;
1109 pub const _SC_MEMORY_PROTECTION: ::c_int = 19;
1110 pub const _SC_MESSAGE_PASSING: ::c_int = 20;
1111 pub const _SC_SEMAPHORES: ::c_int = 21;
1112 pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 22;
1113 pub const _SC_AIO_LISTIO_MAX: ::c_int = 23;
1114 pub const _SC_AIO_MAX: ::c_int = 24;
1115 pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 25;
1116 pub const _SC_DELAYTIMER_MAX: ::c_int = 26;
1117 pub const _SC_MQ_OPEN_MAX: ::c_int = 27;
1118 pub const _SC_MQ_PRIO_MAX: ::c_int = 28;
1119 pub const _SC_VERSION: ::c_int = 29;
1120 pub const _SC_PAGESIZE: ::c_int = 30;
1121 pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
1122 pub const _SC_RTSIG_MAX: ::c_int = 31;
1123 pub const _SC_SEM_NSEMS_MAX: ::c_int = 32;
1124 pub const _SC_SEM_VALUE_MAX: ::c_int = 33;
1125 pub const _SC_SIGQUEUE_MAX: ::c_int = 34;
1126 pub const _SC_TIMER_MAX: ::c_int = 35;
1127 pub const _SC_BC_BASE_MAX: ::c_int = 36;
1128 pub const _SC_BC_DIM_MAX: ::c_int = 37;
1129 pub const _SC_BC_SCALE_MAX: ::c_int = 38;
1130 pub const _SC_BC_STRING_MAX: ::c_int = 39;
1131 pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 40;
1132 pub const _SC_EXPR_NEST_MAX: ::c_int = 42;
1133 pub const _SC_LINE_MAX: ::c_int = 43;
1134 pub const _SC_RE_DUP_MAX: ::c_int = 44;
1135 pub const _SC_2_VERSION: ::c_int = 46;
1136 pub const _SC_2_C_BIND: ::c_int = 47;
1137 pub const _SC_2_C_DEV: ::c_int = 48;
1138 pub const _SC_2_FORT_DEV: ::c_int = 49;
1139 pub const _SC_2_FORT_RUN: ::c_int = 50;
1140 pub const _SC_2_SW_DEV: ::c_int = 51;
1141 pub const _SC_2_LOCALEDEF: ::c_int = 52;
1142 pub const _SC_IOV_MAX: ::c_int = 60;
1143 pub const _SC_THREADS: ::c_int = 67;
1144 pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 68;
1145 pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 69;
1146 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 70;
1147 pub const _SC_LOGIN_NAME_MAX: ::c_int = 71;
1148 pub const _SC_TTY_NAME_MAX: ::c_int = 72;
1149 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 73;
1150 pub const _SC_THREAD_KEYS_MAX: ::c_int = 74;
1151 pub const _SC_THREAD_STACK_MIN: ::c_int = 75;
1152 pub const _SC_THREAD_THREADS_MAX: ::c_int = 76;
1153 pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77;
1154 pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78;
1155 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79;
1156 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80;
1157 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81;
1158 pub const _SC_NPROCESSORS_ONLN: ::c_int = 84;
1159 pub const _SC_ATEXIT_MAX: ::c_int = 87;
1160 pub const _SC_XOPEN_VERSION: ::c_int = 89;
1161 pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90;
1162 pub const _SC_XOPEN_UNIX: ::c_int = 91;
1163 pub const _SC_XOPEN_CRYPT: ::c_int = 92;
1164 pub const _SC_XOPEN_ENH_I18N: ::c_int = 93;
1165 pub const _SC_XOPEN_SHM: ::c_int = 94;
1166 pub const _SC_2_CHAR_TERM: ::c_int = 95;
1167 pub const _SC_2_UPE: ::c_int = 97;
1168 pub const _SC_XBS5_ILP32_OFF32: ::c_int = 125;
1169 pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126;
1170 pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 128;
1171 pub const _SC_XOPEN_LEGACY: ::c_int = 129;
1172 pub const _SC_XOPEN_REALTIME: ::c_int = 130;
1173 pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 131;
1174 pub const _SC_HOST_NAME_MAX: ::c_int = 180;
1175 
1176 pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY;
1177 pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY;
1178 
1179 pub const GLOB_ERR: ::c_int = 1 << 0;
1180 pub const GLOB_MARK: ::c_int = 1 << 1;
1181 pub const GLOB_NOSORT: ::c_int = 1 << 2;
1182 pub const GLOB_DOOFFS: ::c_int = 1 << 3;
1183 pub const GLOB_NOCHECK: ::c_int = 1 << 4;
1184 pub const GLOB_APPEND: ::c_int = 1 << 5;
1185 pub const GLOB_NOESCAPE: ::c_int = 1 << 6;
1186 
1187 pub const GLOB_NOSPACE: ::c_int = 1;
1188 pub const GLOB_ABORTED: ::c_int = 2;
1189 pub const GLOB_NOMATCH: ::c_int = 3;
1190 
1191 pub const POSIX_MADV_NORMAL: ::c_int = 0;
1192 pub const POSIX_MADV_RANDOM: ::c_int = 1;
1193 pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
1194 pub const POSIX_MADV_WILLNEED: ::c_int = 3;
1195 
1196 pub const S_IEXEC: mode_t = 64;
1197 pub const S_IWRITE: mode_t = 128;
1198 pub const S_IREAD: mode_t = 256;
1199 
1200 pub const F_LOCK: ::c_int = 1;
1201 pub const F_TEST: ::c_int = 3;
1202 pub const F_TLOCK: ::c_int = 2;
1203 pub const F_ULOCK: ::c_int = 0;
1204 
1205 pub const ST_RDONLY: ::c_ulong = 1;
1206 pub const ST_NOSUID: ::c_ulong = 2;
1207 pub const ST_NODEV: ::c_ulong = 4;
1208 pub const ST_NOEXEC: ::c_ulong = 8;
1209 pub const ST_SYNCHRONOUS: ::c_ulong = 16;
1210 pub const ST_MANDLOCK: ::c_ulong = 64;
1211 pub const ST_WRITE: ::c_ulong = 128;
1212 pub const ST_APPEND: ::c_ulong = 256;
1213 pub const ST_IMMUTABLE: ::c_ulong = 512;
1214 pub const ST_NOATIME: ::c_ulong = 1024;
1215 pub const ST_NODIRATIME: ::c_ulong = 2048;
1216 
1217 pub const RTLD_NEXT: *mut ::c_void = -1i64 as *mut ::c_void;
1218 pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
1219 pub const RTLD_NODELETE: ::c_int = 0x1000;
1220 pub const RTLD_NOW: ::c_int = 0x2;
1221 
1222 pub const TCP_MD5SIG: ::c_int = 14;
1223 
1224 align_const! {
1225     pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
1226         size: [0; __SIZEOF_PTHREAD_MUTEX_T],
1227     };
1228     pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
1229         size: [0; __SIZEOF_PTHREAD_COND_T],
1230     };
1231     pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
1232         size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
1233     };
1234 }
1235 pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
1236 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
1237 pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
1238 pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
1239 pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
1240 
1241 pub const SCHED_OTHER: ::c_int = 0;
1242 pub const SCHED_FIFO: ::c_int = 1;
1243 pub const SCHED_RR: ::c_int = 2;
1244 pub const SCHED_BATCH: ::c_int = 3;
1245 pub const SCHED_IDLE: ::c_int = 5;
1246 
1247 // System V IPC
1248 pub const IPC_PRIVATE: ::key_t = 0;
1249 
1250 pub const IPC_CREAT: ::c_int = 0o1000;
1251 pub const IPC_EXCL: ::c_int = 0o2000;
1252 pub const IPC_NOWAIT: ::c_int = 0o4000;
1253 
1254 pub const IPC_RMID: ::c_int = 0;
1255 pub const IPC_SET: ::c_int = 1;
1256 pub const IPC_STAT: ::c_int = 2;
1257 pub const IPC_INFO: ::c_int = 3;
1258 pub const MSG_STAT: ::c_int = 11;
1259 pub const MSG_INFO: ::c_int = 12;
1260 
1261 pub const MSG_NOERROR: ::c_int = 0o10000;
1262 pub const MSG_EXCEPT: ::c_int = 0o20000;
1263 
1264 pub const SHM_R: ::c_int = 0o400;
1265 pub const SHM_W: ::c_int = 0o200;
1266 
1267 pub const SHM_RDONLY: ::c_int = 0o10000;
1268 pub const SHM_RND: ::c_int = 0o20000;
1269 pub const SHM_REMAP: ::c_int = 0o40000;
1270 
1271 pub const SHM_LOCK: ::c_int = 11;
1272 pub const SHM_UNLOCK: ::c_int = 12;
1273 
1274 pub const SHM_HUGETLB: ::c_int = 0o4000;
1275 pub const SHM_NORESERVE: ::c_int = 0o10000;
1276 
1277 pub const EPOLLRDHUP: ::c_int = 0x2000;
1278 pub const EPOLLONESHOT: ::c_int = 0x40000000;
1279 
1280 pub const QFMT_VFS_OLD: ::c_int = 1;
1281 pub const QFMT_VFS_V0: ::c_int = 2;
1282 
1283 pub const EFD_SEMAPHORE: ::c_int = 0x1;
1284 
1285 pub const LOG_NFACILITIES: ::c_int = 24;
1286 
1287 pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t;
1288 
1289 pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32;
1290 pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32;
1291 pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32;
1292 pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32;
1293 pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32;
1294 
1295 pub const AI_PASSIVE: ::c_int = 0x0001;
1296 pub const AI_CANONNAME: ::c_int = 0x0002;
1297 pub const AI_NUMERICHOST: ::c_int = 0x0004;
1298 pub const AI_V4MAPPED: ::c_int = 0x0008;
1299 pub const AI_ALL: ::c_int = 0x0010;
1300 pub const AI_ADDRCONFIG: ::c_int = 0x0020;
1301 
1302 pub const AI_NUMERICSERV: ::c_int = 0x0400;
1303 
1304 pub const EAI_BADFLAGS: ::c_int = -1;
1305 pub const EAI_NONAME: ::c_int = -2;
1306 pub const EAI_AGAIN: ::c_int = -3;
1307 pub const EAI_FAIL: ::c_int = -4;
1308 pub const EAI_FAMILY: ::c_int = -6;
1309 pub const EAI_SOCKTYPE: ::c_int = -7;
1310 pub const EAI_SERVICE: ::c_int = -8;
1311 pub const EAI_MEMORY: ::c_int = -10;
1312 pub const EAI_OVERFLOW: ::c_int = -12;
1313 
1314 pub const NI_NUMERICHOST: ::c_int = 1;
1315 pub const NI_NUMERICSERV: ::c_int = 2;
1316 pub const NI_NOFQDN: ::c_int = 4;
1317 pub const NI_NAMEREQD: ::c_int = 8;
1318 pub const NI_DGRAM: ::c_int = 16;
1319 
1320 pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1;
1321 pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2;
1322 pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4;
1323 
1324 pub const EAI_SYSTEM: ::c_int = -11;
1325 
1326 pub const MREMAP_MAYMOVE: ::c_int = 1;
1327 pub const MREMAP_FIXED: ::c_int = 2;
1328 
1329 pub const PR_SET_PDEATHSIG: ::c_int = 1;
1330 pub const PR_GET_PDEATHSIG: ::c_int = 2;
1331 
1332 pub const PR_GET_DUMPABLE: ::c_int = 3;
1333 pub const PR_SET_DUMPABLE: ::c_int = 4;
1334 
1335 pub const PR_GET_UNALIGN: ::c_int = 5;
1336 pub const PR_SET_UNALIGN: ::c_int = 6;
1337 pub const PR_UNALIGN_NOPRINT: ::c_int = 1;
1338 pub const PR_UNALIGN_SIGBUS: ::c_int = 2;
1339 
1340 pub const PR_GET_KEEPCAPS: ::c_int = 7;
1341 pub const PR_SET_KEEPCAPS: ::c_int = 8;
1342 
1343 pub const PR_GET_FPEMU: ::c_int = 9;
1344 pub const PR_SET_FPEMU: ::c_int = 10;
1345 pub const PR_FPEMU_NOPRINT: ::c_int = 1;
1346 pub const PR_FPEMU_SIGFPE: ::c_int = 2;
1347 
1348 pub const PR_GET_FPEXC: ::c_int = 11;
1349 pub const PR_SET_FPEXC: ::c_int = 12;
1350 pub const PR_FP_EXC_SW_ENABLE: ::c_int = 0x80;
1351 pub const PR_FP_EXC_DIV: ::c_int = 0x010000;
1352 pub const PR_FP_EXC_OVF: ::c_int = 0x020000;
1353 pub const PR_FP_EXC_UND: ::c_int = 0x040000;
1354 pub const PR_FP_EXC_RES: ::c_int = 0x080000;
1355 pub const PR_FP_EXC_INV: ::c_int = 0x100000;
1356 pub const PR_FP_EXC_DISABLED: ::c_int = 0;
1357 pub const PR_FP_EXC_NONRECOV: ::c_int = 1;
1358 pub const PR_FP_EXC_ASYNC: ::c_int = 2;
1359 pub const PR_FP_EXC_PRECISE: ::c_int = 3;
1360 
1361 pub const PR_GET_TIMING: ::c_int = 13;
1362 pub const PR_SET_TIMING: ::c_int = 14;
1363 pub const PR_TIMING_STATISTICAL: ::c_int = 0;
1364 pub const PR_TIMING_TIMESTAMP: ::c_int = 1;
1365 
1366 pub const PR_SET_NAME: ::c_int = 15;
1367 pub const PR_GET_NAME: ::c_int = 16;
1368 
1369 pub const PR_GET_ENDIAN: ::c_int = 19;
1370 pub const PR_SET_ENDIAN: ::c_int = 20;
1371 pub const PR_ENDIAN_BIG: ::c_int = 0;
1372 pub const PR_ENDIAN_LITTLE: ::c_int = 1;
1373 pub const PR_ENDIAN_PPC_LITTLE: ::c_int = 2;
1374 
1375 pub const PR_GET_SECCOMP: ::c_int = 21;
1376 pub const PR_SET_SECCOMP: ::c_int = 22;
1377 
1378 pub const PR_CAPBSET_READ: ::c_int = 23;
1379 pub const PR_CAPBSET_DROP: ::c_int = 24;
1380 
1381 pub const PR_GET_TSC: ::c_int = 25;
1382 pub const PR_SET_TSC: ::c_int = 26;
1383 pub const PR_TSC_ENABLE: ::c_int = 1;
1384 pub const PR_TSC_SIGSEGV: ::c_int = 2;
1385 
1386 pub const PR_GET_SECUREBITS: ::c_int = 27;
1387 pub const PR_SET_SECUREBITS: ::c_int = 28;
1388 
1389 pub const PR_SET_TIMERSLACK: ::c_int = 29;
1390 pub const PR_GET_TIMERSLACK: ::c_int = 30;
1391 
1392 pub const PR_TASK_PERF_EVENTS_DISABLE: ::c_int = 31;
1393 pub const PR_TASK_PERF_EVENTS_ENABLE: ::c_int = 32;
1394 
1395 pub const PR_MCE_KILL: ::c_int = 33;
1396 pub const PR_MCE_KILL_CLEAR: ::c_int = 0;
1397 pub const PR_MCE_KILL_SET: ::c_int = 1;
1398 
1399 pub const PR_MCE_KILL_LATE: ::c_int = 0;
1400 pub const PR_MCE_KILL_EARLY: ::c_int = 1;
1401 pub const PR_MCE_KILL_DEFAULT: ::c_int = 2;
1402 
1403 pub const PR_MCE_KILL_GET: ::c_int = 34;
1404 
1405 pub const PR_SET_MM: ::c_int = 35;
1406 pub const PR_SET_MM_START_CODE: ::c_int = 1;
1407 pub const PR_SET_MM_END_CODE: ::c_int = 2;
1408 pub const PR_SET_MM_START_DATA: ::c_int = 3;
1409 pub const PR_SET_MM_END_DATA: ::c_int = 4;
1410 pub const PR_SET_MM_START_STACK: ::c_int = 5;
1411 pub const PR_SET_MM_START_BRK: ::c_int = 6;
1412 pub const PR_SET_MM_BRK: ::c_int = 7;
1413 pub const PR_SET_MM_ARG_START: ::c_int = 8;
1414 pub const PR_SET_MM_ARG_END: ::c_int = 9;
1415 pub const PR_SET_MM_ENV_START: ::c_int = 10;
1416 pub const PR_SET_MM_ENV_END: ::c_int = 11;
1417 pub const PR_SET_MM_AUXV: ::c_int = 12;
1418 pub const PR_SET_MM_EXE_FILE: ::c_int = 13;
1419 pub const PR_SET_MM_MAP: ::c_int = 14;
1420 pub const PR_SET_MM_MAP_SIZE: ::c_int = 15;
1421 
1422 pub const PR_SET_PTRACER: ::c_int = 0x59616d61;
1423 
1424 pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36;
1425 pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37;
1426 
1427 pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38;
1428 pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39;
1429 
1430 pub const PR_GET_TID_ADDRESS: ::c_int = 40;
1431 
1432 pub const PR_SET_THP_DISABLE: ::c_int = 41;
1433 pub const PR_GET_THP_DISABLE: ::c_int = 42;
1434 
1435 pub const GRND_NONBLOCK: ::c_uint = 0x0001;
1436 pub const GRND_RANDOM: ::c_uint = 0x0002;
1437 
1438 pub const ABDAY_1: ::nl_item = 0x300;
1439 pub const ABDAY_2: ::nl_item = 0x301;
1440 pub const ABDAY_3: ::nl_item = 0x302;
1441 pub const ABDAY_4: ::nl_item = 0x303;
1442 pub const ABDAY_5: ::nl_item = 0x304;
1443 pub const ABDAY_6: ::nl_item = 0x305;
1444 pub const ABDAY_7: ::nl_item = 0x306;
1445 
1446 pub const DAY_1: ::nl_item = 0x307;
1447 pub const DAY_2: ::nl_item = 0x308;
1448 pub const DAY_3: ::nl_item = 0x309;
1449 pub const DAY_4: ::nl_item = 0x30A;
1450 pub const DAY_5: ::nl_item = 0x30B;
1451 pub const DAY_6: ::nl_item = 0x30C;
1452 pub const DAY_7: ::nl_item = 0x30D;
1453 
1454 pub const ABMON_1: ::nl_item = 0x30E;
1455 pub const ABMON_2: ::nl_item = 0x30F;
1456 pub const ABMON_3: ::nl_item = 0x310;
1457 pub const ABMON_4: ::nl_item = 0x311;
1458 pub const ABMON_5: ::nl_item = 0x312;
1459 pub const ABMON_6: ::nl_item = 0x313;
1460 pub const ABMON_7: ::nl_item = 0x314;
1461 pub const ABMON_8: ::nl_item = 0x315;
1462 pub const ABMON_9: ::nl_item = 0x316;
1463 pub const ABMON_10: ::nl_item = 0x317;
1464 pub const ABMON_11: ::nl_item = 0x318;
1465 pub const ABMON_12: ::nl_item = 0x319;
1466 
1467 pub const MON_1: ::nl_item = 0x31A;
1468 pub const MON_2: ::nl_item = 0x31B;
1469 pub const MON_3: ::nl_item = 0x31C;
1470 pub const MON_4: ::nl_item = 0x31D;
1471 pub const MON_5: ::nl_item = 0x31E;
1472 pub const MON_6: ::nl_item = 0x31F;
1473 pub const MON_7: ::nl_item = 0x320;
1474 pub const MON_8: ::nl_item = 0x321;
1475 pub const MON_9: ::nl_item = 0x322;
1476 pub const MON_10: ::nl_item = 0x323;
1477 pub const MON_11: ::nl_item = 0x324;
1478 pub const MON_12: ::nl_item = 0x325;
1479 
1480 pub const AM_STR: ::nl_item = 0x326;
1481 pub const PM_STR: ::nl_item = 0x327;
1482 
1483 pub const D_T_FMT: ::nl_item = 0x328;
1484 pub const D_FMT: ::nl_item = 0x329;
1485 pub const T_FMT: ::nl_item = 0x32A;
1486 pub const T_FMT_AMPM: ::nl_item = 0x32B;
1487 
1488 pub const ERA: ::nl_item = 0x32C;
1489 pub const ERA_D_FMT: ::nl_item = 0x32E;
1490 pub const ALT_DIGITS: ::nl_item = 0x32F;
1491 pub const ERA_D_T_FMT: ::nl_item = 0x330;
1492 pub const ERA_T_FMT: ::nl_item = 0x331;
1493 
1494 pub const CODESET: ::nl_item = 10;
1495 
1496 pub const CRNCYSTR: ::nl_item = 0x215;
1497 
1498 pub const RADIXCHAR: ::nl_item = 0x100;
1499 pub const THOUSEP: ::nl_item = 0x101;
1500 
1501 pub const NOEXPR: ::nl_item = 0x501;
1502 pub const YESSTR: ::nl_item = 0x502;
1503 pub const NOSTR: ::nl_item = 0x503;
1504 
1505 pub const FILENAME_MAX: ::c_uint = 4095;
1506 
1507 pub const PRIO_PROCESS: ::c_int = 0;
1508 pub const PRIO_PGRP: ::c_int = 1;
1509 pub const PRIO_USER: ::c_int = 2;
1510 
1511 f! {
1512     pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
1513         let fd = fd as usize;
1514         let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
1515         (*set).fds_bits[fd / size] &= !(1 << (fd % size));
1516         return
1517     }
1518 
1519     pub fn FD_ISSET(fd: ::c_int, set: *mut fd_set) -> bool {
1520         let fd = fd as usize;
1521         let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
1522         return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
1523     }
1524 
1525     pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
1526         let fd = fd as usize;
1527         let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
1528         (*set).fds_bits[fd / size] |= 1 << (fd % size);
1529         return
1530     }
1531 
1532     pub fn FD_ZERO(set: *mut fd_set) -> () {
1533         for slot in (*set).fds_bits.iter_mut() {
1534             *slot = 0;
1535         }
1536     }
1537 
1538     pub fn WIFSTOPPED(status: ::c_int) -> bool {
1539         (status & 0xff) == 0x7f
1540     }
1541 
1542     pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
1543         (status >> 8) & 0xff
1544     }
1545 
1546     pub fn WIFCONTINUED(status: ::c_int) -> bool {
1547         status == 0xffff
1548     }
1549 
1550     pub fn WIFSIGNALED(status: ::c_int) -> bool {
1551         ((status & 0x7f) + 1) as i8 >= 2
1552     }
1553 
1554     pub fn WTERMSIG(status: ::c_int) -> ::c_int {
1555         status & 0x7f
1556     }
1557 
1558     pub fn WIFEXITED(status: ::c_int) -> bool {
1559         (status & 0x7f) == 0
1560     }
1561 
1562     pub fn WEXITSTATUS(status: ::c_int) -> ::c_int {
1563         (status >> 8) & 0xff
1564     }
1565 
1566     pub fn WCOREDUMP(status: ::c_int) -> bool {
1567         (status & 0x80) != 0
1568     }
1569 
1570     pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
1571         for slot in cpuset.bits.iter_mut() {
1572             *slot = 0;
1573         }
1574     }
1575 
1576     pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
1577         let size_in_bits
1578             = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
1579         let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
1580         cpuset.bits[idx] |= 1 << offset;
1581         ()
1582     }
1583 
1584     pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
1585         let size_in_bits
1586             = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
1587         let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
1588         cpuset.bits[idx] &= !(1 << offset);
1589         ()
1590     }
1591 
1592     pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
1593         let size_in_bits = 8 * ::mem::size_of_val(&cpuset.bits[0]);
1594         let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
1595         0 != (cpuset.bits[idx] & (1 << offset))
1596     }
1597 
1598     pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
1599         set1.bits == set2.bits
1600     }
1601 
1602     pub fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int {
1603         (cmd << 8) | (type_ & 0x00ff)
1604     }
1605 }
1606 
1607 extern "C" {
1608     #[cfg_attr(target_os = "linux", link_name = "__xpg_strerror_r")]
strerror_r( errnum: ::c_int, buf: *mut c_char, buflen: ::size_t, ) -> ::c_int1609     pub fn strerror_r(
1610         errnum: ::c_int,
1611         buf: *mut c_char,
1612         buflen: ::size_t,
1613     ) -> ::c_int;
1614 
sem_destroy(sem: *mut sem_t) -> ::c_int1615     pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
sem_init( sem: *mut sem_t, pshared: ::c_int, value: ::c_uint, ) -> ::c_int1616     pub fn sem_init(
1617         sem: *mut sem_t,
1618         pshared: ::c_int,
1619         value: ::c_uint,
1620     ) -> ::c_int;
1621 
abs(i: ::c_int) -> ::c_int1622     pub fn abs(i: ::c_int) -> ::c_int;
atof(s: *const ::c_char) -> ::c_double1623     pub fn atof(s: *const ::c_char) -> ::c_double;
labs(i: ::c_long) -> ::c_long1624     pub fn labs(i: ::c_long) -> ::c_long;
rand() -> ::c_int1625     pub fn rand() -> ::c_int;
srand(seed: ::c_uint)1626     pub fn srand(seed: ::c_uint);
1627 
fdatasync(fd: ::c_int) -> ::c_int1628     pub fn fdatasync(fd: ::c_int) -> ::c_int;
gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int1629     pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
mincore( addr: *mut ::c_void, len: ::size_t, vec: *mut ::c_uchar, ) -> ::c_int1630     pub fn mincore(
1631         addr: *mut ::c_void,
1632         len: ::size_t,
1633         vec: *mut ::c_uchar,
1634     ) -> ::c_int;
clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int1635     pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int1636     pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
clock_nanosleep( clk_id: ::clockid_t, flags: ::c_int, rqtp: *const ::timespec, rmtp: *mut ::timespec, ) -> ::c_int1637     pub fn clock_nanosleep(
1638         clk_id: ::clockid_t,
1639         flags: ::c_int,
1640         rqtp: *const ::timespec,
1641         rmtp: *mut ::timespec,
1642     ) -> ::c_int;
clock_settime( clk_id: ::clockid_t, tp: *const ::timespec, ) -> ::c_int1643     pub fn clock_settime(
1644         clk_id: ::clockid_t,
1645         tp: *const ::timespec,
1646     ) -> ::c_int;
prctl(option: ::c_int, ...) -> ::c_int1647     pub fn prctl(option: ::c_int, ...) -> ::c_int;
pthread_getattr_np( native: ::pthread_t, attr: *mut ::pthread_attr_t, ) -> ::c_int1648     pub fn pthread_getattr_np(
1649         native: ::pthread_t,
1650         attr: *mut ::pthread_attr_t,
1651     ) -> ::c_int;
pthread_attr_getguardsize( attr: *const ::pthread_attr_t, guardsize: *mut ::size_t, ) -> ::c_int1652     pub fn pthread_attr_getguardsize(
1653         attr: *const ::pthread_attr_t,
1654         guardsize: *mut ::size_t,
1655     ) -> ::c_int;
pthread_attr_getstack( attr: *const ::pthread_attr_t, stackaddr: *mut *mut ::c_void, stacksize: *mut ::size_t, ) -> ::c_int1656     pub fn pthread_attr_getstack(
1657         attr: *const ::pthread_attr_t,
1658         stackaddr: *mut *mut ::c_void,
1659         stacksize: *mut ::size_t,
1660     ) -> ::c_int;
memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void1661     pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int1662     pub fn setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int;
initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int1663     pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
sched_setscheduler( pid: ::pid_t, policy: ::c_int, param: *const ::sched_param, ) -> ::c_int1664     pub fn sched_setscheduler(
1665         pid: ::pid_t,
1666         policy: ::c_int,
1667         param: *const ::sched_param,
1668     ) -> ::c_int;
sched_getscheduler(pid: ::pid_t) -> ::c_int1669     pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
sched_get_priority_max(policy: ::c_int) -> ::c_int1670     pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
sched_get_priority_min(policy: ::c_int) -> ::c_int1671     pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
epoll_create(size: ::c_int) -> ::c_int1672     pub fn epoll_create(size: ::c_int) -> ::c_int;
epoll_create1(flags: ::c_int) -> ::c_int1673     pub fn epoll_create1(flags: ::c_int) -> ::c_int;
epoll_ctl( epfd: ::c_int, op: ::c_int, fd: ::c_int, event: *mut ::epoll_event, ) -> ::c_int1674     pub fn epoll_ctl(
1675         epfd: ::c_int,
1676         op: ::c_int,
1677         fd: ::c_int,
1678         event: *mut ::epoll_event,
1679     ) -> ::c_int;
epoll_wait( epfd: ::c_int, events: *mut ::epoll_event, maxevents: ::c_int, timeout: ::c_int, ) -> ::c_int1680     pub fn epoll_wait(
1681         epfd: ::c_int,
1682         events: *mut ::epoll_event,
1683         maxevents: ::c_int,
1684         timeout: ::c_int,
1685     ) -> ::c_int;
pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int1686     pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
mount( src: *const ::c_char, target: *const ::c_char, fstype: *const ::c_char, flags: ::c_ulong, data: *const ::c_void, ) -> ::c_int1687     pub fn mount(
1688         src: *const ::c_char,
1689         target: *const ::c_char,
1690         fstype: *const ::c_char,
1691         flags: ::c_ulong,
1692         data: *const ::c_void,
1693     ) -> ::c_int;
umount(target: *const ::c_char) -> ::c_int1694     pub fn umount(target: *const ::c_char) -> ::c_int;
umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int1695     pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::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_int1696     pub fn clone(
1697         cb: extern "C" fn(*mut ::c_void) -> ::c_int,
1698         child_stack: *mut ::c_void,
1699         flags: ::c_int,
1700         arg: *mut ::c_void,
1701         ...
1702     ) -> ::c_int;
statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int1703     pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int1704     pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
memrchr( cx: *const ::c_void, c: ::c_int, n: ::size_t, ) -> *mut ::c_void1705     pub fn memrchr(
1706         cx: *const ::c_void,
1707         c: ::c_int,
1708         n: ::size_t,
1709     ) -> *mut ::c_void;
syscall(num: ::c_long, ...) -> ::c_long1710     pub fn syscall(num: ::c_long, ...) -> ::c_long;
sendfile( out_fd: ::c_int, in_fd: ::c_int, offset: *mut off_t, count: ::size_t, ) -> ::ssize_t1711     pub fn sendfile(
1712         out_fd: ::c_int,
1713         in_fd: ::c_int,
1714         offset: *mut off_t,
1715         count: ::size_t,
1716     ) -> ::ssize_t;
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_t1717     pub fn splice(
1718         fd_in: ::c_int,
1719         off_in: *mut ::loff_t,
1720         fd_out: ::c_int,
1721         off_out: *mut ::loff_t,
1722         len: ::size_t,
1723         flags: ::c_uint,
1724     ) -> ::ssize_t;
tee( fd_in: ::c_int, fd_out: ::c_int, len: ::size_t, flags: ::c_uint, ) -> ::ssize_t1725     pub fn tee(
1726         fd_in: ::c_int,
1727         fd_out: ::c_int,
1728         len: ::size_t,
1729         flags: ::c_uint,
1730     ) -> ::ssize_t;
vmsplice( fd: ::c_int, iov: *const ::iovec, nr_segs: ::size_t, flags: ::c_uint, ) -> ::ssize_t1731     pub fn vmsplice(
1732         fd: ::c_int,
1733         iov: *const ::iovec,
1734         nr_segs: ::size_t,
1735         flags: ::c_uint,
1736     ) -> ::ssize_t;
1737 
posix_fadvise( fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int, ) -> ::c_int1738     pub fn posix_fadvise(
1739         fd: ::c_int,
1740         offset: ::off_t,
1741         len: ::off_t,
1742         advise: ::c_int,
1743     ) -> ::c_int;
getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int1744     pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int1745     pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int1746     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_int1747     pub fn utimensat(
1748         dirfd: ::c_int,
1749         path: *const ::c_char,
1750         times: *const ::timespec,
1751         flag: ::c_int,
1752     ) -> ::c_int;
duplocale(base: ::locale_t) -> ::locale_t1753     pub fn duplocale(base: ::locale_t) -> ::locale_t;
freelocale(loc: ::locale_t)1754     pub fn freelocale(loc: ::locale_t);
newlocale( mask: ::c_int, locale: *const ::c_char, base: ::locale_t, ) -> ::locale_t1755     pub fn newlocale(
1756         mask: ::c_int,
1757         locale: *const ::c_char,
1758         base: ::locale_t,
1759     ) -> ::locale_t;
uselocale(loc: ::locale_t) -> ::locale_t1760     pub fn uselocale(loc: ::locale_t) -> ::locale_t;
creat64(path: *const c_char, mode: mode_t) -> ::c_int1761     pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int;
fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int1762     pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int;
fstatat64( fildes: ::c_int, path: *const ::c_char, buf: *mut stat64, flag: ::c_int, ) -> ::c_int1763     pub fn fstatat64(
1764         fildes: ::c_int,
1765         path: *const ::c_char,
1766         buf: *mut stat64,
1767         flag: ::c_int,
1768     ) -> ::c_int;
ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int1769     pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int;
getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int1770     pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int;
lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t1771     pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t;
lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int1772     pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
mmap64( addr: *mut ::c_void, len: ::size_t, prot: ::c_int, flags: ::c_int, fd: ::c_int, offset: off64_t, ) -> *mut ::c_void1773     pub fn mmap64(
1774         addr: *mut ::c_void,
1775         len: ::size_t,
1776         prot: ::c_int,
1777         flags: ::c_int,
1778         fd: ::c_int,
1779         offset: off64_t,
1780     ) -> *mut ::c_void;
open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int1781     pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
openat64( fd: ::c_int, path: *const c_char, oflag: ::c_int, ... ) -> ::c_int1782     pub fn openat64(
1783         fd: ::c_int,
1784         path: *const c_char,
1785         oflag: ::c_int,
1786         ...
1787     ) -> ::c_int;
pread64( fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off64_t, ) -> ::ssize_t1788     pub fn pread64(
1789         fd: ::c_int,
1790         buf: *mut ::c_void,
1791         count: ::size_t,
1792         offset: off64_t,
1793     ) -> ::ssize_t;
pwrite64( fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off64_t, ) -> ::ssize_t1794     pub fn pwrite64(
1795         fd: ::c_int,
1796         buf: *const ::c_void,
1797         count: ::size_t,
1798         offset: off64_t,
1799     ) -> ::ssize_t;
readdir64(dirp: *mut ::DIR) -> *mut ::dirent641800     pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64;
readdir64_r( dirp: *mut ::DIR, entry: *mut ::dirent64, result: *mut *mut ::dirent64, ) -> ::c_int1801     pub fn readdir64_r(
1802         dirp: *mut ::DIR,
1803         entry: *mut ::dirent64,
1804         result: *mut *mut ::dirent64,
1805     ) -> ::c_int;
setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int1806     pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int;
stat64(path: *const c_char, buf: *mut stat64) -> ::c_int1807     pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
truncate64(path: *const c_char, length: off64_t) -> ::c_int1808     pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int;
eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int1809     pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
1810 
mknodat( dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t, dev: dev_t, ) -> ::c_int1811     pub fn mknodat(
1812         dirfd: ::c_int,
1813         pathname: *const ::c_char,
1814         mode: ::mode_t,
1815         dev: dev_t,
1816     ) -> ::c_int;
ppoll( fds: *mut ::pollfd, nfds: nfds_t, timeout: *const ::timespec, sigmask: *const sigset_t, ) -> ::c_int1817     pub fn ppoll(
1818         fds: *mut ::pollfd,
1819         nfds: nfds_t,
1820         timeout: *const ::timespec,
1821         sigmask: *const sigset_t,
1822     ) -> ::c_int;
pthread_condattr_getclock( attr: *const pthread_condattr_t, clock_id: *mut clockid_t, ) -> ::c_int1823     pub fn pthread_condattr_getclock(
1824         attr: *const pthread_condattr_t,
1825         clock_id: *mut clockid_t,
1826     ) -> ::c_int;
pthread_condattr_setclock( attr: *mut pthread_condattr_t, clock_id: ::clockid_t, ) -> ::c_int1827     pub fn pthread_condattr_setclock(
1828         attr: *mut pthread_condattr_t,
1829         clock_id: ::clockid_t,
1830     ) -> ::c_int;
pthread_condattr_setpshared( attr: *mut pthread_condattr_t, pshared: ::c_int, ) -> ::c_int1831     pub fn pthread_condattr_setpshared(
1832         attr: *mut pthread_condattr_t,
1833         pshared: ::c_int,
1834     ) -> ::c_int;
pthread_condattr_getpshared( attr: *const pthread_condattr_t, pshared: *mut ::c_int, ) -> ::c_int1835     pub fn pthread_condattr_getpshared(
1836         attr: *const pthread_condattr_t,
1837         pshared: *mut ::c_int,
1838     ) -> ::c_int;
sched_getaffinity( pid: ::pid_t, cpusetsize: ::size_t, cpuset: *mut cpu_set_t, ) -> ::c_int1839     pub fn sched_getaffinity(
1840         pid: ::pid_t,
1841         cpusetsize: ::size_t,
1842         cpuset: *mut cpu_set_t,
1843     ) -> ::c_int;
sched_setaffinity( pid: ::pid_t, cpusetsize: ::size_t, cpuset: *const cpu_set_t, ) -> ::c_int1844     pub fn sched_setaffinity(
1845         pid: ::pid_t,
1846         cpusetsize: ::size_t,
1847         cpuset: *const cpu_set_t,
1848     ) -> ::c_int;
unshare(flags: ::c_int) -> ::c_int1849     pub fn unshare(flags: ::c_int) -> ::c_int;
sem_timedwait( sem: *mut sem_t, abstime: *const ::timespec, ) -> ::c_int1850     pub fn sem_timedwait(
1851         sem: *mut sem_t,
1852         abstime: *const ::timespec,
1853     ) -> ::c_int;
sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int1854     pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
accept4( fd: ::c_int, addr: *mut ::sockaddr, len: *mut ::socklen_t, flg: ::c_int, ) -> ::c_int1855     pub fn accept4(
1856         fd: ::c_int,
1857         addr: *mut ::sockaddr,
1858         len: *mut ::socklen_t,
1859         flg: ::c_int,
1860     ) -> ::c_int;
pthread_mutex_timedlock( lock: *mut pthread_mutex_t, abstime: *const ::timespec, ) -> ::c_int1861     pub fn pthread_mutex_timedlock(
1862         lock: *mut pthread_mutex_t,
1863         abstime: *const ::timespec,
1864     ) -> ::c_int;
pthread_mutexattr_setpshared( attr: *mut pthread_mutexattr_t, pshared: ::c_int, ) -> ::c_int1865     pub fn pthread_mutexattr_setpshared(
1866         attr: *mut pthread_mutexattr_t,
1867         pshared: ::c_int,
1868     ) -> ::c_int;
pthread_mutexattr_getpshared( attr: *const pthread_mutexattr_t, pshared: *mut ::c_int, ) -> ::c_int1869     pub fn pthread_mutexattr_getpshared(
1870         attr: *const pthread_mutexattr_t,
1871         pshared: *mut ::c_int,
1872     ) -> ::c_int;
pthread_rwlockattr_getkind_np( attr: *const pthread_rwlockattr_t, val: *mut ::c_int, ) -> ::c_int1873     pub fn pthread_rwlockattr_getkind_np(
1874         attr: *const pthread_rwlockattr_t,
1875         val: *mut ::c_int,
1876     ) -> ::c_int;
pthread_rwlockattr_setkind_np( attr: *mut pthread_rwlockattr_t, val: ::c_int, ) -> ::c_int1877     pub fn pthread_rwlockattr_setkind_np(
1878         attr: *mut pthread_rwlockattr_t,
1879         val: ::c_int,
1880     ) -> ::c_int;
pthread_rwlockattr_getpshared( attr: *const pthread_rwlockattr_t, val: *mut ::c_int, ) -> ::c_int1881     pub fn pthread_rwlockattr_getpshared(
1882         attr: *const pthread_rwlockattr_t,
1883         val: *mut ::c_int,
1884     ) -> ::c_int;
pthread_rwlockattr_setpshared( attr: *mut pthread_rwlockattr_t, val: ::c_int, ) -> ::c_int1885     pub fn pthread_rwlockattr_setpshared(
1886         attr: *mut pthread_rwlockattr_t,
1887         val: ::c_int,
1888     ) -> ::c_int;
ptsname_r( fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t, ) -> ::c_int1889     pub fn ptsname_r(
1890         fd: ::c_int,
1891         buf: *mut ::c_char,
1892         buflen: ::size_t,
1893     ) -> ::c_int;
clearenv() -> ::c_int1894     pub fn clearenv() -> ::c_int;
waitid( idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int, ) -> ::c_int1895     pub fn waitid(
1896         idtype: idtype_t,
1897         id: id_t,
1898         infop: *mut ::siginfo_t,
1899         options: ::c_int,
1900     ) -> ::c_int;
1901 
lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int1902     pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
1903 
setpwent()1904     pub fn setpwent();
endpwent()1905     pub fn endpwent();
getpwent() -> *mut passwd1906     pub fn getpwent() -> *mut passwd;
setspent()1907     pub fn setspent();
endspent()1908     pub fn endspent();
getspent() -> *mut spwd1909     pub fn getspent() -> *mut spwd;
getspnam(__name: *const ::c_char) -> *mut spwd1910     pub fn getspnam(__name: *const ::c_char) -> *mut spwd;
1911 
shm_open( name: *const c_char, oflag: ::c_int, mode: mode_t, ) -> ::c_int1912     pub fn shm_open(
1913         name: *const c_char,
1914         oflag: ::c_int,
1915         mode: mode_t,
1916     ) -> ::c_int;
1917 
1918     // System V IPC
shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int1919     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_void1920     pub fn shmat(
1921         shmid: ::c_int,
1922         shmaddr: *const ::c_void,
1923         shmflg: ::c_int,
1924     ) -> *mut ::c_void;
shmdt(shmaddr: *const ::c_void) -> ::c_int1925     pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
shmctl( shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds, ) -> ::c_int1926     pub fn shmctl(
1927         shmid: ::c_int,
1928         cmd: ::c_int,
1929         buf: *mut ::shmid_ds,
1930     ) -> ::c_int;
ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t1931     pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int1932     pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds)
1933         -> ::c_int;
msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int1934     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_t1935     pub fn msgrcv(
1936         msqid: ::c_int,
1937         msgp: *mut ::c_void,
1938         msgsz: ::size_t,
1939         msgtyp: ::c_long,
1940         msgflg: ::c_int,
1941     ) -> ::ssize_t;
msgsnd( msqid: ::c_int, msgp: *const ::c_void, msgsz: ::size_t, msgflg: ::c_int, ) -> ::c_int1942     pub fn msgsnd(
1943         msqid: ::c_int,
1944         msgp: *const ::c_void,
1945         msgsz: ::size_t,
1946         msgflg: ::c_int,
1947     ) -> ::c_int;
1948 
mprotect( addr: *mut ::c_void, len: ::size_t, prot: ::c_int, ) -> ::c_int1949     pub fn mprotect(
1950         addr: *mut ::c_void,
1951         len: ::size_t,
1952         prot: ::c_int,
1953     ) -> ::c_int;
__errno_location() -> *mut ::c_int1954     pub fn __errno_location() -> *mut ::c_int;
1955 
fopen64( filename: *const c_char, mode: *const c_char, ) -> *mut ::FILE1956     pub fn fopen64(
1957         filename: *const c_char,
1958         mode: *const c_char,
1959     ) -> *mut ::FILE;
freopen64( filename: *const c_char, mode: *const c_char, file: *mut ::FILE, ) -> *mut ::FILE1960     pub fn freopen64(
1961         filename: *const c_char,
1962         mode: *const c_char,
1963         file: *mut ::FILE,
1964     ) -> *mut ::FILE;
tmpfile64() -> *mut ::FILE1965     pub fn tmpfile64() -> *mut ::FILE;
fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int1966     pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int;
fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int1967     pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int;
fseeko64( stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int, ) -> ::c_int1968     pub fn fseeko64(
1969         stream: *mut ::FILE,
1970         offset: ::off64_t,
1971         whence: ::c_int,
1972     ) -> ::c_int;
ftello64(stream: *mut ::FILE) -> ::off64_t1973     pub fn ftello64(stream: *mut ::FILE) -> ::off64_t;
readahead( fd: ::c_int, offset: ::off64_t, count: ::size_t, ) -> ::ssize_t1974     pub fn readahead(
1975         fd: ::c_int,
1976         offset: ::off64_t,
1977         count: ::size_t,
1978     ) -> ::ssize_t;
getxattr( path: *const c_char, name: *const c_char, value: *mut ::c_void, size: ::size_t, ) -> ::ssize_t1979     pub fn getxattr(
1980         path: *const c_char,
1981         name: *const c_char,
1982         value: *mut ::c_void,
1983         size: ::size_t,
1984     ) -> ::ssize_t;
lgetxattr( path: *const c_char, name: *const c_char, value: *mut ::c_void, size: ::size_t, ) -> ::ssize_t1985     pub fn lgetxattr(
1986         path: *const c_char,
1987         name: *const c_char,
1988         value: *mut ::c_void,
1989         size: ::size_t,
1990     ) -> ::ssize_t;
fgetxattr( filedes: ::c_int, name: *const c_char, value: *mut ::c_void, size: ::size_t, ) -> ::ssize_t1991     pub fn fgetxattr(
1992         filedes: ::c_int,
1993         name: *const c_char,
1994         value: *mut ::c_void,
1995         size: ::size_t,
1996     ) -> ::ssize_t;
setxattr( path: *const c_char, name: *const c_char, value: *const ::c_void, size: ::size_t, flags: ::c_int, ) -> ::c_int1997     pub fn setxattr(
1998         path: *const c_char,
1999         name: *const c_char,
2000         value: *const ::c_void,
2001         size: ::size_t,
2002         flags: ::c_int,
2003     ) -> ::c_int;
lsetxattr( path: *const c_char, name: *const c_char, value: *const ::c_void, size: ::size_t, flags: ::c_int, ) -> ::c_int2004     pub fn lsetxattr(
2005         path: *const c_char,
2006         name: *const c_char,
2007         value: *const ::c_void,
2008         size: ::size_t,
2009         flags: ::c_int,
2010     ) -> ::c_int;
fsetxattr( filedes: ::c_int, name: *const c_char, value: *const ::c_void, size: ::size_t, flags: ::c_int, ) -> ::c_int2011     pub fn fsetxattr(
2012         filedes: ::c_int,
2013         name: *const c_char,
2014         value: *const ::c_void,
2015         size: ::size_t,
2016         flags: ::c_int,
2017     ) -> ::c_int;
listxattr( path: *const c_char, list: *mut c_char, size: ::size_t, ) -> ::ssize_t2018     pub fn listxattr(
2019         path: *const c_char,
2020         list: *mut c_char,
2021         size: ::size_t,
2022     ) -> ::ssize_t;
llistxattr( path: *const c_char, list: *mut c_char, size: ::size_t, ) -> ::ssize_t2023     pub fn llistxattr(
2024         path: *const c_char,
2025         list: *mut c_char,
2026         size: ::size_t,
2027     ) -> ::ssize_t;
flistxattr( filedes: ::c_int, list: *mut c_char, size: ::size_t, ) -> ::ssize_t2028     pub fn flistxattr(
2029         filedes: ::c_int,
2030         list: *mut c_char,
2031         size: ::size_t,
2032     ) -> ::ssize_t;
removexattr(path: *const c_char, name: *const c_char) -> ::c_int2033     pub fn removexattr(path: *const c_char, name: *const c_char) -> ::c_int;
lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int2034     pub fn lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int;
fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int2035     pub fn fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int;
signalfd( fd: ::c_int, mask: *const ::sigset_t, flags: ::c_int, ) -> ::c_int2036     pub fn signalfd(
2037         fd: ::c_int,
2038         mask: *const ::sigset_t,
2039         flags: ::c_int,
2040     ) -> ::c_int;
quotactl( cmd: ::c_int, special: *const ::c_char, id: ::c_int, data: *mut ::c_char, ) -> ::c_int2041     pub fn quotactl(
2042         cmd: ::c_int,
2043         special: *const ::c_char,
2044         id: ::c_int,
2045         data: *mut ::c_char,
2046     ) -> ::c_int;
mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t2047     pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
mq_close(mqd: ::mqd_t) -> ::c_int2048     pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
mq_unlink(name: *const ::c_char) -> ::c_int2049     pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
mq_receive( mqd: ::mqd_t, msg_ptr: *mut ::c_char, msg_len: ::size_t, msg_prio: *mut ::c_uint, ) -> ::ssize_t2050     pub fn mq_receive(
2051         mqd: ::mqd_t,
2052         msg_ptr: *mut ::c_char,
2053         msg_len: ::size_t,
2054         msg_prio: *mut ::c_uint,
2055     ) -> ::ssize_t;
mq_send( mqd: ::mqd_t, msg_ptr: *const ::c_char, msg_len: ::size_t, msg_prio: ::c_uint, ) -> ::c_int2056     pub fn mq_send(
2057         mqd: ::mqd_t,
2058         msg_ptr: *const ::c_char,
2059         msg_len: ::size_t,
2060         msg_prio: ::c_uint,
2061     ) -> ::c_int;
mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int2062     pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
mq_setattr( mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr, ) -> ::c_int2063     pub fn mq_setattr(
2064         mqd: ::mqd_t,
2065         newattr: *const ::mq_attr,
2066         oldattr: *mut ::mq_attr,
2067     ) -> ::c_int;
epoll_pwait( epfd: ::c_int, events: *mut ::epoll_event, maxevents: ::c_int, timeout: ::c_int, sigmask: *const ::sigset_t, ) -> ::c_int2068     pub fn epoll_pwait(
2069         epfd: ::c_int,
2070         events: *mut ::epoll_event,
2071         maxevents: ::c_int,
2072         timeout: ::c_int,
2073         sigmask: *const ::sigset_t,
2074     ) -> ::c_int;
sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int2075     pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
sigtimedwait( set: *const sigset_t, info: *mut siginfo_t, timeout: *const ::timespec, ) -> ::c_int2076     pub fn sigtimedwait(
2077         set: *const sigset_t,
2078         info: *mut siginfo_t,
2079         timeout: *const ::timespec,
2080     ) -> ::c_int;
sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int2081     pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char2082     pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t)
2083         -> *mut ::c_char;
prlimit( pid: ::pid_t, resource: ::c_int, new_limit: *const ::rlimit, old_limit: *mut ::rlimit, ) -> ::c_int2084     pub fn prlimit(
2085         pid: ::pid_t,
2086         resource: ::c_int,
2087         new_limit: *const ::rlimit,
2088         old_limit: *mut ::rlimit,
2089     ) -> ::c_int;
prlimit64( pid: ::pid_t, resource: ::c_int, new_limit: *const ::rlimit64, old_limit: *mut ::rlimit64, ) -> ::c_int2090     pub fn prlimit64(
2091         pid: ::pid_t,
2092         resource: ::c_int,
2093         new_limit: *const ::rlimit64,
2094         old_limit: *mut ::rlimit64,
2095     ) -> ::c_int;
reboot(how_to: ::c_int) -> ::c_int2096     pub fn reboot(how_to: ::c_int) -> ::c_int;
setfsgid(gid: ::gid_t) -> ::c_int2097     pub fn setfsgid(gid: ::gid_t) -> ::c_int;
setfsuid(uid: ::uid_t) -> ::c_int2098     pub fn setfsuid(uid: ::uid_t) -> ::c_int;
setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int2099     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_int2100     pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
2101 
2102     // Not available now on Android
mkfifoat( dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t, ) -> ::c_int2103     pub fn mkfifoat(
2104         dirfd: ::c_int,
2105         pathname: *const ::c_char,
2106         mode: ::mode_t,
2107     ) -> ::c_int;
if_nameindex() -> *mut if_nameindex2108     pub fn if_nameindex() -> *mut if_nameindex;
if_freenameindex(ptr: *mut if_nameindex)2109     pub fn if_freenameindex(ptr: *mut if_nameindex);
sync_file_range( fd: ::c_int, offset: ::off64_t, nbytes: ::off64_t, flags: ::c_uint, ) -> ::c_int2110     pub fn sync_file_range(
2111         fd: ::c_int,
2112         offset: ::off64_t,
2113         nbytes: ::off64_t,
2114         flags: ::c_uint,
2115     ) -> ::c_int;
getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int2116     pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
freeifaddrs(ifa: *mut ::ifaddrs)2117     pub fn freeifaddrs(ifa: *mut ::ifaddrs);
2118 
mremap( addr: *mut ::c_void, len: ::size_t, new_len: ::size_t, flags: ::c_int, ... ) -> *mut ::c_void2119     pub fn mremap(
2120         addr: *mut ::c_void,
2121         len: ::size_t,
2122         new_len: ::size_t,
2123         flags: ::c_int,
2124         ...
2125     ) -> *mut ::c_void;
2126 
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_int2127     pub fn glob(
2128         pattern: *const c_char,
2129         flags: ::c_int,
2130         errfunc: ::Option<
2131             extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int,
2132         >,
2133         pglob: *mut ::glob_t,
2134     ) -> ::c_int;
globfree(pglob: *mut ::glob_t)2135     pub fn globfree(pglob: *mut ::glob_t);
2136 
shm_unlink(name: *const ::c_char) -> ::c_int2137     pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
2138 
seekdir(dirp: *mut ::DIR, loc: ::c_long)2139     pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
2140 
dirfd(dirp: *mut ::DIR) -> ::c_int2141     pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
2142 
telldir(dirp: *mut ::DIR) -> ::c_long2143     pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
madvise( addr: *mut ::c_void, len: ::size_t, advice: ::c_int, ) -> ::c_int2144     pub fn madvise(
2145         addr: *mut ::c_void,
2146         len: ::size_t,
2147         advice: ::c_int,
2148     ) -> ::c_int;
2149 
msync( addr: *mut ::c_void, len: ::size_t, flags: ::c_int, ) -> ::c_int2150     pub fn msync(
2151         addr: *mut ::c_void,
2152         len: ::size_t,
2153         flags: ::c_int,
2154     ) -> ::c_int;
2155 
recvfrom( socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int, addr: *mut ::sockaddr, addrlen: *mut ::socklen_t, ) -> ::ssize_t2156     pub fn recvfrom(
2157         socket: ::c_int,
2158         buf: *mut ::c_void,
2159         len: ::size_t,
2160         flags: ::c_int,
2161         addr: *mut ::sockaddr,
2162         addrlen: *mut ::socklen_t,
2163     ) -> ::ssize_t;
nl_langinfo(item: ::nl_item) -> *mut ::c_char2164     pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
2165 
bind( socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t, ) -> ::c_int2166     pub fn bind(
2167         socket: ::c_int,
2168         address: *const ::sockaddr,
2169         address_len: ::socklen_t,
2170     ) -> ::c_int;
2171 
writev( fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, ) -> ::ssize_t2172     pub fn writev(
2173         fd: ::c_int,
2174         iov: *const ::iovec,
2175         iovcnt: ::c_int,
2176     ) -> ::ssize_t;
readv( fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, ) -> ::ssize_t2177     pub fn readv(
2178         fd: ::c_int,
2179         iov: *const ::iovec,
2180         iovcnt: ::c_int,
2181     ) -> ::ssize_t;
2182 
sendmsg( fd: ::c_int, msg: *const ::msghdr, flags: ::c_int, ) -> ::ssize_t2183     pub fn sendmsg(
2184         fd: ::c_int,
2185         msg: *const ::msghdr,
2186         flags: ::c_int,
2187     ) -> ::ssize_t;
recvmsg( fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int, ) -> ::ssize_t2188     pub fn recvmsg(
2189         fd: ::c_int,
2190         msg: *mut ::msghdr,
2191         flags: ::c_int,
2192     ) -> ::ssize_t;
getgrgid_r( gid: ::gid_t, grp: *mut ::group, buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut ::group, ) -> ::c_int2193     pub fn getgrgid_r(
2194         gid: ::gid_t,
2195         grp: *mut ::group,
2196         buf: *mut ::c_char,
2197         buflen: ::size_t,
2198         result: *mut *mut ::group,
2199     ) -> ::c_int;
sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int2200     pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
sem_close(sem: *mut sem_t) -> ::c_int2201     pub fn sem_close(sem: *mut sem_t) -> ::c_int;
getdtablesize() -> ::c_int2202     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_int2203     pub fn getgrnam_r(
2204         name: *const ::c_char,
2205         grp: *mut ::group,
2206         buf: *mut ::c_char,
2207         buflen: ::size_t,
2208         result: *mut *mut ::group,
2209     ) -> ::c_int;
pthread_sigmask( how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t, ) -> ::c_int2210     pub fn pthread_sigmask(
2211         how: ::c_int,
2212         set: *const sigset_t,
2213         oldset: *mut sigset_t,
2214     ) -> ::c_int;
sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t2215     pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
getgrnam(name: *const ::c_char) -> *mut ::group2216     pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int2217     pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
sem_unlink(name: *const ::c_char) -> ::c_int2218     pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int2219     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_int2220     pub fn getpwnam_r(
2221         name: *const ::c_char,
2222         pwd: *mut passwd,
2223         buf: *mut ::c_char,
2224         buflen: ::size_t,
2225         result: *mut *mut passwd,
2226     ) -> ::c_int;
getpwuid_r( uid: ::uid_t, pwd: *mut passwd, buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut passwd, ) -> ::c_int2227     pub fn getpwuid_r(
2228         uid: ::uid_t,
2229         pwd: *mut passwd,
2230         buf: *mut ::c_char,
2231         buflen: ::size_t,
2232         result: *mut *mut passwd,
2233     ) -> ::c_int;
sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int2234     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_int2235     pub fn pthread_atfork(
2236         prepare: ::Option<unsafe extern "C" fn()>,
2237         parent: ::Option<unsafe extern "C" fn()>,
2238         child: ::Option<unsafe extern "C" fn()>,
2239     ) -> ::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_int2240     pub fn pthread_create(
2241         native: *mut ::pthread_t,
2242         attr: *const ::pthread_attr_t,
2243         f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
2244         value: *mut ::c_void,
2245     ) -> ::c_int;
getgrgid(gid: ::gid_t) -> *mut ::group2246     pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE2247     pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
uname(buf: *mut ::utsname) -> ::c_int2248     pub fn uname(buf: *mut ::utsname) -> ::c_int;
2249 }
2250 
2251 cfg_if! {
2252     if #[cfg(any(target_arch = "mips", target_arch = "mips64"))] {
2253         mod mips;
2254         pub use self::mips::*;
2255     } else if #[cfg(target_arch = "x86_64")] {
2256         mod x86_64;
2257         pub use self::x86_64::*;
2258     } else if #[cfg(target_arch = "arm")] {
2259         mod arm;
2260         pub use self::arm::*;
2261     } else {
2262         pub use unsupported_target;
2263     }
2264 }
2265 
2266 cfg_if! {
2267     if #[cfg(libc_align)] {
2268         #[macro_use]
2269         mod align;
2270     } else {
2271         #[macro_use]
2272         mod no_align;
2273     }
2274 }
2275 
2276 expand_align!();
2277