libc_interface/unix/notbsd/
mod.rs1use dox::mem;
2
3pub type sa_family_t = u16;
4pub type pthread_key_t = ::c_uint;
5pub type speed_t = ::c_uint;
6pub type tcflag_t = ::c_uint;
7pub type clockid_t = ::c_int;
8pub type key_t = ::c_int;
9pub type id_t = ::c_uint;
10
11pub enum timezone {}
12
13s! {
14 pub struct sockaddr {
15 pub sa_family: sa_family_t,
16 pub sa_data: [::c_char; 14],
17 }
18
19 pub struct sockaddr_in {
20 pub sin_family: sa_family_t,
21 pub sin_port: ::in_port_t,
22 pub sin_addr: ::in_addr,
23 pub sin_zero: [u8; 8],
24 }
25
26 pub struct sockaddr_in6 {
27 pub sin6_family: sa_family_t,
28 pub sin6_port: ::in_port_t,
29 pub sin6_flowinfo: u32,
30 pub sin6_addr: ::in6_addr,
31 pub sin6_scope_id: u32,
32 }
33
34 pub struct sockaddr_un {
35 pub sun_family: sa_family_t,
36 pub sun_path: [::c_char; 108]
37 }
38
39 pub struct sockaddr_storage {
40 pub ss_family: sa_family_t,
41 __ss_align: ::size_t,
42 #[cfg(target_pointer_width = "32")]
43 __ss_pad2: [u8; 128 - 2 * 4],
44 #[cfg(target_pointer_width = "64")]
45 __ss_pad2: [u8; 128 - 2 * 8],
46 }
47
48 pub struct addrinfo {
49 pub ai_flags: ::c_int,
50 pub ai_family: ::c_int,
51 pub ai_socktype: ::c_int,
52 pub ai_protocol: ::c_int,
53 pub ai_addrlen: socklen_t,
54
55 #[cfg(any(target_os = "linux",
56 target_os = "emscripten",
57 target_os = "fuchsia"))]
58 pub ai_addr: *mut ::sockaddr,
59
60 pub ai_canonname: *mut c_char,
61
62 #[cfg(target_os = "android")]
63 pub ai_addr: *mut ::sockaddr,
64
65 pub ai_next: *mut addrinfo,
66 }
67
68 pub struct sockaddr_nl {
69 pub nl_family: ::sa_family_t,
70 nl_pad: ::c_ushort,
71 pub nl_pid: u32,
72 pub nl_groups: u32
73 }
74
75 pub struct sockaddr_ll {
76 pub sll_family: ::c_ushort,
77 pub sll_protocol: ::c_ushort,
78 pub sll_ifindex: ::c_int,
79 pub sll_hatype: ::c_ushort,
80 pub sll_pkttype: ::c_uchar,
81 pub sll_halen: ::c_uchar,
82 pub sll_addr: [::c_uchar; 8]
83 }
84
85 pub struct fd_set {
86 fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
87 }
88
89 pub struct tm {
90 pub tm_sec: ::c_int,
91 pub tm_min: ::c_int,
92 pub tm_hour: ::c_int,
93 pub tm_mday: ::c_int,
94 pub tm_mon: ::c_int,
95 pub tm_year: ::c_int,
96 pub tm_wday: ::c_int,
97 pub tm_yday: ::c_int,
98 pub tm_isdst: ::c_int,
99 pub tm_gmtoff: ::c_long,
100 pub tm_zone: *const ::c_char,
101 }
102
103 pub struct sched_param {
104 pub sched_priority: ::c_int,
105 #[cfg(any(target_env = "musl", target_os = "emscripten"))]
106 pub sched_ss_low_priority: ::c_int,
107 #[cfg(any(target_env = "musl", target_os = "emscripten"))]
108 pub sched_ss_repl_period: ::timespec,
109 #[cfg(any(target_env = "musl", target_os = "emscripten"))]
110 pub sched_ss_init_budget: ::timespec,
111 #[cfg(any(target_env = "musl", target_os = "emscripten"))]
112 pub sched_ss_max_repl: ::c_int,
113 }
114
115 pub struct Dl_info {
116 pub dli_fname: *const ::c_char,
117 pub dli_fbase: *mut ::c_void,
118 pub dli_sname: *const ::c_char,
119 pub dli_saddr: *mut ::c_void,
120 }
121
122 #[cfg_attr(any(all(target_arch = "x86",
123 not(target_env = "musl"),
124 not(target_os = "android")),
125 target_arch = "x86_64"),
126 repr(packed))]
127 pub struct epoll_event {
128 pub events: ::uint32_t,
129 pub u64: ::uint64_t,
130 }
131
132 pub struct utsname {
133 pub sysname: [::c_char; 65],
134 pub nodename: [::c_char; 65],
135 pub release: [::c_char; 65],
136 pub version: [::c_char; 65],
137 pub machine: [::c_char; 65],
138 pub domainname: [::c_char; 65]
139 }
140
141 pub struct lconv {
142 pub decimal_point: *mut ::c_char,
143 pub thousands_sep: *mut ::c_char,
144 pub grouping: *mut ::c_char,
145 pub int_curr_symbol: *mut ::c_char,
146 pub currency_symbol: *mut ::c_char,
147 pub mon_decimal_point: *mut ::c_char,
148 pub mon_thousands_sep: *mut ::c_char,
149 pub mon_grouping: *mut ::c_char,
150 pub positive_sign: *mut ::c_char,
151 pub negative_sign: *mut ::c_char,
152 pub int_frac_digits: ::c_char,
153 pub frac_digits: ::c_char,
154 pub p_cs_precedes: ::c_char,
155 pub p_sep_by_space: ::c_char,
156 pub n_cs_precedes: ::c_char,
157 pub n_sep_by_space: ::c_char,
158 pub p_sign_posn: ::c_char,
159 pub n_sign_posn: ::c_char,
160 pub int_p_cs_precedes: ::c_char,
161 pub int_p_sep_by_space: ::c_char,
162 pub int_n_cs_precedes: ::c_char,
163 pub int_n_sep_by_space: ::c_char,
164 pub int_p_sign_posn: ::c_char,
165 pub int_n_sign_posn: ::c_char,
166 }
167
168 pub struct sigevent {
169 pub sigev_value: ::sigval,
170 pub sigev_signo: ::c_int,
171 pub sigev_notify: ::c_int,
172 pub sigev_notify_thread_id: ::c_int,
175 #[cfg(target_pointer_width = "64")]
176 __unused1: [::c_int; 11],
177 #[cfg(target_pointer_width = "32")]
178 __unused1: [::c_int; 12]
179 }
180
181 pub struct in_pktinfo {
182 pub ipi_ifindex: ::c_int,
183 pub ipi_spec_dst: ::in_addr,
184 pub ipi_addr: ::in_addr,
185 }
186
187 pub struct ifaddrs {
188 pub ifa_next: *mut ifaddrs,
189 pub ifa_name: *mut c_char,
190 pub ifa_flags: ::c_uint,
191 pub ifa_addr: *mut ::sockaddr,
192 pub ifa_netmask: *mut ::sockaddr,
193 pub ifa_ifu: *mut ::sockaddr, pub ifa_data: *mut ::c_void
195 }
196
197 pub struct in6_rtmsg {
198 rtmsg_dst: ::in6_addr,
199 rtmsg_src: ::in6_addr,
200 rtmsg_gateway: ::in6_addr,
201 rtmsg_type: u32,
202 rtmsg_dst_len: u16,
203 rtmsg_src_len: u16,
204 rtmsg_metric: u32,
205 rtmsg_info: ::c_ulong,
206 rtmsg_flags: u32,
207 rtmsg_ifindex: ::c_int,
208 }
209
210 pub struct arpreq {
211 pub arp_pa: ::sockaddr,
212 pub arp_ha: ::sockaddr,
213 pub arp_flags: ::c_int,
214 pub arp_netmask: ::sockaddr,
215 pub arp_dev: [::c_char; 16],
216 }
217
218 pub struct arpreq_old {
219 pub arp_pa: ::sockaddr,
220 pub arp_ha: ::sockaddr,
221 pub arp_flags: ::c_int,
222 pub arp_netmask: ::sockaddr,
223 }
224
225 pub struct arphdr {
226 pub ar_hrd: u16,
227 pub ar_pro: u16,
228 pub ar_hln: u8,
229 pub ar_pln: u8,
230 pub ar_op: u16,
231 }
232}
233
234cfg_if! {
236 if #[cfg(target_pointer_width = "32")] {
237 const ULONG_SIZE: usize = 32;
238 } else if #[cfg(target_pointer_width = "64")] {
239 const ULONG_SIZE: usize = 64;
240 } else {
241 }
243}
244
245pub const EXIT_FAILURE: ::c_int = 1;
246pub const EXIT_SUCCESS: ::c_int = 0;
247pub const RAND_MAX: ::c_int = 2147483647;
248pub const EOF: ::c_int = -1;
249pub const SEEK_SET: ::c_int = 0;
250pub const SEEK_CUR: ::c_int = 1;
251pub const SEEK_END: ::c_int = 2;
252pub const _IOFBF: ::c_int = 0;
253pub const _IONBF: ::c_int = 2;
254pub const _IOLBF: ::c_int = 1;
255
256pub const F_DUPFD: ::c_int = 0;
257pub const F_GETFD: ::c_int = 1;
258pub const F_SETFD: ::c_int = 2;
259pub const F_GETFL: ::c_int = 3;
260pub const F_SETFL: ::c_int = 4;
261
262pub const F_SETLEASE: ::c_int = 1024;
264pub const F_GETLEASE: ::c_int = 1025;
265pub const F_NOTIFY: ::c_int = 1026;
266pub const F_CANCELLK: ::c_int = 1029;
267pub const F_DUPFD_CLOEXEC: ::c_int = 1030;
268pub const F_SETPIPE_SZ: ::c_int = 1031;
269pub const F_GETPIPE_SZ: ::c_int = 1032;
270pub const F_ADD_SEALS: ::c_int = 1033;
271pub const F_GET_SEALS: ::c_int = 1034;
272
273pub const F_SEAL_SEAL: ::c_int = 0x0001;
274pub const F_SEAL_SHRINK: ::c_int = 0x0002;
275pub const F_SEAL_GROW: ::c_int = 0x0004;
276pub const F_SEAL_WRITE: ::c_int = 0x0008;
277
278pub const SIGTRAP: ::c_int = 5;
281
282pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
283pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
284
285pub const CLOCK_REALTIME: ::clockid_t = 0;
286pub const CLOCK_MONOTONIC: ::clockid_t = 1;
287pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
288pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 3;
289pub const CLOCK_MONOTONIC_RAW: ::clockid_t = 4;
290pub const CLOCK_REALTIME_COARSE: ::clockid_t = 5;
291pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = 6;
292pub const CLOCK_BOOTTIME: ::clockid_t = 7;
293pub const CLOCK_REALTIME_ALARM: ::clockid_t = 8;
294pub const CLOCK_BOOTTIME_ALARM: ::clockid_t = 9;
295pub const TIMER_ABSTIME: ::c_int = 1;
300
301pub const RLIMIT_CPU: ::c_int = 0;
302pub const RLIMIT_FSIZE: ::c_int = 1;
303pub const RLIMIT_DATA: ::c_int = 2;
304pub const RLIMIT_STACK: ::c_int = 3;
305pub const RLIMIT_CORE: ::c_int = 4;
306pub const RLIMIT_LOCKS: ::c_int = 10;
307pub const RLIMIT_SIGPENDING: ::c_int = 11;
308pub const RLIMIT_MSGQUEUE: ::c_int = 12;
309pub const RLIMIT_NICE: ::c_int = 13;
310pub const RLIMIT_RTPRIO: ::c_int = 14;
311
312pub const RUSAGE_SELF: ::c_int = 0;
313
314pub const O_RDONLY: ::c_int = 0;
315pub const O_WRONLY: ::c_int = 1;
316pub const O_RDWR: ::c_int = 2;
317
318pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC;
319
320pub const S_IFIFO: ::mode_t = 4096;
321pub const S_IFCHR: ::mode_t = 8192;
322pub const S_IFBLK: ::mode_t = 24576;
323pub const S_IFDIR: ::mode_t = 16384;
324pub const S_IFREG: ::mode_t = 32768;
325pub const S_IFLNK: ::mode_t = 40960;
326pub const S_IFSOCK: ::mode_t = 49152;
327pub const S_IFMT: ::mode_t = 61440;
328pub const S_IRWXU: ::mode_t = 448;
329pub const S_IXUSR: ::mode_t = 64;
330pub const S_IWUSR: ::mode_t = 128;
331pub const S_IRUSR: ::mode_t = 256;
332pub const S_IRWXG: ::mode_t = 56;
333pub const S_IXGRP: ::mode_t = 8;
334pub const S_IWGRP: ::mode_t = 16;
335pub const S_IRGRP: ::mode_t = 32;
336pub const S_IRWXO: ::mode_t = 7;
337pub const S_IXOTH: ::mode_t = 1;
338pub const S_IWOTH: ::mode_t = 2;
339pub const S_IROTH: ::mode_t = 4;
340pub const F_OK: ::c_int = 0;
341pub const R_OK: ::c_int = 4;
342pub const W_OK: ::c_int = 2;
343pub const X_OK: ::c_int = 1;
344pub const STDIN_FILENO: ::c_int = 0;
345pub const STDOUT_FILENO: ::c_int = 1;
346pub const STDERR_FILENO: ::c_int = 2;
347pub const SIGHUP: ::c_int = 1;
348pub const SIGINT: ::c_int = 2;
349pub const SIGQUIT: ::c_int = 3;
350pub const SIGILL: ::c_int = 4;
351pub const SIGABRT: ::c_int = 6;
352pub const SIGFPE: ::c_int = 8;
353pub const SIGKILL: ::c_int = 9;
354pub const SIGSEGV: ::c_int = 11;
355pub const SIGPIPE: ::c_int = 13;
356pub const SIGALRM: ::c_int = 14;
357pub const SIGTERM: ::c_int = 15;
358
359pub const PROT_NONE: ::c_int = 0;
360pub const PROT_READ: ::c_int = 1;
361pub const PROT_WRITE: ::c_int = 2;
362pub const PROT_EXEC: ::c_int = 4;
363
364pub const LC_CTYPE: ::c_int = 0;
365pub const LC_NUMERIC: ::c_int = 1;
366pub const LC_TIME: ::c_int = 2;
367pub const LC_COLLATE: ::c_int = 3;
368pub const LC_MONETARY: ::c_int = 4;
369pub const LC_MESSAGES: ::c_int = 5;
370pub const LC_ALL: ::c_int = 6;
371pub const LC_CTYPE_MASK: ::c_int = (1 << LC_CTYPE);
372pub const LC_NUMERIC_MASK: ::c_int = (1 << LC_NUMERIC);
373pub const LC_TIME_MASK: ::c_int = (1 << LC_TIME);
374pub const LC_COLLATE_MASK: ::c_int = (1 << LC_COLLATE);
375pub const LC_MONETARY_MASK: ::c_int = (1 << LC_MONETARY);
376pub const LC_MESSAGES_MASK: ::c_int = (1 << LC_MESSAGES);
377pub const MAP_FILE: ::c_int = 0x0000;
380pub const MAP_SHARED: ::c_int = 0x0001;
381pub const MAP_PRIVATE: ::c_int = 0x0002;
382pub const MAP_FIXED: ::c_int = 0x0010;
383
384pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
385
386pub const MS_ASYNC: ::c_int = 0x0001;
388pub const MS_INVALIDATE: ::c_int = 0x0002;
389pub const MS_SYNC: ::c_int = 0x0004;
390
391pub const MS_RDONLY: ::c_ulong = 0x01;
393pub const MS_NOSUID: ::c_ulong = 0x02;
394pub const MS_NODEV: ::c_ulong = 0x04;
395pub const MS_NOEXEC: ::c_ulong = 0x08;
396pub const MS_SYNCHRONOUS: ::c_ulong = 0x10;
397pub const MS_REMOUNT: ::c_ulong = 0x20;
398pub const MS_MANDLOCK: ::c_ulong = 0x40;
399pub const MS_DIRSYNC: ::c_ulong = 0x80;
400pub const MS_NOATIME: ::c_ulong = 0x0400;
401pub const MS_NODIRATIME: ::c_ulong = 0x0800;
402pub const MS_BIND: ::c_ulong = 0x1000;
403pub const MS_MOVE: ::c_ulong = 0x2000;
404pub const MS_REC: ::c_ulong = 0x4000;
405pub const MS_SILENT: ::c_ulong = 0x8000;
406pub const MS_POSIXACL: ::c_ulong = 0x010000;
407pub const MS_UNBINDABLE: ::c_ulong = 0x020000;
408pub const MS_PRIVATE: ::c_ulong = 0x040000;
409pub const MS_SLAVE: ::c_ulong = 0x080000;
410pub const MS_SHARED: ::c_ulong = 0x100000;
411pub const MS_RELATIME: ::c_ulong = 0x200000;
412pub const MS_KERNMOUNT: ::c_ulong = 0x400000;
413pub const MS_I_VERSION: ::c_ulong = 0x800000;
414pub const MS_STRICTATIME: ::c_ulong = 0x1000000;
415pub const MS_ACTIVE: ::c_ulong = 0x40000000;
416pub const MS_NOUSER: ::c_ulong = 0x80000000;
417pub const MS_MGC_VAL: ::c_ulong = 0xc0ed0000;
418pub const MS_MGC_MSK: ::c_ulong = 0xffff0000;
419pub const MS_RMT_MASK: ::c_ulong = 0x800051;
420
421pub const EPERM: ::c_int = 1;
422pub const ENOENT: ::c_int = 2;
423pub const ESRCH: ::c_int = 3;
424pub const EINTR: ::c_int = 4;
425pub const EIO: ::c_int = 5;
426pub const ENXIO: ::c_int = 6;
427pub const E2BIG: ::c_int = 7;
428pub const ENOEXEC: ::c_int = 8;
429pub const EBADF: ::c_int = 9;
430pub const ECHILD: ::c_int = 10;
431pub const EAGAIN: ::c_int = 11;
432pub const ENOMEM: ::c_int = 12;
433pub const EACCES: ::c_int = 13;
434pub const EFAULT: ::c_int = 14;
435pub const ENOTBLK: ::c_int = 15;
436pub const EBUSY: ::c_int = 16;
437pub const EEXIST: ::c_int = 17;
438pub const EXDEV: ::c_int = 18;
439pub const ENODEV: ::c_int = 19;
440pub const ENOTDIR: ::c_int = 20;
441pub const EISDIR: ::c_int = 21;
442pub const EINVAL: ::c_int = 22;
443pub const ENFILE: ::c_int = 23;
444pub const EMFILE: ::c_int = 24;
445pub const ENOTTY: ::c_int = 25;
446pub const ETXTBSY: ::c_int = 26;
447pub const EFBIG: ::c_int = 27;
448pub const ENOSPC: ::c_int = 28;
449pub const ESPIPE: ::c_int = 29;
450pub const EROFS: ::c_int = 30;
451pub const EMLINK: ::c_int = 31;
452pub const EPIPE: ::c_int = 32;
453pub const EDOM: ::c_int = 33;
454pub const ERANGE: ::c_int = 34;
455pub const EWOULDBLOCK: ::c_int = EAGAIN;
456
457pub const SCM_RIGHTS: ::c_int = 0x01;
458pub const SCM_CREDENTIALS: ::c_int = 0x02;
459
460pub const PROT_GROWSDOWN: ::c_int = 0x1000000;
461pub const PROT_GROWSUP: ::c_int = 0x2000000;
462
463pub const MAP_TYPE: ::c_int = 0x000f;
464
465pub const MADV_NORMAL: ::c_int = 0;
466pub const MADV_RANDOM: ::c_int = 1;
467pub const MADV_SEQUENTIAL: ::c_int = 2;
468pub const MADV_WILLNEED: ::c_int = 3;
469pub const MADV_DONTNEED: ::c_int = 4;
470pub const MADV_FREE: ::c_int = 8;
471pub const MADV_REMOVE: ::c_int = 9;
472pub const MADV_DONTFORK: ::c_int = 10;
473pub const MADV_DOFORK: ::c_int = 11;
474pub const MADV_MERGEABLE: ::c_int = 12;
475pub const MADV_UNMERGEABLE: ::c_int = 13;
476pub const MADV_HUGEPAGE: ::c_int = 14;
477pub const MADV_NOHUGEPAGE: ::c_int = 15;
478pub const MADV_DONTDUMP: ::c_int = 16;
479pub const MADV_DODUMP: ::c_int = 17;
480pub const MADV_HWPOISON: ::c_int = 100;
481pub const MADV_SOFT_OFFLINE: ::c_int = 101;
482
483pub const IFF_UP: ::c_int = 0x1;
484pub const IFF_BROADCAST: ::c_int = 0x2;
485pub const IFF_DEBUG: ::c_int = 0x4;
486pub const IFF_LOOPBACK: ::c_int = 0x8;
487pub const IFF_POINTOPOINT: ::c_int = 0x10;
488pub const IFF_NOTRAILERS: ::c_int = 0x20;
489pub const IFF_RUNNING: ::c_int = 0x40;
490pub const IFF_NOARP: ::c_int = 0x80;
491pub const IFF_PROMISC: ::c_int = 0x100;
492pub const IFF_ALLMULTI: ::c_int = 0x200;
493pub const IFF_MASTER: ::c_int = 0x400;
494pub const IFF_SLAVE: ::c_int = 0x800;
495pub const IFF_MULTICAST: ::c_int = 0x1000;
496pub const IFF_PORTSEL: ::c_int = 0x2000;
497pub const IFF_AUTOMEDIA: ::c_int = 0x4000;
498pub const IFF_DYNAMIC: ::c_int = 0x8000;
499
500pub const SOL_IP: ::c_int = 0;
501pub const SOL_TCP: ::c_int = 6;
502pub const SOL_UDP: ::c_int = 17;
503pub const SOL_IPV6: ::c_int = 41;
504pub const SOL_ICMPV6: ::c_int = 58;
505pub const SOL_RAW: ::c_int = 255;
506pub const SOL_DECNET: ::c_int = 261;
507pub const SOL_X25: ::c_int = 262;
508pub const SOL_PACKET: ::c_int = 263;
509pub const SOL_ATM: ::c_int = 264;
510pub const SOL_AAL: ::c_int = 265;
511pub const SOL_IRDA: ::c_int = 266;
512pub const SOL_NETBEUI: ::c_int = 267;
513pub const SOL_LLC: ::c_int = 268;
514pub const SOL_DCCP: ::c_int = 269;
515pub const SOL_NETLINK: ::c_int = 270;
516pub const SOL_TIPC: ::c_int = 271;
517
518pub const AF_UNSPEC: ::c_int = 0;
519pub const AF_UNIX: ::c_int = 1;
520pub const AF_LOCAL: ::c_int = 1;
521pub const AF_INET: ::c_int = 2;
522pub const AF_AX25: ::c_int = 3;
523pub const AF_IPX: ::c_int = 4;
524pub const AF_APPLETALK: ::c_int = 5;
525pub const AF_NETROM: ::c_int = 6;
526pub const AF_BRIDGE: ::c_int = 7;
527pub const AF_ATMPVC: ::c_int = 8;
528pub const AF_X25: ::c_int = 9;
529pub const AF_INET6: ::c_int = 10;
530pub const AF_ROSE: ::c_int = 11;
531pub const AF_DECnet: ::c_int = 12;
532pub const AF_NETBEUI: ::c_int = 13;
533pub const AF_SECURITY: ::c_int = 14;
534pub const AF_KEY: ::c_int = 15;
535pub const AF_NETLINK: ::c_int = 16;
536pub const AF_ROUTE: ::c_int = AF_NETLINK;
537pub const AF_PACKET: ::c_int = 17;
538pub const AF_ASH: ::c_int = 18;
539pub const AF_ECONET: ::c_int = 19;
540pub const AF_ATMSVC: ::c_int = 20;
541pub const AF_RDS: ::c_int = 21;
542pub const AF_SNA: ::c_int = 22;
543pub const AF_IRDA: ::c_int = 23;
544pub const AF_PPPOX: ::c_int = 24;
545pub const AF_WANPIPE: ::c_int = 25;
546pub const AF_LLC: ::c_int = 26;
547pub const AF_CAN: ::c_int = 29;
548pub const AF_TIPC: ::c_int = 30;
549pub const AF_BLUETOOTH: ::c_int = 31;
550pub const AF_IUCV: ::c_int = 32;
551pub const AF_RXRPC: ::c_int = 33;
552pub const AF_ISDN: ::c_int = 34;
553pub const AF_PHONET: ::c_int = 35;
554pub const AF_IEEE802154: ::c_int = 36;
555pub const AF_CAIF: ::c_int = 37;
556pub const AF_ALG: ::c_int = 38;
557
558pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
559pub const PF_UNIX: ::c_int = AF_UNIX;
560pub const PF_LOCAL: ::c_int = AF_LOCAL;
561pub const PF_INET: ::c_int = AF_INET;
562pub const PF_AX25: ::c_int = AF_AX25;
563pub const PF_IPX: ::c_int = AF_IPX;
564pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
565pub const PF_NETROM: ::c_int = AF_NETROM;
566pub const PF_BRIDGE: ::c_int = AF_BRIDGE;
567pub const PF_ATMPVC: ::c_int = AF_ATMPVC;
568pub const PF_X25: ::c_int = AF_X25;
569pub const PF_INET6: ::c_int = AF_INET6;
570pub const PF_ROSE: ::c_int = AF_ROSE;
571pub const PF_DECnet: ::c_int = AF_DECnet;
572pub const PF_NETBEUI: ::c_int = AF_NETBEUI;
573pub const PF_SECURITY: ::c_int = AF_SECURITY;
574pub const PF_KEY: ::c_int = AF_KEY;
575pub const PF_NETLINK: ::c_int = AF_NETLINK;
576pub const PF_ROUTE: ::c_int = AF_ROUTE;
577pub const PF_PACKET: ::c_int = AF_PACKET;
578pub const PF_ASH: ::c_int = AF_ASH;
579pub const PF_ECONET: ::c_int = AF_ECONET;
580pub const PF_ATMSVC: ::c_int = AF_ATMSVC;
581pub const PF_RDS: ::c_int = AF_RDS;
582pub const PF_SNA: ::c_int = AF_SNA;
583pub const PF_IRDA: ::c_int = AF_IRDA;
584pub const PF_PPPOX: ::c_int = AF_PPPOX;
585pub const PF_WANPIPE: ::c_int = AF_WANPIPE;
586pub const PF_LLC: ::c_int = AF_LLC;
587pub const PF_CAN: ::c_int = AF_CAN;
588pub const PF_TIPC: ::c_int = AF_TIPC;
589pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
590pub const PF_IUCV: ::c_int = AF_IUCV;
591pub const PF_RXRPC: ::c_int = AF_RXRPC;
592pub const PF_ISDN: ::c_int = AF_ISDN;
593pub const PF_PHONET: ::c_int = AF_PHONET;
594pub const PF_IEEE802154: ::c_int = AF_IEEE802154;
595pub const PF_CAIF: ::c_int = AF_CAIF;
596pub const PF_ALG: ::c_int = AF_ALG;
597
598pub const SOMAXCONN: ::c_int = 128;
599
600pub const MSG_OOB: ::c_int = 1;
601pub const MSG_PEEK: ::c_int = 2;
602pub const MSG_DONTROUTE: ::c_int = 4;
603pub const MSG_CTRUNC: ::c_int = 8;
604pub const MSG_TRUNC: ::c_int = 0x20;
605pub const MSG_DONTWAIT: ::c_int = 0x40;
606pub const MSG_EOR: ::c_int = 0x80;
607pub const MSG_WAITALL: ::c_int = 0x100;
608pub const MSG_FIN: ::c_int = 0x200;
609pub const MSG_SYN: ::c_int = 0x400;
610pub const MSG_CONFIRM: ::c_int = 0x800;
611pub const MSG_RST: ::c_int = 0x1000;
612pub const MSG_ERRQUEUE: ::c_int = 0x2000;
613pub const MSG_NOSIGNAL: ::c_int = 0x4000;
614pub const MSG_MORE: ::c_int = 0x8000;
615pub const MSG_WAITFORONE: ::c_int = 0x10000;
616pub const MSG_FASTOPEN: ::c_int = 0x20000000;
617pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000;
618
619pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
620
621pub const SOCK_RAW: ::c_int = 3;
622pub const SOCK_RDM: ::c_int = 4;
623pub const IP_MULTICAST_IF: ::c_int = 32;
624pub const IP_MULTICAST_TTL: ::c_int = 33;
625pub const IP_MULTICAST_LOOP: ::c_int = 34;
626pub const IP_TTL: ::c_int = 2;
627pub const IP_HDRINCL: ::c_int = 3;
628pub const IP_PKTINFO: ::c_int = 8;
629pub const IP_ADD_MEMBERSHIP: ::c_int = 35;
630pub const IP_DROP_MEMBERSHIP: ::c_int = 36;
631pub const IP_TRANSPARENT: ::c_int = 19;
632pub const IPV6_UNICAST_HOPS: ::c_int = 16;
633pub const IPV6_MULTICAST_IF: ::c_int = 17;
634pub const IPV6_MULTICAST_HOPS: ::c_int = 18;
635pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
636pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20;
637pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21;
638pub const IPV6_V6ONLY: ::c_int = 26;
639pub const IPV6_RECVPKTINFO: ::c_int = 49;
640pub const IPV6_PKTINFO: ::c_int = 50;
641
642pub const TCP_NODELAY: ::c_int = 1;
643pub const TCP_MAXSEG: ::c_int = 2;
644pub const TCP_CORK: ::c_int = 3;
645pub const TCP_KEEPIDLE: ::c_int = 4;
646pub const TCP_KEEPINTVL: ::c_int = 5;
647pub const TCP_KEEPCNT: ::c_int = 6;
648pub const TCP_SYNCNT: ::c_int = 7;
649pub const TCP_LINGER2: ::c_int = 8;
650pub const TCP_DEFER_ACCEPT: ::c_int = 9;
651pub const TCP_WINDOW_CLAMP: ::c_int = 10;
652pub const TCP_INFO: ::c_int = 11;
653pub const TCP_QUICKACK: ::c_int = 12;
654pub const TCP_CONGESTION: ::c_int = 13;
655
656pub const SO_DEBUG: ::c_int = 1;
657
658pub const SHUT_RD: ::c_int = 0;
659pub const SHUT_WR: ::c_int = 1;
660pub const SHUT_RDWR: ::c_int = 2;
661
662pub const LOCK_SH: ::c_int = 1;
663pub const LOCK_EX: ::c_int = 2;
664pub const LOCK_NB: ::c_int = 4;
665pub const LOCK_UN: ::c_int = 8;
666
667pub const SS_ONSTACK: ::c_int = 1;
668pub const SS_DISABLE: ::c_int = 2;
669
670pub const PATH_MAX: ::c_int = 4096;
671
672pub const FD_SETSIZE: usize = 1024;
673
674pub const EPOLLIN: ::c_int = 0x1;
675pub const EPOLLPRI: ::c_int = 0x2;
676pub const EPOLLOUT: ::c_int = 0x4;
677pub const EPOLLRDNORM: ::c_int = 0x40;
678pub const EPOLLRDBAND: ::c_int = 0x80;
679pub const EPOLLWRNORM: ::c_int = 0x100;
680pub const EPOLLWRBAND: ::c_int = 0x200;
681pub const EPOLLMSG: ::c_int = 0x400;
682pub const EPOLLERR: ::c_int = 0x8;
683pub const EPOLLHUP: ::c_int = 0x10;
684pub const EPOLLET: ::c_int = 0x80000000;
685
686pub const EPOLL_CTL_ADD: ::c_int = 1;
687pub const EPOLL_CTL_MOD: ::c_int = 3;
688pub const EPOLL_CTL_DEL: ::c_int = 2;
689
690pub const MNT_DETACH: ::c_int = 0x2;
691pub const MNT_EXPIRE: ::c_int = 0x4;
692
693pub const Q_GETFMT: ::c_int = 0x800004;
694pub const Q_GETINFO: ::c_int = 0x800005;
695pub const Q_SETINFO: ::c_int = 0x800006;
696pub const QIF_BLIMITS: ::uint32_t = 1;
697pub const QIF_SPACE: ::uint32_t = 2;
698pub const QIF_ILIMITS: ::uint32_t = 4;
699pub const QIF_INODES: ::uint32_t = 8;
700pub const QIF_BTIME: ::uint32_t = 16;
701pub const QIF_ITIME: ::uint32_t = 32;
702pub const QIF_LIMITS: ::uint32_t = 5;
703pub const QIF_USAGE: ::uint32_t = 10;
704pub const QIF_TIMES: ::uint32_t = 48;
705pub const QIF_ALL: ::uint32_t = 63;
706
707pub const MNT_FORCE: ::c_int = 0x1;
708
709pub const Q_SYNC: ::c_int = 0x800001;
710pub const Q_QUOTAON: ::c_int = 0x800002;
711pub const Q_QUOTAOFF: ::c_int = 0x800003;
712pub const Q_GETQUOTA: ::c_int = 0x800007;
713pub const Q_SETQUOTA: ::c_int = 0x800008;
714
715pub const TCIOFF: ::c_int = 2;
716pub const TCION: ::c_int = 3;
717pub const TCOOFF: ::c_int = 0;
718pub const TCOON: ::c_int = 1;
719pub const TCIFLUSH: ::c_int = 0;
720pub const TCOFLUSH: ::c_int = 1;
721pub const TCIOFLUSH: ::c_int = 2;
722pub const NL0: ::c_int = 0x00000000;
723pub const NL1: ::c_int = 0x00000100;
724pub const TAB0: ::c_int = 0x00000000;
725pub const CR0: ::c_int = 0x00000000;
726pub const FF0: ::c_int = 0x00000000;
727pub const BS0: ::c_int = 0x00000000;
728pub const VT0: ::c_int = 0x00000000;
729pub const VERASE: usize = 2;
730pub const VKILL: usize = 3;
731pub const VINTR: usize = 0;
732pub const VQUIT: usize = 1;
733pub const VLNEXT: usize = 15;
734pub const IGNBRK: ::tcflag_t = 0x00000001;
735pub const BRKINT: ::tcflag_t = 0x00000002;
736pub const IGNPAR: ::tcflag_t = 0x00000004;
737pub const PARMRK: ::tcflag_t = 0x00000008;
738pub const INPCK: ::tcflag_t = 0x00000010;
739pub const ISTRIP: ::tcflag_t = 0x00000020;
740pub const INLCR: ::tcflag_t = 0x00000040;
741pub const IGNCR: ::tcflag_t = 0x00000080;
742pub const ICRNL: ::tcflag_t = 0x00000100;
743pub const IXANY: ::tcflag_t = 0x00000800;
744pub const IMAXBEL: ::tcflag_t = 0x00002000;
745pub const OPOST: ::tcflag_t = 0x1;
746pub const CS5: ::tcflag_t = 0x00000000;
747pub const CRTSCTS: ::tcflag_t = 0x80000000;
748pub const ECHO: ::tcflag_t = 0x00000008;
749pub const OCRNL: ::tcflag_t = 0o000010;
750pub const ONOCR: ::tcflag_t = 0o000020;
751pub const ONLRET: ::tcflag_t = 0o000040;
752pub const OFILL: ::tcflag_t = 0o000100;
753pub const OFDEL: ::tcflag_t = 0o000200;
754
755pub const CLONE_VM: ::c_int = 0x100;
756pub const CLONE_FS: ::c_int = 0x200;
757pub const CLONE_FILES: ::c_int = 0x400;
758pub const CLONE_SIGHAND: ::c_int = 0x800;
759pub const CLONE_PTRACE: ::c_int = 0x2000;
760pub const CLONE_VFORK: ::c_int = 0x4000;
761pub const CLONE_PARENT: ::c_int = 0x8000;
762pub const CLONE_THREAD: ::c_int = 0x10000;
763pub const CLONE_NEWNS: ::c_int = 0x20000;
764pub const CLONE_SYSVSEM: ::c_int = 0x40000;
765pub const CLONE_SETTLS: ::c_int = 0x80000;
766pub const CLONE_PARENT_SETTID: ::c_int = 0x100000;
767pub const CLONE_CHILD_CLEARTID: ::c_int = 0x200000;
768pub const CLONE_DETACHED: ::c_int = 0x400000;
769pub const CLONE_UNTRACED: ::c_int = 0x800000;
770pub const CLONE_CHILD_SETTID: ::c_int = 0x01000000;
771pub const CLONE_NEWUTS: ::c_int = 0x04000000;
772pub const CLONE_NEWIPC: ::c_int = 0x08000000;
773pub const CLONE_NEWUSER: ::c_int = 0x10000000;
774pub const CLONE_NEWPID: ::c_int = 0x20000000;
775pub const CLONE_NEWNET: ::c_int = 0x40000000;
776pub const CLONE_IO: ::c_int = 0x80000000;
777pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
778
779pub const WNOHANG: ::c_int = 0x00000001;
780pub const WUNTRACED: ::c_int = 0x00000002;
781pub const WSTOPPED: ::c_int = WUNTRACED;
782pub const WEXITED: ::c_int = 0x00000004;
783pub const WCONTINUED: ::c_int = 0x00000008;
784pub const WNOWAIT: ::c_int = 0x01000000;
785
786pub const PTRACE_O_TRACESYSGOOD: ::c_int = 0x00000001;
788pub const PTRACE_O_TRACEFORK: ::c_int = 0x00000002;
789pub const PTRACE_O_TRACEVFORK: ::c_int = 0x00000004;
790pub const PTRACE_O_TRACECLONE: ::c_int = 0x00000008;
791pub const PTRACE_O_TRACEEXEC: ::c_int = 0x00000010;
792pub const PTRACE_O_TRACEVFORKDONE: ::c_int = 0x00000020;
793pub const PTRACE_O_TRACEEXIT: ::c_int = 0x00000040;
794pub const PTRACE_O_TRACESECCOMP: ::c_int = 0x00000080;
795pub const PTRACE_O_EXITKILL: ::c_int = 0x00100000;
796pub const PTRACE_O_SUSPEND_SECCOMP: ::c_int = 0x00200000;
797pub const PTRACE_O_MASK: ::c_int = 0x003000ff;
798
799pub const PTRACE_EVENT_FORK: ::c_int = 1;
801pub const PTRACE_EVENT_VFORK: ::c_int = 2;
802pub const PTRACE_EVENT_CLONE: ::c_int = 3;
803pub const PTRACE_EVENT_EXEC: ::c_int = 4;
804pub const PTRACE_EVENT_VFORK_DONE: ::c_int = 5;
805pub const PTRACE_EVENT_EXIT: ::c_int = 6;
806pub const PTRACE_EVENT_SECCOMP: ::c_int = 7;
807pub const __WNOTHREAD: ::c_int = 0x20000000;
811pub const __WALL: ::c_int = 0x40000000;
812pub const __WCLONE: ::c_int = 0x80000000;
813
814pub const SPLICE_F_MOVE: ::c_uint = 0x01;
815pub const SPLICE_F_NONBLOCK: ::c_uint = 0x02;
816pub const SPLICE_F_MORE: ::c_uint = 0x04;
817pub const SPLICE_F_GIFT: ::c_uint = 0x08;
818
819pub const RTLD_LOCAL: ::c_int = 0;
820pub const RTLD_LAZY: ::c_int = 1;
821
822pub const POSIX_FADV_NORMAL: ::c_int = 0;
823pub const POSIX_FADV_RANDOM: ::c_int = 1;
824pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
825pub const POSIX_FADV_WILLNEED: ::c_int = 3;
826
827pub const AT_FDCWD: ::c_int = -100;
828pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x100;
829pub const AT_REMOVEDIR: ::c_int = 0x200;
830pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
831pub const AT_NO_AUTOMOUNT: ::c_int = 0x800;
832pub const AT_EMPTY_PATH: ::c_int = 0x1000;
833
834pub const LOG_CRON: ::c_int = 9 << 3;
835pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
836pub const LOG_FTP: ::c_int = 11 << 3;
837pub const LOG_PERROR: ::c_int = 0x20;
838
839pub const PIPE_BUF: usize = 4096;
840
841pub const SI_LOAD_SHIFT: ::c_uint = 16;
842
843pub const SIGEV_SIGNAL: ::c_int = 0;
844pub const SIGEV_NONE: ::c_int = 1;
845pub const SIGEV_THREAD: ::c_int = 2;
846
847pub const P_ALL: idtype_t = 0;
848pub const P_PID: idtype_t = 1;
849pub const P_PGID: idtype_t = 2;
850
851pub const UTIME_OMIT: c_long = 1073741822;
852pub const UTIME_NOW: c_long = 1073741823;
853
854pub const POLLIN: ::c_short = 0x1;
855pub const POLLPRI: ::c_short = 0x2;
856pub const POLLOUT: ::c_short = 0x4;
857pub const POLLERR: ::c_short = 0x8;
858pub const POLLHUP: ::c_short = 0x10;
859pub const POLLNVAL: ::c_short = 0x20;
860pub const POLLRDNORM: ::c_short = 0x040;
861pub const POLLRDBAND: ::c_short = 0x080;
862
863pub const IPTOS_LOWDELAY: u8 = 0x10;
864pub const IPTOS_THROUGHPUT: u8 = 0x08;
865pub const IPTOS_RELIABILITY: u8 = 0x04;
866pub const IPTOS_MINCOST: u8 = 0x02;
867
868pub const IPTOS_PREC_NETCONTROL: u8 = 0xe0;
869pub const IPTOS_PREC_INTERNETCONTROL: u8 = 0xc0;
870pub const IPTOS_PREC_CRITIC_ECP: u8 = 0xa0;
871pub const IPTOS_PREC_FLASHOVERRIDE: u8 = 0x80;
872pub const IPTOS_PREC_FLASH: u8 = 0x60;
873pub const IPTOS_PREC_IMMEDIATE: u8 = 0x40;
874pub const IPTOS_PREC_PRIORITY: u8 = 0x20;
875pub const IPTOS_PREC_ROUTINE: u8 = 0x00;
876
877pub const IPOPT_COPY: u8 = 0x80;
878pub const IPOPT_CLASS_MASK: u8 = 0x60;
879pub const IPOPT_NUMBER_MASK: u8 = 0x1f;
880
881pub const IPOPT_CONTROL: u8 = 0x00;
882pub const IPOPT_RESERVED1: u8 = 0x20;
883pub const IPOPT_MEASUREMENT: u8 = 0x40;
884pub const IPOPT_RESERVED2: u8 = 0x60;
885pub const IPOPT_END: u8 = (0 |IPOPT_CONTROL);
886pub const IPOPT_NOOP: u8 = (1 |IPOPT_CONTROL);
887pub const IPOPT_SEC: u8 = (2 |IPOPT_CONTROL|IPOPT_COPY);
888pub const IPOPT_LSRR: u8 = (3 |IPOPT_CONTROL|IPOPT_COPY);
889pub const IPOPT_TIMESTAMP: u8 = (4 |IPOPT_MEASUREMENT);
890pub const IPOPT_RR: u8 = (7 |IPOPT_CONTROL);
891pub const IPOPT_SID: u8 = (8 |IPOPT_CONTROL|IPOPT_COPY);
892pub const IPOPT_SSRR: u8 = (9 |IPOPT_CONTROL|IPOPT_COPY);
893pub const IPOPT_RA: u8 = (20|IPOPT_CONTROL|IPOPT_COPY);
894pub const IPVERSION: u8 = 4;
895pub const MAXTTL: u8 = 255;
896pub const IPDEFTTL: u8 = 64;
897pub const IPOPT_OPTVAL: u8 = 0;
898pub const IPOPT_OLEN: u8 = 1;
899pub const IPOPT_OFFSET: u8 = 2;
900pub const IPOPT_MINOFF: u8 = 4;
901pub const MAX_IPOPTLEN: u8 = 40;
902pub const IPOPT_NOP: u8 = IPOPT_NOOP;
903pub const IPOPT_EOL: u8 = IPOPT_END;
904pub const IPOPT_TS: u8 = IPOPT_TIMESTAMP;
905pub const IPOPT_TS_TSONLY: u8 = 0;
906pub const IPOPT_TS_TSANDADDR: u8 = 1;
907pub const IPOPT_TS_PRESPEC: u8 = 3;
908
909pub const ARPOP_RREQUEST: u16 = 3;
910pub const ARPOP_RREPLY: u16 = 4;
911pub const ARPOP_InREQUEST: u16 = 8;
912pub const ARPOP_InREPLY: u16 = 9;
913pub const ARPOP_NAK: u16 = 10;
914
915pub const ATF_NETMASK: ::c_int = 0x20;
916pub const ATF_DONTPUB: ::c_int = 0x40;
917
918pub const ARPHRD_NETROM: u16 = 0;
919pub const ARPHRD_ETHER: u16 = 1;
920pub const ARPHRD_EETHER: u16 = 2;
921pub const ARPHRD_AX25: u16 = 3;
922pub const ARPHRD_PRONET: u16 = 4;
923pub const ARPHRD_CHAOS: u16 = 5;
924pub const ARPHRD_IEEE802: u16 = 6;
925pub const ARPHRD_ARCNET: u16 = 7;
926pub const ARPHRD_APPLETLK: u16 = 8;
927pub const ARPHRD_DLCI: u16 = 15;
928pub const ARPHRD_ATM: u16 = 19;
929pub const ARPHRD_METRICOM: u16 = 23;
930pub const ARPHRD_IEEE1394: u16 = 24;
931pub const ARPHRD_EUI64: u16 = 27;
932pub const ARPHRD_INFINIBAND: u16 = 32;
933
934pub const ARPHRD_SLIP: u16 = 256;
935pub const ARPHRD_CSLIP: u16 = 257;
936pub const ARPHRD_SLIP6: u16 = 258;
937pub const ARPHRD_CSLIP6: u16 = 259;
938pub const ARPHRD_RSRVD: u16 = 260;
939pub const ARPHRD_ADAPT: u16 = 264;
940pub const ARPHRD_ROSE: u16 = 270;
941pub const ARPHRD_X25: u16 = 271;
942pub const ARPHRD_HWX25: u16 = 272;
943pub const ARPHRD_PPP: u16 = 512;
944pub const ARPHRD_CISCO: u16 = 513;
945pub const ARPHRD_HDLC: u16 = ARPHRD_CISCO;
946pub const ARPHRD_LAPB: u16 = 516;
947pub const ARPHRD_DDCMP: u16 = 517;
948pub const ARPHRD_RAWHDLC: u16 = 518;
949
950pub const ARPHRD_TUNNEL: u16 = 768;
951pub const ARPHRD_TUNNEL6: u16 = 769;
952pub const ARPHRD_FRAD: u16 = 770;
953pub const ARPHRD_SKIP: u16 = 771;
954pub const ARPHRD_LOOPBACK: u16 = 772;
955pub const ARPHRD_LOCALTLK: u16 = 773;
956pub const ARPHRD_FDDI: u16 = 774;
957pub const ARPHRD_BIF: u16 = 775;
958pub const ARPHRD_SIT: u16 = 776;
959pub const ARPHRD_IPDDP: u16 = 777;
960pub const ARPHRD_IPGRE: u16 = 778;
961pub const ARPHRD_PIMREG: u16 = 779;
962pub const ARPHRD_HIPPI: u16 = 780;
963pub const ARPHRD_ASH: u16 = 781;
964pub const ARPHRD_ECONET: u16 = 782;
965pub const ARPHRD_IRDA: u16 = 783;
966pub const ARPHRD_FCPP: u16 = 784;
967pub const ARPHRD_FCAL: u16 = 785;
968pub const ARPHRD_FCPL: u16 = 786;
969pub const ARPHRD_FCFABRIC: u16 = 787;
970pub const ARPHRD_IEEE802_TR: u16 = 800;
971pub const ARPHRD_IEEE80211: u16 = 801;
972pub const ARPHRD_IEEE80211_PRISM: u16 = 802;
973pub const ARPHRD_IEEE80211_RADIOTAP: u16 = 803;
974pub const ARPHRD_IEEE802154: u16 = 804;
975
976pub const ARPHRD_VOID: u16 = 0xFFFF;
977pub const ARPHRD_NONE: u16 = 0xFFFE;
978
979f! {
980 pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
981 let fd = fd as usize;
982 let size = mem::size_of_val(&(*set).fds_bits[0]) * 8;
983 (*set).fds_bits[fd / size] &= !(1 << (fd % size));
984 return
985 }
986
987 pub fn FD_ISSET(fd: ::c_int, set: *mut fd_set) -> bool {
988 let fd = fd as usize;
989 let size = mem::size_of_val(&(*set).fds_bits[0]) * 8;
990 return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
991 }
992
993 pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
994 let fd = fd as usize;
995 let size = mem::size_of_val(&(*set).fds_bits[0]) * 8;
996 (*set).fds_bits[fd / size] |= 1 << (fd % size);
997 return
998 }
999
1000 pub fn FD_ZERO(set: *mut fd_set) -> () {
1001 for slot in (*set).fds_bits.iter_mut() {
1002 *slot = 0;
1003 }
1004 }
1005
1006 pub fn WIFSTOPPED(status: ::c_int) -> bool {
1007 (status & 0xff) == 0x7f
1008 }
1009
1010 pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
1011 (status >> 8) & 0xff
1012 }
1013
1014 pub fn WIFCONTINUED(status: ::c_int) -> bool {
1015 status == 0xffff
1016 }
1017
1018 pub fn WIFSIGNALED(status: ::c_int) -> bool {
1019 ((status & 0x7f) + 1) as i8 >= 2
1020 }
1021
1022 pub fn WTERMSIG(status: ::c_int) -> ::c_int {
1023 status & 0x7f
1024 }
1025
1026 pub fn WIFEXITED(status: ::c_int) -> bool {
1027 (status & 0x7f) == 0
1028 }
1029
1030 pub fn WEXITSTATUS(status: ::c_int) -> ::c_int {
1031 (status >> 8) & 0xff
1032 }
1033
1034 pub fn WCOREDUMP(status: ::c_int) -> bool {
1035 (status & 0x80) != 0
1036 }
1037
1038 pub fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int {
1039 (cmd << 8) | (type_ & 0x00ff)
1040 }
1041
1042 pub fn IPOPT_COPIED(o: u8) -> u8 {
1043 o & IPOPT_COPY
1044 }
1045
1046 pub fn IPOPT_CLASS(o: u8) -> u8 {
1047 o & IPOPT_CLASS_MASK
1048 }
1049
1050 pub fn IPOPT_NUMBER(o: u8) -> u8 {
1051 o & IPOPT_NUMBER_MASK
1052 }
1053}
1054
1055cfg_if! {
1056 if #[cfg(target_os = "emscripten")] {
1057 mod emscripten;
1058 pub use self::emscripten::*;
1059 } else if #[cfg(any(target_os = "linux", target_os = "fuchsia"))] {
1060 mod linux;
1061 pub use self::linux::*;
1062 } else if #[cfg(target_os = "android")] {
1063 mod android;
1064 pub use self::android::*;
1065 } else {
1066 }
1068}