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