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