1 pub type sa_family_t = u16;
2 pub type speed_t = ::c_uint;
3 pub type tcflag_t = ::c_uint;
4 pub type clockid_t = ::c_int;
5 pub type key_t = ::c_int;
6 pub type id_t = ::c_uint;
7 
8 #[cfg_attr(feature = "extra_traits", derive(Debug))]
9 pub enum timezone {}
10 impl ::Copy for timezone {}
11 impl ::Clone for timezone {
12     fn clone(&self) -> timezone {
13         *self
14     }
15 }
16 
17 s! {
18     pub struct in_addr {
19         pub s_addr: ::in_addr_t,
20     }
21 
22     pub struct ip_mreq {
23         pub imr_multiaddr: in_addr,
24         pub imr_interface: in_addr,
25     }
26 
27     pub struct ip_mreq_source {
28         pub imr_multiaddr: in_addr,
29         pub imr_interface: in_addr,
30         pub imr_sourceaddr: in_addr,
31     }
32 
33     pub struct sockaddr {
34         pub sa_family: sa_family_t,
35         pub sa_data: [::c_char; 14],
36     }
37 
38     pub struct sockaddr_in {
39         pub sin_family: sa_family_t,
40         pub sin_port: ::in_port_t,
41         pub sin_addr: ::in_addr,
42         pub sin_zero: [u8; 8],
43     }
44 
45     pub struct sockaddr_in6 {
46         pub sin6_family: sa_family_t,
47         pub sin6_port: ::in_port_t,
48         pub sin6_flowinfo: u32,
49         pub sin6_addr: ::in6_addr,
50         pub sin6_scope_id: u32,
51     }
52 
53     pub struct addrinfo {
54         pub ai_flags: ::c_int,
55         pub ai_family: ::c_int,
56         pub ai_socktype: ::c_int,
57         pub ai_protocol: ::c_int,
58         pub ai_addrlen: socklen_t,
59 
60         #[cfg(any(target_os = "linux",
61                   target_os = "emscripten"))]
62         pub ai_addr: *mut ::sockaddr,
63 
64         pub ai_canonname: *mut c_char,
65 
66         #[cfg(target_os = "android")]
67         pub ai_addr: *mut ::sockaddr,
68 
69         pub ai_next: *mut addrinfo,
70     }
71 
72     pub struct sockaddr_ll {
73         pub sll_family: ::c_ushort,
74         pub sll_protocol: ::c_ushort,
75         pub sll_ifindex: ::c_int,
76         pub sll_hatype: ::c_ushort,
77         pub sll_pkttype: ::c_uchar,
78         pub sll_halen: ::c_uchar,
79         pub sll_addr: [::c_uchar; 8]
80     }
81 
82     pub struct fd_set {
83         fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
84     }
85 
86     pub struct tm {
87         pub tm_sec: ::c_int,
88         pub tm_min: ::c_int,
89         pub tm_hour: ::c_int,
90         pub tm_mday: ::c_int,
91         pub tm_mon: ::c_int,
92         pub tm_year: ::c_int,
93         pub tm_wday: ::c_int,
94         pub tm_yday: ::c_int,
95         pub tm_isdst: ::c_int,
96         pub tm_gmtoff: ::c_long,
97         pub tm_zone: *const ::c_char,
98     }
99 
100     pub struct sched_param {
101         pub sched_priority: ::c_int,
102         #[cfg(any(target_env = "musl", target_os = "emscripten"))]
103         pub sched_ss_low_priority: ::c_int,
104         #[cfg(any(target_env = "musl", target_os = "emscripten"))]
105         pub sched_ss_repl_period: ::timespec,
106         #[cfg(any(target_env = "musl", target_os = "emscripten"))]
107         pub sched_ss_init_budget: ::timespec,
108         #[cfg(any(target_env = "musl", target_os = "emscripten"))]
109         pub sched_ss_max_repl: ::c_int,
110     }
111 
112     pub struct Dl_info {
113         pub dli_fname: *const ::c_char,
114         pub dli_fbase: *mut ::c_void,
115         pub dli_sname: *const ::c_char,
116         pub dli_saddr: *mut ::c_void,
117     }
118 
119     pub struct lconv {
120         pub decimal_point: *mut ::c_char,
121         pub thousands_sep: *mut ::c_char,
122         pub grouping: *mut ::c_char,
123         pub int_curr_symbol: *mut ::c_char,
124         pub currency_symbol: *mut ::c_char,
125         pub mon_decimal_point: *mut ::c_char,
126         pub mon_thousands_sep: *mut ::c_char,
127         pub mon_grouping: *mut ::c_char,
128         pub positive_sign: *mut ::c_char,
129         pub negative_sign: *mut ::c_char,
130         pub int_frac_digits: ::c_char,
131         pub frac_digits: ::c_char,
132         pub p_cs_precedes: ::c_char,
133         pub p_sep_by_space: ::c_char,
134         pub n_cs_precedes: ::c_char,
135         pub n_sep_by_space: ::c_char,
136         pub p_sign_posn: ::c_char,
137         pub n_sign_posn: ::c_char,
138         pub int_p_cs_precedes: ::c_char,
139         pub int_p_sep_by_space: ::c_char,
140         pub int_n_cs_precedes: ::c_char,
141         pub int_n_sep_by_space: ::c_char,
142         pub int_p_sign_posn: ::c_char,
143         pub int_n_sign_posn: ::c_char,
144     }
145 
146     pub struct in_pktinfo {
147         pub ipi_ifindex: ::c_int,
148         pub ipi_spec_dst: ::in_addr,
149         pub ipi_addr: ::in_addr,
150     }
151 
152     pub struct ifaddrs {
153         pub ifa_next: *mut ifaddrs,
154         pub ifa_name: *mut c_char,
155         pub ifa_flags: ::c_uint,
156         pub ifa_addr: *mut ::sockaddr,
157         pub ifa_netmask: *mut ::sockaddr,
158         pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union
159         pub ifa_data: *mut ::c_void
160     }
161 
162     pub struct in6_rtmsg {
163         rtmsg_dst: ::in6_addr,
164         rtmsg_src: ::in6_addr,
165         rtmsg_gateway: ::in6_addr,
166         rtmsg_type: u32,
167         rtmsg_dst_len: u16,
168         rtmsg_src_len: u16,
169         rtmsg_metric: u32,
170         rtmsg_info: ::c_ulong,
171         rtmsg_flags: u32,
172         rtmsg_ifindex: ::c_int,
173     }
174 
175     pub struct arpreq {
176         pub arp_pa: ::sockaddr,
177         pub arp_ha: ::sockaddr,
178         pub arp_flags: ::c_int,
179         pub arp_netmask: ::sockaddr,
180         pub arp_dev: [::c_char; 16],
181     }
182 
183     pub struct arpreq_old {
184         pub arp_pa: ::sockaddr,
185         pub arp_ha: ::sockaddr,
186         pub arp_flags: ::c_int,
187         pub arp_netmask: ::sockaddr,
188     }
189 
190     pub struct arphdr {
191         pub ar_hrd: u16,
192         pub ar_pro: u16,
193         pub ar_hln: u8,
194         pub ar_pln: u8,
195         pub ar_op: u16,
196     }
197 
198     pub struct mmsghdr {
199         pub msg_hdr: ::msghdr,
200         pub msg_len: ::c_uint,
201     }
202 }
203 
204 s_no_extra_traits! {
205     #[cfg_attr(
206         any(
207             all(
208                 target_arch = "x86",
209                 not(target_env = "musl"),
210                 not(target_os = "android")),
211             target_arch = "x86_64"),
212         repr(packed))]
213     pub struct epoll_event {
214         pub events: u32,
215         pub u64: u64,
216     }
217 
218     pub struct sockaddr_un {
219         pub sun_family: sa_family_t,
220         pub sun_path: [::c_char; 108]
221     }
222 
223     pub struct sockaddr_storage {
224         pub ss_family: sa_family_t,
225         __ss_align: ::size_t,
226         #[cfg(target_pointer_width = "32")]
227         __ss_pad2: [u8; 128 - 2 * 4],
228         #[cfg(target_pointer_width = "64")]
229         __ss_pad2: [u8; 128 - 2 * 8],
230     }
231 
232     pub struct utsname {
233         pub sysname: [::c_char; 65],
234         pub nodename: [::c_char; 65],
235         pub release: [::c_char; 65],
236         pub version: [::c_char; 65],
237         pub machine: [::c_char; 65],
238         pub domainname: [::c_char; 65]
239     }
240 
241     pub struct sigevent {
242         pub sigev_value: ::sigval,
243         pub sigev_signo: ::c_int,
244         pub sigev_notify: ::c_int,
245         // Actually a union.  We only expose sigev_notify_thread_id because it's
246         // the most useful member
247         pub sigev_notify_thread_id: ::c_int,
248         #[cfg(target_pointer_width = "64")]
249         __unused1: [::c_int; 11],
250         #[cfg(target_pointer_width = "32")]
251         __unused1: [::c_int; 12]
252     }
253 }
254 
255 cfg_if! {
256     if #[cfg(feature = "extra_traits")] {
257         impl PartialEq for epoll_event {
258             fn eq(&self, other: &epoll_event) -> bool {
259                 self.events == other.events
260                     && self.u64 == other.u64
261             }
262         }
263         impl Eq for epoll_event {}
264         impl ::fmt::Debug for epoll_event {
265             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
266                 let events = self.events;
267                 let u64 = self.u64;
268                 f.debug_struct("epoll_event")
269                     .field("events", &events)
270                     .field("u64", &u64)
271                     .finish()
272             }
273         }
274         impl ::hash::Hash for epoll_event {
275             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
276                 let events = self.events;
277                 let u64 = self.u64;
278                 events.hash(state);
279                 u64.hash(state);
280             }
281         }
282 
283         impl PartialEq for sockaddr_un {
284             fn eq(&self, other: &sockaddr_un) -> bool {
285                 self.sun_family == other.sun_family
286                     && self
287                     .sun_path
288                     .iter()
289                     .zip(other.sun_path.iter())
290                     .all(|(a, b)| a == b)
291             }
292         }
293         impl Eq for sockaddr_un {}
294         impl ::fmt::Debug for sockaddr_un {
295             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
296                 f.debug_struct("sockaddr_un")
297                     .field("sun_family", &self.sun_family)
298                 // FIXME: .field("sun_path", &self.sun_path)
299                     .finish()
300             }
301         }
302         impl ::hash::Hash for sockaddr_un {
303             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
304                 self.sun_family.hash(state);
305                 self.sun_path.hash(state);
306             }
307         }
308 
309         impl PartialEq for sockaddr_storage {
310             fn eq(&self, other: &sockaddr_storage) -> bool {
311                 self.ss_family == other.ss_family
312                     && self
313                     .__ss_pad2
314                     .iter()
315                     .zip(other.__ss_pad2.iter())
316                     .all(|(a, b)| a == b)
317             }
318         }
319 
320         impl Eq for sockaddr_storage {}
321 
322         impl ::fmt::Debug for sockaddr_storage {
323             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
324                 f.debug_struct("sockaddr_storage")
325                     .field("ss_family", &self.ss_family)
326                     .field("__ss_align", &self.__ss_align)
327                 // FIXME: .field("__ss_pad2", &self.__ss_pad2)
328                     .finish()
329             }
330         }
331 
332         impl ::hash::Hash for sockaddr_storage {
333             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
334                 self.ss_family.hash(state);
335                 self.__ss_pad2.hash(state);
336             }
337         }
338 
339         impl PartialEq for utsname {
340             fn eq(&self, other: &utsname) -> bool {
341                 self.sysname
342                     .iter()
343                     .zip(other.sysname.iter())
344                     .all(|(a, b)| a == b)
345                     && self
346                     .nodename
347                     .iter()
348                     .zip(other.nodename.iter())
349                     .all(|(a, b)| a == b)
350                     && self
351                     .release
352                     .iter()
353                     .zip(other.release.iter())
354                     .all(|(a, b)| a == b)
355                     && self
356                     .version
357                     .iter()
358                     .zip(other.version.iter())
359                     .all(|(a, b)| a == b)
360                     && self
361                     .machine
362                     .iter()
363                     .zip(other.machine.iter())
364                     .all(|(a, b)| a == b)
365                     && self
366                     .domainname
367                     .iter()
368                     .zip(other.domainname.iter())
369                     .all(|(a, b)| a == b)
370             }
371         }
372 
373         impl Eq for utsname {}
374 
375         impl ::fmt::Debug for utsname {
376             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
377                 f.debug_struct("utsname")
378                 // FIXME: .field("sysname", &self.sysname)
379                 // FIXME: .field("nodename", &self.nodename)
380                 // FIXME: .field("release", &self.release)
381                 // FIXME: .field("version", &self.version)
382                 // FIXME: .field("machine", &self.machine)
383                 // FIXME: .field("domainname", &self.domainname)
384                     .finish()
385             }
386         }
387 
388         impl ::hash::Hash for utsname {
389             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
390                 self.sysname.hash(state);
391                 self.nodename.hash(state);
392                 self.release.hash(state);
393                 self.version.hash(state);
394                 self.machine.hash(state);
395                 self.domainname.hash(state);
396             }
397         }
398 
399         impl PartialEq for sigevent {
400             fn eq(&self, other: &sigevent) -> bool {
401                 self.sigev_value == other.sigev_value
402                     && self.sigev_signo == other.sigev_signo
403                     && self.sigev_notify == other.sigev_notify
404                     && self.sigev_notify_thread_id
405                         == other.sigev_notify_thread_id
406             }
407         }
408         impl Eq for sigevent {}
409         impl ::fmt::Debug for sigevent {
410             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
411                 f.debug_struct("sigevent")
412                     .field("sigev_value", &self.sigev_value)
413                     .field("sigev_signo", &self.sigev_signo)
414                     .field("sigev_notify", &self.sigev_notify)
415                     .field("sigev_notify_thread_id",
416                            &self.sigev_notify_thread_id)
417                     .finish()
418             }
419         }
420         impl ::hash::Hash for sigevent {
421             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
422                 self.sigev_value.hash(state);
423                 self.sigev_signo.hash(state);
424                 self.sigev_notify.hash(state);
425                 self.sigev_notify_thread_id.hash(state);
426             }
427         }
428     }
429 }
430 
431 // intentionally not public, only used for fd_set
432 cfg_if! {
433     if #[cfg(target_pointer_width = "32")] {
434         const ULONG_SIZE: usize = 32;
435     } else if #[cfg(target_pointer_width = "64")] {
436         const ULONG_SIZE: usize = 64;
437     } else {
438         // Unknown target_pointer_width
439     }
440 }
441 
442 pub const EXIT_FAILURE: ::c_int = 1;
443 pub const EXIT_SUCCESS: ::c_int = 0;
444 pub const RAND_MAX: ::c_int = 2147483647;
445 pub const EOF: ::c_int = -1;
446 pub const SEEK_SET: ::c_int = 0;
447 pub const SEEK_CUR: ::c_int = 1;
448 pub const SEEK_END: ::c_int = 2;
449 pub const _IOFBF: ::c_int = 0;
450 pub const _IONBF: ::c_int = 2;
451 pub const _IOLBF: ::c_int = 1;
452 
453 pub const F_DUPFD: ::c_int = 0;
454 pub const F_GETFD: ::c_int = 1;
455 pub const F_SETFD: ::c_int = 2;
456 pub const F_GETFL: ::c_int = 3;
457 pub const F_SETFL: ::c_int = 4;
458 
459 // Linux-specific fcntls
460 pub const F_SETLEASE: ::c_int = 1024;
461 pub const F_GETLEASE: ::c_int = 1025;
462 pub const F_NOTIFY: ::c_int = 1026;
463 pub const F_CANCELLK: ::c_int = 1029;
464 pub const F_DUPFD_CLOEXEC: ::c_int = 1030;
465 pub const F_SETPIPE_SZ: ::c_int = 1031;
466 pub const F_GETPIPE_SZ: ::c_int = 1032;
467 pub const F_ADD_SEALS: ::c_int = 1033;
468 pub const F_GET_SEALS: ::c_int = 1034;
469 
470 pub const F_SEAL_SEAL: ::c_int = 0x0001;
471 pub const F_SEAL_SHRINK: ::c_int = 0x0002;
472 pub const F_SEAL_GROW: ::c_int = 0x0004;
473 pub const F_SEAL_WRITE: ::c_int = 0x0008;
474 
475 // FIXME(#235): Include file sealing fcntls once we have a way to verify them.
476 
477 pub const SIGTRAP: ::c_int = 5;
478 
479 pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
480 pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
481 
482 pub const CLOCK_REALTIME: ::clockid_t = 0;
483 pub const CLOCK_MONOTONIC: ::clockid_t = 1;
484 pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
485 pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 3;
486 pub const CLOCK_MONOTONIC_RAW: ::clockid_t = 4;
487 pub const CLOCK_REALTIME_COARSE: ::clockid_t = 5;
488 pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = 6;
489 pub const CLOCK_BOOTTIME: ::clockid_t = 7;
490 pub const CLOCK_REALTIME_ALARM: ::clockid_t = 8;
491 pub const CLOCK_BOOTTIME_ALARM: ::clockid_t = 9;
492 pub const CLOCK_TAI: ::clockid_t = 11;
493 pub const TIMER_ABSTIME: ::c_int = 1;
494 
495 pub const RUSAGE_SELF: ::c_int = 0;
496 
497 pub const O_RDONLY: ::c_int = 0;
498 pub const O_WRONLY: ::c_int = 1;
499 pub const O_RDWR: ::c_int = 2;
500 
501 pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC;
502 
503 pub const S_IFIFO: ::mode_t = 4096;
504 pub const S_IFCHR: ::mode_t = 8192;
505 pub const S_IFBLK: ::mode_t = 24576;
506 pub const S_IFDIR: ::mode_t = 16384;
507 pub const S_IFREG: ::mode_t = 32768;
508 pub const S_IFLNK: ::mode_t = 40960;
509 pub const S_IFSOCK: ::mode_t = 49152;
510 pub const S_IFMT: ::mode_t = 61440;
511 pub const S_IRWXU: ::mode_t = 448;
512 pub const S_IXUSR: ::mode_t = 64;
513 pub const S_IWUSR: ::mode_t = 128;
514 pub const S_IRUSR: ::mode_t = 256;
515 pub const S_IRWXG: ::mode_t = 56;
516 pub const S_IXGRP: ::mode_t = 8;
517 pub const S_IWGRP: ::mode_t = 16;
518 pub const S_IRGRP: ::mode_t = 32;
519 pub const S_IRWXO: ::mode_t = 7;
520 pub const S_IXOTH: ::mode_t = 1;
521 pub const S_IWOTH: ::mode_t = 2;
522 pub const S_IROTH: ::mode_t = 4;
523 pub const F_OK: ::c_int = 0;
524 pub const R_OK: ::c_int = 4;
525 pub const W_OK: ::c_int = 2;
526 pub const X_OK: ::c_int = 1;
527 pub const STDIN_FILENO: ::c_int = 0;
528 pub const STDOUT_FILENO: ::c_int = 1;
529 pub const STDERR_FILENO: ::c_int = 2;
530 pub const SIGHUP: ::c_int = 1;
531 pub const SIGINT: ::c_int = 2;
532 pub const SIGQUIT: ::c_int = 3;
533 pub const SIGILL: ::c_int = 4;
534 pub const SIGABRT: ::c_int = 6;
535 pub const SIGFPE: ::c_int = 8;
536 pub const SIGKILL: ::c_int = 9;
537 pub const SIGSEGV: ::c_int = 11;
538 pub const SIGPIPE: ::c_int = 13;
539 pub const SIGALRM: ::c_int = 14;
540 pub const SIGTERM: ::c_int = 15;
541 
542 pub const PROT_NONE: ::c_int = 0;
543 pub const PROT_READ: ::c_int = 1;
544 pub const PROT_WRITE: ::c_int = 2;
545 pub const PROT_EXEC: ::c_int = 4;
546 
547 pub const LC_CTYPE: ::c_int = 0;
548 pub const LC_NUMERIC: ::c_int = 1;
549 pub const LC_TIME: ::c_int = 2;
550 pub const LC_COLLATE: ::c_int = 3;
551 pub const LC_MONETARY: ::c_int = 4;
552 pub const LC_MESSAGES: ::c_int = 5;
553 pub const LC_ALL: ::c_int = 6;
554 pub const LC_CTYPE_MASK: ::c_int = 1 << LC_CTYPE;
555 pub const LC_NUMERIC_MASK: ::c_int = 1 << LC_NUMERIC;
556 pub const LC_TIME_MASK: ::c_int = 1 << LC_TIME;
557 pub const LC_COLLATE_MASK: ::c_int = 1 << LC_COLLATE;
558 pub const LC_MONETARY_MASK: ::c_int = 1 << LC_MONETARY;
559 pub const LC_MESSAGES_MASK: ::c_int = 1 << LC_MESSAGES;
560 // LC_ALL_MASK defined per platform
561 
562 pub const MAP_FILE: ::c_int = 0x0000;
563 pub const MAP_SHARED: ::c_int = 0x0001;
564 pub const MAP_PRIVATE: ::c_int = 0x0002;
565 pub const MAP_FIXED: ::c_int = 0x0010;
566 
567 pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
568 
569 // MS_ flags for msync(2)
570 pub const MS_ASYNC: ::c_int = 0x0001;
571 pub const MS_INVALIDATE: ::c_int = 0x0002;
572 pub const MS_SYNC: ::c_int = 0x0004;
573 
574 // MS_ flags for mount(2)
575 pub const MS_RDONLY: ::c_ulong = 0x01;
576 pub const MS_NOSUID: ::c_ulong = 0x02;
577 pub const MS_NODEV: ::c_ulong = 0x04;
578 pub const MS_NOEXEC: ::c_ulong = 0x08;
579 pub const MS_SYNCHRONOUS: ::c_ulong = 0x10;
580 pub const MS_REMOUNT: ::c_ulong = 0x20;
581 pub const MS_MANDLOCK: ::c_ulong = 0x40;
582 pub const MS_DIRSYNC: ::c_ulong = 0x80;
583 pub const MS_NOATIME: ::c_ulong = 0x0400;
584 pub const MS_NODIRATIME: ::c_ulong = 0x0800;
585 pub const MS_BIND: ::c_ulong = 0x1000;
586 pub const MS_MOVE: ::c_ulong = 0x2000;
587 pub const MS_REC: ::c_ulong = 0x4000;
588 pub const MS_SILENT: ::c_ulong = 0x8000;
589 pub const MS_POSIXACL: ::c_ulong = 0x010000;
590 pub const MS_UNBINDABLE: ::c_ulong = 0x020000;
591 pub const MS_PRIVATE: ::c_ulong = 0x040000;
592 pub const MS_SLAVE: ::c_ulong = 0x080000;
593 pub const MS_SHARED: ::c_ulong = 0x100000;
594 pub const MS_RELATIME: ::c_ulong = 0x200000;
595 pub const MS_KERNMOUNT: ::c_ulong = 0x400000;
596 pub const MS_I_VERSION: ::c_ulong = 0x800000;
597 pub const MS_STRICTATIME: ::c_ulong = 0x1000000;
598 pub const MS_ACTIVE: ::c_ulong = 0x40000000;
599 pub const MS_MGC_VAL: ::c_ulong = 0xc0ed0000;
600 pub const MS_MGC_MSK: ::c_ulong = 0xffff0000;
601 
602 pub const SCM_RIGHTS: ::c_int = 0x01;
603 pub const SCM_CREDENTIALS: ::c_int = 0x02;
604 
605 pub const PROT_GROWSDOWN: ::c_int = 0x1000000;
606 pub const PROT_GROWSUP: ::c_int = 0x2000000;
607 
608 pub const MAP_TYPE: ::c_int = 0x000f;
609 
610 pub const MADV_NORMAL: ::c_int = 0;
611 pub const MADV_RANDOM: ::c_int = 1;
612 pub const MADV_SEQUENTIAL: ::c_int = 2;
613 pub const MADV_WILLNEED: ::c_int = 3;
614 pub const MADV_DONTNEED: ::c_int = 4;
615 pub const MADV_FREE: ::c_int = 8;
616 pub const MADV_REMOVE: ::c_int = 9;
617 pub const MADV_DONTFORK: ::c_int = 10;
618 pub const MADV_DOFORK: ::c_int = 11;
619 pub const MADV_MERGEABLE: ::c_int = 12;
620 pub const MADV_UNMERGEABLE: ::c_int = 13;
621 pub const MADV_HUGEPAGE: ::c_int = 14;
622 pub const MADV_NOHUGEPAGE: ::c_int = 15;
623 pub const MADV_DONTDUMP: ::c_int = 16;
624 pub const MADV_DODUMP: ::c_int = 17;
625 pub const MADV_HWPOISON: ::c_int = 100;
626 
627 pub const IFF_UP: ::c_int = 0x1;
628 pub const IFF_BROADCAST: ::c_int = 0x2;
629 pub const IFF_DEBUG: ::c_int = 0x4;
630 pub const IFF_LOOPBACK: ::c_int = 0x8;
631 pub const IFF_POINTOPOINT: ::c_int = 0x10;
632 pub const IFF_NOTRAILERS: ::c_int = 0x20;
633 pub const IFF_RUNNING: ::c_int = 0x40;
634 pub const IFF_NOARP: ::c_int = 0x80;
635 pub const IFF_PROMISC: ::c_int = 0x100;
636 pub const IFF_ALLMULTI: ::c_int = 0x200;
637 pub const IFF_MASTER: ::c_int = 0x400;
638 pub const IFF_SLAVE: ::c_int = 0x800;
639 pub const IFF_MULTICAST: ::c_int = 0x1000;
640 pub const IFF_PORTSEL: ::c_int = 0x2000;
641 pub const IFF_AUTOMEDIA: ::c_int = 0x4000;
642 pub const IFF_DYNAMIC: ::c_int = 0x8000;
643 
644 pub const SOL_IP: ::c_int = 0;
645 pub const SOL_TCP: ::c_int = 6;
646 pub const SOL_UDP: ::c_int = 17;
647 pub const SOL_IPV6: ::c_int = 41;
648 pub const SOL_ICMPV6: ::c_int = 58;
649 pub const SOL_RAW: ::c_int = 255;
650 pub const SOL_DECNET: ::c_int = 261;
651 pub const SOL_X25: ::c_int = 262;
652 pub const SOL_PACKET: ::c_int = 263;
653 pub const SOL_ATM: ::c_int = 264;
654 pub const SOL_AAL: ::c_int = 265;
655 pub const SOL_IRDA: ::c_int = 266;
656 pub const SOL_NETBEUI: ::c_int = 267;
657 pub const SOL_LLC: ::c_int = 268;
658 pub const SOL_DCCP: ::c_int = 269;
659 pub const SOL_NETLINK: ::c_int = 270;
660 pub const SOL_TIPC: ::c_int = 271;
661 pub const SOL_BLUETOOTH: ::c_int = 274;
662 pub const SOL_ALG: ::c_int = 279;
663 
664 pub const AF_UNSPEC: ::c_int = 0;
665 pub const AF_UNIX: ::c_int = 1;
666 pub const AF_LOCAL: ::c_int = 1;
667 pub const AF_INET: ::c_int = 2;
668 pub const AF_AX25: ::c_int = 3;
669 pub const AF_IPX: ::c_int = 4;
670 pub const AF_APPLETALK: ::c_int = 5;
671 pub const AF_NETROM: ::c_int = 6;
672 pub const AF_BRIDGE: ::c_int = 7;
673 pub const AF_ATMPVC: ::c_int = 8;
674 pub const AF_X25: ::c_int = 9;
675 pub const AF_INET6: ::c_int = 10;
676 pub const AF_ROSE: ::c_int = 11;
677 pub const AF_DECnet: ::c_int = 12;
678 pub const AF_NETBEUI: ::c_int = 13;
679 pub const AF_SECURITY: ::c_int = 14;
680 pub const AF_KEY: ::c_int = 15;
681 pub const AF_NETLINK: ::c_int = 16;
682 pub const AF_ROUTE: ::c_int = AF_NETLINK;
683 pub const AF_PACKET: ::c_int = 17;
684 pub const AF_ASH: ::c_int = 18;
685 pub const AF_ECONET: ::c_int = 19;
686 pub const AF_ATMSVC: ::c_int = 20;
687 pub const AF_RDS: ::c_int = 21;
688 pub const AF_SNA: ::c_int = 22;
689 pub const AF_IRDA: ::c_int = 23;
690 pub const AF_PPPOX: ::c_int = 24;
691 pub const AF_WANPIPE: ::c_int = 25;
692 pub const AF_LLC: ::c_int = 26;
693 pub const AF_CAN: ::c_int = 29;
694 pub const AF_TIPC: ::c_int = 30;
695 pub const AF_BLUETOOTH: ::c_int = 31;
696 pub const AF_IUCV: ::c_int = 32;
697 pub const AF_RXRPC: ::c_int = 33;
698 pub const AF_ISDN: ::c_int = 34;
699 pub const AF_PHONET: ::c_int = 35;
700 pub const AF_IEEE802154: ::c_int = 36;
701 pub const AF_CAIF: ::c_int = 37;
702 pub const AF_ALG: ::c_int = 38;
703 
704 pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
705 pub const PF_UNIX: ::c_int = AF_UNIX;
706 pub const PF_LOCAL: ::c_int = AF_LOCAL;
707 pub const PF_INET: ::c_int = AF_INET;
708 pub const PF_AX25: ::c_int = AF_AX25;
709 pub const PF_IPX: ::c_int = AF_IPX;
710 pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
711 pub const PF_NETROM: ::c_int = AF_NETROM;
712 pub const PF_BRIDGE: ::c_int = AF_BRIDGE;
713 pub const PF_ATMPVC: ::c_int = AF_ATMPVC;
714 pub const PF_X25: ::c_int = AF_X25;
715 pub const PF_INET6: ::c_int = AF_INET6;
716 pub const PF_ROSE: ::c_int = AF_ROSE;
717 pub const PF_DECnet: ::c_int = AF_DECnet;
718 pub const PF_NETBEUI: ::c_int = AF_NETBEUI;
719 pub const PF_SECURITY: ::c_int = AF_SECURITY;
720 pub const PF_KEY: ::c_int = AF_KEY;
721 pub const PF_NETLINK: ::c_int = AF_NETLINK;
722 pub const PF_ROUTE: ::c_int = AF_ROUTE;
723 pub const PF_PACKET: ::c_int = AF_PACKET;
724 pub const PF_ASH: ::c_int = AF_ASH;
725 pub const PF_ECONET: ::c_int = AF_ECONET;
726 pub const PF_ATMSVC: ::c_int = AF_ATMSVC;
727 pub const PF_RDS: ::c_int = AF_RDS;
728 pub const PF_SNA: ::c_int = AF_SNA;
729 pub const PF_IRDA: ::c_int = AF_IRDA;
730 pub const PF_PPPOX: ::c_int = AF_PPPOX;
731 pub const PF_WANPIPE: ::c_int = AF_WANPIPE;
732 pub const PF_LLC: ::c_int = AF_LLC;
733 pub const PF_CAN: ::c_int = AF_CAN;
734 pub const PF_TIPC: ::c_int = AF_TIPC;
735 pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
736 pub const PF_IUCV: ::c_int = AF_IUCV;
737 pub const PF_RXRPC: ::c_int = AF_RXRPC;
738 pub const PF_ISDN: ::c_int = AF_ISDN;
739 pub const PF_PHONET: ::c_int = AF_PHONET;
740 pub const PF_IEEE802154: ::c_int = AF_IEEE802154;
741 pub const PF_CAIF: ::c_int = AF_CAIF;
742 pub const PF_ALG: ::c_int = AF_ALG;
743 
744 pub const SOMAXCONN: ::c_int = 128;
745 
746 pub const MSG_OOB: ::c_int = 1;
747 pub const MSG_PEEK: ::c_int = 2;
748 pub const MSG_DONTROUTE: ::c_int = 4;
749 pub const MSG_CTRUNC: ::c_int = 8;
750 pub const MSG_TRUNC: ::c_int = 0x20;
751 pub const MSG_DONTWAIT: ::c_int = 0x40;
752 pub const MSG_EOR: ::c_int = 0x80;
753 pub const MSG_WAITALL: ::c_int = 0x100;
754 pub const MSG_FIN: ::c_int = 0x200;
755 pub const MSG_SYN: ::c_int = 0x400;
756 pub const MSG_CONFIRM: ::c_int = 0x800;
757 pub const MSG_RST: ::c_int = 0x1000;
758 pub const MSG_ERRQUEUE: ::c_int = 0x2000;
759 pub const MSG_NOSIGNAL: ::c_int = 0x4000;
760 pub const MSG_MORE: ::c_int = 0x8000;
761 pub const MSG_WAITFORONE: ::c_int = 0x10000;
762 pub const MSG_FASTOPEN: ::c_int = 0x20000000;
763 pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000;
764 
765 pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
766 
767 pub const SOCK_RAW: ::c_int = 3;
768 pub const SOCK_RDM: ::c_int = 4;
769 pub const IP_MULTICAST_IF: ::c_int = 32;
770 pub const IP_MULTICAST_TTL: ::c_int = 33;
771 pub const IP_MULTICAST_LOOP: ::c_int = 34;
772 pub const IP_TOS: ::c_int = 1;
773 pub const IP_TTL: ::c_int = 2;
774 pub const IP_HDRINCL: ::c_int = 3;
775 pub const IP_PKTINFO: ::c_int = 8;
776 pub const IP_MTU_DISCOVER: ::c_int = 10;
777 pub const IP_RECVTOS: ::c_int = 13;
778 pub const IP_RECVERR: ::c_int = 11;
779 pub const IP_ADD_MEMBERSHIP: ::c_int = 35;
780 pub const IP_DROP_MEMBERSHIP: ::c_int = 36;
781 pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 39;
782 pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 40;
783 pub const IP_TRANSPARENT: ::c_int = 19;
784 pub const IPV6_ADDRFORM: ::c_int = 1;
785 pub const IPV6_2292PKTINFO: ::c_int = 2;
786 pub const IPV6_2292HOPOPTS: ::c_int = 3;
787 pub const IPV6_2292DSTOPTS: ::c_int = 4;
788 pub const IPV6_2292RTHDR: ::c_int = 5;
789 pub const IPV6_2292PKTOPTIONS: ::c_int = 6;
790 pub const IPV6_CHECKSUM: ::c_int = 7;
791 pub const IPV6_2292HOPLIMIT: ::c_int = 8;
792 pub const IPV6_NEXTHOP: ::c_int = 9;
793 pub const IPV6_UNICAST_HOPS: ::c_int = 16;
794 pub const IPV6_MULTICAST_IF: ::c_int = 17;
795 pub const IPV6_MULTICAST_HOPS: ::c_int = 18;
796 pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
797 pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20;
798 pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21;
799 pub const IPV6_ROUTER_ALERT: ::c_int = 22;
800 pub const IPV6_MTU_DISCOVER: ::c_int = 23;
801 pub const IPV6_MTU: ::c_int = 24;
802 pub const IPV6_RECVERR: ::c_int = 25;
803 pub const IPV6_V6ONLY: ::c_int = 26;
804 pub const IPV6_JOIN_ANYCAST: ::c_int = 27;
805 pub const IPV6_LEAVE_ANYCAST: ::c_int = 28;
806 pub const IPV6_RECVPKTINFO: ::c_int = 49;
807 pub const IPV6_PKTINFO: ::c_int = 50;
808 pub const IPV6_HOPLIMIT: ::c_int = 52;
809 pub const IPV6_RECVTCLASS: ::c_int = 66;
810 pub const IPV6_TCLASS: ::c_int = 67;
811 
812 pub const IP_PMTUDISC_DONT: ::c_int = 0;
813 pub const IP_PMTUDISC_WANT: ::c_int = 1;
814 pub const IP_PMTUDISC_DO: ::c_int = 2;
815 pub const IP_PMTUDISC_PROBE: ::c_int = 3;
816 
817 pub const TCP_NODELAY: ::c_int = 1;
818 pub const TCP_MAXSEG: ::c_int = 2;
819 pub const TCP_CORK: ::c_int = 3;
820 pub const TCP_KEEPIDLE: ::c_int = 4;
821 pub const TCP_KEEPINTVL: ::c_int = 5;
822 pub const TCP_KEEPCNT: ::c_int = 6;
823 pub const TCP_SYNCNT: ::c_int = 7;
824 pub const TCP_LINGER2: ::c_int = 8;
825 pub const TCP_DEFER_ACCEPT: ::c_int = 9;
826 pub const TCP_WINDOW_CLAMP: ::c_int = 10;
827 pub const TCP_INFO: ::c_int = 11;
828 pub const TCP_QUICKACK: ::c_int = 12;
829 pub const TCP_CONGESTION: ::c_int = 13;
830 
831 pub const SO_DEBUG: ::c_int = 1;
832 
833 pub const SHUT_RD: ::c_int = 0;
834 pub const SHUT_WR: ::c_int = 1;
835 pub const SHUT_RDWR: ::c_int = 2;
836 
837 pub const LOCK_SH: ::c_int = 1;
838 pub const LOCK_EX: ::c_int = 2;
839 pub const LOCK_NB: ::c_int = 4;
840 pub const LOCK_UN: ::c_int = 8;
841 
842 pub const SS_ONSTACK: ::c_int = 1;
843 pub const SS_DISABLE: ::c_int = 2;
844 
845 pub const PATH_MAX: ::c_int = 4096;
846 
847 pub const FD_SETSIZE: usize = 1024;
848 
849 pub const EPOLLIN: ::c_int = 0x1;
850 pub const EPOLLPRI: ::c_int = 0x2;
851 pub const EPOLLOUT: ::c_int = 0x4;
852 pub const EPOLLRDNORM: ::c_int = 0x40;
853 pub const EPOLLRDBAND: ::c_int = 0x80;
854 pub const EPOLLWRNORM: ::c_int = 0x100;
855 pub const EPOLLWRBAND: ::c_int = 0x200;
856 pub const EPOLLMSG: ::c_int = 0x400;
857 pub const EPOLLERR: ::c_int = 0x8;
858 pub const EPOLLHUP: ::c_int = 0x10;
859 pub const EPOLLET: ::c_int = 0x80000000;
860 
861 pub const EPOLL_CTL_ADD: ::c_int = 1;
862 pub const EPOLL_CTL_MOD: ::c_int = 3;
863 pub const EPOLL_CTL_DEL: ::c_int = 2;
864 
865 pub const MNT_DETACH: ::c_int = 0x2;
866 pub const MNT_EXPIRE: ::c_int = 0x4;
867 
868 pub const Q_GETFMT: ::c_int = 0x800004;
869 pub const Q_GETINFO: ::c_int = 0x800005;
870 pub const Q_SETINFO: ::c_int = 0x800006;
871 pub const QIF_BLIMITS: u32 = 1;
872 pub const QIF_SPACE: u32 = 2;
873 pub const QIF_ILIMITS: u32 = 4;
874 pub const QIF_INODES: u32 = 8;
875 pub const QIF_BTIME: u32 = 16;
876 pub const QIF_ITIME: u32 = 32;
877 pub const QIF_LIMITS: u32 = 5;
878 pub const QIF_USAGE: u32 = 10;
879 pub const QIF_TIMES: u32 = 48;
880 pub const QIF_ALL: u32 = 63;
881 
882 pub const MNT_FORCE: ::c_int = 0x1;
883 
884 pub const Q_SYNC: ::c_int = 0x800001;
885 pub const Q_QUOTAON: ::c_int = 0x800002;
886 pub const Q_QUOTAOFF: ::c_int = 0x800003;
887 pub const Q_GETQUOTA: ::c_int = 0x800007;
888 pub const Q_SETQUOTA: ::c_int = 0x800008;
889 
890 pub const TCIOFF: ::c_int = 2;
891 pub const TCION: ::c_int = 3;
892 pub const TCOOFF: ::c_int = 0;
893 pub const TCOON: ::c_int = 1;
894 pub const TCIFLUSH: ::c_int = 0;
895 pub const TCOFLUSH: ::c_int = 1;
896 pub const TCIOFLUSH: ::c_int = 2;
897 pub const NL0: ::tcflag_t = 0x00000000;
898 pub const NL1: ::tcflag_t = 0x00000100;
899 pub const TAB0: ::tcflag_t = 0x00000000;
900 pub const CR0: ::tcflag_t = 0x00000000;
901 pub const FF0: ::tcflag_t = 0x00000000;
902 pub const BS0: ::tcflag_t = 0x00000000;
903 pub const VT0: ::tcflag_t = 0x00000000;
904 pub const VERASE: usize = 2;
905 pub const VKILL: usize = 3;
906 pub const VINTR: usize = 0;
907 pub const VQUIT: usize = 1;
908 pub const VLNEXT: usize = 15;
909 pub const IGNBRK: ::tcflag_t = 0x00000001;
910 pub const BRKINT: ::tcflag_t = 0x00000002;
911 pub const IGNPAR: ::tcflag_t = 0x00000004;
912 pub const PARMRK: ::tcflag_t = 0x00000008;
913 pub const INPCK: ::tcflag_t = 0x00000010;
914 pub const ISTRIP: ::tcflag_t = 0x00000020;
915 pub const INLCR: ::tcflag_t = 0x00000040;
916 pub const IGNCR: ::tcflag_t = 0x00000080;
917 pub const ICRNL: ::tcflag_t = 0x00000100;
918 pub const IXANY: ::tcflag_t = 0x00000800;
919 pub const IMAXBEL: ::tcflag_t = 0x00002000;
920 pub const OPOST: ::tcflag_t = 0x1;
921 pub const CS5: ::tcflag_t = 0x00000000;
922 pub const CRTSCTS: ::tcflag_t = 0x80000000;
923 pub const ECHO: ::tcflag_t = 0x00000008;
924 pub const OCRNL: ::tcflag_t = 0o000010;
925 pub const ONOCR: ::tcflag_t = 0o000020;
926 pub const ONLRET: ::tcflag_t = 0o000040;
927 pub const OFILL: ::tcflag_t = 0o000100;
928 pub const OFDEL: ::tcflag_t = 0o000200;
929 
930 pub const CLONE_VM: ::c_int = 0x100;
931 pub const CLONE_FS: ::c_int = 0x200;
932 pub const CLONE_FILES: ::c_int = 0x400;
933 pub const CLONE_SIGHAND: ::c_int = 0x800;
934 pub const CLONE_PTRACE: ::c_int = 0x2000;
935 pub const CLONE_VFORK: ::c_int = 0x4000;
936 pub const CLONE_PARENT: ::c_int = 0x8000;
937 pub const CLONE_THREAD: ::c_int = 0x10000;
938 pub const CLONE_NEWNS: ::c_int = 0x20000;
939 pub const CLONE_SYSVSEM: ::c_int = 0x40000;
940 pub const CLONE_SETTLS: ::c_int = 0x80000;
941 pub const CLONE_PARENT_SETTID: ::c_int = 0x100000;
942 pub const CLONE_CHILD_CLEARTID: ::c_int = 0x200000;
943 pub const CLONE_DETACHED: ::c_int = 0x400000;
944 pub const CLONE_UNTRACED: ::c_int = 0x800000;
945 pub const CLONE_CHILD_SETTID: ::c_int = 0x01000000;
946 pub const CLONE_NEWUTS: ::c_int = 0x04000000;
947 pub const CLONE_NEWIPC: ::c_int = 0x08000000;
948 pub const CLONE_NEWUSER: ::c_int = 0x10000000;
949 pub const CLONE_NEWPID: ::c_int = 0x20000000;
950 pub const CLONE_NEWNET: ::c_int = 0x40000000;
951 pub const CLONE_IO: ::c_int = 0x80000000;
952 pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
953 
954 pub const WNOHANG: ::c_int = 0x00000001;
955 pub const WUNTRACED: ::c_int = 0x00000002;
956 pub const WSTOPPED: ::c_int = WUNTRACED;
957 pub const WEXITED: ::c_int = 0x00000004;
958 pub const WCONTINUED: ::c_int = 0x00000008;
959 pub const WNOWAIT: ::c_int = 0x01000000;
960 
961 // Options set using PTRACE_SETOPTIONS.
962 pub const PTRACE_O_TRACESYSGOOD: ::c_int = 0x00000001;
963 pub const PTRACE_O_TRACEFORK: ::c_int = 0x00000002;
964 pub const PTRACE_O_TRACEVFORK: ::c_int = 0x00000004;
965 pub const PTRACE_O_TRACECLONE: ::c_int = 0x00000008;
966 pub const PTRACE_O_TRACEEXEC: ::c_int = 0x00000010;
967 pub const PTRACE_O_TRACEVFORKDONE: ::c_int = 0x00000020;
968 pub const PTRACE_O_TRACEEXIT: ::c_int = 0x00000040;
969 pub const PTRACE_O_TRACESECCOMP: ::c_int = 0x00000080;
970 pub const PTRACE_O_EXITKILL: ::c_int = 0x00100000;
971 pub const PTRACE_O_SUSPEND_SECCOMP: ::c_int = 0x00200000;
972 pub const PTRACE_O_MASK: ::c_int = 0x003000ff;
973 
974 // Wait extended result codes for the above trace options.
975 pub const PTRACE_EVENT_FORK: ::c_int = 1;
976 pub const PTRACE_EVENT_VFORK: ::c_int = 2;
977 pub const PTRACE_EVENT_CLONE: ::c_int = 3;
978 pub const PTRACE_EVENT_EXEC: ::c_int = 4;
979 pub const PTRACE_EVENT_VFORK_DONE: ::c_int = 5;
980 pub const PTRACE_EVENT_EXIT: ::c_int = 6;
981 pub const PTRACE_EVENT_SECCOMP: ::c_int = 7;
982 // PTRACE_EVENT_STOP was added to glibc in 2.26
983 // pub const PTRACE_EVENT_STOP: ::c_int = 128;
984 
985 pub const __WNOTHREAD: ::c_int = 0x20000000;
986 pub const __WALL: ::c_int = 0x40000000;
987 pub const __WCLONE: ::c_int = 0x80000000;
988 
989 pub const SPLICE_F_MOVE: ::c_uint = 0x01;
990 pub const SPLICE_F_NONBLOCK: ::c_uint = 0x02;
991 pub const SPLICE_F_MORE: ::c_uint = 0x04;
992 pub const SPLICE_F_GIFT: ::c_uint = 0x08;
993 
994 pub const RTLD_LOCAL: ::c_int = 0;
995 pub const RTLD_LAZY: ::c_int = 1;
996 
997 pub const POSIX_FADV_NORMAL: ::c_int = 0;
998 pub const POSIX_FADV_RANDOM: ::c_int = 1;
999 pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
1000 pub const POSIX_FADV_WILLNEED: ::c_int = 3;
1001 
1002 pub const AT_FDCWD: ::c_int = -100;
1003 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x100;
1004 pub const AT_REMOVEDIR: ::c_int = 0x200;
1005 pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
1006 pub const AT_NO_AUTOMOUNT: ::c_int = 0x800;
1007 pub const AT_EMPTY_PATH: ::c_int = 0x1000;
1008 
1009 pub const LOG_CRON: ::c_int = 9 << 3;
1010 pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
1011 pub const LOG_FTP: ::c_int = 11 << 3;
1012 pub const LOG_PERROR: ::c_int = 0x20;
1013 
1014 pub const PIPE_BUF: usize = 4096;
1015 
1016 pub const SI_LOAD_SHIFT: ::c_uint = 16;
1017 
1018 pub const SIGEV_SIGNAL: ::c_int = 0;
1019 pub const SIGEV_NONE: ::c_int = 1;
1020 pub const SIGEV_THREAD: ::c_int = 2;
1021 
1022 pub const P_ALL: idtype_t = 0;
1023 pub const P_PID: idtype_t = 1;
1024 pub const P_PGID: idtype_t = 2;
1025 
1026 pub const UTIME_OMIT: c_long = 1073741822;
1027 pub const UTIME_NOW: c_long = 1073741823;
1028 
1029 pub const POLLIN: ::c_short = 0x1;
1030 pub const POLLPRI: ::c_short = 0x2;
1031 pub const POLLOUT: ::c_short = 0x4;
1032 pub const POLLERR: ::c_short = 0x8;
1033 pub const POLLHUP: ::c_short = 0x10;
1034 pub const POLLNVAL: ::c_short = 0x20;
1035 pub const POLLRDNORM: ::c_short = 0x040;
1036 pub const POLLRDBAND: ::c_short = 0x080;
1037 
1038 pub const IPTOS_LOWDELAY: u8 = 0x10;
1039 pub const IPTOS_THROUGHPUT: u8 = 0x08;
1040 pub const IPTOS_RELIABILITY: u8 = 0x04;
1041 pub const IPTOS_MINCOST: u8 = 0x02;
1042 
1043 pub const IPTOS_PREC_NETCONTROL: u8 = 0xe0;
1044 pub const IPTOS_PREC_INTERNETCONTROL: u8 = 0xc0;
1045 pub const IPTOS_PREC_CRITIC_ECP: u8 = 0xa0;
1046 pub const IPTOS_PREC_FLASHOVERRIDE: u8 = 0x80;
1047 pub const IPTOS_PREC_FLASH: u8 = 0x60;
1048 pub const IPTOS_PREC_IMMEDIATE: u8 = 0x40;
1049 pub const IPTOS_PREC_PRIORITY: u8 = 0x20;
1050 pub const IPTOS_PREC_ROUTINE: u8 = 0x00;
1051 
1052 pub const IPTOS_ECN_MASK: u8 = 0x03;
1053 pub const IPTOS_ECN_ECT1: u8 = 0x01;
1054 pub const IPTOS_ECN_ECT0: u8 = 0x02;
1055 pub const IPTOS_ECN_CE: u8 = 0x03;
1056 
1057 pub const IPOPT_COPY: u8 = 0x80;
1058 pub const IPOPT_CLASS_MASK: u8 = 0x60;
1059 pub const IPOPT_NUMBER_MASK: u8 = 0x1f;
1060 
1061 pub const IPOPT_CONTROL: u8 = 0x00;
1062 pub const IPOPT_RESERVED1: u8 = 0x20;
1063 pub const IPOPT_MEASUREMENT: u8 = 0x40;
1064 pub const IPOPT_RESERVED2: u8 = 0x60;
1065 pub const IPOPT_END: u8 = 0 | IPOPT_CONTROL;
1066 pub const IPOPT_NOOP: u8 = 1 | IPOPT_CONTROL;
1067 pub const IPOPT_SEC: u8 = 2 | IPOPT_CONTROL | IPOPT_COPY;
1068 pub const IPOPT_LSRR: u8 = 3 | IPOPT_CONTROL | IPOPT_COPY;
1069 pub const IPOPT_TIMESTAMP: u8 = 4 | IPOPT_MEASUREMENT;
1070 pub const IPOPT_RR: u8 = 7 | IPOPT_CONTROL;
1071 pub const IPOPT_SID: u8 = 8 | IPOPT_CONTROL | IPOPT_COPY;
1072 pub const IPOPT_SSRR: u8 = 9 | IPOPT_CONTROL | IPOPT_COPY;
1073 pub const IPOPT_RA: u8 = 20 | IPOPT_CONTROL | IPOPT_COPY;
1074 pub const IPVERSION: u8 = 4;
1075 pub const MAXTTL: u8 = 255;
1076 pub const IPDEFTTL: u8 = 64;
1077 pub const IPOPT_OPTVAL: u8 = 0;
1078 pub const IPOPT_OLEN: u8 = 1;
1079 pub const IPOPT_OFFSET: u8 = 2;
1080 pub const IPOPT_MINOFF: u8 = 4;
1081 pub const MAX_IPOPTLEN: u8 = 40;
1082 pub const IPOPT_NOP: u8 = IPOPT_NOOP;
1083 pub const IPOPT_EOL: u8 = IPOPT_END;
1084 pub const IPOPT_TS: u8 = IPOPT_TIMESTAMP;
1085 pub const IPOPT_TS_TSONLY: u8 = 0;
1086 pub const IPOPT_TS_TSANDADDR: u8 = 1;
1087 pub const IPOPT_TS_PRESPEC: u8 = 3;
1088 
1089 pub const ARPOP_RREQUEST: u16 = 3;
1090 pub const ARPOP_RREPLY: u16 = 4;
1091 pub const ARPOP_InREQUEST: u16 = 8;
1092 pub const ARPOP_InREPLY: u16 = 9;
1093 pub const ARPOP_NAK: u16 = 10;
1094 
1095 pub const ATF_NETMASK: ::c_int = 0x20;
1096 pub const ATF_DONTPUB: ::c_int = 0x40;
1097 
1098 pub const ARPHRD_NETROM: u16 = 0;
1099 pub const ARPHRD_ETHER: u16 = 1;
1100 pub const ARPHRD_EETHER: u16 = 2;
1101 pub const ARPHRD_AX25: u16 = 3;
1102 pub const ARPHRD_PRONET: u16 = 4;
1103 pub const ARPHRD_CHAOS: u16 = 5;
1104 pub const ARPHRD_IEEE802: u16 = 6;
1105 pub const ARPHRD_ARCNET: u16 = 7;
1106 pub const ARPHRD_APPLETLK: u16 = 8;
1107 pub const ARPHRD_DLCI: u16 = 15;
1108 pub const ARPHRD_ATM: u16 = 19;
1109 pub const ARPHRD_METRICOM: u16 = 23;
1110 pub const ARPHRD_IEEE1394: u16 = 24;
1111 pub const ARPHRD_EUI64: u16 = 27;
1112 pub const ARPHRD_INFINIBAND: u16 = 32;
1113 
1114 pub const ARPHRD_SLIP: u16 = 256;
1115 pub const ARPHRD_CSLIP: u16 = 257;
1116 pub const ARPHRD_SLIP6: u16 = 258;
1117 pub const ARPHRD_CSLIP6: u16 = 259;
1118 pub const ARPHRD_RSRVD: u16 = 260;
1119 pub const ARPHRD_ADAPT: u16 = 264;
1120 pub const ARPHRD_ROSE: u16 = 270;
1121 pub const ARPHRD_X25: u16 = 271;
1122 pub const ARPHRD_HWX25: u16 = 272;
1123 pub const ARPHRD_PPP: u16 = 512;
1124 pub const ARPHRD_CISCO: u16 = 513;
1125 pub const ARPHRD_HDLC: u16 = ARPHRD_CISCO;
1126 pub const ARPHRD_LAPB: u16 = 516;
1127 pub const ARPHRD_DDCMP: u16 = 517;
1128 pub const ARPHRD_RAWHDLC: u16 = 518;
1129 
1130 pub const ARPHRD_TUNNEL: u16 = 768;
1131 pub const ARPHRD_TUNNEL6: u16 = 769;
1132 pub const ARPHRD_FRAD: u16 = 770;
1133 pub const ARPHRD_SKIP: u16 = 771;
1134 pub const ARPHRD_LOOPBACK: u16 = 772;
1135 pub const ARPHRD_LOCALTLK: u16 = 773;
1136 pub const ARPHRD_FDDI: u16 = 774;
1137 pub const ARPHRD_BIF: u16 = 775;
1138 pub const ARPHRD_SIT: u16 = 776;
1139 pub const ARPHRD_IPDDP: u16 = 777;
1140 pub const ARPHRD_IPGRE: u16 = 778;
1141 pub const ARPHRD_PIMREG: u16 = 779;
1142 pub const ARPHRD_HIPPI: u16 = 780;
1143 pub const ARPHRD_ASH: u16 = 781;
1144 pub const ARPHRD_ECONET: u16 = 782;
1145 pub const ARPHRD_IRDA: u16 = 783;
1146 pub const ARPHRD_FCPP: u16 = 784;
1147 pub const ARPHRD_FCAL: u16 = 785;
1148 pub const ARPHRD_FCPL: u16 = 786;
1149 pub const ARPHRD_FCFABRIC: u16 = 787;
1150 pub const ARPHRD_IEEE802_TR: u16 = 800;
1151 pub const ARPHRD_IEEE80211: u16 = 801;
1152 pub const ARPHRD_IEEE80211_PRISM: u16 = 802;
1153 pub const ARPHRD_IEEE80211_RADIOTAP: u16 = 803;
1154 pub const ARPHRD_IEEE802154: u16 = 804;
1155 
1156 pub const ARPHRD_VOID: u16 = 0xFFFF;
1157 pub const ARPHRD_NONE: u16 = 0xFFFE;
1158 
1159 const_fn! {
1160     {const} fn CMSG_ALIGN(len: usize) -> usize {
1161         len + ::mem::size_of::<usize>() - 1 & !(::mem::size_of::<usize>() - 1)
1162     }
1163 }
1164 
1165 f! {
1166     pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
1167         if (*mhdr).msg_controllen as usize >= ::mem::size_of::<cmsghdr>() {
1168             (*mhdr).msg_control as *mut cmsghdr
1169         } else {
1170             0 as *mut cmsghdr
1171         }
1172     }
1173 
1174     pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut ::c_uchar {
1175         cmsg.offset(1) as *mut ::c_uchar
1176     }
1177 
1178     pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
1179         (CMSG_ALIGN(length as usize) + CMSG_ALIGN(::mem::size_of::<cmsghdr>()))
1180             as ::c_uint
1181     }
1182 
1183     pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
1184         CMSG_ALIGN(::mem::size_of::<cmsghdr>()) as ::c_uint + length
1185     }
1186 
1187     pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
1188         let fd = fd as usize;
1189         let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
1190         (*set).fds_bits[fd / size] &= !(1 << (fd % size));
1191         return
1192     }
1193 
1194     pub fn FD_ISSET(fd: ::c_int, set: *mut fd_set) -> bool {
1195         let fd = fd as usize;
1196         let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
1197         return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
1198     }
1199 
1200     pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
1201         let fd = fd as usize;
1202         let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
1203         (*set).fds_bits[fd / size] |= 1 << (fd % size);
1204         return
1205     }
1206 
1207     pub fn FD_ZERO(set: *mut fd_set) -> () {
1208         for slot in (*set).fds_bits.iter_mut() {
1209             *slot = 0;
1210         }
1211     }
1212 
1213     pub fn WIFSTOPPED(status: ::c_int) -> bool {
1214         (status & 0xff) == 0x7f
1215     }
1216 
1217     pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
1218         (status >> 8) & 0xff
1219     }
1220 
1221     pub fn WIFCONTINUED(status: ::c_int) -> bool {
1222         status == 0xffff
1223     }
1224 
1225     pub fn WIFSIGNALED(status: ::c_int) -> bool {
1226         ((status & 0x7f) + 1) as i8 >= 2
1227     }
1228 
1229     pub fn WTERMSIG(status: ::c_int) -> ::c_int {
1230         status & 0x7f
1231     }
1232 
1233     pub fn WIFEXITED(status: ::c_int) -> bool {
1234         (status & 0x7f) == 0
1235     }
1236 
1237     pub fn WEXITSTATUS(status: ::c_int) -> ::c_int {
1238         (status >> 8) & 0xff
1239     }
1240 
1241     pub fn WCOREDUMP(status: ::c_int) -> bool {
1242         (status & 0x80) != 0
1243     }
1244 
1245     pub fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int {
1246         (cmd << 8) | (type_ & 0x00ff)
1247     }
1248 
1249     pub fn IPOPT_COPIED(o: u8) -> u8 {
1250         o & IPOPT_COPY
1251     }
1252 
1253     pub fn IPOPT_CLASS(o: u8) -> u8 {
1254         o & IPOPT_CLASS_MASK
1255     }
1256 
1257     pub fn IPOPT_NUMBER(o: u8) -> u8 {
1258         o & IPOPT_NUMBER_MASK
1259     }
1260 
1261     pub fn IPTOS_ECN(x: u8) -> u8 {
1262         x & ::IPTOS_ECN_MASK
1263     }
1264 }
1265 
1266 extern "C" {
1267     pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
1268     pub fn sem_init(
1269         sem: *mut sem_t,
1270         pshared: ::c_int,
1271         value: ::c_uint,
1272     ) -> ::c_int;
1273     pub fn fdatasync(fd: ::c_int) -> ::c_int;
1274     pub fn mincore(
1275         addr: *mut ::c_void,
1276         len: ::size_t,
1277         vec: *mut ::c_uchar,
1278     ) -> ::c_int;
1279     pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
1280     pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
1281     pub fn clock_settime(
1282         clk_id: ::clockid_t,
1283         tp: *const ::timespec,
1284     ) -> ::c_int;
1285     pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
1286 
1287     pub fn pthread_getattr_np(
1288         native: ::pthread_t,
1289         attr: *mut ::pthread_attr_t,
1290     ) -> ::c_int;
1291     pub fn pthread_attr_getstack(
1292         attr: *const ::pthread_attr_t,
1293         stackaddr: *mut *mut ::c_void,
1294         stacksize: *mut ::size_t,
1295     ) -> ::c_int;
1296     pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
1297     pub fn setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int;
1298     pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
1299     pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
1300     pub fn statfs64(path: *const ::c_char, buf: *mut statfs64) -> ::c_int;
1301     pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
1302     pub fn fstatfs64(fd: ::c_int, buf: *mut statfs64) -> ::c_int;
1303     pub fn statvfs64(path: *const ::c_char, buf: *mut statvfs64) -> ::c_int;
1304     pub fn fstatvfs64(fd: ::c_int, buf: *mut statvfs64) -> ::c_int;
1305     pub fn memrchr(
1306         cx: *const ::c_void,
1307         c: ::c_int,
1308         n: ::size_t,
1309     ) -> *mut ::c_void;
1310 
1311     pub fn posix_fadvise(
1312         fd: ::c_int,
1313         offset: ::off_t,
1314         len: ::off_t,
1315         advise: ::c_int,
1316     ) -> ::c_int;
1317     pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
1318     pub fn utimensat(
1319         dirfd: ::c_int,
1320         path: *const ::c_char,
1321         times: *const ::timespec,
1322         flag: ::c_int,
1323     ) -> ::c_int;
1324     pub fn duplocale(base: ::locale_t) -> ::locale_t;
1325     pub fn freelocale(loc: ::locale_t);
1326     pub fn newlocale(
1327         mask: ::c_int,
1328         locale: *const ::c_char,
1329         base: ::locale_t,
1330     ) -> ::locale_t;
1331     pub fn uselocale(loc: ::locale_t) -> ::locale_t;
1332     pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int;
1333     pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int;
1334     pub fn fstatat64(
1335         dirfd: ::c_int,
1336         pathname: *const c_char,
1337         buf: *mut stat64,
1338         flags: ::c_int,
1339     ) -> ::c_int;
1340     pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int;
1341     pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t;
1342     pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
1343     pub fn mmap64(
1344         addr: *mut ::c_void,
1345         len: ::size_t,
1346         prot: ::c_int,
1347         flags: ::c_int,
1348         fd: ::c_int,
1349         offset: off64_t,
1350     ) -> *mut ::c_void;
1351     pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
1352     pub fn openat64(
1353         fd: ::c_int,
1354         path: *const c_char,
1355         oflag: ::c_int,
1356         ...
1357     ) -> ::c_int;
1358     pub fn pread64(
1359         fd: ::c_int,
1360         buf: *mut ::c_void,
1361         count: ::size_t,
1362         offset: off64_t,
1363     ) -> ::ssize_t;
1364     pub fn preadv64(
1365         fd: ::c_int,
1366         iov: *const ::iovec,
1367         iovcnt: ::c_int,
1368         offset: ::off64_t,
1369     ) -> ::ssize_t;
1370     pub fn pwrite64(
1371         fd: ::c_int,
1372         buf: *const ::c_void,
1373         count: ::size_t,
1374         offset: off64_t,
1375     ) -> ::ssize_t;
1376     pub fn pwritev64(
1377         fd: ::c_int,
1378         iov: *const ::iovec,
1379         iovcnt: ::c_int,
1380         offset: ::off64_t,
1381     ) -> ::ssize_t;
1382     pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64;
1383     pub fn readdir64_r(
1384         dirp: *mut ::DIR,
1385         entry: *mut ::dirent64,
1386         result: *mut *mut ::dirent64,
1387     ) -> ::c_int;
1388     pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
1389     pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int;
1390 
1391     pub fn mknodat(
1392         dirfd: ::c_int,
1393         pathname: *const ::c_char,
1394         mode: ::mode_t,
1395         dev: dev_t,
1396     ) -> ::c_int;
1397     pub fn pthread_condattr_getclock(
1398         attr: *const pthread_condattr_t,
1399         clock_id: *mut clockid_t,
1400     ) -> ::c_int;
1401     pub fn pthread_condattr_setclock(
1402         attr: *mut pthread_condattr_t,
1403         clock_id: ::clockid_t,
1404     ) -> ::c_int;
1405     pub fn pthread_condattr_setpshared(
1406         attr: *mut pthread_condattr_t,
1407         pshared: ::c_int,
1408     ) -> ::c_int;
1409     pub fn accept4(
1410         fd: ::c_int,
1411         addr: *mut ::sockaddr,
1412         len: *mut ::socklen_t,
1413         flg: ::c_int,
1414     ) -> ::c_int;
1415     pub fn pthread_mutexattr_setpshared(
1416         attr: *mut pthread_mutexattr_t,
1417         pshared: ::c_int,
1418     ) -> ::c_int;
1419     pub fn pthread_rwlockattr_getpshared(
1420         attr: *const pthread_rwlockattr_t,
1421         val: *mut ::c_int,
1422     ) -> ::c_int;
1423     pub fn pthread_rwlockattr_setpshared(
1424         attr: *mut pthread_rwlockattr_t,
1425         val: ::c_int,
1426     ) -> ::c_int;
1427     pub fn ptsname_r(
1428         fd: ::c_int,
1429         buf: *mut ::c_char,
1430         buflen: ::size_t,
1431     ) -> ::c_int;
1432     pub fn clearenv() -> ::c_int;
1433     pub fn waitid(
1434         idtype: idtype_t,
1435         id: id_t,
1436         infop: *mut ::siginfo_t,
1437         options: ::c_int,
1438     ) -> ::c_int;
1439     pub fn setreuid(ruid: ::uid_t, euid: ::uid_t) -> ::c_int;
1440     pub fn setregid(rgid: ::gid_t, egid: ::gid_t) -> ::c_int;
1441     pub fn getresuid(
1442         ruid: *mut ::uid_t,
1443         euid: *mut ::uid_t,
1444         suid: *mut ::uid_t,
1445     ) -> ::c_int;
1446     pub fn getresgid(
1447         rgid: *mut ::gid_t,
1448         egid: *mut ::gid_t,
1449         sgid: *mut ::gid_t,
1450     ) -> ::c_int;
1451     pub fn acct(filename: *const ::c_char) -> ::c_int;
1452     pub fn brk(addr: *mut ::c_void) -> ::c_int;
1453     pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
1454     #[deprecated(
1455         since = "0.2.66",
1456         note = "causes memory corruption, see rust-lang/libc#1596"
1457     )]
1458     pub fn vfork() -> ::pid_t;
1459     pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
1460     pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
1461     pub fn wait4(
1462         pid: ::pid_t,
1463         status: *mut ::c_int,
1464         options: ::c_int,
1465         rusage: *mut ::rusage,
1466     ) -> ::pid_t;
1467     pub fn openpty(
1468         amaster: *mut ::c_int,
1469         aslave: *mut ::c_int,
1470         name: *mut ::c_char,
1471         termp: *const termios,
1472         winp: *const ::winsize,
1473     ) -> ::c_int;
1474     pub fn forkpty(
1475         amaster: *mut ::c_int,
1476         name: *mut ::c_char,
1477         termp: *const termios,
1478         winp: *const ::winsize,
1479     ) -> ::pid_t;
1480     pub fn login_tty(fd: ::c_int) -> ::c_int;
1481     pub fn execvpe(
1482         file: *const ::c_char,
1483         argv: *const *const ::c_char,
1484         envp: *const *const ::c_char,
1485     ) -> ::c_int;
1486     pub fn fexecve(
1487         fd: ::c_int,
1488         argv: *const *const ::c_char,
1489         envp: *const *const ::c_char,
1490     ) -> ::c_int;
1491     pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
1492     pub fn freeifaddrs(ifa: *mut ::ifaddrs);
1493     pub fn bind(
1494         socket: ::c_int,
1495         address: *const ::sockaddr,
1496         address_len: ::socklen_t,
1497     ) -> ::c_int;
1498 
1499     pub fn writev(
1500         fd: ::c_int,
1501         iov: *const ::iovec,
1502         iovcnt: ::c_int,
1503     ) -> ::ssize_t;
1504     pub fn readv(
1505         fd: ::c_int,
1506         iov: *const ::iovec,
1507         iovcnt: ::c_int,
1508     ) -> ::ssize_t;
1509 
1510     pub fn sendmsg(
1511         fd: ::c_int,
1512         msg: *const ::msghdr,
1513         flags: ::c_int,
1514     ) -> ::ssize_t;
1515     pub fn recvmsg(
1516         fd: ::c_int,
1517         msg: *mut ::msghdr,
1518         flags: ::c_int,
1519     ) -> ::ssize_t;
1520     pub fn uname(buf: *mut ::utsname) -> ::c_int;
1521 }
1522 
1523 cfg_if! {
1524     if #[cfg(target_os = "emscripten")] {
1525         mod emscripten;
1526         pub use self::emscripten::*;
1527     } else if #[cfg(target_os = "linux")] {
1528         mod linux;
1529         pub use self::linux::*;
1530     } else if #[cfg(target_os = "android")] {
1531         mod android;
1532         pub use self::android::*;
1533     } else {
1534         // Unknown target_os
1535     }
1536 }
1537