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