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