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