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 
6 s! {
7     pub struct statx {
8         pub stx_mask: u32,
9         pub stx_blksize: u32,
10         pub stx_attributes: u64,
11         pub stx_nlink: u32,
12         pub stx_uid: u32,
13         pub stx_gid: u32,
14         pub stx_mode: u16,
15         pub __statx_pad1: [u16; 1],
16         pub stx_ino: u64,
17         pub stx_size: u64,
18         pub stx_blocks: u64,
19         pub stx_attributes_mask: u64,
20         pub stx_atime: ::statx_timestamp,
21         pub stx_btime: ::statx_timestamp,
22         pub stx_ctime: ::statx_timestamp,
23         pub stx_mtime: ::statx_timestamp,
24         pub stx_rdev_major: u32,
25         pub stx_rdev_minor: u32,
26         pub stx_dev_major: u32,
27         pub stx_dev_minor: u32,
28         pub __statx_pad2: [u64; 14],
29     }
30 
31     pub struct statx_timestamp {
32         pub tv_sec: i64,
33         pub tv_nsec: u32,
34         pub __statx_timestamp_pad1: [i32; 1],
35     }
36 
37     pub struct aiocb {
38         pub aio_fildes: ::c_int,
39         pub aio_lio_opcode: ::c_int,
40         pub aio_reqprio: ::c_int,
41         pub aio_buf: *mut ::c_void,
42         pub aio_nbytes: ::size_t,
43         pub aio_sigevent: ::sigevent,
44         __next_prio: *mut aiocb,
45         __abs_prio: ::c_int,
46         __policy: ::c_int,
47         __error_code: ::c_int,
48         __return_value: ::ssize_t,
49         pub aio_offset: off_t,
50         #[cfg(all(not(target_arch = "x86_64"), target_pointer_width = "32"))]
51         __unused1: [::c_char; 4],
52         __glibc_reserved: [::c_char; 32]
53     }
54 
55     pub struct __exit_status {
56         pub e_termination: ::c_short,
57         pub e_exit: ::c_short,
58     }
59 
60     pub struct __timeval {
61         pub tv_sec: i32,
62         pub tv_usec: i32,
63     }
64 
65     pub struct glob64_t {
66         pub gl_pathc: ::size_t,
67         pub gl_pathv: *mut *mut ::c_char,
68         pub gl_offs: ::size_t,
69         pub gl_flags: ::c_int,
70 
71         __unused1: *mut ::c_void,
72         __unused2: *mut ::c_void,
73         __unused3: *mut ::c_void,
74         __unused4: *mut ::c_void,
75         __unused5: *mut ::c_void,
76     }
77 
78     pub struct msghdr {
79         pub msg_name: *mut ::c_void,
80         pub msg_namelen: ::socklen_t,
81         pub msg_iov: *mut ::iovec,
82         pub msg_iovlen: ::size_t,
83         pub msg_control: *mut ::c_void,
84         pub msg_controllen: ::size_t,
85         pub msg_flags: ::c_int,
86     }
87 
88     pub struct cmsghdr {
89         pub cmsg_len: ::size_t,
90         pub cmsg_level: ::c_int,
91         pub cmsg_type: ::c_int,
92     }
93 
94     pub struct termios {
95         pub c_iflag: ::tcflag_t,
96         pub c_oflag: ::tcflag_t,
97         pub c_cflag: ::tcflag_t,
98         pub c_lflag: ::tcflag_t,
99         pub c_line: ::cc_t,
100         pub c_cc: [::cc_t; ::NCCS],
101         #[cfg(not(any(
102             target_arch = "sparc",
103             target_arch = "sparc64",
104             target_arch = "mips",
105             target_arch = "mips64")))]
106         pub c_ispeed: ::speed_t,
107         #[cfg(not(any(
108             target_arch = "sparc",
109             target_arch = "sparc64",
110             target_arch = "mips",
111             target_arch = "mips64")))]
112         pub c_ospeed: ::speed_t,
113     }
114 
115     pub struct mallinfo {
116         pub arena: ::c_int,
117         pub ordblks: ::c_int,
118         pub smblks: ::c_int,
119         pub hblks: ::c_int,
120         pub hblkhd: ::c_int,
121         pub usmblks: ::c_int,
122         pub fsmblks: ::c_int,
123         pub uordblks: ::c_int,
124         pub fordblks: ::c_int,
125         pub keepcost: ::c_int,
126     }
127 
128     pub struct nlmsghdr {
129         pub nlmsg_len: u32,
130         pub nlmsg_type: u16,
131         pub nlmsg_flags: u16,
132         pub nlmsg_seq: u32,
133         pub nlmsg_pid: u32,
134     }
135 
136     pub struct nlmsgerr {
137         pub error: ::c_int,
138         pub msg: nlmsghdr,
139     }
140 
141     pub struct nl_pktinfo {
142         pub group: u32,
143     }
144 
145     pub struct nl_mmap_req {
146         pub nm_block_size: ::c_uint,
147         pub nm_block_nr: ::c_uint,
148         pub nm_frame_size: ::c_uint,
149         pub nm_frame_nr: ::c_uint,
150     }
151 
152     pub struct nl_mmap_hdr {
153         pub nm_status: ::c_uint,
154         pub nm_len: ::c_uint,
155         pub nm_group: u32,
156         pub nm_pid: u32,
157         pub nm_uid: u32,
158         pub nm_gid: u32,
159     }
160 
161     pub struct nlattr {
162         pub nla_len: u16,
163         pub nla_type: u16,
164     }
165 
166     pub struct rtentry {
167         pub rt_pad1: ::c_ulong,
168         pub rt_dst: ::sockaddr,
169         pub rt_gateway: ::sockaddr,
170         pub rt_genmask: ::sockaddr,
171         pub rt_flags: ::c_ushort,
172         pub rt_pad2: ::c_short,
173         pub rt_pad3: ::c_ulong,
174         pub rt_tos: ::c_uchar,
175         pub rt_class: ::c_uchar,
176         #[cfg(target_pointer_width = "64")]
177         pub rt_pad4: [::c_short; 3usize],
178         #[cfg(not(target_pointer_width = "64"))]
179         pub rt_pad4: ::c_short,
180         pub rt_metric: ::c_short,
181         pub rt_dev: *mut ::c_char,
182         pub rt_mtu: ::c_ulong,
183         pub rt_window: ::c_ulong,
184         pub rt_irtt: ::c_ushort,
185     }
186 }
187 
188 impl siginfo_t {
189     pub unsafe fn si_addr(&self) -> *mut ::c_void {
190         #[repr(C)]
191         struct siginfo_sigfault {
192             _si_signo: ::c_int,
193             _si_errno: ::c_int,
194             _si_code: ::c_int,
195             si_addr: *mut ::c_void,
196         }
197         (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr
198     }
199 
200     pub unsafe fn si_value(&self) -> ::sigval {
201         #[repr(C)]
202         struct siginfo_timer {
203             _si_signo: ::c_int,
204             _si_errno: ::c_int,
205             _si_code: ::c_int,
206             _si_tid: ::c_int,
207             _si_overrun: ::c_int,
208             si_sigval: ::sigval,
209         }
210         (*(self as *const siginfo_t as *const siginfo_timer)).si_sigval
211     }
212 }
213 
214 s_no_extra_traits! {
215     pub struct utmpx {
216         pub ut_type: ::c_short,
217         pub ut_pid: ::pid_t,
218         pub ut_line: [::c_char; __UT_LINESIZE],
219         pub ut_id: [::c_char; 4],
220 
221         pub ut_user: [::c_char; __UT_NAMESIZE],
222         pub ut_host: [::c_char; __UT_HOSTSIZE],
223         pub ut_exit: __exit_status,
224 
225         #[cfg(any(target_arch = "aarch64",
226                   target_arch = "s390x",
227                   all(target_pointer_width = "32",
228                       not(target_arch = "x86_64"))))]
229         pub ut_session: ::c_long,
230         #[cfg(any(target_arch = "aarch64",
231                   target_arch = "s390x",
232                   all(target_pointer_width = "32",
233                       not(target_arch = "x86_64"))))]
234         pub ut_tv: ::timeval,
235 
236         #[cfg(not(any(target_arch = "aarch64",
237                       target_arch = "s390x",
238                       all(target_pointer_width = "32",
239                           not(target_arch = "x86_64")))))]
240         pub ut_session: i32,
241         #[cfg(not(any(target_arch = "aarch64",
242                       target_arch = "s390x",
243                       all(target_pointer_width = "32",
244                           not(target_arch = "x86_64")))))]
245         pub ut_tv: __timeval,
246 
247         pub ut_addr_v6: [i32; 4],
248         __glibc_reserved: [::c_char; 20],
249     }
250 }
251 
252 cfg_if! {
253     if #[cfg(feature = "extra_traits")] {
254         impl PartialEq for utmpx {
255             fn eq(&self, other: &utmpx) -> bool {
256                 self.ut_type == other.ut_type
257                     && self.ut_pid == other.ut_pid
258                     && self.ut_line == other.ut_line
259                     && self.ut_id == other.ut_id
260                     && self.ut_user == other.ut_user
261                     && self
262                     .ut_host
263                     .iter()
264                     .zip(other.ut_host.iter())
265                     .all(|(a,b)| a == b)
266                     && self.ut_exit == other.ut_exit
267                     && self.ut_session == other.ut_session
268                     && self.ut_tv == other.ut_tv
269                     && self.ut_addr_v6 == other.ut_addr_v6
270                     && self.__glibc_reserved == other.__glibc_reserved
271             }
272         }
273 
274         impl Eq for utmpx {}
275 
276         impl ::fmt::Debug for utmpx {
277             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
278                 f.debug_struct("utmpx")
279                     .field("ut_type", &self.ut_type)
280                     .field("ut_pid", &self.ut_pid)
281                     .field("ut_line", &self.ut_line)
282                     .field("ut_id", &self.ut_id)
283                     .field("ut_user", &self.ut_user)
284                 // FIXME: .field("ut_host", &self.ut_host)
285                     .field("ut_exit", &self.ut_exit)
286                     .field("ut_session", &self.ut_session)
287                     .field("ut_tv", &self.ut_tv)
288                     .field("ut_addr_v6", &self.ut_addr_v6)
289                     .field("__glibc_reserved", &self.__glibc_reserved)
290                     .finish()
291             }
292         }
293 
294         impl ::hash::Hash for utmpx {
295             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
296                 self.ut_type.hash(state);
297                 self.ut_pid.hash(state);
298                 self.ut_line.hash(state);
299                 self.ut_id.hash(state);
300                 self.ut_user.hash(state);
301                 self.ut_host.hash(state);
302                 self.ut_exit.hash(state);
303                 self.ut_session.hash(state);
304                 self.ut_tv.hash(state);
305                 self.ut_addr_v6.hash(state);
306                 self.__glibc_reserved.hash(state);
307             }
308         }
309     }
310 }
311 
312 pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
313 pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
314 pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
315 pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
316 pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
317 pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
318 pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
319 pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
320 pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
321 pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
322 pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
323 pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = 16;
324 
325 pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
326 
327 pub const __UT_LINESIZE: usize = 32;
328 pub const __UT_NAMESIZE: usize = 32;
329 pub const __UT_HOSTSIZE: usize = 256;
330 pub const EMPTY: ::c_short = 0;
331 pub const RUN_LVL: ::c_short = 1;
332 pub const BOOT_TIME: ::c_short = 2;
333 pub const NEW_TIME: ::c_short = 3;
334 pub const OLD_TIME: ::c_short = 4;
335 pub const INIT_PROCESS: ::c_short = 5;
336 pub const LOGIN_PROCESS: ::c_short = 6;
337 pub const USER_PROCESS: ::c_short = 7;
338 pub const DEAD_PROCESS: ::c_short = 8;
339 pub const ACCOUNTING: ::c_short = 9;
340 
341 // dlfcn.h
342 pub const LM_ID_BASE: ::c_long = 0;
343 pub const LM_ID_NEWLM: ::c_long = -1;
344 
345 pub const RTLD_DI_LMID: ::c_int = 1;
346 pub const RTLD_DI_LINKMAP: ::c_int = 2;
347 pub const RTLD_DI_CONFIGADDR: ::c_int = 3;
348 pub const RTLD_DI_SERINFO: ::c_int = 4;
349 pub const RTLD_DI_SERINFOSIZE: ::c_int = 5;
350 pub const RTLD_DI_ORIGIN: ::c_int = 6;
351 pub const RTLD_DI_PROFILENAME: ::c_int = 7;
352 pub const RTLD_DI_PROFILEOUT: ::c_int = 8;
353 pub const RTLD_DI_TLS_MODID: ::c_int = 9;
354 pub const RTLD_DI_TLS_DATA: ::c_int = 10;
355 
356 pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
357 
358 pub const SOL_RXRPC: ::c_int = 272;
359 pub const SOL_PPPOL2TP: ::c_int = 273;
360 pub const SOL_PNPIPE: ::c_int = 275;
361 pub const SOL_RDS: ::c_int = 276;
362 pub const SOL_IUCV: ::c_int = 277;
363 pub const SOL_CAIF: ::c_int = 278;
364 pub const SOL_NFC: ::c_int = 280;
365 pub const SOL_XDP: ::c_int = 283;
366 
367 pub const MSG_TRYHARD: ::c_int = 4;
368 
369 pub const LC_PAPER: ::c_int = 7;
370 pub const LC_NAME: ::c_int = 8;
371 pub const LC_ADDRESS: ::c_int = 9;
372 pub const LC_TELEPHONE: ::c_int = 10;
373 pub const LC_MEASUREMENT: ::c_int = 11;
374 pub const LC_IDENTIFICATION: ::c_int = 12;
375 pub const LC_PAPER_MASK: ::c_int = 1 << LC_PAPER;
376 pub const LC_NAME_MASK: ::c_int = 1 << LC_NAME;
377 pub const LC_ADDRESS_MASK: ::c_int = 1 << LC_ADDRESS;
378 pub const LC_TELEPHONE_MASK: ::c_int = 1 << LC_TELEPHONE;
379 pub const LC_MEASUREMENT_MASK: ::c_int = 1 << LC_MEASUREMENT;
380 pub const LC_IDENTIFICATION_MASK: ::c_int = 1 << LC_IDENTIFICATION;
381 pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK
382     | ::LC_NUMERIC_MASK
383     | ::LC_TIME_MASK
384     | ::LC_COLLATE_MASK
385     | ::LC_MONETARY_MASK
386     | ::LC_MESSAGES_MASK
387     | LC_PAPER_MASK
388     | LC_NAME_MASK
389     | LC_ADDRESS_MASK
390     | LC_TELEPHONE_MASK
391     | LC_MEASUREMENT_MASK
392     | LC_IDENTIFICATION_MASK;
393 
394 pub const MAP_SHARED_VALIDATE: ::c_int = 0x3;
395 pub const MAP_FIXED_NOREPLACE: ::c_int = 0x100000;
396 
397 pub const ENOTSUP: ::c_int = EOPNOTSUPP;
398 
399 pub const SOCK_SEQPACKET: ::c_int = 5;
400 pub const SOCK_DCCP: ::c_int = 6;
401 pub const SOCK_PACKET: ::c_int = 10;
402 
403 pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
404 pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
405 pub const TCP_THIN_DUPACK: ::c_int = 17;
406 pub const TCP_USER_TIMEOUT: ::c_int = 18;
407 pub const TCP_REPAIR: ::c_int = 19;
408 pub const TCP_REPAIR_QUEUE: ::c_int = 20;
409 pub const TCP_QUEUE_SEQ: ::c_int = 21;
410 pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
411 pub const TCP_FASTOPEN: ::c_int = 23;
412 pub const TCP_TIMESTAMP: ::c_int = 24;
413 
414 /* DCCP socket options */
415 pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1;
416 pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2;
417 pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3;
418 pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4;
419 pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5;
420 pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6;
421 pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10;
422 pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11;
423 pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12;
424 pub const DCCP_SOCKOPT_CCID: ::c_int = 13;
425 pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14;
426 pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15;
427 pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16;
428 pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17;
429 pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128;
430 pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192;
431 
432 /// maximum number of services provided on the same listening port
433 pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32;
434 
435 pub const SIGEV_THREAD_ID: ::c_int = 4;
436 
437 pub const BUFSIZ: ::c_uint = 8192;
438 pub const TMP_MAX: ::c_uint = 238328;
439 pub const FOPEN_MAX: ::c_uint = 16;
440 pub const POSIX_MADV_DONTNEED: ::c_int = 4;
441 pub const _SC_EQUIV_CLASS_MAX: ::c_int = 41;
442 pub const _SC_CHARCLASS_NAME_MAX: ::c_int = 45;
443 pub const _SC_PII: ::c_int = 53;
444 pub const _SC_PII_XTI: ::c_int = 54;
445 pub const _SC_PII_SOCKET: ::c_int = 55;
446 pub const _SC_PII_INTERNET: ::c_int = 56;
447 pub const _SC_PII_OSI: ::c_int = 57;
448 pub const _SC_POLL: ::c_int = 58;
449 pub const _SC_SELECT: ::c_int = 59;
450 pub const _SC_PII_INTERNET_STREAM: ::c_int = 61;
451 pub const _SC_PII_INTERNET_DGRAM: ::c_int = 62;
452 pub const _SC_PII_OSI_COTS: ::c_int = 63;
453 pub const _SC_PII_OSI_CLTS: ::c_int = 64;
454 pub const _SC_PII_OSI_M: ::c_int = 65;
455 pub const _SC_T_IOV_MAX: ::c_int = 66;
456 pub const _SC_2_C_VERSION: ::c_int = 96;
457 pub const _SC_CHAR_BIT: ::c_int = 101;
458 pub const _SC_CHAR_MAX: ::c_int = 102;
459 pub const _SC_CHAR_MIN: ::c_int = 103;
460 pub const _SC_INT_MAX: ::c_int = 104;
461 pub const _SC_INT_MIN: ::c_int = 105;
462 pub const _SC_LONG_BIT: ::c_int = 106;
463 pub const _SC_WORD_BIT: ::c_int = 107;
464 pub const _SC_MB_LEN_MAX: ::c_int = 108;
465 pub const _SC_SSIZE_MAX: ::c_int = 110;
466 pub const _SC_SCHAR_MAX: ::c_int = 111;
467 pub const _SC_SCHAR_MIN: ::c_int = 112;
468 pub const _SC_SHRT_MAX: ::c_int = 113;
469 pub const _SC_SHRT_MIN: ::c_int = 114;
470 pub const _SC_UCHAR_MAX: ::c_int = 115;
471 pub const _SC_UINT_MAX: ::c_int = 116;
472 pub const _SC_ULONG_MAX: ::c_int = 117;
473 pub const _SC_USHRT_MAX: ::c_int = 118;
474 pub const _SC_NL_ARGMAX: ::c_int = 119;
475 pub const _SC_NL_LANGMAX: ::c_int = 120;
476 pub const _SC_NL_MSGMAX: ::c_int = 121;
477 pub const _SC_NL_NMAX: ::c_int = 122;
478 pub const _SC_NL_SETMAX: ::c_int = 123;
479 pub const _SC_NL_TEXTMAX: ::c_int = 124;
480 pub const _SC_BASE: ::c_int = 134;
481 pub const _SC_C_LANG_SUPPORT: ::c_int = 135;
482 pub const _SC_C_LANG_SUPPORT_R: ::c_int = 136;
483 pub const _SC_DEVICE_IO: ::c_int = 140;
484 pub const _SC_DEVICE_SPECIFIC: ::c_int = 141;
485 pub const _SC_DEVICE_SPECIFIC_R: ::c_int = 142;
486 pub const _SC_FD_MGMT: ::c_int = 143;
487 pub const _SC_FIFO: ::c_int = 144;
488 pub const _SC_PIPE: ::c_int = 145;
489 pub const _SC_FILE_ATTRIBUTES: ::c_int = 146;
490 pub const _SC_FILE_LOCKING: ::c_int = 147;
491 pub const _SC_FILE_SYSTEM: ::c_int = 148;
492 pub const _SC_MULTI_PROCESS: ::c_int = 150;
493 pub const _SC_SINGLE_PROCESS: ::c_int = 151;
494 pub const _SC_NETWORKING: ::c_int = 152;
495 pub const _SC_REGEX_VERSION: ::c_int = 156;
496 pub const _SC_SIGNALS: ::c_int = 158;
497 pub const _SC_SYSTEM_DATABASE: ::c_int = 162;
498 pub const _SC_SYSTEM_DATABASE_R: ::c_int = 163;
499 pub const _SC_USER_GROUPS: ::c_int = 166;
500 pub const _SC_USER_GROUPS_R: ::c_int = 167;
501 pub const _SC_LEVEL1_ICACHE_SIZE: ::c_int = 185;
502 pub const _SC_LEVEL1_ICACHE_ASSOC: ::c_int = 186;
503 pub const _SC_LEVEL1_ICACHE_LINESIZE: ::c_int = 187;
504 pub const _SC_LEVEL1_DCACHE_SIZE: ::c_int = 188;
505 pub const _SC_LEVEL1_DCACHE_ASSOC: ::c_int = 189;
506 pub const _SC_LEVEL1_DCACHE_LINESIZE: ::c_int = 190;
507 pub const _SC_LEVEL2_CACHE_SIZE: ::c_int = 191;
508 pub const _SC_LEVEL2_CACHE_ASSOC: ::c_int = 192;
509 pub const _SC_LEVEL2_CACHE_LINESIZE: ::c_int = 193;
510 pub const _SC_LEVEL3_CACHE_SIZE: ::c_int = 194;
511 pub const _SC_LEVEL3_CACHE_ASSOC: ::c_int = 195;
512 pub const _SC_LEVEL3_CACHE_LINESIZE: ::c_int = 196;
513 pub const _SC_LEVEL4_CACHE_SIZE: ::c_int = 197;
514 pub const _SC_LEVEL4_CACHE_ASSOC: ::c_int = 198;
515 pub const _SC_LEVEL4_CACHE_LINESIZE: ::c_int = 199;
516 pub const O_ACCMODE: ::c_int = 3;
517 pub const ST_RELATIME: ::c_ulong = 4096;
518 pub const NI_MAXHOST: ::socklen_t = 1025;
519 
520 pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5;
521 pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff;
522 pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245;
523 pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45;
524 pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53;
525 pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53;
526 pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53;
527 pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53;
528 pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849;
529 pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6;
530 pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660;
531 pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6;
532 pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f;
533 pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f;
534 pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468;
535 pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478;
536 pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44;
537 pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c;
538 pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969;
539 pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1;
540 pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0;
541 pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f;
542 pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973;
543 pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b;
544 pub const TMPFS_MAGIC: ::c_long = 0x01021994;
545 pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2;
546 
547 pub const CPU_SETSIZE: ::c_int = 0x400;
548 
549 pub const PTRACE_TRACEME: ::c_uint = 0;
550 pub const PTRACE_PEEKTEXT: ::c_uint = 1;
551 pub const PTRACE_PEEKDATA: ::c_uint = 2;
552 pub const PTRACE_PEEKUSER: ::c_uint = 3;
553 pub const PTRACE_POKETEXT: ::c_uint = 4;
554 pub const PTRACE_POKEDATA: ::c_uint = 5;
555 pub const PTRACE_POKEUSER: ::c_uint = 6;
556 pub const PTRACE_CONT: ::c_uint = 7;
557 pub const PTRACE_KILL: ::c_uint = 8;
558 pub const PTRACE_SINGLESTEP: ::c_uint = 9;
559 pub const PTRACE_ATTACH: ::c_uint = 16;
560 pub const PTRACE_SYSCALL: ::c_uint = 24;
561 pub const PTRACE_SETOPTIONS: ::c_uint = 0x4200;
562 pub const PTRACE_GETEVENTMSG: ::c_uint = 0x4201;
563 pub const PTRACE_GETSIGINFO: ::c_uint = 0x4202;
564 pub const PTRACE_SETSIGINFO: ::c_uint = 0x4203;
565 pub const PTRACE_GETREGSET: ::c_uint = 0x4204;
566 pub const PTRACE_SETREGSET: ::c_uint = 0x4205;
567 pub const PTRACE_SEIZE: ::c_uint = 0x4206;
568 pub const PTRACE_INTERRUPT: ::c_uint = 0x4207;
569 pub const PTRACE_LISTEN: ::c_uint = 0x4208;
570 pub const PTRACE_PEEKSIGINFO: ::c_uint = 0x4209;
571 
572 pub const EPOLLWAKEUP: ::c_int = 0x20000000;
573 
574 pub const SEEK_DATA: ::c_int = 3;
575 pub const SEEK_HOLE: ::c_int = 4;
576 
577 pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead;
578 pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793;
579 pub const LINUX_REBOOT_MAGIC2A: ::c_int = 85072278;
580 pub const LINUX_REBOOT_MAGIC2B: ::c_int = 369367448;
581 pub const LINUX_REBOOT_MAGIC2C: ::c_int = 537993216;
582 
583 pub const LINUX_REBOOT_CMD_RESTART: ::c_int = 0x01234567;
584 pub const LINUX_REBOOT_CMD_HALT: ::c_int = 0xCDEF0123;
585 pub const LINUX_REBOOT_CMD_CAD_ON: ::c_int = 0x89ABCDEF;
586 pub const LINUX_REBOOT_CMD_CAD_OFF: ::c_int = 0x00000000;
587 pub const LINUX_REBOOT_CMD_POWER_OFF: ::c_int = 0x4321FEDC;
588 pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4;
589 pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2;
590 pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543;
591 
592 // linux/rtnetlink.h
593 pub const TCA_PAD: ::c_ushort = 9;
594 pub const TCA_DUMP_INVISIBLE: ::c_ushort = 10;
595 pub const TCA_CHAIN: ::c_ushort = 11;
596 pub const TCA_HW_OFFLOAD: ::c_ushort = 12;
597 
598 pub const RTM_DELNETCONF: u16 = 81;
599 pub const RTM_NEWSTATS: u16 = 92;
600 pub const RTM_GETSTATS: u16 = 94;
601 pub const RTM_NEWCACHEREPORT: u16 = 96;
602 
603 pub const RTM_F_LOOKUP_TABLE: ::c_uint = 0x1000;
604 pub const RTM_F_FIB_MATCH: ::c_uint = 0x2000;
605 
606 pub const RTA_VIA: ::c_ushort = 18;
607 pub const RTA_NEWDST: ::c_ushort = 19;
608 pub const RTA_PREF: ::c_ushort = 20;
609 pub const RTA_ENCAP_TYPE: ::c_ushort = 21;
610 pub const RTA_ENCAP: ::c_ushort = 22;
611 pub const RTA_EXPIRES: ::c_ushort = 23;
612 pub const RTA_PAD: ::c_ushort = 24;
613 pub const RTA_UID: ::c_ushort = 25;
614 pub const RTA_TTL_PROPAGATE: ::c_ushort = 26;
615 
616 // linux/neighbor.h
617 pub const NTF_EXT_LEARNED: u8 = 0x10;
618 pub const NTF_OFFLOADED: u8 = 0x20;
619 
620 pub const NDA_MASTER: ::c_ushort = 9;
621 pub const NDA_LINK_NETNSID: ::c_ushort = 10;
622 pub const NDA_SRC_VNI: ::c_ushort = 11;
623 
624 // linux/if_addr.h
625 pub const IFA_FLAGS: ::c_ushort = 8;
626 
627 pub const IFA_F_MANAGETEMPADDR: u32 = 0x100;
628 pub const IFA_F_NOPREFIXROUTE: u32 = 0x200;
629 pub const IFA_F_MCAUTOJOIN: u32 = 0x400;
630 pub const IFA_F_STABLE_PRIVACY: u32 = 0x800;
631 
632 pub const MAX_LINKS: ::c_int = 32;
633 
634 pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10;
635 
636 pub const GENL_ID_VFS_DQUOT: ::c_int = ::NLMSG_MIN_TYPE + 1;
637 pub const GENL_ID_PMCRAID: ::c_int = ::NLMSG_MIN_TYPE + 2;
638 
639 pub const TIOCM_LE: ::c_int = 0x001;
640 pub const TIOCM_DTR: ::c_int = 0x002;
641 pub const TIOCM_RTS: ::c_int = 0x004;
642 pub const TIOCM_CD: ::c_int = TIOCM_CAR;
643 pub const TIOCM_RI: ::c_int = TIOCM_RNG;
644 
645 pub const NF_NETDEV_INGRESS: ::c_int = 0;
646 pub const NF_NETDEV_NUMHOOKS: ::c_int = 1;
647 
648 pub const NFPROTO_INET: ::c_int = 1;
649 pub const NFPROTO_NETDEV: ::c_int = 5;
650 
651 // linux/netfilter/nf_tables.h
652 pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256;
653 pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256;
654 pub const NFT_SET_MAXNAMELEN: ::c_int = 256;
655 pub const NFT_OBJ_MAXNAMELEN: ::c_int = 256;
656 pub const NFT_USERDATA_MAXLEN: ::c_int = 256;
657 
658 pub const NFT_REG_VERDICT: ::c_int = 0;
659 pub const NFT_REG_1: ::c_int = 1;
660 pub const NFT_REG_2: ::c_int = 2;
661 pub const NFT_REG_3: ::c_int = 3;
662 pub const NFT_REG_4: ::c_int = 4;
663 pub const __NFT_REG_MAX: ::c_int = 5;
664 pub const NFT_REG32_00: ::c_int = 8;
665 pub const NFT_REG32_01: ::c_int = 9;
666 pub const NFT_REG32_02: ::c_int = 10;
667 pub const NFT_REG32_03: ::c_int = 11;
668 pub const NFT_REG32_04: ::c_int = 12;
669 pub const NFT_REG32_05: ::c_int = 13;
670 pub const NFT_REG32_06: ::c_int = 14;
671 pub const NFT_REG32_07: ::c_int = 15;
672 pub const NFT_REG32_08: ::c_int = 16;
673 pub const NFT_REG32_09: ::c_int = 17;
674 pub const NFT_REG32_10: ::c_int = 18;
675 pub const NFT_REG32_11: ::c_int = 19;
676 pub const NFT_REG32_12: ::c_int = 20;
677 pub const NFT_REG32_13: ::c_int = 21;
678 pub const NFT_REG32_14: ::c_int = 22;
679 pub const NFT_REG32_15: ::c_int = 23;
680 
681 pub const NFT_REG_SIZE: ::c_int = 16;
682 pub const NFT_REG32_SIZE: ::c_int = 4;
683 
684 pub const NFT_CONTINUE: ::c_int = -1;
685 pub const NFT_BREAK: ::c_int = -2;
686 pub const NFT_JUMP: ::c_int = -3;
687 pub const NFT_GOTO: ::c_int = -4;
688 pub const NFT_RETURN: ::c_int = -5;
689 
690 pub const NFT_MSG_NEWTABLE: ::c_int = 0;
691 pub const NFT_MSG_GETTABLE: ::c_int = 1;
692 pub const NFT_MSG_DELTABLE: ::c_int = 2;
693 pub const NFT_MSG_NEWCHAIN: ::c_int = 3;
694 pub const NFT_MSG_GETCHAIN: ::c_int = 4;
695 pub const NFT_MSG_DELCHAIN: ::c_int = 5;
696 pub const NFT_MSG_NEWRULE: ::c_int = 6;
697 pub const NFT_MSG_GETRULE: ::c_int = 7;
698 pub const NFT_MSG_DELRULE: ::c_int = 8;
699 pub const NFT_MSG_NEWSET: ::c_int = 9;
700 pub const NFT_MSG_GETSET: ::c_int = 10;
701 pub const NFT_MSG_DELSET: ::c_int = 11;
702 pub const NFT_MSG_NEWSETELEM: ::c_int = 12;
703 pub const NFT_MSG_GETSETELEM: ::c_int = 13;
704 pub const NFT_MSG_DELSETELEM: ::c_int = 14;
705 pub const NFT_MSG_NEWGEN: ::c_int = 15;
706 pub const NFT_MSG_GETGEN: ::c_int = 16;
707 pub const NFT_MSG_TRACE: ::c_int = 17;
708 cfg_if! {
709     if #[cfg(not(target_arch = "sparc64"))] {
710         pub const NFT_MSG_NEWOBJ: ::c_int = 18;
711         pub const NFT_MSG_GETOBJ: ::c_int = 19;
712         pub const NFT_MSG_DELOBJ: ::c_int = 20;
713         pub const NFT_MSG_GETOBJ_RESET: ::c_int = 21;
714     }
715 }
716 pub const NFT_MSG_MAX: ::c_int = 25;
717 
718 pub const NFT_SET_ANONYMOUS: ::c_int = 0x1;
719 pub const NFT_SET_CONSTANT: ::c_int = 0x2;
720 pub const NFT_SET_INTERVAL: ::c_int = 0x4;
721 pub const NFT_SET_MAP: ::c_int = 0x8;
722 pub const NFT_SET_TIMEOUT: ::c_int = 0x10;
723 pub const NFT_SET_EVAL: ::c_int = 0x20;
724 
725 pub const NFT_SET_POL_PERFORMANCE: ::c_int = 0;
726 pub const NFT_SET_POL_MEMORY: ::c_int = 1;
727 
728 pub const NFT_SET_ELEM_INTERVAL_END: ::c_int = 0x1;
729 
730 pub const NFT_DATA_VALUE: ::c_uint = 0;
731 pub const NFT_DATA_VERDICT: ::c_uint = 0xffffff00;
732 
733 pub const NFT_DATA_RESERVED_MASK: ::c_uint = 0xffffff00;
734 
735 pub const NFT_DATA_VALUE_MAXLEN: ::c_int = 64;
736 
737 pub const NFT_BYTEORDER_NTOH: ::c_int = 0;
738 pub const NFT_BYTEORDER_HTON: ::c_int = 1;
739 
740 pub const NFT_CMP_EQ: ::c_int = 0;
741 pub const NFT_CMP_NEQ: ::c_int = 1;
742 pub const NFT_CMP_LT: ::c_int = 2;
743 pub const NFT_CMP_LTE: ::c_int = 3;
744 pub const NFT_CMP_GT: ::c_int = 4;
745 pub const NFT_CMP_GTE: ::c_int = 5;
746 
747 pub const NFT_RANGE_EQ: ::c_int = 0;
748 pub const NFT_RANGE_NEQ: ::c_int = 1;
749 
750 pub const NFT_LOOKUP_F_INV: ::c_int = 1 << 0;
751 
752 pub const NFT_DYNSET_OP_ADD: ::c_int = 0;
753 pub const NFT_DYNSET_OP_UPDATE: ::c_int = 1;
754 
755 pub const NFT_DYNSET_F_INV: ::c_int = 1 << 0;
756 
757 pub const NFT_PAYLOAD_LL_HEADER: ::c_int = 0;
758 pub const NFT_PAYLOAD_NETWORK_HEADER: ::c_int = 1;
759 pub const NFT_PAYLOAD_TRANSPORT_HEADER: ::c_int = 2;
760 
761 pub const NFT_PAYLOAD_CSUM_NONE: ::c_int = 0;
762 pub const NFT_PAYLOAD_CSUM_INET: ::c_int = 1;
763 
764 pub const NFT_META_LEN: ::c_int = 0;
765 pub const NFT_META_PROTOCOL: ::c_int = 1;
766 pub const NFT_META_PRIORITY: ::c_int = 2;
767 pub const NFT_META_MARK: ::c_int = 3;
768 pub const NFT_META_IIF: ::c_int = 4;
769 pub const NFT_META_OIF: ::c_int = 5;
770 pub const NFT_META_IIFNAME: ::c_int = 6;
771 pub const NFT_META_OIFNAME: ::c_int = 7;
772 pub const NFT_META_IIFTYPE: ::c_int = 8;
773 pub const NFT_META_OIFTYPE: ::c_int = 9;
774 pub const NFT_META_SKUID: ::c_int = 10;
775 pub const NFT_META_SKGID: ::c_int = 11;
776 pub const NFT_META_NFTRACE: ::c_int = 12;
777 pub const NFT_META_RTCLASSID: ::c_int = 13;
778 pub const NFT_META_SECMARK: ::c_int = 14;
779 pub const NFT_META_NFPROTO: ::c_int = 15;
780 pub const NFT_META_L4PROTO: ::c_int = 16;
781 pub const NFT_META_BRI_IIFNAME: ::c_int = 17;
782 pub const NFT_META_BRI_OIFNAME: ::c_int = 18;
783 pub const NFT_META_PKTTYPE: ::c_int = 19;
784 pub const NFT_META_CPU: ::c_int = 20;
785 pub const NFT_META_IIFGROUP: ::c_int = 21;
786 pub const NFT_META_OIFGROUP: ::c_int = 22;
787 pub const NFT_META_CGROUP: ::c_int = 23;
788 pub const NFT_META_PRANDOM: ::c_int = 24;
789 
790 pub const NFT_CT_STATE: ::c_int = 0;
791 pub const NFT_CT_DIRECTION: ::c_int = 1;
792 pub const NFT_CT_STATUS: ::c_int = 2;
793 pub const NFT_CT_MARK: ::c_int = 3;
794 pub const NFT_CT_SECMARK: ::c_int = 4;
795 pub const NFT_CT_EXPIRATION: ::c_int = 5;
796 pub const NFT_CT_HELPER: ::c_int = 6;
797 pub const NFT_CT_L3PROTOCOL: ::c_int = 7;
798 pub const NFT_CT_SRC: ::c_int = 8;
799 pub const NFT_CT_DST: ::c_int = 9;
800 pub const NFT_CT_PROTOCOL: ::c_int = 10;
801 pub const NFT_CT_PROTO_SRC: ::c_int = 11;
802 pub const NFT_CT_PROTO_DST: ::c_int = 12;
803 pub const NFT_CT_LABELS: ::c_int = 13;
804 pub const NFT_CT_PKTS: ::c_int = 14;
805 pub const NFT_CT_BYTES: ::c_int = 15;
806 
807 pub const NFT_LIMIT_PKTS: ::c_int = 0;
808 pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1;
809 
810 pub const NFT_LIMIT_F_INV: ::c_int = 1 << 0;
811 
812 pub const NFT_QUEUE_FLAG_BYPASS: ::c_int = 0x01;
813 pub const NFT_QUEUE_FLAG_CPU_FANOUT: ::c_int = 0x02;
814 pub const NFT_QUEUE_FLAG_MASK: ::c_int = 0x03;
815 
816 pub const NFT_QUOTA_F_INV: ::c_int = 1 << 0;
817 
818 pub const NFT_REJECT_ICMP_UNREACH: ::c_int = 0;
819 pub const NFT_REJECT_TCP_RST: ::c_int = 1;
820 pub const NFT_REJECT_ICMPX_UNREACH: ::c_int = 2;
821 
822 pub const NFT_REJECT_ICMPX_NO_ROUTE: ::c_int = 0;
823 pub const NFT_REJECT_ICMPX_PORT_UNREACH: ::c_int = 1;
824 pub const NFT_REJECT_ICMPX_HOST_UNREACH: ::c_int = 2;
825 pub const NFT_REJECT_ICMPX_ADMIN_PROHIBITED: ::c_int = 3;
826 
827 pub const NFT_NAT_SNAT: ::c_int = 0;
828 pub const NFT_NAT_DNAT: ::c_int = 1;
829 
830 pub const NFT_TRACETYPE_UNSPEC: ::c_int = 0;
831 pub const NFT_TRACETYPE_POLICY: ::c_int = 1;
832 pub const NFT_TRACETYPE_RETURN: ::c_int = 2;
833 pub const NFT_TRACETYPE_RULE: ::c_int = 3;
834 
835 pub const NFT_NG_INCREMENTAL: ::c_int = 0;
836 pub const NFT_NG_RANDOM: ::c_int = 1;
837 
838 pub const M_MXFAST: ::c_int = 1;
839 pub const M_NLBLKS: ::c_int = 2;
840 pub const M_GRAIN: ::c_int = 3;
841 pub const M_KEEP: ::c_int = 4;
842 pub const M_TRIM_THRESHOLD: ::c_int = -1;
843 pub const M_TOP_PAD: ::c_int = -2;
844 pub const M_MMAP_THRESHOLD: ::c_int = -3;
845 pub const M_MMAP_MAX: ::c_int = -4;
846 pub const M_CHECK_ACTION: ::c_int = -5;
847 pub const M_PERTURB: ::c_int = -6;
848 pub const M_ARENA_TEST: ::c_int = -7;
849 pub const M_ARENA_MAX: ::c_int = -8;
850 
851 pub const AT_STATX_SYNC_TYPE: ::c_int = 0x6000;
852 pub const AT_STATX_SYNC_AS_STAT: ::c_int = 0x0000;
853 pub const AT_STATX_FORCE_SYNC: ::c_int = 0x2000;
854 pub const AT_STATX_DONT_SYNC: ::c_int = 0x4000;
855 pub const STATX_TYPE: ::c_uint = 0x0001;
856 pub const STATX_MODE: ::c_uint = 0x0002;
857 pub const STATX_NLINK: ::c_uint = 0x0004;
858 pub const STATX_UID: ::c_uint = 0x0008;
859 pub const STATX_GID: ::c_uint = 0x0010;
860 pub const STATX_ATIME: ::c_uint = 0x0020;
861 pub const STATX_MTIME: ::c_uint = 0x0040;
862 pub const STATX_CTIME: ::c_uint = 0x0080;
863 pub const STATX_INO: ::c_uint = 0x0100;
864 pub const STATX_SIZE: ::c_uint = 0x0200;
865 pub const STATX_BLOCKS: ::c_uint = 0x0400;
866 pub const STATX_BASIC_STATS: ::c_uint = 0x07ff;
867 pub const STATX_BTIME: ::c_uint = 0x0800;
868 pub const STATX_ALL: ::c_uint = 0x0fff;
869 pub const STATX__RESERVED: ::c_int = 0x80000000;
870 pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004;
871 pub const STATX_ATTR_IMMUTABLE: ::c_int = 0x0010;
872 pub const STATX_ATTR_APPEND: ::c_int = 0x0020;
873 pub const STATX_ATTR_NODUMP: ::c_int = 0x0040;
874 pub const STATX_ATTR_ENCRYPTED: ::c_int = 0x0800;
875 pub const STATX_ATTR_AUTOMOUNT: ::c_int = 0x1000;
876 
877 // sys/auxv.h
878 pub const AT_NULL: ::c_ulong = 0;
879 pub const AT_IGNORE: ::c_ulong = 1;
880 pub const AT_EXECFD: ::c_ulong = 2;
881 pub const AT_PHDR: ::c_ulong = 3;
882 pub const AT_PHENT: ::c_ulong = 4;
883 pub const AT_PHNUM: ::c_ulong = 5;
884 pub const AT_PAGESZ: ::c_ulong = 6;
885 pub const AT_BASE: ::c_ulong = 7;
886 pub const AT_FLAGS: ::c_ulong = 8;
887 pub const AT_ENTRY: ::c_ulong = 9;
888 pub const AT_NOTELF: ::c_ulong = 10;
889 pub const AT_UID: ::c_ulong = 11;
890 pub const AT_EUID: ::c_ulong = 12;
891 pub const AT_GID: ::c_ulong = 13;
892 pub const AT_EGID: ::c_ulong = 14;
893 pub const AT_PLATFORM: ::c_ulong = 15;
894 pub const AT_HWCAP: ::c_ulong = 16;
895 pub const AT_CLKTCK: ::c_ulong = 17;
896 // AT_* values 18 through 22 are reserved
897 pub const AT_SECURE: ::c_ulong = 23;
898 pub const AT_BASE_PLATFORM: ::c_ulong = 24;
899 pub const AT_RANDOM: ::c_ulong = 25;
900 pub const AT_HWCAP2: ::c_ulong = 26;
901 
902 pub const AT_EXECFN: ::c_ulong = 31;
903 
904 cfg_if! {
905     if #[cfg(any(
906         target_arch = "arm",
907         target_arch = "x86",
908         target_arch = "x86_64",
909         target_arch = "s390x"
910     ))] {
911         pub const PTHREAD_STACK_MIN: ::size_t = 16384;
912     } else if #[cfg(any(
913                target_arch = "sparc",
914                target_arch = "sparc64"
915            ))] {
916         pub const PTHREAD_STACK_MIN: ::size_t = 0x6000;
917     } else {
918         pub const PTHREAD_STACK_MIN: ::size_t = 131072;
919     }
920 }
921 pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 3;
922 
923 extern "C" {
924     pub fn qsort_r(
925         base: *mut ::c_void,
926         num: ::size_t,
927         size: ::size_t,
928         compar: ::Option<
929             unsafe extern "C" fn(
930                 *const ::c_void,
931                 *const ::c_void,
932                 *mut ::c_void,
933             ) -> ::c_int,
934         >,
935         arg: *mut ::c_void,
936     );
937     pub fn sendmmsg(
938         sockfd: ::c_int,
939         msgvec: *mut ::mmsghdr,
940         vlen: ::c_uint,
941         flags: ::c_int,
942     ) -> ::c_int;
943     pub fn recvmmsg(
944         sockfd: ::c_int,
945         msgvec: *mut ::mmsghdr,
946         vlen: ::c_uint,
947         flags: ::c_int,
948         timeout: *mut ::timespec,
949     ) -> ::c_int;
950 
951     pub fn getrlimit64(
952         resource: ::__rlimit_resource_t,
953         rlim: *mut ::rlimit64,
954     ) -> ::c_int;
955     pub fn setrlimit64(
956         resource: ::__rlimit_resource_t,
957         rlim: *const ::rlimit64,
958     ) -> ::c_int;
959     pub fn getrlimit(
960         resource: ::__rlimit_resource_t,
961         rlim: *mut ::rlimit,
962     ) -> ::c_int;
963     pub fn setrlimit(
964         resource: ::__rlimit_resource_t,
965         rlim: *const ::rlimit,
966     ) -> ::c_int;
967     pub fn prlimit(
968         pid: ::pid_t,
969         resource: ::__rlimit_resource_t,
970         new_limit: *const ::rlimit,
971         old_limit: *mut ::rlimit,
972     ) -> ::c_int;
973     pub fn prlimit64(
974         pid: ::pid_t,
975         resource: ::__rlimit_resource_t,
976         new_limit: *const ::rlimit64,
977         old_limit: *mut ::rlimit64,
978     ) -> ::c_int;
979     pub fn utmpname(file: *const ::c_char) -> ::c_int;
980     pub fn utmpxname(file: *const ::c_char) -> ::c_int;
981     pub fn getutxent() -> *mut utmpx;
982     pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
983     pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
984     pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
985     pub fn setutxent();
986     pub fn endutxent();
987     pub fn getpt() -> ::c_int;
988     pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int;
989     pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
990     pub fn statx(
991         dirfd: ::c_int,
992         pathname: *const c_char,
993         flags: ::c_int,
994         mask: ::c_uint,
995         statxbuf: *mut statx,
996     ) -> ::c_int;
997     pub fn getrandom(
998         buf: *mut ::c_void,
999         buflen: ::size_t,
1000         flags: ::c_uint,
1001     ) -> ::ssize_t;
1002     pub fn memmem(
1003         haystack: *const ::c_void,
1004         haystacklen: ::size_t,
1005         needle: *const ::c_void,
1006         needlelen: ::size_t,
1007     ) -> *mut ::c_void;
1008     pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
1009 }
1010 
1011 #[link(name = "util")]
1012 extern "C" {
1013     pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
1014     pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int;
1015     pub fn glob64(
1016         pattern: *const ::c_char,
1017         flags: ::c_int,
1018         errfunc: ::Option<
1019             extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int,
1020         >,
1021         pglob: *mut glob64_t,
1022     ) -> ::c_int;
1023     pub fn globfree64(pglob: *mut glob64_t);
1024     pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
1025     pub fn pthread_attr_getaffinity_np(
1026         attr: *const ::pthread_attr_t,
1027         cpusetsize: ::size_t,
1028         cpuset: *mut ::cpu_set_t,
1029     ) -> ::c_int;
1030     pub fn pthread_attr_setaffinity_np(
1031         attr: *mut ::pthread_attr_t,
1032         cpusetsize: ::size_t,
1033         cpuset: *const ::cpu_set_t,
1034     ) -> ::c_int;
1035     pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int;
1036     pub fn setpriority(
1037         which: ::__priority_which_t,
1038         who: ::id_t,
1039         prio: ::c_int,
1040     ) -> ::c_int;
1041     pub fn pthread_getaffinity_np(
1042         thread: ::pthread_t,
1043         cpusetsize: ::size_t,
1044         cpuset: *mut ::cpu_set_t,
1045     ) -> ::c_int;
1046     pub fn pthread_setaffinity_np(
1047         thread: ::pthread_t,
1048         cpusetsize: ::size_t,
1049         cpuset: *const ::cpu_set_t,
1050     ) -> ::c_int;
1051     pub fn pthread_rwlockattr_getkind_np(
1052         attr: *const ::pthread_rwlockattr_t,
1053         val: *mut ::c_int,
1054     ) -> ::c_int;
1055     pub fn pthread_rwlockattr_setkind_np(
1056         attr: *mut ::pthread_rwlockattr_t,
1057         val: ::c_int,
1058     ) -> ::c_int;
1059     pub fn sched_getcpu() -> ::c_int;
1060     pub fn mallinfo() -> ::mallinfo;
1061     pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
1062     #[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
1063     #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwent_r")]
1064     pub fn getpwent_r(
1065         pwd: *mut ::passwd,
1066         buf: *mut ::c_char,
1067         buflen: ::size_t,
1068         result: *mut *mut ::passwd,
1069     ) -> ::c_int;
1070     #[cfg_attr(target_os = "netbsd", link_name = "__getgrent_r50")]
1071     #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrent_r")]
1072     pub fn getgrent_r(
1073         grp: *mut ::group,
1074         buf: *mut ::c_char,
1075         buflen: ::size_t,
1076         result: *mut *mut ::group,
1077     ) -> ::c_int;
1078     pub fn pthread_getname_np(
1079         thread: ::pthread_t,
1080         name: *mut ::c_char,
1081         len: ::size_t,
1082     ) -> ::c_int;
1083     pub fn pthread_setname_np(
1084         thread: ::pthread_t,
1085         name: *const ::c_char,
1086     ) -> ::c_int;
1087 }
1088 
1089 #[link(name = "dl")]
1090 extern "C" {
1091     pub fn dlmopen(
1092         lmid: Lmid_t,
1093         filename: *const ::c_char,
1094         flag: ::c_int,
1095     ) -> *mut ::c_void;
1096     pub fn dlinfo(
1097         handle: *mut ::c_void,
1098         request: ::c_int,
1099         info: *mut ::c_void,
1100     ) -> ::c_int;
1101 }
1102 
1103 cfg_if! {
1104     if #[cfg(any(target_arch = "x86",
1105                  target_arch = "arm",
1106                  target_arch = "mips",
1107                  target_arch = "powerpc",
1108                  target_arch = "sparc"))] {
1109         mod b32;
1110         pub use self::b32::*;
1111     } else if #[cfg(any(target_arch = "x86_64",
1112                         target_arch = "aarch64",
1113                         target_arch = "powerpc64",
1114                         target_arch = "mips64",
1115                         target_arch = "s390x",
1116                         target_arch = "sparc64",
1117                         target_arch = "riscv64"))] {
1118         mod b64;
1119         pub use self::b64::*;
1120     } else {
1121         // Unknown target_arch
1122     }
1123 }
1124 
1125 cfg_if! {
1126     if #[cfg(libc_align)] {
1127         mod align;
1128         pub use self::align::*;
1129     } else {
1130         mod no_align;
1131         pub use self::no_align::*;
1132     }
1133 }
1134