]> git.proxmox.com Git - rustc.git/blob - src/vendor/libc/src/unix/notbsd/linux/mod.rs
New upstream version 1.25.0+dfsg1
[rustc.git] / src / vendor / libc / src / unix / notbsd / linux / mod.rs
1 //! Linux-specific definitions for linux-like values
2
3 use dox::{mem, Option};
4
5 pub type useconds_t = u32;
6 pub type dev_t = u64;
7 pub type socklen_t = u32;
8 pub type pthread_t = c_ulong;
9 pub type mode_t = u32;
10 pub type ino64_t = u64;
11 pub type off64_t = i64;
12 pub type blkcnt64_t = i64;
13 pub type rlim64_t = u64;
14 pub type mqd_t = ::c_int;
15 pub type nfds_t = ::c_ulong;
16 pub type nl_item = ::c_int;
17 pub type idtype_t = ::c_uint;
18 pub type loff_t = ::c_longlong;
19
20 pub type __u8 = ::c_uchar;
21 pub type __u16 = ::c_ushort;
22 pub type __s16 = ::c_short;
23 pub type __u32 = ::c_uint;
24 pub type __s32 = ::c_int;
25
26 pub type Elf32_Half = u16;
27 pub type Elf32_Word = u32;
28 pub type Elf32_Off = u32;
29 pub type Elf32_Addr = u32;
30
31 pub type Elf64_Half = u16;
32 pub type Elf64_Word = u32;
33 pub type Elf64_Off = u64;
34 pub type Elf64_Addr = u64;
35 pub type Elf64_Xword = u64;
36
37 pub enum fpos64_t {} // TODO: fill this out with a struct
38
39 s! {
40 pub struct dirent {
41 pub d_ino: ::ino_t,
42 pub d_off: ::off_t,
43 pub d_reclen: ::c_ushort,
44 pub d_type: ::c_uchar,
45 pub d_name: [::c_char; 256],
46 }
47
48 pub struct dirent64 {
49 pub d_ino: ::ino64_t,
50 pub d_off: ::off64_t,
51 pub d_reclen: ::c_ushort,
52 pub d_type: ::c_uchar,
53 pub d_name: [::c_char; 256],
54 }
55
56 pub struct rlimit64 {
57 pub rlim_cur: rlim64_t,
58 pub rlim_max: rlim64_t,
59 }
60
61 pub struct glob_t {
62 pub gl_pathc: ::size_t,
63 pub gl_pathv: *mut *mut c_char,
64 pub gl_offs: ::size_t,
65 pub gl_flags: ::c_int,
66
67 __unused1: *mut ::c_void,
68 __unused2: *mut ::c_void,
69 __unused3: *mut ::c_void,
70 __unused4: *mut ::c_void,
71 __unused5: *mut ::c_void,
72 }
73
74 pub struct ifaddrs {
75 pub ifa_next: *mut ifaddrs,
76 pub ifa_name: *mut c_char,
77 pub ifa_flags: ::c_uint,
78 pub ifa_addr: *mut ::sockaddr,
79 pub ifa_netmask: *mut ::sockaddr,
80 pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union
81 pub ifa_data: *mut ::c_void
82 }
83
84 pub struct pthread_mutex_t {
85 #[cfg(any(target_arch = "mips",
86 target_arch = "arm",
87 target_arch = "powerpc",
88 all(target_arch = "x86_64",
89 target_pointer_width = "32")))]
90 __align: [::c_long; 0],
91 #[cfg(not(any(target_arch = "mips",
92 target_arch = "arm",
93 target_arch = "powerpc",
94 all(target_arch = "x86_64",
95 target_pointer_width = "32"))))]
96 __align: [::c_longlong; 0],
97 size: [u8; __SIZEOF_PTHREAD_MUTEX_T],
98 }
99
100 pub struct pthread_rwlock_t {
101 #[cfg(any(target_arch = "mips",
102 target_arch = "arm",
103 target_arch = "powerpc",
104 all(target_arch = "x86_64",
105 target_pointer_width = "32")))]
106 __align: [::c_long; 0],
107 #[cfg(not(any(target_arch = "mips",
108 target_arch = "arm",
109 target_arch = "powerpc",
110 all(target_arch = "x86_64",
111 target_pointer_width = "32"))))]
112 __align: [::c_longlong; 0],
113 size: [u8; __SIZEOF_PTHREAD_RWLOCK_T],
114 }
115
116 pub struct pthread_mutexattr_t {
117 #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64",
118 target_arch = "mips64", target_arch = "s390x",
119 target_arch = "sparc64"))]
120 __align: [::c_int; 0],
121 #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64",
122 target_arch = "mips64", target_arch = "s390x",
123 target_arch = "sparc64", target_arch = "aarch64")))]
124 __align: [::c_long; 0],
125 #[cfg(all(target_arch = "aarch64", target_env = "gnu"))]
126 __align: [::c_long; 0],
127 #[cfg(all(target_arch = "aarch64", target_env = "musl"))]
128 __align: [::c_int; 0],
129 size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T],
130 }
131
132 pub struct pthread_rwlockattr_t {
133 #[cfg(any(target_env = "musl"))]
134 __align: [::c_int; 0],
135 #[cfg(not(any(target_env = "musl")))]
136 __align: [::c_long; 0],
137 size: [u8; __SIZEOF_PTHREAD_RWLOCKATTR_T],
138 }
139
140 pub struct pthread_cond_t {
141 #[cfg(any(target_env = "musl"))]
142 __align: [*const ::c_void; 0],
143 #[cfg(not(any(target_env = "musl")))]
144 __align: [::c_longlong; 0],
145 size: [u8; __SIZEOF_PTHREAD_COND_T],
146 }
147
148 pub struct pthread_condattr_t {
149 __align: [::c_int; 0],
150 size: [u8; __SIZEOF_PTHREAD_CONDATTR_T],
151 }
152
153 pub struct passwd {
154 pub pw_name: *mut ::c_char,
155 pub pw_passwd: *mut ::c_char,
156 pub pw_uid: ::uid_t,
157 pub pw_gid: ::gid_t,
158 pub pw_gecos: *mut ::c_char,
159 pub pw_dir: *mut ::c_char,
160 pub pw_shell: *mut ::c_char,
161 }
162
163 pub struct spwd {
164 pub sp_namp: *mut ::c_char,
165 pub sp_pwdp: *mut ::c_char,
166 pub sp_lstchg: ::c_long,
167 pub sp_min: ::c_long,
168 pub sp_max: ::c_long,
169 pub sp_warn: ::c_long,
170 pub sp_inact: ::c_long,
171 pub sp_expire: ::c_long,
172 pub sp_flag: ::c_ulong,
173 }
174
175 pub struct statvfs {
176 pub f_bsize: ::c_ulong,
177 pub f_frsize: ::c_ulong,
178 pub f_blocks: ::fsblkcnt_t,
179 pub f_bfree: ::fsblkcnt_t,
180 pub f_bavail: ::fsblkcnt_t,
181 pub f_files: ::fsfilcnt_t,
182 pub f_ffree: ::fsfilcnt_t,
183 pub f_favail: ::fsfilcnt_t,
184 #[cfg(target_endian = "little")]
185 pub f_fsid: ::c_ulong,
186 #[cfg(all(target_pointer_width = "32", not(target_arch = "x86_64")))]
187 __f_unused: ::c_int,
188 #[cfg(target_endian = "big")]
189 pub f_fsid: ::c_ulong,
190 pub f_flag: ::c_ulong,
191 pub f_namemax: ::c_ulong,
192 __f_spare: [::c_int; 6],
193 }
194
195 pub struct dqblk {
196 pub dqb_bhardlimit: ::uint64_t,
197 pub dqb_bsoftlimit: ::uint64_t,
198 pub dqb_curspace: ::uint64_t,
199 pub dqb_ihardlimit: ::uint64_t,
200 pub dqb_isoftlimit: ::uint64_t,
201 pub dqb_curinodes: ::uint64_t,
202 pub dqb_btime: ::uint64_t,
203 pub dqb_itime: ::uint64_t,
204 pub dqb_valid: ::uint32_t,
205 }
206
207 pub struct signalfd_siginfo {
208 pub ssi_signo: ::uint32_t,
209 pub ssi_errno: ::int32_t,
210 pub ssi_code: ::int32_t,
211 pub ssi_pid: ::uint32_t,
212 pub ssi_uid: ::uint32_t,
213 pub ssi_fd: ::int32_t,
214 pub ssi_tid: ::uint32_t,
215 pub ssi_band: ::uint32_t,
216 pub ssi_overrun: ::uint32_t,
217 pub ssi_trapno: ::uint32_t,
218 pub ssi_status: ::int32_t,
219 pub ssi_int: ::int32_t,
220 pub ssi_ptr: ::uint64_t,
221 pub ssi_utime: ::uint64_t,
222 pub ssi_stime: ::uint64_t,
223 pub ssi_addr: ::uint64_t,
224 _pad: [::uint8_t; 48],
225 }
226
227 pub struct itimerspec {
228 pub it_interval: ::timespec,
229 pub it_value: ::timespec,
230 }
231
232 pub struct fsid_t {
233 __val: [::c_int; 2],
234 }
235
236 // x32 compatibility
237 // See https://sourceware.org/bugzilla/show_bug.cgi?id=21279
238 pub struct mq_attr {
239 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
240 pub mq_flags: i64,
241 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
242 pub mq_maxmsg: i64,
243 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
244 pub mq_msgsize: i64,
245 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
246 pub mq_curmsgs: i64,
247 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
248 pad: [i64; 4],
249
250 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
251 pub mq_flags: ::c_long,
252 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
253 pub mq_maxmsg: ::c_long,
254 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
255 pub mq_msgsize: ::c_long,
256 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
257 pub mq_curmsgs: ::c_long,
258 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
259 pad: [::c_long; 4],
260 }
261
262 pub struct cpu_set_t {
263 #[cfg(all(target_pointer_width = "32",
264 not(target_arch = "x86_64")))]
265 bits: [u32; 32],
266 #[cfg(not(all(target_pointer_width = "32",
267 not(target_arch = "x86_64"))))]
268 bits: [u64; 16],
269 }
270
271 pub struct if_nameindex {
272 pub if_index: ::c_uint,
273 pub if_name: *mut ::c_char,
274 }
275
276 // System V IPC
277 pub struct msginfo {
278 pub msgpool: ::c_int,
279 pub msgmap: ::c_int,
280 pub msgmax: ::c_int,
281 pub msgmnb: ::c_int,
282 pub msgmni: ::c_int,
283 pub msgssz: ::c_int,
284 pub msgtql: ::c_int,
285 pub msgseg: ::c_ushort,
286 }
287
288 pub struct mmsghdr {
289 pub msg_hdr: ::msghdr,
290 pub msg_len: ::c_uint,
291 }
292
293 pub struct sembuf {
294 pub sem_num: ::c_ushort,
295 pub sem_op: ::c_short,
296 pub sem_flg: ::c_short,
297 }
298
299 pub struct input_event {
300 pub time: ::timeval,
301 pub type_: ::__u16,
302 pub code: ::__u16,
303 pub value: ::__s32,
304 }
305
306 pub struct input_id {
307 pub bustype: ::__u16,
308 pub vendor: ::__u16,
309 pub product: ::__u16,
310 pub version: ::__u16,
311 }
312
313 pub struct input_absinfo {
314 pub value: ::__s32,
315 pub minimum: ::__s32,
316 pub maximum: ::__s32,
317 pub fuzz: ::__s32,
318 pub flat: ::__s32,
319 pub resolution: ::__s32,
320 }
321
322 pub struct input_keymap_entry {
323 pub flags: ::__u8,
324 pub len: ::__u8,
325 pub index: ::__u16,
326 pub keycode: ::__u32,
327 pub scancode: [::__u8; 32],
328 }
329
330 pub struct input_mask {
331 pub type_: ::__u32,
332 pub codes_size: ::__u32,
333 pub codes_ptr: ::__u64,
334 }
335
336 pub struct ff_replay {
337 pub length: ::__u16,
338 pub delay: ::__u16,
339 }
340
341 pub struct ff_trigger {
342 pub button: ::__u16,
343 pub interval: ::__u16,
344 }
345
346 pub struct ff_envelope {
347 pub attack_length: ::__u16,
348 pub attack_level: ::__u16,
349 pub fade_length: ::__u16,
350 pub fade_level: ::__u16,
351 }
352
353 pub struct ff_constant_effect {
354 pub level: ::__s16,
355 pub envelope: ff_envelope,
356 }
357
358 pub struct ff_ramp_effect {
359 pub start_level: ::__s16,
360 pub end_level: ::__s16,
361 pub envelope: ff_envelope,
362 }
363
364 pub struct ff_condition_effect {
365 pub right_saturation: ::__u16,
366 pub left_saturation: ::__u16,
367
368 pub right_coeff: ::__s16,
369 pub left_coeff: ::__s16,
370
371 pub deadband: ::__u16,
372 pub center: ::__s16,
373 }
374
375 pub struct ff_periodic_effect {
376 pub waveform: ::__u16,
377 pub period: ::__u16,
378 pub magnitude: ::__s16,
379 pub offset: ::__s16,
380 pub phase: ::__u16,
381
382 pub envelope: ff_envelope,
383
384 pub custom_len: ::__u32,
385 pub custom_data: *mut ::__s16,
386 }
387
388 pub struct ff_rumble_effect {
389 pub strong_magnitude: ::__u16,
390 pub weak_magnitude: ::__u16,
391 }
392
393 pub struct ff_effect {
394 pub type_: ::__u16,
395 pub id: ::__s16,
396 pub direction: ::__u16,
397 pub trigger: ff_trigger,
398 pub replay: ff_replay,
399 // FIXME this is actually a union
400 #[cfg(target_pointer_width = "64")]
401 pub u: [u64; 4],
402 #[cfg(target_pointer_width = "32")]
403 pub u: [u32; 7],
404 }
405
406 pub struct dl_phdr_info {
407 #[cfg(target_pointer_width = "64")]
408 pub dlpi_addr: Elf64_Addr,
409 #[cfg(target_pointer_width = "32")]
410 pub dlpi_addr: Elf32_Addr,
411
412 pub dlpi_name: *const ::c_char,
413
414 #[cfg(target_pointer_width = "64")]
415 pub dlpi_phdr: *const Elf64_Phdr,
416 #[cfg(target_pointer_width = "32")]
417 pub dlpi_phdr: *const Elf32_Phdr,
418
419 #[cfg(target_pointer_width = "64")]
420 pub dlpi_phnum: Elf64_Half,
421 #[cfg(target_pointer_width = "32")]
422 pub dlpi_phnum: Elf32_Half,
423
424 pub dlpi_adds: ::c_ulonglong,
425 pub dlpi_subs: ::c_ulonglong,
426 pub dlpi_tls_modid: ::size_t,
427 pub dlpi_tls_data: *mut ::c_void,
428 }
429
430 pub struct Elf32_Phdr {
431 pub p_type: Elf32_Word,
432 pub p_offset: Elf32_Off,
433 pub p_vaddr: Elf32_Addr,
434 pub p_paddr: Elf32_Addr,
435 pub p_filesz: Elf32_Word,
436 pub p_memsz: Elf32_Word,
437 pub p_flags: Elf32_Word,
438 pub p_align: Elf32_Word,
439 }
440
441 pub struct Elf64_Phdr {
442 pub p_type: Elf64_Word,
443 pub p_flags: Elf64_Word,
444 pub p_offset: Elf64_Off,
445 pub p_vaddr: Elf64_Addr,
446 pub p_paddr: Elf64_Addr,
447 pub p_filesz: Elf64_Xword,
448 pub p_memsz: Elf64_Xword,
449 pub p_align: Elf64_Xword,
450 }
451
452 pub struct ucred {
453 pub pid: ::pid_t,
454 pub uid: ::uid_t,
455 pub gid: ::gid_t,
456 }
457
458 pub struct mntent {
459 pub mnt_fsname: *mut ::c_char,
460 pub mnt_dir: *mut ::c_char,
461 pub mnt_type: *mut ::c_char,
462 pub mnt_opts: *mut ::c_char,
463 pub mnt_freq: ::c_int,
464 pub mnt_passno: ::c_int,
465 }
466
467 pub struct posix_spawn_file_actions_t {
468 __allocated: ::c_int,
469 __used: ::c_int,
470 __actions: *mut ::c_int,
471 __pad: [::c_int; 16],
472 }
473
474 pub struct posix_spawnattr_t {
475 __flags: ::c_short,
476 __pgrp: ::pid_t,
477 __sd: ::sigset_t,
478 __ss: ::sigset_t,
479 #[cfg(target_env = "musl")]
480 __prio: ::c_int,
481 #[cfg(not(target_env = "musl"))]
482 __sp: ::sched_param,
483 __policy: ::c_int,
484 __pad: [::c_int; 16],
485 }
486
487 pub struct genlmsghdr {
488 cmd: u8,
489 version: u8,
490 reserved: u16,
491 }
492 }
493
494 pub const ABDAY_1: ::nl_item = 0x20000;
495 pub const ABDAY_2: ::nl_item = 0x20001;
496 pub const ABDAY_3: ::nl_item = 0x20002;
497 pub const ABDAY_4: ::nl_item = 0x20003;
498 pub const ABDAY_5: ::nl_item = 0x20004;
499 pub const ABDAY_6: ::nl_item = 0x20005;
500 pub const ABDAY_7: ::nl_item = 0x20006;
501
502 pub const DAY_1: ::nl_item = 0x20007;
503 pub const DAY_2: ::nl_item = 0x20008;
504 pub const DAY_3: ::nl_item = 0x20009;
505 pub const DAY_4: ::nl_item = 0x2000A;
506 pub const DAY_5: ::nl_item = 0x2000B;
507 pub const DAY_6: ::nl_item = 0x2000C;
508 pub const DAY_7: ::nl_item = 0x2000D;
509
510 pub const ABMON_1: ::nl_item = 0x2000E;
511 pub const ABMON_2: ::nl_item = 0x2000F;
512 pub const ABMON_3: ::nl_item = 0x20010;
513 pub const ABMON_4: ::nl_item = 0x20011;
514 pub const ABMON_5: ::nl_item = 0x20012;
515 pub const ABMON_6: ::nl_item = 0x20013;
516 pub const ABMON_7: ::nl_item = 0x20014;
517 pub const ABMON_8: ::nl_item = 0x20015;
518 pub const ABMON_9: ::nl_item = 0x20016;
519 pub const ABMON_10: ::nl_item = 0x20017;
520 pub const ABMON_11: ::nl_item = 0x20018;
521 pub const ABMON_12: ::nl_item = 0x20019;
522
523 pub const MON_1: ::nl_item = 0x2001A;
524 pub const MON_2: ::nl_item = 0x2001B;
525 pub const MON_3: ::nl_item = 0x2001C;
526 pub const MON_4: ::nl_item = 0x2001D;
527 pub const MON_5: ::nl_item = 0x2001E;
528 pub const MON_6: ::nl_item = 0x2001F;
529 pub const MON_7: ::nl_item = 0x20020;
530 pub const MON_8: ::nl_item = 0x20021;
531 pub const MON_9: ::nl_item = 0x20022;
532 pub const MON_10: ::nl_item = 0x20023;
533 pub const MON_11: ::nl_item = 0x20024;
534 pub const MON_12: ::nl_item = 0x20025;
535
536 pub const AM_STR: ::nl_item = 0x20026;
537 pub const PM_STR: ::nl_item = 0x20027;
538
539 pub const D_T_FMT: ::nl_item = 0x20028;
540 pub const D_FMT: ::nl_item = 0x20029;
541 pub const T_FMT: ::nl_item = 0x2002A;
542 pub const T_FMT_AMPM: ::nl_item = 0x2002B;
543
544 pub const ERA: ::nl_item = 0x2002C;
545 pub const ERA_D_FMT: ::nl_item = 0x2002E;
546 pub const ALT_DIGITS: ::nl_item = 0x2002F;
547 pub const ERA_D_T_FMT: ::nl_item = 0x20030;
548 pub const ERA_T_FMT: ::nl_item = 0x20031;
549
550 pub const CODESET: ::nl_item = 14;
551
552 pub const CRNCYSTR: ::nl_item = 0x4000F;
553
554 pub const RUSAGE_THREAD: ::c_int = 1;
555 pub const RUSAGE_CHILDREN: ::c_int = -1;
556
557 pub const RADIXCHAR: ::nl_item = 0x10000;
558 pub const THOUSEP: ::nl_item = 0x10001;
559
560 pub const YESEXPR: ::nl_item = 0x50000;
561 pub const NOEXPR: ::nl_item = 0x50001;
562 pub const YESSTR: ::nl_item = 0x50002;
563 pub const NOSTR: ::nl_item = 0x50003;
564
565 pub const FILENAME_MAX: ::c_uint = 4096;
566 pub const L_tmpnam: ::c_uint = 20;
567 pub const _PC_LINK_MAX: ::c_int = 0;
568 pub const _PC_MAX_CANON: ::c_int = 1;
569 pub const _PC_MAX_INPUT: ::c_int = 2;
570 pub const _PC_NAME_MAX: ::c_int = 3;
571 pub const _PC_PATH_MAX: ::c_int = 4;
572 pub const _PC_PIPE_BUF: ::c_int = 5;
573 pub const _PC_CHOWN_RESTRICTED: ::c_int = 6;
574 pub const _PC_NO_TRUNC: ::c_int = 7;
575 pub const _PC_VDISABLE: ::c_int = 8;
576 pub const _PC_SYNC_IO: ::c_int = 9;
577 pub const _PC_ASYNC_IO: ::c_int = 10;
578 pub const _PC_PRIO_IO: ::c_int = 11;
579 pub const _PC_SOCK_MAXBUF: ::c_int = 12;
580 pub const _PC_FILESIZEBITS: ::c_int = 13;
581 pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14;
582 pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15;
583 pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16;
584 pub const _PC_REC_XFER_ALIGN: ::c_int = 17;
585 pub const _PC_ALLOC_SIZE_MIN: ::c_int = 18;
586 pub const _PC_SYMLINK_MAX: ::c_int = 19;
587 pub const _PC_2_SYMLINKS: ::c_int = 20;
588
589 pub const _SC_ARG_MAX: ::c_int = 0;
590 pub const _SC_CHILD_MAX: ::c_int = 1;
591 pub const _SC_CLK_TCK: ::c_int = 2;
592 pub const _SC_NGROUPS_MAX: ::c_int = 3;
593 pub const _SC_OPEN_MAX: ::c_int = 4;
594 pub const _SC_STREAM_MAX: ::c_int = 5;
595 pub const _SC_TZNAME_MAX: ::c_int = 6;
596 pub const _SC_JOB_CONTROL: ::c_int = 7;
597 pub const _SC_SAVED_IDS: ::c_int = 8;
598 pub const _SC_REALTIME_SIGNALS: ::c_int = 9;
599 pub const _SC_PRIORITY_SCHEDULING: ::c_int = 10;
600 pub const _SC_TIMERS: ::c_int = 11;
601 pub const _SC_ASYNCHRONOUS_IO: ::c_int = 12;
602 pub const _SC_PRIORITIZED_IO: ::c_int = 13;
603 pub const _SC_SYNCHRONIZED_IO: ::c_int = 14;
604 pub const _SC_FSYNC: ::c_int = 15;
605 pub const _SC_MAPPED_FILES: ::c_int = 16;
606 pub const _SC_MEMLOCK: ::c_int = 17;
607 pub const _SC_MEMLOCK_RANGE: ::c_int = 18;
608 pub const _SC_MEMORY_PROTECTION: ::c_int = 19;
609 pub const _SC_MESSAGE_PASSING: ::c_int = 20;
610 pub const _SC_SEMAPHORES: ::c_int = 21;
611 pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 22;
612 pub const _SC_AIO_LISTIO_MAX: ::c_int = 23;
613 pub const _SC_AIO_MAX: ::c_int = 24;
614 pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 25;
615 pub const _SC_DELAYTIMER_MAX: ::c_int = 26;
616 pub const _SC_MQ_OPEN_MAX: ::c_int = 27;
617 pub const _SC_MQ_PRIO_MAX: ::c_int = 28;
618 pub const _SC_VERSION: ::c_int = 29;
619 pub const _SC_PAGESIZE: ::c_int = 30;
620 pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
621 pub const _SC_RTSIG_MAX: ::c_int = 31;
622 pub const _SC_SEM_NSEMS_MAX: ::c_int = 32;
623 pub const _SC_SEM_VALUE_MAX: ::c_int = 33;
624 pub const _SC_SIGQUEUE_MAX: ::c_int = 34;
625 pub const _SC_TIMER_MAX: ::c_int = 35;
626 pub const _SC_BC_BASE_MAX: ::c_int = 36;
627 pub const _SC_BC_DIM_MAX: ::c_int = 37;
628 pub const _SC_BC_SCALE_MAX: ::c_int = 38;
629 pub const _SC_BC_STRING_MAX: ::c_int = 39;
630 pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 40;
631 pub const _SC_EXPR_NEST_MAX: ::c_int = 42;
632 pub const _SC_LINE_MAX: ::c_int = 43;
633 pub const _SC_RE_DUP_MAX: ::c_int = 44;
634 pub const _SC_2_VERSION: ::c_int = 46;
635 pub const _SC_2_C_BIND: ::c_int = 47;
636 pub const _SC_2_C_DEV: ::c_int = 48;
637 pub const _SC_2_FORT_DEV: ::c_int = 49;
638 pub const _SC_2_FORT_RUN: ::c_int = 50;
639 pub const _SC_2_SW_DEV: ::c_int = 51;
640 pub const _SC_2_LOCALEDEF: ::c_int = 52;
641 pub const _SC_UIO_MAXIOV: ::c_int = 60;
642 pub const _SC_IOV_MAX: ::c_int = 60;
643 pub const _SC_THREADS: ::c_int = 67;
644 pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 68;
645 pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 69;
646 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 70;
647 pub const _SC_LOGIN_NAME_MAX: ::c_int = 71;
648 pub const _SC_TTY_NAME_MAX: ::c_int = 72;
649 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 73;
650 pub const _SC_THREAD_KEYS_MAX: ::c_int = 74;
651 pub const _SC_THREAD_STACK_MIN: ::c_int = 75;
652 pub const _SC_THREAD_THREADS_MAX: ::c_int = 76;
653 pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77;
654 pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78;
655 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79;
656 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80;
657 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81;
658 pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 82;
659 pub const _SC_NPROCESSORS_CONF: ::c_int = 83;
660 pub const _SC_NPROCESSORS_ONLN: ::c_int = 84;
661 pub const _SC_PHYS_PAGES: ::c_int = 85;
662 pub const _SC_AVPHYS_PAGES: ::c_int = 86;
663 pub const _SC_ATEXIT_MAX: ::c_int = 87;
664 pub const _SC_PASS_MAX: ::c_int = 88;
665 pub const _SC_XOPEN_VERSION: ::c_int = 89;
666 pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90;
667 pub const _SC_XOPEN_UNIX: ::c_int = 91;
668 pub const _SC_XOPEN_CRYPT: ::c_int = 92;
669 pub const _SC_XOPEN_ENH_I18N: ::c_int = 93;
670 pub const _SC_XOPEN_SHM: ::c_int = 94;
671 pub const _SC_2_CHAR_TERM: ::c_int = 95;
672 pub const _SC_2_UPE: ::c_int = 97;
673 pub const _SC_XOPEN_XPG2: ::c_int = 98;
674 pub const _SC_XOPEN_XPG3: ::c_int = 99;
675 pub const _SC_XOPEN_XPG4: ::c_int = 100;
676 pub const _SC_NZERO: ::c_int = 109;
677 pub const _SC_XBS5_ILP32_OFF32: ::c_int = 125;
678 pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126;
679 pub const _SC_XBS5_LP64_OFF64: ::c_int = 127;
680 pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 128;
681 pub const _SC_XOPEN_LEGACY: ::c_int = 129;
682 pub const _SC_XOPEN_REALTIME: ::c_int = 130;
683 pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 131;
684 pub const _SC_ADVISORY_INFO: ::c_int = 132;
685 pub const _SC_BARRIERS: ::c_int = 133;
686 pub const _SC_CLOCK_SELECTION: ::c_int = 137;
687 pub const _SC_CPUTIME: ::c_int = 138;
688 pub const _SC_THREAD_CPUTIME: ::c_int = 139;
689 pub const _SC_MONOTONIC_CLOCK: ::c_int = 149;
690 pub const _SC_READER_WRITER_LOCKS: ::c_int = 153;
691 pub const _SC_SPIN_LOCKS: ::c_int = 154;
692 pub const _SC_REGEXP: ::c_int = 155;
693 pub const _SC_SHELL: ::c_int = 157;
694 pub const _SC_SPAWN: ::c_int = 159;
695 pub const _SC_SPORADIC_SERVER: ::c_int = 160;
696 pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 161;
697 pub const _SC_TIMEOUTS: ::c_int = 164;
698 pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 165;
699 pub const _SC_2_PBS: ::c_int = 168;
700 pub const _SC_2_PBS_ACCOUNTING: ::c_int = 169;
701 pub const _SC_2_PBS_LOCATE: ::c_int = 170;
702 pub const _SC_2_PBS_MESSAGE: ::c_int = 171;
703 pub const _SC_2_PBS_TRACK: ::c_int = 172;
704 pub const _SC_SYMLOOP_MAX: ::c_int = 173;
705 pub const _SC_STREAMS: ::c_int = 174;
706 pub const _SC_2_PBS_CHECKPOINT: ::c_int = 175;
707 pub const _SC_V6_ILP32_OFF32: ::c_int = 176;
708 pub const _SC_V6_ILP32_OFFBIG: ::c_int = 177;
709 pub const _SC_V6_LP64_OFF64: ::c_int = 178;
710 pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 179;
711 pub const _SC_HOST_NAME_MAX: ::c_int = 180;
712 pub const _SC_TRACE: ::c_int = 181;
713 pub const _SC_TRACE_EVENT_FILTER: ::c_int = 182;
714 pub const _SC_TRACE_INHERIT: ::c_int = 183;
715 pub const _SC_TRACE_LOG: ::c_int = 184;
716 pub const _SC_IPV6: ::c_int = 235;
717 pub const _SC_RAW_SOCKETS: ::c_int = 236;
718 pub const _SC_V7_ILP32_OFF32: ::c_int = 237;
719 pub const _SC_V7_ILP32_OFFBIG: ::c_int = 238;
720 pub const _SC_V7_LP64_OFF64: ::c_int = 239;
721 pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 240;
722 pub const _SC_SS_REPL_MAX: ::c_int = 241;
723 pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 242;
724 pub const _SC_TRACE_NAME_MAX: ::c_int = 243;
725 pub const _SC_TRACE_SYS_MAX: ::c_int = 244;
726 pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 245;
727 pub const _SC_XOPEN_STREAMS: ::c_int = 246;
728 pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 247;
729 pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 248;
730
731 pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY;
732 pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY;
733
734 pub const GLOB_ERR: ::c_int = 1 << 0;
735 pub const GLOB_MARK: ::c_int = 1 << 1;
736 pub const GLOB_NOSORT: ::c_int = 1 << 2;
737 pub const GLOB_DOOFFS: ::c_int = 1 << 3;
738 pub const GLOB_NOCHECK: ::c_int = 1 << 4;
739 pub const GLOB_APPEND: ::c_int = 1 << 5;
740 pub const GLOB_NOESCAPE: ::c_int = 1 << 6;
741
742 pub const GLOB_NOSPACE: ::c_int = 1;
743 pub const GLOB_ABORTED: ::c_int = 2;
744 pub const GLOB_NOMATCH: ::c_int = 3;
745
746 pub const POSIX_MADV_NORMAL: ::c_int = 0;
747 pub const POSIX_MADV_RANDOM: ::c_int = 1;
748 pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
749 pub const POSIX_MADV_WILLNEED: ::c_int = 3;
750
751 pub const S_IEXEC: mode_t = 64;
752 pub const S_IWRITE: mode_t = 128;
753 pub const S_IREAD: mode_t = 256;
754
755 pub const F_LOCK: ::c_int = 1;
756 pub const F_TEST: ::c_int = 3;
757 pub const F_TLOCK: ::c_int = 2;
758 pub const F_ULOCK: ::c_int = 0;
759
760 pub const IFF_LOWER_UP: ::c_int = 0x10000;
761 pub const IFF_DORMANT: ::c_int = 0x20000;
762 pub const IFF_ECHO: ::c_int = 0x40000;
763
764 // linux/if_tun.h
765 pub const IFF_TUN: ::c_short = 0x0001;
766 pub const IFF_TAP: ::c_short = 0x0002;
767 pub const IFF_NO_PI: ::c_short = 0x1000;
768 // Read queue size
769 pub const TUN_READQ_SIZE: ::c_short = 500;
770 // TUN device type flags: deprecated. Use IFF_TUN/IFF_TAP instead.
771 pub const TUN_TUN_DEV: ::c_short = ::IFF_TUN;
772 pub const TUN_TAP_DEV: ::c_short = ::IFF_TAP;
773 pub const TUN_TYPE_MASK: ::c_short = 0x000f;
774 // This flag has no real effect
775 pub const IFF_ONE_QUEUE: ::c_short = 0x2000;
776 pub const IFF_VNET_HDR: ::c_short = 0x4000;
777 pub const IFF_TUN_EXCL: ::c_short = 0x8000;
778 pub const IFF_MULTI_QUEUE: ::c_short = 0x0100;
779 pub const IFF_ATTACH_QUEUE: ::c_short = 0x0200;
780 pub const IFF_DETACH_QUEUE: ::c_short = 0x0400;
781 // read-only flag
782 pub const IFF_PERSIST: ::c_short = 0x0800;
783 pub const IFF_NOFILTER: ::c_short = 0x1000;
784
785 pub const ST_RDONLY: ::c_ulong = 1;
786 pub const ST_NOSUID: ::c_ulong = 2;
787 pub const ST_NODEV: ::c_ulong = 4;
788 pub const ST_NOEXEC: ::c_ulong = 8;
789 pub const ST_SYNCHRONOUS: ::c_ulong = 16;
790 pub const ST_MANDLOCK: ::c_ulong = 64;
791 pub const ST_WRITE: ::c_ulong = 128;
792 pub const ST_APPEND: ::c_ulong = 256;
793 pub const ST_IMMUTABLE: ::c_ulong = 512;
794 pub const ST_NOATIME: ::c_ulong = 1024;
795 pub const ST_NODIRATIME: ::c_ulong = 2048;
796
797 pub const RTLD_NEXT: *mut ::c_void = -1i64 as *mut ::c_void;
798 pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
799 pub const RTLD_NODELETE: ::c_int = 0x1000;
800 pub const RTLD_NOW: ::c_int = 0x2;
801
802 pub const TCP_MD5SIG: ::c_int = 14;
803
804 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
805 __align: [],
806 size: [0; __SIZEOF_PTHREAD_MUTEX_T],
807 };
808 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
809 __align: [],
810 size: [0; __SIZEOF_PTHREAD_COND_T],
811 };
812 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
813 __align: [],
814 size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
815 };
816 pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
817 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
818 pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
819 pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
820 pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
821 pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
822 pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
823
824 pub const RENAME_NOREPLACE: ::c_int = 1;
825 pub const RENAME_EXCHANGE: ::c_int = 2;
826 pub const RENAME_WHITEOUT: ::c_int = 4;
827
828 pub const SCHED_OTHER: ::c_int = 0;
829 pub const SCHED_FIFO: ::c_int = 1;
830 pub const SCHED_RR: ::c_int = 2;
831 pub const SCHED_BATCH: ::c_int = 3;
832 pub const SCHED_IDLE: ::c_int = 5;
833
834 // netinet/in.h
835 // NOTE: These are in addition to the constants defined in src/unix/mod.rs
836
837 // IPPROTO_IP defined in src/unix/mod.rs
838 /// Hop-by-hop option header
839 pub const IPPROTO_HOPOPTS: ::c_int = 0;
840 // IPPROTO_ICMP defined in src/unix/mod.rs
841 /// group mgmt protocol
842 pub const IPPROTO_IGMP: ::c_int = 2;
843 /// for compatibility
844 pub const IPPROTO_IPIP: ::c_int = 4;
845 // IPPROTO_TCP defined in src/unix/mod.rs
846 /// exterior gateway protocol
847 pub const IPPROTO_EGP: ::c_int = 8;
848 /// pup
849 pub const IPPROTO_PUP: ::c_int = 12;
850 // IPPROTO_UDP defined in src/unix/mod.rs
851 /// xns idp
852 pub const IPPROTO_IDP: ::c_int = 22;
853 /// tp-4 w/ class negotiation
854 pub const IPPROTO_TP: ::c_int = 29;
855 /// DCCP
856 pub const IPPROTO_DCCP: ::c_int = 33;
857 // IPPROTO_IPV6 defined in src/unix/mod.rs
858 /// IP6 routing header
859 pub const IPPROTO_ROUTING: ::c_int = 43;
860 /// IP6 fragmentation header
861 pub const IPPROTO_FRAGMENT: ::c_int = 44;
862 /// resource reservation
863 pub const IPPROTO_RSVP: ::c_int = 46;
864 /// General Routing Encap.
865 pub const IPPROTO_GRE: ::c_int = 47;
866 /// IP6 Encap Sec. Payload
867 pub const IPPROTO_ESP: ::c_int = 50;
868 /// IP6 Auth Header
869 pub const IPPROTO_AH: ::c_int = 51;
870 // IPPROTO_ICMPV6 defined in src/unix/mod.rs
871 /// IP6 no next header
872 pub const IPPROTO_NONE: ::c_int = 59;
873 /// IP6 destination option
874 pub const IPPROTO_DSTOPTS: ::c_int = 60;
875 pub const IPPROTO_MTP: ::c_int = 92;
876 pub const IPPROTO_BEETPH: ::c_int = 94;
877 /// encapsulation header
878 pub const IPPROTO_ENCAP: ::c_int = 98;
879 /// Protocol indep. multicast
880 pub const IPPROTO_PIM: ::c_int = 103;
881 /// IP Payload Comp. Protocol
882 pub const IPPROTO_COMP: ::c_int = 108;
883 /// SCTP
884 pub const IPPROTO_SCTP: ::c_int = 132;
885 pub const IPPROTO_MH: ::c_int = 135;
886 pub const IPPROTO_UDPLITE: ::c_int = 136;
887 pub const IPPROTO_MPLS: ::c_int = 137;
888 /// raw IP packet
889 pub const IPPROTO_RAW: ::c_int = 255;
890 pub const IPPROTO_MAX: ::c_int = 256;
891
892 pub const AF_IB: ::c_int = 27;
893 pub const AF_MPLS: ::c_int = 28;
894 pub const AF_NFC: ::c_int = 39;
895 pub const AF_VSOCK: ::c_int = 40;
896 pub const PF_IB: ::c_int = AF_IB;
897 pub const PF_MPLS: ::c_int = AF_MPLS;
898 pub const PF_NFC: ::c_int = AF_NFC;
899 pub const PF_VSOCK: ::c_int = AF_VSOCK;
900
901 // System V IPC
902 pub const IPC_PRIVATE: ::key_t = 0;
903
904 pub const IPC_CREAT: ::c_int = 0o1000;
905 pub const IPC_EXCL: ::c_int = 0o2000;
906 pub const IPC_NOWAIT: ::c_int = 0o4000;
907
908 pub const IPC_RMID: ::c_int = 0;
909 pub const IPC_SET: ::c_int = 1;
910 pub const IPC_STAT: ::c_int = 2;
911 pub const IPC_INFO: ::c_int = 3;
912 pub const MSG_STAT: ::c_int = 11;
913 pub const MSG_INFO: ::c_int = 12;
914
915 pub const MSG_NOERROR: ::c_int = 0o10000;
916 pub const MSG_EXCEPT: ::c_int = 0o20000;
917 pub const MSG_COPY: ::c_int = 0o40000;
918
919 pub const SHM_R: ::c_int = 0o400;
920 pub const SHM_W: ::c_int = 0o200;
921
922 pub const SHM_RDONLY: ::c_int = 0o10000;
923 pub const SHM_RND: ::c_int = 0o20000;
924 pub const SHM_REMAP: ::c_int = 0o40000;
925 pub const SHM_EXEC: ::c_int = 0o100000;
926
927 pub const SHM_LOCK: ::c_int = 11;
928 pub const SHM_UNLOCK: ::c_int = 12;
929
930 pub const SHM_HUGETLB: ::c_int = 0o4000;
931 pub const SHM_NORESERVE: ::c_int = 0o10000;
932
933 pub const EPOLLRDHUP: ::c_int = 0x2000;
934 pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
935 pub const EPOLLONESHOT: ::c_int = 0x40000000;
936
937 pub const QFMT_VFS_OLD: ::c_int = 1;
938 pub const QFMT_VFS_V0: ::c_int = 2;
939 pub const QFMT_VFS_V1: ::c_int = 4;
940
941 pub const EFD_SEMAPHORE: ::c_int = 0x1;
942
943 pub const LOG_NFACILITIES: ::c_int = 24;
944
945 pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t;
946
947 pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32;
948 pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32;
949 pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32;
950 pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32;
951 pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32;
952 pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2u32 as i32;
953 pub const RB_KEXEC: ::c_int = 0x45584543u32 as i32;
954
955 pub const AI_PASSIVE: ::c_int = 0x0001;
956 pub const AI_CANONNAME: ::c_int = 0x0002;
957 pub const AI_NUMERICHOST: ::c_int = 0x0004;
958 pub const AI_V4MAPPED: ::c_int = 0x0008;
959 pub const AI_ALL: ::c_int = 0x0010;
960 pub const AI_ADDRCONFIG: ::c_int = 0x0020;
961
962 pub const AI_NUMERICSERV: ::c_int = 0x0400;
963
964 pub const EAI_BADFLAGS: ::c_int = -1;
965 pub const EAI_NONAME: ::c_int = -2;
966 pub const EAI_AGAIN: ::c_int = -3;
967 pub const EAI_FAIL: ::c_int = -4;
968 pub const EAI_NODATA: ::c_int = -5;
969 pub const EAI_FAMILY: ::c_int = -6;
970 pub const EAI_SOCKTYPE: ::c_int = -7;
971 pub const EAI_SERVICE: ::c_int = -8;
972 pub const EAI_MEMORY: ::c_int = -10;
973 pub const EAI_SYSTEM: ::c_int = -11;
974 pub const EAI_OVERFLOW: ::c_int = -12;
975
976 pub const NI_NUMERICHOST: ::c_int = 1;
977 pub const NI_NUMERICSERV: ::c_int = 2;
978 pub const NI_NOFQDN: ::c_int = 4;
979 pub const NI_NAMEREQD: ::c_int = 8;
980 pub const NI_DGRAM: ::c_int = 16;
981
982 pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1;
983 pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2;
984 pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4;
985
986 pub const AIO_CANCELED: ::c_int = 0;
987 pub const AIO_NOTCANCELED: ::c_int = 1;
988 pub const AIO_ALLDONE: ::c_int = 2;
989 pub const LIO_READ: ::c_int = 0;
990 pub const LIO_WRITE: ::c_int = 1;
991 pub const LIO_NOP: ::c_int = 2;
992 pub const LIO_WAIT: ::c_int = 0;
993 pub const LIO_NOWAIT: ::c_int = 1;
994
995 pub const MREMAP_MAYMOVE: ::c_int = 1;
996 pub const MREMAP_FIXED: ::c_int = 2;
997
998 pub const PR_SET_PDEATHSIG: ::c_int = 1;
999 pub const PR_GET_PDEATHSIG: ::c_int = 2;
1000
1001 pub const PR_GET_DUMPABLE: ::c_int = 3;
1002 pub const PR_SET_DUMPABLE: ::c_int = 4;
1003
1004 pub const PR_GET_UNALIGN: ::c_int = 5;
1005 pub const PR_SET_UNALIGN: ::c_int = 6;
1006 pub const PR_UNALIGN_NOPRINT: ::c_int = 1;
1007 pub const PR_UNALIGN_SIGBUS: ::c_int = 2;
1008
1009 pub const PR_GET_KEEPCAPS: ::c_int = 7;
1010 pub const PR_SET_KEEPCAPS: ::c_int = 8;
1011
1012 pub const PR_GET_FPEMU: ::c_int = 9;
1013 pub const PR_SET_FPEMU: ::c_int = 10;
1014 pub const PR_FPEMU_NOPRINT: ::c_int = 1;
1015 pub const PR_FPEMU_SIGFPE: ::c_int = 2;
1016
1017 pub const PR_GET_FPEXC: ::c_int = 11;
1018 pub const PR_SET_FPEXC: ::c_int = 12;
1019 pub const PR_FP_EXC_SW_ENABLE: ::c_int = 0x80;
1020 pub const PR_FP_EXC_DIV: ::c_int = 0x010000;
1021 pub const PR_FP_EXC_OVF: ::c_int = 0x020000;
1022 pub const PR_FP_EXC_UND: ::c_int = 0x040000;
1023 pub const PR_FP_EXC_RES: ::c_int = 0x080000;
1024 pub const PR_FP_EXC_INV: ::c_int = 0x100000;
1025 pub const PR_FP_EXC_DISABLED: ::c_int = 0;
1026 pub const PR_FP_EXC_NONRECOV: ::c_int = 1;
1027 pub const PR_FP_EXC_ASYNC: ::c_int = 2;
1028 pub const PR_FP_EXC_PRECISE: ::c_int = 3;
1029
1030 pub const PR_GET_TIMING: ::c_int = 13;
1031 pub const PR_SET_TIMING: ::c_int = 14;
1032 pub const PR_TIMING_STATISTICAL: ::c_int = 0;
1033 pub const PR_TIMING_TIMESTAMP: ::c_int = 1;
1034
1035 pub const PR_SET_NAME: ::c_int = 15;
1036 pub const PR_GET_NAME: ::c_int = 16;
1037
1038 pub const PR_GET_ENDIAN: ::c_int = 19;
1039 pub const PR_SET_ENDIAN: ::c_int = 20;
1040 pub const PR_ENDIAN_BIG: ::c_int = 0;
1041 pub const PR_ENDIAN_LITTLE: ::c_int = 1;
1042 pub const PR_ENDIAN_PPC_LITTLE: ::c_int = 2;
1043
1044 pub const PR_GET_SECCOMP: ::c_int = 21;
1045 pub const PR_SET_SECCOMP: ::c_int = 22;
1046
1047 pub const PR_CAPBSET_READ: ::c_int = 23;
1048 pub const PR_CAPBSET_DROP: ::c_int = 24;
1049
1050 pub const PR_GET_TSC: ::c_int = 25;
1051 pub const PR_SET_TSC: ::c_int = 26;
1052 pub const PR_TSC_ENABLE: ::c_int = 1;
1053 pub const PR_TSC_SIGSEGV: ::c_int = 2;
1054
1055 pub const PR_GET_SECUREBITS: ::c_int = 27;
1056 pub const PR_SET_SECUREBITS: ::c_int = 28;
1057
1058 pub const PR_SET_TIMERSLACK: ::c_int = 29;
1059 pub const PR_GET_TIMERSLACK: ::c_int = 30;
1060
1061 pub const PR_TASK_PERF_EVENTS_DISABLE: ::c_int = 31;
1062 pub const PR_TASK_PERF_EVENTS_ENABLE: ::c_int = 32;
1063
1064 pub const PR_MCE_KILL: ::c_int = 33;
1065 pub const PR_MCE_KILL_CLEAR: ::c_int = 0;
1066 pub const PR_MCE_KILL_SET: ::c_int = 1;
1067
1068 pub const PR_MCE_KILL_LATE: ::c_int = 0;
1069 pub const PR_MCE_KILL_EARLY: ::c_int = 1;
1070 pub const PR_MCE_KILL_DEFAULT: ::c_int = 2;
1071
1072 pub const PR_MCE_KILL_GET: ::c_int = 34;
1073
1074 pub const PR_SET_MM: ::c_int = 35;
1075 pub const PR_SET_MM_START_CODE: ::c_int = 1;
1076 pub const PR_SET_MM_END_CODE: ::c_int = 2;
1077 pub const PR_SET_MM_START_DATA: ::c_int = 3;
1078 pub const PR_SET_MM_END_DATA: ::c_int = 4;
1079 pub const PR_SET_MM_START_STACK: ::c_int = 5;
1080 pub const PR_SET_MM_START_BRK: ::c_int = 6;
1081 pub const PR_SET_MM_BRK: ::c_int = 7;
1082 pub const PR_SET_MM_ARG_START: ::c_int = 8;
1083 pub const PR_SET_MM_ARG_END: ::c_int = 9;
1084 pub const PR_SET_MM_ENV_START: ::c_int = 10;
1085 pub const PR_SET_MM_ENV_END: ::c_int = 11;
1086 pub const PR_SET_MM_AUXV: ::c_int = 12;
1087 pub const PR_SET_MM_EXE_FILE: ::c_int = 13;
1088 pub const PR_SET_MM_MAP: ::c_int = 14;
1089 pub const PR_SET_MM_MAP_SIZE: ::c_int = 15;
1090
1091 pub const PR_SET_PTRACER: ::c_int = 0x59616d61;
1092
1093 pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36;
1094 pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37;
1095
1096 pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38;
1097 pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39;
1098
1099 pub const PR_GET_TID_ADDRESS: ::c_int = 40;
1100
1101 pub const PR_SET_THP_DISABLE: ::c_int = 41;
1102 pub const PR_GET_THP_DISABLE: ::c_int = 42;
1103
1104 pub const PR_MPX_ENABLE_MANAGEMENT: ::c_int = 43;
1105 pub const PR_MPX_DISABLE_MANAGEMENT: ::c_int = 44;
1106
1107 pub const PR_SET_FP_MODE: ::c_int = 45;
1108 pub const PR_GET_FP_MODE: ::c_int = 46;
1109 pub const PR_FP_MODE_FR: ::c_int = 1 << 0;
1110 pub const PR_FP_MODE_FRE: ::c_int = 1 << 1;
1111
1112 pub const PR_CAP_AMBIENT: ::c_int = 47;
1113 pub const PR_CAP_AMBIENT_IS_SET: ::c_int = 1;
1114 pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2;
1115 pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3;
1116 pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4;
1117
1118 pub const GRND_NONBLOCK: ::c_uint = 0x0001;
1119 pub const GRND_RANDOM: ::c_uint = 0x0002;
1120
1121 pub const SECCOMP_MODE_DISABLED: ::c_uint = 0;
1122 pub const SECCOMP_MODE_STRICT: ::c_uint = 1;
1123 pub const SECCOMP_MODE_FILTER: ::c_uint = 2;
1124
1125 pub const ITIMER_REAL: ::c_int = 0;
1126 pub const ITIMER_VIRTUAL: ::c_int = 1;
1127 pub const ITIMER_PROF: ::c_int = 2;
1128
1129 pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC;
1130 pub const TFD_NONBLOCK: ::c_int = O_NONBLOCK;
1131 pub const TFD_TIMER_ABSTIME: ::c_int = 1;
1132
1133 pub const XATTR_CREATE: ::c_int = 0x1;
1134 pub const XATTR_REPLACE: ::c_int = 0x2;
1135
1136 pub const _POSIX_VDISABLE: ::cc_t = 0;
1137
1138 pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
1139 pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
1140 pub const FALLOC_FL_COLLAPSE_RANGE: ::c_int = 0x08;
1141 pub const FALLOC_FL_ZERO_RANGE: ::c_int = 0x10;
1142 pub const FALLOC_FL_INSERT_RANGE: ::c_int = 0x20;
1143 pub const FALLOC_FL_UNSHARE_RANGE: ::c_int = 0x40;
1144
1145 // On Linux, libc doesn't define this constant, libattr does instead.
1146 // We still define it for Linux as it's defined by libc on other platforms,
1147 // and it's mentioned in the man pages for getxattr and setxattr.
1148 pub const ENOATTR: ::c_int = ::ENODATA;
1149
1150 pub const SO_ORIGINAL_DST: ::c_int = 80;
1151 pub const IUTF8: ::tcflag_t = 0x00004000;
1152 pub const CMSPAR: ::tcflag_t = 0o10000000000;
1153
1154 pub const MFD_CLOEXEC: ::c_uint = 0x0001;
1155 pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
1156
1157 // these are used in the p_type field of Elf32_Phdr and Elf64_Phdr, which has
1158 // the type Elf32Word and Elf64Word respectively. Luckily, both of those are u32
1159 // so we can use that type here to avoid having to cast.
1160 pub const PT_NULL: u32 = 0;
1161 pub const PT_LOAD: u32 = 1;
1162 pub const PT_DYNAMIC: u32 = 2;
1163 pub const PT_INTERP: u32 = 3;
1164 pub const PT_NOTE: u32 = 4;
1165 pub const PT_SHLIB: u32 = 5;
1166 pub const PT_PHDR: u32 = 6;
1167 pub const PT_TLS: u32 = 7;
1168 pub const PT_NUM: u32 = 8;
1169 pub const PT_LOOS: u32 = 0x60000000;
1170 pub const PT_GNU_EH_FRAME: u32 = 0x6474e550;
1171 pub const PT_GNU_STACK: u32 = 0x6474e551;
1172 pub const PT_GNU_RELRO: u32 = 0x6474e552;
1173
1174 // linux/if_ether.h
1175 pub const ETH_ALEN: ::c_int = 6;
1176 pub const ETH_HLEN: ::c_int = 14;
1177 pub const ETH_ZLEN: ::c_int = 60;
1178 pub const ETH_DATA_LEN: ::c_int = 1500;
1179 pub const ETH_FRAME_LEN: ::c_int = 1514;
1180 pub const ETH_FCS_LEN: ::c_int = 4;
1181
1182 // These are the defined Ethernet Protocol ID's.
1183 pub const ETH_P_LOOP: ::c_int = 0x0060;
1184 pub const ETH_P_PUP: ::c_int = 0x0200;
1185 pub const ETH_P_PUPAT: ::c_int = 0x0201;
1186 pub const ETH_P_IP: ::c_int = 0x0800;
1187 pub const ETH_P_X25: ::c_int = 0x0805;
1188 pub const ETH_P_ARP: ::c_int = 0x0806;
1189 pub const ETH_P_BPQ: ::c_int = 0x08FF;
1190 pub const ETH_P_IEEEPUP: ::c_int = 0x0a00;
1191 pub const ETH_P_IEEEPUPAT: ::c_int = 0x0a01;
1192 pub const ETH_P_BATMAN: ::c_int = 0x4305;
1193 pub const ETH_P_DEC: ::c_int = 0x6000;
1194 pub const ETH_P_DNA_DL: ::c_int = 0x6001;
1195 pub const ETH_P_DNA_RC: ::c_int = 0x6002;
1196 pub const ETH_P_DNA_RT: ::c_int = 0x6003;
1197 pub const ETH_P_LAT: ::c_int = 0x6004;
1198 pub const ETH_P_DIAG: ::c_int = 0x6005;
1199 pub const ETH_P_CUST: ::c_int = 0x6006;
1200 pub const ETH_P_SCA: ::c_int = 0x6007;
1201 pub const ETH_P_TEB: ::c_int = 0x6558;
1202 pub const ETH_P_RARP: ::c_int = 0x8035;
1203 pub const ETH_P_ATALK: ::c_int = 0x809B;
1204 pub const ETH_P_AARP: ::c_int = 0x80F3;
1205 pub const ETH_P_8021Q: ::c_int = 0x8100;
1206 pub const ETH_P_IPX: ::c_int = 0x8137;
1207 pub const ETH_P_IPV6: ::c_int = 0x86DD;
1208 pub const ETH_P_PAUSE: ::c_int = 0x8808;
1209 pub const ETH_P_SLOW: ::c_int = 0x8809;
1210 pub const ETH_P_WCCP: ::c_int = 0x883E;
1211 pub const ETH_P_MPLS_UC: ::c_int = 0x8847;
1212 pub const ETH_P_MPLS_MC: ::c_int = 0x8848;
1213 pub const ETH_P_ATMMPOA: ::c_int = 0x884c;
1214 pub const ETH_P_PPP_DISC: ::c_int = 0x8863;
1215 pub const ETH_P_PPP_SES: ::c_int = 0x8864;
1216 pub const ETH_P_LINK_CTL: ::c_int = 0x886c;
1217 pub const ETH_P_ATMFATE: ::c_int = 0x8884;
1218 pub const ETH_P_PAE: ::c_int = 0x888E;
1219 pub const ETH_P_AOE: ::c_int = 0x88A2;
1220 pub const ETH_P_8021AD: ::c_int = 0x88A8;
1221 pub const ETH_P_802_EX1: ::c_int = 0x88B5;
1222 pub const ETH_P_TIPC: ::c_int = 0x88CA;
1223 pub const ETH_P_MACSEC: ::c_int = 0x88E5;
1224 pub const ETH_P_8021AH: ::c_int = 0x88E7;
1225 pub const ETH_P_MVRP: ::c_int = 0x88F5;
1226 pub const ETH_P_1588: ::c_int = 0x88F7;
1227 pub const ETH_P_PRP: ::c_int = 0x88FB;
1228 pub const ETH_P_FCOE: ::c_int = 0x8906;
1229 pub const ETH_P_TDLS: ::c_int = 0x890D;
1230 pub const ETH_P_FIP: ::c_int = 0x8914;
1231 pub const ETH_P_80221: ::c_int = 0x8917;
1232 pub const ETH_P_LOOPBACK: ::c_int = 0x9000;
1233 pub const ETH_P_QINQ1: ::c_int = 0x9100;
1234 pub const ETH_P_QINQ2: ::c_int = 0x9200;
1235 pub const ETH_P_QINQ3: ::c_int = 0x9300;
1236 pub const ETH_P_EDSA: ::c_int = 0xDADA;
1237 pub const ETH_P_AF_IUCV: ::c_int = 0xFBFB;
1238
1239 pub const ETH_P_802_3_MIN: ::c_int = 0x0600;
1240
1241 // Non DIX types. Won't clash for 1500 types.
1242 pub const ETH_P_802_3: ::c_int = 0x0001;
1243 pub const ETH_P_AX25: ::c_int = 0x0002;
1244 pub const ETH_P_ALL: ::c_int = 0x0003;
1245 pub const ETH_P_802_2: ::c_int = 0x0004;
1246 pub const ETH_P_SNAP: ::c_int = 0x0005;
1247 pub const ETH_P_DDCMP: ::c_int = 0x0006;
1248 pub const ETH_P_WAN_PPP: ::c_int = 0x0007;
1249 pub const ETH_P_PPP_MP: ::c_int = 0x0008;
1250 pub const ETH_P_LOCALTALK: ::c_int = 0x0009;
1251 pub const ETH_P_CANFD: ::c_int = 0x000D;
1252 pub const ETH_P_PPPTALK: ::c_int = 0x0010;
1253 pub const ETH_P_TR_802_2: ::c_int = 0x0011;
1254 pub const ETH_P_MOBITEX: ::c_int = 0x0015;
1255 pub const ETH_P_CONTROL: ::c_int = 0x0016;
1256 pub const ETH_P_IRDA: ::c_int = 0x0017;
1257 pub const ETH_P_ECONET: ::c_int = 0x0018;
1258 pub const ETH_P_HDLC: ::c_int = 0x0019;
1259 pub const ETH_P_ARCNET: ::c_int = 0x001A;
1260 pub const ETH_P_DSA: ::c_int = 0x001B;
1261 pub const ETH_P_TRAILER: ::c_int = 0x001C;
1262 pub const ETH_P_PHONET: ::c_int = 0x00F5;
1263 pub const ETH_P_IEEE802154: ::c_int = 0x00F6;
1264 pub const ETH_P_CAIF: ::c_int = 0x00F7;
1265
1266 pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
1267 pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
1268 pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x04;
1269 pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x08;
1270 pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x10;
1271 pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x20;
1272
1273 pub const NLMSG_NOOP: ::c_int = 0x1;
1274 pub const NLMSG_ERROR: ::c_int = 0x2;
1275 pub const NLMSG_DONE: ::c_int = 0x3;
1276 pub const NLMSG_OVERRUN: ::c_int = 0x4;
1277 pub const NLMSG_MIN_TYPE: ::c_int = 0x10;
1278
1279 pub const GENL_NAMSIZ: ::c_int = 16;
1280
1281 pub const GENL_MIN_ID: ::c_int = NLMSG_MIN_TYPE;
1282 pub const GENL_MAX_ID: ::c_int = 1023;
1283
1284 pub const GENL_ADMIN_PERM: ::c_int = 0x01;
1285 pub const GENL_CMD_CAP_DO: ::c_int = 0x02;
1286 pub const GENL_CMD_CAP_DUMP: ::c_int = 0x04;
1287 pub const GENL_CMD_CAP_HASPOL: ::c_int = 0x08;
1288
1289 pub const GENL_ID_CTRL: ::c_int = NLMSG_MIN_TYPE;
1290
1291 pub const CTRL_CMD_UNSPEC: ::c_int = 0;
1292 pub const CTRL_CMD_NEWFAMILY: ::c_int = 1;
1293 pub const CTRL_CMD_DELFAMILY: ::c_int = 2;
1294 pub const CTRL_CMD_GETFAMILY: ::c_int = 3;
1295 pub const CTRL_CMD_NEWOPS: ::c_int = 4;
1296 pub const CTRL_CMD_DELOPS: ::c_int = 5;
1297 pub const CTRL_CMD_GETOPS: ::c_int = 6;
1298 pub const CTRL_CMD_NEWMCAST_GRP: ::c_int = 7;
1299 pub const CTRL_CMD_DELMCAST_GRP: ::c_int = 8;
1300 pub const CTRL_CMD_GETMCAST_GRP: ::c_int = 9;
1301
1302 pub const CTRL_ATTR_UNSPEC: ::c_int = 0;
1303 pub const CTRL_ATTR_FAMILY_ID: ::c_int = 1;
1304 pub const CTRL_ATTR_FAMILY_NAME: ::c_int = 2;
1305 pub const CTRL_ATTR_VERSION: ::c_int = 3;
1306 pub const CTRL_ATTR_HDRSIZE: ::c_int = 4;
1307 pub const CTRL_ATTR_MAXATTR: ::c_int = 5;
1308 pub const CTRL_ATTR_OPS: ::c_int = 6;
1309 pub const CTRL_ATTR_MCAST_GROUPS: ::c_int = 7;
1310
1311 pub const CTRL_ATTR_OP_UNSPEC: ::c_int = 0;
1312 pub const CTRL_ATTR_OP_ID: ::c_int = 1;
1313 pub const CTRL_ATTR_OP_FLAGS: ::c_int = 2;
1314
1315 pub const CTRL_ATTR_MCAST_GRP_UNSPEC: ::c_int = 0;
1316 pub const CTRL_ATTR_MCAST_GRP_NAME: ::c_int = 1;
1317 pub const CTRL_ATTR_MCAST_GRP_ID: ::c_int = 2;
1318
1319 // linux/netfilter.h
1320 pub const NF_DROP: ::c_int = 0;
1321 pub const NF_ACCEPT: ::c_int = 1;
1322 pub const NF_STOLEN: ::c_int = 2;
1323 pub const NF_QUEUE: ::c_int = 3;
1324 pub const NF_REPEAT: ::c_int = 4;
1325 pub const NF_STOP: ::c_int = 5;
1326 pub const NF_MAX_VERDICT: ::c_int = NF_STOP;
1327
1328 pub const NF_VERDICT_MASK: ::c_int = 0x000000ff;
1329 pub const NF_VERDICT_FLAG_QUEUE_BYPASS: ::c_int = 0x00008000;
1330
1331 pub const NF_VERDICT_QMASK: ::c_int = 0xffff0000;
1332 pub const NF_VERDICT_QBITS: ::c_int = 16;
1333
1334 pub const NF_VERDICT_BITS: ::c_int = 16;
1335
1336 pub const NF_INET_PRE_ROUTING: ::c_int = 0;
1337 pub const NF_INET_LOCAL_IN: ::c_int = 1;
1338 pub const NF_INET_FORWARD: ::c_int = 2;
1339 pub const NF_INET_LOCAL_OUT: ::c_int = 3;
1340 pub const NF_INET_POST_ROUTING: ::c_int = 4;
1341 pub const NF_INET_NUMHOOKS: ::c_int = 5;
1342
1343 // Some NFPROTO are not compatible with musl and are defined in submodules.
1344 pub const NFPROTO_UNSPEC: ::c_int = 0;
1345 pub const NFPROTO_IPV4: ::c_int = 2;
1346 pub const NFPROTO_ARP: ::c_int = 3;
1347 pub const NFPROTO_BRIDGE: ::c_int = 7;
1348 pub const NFPROTO_IPV6: ::c_int = 10;
1349 pub const NFPROTO_DECNET: ::c_int = 12;
1350 pub const NFPROTO_NUMPROTO: ::c_int = 13;
1351
1352 // linux/netfilter_ipv4.h
1353 pub const NF_IP_PRE_ROUTING: ::c_int = 0;
1354 pub const NF_IP_LOCAL_IN: ::c_int = 1;
1355 pub const NF_IP_FORWARD: ::c_int = 2;
1356 pub const NF_IP_LOCAL_OUT: ::c_int = 3;
1357 pub const NF_IP_POST_ROUTING: ::c_int = 4;
1358 pub const NF_IP_NUMHOOKS: ::c_int = 5;
1359
1360 pub const NF_IP_PRI_FIRST: ::c_int = ::INT_MIN;
1361 pub const NF_IP_PRI_CONNTRACK_DEFRAG: ::c_int = -400;
1362 pub const NF_IP_PRI_RAW: ::c_int = -300;
1363 pub const NF_IP_PRI_SELINUX_FIRST: ::c_int = -225;
1364 pub const NF_IP_PRI_CONNTRACK: ::c_int = -200;
1365 pub const NF_IP_PRI_MANGLE: ::c_int = -150;
1366 pub const NF_IP_PRI_NAT_DST: ::c_int = -100;
1367 pub const NF_IP_PRI_FILTER: ::c_int = 0;
1368 pub const NF_IP_PRI_SECURITY: ::c_int = 50;
1369 pub const NF_IP_PRI_NAT_SRC: ::c_int = 100;
1370 pub const NF_IP_PRI_SELINUX_LAST: ::c_int = 225;
1371 pub const NF_IP_PRI_CONNTRACK_HELPER: ::c_int = 300;
1372 pub const NF_IP_PRI_CONNTRACK_CONFIRM: ::c_int = ::INT_MAX;
1373 pub const NF_IP_PRI_LAST: ::c_int = ::INT_MAX;
1374
1375 // linux/netfilter_ipv6.h
1376 pub const NF_IP6_PRE_ROUTING: ::c_int = 0;
1377 pub const NF_IP6_LOCAL_IN: ::c_int = 1;
1378 pub const NF_IP6_FORWARD: ::c_int = 2;
1379 pub const NF_IP6_LOCAL_OUT: ::c_int = 3;
1380 pub const NF_IP6_POST_ROUTING: ::c_int = 4;
1381 pub const NF_IP6_NUMHOOKS: ::c_int = 5;
1382
1383 pub const NF_IP6_PRI_FIRST: ::c_int = ::INT_MIN;
1384 pub const NF_IP6_PRI_CONNTRACK_DEFRAG: ::c_int = -400;
1385 pub const NF_IP6_PRI_RAW: ::c_int = -300;
1386 pub const NF_IP6_PRI_SELINUX_FIRST: ::c_int = -225;
1387 pub const NF_IP6_PRI_CONNTRACK: ::c_int = -200;
1388 pub const NF_IP6_PRI_MANGLE: ::c_int = -150;
1389 pub const NF_IP6_PRI_NAT_DST: ::c_int = -100;
1390 pub const NF_IP6_PRI_FILTER: ::c_int = 0;
1391 pub const NF_IP6_PRI_SECURITY: ::c_int = 50;
1392 pub const NF_IP6_PRI_NAT_SRC: ::c_int = 100;
1393 pub const NF_IP6_PRI_SELINUX_LAST: ::c_int = 225;
1394 pub const NF_IP6_PRI_CONNTRACK_HELPER: ::c_int = 300;
1395 pub const NF_IP6_PRI_LAST: ::c_int = ::INT_MAX;
1396
1397 f! {
1398 pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
1399 for slot in cpuset.bits.iter_mut() {
1400 *slot = 0;
1401 }
1402 }
1403
1404 pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
1405 let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
1406 let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
1407 cpuset.bits[idx] |= 1 << offset;
1408 ()
1409 }
1410
1411 pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
1412 let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
1413 let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
1414 cpuset.bits[idx] &= !(1 << offset);
1415 ()
1416 }
1417
1418 pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
1419 let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]);
1420 let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
1421 0 != (cpuset.bits[idx] & (1 << offset))
1422 }
1423
1424 pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
1425 set1.bits == set2.bits
1426 }
1427
1428 pub fn major(dev: ::dev_t) -> ::c_uint {
1429 let mut major = 0;
1430 major |= (dev & 0x00000000000fff00) >> 8;
1431 major |= (dev & 0xfffff00000000000) >> 32;
1432 major as ::c_uint
1433 }
1434
1435 pub fn minor(dev: ::dev_t) -> ::c_uint {
1436 let mut minor = 0;
1437 minor |= (dev & 0x00000000000000ff) >> 0;
1438 minor |= (dev & 0x00000ffffff00000) >> 12;
1439 minor as ::c_uint
1440 }
1441
1442 pub fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
1443 let major = major as ::dev_t;
1444 let minor = minor as ::dev_t;
1445 let mut dev = 0;
1446 dev |= (major & 0x00000fff) << 8;
1447 dev |= (major & 0xfffff000) << 32;
1448 dev |= (minor & 0x000000ff) << 0;
1449 dev |= (minor & 0xffffff00) << 12;
1450 dev
1451 }
1452 }
1453
1454 extern {
1455 pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
1456 pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
1457 pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
1458 pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
1459 pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
1460 pub fn aio_suspend(aiocb_list: *const *const aiocb, nitems: ::c_int,
1461 timeout: *const ::timespec) -> ::c_int;
1462 pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
1463 pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb,
1464 nitems: ::c_int, sevp: *mut ::sigevent) -> ::c_int;
1465
1466 pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
1467
1468 pub fn setpwent();
1469 pub fn endpwent();
1470 pub fn getpwent() -> *mut passwd;
1471 pub fn setgrent();
1472 pub fn endgrent();
1473 pub fn getgrent() -> *mut ::group;
1474 pub fn setspent();
1475 pub fn endspent();
1476 pub fn getspent() -> *mut spwd;
1477
1478 pub fn getspnam(__name: *const ::c_char) -> *mut spwd;
1479
1480 pub fn shm_open(name: *const c_char, oflag: ::c_int,
1481 mode: mode_t) -> ::c_int;
1482
1483 // System V IPC
1484 pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
1485 pub fn shmat(shmid: ::c_int,
1486 shmaddr: *const ::c_void,
1487 shmflg: ::c_int) -> *mut ::c_void;
1488 pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
1489 pub fn shmctl(shmid: ::c_int,
1490 cmd: ::c_int,
1491 buf: *mut ::shmid_ds) -> ::c_int;
1492 pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
1493 pub fn semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int;
1494 pub fn semop(semid: ::c_int,
1495 sops: *mut ::sembuf, nsops: ::size_t) -> ::c_int;
1496 pub fn semctl(semid: ::c_int,
1497 semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
1498 pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
1499 pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
1500 pub fn msgrcv(msqid: ::c_int, msgp: *mut ::c_void, msgsz: ::size_t,
1501 msgtyp: ::c_long, msgflg: ::c_int) -> ::ssize_t;
1502 pub fn msgsnd(msqid: ::c_int, msgp: *const ::c_void, msgsz: ::size_t,
1503 msgflg: ::c_int) -> ::c_int;
1504
1505 pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
1506 -> ::c_int;
1507 pub fn __errno_location() -> *mut ::c_int;
1508
1509 pub fn fopen64(filename: *const c_char,
1510 mode: *const c_char) -> *mut ::FILE;
1511 pub fn freopen64(filename: *const c_char, mode: *const c_char,
1512 file: *mut ::FILE) -> *mut ::FILE;
1513 pub fn tmpfile64() -> *mut ::FILE;
1514 pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int;
1515 pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int;
1516 pub fn fseeko64(stream: *mut ::FILE,
1517 offset: ::off64_t,
1518 whence: ::c_int) -> ::c_int;
1519 pub fn ftello64(stream: *mut ::FILE) -> ::off64_t;
1520 pub fn fallocate(fd: ::c_int, mode: ::c_int,
1521 offset: ::off_t, len: ::off_t) -> ::c_int;
1522 pub fn posix_fallocate(fd: ::c_int, offset: ::off_t,
1523 len: ::off_t) -> ::c_int;
1524 pub fn readahead(fd: ::c_int, offset: ::off64_t,
1525 count: ::size_t) -> ::ssize_t;
1526 pub fn getxattr(path: *const c_char, name: *const c_char,
1527 value: *mut ::c_void, size: ::size_t) -> ::ssize_t;
1528 pub fn lgetxattr(path: *const c_char, name: *const c_char,
1529 value: *mut ::c_void, size: ::size_t) -> ::ssize_t;
1530 pub fn fgetxattr(filedes: ::c_int, name: *const c_char,
1531 value: *mut ::c_void, size: ::size_t) -> ::ssize_t;
1532 pub fn setxattr(path: *const c_char, name: *const c_char,
1533 value: *const ::c_void, size: ::size_t,
1534 flags: ::c_int) -> ::c_int;
1535 pub fn lsetxattr(path: *const c_char, name: *const c_char,
1536 value: *const ::c_void, size: ::size_t,
1537 flags: ::c_int) -> ::c_int;
1538 pub fn fsetxattr(filedes: ::c_int, name: *const c_char,
1539 value: *const ::c_void, size: ::size_t,
1540 flags: ::c_int) -> ::c_int;
1541 pub fn listxattr(path: *const c_char, list: *mut c_char,
1542 size: ::size_t) -> ::ssize_t;
1543 pub fn llistxattr(path: *const c_char, list: *mut c_char,
1544 size: ::size_t) -> ::ssize_t;
1545 pub fn flistxattr(filedes: ::c_int, list: *mut c_char,
1546 size: ::size_t) -> ::ssize_t;
1547 pub fn removexattr(path: *const c_char, name: *const c_char) -> ::c_int;
1548 pub fn lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int;
1549 pub fn fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int;
1550 pub fn signalfd(fd: ::c_int,
1551 mask: *const ::sigset_t,
1552 flags: ::c_int) -> ::c_int;
1553 pub fn timerfd_create(clockid: ::c_int, flags: ::c_int) -> ::c_int;
1554 pub fn timerfd_gettime(fd: ::c_int,
1555 curr_value: *mut itimerspec) -> ::c_int;
1556 pub fn timerfd_settime(fd: ::c_int,
1557 flags: ::c_int,
1558 new_value: *const itimerspec,
1559 old_value: *mut itimerspec) -> ::c_int;
1560 pub fn pwritev(fd: ::c_int,
1561 iov: *const ::iovec,
1562 iovcnt: ::c_int,
1563 offset: ::off_t) -> ::ssize_t;
1564 pub fn preadv(fd: ::c_int,
1565 iov: *const ::iovec,
1566 iovcnt: ::c_int,
1567 offset: ::off_t) -> ::ssize_t;
1568 pub fn quotactl(cmd: ::c_int,
1569 special: *const ::c_char,
1570 id: ::c_int,
1571 data: *mut ::c_char) -> ::c_int;
1572 pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
1573 pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
1574 pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
1575 pub fn mq_receive(mqd: ::mqd_t,
1576 msg_ptr: *mut ::c_char,
1577 msg_len: ::size_t,
1578 msq_prio: *mut ::c_uint) -> ::ssize_t;
1579 pub fn mq_send(mqd: ::mqd_t,
1580 msg_ptr: *const ::c_char,
1581 msg_len: ::size_t,
1582 msq_prio: ::c_uint) -> ::c_int;
1583 pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
1584 pub fn mq_setattr(mqd: ::mqd_t,
1585 newattr: *const ::mq_attr,
1586 oldattr: *mut ::mq_attr) -> ::c_int;
1587 pub fn epoll_pwait(epfd: ::c_int,
1588 events: *mut ::epoll_event,
1589 maxevents: ::c_int,
1590 timeout: ::c_int,
1591 sigmask: *const ::sigset_t) -> ::c_int;
1592 pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int;
1593 pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
1594 pub fn mkostemps(template: *mut ::c_char,
1595 suffixlen: ::c_int,
1596 flags: ::c_int) -> ::c_int;
1597 pub fn sigtimedwait(set: *const sigset_t,
1598 info: *mut siginfo_t,
1599 timeout: *const ::timespec) -> ::c_int;
1600 pub fn sigwaitinfo(set: *const sigset_t,
1601 info: *mut siginfo_t) -> ::c_int;
1602 pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
1603 pub fn getnameinfo(sa: *const ::sockaddr,
1604 salen: ::socklen_t,
1605 host: *mut ::c_char,
1606 hostlen: ::socklen_t,
1607 serv: *mut ::c_char,
1608 sevlen: ::socklen_t,
1609 flags: ::c_int) -> ::c_int;
1610 pub fn pthread_setschedprio(native: ::pthread_t,
1611 priority: ::c_int) -> ::c_int;
1612 pub fn prlimit(pid: ::pid_t, resource: ::c_int, new_limit: *const ::rlimit,
1613 old_limit: *mut ::rlimit) -> ::c_int;
1614 pub fn prlimit64(pid: ::pid_t,
1615 resource: ::c_int,
1616 new_limit: *const ::rlimit64,
1617 old_limit: *mut ::rlimit64) -> ::c_int;
1618 pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
1619 pub fn process_vm_readv(pid: ::pid_t,
1620 local_iov: *const ::iovec,
1621 liovcnt: ::c_ulong,
1622 remote_iov: *const ::iovec,
1623 riovcnt: ::c_ulong,
1624 flags: ::c_ulong) -> isize;
1625 pub fn process_vm_writev(pid: ::pid_t,
1626 local_iov: *const ::iovec,
1627 liovcnt: ::c_ulong,
1628 remote_iov: *const ::iovec,
1629 riovcnt: ::c_ulong,
1630 flags: ::c_ulong) -> isize;
1631 pub fn reboot(how_to: ::c_int) -> ::c_int;
1632 pub fn setfsgid(gid: ::gid_t) -> ::c_int;
1633 pub fn setfsuid(uid: ::uid_t) -> ::c_int;
1634
1635 // Not available now on Android
1636 pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
1637 mode: ::mode_t) -> ::c_int;
1638 pub fn if_nameindex() -> *mut if_nameindex;
1639 pub fn if_freenameindex(ptr: *mut if_nameindex);
1640 pub fn sync_file_range(fd: ::c_int, offset: ::off64_t,
1641 nbytes: ::off64_t, flags: ::c_uint) -> ::c_int;
1642 pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
1643 pub fn freeifaddrs(ifa: *mut ::ifaddrs);
1644 pub fn mremap(addr: *mut ::c_void,
1645 len: ::size_t,
1646 new_len: ::size_t,
1647 flags: ::c_int,
1648 ...) -> *mut ::c_void;
1649
1650 pub fn glob(pattern: *const c_char,
1651 flags: ::c_int,
1652 errfunc: Option<extern fn(epath: *const c_char,
1653 errno: ::c_int) -> ::c_int>,
1654 pglob: *mut ::glob_t) -> ::c_int;
1655 pub fn globfree(pglob: *mut ::glob_t);
1656
1657 pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
1658 -> ::c_int;
1659
1660 pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
1661
1662 pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
1663
1664 pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
1665 pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
1666 -> ::c_int;
1667
1668 pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
1669 pub fn remap_file_pages(addr: *mut ::c_void, size: ::size_t, prot: ::c_int,
1670 pgoff: ::size_t, flags: ::c_int) -> ::c_int;
1671 pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t,
1672 flags: ::c_int, addr: *mut ::sockaddr,
1673 addrlen: *mut ::socklen_t) -> ::ssize_t;
1674 pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
1675 pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
1676 pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
1677
1678 pub fn bind(socket: ::c_int, address: *const ::sockaddr,
1679 address_len: ::socklen_t) -> ::c_int;
1680
1681 pub fn writev(fd: ::c_int,
1682 iov: *const ::iovec,
1683 iovcnt: ::c_int) -> ::ssize_t;
1684 pub fn readv(fd: ::c_int,
1685 iov: *const ::iovec,
1686 iovcnt: ::c_int) -> ::ssize_t;
1687
1688 pub fn sendmsg(fd: ::c_int,
1689 msg: *const ::msghdr,
1690 flags: ::c_int) -> ::ssize_t;
1691 pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
1692 -> ::ssize_t;
1693 pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
1694 pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
1695 pub fn vhangup() -> ::c_int;
1696 pub fn sendmmsg(sockfd: ::c_int, msgvec: *mut mmsghdr, vlen: ::c_uint,
1697 flags: ::c_int) -> ::c_int;
1698 pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut mmsghdr, vlen: ::c_uint,
1699 flags: ::c_int, timeout: *mut ::timespec) -> ::c_int;
1700 pub fn sync();
1701 pub fn syscall(num: ::c_long, ...) -> ::c_long;
1702 pub fn sched_getaffinity(pid: ::pid_t,
1703 cpusetsize: ::size_t,
1704 cpuset: *mut cpu_set_t) -> ::c_int;
1705 pub fn sched_setaffinity(pid: ::pid_t,
1706 cpusetsize: ::size_t,
1707 cpuset: *const cpu_set_t) -> ::c_int;
1708 pub fn epoll_create(size: ::c_int) -> ::c_int;
1709 pub fn epoll_create1(flags: ::c_int) -> ::c_int;
1710 pub fn epoll_wait(epfd: ::c_int,
1711 events: *mut ::epoll_event,
1712 maxevents: ::c_int,
1713 timeout: ::c_int) -> ::c_int;
1714 pub fn epoll_ctl(epfd: ::c_int,
1715 op: ::c_int,
1716 fd: ::c_int,
1717 event: *mut ::epoll_event) -> ::c_int;
1718 pub fn pthread_getschedparam(native: ::pthread_t,
1719 policy: *mut ::c_int,
1720 param: *mut ::sched_param) -> ::c_int;
1721 pub fn unshare(flags: ::c_int) -> ::c_int;
1722 pub fn umount(target: *const ::c_char) -> ::c_int;
1723 pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
1724 pub fn tee(fd_in: ::c_int,
1725 fd_out: ::c_int,
1726 len: ::size_t,
1727 flags: ::c_uint) -> ::ssize_t;
1728 pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
1729 pub fn splice(fd_in: ::c_int,
1730 off_in: *mut ::loff_t,
1731 fd_out: ::c_int,
1732 off_out: *mut ::loff_t,
1733 len: ::size_t,
1734 flags: ::c_uint) -> ::ssize_t;
1735 pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
1736 pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
1737 pub fn sem_timedwait(sem: *mut sem_t,
1738 abstime: *const ::timespec) -> ::c_int;
1739 pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
1740 pub fn setns(fd: ::c_int, nstype: ::c_int) -> ::c_int;
1741 pub fn swapoff(puath: *const ::c_char) -> ::c_int;
1742 pub fn vmsplice(fd: ::c_int,
1743 iov: *const ::iovec,
1744 nr_segs: ::size_t,
1745 flags: ::c_uint) -> ::ssize_t;
1746 pub fn mount(src: *const ::c_char,
1747 target: *const ::c_char,
1748 fstype: *const ::c_char,
1749 flags: ::c_ulong,
1750 data: *const ::c_void) -> ::c_int;
1751 pub fn personality(persona: ::c_ulong) -> ::c_int;
1752 pub fn prctl(option: ::c_int, ...) -> ::c_int;
1753 pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int;
1754 pub fn ppoll(fds: *mut ::pollfd,
1755 nfds: nfds_t,
1756 timeout: *const ::timespec,
1757 sigmask: *const sigset_t) -> ::c_int;
1758 pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t,
1759 abstime: *const ::timespec) -> ::c_int;
1760 pub fn clone(cb: extern fn(*mut ::c_void) -> ::c_int,
1761 child_stack: *mut ::c_void,
1762 flags: ::c_int,
1763 arg: *mut ::c_void, ...) -> ::c_int;
1764 pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
1765 pub fn clock_nanosleep(clk_id: ::clockid_t,
1766 flags: ::c_int,
1767 rqtp: *const ::timespec,
1768 rmtp: *mut ::timespec) -> ::c_int;
1769 pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t,
1770 guardsize: *mut ::size_t) -> ::c_int;
1771 pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
1772 pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
1773 pub fn pthread_condattr_getpshared(attr: *const pthread_condattr_t,
1774 pshared: *mut ::c_int) -> ::c_int;
1775 pub fn sysinfo(info: *mut ::sysinfo) -> ::c_int;
1776 pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int;
1777 pub fn pthread_setschedparam(native: ::pthread_t,
1778 policy: ::c_int,
1779 param: *const ::sched_param) -> ::c_int;
1780 pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int;
1781 pub fn sched_setscheduler(pid: ::pid_t,
1782 policy: ::c_int,
1783 param: *const ::sched_param) -> ::c_int;
1784 pub fn sendfile(out_fd: ::c_int,
1785 in_fd: ::c_int,
1786 offset: *mut off_t,
1787 count: ::size_t) -> ::ssize_t;
1788 pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
1789 #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrgid_r")]
1790 pub fn getgrgid_r(uid: ::uid_t,
1791 grp: *mut ::group,
1792 buf: *mut ::c_char,
1793 buflen: ::size_t,
1794 result: *mut *mut ::group) -> ::c_int;
1795 #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1796 link_name = "sigaltstack$UNIX2003")]
1797 #[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")]
1798 pub fn sigaltstack(ss: *const stack_t,
1799 oss: *mut stack_t) -> ::c_int;
1800 pub fn sem_close(sem: *mut sem_t) -> ::c_int;
1801 pub fn getdtablesize() -> ::c_int;
1802 #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrnam_r")]
1803 pub fn getgrnam_r(name: *const ::c_char,
1804 grp: *mut ::group,
1805 buf: *mut ::c_char,
1806 buflen: ::size_t,
1807 result: *mut *mut ::group) -> ::c_int;
1808 pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
1809 #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1810 link_name = "pthread_sigmask$UNIX2003")]
1811 pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t,
1812 oldset: *mut sigset_t) -> ::c_int;
1813 pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
1814 pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
1815 pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
1816 pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
1817 pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
1818 pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
1819 #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")]
1820 #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwnam_r")]
1821 pub fn getpwnam_r(name: *const ::c_char,
1822 pwd: *mut passwd,
1823 buf: *mut ::c_char,
1824 buflen: ::size_t,
1825 result: *mut *mut passwd) -> ::c_int;
1826 #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")]
1827 #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwuid_r")]
1828 pub fn getpwuid_r(uid: ::uid_t,
1829 pwd: *mut passwd,
1830 buf: *mut ::c_char,
1831 buflen: ::size_t,
1832 result: *mut *mut passwd) -> ::c_int;
1833 #[cfg_attr(all(target_os = "macos", target_arch ="x86"),
1834 link_name = "sigwait$UNIX2003")]
1835 #[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")]
1836 pub fn sigwait(set: *const sigset_t,
1837 sig: *mut ::c_int) -> ::c_int;
1838 pub fn pthread_atfork(prepare: Option<unsafe extern fn()>,
1839 parent: Option<unsafe extern fn()>,
1840 child: Option<unsafe extern fn()>) -> ::c_int;
1841 pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
1842 pub fn getgrouplist(user: *const ::c_char,
1843 group: ::gid_t,
1844 groups: *mut ::gid_t,
1845 ngroups: *mut ::c_int) -> ::c_int;
1846 pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t,
1847 pshared: *mut ::c_int) -> ::c_int;
1848 #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1849 link_name = "popen$UNIX2003")]
1850 pub fn popen(command: *const c_char,
1851 mode: *const c_char) -> *mut ::FILE;
1852 pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char,
1853 mode: ::c_int, flags: ::c_int) -> ::c_int;
1854 pub fn pthread_create(native: *mut ::pthread_t,
1855 attr: *const ::pthread_attr_t,
1856 f: extern fn(*mut ::c_void) -> *mut ::c_void,
1857 value: *mut ::c_void) -> ::c_int;
1858 pub fn dl_iterate_phdr(
1859 callback: Option<unsafe extern fn(
1860 info: *mut ::dl_phdr_info,
1861 size: ::size_t,
1862 data: *mut ::c_void
1863 ) -> ::c_int>,
1864 data: *mut ::c_void
1865 ) -> ::c_int;
1866
1867 pub fn setmntent(filename: *const ::c_char,
1868 ty: *const ::c_char) -> *mut ::FILE;
1869 pub fn getmntent(stream: *mut ::FILE) -> *mut ::mntent;
1870 pub fn addmntent(stream: *mut ::FILE, mnt: *const ::mntent) -> ::c_int;
1871 pub fn endmntent(streamp: *mut ::FILE) -> ::c_int;
1872 pub fn hasmntopt(mnt: *const ::mntent,
1873 opt: *const ::c_char) -> *mut ::c_char;
1874
1875 pub fn posix_spawn(pid: *mut ::pid_t,
1876 path: *const ::c_char,
1877 file_actions: *const ::posix_spawn_file_actions_t,
1878 attrp: *const ::posix_spawnattr_t,
1879 argv: *const *mut ::c_char,
1880 envp: *const *mut ::c_char) -> ::c_int;
1881 pub fn posix_spawnp(pid: *mut ::pid_t,
1882 file: *const ::c_char,
1883 file_actions: *const ::posix_spawn_file_actions_t,
1884 attrp: *const ::posix_spawnattr_t,
1885 argv: *const *mut ::c_char,
1886 envp: *const *mut ::c_char) -> ::c_int;
1887 pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
1888 pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
1889 pub fn posix_spawnattr_getsigdefault(attr: *const posix_spawnattr_t,
1890 default: *mut ::sigset_t) -> ::c_int;
1891 pub fn posix_spawnattr_setsigdefault(attr: *mut posix_spawnattr_t,
1892 default: *const ::sigset_t) -> ::c_int;
1893 pub fn posix_spawnattr_getsigmask(attr: *const posix_spawnattr_t,
1894 default: *mut ::sigset_t) -> ::c_int;
1895 pub fn posix_spawnattr_setsigmask(attr: *mut posix_spawnattr_t,
1896 default: *const ::sigset_t) -> ::c_int;
1897 pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t,
1898 flags: *mut ::c_short) -> ::c_int;
1899 pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t,
1900 flags: ::c_short) -> ::c_int;
1901 pub fn posix_spawnattr_getpgroup(attr: *const posix_spawnattr_t,
1902 flags: *mut ::pid_t) -> ::c_int;
1903 pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t,
1904 flags: ::pid_t) -> ::c_int;
1905 pub fn posix_spawnattr_getschedpolicy(attr: *const posix_spawnattr_t,
1906 flags: *mut ::c_int) -> ::c_int;
1907 pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t,
1908 flags: ::c_int) -> ::c_int;
1909 pub fn posix_spawnattr_getschedparam(
1910 attr: *const posix_spawnattr_t,
1911 param: *mut ::sched_param,
1912 ) -> ::c_int;
1913 pub fn posix_spawnattr_setschedparam(
1914 attr: *mut posix_spawnattr_t,
1915 param: *const ::sched_param,
1916 ) -> ::c_int;
1917
1918 pub fn posix_spawn_file_actions_init(
1919 actions: *mut posix_spawn_file_actions_t,
1920 ) -> ::c_int;
1921 pub fn posix_spawn_file_actions_destroy(
1922 actions: *mut posix_spawn_file_actions_t,
1923 ) -> ::c_int;
1924 pub fn posix_spawn_file_actions_addopen(
1925 actions: *mut posix_spawn_file_actions_t,
1926 fd: ::c_int,
1927 path: *const ::c_char,
1928 oflag: ::c_int,
1929 mode: ::mode_t,
1930 ) -> ::c_int;
1931 pub fn posix_spawn_file_actions_addclose(
1932 actions: *mut posix_spawn_file_actions_t,
1933 fd: ::c_int,
1934 ) -> ::c_int;
1935 pub fn posix_spawn_file_actions_adddup2(
1936 actions: *mut posix_spawn_file_actions_t,
1937 fd: ::c_int,
1938 newfd: ::c_int,
1939 ) -> ::c_int;
1940 }
1941
1942 cfg_if! {
1943 if #[cfg(any(target_env = "musl", target_os = "fuchsia"))] {
1944 mod musl;
1945 pub use self::musl::*;
1946 } else if #[cfg(any(target_arch = "mips",
1947 target_arch = "mips64"))] {
1948 mod mips;
1949 pub use self::mips::*;
1950 } else if #[cfg(any(target_arch = "s390x"))] {
1951 mod s390x;
1952 pub use self::s390x::*;
1953 } else {
1954 mod other;
1955 pub use self::other::*;
1956 }
1957 }