1 pub type pthread_t = c_ulong;
2 pub type __priority_which_t = ::c_uint;
3 pub type __rlimit_resource_t = ::c_uint;
4 pub type Lmid_t = ::c_long;
5 pub type regoff_t = ::c_int;
6 
7 s! {
8     pub struct statx {
9         pub stx_mask: u32,
10         pub stx_blksize: u32,
11         pub stx_attributes: u64,
12         pub stx_nlink: u32,
13         pub stx_uid: u32,
14         pub stx_gid: u32,
15         pub stx_mode: u16,
16         __statx_pad1: [u16; 1],
17         pub stx_ino: u64,
18         pub stx_size: u64,
19         pub stx_blocks: u64,
20         pub stx_attributes_mask: u64,
21         pub stx_atime: ::statx_timestamp,
22         pub stx_btime: ::statx_timestamp,
23         pub stx_ctime: ::statx_timestamp,
24         pub stx_mtime: ::statx_timestamp,
25         pub stx_rdev_major: u32,
26         pub stx_rdev_minor: u32,
27         pub stx_dev_major: u32,
28         pub stx_dev_minor: u32,
29         pub stx_mnt_id: u64,
30         __statx_pad2: u64,
31         __statx_pad3: [u64; 12],
32     }
33 
34     pub struct statx_timestamp {
35         pub tv_sec: i64,
36         pub tv_nsec: u32,
37         pub __statx_timestamp_pad1: [i32; 1],
38     }
39 
40     pub struct aiocb {
41         pub aio_fildes: ::c_int,
42         pub aio_lio_opcode: ::c_int,
43         pub aio_reqprio: ::c_int,
44         pub aio_buf: *mut ::c_void,
45         pub aio_nbytes: ::size_t,
46         pub aio_sigevent: ::sigevent,
47         __next_prio: *mut aiocb,
48         __abs_prio: ::c_int,
49         __policy: ::c_int,
50         __error_code: ::c_int,
51         __return_value: ::ssize_t,
52         pub aio_offset: off_t,
53         #[cfg(all(not(target_arch = "x86_64"), target_pointer_width = "32"))]
54         __unused1: [::c_char; 4],
55         __glibc_reserved: [::c_char; 32]
56     }
57 
58     pub struct __exit_status {
59         pub e_termination: ::c_short,
60         pub e_exit: ::c_short,
61     }
62 
63     pub struct __timeval {
64         pub tv_sec: i32,
65         pub tv_usec: i32,
66     }
67 
68     pub struct glob64_t {
69         pub gl_pathc: ::size_t,
70         pub gl_pathv: *mut *mut ::c_char,
71         pub gl_offs: ::size_t,
72         pub gl_flags: ::c_int,
73 
74         __unused1: *mut ::c_void,
75         __unused2: *mut ::c_void,
76         __unused3: *mut ::c_void,
77         __unused4: *mut ::c_void,
78         __unused5: *mut ::c_void,
79     }
80 
81     pub struct msghdr {
82         pub msg_name: *mut ::c_void,
83         pub msg_namelen: ::socklen_t,
84         pub msg_iov: *mut ::iovec,
85         pub msg_iovlen: ::size_t,
86         pub msg_control: *mut ::c_void,
87         pub msg_controllen: ::size_t,
88         pub msg_flags: ::c_int,
89     }
90 
91     pub struct cmsghdr {
92         pub cmsg_len: ::size_t,
93         pub cmsg_level: ::c_int,
94         pub cmsg_type: ::c_int,
95     }
96 
97     pub struct termios {
98         pub c_iflag: ::tcflag_t,
99         pub c_oflag: ::tcflag_t,
100         pub c_cflag: ::tcflag_t,
101         pub c_lflag: ::tcflag_t,
102         pub c_line: ::cc_t,
103         pub c_cc: [::cc_t; ::NCCS],
104         #[cfg(not(any(
105             target_arch = "sparc",
106             target_arch = "sparc64",
107             target_arch = "mips",
108             target_arch = "mips64")))]
109         pub c_ispeed: ::speed_t,
110         #[cfg(not(any(
111             target_arch = "sparc",
112             target_arch = "sparc64",
113             target_arch = "mips",
114             target_arch = "mips64")))]
115         pub c_ospeed: ::speed_t,
116     }
117 
118     pub struct mallinfo {
119         pub arena: ::c_int,
120         pub ordblks: ::c_int,
121         pub smblks: ::c_int,
122         pub hblks: ::c_int,
123         pub hblkhd: ::c_int,
124         pub usmblks: ::c_int,
125         pub fsmblks: ::c_int,
126         pub uordblks: ::c_int,
127         pub fordblks: ::c_int,
128         pub keepcost: ::c_int,
129     }
130 
131     pub struct nlmsghdr {
132         pub nlmsg_len: u32,
133         pub nlmsg_type: u16,
134         pub nlmsg_flags: u16,
135         pub nlmsg_seq: u32,
136         pub nlmsg_pid: u32,
137     }
138 
139     pub struct nlmsgerr {
140         pub error: ::c_int,
141         pub msg: nlmsghdr,
142     }
143 
144     pub struct nl_pktinfo {
145         pub group: u32,
146     }
147 
148     pub struct nl_mmap_req {
149         pub nm_block_size: ::c_uint,
150         pub nm_block_nr: ::c_uint,
151         pub nm_frame_size: ::c_uint,
152         pub nm_frame_nr: ::c_uint,
153     }
154 
155     pub struct nl_mmap_hdr {
156         pub nm_status: ::c_uint,
157         pub nm_len: ::c_uint,
158         pub nm_group: u32,
159         pub nm_pid: u32,
160         pub nm_uid: u32,
161         pub nm_gid: u32,
162     }
163 
164     pub struct nlattr {
165         pub nla_len: u16,
166         pub nla_type: u16,
167     }
168 
169     pub struct rtentry {
170         pub rt_pad1: ::c_ulong,
171         pub rt_dst: ::sockaddr,
172         pub rt_gateway: ::sockaddr,
173         pub rt_genmask: ::sockaddr,
174         pub rt_flags: ::c_ushort,
175         pub rt_pad2: ::c_short,
176         pub rt_pad3: ::c_ulong,
177         pub rt_tos: ::c_uchar,
178         pub rt_class: ::c_uchar,
179         #[cfg(target_pointer_width = "64")]
180         pub rt_pad4: [::c_short; 3usize],
181         #[cfg(not(target_pointer_width = "64"))]
182         pub rt_pad4: ::c_short,
183         pub rt_metric: ::c_short,
184         pub rt_dev: *mut ::c_char,
185         pub rt_mtu: ::c_ulong,
186         pub rt_window: ::c_ulong,
187         pub rt_irtt: ::c_ushort,
188     }
189 
190     pub struct timex {
191         pub modes: ::c_uint,
192         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
193         pub offset: i64,
194         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
195         pub offset: ::c_long,
196         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
197         pub freq: i64,
198         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
199         pub freq: ::c_long,
200         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
201         pub maxerror: i64,
202         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
203         pub maxerror: ::c_long,
204         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
205         pub esterror: i64,
206         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
207         pub esterror: ::c_long,
208         pub status: ::c_int,
209         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
210         pub constant: i64,
211         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
212         pub constant: ::c_long,
213         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
214         pub precision: i64,
215         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
216         pub precision: ::c_long,
217         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
218         pub tolerance: i64,
219         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
220         pub tolerance: ::c_long,
221         pub time: ::timeval,
222         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
223         pub tick: i64,
224         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
225         pub tick: ::c_long,
226         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
227         pub ppsfreq: i64,
228         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
229         pub ppsfreq: ::c_long,
230         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
231         pub jitter: i64,
232         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
233         pub jitter: ::c_long,
234         pub shift: ::c_int,
235         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
236         pub stabil: i64,
237         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
238         pub stabil: ::c_long,
239         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
240         pub jitcnt: i64,
241         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
242         pub jitcnt: ::c_long,
243         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
244         pub calcnt: i64,
245         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
246         pub calcnt: ::c_long,
247         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
248         pub errcnt: i64,
249         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
250         pub errcnt: ::c_long,
251         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
252         pub stbcnt: i64,
253         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
254         pub stbcnt: ::c_long,
255         pub tai: ::c_int,
256         pub __unused1: i32,
257         pub __unused2: i32,
258         pub __unused3: i32,
259         pub __unused4: i32,
260         pub __unused5: i32,
261         pub __unused6: i32,
262         pub __unused7: i32,
263         pub __unused8: i32,
264         pub __unused9: i32,
265         pub __unused10: i32,
266         pub __unused11: i32,
267     }
268 
269     pub struct ntptimeval {
270         pub time: ::timeval,
271         pub maxerror: ::c_long,
272         pub esterror: ::c_long,
273         pub tai: ::c_long,
274         pub __glibc_reserved1: ::c_long,
275         pub __glibc_reserved2: ::c_long,
276         pub __glibc_reserved3: ::c_long,
277         pub __glibc_reserved4: ::c_long,
278     }
279 
280     pub struct regex_t {
281         __buffer: *mut ::c_void,
282         __allocated: ::size_t,
283         __used: ::size_t,
284         __syntax: ::c_ulong,
285         __fastmap: *mut ::c_char,
286         __translate: *mut ::c_char,
287         __re_nsub: ::size_t,
288         __bitfield: u8,
289     }
290 }
291 
292 impl siginfo_t {
293     pub unsafe fn si_addr(&self) -> *mut ::c_void {
294         #[repr(C)]
295         struct siginfo_sigfault {
296             _si_signo: ::c_int,
297             _si_errno: ::c_int,
298             _si_code: ::c_int,
299             si_addr: *mut ::c_void,
300         }
301         (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr
302     }
303 
304     pub unsafe fn si_value(&self) -> ::sigval {
305         #[repr(C)]
306         struct siginfo_timer {
307             _si_signo: ::c_int,
308             _si_errno: ::c_int,
309             _si_code: ::c_int,
310             _si_tid: ::c_int,
311             _si_overrun: ::c_int,
312             si_sigval: ::sigval,
313         }
314         (*(self as *const siginfo_t as *const siginfo_timer)).si_sigval
315     }
316 }
317 
318 cfg_if! {
319     if #[cfg(libc_union)] {
320         // Internal, for casts to access union fields
321         #[repr(C)]
322         struct sifields_sigchld {
323             si_pid: ::pid_t,
324             si_uid: ::uid_t,
325             si_status: ::c_int,
326             si_utime: ::c_long,
327             si_stime: ::c_long,
328         }
329         impl ::Copy for sifields_sigchld {}
330         impl ::Clone for sifields_sigchld {
331             fn clone(&self) -> sifields_sigchld {
332                 *self
333             }
334         }
335 
336         // Internal, for casts to access union fields
337         #[repr(C)]
338         union sifields {
339             _align_pointer: *mut ::c_void,
340             sigchld: sifields_sigchld,
341         }
342 
343         // Internal, for casts to access union fields. Note that some variants
344         // of sifields start with a pointer, which makes the alignment of
345         // sifields vary on 32-bit and 64-bit architectures.
346         #[repr(C)]
347         struct siginfo_f {
348             _siginfo_base: [::c_int; 3],
349             sifields: sifields,
350         }
351 
352         impl siginfo_t {
353             unsafe fn sifields(&self) -> &sifields {
354                 &(*(self as *const siginfo_t as *const siginfo_f)).sifields
355             }
356 
357             pub unsafe fn si_pid(&self) -> ::pid_t {
358                 self.sifields().sigchld.si_pid
359             }
360 
361             pub unsafe fn si_uid(&self) -> ::uid_t {
362                 self.sifields().sigchld.si_uid
363             }
364 
365             pub unsafe fn si_status(&self) -> ::c_int {
366                 self.sifields().sigchld.si_status
367             }
368 
369             pub unsafe fn si_utime(&self) -> ::c_long {
370                 self.sifields().sigchld.si_utime
371             }
372 
373             pub unsafe fn si_stime(&self) -> ::c_long {
374                 self.sifields().sigchld.si_stime
375             }
376         }
377     }
378 }
379 
380 s_no_extra_traits! {
381     pub struct utmpx {
382         pub ut_type: ::c_short,
383         pub ut_pid: ::pid_t,
384         pub ut_line: [::c_char; __UT_LINESIZE],
385         pub ut_id: [::c_char; 4],
386 
387         pub ut_user: [::c_char; __UT_NAMESIZE],
388         pub ut_host: [::c_char; __UT_HOSTSIZE],
389         pub ut_exit: __exit_status,
390 
391         #[cfg(any(target_arch = "aarch64",
392                   target_arch = "s390x",
393                   all(target_pointer_width = "32",
394                       not(target_arch = "x86_64"))))]
395         pub ut_session: ::c_long,
396         #[cfg(any(target_arch = "aarch64",
397                   target_arch = "s390x",
398                   all(target_pointer_width = "32",
399                       not(target_arch = "x86_64"))))]
400         pub ut_tv: ::timeval,
401 
402         #[cfg(not(any(target_arch = "aarch64",
403                       target_arch = "s390x",
404                       all(target_pointer_width = "32",
405                           not(target_arch = "x86_64")))))]
406         pub ut_session: i32,
407         #[cfg(not(any(target_arch = "aarch64",
408                       target_arch = "s390x",
409                       all(target_pointer_width = "32",
410                           not(target_arch = "x86_64")))))]
411         pub ut_tv: __timeval,
412 
413         pub ut_addr_v6: [i32; 4],
414         __glibc_reserved: [::c_char; 20],
415     }
416 }
417 
418 cfg_if! {
419     if #[cfg(feature = "extra_traits")] {
420         impl PartialEq for utmpx {
421             fn eq(&self, other: &utmpx) -> bool {
422                 self.ut_type == other.ut_type
423                     && self.ut_pid == other.ut_pid
424                     && self.ut_line == other.ut_line
425                     && self.ut_id == other.ut_id
426                     && self.ut_user == other.ut_user
427                     && self
428                     .ut_host
429                     .iter()
430                     .zip(other.ut_host.iter())
431                     .all(|(a,b)| a == b)
432                     && self.ut_exit == other.ut_exit
433                     && self.ut_session == other.ut_session
434                     && self.ut_tv == other.ut_tv
435                     && self.ut_addr_v6 == other.ut_addr_v6
436                     && self.__glibc_reserved == other.__glibc_reserved
437             }
438         }
439 
440         impl Eq for utmpx {}
441 
442         impl ::fmt::Debug for utmpx {
443             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
444                 f.debug_struct("utmpx")
445                     .field("ut_type", &self.ut_type)
446                     .field("ut_pid", &self.ut_pid)
447                     .field("ut_line", &self.ut_line)
448                     .field("ut_id", &self.ut_id)
449                     .field("ut_user", &self.ut_user)
450                 // FIXME: .field("ut_host", &self.ut_host)
451                     .field("ut_exit", &self.ut_exit)
452                     .field("ut_session", &self.ut_session)
453                     .field("ut_tv", &self.ut_tv)
454                     .field("ut_addr_v6", &self.ut_addr_v6)
455                     .field("__glibc_reserved", &self.__glibc_reserved)
456                     .finish()
457             }
458         }
459 
460         impl ::hash::Hash for utmpx {
461             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
462                 self.ut_type.hash(state);
463                 self.ut_pid.hash(state);
464                 self.ut_line.hash(state);
465                 self.ut_id.hash(state);
466                 self.ut_user.hash(state);
467                 self.ut_host.hash(state);
468                 self.ut_exit.hash(state);
469                 self.ut_session.hash(state);
470                 self.ut_tv.hash(state);
471                 self.ut_addr_v6.hash(state);
472                 self.__glibc_reserved.hash(state);
473             }
474         }
475     }
476 }
477 
478 // include/uapi/asm-generic/hugetlb_encode.h
479 pub const HUGETLB_FLAG_ENCODE_SHIFT: ::c_int = 26;
480 pub const HUGETLB_FLAG_ENCODE_MASK: ::c_int = 0x3f;
481 
482 pub const HUGETLB_FLAG_ENCODE_64KB: ::c_int = 16 << HUGETLB_FLAG_ENCODE_SHIFT;
483 pub const HUGETLB_FLAG_ENCODE_512KB: ::c_int = 19 << HUGETLB_FLAG_ENCODE_SHIFT;
484 pub const HUGETLB_FLAG_ENCODE_1MB: ::c_int = 20 << HUGETLB_FLAG_ENCODE_SHIFT;
485 pub const HUGETLB_FLAG_ENCODE_2MB: ::c_int = 21 << HUGETLB_FLAG_ENCODE_SHIFT;
486 pub const HUGETLB_FLAG_ENCODE_8MB: ::c_int = 23 << HUGETLB_FLAG_ENCODE_SHIFT;
487 pub const HUGETLB_FLAG_ENCODE_16MB: ::c_int = 24 << HUGETLB_FLAG_ENCODE_SHIFT;
488 pub const HUGETLB_FLAG_ENCODE_32MB: ::c_int = 25 << HUGETLB_FLAG_ENCODE_SHIFT;
489 pub const HUGETLB_FLAG_ENCODE_256MB: ::c_int = 28 << HUGETLB_FLAG_ENCODE_SHIFT;
490 pub const HUGETLB_FLAG_ENCODE_512MB: ::c_int = 29 << HUGETLB_FLAG_ENCODE_SHIFT;
491 pub const HUGETLB_FLAG_ENCODE_1GB: ::c_int = 30 << HUGETLB_FLAG_ENCODE_SHIFT;
492 pub const HUGETLB_FLAG_ENCODE_2GB: ::c_int = 31 << HUGETLB_FLAG_ENCODE_SHIFT;
493 pub const HUGETLB_FLAG_ENCODE_16GB: ::c_int = 34 << HUGETLB_FLAG_ENCODE_SHIFT;
494 
495 // include/uapi/linux/mman.h
496 /*
497  * Huge page size encoding when MAP_HUGETLB is specified, and a huge page
498  * size other than the default is desired.  See hugetlb_encode.h.
499  * All known huge page size encodings are provided here.  It is the
500  * responsibility of the application to know which sizes are supported on
501  * the running system.  See mmap(2) man page for details.
502  */
503 pub const MAP_HUGE_SHIFT: ::c_int = HUGETLB_FLAG_ENCODE_SHIFT;
504 pub const MAP_HUGE_MASK: ::c_int = HUGETLB_FLAG_ENCODE_MASK;
505 
506 pub const MAP_HUGE_64KB: ::c_int = HUGETLB_FLAG_ENCODE_64KB;
507 pub const MAP_HUGE_512KB: ::c_int = HUGETLB_FLAG_ENCODE_512KB;
508 pub const MAP_HUGE_1MB: ::c_int = HUGETLB_FLAG_ENCODE_1MB;
509 pub const MAP_HUGE_2MB: ::c_int = HUGETLB_FLAG_ENCODE_2MB;
510 pub const MAP_HUGE_8MB: ::c_int = HUGETLB_FLAG_ENCODE_8MB;
511 pub const MAP_HUGE_16MB: ::c_int = HUGETLB_FLAG_ENCODE_16MB;
512 pub const MAP_HUGE_32MB: ::c_int = HUGETLB_FLAG_ENCODE_32MB;
513 pub const MAP_HUGE_256MB: ::c_int = HUGETLB_FLAG_ENCODE_256MB;
514 pub const MAP_HUGE_512MB: ::c_int = HUGETLB_FLAG_ENCODE_512MB;
515 pub const MAP_HUGE_1GB: ::c_int = HUGETLB_FLAG_ENCODE_1GB;
516 pub const MAP_HUGE_2GB: ::c_int = HUGETLB_FLAG_ENCODE_2GB;
517 pub const MAP_HUGE_16GB: ::c_int = HUGETLB_FLAG_ENCODE_16GB;
518 
519 pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
520 pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
521 pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
522 pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
523 pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
524 pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
525 pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
526 pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
527 pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
528 pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
529 pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
530 pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = 16;
531 
532 pub const PRIO_PROCESS: ::__priority_which_t = 0;
533 pub const PRIO_PGRP: ::__priority_which_t = 1;
534 pub const PRIO_USER: ::__priority_which_t = 2;
535 
536 pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
537 
538 pub const __UT_LINESIZE: usize = 32;
539 pub const __UT_NAMESIZE: usize = 32;
540 pub const __UT_HOSTSIZE: usize = 256;
541 pub const EMPTY: ::c_short = 0;
542 pub const RUN_LVL: ::c_short = 1;
543 pub const BOOT_TIME: ::c_short = 2;
544 pub const NEW_TIME: ::c_short = 3;
545 pub const OLD_TIME: ::c_short = 4;
546 pub const INIT_PROCESS: ::c_short = 5;
547 pub const LOGIN_PROCESS: ::c_short = 6;
548 pub const USER_PROCESS: ::c_short = 7;
549 pub const DEAD_PROCESS: ::c_short = 8;
550 pub const ACCOUNTING: ::c_short = 9;
551 
552 // dlfcn.h
553 pub const LM_ID_BASE: ::c_long = 0;
554 pub const LM_ID_NEWLM: ::c_long = -1;
555 
556 pub const RTLD_DI_LMID: ::c_int = 1;
557 pub const RTLD_DI_LINKMAP: ::c_int = 2;
558 pub const RTLD_DI_CONFIGADDR: ::c_int = 3;
559 pub const RTLD_DI_SERINFO: ::c_int = 4;
560 pub const RTLD_DI_SERINFOSIZE: ::c_int = 5;
561 pub const RTLD_DI_ORIGIN: ::c_int = 6;
562 pub const RTLD_DI_PROFILENAME: ::c_int = 7;
563 pub const RTLD_DI_PROFILEOUT: ::c_int = 8;
564 pub const RTLD_DI_TLS_MODID: ::c_int = 9;
565 pub const RTLD_DI_TLS_DATA: ::c_int = 10;
566 
567 pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
568 
569 pub const SOL_RXRPC: ::c_int = 272;
570 pub const SOL_PPPOL2TP: ::c_int = 273;
571 pub const SOL_PNPIPE: ::c_int = 275;
572 pub const SOL_RDS: ::c_int = 276;
573 pub const SOL_IUCV: ::c_int = 277;
574 pub const SOL_CAIF: ::c_int = 278;
575 pub const SOL_NFC: ::c_int = 280;
576 pub const SOL_XDP: ::c_int = 283;
577 
578 pub const MSG_TRYHARD: ::c_int = 4;
579 
580 pub const LC_PAPER: ::c_int = 7;
581 pub const LC_NAME: ::c_int = 8;
582 pub const LC_ADDRESS: ::c_int = 9;
583 pub const LC_TELEPHONE: ::c_int = 10;
584 pub const LC_MEASUREMENT: ::c_int = 11;
585 pub const LC_IDENTIFICATION: ::c_int = 12;
586 pub const LC_PAPER_MASK: ::c_int = 1 << LC_PAPER;
587 pub const LC_NAME_MASK: ::c_int = 1 << LC_NAME;
588 pub const LC_ADDRESS_MASK: ::c_int = 1 << LC_ADDRESS;
589 pub const LC_TELEPHONE_MASK: ::c_int = 1 << LC_TELEPHONE;
590 pub const LC_MEASUREMENT_MASK: ::c_int = 1 << LC_MEASUREMENT;
591 pub const LC_IDENTIFICATION_MASK: ::c_int = 1 << LC_IDENTIFICATION;
592 pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK
593     | ::LC_NUMERIC_MASK
594     | ::LC_TIME_MASK
595     | ::LC_COLLATE_MASK
596     | ::LC_MONETARY_MASK
597     | ::LC_MESSAGES_MASK
598     | LC_PAPER_MASK
599     | LC_NAME_MASK
600     | LC_ADDRESS_MASK
601     | LC_TELEPHONE_MASK
602     | LC_MEASUREMENT_MASK
603     | LC_IDENTIFICATION_MASK;
604 
605 pub const ENOTSUP: ::c_int = EOPNOTSUPP;
606 
607 pub const SOCK_SEQPACKET: ::c_int = 5;
608 pub const SOCK_DCCP: ::c_int = 6;
609 pub const SOCK_PACKET: ::c_int = 10;
610 
611 pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
612 pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
613 pub const TCP_THIN_DUPACK: ::c_int = 17;
614 pub const TCP_USER_TIMEOUT: ::c_int = 18;
615 pub const TCP_REPAIR: ::c_int = 19;
616 pub const TCP_REPAIR_QUEUE: ::c_int = 20;
617 pub const TCP_QUEUE_SEQ: ::c_int = 21;
618 pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
619 pub const TCP_FASTOPEN: ::c_int = 23;
620 pub const TCP_TIMESTAMP: ::c_int = 24;
621 pub const TCP_FASTOPEN_CONNECT: ::c_int = 30;
622 
623 /* DCCP socket options */
624 pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1;
625 pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2;
626 pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3;
627 pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4;
628 pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5;
629 pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6;
630 pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10;
631 pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11;
632 pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12;
633 pub const DCCP_SOCKOPT_CCID: ::c_int = 13;
634 pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14;
635 pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15;
636 pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16;
637 pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17;
638 pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128;
639 pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192;
640 
641 /// maximum number of services provided on the same listening port
642 pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32;
643 
644 pub const SIGEV_THREAD_ID: ::c_int = 4;
645 
646 pub const BUFSIZ: ::c_uint = 8192;
647 pub const TMP_MAX: ::c_uint = 238328;
648 pub const FOPEN_MAX: ::c_uint = 16;
649 pub const POSIX_MADV_DONTNEED: ::c_int = 4;
650 pub const _SC_EQUIV_CLASS_MAX: ::c_int = 41;
651 pub const _SC_CHARCLASS_NAME_MAX: ::c_int = 45;
652 pub const _SC_PII: ::c_int = 53;
653 pub const _SC_PII_XTI: ::c_int = 54;
654 pub const _SC_PII_SOCKET: ::c_int = 55;
655 pub const _SC_PII_INTERNET: ::c_int = 56;
656 pub const _SC_PII_OSI: ::c_int = 57;
657 pub const _SC_POLL: ::c_int = 58;
658 pub const _SC_SELECT: ::c_int = 59;
659 pub const _SC_PII_INTERNET_STREAM: ::c_int = 61;
660 pub const _SC_PII_INTERNET_DGRAM: ::c_int = 62;
661 pub const _SC_PII_OSI_COTS: ::c_int = 63;
662 pub const _SC_PII_OSI_CLTS: ::c_int = 64;
663 pub const _SC_PII_OSI_M: ::c_int = 65;
664 pub const _SC_T_IOV_MAX: ::c_int = 66;
665 pub const _SC_2_C_VERSION: ::c_int = 96;
666 pub const _SC_CHAR_BIT: ::c_int = 101;
667 pub const _SC_CHAR_MAX: ::c_int = 102;
668 pub const _SC_CHAR_MIN: ::c_int = 103;
669 pub const _SC_INT_MAX: ::c_int = 104;
670 pub const _SC_INT_MIN: ::c_int = 105;
671 pub const _SC_LONG_BIT: ::c_int = 106;
672 pub const _SC_WORD_BIT: ::c_int = 107;
673 pub const _SC_MB_LEN_MAX: ::c_int = 108;
674 pub const _SC_SSIZE_MAX: ::c_int = 110;
675 pub const _SC_SCHAR_MAX: ::c_int = 111;
676 pub const _SC_SCHAR_MIN: ::c_int = 112;
677 pub const _SC_SHRT_MAX: ::c_int = 113;
678 pub const _SC_SHRT_MIN: ::c_int = 114;
679 pub const _SC_UCHAR_MAX: ::c_int = 115;
680 pub const _SC_UINT_MAX: ::c_int = 116;
681 pub const _SC_ULONG_MAX: ::c_int = 117;
682 pub const _SC_USHRT_MAX: ::c_int = 118;
683 pub const _SC_NL_ARGMAX: ::c_int = 119;
684 pub const _SC_NL_LANGMAX: ::c_int = 120;
685 pub const _SC_NL_MSGMAX: ::c_int = 121;
686 pub const _SC_NL_NMAX: ::c_int = 122;
687 pub const _SC_NL_SETMAX: ::c_int = 123;
688 pub const _SC_NL_TEXTMAX: ::c_int = 124;
689 pub const _SC_BASE: ::c_int = 134;
690 pub const _SC_C_LANG_SUPPORT: ::c_int = 135;
691 pub const _SC_C_LANG_SUPPORT_R: ::c_int = 136;
692 pub const _SC_DEVICE_IO: ::c_int = 140;
693 pub const _SC_DEVICE_SPECIFIC: ::c_int = 141;
694 pub const _SC_DEVICE_SPECIFIC_R: ::c_int = 142;
695 pub const _SC_FD_MGMT: ::c_int = 143;
696 pub const _SC_FIFO: ::c_int = 144;
697 pub const _SC_PIPE: ::c_int = 145;
698 pub const _SC_FILE_ATTRIBUTES: ::c_int = 146;
699 pub const _SC_FILE_LOCKING: ::c_int = 147;
700 pub const _SC_FILE_SYSTEM: ::c_int = 148;
701 pub const _SC_MULTI_PROCESS: ::c_int = 150;
702 pub const _SC_SINGLE_PROCESS: ::c_int = 151;
703 pub const _SC_NETWORKING: ::c_int = 152;
704 pub const _SC_REGEX_VERSION: ::c_int = 156;
705 pub const _SC_SIGNALS: ::c_int = 158;
706 pub const _SC_SYSTEM_DATABASE: ::c_int = 162;
707 pub const _SC_SYSTEM_DATABASE_R: ::c_int = 163;
708 pub const _SC_USER_GROUPS: ::c_int = 166;
709 pub const _SC_USER_GROUPS_R: ::c_int = 167;
710 pub const _SC_LEVEL1_ICACHE_SIZE: ::c_int = 185;
711 pub const _SC_LEVEL1_ICACHE_ASSOC: ::c_int = 186;
712 pub const _SC_LEVEL1_ICACHE_LINESIZE: ::c_int = 187;
713 pub const _SC_LEVEL1_DCACHE_SIZE: ::c_int = 188;
714 pub const _SC_LEVEL1_DCACHE_ASSOC: ::c_int = 189;
715 pub const _SC_LEVEL1_DCACHE_LINESIZE: ::c_int = 190;
716 pub const _SC_LEVEL2_CACHE_SIZE: ::c_int = 191;
717 pub const _SC_LEVEL2_CACHE_ASSOC: ::c_int = 192;
718 pub const _SC_LEVEL2_CACHE_LINESIZE: ::c_int = 193;
719 pub const _SC_LEVEL3_CACHE_SIZE: ::c_int = 194;
720 pub const _SC_LEVEL3_CACHE_ASSOC: ::c_int = 195;
721 pub const _SC_LEVEL3_CACHE_LINESIZE: ::c_int = 196;
722 pub const _SC_LEVEL4_CACHE_SIZE: ::c_int = 197;
723 pub const _SC_LEVEL4_CACHE_ASSOC: ::c_int = 198;
724 pub const _SC_LEVEL4_CACHE_LINESIZE: ::c_int = 199;
725 pub const O_ACCMODE: ::c_int = 3;
726 pub const ST_RELATIME: ::c_ulong = 4096;
727 pub const NI_MAXHOST: ::socklen_t = 1025;
728 
729 cfg_if! {
730     if #[cfg(not(target_arch = "s390x"))] {
731         pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5;
732         pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff;
733         pub const AFS_SUPER_MAGIC: ::c_long = 0x5346414f;
734         pub const AUTOFS_SUPER_MAGIC: ::c_long = 0x0187;
735         pub const BINDERFS_SUPER_MAGIC: ::c_long = 0x6c6f6f70;
736         pub const BPF_FS_MAGIC: ::c_long = 0xcafe4a11;
737         pub const BTRFS_SUPER_MAGIC: ::c_long = 0x9123683e;
738         pub const CGROUP2_SUPER_MAGIC: ::c_long = 0x63677270;
739         pub const CGROUP_SUPER_MAGIC: ::c_long = 0x27e0eb;
740         pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245;
741         pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45;
742         pub const DEBUGFS_MAGIC: ::c_long = 0x64626720;
743         pub const DEVPTS_SUPER_MAGIC: ::c_long = 0x1cd1;
744         pub const ECRYPTFS_SUPER_MAGIC: ::c_long = 0xf15f;
745         pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53;
746         pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53;
747         pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53;
748         pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53;
749         pub const F2FS_SUPER_MAGIC: ::c_long = 0xf2f52010;
750         pub const FUTEXFS_SUPER_MAGIC: ::c_long = 0xbad1dea;
751         pub const HOSTFS_SUPER_MAGIC: ::c_long = 0x00c0ffee;
752         pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849;
753         pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6;
754         pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660;
755         pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6;
756         pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478;
757         pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468;
758         pub const MINIX3_SUPER_MAGIC: ::c_long = 0x4d5a;
759         pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f;
760         pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f;
761         pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44;
762         pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c;
763         pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969;
764         pub const NILFS_SUPER_MAGIC: ::c_long = 0x3434;
765         pub const OCFS2_SUPER_MAGIC: ::c_long = 0x7461636f;
766         pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1;
767         pub const OVERLAYFS_SUPER_MAGIC: ::c_long = 0x794c7630;
768         pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0;
769         pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f;
770         pub const QNX6_SUPER_MAGIC: ::c_long = 0x68191122;
771         pub const RDTGROUP_SUPER_MAGIC: ::c_long = 0x7655821;
772         pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973;
773         pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b;
774         pub const SYSFS_MAGIC: ::c_long = 0x62656572;
775         pub const TMPFS_MAGIC: ::c_long = 0x01021994;
776         pub const TRACEFS_MAGIC: ::c_long = 0x74726163;
777         pub const UDF_SUPER_MAGIC: ::c_long = 0x15013346;
778         pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2;
779         pub const XENFS_SUPER_MAGIC: ::c_long = 0xabba1974;
780         pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342;
781     } else if #[cfg(target_arch = "s390x")] {
782         pub const ADFS_SUPER_MAGIC: ::c_uint = 0x0000adf5;
783         pub const AFFS_SUPER_MAGIC: ::c_uint = 0x0000adff;
784         pub const AFS_SUPER_MAGIC: ::c_uint = 0x5346414f;
785         pub const AUTOFS_SUPER_MAGIC: ::c_uint = 0x0187;
786         pub const BINDERFS_SUPER_MAGIC: ::c_uint = 0x6c6f6f70;
787         pub const BPF_FS_MAGIC: ::c_uint = 0xcafe4a11;
788         pub const BTRFS_SUPER_MAGIC: ::c_uint = 0x9123683e;
789         pub const CGROUP2_SUPER_MAGIC: ::c_uint = 0x63677270;
790         pub const CGROUP_SUPER_MAGIC: ::c_uint = 0x27e0eb;
791         pub const CODA_SUPER_MAGIC: ::c_uint = 0x73757245;
792         pub const CRAMFS_MAGIC: ::c_uint = 0x28cd3d45;
793         pub const DEBUGFS_MAGIC: ::c_uint = 0x64626720;
794         pub const DEVPTS_SUPER_MAGIC: ::c_uint = 0x1cd1;
795         pub const ECRYPTFS_SUPER_MAGIC: ::c_uint = 0xf15f;
796         pub const EFS_SUPER_MAGIC: ::c_uint = 0x00414a53;
797         pub const EXT2_SUPER_MAGIC: ::c_uint = 0x0000ef53;
798         pub const EXT3_SUPER_MAGIC: ::c_uint = 0x0000ef53;
799         pub const EXT4_SUPER_MAGIC: ::c_uint = 0x0000ef53;
800         pub const F2FS_SUPER_MAGIC: ::c_uint = 0xf2f52010;
801         pub const FUTEXFS_SUPER_MAGIC: ::c_uint = 0xbad1dea;
802         pub const HOSTFS_SUPER_MAGIC: ::c_uint = 0x00c0ffee;
803         pub const HPFS_SUPER_MAGIC: ::c_uint = 0xf995e849;
804         pub const HUGETLBFS_MAGIC: ::c_uint = 0x958458f6;
805         pub const ISOFS_SUPER_MAGIC: ::c_uint = 0x00009660;
806         pub const JFFS2_SUPER_MAGIC: ::c_uint = 0x000072b6;
807         pub const MINIX2_SUPER_MAGIC2: ::c_uint = 0x00002478;
808         pub const MINIX2_SUPER_MAGIC: ::c_uint = 0x00002468;
809         pub const MINIX3_SUPER_MAGIC: ::c_uint = 0x4d5a;
810         pub const MINIX_SUPER_MAGIC2: ::c_uint = 0x0000138f;
811         pub const MINIX_SUPER_MAGIC: ::c_uint = 0x0000137f;
812         pub const MSDOS_SUPER_MAGIC: ::c_uint = 0x00004d44;
813         pub const NCP_SUPER_MAGIC: ::c_uint = 0x0000564c;
814         pub const NFS_SUPER_MAGIC: ::c_uint = 0x00006969;
815         pub const NILFS_SUPER_MAGIC: ::c_uint = 0x3434;
816         pub const OCFS2_SUPER_MAGIC: ::c_uint = 0x7461636f;
817         pub const OPENPROM_SUPER_MAGIC: ::c_uint = 0x00009fa1;
818         pub const OVERLAYFS_SUPER_MAGIC: ::c_uint = 0x794c7630;
819         pub const PROC_SUPER_MAGIC: ::c_uint = 0x00009fa0;
820         pub const QNX4_SUPER_MAGIC: ::c_uint = 0x0000002f;
821         pub const QNX6_SUPER_MAGIC: ::c_uint = 0x68191122;
822         pub const RDTGROUP_SUPER_MAGIC: ::c_uint = 0x7655821;
823         pub const REISERFS_SUPER_MAGIC: ::c_uint = 0x52654973;
824         pub const SMB_SUPER_MAGIC: ::c_uint = 0x0000517b;
825         pub const SYSFS_MAGIC: ::c_uint = 0x62656572;
826         pub const TMPFS_MAGIC: ::c_uint = 0x01021994;
827         pub const TRACEFS_MAGIC: ::c_uint = 0x74726163;
828         pub const UDF_SUPER_MAGIC: ::c_uint = 0x15013346;
829         pub const USBDEVICE_SUPER_MAGIC: ::c_uint = 0x00009fa2;
830         pub const XENFS_SUPER_MAGIC: ::c_uint = 0xabba1974;
831         pub const XFS_SUPER_MAGIC: ::c_uint = 0x58465342;
832     }
833 }
834 
835 pub const CPU_SETSIZE: ::c_int = 0x400;
836 
837 pub const PTRACE_TRACEME: ::c_uint = 0;
838 pub const PTRACE_PEEKTEXT: ::c_uint = 1;
839 pub const PTRACE_PEEKDATA: ::c_uint = 2;
840 pub const PTRACE_PEEKUSER: ::c_uint = 3;
841 pub const PTRACE_POKETEXT: ::c_uint = 4;
842 pub const PTRACE_POKEDATA: ::c_uint = 5;
843 pub const PTRACE_POKEUSER: ::c_uint = 6;
844 pub const PTRACE_CONT: ::c_uint = 7;
845 pub const PTRACE_KILL: ::c_uint = 8;
846 pub const PTRACE_SINGLESTEP: ::c_uint = 9;
847 pub const PTRACE_ATTACH: ::c_uint = 16;
848 pub const PTRACE_SYSCALL: ::c_uint = 24;
849 pub const PTRACE_SETOPTIONS: ::c_uint = 0x4200;
850 pub const PTRACE_GETEVENTMSG: ::c_uint = 0x4201;
851 pub const PTRACE_GETSIGINFO: ::c_uint = 0x4202;
852 pub const PTRACE_SETSIGINFO: ::c_uint = 0x4203;
853 pub const PTRACE_GETREGSET: ::c_uint = 0x4204;
854 pub const PTRACE_SETREGSET: ::c_uint = 0x4205;
855 pub const PTRACE_SEIZE: ::c_uint = 0x4206;
856 pub const PTRACE_INTERRUPT: ::c_uint = 0x4207;
857 pub const PTRACE_LISTEN: ::c_uint = 0x4208;
858 pub const PTRACE_PEEKSIGINFO: ::c_uint = 0x4209;
859 
860 pub const EPOLLWAKEUP: ::c_int = 0x20000000;
861 
862 pub const SEEK_DATA: ::c_int = 3;
863 pub const SEEK_HOLE: ::c_int = 4;
864 
865 // linux/fs.h
866 
867 // Flags for preadv2/pwritev2
868 pub const RWF_HIPRI: ::c_int = 0x00000001;
869 pub const RWF_DSYNC: ::c_int = 0x00000002;
870 pub const RWF_SYNC: ::c_int = 0x00000004;
871 pub const RWF_NOWAIT: ::c_int = 0x00000008;
872 pub const RWF_APPEND: ::c_int = 0x00000010;
873 
874 // linux/rtnetlink.h
875 pub const TCA_PAD: ::c_ushort = 9;
876 pub const TCA_DUMP_INVISIBLE: ::c_ushort = 10;
877 pub const TCA_CHAIN: ::c_ushort = 11;
878 pub const TCA_HW_OFFLOAD: ::c_ushort = 12;
879 
880 pub const RTM_DELNETCONF: u16 = 81;
881 pub const RTM_NEWSTATS: u16 = 92;
882 pub const RTM_GETSTATS: u16 = 94;
883 pub const RTM_NEWCACHEREPORT: u16 = 96;
884 
885 pub const RTM_F_LOOKUP_TABLE: ::c_uint = 0x1000;
886 pub const RTM_F_FIB_MATCH: ::c_uint = 0x2000;
887 
888 pub const RTA_VIA: ::c_ushort = 18;
889 pub const RTA_NEWDST: ::c_ushort = 19;
890 pub const RTA_PREF: ::c_ushort = 20;
891 pub const RTA_ENCAP_TYPE: ::c_ushort = 21;
892 pub const RTA_ENCAP: ::c_ushort = 22;
893 pub const RTA_EXPIRES: ::c_ushort = 23;
894 pub const RTA_PAD: ::c_ushort = 24;
895 pub const RTA_UID: ::c_ushort = 25;
896 pub const RTA_TTL_PROPAGATE: ::c_ushort = 26;
897 
898 // linux/neighbor.h
899 pub const NTF_EXT_LEARNED: u8 = 0x10;
900 pub const NTF_OFFLOADED: u8 = 0x20;
901 
902 pub const NDA_MASTER: ::c_ushort = 9;
903 pub const NDA_LINK_NETNSID: ::c_ushort = 10;
904 pub const NDA_SRC_VNI: ::c_ushort = 11;
905 
906 // linux/personality.h
907 pub const UNAME26: ::c_int = 0x0020000;
908 pub const FDPIC_FUNCPTRS: ::c_int = 0x0080000;
909 
910 // linux/if_addr.h
911 pub const IFA_FLAGS: ::c_ushort = 8;
912 
913 pub const IFA_F_MANAGETEMPADDR: u32 = 0x100;
914 pub const IFA_F_NOPREFIXROUTE: u32 = 0x200;
915 pub const IFA_F_MCAUTOJOIN: u32 = 0x400;
916 pub const IFA_F_STABLE_PRIVACY: u32 = 0x800;
917 
918 pub const MAX_LINKS: ::c_int = 32;
919 
920 pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10;
921 
922 pub const GENL_ID_VFS_DQUOT: ::c_int = ::NLMSG_MIN_TYPE + 1;
923 pub const GENL_ID_PMCRAID: ::c_int = ::NLMSG_MIN_TYPE + 2;
924 
925 pub const TIOCM_LE: ::c_int = 0x001;
926 pub const TIOCM_DTR: ::c_int = 0x002;
927 pub const TIOCM_RTS: ::c_int = 0x004;
928 pub const TIOCM_CD: ::c_int = TIOCM_CAR;
929 pub const TIOCM_RI: ::c_int = TIOCM_RNG;
930 
931 pub const NF_NETDEV_INGRESS: ::c_int = 0;
932 pub const NF_NETDEV_NUMHOOKS: ::c_int = 1;
933 
934 pub const NFPROTO_INET: ::c_int = 1;
935 pub const NFPROTO_NETDEV: ::c_int = 5;
936 
937 // linux/keyctl.h
938 pub const KEYCTL_DH_COMPUTE: u32 = 23;
939 pub const KEYCTL_PKEY_QUERY: u32 = 24;
940 pub const KEYCTL_PKEY_ENCRYPT: u32 = 25;
941 pub const KEYCTL_PKEY_DECRYPT: u32 = 26;
942 pub const KEYCTL_PKEY_SIGN: u32 = 27;
943 pub const KEYCTL_PKEY_VERIFY: u32 = 28;
944 pub const KEYCTL_RESTRICT_KEYRING: u32 = 29;
945 
946 pub const KEYCTL_SUPPORTS_ENCRYPT: u32 = 0x01;
947 pub const KEYCTL_SUPPORTS_DECRYPT: u32 = 0x02;
948 pub const KEYCTL_SUPPORTS_SIGN: u32 = 0x04;
949 pub const KEYCTL_SUPPORTS_VERIFY: u32 = 0x08;
950 cfg_if! {
951     if #[cfg(not(any(target_arch="mips", target_arch="mips64")))] {
952         pub const KEYCTL_MOVE: u32 = 30;
953         pub const KEYCTL_CAPABILITIES: u32 = 31;
954 
955         pub const KEYCTL_CAPS0_CAPABILITIES: u32 = 0x01;
956         pub const KEYCTL_CAPS0_PERSISTENT_KEYRINGS: u32 = 0x02;
957         pub const KEYCTL_CAPS0_DIFFIE_HELLMAN: u32 = 0x04;
958         pub const KEYCTL_CAPS0_PUBLIC_KEY: u32 = 0x08;
959         pub const KEYCTL_CAPS0_BIG_KEY: u32 = 0x10;
960         pub const KEYCTL_CAPS0_INVALIDATE: u32 = 0x20;
961         pub const KEYCTL_CAPS0_RESTRICT_KEYRING: u32 = 0x40;
962         pub const KEYCTL_CAPS0_MOVE: u32 = 0x80;
963         pub const KEYCTL_CAPS1_NS_KEYRING_NAME: u32 = 0x01;
964         pub const KEYCTL_CAPS1_NS_KEY_TAG: u32 = 0x02;
965     }
966 }
967 
968 // linux/netfilter/nf_tables.h
969 pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256;
970 pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256;
971 pub const NFT_SET_MAXNAMELEN: ::c_int = 256;
972 pub const NFT_OBJ_MAXNAMELEN: ::c_int = 256;
973 pub const NFT_USERDATA_MAXLEN: ::c_int = 256;
974 
975 pub const NFT_REG_VERDICT: ::c_int = 0;
976 pub const NFT_REG_1: ::c_int = 1;
977 pub const NFT_REG_2: ::c_int = 2;
978 pub const NFT_REG_3: ::c_int = 3;
979 pub const NFT_REG_4: ::c_int = 4;
980 pub const __NFT_REG_MAX: ::c_int = 5;
981 pub const NFT_REG32_00: ::c_int = 8;
982 pub const NFT_REG32_01: ::c_int = 9;
983 pub const NFT_REG32_02: ::c_int = 10;
984 pub const NFT_REG32_03: ::c_int = 11;
985 pub const NFT_REG32_04: ::c_int = 12;
986 pub const NFT_REG32_05: ::c_int = 13;
987 pub const NFT_REG32_06: ::c_int = 14;
988 pub const NFT_REG32_07: ::c_int = 15;
989 pub const NFT_REG32_08: ::c_int = 16;
990 pub const NFT_REG32_09: ::c_int = 17;
991 pub const NFT_REG32_10: ::c_int = 18;
992 pub const NFT_REG32_11: ::c_int = 19;
993 pub const NFT_REG32_12: ::c_int = 20;
994 pub const NFT_REG32_13: ::c_int = 21;
995 pub const NFT_REG32_14: ::c_int = 22;
996 pub const NFT_REG32_15: ::c_int = 23;
997 
998 pub const NFT_REG_SIZE: ::c_int = 16;
999 pub const NFT_REG32_SIZE: ::c_int = 4;
1000 
1001 pub const NFT_CONTINUE: ::c_int = -1;
1002 pub const NFT_BREAK: ::c_int = -2;
1003 pub const NFT_JUMP: ::c_int = -3;
1004 pub const NFT_GOTO: ::c_int = -4;
1005 pub const NFT_RETURN: ::c_int = -5;
1006 
1007 pub const NFT_MSG_NEWTABLE: ::c_int = 0;
1008 pub const NFT_MSG_GETTABLE: ::c_int = 1;
1009 pub const NFT_MSG_DELTABLE: ::c_int = 2;
1010 pub const NFT_MSG_NEWCHAIN: ::c_int = 3;
1011 pub const NFT_MSG_GETCHAIN: ::c_int = 4;
1012 pub const NFT_MSG_DELCHAIN: ::c_int = 5;
1013 pub const NFT_MSG_NEWRULE: ::c_int = 6;
1014 pub const NFT_MSG_GETRULE: ::c_int = 7;
1015 pub const NFT_MSG_DELRULE: ::c_int = 8;
1016 pub const NFT_MSG_NEWSET: ::c_int = 9;
1017 pub const NFT_MSG_GETSET: ::c_int = 10;
1018 pub const NFT_MSG_DELSET: ::c_int = 11;
1019 pub const NFT_MSG_NEWSETELEM: ::c_int = 12;
1020 pub const NFT_MSG_GETSETELEM: ::c_int = 13;
1021 pub const NFT_MSG_DELSETELEM: ::c_int = 14;
1022 pub const NFT_MSG_NEWGEN: ::c_int = 15;
1023 pub const NFT_MSG_GETGEN: ::c_int = 16;
1024 pub const NFT_MSG_TRACE: ::c_int = 17;
1025 cfg_if! {
1026     if #[cfg(not(target_arch = "sparc64"))] {
1027         pub const NFT_MSG_NEWOBJ: ::c_int = 18;
1028         pub const NFT_MSG_GETOBJ: ::c_int = 19;
1029         pub const NFT_MSG_DELOBJ: ::c_int = 20;
1030         pub const NFT_MSG_GETOBJ_RESET: ::c_int = 21;
1031     }
1032 }
1033 pub const NFT_MSG_MAX: ::c_int = 25;
1034 
1035 pub const NFT_SET_ANONYMOUS: ::c_int = 0x1;
1036 pub const NFT_SET_CONSTANT: ::c_int = 0x2;
1037 pub const NFT_SET_INTERVAL: ::c_int = 0x4;
1038 pub const NFT_SET_MAP: ::c_int = 0x8;
1039 pub const NFT_SET_TIMEOUT: ::c_int = 0x10;
1040 pub const NFT_SET_EVAL: ::c_int = 0x20;
1041 
1042 pub const NFT_SET_POL_PERFORMANCE: ::c_int = 0;
1043 pub const NFT_SET_POL_MEMORY: ::c_int = 1;
1044 
1045 pub const NFT_SET_ELEM_INTERVAL_END: ::c_int = 0x1;
1046 
1047 pub const NFT_DATA_VALUE: ::c_uint = 0;
1048 pub const NFT_DATA_VERDICT: ::c_uint = 0xffffff00;
1049 
1050 pub const NFT_DATA_RESERVED_MASK: ::c_uint = 0xffffff00;
1051 
1052 pub const NFT_DATA_VALUE_MAXLEN: ::c_int = 64;
1053 
1054 pub const NFT_BYTEORDER_NTOH: ::c_int = 0;
1055 pub const NFT_BYTEORDER_HTON: ::c_int = 1;
1056 
1057 pub const NFT_CMP_EQ: ::c_int = 0;
1058 pub const NFT_CMP_NEQ: ::c_int = 1;
1059 pub const NFT_CMP_LT: ::c_int = 2;
1060 pub const NFT_CMP_LTE: ::c_int = 3;
1061 pub const NFT_CMP_GT: ::c_int = 4;
1062 pub const NFT_CMP_GTE: ::c_int = 5;
1063 
1064 pub const NFT_RANGE_EQ: ::c_int = 0;
1065 pub const NFT_RANGE_NEQ: ::c_int = 1;
1066 
1067 pub const NFT_LOOKUP_F_INV: ::c_int = 1 << 0;
1068 
1069 pub const NFT_DYNSET_OP_ADD: ::c_int = 0;
1070 pub const NFT_DYNSET_OP_UPDATE: ::c_int = 1;
1071 
1072 pub const NFT_DYNSET_F_INV: ::c_int = 1 << 0;
1073 
1074 pub const NFT_PAYLOAD_LL_HEADER: ::c_int = 0;
1075 pub const NFT_PAYLOAD_NETWORK_HEADER: ::c_int = 1;
1076 pub const NFT_PAYLOAD_TRANSPORT_HEADER: ::c_int = 2;
1077 
1078 pub const NFT_PAYLOAD_CSUM_NONE: ::c_int = 0;
1079 pub const NFT_PAYLOAD_CSUM_INET: ::c_int = 1;
1080 
1081 pub const NFT_META_LEN: ::c_int = 0;
1082 pub const NFT_META_PROTOCOL: ::c_int = 1;
1083 pub const NFT_META_PRIORITY: ::c_int = 2;
1084 pub const NFT_META_MARK: ::c_int = 3;
1085 pub const NFT_META_IIF: ::c_int = 4;
1086 pub const NFT_META_OIF: ::c_int = 5;
1087 pub const NFT_META_IIFNAME: ::c_int = 6;
1088 pub const NFT_META_OIFNAME: ::c_int = 7;
1089 pub const NFT_META_IIFTYPE: ::c_int = 8;
1090 pub const NFT_META_OIFTYPE: ::c_int = 9;
1091 pub const NFT_META_SKUID: ::c_int = 10;
1092 pub const NFT_META_SKGID: ::c_int = 11;
1093 pub const NFT_META_NFTRACE: ::c_int = 12;
1094 pub const NFT_META_RTCLASSID: ::c_int = 13;
1095 pub const NFT_META_SECMARK: ::c_int = 14;
1096 pub const NFT_META_NFPROTO: ::c_int = 15;
1097 pub const NFT_META_L4PROTO: ::c_int = 16;
1098 pub const NFT_META_BRI_IIFNAME: ::c_int = 17;
1099 pub const NFT_META_BRI_OIFNAME: ::c_int = 18;
1100 pub const NFT_META_PKTTYPE: ::c_int = 19;
1101 pub const NFT_META_CPU: ::c_int = 20;
1102 pub const NFT_META_IIFGROUP: ::c_int = 21;
1103 pub const NFT_META_OIFGROUP: ::c_int = 22;
1104 pub const NFT_META_CGROUP: ::c_int = 23;
1105 pub const NFT_META_PRANDOM: ::c_int = 24;
1106 
1107 pub const NFT_CT_STATE: ::c_int = 0;
1108 pub const NFT_CT_DIRECTION: ::c_int = 1;
1109 pub const NFT_CT_STATUS: ::c_int = 2;
1110 pub const NFT_CT_MARK: ::c_int = 3;
1111 pub const NFT_CT_SECMARK: ::c_int = 4;
1112 pub const NFT_CT_EXPIRATION: ::c_int = 5;
1113 pub const NFT_CT_HELPER: ::c_int = 6;
1114 pub const NFT_CT_L3PROTOCOL: ::c_int = 7;
1115 pub const NFT_CT_SRC: ::c_int = 8;
1116 pub const NFT_CT_DST: ::c_int = 9;
1117 pub const NFT_CT_PROTOCOL: ::c_int = 10;
1118 pub const NFT_CT_PROTO_SRC: ::c_int = 11;
1119 pub const NFT_CT_PROTO_DST: ::c_int = 12;
1120 pub const NFT_CT_LABELS: ::c_int = 13;
1121 pub const NFT_CT_PKTS: ::c_int = 14;
1122 pub const NFT_CT_BYTES: ::c_int = 15;
1123 
1124 pub const NFT_LIMIT_PKTS: ::c_int = 0;
1125 pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1;
1126 
1127 pub const NFT_LIMIT_F_INV: ::c_int = 1 << 0;
1128 
1129 pub const NFT_QUEUE_FLAG_BYPASS: ::c_int = 0x01;
1130 pub const NFT_QUEUE_FLAG_CPU_FANOUT: ::c_int = 0x02;
1131 pub const NFT_QUEUE_FLAG_MASK: ::c_int = 0x03;
1132 
1133 pub const NFT_QUOTA_F_INV: ::c_int = 1 << 0;
1134 
1135 pub const NFT_REJECT_ICMP_UNREACH: ::c_int = 0;
1136 pub const NFT_REJECT_TCP_RST: ::c_int = 1;
1137 pub const NFT_REJECT_ICMPX_UNREACH: ::c_int = 2;
1138 
1139 pub const NFT_REJECT_ICMPX_NO_ROUTE: ::c_int = 0;
1140 pub const NFT_REJECT_ICMPX_PORT_UNREACH: ::c_int = 1;
1141 pub const NFT_REJECT_ICMPX_HOST_UNREACH: ::c_int = 2;
1142 pub const NFT_REJECT_ICMPX_ADMIN_PROHIBITED: ::c_int = 3;
1143 
1144 pub const NFT_NAT_SNAT: ::c_int = 0;
1145 pub const NFT_NAT_DNAT: ::c_int = 1;
1146 
1147 pub const NFT_TRACETYPE_UNSPEC: ::c_int = 0;
1148 pub const NFT_TRACETYPE_POLICY: ::c_int = 1;
1149 pub const NFT_TRACETYPE_RETURN: ::c_int = 2;
1150 pub const NFT_TRACETYPE_RULE: ::c_int = 3;
1151 
1152 pub const NFT_NG_INCREMENTAL: ::c_int = 0;
1153 pub const NFT_NG_RANDOM: ::c_int = 1;
1154 
1155 pub const M_MXFAST: ::c_int = 1;
1156 pub const M_NLBLKS: ::c_int = 2;
1157 pub const M_GRAIN: ::c_int = 3;
1158 pub const M_KEEP: ::c_int = 4;
1159 pub const M_TRIM_THRESHOLD: ::c_int = -1;
1160 pub const M_TOP_PAD: ::c_int = -2;
1161 pub const M_MMAP_THRESHOLD: ::c_int = -3;
1162 pub const M_MMAP_MAX: ::c_int = -4;
1163 pub const M_CHECK_ACTION: ::c_int = -5;
1164 pub const M_PERTURB: ::c_int = -6;
1165 pub const M_ARENA_TEST: ::c_int = -7;
1166 pub const M_ARENA_MAX: ::c_int = -8;
1167 
1168 pub const AT_STATX_SYNC_TYPE: ::c_int = 0x6000;
1169 pub const AT_STATX_SYNC_AS_STAT: ::c_int = 0x0000;
1170 pub const AT_STATX_FORCE_SYNC: ::c_int = 0x2000;
1171 pub const AT_STATX_DONT_SYNC: ::c_int = 0x4000;
1172 pub const STATX_TYPE: ::c_uint = 0x0001;
1173 pub const STATX_MODE: ::c_uint = 0x0002;
1174 pub const STATX_NLINK: ::c_uint = 0x0004;
1175 pub const STATX_UID: ::c_uint = 0x0008;
1176 pub const STATX_GID: ::c_uint = 0x0010;
1177 pub const STATX_ATIME: ::c_uint = 0x0020;
1178 pub const STATX_MTIME: ::c_uint = 0x0040;
1179 pub const STATX_CTIME: ::c_uint = 0x0080;
1180 pub const STATX_INO: ::c_uint = 0x0100;
1181 pub const STATX_SIZE: ::c_uint = 0x0200;
1182 pub const STATX_BLOCKS: ::c_uint = 0x0400;
1183 pub const STATX_BASIC_STATS: ::c_uint = 0x07ff;
1184 pub const STATX_BTIME: ::c_uint = 0x0800;
1185 pub const STATX_MNT_ID: ::c_uint = 0x1000;
1186 pub const STATX_ALL: ::c_uint = 0x0fff;
1187 pub const STATX__RESERVED: ::c_int = 0x80000000;
1188 pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004;
1189 pub const STATX_ATTR_IMMUTABLE: ::c_int = 0x0010;
1190 pub const STATX_ATTR_APPEND: ::c_int = 0x0020;
1191 pub const STATX_ATTR_NODUMP: ::c_int = 0x0040;
1192 pub const STATX_ATTR_ENCRYPTED: ::c_int = 0x0800;
1193 pub const STATX_ATTR_AUTOMOUNT: ::c_int = 0x1000;
1194 
1195 // sys/auxv.h
1196 pub const AT_NULL: ::c_ulong = 0;
1197 pub const AT_IGNORE: ::c_ulong = 1;
1198 pub const AT_EXECFD: ::c_ulong = 2;
1199 pub const AT_PHDR: ::c_ulong = 3;
1200 pub const AT_PHENT: ::c_ulong = 4;
1201 pub const AT_PHNUM: ::c_ulong = 5;
1202 pub const AT_PAGESZ: ::c_ulong = 6;
1203 pub const AT_BASE: ::c_ulong = 7;
1204 pub const AT_FLAGS: ::c_ulong = 8;
1205 pub const AT_ENTRY: ::c_ulong = 9;
1206 pub const AT_NOTELF: ::c_ulong = 10;
1207 pub const AT_UID: ::c_ulong = 11;
1208 pub const AT_EUID: ::c_ulong = 12;
1209 pub const AT_GID: ::c_ulong = 13;
1210 pub const AT_EGID: ::c_ulong = 14;
1211 pub const AT_PLATFORM: ::c_ulong = 15;
1212 pub const AT_HWCAP: ::c_ulong = 16;
1213 pub const AT_CLKTCK: ::c_ulong = 17;
1214 // AT_* values 18 through 22 are reserved
1215 pub const AT_SECURE: ::c_ulong = 23;
1216 pub const AT_BASE_PLATFORM: ::c_ulong = 24;
1217 pub const AT_RANDOM: ::c_ulong = 25;
1218 pub const AT_HWCAP2: ::c_ulong = 26;
1219 
1220 pub const AT_EXECFN: ::c_ulong = 31;
1221 
1222 //sys/timex.h
1223 pub const ADJ_OFFSET: ::c_uint = 0x0001;
1224 pub const ADJ_FREQUENCY: ::c_uint = 0x0002;
1225 pub const ADJ_MAXERROR: ::c_uint = 0x0004;
1226 pub const ADJ_ESTERROR: ::c_uint = 0x0008;
1227 pub const ADJ_STATUS: ::c_uint = 0x0010;
1228 pub const ADJ_TIMECONST: ::c_uint = 0x0020;
1229 pub const ADJ_TAI: ::c_uint = 0x0080;
1230 pub const ADJ_SETOFFSET: ::c_uint = 0x0100;
1231 pub const ADJ_MICRO: ::c_uint = 0x1000;
1232 pub const ADJ_NANO: ::c_uint = 0x2000;
1233 pub const ADJ_TICK: ::c_uint = 0x4000;
1234 pub const ADJ_OFFSET_SINGLESHOT: ::c_uint = 0x8001;
1235 pub const ADJ_OFFSET_SS_READ: ::c_uint = 0xa001;
1236 pub const MOD_OFFSET: ::c_uint = ADJ_OFFSET;
1237 pub const MOD_FREQUENCY: ::c_uint = ADJ_FREQUENCY;
1238 pub const MOD_MAXERROR: ::c_uint = ADJ_MAXERROR;
1239 pub const MOD_ESTERROR: ::c_uint = ADJ_ESTERROR;
1240 pub const MOD_STATUS: ::c_uint = ADJ_STATUS;
1241 pub const MOD_TIMECONST: ::c_uint = ADJ_TIMECONST;
1242 pub const MOD_CLKB: ::c_uint = ADJ_TICK;
1243 pub const MOD_CLKA: ::c_uint = ADJ_OFFSET_SINGLESHOT;
1244 pub const MOD_TAI: ::c_uint = ADJ_TAI;
1245 pub const MOD_MICRO: ::c_uint = ADJ_MICRO;
1246 pub const MOD_NANO: ::c_uint = ADJ_NANO;
1247 pub const STA_PLL: ::c_int = 0x0001;
1248 pub const STA_PPSFREQ: ::c_int = 0x0002;
1249 pub const STA_PPSTIME: ::c_int = 0x0004;
1250 pub const STA_FLL: ::c_int = 0x0008;
1251 pub const STA_INS: ::c_int = 0x0010;
1252 pub const STA_DEL: ::c_int = 0x0020;
1253 pub const STA_UNSYNC: ::c_int = 0x0040;
1254 pub const STA_FREQHOLD: ::c_int = 0x0080;
1255 pub const STA_PPSSIGNAL: ::c_int = 0x0100;
1256 pub const STA_PPSJITTER: ::c_int = 0x0200;
1257 pub const STA_PPSWANDER: ::c_int = 0x0400;
1258 pub const STA_PPSERROR: ::c_int = 0x0800;
1259 pub const STA_CLOCKERR: ::c_int = 0x1000;
1260 pub const STA_NANO: ::c_int = 0x2000;
1261 pub const STA_MODE: ::c_int = 0x4000;
1262 pub const STA_CLK: ::c_int = 0x8000;
1263 pub const STA_RONLY: ::c_int = STA_PPSSIGNAL
1264     | STA_PPSJITTER
1265     | STA_PPSWANDER
1266     | STA_PPSERROR
1267     | STA_CLOCKERR
1268     | STA_NANO
1269     | STA_MODE
1270     | STA_CLK;
1271 pub const NTP_API: ::c_int = 4;
1272 pub const TIME_OK: ::c_int = 0;
1273 pub const TIME_INS: ::c_int = 1;
1274 pub const TIME_DEL: ::c_int = 2;
1275 pub const TIME_OOP: ::c_int = 3;
1276 pub const TIME_WAIT: ::c_int = 4;
1277 pub const TIME_ERROR: ::c_int = 5;
1278 pub const TIME_BAD: ::c_int = TIME_ERROR;
1279 pub const MAXTC: ::c_long = 6;
1280 
1281 cfg_if! {
1282     if #[cfg(any(
1283         target_arch = "arm",
1284         target_arch = "x86",
1285         target_arch = "x86_64",
1286         target_arch = "s390x",
1287         target_arch = "riscv64",
1288         target_arch = "riscv32"
1289     ))] {
1290         pub const PTHREAD_STACK_MIN: ::size_t = 16384;
1291     } else if #[cfg(any(
1292                target_arch = "sparc",
1293                target_arch = "sparc64"
1294            ))] {
1295         pub const PTHREAD_STACK_MIN: ::size_t = 0x6000;
1296     } else {
1297         pub const PTHREAD_STACK_MIN: ::size_t = 131072;
1298     }
1299 }
1300 pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 3;
1301 
1302 pub const REG_STARTEND: ::c_int = 4;
1303 
1304 pub const REG_EEND: ::c_int = 14;
1305 pub const REG_ESIZE: ::c_int = 15;
1306 pub const REG_ERPAREN: ::c_int = 16;
1307 
1308 extern "C" {
1309     pub fn fgetspent_r(
1310         fp: *mut ::FILE,
1311         spbuf: *mut ::spwd,
1312         buf: *mut ::c_char,
1313         buflen: ::size_t,
1314         spbufp: *mut *mut ::spwd,
1315     ) -> ::c_int;
1316     pub fn sgetspent_r(
1317         s: *const ::c_char,
1318         spbuf: *mut ::spwd,
1319         buf: *mut ::c_char,
1320         buflen: ::size_t,
1321         spbufp: *mut *mut ::spwd,
1322     ) -> ::c_int;
1323     pub fn getspent_r(
1324         spbuf: *mut ::spwd,
1325         buf: *mut ::c_char,
1326         buflen: ::size_t,
1327         spbufp: *mut *mut ::spwd,
1328     ) -> ::c_int;
1329     pub fn qsort_r(
1330         base: *mut ::c_void,
1331         num: ::size_t,
1332         size: ::size_t,
1333         compar: ::Option<
1334             unsafe extern "C" fn(
1335                 *const ::c_void,
1336                 *const ::c_void,
1337                 *mut ::c_void,
1338             ) -> ::c_int,
1339         >,
1340         arg: *mut ::c_void,
1341     );
1342     pub fn sendmmsg(
1343         sockfd: ::c_int,
1344         msgvec: *mut ::mmsghdr,
1345         vlen: ::c_uint,
1346         flags: ::c_int,
1347     ) -> ::c_int;
1348     pub fn recvmmsg(
1349         sockfd: ::c_int,
1350         msgvec: *mut ::mmsghdr,
1351         vlen: ::c_uint,
1352         flags: ::c_int,
1353         timeout: *mut ::timespec,
1354     ) -> ::c_int;
1355 
1356     pub fn getrlimit64(
1357         resource: ::__rlimit_resource_t,
1358         rlim: *mut ::rlimit64,
1359     ) -> ::c_int;
1360     pub fn setrlimit64(
1361         resource: ::__rlimit_resource_t,
1362         rlim: *const ::rlimit64,
1363     ) -> ::c_int;
1364     pub fn getrlimit(
1365         resource: ::__rlimit_resource_t,
1366         rlim: *mut ::rlimit,
1367     ) -> ::c_int;
1368     pub fn setrlimit(
1369         resource: ::__rlimit_resource_t,
1370         rlim: *const ::rlimit,
1371     ) -> ::c_int;
1372     pub fn prlimit(
1373         pid: ::pid_t,
1374         resource: ::__rlimit_resource_t,
1375         new_limit: *const ::rlimit,
1376         old_limit: *mut ::rlimit,
1377     ) -> ::c_int;
1378     pub fn prlimit64(
1379         pid: ::pid_t,
1380         resource: ::__rlimit_resource_t,
1381         new_limit: *const ::rlimit64,
1382         old_limit: *mut ::rlimit64,
1383     ) -> ::c_int;
1384     pub fn utmpname(file: *const ::c_char) -> ::c_int;
1385     pub fn utmpxname(file: *const ::c_char) -> ::c_int;
1386     pub fn getutxent() -> *mut utmpx;
1387     pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
1388     pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
1389     pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
1390     pub fn setutxent();
1391     pub fn endutxent();
1392     pub fn getpt() -> ::c_int;
1393     pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int;
1394     pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
1395     pub fn statx(
1396         dirfd: ::c_int,
1397         pathname: *const c_char,
1398         flags: ::c_int,
1399         mask: ::c_uint,
1400         statxbuf: *mut statx,
1401     ) -> ::c_int;
1402     pub fn getrandom(
1403         buf: *mut ::c_void,
1404         buflen: ::size_t,
1405         flags: ::c_uint,
1406     ) -> ::ssize_t;
1407 
1408     pub fn memmem(
1409         haystack: *const ::c_void,
1410         haystacklen: ::size_t,
1411         needle: *const ::c_void,
1412         needlelen: ::size_t,
1413     ) -> *mut ::c_void;
1414     pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
1415 
1416     pub fn adjtimex(buf: *mut timex) -> ::c_int;
1417     pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
1418     #[link_name = "ntp_gettimex"]
1419     pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
1420     pub fn copy_file_range(
1421         fd_in: ::c_int,
1422         off_in: *mut ::off64_t,
1423         fd_out: ::c_int,
1424         off_out: *mut ::off64_t,
1425         len: ::size_t,
1426         flags: ::c_uint,
1427     ) -> ::ssize_t;
1428     pub fn fanotify_mark(
1429         fd: ::c_int,
1430         flags: ::c_uint,
1431         mask: u64,
1432         dirfd: ::c_int,
1433         path: *const ::c_char,
1434     ) -> ::c_int;
1435     pub fn preadv2(
1436         fd: ::c_int,
1437         iov: *const ::iovec,
1438         iovcnt: ::c_int,
1439         offset: ::off_t,
1440         flags: ::c_int,
1441     ) -> ::ssize_t;
1442     pub fn pwritev2(
1443         fd: ::c_int,
1444         iov: *const ::iovec,
1445         iovcnt: ::c_int,
1446         offset: ::off_t,
1447         flags: ::c_int,
1448     ) -> ::ssize_t;
1449 }
1450 
1451 extern "C" {
1452     pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
1453     pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int;
1454     pub fn glob64(
1455         pattern: *const ::c_char,
1456         flags: ::c_int,
1457         errfunc: ::Option<
1458             extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int,
1459         >,
1460         pglob: *mut glob64_t,
1461     ) -> ::c_int;
1462     pub fn globfree64(pglob: *mut glob64_t);
1463     pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
1464     pub fn pthread_attr_getaffinity_np(
1465         attr: *const ::pthread_attr_t,
1466         cpusetsize: ::size_t,
1467         cpuset: *mut ::cpu_set_t,
1468     ) -> ::c_int;
1469     pub fn pthread_attr_setaffinity_np(
1470         attr: *mut ::pthread_attr_t,
1471         cpusetsize: ::size_t,
1472         cpuset: *const ::cpu_set_t,
1473     ) -> ::c_int;
1474     pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int;
1475     pub fn setpriority(
1476         which: ::__priority_which_t,
1477         who: ::id_t,
1478         prio: ::c_int,
1479     ) -> ::c_int;
1480     pub fn pthread_getaffinity_np(
1481         thread: ::pthread_t,
1482         cpusetsize: ::size_t,
1483         cpuset: *mut ::cpu_set_t,
1484     ) -> ::c_int;
1485     pub fn pthread_setaffinity_np(
1486         thread: ::pthread_t,
1487         cpusetsize: ::size_t,
1488         cpuset: *const ::cpu_set_t,
1489     ) -> ::c_int;
1490     pub fn pthread_rwlockattr_getkind_np(
1491         attr: *const ::pthread_rwlockattr_t,
1492         val: *mut ::c_int,
1493     ) -> ::c_int;
1494     pub fn pthread_rwlockattr_setkind_np(
1495         attr: *mut ::pthread_rwlockattr_t,
1496         val: ::c_int,
1497     ) -> ::c_int;
1498     pub fn sched_getcpu() -> ::c_int;
1499     pub fn mallinfo() -> ::mallinfo;
1500     pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
1501     pub fn getpwent_r(
1502         pwd: *mut ::passwd,
1503         buf: *mut ::c_char,
1504         buflen: ::size_t,
1505         result: *mut *mut ::passwd,
1506     ) -> ::c_int;
1507     pub fn getgrent_r(
1508         grp: *mut ::group,
1509         buf: *mut ::c_char,
1510         buflen: ::size_t,
1511         result: *mut *mut ::group,
1512     ) -> ::c_int;
1513     pub fn pthread_getname_np(
1514         thread: ::pthread_t,
1515         name: *mut ::c_char,
1516         len: ::size_t,
1517     ) -> ::c_int;
1518     pub fn pthread_setname_np(
1519         thread: ::pthread_t,
1520         name: *const ::c_char,
1521     ) -> ::c_int;
1522 }
1523 
1524 extern "C" {
1525     pub fn dlmopen(
1526         lmid: Lmid_t,
1527         filename: *const ::c_char,
1528         flag: ::c_int,
1529     ) -> *mut ::c_void;
1530     pub fn dlinfo(
1531         handle: *mut ::c_void,
1532         request: ::c_int,
1533         info: *mut ::c_void,
1534     ) -> ::c_int;
1535 }
1536 
1537 cfg_if! {
1538     if #[cfg(any(target_arch = "x86",
1539                  target_arch = "arm",
1540                  target_arch = "mips",
1541                  target_arch = "powerpc",
1542                  target_arch = "sparc",
1543                  target_arch = "riscv32"))] {
1544         mod b32;
1545         pub use self::b32::*;
1546     } else if #[cfg(any(target_arch = "x86_64",
1547                         target_arch = "aarch64",
1548                         target_arch = "powerpc64",
1549                         target_arch = "mips64",
1550                         target_arch = "s390x",
1551                         target_arch = "sparc64",
1552                         target_arch = "riscv64"))] {
1553         mod b64;
1554         pub use self::b64::*;
1555     } else {
1556         // Unknown target_arch
1557     }
1558 }
1559 
1560 cfg_if! {
1561     if #[cfg(libc_align)] {
1562         mod align;
1563         pub use self::align::*;
1564     } else {
1565         mod no_align;
1566         pub use self::no_align::*;
1567     }
1568 }
1569