1pub type sa_family_t = u16;
2pub type speed_t = ::c_uint;
3pub type tcflag_t = ::c_uint;
4pub type clockid_t = ::c_int;
5pub type timer_t = *mut ::c_void;
6pub type key_t = ::c_int;
7pub type id_t = ::c_uint;
8
9missing! {
10 #[cfg_attr(feature = "extra_traits", derive(Debug))]
11 pub enum timezone {}
12}
13
14s! {
15 pub struct in_addr {
16 pub s_addr: ::in_addr_t,
17 }
18
19 pub struct ip_mreq {
20 pub imr_multiaddr: in_addr,
21 pub imr_interface: in_addr,
22 }
23
24 pub struct ip_mreqn {
25 pub imr_multiaddr: in_addr,
26 pub imr_address: in_addr,
27 pub imr_ifindex: ::c_int,
28 }
29
30 pub struct ip_mreq_source {
31 pub imr_multiaddr: in_addr,
32 pub imr_interface: in_addr,
33 pub imr_sourceaddr: in_addr,
34 }
35
36 pub struct sockaddr {
37 pub sa_family: sa_family_t,
38 pub sa_data: [::c_char; 14],
39 }
40
41 pub struct sockaddr_in {
42 pub sin_family: sa_family_t,
43 pub sin_port: ::in_port_t,
44 pub sin_addr: ::in_addr,
45 pub sin_zero: [u8; 8],
46 }
47
48 pub struct sockaddr_in6 {
49 pub sin6_family: sa_family_t,
50 pub sin6_port: ::in_port_t,
51 pub sin6_flowinfo: u32,
52 pub sin6_addr: ::in6_addr,
53 pub sin6_scope_id: u32,
54 }
55
56 // The order of the `ai_addr` field in this struct is crucial
57 // for converting between the Rust and C types.
58 pub struct addrinfo {
59 pub ai_flags: ::c_int,
60 pub ai_family: ::c_int,
61 pub ai_socktype: ::c_int,
62 pub ai_protocol: ::c_int,
63 pub ai_addrlen: socklen_t,
64
65 #[cfg(any(target_os = "linux",
66 target_os = "emscripten"))]
67 pub ai_addr: *mut ::sockaddr,
68
69 pub ai_canonname: *mut c_char,
70
71 #[cfg(target_os = "android")]
72 pub ai_addr: *mut ::sockaddr,
73
74 pub ai_next: *mut addrinfo,
75 }
76
77 pub struct sockaddr_ll {
78 pub sll_family: ::c_ushort,
79 pub sll_protocol: ::c_ushort,
80 pub sll_ifindex: ::c_int,
81 pub sll_hatype: ::c_ushort,
82 pub sll_pkttype: ::c_uchar,
83 pub sll_halen: ::c_uchar,
84 pub sll_addr: [::c_uchar; 8]
85 }
86
87 pub struct fd_set {
88 fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
89 }
90
91 pub struct tm {
92 pub tm_sec: ::c_int,
93 pub tm_min: ::c_int,
94 pub tm_hour: ::c_int,
95 pub tm_mday: ::c_int,
96 pub tm_mon: ::c_int,
97 pub tm_year: ::c_int,
98 pub tm_wday: ::c_int,
99 pub tm_yday: ::c_int,
100 pub tm_isdst: ::c_int,
101 pub tm_gmtoff: ::c_long,
102 pub tm_zone: *const ::c_char,
103 }
104
105 pub struct sched_param {
106 pub sched_priority: ::c_int,
107 #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
108 pub sched_ss_low_priority: ::c_int,
109 #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
110 pub sched_ss_repl_period: ::timespec,
111 #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
112 pub sched_ss_init_budget: ::timespec,
113 #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
114 pub sched_ss_max_repl: ::c_int,
115 }
116
117 pub struct Dl_info {
118 pub dli_fname: *const ::c_char,
119 pub dli_fbase: *mut ::c_void,
120 pub dli_sname: *const ::c_char,
121 pub dli_saddr: *mut ::c_void,
122 }
123
124 pub struct lconv {
125 pub decimal_point: *mut ::c_char,
126 pub thousands_sep: *mut ::c_char,
127 pub grouping: *mut ::c_char,
128 pub int_curr_symbol: *mut ::c_char,
129 pub currency_symbol: *mut ::c_char,
130 pub mon_decimal_point: *mut ::c_char,
131 pub mon_thousands_sep: *mut ::c_char,
132 pub mon_grouping: *mut ::c_char,
133 pub positive_sign: *mut ::c_char,
134 pub negative_sign: *mut ::c_char,
135 pub int_frac_digits: ::c_char,
136 pub frac_digits: ::c_char,
137 pub p_cs_precedes: ::c_char,
138 pub p_sep_by_space: ::c_char,
139 pub n_cs_precedes: ::c_char,
140 pub n_sep_by_space: ::c_char,
141 pub p_sign_posn: ::c_char,
142 pub n_sign_posn: ::c_char,
143 pub int_p_cs_precedes: ::c_char,
144 pub int_p_sep_by_space: ::c_char,
145 pub int_n_cs_precedes: ::c_char,
146 pub int_n_sep_by_space: ::c_char,
147 pub int_p_sign_posn: ::c_char,
148 pub int_n_sign_posn: ::c_char,
149 }
150
151 pub struct in_pktinfo {
152 pub ipi_ifindex: ::c_int,
153 pub ipi_spec_dst: ::in_addr,
154 pub ipi_addr: ::in_addr,
155 }
156
157 pub struct ifaddrs {
158 pub ifa_next: *mut ifaddrs,
159 pub ifa_name: *mut c_char,
160 pub ifa_flags: ::c_uint,
161 pub ifa_addr: *mut ::sockaddr,
162 pub ifa_netmask: *mut ::sockaddr,
163 pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union
164 pub ifa_data: *mut ::c_void
165 }
166
167 pub struct in6_rtmsg {
168 rtmsg_dst: ::in6_addr,
169 rtmsg_src: ::in6_addr,
170 rtmsg_gateway: ::in6_addr,
171 rtmsg_type: u32,
172 rtmsg_dst_len: u16,
173 rtmsg_src_len: u16,
174 rtmsg_metric: u32,
175 rtmsg_info: ::c_ulong,
176 rtmsg_flags: u32,
177 rtmsg_ifindex: ::c_int,
178 }
179
180 pub struct arpreq {
181 pub arp_pa: ::sockaddr,
182 pub arp_ha: ::sockaddr,
183 pub arp_flags: ::c_int,
184 pub arp_netmask: ::sockaddr,
185 pub arp_dev: [::c_char; 16],
186 }
187
188 pub struct arpreq_old {
189 pub arp_pa: ::sockaddr,
190 pub arp_ha: ::sockaddr,
191 pub arp_flags: ::c_int,
192 pub arp_netmask: ::sockaddr,
193 }
194
195 pub struct arphdr {
196 pub ar_hrd: u16,
197 pub ar_pro: u16,
198 pub ar_hln: u8,
199 pub ar_pln: u8,
200 pub ar_op: u16,
201 }
202
203 pub struct mmsghdr {
204 pub msg_hdr: ::msghdr,
205 pub msg_len: ::c_uint,
206 }
207}
208
209s_no_extra_traits! {
210 #[cfg_attr(
211 any(
212 all(
213 target_arch = "x86",
214 not(target_env = "musl"),
215 not(target_os = "android")),
216 target_arch = "x86_64"),
217 repr(packed))]
218 pub struct epoll_event {
219 pub events: u32,
220 pub u64: u64,
221 }
222
223 pub struct sockaddr_un {
224 pub sun_family: sa_family_t,
225 pub sun_path: [::c_char; 108]
226 }
227
228 pub struct sockaddr_storage {
229 pub ss_family: sa_family_t,
230 #[cfg(target_pointer_width = "32")]
231 __ss_pad2: [u8; 128 - 2 - 4],
232 #[cfg(target_pointer_width = "64")]
233 __ss_pad2: [u8; 128 - 2 - 8],
234 __ss_align: ::size_t,
235 }
236
237 pub struct utsname {
238 pub sysname: [::c_char; 65],
239 pub nodename: [::c_char; 65],
240 pub release: [::c_char; 65],
241 pub version: [::c_char; 65],
242 pub machine: [::c_char; 65],
243 pub domainname: [::c_char; 65]
244 }
245
246 pub struct sigevent {
247 pub sigev_value: ::sigval,
248 pub sigev_signo: ::c_int,
249 pub sigev_notify: ::c_int,
250 // Actually a union. We only expose sigev_notify_thread_id because it's
251 // the most useful member
252 pub sigev_notify_thread_id: ::c_int,
253 #[cfg(target_pointer_width = "64")]
254 __unused1: [::c_int; 11],
255 #[cfg(target_pointer_width = "32")]
256 __unused1: [::c_int; 12]
257 }
258}
259
260cfg_if! {
261 if #[cfg(feature = "extra_traits")] {
262 impl PartialEq for epoll_event {
263 fn eq(&self, other: &epoll_event) -> bool {
264 self.events == other.events
265 && self.u64 == other.u64
266 }
267 }
268 impl Eq for epoll_event {}
269 impl ::fmt::Debug for epoll_event {
270 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
271 let events = self.events;
272 let u64 = self.u64;
273 f.debug_struct("epoll_event")
274 .field("events", &events)
275 .field("u64", &u64)
276 .finish()
277 }
278 }
279 impl ::hash::Hash for epoll_event {
280 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
281 let events = self.events;
282 let u64 = self.u64;
283 events.hash(state);
284 u64.hash(state);
285 }
286 }
287
288 impl PartialEq for sockaddr_un {
289 fn eq(&self, other: &sockaddr_un) -> bool {
290 self.sun_family == other.sun_family
291 && self
292 .sun_path
293 .iter()
294 .zip(other.sun_path.iter())
295 .all(|(a, b)| a == b)
296 }
297 }
298 impl Eq for sockaddr_un {}
299 impl ::fmt::Debug for sockaddr_un {
300 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
301 f.debug_struct("sockaddr_un")
302 .field("sun_family", &self.sun_family)
303 // FIXME: .field("sun_path", &self.sun_path)
304 .finish()
305 }
306 }
307 impl ::hash::Hash for sockaddr_un {
308 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
309 self.sun_family.hash(state);
310 self.sun_path.hash(state);
311 }
312 }
313
314 impl PartialEq for sockaddr_storage {
315 fn eq(&self, other: &sockaddr_storage) -> bool {
316 self.ss_family == other.ss_family
317 && self
318 .__ss_pad2
319 .iter()
320 .zip(other.__ss_pad2.iter())
321 .all(|(a, b)| a == b)
322 }
323 }
324
325 impl Eq for sockaddr_storage {}
326
327 impl ::fmt::Debug for sockaddr_storage {
328 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
329 f.debug_struct("sockaddr_storage")
330 .field("ss_family", &self.ss_family)
331 .field("__ss_align", &self.__ss_align)
332 // FIXME: .field("__ss_pad2", &self.__ss_pad2)
333 .finish()
334 }
335 }
336
337 impl ::hash::Hash for sockaddr_storage {
338 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
339 self.ss_family.hash(state);
340 self.__ss_pad2.hash(state);
341 }
342 }
343
344 impl PartialEq for utsname {
345 fn eq(&self, other: &utsname) -> bool {
346 self.sysname
347 .iter()
348 .zip(other.sysname.iter())
349 .all(|(a, b)| a == b)
350 && self
351 .nodename
352 .iter()
353 .zip(other.nodename.iter())
354 .all(|(a, b)| a == b)
355 && self
356 .release
357 .iter()
358 .zip(other.release.iter())
359 .all(|(a, b)| a == b)
360 && self
361 .version
362 .iter()
363 .zip(other.version.iter())
364 .all(|(a, b)| a == b)
365 && self
366 .machine
367 .iter()
368 .zip(other.machine.iter())
369 .all(|(a, b)| a == b)
370 && self
371 .domainname
372 .iter()
373 .zip(other.domainname.iter())
374 .all(|(a, b)| a == b)
375 }
376 }
377
378 impl Eq for utsname {}
379
380 impl ::fmt::Debug for utsname {
381 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
382 f.debug_struct("utsname")
383 // FIXME: .field("sysname", &self.sysname)
384 // FIXME: .field("nodename", &self.nodename)
385 // FIXME: .field("release", &self.release)
386 // FIXME: .field("version", &self.version)
387 // FIXME: .field("machine", &self.machine)
388 // FIXME: .field("domainname", &self.domainname)
389 .finish()
390 }
391 }
392
393 impl ::hash::Hash for utsname {
394 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
395 self.sysname.hash(state);
396 self.nodename.hash(state);
397 self.release.hash(state);
398 self.version.hash(state);
399 self.machine.hash(state);
400 self.domainname.hash(state);
401 }
402 }
403
404 impl PartialEq for sigevent {
405 fn eq(&self, other: &sigevent) -> bool {
406 self.sigev_value == other.sigev_value
407 && self.sigev_signo == other.sigev_signo
408 && self.sigev_notify == other.sigev_notify
409 && self.sigev_notify_thread_id
410 == other.sigev_notify_thread_id
411 }
412 }
413 impl Eq for sigevent {}
414 impl ::fmt::Debug for sigevent {
415 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
416 f.debug_struct("sigevent")
417 .field("sigev_value", &self.sigev_value)
418 .field("sigev_signo", &self.sigev_signo)
419 .field("sigev_notify", &self.sigev_notify)
420 .field("sigev_notify_thread_id",
421 &self.sigev_notify_thread_id)
422 .finish()
423 }
424 }
425 impl ::hash::Hash for sigevent {
426 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
427 self.sigev_value.hash(state);
428 self.sigev_signo.hash(state);
429 self.sigev_notify.hash(state);
430 self.sigev_notify_thread_id.hash(state);
431 }
432 }
433 }
434}
435
436// intentionally not public, only used for fd_set
437cfg_if! {
438 if #[cfg(target_pointer_width = "32")] {
439 const ULONG_SIZE: usize = 32;
440 } else if #[cfg(target_pointer_width = "64")] {
441 const ULONG_SIZE: usize = 64;
442 } else {
443 // Unknown target_pointer_width
444 }
445}
446
447pub const EXIT_FAILURE: ::c_int = 1;
448pub const EXIT_SUCCESS: ::c_int = 0;
449pub const RAND_MAX: ::c_int = 2147483647;
450pub const EOF: ::c_int = -1;
451pub const SEEK_SET: ::c_int = 0;
452pub const SEEK_CUR: ::c_int = 1;
453pub const SEEK_END: ::c_int = 2;
454pub const _IOFBF: ::c_int = 0;
455pub const _IONBF: ::c_int = 2;
456pub const _IOLBF: ::c_int = 1;
457
458pub const F_DUPFD: ::c_int = 0;
459pub const F_GETFD: ::c_int = 1;
460pub const F_SETFD: ::c_int = 2;
461pub const F_GETFL: ::c_int = 3;
462pub const F_SETFL: ::c_int = 4;
463
464// Linux-specific fcntls
465pub const F_SETLEASE: ::c_int = 1024;
466pub const F_GETLEASE: ::c_int = 1025;
467pub const F_NOTIFY: ::c_int = 1026;
468pub const F_CANCELLK: ::c_int = 1029;
469pub const F_DUPFD_CLOEXEC: ::c_int = 1030;
470pub const F_SETPIPE_SZ: ::c_int = 1031;
471pub const F_GETPIPE_SZ: ::c_int = 1032;
472pub const F_ADD_SEALS: ::c_int = 1033;
473pub const F_GET_SEALS: ::c_int = 1034;
474
475pub const F_SEAL_SEAL: ::c_int = 0x0001;
476pub const F_SEAL_SHRINK: ::c_int = 0x0002;
477pub const F_SEAL_GROW: ::c_int = 0x0004;
478pub const F_SEAL_WRITE: ::c_int = 0x0008;
479
480// FIXME(#235): Include file sealing fcntls once we have a way to verify them.
481
482pub const SIGTRAP: ::c_int = 5;
483
484pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
485pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
486
487pub const CLOCK_REALTIME: ::clockid_t = 0;
488pub const CLOCK_MONOTONIC: ::clockid_t = 1;
489pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
490pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 3;
491pub const CLOCK_MONOTONIC_RAW: ::clockid_t = 4;
492pub const CLOCK_REALTIME_COARSE: ::clockid_t = 5;
493pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = 6;
494pub const CLOCK_BOOTTIME: ::clockid_t = 7;
495pub const CLOCK_REALTIME_ALARM: ::clockid_t = 8;
496pub const CLOCK_BOOTTIME_ALARM: ::clockid_t = 9;
497pub const CLOCK_TAI: ::clockid_t = 11;
498pub const TIMER_ABSTIME: ::c_int = 1;
499
500pub const RUSAGE_SELF: ::c_int = 0;
501
502pub const O_RDONLY: ::c_int = 0;
503pub const O_WRONLY: ::c_int = 1;
504pub const O_RDWR: ::c_int = 2;
505
506pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC;
507
508pub const S_IFIFO: ::mode_t = 4096;
509pub const S_IFCHR: ::mode_t = 8192;
510pub const S_IFBLK: ::mode_t = 24576;
511pub const S_IFDIR: ::mode_t = 16384;
512pub const S_IFREG: ::mode_t = 32768;
513pub const S_IFLNK: ::mode_t = 40960;
514pub const S_IFSOCK: ::mode_t = 49152;
515pub const S_IFMT: ::mode_t = 61440;
516pub const S_IRWXU: ::mode_t = 448;
517pub const S_IXUSR: ::mode_t = 64;
518pub const S_IWUSR: ::mode_t = 128;
519pub const S_IRUSR: ::mode_t = 256;
520pub const S_IRWXG: ::mode_t = 56;
521pub const S_IXGRP: ::mode_t = 8;
522pub const S_IWGRP: ::mode_t = 16;
523pub const S_IRGRP: ::mode_t = 32;
524pub const S_IRWXO: ::mode_t = 7;
525pub const S_IXOTH: ::mode_t = 1;
526pub const S_IWOTH: ::mode_t = 2;
527pub const S_IROTH: ::mode_t = 4;
528pub const F_OK: ::c_int = 0;
529pub const R_OK: ::c_int = 4;
530pub const W_OK: ::c_int = 2;
531pub const X_OK: ::c_int = 1;
532pub const STDIN_FILENO: ::c_int = 0;
533pub const STDOUT_FILENO: ::c_int = 1;
534pub const STDERR_FILENO: ::c_int = 2;
535pub const SIGHUP: ::c_int = 1;
536pub const SIGINT: ::c_int = 2;
537pub const SIGQUIT: ::c_int = 3;
538pub const SIGILL: ::c_int = 4;
539pub const SIGABRT: ::c_int = 6;
540pub const SIGFPE: ::c_int = 8;
541pub const SIGKILL: ::c_int = 9;
542pub const SIGSEGV: ::c_int = 11;
543pub const SIGPIPE: ::c_int = 13;
544pub const SIGALRM: ::c_int = 14;
545pub const SIGTERM: ::c_int = 15;
546
547pub const PROT_NONE: ::c_int = 0;
548pub const PROT_READ: ::c_int = 1;
549pub const PROT_WRITE: ::c_int = 2;
550pub const PROT_EXEC: ::c_int = 4;
551
552pub const XATTR_CREATE: ::c_int = 0x1;
553pub const XATTR_REPLACE: ::c_int = 0x2;
554
555cfg_if! {
556 if #[cfg(target_os = "android")] {
557 pub const RLIM64_INFINITY: ::c_ulonglong = !0;
558 } else {
559 pub const RLIM64_INFINITY: ::rlim64_t = !0;
560 }
561}
562
563cfg_if! {
564 if #[cfg(target_env = "ohos")] {
565 pub const LC_CTYPE: ::c_int = 0;
566 pub const LC_NUMERIC: ::c_int = 1;
567 pub const LC_TIME: ::c_int = 2;
568 pub const LC_COLLATE: ::c_int = 3;
569 pub const LC_MONETARY: ::c_int = 4;
570 pub const LC_MESSAGES: ::c_int = 5;
571 pub const LC_PAPER: ::c_int = 6;
572 pub const LC_NAME: ::c_int = 7;
573 pub const LC_ADDRESS: ::c_int = 8;
574 pub const LC_TELEPHONE: ::c_int = 9;
575 pub const LC_MEASUREMENT: ::c_int = 10;
576 pub const LC_IDENTIFICATION: ::c_int = 11;
577 pub const LC_ALL: ::c_int = 12;
578 } else if #[cfg(not(target_env = "uclibc"))] {
579 pub const LC_CTYPE: ::c_int = 0;
580 pub const LC_NUMERIC: ::c_int = 1;
581 pub const LC_TIME: ::c_int = 2;
582 pub const LC_COLLATE: ::c_int = 3;
583 pub const LC_MONETARY: ::c_int = 4;
584 pub const LC_MESSAGES: ::c_int = 5;
585 pub const LC_ALL: ::c_int = 6;
586 }
587}
588
589pub const LC_CTYPE_MASK: ::c_int = 1 << LC_CTYPE;
590pub const LC_NUMERIC_MASK: ::c_int = 1 << LC_NUMERIC;
591pub const LC_TIME_MASK: ::c_int = 1 << LC_TIME;
592pub const LC_COLLATE_MASK: ::c_int = 1 << LC_COLLATE;
593pub const LC_MONETARY_MASK: ::c_int = 1 << LC_MONETARY;
594pub const LC_MESSAGES_MASK: ::c_int = 1 << LC_MESSAGES;
595// LC_ALL_MASK defined per platform
596
597pub const MAP_FILE: ::c_int = 0x0000;
598pub const MAP_SHARED: ::c_int = 0x0001;
599pub const MAP_PRIVATE: ::c_int = 0x0002;
600pub const MAP_FIXED: ::c_int = 0x0010;
601
602pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
603
604// MS_ flags for msync(2)
605pub const MS_ASYNC: ::c_int = 0x0001;
606pub const MS_INVALIDATE: ::c_int = 0x0002;
607pub const MS_SYNC: ::c_int = 0x0004;
608
609// MS_ flags for mount(2)
610pub const MS_RDONLY: ::c_ulong = 0x01;
611pub const MS_NOSUID: ::c_ulong = 0x02;
612pub const MS_NODEV: ::c_ulong = 0x04;
613pub const MS_NOEXEC: ::c_ulong = 0x08;
614pub const MS_SYNCHRONOUS: ::c_ulong = 0x10;
615pub const MS_REMOUNT: ::c_ulong = 0x20;
616pub const MS_MANDLOCK: ::c_ulong = 0x40;
617pub const MS_DIRSYNC: ::c_ulong = 0x80;
618pub const MS_NOATIME: ::c_ulong = 0x0400;
619pub const MS_NODIRATIME: ::c_ulong = 0x0800;
620pub const MS_BIND: ::c_ulong = 0x1000;
621pub const MS_MOVE: ::c_ulong = 0x2000;
622pub const MS_REC: ::c_ulong = 0x4000;
623pub const MS_SILENT: ::c_ulong = 0x8000;
624pub const MS_POSIXACL: ::c_ulong = 0x010000;
625pub const MS_UNBINDABLE: ::c_ulong = 0x020000;
626pub const MS_PRIVATE: ::c_ulong = 0x040000;
627pub const MS_SLAVE: ::c_ulong = 0x080000;
628pub const MS_SHARED: ::c_ulong = 0x100000;
629pub const MS_RELATIME: ::c_ulong = 0x200000;
630pub const MS_KERNMOUNT: ::c_ulong = 0x400000;
631pub const MS_I_VERSION: ::c_ulong = 0x800000;
632pub const MS_STRICTATIME: ::c_ulong = 0x1000000;
633pub const MS_LAZYTIME: ::c_ulong = 0x2000000;
634pub const MS_ACTIVE: ::c_ulong = 0x40000000;
635pub const MS_MGC_VAL: ::c_ulong = 0xc0ed0000;
636pub const MS_MGC_MSK: ::c_ulong = 0xffff0000;
637
638pub const SCM_RIGHTS: ::c_int = 0x01;
639pub const SCM_CREDENTIALS: ::c_int = 0x02;
640
641pub const PROT_GROWSDOWN: ::c_int = 0x1000000;
642pub const PROT_GROWSUP: ::c_int = 0x2000000;
643
644pub const MAP_TYPE: ::c_int = 0x000f;
645
646pub const MADV_NORMAL: ::c_int = 0;
647pub const MADV_RANDOM: ::c_int = 1;
648pub const MADV_SEQUENTIAL: ::c_int = 2;
649pub const MADV_WILLNEED: ::c_int = 3;
650pub const MADV_DONTNEED: ::c_int = 4;
651pub const MADV_FREE: ::c_int = 8;
652pub const MADV_REMOVE: ::c_int = 9;
653pub const MADV_DONTFORK: ::c_int = 10;
654pub const MADV_DOFORK: ::c_int = 11;
655pub const MADV_MERGEABLE: ::c_int = 12;
656pub const MADV_UNMERGEABLE: ::c_int = 13;
657pub const MADV_HUGEPAGE: ::c_int = 14;
658pub const MADV_NOHUGEPAGE: ::c_int = 15;
659pub const MADV_DONTDUMP: ::c_int = 16;
660pub const MADV_DODUMP: ::c_int = 17;
661pub const MADV_WIPEONFORK: ::c_int = 18;
662pub const MADV_KEEPONFORK: ::c_int = 19;
663pub const MADV_COLD: ::c_int = 20;
664pub const MADV_PAGEOUT: ::c_int = 21;
665pub const MADV_HWPOISON: ::c_int = 100;
666cfg_if! {
667 if #[cfg(not(target_os = "emscripten"))] {
668 pub const MADV_POPULATE_READ: ::c_int = 22;
669 pub const MADV_POPULATE_WRITE: ::c_int = 23;
670 pub const MADV_DONTNEED_LOCKED: ::c_int = 24;
671 }
672}
673
674pub const IFF_UP: ::c_int = 0x1;
675pub const IFF_BROADCAST: ::c_int = 0x2;
676pub const IFF_DEBUG: ::c_int = 0x4;
677pub const IFF_LOOPBACK: ::c_int = 0x8;
678pub const IFF_POINTOPOINT: ::c_int = 0x10;
679pub const IFF_NOTRAILERS: ::c_int = 0x20;
680pub const IFF_RUNNING: ::c_int = 0x40;
681pub const IFF_NOARP: ::c_int = 0x80;
682pub const IFF_PROMISC: ::c_int = 0x100;
683pub const IFF_ALLMULTI: ::c_int = 0x200;
684pub const IFF_MASTER: ::c_int = 0x400;
685pub const IFF_SLAVE: ::c_int = 0x800;
686pub const IFF_MULTICAST: ::c_int = 0x1000;
687pub const IFF_PORTSEL: ::c_int = 0x2000;
688pub const IFF_AUTOMEDIA: ::c_int = 0x4000;
689pub const IFF_DYNAMIC: ::c_int = 0x8000;
690
691pub const SOL_IP: ::c_int = 0;
692pub const SOL_TCP: ::c_int = 6;
693pub const SOL_UDP: ::c_int = 17;
694pub const SOL_IPV6: ::c_int = 41;
695pub const SOL_ICMPV6: ::c_int = 58;
696pub const SOL_RAW: ::c_int = 255;
697pub const SOL_DECNET: ::c_int = 261;
698pub const SOL_X25: ::c_int = 262;
699pub const SOL_PACKET: ::c_int = 263;
700pub const SOL_ATM: ::c_int = 264;
701pub const SOL_AAL: ::c_int = 265;
702pub const SOL_IRDA: ::c_int = 266;
703pub const SOL_NETBEUI: ::c_int = 267;
704pub const SOL_LLC: ::c_int = 268;
705pub const SOL_DCCP: ::c_int = 269;
706pub const SOL_NETLINK: ::c_int = 270;
707pub const SOL_TIPC: ::c_int = 271;
708pub const SOL_BLUETOOTH: ::c_int = 274;
709pub const SOL_ALG: ::c_int = 279;
710
711pub const AF_UNSPEC: ::c_int = 0;
712pub const AF_UNIX: ::c_int = 1;
713pub const AF_LOCAL: ::c_int = 1;
714pub const AF_INET: ::c_int = 2;
715pub const AF_AX25: ::c_int = 3;
716pub const AF_IPX: ::c_int = 4;
717pub const AF_APPLETALK: ::c_int = 5;
718pub const AF_NETROM: ::c_int = 6;
719pub const AF_BRIDGE: ::c_int = 7;
720pub const AF_ATMPVC: ::c_int = 8;
721pub const AF_X25: ::c_int = 9;
722pub const AF_INET6: ::c_int = 10;
723pub const AF_ROSE: ::c_int = 11;
724pub const AF_DECnet: ::c_int = 12;
725pub const AF_NETBEUI: ::c_int = 13;
726pub const AF_SECURITY: ::c_int = 14;
727pub const AF_KEY: ::c_int = 15;
728pub const AF_NETLINK: ::c_int = 16;
729pub const AF_ROUTE: ::c_int = AF_NETLINK;
730pub const AF_PACKET: ::c_int = 17;
731pub const AF_ASH: ::c_int = 18;
732pub const AF_ECONET: ::c_int = 19;
733pub const AF_ATMSVC: ::c_int = 20;
734pub const AF_RDS: ::c_int = 21;
735pub const AF_SNA: ::c_int = 22;
736pub const AF_IRDA: ::c_int = 23;
737pub const AF_PPPOX: ::c_int = 24;
738pub const AF_WANPIPE: ::c_int = 25;
739pub const AF_LLC: ::c_int = 26;
740pub const AF_CAN: ::c_int = 29;
741pub const AF_TIPC: ::c_int = 30;
742pub const AF_BLUETOOTH: ::c_int = 31;
743pub const AF_IUCV: ::c_int = 32;
744pub const AF_RXRPC: ::c_int = 33;
745pub const AF_ISDN: ::c_int = 34;
746pub const AF_PHONET: ::c_int = 35;
747pub const AF_IEEE802154: ::c_int = 36;
748pub const AF_CAIF: ::c_int = 37;
749pub const AF_ALG: ::c_int = 38;
750
751pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
752pub const PF_UNIX: ::c_int = AF_UNIX;
753pub const PF_LOCAL: ::c_int = AF_LOCAL;
754pub const PF_INET: ::c_int = AF_INET;
755pub const PF_AX25: ::c_int = AF_AX25;
756pub const PF_IPX: ::c_int = AF_IPX;
757pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
758pub const PF_NETROM: ::c_int = AF_NETROM;
759pub const PF_BRIDGE: ::c_int = AF_BRIDGE;
760pub const PF_ATMPVC: ::c_int = AF_ATMPVC;
761pub const PF_X25: ::c_int = AF_X25;
762pub const PF_INET6: ::c_int = AF_INET6;
763pub const PF_ROSE: ::c_int = AF_ROSE;
764pub const PF_DECnet: ::c_int = AF_DECnet;
765pub const PF_NETBEUI: ::c_int = AF_NETBEUI;
766pub const PF_SECURITY: ::c_int = AF_SECURITY;
767pub const PF_KEY: ::c_int = AF_KEY;
768pub const PF_NETLINK: ::c_int = AF_NETLINK;
769pub const PF_ROUTE: ::c_int = AF_ROUTE;
770pub const PF_PACKET: ::c_int = AF_PACKET;
771pub const PF_ASH: ::c_int = AF_ASH;
772pub const PF_ECONET: ::c_int = AF_ECONET;
773pub const PF_ATMSVC: ::c_int = AF_ATMSVC;
774pub const PF_RDS: ::c_int = AF_RDS;
775pub const PF_SNA: ::c_int = AF_SNA;
776pub const PF_IRDA: ::c_int = AF_IRDA;
777pub const PF_PPPOX: ::c_int = AF_PPPOX;
778pub const PF_WANPIPE: ::c_int = AF_WANPIPE;
779pub const PF_LLC: ::c_int = AF_LLC;
780pub const PF_CAN: ::c_int = AF_CAN;
781pub const PF_TIPC: ::c_int = AF_TIPC;
782pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
783pub const PF_IUCV: ::c_int = AF_IUCV;
784pub const PF_RXRPC: ::c_int = AF_RXRPC;
785pub const PF_ISDN: ::c_int = AF_ISDN;
786pub const PF_PHONET: ::c_int = AF_PHONET;
787pub const PF_IEEE802154: ::c_int = AF_IEEE802154;
788pub const PF_CAIF: ::c_int = AF_CAIF;
789pub const PF_ALG: ::c_int = AF_ALG;
790
791pub const MSG_OOB: ::c_int = 1;
792pub const MSG_PEEK: ::c_int = 2;
793pub const MSG_DONTROUTE: ::c_int = 4;
794pub const MSG_CTRUNC: ::c_int = 8;
795pub const MSG_TRUNC: ::c_int = 0x20;
796pub const MSG_DONTWAIT: ::c_int = 0x40;
797pub const MSG_EOR: ::c_int = 0x80;
798pub const MSG_WAITALL: ::c_int = 0x100;
799pub const MSG_FIN: ::c_int = 0x200;
800pub const MSG_SYN: ::c_int = 0x400;
801pub const MSG_CONFIRM: ::c_int = 0x800;
802pub const MSG_RST: ::c_int = 0x1000;
803pub const MSG_ERRQUEUE: ::c_int = 0x2000;
804pub const MSG_NOSIGNAL: ::c_int = 0x4000;
805pub const MSG_MORE: ::c_int = 0x8000;
806pub const MSG_WAITFORONE: ::c_int = 0x10000;
807pub const MSG_FASTOPEN: ::c_int = 0x20000000;
808pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000;
809
810pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
811
812pub const SOCK_RAW: ::c_int = 3;
813pub const SOCK_RDM: ::c_int = 4;
814pub const IP_TOS: ::c_int = 1;
815pub const IP_TTL: ::c_int = 2;
816pub const IP_HDRINCL: ::c_int = 3;
817pub const IP_OPTIONS: ::c_int = 4;
818pub const IP_ROUTER_ALERT: ::c_int = 5;
819pub const IP_RECVOPTS: ::c_int = 6;
820pub const IP_RETOPTS: ::c_int = 7;
821pub const IP_PKTINFO: ::c_int = 8;
822pub const IP_PKTOPTIONS: ::c_int = 9;
823pub const IP_MTU_DISCOVER: ::c_int = 10;
824pub const IP_RECVERR: ::c_int = 11;
825pub const IP_RECVTTL: ::c_int = 12;
826pub const IP_RECVTOS: ::c_int = 13;
827pub const IP_MTU: ::c_int = 14;
828pub const IP_FREEBIND: ::c_int = 15;
829pub const IP_IPSEC_POLICY: ::c_int = 16;
830pub const IP_XFRM_POLICY: ::c_int = 17;
831pub const IP_PASSSEC: ::c_int = 18;
832pub const IP_TRANSPARENT: ::c_int = 19;
833pub const IP_ORIGDSTADDR: ::c_int = 20;
834pub const IP_RECVORIGDSTADDR: ::c_int = IP_ORIGDSTADDR;
835pub const IP_MINTTL: ::c_int = 21;
836pub const IP_NODEFRAG: ::c_int = 22;
837pub const IP_CHECKSUM: ::c_int = 23;
838pub const IP_BIND_ADDRESS_NO_PORT: ::c_int = 24;
839pub const IP_MULTICAST_IF: ::c_int = 32;
840pub const IP_MULTICAST_TTL: ::c_int = 33;
841pub const IP_MULTICAST_LOOP: ::c_int = 34;
842pub const IP_ADD_MEMBERSHIP: ::c_int = 35;
843pub const IP_DROP_MEMBERSHIP: ::c_int = 36;
844pub const IP_UNBLOCK_SOURCE: ::c_int = 37;
845pub const IP_BLOCK_SOURCE: ::c_int = 38;
846pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 39;
847pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 40;
848pub const IP_MSFILTER: ::c_int = 41;
849pub const IP_MULTICAST_ALL: ::c_int = 49;
850pub const IP_UNICAST_IF: ::c_int = 50;
851
852pub const IP_DEFAULT_MULTICAST_TTL: ::c_int = 1;
853pub const IP_DEFAULT_MULTICAST_LOOP: ::c_int = 1;
854
855pub const IP_PMTUDISC_DONT: ::c_int = 0;
856pub const IP_PMTUDISC_WANT: ::c_int = 1;
857pub const IP_PMTUDISC_DO: ::c_int = 2;
858pub const IP_PMTUDISC_PROBE: ::c_int = 3;
859pub const IP_PMTUDISC_INTERFACE: ::c_int = 4;
860pub const IP_PMTUDISC_OMIT: ::c_int = 5;
861
862// IPPROTO_IP defined in src/unix/mod.rs
863/// Hop-by-hop option header
864pub const IPPROTO_HOPOPTS: ::c_int = 0;
865// IPPROTO_ICMP defined in src/unix/mod.rs
866/// group mgmt protocol
867pub const IPPROTO_IGMP: ::c_int = 2;
868/// for compatibility
869pub const IPPROTO_IPIP: ::c_int = 4;
870// IPPROTO_TCP defined in src/unix/mod.rs
871/// exterior gateway protocol
872pub const IPPROTO_EGP: ::c_int = 8;
873/// pup
874pub const IPPROTO_PUP: ::c_int = 12;
875// IPPROTO_UDP defined in src/unix/mod.rs
876/// xns idp
877pub const IPPROTO_IDP: ::c_int = 22;
878/// tp-4 w/ class negotiation
879pub const IPPROTO_TP: ::c_int = 29;
880/// DCCP
881pub const IPPROTO_DCCP: ::c_int = 33;
882// IPPROTO_IPV6 defined in src/unix/mod.rs
883/// IP6 routing header
884pub const IPPROTO_ROUTING: ::c_int = 43;
885/// IP6 fragmentation header
886pub const IPPROTO_FRAGMENT: ::c_int = 44;
887/// resource reservation
888pub const IPPROTO_RSVP: ::c_int = 46;
889/// General Routing Encap.
890pub const IPPROTO_GRE: ::c_int = 47;
891/// IP6 Encap Sec. Payload
892pub const IPPROTO_ESP: ::c_int = 50;
893/// IP6 Auth Header
894pub const IPPROTO_AH: ::c_int = 51;
895// IPPROTO_ICMPV6 defined in src/unix/mod.rs
896/// IP6 no next header
897pub const IPPROTO_NONE: ::c_int = 59;
898/// IP6 destination option
899pub const IPPROTO_DSTOPTS: ::c_int = 60;
900pub const IPPROTO_MTP: ::c_int = 92;
901/// encapsulation header
902pub const IPPROTO_ENCAP: ::c_int = 98;
903/// Protocol indep. multicast
904pub const IPPROTO_PIM: ::c_int = 103;
905/// IP Payload Comp. Protocol
906pub const IPPROTO_COMP: ::c_int = 108;
907/// SCTP
908pub const IPPROTO_SCTP: ::c_int = 132;
909pub const IPPROTO_MH: ::c_int = 135;
910pub const IPPROTO_UDPLITE: ::c_int = 136;
911/// raw IP packet
912pub const IPPROTO_RAW: ::c_int = 255;
913pub const IPPROTO_BEETPH: ::c_int = 94;
914pub const IPPROTO_MPLS: ::c_int = 137;
915/// Multipath TCP
916pub const IPPROTO_MPTCP: ::c_int = 262;
917/// Ethernet-within-IPv6 encapsulation.
918pub const IPPROTO_ETHERNET: ::c_int = 143;
919
920pub const MCAST_EXCLUDE: ::c_int = 0;
921pub const MCAST_INCLUDE: ::c_int = 1;
922pub const MCAST_JOIN_GROUP: ::c_int = 42;
923pub const MCAST_BLOCK_SOURCE: ::c_int = 43;
924pub const MCAST_UNBLOCK_SOURCE: ::c_int = 44;
925pub const MCAST_LEAVE_GROUP: ::c_int = 45;
926pub const MCAST_JOIN_SOURCE_GROUP: ::c_int = 46;
927pub const MCAST_LEAVE_SOURCE_GROUP: ::c_int = 47;
928pub const MCAST_MSFILTER: ::c_int = 48;
929
930pub const IPV6_ADDRFORM: ::c_int = 1;
931pub const IPV6_2292PKTINFO: ::c_int = 2;
932pub const IPV6_2292HOPOPTS: ::c_int = 3;
933pub const IPV6_2292DSTOPTS: ::c_int = 4;
934pub const IPV6_2292RTHDR: ::c_int = 5;
935pub const IPV6_2292PKTOPTIONS: ::c_int = 6;
936pub const IPV6_CHECKSUM: ::c_int = 7;
937pub const IPV6_2292HOPLIMIT: ::c_int = 8;
938pub const IPV6_NEXTHOP: ::c_int = 9;
939pub const IPV6_AUTHHDR: ::c_int = 10;
940pub const IPV6_UNICAST_HOPS: ::c_int = 16;
941pub const IPV6_MULTICAST_IF: ::c_int = 17;
942pub const IPV6_MULTICAST_HOPS: ::c_int = 18;
943pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
944pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20;
945pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21;
946pub const IPV6_ROUTER_ALERT: ::c_int = 22;
947pub const IPV6_MTU_DISCOVER: ::c_int = 23;
948pub const IPV6_MTU: ::c_int = 24;
949pub const IPV6_RECVERR: ::c_int = 25;
950pub const IPV6_V6ONLY: ::c_int = 26;
951pub const IPV6_JOIN_ANYCAST: ::c_int = 27;
952pub const IPV6_LEAVE_ANYCAST: ::c_int = 28;
953pub const IPV6_IPSEC_POLICY: ::c_int = 34;
954pub const IPV6_XFRM_POLICY: ::c_int = 35;
955pub const IPV6_HDRINCL: ::c_int = 36;
956pub const IPV6_RECVPKTINFO: ::c_int = 49;
957pub const IPV6_PKTINFO: ::c_int = 50;
958pub const IPV6_RECVHOPLIMIT: ::c_int = 51;
959pub const IPV6_HOPLIMIT: ::c_int = 52;
960pub const IPV6_RECVHOPOPTS: ::c_int = 53;
961pub const IPV6_HOPOPTS: ::c_int = 54;
962pub const IPV6_RTHDRDSTOPTS: ::c_int = 55;
963pub const IPV6_RECVRTHDR: ::c_int = 56;
964pub const IPV6_RTHDR: ::c_int = 57;
965pub const IPV6_RECVDSTOPTS: ::c_int = 58;
966pub const IPV6_DSTOPTS: ::c_int = 59;
967pub const IPV6_RECVPATHMTU: ::c_int = 60;
968pub const IPV6_PATHMTU: ::c_int = 61;
969pub const IPV6_DONTFRAG: ::c_int = 62;
970pub const IPV6_RECVTCLASS: ::c_int = 66;
971pub const IPV6_TCLASS: ::c_int = 67;
972pub const IPV6_AUTOFLOWLABEL: ::c_int = 70;
973pub const IPV6_ADDR_PREFERENCES: ::c_int = 72;
974pub const IPV6_MINHOPCOUNT: ::c_int = 73;
975pub const IPV6_ORIGDSTADDR: ::c_int = 74;
976pub const IPV6_RECVORIGDSTADDR: ::c_int = IPV6_ORIGDSTADDR;
977pub const IPV6_TRANSPARENT: ::c_int = 75;
978pub const IPV6_UNICAST_IF: ::c_int = 76;
979pub const IPV6_PREFER_SRC_TMP: ::c_int = 0x0001;
980pub const IPV6_PREFER_SRC_PUBLIC: ::c_int = 0x0002;
981pub const IPV6_PREFER_SRC_PUBTMP_DEFAULT: ::c_int = 0x0100;
982pub const IPV6_PREFER_SRC_COA: ::c_int = 0x0004;
983pub const IPV6_PREFER_SRC_HOME: ::c_int = 0x0400;
984pub const IPV6_PREFER_SRC_CGA: ::c_int = 0x0008;
985pub const IPV6_PREFER_SRC_NONCGA: ::c_int = 0x0800;
986
987pub const IPV6_PMTUDISC_DONT: ::c_int = 0;
988pub const IPV6_PMTUDISC_WANT: ::c_int = 1;
989pub const IPV6_PMTUDISC_DO: ::c_int = 2;
990pub const IPV6_PMTUDISC_PROBE: ::c_int = 3;
991pub const IPV6_PMTUDISC_INTERFACE: ::c_int = 4;
992pub const IPV6_PMTUDISC_OMIT: ::c_int = 5;
993
994pub const TCP_NODELAY: ::c_int = 1;
995pub const TCP_MAXSEG: ::c_int = 2;
996pub const TCP_CORK: ::c_int = 3;
997pub const TCP_KEEPIDLE: ::c_int = 4;
998pub const TCP_KEEPINTVL: ::c_int = 5;
999pub const TCP_KEEPCNT: ::c_int = 6;
1000pub const TCP_SYNCNT: ::c_int = 7;
1001pub const TCP_LINGER2: ::c_int = 8;
1002pub const TCP_DEFER_ACCEPT: ::c_int = 9;
1003pub const TCP_WINDOW_CLAMP: ::c_int = 10;
1004pub const TCP_INFO: ::c_int = 11;
1005pub const TCP_QUICKACK: ::c_int = 12;
1006pub const TCP_CONGESTION: ::c_int = 13;
1007pub const TCP_MD5SIG: ::c_int = 14;
1008cfg_if! {
1009 if #[cfg(all(target_os = "linux", any(
1010 target_env = "gnu",
1011 target_env = "musl",
1012 target_env = "ohos"
1013 )))] {
1014 // WARN: deprecated
1015 pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
1016 }
1017}
1018pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
1019pub const TCP_THIN_DUPACK: ::c_int = 17;
1020pub const TCP_USER_TIMEOUT: ::c_int = 18;
1021pub const TCP_REPAIR: ::c_int = 19;
1022pub const TCP_REPAIR_QUEUE: ::c_int = 20;
1023pub const TCP_QUEUE_SEQ: ::c_int = 21;
1024pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
1025pub const TCP_FASTOPEN: ::c_int = 23;
1026pub const TCP_TIMESTAMP: ::c_int = 24;
1027pub const TCP_NOTSENT_LOWAT: ::c_int = 25;
1028pub const TCP_CC_INFO: ::c_int = 26;
1029pub const TCP_SAVE_SYN: ::c_int = 27;
1030pub const TCP_SAVED_SYN: ::c_int = 28;
1031cfg_if! {
1032 if #[cfg(not(target_os = "emscripten"))] {
1033 // NOTE: emscripten doesn't support these options yet.
1034
1035 pub const TCP_REPAIR_WINDOW: ::c_int = 29;
1036 pub const TCP_FASTOPEN_CONNECT: ::c_int = 30;
1037 pub const TCP_ULP: ::c_int = 31;
1038 pub const TCP_MD5SIG_EXT: ::c_int = 32;
1039 pub const TCP_FASTOPEN_KEY: ::c_int = 33;
1040 pub const TCP_FASTOPEN_NO_COOKIE: ::c_int = 34;
1041 pub const TCP_ZEROCOPY_RECEIVE: ::c_int = 35;
1042 pub const TCP_INQ: ::c_int = 36;
1043 pub const TCP_CM_INQ: ::c_int = TCP_INQ;
1044 // NOTE: Some CI images doesn't have this option yet.
1045 // pub const TCP_TX_DELAY: ::c_int = 37;
1046 pub const TCP_MD5SIG_MAXKEYLEN: usize = 80;
1047 }
1048}
1049
1050pub const SO_DEBUG: ::c_int = 1;
1051
1052pub const SHUT_RD: ::c_int = 0;
1053pub const SHUT_WR: ::c_int = 1;
1054pub const SHUT_RDWR: ::c_int = 2;
1055
1056pub const LOCK_SH: ::c_int = 1;
1057pub const LOCK_EX: ::c_int = 2;
1058pub const LOCK_NB: ::c_int = 4;
1059pub const LOCK_UN: ::c_int = 8;
1060
1061pub const SS_ONSTACK: ::c_int = 1;
1062pub const SS_DISABLE: ::c_int = 2;
1063
1064pub const PATH_MAX: ::c_int = 4096;
1065
1066pub const UIO_MAXIOV: ::c_int = 1024;
1067
1068pub const FD_SETSIZE: usize = 1024;
1069
1070pub const EPOLLIN: ::c_int = 0x1;
1071pub const EPOLLPRI: ::c_int = 0x2;
1072pub const EPOLLOUT: ::c_int = 0x4;
1073pub const EPOLLERR: ::c_int = 0x8;
1074pub const EPOLLHUP: ::c_int = 0x10;
1075pub const EPOLLRDNORM: ::c_int = 0x40;
1076pub const EPOLLRDBAND: ::c_int = 0x80;
1077pub const EPOLLWRNORM: ::c_int = 0x100;
1078pub const EPOLLWRBAND: ::c_int = 0x200;
1079pub const EPOLLMSG: ::c_int = 0x400;
1080pub const EPOLLRDHUP: ::c_int = 0x2000;
1081pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
1082pub const EPOLLWAKEUP: ::c_int = 0x20000000;
1083pub const EPOLLONESHOT: ::c_int = 0x40000000;
1084pub const EPOLLET: ::c_int = 0x80000000;
1085
1086pub const EPOLL_CTL_ADD: ::c_int = 1;
1087pub const EPOLL_CTL_MOD: ::c_int = 3;
1088pub const EPOLL_CTL_DEL: ::c_int = 2;
1089
1090pub const MNT_FORCE: ::c_int = 0x1;
1091pub const MNT_DETACH: ::c_int = 0x2;
1092pub const MNT_EXPIRE: ::c_int = 0x4;
1093pub const UMOUNT_NOFOLLOW: ::c_int = 0x8;
1094
1095pub const Q_GETFMT: ::c_int = 0x800004;
1096pub const Q_GETINFO: ::c_int = 0x800005;
1097pub const Q_SETINFO: ::c_int = 0x800006;
1098pub const QIF_BLIMITS: u32 = 1;
1099pub const QIF_SPACE: u32 = 2;
1100pub const QIF_ILIMITS: u32 = 4;
1101pub const QIF_INODES: u32 = 8;
1102pub const QIF_BTIME: u32 = 16;
1103pub const QIF_ITIME: u32 = 32;
1104pub const QIF_LIMITS: u32 = 5;
1105pub const QIF_USAGE: u32 = 10;
1106pub const QIF_TIMES: u32 = 48;
1107pub const QIF_ALL: u32 = 63;
1108
1109pub const Q_SYNC: ::c_int = 0x800001;
1110pub const Q_QUOTAON: ::c_int = 0x800002;
1111pub const Q_QUOTAOFF: ::c_int = 0x800003;
1112pub const Q_GETQUOTA: ::c_int = 0x800007;
1113pub const Q_SETQUOTA: ::c_int = 0x800008;
1114
1115pub const TCIOFF: ::c_int = 2;
1116pub const TCION: ::c_int = 3;
1117pub const TCOOFF: ::c_int = 0;
1118pub const TCOON: ::c_int = 1;
1119pub const TCIFLUSH: ::c_int = 0;
1120pub const TCOFLUSH: ::c_int = 1;
1121pub const TCIOFLUSH: ::c_int = 2;
1122pub const NL0: ::tcflag_t = 0x00000000;
1123pub const NL1: ::tcflag_t = 0x00000100;
1124pub const TAB0: ::tcflag_t = 0x00000000;
1125pub const CR0: ::tcflag_t = 0x00000000;
1126pub const FF0: ::tcflag_t = 0x00000000;
1127pub const BS0: ::tcflag_t = 0x00000000;
1128pub const VT0: ::tcflag_t = 0x00000000;
1129pub const VERASE: usize = 2;
1130pub const VKILL: usize = 3;
1131pub const VINTR: usize = 0;
1132pub const VQUIT: usize = 1;
1133pub const VLNEXT: usize = 15;
1134pub const IGNBRK: ::tcflag_t = 0x00000001;
1135pub const BRKINT: ::tcflag_t = 0x00000002;
1136pub const IGNPAR: ::tcflag_t = 0x00000004;
1137pub const PARMRK: ::tcflag_t = 0x00000008;
1138pub const INPCK: ::tcflag_t = 0x00000010;
1139pub const ISTRIP: ::tcflag_t = 0x00000020;
1140pub const INLCR: ::tcflag_t = 0x00000040;
1141pub const IGNCR: ::tcflag_t = 0x00000080;
1142pub const ICRNL: ::tcflag_t = 0x00000100;
1143pub const IXANY: ::tcflag_t = 0x00000800;
1144pub const IMAXBEL: ::tcflag_t = 0x00002000;
1145pub const OPOST: ::tcflag_t = 0x1;
1146pub const CS5: ::tcflag_t = 0x00000000;
1147pub const CRTSCTS: ::tcflag_t = 0x80000000;
1148pub const ECHO: ::tcflag_t = 0x00000008;
1149pub const OCRNL: ::tcflag_t = 0o000010;
1150pub const ONOCR: ::tcflag_t = 0o000020;
1151pub const ONLRET: ::tcflag_t = 0o000040;
1152pub const OFILL: ::tcflag_t = 0o000100;
1153pub const OFDEL: ::tcflag_t = 0o000200;
1154
1155pub const CLONE_VM: ::c_int = 0x100;
1156pub const CLONE_FS: ::c_int = 0x200;
1157pub const CLONE_FILES: ::c_int = 0x400;
1158pub const CLONE_SIGHAND: ::c_int = 0x800;
1159pub const CLONE_PTRACE: ::c_int = 0x2000;
1160pub const CLONE_VFORK: ::c_int = 0x4000;
1161pub const CLONE_PARENT: ::c_int = 0x8000;
1162pub const CLONE_THREAD: ::c_int = 0x10000;
1163pub const CLONE_NEWNS: ::c_int = 0x20000;
1164pub const CLONE_SYSVSEM: ::c_int = 0x40000;
1165pub const CLONE_SETTLS: ::c_int = 0x80000;
1166pub const CLONE_PARENT_SETTID: ::c_int = 0x100000;
1167pub const CLONE_CHILD_CLEARTID: ::c_int = 0x200000;
1168pub const CLONE_DETACHED: ::c_int = 0x400000;
1169pub const CLONE_UNTRACED: ::c_int = 0x800000;
1170pub const CLONE_CHILD_SETTID: ::c_int = 0x01000000;
1171pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
1172pub const CLONE_NEWUTS: ::c_int = 0x04000000;
1173pub const CLONE_NEWIPC: ::c_int = 0x08000000;
1174pub const CLONE_NEWUSER: ::c_int = 0x10000000;
1175pub const CLONE_NEWPID: ::c_int = 0x20000000;
1176pub const CLONE_NEWNET: ::c_int = 0x40000000;
1177pub const CLONE_IO: ::c_int = 0x80000000;
1178
1179pub const WNOHANG: ::c_int = 0x00000001;
1180pub const WUNTRACED: ::c_int = 0x00000002;
1181pub const WSTOPPED: ::c_int = WUNTRACED;
1182pub const WEXITED: ::c_int = 0x00000004;
1183pub const WCONTINUED: ::c_int = 0x00000008;
1184pub const WNOWAIT: ::c_int = 0x01000000;
1185
1186// Options for personality(2).
1187pub const ADDR_NO_RANDOMIZE: ::c_int = 0x0040000;
1188pub const MMAP_PAGE_ZERO: ::c_int = 0x0100000;
1189pub const ADDR_COMPAT_LAYOUT: ::c_int = 0x0200000;
1190pub const READ_IMPLIES_EXEC: ::c_int = 0x0400000;
1191pub const ADDR_LIMIT_32BIT: ::c_int = 0x0800000;
1192pub const SHORT_INODE: ::c_int = 0x1000000;
1193pub const WHOLE_SECONDS: ::c_int = 0x2000000;
1194pub const STICKY_TIMEOUTS: ::c_int = 0x4000000;
1195pub const ADDR_LIMIT_3GB: ::c_int = 0x8000000;
1196
1197// Options set using PTRACE_SETOPTIONS.
1198pub const PTRACE_O_TRACESYSGOOD: ::c_int = 0x00000001;
1199pub const PTRACE_O_TRACEFORK: ::c_int = 0x00000002;
1200pub const PTRACE_O_TRACEVFORK: ::c_int = 0x00000004;
1201pub const PTRACE_O_TRACECLONE: ::c_int = 0x00000008;
1202pub const PTRACE_O_TRACEEXEC: ::c_int = 0x00000010;
1203pub const PTRACE_O_TRACEVFORKDONE: ::c_int = 0x00000020;
1204pub const PTRACE_O_TRACEEXIT: ::c_int = 0x00000040;
1205pub const PTRACE_O_TRACESECCOMP: ::c_int = 0x00000080;
1206pub const PTRACE_O_SUSPEND_SECCOMP: ::c_int = 0x00200000;
1207pub const PTRACE_O_EXITKILL: ::c_int = 0x00100000;
1208pub const PTRACE_O_MASK: ::c_int = 0x003000ff;
1209
1210// Wait extended result codes for the above trace options.
1211pub const PTRACE_EVENT_FORK: ::c_int = 1;
1212pub const PTRACE_EVENT_VFORK: ::c_int = 2;
1213pub const PTRACE_EVENT_CLONE: ::c_int = 3;
1214pub const PTRACE_EVENT_EXEC: ::c_int = 4;
1215pub const PTRACE_EVENT_VFORK_DONE: ::c_int = 5;
1216pub const PTRACE_EVENT_EXIT: ::c_int = 6;
1217pub const PTRACE_EVENT_SECCOMP: ::c_int = 7;
1218
1219pub const __WNOTHREAD: ::c_int = 0x20000000;
1220pub const __WALL: ::c_int = 0x40000000;
1221pub const __WCLONE: ::c_int = 0x80000000;
1222
1223pub const SPLICE_F_MOVE: ::c_uint = 0x01;
1224pub const SPLICE_F_NONBLOCK: ::c_uint = 0x02;
1225pub const SPLICE_F_MORE: ::c_uint = 0x04;
1226pub const SPLICE_F_GIFT: ::c_uint = 0x08;
1227
1228pub const RTLD_LOCAL: ::c_int = 0;
1229pub const RTLD_LAZY: ::c_int = 1;
1230
1231pub const POSIX_FADV_NORMAL: ::c_int = 0;
1232pub const POSIX_FADV_RANDOM: ::c_int = 1;
1233pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
1234pub const POSIX_FADV_WILLNEED: ::c_int = 3;
1235
1236pub const AT_FDCWD: ::c_int = -100;
1237pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x100;
1238pub const AT_REMOVEDIR: ::c_int = 0x200;
1239pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
1240pub const AT_NO_AUTOMOUNT: ::c_int = 0x800;
1241pub const AT_EMPTY_PATH: ::c_int = 0x1000;
1242pub const AT_RECURSIVE: ::c_int = 0x8000;
1243
1244pub const LOG_CRON: ::c_int = 9 << 3;
1245pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
1246pub const LOG_FTP: ::c_int = 11 << 3;
1247pub const LOG_PERROR: ::c_int = 0x20;
1248
1249pub const PIPE_BUF: usize = 4096;
1250
1251pub const SI_LOAD_SHIFT: ::c_uint = 16;
1252
1253// si_code values for SIGBUS signal
1254pub const BUS_ADRALN: ::c_int = 1;
1255pub const BUS_ADRERR: ::c_int = 2;
1256pub const BUS_OBJERR: ::c_int = 3;
1257// Linux-specific si_code values for SIGBUS signal
1258pub const BUS_MCEERR_AR: ::c_int = 4;
1259pub const BUS_MCEERR_AO: ::c_int = 5;
1260
1261// si_code values for SIGCHLD signal
1262pub const CLD_EXITED: ::c_int = 1;
1263pub const CLD_KILLED: ::c_int = 2;
1264pub const CLD_DUMPED: ::c_int = 3;
1265pub const CLD_TRAPPED: ::c_int = 4;
1266pub const CLD_STOPPED: ::c_int = 5;
1267pub const CLD_CONTINUED: ::c_int = 6;
1268
1269pub const SIGEV_SIGNAL: ::c_int = 0;
1270pub const SIGEV_NONE: ::c_int = 1;
1271pub const SIGEV_THREAD: ::c_int = 2;
1272
1273pub const P_ALL: idtype_t = 0;
1274pub const P_PID: idtype_t = 1;
1275pub const P_PGID: idtype_t = 2;
1276cfg_if! {
1277 if #[cfg(not(target_os = "emscripten"))] {
1278 pub const P_PIDFD: idtype_t = 3;
1279 }
1280}
1281
1282pub const UTIME_OMIT: c_long = 1073741822;
1283pub const UTIME_NOW: c_long = 1073741823;
1284
1285pub const POLLIN: ::c_short = 0x1;
1286pub const POLLPRI: ::c_short = 0x2;
1287pub const POLLOUT: ::c_short = 0x4;
1288pub const POLLERR: ::c_short = 0x8;
1289pub const POLLHUP: ::c_short = 0x10;
1290pub const POLLNVAL: ::c_short = 0x20;
1291pub const POLLRDNORM: ::c_short = 0x040;
1292pub const POLLRDBAND: ::c_short = 0x080;
1293#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64")))]
1294pub const POLLRDHUP: ::c_short = 0x2000;
1295#[cfg(any(target_arch = "sparc", target_arch = "sparc64"))]
1296pub const POLLRDHUP: ::c_short = 0x800;
1297
1298pub const IPTOS_LOWDELAY: u8 = 0x10;
1299pub const IPTOS_THROUGHPUT: u8 = 0x08;
1300pub const IPTOS_RELIABILITY: u8 = 0x04;
1301pub const IPTOS_MINCOST: u8 = 0x02;
1302
1303pub const IPTOS_PREC_NETCONTROL: u8 = 0xe0;
1304pub const IPTOS_PREC_INTERNETCONTROL: u8 = 0xc0;
1305pub const IPTOS_PREC_CRITIC_ECP: u8 = 0xa0;
1306pub const IPTOS_PREC_FLASHOVERRIDE: u8 = 0x80;
1307pub const IPTOS_PREC_FLASH: u8 = 0x60;
1308pub const IPTOS_PREC_IMMEDIATE: u8 = 0x40;
1309pub const IPTOS_PREC_PRIORITY: u8 = 0x20;
1310pub const IPTOS_PREC_ROUTINE: u8 = 0x00;
1311
1312pub const IPTOS_ECN_MASK: u8 = 0x03;
1313pub const IPTOS_ECN_ECT1: u8 = 0x01;
1314pub const IPTOS_ECN_ECT0: u8 = 0x02;
1315pub const IPTOS_ECN_CE: u8 = 0x03;
1316
1317pub const IPOPT_COPY: u8 = 0x80;
1318pub const IPOPT_CLASS_MASK: u8 = 0x60;
1319pub const IPOPT_NUMBER_MASK: u8 = 0x1f;
1320
1321pub const IPOPT_CONTROL: u8 = 0x00;
1322pub const IPOPT_RESERVED1: u8 = 0x20;
1323pub const IPOPT_MEASUREMENT: u8 = 0x40;
1324pub const IPOPT_RESERVED2: u8 = 0x60;
1325pub const IPOPT_END: u8 = 0 | IPOPT_CONTROL;
1326pub const IPOPT_NOOP: u8 = 1 | IPOPT_CONTROL;
1327pub const IPOPT_SEC: u8 = 2 | IPOPT_CONTROL | IPOPT_COPY;
1328pub const IPOPT_LSRR: u8 = 3 | IPOPT_CONTROL | IPOPT_COPY;
1329pub const IPOPT_TIMESTAMP: u8 = 4 | IPOPT_MEASUREMENT;
1330pub const IPOPT_RR: u8 = 7 | IPOPT_CONTROL;
1331pub const IPOPT_SID: u8 = 8 | IPOPT_CONTROL | IPOPT_COPY;
1332pub const IPOPT_SSRR: u8 = 9 | IPOPT_CONTROL | IPOPT_COPY;
1333pub const IPOPT_RA: u8 = 20 | IPOPT_CONTROL | IPOPT_COPY;
1334pub const IPVERSION: u8 = 4;
1335pub const MAXTTL: u8 = 255;
1336pub const IPDEFTTL: u8 = 64;
1337pub const IPOPT_OPTVAL: u8 = 0;
1338pub const IPOPT_OLEN: u8 = 1;
1339pub const IPOPT_OFFSET: u8 = 2;
1340pub const IPOPT_MINOFF: u8 = 4;
1341pub const MAX_IPOPTLEN: u8 = 40;
1342pub const IPOPT_NOP: u8 = IPOPT_NOOP;
1343pub const IPOPT_EOL: u8 = IPOPT_END;
1344pub const IPOPT_TS: u8 = IPOPT_TIMESTAMP;
1345pub const IPOPT_TS_TSONLY: u8 = 0;
1346pub const IPOPT_TS_TSANDADDR: u8 = 1;
1347pub const IPOPT_TS_PRESPEC: u8 = 3;
1348
1349pub const ARPOP_RREQUEST: u16 = 3;
1350pub const ARPOP_RREPLY: u16 = 4;
1351pub const ARPOP_InREQUEST: u16 = 8;
1352pub const ARPOP_InREPLY: u16 = 9;
1353pub const ARPOP_NAK: u16 = 10;
1354
1355pub const ATF_NETMASK: ::c_int = 0x20;
1356pub const ATF_DONTPUB: ::c_int = 0x40;
1357
1358pub const ARPHRD_NETROM: u16 = 0;
1359pub const ARPHRD_ETHER: u16 = 1;
1360pub const ARPHRD_EETHER: u16 = 2;
1361pub const ARPHRD_AX25: u16 = 3;
1362pub const ARPHRD_PRONET: u16 = 4;
1363pub const ARPHRD_CHAOS: u16 = 5;
1364pub const ARPHRD_IEEE802: u16 = 6;
1365pub const ARPHRD_ARCNET: u16 = 7;
1366pub const ARPHRD_APPLETLK: u16 = 8;
1367pub const ARPHRD_DLCI: u16 = 15;
1368pub const ARPHRD_ATM: u16 = 19;
1369pub const ARPHRD_METRICOM: u16 = 23;
1370pub const ARPHRD_IEEE1394: u16 = 24;
1371pub const ARPHRD_EUI64: u16 = 27;
1372pub const ARPHRD_INFINIBAND: u16 = 32;
1373
1374pub const ARPHRD_SLIP: u16 = 256;
1375pub const ARPHRD_CSLIP: u16 = 257;
1376pub const ARPHRD_SLIP6: u16 = 258;
1377pub const ARPHRD_CSLIP6: u16 = 259;
1378pub const ARPHRD_RSRVD: u16 = 260;
1379pub const ARPHRD_ADAPT: u16 = 264;
1380pub const ARPHRD_ROSE: u16 = 270;
1381pub const ARPHRD_X25: u16 = 271;
1382pub const ARPHRD_HWX25: u16 = 272;
1383pub const ARPHRD_CAN: u16 = 280;
1384pub const ARPHRD_PPP: u16 = 512;
1385pub const ARPHRD_CISCO: u16 = 513;
1386pub const ARPHRD_HDLC: u16 = ARPHRD_CISCO;
1387pub const ARPHRD_LAPB: u16 = 516;
1388pub const ARPHRD_DDCMP: u16 = 517;
1389pub const ARPHRD_RAWHDLC: u16 = 518;
1390
1391pub const ARPHRD_TUNNEL: u16 = 768;
1392pub const ARPHRD_TUNNEL6: u16 = 769;
1393pub const ARPHRD_FRAD: u16 = 770;
1394pub const ARPHRD_SKIP: u16 = 771;
1395pub const ARPHRD_LOOPBACK: u16 = 772;
1396pub const ARPHRD_LOCALTLK: u16 = 773;
1397pub const ARPHRD_FDDI: u16 = 774;
1398pub const ARPHRD_BIF: u16 = 775;
1399pub const ARPHRD_SIT: u16 = 776;
1400pub const ARPHRD_IPDDP: u16 = 777;
1401pub const ARPHRD_IPGRE: u16 = 778;
1402pub const ARPHRD_PIMREG: u16 = 779;
1403pub const ARPHRD_HIPPI: u16 = 780;
1404pub const ARPHRD_ASH: u16 = 781;
1405pub const ARPHRD_ECONET: u16 = 782;
1406pub const ARPHRD_IRDA: u16 = 783;
1407pub const ARPHRD_FCPP: u16 = 784;
1408pub const ARPHRD_FCAL: u16 = 785;
1409pub const ARPHRD_FCPL: u16 = 786;
1410pub const ARPHRD_FCFABRIC: u16 = 787;
1411pub const ARPHRD_IEEE802_TR: u16 = 800;
1412pub const ARPHRD_IEEE80211: u16 = 801;
1413pub const ARPHRD_IEEE80211_PRISM: u16 = 802;
1414pub const ARPHRD_IEEE80211_RADIOTAP: u16 = 803;
1415pub const ARPHRD_IEEE802154: u16 = 804;
1416
1417pub const ARPHRD_VOID: u16 = 0xFFFF;
1418pub const ARPHRD_NONE: u16 = 0xFFFE;
1419
1420cfg_if! {
1421 if #[cfg(target_os = "emscripten")] {
1422 // Emscripten does not define any `*_SUPER_MAGIC` constants.
1423 } else if #[cfg(not(target_arch = "s390x"))] {
1424 pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5;
1425 pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff;
1426 pub const AFS_SUPER_MAGIC: ::c_long = 0x5346414f;
1427 pub const AUTOFS_SUPER_MAGIC: ::c_long = 0x0187;
1428 pub const BPF_FS_MAGIC: ::c_long = 0xcafe4a11;
1429 pub const BTRFS_SUPER_MAGIC: ::c_long = 0x9123683e;
1430 pub const CGROUP2_SUPER_MAGIC: ::c_long = 0x63677270;
1431 pub const CGROUP_SUPER_MAGIC: ::c_long = 0x27e0eb;
1432 pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245;
1433 pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45;
1434 pub const DEBUGFS_MAGIC: ::c_long = 0x64626720;
1435 pub const DEVPTS_SUPER_MAGIC: ::c_long = 0x1cd1;
1436 pub const ECRYPTFS_SUPER_MAGIC: ::c_long = 0xf15f;
1437 pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53;
1438 pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53;
1439 pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53;
1440 pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53;
1441 pub const F2FS_SUPER_MAGIC: ::c_long = 0xf2f52010;
1442 pub const FUSE_SUPER_MAGIC: ::c_long = 0x65735546;
1443 pub const FUTEXFS_SUPER_MAGIC: ::c_long = 0xbad1dea;
1444 pub const HOSTFS_SUPER_MAGIC: ::c_long = 0x00c0ffee;
1445 pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849;
1446 pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6;
1447 pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660;
1448 pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6;
1449 pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478;
1450 pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468;
1451 pub const MINIX3_SUPER_MAGIC: ::c_long = 0x4d5a;
1452 pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f;
1453 pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f;
1454 pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44;
1455 pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c;
1456 pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969;
1457 pub const NILFS_SUPER_MAGIC: ::c_long = 0x3434;
1458 pub const OCFS2_SUPER_MAGIC: ::c_long = 0x7461636f;
1459 pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1;
1460 pub const OVERLAYFS_SUPER_MAGIC: ::c_long = 0x794c7630;
1461 pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0;
1462 pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f;
1463 pub const QNX6_SUPER_MAGIC: ::c_long = 0x68191122;
1464 pub const RDTGROUP_SUPER_MAGIC: ::c_long = 0x7655821;
1465 pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973;
1466 pub const SECURITYFS_MAGIC: ::c_long = 0x73636673;
1467 pub const SELINUX_MAGIC: ::c_long = 0xf97cff8c;
1468 pub const SMACK_MAGIC: ::c_long = 0x43415d53;
1469 pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b;
1470 pub const SYSFS_MAGIC: ::c_long = 0x62656572;
1471 pub const TMPFS_MAGIC: ::c_long = 0x01021994;
1472 pub const TRACEFS_MAGIC: ::c_long = 0x74726163;
1473 pub const UDF_SUPER_MAGIC: ::c_long = 0x15013346;
1474 pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2;
1475 pub const XENFS_SUPER_MAGIC: ::c_long = 0xabba1974;
1476 pub const NSFS_MAGIC: ::c_long = 0x6e736673;
1477 } else if #[cfg(target_arch = "s390x")] {
1478 pub const ADFS_SUPER_MAGIC: ::c_uint = 0x0000adf5;
1479 pub const AFFS_SUPER_MAGIC: ::c_uint = 0x0000adff;
1480 pub const AFS_SUPER_MAGIC: ::c_uint = 0x5346414f;
1481 pub const AUTOFS_SUPER_MAGIC: ::c_uint = 0x0187;
1482 pub const BPF_FS_MAGIC: ::c_uint = 0xcafe4a11;
1483 pub const BTRFS_SUPER_MAGIC: ::c_uint = 0x9123683e;
1484 pub const CGROUP2_SUPER_MAGIC: ::c_uint = 0x63677270;
1485 pub const CGROUP_SUPER_MAGIC: ::c_uint = 0x27e0eb;
1486 pub const CODA_SUPER_MAGIC: ::c_uint = 0x73757245;
1487 pub const CRAMFS_MAGIC: ::c_uint = 0x28cd3d45;
1488 pub const DEBUGFS_MAGIC: ::c_uint = 0x64626720;
1489 pub const DEVPTS_SUPER_MAGIC: ::c_uint = 0x1cd1;
1490 pub const ECRYPTFS_SUPER_MAGIC: ::c_uint = 0xf15f;
1491 pub const EFS_SUPER_MAGIC: ::c_uint = 0x00414a53;
1492 pub const EXT2_SUPER_MAGIC: ::c_uint = 0x0000ef53;
1493 pub const EXT3_SUPER_MAGIC: ::c_uint = 0x0000ef53;
1494 pub const EXT4_SUPER_MAGIC: ::c_uint = 0x0000ef53;
1495 pub const F2FS_SUPER_MAGIC: ::c_uint = 0xf2f52010;
1496 pub const FUSE_SUPER_MAGIC: ::c_uint = 0x65735546;
1497 pub const FUTEXFS_SUPER_MAGIC: ::c_uint = 0xbad1dea;
1498 pub const HOSTFS_SUPER_MAGIC: ::c_uint = 0x00c0ffee;
1499 pub const HPFS_SUPER_MAGIC: ::c_uint = 0xf995e849;
1500 pub const HUGETLBFS_MAGIC: ::c_uint = 0x958458f6;
1501 pub const ISOFS_SUPER_MAGIC: ::c_uint = 0x00009660;
1502 pub const JFFS2_SUPER_MAGIC: ::c_uint = 0x000072b6;
1503 pub const MINIX2_SUPER_MAGIC2: ::c_uint = 0x00002478;
1504 pub const MINIX2_SUPER_MAGIC: ::c_uint = 0x00002468;
1505 pub const MINIX3_SUPER_MAGIC: ::c_uint = 0x4d5a;
1506 pub const MINIX_SUPER_MAGIC2: ::c_uint = 0x0000138f;
1507 pub const MINIX_SUPER_MAGIC: ::c_uint = 0x0000137f;
1508 pub const MSDOS_SUPER_MAGIC: ::c_uint = 0x00004d44;
1509 pub const NCP_SUPER_MAGIC: ::c_uint = 0x0000564c;
1510 pub const NFS_SUPER_MAGIC: ::c_uint = 0x00006969;
1511 pub const NILFS_SUPER_MAGIC: ::c_uint = 0x3434;
1512 pub const OCFS2_SUPER_MAGIC: ::c_uint = 0x7461636f;
1513 pub const OPENPROM_SUPER_MAGIC: ::c_uint = 0x00009fa1;
1514 pub const OVERLAYFS_SUPER_MAGIC: ::c_uint = 0x794c7630;
1515 pub const PROC_SUPER_MAGIC: ::c_uint = 0x00009fa0;
1516 pub const QNX4_SUPER_MAGIC: ::c_uint = 0x0000002f;
1517 pub const QNX6_SUPER_MAGIC: ::c_uint = 0x68191122;
1518 pub const RDTGROUP_SUPER_MAGIC: ::c_uint = 0x7655821;
1519 pub const REISERFS_SUPER_MAGIC: ::c_uint = 0x52654973;
1520 pub const SECURITYFS_MAGIC: ::c_uint = 0x73636673;
1521 pub const SELINUX_MAGIC: ::c_uint = 0xf97cff8c;
1522 pub const SMACK_MAGIC: ::c_uint = 0x43415d53;
1523 pub const SMB_SUPER_MAGIC: ::c_uint = 0x0000517b;
1524 pub const SYSFS_MAGIC: ::c_uint = 0x62656572;
1525 pub const TMPFS_MAGIC: ::c_uint = 0x01021994;
1526 pub const TRACEFS_MAGIC: ::c_uint = 0x74726163;
1527 pub const UDF_SUPER_MAGIC: ::c_uint = 0x15013346;
1528 pub const USBDEVICE_SUPER_MAGIC: ::c_uint = 0x00009fa2;
1529 pub const XENFS_SUPER_MAGIC: ::c_uint = 0xabba1974;
1530 pub const NSFS_MAGIC: ::c_uint = 0x6e736673;
1531 }
1532}
1533
1534const_fn! {
1535 {const} fn CMSG_ALIGN(len: usize) -> usize {
1536 len + ::mem::size_of::<usize>() - 1 & !(::mem::size_of::<usize>() - 1)
1537 }
1538}
1539
1540f! {
1541 pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
1542 if (*mhdr).msg_controllen as usize >= ::mem::size_of::<cmsghdr>() {
1543 (*mhdr).msg_control as *mut cmsghdr
1544 } else {
1545 0 as *mut cmsghdr
1546 }
1547 }
1548
1549 pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut ::c_uchar {
1550 cmsg.offset(1) as *mut ::c_uchar
1551 }
1552
1553 pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
1554 (CMSG_ALIGN(length as usize) + CMSG_ALIGN(::mem::size_of::<cmsghdr>()))
1555 as ::c_uint
1556 }
1557
1558 pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
1559 CMSG_ALIGN(::mem::size_of::<cmsghdr>()) as ::c_uint + length
1560 }
1561
1562 pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
1563 let fd = fd as usize;
1564 let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
1565 (*set).fds_bits[fd / size] &= !(1 << (fd % size));
1566 return
1567 }
1568
1569 pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
1570 let fd = fd as usize;
1571 let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
1572 return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
1573 }
1574
1575 pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
1576 let fd = fd as usize;
1577 let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
1578 (*set).fds_bits[fd / size] |= 1 << (fd % size);
1579 return
1580 }
1581
1582 pub fn FD_ZERO(set: *mut fd_set) -> () {
1583 for slot in (*set).fds_bits.iter_mut() {
1584 *slot = 0;
1585 }
1586 }
1587}
1588
1589safe_f! {
1590 pub fn SIGRTMAX() -> ::c_int {
1591 unsafe { __libc_current_sigrtmax() }
1592 }
1593
1594 pub fn SIGRTMIN() -> ::c_int {
1595 unsafe { __libc_current_sigrtmin() }
1596 }
1597
1598 pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
1599 (status & 0xff) == 0x7f
1600 }
1601
1602 pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
1603 (status >> 8) & 0xff
1604 }
1605
1606 pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
1607 status == 0xffff
1608 }
1609
1610 pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
1611 ((status & 0x7f) + 1) as i8 >= 2
1612 }
1613
1614 pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int {
1615 status & 0x7f
1616 }
1617
1618 pub {const} fn WIFEXITED(status: ::c_int) -> bool {
1619 (status & 0x7f) == 0
1620 }
1621
1622 pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int {
1623 (status >> 8) & 0xff
1624 }
1625
1626 pub {const} fn WCOREDUMP(status: ::c_int) -> bool {
1627 (status & 0x80) != 0
1628 }
1629
1630 pub {const} fn W_EXITCODE(ret: ::c_int, sig: ::c_int) -> ::c_int {
1631 (ret << 8) | sig
1632 }
1633
1634 pub {const} fn W_STOPCODE(sig: ::c_int) -> ::c_int {
1635 (sig << 8) | 0x7f
1636 }
1637
1638 pub {const} fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int {
1639 (cmd << 8) | (type_ & 0x00ff)
1640 }
1641
1642 pub {const} fn IPOPT_COPIED(o: u8) -> u8 {
1643 o & IPOPT_COPY
1644 }
1645
1646 pub {const} fn IPOPT_CLASS(o: u8) -> u8 {
1647 o & IPOPT_CLASS_MASK
1648 }
1649
1650 pub {const} fn IPOPT_NUMBER(o: u8) -> u8 {
1651 o & IPOPT_NUMBER_MASK
1652 }
1653
1654 pub {const} fn IPTOS_ECN(x: u8) -> u8 {
1655 x & ::IPTOS_ECN_MASK
1656 }
1657
1658 #[allow(ellipsis_inclusive_range_patterns)]
1659 pub {const} fn KERNEL_VERSION(a: u32, b: u32, c: u32) -> u32 {
1660 ((a << 16) + (b << 8)) + match c {
1661 0 ... 255 => c,
1662 _ => 255,
1663 }
1664 }
1665}
1666
1667extern "C" {
1668 #[doc(hidden)]
1669 pub fn __libc_current_sigrtmax() -> ::c_int;
1670 #[doc(hidden)]
1671 pub fn __libc_current_sigrtmin() -> ::c_int;
1672
1673 pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
1674 pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
1675 pub fn fdatasync(fd: ::c_int) -> ::c_int;
1676 pub fn mincore(addr: *mut ::c_void, len: ::size_t, vec: *mut ::c_uchar) -> ::c_int;
1677
1678 pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
1679 pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
1680 pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
1681 pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
1682
1683 pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
1684
1685 pub fn pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
1686 pub fn pthread_attr_getstack(
1687 attr: *const ::pthread_attr_t,
1688 stackaddr: *mut *mut ::c_void,
1689 stacksize: *mut ::size_t,
1690 ) -> ::c_int;
1691 pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
1692 pub fn setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int;
1693 pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
1694 pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
1695 pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
1696 pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
1697 pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
1698 pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
1699 pub fn utimensat(
1700 dirfd: ::c_int,
1701 path: *const ::c_char,
1702 times: *const ::timespec,
1703 flag: ::c_int,
1704 ) -> ::c_int;
1705 pub fn duplocale(base: ::locale_t) -> ::locale_t;
1706 pub fn freelocale(loc: ::locale_t);
1707 pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
1708 pub fn uselocale(loc: ::locale_t) -> ::locale_t;
1709 pub fn mknodat(
1710 dirfd: ::c_int,
1711 pathname: *const ::c_char,
1712 mode: ::mode_t,
1713 dev: dev_t,
1714 ) -> ::c_int;
1715 pub fn pthread_condattr_getclock(
1716 attr: *const pthread_condattr_t,
1717 clock_id: *mut clockid_t,
1718 ) -> ::c_int;
1719 pub fn pthread_condattr_setclock(
1720 attr: *mut pthread_condattr_t,
1721 clock_id: ::clockid_t,
1722 ) -> ::c_int;
1723 pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int;
1724 pub fn pthread_mutexattr_setpshared(
1725 attr: *mut pthread_mutexattr_t,
1726 pshared: ::c_int,
1727 ) -> ::c_int;
1728 pub fn pthread_rwlockattr_getpshared(
1729 attr: *const pthread_rwlockattr_t,
1730 val: *mut ::c_int,
1731 ) -> ::c_int;
1732 pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
1733 pub fn ptsname_r(fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t) -> ::c_int;
1734 pub fn clearenv() -> ::c_int;
1735 pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
1736 -> ::c_int;
1737 pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int;
1738 pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int;
1739 pub fn acct(filename: *const ::c_char) -> ::c_int;
1740 pub fn brk(addr: *mut ::c_void) -> ::c_int;
1741 pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
1742 #[deprecated(
1743 since = "0.2.66",
1744 note = "causes memory corruption, see rust-lang/libc#1596"
1745 )]
1746 pub fn vfork() -> ::pid_t;
1747 pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
1748 pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
1749 pub fn wait4(
1750 pid: ::pid_t,
1751 status: *mut ::c_int,
1752 options: ::c_int,
1753 rusage: *mut ::rusage,
1754 ) -> ::pid_t;
1755 pub fn login_tty(fd: ::c_int) -> ::c_int;
1756 pub fn execvpe(
1757 file: *const ::c_char,
1758 argv: *const *const ::c_char,
1759 envp: *const *const ::c_char,
1760 ) -> ::c_int;
1761 pub fn fexecve(
1762 fd: ::c_int,
1763 argv: *const *const ::c_char,
1764 envp: *const *const ::c_char,
1765 ) -> ::c_int;
1766 pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
1767 pub fn freeifaddrs(ifa: *mut ::ifaddrs);
1768 pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
1769
1770 pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
1771 pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
1772
1773 pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
1774 pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
1775 pub fn uname(buf: *mut ::utsname) -> ::c_int;
1776
1777 pub fn strchrnul(s: *const ::c_char, c: ::c_int) -> *mut ::c_char;
1778}
1779
1780// LFS64 extensions
1781//
1782// * musl and Emscripten has 64-bit versions only so aliases the LFS64 symbols to the standard ones
1783// * ulibc doesn't have preadv64/pwritev64
1784cfg_if! {
1785 if #[cfg(not(any(target_env = "musl", target_os = "emscripten")))] {
1786 extern "C" {
1787 pub fn fstatfs64(fd: ::c_int, buf: *mut statfs64) -> ::c_int;
1788 pub fn statvfs64(path: *const ::c_char, buf: *mut statvfs64) -> ::c_int;
1789 pub fn fstatvfs64(fd: ::c_int, buf: *mut statvfs64) -> ::c_int;
1790 pub fn statfs64(path: *const ::c_char, buf: *mut statfs64) -> ::c_int;
1791 pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int;
1792 pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int;
1793 pub fn fstatat64(
1794 dirfd: ::c_int,
1795 pathname: *const c_char,
1796 buf: *mut stat64,
1797 flags: ::c_int,
1798 ) -> ::c_int;
1799 pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int;
1800 pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t;
1801 pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
1802 pub fn mmap64(
1803 addr: *mut ::c_void,
1804 len: ::size_t,
1805 prot: ::c_int,
1806 flags: ::c_int,
1807 fd: ::c_int,
1808 offset: off64_t,
1809 ) -> *mut ::c_void;
1810 pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
1811 pub fn openat64(fd: ::c_int, path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
1812 pub fn posix_fadvise64(
1813 fd: ::c_int,
1814 offset: ::off64_t,
1815 len: ::off64_t,
1816 advise: ::c_int,
1817 ) -> ::c_int;
1818 pub fn pread64(
1819 fd: ::c_int,
1820 buf: *mut ::c_void,
1821 count: ::size_t,
1822 offset: off64_t
1823 ) -> ::ssize_t;
1824 pub fn pwrite64(
1825 fd: ::c_int,
1826 buf: *const ::c_void,
1827 count: ::size_t,
1828 offset: off64_t,
1829 ) -> ::ssize_t;
1830 pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64;
1831 pub fn readdir64_r(
1832 dirp: *mut ::DIR,
1833 entry: *mut ::dirent64,
1834 result: *mut *mut ::dirent64,
1835 ) -> ::c_int;
1836 pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
1837 pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int;
1838 }
1839 }
1840}
1841
1842cfg_if! {
1843 if #[cfg(not(any(target_env = "uclibc", target_env = "musl", target_os = "emscripten")))] {
1844 extern "C" {
1845 pub fn preadv64(
1846 fd: ::c_int,
1847 iov: *const ::iovec,
1848 iovcnt: ::c_int,
1849 offset: ::off64_t,
1850 ) -> ::ssize_t;
1851 pub fn pwritev64(
1852 fd: ::c_int,
1853 iov: *const ::iovec,
1854 iovcnt: ::c_int,
1855 offset: ::off64_t,
1856 ) -> ::ssize_t;
1857 }
1858 }
1859}
1860
1861cfg_if! {
1862 if #[cfg(not(target_env = "uclibc"))] {
1863 extern "C" {
1864 // uclibc has separate non-const version of this function
1865 pub fn forkpty(
1866 amaster: *mut ::c_int,
1867 name: *mut ::c_char,
1868 termp: *const termios,
1869 winp: *const ::winsize,
1870 ) -> ::pid_t;
1871 // uclibc has separate non-const version of this function
1872 pub fn openpty(
1873 amaster: *mut ::c_int,
1874 aslave: *mut ::c_int,
1875 name: *mut ::c_char,
1876 termp: *const termios,
1877 winp: *const ::winsize,
1878 ) -> ::c_int;
1879 }
1880 }
1881}
1882
1883cfg_if! {
1884 if #[cfg(target_os = "emscripten")] {
1885 mod emscripten;
1886 pub use self::emscripten::*;
1887 } else if #[cfg(target_os = "linux")] {
1888 mod linux;
1889 pub use self::linux::*;
1890 } else if #[cfg(target_os = "l4re")] {
1891 mod linux;
1892 pub use self::linux::*;
1893 } else if #[cfg(target_os = "android")] {
1894 mod android;
1895 pub use self::android::*;
1896 } else {
1897 // Unknown target_os
1898 }
1899}
1900