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