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 mallinfo2 {
132         pub arena: ::size_t,
133         pub ordblks: ::size_t,
134         pub smblks: ::size_t,
135         pub hblks: ::size_t,
136         pub hblkhd: ::size_t,
137         pub usmblks: ::size_t,
138         pub fsmblks: ::size_t,
139         pub uordblks: ::size_t,
140         pub fordblks: ::size_t,
141         pub keepcost: ::size_t,
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 rtentry {
165         pub rt_pad1: ::c_ulong,
166         pub rt_dst: ::sockaddr,
167         pub rt_gateway: ::sockaddr,
168         pub rt_genmask: ::sockaddr,
169         pub rt_flags: ::c_ushort,
170         pub rt_pad2: ::c_short,
171         pub rt_pad3: ::c_ulong,
172         pub rt_tos: ::c_uchar,
173         pub rt_class: ::c_uchar,
174         #[cfg(target_pointer_width = "64")]
175         pub rt_pad4: [::c_short; 3usize],
176         #[cfg(not(target_pointer_width = "64"))]
177         pub rt_pad4: ::c_short,
178         pub rt_metric: ::c_short,
179         pub rt_dev: *mut ::c_char,
180         pub rt_mtu: ::c_ulong,
181         pub rt_window: ::c_ulong,
182         pub rt_irtt: ::c_ushort,
183     }
184 
185     pub struct timex {
186         pub modes: ::c_uint,
187         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
188         pub offset: i64,
189         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
190         pub offset: ::c_long,
191         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
192         pub freq: i64,
193         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
194         pub freq: ::c_long,
195         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
196         pub maxerror: i64,
197         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
198         pub maxerror: ::c_long,
199         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
200         pub esterror: i64,
201         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
202         pub esterror: ::c_long,
203         pub status: ::c_int,
204         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
205         pub constant: i64,
206         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
207         pub constant: ::c_long,
208         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
209         pub precision: i64,
210         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
211         pub precision: ::c_long,
212         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
213         pub tolerance: i64,
214         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
215         pub tolerance: ::c_long,
216         pub time: ::timeval,
217         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
218         pub tick: i64,
219         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
220         pub tick: ::c_long,
221         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
222         pub ppsfreq: i64,
223         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
224         pub ppsfreq: ::c_long,
225         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
226         pub jitter: i64,
227         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
228         pub jitter: ::c_long,
229         pub shift: ::c_int,
230         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
231         pub stabil: i64,
232         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
233         pub stabil: ::c_long,
234         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
235         pub jitcnt: i64,
236         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
237         pub jitcnt: ::c_long,
238         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
239         pub calcnt: i64,
240         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
241         pub calcnt: ::c_long,
242         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
243         pub errcnt: i64,
244         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
245         pub errcnt: ::c_long,
246         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
247         pub stbcnt: i64,
248         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
249         pub stbcnt: ::c_long,
250         pub tai: ::c_int,
251         pub __unused1: i32,
252         pub __unused2: i32,
253         pub __unused3: i32,
254         pub __unused4: i32,
255         pub __unused5: i32,
256         pub __unused6: i32,
257         pub __unused7: i32,
258         pub __unused8: i32,
259         pub __unused9: i32,
260         pub __unused10: i32,
261         pub __unused11: i32,
262     }
263 
264     pub struct ntptimeval {
265         pub time: ::timeval,
266         pub maxerror: ::c_long,
267         pub esterror: ::c_long,
268         pub tai: ::c_long,
269         pub __glibc_reserved1: ::c_long,
270         pub __glibc_reserved2: ::c_long,
271         pub __glibc_reserved3: ::c_long,
272         pub __glibc_reserved4: ::c_long,
273     }
274 
275     pub struct regex_t {
276         __buffer: *mut ::c_void,
277         __allocated: ::size_t,
278         __used: ::size_t,
279         __syntax: ::c_ulong,
280         __fastmap: *mut ::c_char,
281         __translate: *mut ::c_char,
282         __re_nsub: ::size_t,
283         __bitfield: u8,
284     }
285 
286     pub struct Elf64_Chdr {
287         pub ch_type: ::Elf64_Word,
288         pub ch_reserved: ::Elf64_Word,
289         pub ch_size: ::Elf64_Xword,
290         pub ch_addralign: ::Elf64_Xword,
291     }
292 
293     pub struct Elf32_Chdr {
294         pub ch_type: ::Elf32_Word,
295         pub ch_size: ::Elf32_Word,
296         pub ch_addralign: ::Elf32_Word,
297     }
298 
299     pub struct seminfo {
300         pub semmap: ::c_int,
301         pub semmni: ::c_int,
302         pub semmns: ::c_int,
303         pub semmnu: ::c_int,
304         pub semmsl: ::c_int,
305         pub semopm: ::c_int,
306         pub semume: ::c_int,
307         pub semusz: ::c_int,
308         pub semvmx: ::c_int,
309         pub semaem: ::c_int,
310     }
311 }
312 
313 impl siginfo_t {
si_addr(&self) -> *mut ::c_void314     pub unsafe fn si_addr(&self) -> *mut ::c_void {
315         #[repr(C)]
316         struct siginfo_sigfault {
317             _si_signo: ::c_int,
318             _si_errno: ::c_int,
319             _si_code: ::c_int,
320             si_addr: *mut ::c_void,
321         }
322         (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr
323     }
324 
si_value(&self) -> ::sigval325     pub unsafe fn si_value(&self) -> ::sigval {
326         #[repr(C)]
327         struct siginfo_timer {
328             _si_signo: ::c_int,
329             _si_errno: ::c_int,
330             _si_code: ::c_int,
331             _si_tid: ::c_int,
332             _si_overrun: ::c_int,
333             si_sigval: ::sigval,
334         }
335         (*(self as *const siginfo_t as *const siginfo_timer)).si_sigval
336     }
337 }
338 
339 cfg_if! {
340     if #[cfg(libc_union)] {
341         // Internal, for casts to access union fields
342         #[repr(C)]
343         struct sifields_sigchld {
344             si_pid: ::pid_t,
345             si_uid: ::uid_t,
346             si_status: ::c_int,
347             si_utime: ::c_long,
348             si_stime: ::c_long,
349         }
350         impl ::Copy for sifields_sigchld {}
351         impl ::Clone for sifields_sigchld {
352             fn clone(&self) -> sifields_sigchld {
353                 *self
354             }
355         }
356 
357         // Internal, for casts to access union fields
358         #[repr(C)]
359         union sifields {
360             _align_pointer: *mut ::c_void,
361             sigchld: sifields_sigchld,
362         }
363 
364         // Internal, for casts to access union fields. Note that some variants
365         // of sifields start with a pointer, which makes the alignment of
366         // sifields vary on 32-bit and 64-bit architectures.
367         #[repr(C)]
368         struct siginfo_f {
369             _siginfo_base: [::c_int; 3],
370             sifields: sifields,
371         }
372 
373         impl siginfo_t {
374             unsafe fn sifields(&self) -> &sifields {
375                 &(*(self as *const siginfo_t as *const siginfo_f)).sifields
376             }
377 
378             pub unsafe fn si_pid(&self) -> ::pid_t {
379                 self.sifields().sigchld.si_pid
380             }
381 
382             pub unsafe fn si_uid(&self) -> ::uid_t {
383                 self.sifields().sigchld.si_uid
384             }
385 
386             pub unsafe fn si_status(&self) -> ::c_int {
387                 self.sifields().sigchld.si_status
388             }
389 
390             pub unsafe fn si_utime(&self) -> ::c_long {
391                 self.sifields().sigchld.si_utime
392             }
393 
394             pub unsafe fn si_stime(&self) -> ::c_long {
395                 self.sifields().sigchld.si_stime
396             }
397         }
398     }
399 }
400 
401 s_no_extra_traits! {
402     pub struct utmpx {
403         pub ut_type: ::c_short,
404         pub ut_pid: ::pid_t,
405         pub ut_line: [::c_char; __UT_LINESIZE],
406         pub ut_id: [::c_char; 4],
407 
408         pub ut_user: [::c_char; __UT_NAMESIZE],
409         pub ut_host: [::c_char; __UT_HOSTSIZE],
410         pub ut_exit: __exit_status,
411 
412         #[cfg(any(target_arch = "aarch64",
413                   target_arch = "s390x",
414                   all(target_pointer_width = "32",
415                       not(target_arch = "x86_64"))))]
416         pub ut_session: ::c_long,
417         #[cfg(any(target_arch = "aarch64",
418                   target_arch = "s390x",
419                   all(target_pointer_width = "32",
420                       not(target_arch = "x86_64"))))]
421         pub ut_tv: ::timeval,
422 
423         #[cfg(not(any(target_arch = "aarch64",
424                       target_arch = "s390x",
425                       all(target_pointer_width = "32",
426                           not(target_arch = "x86_64")))))]
427         pub ut_session: i32,
428         #[cfg(not(any(target_arch = "aarch64",
429                       target_arch = "s390x",
430                       all(target_pointer_width = "32",
431                           not(target_arch = "x86_64")))))]
432         pub ut_tv: __timeval,
433 
434         pub ut_addr_v6: [i32; 4],
435         __glibc_reserved: [::c_char; 20],
436     }
437 }
438 
439 cfg_if! {
440     if #[cfg(feature = "extra_traits")] {
441         impl PartialEq for utmpx {
442             fn eq(&self, other: &utmpx) -> bool {
443                 self.ut_type == other.ut_type
444                     && self.ut_pid == other.ut_pid
445                     && self.ut_line == other.ut_line
446                     && self.ut_id == other.ut_id
447                     && self.ut_user == other.ut_user
448                     && self
449                     .ut_host
450                     .iter()
451                     .zip(other.ut_host.iter())
452                     .all(|(a,b)| a == b)
453                     && self.ut_exit == other.ut_exit
454                     && self.ut_session == other.ut_session
455                     && self.ut_tv == other.ut_tv
456                     && self.ut_addr_v6 == other.ut_addr_v6
457                     && self.__glibc_reserved == other.__glibc_reserved
458             }
459         }
460 
461         impl Eq for utmpx {}
462 
463         impl ::fmt::Debug for utmpx {
464             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
465                 f.debug_struct("utmpx")
466                     .field("ut_type", &self.ut_type)
467                     .field("ut_pid", &self.ut_pid)
468                     .field("ut_line", &self.ut_line)
469                     .field("ut_id", &self.ut_id)
470                     .field("ut_user", &self.ut_user)
471                 // FIXME: .field("ut_host", &self.ut_host)
472                     .field("ut_exit", &self.ut_exit)
473                     .field("ut_session", &self.ut_session)
474                     .field("ut_tv", &self.ut_tv)
475                     .field("ut_addr_v6", &self.ut_addr_v6)
476                     .field("__glibc_reserved", &self.__glibc_reserved)
477                     .finish()
478             }
479         }
480 
481         impl ::hash::Hash for utmpx {
482             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
483                 self.ut_type.hash(state);
484                 self.ut_pid.hash(state);
485                 self.ut_line.hash(state);
486                 self.ut_id.hash(state);
487                 self.ut_user.hash(state);
488                 self.ut_host.hash(state);
489                 self.ut_exit.hash(state);
490                 self.ut_session.hash(state);
491                 self.ut_tv.hash(state);
492                 self.ut_addr_v6.hash(state);
493                 self.__glibc_reserved.hash(state);
494             }
495         }
496     }
497 }
498 
499 // include/uapi/asm-generic/hugetlb_encode.h
500 pub const HUGETLB_FLAG_ENCODE_SHIFT: ::c_int = 26;
501 pub const HUGETLB_FLAG_ENCODE_MASK: ::c_int = 0x3f;
502 
503 pub const HUGETLB_FLAG_ENCODE_64KB: ::c_int = 16 << HUGETLB_FLAG_ENCODE_SHIFT;
504 pub const HUGETLB_FLAG_ENCODE_512KB: ::c_int = 19 << HUGETLB_FLAG_ENCODE_SHIFT;
505 pub const HUGETLB_FLAG_ENCODE_1MB: ::c_int = 20 << HUGETLB_FLAG_ENCODE_SHIFT;
506 pub const HUGETLB_FLAG_ENCODE_2MB: ::c_int = 21 << HUGETLB_FLAG_ENCODE_SHIFT;
507 pub const HUGETLB_FLAG_ENCODE_8MB: ::c_int = 23 << HUGETLB_FLAG_ENCODE_SHIFT;
508 pub const HUGETLB_FLAG_ENCODE_16MB: ::c_int = 24 << HUGETLB_FLAG_ENCODE_SHIFT;
509 pub const HUGETLB_FLAG_ENCODE_32MB: ::c_int = 25 << HUGETLB_FLAG_ENCODE_SHIFT;
510 pub const HUGETLB_FLAG_ENCODE_256MB: ::c_int = 28 << HUGETLB_FLAG_ENCODE_SHIFT;
511 pub const HUGETLB_FLAG_ENCODE_512MB: ::c_int = 29 << HUGETLB_FLAG_ENCODE_SHIFT;
512 pub const HUGETLB_FLAG_ENCODE_1GB: ::c_int = 30 << HUGETLB_FLAG_ENCODE_SHIFT;
513 pub const HUGETLB_FLAG_ENCODE_2GB: ::c_int = 31 << HUGETLB_FLAG_ENCODE_SHIFT;
514 pub const HUGETLB_FLAG_ENCODE_16GB: ::c_int = 34 << HUGETLB_FLAG_ENCODE_SHIFT;
515 
516 // include/uapi/linux/mman.h
517 /*
518  * Huge page size encoding when MAP_HUGETLB is specified, and a huge page
519  * size other than the default is desired.  See hugetlb_encode.h.
520  * All known huge page size encodings are provided here.  It is the
521  * responsibility of the application to know which sizes are supported on
522  * the running system.  See mmap(2) man page for details.
523  */
524 pub const MAP_HUGE_SHIFT: ::c_int = HUGETLB_FLAG_ENCODE_SHIFT;
525 pub const MAP_HUGE_MASK: ::c_int = HUGETLB_FLAG_ENCODE_MASK;
526 
527 pub const MAP_HUGE_64KB: ::c_int = HUGETLB_FLAG_ENCODE_64KB;
528 pub const MAP_HUGE_512KB: ::c_int = HUGETLB_FLAG_ENCODE_512KB;
529 pub const MAP_HUGE_1MB: ::c_int = HUGETLB_FLAG_ENCODE_1MB;
530 pub const MAP_HUGE_2MB: ::c_int = HUGETLB_FLAG_ENCODE_2MB;
531 pub const MAP_HUGE_8MB: ::c_int = HUGETLB_FLAG_ENCODE_8MB;
532 pub const MAP_HUGE_16MB: ::c_int = HUGETLB_FLAG_ENCODE_16MB;
533 pub const MAP_HUGE_32MB: ::c_int = HUGETLB_FLAG_ENCODE_32MB;
534 pub const MAP_HUGE_256MB: ::c_int = HUGETLB_FLAG_ENCODE_256MB;
535 pub const MAP_HUGE_512MB: ::c_int = HUGETLB_FLAG_ENCODE_512MB;
536 pub const MAP_HUGE_1GB: ::c_int = HUGETLB_FLAG_ENCODE_1GB;
537 pub const MAP_HUGE_2GB: ::c_int = HUGETLB_FLAG_ENCODE_2GB;
538 pub const MAP_HUGE_16GB: ::c_int = HUGETLB_FLAG_ENCODE_16GB;
539 
540 pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
541 pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
542 pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
543 pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
544 pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
545 pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
546 pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
547 pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
548 pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
549 pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
550 pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
551 pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = 16;
552 pub const RLIM_NLIMITS: ::__rlimit_resource_t = RLIMIT_NLIMITS;
553 
554 pub const PRIO_PROCESS: ::__priority_which_t = 0;
555 pub const PRIO_PGRP: ::__priority_which_t = 1;
556 pub const PRIO_USER: ::__priority_which_t = 2;
557 
558 pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
559 
560 pub const __UT_LINESIZE: usize = 32;
561 pub const __UT_NAMESIZE: usize = 32;
562 pub const __UT_HOSTSIZE: usize = 256;
563 pub const EMPTY: ::c_short = 0;
564 pub const RUN_LVL: ::c_short = 1;
565 pub const BOOT_TIME: ::c_short = 2;
566 pub const NEW_TIME: ::c_short = 3;
567 pub const OLD_TIME: ::c_short = 4;
568 pub const INIT_PROCESS: ::c_short = 5;
569 pub const LOGIN_PROCESS: ::c_short = 6;
570 pub const USER_PROCESS: ::c_short = 7;
571 pub const DEAD_PROCESS: ::c_short = 8;
572 pub const ACCOUNTING: ::c_short = 9;
573 
574 // dlfcn.h
575 pub const LM_ID_BASE: ::c_long = 0;
576 pub const LM_ID_NEWLM: ::c_long = -1;
577 
578 pub const RTLD_DI_LMID: ::c_int = 1;
579 pub const RTLD_DI_LINKMAP: ::c_int = 2;
580 pub const RTLD_DI_CONFIGADDR: ::c_int = 3;
581 pub const RTLD_DI_SERINFO: ::c_int = 4;
582 pub const RTLD_DI_SERINFOSIZE: ::c_int = 5;
583 pub const RTLD_DI_ORIGIN: ::c_int = 6;
584 pub const RTLD_DI_PROFILENAME: ::c_int = 7;
585 pub const RTLD_DI_PROFILEOUT: ::c_int = 8;
586 pub const RTLD_DI_TLS_MODID: ::c_int = 9;
587 pub const RTLD_DI_TLS_DATA: ::c_int = 10;
588 
589 pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
590 
591 pub const SOL_RXRPC: ::c_int = 272;
592 pub const SOL_PPPOL2TP: ::c_int = 273;
593 pub const SOL_PNPIPE: ::c_int = 275;
594 pub const SOL_RDS: ::c_int = 276;
595 pub const SOL_IUCV: ::c_int = 277;
596 pub const SOL_CAIF: ::c_int = 278;
597 pub const SOL_NFC: ::c_int = 280;
598 pub const SOL_XDP: ::c_int = 283;
599 
600 pub const MSG_TRYHARD: ::c_int = 4;
601 
602 pub const LC_PAPER: ::c_int = 7;
603 pub const LC_NAME: ::c_int = 8;
604 pub const LC_ADDRESS: ::c_int = 9;
605 pub const LC_TELEPHONE: ::c_int = 10;
606 pub const LC_MEASUREMENT: ::c_int = 11;
607 pub const LC_IDENTIFICATION: ::c_int = 12;
608 pub const LC_PAPER_MASK: ::c_int = 1 << LC_PAPER;
609 pub const LC_NAME_MASK: ::c_int = 1 << LC_NAME;
610 pub const LC_ADDRESS_MASK: ::c_int = 1 << LC_ADDRESS;
611 pub const LC_TELEPHONE_MASK: ::c_int = 1 << LC_TELEPHONE;
612 pub const LC_MEASUREMENT_MASK: ::c_int = 1 << LC_MEASUREMENT;
613 pub const LC_IDENTIFICATION_MASK: ::c_int = 1 << LC_IDENTIFICATION;
614 pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK
615     | ::LC_NUMERIC_MASK
616     | ::LC_TIME_MASK
617     | ::LC_COLLATE_MASK
618     | ::LC_MONETARY_MASK
619     | ::LC_MESSAGES_MASK
620     | LC_PAPER_MASK
621     | LC_NAME_MASK
622     | LC_ADDRESS_MASK
623     | LC_TELEPHONE_MASK
624     | LC_MEASUREMENT_MASK
625     | LC_IDENTIFICATION_MASK;
626 
627 pub const ENOTSUP: ::c_int = EOPNOTSUPP;
628 
629 pub const SOCK_SEQPACKET: ::c_int = 5;
630 pub const SOCK_DCCP: ::c_int = 6;
631 pub const SOCK_PACKET: ::c_int = 10;
632 
633 pub const FAN_MARK_INODE: ::c_uint = 0x0000_0000;
634 pub const FAN_MARK_MOUNT: ::c_uint = 0x0000_0010;
635 // NOTE: FAN_MARK_FILESYSTEM requires Linux Kernel >= 4.20.0
636 pub const FAN_MARK_FILESYSTEM: ::c_uint = 0x0000_0100;
637 
638 pub const AF_IB: ::c_int = 27;
639 pub const AF_MPLS: ::c_int = 28;
640 pub const AF_NFC: ::c_int = 39;
641 pub const AF_VSOCK: ::c_int = 40;
642 pub const AF_XDP: ::c_int = 44;
643 pub const PF_IB: ::c_int = AF_IB;
644 pub const PF_MPLS: ::c_int = AF_MPLS;
645 pub const PF_NFC: ::c_int = AF_NFC;
646 pub const PF_VSOCK: ::c_int = AF_VSOCK;
647 pub const PF_XDP: ::c_int = AF_XDP;
648 
649 /* DCCP socket options */
650 pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1;
651 pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2;
652 pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3;
653 pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4;
654 pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5;
655 pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6;
656 pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10;
657 pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11;
658 pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12;
659 pub const DCCP_SOCKOPT_CCID: ::c_int = 13;
660 pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14;
661 pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15;
662 pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16;
663 pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17;
664 pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128;
665 pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192;
666 
667 /// maximum number of services provided on the same listening port
668 pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32;
669 
670 pub const SIGEV_THREAD_ID: ::c_int = 4;
671 
672 pub const BUFSIZ: ::c_uint = 8192;
673 pub const TMP_MAX: ::c_uint = 238328;
674 pub const FOPEN_MAX: ::c_uint = 16;
675 pub const FILENAME_MAX: ::c_uint = 4096;
676 pub const POSIX_MADV_DONTNEED: ::c_int = 4;
677 pub const _SC_EQUIV_CLASS_MAX: ::c_int = 41;
678 pub const _SC_CHARCLASS_NAME_MAX: ::c_int = 45;
679 pub const _SC_PII: ::c_int = 53;
680 pub const _SC_PII_XTI: ::c_int = 54;
681 pub const _SC_PII_SOCKET: ::c_int = 55;
682 pub const _SC_PII_INTERNET: ::c_int = 56;
683 pub const _SC_PII_OSI: ::c_int = 57;
684 pub const _SC_POLL: ::c_int = 58;
685 pub const _SC_SELECT: ::c_int = 59;
686 pub const _SC_PII_INTERNET_STREAM: ::c_int = 61;
687 pub const _SC_PII_INTERNET_DGRAM: ::c_int = 62;
688 pub const _SC_PII_OSI_COTS: ::c_int = 63;
689 pub const _SC_PII_OSI_CLTS: ::c_int = 64;
690 pub const _SC_PII_OSI_M: ::c_int = 65;
691 pub const _SC_T_IOV_MAX: ::c_int = 66;
692 pub const _SC_2_C_VERSION: ::c_int = 96;
693 pub const _SC_CHAR_BIT: ::c_int = 101;
694 pub const _SC_CHAR_MAX: ::c_int = 102;
695 pub const _SC_CHAR_MIN: ::c_int = 103;
696 pub const _SC_INT_MAX: ::c_int = 104;
697 pub const _SC_INT_MIN: ::c_int = 105;
698 pub const _SC_LONG_BIT: ::c_int = 106;
699 pub const _SC_WORD_BIT: ::c_int = 107;
700 pub const _SC_MB_LEN_MAX: ::c_int = 108;
701 pub const _SC_SSIZE_MAX: ::c_int = 110;
702 pub const _SC_SCHAR_MAX: ::c_int = 111;
703 pub const _SC_SCHAR_MIN: ::c_int = 112;
704 pub const _SC_SHRT_MAX: ::c_int = 113;
705 pub const _SC_SHRT_MIN: ::c_int = 114;
706 pub const _SC_UCHAR_MAX: ::c_int = 115;
707 pub const _SC_UINT_MAX: ::c_int = 116;
708 pub const _SC_ULONG_MAX: ::c_int = 117;
709 pub const _SC_USHRT_MAX: ::c_int = 118;
710 pub const _SC_NL_ARGMAX: ::c_int = 119;
711 pub const _SC_NL_LANGMAX: ::c_int = 120;
712 pub const _SC_NL_MSGMAX: ::c_int = 121;
713 pub const _SC_NL_NMAX: ::c_int = 122;
714 pub const _SC_NL_SETMAX: ::c_int = 123;
715 pub const _SC_NL_TEXTMAX: ::c_int = 124;
716 pub const _SC_BASE: ::c_int = 134;
717 pub const _SC_C_LANG_SUPPORT: ::c_int = 135;
718 pub const _SC_C_LANG_SUPPORT_R: ::c_int = 136;
719 pub const _SC_DEVICE_IO: ::c_int = 140;
720 pub const _SC_DEVICE_SPECIFIC: ::c_int = 141;
721 pub const _SC_DEVICE_SPECIFIC_R: ::c_int = 142;
722 pub const _SC_FD_MGMT: ::c_int = 143;
723 pub const _SC_FIFO: ::c_int = 144;
724 pub const _SC_PIPE: ::c_int = 145;
725 pub const _SC_FILE_ATTRIBUTES: ::c_int = 146;
726 pub const _SC_FILE_LOCKING: ::c_int = 147;
727 pub const _SC_FILE_SYSTEM: ::c_int = 148;
728 pub const _SC_MULTI_PROCESS: ::c_int = 150;
729 pub const _SC_SINGLE_PROCESS: ::c_int = 151;
730 pub const _SC_NETWORKING: ::c_int = 152;
731 pub const _SC_REGEX_VERSION: ::c_int = 156;
732 pub const _SC_SIGNALS: ::c_int = 158;
733 pub const _SC_SYSTEM_DATABASE: ::c_int = 162;
734 pub const _SC_SYSTEM_DATABASE_R: ::c_int = 163;
735 pub const _SC_USER_GROUPS: ::c_int = 166;
736 pub const _SC_USER_GROUPS_R: ::c_int = 167;
737 pub const _SC_LEVEL1_ICACHE_SIZE: ::c_int = 185;
738 pub const _SC_LEVEL1_ICACHE_ASSOC: ::c_int = 186;
739 pub const _SC_LEVEL1_ICACHE_LINESIZE: ::c_int = 187;
740 pub const _SC_LEVEL1_DCACHE_SIZE: ::c_int = 188;
741 pub const _SC_LEVEL1_DCACHE_ASSOC: ::c_int = 189;
742 pub const _SC_LEVEL1_DCACHE_LINESIZE: ::c_int = 190;
743 pub const _SC_LEVEL2_CACHE_SIZE: ::c_int = 191;
744 pub const _SC_LEVEL2_CACHE_ASSOC: ::c_int = 192;
745 pub const _SC_LEVEL2_CACHE_LINESIZE: ::c_int = 193;
746 pub const _SC_LEVEL3_CACHE_SIZE: ::c_int = 194;
747 pub const _SC_LEVEL3_CACHE_ASSOC: ::c_int = 195;
748 pub const _SC_LEVEL3_CACHE_LINESIZE: ::c_int = 196;
749 pub const _SC_LEVEL4_CACHE_SIZE: ::c_int = 197;
750 pub const _SC_LEVEL4_CACHE_ASSOC: ::c_int = 198;
751 pub const _SC_LEVEL4_CACHE_LINESIZE: ::c_int = 199;
752 pub const O_ACCMODE: ::c_int = 3;
753 pub const ST_RELATIME: ::c_ulong = 4096;
754 pub const NI_MAXHOST: ::socklen_t = 1025;
755 
756 cfg_if! {
757     if #[cfg(not(target_arch = "s390x"))] {
758         pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5;
759         pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff;
760         pub const AFS_SUPER_MAGIC: ::c_long = 0x5346414f;
761         pub const AUTOFS_SUPER_MAGIC: ::c_long = 0x0187;
762         pub const BINDERFS_SUPER_MAGIC: ::c_long = 0x6c6f6f70;
763         pub const BPF_FS_MAGIC: ::c_long = 0xcafe4a11;
764         pub const BTRFS_SUPER_MAGIC: ::c_long = 0x9123683e;
765         pub const CGROUP2_SUPER_MAGIC: ::c_long = 0x63677270;
766         pub const CGROUP_SUPER_MAGIC: ::c_long = 0x27e0eb;
767         pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245;
768         pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45;
769         pub const DEBUGFS_MAGIC: ::c_long = 0x64626720;
770         pub const DEVPTS_SUPER_MAGIC: ::c_long = 0x1cd1;
771         pub const ECRYPTFS_SUPER_MAGIC: ::c_long = 0xf15f;
772         pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53;
773         pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53;
774         pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53;
775         pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53;
776         pub const F2FS_SUPER_MAGIC: ::c_long = 0xf2f52010;
777         pub const FUTEXFS_SUPER_MAGIC: ::c_long = 0xbad1dea;
778         pub const HOSTFS_SUPER_MAGIC: ::c_long = 0x00c0ffee;
779         pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849;
780         pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6;
781         pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660;
782         pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6;
783         pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478;
784         pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468;
785         pub const MINIX3_SUPER_MAGIC: ::c_long = 0x4d5a;
786         pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f;
787         pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f;
788         pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44;
789         pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c;
790         pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969;
791         pub const NILFS_SUPER_MAGIC: ::c_long = 0x3434;
792         pub const OCFS2_SUPER_MAGIC: ::c_long = 0x7461636f;
793         pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1;
794         pub const OVERLAYFS_SUPER_MAGIC: ::c_long = 0x794c7630;
795         pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0;
796         pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f;
797         pub const QNX6_SUPER_MAGIC: ::c_long = 0x68191122;
798         pub const RDTGROUP_SUPER_MAGIC: ::c_long = 0x7655821;
799         pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973;
800         pub const SECURITYFS_MAGIC: ::c_long = 0x73636673;
801         pub const SELINUX_MAGIC: ::c_long = 0xf97cff8c;
802         pub const SMACK_MAGIC: ::c_long = 0x43415d53;
803         pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b;
804         pub const SYSFS_MAGIC: ::c_long = 0x62656572;
805         pub const TMPFS_MAGIC: ::c_long = 0x01021994;
806         pub const TRACEFS_MAGIC: ::c_long = 0x74726163;
807         pub const UDF_SUPER_MAGIC: ::c_long = 0x15013346;
808         pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2;
809         pub const XENFS_SUPER_MAGIC: ::c_long = 0xabba1974;
810         pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342;
811     } else if #[cfg(target_arch = "s390x")] {
812         pub const ADFS_SUPER_MAGIC: ::c_uint = 0x0000adf5;
813         pub const AFFS_SUPER_MAGIC: ::c_uint = 0x0000adff;
814         pub const AFS_SUPER_MAGIC: ::c_uint = 0x5346414f;
815         pub const AUTOFS_SUPER_MAGIC: ::c_uint = 0x0187;
816         pub const BINDERFS_SUPER_MAGIC: ::c_uint = 0x6c6f6f70;
817         pub const BPF_FS_MAGIC: ::c_uint = 0xcafe4a11;
818         pub const BTRFS_SUPER_MAGIC: ::c_uint = 0x9123683e;
819         pub const CGROUP2_SUPER_MAGIC: ::c_uint = 0x63677270;
820         pub const CGROUP_SUPER_MAGIC: ::c_uint = 0x27e0eb;
821         pub const CODA_SUPER_MAGIC: ::c_uint = 0x73757245;
822         pub const CRAMFS_MAGIC: ::c_uint = 0x28cd3d45;
823         pub const DEBUGFS_MAGIC: ::c_uint = 0x64626720;
824         pub const DEVPTS_SUPER_MAGIC: ::c_uint = 0x1cd1;
825         pub const ECRYPTFS_SUPER_MAGIC: ::c_uint = 0xf15f;
826         pub const EFS_SUPER_MAGIC: ::c_uint = 0x00414a53;
827         pub const EXT2_SUPER_MAGIC: ::c_uint = 0x0000ef53;
828         pub const EXT3_SUPER_MAGIC: ::c_uint = 0x0000ef53;
829         pub const EXT4_SUPER_MAGIC: ::c_uint = 0x0000ef53;
830         pub const F2FS_SUPER_MAGIC: ::c_uint = 0xf2f52010;
831         pub const FUTEXFS_SUPER_MAGIC: ::c_uint = 0xbad1dea;
832         pub const HOSTFS_SUPER_MAGIC: ::c_uint = 0x00c0ffee;
833         pub const HPFS_SUPER_MAGIC: ::c_uint = 0xf995e849;
834         pub const HUGETLBFS_MAGIC: ::c_uint = 0x958458f6;
835         pub const ISOFS_SUPER_MAGIC: ::c_uint = 0x00009660;
836         pub const JFFS2_SUPER_MAGIC: ::c_uint = 0x000072b6;
837         pub const MINIX2_SUPER_MAGIC2: ::c_uint = 0x00002478;
838         pub const MINIX2_SUPER_MAGIC: ::c_uint = 0x00002468;
839         pub const MINIX3_SUPER_MAGIC: ::c_uint = 0x4d5a;
840         pub const MINIX_SUPER_MAGIC2: ::c_uint = 0x0000138f;
841         pub const MINIX_SUPER_MAGIC: ::c_uint = 0x0000137f;
842         pub const MSDOS_SUPER_MAGIC: ::c_uint = 0x00004d44;
843         pub const NCP_SUPER_MAGIC: ::c_uint = 0x0000564c;
844         pub const NFS_SUPER_MAGIC: ::c_uint = 0x00006969;
845         pub const NILFS_SUPER_MAGIC: ::c_uint = 0x3434;
846         pub const OCFS2_SUPER_MAGIC: ::c_uint = 0x7461636f;
847         pub const OPENPROM_SUPER_MAGIC: ::c_uint = 0x00009fa1;
848         pub const OVERLAYFS_SUPER_MAGIC: ::c_uint = 0x794c7630;
849         pub const PROC_SUPER_MAGIC: ::c_uint = 0x00009fa0;
850         pub const QNX4_SUPER_MAGIC: ::c_uint = 0x0000002f;
851         pub const QNX6_SUPER_MAGIC: ::c_uint = 0x68191122;
852         pub const RDTGROUP_SUPER_MAGIC: ::c_uint = 0x7655821;
853         pub const REISERFS_SUPER_MAGIC: ::c_uint = 0x52654973;
854         pub const SECURITYFS_MAGIC: ::c_uint = 0x73636673;
855         pub const SELINUX_MAGIC: ::c_uint = 0xf97cff8c;
856         pub const SMACK_MAGIC: ::c_uint = 0x43415d53;
857         pub const SMB_SUPER_MAGIC: ::c_uint = 0x0000517b;
858         pub const SYSFS_MAGIC: ::c_uint = 0x62656572;
859         pub const TMPFS_MAGIC: ::c_uint = 0x01021994;
860         pub const TRACEFS_MAGIC: ::c_uint = 0x74726163;
861         pub const UDF_SUPER_MAGIC: ::c_uint = 0x15013346;
862         pub const USBDEVICE_SUPER_MAGIC: ::c_uint = 0x00009fa2;
863         pub const XENFS_SUPER_MAGIC: ::c_uint = 0xabba1974;
864         pub const XFS_SUPER_MAGIC: ::c_uint = 0x58465342;
865     }
866 }
867 
868 pub const CPU_SETSIZE: ::c_int = 0x400;
869 
870 pub const PTRACE_TRACEME: ::c_uint = 0;
871 pub const PTRACE_PEEKTEXT: ::c_uint = 1;
872 pub const PTRACE_PEEKDATA: ::c_uint = 2;
873 pub const PTRACE_PEEKUSER: ::c_uint = 3;
874 pub const PTRACE_POKETEXT: ::c_uint = 4;
875 pub const PTRACE_POKEDATA: ::c_uint = 5;
876 pub const PTRACE_POKEUSER: ::c_uint = 6;
877 pub const PTRACE_CONT: ::c_uint = 7;
878 pub const PTRACE_KILL: ::c_uint = 8;
879 pub const PTRACE_SINGLESTEP: ::c_uint = 9;
880 pub const PTRACE_ATTACH: ::c_uint = 16;
881 pub const PTRACE_SYSCALL: ::c_uint = 24;
882 pub const PTRACE_SETOPTIONS: ::c_uint = 0x4200;
883 pub const PTRACE_GETEVENTMSG: ::c_uint = 0x4201;
884 pub const PTRACE_GETSIGINFO: ::c_uint = 0x4202;
885 pub const PTRACE_SETSIGINFO: ::c_uint = 0x4203;
886 pub const PTRACE_GETREGSET: ::c_uint = 0x4204;
887 pub const PTRACE_SETREGSET: ::c_uint = 0x4205;
888 pub const PTRACE_SEIZE: ::c_uint = 0x4206;
889 pub const PTRACE_INTERRUPT: ::c_uint = 0x4207;
890 pub const PTRACE_LISTEN: ::c_uint = 0x4208;
891 pub const PTRACE_PEEKSIGINFO: ::c_uint = 0x4209;
892 
893 // linux/fs.h
894 
895 // Flags for preadv2/pwritev2
896 pub const RWF_HIPRI: ::c_int = 0x00000001;
897 pub const RWF_DSYNC: ::c_int = 0x00000002;
898 pub const RWF_SYNC: ::c_int = 0x00000004;
899 pub const RWF_NOWAIT: ::c_int = 0x00000008;
900 pub const RWF_APPEND: ::c_int = 0x00000010;
901 
902 // linux/rtnetlink.h
903 pub const TCA_PAD: ::c_ushort = 9;
904 pub const TCA_DUMP_INVISIBLE: ::c_ushort = 10;
905 pub const TCA_CHAIN: ::c_ushort = 11;
906 pub const TCA_HW_OFFLOAD: ::c_ushort = 12;
907 
908 pub const RTM_DELNETCONF: u16 = 81;
909 pub const RTM_NEWSTATS: u16 = 92;
910 pub const RTM_GETSTATS: u16 = 94;
911 pub const RTM_NEWCACHEREPORT: u16 = 96;
912 
913 pub const RTM_F_LOOKUP_TABLE: ::c_uint = 0x1000;
914 pub const RTM_F_FIB_MATCH: ::c_uint = 0x2000;
915 
916 pub const RTA_VIA: ::c_ushort = 18;
917 pub const RTA_NEWDST: ::c_ushort = 19;
918 pub const RTA_PREF: ::c_ushort = 20;
919 pub const RTA_ENCAP_TYPE: ::c_ushort = 21;
920 pub const RTA_ENCAP: ::c_ushort = 22;
921 pub const RTA_EXPIRES: ::c_ushort = 23;
922 pub const RTA_PAD: ::c_ushort = 24;
923 pub const RTA_UID: ::c_ushort = 25;
924 pub const RTA_TTL_PROPAGATE: ::c_ushort = 26;
925 
926 // linux/neighbor.h
927 pub const NTF_EXT_LEARNED: u8 = 0x10;
928 pub const NTF_OFFLOADED: u8 = 0x20;
929 
930 pub const NDA_MASTER: ::c_ushort = 9;
931 pub const NDA_LINK_NETNSID: ::c_ushort = 10;
932 pub const NDA_SRC_VNI: ::c_ushort = 11;
933 
934 // linux/personality.h
935 pub const UNAME26: ::c_int = 0x0020000;
936 pub const FDPIC_FUNCPTRS: ::c_int = 0x0080000;
937 
938 // linux/if_addr.h
939 pub const IFA_FLAGS: ::c_ushort = 8;
940 
941 pub const IFA_F_MANAGETEMPADDR: u32 = 0x100;
942 pub const IFA_F_NOPREFIXROUTE: u32 = 0x200;
943 pub const IFA_F_MCAUTOJOIN: u32 = 0x400;
944 pub const IFA_F_STABLE_PRIVACY: u32 = 0x800;
945 
946 pub const MAX_LINKS: ::c_int = 32;
947 
948 pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10;
949 
950 pub const GENL_ID_VFS_DQUOT: ::c_int = ::NLMSG_MIN_TYPE + 1;
951 pub const GENL_ID_PMCRAID: ::c_int = ::NLMSG_MIN_TYPE + 2;
952 
953 pub const TIOCM_LE: ::c_int = 0x001;
954 pub const TIOCM_DTR: ::c_int = 0x002;
955 pub const TIOCM_RTS: ::c_int = 0x004;
956 pub const TIOCM_CD: ::c_int = TIOCM_CAR;
957 pub const TIOCM_RI: ::c_int = TIOCM_RNG;
958 
959 // elf.h
960 pub const NT_PRSTATUS: ::c_int = 1;
961 pub const NT_PRFPREG: ::c_int = 2;
962 pub const NT_FPREGSET: ::c_int = 2;
963 pub const NT_PRPSINFO: ::c_int = 3;
964 pub const NT_PRXREG: ::c_int = 4;
965 pub const NT_TASKSTRUCT: ::c_int = 4;
966 pub const NT_PLATFORM: ::c_int = 5;
967 pub const NT_AUXV: ::c_int = 6;
968 pub const NT_GWINDOWS: ::c_int = 7;
969 pub const NT_ASRS: ::c_int = 8;
970 pub const NT_PSTATUS: ::c_int = 10;
971 pub const NT_PSINFO: ::c_int = 13;
972 pub const NT_PRCRED: ::c_int = 14;
973 pub const NT_UTSNAME: ::c_int = 15;
974 pub const NT_LWPSTATUS: ::c_int = 16;
975 pub const NT_LWPSINFO: ::c_int = 17;
976 pub const NT_PRFPXREG: ::c_int = 20;
977 
978 // linux/keyctl.h
979 pub const KEYCTL_DH_COMPUTE: u32 = 23;
980 pub const KEYCTL_PKEY_QUERY: u32 = 24;
981 pub const KEYCTL_PKEY_ENCRYPT: u32 = 25;
982 pub const KEYCTL_PKEY_DECRYPT: u32 = 26;
983 pub const KEYCTL_PKEY_SIGN: u32 = 27;
984 pub const KEYCTL_PKEY_VERIFY: u32 = 28;
985 pub const KEYCTL_RESTRICT_KEYRING: u32 = 29;
986 
987 pub const KEYCTL_SUPPORTS_ENCRYPT: u32 = 0x01;
988 pub const KEYCTL_SUPPORTS_DECRYPT: u32 = 0x02;
989 pub const KEYCTL_SUPPORTS_SIGN: u32 = 0x04;
990 pub const KEYCTL_SUPPORTS_VERIFY: u32 = 0x08;
991 cfg_if! {
992     if #[cfg(not(any(target_arch="mips", target_arch="mips64")))] {
993         pub const KEYCTL_MOVE: u32 = 30;
994         pub const KEYCTL_CAPABILITIES: u32 = 31;
995 
996         pub const KEYCTL_CAPS0_CAPABILITIES: u32 = 0x01;
997         pub const KEYCTL_CAPS0_PERSISTENT_KEYRINGS: u32 = 0x02;
998         pub const KEYCTL_CAPS0_DIFFIE_HELLMAN: u32 = 0x04;
999         pub const KEYCTL_CAPS0_PUBLIC_KEY: u32 = 0x08;
1000         pub const KEYCTL_CAPS0_BIG_KEY: u32 = 0x10;
1001         pub const KEYCTL_CAPS0_INVALIDATE: u32 = 0x20;
1002         pub const KEYCTL_CAPS0_RESTRICT_KEYRING: u32 = 0x40;
1003         pub const KEYCTL_CAPS0_MOVE: u32 = 0x80;
1004         pub const KEYCTL_CAPS1_NS_KEYRING_NAME: u32 = 0x01;
1005         pub const KEYCTL_CAPS1_NS_KEY_TAG: u32 = 0x02;
1006     }
1007 }
1008 
1009 pub const M_MXFAST: ::c_int = 1;
1010 pub const M_NLBLKS: ::c_int = 2;
1011 pub const M_GRAIN: ::c_int = 3;
1012 pub const M_KEEP: ::c_int = 4;
1013 pub const M_TRIM_THRESHOLD: ::c_int = -1;
1014 pub const M_TOP_PAD: ::c_int = -2;
1015 pub const M_MMAP_THRESHOLD: ::c_int = -3;
1016 pub const M_MMAP_MAX: ::c_int = -4;
1017 pub const M_CHECK_ACTION: ::c_int = -5;
1018 pub const M_PERTURB: ::c_int = -6;
1019 pub const M_ARENA_TEST: ::c_int = -7;
1020 pub const M_ARENA_MAX: ::c_int = -8;
1021 
1022 pub const AT_STATX_SYNC_TYPE: ::c_int = 0x6000;
1023 pub const AT_STATX_SYNC_AS_STAT: ::c_int = 0x0000;
1024 pub const AT_STATX_FORCE_SYNC: ::c_int = 0x2000;
1025 pub const AT_STATX_DONT_SYNC: ::c_int = 0x4000;
1026 pub const STATX_TYPE: ::c_uint = 0x0001;
1027 pub const STATX_MODE: ::c_uint = 0x0002;
1028 pub const STATX_NLINK: ::c_uint = 0x0004;
1029 pub const STATX_UID: ::c_uint = 0x0008;
1030 pub const STATX_GID: ::c_uint = 0x0010;
1031 pub const STATX_ATIME: ::c_uint = 0x0020;
1032 pub const STATX_MTIME: ::c_uint = 0x0040;
1033 pub const STATX_CTIME: ::c_uint = 0x0080;
1034 pub const STATX_INO: ::c_uint = 0x0100;
1035 pub const STATX_SIZE: ::c_uint = 0x0200;
1036 pub const STATX_BLOCKS: ::c_uint = 0x0400;
1037 pub const STATX_BASIC_STATS: ::c_uint = 0x07ff;
1038 pub const STATX_BTIME: ::c_uint = 0x0800;
1039 pub const STATX_MNT_ID: ::c_uint = 0x1000;
1040 pub const STATX_ALL: ::c_uint = 0x0fff;
1041 pub const STATX__RESERVED: ::c_int = 0x80000000;
1042 pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004;
1043 pub const STATX_ATTR_IMMUTABLE: ::c_int = 0x0010;
1044 pub const STATX_ATTR_APPEND: ::c_int = 0x0020;
1045 pub const STATX_ATTR_NODUMP: ::c_int = 0x0040;
1046 pub const STATX_ATTR_ENCRYPTED: ::c_int = 0x0800;
1047 pub const STATX_ATTR_AUTOMOUNT: ::c_int = 0x1000;
1048 
1049 //sys/timex.h
1050 pub const ADJ_OFFSET: ::c_uint = 0x0001;
1051 pub const ADJ_FREQUENCY: ::c_uint = 0x0002;
1052 pub const ADJ_MAXERROR: ::c_uint = 0x0004;
1053 pub const ADJ_ESTERROR: ::c_uint = 0x0008;
1054 pub const ADJ_STATUS: ::c_uint = 0x0010;
1055 pub const ADJ_TIMECONST: ::c_uint = 0x0020;
1056 pub const ADJ_TAI: ::c_uint = 0x0080;
1057 pub const ADJ_SETOFFSET: ::c_uint = 0x0100;
1058 pub const ADJ_MICRO: ::c_uint = 0x1000;
1059 pub const ADJ_NANO: ::c_uint = 0x2000;
1060 pub const ADJ_TICK: ::c_uint = 0x4000;
1061 pub const ADJ_OFFSET_SINGLESHOT: ::c_uint = 0x8001;
1062 pub const ADJ_OFFSET_SS_READ: ::c_uint = 0xa001;
1063 pub const MOD_OFFSET: ::c_uint = ADJ_OFFSET;
1064 pub const MOD_FREQUENCY: ::c_uint = ADJ_FREQUENCY;
1065 pub const MOD_MAXERROR: ::c_uint = ADJ_MAXERROR;
1066 pub const MOD_ESTERROR: ::c_uint = ADJ_ESTERROR;
1067 pub const MOD_STATUS: ::c_uint = ADJ_STATUS;
1068 pub const MOD_TIMECONST: ::c_uint = ADJ_TIMECONST;
1069 pub const MOD_CLKB: ::c_uint = ADJ_TICK;
1070 pub const MOD_CLKA: ::c_uint = ADJ_OFFSET_SINGLESHOT;
1071 pub const MOD_TAI: ::c_uint = ADJ_TAI;
1072 pub const MOD_MICRO: ::c_uint = ADJ_MICRO;
1073 pub const MOD_NANO: ::c_uint = ADJ_NANO;
1074 pub const STA_PLL: ::c_int = 0x0001;
1075 pub const STA_PPSFREQ: ::c_int = 0x0002;
1076 pub const STA_PPSTIME: ::c_int = 0x0004;
1077 pub const STA_FLL: ::c_int = 0x0008;
1078 pub const STA_INS: ::c_int = 0x0010;
1079 pub const STA_DEL: ::c_int = 0x0020;
1080 pub const STA_UNSYNC: ::c_int = 0x0040;
1081 pub const STA_FREQHOLD: ::c_int = 0x0080;
1082 pub const STA_PPSSIGNAL: ::c_int = 0x0100;
1083 pub const STA_PPSJITTER: ::c_int = 0x0200;
1084 pub const STA_PPSWANDER: ::c_int = 0x0400;
1085 pub const STA_PPSERROR: ::c_int = 0x0800;
1086 pub const STA_CLOCKERR: ::c_int = 0x1000;
1087 pub const STA_NANO: ::c_int = 0x2000;
1088 pub const STA_MODE: ::c_int = 0x4000;
1089 pub const STA_CLK: ::c_int = 0x8000;
1090 pub const STA_RONLY: ::c_int = STA_PPSSIGNAL
1091     | STA_PPSJITTER
1092     | STA_PPSWANDER
1093     | STA_PPSERROR
1094     | STA_CLOCKERR
1095     | STA_NANO
1096     | STA_MODE
1097     | STA_CLK;
1098 pub const NTP_API: ::c_int = 4;
1099 pub const TIME_OK: ::c_int = 0;
1100 pub const TIME_INS: ::c_int = 1;
1101 pub const TIME_DEL: ::c_int = 2;
1102 pub const TIME_OOP: ::c_int = 3;
1103 pub const TIME_WAIT: ::c_int = 4;
1104 pub const TIME_ERROR: ::c_int = 5;
1105 pub const TIME_BAD: ::c_int = TIME_ERROR;
1106 pub const MAXTC: ::c_long = 6;
1107 
1108 cfg_if! {
1109     if #[cfg(any(
1110         target_arch = "arm",
1111         target_arch = "x86",
1112         target_arch = "x86_64",
1113         target_arch = "s390x",
1114         target_arch = "riscv64",
1115         target_arch = "riscv32"
1116     ))] {
1117         pub const PTHREAD_STACK_MIN: ::size_t = 16384;
1118     } else if #[cfg(any(
1119                target_arch = "sparc",
1120                target_arch = "sparc64"
1121            ))] {
1122         pub const PTHREAD_STACK_MIN: ::size_t = 0x6000;
1123     } else {
1124         pub const PTHREAD_STACK_MIN: ::size_t = 131072;
1125     }
1126 }
1127 pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 3;
1128 
1129 pub const REG_STARTEND: ::c_int = 4;
1130 
1131 pub const REG_EEND: ::c_int = 14;
1132 pub const REG_ESIZE: ::c_int = 15;
1133 pub const REG_ERPAREN: ::c_int = 16;
1134 
1135 extern "C" {
fgetspent_r( fp: *mut ::FILE, spbuf: *mut ::spwd, buf: *mut ::c_char, buflen: ::size_t, spbufp: *mut *mut ::spwd, ) -> ::c_int1136     pub fn fgetspent_r(
1137         fp: *mut ::FILE,
1138         spbuf: *mut ::spwd,
1139         buf: *mut ::c_char,
1140         buflen: ::size_t,
1141         spbufp: *mut *mut ::spwd,
1142     ) -> ::c_int;
sgetspent_r( s: *const ::c_char, spbuf: *mut ::spwd, buf: *mut ::c_char, buflen: ::size_t, spbufp: *mut *mut ::spwd, ) -> ::c_int1143     pub fn sgetspent_r(
1144         s: *const ::c_char,
1145         spbuf: *mut ::spwd,
1146         buf: *mut ::c_char,
1147         buflen: ::size_t,
1148         spbufp: *mut *mut ::spwd,
1149     ) -> ::c_int;
getspent_r( spbuf: *mut ::spwd, buf: *mut ::c_char, buflen: ::size_t, spbufp: *mut *mut ::spwd, ) -> ::c_int1150     pub fn getspent_r(
1151         spbuf: *mut ::spwd,
1152         buf: *mut ::c_char,
1153         buflen: ::size_t,
1154         spbufp: *mut *mut ::spwd,
1155     ) -> ::c_int;
qsort_r( base: *mut ::c_void, num: ::size_t, size: ::size_t, compar: ::Option< unsafe extern "C" fn(*const ::c_void, *const ::c_void, *mut ::c_void) -> ::c_int, >, arg: *mut ::c_void, )1156     pub fn qsort_r(
1157         base: *mut ::c_void,
1158         num: ::size_t,
1159         size: ::size_t,
1160         compar: ::Option<
1161             unsafe extern "C" fn(*const ::c_void, *const ::c_void, *mut ::c_void) -> ::c_int,
1162         >,
1163         arg: *mut ::c_void,
1164     );
sendmmsg( sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, flags: ::c_int, ) -> ::c_int1165     pub fn sendmmsg(
1166         sockfd: ::c_int,
1167         msgvec: *mut ::mmsghdr,
1168         vlen: ::c_uint,
1169         flags: ::c_int,
1170     ) -> ::c_int;
recvmmsg( sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, flags: ::c_int, timeout: *mut ::timespec, ) -> ::c_int1171     pub fn recvmmsg(
1172         sockfd: ::c_int,
1173         msgvec: *mut ::mmsghdr,
1174         vlen: ::c_uint,
1175         flags: ::c_int,
1176         timeout: *mut ::timespec,
1177     ) -> ::c_int;
1178 
getrlimit64(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit64) -> ::c_int1179     pub fn getrlimit64(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit64) -> ::c_int;
setrlimit64(resource: ::__rlimit_resource_t, rlim: *const ::rlimit64) -> ::c_int1180     pub fn setrlimit64(resource: ::__rlimit_resource_t, rlim: *const ::rlimit64) -> ::c_int;
getrlimit(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit) -> ::c_int1181     pub fn getrlimit(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit) -> ::c_int;
setrlimit(resource: ::__rlimit_resource_t, rlim: *const ::rlimit) -> ::c_int1182     pub fn setrlimit(resource: ::__rlimit_resource_t, rlim: *const ::rlimit) -> ::c_int;
prlimit( pid: ::pid_t, resource: ::__rlimit_resource_t, new_limit: *const ::rlimit, old_limit: *mut ::rlimit, ) -> ::c_int1183     pub fn prlimit(
1184         pid: ::pid_t,
1185         resource: ::__rlimit_resource_t,
1186         new_limit: *const ::rlimit,
1187         old_limit: *mut ::rlimit,
1188     ) -> ::c_int;
prlimit64( pid: ::pid_t, resource: ::__rlimit_resource_t, new_limit: *const ::rlimit64, old_limit: *mut ::rlimit64, ) -> ::c_int1189     pub fn prlimit64(
1190         pid: ::pid_t,
1191         resource: ::__rlimit_resource_t,
1192         new_limit: *const ::rlimit64,
1193         old_limit: *mut ::rlimit64,
1194     ) -> ::c_int;
utmpname(file: *const ::c_char) -> ::c_int1195     pub fn utmpname(file: *const ::c_char) -> ::c_int;
utmpxname(file: *const ::c_char) -> ::c_int1196     pub fn utmpxname(file: *const ::c_char) -> ::c_int;
getutxent() -> *mut utmpx1197     pub fn getutxent() -> *mut utmpx;
getutxid(ut: *const utmpx) -> *mut utmpx1198     pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
getutxline(ut: *const utmpx) -> *mut utmpx1199     pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
pututxline(ut: *const utmpx) -> *mut utmpx1200     pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
setutxent()1201     pub fn setutxent();
endutxent()1202     pub fn endutxent();
getpt() -> ::c_int1203     pub fn getpt() -> ::c_int;
mallopt(param: ::c_int, value: ::c_int) -> ::c_int1204     pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int;
gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int1205     pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
statx( dirfd: ::c_int, pathname: *const c_char, flags: ::c_int, mask: ::c_uint, statxbuf: *mut statx, ) -> ::c_int1206     pub fn statx(
1207         dirfd: ::c_int,
1208         pathname: *const c_char,
1209         flags: ::c_int,
1210         mask: ::c_uint,
1211         statxbuf: *mut statx,
1212     ) -> ::c_int;
getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t1213     pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
getauxval(type_: ::c_ulong) -> ::c_ulong1214     pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
1215 
adjtimex(buf: *mut timex) -> ::c_int1216     pub fn adjtimex(buf: *mut timex) -> ::c_int;
ntp_adjtime(buf: *mut timex) -> ::c_int1217     pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
1218     #[link_name = "ntp_gettimex"]
ntp_gettime(buf: *mut ntptimeval) -> ::c_int1219     pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
clock_adjtime(clk_id: ::clockid_t, buf: *mut ::timex) -> ::c_int1220     pub fn clock_adjtime(clk_id: ::clockid_t, buf: *mut ::timex) -> ::c_int;
1221 
copy_file_range( fd_in: ::c_int, off_in: *mut ::off64_t, fd_out: ::c_int, off_out: *mut ::off64_t, len: ::size_t, flags: ::c_uint, ) -> ::ssize_t1222     pub fn copy_file_range(
1223         fd_in: ::c_int,
1224         off_in: *mut ::off64_t,
1225         fd_out: ::c_int,
1226         off_out: *mut ::off64_t,
1227         len: ::size_t,
1228         flags: ::c_uint,
1229     ) -> ::ssize_t;
fanotify_mark( fd: ::c_int, flags: ::c_uint, mask: u64, dirfd: ::c_int, path: *const ::c_char, ) -> ::c_int1230     pub fn fanotify_mark(
1231         fd: ::c_int,
1232         flags: ::c_uint,
1233         mask: u64,
1234         dirfd: ::c_int,
1235         path: *const ::c_char,
1236     ) -> ::c_int;
preadv2( fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t, flags: ::c_int, ) -> ::ssize_t1237     pub fn preadv2(
1238         fd: ::c_int,
1239         iov: *const ::iovec,
1240         iovcnt: ::c_int,
1241         offset: ::off_t,
1242         flags: ::c_int,
1243     ) -> ::ssize_t;
pwritev2( fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t, flags: ::c_int, ) -> ::ssize_t1244     pub fn pwritev2(
1245         fd: ::c_int,
1246         iov: *const ::iovec,
1247         iovcnt: ::c_int,
1248         offset: ::off_t,
1249         flags: ::c_int,
1250     ) -> ::ssize_t;
preadv64v2( fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off64_t, flags: ::c_int, ) -> ::ssize_t1251     pub fn preadv64v2(
1252         fd: ::c_int,
1253         iov: *const ::iovec,
1254         iovcnt: ::c_int,
1255         offset: ::off64_t,
1256         flags: ::c_int,
1257     ) -> ::ssize_t;
pwritev64v2( fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off64_t, flags: ::c_int, ) -> ::ssize_t1258     pub fn pwritev64v2(
1259         fd: ::c_int,
1260         iov: *const ::iovec,
1261         iovcnt: ::c_int,
1262         offset: ::off64_t,
1263         flags: ::c_int,
1264     ) -> ::ssize_t;
renameat2( olddirfd: ::c_int, oldpath: *const ::c_char, newdirfd: ::c_int, newpath: *const ::c_char, flags: ::c_uint, ) -> ::c_int1265     pub fn renameat2(
1266         olddirfd: ::c_int,
1267         oldpath: *const ::c_char,
1268         newdirfd: ::c_int,
1269         newpath: *const ::c_char,
1270         flags: ::c_uint,
1271     ) -> ::c_int;
1272 
1273     // Added in `glibc` 2.25
explicit_bzero(s: *mut ::c_void, len: ::size_t)1274     pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t);
1275     // Added in `glibc` 2.29
reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void1276     pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
1277 }
1278 
1279 extern "C" {
ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int1280     pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int1281     pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int;
glob64( pattern: *const ::c_char, flags: ::c_int, errfunc: ::Option<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>, pglob: *mut glob64_t, ) -> ::c_int1282     pub fn glob64(
1283         pattern: *const ::c_char,
1284         flags: ::c_int,
1285         errfunc: ::Option<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>,
1286         pglob: *mut glob64_t,
1287     ) -> ::c_int;
globfree64(pglob: *mut glob64_t)1288     pub fn globfree64(pglob: *mut glob64_t);
ptrace(request: ::c_uint, ...) -> ::c_long1289     pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
pthread_attr_getaffinity_np( attr: *const ::pthread_attr_t, cpusetsize: ::size_t, cpuset: *mut ::cpu_set_t, ) -> ::c_int1290     pub fn pthread_attr_getaffinity_np(
1291         attr: *const ::pthread_attr_t,
1292         cpusetsize: ::size_t,
1293         cpuset: *mut ::cpu_set_t,
1294     ) -> ::c_int;
pthread_attr_setaffinity_np( attr: *mut ::pthread_attr_t, cpusetsize: ::size_t, cpuset: *const ::cpu_set_t, ) -> ::c_int1295     pub fn pthread_attr_setaffinity_np(
1296         attr: *mut ::pthread_attr_t,
1297         cpusetsize: ::size_t,
1298         cpuset: *const ::cpu_set_t,
1299     ) -> ::c_int;
getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int1300     pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int;
setpriority(which: ::__priority_which_t, who: ::id_t, prio: ::c_int) -> ::c_int1301     pub fn setpriority(which: ::__priority_which_t, who: ::id_t, prio: ::c_int) -> ::c_int;
pthread_rwlockattr_getkind_np( attr: *const ::pthread_rwlockattr_t, val: *mut ::c_int, ) -> ::c_int1302     pub fn pthread_rwlockattr_getkind_np(
1303         attr: *const ::pthread_rwlockattr_t,
1304         val: *mut ::c_int,
1305     ) -> ::c_int;
pthread_rwlockattr_setkind_np( attr: *mut ::pthread_rwlockattr_t, val: ::c_int, ) -> ::c_int1306     pub fn pthread_rwlockattr_setkind_np(
1307         attr: *mut ::pthread_rwlockattr_t,
1308         val: ::c_int,
1309     ) -> ::c_int;
mallinfo() -> ::mallinfo1310     pub fn mallinfo() -> ::mallinfo;
mallinfo2() -> ::mallinfo21311     pub fn mallinfo2() -> ::mallinfo2;
malloc_info(options: ::c_int, stream: *mut ::FILE) -> ::c_int1312     pub fn malloc_info(options: ::c_int, stream: *mut ::FILE) -> ::c_int;
malloc_usable_size(ptr: *mut ::c_void) -> ::size_t1313     pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
getpwent_r( pwd: *mut ::passwd, buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut ::passwd, ) -> ::c_int1314     pub fn getpwent_r(
1315         pwd: *mut ::passwd,
1316         buf: *mut ::c_char,
1317         buflen: ::size_t,
1318         result: *mut *mut ::passwd,
1319     ) -> ::c_int;
getgrent_r( grp: *mut ::group, buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut ::group, ) -> ::c_int1320     pub fn getgrent_r(
1321         grp: *mut ::group,
1322         buf: *mut ::c_char,
1323         buflen: ::size_t,
1324         result: *mut *mut ::group,
1325     ) -> ::c_int;
pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int1326     pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int1327     pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
1328 
sethostid(hostid: ::c_long) -> ::c_int1329     pub fn sethostid(hostid: ::c_long) -> ::c_int;
1330 }
1331 
1332 extern "C" {
dlmopen(lmid: Lmid_t, filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void1333     pub fn dlmopen(lmid: Lmid_t, filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void;
dlinfo(handle: *mut ::c_void, request: ::c_int, info: *mut ::c_void) -> ::c_int1334     pub fn dlinfo(handle: *mut ::c_void, request: ::c_int, info: *mut ::c_void) -> ::c_int;
dladdr1( addr: *const ::c_void, info: *mut ::Dl_info, extra_info: *mut *mut ::c_void, flags: ::c_int, ) -> ::c_int1335     pub fn dladdr1(
1336         addr: *const ::c_void,
1337         info: *mut ::Dl_info,
1338         extra_info: *mut *mut ::c_void,
1339         flags: ::c_int,
1340     ) -> ::c_int;
1341 }
1342 
1343 cfg_if! {
1344     if #[cfg(any(target_arch = "x86",
1345                  target_arch = "arm",
1346                  target_arch = "mips",
1347                  target_arch = "powerpc",
1348                  target_arch = "sparc",
1349                  target_arch = "riscv32"))] {
1350         mod b32;
1351         pub use self::b32::*;
1352     } else if #[cfg(any(target_arch = "x86_64",
1353                         target_arch = "aarch64",
1354                         target_arch = "powerpc64",
1355                         target_arch = "mips64",
1356                         target_arch = "s390x",
1357                         target_arch = "sparc64",
1358                         target_arch = "riscv64"))] {
1359         mod b64;
1360         pub use self::b64::*;
1361     } else {
1362         // Unknown target_arch
1363     }
1364 }
1365 
1366 cfg_if! {
1367     if #[cfg(libc_align)] {
1368         mod align;
1369         pub use self::align::*;
1370     } else {
1371         mod no_align;
1372         pub use self::no_align::*;
1373     }
1374 }
1375