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