libc/unix/linux_like/linux/gnu/
mod.rs

1pub type pthread_t = c_ulong;
2pub type __priority_which_t = ::c_uint;
3pub type __rlimit_resource_t = ::c_uint;
4
5s! {
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
187impl siginfo_t {
188    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
199    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
213s_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
251cfg_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
311pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
312pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
313pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
314pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
315pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
316pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
317pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
318pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
319pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
320pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
321pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
322pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = 16;
323
324pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
325
326pub const __UT_LINESIZE: usize = 32;
327pub const __UT_NAMESIZE: usize = 32;
328pub const __UT_HOSTSIZE: usize = 256;
329pub const EMPTY: ::c_short = 0;
330pub const RUN_LVL: ::c_short = 1;
331pub const BOOT_TIME: ::c_short = 2;
332pub const NEW_TIME: ::c_short = 3;
333pub const OLD_TIME: ::c_short = 4;
334pub const INIT_PROCESS: ::c_short = 5;
335pub const LOGIN_PROCESS: ::c_short = 6;
336pub const USER_PROCESS: ::c_short = 7;
337pub const DEAD_PROCESS: ::c_short = 8;
338pub const ACCOUNTING: ::c_short = 9;
339
340pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
341
342pub const SOL_RXRPC: ::c_int = 272;
343pub const SOL_PPPOL2TP: ::c_int = 273;
344pub const SOL_PNPIPE: ::c_int = 275;
345pub const SOL_RDS: ::c_int = 276;
346pub const SOL_IUCV: ::c_int = 277;
347pub const SOL_CAIF: ::c_int = 278;
348pub const SOL_NFC: ::c_int = 280;
349pub const SOL_XDP: ::c_int = 283;
350
351pub const MSG_TRYHARD: ::c_int = 4;
352
353pub const LC_PAPER: ::c_int = 7;
354pub const LC_NAME: ::c_int = 8;
355pub const LC_ADDRESS: ::c_int = 9;
356pub const LC_TELEPHONE: ::c_int = 10;
357pub const LC_MEASUREMENT: ::c_int = 11;
358pub const LC_IDENTIFICATION: ::c_int = 12;
359pub const LC_PAPER_MASK: ::c_int = (1 << LC_PAPER);
360pub const LC_NAME_MASK: ::c_int = (1 << LC_NAME);
361pub const LC_ADDRESS_MASK: ::c_int = (1 << LC_ADDRESS);
362pub const LC_TELEPHONE_MASK: ::c_int = (1 << LC_TELEPHONE);
363pub const LC_MEASUREMENT_MASK: ::c_int = (1 << LC_MEASUREMENT);
364pub const LC_IDENTIFICATION_MASK: ::c_int = (1 << LC_IDENTIFICATION);
365pub 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
378pub const MAP_SHARED_VALIDATE: ::c_int = 0x3;
379pub const MAP_FIXED_NOREPLACE: ::c_int = 0x100000;
380
381pub const ENOTSUP: ::c_int = EOPNOTSUPP;
382
383pub const SOCK_SEQPACKET: ::c_int = 5;
384pub const SOCK_DCCP: ::c_int = 6;
385pub const SOCK_PACKET: ::c_int = 10;
386
387pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
388pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
389pub const TCP_THIN_DUPACK: ::c_int = 17;
390pub const TCP_USER_TIMEOUT: ::c_int = 18;
391pub const TCP_REPAIR: ::c_int = 19;
392pub const TCP_REPAIR_QUEUE: ::c_int = 20;
393pub const TCP_QUEUE_SEQ: ::c_int = 21;
394pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
395pub const TCP_FASTOPEN: ::c_int = 23;
396pub const TCP_TIMESTAMP: ::c_int = 24;
397
398/* DCCP socket options */
399pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1;
400pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2;
401pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3;
402pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4;
403pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5;
404pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6;
405pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10;
406pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11;
407pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12;
408pub const DCCP_SOCKOPT_CCID: ::c_int = 13;
409pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14;
410pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15;
411pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16;
412pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17;
413pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128;
414pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192;
415
416/// maximum number of services provided on the same listening port
417pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32;
418
419pub const SIGEV_THREAD_ID: ::c_int = 4;
420
421pub const BUFSIZ: ::c_uint = 8192;
422pub const TMP_MAX: ::c_uint = 238328;
423pub const FOPEN_MAX: ::c_uint = 16;
424pub const POSIX_MADV_DONTNEED: ::c_int = 4;
425pub const _SC_EQUIV_CLASS_MAX: ::c_int = 41;
426pub const _SC_CHARCLASS_NAME_MAX: ::c_int = 45;
427pub const _SC_PII: ::c_int = 53;
428pub const _SC_PII_XTI: ::c_int = 54;
429pub const _SC_PII_SOCKET: ::c_int = 55;
430pub const _SC_PII_INTERNET: ::c_int = 56;
431pub const _SC_PII_OSI: ::c_int = 57;
432pub const _SC_POLL: ::c_int = 58;
433pub const _SC_SELECT: ::c_int = 59;
434pub const _SC_PII_INTERNET_STREAM: ::c_int = 61;
435pub const _SC_PII_INTERNET_DGRAM: ::c_int = 62;
436pub const _SC_PII_OSI_COTS: ::c_int = 63;
437pub const _SC_PII_OSI_CLTS: ::c_int = 64;
438pub const _SC_PII_OSI_M: ::c_int = 65;
439pub const _SC_T_IOV_MAX: ::c_int = 66;
440pub const _SC_2_C_VERSION: ::c_int = 96;
441pub const _SC_CHAR_BIT: ::c_int = 101;
442pub const _SC_CHAR_MAX: ::c_int = 102;
443pub const _SC_CHAR_MIN: ::c_int = 103;
444pub const _SC_INT_MAX: ::c_int = 104;
445pub const _SC_INT_MIN: ::c_int = 105;
446pub const _SC_LONG_BIT: ::c_int = 106;
447pub const _SC_WORD_BIT: ::c_int = 107;
448pub const _SC_MB_LEN_MAX: ::c_int = 108;
449pub const _SC_SSIZE_MAX: ::c_int = 110;
450pub const _SC_SCHAR_MAX: ::c_int = 111;
451pub const _SC_SCHAR_MIN: ::c_int = 112;
452pub const _SC_SHRT_MAX: ::c_int = 113;
453pub const _SC_SHRT_MIN: ::c_int = 114;
454pub const _SC_UCHAR_MAX: ::c_int = 115;
455pub const _SC_UINT_MAX: ::c_int = 116;
456pub const _SC_ULONG_MAX: ::c_int = 117;
457pub const _SC_USHRT_MAX: ::c_int = 118;
458pub const _SC_NL_ARGMAX: ::c_int = 119;
459pub const _SC_NL_LANGMAX: ::c_int = 120;
460pub const _SC_NL_MSGMAX: ::c_int = 121;
461pub const _SC_NL_NMAX: ::c_int = 122;
462pub const _SC_NL_SETMAX: ::c_int = 123;
463pub const _SC_NL_TEXTMAX: ::c_int = 124;
464pub const _SC_BASE: ::c_int = 134;
465pub const _SC_C_LANG_SUPPORT: ::c_int = 135;
466pub const _SC_C_LANG_SUPPORT_R: ::c_int = 136;
467pub const _SC_DEVICE_IO: ::c_int = 140;
468pub const _SC_DEVICE_SPECIFIC: ::c_int = 141;
469pub const _SC_DEVICE_SPECIFIC_R: ::c_int = 142;
470pub const _SC_FD_MGMT: ::c_int = 143;
471pub const _SC_FIFO: ::c_int = 144;
472pub const _SC_PIPE: ::c_int = 145;
473pub const _SC_FILE_ATTRIBUTES: ::c_int = 146;
474pub const _SC_FILE_LOCKING: ::c_int = 147;
475pub const _SC_FILE_SYSTEM: ::c_int = 148;
476pub const _SC_MULTI_PROCESS: ::c_int = 150;
477pub const _SC_SINGLE_PROCESS: ::c_int = 151;
478pub const _SC_NETWORKING: ::c_int = 152;
479pub const _SC_REGEX_VERSION: ::c_int = 156;
480pub const _SC_SIGNALS: ::c_int = 158;
481pub const _SC_SYSTEM_DATABASE: ::c_int = 162;
482pub const _SC_SYSTEM_DATABASE_R: ::c_int = 163;
483pub const _SC_USER_GROUPS: ::c_int = 166;
484pub const _SC_USER_GROUPS_R: ::c_int = 167;
485pub const _SC_LEVEL1_ICACHE_SIZE: ::c_int = 185;
486pub const _SC_LEVEL1_ICACHE_ASSOC: ::c_int = 186;
487pub const _SC_LEVEL1_ICACHE_LINESIZE: ::c_int = 187;
488pub const _SC_LEVEL1_DCACHE_SIZE: ::c_int = 188;
489pub const _SC_LEVEL1_DCACHE_ASSOC: ::c_int = 189;
490pub const _SC_LEVEL1_DCACHE_LINESIZE: ::c_int = 190;
491pub const _SC_LEVEL2_CACHE_SIZE: ::c_int = 191;
492pub const _SC_LEVEL2_CACHE_ASSOC: ::c_int = 192;
493pub const _SC_LEVEL2_CACHE_LINESIZE: ::c_int = 193;
494pub const _SC_LEVEL3_CACHE_SIZE: ::c_int = 194;
495pub const _SC_LEVEL3_CACHE_ASSOC: ::c_int = 195;
496pub const _SC_LEVEL3_CACHE_LINESIZE: ::c_int = 196;
497pub const _SC_LEVEL4_CACHE_SIZE: ::c_int = 197;
498pub const _SC_LEVEL4_CACHE_ASSOC: ::c_int = 198;
499pub const _SC_LEVEL4_CACHE_LINESIZE: ::c_int = 199;
500pub const O_ACCMODE: ::c_int = 3;
501pub const ST_RELATIME: ::c_ulong = 4096;
502pub const NI_MAXHOST: ::socklen_t = 1025;
503
504pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5;
505pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff;
506pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245;
507pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45;
508pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53;
509pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53;
510pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53;
511pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53;
512pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849;
513pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6;
514pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660;
515pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6;
516pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f;
517pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f;
518pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468;
519pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478;
520pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44;
521pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c;
522pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969;
523pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1;
524pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0;
525pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f;
526pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973;
527pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b;
528pub const TMPFS_MAGIC: ::c_long = 0x01021994;
529pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2;
530
531pub const CPU_SETSIZE: ::c_int = 0x400;
532
533pub const PTRACE_TRACEME: ::c_uint = 0;
534pub const PTRACE_PEEKTEXT: ::c_uint = 1;
535pub const PTRACE_PEEKDATA: ::c_uint = 2;
536pub const PTRACE_PEEKUSER: ::c_uint = 3;
537pub const PTRACE_POKETEXT: ::c_uint = 4;
538pub const PTRACE_POKEDATA: ::c_uint = 5;
539pub const PTRACE_POKEUSER: ::c_uint = 6;
540pub const PTRACE_CONT: ::c_uint = 7;
541pub const PTRACE_KILL: ::c_uint = 8;
542pub const PTRACE_SINGLESTEP: ::c_uint = 9;
543pub const PTRACE_ATTACH: ::c_uint = 16;
544pub const PTRACE_SYSCALL: ::c_uint = 24;
545pub const PTRACE_SETOPTIONS: ::c_uint = 0x4200;
546pub const PTRACE_GETEVENTMSG: ::c_uint = 0x4201;
547pub const PTRACE_GETSIGINFO: ::c_uint = 0x4202;
548pub const PTRACE_SETSIGINFO: ::c_uint = 0x4203;
549pub const PTRACE_GETREGSET: ::c_uint = 0x4204;
550pub const PTRACE_SETREGSET: ::c_uint = 0x4205;
551pub const PTRACE_SEIZE: ::c_uint = 0x4206;
552pub const PTRACE_INTERRUPT: ::c_uint = 0x4207;
553pub const PTRACE_LISTEN: ::c_uint = 0x4208;
554pub const PTRACE_PEEKSIGINFO: ::c_uint = 0x4209;
555
556pub const EPOLLWAKEUP: ::c_int = 0x20000000;
557
558pub const SEEK_DATA: ::c_int = 3;
559pub const SEEK_HOLE: ::c_int = 4;
560
561pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead;
562pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793;
563pub const LINUX_REBOOT_MAGIC2A: ::c_int = 85072278;
564pub const LINUX_REBOOT_MAGIC2B: ::c_int = 369367448;
565pub const LINUX_REBOOT_MAGIC2C: ::c_int = 537993216;
566
567pub const LINUX_REBOOT_CMD_RESTART: ::c_int = 0x01234567;
568pub const LINUX_REBOOT_CMD_HALT: ::c_int = 0xCDEF0123;
569pub const LINUX_REBOOT_CMD_CAD_ON: ::c_int = 0x89ABCDEF;
570pub const LINUX_REBOOT_CMD_CAD_OFF: ::c_int = 0x00000000;
571pub const LINUX_REBOOT_CMD_POWER_OFF: ::c_int = 0x4321FEDC;
572pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4;
573pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2;
574pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543;
575
576// linux/rtnetlink.h
577pub const TCA_PAD: ::c_ushort = 9;
578pub const TCA_DUMP_INVISIBLE: ::c_ushort = 10;
579pub const TCA_CHAIN: ::c_ushort = 11;
580pub const TCA_HW_OFFLOAD: ::c_ushort = 12;
581
582pub const RTM_DELNETCONF: u16 = 81;
583pub const RTM_NEWSTATS: u16 = 92;
584pub const RTM_GETSTATS: u16 = 94;
585pub const RTM_NEWCACHEREPORT: u16 = 96;
586
587pub const RTM_F_LOOKUP_TABLE: ::c_uint = 0x1000;
588pub const RTM_F_FIB_MATCH: ::c_uint = 0x2000;
589
590pub const RTA_VIA: ::c_ushort = 18;
591pub const RTA_NEWDST: ::c_ushort = 19;
592pub const RTA_PREF: ::c_ushort = 20;
593pub const RTA_ENCAP_TYPE: ::c_ushort = 21;
594pub const RTA_ENCAP: ::c_ushort = 22;
595pub const RTA_EXPIRES: ::c_ushort = 23;
596pub const RTA_PAD: ::c_ushort = 24;
597pub const RTA_UID: ::c_ushort = 25;
598pub const RTA_TTL_PROPAGATE: ::c_ushort = 26;
599
600// linux/neighbor.h
601pub const NTF_EXT_LEARNED: u8 = 0x10;
602pub const NTF_OFFLOADED: u8 = 0x20;
603
604pub const NDA_MASTER: ::c_ushort = 9;
605pub const NDA_LINK_NETNSID: ::c_ushort = 10;
606pub const NDA_SRC_VNI: ::c_ushort = 11;
607
608// linux/if_addr.h
609pub const IFA_FLAGS: ::c_ushort = 8;
610
611pub const IFA_F_MANAGETEMPADDR: u32 = 0x100;
612pub const IFA_F_NOPREFIXROUTE: u32 = 0x200;
613pub const IFA_F_MCAUTOJOIN: u32 = 0x400;
614pub const IFA_F_STABLE_PRIVACY: u32 = 0x800;
615
616pub const MAX_LINKS: ::c_int = 32;
617
618pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10;
619
620pub const GENL_ID_VFS_DQUOT: ::c_int = ::NLMSG_MIN_TYPE + 1;
621pub const GENL_ID_PMCRAID: ::c_int = ::NLMSG_MIN_TYPE + 2;
622
623pub const TIOCM_LE: ::c_int = 0x001;
624pub const TIOCM_DTR: ::c_int = 0x002;
625pub const TIOCM_RTS: ::c_int = 0x004;
626pub const TIOCM_CD: ::c_int = TIOCM_CAR;
627pub const TIOCM_RI: ::c_int = TIOCM_RNG;
628
629pub const NF_NETDEV_INGRESS: ::c_int = 0;
630pub const NF_NETDEV_NUMHOOKS: ::c_int = 1;
631
632pub const NFPROTO_INET: ::c_int = 1;
633pub const NFPROTO_NETDEV: ::c_int = 5;
634
635// linux/netfilter/nf_tables.h
636pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256;
637pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256;
638pub const NFT_SET_MAXNAMELEN: ::c_int = 256;
639pub const NFT_OBJ_MAXNAMELEN: ::c_int = 256;
640pub const NFT_USERDATA_MAXLEN: ::c_int = 256;
641
642pub const NFT_REG_VERDICT: ::c_int = 0;
643pub const NFT_REG_1: ::c_int = 1;
644pub const NFT_REG_2: ::c_int = 2;
645pub const NFT_REG_3: ::c_int = 3;
646pub const NFT_REG_4: ::c_int = 4;
647pub const __NFT_REG_MAX: ::c_int = 5;
648pub const NFT_REG32_00: ::c_int = 8;
649pub const NFT_REG32_01: ::c_int = 9;
650pub const NFT_REG32_02: ::c_int = 10;
651pub const NFT_REG32_03: ::c_int = 11;
652pub const NFT_REG32_04: ::c_int = 12;
653pub const NFT_REG32_05: ::c_int = 13;
654pub const NFT_REG32_06: ::c_int = 14;
655pub const NFT_REG32_07: ::c_int = 15;
656pub const NFT_REG32_08: ::c_int = 16;
657pub const NFT_REG32_09: ::c_int = 17;
658pub const NFT_REG32_10: ::c_int = 18;
659pub const NFT_REG32_11: ::c_int = 19;
660pub const NFT_REG32_12: ::c_int = 20;
661pub const NFT_REG32_13: ::c_int = 21;
662pub const NFT_REG32_14: ::c_int = 22;
663pub const NFT_REG32_15: ::c_int = 23;
664
665pub const NFT_REG_SIZE: ::c_int = 16;
666pub const NFT_REG32_SIZE: ::c_int = 4;
667
668pub const NFT_CONTINUE: ::c_int = -1;
669pub const NFT_BREAK: ::c_int = -2;
670pub const NFT_JUMP: ::c_int = -3;
671pub const NFT_GOTO: ::c_int = -4;
672pub const NFT_RETURN: ::c_int = -5;
673
674pub const NFT_MSG_NEWTABLE: ::c_int = 0;
675pub const NFT_MSG_GETTABLE: ::c_int = 1;
676pub const NFT_MSG_DELTABLE: ::c_int = 2;
677pub const NFT_MSG_NEWCHAIN: ::c_int = 3;
678pub const NFT_MSG_GETCHAIN: ::c_int = 4;
679pub const NFT_MSG_DELCHAIN: ::c_int = 5;
680pub const NFT_MSG_NEWRULE: ::c_int = 6;
681pub const NFT_MSG_GETRULE: ::c_int = 7;
682pub const NFT_MSG_DELRULE: ::c_int = 8;
683pub const NFT_MSG_NEWSET: ::c_int = 9;
684pub const NFT_MSG_GETSET: ::c_int = 10;
685pub const NFT_MSG_DELSET: ::c_int = 11;
686pub const NFT_MSG_NEWSETELEM: ::c_int = 12;
687pub const NFT_MSG_GETSETELEM: ::c_int = 13;
688pub const NFT_MSG_DELSETELEM: ::c_int = 14;
689pub const NFT_MSG_NEWGEN: ::c_int = 15;
690pub const NFT_MSG_GETGEN: ::c_int = 16;
691pub const NFT_MSG_TRACE: ::c_int = 17;
692cfg_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}
700pub const NFT_MSG_MAX: ::c_int = 25;
701
702pub const NFT_SET_ANONYMOUS: ::c_int = 0x1;
703pub const NFT_SET_CONSTANT: ::c_int = 0x2;
704pub const NFT_SET_INTERVAL: ::c_int = 0x4;
705pub const NFT_SET_MAP: ::c_int = 0x8;
706pub const NFT_SET_TIMEOUT: ::c_int = 0x10;
707pub const NFT_SET_EVAL: ::c_int = 0x20;
708
709pub const NFT_SET_POL_PERFORMANCE: ::c_int = 0;
710pub const NFT_SET_POL_MEMORY: ::c_int = 1;
711
712pub const NFT_SET_ELEM_INTERVAL_END: ::c_int = 0x1;
713
714pub const NFT_DATA_VALUE: ::c_uint = 0;
715pub const NFT_DATA_VERDICT: ::c_uint = 0xffffff00;
716
717pub const NFT_DATA_RESERVED_MASK: ::c_uint = 0xffffff00;
718
719pub const NFT_DATA_VALUE_MAXLEN: ::c_int = 64;
720
721pub const NFT_BYTEORDER_NTOH: ::c_int = 0;
722pub const NFT_BYTEORDER_HTON: ::c_int = 1;
723
724pub const NFT_CMP_EQ: ::c_int = 0;
725pub const NFT_CMP_NEQ: ::c_int = 1;
726pub const NFT_CMP_LT: ::c_int = 2;
727pub const NFT_CMP_LTE: ::c_int = 3;
728pub const NFT_CMP_GT: ::c_int = 4;
729pub const NFT_CMP_GTE: ::c_int = 5;
730
731pub const NFT_RANGE_EQ: ::c_int = 0;
732pub const NFT_RANGE_NEQ: ::c_int = 1;
733
734pub const NFT_LOOKUP_F_INV: ::c_int = (1 << 0);
735
736pub const NFT_DYNSET_OP_ADD: ::c_int = 0;
737pub const NFT_DYNSET_OP_UPDATE: ::c_int = 1;
738
739pub const NFT_DYNSET_F_INV: ::c_int = (1 << 0);
740
741pub const NFT_PAYLOAD_LL_HEADER: ::c_int = 0;
742pub const NFT_PAYLOAD_NETWORK_HEADER: ::c_int = 1;
743pub const NFT_PAYLOAD_TRANSPORT_HEADER: ::c_int = 2;
744
745pub const NFT_PAYLOAD_CSUM_NONE: ::c_int = 0;
746pub const NFT_PAYLOAD_CSUM_INET: ::c_int = 1;
747
748pub const NFT_META_LEN: ::c_int = 0;
749pub const NFT_META_PROTOCOL: ::c_int = 1;
750pub const NFT_META_PRIORITY: ::c_int = 2;
751pub const NFT_META_MARK: ::c_int = 3;
752pub const NFT_META_IIF: ::c_int = 4;
753pub const NFT_META_OIF: ::c_int = 5;
754pub const NFT_META_IIFNAME: ::c_int = 6;
755pub const NFT_META_OIFNAME: ::c_int = 7;
756pub const NFT_META_IIFTYPE: ::c_int = 8;
757pub const NFT_META_OIFTYPE: ::c_int = 9;
758pub const NFT_META_SKUID: ::c_int = 10;
759pub const NFT_META_SKGID: ::c_int = 11;
760pub const NFT_META_NFTRACE: ::c_int = 12;
761pub const NFT_META_RTCLASSID: ::c_int = 13;
762pub const NFT_META_SECMARK: ::c_int = 14;
763pub const NFT_META_NFPROTO: ::c_int = 15;
764pub const NFT_META_L4PROTO: ::c_int = 16;
765pub const NFT_META_BRI_IIFNAME: ::c_int = 17;
766pub const NFT_META_BRI_OIFNAME: ::c_int = 18;
767pub const NFT_META_PKTTYPE: ::c_int = 19;
768pub const NFT_META_CPU: ::c_int = 20;
769pub const NFT_META_IIFGROUP: ::c_int = 21;
770pub const NFT_META_OIFGROUP: ::c_int = 22;
771pub const NFT_META_CGROUP: ::c_int = 23;
772pub const NFT_META_PRANDOM: ::c_int = 24;
773
774pub const NFT_CT_STATE: ::c_int = 0;
775pub const NFT_CT_DIRECTION: ::c_int = 1;
776pub const NFT_CT_STATUS: ::c_int = 2;
777pub const NFT_CT_MARK: ::c_int = 3;
778pub const NFT_CT_SECMARK: ::c_int = 4;
779pub const NFT_CT_EXPIRATION: ::c_int = 5;
780pub const NFT_CT_HELPER: ::c_int = 6;
781pub const NFT_CT_L3PROTOCOL: ::c_int = 7;
782pub const NFT_CT_SRC: ::c_int = 8;
783pub const NFT_CT_DST: ::c_int = 9;
784pub const NFT_CT_PROTOCOL: ::c_int = 10;
785pub const NFT_CT_PROTO_SRC: ::c_int = 11;
786pub const NFT_CT_PROTO_DST: ::c_int = 12;
787pub const NFT_CT_LABELS: ::c_int = 13;
788pub const NFT_CT_PKTS: ::c_int = 14;
789pub const NFT_CT_BYTES: ::c_int = 15;
790
791pub const NFT_LIMIT_PKTS: ::c_int = 0;
792pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1;
793
794pub const NFT_LIMIT_F_INV: ::c_int = (1 << 0);
795
796pub const NFT_QUEUE_FLAG_BYPASS: ::c_int = 0x01;
797pub const NFT_QUEUE_FLAG_CPU_FANOUT: ::c_int = 0x02;
798pub const NFT_QUEUE_FLAG_MASK: ::c_int = 0x03;
799
800pub const NFT_QUOTA_F_INV: ::c_int = (1 << 0);
801
802pub const NFT_REJECT_ICMP_UNREACH: ::c_int = 0;
803pub const NFT_REJECT_TCP_RST: ::c_int = 1;
804pub const NFT_REJECT_ICMPX_UNREACH: ::c_int = 2;
805
806pub const NFT_REJECT_ICMPX_NO_ROUTE: ::c_int = 0;
807pub const NFT_REJECT_ICMPX_PORT_UNREACH: ::c_int = 1;
808pub const NFT_REJECT_ICMPX_HOST_UNREACH: ::c_int = 2;
809pub const NFT_REJECT_ICMPX_ADMIN_PROHIBITED: ::c_int = 3;
810
811pub const NFT_NAT_SNAT: ::c_int = 0;
812pub const NFT_NAT_DNAT: ::c_int = 1;
813
814pub const NFT_TRACETYPE_UNSPEC: ::c_int = 0;
815pub const NFT_TRACETYPE_POLICY: ::c_int = 1;
816pub const NFT_TRACETYPE_RETURN: ::c_int = 2;
817pub const NFT_TRACETYPE_RULE: ::c_int = 3;
818
819pub const NFT_NG_INCREMENTAL: ::c_int = 0;
820pub const NFT_NG_RANDOM: ::c_int = 1;
821
822pub const M_MXFAST: ::c_int = 1;
823pub const M_NLBLKS: ::c_int = 2;
824pub const M_GRAIN: ::c_int = 3;
825pub const M_KEEP: ::c_int = 4;
826pub const M_TRIM_THRESHOLD: ::c_int = -1;
827pub const M_TOP_PAD: ::c_int = -2;
828pub const M_MMAP_THRESHOLD: ::c_int = -3;
829pub const M_MMAP_MAX: ::c_int = -4;
830pub const M_CHECK_ACTION: ::c_int = -5;
831pub const M_PERTURB: ::c_int = -6;
832pub const M_ARENA_TEST: ::c_int = -7;
833pub const M_ARENA_MAX: ::c_int = -8;
834
835pub const AT_STATX_SYNC_TYPE: ::c_int = 0x6000;
836pub const AT_STATX_SYNC_AS_STAT: ::c_int = 0x0000;
837pub const AT_STATX_FORCE_SYNC: ::c_int = 0x2000;
838pub const AT_STATX_DONT_SYNC: ::c_int = 0x4000;
839pub const STATX_TYPE: ::c_uint = 0x0001;
840pub const STATX_MODE: ::c_uint = 0x0002;
841pub const STATX_NLINK: ::c_uint = 0x0004;
842pub const STATX_UID: ::c_uint = 0x0008;
843pub const STATX_GID: ::c_uint = 0x0010;
844pub const STATX_ATIME: ::c_uint = 0x0020;
845pub const STATX_MTIME: ::c_uint = 0x0040;
846pub const STATX_CTIME: ::c_uint = 0x0080;
847pub const STATX_INO: ::c_uint = 0x0100;
848pub const STATX_SIZE: ::c_uint = 0x0200;
849pub const STATX_BLOCKS: ::c_uint = 0x0400;
850pub const STATX_BASIC_STATS: ::c_uint = 0x07ff;
851pub const STATX_BTIME: ::c_uint = 0x0800;
852pub const STATX_ALL: ::c_uint = 0x0fff;
853pub const STATX__RESERVED: ::c_int = 0x80000000;
854pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004;
855pub const STATX_ATTR_IMMUTABLE: ::c_int = 0x0010;
856pub const STATX_ATTR_APPEND: ::c_int = 0x0020;
857pub const STATX_ATTR_NODUMP: ::c_int = 0x0040;
858pub const STATX_ATTR_ENCRYPTED: ::c_int = 0x0800;
859pub const STATX_ATTR_AUTOMOUNT: ::c_int = 0x1000;
860
861cfg_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}
878pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 3;
879
880extern "C" {
881    pub fn sendmmsg(
882        sockfd: ::c_int,
883        msgvec: *mut ::mmsghdr,
884        vlen: ::c_uint,
885        flags: ::c_int,
886    ) -> ::c_int;
887    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
895    pub fn getrlimit64(
896        resource: ::__rlimit_resource_t,
897        rlim: *mut ::rlimit64,
898    ) -> ::c_int;
899    pub fn setrlimit64(
900        resource: ::__rlimit_resource_t,
901        rlim: *const ::rlimit64,
902    ) -> ::c_int;
903    pub fn getrlimit(
904        resource: ::__rlimit_resource_t,
905        rlim: *mut ::rlimit,
906    ) -> ::c_int;
907    pub fn setrlimit(
908        resource: ::__rlimit_resource_t,
909        rlim: *const ::rlimit,
910    ) -> ::c_int;
911    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;
917    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;
923    pub fn utmpname(file: *const ::c_char) -> ::c_int;
924    pub fn utmpxname(file: *const ::c_char) -> ::c_int;
925    pub fn getutxent() -> *mut utmpx;
926    pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
927    pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
928    pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
929    pub fn setutxent();
930    pub fn endutxent();
931    pub fn getpt() -> ::c_int;
932    pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int;
933    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
934    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;
941    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")]
949extern "C" {
950    pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
951    pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int;
952    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;
960    pub fn globfree64(pglob: *mut glob64_t);
961    pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
962    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;
967    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;
972    pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int;
973    pub fn setpriority(
974        which: ::__priority_which_t,
975        who: ::id_t,
976        prio: ::c_int,
977    ) -> ::c_int;
978    pub fn pthread_getaffinity_np(
979        thread: ::pthread_t,
980        cpusetsize: ::size_t,
981        cpuset: *mut ::cpu_set_t,
982    ) -> ::c_int;
983    pub fn pthread_setaffinity_np(
984        thread: ::pthread_t,
985        cpusetsize: ::size_t,
986        cpuset: *const ::cpu_set_t,
987    ) -> ::c_int;
988    pub fn pthread_rwlockattr_getkind_np(
989        attr: *const ::pthread_rwlockattr_t,
990        val: *mut ::c_int,
991    ) -> ::c_int;
992    pub fn pthread_rwlockattr_setkind_np(
993        attr: *mut ::pthread_rwlockattr_t,
994        val: ::c_int,
995    ) -> ::c_int;
996    pub fn sched_getcpu() -> ::c_int;
997    pub fn mallinfo() -> ::mallinfo;
998    pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
999    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")]
1002    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")]
1010    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;
1016    pub fn pthread_getname_np(
1017        thread: ::pthread_t,
1018        name: *mut ::c_char,
1019        len: ::size_t,
1020    ) -> ::c_int;
1021    pub fn pthread_setname_np(
1022        thread: ::pthread_t,
1023        name: *const ::c_char,
1024    ) -> ::c_int;
1025}
1026
1027cfg_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
1049cfg_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}