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