1use crate::prelude::*;
4use crate::{
5 sock_filter,
6 _IO,
7 _IOR,
8 _IOW,
9 _IOWR,
10};
11
12pub type useconds_t = u32;
13pub type dev_t = u64;
14pub type socklen_t = u32;
15pub type mode_t = u32;
16pub type ino64_t = u64;
17pub type off64_t = i64;
18pub type blkcnt64_t = i64;
19pub type rlim64_t = u64;
20pub type mqd_t = c_int;
21pub type nfds_t = c_ulong;
22pub type nl_item = c_int;
23pub type idtype_t = c_uint;
24pub type loff_t = c_longlong;
25pub type pthread_key_t = c_uint;
26pub type pthread_once_t = c_int;
27pub type pthread_spinlock_t = c_int;
28pub type __kernel_fsid_t = __c_anonymous__kernel_fsid_t;
29pub type __kernel_clockid_t = c_int;
30
31pub type __u8 = c_uchar;
32pub type __u16 = c_ushort;
33pub type __s16 = c_short;
34pub type __u32 = c_uint;
35pub type __s32 = c_int;
36
37pub type Elf32_Half = u16;
38pub type Elf32_Word = u32;
39pub type Elf32_Off = u32;
40pub type Elf32_Addr = u32;
41pub type Elf32_Xword = u64;
42pub type Elf32_Sword = i32;
43
44pub type Elf64_Half = u16;
45pub type Elf64_Word = u32;
46pub type Elf64_Off = u64;
47pub type Elf64_Addr = u64;
48pub type Elf64_Xword = u64;
49pub type Elf64_Sxword = i64;
50pub type Elf64_Sword = i32;
51
52pub type Elf32_Section = u16;
53pub type Elf64_Section = u16;
54
55pub type Elf32_Relr = Elf32_Word;
56pub type Elf64_Relr = Elf32_Xword;
57pub type Elf32_Rel = __c_anonymous_elf32_rel;
58pub type Elf64_Rel = __c_anonymous_elf64_rel;
59
60cfg_if! {
61 if #[cfg(not(target_arch = "sparc64"))] {
62 pub type Elf32_Rela = __c_anonymous_elf32_rela;
63 pub type Elf64_Rela = __c_anonymous_elf64_rela;
64 }
65}
66
67pub type iconv_t = *mut c_void;
68
69pub type sctp_assoc_t = __s32;
71
72pub type eventfd_t = u64;
73
74cfg_if! {
75 if #[cfg(not(target_env = "gnu"))] {
76 extern_ty! {
77 pub enum fpos64_t {} }
79 }
80}
81
82e! {
83 #[repr(u32)]
84 pub enum tpacket_versions {
85 TPACKET_V1,
86 TPACKET_V2,
87 TPACKET_V3,
88 }
89}
90
91c_enum! {
92 pub enum pid_type {
93 pub PIDTYPE_PID,
94 pub PIDTYPE_TGID,
95 pub PIDTYPE_PGID,
96 pub PIDTYPE_SID,
97 pub PIDTYPE_MAX,
98 }
99}
100
101s! {
102 pub struct glob_t {
103 pub gl_pathc: size_t,
104 pub gl_pathv: *mut *mut c_char,
105 pub gl_offs: size_t,
106 pub gl_flags: c_int,
107
108 __unused1: Padding<*mut c_void>,
109 __unused2: Padding<*mut c_void>,
110 __unused3: Padding<*mut c_void>,
111 __unused4: Padding<*mut c_void>,
112 __unused5: Padding<*mut c_void>,
113 }
114
115 pub struct passwd {
116 pub pw_name: *mut c_char,
117 pub pw_passwd: *mut c_char,
118 pub pw_uid: crate::uid_t,
119 pub pw_gid: crate::gid_t,
120 pub pw_gecos: *mut c_char,
121 pub pw_dir: *mut c_char,
122 pub pw_shell: *mut c_char,
123 }
124
125 pub struct spwd {
126 pub sp_namp: *mut c_char,
127 pub sp_pwdp: *mut c_char,
128 pub sp_lstchg: c_long,
129 pub sp_min: c_long,
130 pub sp_max: c_long,
131 pub sp_warn: c_long,
132 pub sp_inact: c_long,
133 pub sp_expire: c_long,
134 pub sp_flag: c_ulong,
135 }
136
137 pub struct dqblk {
138 pub dqb_bhardlimit: u64,
139 pub dqb_bsoftlimit: u64,
140 pub dqb_curspace: u64,
141 pub dqb_ihardlimit: u64,
142 pub dqb_isoftlimit: u64,
143 pub dqb_curinodes: u64,
144 pub dqb_btime: u64,
145 pub dqb_itime: u64,
146 pub dqb_valid: u32,
147 }
148
149 pub struct signalfd_siginfo {
150 pub ssi_signo: u32,
151 pub ssi_errno: i32,
152 pub ssi_code: i32,
153 pub ssi_pid: u32,
154 pub ssi_uid: u32,
155 pub ssi_fd: i32,
156 pub ssi_tid: u32,
157 pub ssi_band: u32,
158 pub ssi_overrun: u32,
159 pub ssi_trapno: u32,
160 pub ssi_status: i32,
161 pub ssi_int: i32,
162 pub ssi_ptr: u64,
163 pub ssi_utime: u64,
164 pub ssi_stime: u64,
165 pub ssi_addr: u64,
166 pub ssi_addr_lsb: u16,
167 _pad2: Padding<u16>,
168 pub ssi_syscall: i32,
169 pub ssi_call_addr: u64,
170 pub ssi_arch: u32,
171 _pad: Padding<[u8; 28]>,
172 }
173
174 pub struct itimerspec {
175 pub it_interval: crate::timespec,
176 pub it_value: crate::timespec,
177 }
178
179 pub struct fsid_t {
180 __val: [c_int; 2],
181 }
182
183 pub struct fanout_args {
184 #[cfg(target_endian = "little")]
185 pub id: __u16,
186 pub type_flags: __u16,
187 #[cfg(target_endian = "big")]
188 pub id: __u16,
189 pub max_num_members: __u32,
190 }
191
192 pub struct packet_mreq {
193 pub mr_ifindex: c_int,
194 pub mr_type: c_ushort,
195 pub mr_alen: c_ushort,
196 pub mr_address: [c_uchar; 8],
197 }
198
199 #[deprecated(since = "0.2.70", note = "sockaddr_ll type must be used instead")]
200 pub struct sockaddr_pkt {
201 pub spkt_family: c_ushort,
202 pub spkt_device: [c_uchar; 14],
203 pub spkt_protocol: c_ushort,
204 }
205
206 pub struct tpacket_auxdata {
207 pub tp_status: __u32,
208 pub tp_len: __u32,
209 pub tp_snaplen: __u32,
210 pub tp_mac: __u16,
211 pub tp_net: __u16,
212 pub tp_vlan_tci: __u16,
213 pub tp_vlan_tpid: __u16,
214 }
215
216 pub struct tpacket_hdr {
217 pub tp_status: c_ulong,
218 pub tp_len: c_uint,
219 pub tp_snaplen: c_uint,
220 pub tp_mac: c_ushort,
221 pub tp_net: c_ushort,
222 pub tp_sec: c_uint,
223 pub tp_usec: c_uint,
224 }
225
226 pub struct tpacket_hdr_variant1 {
227 pub tp_rxhash: __u32,
228 pub tp_vlan_tci: __u32,
229 pub tp_vlan_tpid: __u16,
230 pub tp_padding: __u16,
231 }
232
233 pub struct tpacket2_hdr {
234 pub tp_status: __u32,
235 pub tp_len: __u32,
236 pub tp_snaplen: __u32,
237 pub tp_mac: __u16,
238 pub tp_net: __u16,
239 pub tp_sec: __u32,
240 pub tp_nsec: __u32,
241 pub tp_vlan_tci: __u16,
242 pub tp_vlan_tpid: __u16,
243 pub tp_padding: [__u8; 4],
244 }
245
246 pub struct tpacket_req {
247 pub tp_block_size: c_uint,
248 pub tp_block_nr: c_uint,
249 pub tp_frame_size: c_uint,
250 pub tp_frame_nr: c_uint,
251 }
252
253 pub struct tpacket_req3 {
254 pub tp_block_size: c_uint,
255 pub tp_block_nr: c_uint,
256 pub tp_frame_size: c_uint,
257 pub tp_frame_nr: c_uint,
258 pub tp_retire_blk_tov: c_uint,
259 pub tp_sizeof_priv: c_uint,
260 pub tp_feature_req_word: c_uint,
261 }
262
263 #[repr(align(8))]
264 pub struct tpacket_rollover_stats {
265 pub tp_all: crate::__u64,
266 pub tp_huge: crate::__u64,
267 pub tp_failed: crate::__u64,
268 }
269
270 pub struct tpacket_stats {
271 pub tp_packets: c_uint,
272 pub tp_drops: c_uint,
273 }
274
275 pub struct tpacket_stats_v3 {
276 pub tp_packets: c_uint,
277 pub tp_drops: c_uint,
278 pub tp_freeze_q_cnt: c_uint,
279 }
280
281 pub struct tpacket3_hdr {
282 pub tp_next_offset: __u32,
283 pub tp_sec: __u32,
284 pub tp_nsec: __u32,
285 pub tp_snaplen: __u32,
286 pub tp_len: __u32,
287 pub tp_status: __u32,
288 pub tp_mac: __u16,
289 pub tp_net: __u16,
290 pub hv1: crate::tpacket_hdr_variant1,
291 pub tp_padding: [__u8; 8],
292 }
293
294 pub struct tpacket_bd_ts {
295 pub ts_sec: c_uint,
296 pub ts_usec: c_uint,
297 }
298
299 #[repr(align(8))]
300 pub struct tpacket_hdr_v1 {
301 pub block_status: __u32,
302 pub num_pkts: __u32,
303 pub offset_to_first_pkt: __u32,
304 pub blk_len: __u32,
305 pub seq_num: crate::__u64,
306 pub ts_first_pkt: crate::tpacket_bd_ts,
307 pub ts_last_pkt: crate::tpacket_bd_ts,
308 }
309
310 pub struct cpu_set_t {
311 #[cfg(all(target_pointer_width = "32", not(target_arch = "x86_64")))]
312 bits: [u32; 32],
313 #[cfg(not(all(target_pointer_width = "32", not(target_arch = "x86_64"))))]
314 bits: [u64; 16],
315 }
316
317 pub struct if_nameindex {
318 pub if_index: c_uint,
319 pub if_name: *mut c_char,
320 }
321
322 pub struct msginfo {
324 pub msgpool: c_int,
325 pub msgmap: c_int,
326 pub msgmax: c_int,
327 pub msgmnb: c_int,
328 pub msgmni: c_int,
329 pub msgssz: c_int,
330 pub msgtql: c_int,
331 pub msgseg: c_ushort,
332 }
333
334 pub struct sembuf {
335 pub sem_num: c_ushort,
336 pub sem_op: c_short,
337 pub sem_flg: c_short,
338 }
339
340 pub struct input_event {
341 #[cfg(any(target_pointer_width = "64", not(linux_time_bits64)))]
343 pub time: crate::timeval,
344 #[cfg(all(target_pointer_width = "32", linux_time_bits64))]
351 pub input_event_sec: c_ulong,
352
353 #[cfg(all(target_pointer_width = "32", linux_time_bits64))]
354 pub input_event_usec: c_ulong,
355
356 pub type_: __u16,
357 pub code: __u16,
358 pub value: __s32,
359 }
360
361 pub struct input_id {
362 pub bustype: __u16,
363 pub vendor: __u16,
364 pub product: __u16,
365 pub version: __u16,
366 }
367
368 pub struct input_absinfo {
369 pub value: __s32,
370 pub minimum: __s32,
371 pub maximum: __s32,
372 pub fuzz: __s32,
373 pub flat: __s32,
374 pub resolution: __s32,
375 }
376
377 pub struct input_keymap_entry {
378 pub flags: __u8,
379 pub len: __u8,
380 pub index: __u16,
381 pub keycode: __u32,
382 pub scancode: [__u8; 32],
383 }
384
385 pub struct input_mask {
386 pub type_: __u32,
387 pub codes_size: __u32,
388 pub codes_ptr: crate::__u64,
389 }
390
391 pub struct ff_replay {
392 pub length: __u16,
393 pub delay: __u16,
394 }
395
396 pub struct ff_trigger {
397 pub button: __u16,
398 pub interval: __u16,
399 }
400
401 pub struct ff_envelope {
402 pub attack_length: __u16,
403 pub attack_level: __u16,
404 pub fade_length: __u16,
405 pub fade_level: __u16,
406 }
407
408 pub struct ff_constant_effect {
409 pub level: __s16,
410 pub envelope: ff_envelope,
411 }
412
413 pub struct ff_ramp_effect {
414 pub start_level: __s16,
415 pub end_level: __s16,
416 pub envelope: ff_envelope,
417 }
418
419 pub struct ff_condition_effect {
420 pub right_saturation: __u16,
421 pub left_saturation: __u16,
422
423 pub right_coeff: __s16,
424 pub left_coeff: __s16,
425
426 pub deadband: __u16,
427 pub center: __s16,
428 }
429
430 pub struct ff_periodic_effect {
431 pub waveform: __u16,
432 pub period: __u16,
433 pub magnitude: __s16,
434 pub offset: __s16,
435 pub phase: __u16,
436
437 pub envelope: ff_envelope,
438
439 pub custom_len: __u32,
440 pub custom_data: *mut __s16,
441 }
442
443 pub struct ff_rumble_effect {
444 pub strong_magnitude: __u16,
445 pub weak_magnitude: __u16,
446 }
447
448 pub struct ff_effect {
449 pub type_: __u16,
450 pub id: __s16,
451 pub direction: __u16,
452 pub trigger: ff_trigger,
453 pub replay: ff_replay,
454 #[cfg(target_pointer_width = "64")]
456 pub u: [u64; 4],
457 #[cfg(target_pointer_width = "32")]
458 pub u: [u32; 7],
459 }
460
461 pub struct uinput_ff_upload {
462 pub request_id: __u32,
463 pub retval: __s32,
464 pub effect: ff_effect,
465 pub old: ff_effect,
466 }
467
468 pub struct uinput_ff_erase {
469 pub request_id: __u32,
470 pub retval: __s32,
471 pub effect_id: __u32,
472 }
473
474 pub struct uinput_abs_setup {
475 pub code: __u16,
476 pub absinfo: input_absinfo,
477 }
478
479 pub struct dl_phdr_info {
480 #[cfg(target_pointer_width = "64")]
481 pub dlpi_addr: Elf64_Addr,
482 #[cfg(target_pointer_width = "32")]
483 pub dlpi_addr: Elf32_Addr,
484
485 pub dlpi_name: *const c_char,
486
487 #[cfg(target_pointer_width = "64")]
488 pub dlpi_phdr: *const Elf64_Phdr,
489 #[cfg(target_pointer_width = "32")]
490 pub dlpi_phdr: *const Elf32_Phdr,
491
492 #[cfg(target_pointer_width = "64")]
493 pub dlpi_phnum: Elf64_Half,
494 #[cfg(target_pointer_width = "32")]
495 pub dlpi_phnum: Elf32_Half,
496
497 #[cfg(not(any(target_env = "uclibc", target_os = "nto")))]
504 pub dlpi_adds: c_ulonglong,
505 #[cfg(not(any(target_env = "uclibc", target_os = "nto")))]
506 pub dlpi_subs: c_ulonglong,
507 #[cfg(not(any(target_env = "uclibc", target_os = "nto")))]
508 pub dlpi_tls_modid: size_t,
509 #[cfg(not(any(target_env = "uclibc", target_os = "nto")))]
510 pub dlpi_tls_data: *mut c_void,
511 }
512
513 pub struct Elf32_Ehdr {
514 pub e_ident: [c_uchar; 16],
515 pub e_type: Elf32_Half,
516 pub e_machine: Elf32_Half,
517 pub e_version: Elf32_Word,
518 pub e_entry: Elf32_Addr,
519 pub e_phoff: Elf32_Off,
520 pub e_shoff: Elf32_Off,
521 pub e_flags: Elf32_Word,
522 pub e_ehsize: Elf32_Half,
523 pub e_phentsize: Elf32_Half,
524 pub e_phnum: Elf32_Half,
525 pub e_shentsize: Elf32_Half,
526 pub e_shnum: Elf32_Half,
527 pub e_shstrndx: Elf32_Half,
528 }
529
530 pub struct Elf64_Ehdr {
531 pub e_ident: [c_uchar; 16],
532 pub e_type: Elf64_Half,
533 pub e_machine: Elf64_Half,
534 pub e_version: Elf64_Word,
535 pub e_entry: Elf64_Addr,
536 pub e_phoff: Elf64_Off,
537 pub e_shoff: Elf64_Off,
538 pub e_flags: Elf64_Word,
539 pub e_ehsize: Elf64_Half,
540 pub e_phentsize: Elf64_Half,
541 pub e_phnum: Elf64_Half,
542 pub e_shentsize: Elf64_Half,
543 pub e_shnum: Elf64_Half,
544 pub e_shstrndx: Elf64_Half,
545 }
546
547 pub struct Elf32_Sym {
548 pub st_name: Elf32_Word,
549 pub st_value: Elf32_Addr,
550 pub st_size: Elf32_Word,
551 pub st_info: c_uchar,
552 pub st_other: c_uchar,
553 pub st_shndx: Elf32_Section,
554 }
555
556 pub struct Elf64_Sym {
557 pub st_name: Elf64_Word,
558 pub st_info: c_uchar,
559 pub st_other: c_uchar,
560 pub st_shndx: Elf64_Section,
561 pub st_value: Elf64_Addr,
562 pub st_size: Elf64_Xword,
563 }
564
565 pub struct Elf32_Phdr {
566 pub p_type: Elf32_Word,
567 pub p_offset: Elf32_Off,
568 pub p_vaddr: Elf32_Addr,
569 pub p_paddr: Elf32_Addr,
570 pub p_filesz: Elf32_Word,
571 pub p_memsz: Elf32_Word,
572 pub p_flags: Elf32_Word,
573 pub p_align: Elf32_Word,
574 }
575
576 pub struct Elf64_Phdr {
577 pub p_type: Elf64_Word,
578 pub p_flags: Elf64_Word,
579 pub p_offset: Elf64_Off,
580 pub p_vaddr: Elf64_Addr,
581 pub p_paddr: Elf64_Addr,
582 pub p_filesz: Elf64_Xword,
583 pub p_memsz: Elf64_Xword,
584 pub p_align: Elf64_Xword,
585 }
586
587 pub struct Elf32_Shdr {
588 pub sh_name: Elf32_Word,
589 pub sh_type: Elf32_Word,
590 pub sh_flags: Elf32_Word,
591 pub sh_addr: Elf32_Addr,
592 pub sh_offset: Elf32_Off,
593 pub sh_size: Elf32_Word,
594 pub sh_link: Elf32_Word,
595 pub sh_info: Elf32_Word,
596 pub sh_addralign: Elf32_Word,
597 pub sh_entsize: Elf32_Word,
598 }
599
600 pub struct Elf64_Shdr {
601 pub sh_name: Elf64_Word,
602 pub sh_type: Elf64_Word,
603 pub sh_flags: Elf64_Xword,
604 pub sh_addr: Elf64_Addr,
605 pub sh_offset: Elf64_Off,
606 pub sh_size: Elf64_Xword,
607 pub sh_link: Elf64_Word,
608 pub sh_info: Elf64_Word,
609 pub sh_addralign: Elf64_Xword,
610 pub sh_entsize: Elf64_Xword,
611 }
612
613 pub struct __c_anonymous_elf32_rel {
614 pub r_offset: Elf32_Addr,
615 pub r_info: Elf32_Word,
616 }
617
618 pub struct __c_anonymous_elf64_rel {
619 pub r_offset: Elf64_Addr,
620 pub r_info: Elf64_Xword,
621 }
622
623 pub struct __c_anonymous__kernel_fsid_t {
624 pub val: [c_int; 2],
625 }
626
627 pub struct ucred {
628 pub pid: crate::pid_t,
629 pub uid: crate::uid_t,
630 pub gid: crate::gid_t,
631 }
632
633 pub struct mntent {
634 pub mnt_fsname: *mut c_char,
635 pub mnt_dir: *mut c_char,
636 pub mnt_type: *mut c_char,
637 pub mnt_opts: *mut c_char,
638 pub mnt_freq: c_int,
639 pub mnt_passno: c_int,
640 }
641
642 pub struct posix_spawn_file_actions_t {
643 __allocated: c_int,
644 __used: c_int,
645 __actions: *mut c_int,
646 __pad: Padding<[c_int; 16]>,
647 }
648
649 pub struct posix_spawnattr_t {
650 __flags: c_short,
651 __pgrp: crate::pid_t,
652 __sd: crate::sigset_t,
653 __ss: crate::sigset_t,
654 #[cfg(any(target_env = "musl", target_env = "ohos"))]
655 __prio: c_int,
656 #[cfg(not(any(target_env = "musl", target_env = "ohos")))]
657 __sp: crate::sched_param,
658 __policy: c_int,
659 __pad: Padding<[c_int; 16]>,
660 }
661
662 pub struct genlmsghdr {
663 pub cmd: u8,
664 pub version: u8,
665 pub reserved: u16,
666 }
667
668 pub struct in6_pktinfo {
669 pub ipi6_addr: crate::in6_addr,
670 pub ipi6_ifindex: c_uint,
671 }
672
673 pub struct arpd_request {
674 pub req: c_ushort,
675 pub ip: u32,
676 pub dev: c_ulong,
677 pub stamp: c_ulong,
678 pub updated: c_ulong,
679 pub ha: [c_uchar; crate::MAX_ADDR_LEN],
680 }
681
682 pub struct inotify_event {
683 pub wd: c_int,
684 pub mask: u32,
685 pub cookie: u32,
686 pub len: u32,
687 }
688
689 pub struct fanotify_response {
690 pub fd: c_int,
691 pub response: __u32,
692 }
693
694 pub struct fanotify_event_info_header {
695 pub info_type: __u8,
696 pub pad: __u8,
697 pub len: __u16,
698 }
699
700 pub struct fanotify_event_info_fid {
701 pub hdr: fanotify_event_info_header,
702 pub fsid: crate::__kernel_fsid_t,
703 pub handle: [c_uchar; 0],
704 }
705
706 pub struct sockaddr_vm {
707 pub svm_family: crate::sa_family_t,
708 pub svm_reserved1: c_ushort,
709 pub svm_port: c_uint,
710 pub svm_cid: c_uint,
711 pub svm_zero: [u8; 4],
712 }
713
714 pub struct regmatch_t {
715 pub rm_so: regoff_t,
716 pub rm_eo: regoff_t,
717 }
718
719 pub struct sock_extended_err {
720 pub ee_errno: u32,
721 pub ee_origin: u8,
722 pub ee_type: u8,
723 pub ee_code: u8,
724 pub ee_pad: u8,
725 pub ee_info: u32,
726 pub ee_data: u32,
727 }
728
729 pub struct seccomp_data {
731 pub nr: c_int,
732 pub arch: __u32,
733 pub instruction_pointer: crate::__u64,
734 pub args: [crate::__u64; 6],
735 }
736
737 pub struct seccomp_notif_sizes {
738 pub seccomp_notif: __u16,
739 pub seccomp_notif_resp: __u16,
740 pub seccomp_data: __u16,
741 }
742
743 pub struct seccomp_notif {
744 pub id: crate::__u64,
745 pub pid: __u32,
746 pub flags: __u32,
747 pub data: seccomp_data,
748 }
749
750 pub struct seccomp_notif_resp {
751 pub id: crate::__u64,
752 pub val: crate::__s64,
753 pub error: __s32,
754 pub flags: __u32,
755 }
756
757 pub struct seccomp_notif_addfd {
758 pub id: crate::__u64,
759 pub flags: __u32,
760 pub srcfd: __u32,
761 pub newfd: __u32,
762 pub newfd_flags: __u32,
763 }
764
765 pub struct nlmsghdr {
766 pub nlmsg_len: u32,
767 pub nlmsg_type: u16,
768 pub nlmsg_flags: u16,
769 pub nlmsg_seq: u32,
770 pub nlmsg_pid: u32,
771 }
772
773 pub struct nlmsgerr {
774 pub error: c_int,
775 pub msg: nlmsghdr,
776 }
777
778 pub struct nlattr {
779 pub nla_len: u16,
780 pub nla_type: u16,
781 }
782
783 pub struct __c_anonymous_ifru_map {
784 pub mem_start: c_ulong,
785 pub mem_end: c_ulong,
786 pub base_addr: c_ushort,
787 pub irq: c_uchar,
788 pub dma: c_uchar,
789 pub port: c_uchar,
790 }
791
792 pub struct in6_ifreq {
793 pub ifr6_addr: crate::in6_addr,
794 pub ifr6_prefixlen: u32,
795 pub ifr6_ifindex: c_int,
796 }
797
798 pub struct option {
799 pub name: *const c_char,
800 pub has_arg: c_int,
801 pub flag: *mut c_int,
802 pub val: c_int,
803 }
804
805 #[non_exhaustive]
807 pub struct open_how {
808 pub flags: crate::__u64,
809 pub mode: crate::__u64,
810 pub resolve: crate::__u64,
811 }
812
813 pub struct ptp_clock_time {
815 pub sec: crate::__s64,
816 pub nsec: __u32,
817 pub reserved: __u32,
818 }
819
820 pub struct ptp_extts_request {
821 pub index: c_uint,
822 pub flags: c_uint,
823 pub rsv: [c_uint; 2],
824 }
825
826 pub struct ptp_sys_offset_extended {
827 pub n_samples: c_uint,
828 pub clockid: __kernel_clockid_t,
829 pub rsv: [c_uint; 2],
830 pub ts: [[ptp_clock_time; 3]; PTP_MAX_SAMPLES as usize],
831 }
832
833 pub struct ptp_sys_offset_precise {
834 pub device: ptp_clock_time,
835 pub sys_realtime: ptp_clock_time,
836 pub sys_monoraw: ptp_clock_time,
837 pub rsv: [c_uint; 4],
838 }
839
840 pub struct ptp_extts_event {
841 pub t: ptp_clock_time,
842 index: c_uint,
843 flags: c_uint,
844 rsv: [c_uint; 2],
845 }
846
847 pub struct sctp_initmsg {
850 pub sinit_num_ostreams: __u16,
851 pub sinit_max_instreams: __u16,
852 pub sinit_max_attempts: __u16,
853 pub sinit_max_init_timeo: __u16,
854 }
855
856 pub struct sctp_sndrcvinfo {
857 pub sinfo_stream: __u16,
858 pub sinfo_ssn: __u16,
859 pub sinfo_flags: __u16,
860 pub sinfo_ppid: __u32,
861 pub sinfo_context: __u32,
862 pub sinfo_timetolive: __u32,
863 pub sinfo_tsn: __u32,
864 pub sinfo_cumtsn: __u32,
865 pub sinfo_assoc_id: crate::sctp_assoc_t,
866 }
867
868 pub struct sctp_sndinfo {
869 pub snd_sid: __u16,
870 pub snd_flags: __u16,
871 pub snd_ppid: __u32,
872 pub snd_context: __u32,
873 pub snd_assoc_id: crate::sctp_assoc_t,
874 }
875
876 pub struct sctp_rcvinfo {
877 pub rcv_sid: __u16,
878 pub rcv_ssn: __u16,
879 pub rcv_flags: __u16,
880 pub rcv_ppid: __u32,
881 pub rcv_tsn: __u32,
882 pub rcv_cumtsn: __u32,
883 pub rcv_context: __u32,
884 pub rcv_assoc_id: crate::sctp_assoc_t,
885 }
886
887 pub struct sctp_nxtinfo {
888 pub nxt_sid: __u16,
889 pub nxt_flags: __u16,
890 pub nxt_ppid: __u32,
891 pub nxt_length: __u32,
892 pub nxt_assoc_id: crate::sctp_assoc_t,
893 }
894
895 pub struct sctp_prinfo {
896 pub pr_policy: __u16,
897 pub pr_value: __u32,
898 }
899
900 pub struct sctp_authinfo {
901 pub auth_keynumber: __u16,
902 }
903
904 pub struct rlimit64 {
905 pub rlim_cur: rlim64_t,
906 pub rlim_max: rlim64_t,
907 }
908
909 pub struct tls_crypto_info {
912 pub version: __u16,
913 pub cipher_type: __u16,
914 }
915
916 pub struct tls12_crypto_info_aes_gcm_128 {
917 pub info: tls_crypto_info,
918 pub iv: [c_uchar; TLS_CIPHER_AES_GCM_128_IV_SIZE],
919 pub key: [c_uchar; TLS_CIPHER_AES_GCM_128_KEY_SIZE],
920 pub salt: [c_uchar; TLS_CIPHER_AES_GCM_128_SALT_SIZE],
921 pub rec_seq: [c_uchar; TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE],
922 }
923
924 pub struct tls12_crypto_info_aes_gcm_256 {
925 pub info: tls_crypto_info,
926 pub iv: [c_uchar; TLS_CIPHER_AES_GCM_256_IV_SIZE],
927 pub key: [c_uchar; TLS_CIPHER_AES_GCM_256_KEY_SIZE],
928 pub salt: [c_uchar; TLS_CIPHER_AES_GCM_256_SALT_SIZE],
929 pub rec_seq: [c_uchar; TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE],
930 }
931
932 pub struct tls12_crypto_info_aes_ccm_128 {
933 pub info: tls_crypto_info,
934 pub iv: [c_uchar; TLS_CIPHER_AES_CCM_128_IV_SIZE],
935 pub key: [c_uchar; TLS_CIPHER_AES_CCM_128_KEY_SIZE],
936 pub salt: [c_uchar; TLS_CIPHER_AES_CCM_128_SALT_SIZE],
937 pub rec_seq: [c_uchar; TLS_CIPHER_AES_CCM_128_REC_SEQ_SIZE],
938 }
939
940 pub struct tls12_crypto_info_chacha20_poly1305 {
941 pub info: tls_crypto_info,
942 pub iv: [c_uchar; TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE],
943 pub key: [c_uchar; TLS_CIPHER_CHACHA20_POLY1305_KEY_SIZE],
944 pub salt: [c_uchar; TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE],
945 pub rec_seq: [c_uchar; TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE],
946 }
947
948 pub struct tls12_crypto_info_sm4_gcm {
949 pub info: tls_crypto_info,
950 pub iv: [c_uchar; TLS_CIPHER_SM4_GCM_IV_SIZE],
951 pub key: [c_uchar; TLS_CIPHER_SM4_GCM_KEY_SIZE],
952 pub salt: [c_uchar; TLS_CIPHER_SM4_GCM_SALT_SIZE],
953 pub rec_seq: [c_uchar; TLS_CIPHER_SM4_GCM_REC_SEQ_SIZE],
954 }
955
956 pub struct tls12_crypto_info_sm4_ccm {
957 pub info: tls_crypto_info,
958 pub iv: [c_uchar; TLS_CIPHER_SM4_CCM_IV_SIZE],
959 pub key: [c_uchar; TLS_CIPHER_SM4_CCM_KEY_SIZE],
960 pub salt: [c_uchar; TLS_CIPHER_SM4_CCM_SALT_SIZE],
961 pub rec_seq: [c_uchar; TLS_CIPHER_SM4_CCM_REC_SEQ_SIZE],
962 }
963
964 pub struct tls12_crypto_info_aria_gcm_128 {
965 pub info: tls_crypto_info,
966 pub iv: [c_uchar; TLS_CIPHER_ARIA_GCM_128_IV_SIZE],
967 pub key: [c_uchar; TLS_CIPHER_ARIA_GCM_128_KEY_SIZE],
968 pub salt: [c_uchar; TLS_CIPHER_ARIA_GCM_128_SALT_SIZE],
969 pub rec_seq: [c_uchar; TLS_CIPHER_ARIA_GCM_128_REC_SEQ_SIZE],
970 }
971
972 pub struct tls12_crypto_info_aria_gcm_256 {
973 pub info: tls_crypto_info,
974 pub iv: [c_uchar; TLS_CIPHER_ARIA_GCM_256_IV_SIZE],
975 pub key: [c_uchar; TLS_CIPHER_ARIA_GCM_256_KEY_SIZE],
976 pub salt: [c_uchar; TLS_CIPHER_ARIA_GCM_256_SALT_SIZE],
977 pub rec_seq: [c_uchar; TLS_CIPHER_ARIA_GCM_256_REC_SEQ_SIZE],
978 }
979
980 pub struct iw_param {
983 pub value: __s32,
984 pub fixed: __u8,
985 pub disabled: __u8,
986 pub flags: __u16,
987 }
988
989 pub struct iw_point {
990 pub pointer: *mut c_void,
991 pub length: __u16,
992 pub flags: __u16,
993 }
994
995 pub struct iw_freq {
996 pub m: __s32,
997 pub e: __s16,
998 pub i: __u8,
999 pub flags: __u8,
1000 }
1001
1002 pub struct iw_quality {
1003 pub qual: __u8,
1004 pub level: __u8,
1005 pub noise: __u8,
1006 pub updated: __u8,
1007 }
1008
1009 pub struct iw_discarded {
1010 pub nwid: __u32,
1011 pub code: __u32,
1012 pub fragment: __u32,
1013 pub retries: __u32,
1014 pubmisc: __u32,
1015 }
1016
1017 pub struct iw_missed {
1018 pub beacon: __u32,
1019 }
1020
1021 pub struct iw_scan_req {
1022 pub scan_type: __u8,
1023 pub essid_len: __u8,
1024 pub num_channels: __u8,
1025 pub flags: __u8,
1026 pub bssid: crate::sockaddr,
1027 pub essid: [__u8; IW_ESSID_MAX_SIZE],
1028 pub min_channel_time: __u32,
1029 pub max_channel_time: __u32,
1030 pub channel_list: [iw_freq; IW_MAX_FREQUENCIES],
1031 }
1032
1033 pub struct iw_encode_ext {
1034 pub ext_flags: __u32,
1035 pub tx_seq: [__u8; IW_ENCODE_SEQ_MAX_SIZE],
1036 pub rx_seq: [__u8; IW_ENCODE_SEQ_MAX_SIZE],
1037 pub addr: crate::sockaddr,
1038 pub alg: __u16,
1039 pub key_len: __u16,
1040 pub key: [__u8; 0],
1041 }
1042
1043 pub struct iw_pmksa {
1044 pub cmd: __u32,
1045 pub bssid: crate::sockaddr,
1046 pub pmkid: [__u8; IW_PMKID_LEN],
1047 }
1048
1049 pub struct iw_pmkid_cand {
1050 pub flags: __u32,
1051 pub index: __u32,
1052 pub bssid: crate::sockaddr,
1053 }
1054
1055 pub struct iw_statistics {
1056 pub status: __u16,
1057 pub qual: iw_quality,
1058 pub discard: iw_discarded,
1059 pub miss: iw_missed,
1060 }
1061
1062 pub struct iw_range {
1063 pub throughput: __u32,
1064 pub min_nwid: __u32,
1065 pub max_nwid: __u32,
1066 pub old_num_channels: __u16,
1067 pub old_num_frequency: __u8,
1068 pub scan_capa: __u8,
1069 pub event_capa: [__u32; 6],
1070 pub sensitivity: __s32,
1071 pub max_qual: iw_quality,
1072 pub avg_qual: iw_quality,
1073 pub num_bitrates: __u8,
1074 pub bitrate: [__s32; IW_MAX_BITRATES],
1075 pub min_rts: __s32,
1076 pub max_rts: __s32,
1077 pub min_frag: __s32,
1078 pub max_frag: __s32,
1079 pub min_pmp: __s32,
1080 pub max_pmp: __s32,
1081 pub min_pmt: __s32,
1082 pub max_pmt: __s32,
1083 pub pmp_flags: __u16,
1084 pub pmt_flags: __u16,
1085 pub pm_capa: __u16,
1086 pub encoding_size: [__u16; IW_MAX_ENCODING_SIZES],
1087 pub num_encoding_sizes: __u8,
1088 pub max_encoding_tokens: __u8,
1089 pub encoding_login_index: __u8,
1090 pub txpower_capa: __u16,
1091 pub num_txpower: __u8,
1092 pub txpower: [__s32; IW_MAX_TXPOWER],
1093 pub we_version_compiled: __u8,
1094 pub we_version_source: __u8,
1095 pub retry_capa: __u16,
1096 pub retry_flags: __u16,
1097 pub r_time_flags: __u16,
1098 pub min_retry: __s32,
1099 pub max_retry: __s32,
1100 pub min_r_time: __s32,
1101 pub max_r_time: __s32,
1102 pub num_channels: __u16,
1103 pub num_frequency: __u8,
1104 pub freq: [iw_freq; IW_MAX_FREQUENCIES],
1105 pub enc_capa: __u32,
1106 }
1107
1108 pub struct iw_priv_args {
1109 pub cmd: __u32,
1110 pub set_args: __u16,
1111 pub get_args: __u16,
1112 pub name: [c_char; crate::IFNAMSIZ],
1113 }
1114
1115 pub struct epoll_params {
1118 pub busy_poll_usecs: u32,
1119 pub busy_poll_budget: u16,
1120 pub prefer_busy_poll: u8,
1121 pub __pad: u8, }
1123
1124 #[cfg_attr(
1125 any(
1126 target_pointer_width = "32",
1127 target_arch = "x86_64",
1128 target_arch = "powerpc64",
1129 target_arch = "mips64",
1130 target_arch = "mips64r6",
1131 target_arch = "s390x",
1132 target_arch = "sparc64",
1133 target_arch = "aarch64",
1134 target_arch = "riscv64",
1135 target_arch = "riscv32",
1136 target_arch = "loongarch64"
1137 ),
1138 repr(align(4))
1139 )]
1140 #[cfg_attr(
1141 not(any(
1142 target_pointer_width = "32",
1143 target_arch = "x86_64",
1144 target_arch = "powerpc64",
1145 target_arch = "mips64",
1146 target_arch = "mips64r6",
1147 target_arch = "s390x",
1148 target_arch = "sparc64",
1149 target_arch = "aarch64",
1150 target_arch = "riscv64",
1151 target_arch = "riscv32",
1152 target_arch = "loongarch64"
1153 )),
1154 repr(align(8))
1155 )]
1156 pub struct pthread_mutexattr_t {
1157 #[doc(hidden)]
1158 size: [u8; crate::__SIZEOF_PTHREAD_MUTEXATTR_T],
1159 }
1160
1161 #[cfg_attr(
1162 any(target_env = "musl", target_env = "ohos", target_pointer_width = "32"),
1163 repr(align(4))
1164 )]
1165 #[cfg_attr(
1166 all(
1167 not(target_env = "musl"),
1168 not(target_env = "ohos"),
1169 target_pointer_width = "64"
1170 ),
1171 repr(align(8))
1172 )]
1173 pub struct pthread_rwlockattr_t {
1174 #[doc(hidden)]
1175 size: [u8; crate::__SIZEOF_PTHREAD_RWLOCKATTR_T],
1176 }
1177
1178 #[repr(align(4))]
1179 pub struct pthread_condattr_t {
1180 #[doc(hidden)]
1181 size: [u8; crate::__SIZEOF_PTHREAD_CONDATTR_T],
1182 }
1183
1184 #[repr(align(4))]
1185 pub struct pthread_barrierattr_t {
1186 #[doc(hidden)]
1187 size: [u8; crate::__SIZEOF_PTHREAD_BARRIERATTR_T],
1188 }
1189
1190 #[cfg(not(any(target_env = "musl", target_env = "ohos")))]
1191 #[repr(align(8))]
1192 pub struct fanotify_event_metadata {
1193 pub event_len: __u32,
1194 pub vers: __u8,
1195 pub reserved: __u8,
1196 pub metadata_len: __u16,
1197 pub mask: __u64,
1198 pub fd: c_int,
1199 pub pid: c_int,
1200 }
1201
1202 pub struct ptp_sys_offset {
1205 pub n_samples: c_uint,
1206 pub rsv: [c_uint; 3],
1207 pub ts: [ptp_clock_time; 51],
1209 }
1210
1211 pub struct ptp_pin_desc {
1212 pub name: [c_char; 64],
1213 pub index: c_uint,
1214 pub func: c_uint,
1215 pub chan: c_uint,
1216 pub rsv: [c_uint; 5],
1217 }
1218
1219 pub struct ptp_clock_caps {
1220 pub max_adj: c_int,
1221 pub n_alarm: c_int,
1222 pub n_ext_ts: c_int,
1223 pub n_per_out: c_int,
1224 pub pps: c_int,
1225 pub n_pins: c_int,
1226 pub cross_timestamping: c_int,
1227 pub adjust_phase: c_int,
1228 pub max_phase_adj: c_int,
1229 pub rsv: [c_int; 11],
1230 }
1231
1232 pub struct sockaddr_xdp {
1235 pub sxdp_family: crate::__u16,
1236 pub sxdp_flags: crate::__u16,
1237 pub sxdp_ifindex: crate::__u32,
1238 pub sxdp_queue_id: crate::__u32,
1239 pub sxdp_shared_umem_fd: crate::__u32,
1240 }
1241
1242 pub struct xdp_ring_offset {
1243 pub producer: crate::__u64,
1244 pub consumer: crate::__u64,
1245 pub desc: crate::__u64,
1246 pub flags: crate::__u64,
1247 }
1248
1249 pub struct xdp_mmap_offsets {
1250 pub rx: xdp_ring_offset,
1251 pub tx: xdp_ring_offset,
1252 pub fr: xdp_ring_offset,
1253 pub cr: xdp_ring_offset,
1254 }
1255
1256 pub struct xdp_ring_offset_v1 {
1257 pub producer: crate::__u64,
1258 pub consumer: crate::__u64,
1259 pub desc: crate::__u64,
1260 }
1261
1262 pub struct xdp_mmap_offsets_v1 {
1263 pub rx: xdp_ring_offset_v1,
1264 pub tx: xdp_ring_offset_v1,
1265 pub fr: xdp_ring_offset_v1,
1266 pub cr: xdp_ring_offset_v1,
1267 }
1268
1269 pub struct xdp_umem_reg {
1270 pub addr: crate::__u64,
1271 pub len: crate::__u64,
1272 pub chunk_size: crate::__u32,
1273 pub headroom: crate::__u32,
1274 pub flags: crate::__u32,
1275 pub tx_metadata_len: crate::__u32,
1276 }
1277
1278 pub struct xdp_umem_reg_v1 {
1279 pub addr: crate::__u64,
1280 pub len: crate::__u64,
1281 pub chunk_size: crate::__u32,
1282 pub headroom: crate::__u32,
1283 }
1284
1285 pub struct xdp_statistics {
1286 pub rx_dropped: crate::__u64,
1287 pub rx_invalid_descs: crate::__u64,
1288 pub tx_invalid_descs: crate::__u64,
1289 pub rx_ring_full: crate::__u64,
1290 pub rx_fill_ring_empty_descs: crate::__u64,
1291 pub tx_ring_empty_descs: crate::__u64,
1292 }
1293
1294 pub struct xdp_statistics_v1 {
1295 pub rx_dropped: crate::__u64,
1296 pub rx_invalid_descs: crate::__u64,
1297 pub tx_invalid_descs: crate::__u64,
1298 }
1299
1300 pub struct xdp_options {
1301 pub flags: crate::__u32,
1302 }
1303
1304 pub struct xdp_desc {
1305 pub addr: crate::__u64,
1306 pub len: crate::__u32,
1307 pub options: crate::__u32,
1308 }
1309
1310 pub struct xsk_tx_metadata_completion {
1311 pub tx_timestamp: crate::__u64,
1312 }
1313
1314 pub struct xsk_tx_metadata_request {
1315 pub csum_start: __u16,
1316 pub csum_offset: __u16,
1317 }
1318
1319 pub struct mount_attr {
1322 pub attr_set: crate::__u64,
1323 pub attr_clr: crate::__u64,
1324 pub propagation: crate::__u64,
1325 pub userns_fd: crate::__u64,
1326 }
1327
1328 pub struct mnt_ns_info {
1330 pub size: crate::__u32,
1331 pub nr_mounts: crate::__u32,
1332 pub mnt_ns_id: crate::__u64,
1333 }
1334
1335 #[non_exhaustive]
1338 pub struct pidfd_info {
1339 pub mask: crate::__u64,
1340 pub cgroupid: crate::__u64,
1341 pub pid: crate::__u32,
1342 pub tgid: crate::__u32,
1343 pub ppid: crate::__u32,
1344 pub ruid: crate::__u32,
1345 pub rgid: crate::__u32,
1346 pub euid: crate::__u32,
1347 pub egid: crate::__u32,
1348 pub suid: crate::__u32,
1349 pub sgid: crate::__u32,
1350 pub fsuid: crate::__u32,
1351 pub fsgid: crate::__u32,
1352 pub exit_code: crate::__s32,
1353 }
1354
1355 pub struct dmabuf_cmsg {
1358 pub frag_offset: crate::__u64,
1359 pub frag_size: crate::__u32,
1360 pub frag_token: crate::__u32,
1361 pub dmabuf_id: crate::__u32,
1362 pub flags: crate::__u32,
1363 }
1364
1365 pub struct dmabuf_token {
1366 pub token_start: crate::__u32,
1367 pub token_count: crate::__u32,
1368 }
1369
1370 pub struct sockaddr_nl {
1371 pub nl_family: crate::sa_family_t,
1372 nl_pad: Padding<c_ushort>,
1373 pub nl_pid: u32,
1374 pub nl_groups: u32,
1375 }
1376
1377 pub struct dirent {
1378 pub d_ino: crate::ino_t,
1379 pub d_off: off_t,
1380 pub d_reclen: c_ushort,
1381 pub d_type: c_uchar,
1382 pub d_name: [c_char; 256],
1383 }
1384
1385 pub struct dirent64 {
1386 pub d_ino: crate::ino64_t,
1387 pub d_off: off64_t,
1388 pub d_reclen: c_ushort,
1389 pub d_type: c_uchar,
1390 pub d_name: [c_char; 256],
1391 }
1392
1393 pub struct sockaddr_alg {
1394 pub salg_family: crate::sa_family_t,
1395 pub salg_type: [c_uchar; 14],
1396 pub salg_feat: u32,
1397 pub salg_mask: u32,
1398 pub salg_name: [c_uchar; 64],
1399 }
1400
1401 pub struct uinput_setup {
1402 pub id: input_id,
1403 pub name: [c_char; UINPUT_MAX_NAME_SIZE],
1404 pub ff_effects_max: __u32,
1405 }
1406
1407 pub struct uinput_user_dev {
1408 pub name: [c_char; UINPUT_MAX_NAME_SIZE],
1409 pub id: input_id,
1410 pub ff_effects_max: __u32,
1411 pub absmax: [__s32; ABS_CNT],
1412 pub absmin: [__s32; ABS_CNT],
1413 pub absfuzz: [__s32; ABS_CNT],
1414 pub absflat: [__s32; ABS_CNT],
1415 }
1416
1417 pub struct mq_attr {
1420 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
1421 pub mq_flags: i64,
1422 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
1423 pub mq_maxmsg: i64,
1424 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
1425 pub mq_msgsize: i64,
1426 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
1427 pub mq_curmsgs: i64,
1428 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
1429 pad: [i64; 4],
1430
1431 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
1432 pub mq_flags: c_long,
1433 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
1434 pub mq_maxmsg: c_long,
1435 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
1436 pub mq_msgsize: c_long,
1437 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
1438 pub mq_curmsgs: c_long,
1439 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
1440 pad: [c_long; 4],
1441 }
1442
1443 pub struct hwtstamp_config {
1444 pub flags: c_int,
1445 pub tx_type: c_int,
1446 pub rx_filter: c_int,
1447 }
1448
1449 pub struct sched_attr {
1450 pub size: __u32,
1451 pub sched_policy: __u32,
1452 pub sched_flags: crate::__u64,
1453 pub sched_nice: __s32,
1454 pub sched_priority: __u32,
1455 pub sched_runtime: crate::__u64,
1456 pub sched_deadline: crate::__u64,
1457 pub sched_period: crate::__u64,
1458 }
1459
1460 #[cfg_attr(
1461 all(
1462 any(target_env = "musl", target_env = "ohos"),
1463 target_pointer_width = "32"
1464 ),
1465 repr(align(4))
1466 )]
1467 #[cfg_attr(
1468 all(
1469 any(target_env = "musl", target_env = "ohos"),
1470 target_pointer_width = "64"
1471 ),
1472 repr(align(8))
1473 )]
1474 #[cfg_attr(
1475 all(
1476 not(any(target_env = "musl", target_env = "ohos")),
1477 target_arch = "x86"
1478 ),
1479 repr(align(4))
1480 )]
1481 #[cfg_attr(
1482 all(
1483 not(any(target_env = "musl", target_env = "ohos")),
1484 not(target_arch = "x86")
1485 ),
1486 repr(align(8))
1487 )]
1488 pub struct pthread_cond_t {
1489 #[doc(hidden)]
1490 size: [u8; crate::__SIZEOF_PTHREAD_COND_T],
1491 }
1492
1493 #[cfg_attr(
1494 all(
1495 target_pointer_width = "32",
1496 any(
1497 target_arch = "mips",
1498 target_arch = "mips32r6",
1499 target_arch = "arm",
1500 target_arch = "hexagon",
1501 target_arch = "m68k",
1502 target_arch = "csky",
1503 target_arch = "powerpc",
1504 target_arch = "sparc",
1505 target_arch = "x86_64",
1506 target_arch = "x86"
1507 )
1508 ),
1509 repr(align(4))
1510 )]
1511 #[cfg_attr(
1512 any(
1513 target_pointer_width = "64",
1514 not(any(
1515 target_arch = "mips",
1516 target_arch = "mips32r6",
1517 target_arch = "arm",
1518 target_arch = "hexagon",
1519 target_arch = "m68k",
1520 target_arch = "csky",
1521 target_arch = "powerpc",
1522 target_arch = "sparc",
1523 target_arch = "x86_64",
1524 target_arch = "x86"
1525 ))
1526 ),
1527 repr(align(8))
1528 )]
1529 pub struct pthread_mutex_t {
1530 #[doc(hidden)]
1531 size: [u8; crate::__SIZEOF_PTHREAD_MUTEX_T],
1532 }
1533
1534 #[cfg_attr(
1535 all(
1536 target_pointer_width = "32",
1537 any(
1538 target_arch = "mips",
1539 target_arch = "mips32r6",
1540 target_arch = "arm",
1541 target_arch = "hexagon",
1542 target_arch = "m68k",
1543 target_arch = "csky",
1544 target_arch = "powerpc",
1545 target_arch = "sparc",
1546 target_arch = "x86_64",
1547 target_arch = "x86"
1548 )
1549 ),
1550 repr(align(4))
1551 )]
1552 #[cfg_attr(
1553 any(
1554 target_pointer_width = "64",
1555 not(any(
1556 target_arch = "mips",
1557 target_arch = "mips32r6",
1558 target_arch = "arm",
1559 target_arch = "hexagon",
1560 target_arch = "m68k",
1561 target_arch = "powerpc",
1562 target_arch = "sparc",
1563 target_arch = "x86_64",
1564 target_arch = "x86"
1565 ))
1566 ),
1567 repr(align(8))
1568 )]
1569 pub struct pthread_rwlock_t {
1570 size: [u8; crate::__SIZEOF_PTHREAD_RWLOCK_T],
1571 }
1572
1573 #[cfg_attr(
1574 all(
1575 target_pointer_width = "32",
1576 any(
1577 target_arch = "mips",
1578 target_arch = "mips32r6",
1579 target_arch = "arm",
1580 target_arch = "hexagon",
1581 target_arch = "m68k",
1582 target_arch = "csky",
1583 target_arch = "powerpc",
1584 target_arch = "sparc",
1585 target_arch = "x86_64",
1586 target_arch = "x86"
1587 )
1588 ),
1589 repr(align(4))
1590 )]
1591 #[cfg_attr(
1592 any(
1593 target_pointer_width = "64",
1594 not(any(
1595 target_arch = "mips",
1596 target_arch = "mips32r6",
1597 target_arch = "arm",
1598 target_arch = "hexagon",
1599 target_arch = "m68k",
1600 target_arch = "csky",
1601 target_arch = "powerpc",
1602 target_arch = "sparc",
1603 target_arch = "x86_64",
1604 target_arch = "x86"
1605 ))
1606 ),
1607 repr(align(8))
1608 )]
1609 pub struct pthread_barrier_t {
1610 size: [u8; crate::__SIZEOF_PTHREAD_BARRIER_T],
1611 }
1612}
1613
1614cfg_if! {
1615 if #[cfg(not(target_arch = "sparc64"))] {
1616 s! {
1617 pub struct iw_thrspy {
1618 pub addr: crate::sockaddr,
1619 pub qual: iw_quality,
1620 pub low: iw_quality,
1621 pub high: iw_quality,
1622 }
1623
1624 pub struct iw_mlme {
1625 pub cmd: __u16,
1626 pub reason_code: __u16,
1627 pub addr: crate::sockaddr,
1628 }
1629
1630 pub struct iw_michaelmicfailure {
1631 pub flags: __u32,
1632 pub src_addr: crate::sockaddr,
1633 pub tsc: [__u8; IW_ENCODE_SEQ_MAX_SIZE],
1634 }
1635
1636 pub struct __c_anonymous_elf32_rela {
1637 pub r_offset: Elf32_Addr,
1638 pub r_info: Elf32_Word,
1639 pub r_addend: Elf32_Sword,
1640 }
1641
1642 pub struct __c_anonymous_elf64_rela {
1643 pub r_offset: Elf64_Addr,
1644 pub r_info: Elf64_Xword,
1645 pub r_addend: Elf64_Sxword,
1646 }
1647 }
1648 }
1649}
1650
1651s_no_extra_traits! {
1652 #[deprecated(
1655 note = "this struct has unsafe trait implementations that will be \
1656 removed in the future",
1657 since = "0.2.80"
1658 )]
1659 pub struct af_alg_iv {
1660 pub ivlen: u32,
1661 pub iv: [c_uchar; 0],
1662 }
1663
1664 pub union __c_anonymous_ifr_ifru {
1665 pub ifru_addr: crate::sockaddr,
1666 pub ifru_dstaddr: crate::sockaddr,
1667 pub ifru_broadaddr: crate::sockaddr,
1668 pub ifru_netmask: crate::sockaddr,
1669 pub ifru_hwaddr: crate::sockaddr,
1670 pub ifru_flags: c_short,
1671 pub ifru_ifindex: c_int,
1672 pub ifru_metric: c_int,
1673 pub ifru_mtu: c_int,
1674 pub ifru_map: __c_anonymous_ifru_map,
1675 pub ifru_slave: [c_char; crate::IFNAMSIZ],
1676 pub ifru_newname: [c_char; crate::IFNAMSIZ],
1677 pub ifru_data: *mut c_char,
1678 }
1679
1680 pub struct ifreq {
1681 pub ifr_name: [c_char; crate::IFNAMSIZ],
1683 pub ifr_ifru: __c_anonymous_ifr_ifru,
1684 }
1685
1686 pub union __c_anonymous_ifc_ifcu {
1687 pub ifcu_buf: *mut c_char,
1688 pub ifcu_req: *mut crate::ifreq,
1689 }
1690
1691 pub struct ifconf {
1694 pub ifc_len: c_int,
1696 pub ifc_ifcu: __c_anonymous_ifc_ifcu,
1697 }
1698
1699 pub union tpacket_req_u {
1700 pub req: crate::tpacket_req,
1701 pub req3: crate::tpacket_req3,
1702 }
1703
1704 pub union tpacket_bd_header_u {
1705 pub bh1: crate::tpacket_hdr_v1,
1706 }
1707
1708 pub struct tpacket_block_desc {
1709 pub version: __u32,
1710 pub offset_to_priv: __u32,
1711 pub hdr: crate::tpacket_bd_header_u,
1712 }
1713
1714 pub struct sock_txtime {
1716 pub clockid: crate::clockid_t,
1717 pub flags: __u32,
1718 }
1719
1720 pub union iwreq_data {
1722 pub name: [c_char; crate::IFNAMSIZ],
1723 pub essid: iw_point,
1724 pub nwid: iw_param,
1725 pub freq: iw_freq,
1726 pub sens: iw_param,
1727 pub bitrate: iw_param,
1728 pub txpower: iw_param,
1729 pub rts: iw_param,
1730 pub frag: iw_param,
1731 pub mode: __u32,
1732 pub retry: iw_param,
1733 pub encoding: iw_point,
1734 pub power: iw_param,
1735 pub qual: iw_quality,
1736 pub ap_addr: crate::sockaddr,
1737 pub addr: crate::sockaddr,
1738 pub param: iw_param,
1739 pub data: iw_point,
1740 }
1741
1742 pub struct iw_event {
1743 pub len: __u16,
1744 pub cmd: __u16,
1745 pub u: iwreq_data,
1746 }
1747
1748 pub union __c_anonymous_iwreq {
1749 pub ifrn_name: [c_char; crate::IFNAMSIZ],
1750 }
1751
1752 pub struct iwreq {
1753 pub ifr_ifrn: __c_anonymous_iwreq,
1754 pub u: iwreq_data,
1755 }
1756
1757 pub union __c_anonymous_ptp_perout_request_1 {
1759 pub start: ptp_clock_time,
1760 pub phase: ptp_clock_time,
1761 }
1762
1763 pub union __c_anonymous_ptp_perout_request_2 {
1764 pub on: ptp_clock_time,
1765 pub rsv: [c_uint; 4],
1766 }
1767
1768 pub struct ptp_perout_request {
1769 pub anonymous_1: __c_anonymous_ptp_perout_request_1,
1770 pub period: ptp_clock_time,
1771 pub index: c_uint,
1772 pub flags: c_uint,
1773 pub anonymous_2: __c_anonymous_ptp_perout_request_2,
1774 }
1775
1776 pub struct xsk_tx_metadata {
1778 pub flags: crate::__u64,
1779 pub xsk_tx_metadata_union: __c_anonymous_xsk_tx_metadata_union,
1780 }
1781
1782 pub union __c_anonymous_xsk_tx_metadata_union {
1783 pub request: xsk_tx_metadata_request,
1784 pub completion: xsk_tx_metadata_completion,
1785 }
1786}
1787
1788cfg_if! {
1789 if #[cfg(feature = "extra_traits")] {
1790 #[allow(deprecated)]
1791 impl af_alg_iv {
1792 fn as_slice(&self) -> &[u8] {
1793 unsafe { ::core::slice::from_raw_parts(self.iv.as_ptr(), self.ivlen as usize) }
1794 }
1795 }
1796
1797 #[allow(deprecated)]
1798 impl PartialEq for af_alg_iv {
1799 fn eq(&self, other: &af_alg_iv) -> bool {
1800 *self.as_slice() == *other.as_slice()
1801 }
1802 }
1803
1804 #[allow(deprecated)]
1805 impl Eq for af_alg_iv {}
1806
1807 #[allow(deprecated)]
1808 impl hash::Hash for af_alg_iv {
1809 fn hash<H: hash::Hasher>(&self, state: &mut H) {
1810 self.as_slice().hash(state);
1811 }
1812 }
1813 }
1814}
1815
1816cfg_if! {
1817 if #[cfg(any(
1818 target_env = "gnu",
1819 target_env = "musl",
1820 target_env = "ohos"
1821 ))] {
1822 pub const ABDAY_1: crate::nl_item = 0x20000;
1823 pub const ABDAY_2: crate::nl_item = 0x20001;
1824 pub const ABDAY_3: crate::nl_item = 0x20002;
1825 pub const ABDAY_4: crate::nl_item = 0x20003;
1826 pub const ABDAY_5: crate::nl_item = 0x20004;
1827 pub const ABDAY_6: crate::nl_item = 0x20005;
1828 pub const ABDAY_7: crate::nl_item = 0x20006;
1829
1830 pub const DAY_1: crate::nl_item = 0x20007;
1831 pub const DAY_2: crate::nl_item = 0x20008;
1832 pub const DAY_3: crate::nl_item = 0x20009;
1833 pub const DAY_4: crate::nl_item = 0x2000A;
1834 pub const DAY_5: crate::nl_item = 0x2000B;
1835 pub const DAY_6: crate::nl_item = 0x2000C;
1836 pub const DAY_7: crate::nl_item = 0x2000D;
1837
1838 pub const ABMON_1: crate::nl_item = 0x2000E;
1839 pub const ABMON_2: crate::nl_item = 0x2000F;
1840 pub const ABMON_3: crate::nl_item = 0x20010;
1841 pub const ABMON_4: crate::nl_item = 0x20011;
1842 pub const ABMON_5: crate::nl_item = 0x20012;
1843 pub const ABMON_6: crate::nl_item = 0x20013;
1844 pub const ABMON_7: crate::nl_item = 0x20014;
1845 pub const ABMON_8: crate::nl_item = 0x20015;
1846 pub const ABMON_9: crate::nl_item = 0x20016;
1847 pub const ABMON_10: crate::nl_item = 0x20017;
1848 pub const ABMON_11: crate::nl_item = 0x20018;
1849 pub const ABMON_12: crate::nl_item = 0x20019;
1850
1851 pub const MON_1: crate::nl_item = 0x2001A;
1852 pub const MON_2: crate::nl_item = 0x2001B;
1853 pub const MON_3: crate::nl_item = 0x2001C;
1854 pub const MON_4: crate::nl_item = 0x2001D;
1855 pub const MON_5: crate::nl_item = 0x2001E;
1856 pub const MON_6: crate::nl_item = 0x2001F;
1857 pub const MON_7: crate::nl_item = 0x20020;
1858 pub const MON_8: crate::nl_item = 0x20021;
1859 pub const MON_9: crate::nl_item = 0x20022;
1860 pub const MON_10: crate::nl_item = 0x20023;
1861 pub const MON_11: crate::nl_item = 0x20024;
1862 pub const MON_12: crate::nl_item = 0x20025;
1863
1864 pub const AM_STR: crate::nl_item = 0x20026;
1865 pub const PM_STR: crate::nl_item = 0x20027;
1866
1867 pub const D_T_FMT: crate::nl_item = 0x20028;
1868 pub const D_FMT: crate::nl_item = 0x20029;
1869 pub const T_FMT: crate::nl_item = 0x2002A;
1870 pub const T_FMT_AMPM: crate::nl_item = 0x2002B;
1871
1872 pub const ERA: crate::nl_item = 0x2002C;
1873 pub const ERA_D_FMT: crate::nl_item = 0x2002E;
1874 pub const ALT_DIGITS: crate::nl_item = 0x2002F;
1875 pub const ERA_D_T_FMT: crate::nl_item = 0x20030;
1876 pub const ERA_T_FMT: crate::nl_item = 0x20031;
1877
1878 pub const CODESET: crate::nl_item = 14;
1879 pub const CRNCYSTR: crate::nl_item = 0x4000F;
1880 pub const RADIXCHAR: crate::nl_item = 0x10000;
1881 pub const THOUSEP: crate::nl_item = 0x10001;
1882 pub const YESEXPR: crate::nl_item = 0x50000;
1883 pub const NOEXPR: crate::nl_item = 0x50001;
1884 pub const YESSTR: crate::nl_item = 0x50002;
1885 pub const NOSTR: crate::nl_item = 0x50003;
1886 }
1887}
1888
1889pub const RUSAGE_CHILDREN: c_int = -1;
1890pub const L_tmpnam: c_uint = 20;
1891pub const _PC_LINK_MAX: c_int = 0;
1892pub const _PC_MAX_CANON: c_int = 1;
1893pub const _PC_MAX_INPUT: c_int = 2;
1894pub const _PC_NAME_MAX: c_int = 3;
1895pub const _PC_PATH_MAX: c_int = 4;
1896pub const _PC_PIPE_BUF: c_int = 5;
1897pub const _PC_CHOWN_RESTRICTED: c_int = 6;
1898pub const _PC_NO_TRUNC: c_int = 7;
1899pub const _PC_VDISABLE: c_int = 8;
1900pub const _PC_SYNC_IO: c_int = 9;
1901pub const _PC_ASYNC_IO: c_int = 10;
1902pub const _PC_PRIO_IO: c_int = 11;
1903pub const _PC_SOCK_MAXBUF: c_int = 12;
1904pub const _PC_FILESIZEBITS: c_int = 13;
1905pub const _PC_REC_INCR_XFER_SIZE: c_int = 14;
1906pub const _PC_REC_MAX_XFER_SIZE: c_int = 15;
1907pub const _PC_REC_MIN_XFER_SIZE: c_int = 16;
1908pub const _PC_REC_XFER_ALIGN: c_int = 17;
1909pub const _PC_ALLOC_SIZE_MIN: c_int = 18;
1910pub const _PC_SYMLINK_MAX: c_int = 19;
1911pub const _PC_2_SYMLINKS: c_int = 20;
1912
1913pub const MS_NOUSER: c_ulong = 0xffffffff80000000;
1914
1915pub const _SC_ARG_MAX: c_int = 0;
1916pub const _SC_CHILD_MAX: c_int = 1;
1917pub const _SC_CLK_TCK: c_int = 2;
1918pub const _SC_NGROUPS_MAX: c_int = 3;
1919pub const _SC_OPEN_MAX: c_int = 4;
1920pub const _SC_STREAM_MAX: c_int = 5;
1921pub const _SC_TZNAME_MAX: c_int = 6;
1922pub const _SC_JOB_CONTROL: c_int = 7;
1923pub const _SC_SAVED_IDS: c_int = 8;
1924pub const _SC_REALTIME_SIGNALS: c_int = 9;
1925pub const _SC_PRIORITY_SCHEDULING: c_int = 10;
1926pub const _SC_TIMERS: c_int = 11;
1927pub const _SC_ASYNCHRONOUS_IO: c_int = 12;
1928pub const _SC_PRIORITIZED_IO: c_int = 13;
1929pub const _SC_SYNCHRONIZED_IO: c_int = 14;
1930pub const _SC_FSYNC: c_int = 15;
1931pub const _SC_MAPPED_FILES: c_int = 16;
1932pub const _SC_MEMLOCK: c_int = 17;
1933pub const _SC_MEMLOCK_RANGE: c_int = 18;
1934pub const _SC_MEMORY_PROTECTION: c_int = 19;
1935pub const _SC_MESSAGE_PASSING: c_int = 20;
1936pub const _SC_SEMAPHORES: c_int = 21;
1937pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 22;
1938pub const _SC_AIO_LISTIO_MAX: c_int = 23;
1939pub const _SC_AIO_MAX: c_int = 24;
1940pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 25;
1941pub const _SC_DELAYTIMER_MAX: c_int = 26;
1942pub const _SC_MQ_OPEN_MAX: c_int = 27;
1943pub const _SC_MQ_PRIO_MAX: c_int = 28;
1944pub const _SC_VERSION: c_int = 29;
1945pub const _SC_PAGESIZE: c_int = 30;
1946pub const _SC_PAGE_SIZE: c_int = _SC_PAGESIZE;
1947pub const _SC_RTSIG_MAX: c_int = 31;
1948pub const _SC_SEM_NSEMS_MAX: c_int = 32;
1949pub const _SC_SEM_VALUE_MAX: c_int = 33;
1950pub const _SC_SIGQUEUE_MAX: c_int = 34;
1951pub const _SC_TIMER_MAX: c_int = 35;
1952pub const _SC_BC_BASE_MAX: c_int = 36;
1953pub const _SC_BC_DIM_MAX: c_int = 37;
1954pub const _SC_BC_SCALE_MAX: c_int = 38;
1955pub const _SC_BC_STRING_MAX: c_int = 39;
1956pub const _SC_COLL_WEIGHTS_MAX: c_int = 40;
1957pub const _SC_EXPR_NEST_MAX: c_int = 42;
1958pub const _SC_LINE_MAX: c_int = 43;
1959pub const _SC_RE_DUP_MAX: c_int = 44;
1960pub const _SC_2_VERSION: c_int = 46;
1961pub const _SC_2_C_BIND: c_int = 47;
1962pub const _SC_2_C_DEV: c_int = 48;
1963pub const _SC_2_FORT_DEV: c_int = 49;
1964pub const _SC_2_FORT_RUN: c_int = 50;
1965pub const _SC_2_SW_DEV: c_int = 51;
1966pub const _SC_2_LOCALEDEF: c_int = 52;
1967pub const _SC_UIO_MAXIOV: c_int = 60;
1968pub const _SC_IOV_MAX: c_int = 60;
1969pub const _SC_THREADS: c_int = 67;
1970pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 68;
1971pub const _SC_GETGR_R_SIZE_MAX: c_int = 69;
1972pub const _SC_GETPW_R_SIZE_MAX: c_int = 70;
1973pub const _SC_LOGIN_NAME_MAX: c_int = 71;
1974pub const _SC_TTY_NAME_MAX: c_int = 72;
1975pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 73;
1976pub const _SC_THREAD_KEYS_MAX: c_int = 74;
1977pub const _SC_THREAD_STACK_MIN: c_int = 75;
1978pub const _SC_THREAD_THREADS_MAX: c_int = 76;
1979pub const _SC_THREAD_ATTR_STACKADDR: c_int = 77;
1980pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 78;
1981pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 79;
1982pub const _SC_THREAD_PRIO_INHERIT: c_int = 80;
1983pub const _SC_THREAD_PRIO_PROTECT: c_int = 81;
1984pub const _SC_THREAD_PROCESS_SHARED: c_int = 82;
1985pub const _SC_NPROCESSORS_CONF: c_int = 83;
1986pub const _SC_NPROCESSORS_ONLN: c_int = 84;
1987pub const _SC_PHYS_PAGES: c_int = 85;
1988pub const _SC_AVPHYS_PAGES: c_int = 86;
1989pub const _SC_ATEXIT_MAX: c_int = 87;
1990pub const _SC_PASS_MAX: c_int = 88;
1991pub const _SC_XOPEN_VERSION: c_int = 89;
1992pub const _SC_XOPEN_XCU_VERSION: c_int = 90;
1993pub const _SC_XOPEN_UNIX: c_int = 91;
1994pub const _SC_XOPEN_CRYPT: c_int = 92;
1995pub const _SC_XOPEN_ENH_I18N: c_int = 93;
1996pub const _SC_XOPEN_SHM: c_int = 94;
1997pub const _SC_2_CHAR_TERM: c_int = 95;
1998pub const _SC_2_UPE: c_int = 97;
1999pub const _SC_XOPEN_XPG2: c_int = 98;
2000pub const _SC_XOPEN_XPG3: c_int = 99;
2001pub const _SC_XOPEN_XPG4: c_int = 100;
2002pub const _SC_NZERO: c_int = 109;
2003pub const _SC_XBS5_ILP32_OFF32: c_int = 125;
2004pub const _SC_XBS5_ILP32_OFFBIG: c_int = 126;
2005pub const _SC_XBS5_LP64_OFF64: c_int = 127;
2006pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 128;
2007pub const _SC_XOPEN_LEGACY: c_int = 129;
2008pub const _SC_XOPEN_REALTIME: c_int = 130;
2009pub const _SC_XOPEN_REALTIME_THREADS: c_int = 131;
2010pub const _SC_ADVISORY_INFO: c_int = 132;
2011pub const _SC_BARRIERS: c_int = 133;
2012pub const _SC_CLOCK_SELECTION: c_int = 137;
2013pub const _SC_CPUTIME: c_int = 138;
2014pub const _SC_THREAD_CPUTIME: c_int = 139;
2015pub const _SC_MONOTONIC_CLOCK: c_int = 149;
2016pub const _SC_READER_WRITER_LOCKS: c_int = 153;
2017pub const _SC_SPIN_LOCKS: c_int = 154;
2018pub const _SC_REGEXP: c_int = 155;
2019pub const _SC_SHELL: c_int = 157;
2020pub const _SC_SPAWN: c_int = 159;
2021pub const _SC_SPORADIC_SERVER: c_int = 160;
2022pub const _SC_THREAD_SPORADIC_SERVER: c_int = 161;
2023pub const _SC_TIMEOUTS: c_int = 164;
2024pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 165;
2025pub const _SC_2_PBS: c_int = 168;
2026pub const _SC_2_PBS_ACCOUNTING: c_int = 169;
2027pub const _SC_2_PBS_LOCATE: c_int = 170;
2028pub const _SC_2_PBS_MESSAGE: c_int = 171;
2029pub const _SC_2_PBS_TRACK: c_int = 172;
2030pub const _SC_SYMLOOP_MAX: c_int = 173;
2031pub const _SC_STREAMS: c_int = 174;
2032pub const _SC_2_PBS_CHECKPOINT: c_int = 175;
2033pub const _SC_V6_ILP32_OFF32: c_int = 176;
2034pub const _SC_V6_ILP32_OFFBIG: c_int = 177;
2035pub const _SC_V6_LP64_OFF64: c_int = 178;
2036pub const _SC_V6_LPBIG_OFFBIG: c_int = 179;
2037pub const _SC_HOST_NAME_MAX: c_int = 180;
2038pub const _SC_TRACE: c_int = 181;
2039pub const _SC_TRACE_EVENT_FILTER: c_int = 182;
2040pub const _SC_TRACE_INHERIT: c_int = 183;
2041pub const _SC_TRACE_LOG: c_int = 184;
2042pub const _SC_IPV6: c_int = 235;
2043pub const _SC_RAW_SOCKETS: c_int = 236;
2044pub const _SC_V7_ILP32_OFF32: c_int = 237;
2045pub const _SC_V7_ILP32_OFFBIG: c_int = 238;
2046pub const _SC_V7_LP64_OFF64: c_int = 239;
2047pub const _SC_V7_LPBIG_OFFBIG: c_int = 240;
2048pub const _SC_SS_REPL_MAX: c_int = 241;
2049pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 242;
2050pub const _SC_TRACE_NAME_MAX: c_int = 243;
2051pub const _SC_TRACE_SYS_MAX: c_int = 244;
2052pub const _SC_TRACE_USER_EVENT_MAX: c_int = 245;
2053pub const _SC_XOPEN_STREAMS: c_int = 246;
2054pub const _SC_THREAD_ROBUST_PRIO_INHERIT: c_int = 247;
2055pub const _SC_THREAD_ROBUST_PRIO_PROTECT: c_int = 248;
2056
2057pub const _CS_PATH: c_int = 0;
2058pub const _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS: c_int = 1;
2059pub const _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS: c_int = 4;
2060pub const _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS: c_int = 5;
2061pub const _CS_POSIX_V6_ILP32_OFF32_CFLAGS: c_int = 1116;
2062pub const _CS_POSIX_V6_ILP32_OFF32_LDFLAGS: c_int = 1117;
2063pub const _CS_POSIX_V6_ILP32_OFF32_LIBS: c_int = 1118;
2064pub const _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS: c_int = 1119;
2065pub const _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS: c_int = 1120;
2066pub const _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS: c_int = 1121;
2067pub const _CS_POSIX_V6_ILP32_OFFBIG_LIBS: c_int = 1122;
2068pub const _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS: c_int = 1123;
2069pub const _CS_POSIX_V6_LP64_OFF64_CFLAGS: c_int = 1124;
2070pub const _CS_POSIX_V6_LP64_OFF64_LDFLAGS: c_int = 1125;
2071pub const _CS_POSIX_V6_LP64_OFF64_LIBS: c_int = 1126;
2072pub const _CS_POSIX_V6_LP64_OFF64_LINTFLAGS: c_int = 1127;
2073pub const _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS: c_int = 1128;
2074pub const _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS: c_int = 1129;
2075pub const _CS_POSIX_V6_LPBIG_OFFBIG_LIBS: c_int = 1130;
2076pub const _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS: c_int = 1131;
2077pub const _CS_POSIX_V7_ILP32_OFF32_CFLAGS: c_int = 1132;
2078pub const _CS_POSIX_V7_ILP32_OFF32_LDFLAGS: c_int = 1133;
2079pub const _CS_POSIX_V7_ILP32_OFF32_LIBS: c_int = 1134;
2080pub const _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS: c_int = 1135;
2081pub const _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS: c_int = 1136;
2082pub const _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS: c_int = 1137;
2083pub const _CS_POSIX_V7_ILP32_OFFBIG_LIBS: c_int = 1138;
2084pub const _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS: c_int = 1139;
2085pub const _CS_POSIX_V7_LP64_OFF64_CFLAGS: c_int = 1140;
2086pub const _CS_POSIX_V7_LP64_OFF64_LDFLAGS: c_int = 1141;
2087pub const _CS_POSIX_V7_LP64_OFF64_LIBS: c_int = 1142;
2088pub const _CS_POSIX_V7_LP64_OFF64_LINTFLAGS: c_int = 1143;
2089pub const _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS: c_int = 1144;
2090pub const _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS: c_int = 1145;
2091pub const _CS_POSIX_V7_LPBIG_OFFBIG_LIBS: c_int = 1146;
2092pub const _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS: c_int = 1147;
2093
2094pub const RLIM_SAVED_MAX: crate::rlim_t = RLIM_INFINITY;
2095pub const RLIM_SAVED_CUR: crate::rlim_t = RLIM_INFINITY;
2096
2097pub const EI_NIDENT: usize = 16;
2099
2100pub const EI_MAG0: usize = 0;
2101pub const ELFMAG0: u8 = 0x7f;
2102pub const EI_MAG1: usize = 1;
2103pub const ELFMAG1: u8 = b'E';
2104pub const EI_MAG2: usize = 2;
2105pub const ELFMAG2: u8 = b'L';
2106pub const EI_MAG3: usize = 3;
2107pub const ELFMAG3: u8 = b'F';
2108pub const SELFMAG: usize = 4;
2109
2110pub const EI_CLASS: usize = 4;
2111pub const ELFCLASSNONE: u8 = 0;
2112pub const ELFCLASS32: u8 = 1;
2113pub const ELFCLASS64: u8 = 2;
2114pub const ELFCLASSNUM: usize = 3;
2115
2116pub const EI_DATA: usize = 5;
2117pub const ELFDATANONE: u8 = 0;
2118pub const ELFDATA2LSB: u8 = 1;
2119pub const ELFDATA2MSB: u8 = 2;
2120pub const ELFDATANUM: usize = 3;
2121
2122pub const EI_VERSION: usize = 6;
2123
2124pub const EI_OSABI: usize = 7;
2125pub const ELFOSABI_NONE: u8 = 0;
2126pub const ELFOSABI_SYSV: u8 = 0;
2127pub const ELFOSABI_HPUX: u8 = 1;
2128pub const ELFOSABI_NETBSD: u8 = 2;
2129pub const ELFOSABI_GNU: u8 = 3;
2130pub const ELFOSABI_LINUX: u8 = ELFOSABI_GNU;
2131pub const ELFOSABI_SOLARIS: u8 = 6;
2132pub const ELFOSABI_AIX: u8 = 7;
2133pub const ELFOSABI_IRIX: u8 = 8;
2134pub const ELFOSABI_FREEBSD: u8 = 9;
2135pub const ELFOSABI_TRU64: u8 = 10;
2136pub const ELFOSABI_MODESTO: u8 = 11;
2137pub const ELFOSABI_OPENBSD: u8 = 12;
2138pub const ELFOSABI_ARM: u8 = 97;
2139pub const ELFOSABI_STANDALONE: u8 = 255;
2140
2141pub const EI_ABIVERSION: usize = 8;
2142
2143pub const EI_PAD: usize = 9;
2144
2145pub const ET_NONE: u16 = 0;
2147pub const ET_REL: u16 = 1;
2148pub const ET_EXEC: u16 = 2;
2149pub const ET_DYN: u16 = 3;
2150pub const ET_CORE: u16 = 4;
2151pub const ET_NUM: u16 = 5;
2152pub const ET_LOOS: u16 = 0xfe00;
2153pub const ET_HIOS: u16 = 0xfeff;
2154pub const ET_LOPROC: u16 = 0xff00;
2155pub const ET_HIPROC: u16 = 0xffff;
2156
2157pub const EM_NONE: u16 = 0;
2159pub const EM_M32: u16 = 1;
2160pub const EM_SPARC: u16 = 2;
2161pub const EM_386: u16 = 3;
2162pub const EM_68K: u16 = 4;
2163pub const EM_88K: u16 = 5;
2164pub const EM_860: u16 = 7;
2165pub const EM_MIPS: u16 = 8;
2166pub const EM_S370: u16 = 9;
2167pub const EM_MIPS_RS3_LE: u16 = 10;
2168pub const EM_PARISC: u16 = 15;
2169pub const EM_VPP500: u16 = 17;
2170pub const EM_SPARC32PLUS: u16 = 18;
2171pub const EM_960: u16 = 19;
2172pub const EM_PPC: u16 = 20;
2173pub const EM_PPC64: u16 = 21;
2174pub const EM_S390: u16 = 22;
2175pub const EM_V800: u16 = 36;
2176pub const EM_FR20: u16 = 37;
2177pub const EM_RH32: u16 = 38;
2178pub const EM_RCE: u16 = 39;
2179pub const EM_ARM: u16 = 40;
2180pub const EM_FAKE_ALPHA: u16 = 41;
2181pub const EM_SH: u16 = 42;
2182pub const EM_SPARCV9: u16 = 43;
2183pub const EM_TRICORE: u16 = 44;
2184pub const EM_ARC: u16 = 45;
2185pub const EM_H8_300: u16 = 46;
2186pub const EM_H8_300H: u16 = 47;
2187pub const EM_H8S: u16 = 48;
2188pub const EM_H8_500: u16 = 49;
2189pub const EM_IA_64: u16 = 50;
2190pub const EM_MIPS_X: u16 = 51;
2191pub const EM_COLDFIRE: u16 = 52;
2192pub const EM_68HC12: u16 = 53;
2193pub const EM_MMA: u16 = 54;
2194pub const EM_PCP: u16 = 55;
2195pub const EM_NCPU: u16 = 56;
2196pub const EM_NDR1: u16 = 57;
2197pub const EM_STARCORE: u16 = 58;
2198pub const EM_ME16: u16 = 59;
2199pub const EM_ST100: u16 = 60;
2200pub const EM_TINYJ: u16 = 61;
2201pub const EM_X86_64: u16 = 62;
2202pub const EM_PDSP: u16 = 63;
2203pub const EM_FX66: u16 = 66;
2204pub const EM_ST9PLUS: u16 = 67;
2205pub const EM_ST7: u16 = 68;
2206pub const EM_68HC16: u16 = 69;
2207pub const EM_68HC11: u16 = 70;
2208pub const EM_68HC08: u16 = 71;
2209pub const EM_68HC05: u16 = 72;
2210pub const EM_SVX: u16 = 73;
2211pub const EM_ST19: u16 = 74;
2212pub const EM_VAX: u16 = 75;
2213pub const EM_CRIS: u16 = 76;
2214pub const EM_JAVELIN: u16 = 77;
2215pub const EM_FIREPATH: u16 = 78;
2216pub const EM_ZSP: u16 = 79;
2217pub const EM_MMIX: u16 = 80;
2218pub const EM_HUANY: u16 = 81;
2219pub const EM_PRISM: u16 = 82;
2220pub const EM_AVR: u16 = 83;
2221pub const EM_FR30: u16 = 84;
2222pub const EM_D10V: u16 = 85;
2223pub const EM_D30V: u16 = 86;
2224pub const EM_V850: u16 = 87;
2225pub const EM_M32R: u16 = 88;
2226pub const EM_MN10300: u16 = 89;
2227pub const EM_MN10200: u16 = 90;
2228pub const EM_PJ: u16 = 91;
2229pub const EM_OPENRISC: u16 = 92;
2230pub const EM_ARC_A5: u16 = 93;
2231pub const EM_XTENSA: u16 = 94;
2232pub const EM_AARCH64: u16 = 183;
2233pub const EM_TILEPRO: u16 = 188;
2234pub const EM_TILEGX: u16 = 191;
2235pub const EM_RISCV: u16 = 243;
2236pub const EM_ALPHA: u16 = 0x9026;
2237
2238pub const EV_NONE: u32 = 0;
2240pub const EV_CURRENT: u32 = 1;
2241pub const EV_NUM: u32 = 2;
2242
2243pub const PT_NULL: u32 = 0;
2245pub const PT_LOAD: u32 = 1;
2246pub const PT_DYNAMIC: u32 = 2;
2247pub const PT_INTERP: u32 = 3;
2248pub const PT_NOTE: u32 = 4;
2249pub const PT_SHLIB: u32 = 5;
2250pub const PT_PHDR: u32 = 6;
2251pub const PT_TLS: u32 = 7;
2252pub const PT_NUM: u32 = 8;
2253pub const PT_LOOS: u32 = 0x60000000;
2254pub const PT_GNU_EH_FRAME: u32 = 0x6474e550;
2255pub const PT_GNU_STACK: u32 = 0x6474e551;
2256pub const PT_GNU_RELRO: u32 = 0x6474e552;
2257pub const PT_LOSUNW: u32 = 0x6ffffffa;
2258pub const PT_SUNWBSS: u32 = 0x6ffffffa;
2259pub const PT_SUNWSTACK: u32 = 0x6ffffffb;
2260pub const PT_HISUNW: u32 = 0x6fffffff;
2261pub const PT_HIOS: u32 = 0x6fffffff;
2262pub const PT_LOPROC: u32 = 0x70000000;
2263pub const PT_HIPROC: u32 = 0x7fffffff;
2264
2265pub const PF_X: u32 = 1 << 0;
2267pub const PF_W: u32 = 1 << 1;
2268pub const PF_R: u32 = 1 << 2;
2269pub const PF_MASKOS: u32 = 0x0ff00000;
2270pub const PF_MASKPROC: u32 = 0xf0000000;
2271
2272pub const AT_NULL: c_ulong = 0;
2274pub const AT_IGNORE: c_ulong = 1;
2275pub const AT_EXECFD: c_ulong = 2;
2276pub const AT_PHDR: c_ulong = 3;
2277pub const AT_PHENT: c_ulong = 4;
2278pub const AT_PHNUM: c_ulong = 5;
2279pub const AT_PAGESZ: c_ulong = 6;
2280pub const AT_BASE: c_ulong = 7;
2281pub const AT_FLAGS: c_ulong = 8;
2282pub const AT_ENTRY: c_ulong = 9;
2283pub const AT_NOTELF: c_ulong = 10;
2284pub const AT_UID: c_ulong = 11;
2285pub const AT_EUID: c_ulong = 12;
2286pub const AT_GID: c_ulong = 13;
2287pub const AT_EGID: c_ulong = 14;
2288pub const AT_PLATFORM: c_ulong = 15;
2289pub const AT_HWCAP: c_ulong = 16;
2290pub const AT_CLKTCK: c_ulong = 17;
2291
2292pub const AT_SECURE: c_ulong = 23;
2293pub const AT_BASE_PLATFORM: c_ulong = 24;
2294pub const AT_RANDOM: c_ulong = 25;
2295pub const AT_HWCAP2: c_ulong = 26;
2296
2297pub const AT_HWCAP3: c_ulong = 29;
2298pub const AT_HWCAP4: c_ulong = 30;
2299pub const AT_EXECFN: c_ulong = 31;
2300
2301pub const AT_SYSINFO_EHDR: c_ulong = 33;
2304pub const AT_MINSIGSTKSZ: c_ulong = 51;
2305
2306pub const GLOB_ERR: c_int = 1 << 0;
2307pub const GLOB_MARK: c_int = 1 << 1;
2308pub const GLOB_NOSORT: c_int = 1 << 2;
2309pub const GLOB_DOOFFS: c_int = 1 << 3;
2310pub const GLOB_NOCHECK: c_int = 1 << 4;
2311pub const GLOB_APPEND: c_int = 1 << 5;
2312pub const GLOB_NOESCAPE: c_int = 1 << 6;
2313
2314pub const GLOB_NOSPACE: c_int = 1;
2315pub const GLOB_ABORTED: c_int = 2;
2316pub const GLOB_NOMATCH: c_int = 3;
2317
2318pub const POSIX_MADV_NORMAL: c_int = 0;
2319pub const POSIX_MADV_RANDOM: c_int = 1;
2320pub const POSIX_MADV_SEQUENTIAL: c_int = 2;
2321pub const POSIX_MADV_WILLNEED: c_int = 3;
2322pub const POSIX_SPAWN_USEVFORK: c_int = 64;
2323pub const POSIX_SPAWN_SETSID: c_int = 128;
2324
2325pub const S_IEXEC: mode_t = 0o0100;
2326pub const S_IWRITE: mode_t = 0o0200;
2327pub const S_IREAD: mode_t = 0o0400;
2328
2329pub const F_LOCK: c_int = 1;
2330pub const F_TEST: c_int = 3;
2331pub const F_TLOCK: c_int = 2;
2332pub const F_ULOCK: c_int = 0;
2333
2334pub const F_SEAL_FUTURE_WRITE: c_int = 0x0010;
2335pub const F_SEAL_EXEC: c_int = 0x0020;
2336
2337pub const IFF_LOWER_UP: c_int = 0x10000;
2338pub const IFF_DORMANT: c_int = 0x20000;
2339pub const IFF_ECHO: c_int = 0x40000;
2340
2341pub const IFA_UNSPEC: c_ushort = 0;
2343pub const IFA_ADDRESS: c_ushort = 1;
2344pub const IFA_LOCAL: c_ushort = 2;
2345pub const IFA_LABEL: c_ushort = 3;
2346pub const IFA_BROADCAST: c_ushort = 4;
2347pub const IFA_ANYCAST: c_ushort = 5;
2348pub const IFA_CACHEINFO: c_ushort = 6;
2349pub const IFA_MULTICAST: c_ushort = 7;
2350pub const IFA_FLAGS: c_ushort = 8;
2351
2352pub const IFA_F_SECONDARY: u32 = 0x01;
2353pub const IFA_F_TEMPORARY: u32 = 0x01;
2354pub const IFA_F_NODAD: u32 = 0x02;
2355pub const IFA_F_OPTIMISTIC: u32 = 0x04;
2356pub const IFA_F_DADFAILED: u32 = 0x08;
2357pub const IFA_F_HOMEADDRESS: u32 = 0x10;
2358pub const IFA_F_DEPRECATED: u32 = 0x20;
2359pub const IFA_F_TENTATIVE: u32 = 0x40;
2360pub const IFA_F_PERMANENT: u32 = 0x80;
2361pub const IFA_F_MANAGETEMPADDR: u32 = 0x100;
2362pub const IFA_F_NOPREFIXROUTE: u32 = 0x200;
2363pub const IFA_F_MCAUTOJOIN: u32 = 0x400;
2364pub const IFA_F_STABLE_PRIVACY: u32 = 0x800;
2365
2366pub const RWF_HIPRI: c_int = 0x00000001;
2370pub const RWF_DSYNC: c_int = 0x00000002;
2371pub const RWF_SYNC: c_int = 0x00000004;
2372pub const RWF_NOWAIT: c_int = 0x00000008;
2373pub const RWF_APPEND: c_int = 0x00000010;
2374pub const RWF_NOAPPEND: c_int = 0x00000020;
2375pub const RWF_ATOMIC: c_int = 0x00000040;
2376pub const RWF_DONTCACHE: c_int = 0x00000080;
2377
2378pub const IFLA_UNSPEC: c_ushort = 0;
2380pub const IFLA_ADDRESS: c_ushort = 1;
2381pub const IFLA_BROADCAST: c_ushort = 2;
2382pub const IFLA_IFNAME: c_ushort = 3;
2383pub const IFLA_MTU: c_ushort = 4;
2384pub const IFLA_LINK: c_ushort = 5;
2385pub const IFLA_QDISC: c_ushort = 6;
2386pub const IFLA_STATS: c_ushort = 7;
2387pub const IFLA_COST: c_ushort = 8;
2388pub const IFLA_PRIORITY: c_ushort = 9;
2389pub const IFLA_MASTER: c_ushort = 10;
2390pub const IFLA_WIRELESS: c_ushort = 11;
2391pub const IFLA_PROTINFO: c_ushort = 12;
2392pub const IFLA_TXQLEN: c_ushort = 13;
2393pub const IFLA_MAP: c_ushort = 14;
2394pub const IFLA_WEIGHT: c_ushort = 15;
2395pub const IFLA_OPERSTATE: c_ushort = 16;
2396pub const IFLA_LINKMODE: c_ushort = 17;
2397pub const IFLA_LINKINFO: c_ushort = 18;
2398pub const IFLA_NET_NS_PID: c_ushort = 19;
2399pub const IFLA_IFALIAS: c_ushort = 20;
2400pub const IFLA_NUM_VF: c_ushort = 21;
2401pub const IFLA_VFINFO_LIST: c_ushort = 22;
2402pub const IFLA_STATS64: c_ushort = 23;
2403pub const IFLA_VF_PORTS: c_ushort = 24;
2404pub const IFLA_PORT_SELF: c_ushort = 25;
2405pub const IFLA_AF_SPEC: c_ushort = 26;
2406pub const IFLA_GROUP: c_ushort = 27;
2407pub const IFLA_NET_NS_FD: c_ushort = 28;
2408pub const IFLA_EXT_MASK: c_ushort = 29;
2409pub const IFLA_PROMISCUITY: c_ushort = 30;
2410pub const IFLA_NUM_TX_QUEUES: c_ushort = 31;
2411pub const IFLA_NUM_RX_QUEUES: c_ushort = 32;
2412pub const IFLA_CARRIER: c_ushort = 33;
2413pub const IFLA_PHYS_PORT_ID: c_ushort = 34;
2414pub const IFLA_CARRIER_CHANGES: c_ushort = 35;
2415pub const IFLA_PHYS_SWITCH_ID: c_ushort = 36;
2416pub const IFLA_LINK_NETNSID: c_ushort = 37;
2417pub const IFLA_PHYS_PORT_NAME: c_ushort = 38;
2418pub const IFLA_PROTO_DOWN: c_ushort = 39;
2419pub const IFLA_GSO_MAX_SEGS: c_ushort = 40;
2420pub const IFLA_GSO_MAX_SIZE: c_ushort = 41;
2421pub const IFLA_PAD: c_ushort = 42;
2422pub const IFLA_XDP: c_ushort = 43;
2423pub const IFLA_EVENT: c_ushort = 44;
2424pub const IFLA_NEW_NETNSID: c_ushort = 45;
2425pub const IFLA_IF_NETNSID: c_ushort = 46;
2426pub const IFLA_TARGET_NETNSID: c_ushort = IFLA_IF_NETNSID;
2427pub const IFLA_CARRIER_UP_COUNT: c_ushort = 47;
2428pub const IFLA_CARRIER_DOWN_COUNT: c_ushort = 48;
2429pub const IFLA_NEW_IFINDEX: c_ushort = 49;
2430pub const IFLA_MIN_MTU: c_ushort = 50;
2431pub const IFLA_MAX_MTU: c_ushort = 51;
2432pub const IFLA_PROP_LIST: c_ushort = 52;
2433pub const IFLA_ALT_IFNAME: c_ushort = 53;
2434pub const IFLA_PERM_ADDRESS: c_ushort = 54;
2435pub const IFLA_PROTO_DOWN_REASON: c_ushort = 55;
2436pub const IFLA_PARENT_DEV_NAME: c_ushort = 56;
2437pub const IFLA_PARENT_DEV_BUS_NAME: c_ushort = 57;
2438pub const IFLA_GRO_MAX_SIZE: c_ushort = 58;
2439pub const IFLA_TSO_MAX_SIZE: c_ushort = 59;
2440pub const IFLA_TSO_MAX_SEGS: c_ushort = 60;
2441pub const IFLA_ALLMULTI: c_ushort = 61;
2442
2443pub const IFLA_INFO_UNSPEC: c_ushort = 0;
2444pub const IFLA_INFO_KIND: c_ushort = 1;
2445pub const IFLA_INFO_DATA: c_ushort = 2;
2446pub const IFLA_INFO_XSTATS: c_ushort = 3;
2447pub const IFLA_INFO_SLAVE_KIND: c_ushort = 4;
2448pub const IFLA_INFO_SLAVE_DATA: c_ushort = 5;
2449
2450pub const SEEK_DATA: c_int = 3;
2452pub const SEEK_HOLE: c_int = 4;
2453
2454pub const ST_RDONLY: c_ulong = 1;
2455pub const ST_NOSUID: c_ulong = 2;
2456pub const ST_NODEV: c_ulong = 4;
2457pub const ST_NOEXEC: c_ulong = 8;
2458pub const ST_SYNCHRONOUS: c_ulong = 16;
2459pub const ST_MANDLOCK: c_ulong = 64;
2460pub const ST_WRITE: c_ulong = 128;
2461pub const ST_APPEND: c_ulong = 256;
2462pub const ST_IMMUTABLE: c_ulong = 512;
2463pub const ST_NOATIME: c_ulong = 1024;
2464pub const ST_NODIRATIME: c_ulong = 2048;
2465
2466pub const RTLD_NEXT: *mut c_void = -1i64 as *mut c_void;
2467pub const RTLD_DEFAULT: *mut c_void = ptr::null_mut();
2468pub const RTLD_NODELETE: c_int = 0x1000;
2469pub const RTLD_NOW: c_int = 0x2;
2470
2471pub const AT_EACCESS: c_int = 0x200;
2472
2473pub const MPOL_DEFAULT: c_int = 0;
2475pub const MPOL_PREFERRED: c_int = 1;
2476pub const MPOL_BIND: c_int = 2;
2477pub const MPOL_INTERLEAVE: c_int = 3;
2478pub const MPOL_LOCAL: c_int = 4;
2479pub const MPOL_F_NUMA_BALANCING: c_int = 1 << 13;
2480pub const MPOL_F_RELATIVE_NODES: c_int = 1 << 14;
2481pub const MPOL_F_STATIC_NODES: c_int = 1 << 15;
2482
2483pub const MEMBARRIER_CMD_QUERY: c_int = 0;
2485pub const MEMBARRIER_CMD_GLOBAL: c_int = 1 << 0;
2486pub const MEMBARRIER_CMD_GLOBAL_EXPEDITED: c_int = 1 << 1;
2487pub const MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED: c_int = 1 << 2;
2488pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED: c_int = 1 << 3;
2489pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED: c_int = 1 << 4;
2490pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE: c_int = 1 << 5;
2491pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE: c_int = 1 << 6;
2492pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ: c_int = 1 << 7;
2493pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ: c_int = 1 << 8;
2494
2495pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
2496 size: [0; __SIZEOF_PTHREAD_MUTEX_T],
2497};
2498pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
2499 size: [0; __SIZEOF_PTHREAD_COND_T],
2500};
2501pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
2502 size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
2503};
2504
2505pub const PTHREAD_BARRIER_SERIAL_THREAD: c_int = -1;
2506pub const PTHREAD_ONCE_INIT: pthread_once_t = 0;
2507pub const PTHREAD_MUTEX_NORMAL: c_int = 0;
2508pub const PTHREAD_MUTEX_RECURSIVE: c_int = 1;
2509pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 2;
2510pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL;
2511pub const PTHREAD_MUTEX_STALLED: c_int = 0;
2512pub const PTHREAD_MUTEX_ROBUST: c_int = 1;
2513pub const PTHREAD_PRIO_NONE: c_int = 0;
2514pub const PTHREAD_PRIO_INHERIT: c_int = 1;
2515pub const PTHREAD_PRIO_PROTECT: c_int = 2;
2516pub const PTHREAD_PROCESS_PRIVATE: c_int = 0;
2517pub const PTHREAD_PROCESS_SHARED: c_int = 1;
2518pub const PTHREAD_INHERIT_SCHED: c_int = 0;
2519pub const PTHREAD_EXPLICIT_SCHED: c_int = 1;
2520pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
2521
2522pub const RENAME_NOREPLACE: c_uint = 1;
2523pub const RENAME_EXCHANGE: c_uint = 2;
2524pub const RENAME_WHITEOUT: c_uint = 4;
2525
2526#[deprecated(
2530 since = "0.2.80",
2531 note = "This value was increased in the newer kernel \
2532 and we'll change this following upstream in the future release. \
2533 See #1896 for more info."
2534)]
2535pub const IPPROTO_MAX: c_int = 256;
2536
2537pub const IPC_PRIVATE: crate::key_t = 0;
2539
2540pub const IPC_CREAT: c_int = 0o1000;
2541pub const IPC_EXCL: c_int = 0o2000;
2542pub const IPC_NOWAIT: c_int = 0o4000;
2543
2544pub const IPC_RMID: c_int = 0;
2545pub const IPC_SET: c_int = 1;
2546pub const IPC_STAT: c_int = 2;
2547pub const IPC_INFO: c_int = 3;
2548pub const MSG_STAT: c_int = 11;
2549pub const MSG_INFO: c_int = 12;
2550pub const MSG_NOTIFICATION: c_int = 0x8000;
2551
2552pub const MSG_NOERROR: c_int = 0o10000;
2553pub const MSG_EXCEPT: c_int = 0o20000;
2554pub const MSG_ZEROCOPY: c_int = 0x4000000;
2555
2556pub const SEM_UNDO: c_int = 0x1000;
2557
2558pub const GETPID: c_int = 11;
2559pub const GETVAL: c_int = 12;
2560pub const GETALL: c_int = 13;
2561pub const GETNCNT: c_int = 14;
2562pub const GETZCNT: c_int = 15;
2563pub const SETVAL: c_int = 16;
2564pub const SETALL: c_int = 17;
2565pub const SEM_STAT: c_int = 18;
2566pub const SEM_INFO: c_int = 19;
2567pub const SEM_STAT_ANY: c_int = 20;
2568
2569pub const SHM_R: c_int = 0o400;
2570pub const SHM_W: c_int = 0o200;
2571
2572pub const SHM_RDONLY: c_int = 0o10000;
2573pub const SHM_RND: c_int = 0o20000;
2574pub const SHM_REMAP: c_int = 0o40000;
2575
2576pub const SHM_LOCK: c_int = 11;
2577pub const SHM_UNLOCK: c_int = 12;
2578
2579pub const SHM_HUGETLB: c_int = 0o4000;
2580#[cfg(not(all(target_env = "uclibc", target_arch = "mips")))]
2581pub const SHM_NORESERVE: c_int = 0o10000;
2582
2583pub const QFMT_VFS_OLD: c_int = 1;
2584pub const QFMT_VFS_V0: c_int = 2;
2585pub const QFMT_VFS_V1: c_int = 4;
2586
2587pub const EFD_SEMAPHORE: c_int = 0x1;
2588
2589pub const LOG_NFACILITIES: c_int = 24;
2590
2591pub const SEM_FAILED: *mut crate::sem_t = ptr::null_mut();
2592
2593pub const RB_AUTOBOOT: c_int = 0x01234567u32 as i32;
2594pub const RB_HALT_SYSTEM: c_int = 0xcdef0123u32 as i32;
2595pub const RB_ENABLE_CAD: c_int = 0x89abcdefu32 as i32;
2596pub const RB_DISABLE_CAD: c_int = 0x00000000u32 as i32;
2597pub const RB_POWER_OFF: c_int = 0x4321fedcu32 as i32;
2598pub const RB_SW_SUSPEND: c_int = 0xd000fce2u32 as i32;
2599pub const RB_KEXEC: c_int = 0x45584543u32 as i32;
2600
2601pub const AI_PASSIVE: c_int = 0x0001;
2602pub const AI_CANONNAME: c_int = 0x0002;
2603pub const AI_NUMERICHOST: c_int = 0x0004;
2604pub const AI_V4MAPPED: c_int = 0x0008;
2605pub const AI_ALL: c_int = 0x0010;
2606pub const AI_ADDRCONFIG: c_int = 0x0020;
2607
2608pub const AI_NUMERICSERV: c_int = 0x0400;
2609
2610pub const EAI_BADFLAGS: c_int = -1;
2611pub const EAI_NONAME: c_int = -2;
2612pub const EAI_AGAIN: c_int = -3;
2613pub const EAI_FAIL: c_int = -4;
2614pub const EAI_NODATA: c_int = -5;
2615pub const EAI_FAMILY: c_int = -6;
2616pub const EAI_SOCKTYPE: c_int = -7;
2617pub const EAI_SERVICE: c_int = -8;
2618pub const EAI_MEMORY: c_int = -10;
2619pub const EAI_SYSTEM: c_int = -11;
2620pub const EAI_OVERFLOW: c_int = -12;
2621
2622pub const NI_NUMERICHOST: c_int = 1;
2623pub const NI_NUMERICSERV: c_int = 2;
2624pub const NI_NOFQDN: c_int = 4;
2625pub const NI_NAMEREQD: c_int = 8;
2626pub const NI_DGRAM: c_int = 16;
2627pub const NI_IDN: c_int = 32;
2628
2629pub const SYNC_FILE_RANGE_WAIT_BEFORE: c_uint = 1;
2630pub const SYNC_FILE_RANGE_WRITE: c_uint = 2;
2631pub const SYNC_FILE_RANGE_WAIT_AFTER: c_uint = 4;
2632
2633cfg_if! {
2634 if #[cfg(not(target_env = "uclibc"))] {
2635 pub const AIO_CANCELED: c_int = 0;
2636 pub const AIO_NOTCANCELED: c_int = 1;
2637 pub const AIO_ALLDONE: c_int = 2;
2638 pub const LIO_READ: c_int = 0;
2639 pub const LIO_WRITE: c_int = 1;
2640 pub const LIO_NOP: c_int = 2;
2641 pub const LIO_WAIT: c_int = 0;
2642 pub const LIO_NOWAIT: c_int = 1;
2643 pub const RUSAGE_THREAD: c_int = 1;
2644 pub const MSG_COPY: c_int = 0o40000;
2645 pub const SHM_EXEC: c_int = 0o100000;
2646 pub const IPV6_MULTICAST_ALL: c_int = 29;
2647 pub const IPV6_ROUTER_ALERT_ISOLATE: c_int = 30;
2648 pub const PACKET_MR_UNICAST: c_int = 3;
2649 pub const PTRACE_EVENT_STOP: c_int = 128;
2650 pub const UDP_SEGMENT: c_int = 103;
2651 pub const UDP_GRO: c_int = 104;
2652 }
2653}
2654
2655pub const MREMAP_MAYMOVE: c_int = 1;
2656pub const MREMAP_FIXED: c_int = 2;
2657pub const MREMAP_DONTUNMAP: c_int = 4;
2658
2659const NSIO: c_uint = 0xb7;
2661
2662pub const NS_GET_USERNS: Ioctl = _IO(NSIO, 0x1);
2663pub const NS_GET_PARENT: Ioctl = _IO(NSIO, 0x2);
2664pub const NS_GET_NSTYPE: Ioctl = _IO(NSIO, 0x3);
2665pub const NS_GET_OWNER_UID: Ioctl = _IO(NSIO, 0x4);
2666
2667pub const NS_GET_MNTNS_ID: Ioctl = _IOR::<__u64>(NSIO, 0x5);
2668
2669pub const NS_GET_PID_FROM_PIDNS: Ioctl = _IOR::<c_int>(NSIO, 0x6);
2670pub const NS_GET_TGID_FROM_PIDNS: Ioctl = _IOR::<c_int>(NSIO, 0x7);
2671pub const NS_GET_PID_IN_PIDNS: Ioctl = _IOR::<c_int>(NSIO, 0x8);
2672pub const NS_GET_TGID_IN_PIDNS: Ioctl = _IOR::<c_int>(NSIO, 0x9);
2673
2674pub const MNT_NS_INFO_SIZE_VER0: Ioctl = 16;
2675
2676pub const NS_MNT_GET_INFO: Ioctl = _IOR::<mnt_ns_info>(NSIO, 10);
2677pub const NS_MNT_GET_NEXT: Ioctl = _IOR::<mnt_ns_info>(NSIO, 11);
2678pub const NS_MNT_GET_PREV: Ioctl = _IOR::<mnt_ns_info>(NSIO, 12);
2679
2680pub const PIDFD_NONBLOCK: c_uint = O_NONBLOCK as c_uint;
2682pub const PIDFD_THREAD: c_uint = O_EXCL as c_uint;
2683
2684pub const PIDFD_SIGNAL_THREAD: c_uint = 1 << 0;
2685pub const PIDFD_SIGNAL_THREAD_GROUP: c_uint = 1 << 1;
2686pub const PIDFD_SIGNAL_PROCESS_GROUP: c_uint = 1 << 2;
2687
2688pub const PIDFD_INFO_PID: c_uint = 1 << 0;
2689pub const PIDFD_INFO_CREDS: c_uint = 1 << 1;
2690pub const PIDFD_INFO_CGROUPID: c_uint = 1 << 2;
2691pub const PIDFD_INFO_EXIT: c_uint = 1 << 3;
2692
2693pub const PIDFD_INFO_SIZE_VER0: c_uint = 64;
2694
2695const PIDFS_IOCTL_MAGIC: c_uint = 0xFF;
2696pub const PIDFD_GET_CGROUP_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 1);
2697pub const PIDFD_GET_IPC_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 2);
2698pub const PIDFD_GET_MNT_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 3);
2699pub const PIDFD_GET_NET_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 4);
2700pub const PIDFD_GET_PID_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 5);
2701pub const PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 6);
2702pub const PIDFD_GET_TIME_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 7);
2703pub const PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 8);
2704pub const PIDFD_GET_USER_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 9);
2705pub const PIDFD_GET_UTS_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 10);
2706pub const PIDFD_GET_INFO: Ioctl = _IOWR::<pidfd_info>(PIDFS_IOCTL_MAGIC, 11);
2707
2708pub const PR_SET_PDEATHSIG: c_int = 1;
2710pub const PR_GET_PDEATHSIG: c_int = 2;
2711
2712pub const PR_GET_DUMPABLE: c_int = 3;
2713pub const PR_SET_DUMPABLE: c_int = 4;
2714
2715pub const PR_GET_UNALIGN: c_int = 5;
2716pub const PR_SET_UNALIGN: c_int = 6;
2717pub const PR_UNALIGN_NOPRINT: c_int = 1;
2718pub const PR_UNALIGN_SIGBUS: c_int = 2;
2719
2720pub const PR_GET_KEEPCAPS: c_int = 7;
2721pub const PR_SET_KEEPCAPS: c_int = 8;
2722
2723pub const PR_GET_FPEMU: c_int = 9;
2724pub const PR_SET_FPEMU: c_int = 10;
2725pub const PR_FPEMU_NOPRINT: c_int = 1;
2726pub const PR_FPEMU_SIGFPE: c_int = 2;
2727
2728pub const PR_GET_FPEXC: c_int = 11;
2729pub const PR_SET_FPEXC: c_int = 12;
2730pub const PR_FP_EXC_SW_ENABLE: c_int = 0x80;
2731pub const PR_FP_EXC_DIV: c_int = 0x010000;
2732pub const PR_FP_EXC_OVF: c_int = 0x020000;
2733pub const PR_FP_EXC_UND: c_int = 0x040000;
2734pub const PR_FP_EXC_RES: c_int = 0x080000;
2735pub const PR_FP_EXC_INV: c_int = 0x100000;
2736pub const PR_FP_EXC_DISABLED: c_int = 0;
2737pub const PR_FP_EXC_NONRECOV: c_int = 1;
2738pub const PR_FP_EXC_ASYNC: c_int = 2;
2739pub const PR_FP_EXC_PRECISE: c_int = 3;
2740
2741pub const PR_GET_TIMING: c_int = 13;
2742pub const PR_SET_TIMING: c_int = 14;
2743pub const PR_TIMING_STATISTICAL: c_int = 0;
2744pub const PR_TIMING_TIMESTAMP: c_int = 1;
2745
2746pub const PR_SET_NAME: c_int = 15;
2747pub const PR_GET_NAME: c_int = 16;
2748
2749pub const PR_GET_ENDIAN: c_int = 19;
2750pub const PR_SET_ENDIAN: c_int = 20;
2751pub const PR_ENDIAN_BIG: c_int = 0;
2752pub const PR_ENDIAN_LITTLE: c_int = 1;
2753pub const PR_ENDIAN_PPC_LITTLE: c_int = 2;
2754
2755pub const PR_GET_SECCOMP: c_int = 21;
2756pub const PR_SET_SECCOMP: c_int = 22;
2757
2758pub const PR_CAPBSET_READ: c_int = 23;
2759pub const PR_CAPBSET_DROP: c_int = 24;
2760
2761pub const PR_GET_TSC: c_int = 25;
2762pub const PR_SET_TSC: c_int = 26;
2763pub const PR_TSC_ENABLE: c_int = 1;
2764pub const PR_TSC_SIGSEGV: c_int = 2;
2765
2766pub const PR_GET_SECUREBITS: c_int = 27;
2767pub const PR_SET_SECUREBITS: c_int = 28;
2768
2769pub const PR_SET_TIMERSLACK: c_int = 29;
2770pub const PR_GET_TIMERSLACK: c_int = 30;
2771
2772pub const PR_TASK_PERF_EVENTS_DISABLE: c_int = 31;
2773pub const PR_TASK_PERF_EVENTS_ENABLE: c_int = 32;
2774
2775pub const PR_MCE_KILL: c_int = 33;
2776pub const PR_MCE_KILL_CLEAR: c_int = 0;
2777pub const PR_MCE_KILL_SET: c_int = 1;
2778
2779pub const PR_MCE_KILL_LATE: c_int = 0;
2780pub const PR_MCE_KILL_EARLY: c_int = 1;
2781pub const PR_MCE_KILL_DEFAULT: c_int = 2;
2782
2783pub const PR_MCE_KILL_GET: c_int = 34;
2784
2785pub const PR_SET_MM: c_int = 35;
2786pub const PR_SET_MM_START_CODE: c_int = 1;
2787pub const PR_SET_MM_END_CODE: c_int = 2;
2788pub const PR_SET_MM_START_DATA: c_int = 3;
2789pub const PR_SET_MM_END_DATA: c_int = 4;
2790pub const PR_SET_MM_START_STACK: c_int = 5;
2791pub const PR_SET_MM_START_BRK: c_int = 6;
2792pub const PR_SET_MM_BRK: c_int = 7;
2793pub const PR_SET_MM_ARG_START: c_int = 8;
2794pub const PR_SET_MM_ARG_END: c_int = 9;
2795pub const PR_SET_MM_ENV_START: c_int = 10;
2796pub const PR_SET_MM_ENV_END: c_int = 11;
2797pub const PR_SET_MM_AUXV: c_int = 12;
2798pub const PR_SET_MM_EXE_FILE: c_int = 13;
2799pub const PR_SET_MM_MAP: c_int = 14;
2800pub const PR_SET_MM_MAP_SIZE: c_int = 15;
2801
2802pub const PR_SET_PTRACER: c_int = 0x59616d61;
2803pub const PR_SET_PTRACER_ANY: c_ulong = 0xffffffffffffffff;
2804
2805pub const PR_SET_CHILD_SUBREAPER: c_int = 36;
2806pub const PR_GET_CHILD_SUBREAPER: c_int = 37;
2807
2808pub const PR_SET_NO_NEW_PRIVS: c_int = 38;
2809pub const PR_GET_NO_NEW_PRIVS: c_int = 39;
2810
2811pub const PR_SET_MDWE: c_int = 65;
2812pub const PR_GET_MDWE: c_int = 66;
2813pub const PR_MDWE_REFUSE_EXEC_GAIN: c_uint = 1 << 0;
2814pub const PR_MDWE_NO_INHERIT: c_uint = 1 << 1;
2815
2816pub const PR_GET_TID_ADDRESS: c_int = 40;
2817
2818pub const PR_SET_THP_DISABLE: c_int = 41;
2819pub const PR_GET_THP_DISABLE: c_int = 42;
2820
2821pub const PR_MPX_ENABLE_MANAGEMENT: c_int = 43;
2822pub const PR_MPX_DISABLE_MANAGEMENT: c_int = 44;
2823
2824pub const PR_SET_FP_MODE: c_int = 45;
2825pub const PR_GET_FP_MODE: c_int = 46;
2826pub const PR_FP_MODE_FR: c_int = 1 << 0;
2827pub const PR_FP_MODE_FRE: c_int = 1 << 1;
2828
2829pub const PR_CAP_AMBIENT: c_int = 47;
2830pub const PR_CAP_AMBIENT_IS_SET: c_int = 1;
2831pub const PR_CAP_AMBIENT_RAISE: c_int = 2;
2832pub const PR_CAP_AMBIENT_LOWER: c_int = 3;
2833pub const PR_CAP_AMBIENT_CLEAR_ALL: c_int = 4;
2834
2835pub const PR_SET_VMA: c_int = 0x53564d41;
2836pub const PR_SET_VMA_ANON_NAME: c_int = 0;
2837
2838pub const PR_SCHED_CORE: c_int = 62;
2839pub const PR_SCHED_CORE_GET: c_int = 0;
2840pub const PR_SCHED_CORE_CREATE: c_int = 1;
2841pub const PR_SCHED_CORE_SHARE_TO: c_int = 2;
2842pub const PR_SCHED_CORE_SHARE_FROM: c_int = 3;
2843pub const PR_SCHED_CORE_MAX: c_int = 4;
2844pub const PR_SCHED_CORE_SCOPE_THREAD: c_int = 0;
2845pub const PR_SCHED_CORE_SCOPE_THREAD_GROUP: c_int = 1;
2846pub const PR_SCHED_CORE_SCOPE_PROCESS_GROUP: c_int = 2;
2847
2848pub const GRND_NONBLOCK: c_uint = 0x0001;
2849pub const GRND_RANDOM: c_uint = 0x0002;
2850pub const GRND_INSECURE: c_uint = 0x0004;
2851
2852pub const SECCOMP_MODE_DISABLED: c_uint = 0;
2854pub const SECCOMP_MODE_STRICT: c_uint = 1;
2855pub const SECCOMP_MODE_FILTER: c_uint = 2;
2856
2857pub const SECCOMP_SET_MODE_STRICT: c_uint = 0;
2858pub const SECCOMP_SET_MODE_FILTER: c_uint = 1;
2859pub const SECCOMP_GET_ACTION_AVAIL: c_uint = 2;
2860pub const SECCOMP_GET_NOTIF_SIZES: c_uint = 3;
2861
2862pub const SECCOMP_FILTER_FLAG_TSYNC: c_ulong = 1 << 0;
2863pub const SECCOMP_FILTER_FLAG_LOG: c_ulong = 1 << 1;
2864pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: c_ulong = 1 << 2;
2865pub const SECCOMP_FILTER_FLAG_NEW_LISTENER: c_ulong = 1 << 3;
2866pub const SECCOMP_FILTER_FLAG_TSYNC_ESRCH: c_ulong = 1 << 4;
2867pub const SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV: c_ulong = 1 << 5;
2868
2869pub const SECCOMP_RET_KILL_PROCESS: c_uint = 0x80000000;
2870pub const SECCOMP_RET_KILL_THREAD: c_uint = 0x00000000;
2871pub const SECCOMP_RET_KILL: c_uint = SECCOMP_RET_KILL_THREAD;
2872pub const SECCOMP_RET_TRAP: c_uint = 0x00030000;
2873pub const SECCOMP_RET_ERRNO: c_uint = 0x00050000;
2874pub const SECCOMP_RET_USER_NOTIF: c_uint = 0x7fc00000;
2875pub const SECCOMP_RET_TRACE: c_uint = 0x7ff00000;
2876pub const SECCOMP_RET_LOG: c_uint = 0x7ffc0000;
2877pub const SECCOMP_RET_ALLOW: c_uint = 0x7fff0000;
2878
2879pub const SECCOMP_RET_ACTION_FULL: c_uint = 0xffff0000;
2880pub const SECCOMP_RET_ACTION: c_uint = 0x7fff0000;
2881pub const SECCOMP_RET_DATA: c_uint = 0x0000ffff;
2882
2883pub const SECCOMP_USER_NOTIF_FLAG_CONTINUE: c_ulong = 1;
2884
2885pub const SECCOMP_ADDFD_FLAG_SETFD: c_ulong = 1;
2886pub const SECCOMP_ADDFD_FLAG_SEND: c_ulong = 2;
2887
2888pub const ITIMER_REAL: c_int = 0;
2889pub const ITIMER_VIRTUAL: c_int = 1;
2890pub const ITIMER_PROF: c_int = 2;
2891
2892pub const TFD_CLOEXEC: c_int = O_CLOEXEC;
2893pub const TFD_NONBLOCK: c_int = O_NONBLOCK;
2894pub const TFD_TIMER_ABSTIME: c_int = 1;
2895pub const TFD_TIMER_CANCEL_ON_SET: c_int = 2;
2896
2897pub const _POSIX_VDISABLE: crate::cc_t = 0;
2898
2899pub const FALLOC_FL_KEEP_SIZE: c_int = 0x01;
2900pub const FALLOC_FL_PUNCH_HOLE: c_int = 0x02;
2901pub const FALLOC_FL_COLLAPSE_RANGE: c_int = 0x08;
2902pub const FALLOC_FL_ZERO_RANGE: c_int = 0x10;
2903pub const FALLOC_FL_INSERT_RANGE: c_int = 0x20;
2904pub const FALLOC_FL_UNSHARE_RANGE: c_int = 0x40;
2905
2906#[deprecated(
2907 since = "0.2.55",
2908 note = "ENOATTR is not available on Linux; use ENODATA instead"
2909)]
2910pub const ENOATTR: c_int = crate::ENODATA;
2911
2912pub const SO_ORIGINAL_DST: c_int = 80;
2913
2914pub const IP_RECVFRAGSIZE: c_int = 25;
2915
2916pub const IPV6_FLOWINFO: c_int = 11;
2917pub const IPV6_FLOWLABEL_MGR: c_int = 32;
2918pub const IPV6_FLOWINFO_SEND: c_int = 33;
2919pub const IPV6_RECVFRAGSIZE: c_int = 77;
2920pub const IPV6_FREEBIND: c_int = 78;
2921pub const IPV6_FLOWINFO_FLOWLABEL: c_int = 0x000fffff;
2922pub const IPV6_FLOWINFO_PRIORITY: c_int = 0x0ff00000;
2923
2924pub const IPV6_RTHDR_LOOSE: c_int = 0;
2925pub const IPV6_RTHDR_STRICT: c_int = 1;
2926
2927pub const SK_MEMINFO_RMEM_ALLOC: c_int = 0;
2929pub const SK_MEMINFO_RCVBUF: c_int = 1;
2930pub const SK_MEMINFO_WMEM_ALLOC: c_int = 2;
2931pub const SK_MEMINFO_SNDBUF: c_int = 3;
2932pub const SK_MEMINFO_FWD_ALLOC: c_int = 4;
2933pub const SK_MEMINFO_WMEM_QUEUED: c_int = 5;
2934pub const SK_MEMINFO_OPTMEM: c_int = 6;
2935pub const SK_MEMINFO_BACKLOG: c_int = 7;
2936pub const SK_MEMINFO_DROPS: c_int = 8;
2937
2938pub const IUTF8: crate::tcflag_t = 0x00004000;
2939#[cfg(not(all(target_env = "uclibc", target_arch = "mips")))]
2940pub const CMSPAR: crate::tcflag_t = 0o10000000000;
2941
2942pub const MFD_CLOEXEC: c_uint = 0x0001;
2943pub const MFD_ALLOW_SEALING: c_uint = 0x0002;
2944pub const MFD_HUGETLB: c_uint = 0x0004;
2945pub const MFD_NOEXEC_SEAL: c_uint = 0x0008;
2946pub const MFD_EXEC: c_uint = 0x0010;
2947pub const MFD_HUGE_64KB: c_uint = 0x40000000;
2948pub const MFD_HUGE_512KB: c_uint = 0x4c000000;
2949pub const MFD_HUGE_1MB: c_uint = 0x50000000;
2950pub const MFD_HUGE_2MB: c_uint = 0x54000000;
2951pub const MFD_HUGE_8MB: c_uint = 0x5c000000;
2952pub const MFD_HUGE_16MB: c_uint = 0x60000000;
2953pub const MFD_HUGE_32MB: c_uint = 0x64000000;
2954pub const MFD_HUGE_256MB: c_uint = 0x70000000;
2955pub const MFD_HUGE_512MB: c_uint = 0x74000000;
2956pub const MFD_HUGE_1GB: c_uint = 0x78000000;
2957pub const MFD_HUGE_2GB: c_uint = 0x7c000000;
2958pub const MFD_HUGE_16GB: c_uint = 0x88000000;
2959pub const MFD_HUGE_MASK: c_uint = 63;
2960pub const MFD_HUGE_SHIFT: c_uint = 26;
2961
2962pub const CLOSE_RANGE_UNSHARE: c_uint = 1 << 1;
2964pub const CLOSE_RANGE_CLOEXEC: c_uint = 1 << 2;
2965
2966pub const SKF_AD_OFF: c_int = -0x1000;
2968pub const SKF_AD_PROTOCOL: c_int = 0;
2969pub const SKF_AD_PKTTYPE: c_int = 4;
2970pub const SKF_AD_IFINDEX: c_int = 8;
2971pub const SKF_AD_NLATTR: c_int = 12;
2972pub const SKF_AD_NLATTR_NEST: c_int = 16;
2973pub const SKF_AD_MARK: c_int = 20;
2974pub const SKF_AD_QUEUE: c_int = 24;
2975pub const SKF_AD_HATYPE: c_int = 28;
2976pub const SKF_AD_RXHASH: c_int = 32;
2977pub const SKF_AD_CPU: c_int = 36;
2978pub const SKF_AD_ALU_XOR_X: c_int = 40;
2979pub const SKF_AD_VLAN_TAG: c_int = 44;
2980pub const SKF_AD_VLAN_TAG_PRESENT: c_int = 48;
2981pub const SKF_AD_PAY_OFFSET: c_int = 52;
2982pub const SKF_AD_RANDOM: c_int = 56;
2983pub const SKF_AD_VLAN_TPID: c_int = 60;
2984pub const SKF_AD_MAX: c_int = 64;
2985pub const SKF_NET_OFF: c_int = -0x100000;
2986pub const SKF_LL_OFF: c_int = -0x200000;
2987pub const BPF_NET_OFF: c_int = SKF_NET_OFF;
2988pub const BPF_LL_OFF: c_int = SKF_LL_OFF;
2989pub const BPF_MEMWORDS: c_int = 16;
2990pub const BPF_MAXINSNS: c_int = 4096;
2991
2992pub const BPF_LD: __u32 = 0x00;
2994pub const BPF_LDX: __u32 = 0x01;
2995pub const BPF_ST: __u32 = 0x02;
2996pub const BPF_STX: __u32 = 0x03;
2997pub const BPF_ALU: __u32 = 0x04;
2998pub const BPF_JMP: __u32 = 0x05;
2999pub const BPF_RET: __u32 = 0x06;
3000pub const BPF_MISC: __u32 = 0x07;
3001pub const BPF_W: __u32 = 0x00;
3002pub const BPF_H: __u32 = 0x08;
3003pub const BPF_B: __u32 = 0x10;
3004pub const BPF_IMM: __u32 = 0x00;
3005pub const BPF_ABS: __u32 = 0x20;
3006pub const BPF_IND: __u32 = 0x40;
3007pub const BPF_MEM: __u32 = 0x60;
3008pub const BPF_LEN: __u32 = 0x80;
3009pub const BPF_MSH: __u32 = 0xa0;
3010pub const BPF_ADD: __u32 = 0x00;
3011pub const BPF_SUB: __u32 = 0x10;
3012pub const BPF_MUL: __u32 = 0x20;
3013pub const BPF_DIV: __u32 = 0x30;
3014pub const BPF_OR: __u32 = 0x40;
3015pub const BPF_AND: __u32 = 0x50;
3016pub const BPF_LSH: __u32 = 0x60;
3017pub const BPF_RSH: __u32 = 0x70;
3018pub const BPF_NEG: __u32 = 0x80;
3019pub const BPF_MOD: __u32 = 0x90;
3020pub const BPF_XOR: __u32 = 0xa0;
3021pub const BPF_JA: __u32 = 0x00;
3022pub const BPF_JEQ: __u32 = 0x10;
3023pub const BPF_JGT: __u32 = 0x20;
3024pub const BPF_JGE: __u32 = 0x30;
3025pub const BPF_JSET: __u32 = 0x40;
3026pub const BPF_K: __u32 = 0x00;
3027pub const BPF_X: __u32 = 0x08;
3028
3029pub const BPF_A: __u32 = 0x10;
3032pub const BPF_TAX: __u32 = 0x00;
3033pub const BPF_TXA: __u32 = 0x80;
3034
3035pub const RESOLVE_NO_XDEV: crate::__u64 = 0x01;
3037pub const RESOLVE_NO_MAGICLINKS: crate::__u64 = 0x02;
3038pub const RESOLVE_NO_SYMLINKS: crate::__u64 = 0x04;
3039pub const RESOLVE_BENEATH: crate::__u64 = 0x08;
3040pub const RESOLVE_IN_ROOT: crate::__u64 = 0x10;
3041pub const RESOLVE_CACHED: crate::__u64 = 0x20;
3042
3043pub const ETH_ALEN: c_int = 6;
3045pub const ETH_HLEN: c_int = 14;
3046pub const ETH_ZLEN: c_int = 60;
3047pub const ETH_DATA_LEN: c_int = 1500;
3048pub const ETH_FRAME_LEN: c_int = 1514;
3049pub const ETH_FCS_LEN: c_int = 4;
3050
3051pub const ETH_P_LOOP: c_int = 0x0060;
3053pub const ETH_P_PUP: c_int = 0x0200;
3054pub const ETH_P_PUPAT: c_int = 0x0201;
3055pub const ETH_P_IP: c_int = 0x0800;
3056pub const ETH_P_X25: c_int = 0x0805;
3057pub const ETH_P_ARP: c_int = 0x0806;
3058pub const ETH_P_BPQ: c_int = 0x08FF;
3059pub const ETH_P_IEEEPUP: c_int = 0x0a00;
3060pub const ETH_P_IEEEPUPAT: c_int = 0x0a01;
3061pub const ETH_P_BATMAN: c_int = 0x4305;
3062pub const ETH_P_DEC: c_int = 0x6000;
3063pub const ETH_P_DNA_DL: c_int = 0x6001;
3064pub const ETH_P_DNA_RC: c_int = 0x6002;
3065pub const ETH_P_DNA_RT: c_int = 0x6003;
3066pub const ETH_P_LAT: c_int = 0x6004;
3067pub const ETH_P_DIAG: c_int = 0x6005;
3068pub const ETH_P_CUST: c_int = 0x6006;
3069pub const ETH_P_SCA: c_int = 0x6007;
3070pub const ETH_P_TEB: c_int = 0x6558;
3071pub const ETH_P_RARP: c_int = 0x8035;
3072pub const ETH_P_ATALK: c_int = 0x809B;
3073pub const ETH_P_AARP: c_int = 0x80F3;
3074pub const ETH_P_8021Q: c_int = 0x8100;
3075pub const ETH_P_IPX: c_int = 0x8137;
3076pub const ETH_P_IPV6: c_int = 0x86DD;
3077pub const ETH_P_PAUSE: c_int = 0x8808;
3078pub const ETH_P_SLOW: c_int = 0x8809;
3079pub const ETH_P_WCCP: c_int = 0x883E;
3080pub const ETH_P_MPLS_UC: c_int = 0x8847;
3081pub const ETH_P_MPLS_MC: c_int = 0x8848;
3082pub const ETH_P_ATMMPOA: c_int = 0x884c;
3083pub const ETH_P_PPP_DISC: c_int = 0x8863;
3084pub const ETH_P_PPP_SES: c_int = 0x8864;
3085pub const ETH_P_LINK_CTL: c_int = 0x886c;
3086pub const ETH_P_ATMFATE: c_int = 0x8884;
3087pub const ETH_P_PAE: c_int = 0x888E;
3088pub const ETH_P_AOE: c_int = 0x88A2;
3089pub const ETH_P_8021AD: c_int = 0x88A8;
3090pub const ETH_P_802_EX1: c_int = 0x88B5;
3091pub const ETH_P_TIPC: c_int = 0x88CA;
3092pub const ETH_P_MACSEC: c_int = 0x88E5;
3093pub const ETH_P_8021AH: c_int = 0x88E7;
3094pub const ETH_P_MVRP: c_int = 0x88F5;
3095pub const ETH_P_1588: c_int = 0x88F7;
3096pub const ETH_P_PRP: c_int = 0x88FB;
3097pub const ETH_P_FCOE: c_int = 0x8906;
3098pub const ETH_P_TDLS: c_int = 0x890D;
3099pub const ETH_P_FIP: c_int = 0x8914;
3100pub const ETH_P_80221: c_int = 0x8917;
3101pub const ETH_P_LOOPBACK: c_int = 0x9000;
3102pub const ETH_P_QINQ1: c_int = 0x9100;
3103pub const ETH_P_QINQ2: c_int = 0x9200;
3104pub const ETH_P_QINQ3: c_int = 0x9300;
3105pub const ETH_P_EDSA: c_int = 0xDADA;
3106pub const ETH_P_AF_IUCV: c_int = 0xFBFB;
3107
3108pub const ETH_P_802_3_MIN: c_int = 0x0600;
3109
3110pub const ETH_P_802_3: c_int = 0x0001;
3112pub const ETH_P_AX25: c_int = 0x0002;
3113pub const ETH_P_ALL: c_int = 0x0003;
3114pub const ETH_P_802_2: c_int = 0x0004;
3115pub const ETH_P_SNAP: c_int = 0x0005;
3116pub const ETH_P_DDCMP: c_int = 0x0006;
3117pub const ETH_P_WAN_PPP: c_int = 0x0007;
3118pub const ETH_P_PPP_MP: c_int = 0x0008;
3119pub const ETH_P_LOCALTALK: c_int = 0x0009;
3120pub const ETH_P_CANFD: c_int = 0x000D;
3121pub const ETH_P_PPPTALK: c_int = 0x0010;
3122pub const ETH_P_TR_802_2: c_int = 0x0011;
3123pub const ETH_P_MOBITEX: c_int = 0x0015;
3124pub const ETH_P_CONTROL: c_int = 0x0016;
3125pub const ETH_P_IRDA: c_int = 0x0017;
3126pub const ETH_P_ECONET: c_int = 0x0018;
3127pub const ETH_P_HDLC: c_int = 0x0019;
3128pub const ETH_P_ARCNET: c_int = 0x001A;
3129pub const ETH_P_DSA: c_int = 0x001B;
3130pub const ETH_P_TRAILER: c_int = 0x001C;
3131pub const ETH_P_PHONET: c_int = 0x00F5;
3132pub const ETH_P_IEEE802154: c_int = 0x00F6;
3133pub const ETH_P_CAIF: c_int = 0x00F7;
3134
3135pub const POSIX_SPAWN_RESETIDS: c_int = 0x01;
3137pub const POSIX_SPAWN_SETPGROUP: c_int = 0x02;
3138pub const POSIX_SPAWN_SETSIGDEF: c_int = 0x04;
3139pub const POSIX_SPAWN_SETSIGMASK: c_int = 0x08;
3140pub const POSIX_SPAWN_SETSCHEDPARAM: c_int = 0x10;
3141pub const POSIX_SPAWN_SETSCHEDULER: c_int = 0x20;
3142
3143pub const NLMSG_NOOP: c_int = 0x1;
3144pub const NLMSG_ERROR: c_int = 0x2;
3145pub const NLMSG_DONE: c_int = 0x3;
3146pub const NLMSG_OVERRUN: c_int = 0x4;
3147pub const NLMSG_MIN_TYPE: c_int = 0x10;
3148
3149pub const NFNLGRP_NONE: c_int = 0;
3151pub const NFNLGRP_CONNTRACK_NEW: c_int = 1;
3152pub const NFNLGRP_CONNTRACK_UPDATE: c_int = 2;
3153pub const NFNLGRP_CONNTRACK_DESTROY: c_int = 3;
3154pub const NFNLGRP_CONNTRACK_EXP_NEW: c_int = 4;
3155pub const NFNLGRP_CONNTRACK_EXP_UPDATE: c_int = 5;
3156pub const NFNLGRP_CONNTRACK_EXP_DESTROY: c_int = 6;
3157pub const NFNLGRP_NFTABLES: c_int = 7;
3158pub const NFNLGRP_ACCT_QUOTA: c_int = 8;
3159pub const NFNLGRP_NFTRACE: c_int = 9;
3160
3161pub const NFNETLINK_V0: c_int = 0;
3162
3163pub const NFNL_SUBSYS_NONE: c_int = 0;
3164pub const NFNL_SUBSYS_CTNETLINK: c_int = 1;
3165pub const NFNL_SUBSYS_CTNETLINK_EXP: c_int = 2;
3166pub const NFNL_SUBSYS_QUEUE: c_int = 3;
3167pub const NFNL_SUBSYS_ULOG: c_int = 4;
3168pub const NFNL_SUBSYS_OSF: c_int = 5;
3169pub const NFNL_SUBSYS_IPSET: c_int = 6;
3170pub const NFNL_SUBSYS_ACCT: c_int = 7;
3171pub const NFNL_SUBSYS_CTNETLINK_TIMEOUT: c_int = 8;
3172pub const NFNL_SUBSYS_CTHELPER: c_int = 9;
3173pub const NFNL_SUBSYS_NFTABLES: c_int = 10;
3174pub const NFNL_SUBSYS_NFT_COMPAT: c_int = 11;
3175pub const NFNL_SUBSYS_HOOK: c_int = 12;
3176pub const NFNL_SUBSYS_COUNT: c_int = 13;
3177
3178pub const NFNL_MSG_BATCH_BEGIN: c_int = NLMSG_MIN_TYPE;
3179pub const NFNL_MSG_BATCH_END: c_int = NLMSG_MIN_TYPE + 1;
3180
3181pub const NFNL_BATCH_UNSPEC: c_int = 0;
3182pub const NFNL_BATCH_GENID: c_int = 1;
3183
3184pub const NFULNL_MSG_PACKET: c_int = 0;
3186pub const NFULNL_MSG_CONFIG: c_int = 1;
3187
3188pub const NFULA_VLAN_UNSPEC: c_int = 0;
3189pub const NFULA_VLAN_PROTO: c_int = 1;
3190pub const NFULA_VLAN_TCI: c_int = 2;
3191
3192pub const NFULA_UNSPEC: c_int = 0;
3193pub const NFULA_PACKET_HDR: c_int = 1;
3194pub const NFULA_MARK: c_int = 2;
3195pub const NFULA_TIMESTAMP: c_int = 3;
3196pub const NFULA_IFINDEX_INDEV: c_int = 4;
3197pub const NFULA_IFINDEX_OUTDEV: c_int = 5;
3198pub const NFULA_IFINDEX_PHYSINDEV: c_int = 6;
3199pub const NFULA_IFINDEX_PHYSOUTDEV: c_int = 7;
3200pub const NFULA_HWADDR: c_int = 8;
3201pub const NFULA_PAYLOAD: c_int = 9;
3202pub const NFULA_PREFIX: c_int = 10;
3203pub const NFULA_UID: c_int = 11;
3204pub const NFULA_SEQ: c_int = 12;
3205pub const NFULA_SEQ_GLOBAL: c_int = 13;
3206pub const NFULA_GID: c_int = 14;
3207pub const NFULA_HWTYPE: c_int = 15;
3208pub const NFULA_HWHEADER: c_int = 16;
3209pub const NFULA_HWLEN: c_int = 17;
3210pub const NFULA_CT: c_int = 18;
3211pub const NFULA_CT_INFO: c_int = 19;
3212pub const NFULA_VLAN: c_int = 20;
3213pub const NFULA_L2HDR: c_int = 21;
3214
3215pub const NFULNL_CFG_CMD_NONE: c_int = 0;
3216pub const NFULNL_CFG_CMD_BIND: c_int = 1;
3217pub const NFULNL_CFG_CMD_UNBIND: c_int = 2;
3218pub const NFULNL_CFG_CMD_PF_BIND: c_int = 3;
3219pub const NFULNL_CFG_CMD_PF_UNBIND: c_int = 4;
3220
3221pub const NFULA_CFG_UNSPEC: c_int = 0;
3222pub const NFULA_CFG_CMD: c_int = 1;
3223pub const NFULA_CFG_MODE: c_int = 2;
3224pub const NFULA_CFG_NLBUFSIZ: c_int = 3;
3225pub const NFULA_CFG_TIMEOUT: c_int = 4;
3226pub const NFULA_CFG_QTHRESH: c_int = 5;
3227pub const NFULA_CFG_FLAGS: c_int = 6;
3228
3229pub const NFULNL_COPY_NONE: c_int = 0x00;
3230pub const NFULNL_COPY_META: c_int = 0x01;
3231pub const NFULNL_COPY_PACKET: c_int = 0x02;
3232
3233pub const NFULNL_CFG_F_SEQ: c_int = 0x0001;
3234pub const NFULNL_CFG_F_SEQ_GLOBAL: c_int = 0x0002;
3235pub const NFULNL_CFG_F_CONNTRACK: c_int = 0x0004;
3236
3237pub const NFQNL_MSG_PACKET: c_int = 0;
3239pub const NFQNL_MSG_VERDICT: c_int = 1;
3240pub const NFQNL_MSG_CONFIG: c_int = 2;
3241pub const NFQNL_MSG_VERDICT_BATCH: c_int = 3;
3242
3243pub const NFQA_UNSPEC: c_int = 0;
3244pub const NFQA_PACKET_HDR: c_int = 1;
3245pub const NFQA_VERDICT_HDR: c_int = 2;
3246pub const NFQA_MARK: c_int = 3;
3247pub const NFQA_TIMESTAMP: c_int = 4;
3248pub const NFQA_IFINDEX_INDEV: c_int = 5;
3249pub const NFQA_IFINDEX_OUTDEV: c_int = 6;
3250pub const NFQA_IFINDEX_PHYSINDEV: c_int = 7;
3251pub const NFQA_IFINDEX_PHYSOUTDEV: c_int = 8;
3252pub const NFQA_HWADDR: c_int = 9;
3253pub const NFQA_PAYLOAD: c_int = 10;
3254pub const NFQA_CT: c_int = 11;
3255pub const NFQA_CT_INFO: c_int = 12;
3256pub const NFQA_CAP_LEN: c_int = 13;
3257pub const NFQA_SKB_INFO: c_int = 14;
3258pub const NFQA_EXP: c_int = 15;
3259pub const NFQA_UID: c_int = 16;
3260pub const NFQA_GID: c_int = 17;
3261pub const NFQA_SECCTX: c_int = 18;
3262pub const NFQA_VLAN: c_int = 19;
3263pub const NFQA_L2HDR: c_int = 20;
3264pub const NFQA_PRIORITY: c_int = 21;
3265
3266pub const NFQA_VLAN_UNSPEC: c_int = 0;
3267pub const NFQA_VLAN_PROTO: c_int = 1;
3268pub const NFQA_VLAN_TCI: c_int = 2;
3269
3270pub const NFQNL_CFG_CMD_NONE: c_int = 0;
3271pub const NFQNL_CFG_CMD_BIND: c_int = 1;
3272pub const NFQNL_CFG_CMD_UNBIND: c_int = 2;
3273pub const NFQNL_CFG_CMD_PF_BIND: c_int = 3;
3274pub const NFQNL_CFG_CMD_PF_UNBIND: c_int = 4;
3275
3276pub const NFQNL_COPY_NONE: c_int = 0;
3277pub const NFQNL_COPY_META: c_int = 1;
3278pub const NFQNL_COPY_PACKET: c_int = 2;
3279
3280pub const NFQA_CFG_UNSPEC: c_int = 0;
3281pub const NFQA_CFG_CMD: c_int = 1;
3282pub const NFQA_CFG_PARAMS: c_int = 2;
3283pub const NFQA_CFG_QUEUE_MAXLEN: c_int = 3;
3284pub const NFQA_CFG_MASK: c_int = 4;
3285pub const NFQA_CFG_FLAGS: c_int = 5;
3286
3287pub const NFQA_CFG_F_FAIL_OPEN: c_int = 0x0001;
3288pub const NFQA_CFG_F_CONNTRACK: c_int = 0x0002;
3289pub const NFQA_CFG_F_GSO: c_int = 0x0004;
3290pub const NFQA_CFG_F_UID_GID: c_int = 0x0008;
3291pub const NFQA_CFG_F_SECCTX: c_int = 0x0010;
3292pub const NFQA_CFG_F_MAX: c_int = 0x0020;
3293
3294pub const NFQA_SKB_CSUMNOTREADY: c_int = 0x0001;
3295pub const NFQA_SKB_GSO: c_int = 0x0002;
3296pub const NFQA_SKB_CSUM_NOTVERIFIED: c_int = 0x0004;
3297
3298pub const GENL_NAMSIZ: c_int = 16;
3301
3302pub const GENL_MIN_ID: c_int = NLMSG_MIN_TYPE;
3303pub const GENL_MAX_ID: c_int = 1023;
3304
3305pub const GENL_ADMIN_PERM: c_int = 0x01;
3306pub const GENL_CMD_CAP_DO: c_int = 0x02;
3307pub const GENL_CMD_CAP_DUMP: c_int = 0x04;
3308pub const GENL_CMD_CAP_HASPOL: c_int = 0x08;
3309
3310pub const GENL_ID_CTRL: c_int = NLMSG_MIN_TYPE;
3311
3312pub const CTRL_CMD_UNSPEC: c_int = 0;
3313pub const CTRL_CMD_NEWFAMILY: c_int = 1;
3314pub const CTRL_CMD_DELFAMILY: c_int = 2;
3315pub const CTRL_CMD_GETFAMILY: c_int = 3;
3316pub const CTRL_CMD_NEWOPS: c_int = 4;
3317pub const CTRL_CMD_DELOPS: c_int = 5;
3318pub const CTRL_CMD_GETOPS: c_int = 6;
3319pub const CTRL_CMD_NEWMCAST_GRP: c_int = 7;
3320pub const CTRL_CMD_DELMCAST_GRP: c_int = 8;
3321pub const CTRL_CMD_GETMCAST_GRP: c_int = 9;
3322
3323pub const CTRL_ATTR_UNSPEC: c_int = 0;
3324pub const CTRL_ATTR_FAMILY_ID: c_int = 1;
3325pub const CTRL_ATTR_FAMILY_NAME: c_int = 2;
3326pub const CTRL_ATTR_VERSION: c_int = 3;
3327pub const CTRL_ATTR_HDRSIZE: c_int = 4;
3328pub const CTRL_ATTR_MAXATTR: c_int = 5;
3329pub const CTRL_ATTR_OPS: c_int = 6;
3330pub const CTRL_ATTR_MCAST_GROUPS: c_int = 7;
3331
3332pub const CTRL_ATTR_OP_UNSPEC: c_int = 0;
3333pub const CTRL_ATTR_OP_ID: c_int = 1;
3334pub const CTRL_ATTR_OP_FLAGS: c_int = 2;
3335
3336pub const CTRL_ATTR_MCAST_GRP_UNSPEC: c_int = 0;
3337pub const CTRL_ATTR_MCAST_GRP_NAME: c_int = 1;
3338pub const CTRL_ATTR_MCAST_GRP_ID: c_int = 2;
3339
3340pub const PACKET_HOST: c_uchar = 0;
3342pub const PACKET_BROADCAST: c_uchar = 1;
3343pub const PACKET_MULTICAST: c_uchar = 2;
3344pub const PACKET_OTHERHOST: c_uchar = 3;
3345pub const PACKET_OUTGOING: c_uchar = 4;
3346pub const PACKET_LOOPBACK: c_uchar = 5;
3347pub const PACKET_USER: c_uchar = 6;
3348pub const PACKET_KERNEL: c_uchar = 7;
3349
3350pub const PACKET_ADD_MEMBERSHIP: c_int = 1;
3351pub const PACKET_DROP_MEMBERSHIP: c_int = 2;
3352pub const PACKET_RECV_OUTPUT: c_int = 3;
3353pub const PACKET_RX_RING: c_int = 5;
3354pub const PACKET_STATISTICS: c_int = 6;
3355pub const PACKET_COPY_THRESH: c_int = 7;
3356pub const PACKET_AUXDATA: c_int = 8;
3357pub const PACKET_ORIGDEV: c_int = 9;
3358pub const PACKET_VERSION: c_int = 10;
3359pub const PACKET_HDRLEN: c_int = 11;
3360pub const PACKET_RESERVE: c_int = 12;
3361pub const PACKET_TX_RING: c_int = 13;
3362pub const PACKET_LOSS: c_int = 14;
3363pub const PACKET_VNET_HDR: c_int = 15;
3364pub const PACKET_TX_TIMESTAMP: c_int = 16;
3365pub const PACKET_TIMESTAMP: c_int = 17;
3366pub const PACKET_FANOUT: c_int = 18;
3367pub const PACKET_TX_HAS_OFF: c_int = 19;
3368pub const PACKET_QDISC_BYPASS: c_int = 20;
3369pub const PACKET_ROLLOVER_STATS: c_int = 21;
3370pub const PACKET_FANOUT_DATA: c_int = 22;
3371pub const PACKET_IGNORE_OUTGOING: c_int = 23;
3372pub const PACKET_VNET_HDR_SZ: c_int = 24;
3373
3374pub const PACKET_FANOUT_HASH: c_uint = 0;
3375pub const PACKET_FANOUT_LB: c_uint = 1;
3376pub const PACKET_FANOUT_CPU: c_uint = 2;
3377pub const PACKET_FANOUT_ROLLOVER: c_uint = 3;
3378pub const PACKET_FANOUT_RND: c_uint = 4;
3379pub const PACKET_FANOUT_QM: c_uint = 5;
3380pub const PACKET_FANOUT_CBPF: c_uint = 6;
3381pub const PACKET_FANOUT_EBPF: c_uint = 7;
3382pub const PACKET_FANOUT_FLAG_ROLLOVER: c_uint = 0x1000;
3383pub const PACKET_FANOUT_FLAG_UNIQUEID: c_uint = 0x2000;
3384pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: c_uint = 0x4000;
3385pub const PACKET_FANOUT_FLAG_DEFRAG: c_uint = 0x8000;
3386
3387pub const PACKET_MR_MULTICAST: c_int = 0;
3388pub const PACKET_MR_PROMISC: c_int = 1;
3389pub const PACKET_MR_ALLMULTI: c_int = 2;
3390
3391pub const TP_STATUS_KERNEL: __u32 = 0;
3392pub const TP_STATUS_USER: __u32 = 1 << 0;
3393pub const TP_STATUS_COPY: __u32 = 1 << 1;
3394pub const TP_STATUS_LOSING: __u32 = 1 << 2;
3395pub const TP_STATUS_CSUMNOTREADY: __u32 = 1 << 3;
3396pub const TP_STATUS_VLAN_VALID: __u32 = 1 << 4;
3397pub const TP_STATUS_BLK_TMO: __u32 = 1 << 5;
3398pub const TP_STATUS_VLAN_TPID_VALID: __u32 = 1 << 6;
3399pub const TP_STATUS_CSUM_VALID: __u32 = 1 << 7;
3400
3401pub const TP_STATUS_AVAILABLE: __u32 = 0;
3402pub const TP_STATUS_SEND_REQUEST: __u32 = 1 << 0;
3403pub const TP_STATUS_SENDING: __u32 = 1 << 1;
3404pub const TP_STATUS_WRONG_FORMAT: __u32 = 1 << 2;
3405
3406pub const TP_STATUS_TS_SOFTWARE: __u32 = 1 << 29;
3407pub const TP_STATUS_TS_SYS_HARDWARE: __u32 = 1 << 30;
3408pub const TP_STATUS_TS_RAW_HARDWARE: __u32 = 1 << 31;
3409
3410pub const TP_FT_REQ_FILL_RXHASH: __u32 = 1;
3411
3412pub const TPACKET_ALIGNMENT: usize = 16;
3413
3414pub const TPACKET_HDRLEN: usize = ((size_of::<crate::tpacket_hdr>() + TPACKET_ALIGNMENT - 1)
3415 & !(TPACKET_ALIGNMENT - 1))
3416 + size_of::<crate::sockaddr_ll>();
3417pub const TPACKET2_HDRLEN: usize = ((size_of::<crate::tpacket2_hdr>() + TPACKET_ALIGNMENT - 1)
3418 & !(TPACKET_ALIGNMENT - 1))
3419 + size_of::<crate::sockaddr_ll>();
3420pub const TPACKET3_HDRLEN: usize = ((size_of::<crate::tpacket3_hdr>() + TPACKET_ALIGNMENT - 1)
3421 & !(TPACKET_ALIGNMENT - 1))
3422 + size_of::<crate::sockaddr_ll>();
3423
3424pub const NF_DROP: c_int = 0;
3426pub const NF_ACCEPT: c_int = 1;
3427pub const NF_STOLEN: c_int = 2;
3428pub const NF_QUEUE: c_int = 3;
3429pub const NF_REPEAT: c_int = 4;
3430pub const NF_STOP: c_int = 5;
3431pub const NF_MAX_VERDICT: c_int = NF_STOP;
3432
3433pub const NF_VERDICT_MASK: c_int = 0x000000ff;
3434pub const NF_VERDICT_FLAG_QUEUE_BYPASS: c_int = 0x00008000;
3435
3436pub const NF_VERDICT_QMASK: c_int = 0xffff0000;
3437pub const NF_VERDICT_QBITS: c_int = 16;
3438
3439pub const NF_VERDICT_BITS: c_int = 16;
3440
3441pub const NF_INET_PRE_ROUTING: c_int = 0;
3442pub const NF_INET_LOCAL_IN: c_int = 1;
3443pub const NF_INET_FORWARD: c_int = 2;
3444pub const NF_INET_LOCAL_OUT: c_int = 3;
3445pub const NF_INET_POST_ROUTING: c_int = 4;
3446pub const NF_INET_NUMHOOKS: c_int = 5;
3447pub const NF_INET_INGRESS: c_int = NF_INET_NUMHOOKS;
3448
3449pub const NF_NETDEV_INGRESS: c_int = 0;
3450pub const NF_NETDEV_EGRESS: c_int = 1;
3451pub const NF_NETDEV_NUMHOOKS: c_int = 2;
3452
3453pub const NFPROTO_UNSPEC: c_int = 0;
3455pub const NFPROTO_INET: c_int = 1;
3456pub const NFPROTO_IPV4: c_int = 2;
3457pub const NFPROTO_ARP: c_int = 3;
3458pub const NFPROTO_NETDEV: c_int = 5;
3459pub const NFPROTO_BRIDGE: c_int = 7;
3460pub const NFPROTO_IPV6: c_int = 10;
3461pub const NFPROTO_DECNET: c_int = 12;
3462pub const NFPROTO_NUMPROTO: c_int = 13;
3463
3464pub const NF_ARP: c_int = 0;
3466pub const NF_ARP_IN: c_int = 0;
3467pub const NF_ARP_OUT: c_int = 1;
3468pub const NF_ARP_FORWARD: c_int = 2;
3469pub const NF_ARP_NUMHOOKS: c_int = 3;
3470
3471pub const NF_BR_PRE_ROUTING: c_int = 0;
3473pub const NF_BR_LOCAL_IN: c_int = 1;
3474pub const NF_BR_FORWARD: c_int = 2;
3475pub const NF_BR_LOCAL_OUT: c_int = 3;
3476pub const NF_BR_POST_ROUTING: c_int = 4;
3477pub const NF_BR_BROUTING: c_int = 5;
3478pub const NF_BR_NUMHOOKS: c_int = 6;
3479
3480pub const NF_BR_PRI_FIRST: c_int = crate::INT_MIN;
3481pub const NF_BR_PRI_NAT_DST_BRIDGED: c_int = -300;
3482pub const NF_BR_PRI_FILTER_BRIDGED: c_int = -200;
3483pub const NF_BR_PRI_BRNF: c_int = 0;
3484pub const NF_BR_PRI_NAT_DST_OTHER: c_int = 100;
3485pub const NF_BR_PRI_FILTER_OTHER: c_int = 200;
3486pub const NF_BR_PRI_NAT_SRC: c_int = 300;
3487pub const NF_BR_PRI_LAST: c_int = crate::INT_MAX;
3488
3489pub const NF_IP_PRE_ROUTING: c_int = 0;
3491pub const NF_IP_LOCAL_IN: c_int = 1;
3492pub const NF_IP_FORWARD: c_int = 2;
3493pub const NF_IP_LOCAL_OUT: c_int = 3;
3494pub const NF_IP_POST_ROUTING: c_int = 4;
3495pub const NF_IP_NUMHOOKS: c_int = 5;
3496
3497pub const NF_IP_PRI_FIRST: c_int = crate::INT_MIN;
3498pub const NF_IP_PRI_RAW_BEFORE_DEFRAG: c_int = -450;
3499pub const NF_IP_PRI_CONNTRACK_DEFRAG: c_int = -400;
3500pub const NF_IP_PRI_RAW: c_int = -300;
3501pub const NF_IP_PRI_SELINUX_FIRST: c_int = -225;
3502pub const NF_IP_PRI_CONNTRACK: c_int = -200;
3503pub const NF_IP_PRI_MANGLE: c_int = -150;
3504pub const NF_IP_PRI_NAT_DST: c_int = -100;
3505pub const NF_IP_PRI_FILTER: c_int = 0;
3506pub const NF_IP_PRI_SECURITY: c_int = 50;
3507pub const NF_IP_PRI_NAT_SRC: c_int = 100;
3508pub const NF_IP_PRI_SELINUX_LAST: c_int = 225;
3509pub const NF_IP_PRI_CONNTRACK_HELPER: c_int = 300;
3510pub const NF_IP_PRI_CONNTRACK_CONFIRM: c_int = crate::INT_MAX;
3511pub const NF_IP_PRI_LAST: c_int = crate::INT_MAX;
3512
3513pub const NF_IP6_PRE_ROUTING: c_int = 0;
3515pub const NF_IP6_LOCAL_IN: c_int = 1;
3516pub const NF_IP6_FORWARD: c_int = 2;
3517pub const NF_IP6_LOCAL_OUT: c_int = 3;
3518pub const NF_IP6_POST_ROUTING: c_int = 4;
3519pub const NF_IP6_NUMHOOKS: c_int = 5;
3520
3521pub const NF_IP6_PRI_FIRST: c_int = crate::INT_MIN;
3522pub const NF_IP6_PRI_RAW_BEFORE_DEFRAG: c_int = -450;
3523pub const NF_IP6_PRI_CONNTRACK_DEFRAG: c_int = -400;
3524pub const NF_IP6_PRI_RAW: c_int = -300;
3525pub const NF_IP6_PRI_SELINUX_FIRST: c_int = -225;
3526pub const NF_IP6_PRI_CONNTRACK: c_int = -200;
3527pub const NF_IP6_PRI_MANGLE: c_int = -150;
3528pub const NF_IP6_PRI_NAT_DST: c_int = -100;
3529pub const NF_IP6_PRI_FILTER: c_int = 0;
3530pub const NF_IP6_PRI_SECURITY: c_int = 50;
3531pub const NF_IP6_PRI_NAT_SRC: c_int = 100;
3532pub const NF_IP6_PRI_SELINUX_LAST: c_int = 225;
3533pub const NF_IP6_PRI_CONNTRACK_HELPER: c_int = 300;
3534pub const NF_IP6_PRI_LAST: c_int = crate::INT_MAX;
3535
3536pub const IP6T_SO_ORIGINAL_DST: c_int = 80;
3538
3539pub const SIOCADDRT: c_ulong = 0x0000890B;
3540pub const SIOCDELRT: c_ulong = 0x0000890C;
3541pub const SIOCGIFNAME: c_ulong = 0x00008910;
3542pub const SIOCSIFLINK: c_ulong = 0x00008911;
3543pub const SIOCGIFCONF: c_ulong = 0x00008912;
3544pub const SIOCGIFFLAGS: c_ulong = 0x00008913;
3545pub const SIOCSIFFLAGS: c_ulong = 0x00008914;
3546pub const SIOCGIFADDR: c_ulong = 0x00008915;
3547pub const SIOCSIFADDR: c_ulong = 0x00008916;
3548pub const SIOCGIFDSTADDR: c_ulong = 0x00008917;
3549pub const SIOCSIFDSTADDR: c_ulong = 0x00008918;
3550pub const SIOCGIFBRDADDR: c_ulong = 0x00008919;
3551pub const SIOCSIFBRDADDR: c_ulong = 0x0000891A;
3552pub const SIOCGIFNETMASK: c_ulong = 0x0000891B;
3553pub const SIOCSIFNETMASK: c_ulong = 0x0000891C;
3554pub const SIOCGIFMETRIC: c_ulong = 0x0000891D;
3555pub const SIOCSIFMETRIC: c_ulong = 0x0000891E;
3556pub const SIOCGIFMEM: c_ulong = 0x0000891F;
3557pub const SIOCSIFMEM: c_ulong = 0x00008920;
3558pub const SIOCGIFMTU: c_ulong = 0x00008921;
3559pub const SIOCSIFMTU: c_ulong = 0x00008922;
3560pub const SIOCSIFNAME: c_ulong = 0x00008923;
3561pub const SIOCSIFHWADDR: c_ulong = 0x00008924;
3562pub const SIOCGIFENCAP: c_ulong = 0x00008925;
3563pub const SIOCSIFENCAP: c_ulong = 0x00008926;
3564pub const SIOCGIFHWADDR: c_ulong = 0x00008927;
3565pub const SIOCGIFSLAVE: c_ulong = 0x00008929;
3566pub const SIOCSIFSLAVE: c_ulong = 0x00008930;
3567pub const SIOCADDMULTI: c_ulong = 0x00008931;
3568pub const SIOCDELMULTI: c_ulong = 0x00008932;
3569pub const SIOCGIFINDEX: c_ulong = 0x00008933;
3570pub const SIOGIFINDEX: c_ulong = SIOCGIFINDEX;
3571pub const SIOCSIFPFLAGS: c_ulong = 0x00008934;
3572pub const SIOCGIFPFLAGS: c_ulong = 0x00008935;
3573pub const SIOCDIFADDR: c_ulong = 0x00008936;
3574pub const SIOCSIFHWBROADCAST: c_ulong = 0x00008937;
3575pub const SIOCGIFCOUNT: c_ulong = 0x00008938;
3576pub const SIOCGIFBR: c_ulong = 0x00008940;
3577pub const SIOCSIFBR: c_ulong = 0x00008941;
3578pub const SIOCGIFTXQLEN: c_ulong = 0x00008942;
3579pub const SIOCSIFTXQLEN: c_ulong = 0x00008943;
3580pub const SIOCETHTOOL: c_ulong = 0x00008946;
3581pub const SIOCGMIIPHY: c_ulong = 0x00008947;
3582pub const SIOCGMIIREG: c_ulong = 0x00008948;
3583pub const SIOCSMIIREG: c_ulong = 0x00008949;
3584pub const SIOCWANDEV: c_ulong = 0x0000894A;
3585pub const SIOCOUTQNSD: c_ulong = 0x0000894B;
3586pub const SIOCGSKNS: c_ulong = 0x0000894C;
3587pub const SIOCDARP: c_ulong = 0x00008953;
3588pub const SIOCGARP: c_ulong = 0x00008954;
3589pub const SIOCSARP: c_ulong = 0x00008955;
3590pub const SIOCDRARP: c_ulong = 0x00008960;
3591pub const SIOCGRARP: c_ulong = 0x00008961;
3592pub const SIOCSRARP: c_ulong = 0x00008962;
3593pub const SIOCGIFMAP: c_ulong = 0x00008970;
3594pub const SIOCSIFMAP: c_ulong = 0x00008971;
3595pub const SIOCSHWTSTAMP: c_ulong = 0x000089b0;
3596pub const SIOCGHWTSTAMP: c_ulong = 0x000089b1;
3597
3598pub const WIRELESS_EXT: c_ulong = 0x16;
3600
3601pub const SIOCSIWCOMMIT: c_ulong = 0x8B00;
3602pub const SIOCGIWNAME: c_ulong = 0x8B01;
3603
3604pub const SIOCSIWNWID: c_ulong = 0x8B02;
3605pub const SIOCGIWNWID: c_ulong = 0x8B03;
3606pub const SIOCSIWFREQ: c_ulong = 0x8B04;
3607pub const SIOCGIWFREQ: c_ulong = 0x8B05;
3608pub const SIOCSIWMODE: c_ulong = 0x8B06;
3609pub const SIOCGIWMODE: c_ulong = 0x8B07;
3610pub const SIOCSIWSENS: c_ulong = 0x8B08;
3611pub const SIOCGIWSENS: c_ulong = 0x8B09;
3612
3613pub const SIOCSIWRANGE: c_ulong = 0x8B0A;
3614pub const SIOCGIWRANGE: c_ulong = 0x8B0B;
3615pub const SIOCSIWPRIV: c_ulong = 0x8B0C;
3616pub const SIOCGIWPRIV: c_ulong = 0x8B0D;
3617pub const SIOCSIWSTATS: c_ulong = 0x8B0E;
3618pub const SIOCGIWSTATS: c_ulong = 0x8B0F;
3619
3620pub const SIOCSIWSPY: c_ulong = 0x8B10;
3621pub const SIOCGIWSPY: c_ulong = 0x8B11;
3622pub const SIOCSIWTHRSPY: c_ulong = 0x8B12;
3623pub const SIOCGIWTHRSPY: c_ulong = 0x8B13;
3624
3625pub const SIOCSIWAP: c_ulong = 0x8B14;
3626pub const SIOCGIWAP: c_ulong = 0x8B15;
3627pub const SIOCGIWAPLIST: c_ulong = 0x8B17;
3628pub const SIOCSIWSCAN: c_ulong = 0x8B18;
3629pub const SIOCGIWSCAN: c_ulong = 0x8B19;
3630
3631pub const SIOCSIWESSID: c_ulong = 0x8B1A;
3632pub const SIOCGIWESSID: c_ulong = 0x8B1B;
3633pub const SIOCSIWNICKN: c_ulong = 0x8B1C;
3634pub const SIOCGIWNICKN: c_ulong = 0x8B1D;
3635
3636pub const SIOCSIWRATE: c_ulong = 0x8B20;
3637pub const SIOCGIWRATE: c_ulong = 0x8B21;
3638pub const SIOCSIWRTS: c_ulong = 0x8B22;
3639pub const SIOCGIWRTS: c_ulong = 0x8B23;
3640pub const SIOCSIWFRAG: c_ulong = 0x8B24;
3641pub const SIOCGIWFRAG: c_ulong = 0x8B25;
3642pub const SIOCSIWTXPOW: c_ulong = 0x8B26;
3643pub const SIOCGIWTXPOW: c_ulong = 0x8B27;
3644pub const SIOCSIWRETRY: c_ulong = 0x8B28;
3645pub const SIOCGIWRETRY: c_ulong = 0x8B29;
3646
3647pub const SIOCSIWENCODE: c_ulong = 0x8B2A;
3648pub const SIOCGIWENCODE: c_ulong = 0x8B2B;
3649
3650pub const SIOCSIWPOWER: c_ulong = 0x8B2C;
3651pub const SIOCGIWPOWER: c_ulong = 0x8B2D;
3652
3653pub const SIOCSIWGENIE: c_ulong = 0x8B30;
3654pub const SIOCGIWGENIE: c_ulong = 0x8B31;
3655
3656pub const SIOCSIWMLME: c_ulong = 0x8B16;
3657
3658pub const SIOCSIWAUTH: c_ulong = 0x8B32;
3659pub const SIOCGIWAUTH: c_ulong = 0x8B33;
3660
3661pub const SIOCSIWENCODEEXT: c_ulong = 0x8B34;
3662pub const SIOCGIWENCODEEXT: c_ulong = 0x8B35;
3663
3664pub const SIOCSIWPMKSA: c_ulong = 0x8B36;
3665
3666pub const SIOCIWFIRSTPRIV: c_ulong = 0x8BE0;
3667pub const SIOCIWLASTPRIV: c_ulong = 0x8BFF;
3668
3669pub const SIOCIWFIRST: c_ulong = 0x8B00;
3670pub const SIOCIWLAST: c_ulong = SIOCIWLASTPRIV;
3671
3672pub const IWEVTXDROP: c_ulong = 0x8C00;
3673pub const IWEVQUAL: c_ulong = 0x8C01;
3674pub const IWEVCUSTOM: c_ulong = 0x8C02;
3675pub const IWEVREGISTERED: c_ulong = 0x8C03;
3676pub const IWEVEXPIRED: c_ulong = 0x8C04;
3677pub const IWEVGENIE: c_ulong = 0x8C05;
3678pub const IWEVMICHAELMICFAILURE: c_ulong = 0x8C06;
3679pub const IWEVASSOCREQIE: c_ulong = 0x8C07;
3680pub const IWEVASSOCRESPIE: c_ulong = 0x8C08;
3681pub const IWEVPMKIDCAND: c_ulong = 0x8C09;
3682pub const IWEVFIRST: c_ulong = 0x8C00;
3683
3684pub const IW_PRIV_TYPE_MASK: c_ulong = 0x7000;
3685pub const IW_PRIV_TYPE_NONE: c_ulong = 0x0000;
3686pub const IW_PRIV_TYPE_BYTE: c_ulong = 0x1000;
3687pub const IW_PRIV_TYPE_CHAR: c_ulong = 0x2000;
3688pub const IW_PRIV_TYPE_INT: c_ulong = 0x4000;
3689pub const IW_PRIV_TYPE_FLOAT: c_ulong = 0x5000;
3690pub const IW_PRIV_TYPE_ADDR: c_ulong = 0x6000;
3691
3692pub const IW_PRIV_SIZE_FIXED: c_ulong = 0x0800;
3693
3694pub const IW_PRIV_SIZE_MASK: c_ulong = 0x07FF;
3695
3696pub const IW_MAX_FREQUENCIES: usize = 32;
3697pub const IW_MAX_BITRATES: usize = 32;
3698pub const IW_MAX_TXPOWER: usize = 8;
3699pub const IW_MAX_SPY: usize = 8;
3700pub const IW_MAX_AP: usize = 64;
3701pub const IW_ESSID_MAX_SIZE: usize = 32;
3702
3703pub const IW_MODE_AUTO: usize = 0;
3704pub const IW_MODE_ADHOC: usize = 1;
3705pub const IW_MODE_INFRA: usize = 2;
3706pub const IW_MODE_MASTER: usize = 3;
3707pub const IW_MODE_REPEAT: usize = 4;
3708pub const IW_MODE_SECOND: usize = 5;
3709pub const IW_MODE_MONITOR: usize = 6;
3710pub const IW_MODE_MESH: usize = 7;
3711
3712pub const IW_QUAL_QUAL_UPDATED: c_ulong = 0x01;
3713pub const IW_QUAL_LEVEL_UPDATED: c_ulong = 0x02;
3714pub const IW_QUAL_NOISE_UPDATED: c_ulong = 0x04;
3715pub const IW_QUAL_ALL_UPDATED: c_ulong = 0x07;
3716pub const IW_QUAL_DBM: c_ulong = 0x08;
3717pub const IW_QUAL_QUAL_INVALID: c_ulong = 0x10;
3718pub const IW_QUAL_LEVEL_INVALID: c_ulong = 0x20;
3719pub const IW_QUAL_NOISE_INVALID: c_ulong = 0x40;
3720pub const IW_QUAL_RCPI: c_ulong = 0x80;
3721pub const IW_QUAL_ALL_INVALID: c_ulong = 0x70;
3722
3723pub const IW_FREQ_AUTO: c_ulong = 0x00;
3724pub const IW_FREQ_FIXED: c_ulong = 0x01;
3725
3726pub const IW_MAX_ENCODING_SIZES: usize = 8;
3727pub const IW_ENCODING_TOKEN_MAX: usize = 64;
3728
3729pub const IW_ENCODE_INDEX: c_ulong = 0x00FF;
3730pub const IW_ENCODE_FLAGS: c_ulong = 0xFF00;
3731pub const IW_ENCODE_MODE: c_ulong = 0xF000;
3732pub const IW_ENCODE_DISABLED: c_ulong = 0x8000;
3733pub const IW_ENCODE_ENABLED: c_ulong = 0x0000;
3734pub const IW_ENCODE_RESTRICTED: c_ulong = 0x4000;
3735pub const IW_ENCODE_OPEN: c_ulong = 0x2000;
3736pub const IW_ENCODE_NOKEY: c_ulong = 0x0800;
3737pub const IW_ENCODE_TEMP: c_ulong = 0x0400;
3738
3739pub const IW_POWER_ON: c_ulong = 0x0000;
3740pub const IW_POWER_TYPE: c_ulong = 0xF000;
3741pub const IW_POWER_PERIOD: c_ulong = 0x1000;
3742pub const IW_POWER_TIMEOUT: c_ulong = 0x2000;
3743pub const IW_POWER_MODE: c_ulong = 0x0F00;
3744pub const IW_POWER_UNICAST_R: c_ulong = 0x0100;
3745pub const IW_POWER_MULTICAST_R: c_ulong = 0x0200;
3746pub const IW_POWER_ALL_R: c_ulong = 0x0300;
3747pub const IW_POWER_FORCE_S: c_ulong = 0x0400;
3748pub const IW_POWER_REPEATER: c_ulong = 0x0800;
3749pub const IW_POWER_MODIFIER: c_ulong = 0x000F;
3750pub const IW_POWER_MIN: c_ulong = 0x0001;
3751pub const IW_POWER_MAX: c_ulong = 0x0002;
3752pub const IW_POWER_RELATIVE: c_ulong = 0x0004;
3753
3754pub const IW_TXPOW_TYPE: c_ulong = 0x00FF;
3755pub const IW_TXPOW_DBM: c_ulong = 0x0000;
3756pub const IW_TXPOW_MWATT: c_ulong = 0x0001;
3757pub const IW_TXPOW_RELATIVE: c_ulong = 0x0002;
3758pub const IW_TXPOW_RANGE: c_ulong = 0x1000;
3759
3760pub const IW_RETRY_ON: c_ulong = 0x0000;
3761pub const IW_RETRY_TYPE: c_ulong = 0xF000;
3762pub const IW_RETRY_LIMIT: c_ulong = 0x1000;
3763pub const IW_RETRY_LIFETIME: c_ulong = 0x2000;
3764pub const IW_RETRY_MODIFIER: c_ulong = 0x00FF;
3765pub const IW_RETRY_MIN: c_ulong = 0x0001;
3766pub const IW_RETRY_MAX: c_ulong = 0x0002;
3767pub const IW_RETRY_RELATIVE: c_ulong = 0x0004;
3768pub const IW_RETRY_SHORT: c_ulong = 0x0010;
3769pub const IW_RETRY_LONG: c_ulong = 0x0020;
3770
3771pub const IW_SCAN_DEFAULT: c_ulong = 0x0000;
3772pub const IW_SCAN_ALL_ESSID: c_ulong = 0x0001;
3773pub const IW_SCAN_THIS_ESSID: c_ulong = 0x0002;
3774pub const IW_SCAN_ALL_FREQ: c_ulong = 0x0004;
3775pub const IW_SCAN_THIS_FREQ: c_ulong = 0x0008;
3776pub const IW_SCAN_ALL_MODE: c_ulong = 0x0010;
3777pub const IW_SCAN_THIS_MODE: c_ulong = 0x0020;
3778pub const IW_SCAN_ALL_RATE: c_ulong = 0x0040;
3779pub const IW_SCAN_THIS_RATE: c_ulong = 0x0080;
3780
3781pub const IW_SCAN_TYPE_ACTIVE: usize = 0;
3782pub const IW_SCAN_TYPE_PASSIVE: usize = 1;
3783
3784pub const IW_SCAN_MAX_DATA: usize = 4096;
3785
3786pub const IW_SCAN_CAPA_NONE: c_ulong = 0x00;
3787pub const IW_SCAN_CAPA_ESSID: c_ulong = 0x01;
3788pub const IW_SCAN_CAPA_BSSID: c_ulong = 0x02;
3789pub const IW_SCAN_CAPA_CHANNEL: c_ulong = 0x04;
3790pub const IW_SCAN_CAPA_MODE: c_ulong = 0x08;
3791pub const IW_SCAN_CAPA_RATE: c_ulong = 0x10;
3792pub const IW_SCAN_CAPA_TYPE: c_ulong = 0x20;
3793pub const IW_SCAN_CAPA_TIME: c_ulong = 0x40;
3794
3795pub const IW_CUSTOM_MAX: c_ulong = 256;
3796
3797pub const IW_GENERIC_IE_MAX: c_ulong = 1024;
3798
3799pub const IW_MLME_DEAUTH: c_ulong = 0;
3800pub const IW_MLME_DISASSOC: c_ulong = 1;
3801pub const IW_MLME_AUTH: c_ulong = 2;
3802pub const IW_MLME_ASSOC: c_ulong = 3;
3803
3804pub const IW_AUTH_INDEX: c_ulong = 0x0FFF;
3805pub const IW_AUTH_FLAGS: c_ulong = 0xF000;
3806
3807pub const IW_AUTH_WPA_VERSION: usize = 0;
3808pub const IW_AUTH_CIPHER_PAIRWISE: usize = 1;
3809pub const IW_AUTH_CIPHER_GROUP: usize = 2;
3810pub const IW_AUTH_KEY_MGMT: usize = 3;
3811pub const IW_AUTH_TKIP_COUNTERMEASURES: usize = 4;
3812pub const IW_AUTH_DROP_UNENCRYPTED: usize = 5;
3813pub const IW_AUTH_80211_AUTH_ALG: usize = 6;
3814pub const IW_AUTH_WPA_ENABLED: usize = 7;
3815pub const IW_AUTH_RX_UNENCRYPTED_EAPOL: usize = 8;
3816pub const IW_AUTH_ROAMING_CONTROL: usize = 9;
3817pub const IW_AUTH_PRIVACY_INVOKED: usize = 10;
3818pub const IW_AUTH_CIPHER_GROUP_MGMT: usize = 11;
3819pub const IW_AUTH_MFP: usize = 12;
3820
3821pub const IW_AUTH_WPA_VERSION_DISABLED: c_ulong = 0x00000001;
3822pub const IW_AUTH_WPA_VERSION_WPA: c_ulong = 0x00000002;
3823pub const IW_AUTH_WPA_VERSION_WPA2: c_ulong = 0x00000004;
3824
3825pub const IW_AUTH_CIPHER_NONE: c_ulong = 0x00000001;
3826pub const IW_AUTH_CIPHER_WEP40: c_ulong = 0x00000002;
3827pub const IW_AUTH_CIPHER_TKIP: c_ulong = 0x00000004;
3828pub const IW_AUTH_CIPHER_CCMP: c_ulong = 0x00000008;
3829pub const IW_AUTH_CIPHER_WEP104: c_ulong = 0x00000010;
3830pub const IW_AUTH_CIPHER_AES_CMAC: c_ulong = 0x00000020;
3831
3832pub const IW_AUTH_KEY_MGMT_802_1X: usize = 1;
3833pub const IW_AUTH_KEY_MGMT_PSK: usize = 2;
3834
3835pub const IW_AUTH_ALG_OPEN_SYSTEM: c_ulong = 0x00000001;
3836pub const IW_AUTH_ALG_SHARED_KEY: c_ulong = 0x00000002;
3837pub const IW_AUTH_ALG_LEAP: c_ulong = 0x00000004;
3838
3839pub const IW_AUTH_ROAMING_ENABLE: usize = 0;
3840pub const IW_AUTH_ROAMING_DISABLE: usize = 1;
3841
3842pub const IW_AUTH_MFP_DISABLED: usize = 0;
3843pub const IW_AUTH_MFP_OPTIONAL: usize = 1;
3844pub const IW_AUTH_MFP_REQUIRED: usize = 2;
3845
3846pub const IW_ENCODE_SEQ_MAX_SIZE: usize = 8;
3847
3848pub const IW_ENCODE_ALG_NONE: usize = 0;
3849pub const IW_ENCODE_ALG_WEP: usize = 1;
3850pub const IW_ENCODE_ALG_TKIP: usize = 2;
3851pub const IW_ENCODE_ALG_CCMP: usize = 3;
3852pub const IW_ENCODE_ALG_PMK: usize = 4;
3853pub const IW_ENCODE_ALG_AES_CMAC: usize = 5;
3854
3855pub const IW_ENCODE_EXT_TX_SEQ_VALID: c_ulong = 0x00000001;
3856pub const IW_ENCODE_EXT_RX_SEQ_VALID: c_ulong = 0x00000002;
3857pub const IW_ENCODE_EXT_GROUP_KEY: c_ulong = 0x00000004;
3858pub const IW_ENCODE_EXT_SET_TX_KEY: c_ulong = 0x00000008;
3859
3860pub const IW_MICFAILURE_KEY_ID: c_ulong = 0x00000003;
3861pub const IW_MICFAILURE_GROUP: c_ulong = 0x00000004;
3862pub const IW_MICFAILURE_PAIRWISE: c_ulong = 0x00000008;
3863pub const IW_MICFAILURE_STAKEY: c_ulong = 0x00000010;
3864pub const IW_MICFAILURE_COUNT: c_ulong = 0x00000060;
3865
3866pub const IW_ENC_CAPA_WPA: c_ulong = 0x00000001;
3867pub const IW_ENC_CAPA_WPA2: c_ulong = 0x00000002;
3868pub const IW_ENC_CAPA_CIPHER_TKIP: c_ulong = 0x00000004;
3869pub const IW_ENC_CAPA_CIPHER_CCMP: c_ulong = 0x00000008;
3870pub const IW_ENC_CAPA_4WAY_HANDSHAKE: c_ulong = 0x00000010;
3871
3872pub const IW_EVENT_CAPA_K_0: c_ulong = 0x4000050; pub const IW_EVENT_CAPA_K_1: c_ulong = 0x400; pub const IW_PMKSA_ADD: usize = 1;
3876pub const IW_PMKSA_REMOVE: usize = 2;
3877pub const IW_PMKSA_FLUSH: usize = 3;
3878
3879pub const IW_PMKID_LEN: usize = 16;
3880
3881pub const IW_PMKID_CAND_PREAUTH: c_ulong = 0x00000001;
3882
3883pub const IW_EV_LCP_PK_LEN: usize = 4;
3884
3885pub const IW_EV_CHAR_PK_LEN: usize = 20; pub const IW_EV_UINT_PK_LEN: usize = 8; pub const IW_EV_FREQ_PK_LEN: usize = 12; pub const IW_EV_PARAM_PK_LEN: usize = 12; pub const IW_EV_ADDR_PK_LEN: usize = 20; pub const IW_EV_QUAL_PK_LEN: usize = 8; pub const IW_EV_POINT_PK_LEN: usize = 8; pub const IPTOS_TOS_MASK: u8 = 0x1E;
3894pub const IPTOS_PREC_MASK: u8 = 0xE0;
3895
3896pub const IPTOS_ECN_NOT_ECT: u8 = 0x00;
3897
3898pub const RTF_UP: c_ushort = 0x0001;
3899pub const RTF_GATEWAY: c_ushort = 0x0002;
3900
3901pub const RTF_HOST: c_ushort = 0x0004;
3902pub const RTF_REINSTATE: c_ushort = 0x0008;
3903pub const RTF_DYNAMIC: c_ushort = 0x0010;
3904pub const RTF_MODIFIED: c_ushort = 0x0020;
3905pub const RTF_MTU: c_ushort = 0x0040;
3906pub const RTF_MSS: c_ushort = RTF_MTU;
3907pub const RTF_WINDOW: c_ushort = 0x0080;
3908pub const RTF_IRTT: c_ushort = 0x0100;
3909pub const RTF_REJECT: c_ushort = 0x0200;
3910pub const RTF_STATIC: c_ushort = 0x0400;
3911pub const RTF_XRESOLVE: c_ushort = 0x0800;
3912pub const RTF_NOFORWARD: c_ushort = 0x1000;
3913pub const RTF_THROW: c_ushort = 0x2000;
3914pub const RTF_NOPMTUDISC: c_ushort = 0x4000;
3915
3916pub const RTF_DEFAULT: u32 = 0x00010000;
3917pub const RTF_ALLONLINK: u32 = 0x00020000;
3918pub const RTF_ADDRCONF: u32 = 0x00040000;
3919pub const RTF_LINKRT: u32 = 0x00100000;
3920pub const RTF_NONEXTHOP: u32 = 0x00200000;
3921pub const RTF_CACHE: u32 = 0x01000000;
3922pub const RTF_FLOW: u32 = 0x02000000;
3923pub const RTF_POLICY: u32 = 0x04000000;
3924
3925pub const RTCF_VALVE: u32 = 0x00200000;
3926pub const RTCF_MASQ: u32 = 0x00400000;
3927pub const RTCF_NAT: u32 = 0x00800000;
3928pub const RTCF_DOREDIRECT: u32 = 0x01000000;
3929pub const RTCF_LOG: u32 = 0x02000000;
3930pub const RTCF_DIRECTSRC: u32 = 0x04000000;
3931
3932pub const RTF_LOCAL: u32 = 0x80000000;
3933pub const RTF_INTERFACE: u32 = 0x40000000;
3934pub const RTF_MULTICAST: u32 = 0x20000000;
3935pub const RTF_BROADCAST: u32 = 0x10000000;
3936pub const RTF_NAT: u32 = 0x08000000;
3937pub const RTF_ADDRCLASSMASK: u32 = 0xF8000000;
3938
3939pub const RT_CLASS_UNSPEC: u8 = 0;
3940pub const RT_CLASS_DEFAULT: u8 = 253;
3941pub const RT_CLASS_MAIN: u8 = 254;
3942pub const RT_CLASS_LOCAL: u8 = 255;
3943pub const RT_CLASS_MAX: u8 = 255;
3944
3945pub const NUD_NONE: u16 = 0x00;
3947pub const NUD_INCOMPLETE: u16 = 0x01;
3948pub const NUD_REACHABLE: u16 = 0x02;
3949pub const NUD_STALE: u16 = 0x04;
3950pub const NUD_DELAY: u16 = 0x08;
3951pub const NUD_PROBE: u16 = 0x10;
3952pub const NUD_FAILED: u16 = 0x20;
3953pub const NUD_NOARP: u16 = 0x40;
3954pub const NUD_PERMANENT: u16 = 0x80;
3955
3956pub const NTF_USE: u8 = 0x01;
3957pub const NTF_SELF: u8 = 0x02;
3958pub const NTF_MASTER: u8 = 0x04;
3959pub const NTF_PROXY: u8 = 0x08;
3960pub const NTF_ROUTER: u8 = 0x80;
3961
3962pub const NDA_UNSPEC: c_ushort = 0;
3963pub const NDA_DST: c_ushort = 1;
3964pub const NDA_LLADDR: c_ushort = 2;
3965pub const NDA_CACHEINFO: c_ushort = 3;
3966pub const NDA_PROBES: c_ushort = 4;
3967pub const NDA_VLAN: c_ushort = 5;
3968pub const NDA_PORT: c_ushort = 6;
3969pub const NDA_VNI: c_ushort = 7;
3970pub const NDA_IFINDEX: c_ushort = 8;
3971
3972pub const NLA_ALIGNTO: c_int = 4;
3974
3975pub const NETLINK_ROUTE: c_int = 0;
3976pub const NETLINK_UNUSED: c_int = 1;
3977pub const NETLINK_USERSOCK: c_int = 2;
3978pub const NETLINK_FIREWALL: c_int = 3;
3979pub const NETLINK_SOCK_DIAG: c_int = 4;
3980pub const NETLINK_NFLOG: c_int = 5;
3981pub const NETLINK_XFRM: c_int = 6;
3982pub const NETLINK_SELINUX: c_int = 7;
3983pub const NETLINK_ISCSI: c_int = 8;
3984pub const NETLINK_AUDIT: c_int = 9;
3985pub const NETLINK_FIB_LOOKUP: c_int = 10;
3986pub const NETLINK_CONNECTOR: c_int = 11;
3987pub const NETLINK_NETFILTER: c_int = 12;
3988pub const NETLINK_IP6_FW: c_int = 13;
3989pub const NETLINK_DNRTMSG: c_int = 14;
3990pub const NETLINK_KOBJECT_UEVENT: c_int = 15;
3991pub const NETLINK_GENERIC: c_int = 16;
3992pub const NETLINK_SCSITRANSPORT: c_int = 18;
3993pub const NETLINK_ECRYPTFS: c_int = 19;
3994pub const NETLINK_RDMA: c_int = 20;
3995pub const NETLINK_CRYPTO: c_int = 21;
3996pub const NETLINK_INET_DIAG: c_int = NETLINK_SOCK_DIAG;
3997
3998pub const NLM_F_REQUEST: c_int = 1;
3999pub const NLM_F_MULTI: c_int = 2;
4000pub const NLM_F_ACK: c_int = 4;
4001pub const NLM_F_ECHO: c_int = 8;
4002pub const NLM_F_DUMP_INTR: c_int = 16;
4003pub const NLM_F_DUMP_FILTERED: c_int = 32;
4004
4005pub const NLM_F_ROOT: c_int = 0x100;
4006pub const NLM_F_MATCH: c_int = 0x200;
4007pub const NLM_F_ATOMIC: c_int = 0x400;
4008pub const NLM_F_DUMP: c_int = NLM_F_ROOT | NLM_F_MATCH;
4009
4010pub const NLM_F_REPLACE: c_int = 0x100;
4011pub const NLM_F_EXCL: c_int = 0x200;
4012pub const NLM_F_CREATE: c_int = 0x400;
4013pub const NLM_F_APPEND: c_int = 0x800;
4014
4015pub const NLM_F_NONREC: c_int = 0x100;
4016pub const NLM_F_BULK: c_int = 0x200;
4017
4018pub const NLM_F_CAPPED: c_int = 0x100;
4019pub const NLM_F_ACK_TLVS: c_int = 0x200;
4020
4021pub const NETLINK_ADD_MEMBERSHIP: c_int = 1;
4022pub const NETLINK_DROP_MEMBERSHIP: c_int = 2;
4023pub const NETLINK_PKTINFO: c_int = 3;
4024pub const NETLINK_BROADCAST_ERROR: c_int = 4;
4025pub const NETLINK_NO_ENOBUFS: c_int = 5;
4026pub const NETLINK_RX_RING: c_int = 6;
4027pub const NETLINK_TX_RING: c_int = 7;
4028pub const NETLINK_LISTEN_ALL_NSID: c_int = 8;
4029pub const NETLINK_LIST_MEMBERSHIPS: c_int = 9;
4030pub const NETLINK_CAP_ACK: c_int = 10;
4031pub const NETLINK_EXT_ACK: c_int = 11;
4032pub const NETLINK_GET_STRICT_CHK: c_int = 12;
4033
4034pub const NLA_F_NESTED: c_int = 1 << 15;
4035pub const NLA_F_NET_BYTEORDER: c_int = 1 << 14;
4036pub const NLA_TYPE_MASK: c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER);
4037
4038pub const TCA_UNSPEC: c_ushort = 0;
4040pub const TCA_KIND: c_ushort = 1;
4041pub const TCA_OPTIONS: c_ushort = 2;
4042pub const TCA_STATS: c_ushort = 3;
4043pub const TCA_XSTATS: c_ushort = 4;
4044pub const TCA_RATE: c_ushort = 5;
4045pub const TCA_FCNT: c_ushort = 6;
4046pub const TCA_STATS2: c_ushort = 7;
4047pub const TCA_STAB: c_ushort = 8;
4048
4049pub const RTM_NEWLINK: u16 = 16;
4050pub const RTM_DELLINK: u16 = 17;
4051pub const RTM_GETLINK: u16 = 18;
4052pub const RTM_SETLINK: u16 = 19;
4053pub const RTM_NEWADDR: u16 = 20;
4054pub const RTM_DELADDR: u16 = 21;
4055pub const RTM_GETADDR: u16 = 22;
4056pub const RTM_NEWROUTE: u16 = 24;
4057pub const RTM_DELROUTE: u16 = 25;
4058pub const RTM_GETROUTE: u16 = 26;
4059pub const RTM_NEWNEIGH: u16 = 28;
4060pub const RTM_DELNEIGH: u16 = 29;
4061pub const RTM_GETNEIGH: u16 = 30;
4062pub const RTM_NEWRULE: u16 = 32;
4063pub const RTM_DELRULE: u16 = 33;
4064pub const RTM_GETRULE: u16 = 34;
4065pub const RTM_NEWQDISC: u16 = 36;
4066pub const RTM_DELQDISC: u16 = 37;
4067pub const RTM_GETQDISC: u16 = 38;
4068pub const RTM_NEWTCLASS: u16 = 40;
4069pub const RTM_DELTCLASS: u16 = 41;
4070pub const RTM_GETTCLASS: u16 = 42;
4071pub const RTM_NEWTFILTER: u16 = 44;
4072pub const RTM_DELTFILTER: u16 = 45;
4073pub const RTM_GETTFILTER: u16 = 46;
4074pub const RTM_NEWACTION: u16 = 48;
4075pub const RTM_DELACTION: u16 = 49;
4076pub const RTM_GETACTION: u16 = 50;
4077pub const RTM_NEWPREFIX: u16 = 52;
4078pub const RTM_GETMULTICAST: u16 = 58;
4079pub const RTM_GETANYCAST: u16 = 62;
4080pub const RTM_NEWNEIGHTBL: u16 = 64;
4081pub const RTM_GETNEIGHTBL: u16 = 66;
4082pub const RTM_SETNEIGHTBL: u16 = 67;
4083pub const RTM_NEWNDUSEROPT: u16 = 68;
4084pub const RTM_NEWADDRLABEL: u16 = 72;
4085pub const RTM_DELADDRLABEL: u16 = 73;
4086pub const RTM_GETADDRLABEL: u16 = 74;
4087pub const RTM_GETDCB: u16 = 78;
4088pub const RTM_SETDCB: u16 = 79;
4089pub const RTM_NEWNETCONF: u16 = 80;
4090pub const RTM_GETNETCONF: u16 = 82;
4091pub const RTM_NEWMDB: u16 = 84;
4092pub const RTM_DELMDB: u16 = 85;
4093pub const RTM_GETMDB: u16 = 86;
4094pub const RTM_NEWNSID: u16 = 88;
4095pub const RTM_DELNSID: u16 = 89;
4096pub const RTM_GETNSID: u16 = 90;
4097
4098pub const RTM_F_NOTIFY: c_uint = 0x100;
4099pub const RTM_F_CLONED: c_uint = 0x200;
4100pub const RTM_F_EQUALIZE: c_uint = 0x400;
4101pub const RTM_F_PREFIX: c_uint = 0x800;
4102
4103pub const RTA_UNSPEC: c_ushort = 0;
4104pub const RTA_DST: c_ushort = 1;
4105pub const RTA_SRC: c_ushort = 2;
4106pub const RTA_IIF: c_ushort = 3;
4107pub const RTA_OIF: c_ushort = 4;
4108pub const RTA_GATEWAY: c_ushort = 5;
4109pub const RTA_PRIORITY: c_ushort = 6;
4110pub const RTA_PREFSRC: c_ushort = 7;
4111pub const RTA_METRICS: c_ushort = 8;
4112pub const RTA_MULTIPATH: c_ushort = 9;
4113pub const RTA_PROTOINFO: c_ushort = 10; pub const RTA_FLOW: c_ushort = 11;
4115pub const RTA_CACHEINFO: c_ushort = 12;
4116pub const RTA_SESSION: c_ushort = 13; pub const RTA_MP_ALGO: c_ushort = 14; pub const RTA_TABLE: c_ushort = 15;
4119pub const RTA_MARK: c_ushort = 16;
4120pub const RTA_MFC_STATS: c_ushort = 17;
4121
4122pub const RTN_UNSPEC: c_uchar = 0;
4123pub const RTN_UNICAST: c_uchar = 1;
4124pub const RTN_LOCAL: c_uchar = 2;
4125pub const RTN_BROADCAST: c_uchar = 3;
4126pub const RTN_ANYCAST: c_uchar = 4;
4127pub const RTN_MULTICAST: c_uchar = 5;
4128pub const RTN_BLACKHOLE: c_uchar = 6;
4129pub const RTN_UNREACHABLE: c_uchar = 7;
4130pub const RTN_PROHIBIT: c_uchar = 8;
4131pub const RTN_THROW: c_uchar = 9;
4132pub const RTN_NAT: c_uchar = 10;
4133pub const RTN_XRESOLVE: c_uchar = 11;
4134
4135pub const RTPROT_UNSPEC: c_uchar = 0;
4136pub const RTPROT_REDIRECT: c_uchar = 1;
4137pub const RTPROT_KERNEL: c_uchar = 2;
4138pub const RTPROT_BOOT: c_uchar = 3;
4139pub const RTPROT_STATIC: c_uchar = 4;
4140
4141pub const RT_SCOPE_UNIVERSE: c_uchar = 0;
4142pub const RT_SCOPE_SITE: c_uchar = 200;
4143pub const RT_SCOPE_LINK: c_uchar = 253;
4144pub const RT_SCOPE_HOST: c_uchar = 254;
4145pub const RT_SCOPE_NOWHERE: c_uchar = 255;
4146
4147pub const RT_TABLE_UNSPEC: c_uchar = 0;
4148pub const RT_TABLE_COMPAT: c_uchar = 252;
4149pub const RT_TABLE_DEFAULT: c_uchar = 253;
4150pub const RT_TABLE_MAIN: c_uchar = 254;
4151pub const RT_TABLE_LOCAL: c_uchar = 255;
4152
4153pub const RTMSG_OVERRUN: u32 = crate::NLMSG_OVERRUN as u32;
4154pub const RTMSG_NEWDEVICE: u32 = 0x11;
4155pub const RTMSG_DELDEVICE: u32 = 0x12;
4156pub const RTMSG_NEWROUTE: u32 = 0x21;
4157pub const RTMSG_DELROUTE: u32 = 0x22;
4158pub const RTMSG_NEWRULE: u32 = 0x31;
4159pub const RTMSG_DELRULE: u32 = 0x32;
4160pub const RTMSG_CONTROL: u32 = 0x40;
4161pub const RTMSG_AR_FAILED: u32 = 0x51;
4162
4163pub const MAX_ADDR_LEN: usize = 7;
4164pub const ARPD_UPDATE: c_ushort = 0x01;
4165pub const ARPD_LOOKUP: c_ushort = 0x02;
4166pub const ARPD_FLUSH: c_ushort = 0x03;
4167pub const ATF_MAGIC: c_int = 0x80;
4168
4169pub const RTEXT_FILTER_VF: c_int = 1 << 0;
4170pub const RTEXT_FILTER_BRVLAN: c_int = 1 << 1;
4171pub const RTEXT_FILTER_BRVLAN_COMPRESSED: c_int = 1 << 2;
4172pub const RTEXT_FILTER_SKIP_STATS: c_int = 1 << 3;
4173pub const RTEXT_FILTER_MRP: c_int = 1 << 4;
4174pub const RTEXT_FILTER_CFM_CONFIG: c_int = 1 << 5;
4175pub const RTEXT_FILTER_CFM_STATUS: c_int = 1 << 6;
4176
4177pub const RTMGRP_LINK: c_int = 0x00001;
4179pub const RTMGRP_NOTIFY: c_int = 0x00002;
4180pub const RTMGRP_NEIGH: c_int = 0x00004;
4181pub const RTMGRP_TC: c_int = 0x00008;
4182pub const RTMGRP_IPV4_IFADDR: c_int = 0x00010;
4183pub const RTMGRP_IPV4_MROUTE: c_int = 0x00020;
4184pub const RTMGRP_IPV4_ROUTE: c_int = 0x00040;
4185pub const RTMGRP_IPV4_RULE: c_int = 0x00080;
4186pub const RTMGRP_IPV6_IFADDR: c_int = 0x00100;
4187pub const RTMGRP_IPV6_MROUTE: c_int = 0x00200;
4188pub const RTMGRP_IPV6_ROUTE: c_int = 0x00400;
4189pub const RTMGRP_IPV6_IFINFO: c_int = 0x00800;
4190pub const RTMGRP_DECnet_IFADDR: c_int = 0x01000;
4191pub const RTMGRP_DECnet_ROUTE: c_int = 0x04000;
4192pub const RTMGRP_IPV6_PREFIX: c_int = 0x20000;
4193
4194pub const RTNLGRP_NONE: c_uint = 0x00;
4196pub const RTNLGRP_LINK: c_uint = 0x01;
4197pub const RTNLGRP_NOTIFY: c_uint = 0x02;
4198pub const RTNLGRP_NEIGH: c_uint = 0x03;
4199pub const RTNLGRP_TC: c_uint = 0x04;
4200pub const RTNLGRP_IPV4_IFADDR: c_uint = 0x05;
4201pub const RTNLGRP_IPV4_MROUTE: c_uint = 0x06;
4202pub const RTNLGRP_IPV4_ROUTE: c_uint = 0x07;
4203pub const RTNLGRP_IPV4_RULE: c_uint = 0x08;
4204pub const RTNLGRP_IPV6_IFADDR: c_uint = 0x09;
4205pub const RTNLGRP_IPV6_MROUTE: c_uint = 0x0a;
4206pub const RTNLGRP_IPV6_ROUTE: c_uint = 0x0b;
4207pub const RTNLGRP_IPV6_IFINFO: c_uint = 0x0c;
4208pub const RTNLGRP_DECnet_IFADDR: c_uint = 0x0d;
4209pub const RTNLGRP_NOP2: c_uint = 0x0e;
4210pub const RTNLGRP_DECnet_ROUTE: c_uint = 0x0f;
4211pub const RTNLGRP_DECnet_RULE: c_uint = 0x10;
4212pub const RTNLGRP_NOP4: c_uint = 0x11;
4213pub const RTNLGRP_IPV6_PREFIX: c_uint = 0x12;
4214pub const RTNLGRP_IPV6_RULE: c_uint = 0x13;
4215pub const RTNLGRP_ND_USEROPT: c_uint = 0x14;
4216pub const RTNLGRP_PHONET_IFADDR: c_uint = 0x15;
4217pub const RTNLGRP_PHONET_ROUTE: c_uint = 0x16;
4218pub const RTNLGRP_DCB: c_uint = 0x17;
4219pub const RTNLGRP_IPV4_NETCONF: c_uint = 0x18;
4220pub const RTNLGRP_IPV6_NETCONF: c_uint = 0x19;
4221pub const RTNLGRP_MDB: c_uint = 0x1a;
4222pub const RTNLGRP_MPLS_ROUTE: c_uint = 0x1b;
4223pub const RTNLGRP_NSID: c_uint = 0x1c;
4224pub const RTNLGRP_MPLS_NETCONF: c_uint = 0x1d;
4225pub const RTNLGRP_IPV4_MROUTE_R: c_uint = 0x1e;
4226pub const RTNLGRP_IPV6_MROUTE_R: c_uint = 0x1f;
4227pub const RTNLGRP_NEXTHOP: c_uint = 0x20;
4228pub const RTNLGRP_BRVLAN: c_uint = 0x21;
4229pub const RTNLGRP_MCTP_IFADDR: c_uint = 0x22;
4230pub const RTNLGRP_TUNNEL: c_uint = 0x23;
4231pub const RTNLGRP_STATS: c_uint = 0x24;
4232
4233c_enum! {
4235 pub enum proc_cn_mcast_op {
4236 pub PROC_CN_MCAST_LISTEN = 1,
4237 pub PROC_CN_MCAST_IGNORE = 2,
4238 }
4239
4240 pub enum proc_cn_event {
4241 pub PROC_EVENT_NONE = 0x00000000,
4242 pub PROC_EVENT_FORK = 0x00000001,
4243 pub PROC_EVENT_EXEC = 0x00000002,
4244 pub PROC_EVENT_UID = 0x00000004,
4245 pub PROC_EVENT_GID = 0x00000040,
4246 pub PROC_EVENT_SID = 0x00000080,
4247 pub PROC_EVENT_PTRACE = 0x00000100,
4248 pub PROC_EVENT_COMM = 0x00000200,
4249 pub PROC_EVENT_NONZERO_EXIT = 0x20000000,
4250 pub PROC_EVENT_COREDUMP = 0x40000000,
4251 pub PROC_EVENT_EXIT = 0x80000000,
4252 }
4253}
4254
4255pub const CN_IDX_PROC: c_uint = 0x1;
4257pub const CN_VAL_PROC: c_uint = 0x1;
4258pub const CN_IDX_CIFS: c_uint = 0x2;
4259pub const CN_VAL_CIFS: c_uint = 0x1;
4260pub const CN_W1_IDX: c_uint = 0x3;
4261pub const CN_W1_VAL: c_uint = 0x1;
4262pub const CN_IDX_V86D: c_uint = 0x4;
4263pub const CN_VAL_V86D_UVESAFB: c_uint = 0x1;
4264pub const CN_IDX_BB: c_uint = 0x5;
4265pub const CN_DST_IDX: c_uint = 0x6;
4266pub const CN_DST_VAL: c_uint = 0x1;
4267pub const CN_IDX_DM: c_uint = 0x7;
4268pub const CN_VAL_DM_USERSPACE_LOG: c_uint = 0x1;
4269pub const CN_IDX_DRBD: c_uint = 0x8;
4270pub const CN_VAL_DRBD: c_uint = 0x1;
4271pub const CN_KVP_IDX: c_uint = 0x9;
4272pub const CN_KVP_VAL: c_uint = 0x1;
4273pub const CN_VSS_IDX: c_uint = 0xA;
4274pub const CN_VSS_VAL: c_uint = 0x1;
4275
4276pub const MODULE_INIT_IGNORE_MODVERSIONS: c_uint = 0x0001;
4278pub const MODULE_INIT_IGNORE_VERMAGIC: c_uint = 0x0002;
4279
4280pub const SOF_TIMESTAMPING_TX_HARDWARE: c_uint = 1 << 0;
4282pub const SOF_TIMESTAMPING_TX_SOFTWARE: c_uint = 1 << 1;
4283pub const SOF_TIMESTAMPING_RX_HARDWARE: c_uint = 1 << 2;
4284pub const SOF_TIMESTAMPING_RX_SOFTWARE: c_uint = 1 << 3;
4285pub const SOF_TIMESTAMPING_SOFTWARE: c_uint = 1 << 4;
4286pub const SOF_TIMESTAMPING_SYS_HARDWARE: c_uint = 1 << 5;
4287pub const SOF_TIMESTAMPING_RAW_HARDWARE: c_uint = 1 << 6;
4288pub const SOF_TIMESTAMPING_OPT_ID: c_uint = 1 << 7;
4289pub const SOF_TIMESTAMPING_TX_SCHED: c_uint = 1 << 8;
4290pub const SOF_TIMESTAMPING_TX_ACK: c_uint = 1 << 9;
4291pub const SOF_TIMESTAMPING_OPT_CMSG: c_uint = 1 << 10;
4292pub const SOF_TIMESTAMPING_OPT_TSONLY: c_uint = 1 << 11;
4293pub const SOF_TIMESTAMPING_OPT_STATS: c_uint = 1 << 12;
4294pub const SOF_TIMESTAMPING_OPT_PKTINFO: c_uint = 1 << 13;
4295pub const SOF_TIMESTAMPING_OPT_TX_SWHW: c_uint = 1 << 14;
4296pub const SOF_TIMESTAMPING_BIND_PHC: c_uint = 1 << 15;
4297pub const SOF_TIMESTAMPING_OPT_ID_TCP: c_uint = 1 << 16;
4298pub const SOF_TIMESTAMPING_OPT_RX_FILTER: c_uint = 1 << 17;
4299pub const SOF_TXTIME_DEADLINE_MODE: u32 = 1 << 0;
4300pub const SOF_TXTIME_REPORT_ERRORS: u32 = 1 << 1;
4301
4302pub const HWTSTAMP_TX_OFF: c_uint = 0;
4303pub const HWTSTAMP_TX_ON: c_uint = 1;
4304pub const HWTSTAMP_TX_ONESTEP_SYNC: c_uint = 2;
4305pub const HWTSTAMP_TX_ONESTEP_P2P: c_uint = 3;
4306
4307pub const HWTSTAMP_FILTER_NONE: c_uint = 0;
4308pub const HWTSTAMP_FILTER_ALL: c_uint = 1;
4309pub const HWTSTAMP_FILTER_SOME: c_uint = 2;
4310pub const HWTSTAMP_FILTER_PTP_V1_L4_EVENT: c_uint = 3;
4311pub const HWTSTAMP_FILTER_PTP_V1_L4_SYNC: c_uint = 4;
4312pub const HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ: c_uint = 5;
4313pub const HWTSTAMP_FILTER_PTP_V2_L4_EVENT: c_uint = 6;
4314pub const HWTSTAMP_FILTER_PTP_V2_L4_SYNC: c_uint = 7;
4315pub const HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ: c_uint = 8;
4316pub const HWTSTAMP_FILTER_PTP_V2_L2_EVENT: c_uint = 9;
4317pub const HWTSTAMP_FILTER_PTP_V2_L2_SYNC: c_uint = 10;
4318pub const HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ: c_uint = 11;
4319pub const HWTSTAMP_FILTER_PTP_V2_EVENT: c_uint = 12;
4320pub const HWTSTAMP_FILTER_PTP_V2_SYNC: c_uint = 13;
4321pub const HWTSTAMP_FILTER_PTP_V2_DELAY_REQ: c_uint = 14;
4322pub const HWTSTAMP_FILTER_NTP_ALL: c_uint = 15;
4323
4324pub const PTP_MAX_SAMPLES: c_uint = 25; const PTP_CLK_MAGIC: u32 = b'=' as u32;
4328
4329pub const PTP_CLOCK_GETCAPS: Ioctl = _IOR::<ptp_clock_caps>(PTP_CLK_MAGIC, 1);
4330pub const PTP_EXTTS_REQUEST: Ioctl = _IOW::<ptp_extts_request>(PTP_CLK_MAGIC, 2);
4331pub const PTP_PEROUT_REQUEST: Ioctl = _IOW::<ptp_perout_request>(PTP_CLK_MAGIC, 3);
4332pub const PTP_ENABLE_PPS: Ioctl = _IOW::<c_int>(PTP_CLK_MAGIC, 4);
4333pub const PTP_SYS_OFFSET: Ioctl = _IOW::<ptp_sys_offset>(PTP_CLK_MAGIC, 5);
4334pub const PTP_PIN_GETFUNC: Ioctl = _IOWR::<ptp_pin_desc>(PTP_CLK_MAGIC, 6);
4335pub const PTP_PIN_SETFUNC: Ioctl = _IOW::<ptp_pin_desc>(PTP_CLK_MAGIC, 7);
4336pub const PTP_SYS_OFFSET_PRECISE: Ioctl = _IOWR::<ptp_sys_offset_precise>(PTP_CLK_MAGIC, 8);
4337pub const PTP_SYS_OFFSET_EXTENDED: Ioctl = _IOWR::<ptp_sys_offset_extended>(PTP_CLK_MAGIC, 9);
4338
4339pub const PTP_CLOCK_GETCAPS2: Ioctl = _IOR::<ptp_clock_caps>(PTP_CLK_MAGIC, 10);
4340pub const PTP_EXTTS_REQUEST2: Ioctl = _IOW::<ptp_extts_request>(PTP_CLK_MAGIC, 11);
4341pub const PTP_PEROUT_REQUEST2: Ioctl = _IOW::<ptp_perout_request>(PTP_CLK_MAGIC, 12);
4342pub const PTP_ENABLE_PPS2: Ioctl = _IOW::<c_int>(PTP_CLK_MAGIC, 13);
4343pub const PTP_SYS_OFFSET2: Ioctl = _IOW::<ptp_sys_offset>(PTP_CLK_MAGIC, 14);
4344pub const PTP_PIN_GETFUNC2: Ioctl = _IOWR::<ptp_pin_desc>(PTP_CLK_MAGIC, 15);
4345pub const PTP_PIN_SETFUNC2: Ioctl = _IOW::<ptp_pin_desc>(PTP_CLK_MAGIC, 16);
4346pub const PTP_SYS_OFFSET_PRECISE2: Ioctl = _IOWR::<ptp_sys_offset_precise>(PTP_CLK_MAGIC, 17);
4347pub const PTP_SYS_OFFSET_EXTENDED2: Ioctl = _IOWR::<ptp_sys_offset_extended>(PTP_CLK_MAGIC, 18);
4348
4349pub const PTP_PF_NONE: c_uint = 0;
4351pub const PTP_PF_EXTTS: c_uint = 1;
4352pub const PTP_PF_PEROUT: c_uint = 2;
4353pub const PTP_PF_PHYSYNC: c_uint = 3;
4354
4355pub const TLS_TX: c_int = 1;
4357pub const TLS_RX: c_int = 2;
4358
4359pub const TLS_TX_ZEROCOPY_RO: c_int = 3;
4360pub const TLS_RX_EXPECT_NO_PAD: c_int = 4;
4361
4362pub const TLS_1_2_VERSION_MAJOR: __u8 = 0x3;
4363pub const TLS_1_2_VERSION_MINOR: __u8 = 0x3;
4364pub const TLS_1_2_VERSION: __u16 =
4365 ((TLS_1_2_VERSION_MAJOR as __u16) << 8) | (TLS_1_2_VERSION_MINOR as __u16);
4366
4367pub const TLS_1_3_VERSION_MAJOR: __u8 = 0x3;
4368pub const TLS_1_3_VERSION_MINOR: __u8 = 0x4;
4369pub const TLS_1_3_VERSION: __u16 =
4370 ((TLS_1_3_VERSION_MAJOR as __u16) << 8) | (TLS_1_3_VERSION_MINOR as __u16);
4371
4372pub const TLS_CIPHER_AES_GCM_128: __u16 = 51;
4373pub const TLS_CIPHER_AES_GCM_128_IV_SIZE: usize = 8;
4374pub const TLS_CIPHER_AES_GCM_128_KEY_SIZE: usize = 16;
4375pub const TLS_CIPHER_AES_GCM_128_SALT_SIZE: usize = 4;
4376pub const TLS_CIPHER_AES_GCM_128_TAG_SIZE: usize = 16;
4377pub const TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE: usize = 8;
4378
4379pub const TLS_CIPHER_AES_GCM_256: __u16 = 52;
4380pub const TLS_CIPHER_AES_GCM_256_IV_SIZE: usize = 8;
4381pub const TLS_CIPHER_AES_GCM_256_KEY_SIZE: usize = 32;
4382pub const TLS_CIPHER_AES_GCM_256_SALT_SIZE: usize = 4;
4383pub const TLS_CIPHER_AES_GCM_256_TAG_SIZE: usize = 16;
4384pub const TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE: usize = 8;
4385
4386pub const TLS_CIPHER_AES_CCM_128: __u16 = 53;
4387pub const TLS_CIPHER_AES_CCM_128_IV_SIZE: usize = 8;
4388pub const TLS_CIPHER_AES_CCM_128_KEY_SIZE: usize = 16;
4389pub const TLS_CIPHER_AES_CCM_128_SALT_SIZE: usize = 4;
4390pub const TLS_CIPHER_AES_CCM_128_TAG_SIZE: usize = 16;
4391pub const TLS_CIPHER_AES_CCM_128_REC_SEQ_SIZE: usize = 8;
4392
4393pub const TLS_CIPHER_CHACHA20_POLY1305: __u16 = 54;
4394pub const TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE: usize = 12;
4395pub const TLS_CIPHER_CHACHA20_POLY1305_KEY_SIZE: usize = 32;
4396pub const TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE: usize = 0;
4397pub const TLS_CIPHER_CHACHA20_POLY1305_TAG_SIZE: usize = 16;
4398pub const TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE: usize = 8;
4399
4400pub const TLS_CIPHER_SM4_GCM: __u16 = 55;
4401pub const TLS_CIPHER_SM4_GCM_IV_SIZE: usize = 8;
4402pub const TLS_CIPHER_SM4_GCM_KEY_SIZE: usize = 16;
4403pub const TLS_CIPHER_SM4_GCM_SALT_SIZE: usize = 4;
4404pub const TLS_CIPHER_SM4_GCM_TAG_SIZE: usize = 16;
4405pub const TLS_CIPHER_SM4_GCM_REC_SEQ_SIZE: usize = 8;
4406
4407pub const TLS_CIPHER_SM4_CCM: __u16 = 56;
4408pub const TLS_CIPHER_SM4_CCM_IV_SIZE: usize = 8;
4409pub const TLS_CIPHER_SM4_CCM_KEY_SIZE: usize = 16;
4410pub const TLS_CIPHER_SM4_CCM_SALT_SIZE: usize = 4;
4411pub const TLS_CIPHER_SM4_CCM_TAG_SIZE: usize = 16;
4412pub const TLS_CIPHER_SM4_CCM_REC_SEQ_SIZE: usize = 8;
4413
4414pub const TLS_CIPHER_ARIA_GCM_128: __u16 = 57;
4415pub const TLS_CIPHER_ARIA_GCM_128_IV_SIZE: usize = 8;
4416pub const TLS_CIPHER_ARIA_GCM_128_KEY_SIZE: usize = 16;
4417pub const TLS_CIPHER_ARIA_GCM_128_SALT_SIZE: usize = 4;
4418pub const TLS_CIPHER_ARIA_GCM_128_TAG_SIZE: usize = 16;
4419pub const TLS_CIPHER_ARIA_GCM_128_REC_SEQ_SIZE: usize = 8;
4420
4421pub const TLS_CIPHER_ARIA_GCM_256: __u16 = 58;
4422pub const TLS_CIPHER_ARIA_GCM_256_IV_SIZE: usize = 8;
4423pub const TLS_CIPHER_ARIA_GCM_256_KEY_SIZE: usize = 32;
4424pub const TLS_CIPHER_ARIA_GCM_256_SALT_SIZE: usize = 4;
4425pub const TLS_CIPHER_ARIA_GCM_256_TAG_SIZE: usize = 16;
4426pub const TLS_CIPHER_ARIA_GCM_256_REC_SEQ_SIZE: usize = 8;
4427
4428pub const TLS_SET_RECORD_TYPE: c_int = 1;
4429pub const TLS_GET_RECORD_TYPE: c_int = 2;
4430
4431pub const SOL_TLS: c_int = 282;
4432
4433pub const TLS_INFO_UNSPEC: c_int = 0x00;
4435pub const TLS_INFO_VERSION: c_int = 0x01;
4436pub const TLS_INFO_CIPHER: c_int = 0x02;
4437pub const TLS_INFO_TXCONF: c_int = 0x03;
4438pub const TLS_INFO_RXCONF: c_int = 0x04;
4439pub const TLS_INFO_ZC_RO_TX: c_int = 0x05;
4440pub const TLS_INFO_RX_NO_PAD: c_int = 0x06;
4441
4442pub const TLS_CONF_BASE: c_int = 1;
4443pub const TLS_CONF_SW: c_int = 2;
4444pub const TLS_CONF_HW: c_int = 3;
4445pub const TLS_CONF_HW_RECORD: c_int = 4;
4446
4447pub const ALG_SET_KEY: c_int = 1;
4449pub const ALG_SET_IV: c_int = 2;
4450pub const ALG_SET_OP: c_int = 3;
4451pub const ALG_SET_AEAD_ASSOCLEN: c_int = 4;
4452pub const ALG_SET_AEAD_AUTHSIZE: c_int = 5;
4453pub const ALG_SET_DRBG_ENTROPY: c_int = 6;
4454pub const ALG_SET_KEY_BY_KEY_SERIAL: c_int = 7;
4455
4456pub const ALG_OP_DECRYPT: c_int = 0;
4457pub const ALG_OP_ENCRYPT: c_int = 1;
4458
4459pub const IF_OPER_UNKNOWN: c_int = 0;
4461pub const IF_OPER_NOTPRESENT: c_int = 1;
4462pub const IF_OPER_DOWN: c_int = 2;
4463pub const IF_OPER_LOWERLAYERDOWN: c_int = 3;
4464pub const IF_OPER_TESTING: c_int = 4;
4465pub const IF_OPER_DORMANT: c_int = 5;
4466pub const IF_OPER_UP: c_int = 6;
4467
4468pub const IF_LINK_MODE_DEFAULT: c_int = 0;
4469pub const IF_LINK_MODE_DORMANT: c_int = 1;
4470pub const IF_LINK_MODE_TESTING: c_int = 2;
4471
4472pub const UDP_CORK: c_int = 1;
4474pub const UDP_ENCAP: c_int = 100;
4475pub const UDP_NO_CHECK6_TX: c_int = 101;
4476pub const UDP_NO_CHECK6_RX: c_int = 102;
4477
4478pub const MAP_SHARED_VALIDATE: c_int = 0x3;
4480pub const MAP_DROPPABLE: c_int = 0x8;
4481
4482pub const MAP_FIXED_NOREPLACE: c_int = 0x100000;
4484pub const MLOCK_ONFAULT: c_uint = 0x01;
4485
4486pub const VMADDR_CID_ANY: c_uint = 0xFFFFFFFF;
4488pub const VMADDR_CID_HYPERVISOR: c_uint = 0;
4489#[deprecated(
4490 since = "0.2.74",
4491 note = "VMADDR_CID_RESERVED is removed since Linux v5.6 and \
4492 replaced with VMADDR_CID_LOCAL"
4493)]
4494pub const VMADDR_CID_RESERVED: c_uint = 1;
4495pub const VMADDR_CID_LOCAL: c_uint = 1;
4496pub const VMADDR_CID_HOST: c_uint = 2;
4497pub const VMADDR_PORT_ANY: c_uint = 0xFFFFFFFF;
4498
4499pub const IN_ACCESS: u32 = 0x0000_0001;
4501pub const IN_MODIFY: u32 = 0x0000_0002;
4502pub const IN_ATTRIB: u32 = 0x0000_0004;
4503pub const IN_CLOSE_WRITE: u32 = 0x0000_0008;
4504pub const IN_CLOSE_NOWRITE: u32 = 0x0000_0010;
4505pub const IN_CLOSE: u32 = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE;
4506pub const IN_OPEN: u32 = 0x0000_0020;
4507pub const IN_MOVED_FROM: u32 = 0x0000_0040;
4508pub const IN_MOVED_TO: u32 = 0x0000_0080;
4509pub const IN_MOVE: u32 = IN_MOVED_FROM | IN_MOVED_TO;
4510pub const IN_CREATE: u32 = 0x0000_0100;
4511pub const IN_DELETE: u32 = 0x0000_0200;
4512pub const IN_DELETE_SELF: u32 = 0x0000_0400;
4513pub const IN_MOVE_SELF: u32 = 0x0000_0800;
4514pub const IN_UNMOUNT: u32 = 0x0000_2000;
4515pub const IN_Q_OVERFLOW: u32 = 0x0000_4000;
4516pub const IN_IGNORED: u32 = 0x0000_8000;
4517pub const IN_ONLYDIR: u32 = 0x0100_0000;
4518pub const IN_DONT_FOLLOW: u32 = 0x0200_0000;
4519pub const IN_EXCL_UNLINK: u32 = 0x0400_0000;
4520
4521const SECURE_NOROOT: c_int = 0;
4523const SECURE_NOROOT_LOCKED: c_int = 1;
4524
4525pub const SECBIT_NOROOT: c_int = issecure_mask(SECURE_NOROOT);
4526pub const SECBIT_NOROOT_LOCKED: c_int = issecure_mask(SECURE_NOROOT_LOCKED);
4527
4528const SECURE_NO_SETUID_FIXUP: c_int = 2;
4529const SECURE_NO_SETUID_FIXUP_LOCKED: c_int = 3;
4530
4531pub const SECBIT_NO_SETUID_FIXUP: c_int = issecure_mask(SECURE_NO_SETUID_FIXUP);
4532pub const SECBIT_NO_SETUID_FIXUP_LOCKED: c_int = issecure_mask(SECURE_NO_SETUID_FIXUP_LOCKED);
4533
4534const SECURE_KEEP_CAPS: c_int = 4;
4535const SECURE_KEEP_CAPS_LOCKED: c_int = 5;
4536
4537pub const SECBIT_KEEP_CAPS: c_int = issecure_mask(SECURE_KEEP_CAPS);
4538pub const SECBIT_KEEP_CAPS_LOCKED: c_int = issecure_mask(SECURE_KEEP_CAPS_LOCKED);
4539
4540const SECURE_NO_CAP_AMBIENT_RAISE: c_int = 6;
4541const SECURE_NO_CAP_AMBIENT_RAISE_LOCKED: c_int = 7;
4542
4543pub const SECBIT_NO_CAP_AMBIENT_RAISE: c_int = issecure_mask(SECURE_NO_CAP_AMBIENT_RAISE);
4544pub const SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED: c_int =
4545 issecure_mask(SECURE_NO_CAP_AMBIENT_RAISE_LOCKED);
4546
4547const SECURE_EXEC_RESTRICT_FILE: c_int = 8;
4548const SECURE_EXEC_RESTRICT_FILE_LOCKED: c_int = 9;
4549
4550pub const SECBIT_EXEC_RESTRICT_FILE: c_int = issecure_mask(SECURE_EXEC_RESTRICT_FILE);
4551pub const SECBIT_EXEC_RESTRICT_FILE_LOCKED: c_int = issecure_mask(SECURE_EXEC_RESTRICT_FILE_LOCKED);
4552
4553const SECURE_EXEC_DENY_INTERACTIVE: c_int = 10;
4554const SECURE_EXEC_DENY_INTERACTIVE_LOCKED: c_int = 11;
4555
4556pub const SECBIT_EXEC_DENY_INTERACTIVE: c_int = issecure_mask(SECURE_EXEC_DENY_INTERACTIVE);
4557pub const SECBIT_EXEC_DENY_INTERACTIVE_LOCKED: c_int =
4558 issecure_mask(SECURE_EXEC_DENY_INTERACTIVE_LOCKED);
4559
4560pub const SECUREBITS_DEFAULT: c_int = 0x00000000;
4561pub const SECURE_ALL_BITS: c_int = SECBIT_NOROOT
4562 | SECBIT_NO_SETUID_FIXUP
4563 | SECBIT_KEEP_CAPS
4564 | SECBIT_NO_CAP_AMBIENT_RAISE
4565 | SECBIT_EXEC_RESTRICT_FILE
4566 | SECBIT_EXEC_DENY_INTERACTIVE;
4567pub const SECURE_ALL_LOCKS: c_int = SECURE_ALL_BITS << 1;
4568
4569pub const SECURE_ALL_UNPRIVILEGED: c_int =
4570 issecure_mask(SECURE_EXEC_RESTRICT_FILE) | issecure_mask(SECURE_EXEC_DENY_INTERACTIVE);
4571
4572const fn issecure_mask(x: c_int) -> c_int {
4573 1 << x
4574}
4575
4576pub const IN_MASK_CREATE: u32 = 0x1000_0000;
4577pub const IN_MASK_ADD: u32 = 0x2000_0000;
4578pub const IN_ISDIR: u32 = 0x4000_0000;
4579pub const IN_ONESHOT: u32 = 0x8000_0000;
4580
4581pub const IN_ALL_EVENTS: u32 = IN_ACCESS
4582 | IN_MODIFY
4583 | IN_ATTRIB
4584 | IN_CLOSE_WRITE
4585 | IN_CLOSE_NOWRITE
4586 | IN_OPEN
4587 | IN_MOVED_FROM
4588 | IN_MOVED_TO
4589 | IN_DELETE
4590 | IN_CREATE
4591 | IN_DELETE_SELF
4592 | IN_MOVE_SELF;
4593
4594pub const IN_CLOEXEC: c_int = O_CLOEXEC;
4595pub const IN_NONBLOCK: c_int = O_NONBLOCK;
4596
4597pub const OPEN_TREE_CLONE: c_uint = 0x01;
4599pub const OPEN_TREE_CLOEXEC: c_uint = O_CLOEXEC as c_uint;
4600
4601pub const NFT_TABLE_MAXNAMELEN: c_int = 256;
4603pub const NFT_CHAIN_MAXNAMELEN: c_int = 256;
4604pub const NFT_SET_MAXNAMELEN: c_int = 256;
4605pub const NFT_OBJ_MAXNAMELEN: c_int = 256;
4606pub const NFT_USERDATA_MAXLEN: c_int = 256;
4607
4608pub const NFT_REG_VERDICT: c_int = 0;
4609pub const NFT_REG_1: c_int = 1;
4610pub const NFT_REG_2: c_int = 2;
4611pub const NFT_REG_3: c_int = 3;
4612pub const NFT_REG_4: c_int = 4;
4613pub const __NFT_REG_MAX: c_int = 5;
4614pub const NFT_REG32_00: c_int = 8;
4615pub const NFT_REG32_01: c_int = 9;
4616pub const NFT_REG32_02: c_int = 10;
4617pub const NFT_REG32_03: c_int = 11;
4618pub const NFT_REG32_04: c_int = 12;
4619pub const NFT_REG32_05: c_int = 13;
4620pub const NFT_REG32_06: c_int = 14;
4621pub const NFT_REG32_07: c_int = 15;
4622pub const NFT_REG32_08: c_int = 16;
4623pub const NFT_REG32_09: c_int = 17;
4624pub const NFT_REG32_10: c_int = 18;
4625pub const NFT_REG32_11: c_int = 19;
4626pub const NFT_REG32_12: c_int = 20;
4627pub const NFT_REG32_13: c_int = 21;
4628pub const NFT_REG32_14: c_int = 22;
4629pub const NFT_REG32_15: c_int = 23;
4630
4631pub const NFT_REG_SIZE: c_int = 16;
4632pub const NFT_REG32_SIZE: c_int = 4;
4633
4634pub const NFT_CONTINUE: c_int = -1;
4635pub const NFT_BREAK: c_int = -2;
4636pub const NFT_JUMP: c_int = -3;
4637pub const NFT_GOTO: c_int = -4;
4638pub const NFT_RETURN: c_int = -5;
4639
4640pub const NFT_MSG_NEWTABLE: c_int = 0;
4641pub const NFT_MSG_GETTABLE: c_int = 1;
4642pub const NFT_MSG_DELTABLE: c_int = 2;
4643pub const NFT_MSG_NEWCHAIN: c_int = 3;
4644pub const NFT_MSG_GETCHAIN: c_int = 4;
4645pub const NFT_MSG_DELCHAIN: c_int = 5;
4646pub const NFT_MSG_NEWRULE: c_int = 6;
4647pub const NFT_MSG_GETRULE: c_int = 7;
4648pub const NFT_MSG_DELRULE: c_int = 8;
4649pub const NFT_MSG_NEWSET: c_int = 9;
4650pub const NFT_MSG_GETSET: c_int = 10;
4651pub const NFT_MSG_DELSET: c_int = 11;
4652pub const NFT_MSG_NEWSETELEM: c_int = 12;
4653pub const NFT_MSG_GETSETELEM: c_int = 13;
4654pub const NFT_MSG_DELSETELEM: c_int = 14;
4655pub const NFT_MSG_NEWGEN: c_int = 15;
4656pub const NFT_MSG_GETGEN: c_int = 16;
4657pub const NFT_MSG_TRACE: c_int = 17;
4658cfg_if! {
4659 if #[cfg(not(target_arch = "sparc64"))] {
4660 pub const NFT_MSG_NEWOBJ: c_int = 18;
4661 pub const NFT_MSG_GETOBJ: c_int = 19;
4662 pub const NFT_MSG_DELOBJ: c_int = 20;
4663 pub const NFT_MSG_GETOBJ_RESET: c_int = 21;
4664 }
4665}
4666
4667pub const NFT_MSG_MAX: c_int = 34;
4668
4669pub const NFT_SET_ANONYMOUS: c_int = 0x1;
4670pub const NFT_SET_CONSTANT: c_int = 0x2;
4671pub const NFT_SET_INTERVAL: c_int = 0x4;
4672pub const NFT_SET_MAP: c_int = 0x8;
4673pub const NFT_SET_TIMEOUT: c_int = 0x10;
4674pub const NFT_SET_EVAL: c_int = 0x20;
4675
4676pub const NFT_SET_POL_PERFORMANCE: c_int = 0;
4677pub const NFT_SET_POL_MEMORY: c_int = 1;
4678
4679pub const NFT_SET_ELEM_INTERVAL_END: c_int = 0x1;
4680
4681pub const NFT_DATA_VALUE: c_uint = 0;
4682pub const NFT_DATA_VERDICT: c_uint = 0xffffff00;
4683
4684pub const NFT_DATA_RESERVED_MASK: c_uint = 0xffffff00;
4685
4686pub const NFT_DATA_VALUE_MAXLEN: c_int = 64;
4687
4688pub const NFT_BYTEORDER_NTOH: c_int = 0;
4689pub const NFT_BYTEORDER_HTON: c_int = 1;
4690
4691pub const NFT_CMP_EQ: c_int = 0;
4692pub const NFT_CMP_NEQ: c_int = 1;
4693pub const NFT_CMP_LT: c_int = 2;
4694pub const NFT_CMP_LTE: c_int = 3;
4695pub const NFT_CMP_GT: c_int = 4;
4696pub const NFT_CMP_GTE: c_int = 5;
4697
4698pub const NFT_RANGE_EQ: c_int = 0;
4699pub const NFT_RANGE_NEQ: c_int = 1;
4700
4701pub const NFT_LOOKUP_F_INV: c_int = 1 << 0;
4702
4703pub const NFT_DYNSET_OP_ADD: c_int = 0;
4704pub const NFT_DYNSET_OP_UPDATE: c_int = 1;
4705
4706pub const NFT_DYNSET_F_INV: c_int = 1 << 0;
4707
4708pub const NFT_PAYLOAD_LL_HEADER: c_int = 0;
4709pub const NFT_PAYLOAD_NETWORK_HEADER: c_int = 1;
4710pub const NFT_PAYLOAD_TRANSPORT_HEADER: c_int = 2;
4711
4712pub const NFT_PAYLOAD_CSUM_NONE: c_int = 0;
4713pub const NFT_PAYLOAD_CSUM_INET: c_int = 1;
4714
4715pub const NFT_META_LEN: c_int = 0;
4716pub const NFT_META_PROTOCOL: c_int = 1;
4717pub const NFT_META_PRIORITY: c_int = 2;
4718pub const NFT_META_MARK: c_int = 3;
4719pub const NFT_META_IIF: c_int = 4;
4720pub const NFT_META_OIF: c_int = 5;
4721pub const NFT_META_IIFNAME: c_int = 6;
4722pub const NFT_META_OIFNAME: c_int = 7;
4723pub const NFT_META_IIFTYPE: c_int = 8;
4724pub const NFT_META_OIFTYPE: c_int = 9;
4725pub const NFT_META_SKUID: c_int = 10;
4726pub const NFT_META_SKGID: c_int = 11;
4727pub const NFT_META_NFTRACE: c_int = 12;
4728pub const NFT_META_RTCLASSID: c_int = 13;
4729pub const NFT_META_SECMARK: c_int = 14;
4730pub const NFT_META_NFPROTO: c_int = 15;
4731pub const NFT_META_L4PROTO: c_int = 16;
4732pub const NFT_META_BRI_IIFNAME: c_int = 17;
4733pub const NFT_META_BRI_OIFNAME: c_int = 18;
4734pub const NFT_META_PKTTYPE: c_int = 19;
4735pub const NFT_META_CPU: c_int = 20;
4736pub const NFT_META_IIFGROUP: c_int = 21;
4737pub const NFT_META_OIFGROUP: c_int = 22;
4738pub const NFT_META_CGROUP: c_int = 23;
4739pub const NFT_META_PRANDOM: c_int = 24;
4740
4741pub const NFT_CT_STATE: c_int = 0;
4742pub const NFT_CT_DIRECTION: c_int = 1;
4743pub const NFT_CT_STATUS: c_int = 2;
4744pub const NFT_CT_MARK: c_int = 3;
4745pub const NFT_CT_SECMARK: c_int = 4;
4746pub const NFT_CT_EXPIRATION: c_int = 5;
4747pub const NFT_CT_HELPER: c_int = 6;
4748pub const NFT_CT_L3PROTOCOL: c_int = 7;
4749pub const NFT_CT_SRC: c_int = 8;
4750pub const NFT_CT_DST: c_int = 9;
4751pub const NFT_CT_PROTOCOL: c_int = 10;
4752pub const NFT_CT_PROTO_SRC: c_int = 11;
4753pub const NFT_CT_PROTO_DST: c_int = 12;
4754pub const NFT_CT_LABELS: c_int = 13;
4755pub const NFT_CT_PKTS: c_int = 14;
4756pub const NFT_CT_BYTES: c_int = 15;
4757pub const NFT_CT_AVGPKT: c_int = 16;
4758pub const NFT_CT_ZONE: c_int = 17;
4759pub const NFT_CT_EVENTMASK: c_int = 18;
4760pub const NFT_CT_SRC_IP: c_int = 19;
4761pub const NFT_CT_DST_IP: c_int = 20;
4762pub const NFT_CT_SRC_IP6: c_int = 21;
4763pub const NFT_CT_DST_IP6: c_int = 22;
4764
4765pub const NFT_LIMIT_PKTS: c_int = 0;
4766pub const NFT_LIMIT_PKT_BYTES: c_int = 1;
4767
4768pub const NFT_LIMIT_F_INV: c_int = 1 << 0;
4769
4770pub const NFT_QUEUE_FLAG_BYPASS: c_int = 0x01;
4771pub const NFT_QUEUE_FLAG_CPU_FANOUT: c_int = 0x02;
4772pub const NFT_QUEUE_FLAG_MASK: c_int = 0x03;
4773
4774pub const NFT_QUOTA_F_INV: c_int = 1 << 0;
4775
4776pub const NFT_REJECT_ICMP_UNREACH: c_int = 0;
4777pub const NFT_REJECT_TCP_RST: c_int = 1;
4778pub const NFT_REJECT_ICMPX_UNREACH: c_int = 2;
4779
4780pub const NFT_REJECT_ICMPX_NO_ROUTE: c_int = 0;
4781pub const NFT_REJECT_ICMPX_PORT_UNREACH: c_int = 1;
4782pub const NFT_REJECT_ICMPX_HOST_UNREACH: c_int = 2;
4783pub const NFT_REJECT_ICMPX_ADMIN_PROHIBITED: c_int = 3;
4784
4785pub const NFT_NAT_SNAT: c_int = 0;
4786pub const NFT_NAT_DNAT: c_int = 1;
4787
4788pub const NFT_TRACETYPE_UNSPEC: c_int = 0;
4789pub const NFT_TRACETYPE_POLICY: c_int = 1;
4790pub const NFT_TRACETYPE_RETURN: c_int = 2;
4791pub const NFT_TRACETYPE_RULE: c_int = 3;
4792
4793pub const NFT_NG_INCREMENTAL: c_int = 0;
4794pub const NFT_NG_RANDOM: c_int = 1;
4795
4796pub const FF_MAX: __u16 = 0x7f;
4798pub const FF_CNT: usize = FF_MAX as usize + 1;
4799
4800pub const INPUT_PROP_POINTER: __u16 = 0x00;
4802pub const INPUT_PROP_DIRECT: __u16 = 0x01;
4803pub const INPUT_PROP_BUTTONPAD: __u16 = 0x02;
4804pub const INPUT_PROP_SEMI_MT: __u16 = 0x03;
4805pub const INPUT_PROP_TOPBUTTONPAD: __u16 = 0x04;
4806pub const INPUT_PROP_POINTING_STICK: __u16 = 0x05;
4807pub const INPUT_PROP_ACCELEROMETER: __u16 = 0x06;
4808pub const INPUT_PROP_MAX: __u16 = 0x1f;
4809pub const INPUT_PROP_CNT: usize = INPUT_PROP_MAX as usize + 1;
4810pub const EV_MAX: __u16 = 0x1f;
4811pub const EV_CNT: usize = EV_MAX as usize + 1;
4812pub const SYN_MAX: __u16 = 0xf;
4813pub const SYN_CNT: usize = SYN_MAX as usize + 1;
4814pub const KEY_MAX: __u16 = 0x2ff;
4815pub const KEY_CNT: usize = KEY_MAX as usize + 1;
4816pub const REL_MAX: __u16 = 0x0f;
4817pub const REL_CNT: usize = REL_MAX as usize + 1;
4818pub const ABS_MAX: __u16 = 0x3f;
4819pub const ABS_CNT: usize = ABS_MAX as usize + 1;
4820pub const SW_MAX: __u16 = 0x10;
4821pub const SW_CNT: usize = SW_MAX as usize + 1;
4822pub const MSC_MAX: __u16 = 0x07;
4823pub const MSC_CNT: usize = MSC_MAX as usize + 1;
4824pub const LED_MAX: __u16 = 0x0f;
4825pub const LED_CNT: usize = LED_MAX as usize + 1;
4826pub const REP_MAX: __u16 = 0x01;
4827pub const REP_CNT: usize = REP_MAX as usize + 1;
4828pub const SND_MAX: __u16 = 0x07;
4829pub const SND_CNT: usize = SND_MAX as usize + 1;
4830
4831pub const UINPUT_VERSION: c_uint = 5;
4833pub const UINPUT_MAX_NAME_SIZE: usize = 80;
4834
4835pub const FAN_ACCESS: u64 = 0x0000_0001;
4837pub const FAN_MODIFY: u64 = 0x0000_0002;
4838pub const FAN_ATTRIB: u64 = 0x0000_0004;
4839pub const FAN_CLOSE_WRITE: u64 = 0x0000_0008;
4840pub const FAN_CLOSE_NOWRITE: u64 = 0x0000_0010;
4841pub const FAN_OPEN: u64 = 0x0000_0020;
4842pub const FAN_MOVED_FROM: u64 = 0x0000_0040;
4843pub const FAN_MOVED_TO: u64 = 0x0000_0080;
4844pub const FAN_CREATE: u64 = 0x0000_0100;
4845pub const FAN_DELETE: u64 = 0x0000_0200;
4846pub const FAN_DELETE_SELF: u64 = 0x0000_0400;
4847pub const FAN_MOVE_SELF: u64 = 0x0000_0800;
4848pub const FAN_OPEN_EXEC: u64 = 0x0000_1000;
4849
4850pub const FAN_Q_OVERFLOW: u64 = 0x0000_4000;
4851pub const FAN_FS_ERROR: u64 = 0x0000_8000;
4852
4853pub const FAN_OPEN_PERM: u64 = 0x0001_0000;
4854pub const FAN_ACCESS_PERM: u64 = 0x0002_0000;
4855pub const FAN_OPEN_EXEC_PERM: u64 = 0x0004_0000;
4856
4857pub const FAN_EVENT_ON_CHILD: u64 = 0x0800_0000;
4858
4859pub const FAN_RENAME: u64 = 0x1000_0000;
4860
4861pub const FAN_ONDIR: u64 = 0x4000_0000;
4862
4863pub const FAN_CLOSE: u64 = FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE;
4864pub const FAN_MOVE: u64 = FAN_MOVED_FROM | FAN_MOVED_TO;
4865
4866pub const FAN_CLOEXEC: c_uint = 0x0000_0001;
4867pub const FAN_NONBLOCK: c_uint = 0x0000_0002;
4868
4869pub const FAN_CLASS_NOTIF: c_uint = 0x0000_0000;
4870pub const FAN_CLASS_CONTENT: c_uint = 0x0000_0004;
4871pub const FAN_CLASS_PRE_CONTENT: c_uint = 0x0000_0008;
4872
4873pub const FAN_UNLIMITED_QUEUE: c_uint = 0x0000_0010;
4874pub const FAN_UNLIMITED_MARKS: c_uint = 0x0000_0020;
4875pub const FAN_ENABLE_AUDIT: c_uint = 0x0000_0040;
4876
4877pub const FAN_REPORT_PIDFD: c_uint = 0x0000_0080;
4878pub const FAN_REPORT_TID: c_uint = 0x0000_0100;
4879pub const FAN_REPORT_FID: c_uint = 0x0000_0200;
4880pub const FAN_REPORT_DIR_FID: c_uint = 0x0000_0400;
4881pub const FAN_REPORT_NAME: c_uint = 0x0000_0800;
4882pub const FAN_REPORT_TARGET_FID: c_uint = 0x0000_1000;
4883
4884pub const FAN_REPORT_DFID_NAME: c_uint = FAN_REPORT_DIR_FID | FAN_REPORT_NAME;
4885pub const FAN_REPORT_DFID_NAME_TARGET: c_uint =
4886 FAN_REPORT_DFID_NAME | FAN_REPORT_FID | FAN_REPORT_TARGET_FID;
4887
4888pub const FAN_MARK_ADD: c_uint = 0x0000_0001;
4889pub const FAN_MARK_REMOVE: c_uint = 0x0000_0002;
4890pub const FAN_MARK_DONT_FOLLOW: c_uint = 0x0000_0004;
4891pub const FAN_MARK_ONLYDIR: c_uint = 0x0000_0008;
4892pub const FAN_MARK_IGNORED_MASK: c_uint = 0x0000_0020;
4893pub const FAN_MARK_IGNORED_SURV_MODIFY: c_uint = 0x0000_0040;
4894pub const FAN_MARK_FLUSH: c_uint = 0x0000_0080;
4895pub const FAN_MARK_EVICTABLE: c_uint = 0x0000_0200;
4896pub const FAN_MARK_IGNORE: c_uint = 0x0000_0400;
4897
4898pub const FAN_MARK_INODE: c_uint = 0x0000_0000;
4899pub const FAN_MARK_MOUNT: c_uint = 0x0000_0010;
4900pub const FAN_MARK_FILESYSTEM: c_uint = 0x0000_0100;
4901
4902pub const FAN_MARK_IGNORE_SURV: c_uint = FAN_MARK_IGNORE | FAN_MARK_IGNORED_SURV_MODIFY;
4903
4904pub const FANOTIFY_METADATA_VERSION: u8 = 3;
4905
4906pub const FAN_EVENT_INFO_TYPE_FID: u8 = 1;
4907pub const FAN_EVENT_INFO_TYPE_DFID_NAME: u8 = 2;
4908pub const FAN_EVENT_INFO_TYPE_DFID: u8 = 3;
4909pub const FAN_EVENT_INFO_TYPE_PIDFD: u8 = 4;
4910pub const FAN_EVENT_INFO_TYPE_ERROR: u8 = 5;
4911
4912pub const FAN_EVENT_INFO_TYPE_OLD_DFID_NAME: u8 = 10;
4913pub const FAN_EVENT_INFO_TYPE_NEW_DFID_NAME: u8 = 12;
4914
4915pub const FAN_RESPONSE_INFO_NONE: u8 = 0;
4916pub const FAN_RESPONSE_INFO_AUDIT_RULE: u8 = 1;
4917
4918pub const FAN_ALLOW: u32 = 0x01;
4919pub const FAN_DENY: u32 = 0x02;
4920pub const FAN_AUDIT: u32 = 0x10;
4921pub const FAN_INFO: u32 = 0x20;
4922
4923pub const FAN_NOFD: c_int = -1;
4924pub const FAN_NOPIDFD: c_int = FAN_NOFD;
4925pub const FAN_EPIDFD: c_int = -2;
4926
4927pub const FUTEX_WAIT: c_int = 0;
4929pub const FUTEX_WAKE: c_int = 1;
4930pub const FUTEX_FD: c_int = 2;
4931pub const FUTEX_REQUEUE: c_int = 3;
4932pub const FUTEX_CMP_REQUEUE: c_int = 4;
4933pub const FUTEX_WAKE_OP: c_int = 5;
4934pub const FUTEX_LOCK_PI: c_int = 6;
4935pub const FUTEX_UNLOCK_PI: c_int = 7;
4936pub const FUTEX_TRYLOCK_PI: c_int = 8;
4937pub const FUTEX_WAIT_BITSET: c_int = 9;
4938pub const FUTEX_WAKE_BITSET: c_int = 10;
4939pub const FUTEX_WAIT_REQUEUE_PI: c_int = 11;
4940pub const FUTEX_CMP_REQUEUE_PI: c_int = 12;
4941pub const FUTEX_LOCK_PI2: c_int = 13;
4942
4943pub const FUTEX_PRIVATE_FLAG: c_int = 128;
4944pub const FUTEX_CLOCK_REALTIME: c_int = 256;
4945pub const FUTEX_CMD_MASK: c_int = !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME);
4946
4947pub const FUTEX_WAITERS: u32 = 0x80000000;
4948pub const FUTEX_OWNER_DIED: u32 = 0x40000000;
4949pub const FUTEX_TID_MASK: u32 = 0x3fffffff;
4950
4951pub const FUTEX_BITSET_MATCH_ANY: c_int = 0xffffffff;
4952
4953pub const FUTEX_OP_SET: c_int = 0;
4954pub const FUTEX_OP_ADD: c_int = 1;
4955pub const FUTEX_OP_OR: c_int = 2;
4956pub const FUTEX_OP_ANDN: c_int = 3;
4957pub const FUTEX_OP_XOR: c_int = 4;
4958
4959pub const FUTEX_OP_OPARG_SHIFT: c_int = 8;
4960
4961pub const FUTEX_OP_CMP_EQ: c_int = 0;
4962pub const FUTEX_OP_CMP_NE: c_int = 1;
4963pub const FUTEX_OP_CMP_LT: c_int = 2;
4964pub const FUTEX_OP_CMP_LE: c_int = 3;
4965pub const FUTEX_OP_CMP_GT: c_int = 4;
4966pub const FUTEX_OP_CMP_GE: c_int = 5;
4967
4968pub fn FUTEX_OP(op: c_int, oparg: c_int, cmp: c_int, cmparg: c_int) -> c_int {
4969 ((op & 0xf) << 28) | ((cmp & 0xf) << 24) | ((oparg & 0xfff) << 12) | (cmparg & 0xfff)
4970}
4971
4972pub const KEXEC_ON_CRASH: c_int = 0x00000001;
4974pub const KEXEC_PRESERVE_CONTEXT: c_int = 0x00000002;
4975pub const KEXEC_ARCH_MASK: c_int = 0xffff0000;
4976pub const KEXEC_FILE_UNLOAD: c_int = 0x00000001;
4977pub const KEXEC_FILE_ON_CRASH: c_int = 0x00000002;
4978pub const KEXEC_FILE_NO_INITRAMFS: c_int = 0x00000004;
4979
4980pub const LINUX_REBOOT_MAGIC1: c_int = 0xfee1dead;
4982pub const LINUX_REBOOT_MAGIC2: c_int = 672274793;
4983pub const LINUX_REBOOT_MAGIC2A: c_int = 85072278;
4984pub const LINUX_REBOOT_MAGIC2B: c_int = 369367448;
4985pub const LINUX_REBOOT_MAGIC2C: c_int = 537993216;
4986
4987pub const LINUX_REBOOT_CMD_RESTART: c_int = 0x01234567;
4988pub const LINUX_REBOOT_CMD_HALT: c_int = 0xCDEF0123;
4989pub const LINUX_REBOOT_CMD_CAD_ON: c_int = 0x89ABCDEF;
4990pub const LINUX_REBOOT_CMD_CAD_OFF: c_int = 0x00000000;
4991pub const LINUX_REBOOT_CMD_POWER_OFF: c_int = 0x4321FEDC;
4992pub const LINUX_REBOOT_CMD_RESTART2: c_int = 0xA1B2C3D4;
4993pub const LINUX_REBOOT_CMD_SW_SUSPEND: c_int = 0xD000FCE2;
4994pub const LINUX_REBOOT_CMD_KEXEC: c_int = 0x45584543;
4995
4996pub const REG_EXTENDED: c_int = 1;
4997pub const REG_ICASE: c_int = 2;
4998pub const REG_NEWLINE: c_int = 4;
4999pub const REG_NOSUB: c_int = 8;
5000
5001pub const REG_NOTBOL: c_int = 1;
5002pub const REG_NOTEOL: c_int = 2;
5003
5004pub const REG_ENOSYS: c_int = -1;
5005pub const REG_NOMATCH: c_int = 1;
5006pub const REG_BADPAT: c_int = 2;
5007pub const REG_ECOLLATE: c_int = 3;
5008pub const REG_ECTYPE: c_int = 4;
5009pub const REG_EESCAPE: c_int = 5;
5010pub const REG_ESUBREG: c_int = 6;
5011pub const REG_EBRACK: c_int = 7;
5012pub const REG_EPAREN: c_int = 8;
5013pub const REG_EBRACE: c_int = 9;
5014pub const REG_BADBR: c_int = 10;
5015pub const REG_ERANGE: c_int = 11;
5016pub const REG_ESPACE: c_int = 12;
5017pub const REG_BADRPT: c_int = 13;
5018
5019pub const SO_EE_ORIGIN_NONE: u8 = 0;
5021pub const SO_EE_ORIGIN_LOCAL: u8 = 1;
5022pub const SO_EE_ORIGIN_ICMP: u8 = 2;
5023pub const SO_EE_ORIGIN_ICMP6: u8 = 3;
5024pub const SO_EE_ORIGIN_TXSTATUS: u8 = 4;
5025pub const SO_EE_ORIGIN_TIMESTAMPING: u8 = SO_EE_ORIGIN_TXSTATUS;
5026
5027pub const EPERM: c_int = 1;
5029pub const ENOENT: c_int = 2;
5030pub const ESRCH: c_int = 3;
5031pub const EINTR: c_int = 4;
5032pub const EIO: c_int = 5;
5033pub const ENXIO: c_int = 6;
5034pub const E2BIG: c_int = 7;
5035pub const ENOEXEC: c_int = 8;
5036pub const EBADF: c_int = 9;
5037pub const ECHILD: c_int = 10;
5038pub const EAGAIN: c_int = 11;
5039pub const ENOMEM: c_int = 12;
5040pub const EACCES: c_int = 13;
5041pub const EFAULT: c_int = 14;
5042pub const ENOTBLK: c_int = 15;
5043pub const EBUSY: c_int = 16;
5044pub const EEXIST: c_int = 17;
5045pub const EXDEV: c_int = 18;
5046pub const ENODEV: c_int = 19;
5047pub const ENOTDIR: c_int = 20;
5048pub const EISDIR: c_int = 21;
5049pub const EINVAL: c_int = 22;
5050pub const ENFILE: c_int = 23;
5051pub const EMFILE: c_int = 24;
5052pub const ENOTTY: c_int = 25;
5053pub const ETXTBSY: c_int = 26;
5054pub const EFBIG: c_int = 27;
5055pub const ENOSPC: c_int = 28;
5056pub const ESPIPE: c_int = 29;
5057pub const EROFS: c_int = 30;
5058pub const EMLINK: c_int = 31;
5059pub const EPIPE: c_int = 32;
5060pub const EDOM: c_int = 33;
5061pub const ERANGE: c_int = 34;
5062pub const EWOULDBLOCK: c_int = EAGAIN;
5063
5064pub const SCTP_FUTURE_ASSOC: c_int = 0;
5066pub const SCTP_CURRENT_ASSOC: c_int = 1;
5067pub const SCTP_ALL_ASSOC: c_int = 2;
5068pub const SCTP_RTOINFO: c_int = 0;
5069pub const SCTP_ASSOCINFO: c_int = 1;
5070pub const SCTP_INITMSG: c_int = 2;
5071pub const SCTP_NODELAY: c_int = 3;
5072pub const SCTP_AUTOCLOSE: c_int = 4;
5073pub const SCTP_SET_PEER_PRIMARY_ADDR: c_int = 5;
5074pub const SCTP_PRIMARY_ADDR: c_int = 6;
5075pub const SCTP_ADAPTATION_LAYER: c_int = 7;
5076pub const SCTP_DISABLE_FRAGMENTS: c_int = 8;
5077pub const SCTP_PEER_ADDR_PARAMS: c_int = 9;
5078pub const SCTP_DEFAULT_SEND_PARAM: c_int = 10;
5079pub const SCTP_EVENTS: c_int = 11;
5080pub const SCTP_I_WANT_MAPPED_V4_ADDR: c_int = 12;
5081pub const SCTP_MAXSEG: c_int = 13;
5082pub const SCTP_STATUS: c_int = 14;
5083pub const SCTP_GET_PEER_ADDR_INFO: c_int = 15;
5084pub const SCTP_DELAYED_ACK_TIME: c_int = 16;
5085pub const SCTP_DELAYED_ACK: c_int = SCTP_DELAYED_ACK_TIME;
5086pub const SCTP_DELAYED_SACK: c_int = SCTP_DELAYED_ACK_TIME;
5087pub const SCTP_CONTEXT: c_int = 17;
5088pub const SCTP_FRAGMENT_INTERLEAVE: c_int = 18;
5089pub const SCTP_PARTIAL_DELIVERY_POINT: c_int = 19;
5090pub const SCTP_MAX_BURST: c_int = 20;
5091pub const SCTP_AUTH_CHUNK: c_int = 21;
5092pub const SCTP_HMAC_IDENT: c_int = 22;
5093pub const SCTP_AUTH_KEY: c_int = 23;
5094pub const SCTP_AUTH_ACTIVE_KEY: c_int = 24;
5095pub const SCTP_AUTH_DELETE_KEY: c_int = 25;
5096pub const SCTP_PEER_AUTH_CHUNKS: c_int = 26;
5097pub const SCTP_LOCAL_AUTH_CHUNKS: c_int = 27;
5098pub const SCTP_GET_ASSOC_NUMBER: c_int = 28;
5099pub const SCTP_GET_ASSOC_ID_LIST: c_int = 29;
5100pub const SCTP_AUTO_ASCONF: c_int = 30;
5101pub const SCTP_PEER_ADDR_THLDS: c_int = 31;
5102pub const SCTP_RECVRCVINFO: c_int = 32;
5103pub const SCTP_RECVNXTINFO: c_int = 33;
5104pub const SCTP_DEFAULT_SNDINFO: c_int = 34;
5105pub const SCTP_AUTH_DEACTIVATE_KEY: c_int = 35;
5106pub const SCTP_REUSE_PORT: c_int = 36;
5107pub const SCTP_PEER_ADDR_THLDS_V2: c_int = 37;
5108pub const SCTP_PR_SCTP_NONE: c_int = 0x0000;
5109pub const SCTP_PR_SCTP_TTL: c_int = 0x0010;
5110pub const SCTP_PR_SCTP_RTX: c_int = 0x0020;
5111pub const SCTP_PR_SCTP_PRIO: c_int = 0x0030;
5112pub const SCTP_PR_SCTP_MAX: c_int = SCTP_PR_SCTP_PRIO;
5113pub const SCTP_PR_SCTP_MASK: c_int = 0x0030;
5114pub const SCTP_ENABLE_RESET_STREAM_REQ: c_int = 0x01;
5115pub const SCTP_ENABLE_RESET_ASSOC_REQ: c_int = 0x02;
5116pub const SCTP_ENABLE_CHANGE_ASSOC_REQ: c_int = 0x04;
5117pub const SCTP_ENABLE_STRRESET_MASK: c_int = 0x07;
5118pub const SCTP_STREAM_RESET_INCOMING: c_int = 0x01;
5119pub const SCTP_STREAM_RESET_OUTGOING: c_int = 0x02;
5120
5121pub const SCTP_INIT: c_int = 0;
5122pub const SCTP_SNDRCV: c_int = 1;
5123pub const SCTP_SNDINFO: c_int = 2;
5124pub const SCTP_RCVINFO: c_int = 3;
5125pub const SCTP_NXTINFO: c_int = 4;
5126pub const SCTP_PRINFO: c_int = 5;
5127pub const SCTP_AUTHINFO: c_int = 6;
5128pub const SCTP_DSTADDRV4: c_int = 7;
5129pub const SCTP_DSTADDRV6: c_int = 8;
5130
5131pub const SCTP_UNORDERED: c_int = 1 << 0;
5132pub const SCTP_ADDR_OVER: c_int = 1 << 1;
5133pub const SCTP_ABORT: c_int = 1 << 2;
5134pub const SCTP_SACK_IMMEDIATELY: c_int = 1 << 3;
5135pub const SCTP_SENDALL: c_int = 1 << 6;
5136pub const SCTP_PR_SCTP_ALL: c_int = 1 << 7;
5137pub const SCTP_NOTIFICATION: c_int = MSG_NOTIFICATION;
5138pub const SCTP_EOF: c_int = crate::MSG_FIN;
5139
5140pub const DCCP_SOCKOPT_PACKET_SIZE: c_int = 1;
5142pub const DCCP_SOCKOPT_SERVICE: c_int = 2;
5143pub const DCCP_SOCKOPT_CHANGE_L: c_int = 3;
5144pub const DCCP_SOCKOPT_CHANGE_R: c_int = 4;
5145pub const DCCP_SOCKOPT_GET_CUR_MPS: c_int = 5;
5146pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: c_int = 6;
5147pub const DCCP_SOCKOPT_SEND_CSCOV: c_int = 10;
5148pub const DCCP_SOCKOPT_RECV_CSCOV: c_int = 11;
5149pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: c_int = 12;
5150pub const DCCP_SOCKOPT_CCID: c_int = 13;
5151pub const DCCP_SOCKOPT_TX_CCID: c_int = 14;
5152pub const DCCP_SOCKOPT_RX_CCID: c_int = 15;
5153pub const DCCP_SOCKOPT_QPOLICY_ID: c_int = 16;
5154pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: c_int = 17;
5155pub const DCCP_SOCKOPT_CCID_RX_INFO: c_int = 128;
5156pub const DCCP_SOCKOPT_CCID_TX_INFO: c_int = 192;
5157
5158pub const DCCP_SERVICE_LIST_MAX_LEN: c_int = 32;
5160
5161pub const CTL_KERN: c_int = 1;
5162pub const CTL_VM: c_int = 2;
5163pub const CTL_NET: c_int = 3;
5164pub const CTL_FS: c_int = 5;
5165pub const CTL_DEBUG: c_int = 6;
5166pub const CTL_DEV: c_int = 7;
5167pub const CTL_BUS: c_int = 8;
5168pub const CTL_ABI: c_int = 9;
5169pub const CTL_CPU: c_int = 10;
5170
5171pub const CTL_BUS_ISA: c_int = 1;
5172
5173pub const INOTIFY_MAX_USER_INSTANCES: c_int = 1;
5174pub const INOTIFY_MAX_USER_WATCHES: c_int = 2;
5175pub const INOTIFY_MAX_QUEUED_EVENTS: c_int = 3;
5176
5177pub const KERN_OSTYPE: c_int = 1;
5178pub const KERN_OSRELEASE: c_int = 2;
5179pub const KERN_OSREV: c_int = 3;
5180pub const KERN_VERSION: c_int = 4;
5181pub const KERN_SECUREMASK: c_int = 5;
5182pub const KERN_PROF: c_int = 6;
5183pub const KERN_NODENAME: c_int = 7;
5184pub const KERN_DOMAINNAME: c_int = 8;
5185pub const KERN_PANIC: c_int = 15;
5186pub const KERN_REALROOTDEV: c_int = 16;
5187pub const KERN_SPARC_REBOOT: c_int = 21;
5188pub const KERN_CTLALTDEL: c_int = 22;
5189pub const KERN_PRINTK: c_int = 23;
5190pub const KERN_NAMETRANS: c_int = 24;
5191pub const KERN_PPC_HTABRECLAIM: c_int = 25;
5192pub const KERN_PPC_ZEROPAGED: c_int = 26;
5193pub const KERN_PPC_POWERSAVE_NAP: c_int = 27;
5194pub const KERN_MODPROBE: c_int = 28;
5195pub const KERN_SG_BIG_BUFF: c_int = 29;
5196pub const KERN_ACCT: c_int = 30;
5197pub const KERN_PPC_L2CR: c_int = 31;
5198pub const KERN_RTSIGNR: c_int = 32;
5199pub const KERN_RTSIGMAX: c_int = 33;
5200pub const KERN_SHMMAX: c_int = 34;
5201pub const KERN_MSGMAX: c_int = 35;
5202pub const KERN_MSGMNB: c_int = 36;
5203pub const KERN_MSGPOOL: c_int = 37;
5204pub const KERN_SYSRQ: c_int = 38;
5205pub const KERN_MAX_THREADS: c_int = 39;
5206pub const KERN_RANDOM: c_int = 40;
5207pub const KERN_SHMALL: c_int = 41;
5208pub const KERN_MSGMNI: c_int = 42;
5209pub const KERN_SEM: c_int = 43;
5210pub const KERN_SPARC_STOP_A: c_int = 44;
5211pub const KERN_SHMMNI: c_int = 45;
5212pub const KERN_OVERFLOWUID: c_int = 46;
5213pub const KERN_OVERFLOWGID: c_int = 47;
5214pub const KERN_SHMPATH: c_int = 48;
5215pub const KERN_HOTPLUG: c_int = 49;
5216pub const KERN_IEEE_EMULATION_WARNINGS: c_int = 50;
5217pub const KERN_S390_USER_DEBUG_LOGGING: c_int = 51;
5218pub const KERN_CORE_USES_PID: c_int = 52;
5219pub const KERN_TAINTED: c_int = 53;
5220pub const KERN_CADPID: c_int = 54;
5221pub const KERN_PIDMAX: c_int = 55;
5222pub const KERN_CORE_PATTERN: c_int = 56;
5223pub const KERN_PANIC_ON_OOPS: c_int = 57;
5224pub const KERN_HPPA_PWRSW: c_int = 58;
5225pub const KERN_HPPA_UNALIGNED: c_int = 59;
5226pub const KERN_PRINTK_RATELIMIT: c_int = 60;
5227pub const KERN_PRINTK_RATELIMIT_BURST: c_int = 61;
5228pub const KERN_PTY: c_int = 62;
5229pub const KERN_NGROUPS_MAX: c_int = 63;
5230pub const KERN_SPARC_SCONS_PWROFF: c_int = 64;
5231pub const KERN_HZ_TIMER: c_int = 65;
5232pub const KERN_UNKNOWN_NMI_PANIC: c_int = 66;
5233pub const KERN_BOOTLOADER_TYPE: c_int = 67;
5234pub const KERN_RANDOMIZE: c_int = 68;
5235pub const KERN_SETUID_DUMPABLE: c_int = 69;
5236pub const KERN_SPIN_RETRY: c_int = 70;
5237pub const KERN_ACPI_VIDEO_FLAGS: c_int = 71;
5238pub const KERN_IA64_UNALIGNED: c_int = 72;
5239pub const KERN_COMPAT_LOG: c_int = 73;
5240pub const KERN_MAX_LOCK_DEPTH: c_int = 74;
5241pub const KERN_NMI_WATCHDOG: c_int = 75;
5242pub const KERN_PANIC_ON_NMI: c_int = 76;
5243
5244pub const VM_OVERCOMMIT_MEMORY: c_int = 5;
5245pub const VM_PAGE_CLUSTER: c_int = 10;
5246pub const VM_DIRTY_BACKGROUND: c_int = 11;
5247pub const VM_DIRTY_RATIO: c_int = 12;
5248pub const VM_DIRTY_WB_CS: c_int = 13;
5249pub const VM_DIRTY_EXPIRE_CS: c_int = 14;
5250pub const VM_NR_PDFLUSH_THREADS: c_int = 15;
5251pub const VM_OVERCOMMIT_RATIO: c_int = 16;
5252pub const VM_PAGEBUF: c_int = 17;
5253pub const VM_HUGETLB_PAGES: c_int = 18;
5254pub const VM_SWAPPINESS: c_int = 19;
5255pub const VM_LOWMEM_RESERVE_RATIO: c_int = 20;
5256pub const VM_MIN_FREE_KBYTES: c_int = 21;
5257pub const VM_MAX_MAP_COUNT: c_int = 22;
5258pub const VM_LAPTOP_MODE: c_int = 23;
5259pub const VM_BLOCK_DUMP: c_int = 24;
5260pub const VM_HUGETLB_GROUP: c_int = 25;
5261pub const VM_VFS_CACHE_PRESSURE: c_int = 26;
5262pub const VM_LEGACY_VA_LAYOUT: c_int = 27;
5263pub const VM_SWAP_TOKEN_TIMEOUT: c_int = 28;
5264pub const VM_DROP_PAGECACHE: c_int = 29;
5265pub const VM_PERCPU_PAGELIST_FRACTION: c_int = 30;
5266pub const VM_ZONE_RECLAIM_MODE: c_int = 31;
5267pub const VM_MIN_UNMAPPED: c_int = 32;
5268pub const VM_PANIC_ON_OOM: c_int = 33;
5269pub const VM_VDSO_ENABLED: c_int = 34;
5270pub const VM_MIN_SLAB: c_int = 35;
5271
5272pub const NET_CORE: c_int = 1;
5273pub const NET_ETHER: c_int = 2;
5274pub const NET_802: c_int = 3;
5275pub const NET_UNIX: c_int = 4;
5276pub const NET_IPV4: c_int = 5;
5277pub const NET_IPX: c_int = 6;
5278pub const NET_ATALK: c_int = 7;
5279pub const NET_NETROM: c_int = 8;
5280pub const NET_AX25: c_int = 9;
5281pub const NET_BRIDGE: c_int = 10;
5282pub const NET_ROSE: c_int = 11;
5283pub const NET_IPV6: c_int = 12;
5284pub const NET_X25: c_int = 13;
5285pub const NET_TR: c_int = 14;
5286pub const NET_DECNET: c_int = 15;
5287pub const NET_ECONET: c_int = 16;
5288pub const NET_SCTP: c_int = 17;
5289pub const NET_LLC: c_int = 18;
5290pub const NET_NETFILTER: c_int = 19;
5291pub const NET_DCCP: c_int = 20;
5292pub const NET_IRDA: c_int = 412;
5293
5294pub const PF_VCPU: c_int = 0x00000001;
5297pub const PF_IDLE: c_int = 0x00000002;
5299pub const PF_EXITING: c_int = 0x00000004;
5301pub const PF_POSTCOREDUMP: c_int = 0x00000008;
5303pub const PF_IO_WORKER: c_int = 0x00000010;
5305pub const PF_WQ_WORKER: c_int = 0x00000020;
5307pub const PF_FORKNOEXEC: c_int = 0x00000040;
5309pub const PF_MCE_PROCESS: c_int = 0x00000080;
5311pub const PF_SUPERPRIV: c_int = 0x00000100;
5313pub const PF_DUMPCORE: c_int = 0x00000200;
5315pub const PF_SIGNALED: c_int = 0x00000400;
5317pub const PF_MEMALLOC: c_int = 0x00000800;
5321pub const PF_NPROC_EXCEEDED: c_int = 0x00001000;
5323pub const PF_USED_MATH: c_int = 0x00002000;
5325pub const PF_USER_WORKER: c_int = 0x00004000;
5327pub const PF_NOFREEZE: c_int = 0x00008000;
5329pub const PF_KSWAPD: c_int = 0x00020000;
5331pub const PF_MEMALLOC_NOFS: c_int = 0x00040000;
5335pub const PF_MEMALLOC_NOIO: c_int = 0x00080000;
5339pub const PF_LOCAL_THROTTLE: c_int = 0x00100000;
5342pub const PF_KTHREAD: c_int = 0x00200000;
5344pub const PF_RANDOMIZE: c_int = 0x00400000;
5346pub const PF_NO_SETAFFINITY: c_int = 0x04000000;
5348pub const PF_MCE_EARLY: c_int = 0x08000000;
5350pub const PF_MEMALLOC_PIN: c_int = 0x10000000;
5354pub const PF_BLOCK_TS: c_int = 0x20000000;
5356pub const PF_SUSPEND_TASK: c_int = PF_SUSPEND_TASK_UINT as _;
5358const PF_SUSPEND_TASK_UINT: c_uint = 0x80000000;
5364
5365pub const CSIGNAL: c_int = 0x000000ff;
5366
5367pub const SCHED_NORMAL: c_int = 0;
5368pub const SCHED_OTHER: c_int = 0;
5369pub const SCHED_FIFO: c_int = 1;
5370pub const SCHED_RR: c_int = 2;
5371pub const SCHED_BATCH: c_int = 3;
5372pub const SCHED_IDLE: c_int = 5;
5373pub const SCHED_DEADLINE: c_int = 6;
5374
5375pub const SCHED_RESET_ON_FORK: c_int = 0x40000000;
5376
5377pub const CLONE_PIDFD: c_int = 0x1000;
5378
5379pub const SCHED_FLAG_RESET_ON_FORK: c_int = 0x01;
5380pub const SCHED_FLAG_RECLAIM: c_int = 0x02;
5381pub const SCHED_FLAG_DL_OVERRUN: c_int = 0x04;
5382pub const SCHED_FLAG_KEEP_POLICY: c_int = 0x08;
5383pub const SCHED_FLAG_KEEP_PARAMS: c_int = 0x10;
5384pub const SCHED_FLAG_UTIL_CLAMP_MIN: c_int = 0x20;
5385pub const SCHED_FLAG_UTIL_CLAMP_MAX: c_int = 0x40;
5386
5387pub const XDP_SHARED_UMEM: crate::__u16 = 1 << 0;
5389pub const XDP_COPY: crate::__u16 = 1 << 1;
5390pub const XDP_ZEROCOPY: crate::__u16 = 1 << 2;
5391pub const XDP_USE_NEED_WAKEUP: crate::__u16 = 1 << 3;
5392pub const XDP_USE_SG: crate::__u16 = 1 << 4;
5393
5394pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: crate::__u32 = 1 << 0;
5395
5396pub const XDP_RING_NEED_WAKEUP: crate::__u32 = 1 << 0;
5397
5398pub const XDP_MMAP_OFFSETS: c_int = 1;
5399pub const XDP_RX_RING: c_int = 2;
5400pub const XDP_TX_RING: c_int = 3;
5401pub const XDP_UMEM_REG: c_int = 4;
5402pub const XDP_UMEM_FILL_RING: c_int = 5;
5403pub const XDP_UMEM_COMPLETION_RING: c_int = 6;
5404pub const XDP_STATISTICS: c_int = 7;
5405pub const XDP_OPTIONS: c_int = 8;
5406
5407pub const XDP_OPTIONS_ZEROCOPY: crate::__u32 = 1 << 0;
5408
5409pub const XDP_PGOFF_RX_RING: crate::off_t = 0;
5410pub const XDP_PGOFF_TX_RING: crate::off_t = 0x80000000;
5411pub const XDP_UMEM_PGOFF_FILL_RING: crate::c_ulonglong = 0x100000000;
5412pub const XDP_UMEM_PGOFF_COMPLETION_RING: crate::c_ulonglong = 0x180000000;
5413
5414pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: crate::c_int = 48;
5415pub const XSK_UNALIGNED_BUF_ADDR_MASK: crate::c_ulonglong =
5416 (1 << XSK_UNALIGNED_BUF_OFFSET_SHIFT) - 1;
5417
5418pub const XDP_PKT_CONTD: crate::__u32 = 1 << 0;
5419
5420pub const XDP_UMEM_TX_SW_CSUM: crate::__u32 = 1 << 1;
5421pub const XDP_UMEM_TX_METADATA_LEN: crate::__u32 = 1 << 2;
5422
5423pub const XDP_TXMD_FLAGS_TIMESTAMP: crate::__u32 = 1 << 0;
5424pub const XDP_TXMD_FLAGS_CHECKSUM: crate::__u32 = 1 << 1;
5425
5426pub const XDP_TX_METADATA: crate::__u32 = 1 << 1;
5427
5428pub const SOL_XDP: c_int = 283;
5429
5430pub const MOUNT_ATTR_RDONLY: crate::__u64 = 0x00000001;
5432pub const MOUNT_ATTR_NOSUID: crate::__u64 = 0x00000002;
5433pub const MOUNT_ATTR_NODEV: crate::__u64 = 0x00000004;
5434pub const MOUNT_ATTR_NOEXEC: crate::__u64 = 0x00000008;
5435pub const MOUNT_ATTR__ATIME: crate::__u64 = 0x00000070;
5436pub const MOUNT_ATTR_RELATIME: crate::__u64 = 0x00000000;
5437pub const MOUNT_ATTR_NOATIME: crate::__u64 = 0x00000010;
5438pub const MOUNT_ATTR_STRICTATIME: crate::__u64 = 0x00000020;
5439pub const MOUNT_ATTR_NODIRATIME: crate::__u64 = 0x00000080;
5440pub const MOUNT_ATTR_IDMAP: crate::__u64 = 0x00100000;
5441pub const MOUNT_ATTR_NOSYMFOLLOW: crate::__u64 = 0x00200000;
5442
5443pub const MOUNT_ATTR_SIZE_VER0: c_int = 32;
5444
5445pub const NT_PRSTATUS: c_int = 1;
5447pub const NT_PRFPREG: c_int = 2;
5448pub const NT_FPREGSET: c_int = 2;
5449pub const NT_PRPSINFO: c_int = 3;
5450pub const NT_PRXREG: c_int = 4;
5451pub const NT_TASKSTRUCT: c_int = 4;
5452pub const NT_PLATFORM: c_int = 5;
5453pub const NT_AUXV: c_int = 6;
5454pub const NT_GWINDOWS: c_int = 7;
5455pub const NT_ASRS: c_int = 8;
5456pub const NT_PSTATUS: c_int = 10;
5457pub const NT_PSINFO: c_int = 13;
5458pub const NT_PRCRED: c_int = 14;
5459pub const NT_UTSNAME: c_int = 15;
5460pub const NT_LWPSTATUS: c_int = 16;
5461pub const NT_LWPSINFO: c_int = 17;
5462pub const NT_PRFPXREG: c_int = 20;
5463
5464pub const SCHED_FLAG_KEEP_ALL: c_int = SCHED_FLAG_KEEP_POLICY | SCHED_FLAG_KEEP_PARAMS;
5465
5466pub const SCHED_FLAG_UTIL_CLAMP: c_int = SCHED_FLAG_UTIL_CLAMP_MIN | SCHED_FLAG_UTIL_CLAMP_MAX;
5467
5468pub const SCHED_FLAG_ALL: c_int = SCHED_FLAG_RESET_ON_FORK
5469 | SCHED_FLAG_RECLAIM
5470 | SCHED_FLAG_DL_OVERRUN
5471 | SCHED_FLAG_KEEP_ALL
5472 | SCHED_FLAG_UTIL_CLAMP;
5473
5474pub const EPIOCSPARAMS: Ioctl = 0x40088a01;
5476pub const EPIOCGPARAMS: Ioctl = 0x80088a02;
5477
5478pub const SI_DETHREAD: c_int = -7;
5480pub const TRAP_PERF: c_int = 6;
5481
5482f! {
5483 pub fn NLA_ALIGN(len: c_int) -> c_int {
5484 return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1);
5485 }
5486
5487 pub fn CMSG_NXTHDR(
5488 mhdr: *const crate::msghdr,
5489 cmsg: *const crate::cmsghdr,
5490 ) -> *mut crate::cmsghdr {
5491 if ((*cmsg).cmsg_len as usize) < size_of::<crate::cmsghdr>() {
5492 return core::ptr::null_mut::<crate::cmsghdr>();
5493 }
5494 let next =
5495 (cmsg as usize + super::CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut crate::cmsghdr;
5496 let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize;
5497 if (next.wrapping_offset(1)) as usize > max
5498 || next as usize + super::CMSG_ALIGN((*next).cmsg_len as usize) > max
5499 {
5500 core::ptr::null_mut::<crate::cmsghdr>()
5501 } else {
5502 next
5503 }
5504 }
5505
5506 pub fn CPU_ALLOC_SIZE(count: c_int) -> size_t {
5507 let _dummy: cpu_set_t = mem::zeroed();
5508 let size_in_bits = 8 * size_of_val(&_dummy.bits[0]);
5509 ((count as size_t + size_in_bits - 1) / 8) as size_t
5510 }
5511
5512 pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
5513 for slot in &mut cpuset.bits {
5514 *slot = 0;
5515 }
5516 }
5517
5518 pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
5519 let size_in_bits = 8 * size_of_val(&cpuset.bits[0]); let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
5521 cpuset.bits[idx] |= 1 << offset;
5522 }
5523
5524 pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
5525 let size_in_bits = 8 * size_of_val(&cpuset.bits[0]); let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
5527 cpuset.bits[idx] &= !(1 << offset);
5528 }
5529
5530 pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
5531 let size_in_bits = 8 * size_of_val(&cpuset.bits[0]);
5532 let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
5533 0 != (cpuset.bits[idx] & (1 << offset))
5534 }
5535
5536 pub fn CPU_COUNT_S(size: usize, cpuset: &cpu_set_t) -> c_int {
5537 let mut s: u32 = 0;
5538 let size_of_mask = size_of_val(&cpuset.bits[0]);
5539 for i in &cpuset.bits[..(size / size_of_mask)] {
5540 s += i.count_ones();
5541 }
5542 s as c_int
5543 }
5544
5545 pub fn CPU_COUNT(cpuset: &cpu_set_t) -> c_int {
5546 CPU_COUNT_S(size_of::<cpu_set_t>(), cpuset)
5547 }
5548
5549 pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
5550 set1.bits == set2.bits
5551 }
5552
5553 pub fn SCTP_PR_INDEX(policy: c_int) -> c_int {
5554 policy >> (4 - 1)
5555 }
5556
5557 pub fn SCTP_PR_POLICY(policy: c_int) -> c_int {
5558 policy & SCTP_PR_SCTP_MASK
5559 }
5560
5561 pub fn SCTP_PR_SET_POLICY(flags: &mut c_int, policy: c_int) -> () {
5562 *flags &= !SCTP_PR_SCTP_MASK;
5563 *flags |= policy;
5564 }
5565
5566 pub fn IPTOS_TOS(tos: u8) -> u8 {
5567 tos & IPTOS_TOS_MASK
5568 }
5569
5570 pub fn IPTOS_PREC(tos: u8) -> u8 {
5571 tos & IPTOS_PREC_MASK
5572 }
5573
5574 pub fn RT_TOS(tos: u8) -> u8 {
5575 tos & crate::IPTOS_TOS_MASK
5576 }
5577
5578 pub fn RT_ADDRCLASS(flags: u32) -> u32 {
5579 flags >> 23
5580 }
5581
5582 pub fn RT_LOCALADDR(flags: u32) -> bool {
5583 (flags & RTF_ADDRCLASSMASK) == (RTF_LOCAL | RTF_INTERFACE)
5584 }
5585
5586 pub fn SO_EE_OFFENDER(ee: *const crate::sock_extended_err) -> *mut crate::sockaddr {
5587 ee.offset(1) as *mut crate::sockaddr
5588 }
5589
5590 pub fn TPACKET_ALIGN(x: usize) -> usize {
5591 (x + TPACKET_ALIGNMENT - 1) & !(TPACKET_ALIGNMENT - 1)
5592 }
5593
5594 pub fn BPF_CLASS(code: __u32) -> __u32 {
5595 code & 0x07
5596 }
5597
5598 pub fn BPF_SIZE(code: __u32) -> __u32 {
5599 code & 0x18
5600 }
5601
5602 pub fn BPF_MODE(code: __u32) -> __u32 {
5603 code & 0xe0
5604 }
5605
5606 pub fn BPF_OP(code: __u32) -> __u32 {
5607 code & 0xf0
5608 }
5609
5610 pub fn BPF_SRC(code: __u32) -> __u32 {
5611 code & 0x08
5612 }
5613
5614 pub fn BPF_RVAL(code: __u32) -> __u32 {
5615 code & 0x18
5616 }
5617
5618 pub fn BPF_MISCOP(code: __u32) -> __u32 {
5619 code & 0xf8
5620 }
5621
5622 pub fn BPF_STMT(code: __u16, k: __u32) -> sock_filter {
5623 sock_filter {
5624 code,
5625 jt: 0,
5626 jf: 0,
5627 k,
5628 }
5629 }
5630
5631 pub fn BPF_JUMP(code: __u16, k: __u32, jt: __u8, jf: __u8) -> sock_filter {
5632 sock_filter { code, jt, jf, k }
5633 }
5634
5635 pub fn ELF32_R_SYM(val: Elf32_Word) -> Elf32_Word {
5636 val >> 8
5637 }
5638
5639 pub fn ELF32_R_TYPE(val: Elf32_Word) -> Elf32_Word {
5640 val & 0xff
5641 }
5642
5643 pub fn ELF32_R_INFO(sym: Elf32_Word, t: Elf32_Word) -> Elf32_Word {
5644 sym << (8 + t) & 0xff
5645 }
5646
5647 pub fn ELF64_R_SYM(val: Elf64_Xword) -> Elf64_Xword {
5648 val >> 32
5649 }
5650
5651 pub fn ELF64_R_TYPE(val: Elf64_Xword) -> Elf64_Xword {
5652 val & 0xffffffff
5653 }
5654
5655 pub fn ELF64_R_INFO(sym: Elf64_Xword, t: Elf64_Xword) -> Elf64_Xword {
5656 sym << (32 + t)
5657 }
5658}
5659
5660safe_f! {
5661 pub const fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t {
5662 let major = major as crate::dev_t;
5663 let minor = minor as crate::dev_t;
5664 let mut dev = 0;
5665 dev |= (major & 0x00000fff) << 8;
5666 dev |= (major & 0xfffff000) << 32;
5667 dev |= (minor & 0x000000ff) << 0;
5668 dev |= (minor & 0xffffff00) << 12;
5669 dev
5670 }
5671
5672 pub const fn major(dev: crate::dev_t) -> c_uint {
5673 let mut major = 0;
5674 major |= (dev & 0x00000000000fff00) >> 8;
5675 major |= (dev & 0xfffff00000000000) >> 32;
5676 major as c_uint
5677 }
5678
5679 pub const fn minor(dev: crate::dev_t) -> c_uint {
5680 let mut minor = 0;
5681 minor |= (dev & 0x00000000000000ff) >> 0;
5682 minor |= (dev & 0x00000ffffff00000) >> 12;
5683 minor as c_uint
5684 }
5685
5686 pub const fn SCTP_PR_TTL_ENABLED(policy: c_int) -> bool {
5687 policy == SCTP_PR_SCTP_TTL
5688 }
5689
5690 pub const fn SCTP_PR_RTX_ENABLED(policy: c_int) -> bool {
5691 policy == SCTP_PR_SCTP_RTX
5692 }
5693
5694 pub const fn SCTP_PR_PRIO_ENABLED(policy: c_int) -> bool {
5695 policy == SCTP_PR_SCTP_PRIO
5696 }
5697}
5698
5699cfg_if! {
5700 if #[cfg(all(
5701 any(target_env = "gnu", target_env = "musl", target_env = "ohos"),
5702 any(target_arch = "x86_64", target_arch = "x86")
5703 ))] {
5704 extern "C" {
5705 pub fn iopl(level: c_int) -> c_int;
5706 pub fn ioperm(from: c_ulong, num: c_ulong, turn_on: c_int) -> c_int;
5707 }
5708 }
5709}
5710
5711cfg_if! {
5712 if #[cfg(all(not(target_env = "uclibc"), not(target_env = "ohos")))] {
5713 extern "C" {
5714 #[cfg_attr(gnu_file_offset_bits64, link_name = "aio_read64")]
5715 pub fn aio_read(aiocbp: *mut aiocb) -> c_int;
5716 #[cfg_attr(gnu_file_offset_bits64, link_name = "aio_write64")]
5717 pub fn aio_write(aiocbp: *mut aiocb) -> c_int;
5718 pub fn aio_fsync(op: c_int, aiocbp: *mut aiocb) -> c_int;
5719 #[cfg_attr(gnu_file_offset_bits64, link_name = "aio_error64")]
5720 pub fn aio_error(aiocbp: *const aiocb) -> c_int;
5721 #[cfg_attr(gnu_file_offset_bits64, link_name = "aio_return64")]
5722 pub fn aio_return(aiocbp: *mut aiocb) -> ssize_t;
5723 #[cfg_attr(gnu_time_bits64, link_name = "__aio_suspend_time64")]
5724 pub fn aio_suspend(
5725 aiocb_list: *const *const aiocb,
5726 nitems: c_int,
5727 timeout: *const crate::timespec,
5728 ) -> c_int;
5729 #[cfg_attr(gnu_file_offset_bits64, link_name = "aio_cancel64")]
5730 pub fn aio_cancel(fd: c_int, aiocbp: *mut aiocb) -> c_int;
5731 #[cfg_attr(gnu_file_offset_bits64, link_name = "lio_listio64")]
5732 pub fn lio_listio(
5733 mode: c_int,
5734 aiocb_list: *const *mut aiocb,
5735 nitems: c_int,
5736 sevp: *mut crate::sigevent,
5737 ) -> c_int;
5738 }
5739 }
5740}
5741
5742cfg_if! {
5743 if #[cfg(not(target_env = "uclibc"))] {
5744 extern "C" {
5745 #[cfg_attr(gnu_file_offset_bits64, link_name = "pwritev64")]
5746 pub fn pwritev(
5747 fd: c_int,
5748 iov: *const crate::iovec,
5749 iovcnt: c_int,
5750 offset: off_t,
5751 ) -> ssize_t;
5752 #[cfg_attr(gnu_file_offset_bits64, link_name = "preadv64")]
5753 pub fn preadv(
5754 fd: c_int,
5755 iov: *const crate::iovec,
5756 iovcnt: c_int,
5757 offset: off_t,
5758 ) -> ssize_t;
5759 pub fn getnameinfo(
5760 sa: *const crate::sockaddr,
5761 salen: crate::socklen_t,
5762 host: *mut c_char,
5763 hostlen: crate::socklen_t,
5764 serv: *mut c_char,
5765 servlen: crate::socklen_t,
5766 flags: c_int,
5767 ) -> c_int;
5768 pub fn getloadavg(loadavg: *mut c_double, nelem: c_int) -> c_int;
5769 pub fn process_vm_readv(
5770 pid: crate::pid_t,
5771 local_iov: *const crate::iovec,
5772 liovcnt: c_ulong,
5773 remote_iov: *const crate::iovec,
5774 riovcnt: c_ulong,
5775 flags: c_ulong,
5776 ) -> isize;
5777 pub fn process_vm_writev(
5778 pid: crate::pid_t,
5779 local_iov: *const crate::iovec,
5780 liovcnt: c_ulong,
5781 remote_iov: *const crate::iovec,
5782 riovcnt: c_ulong,
5783 flags: c_ulong,
5784 ) -> isize;
5785 #[cfg_attr(gnu_time_bits64, link_name = "__futimes64")]
5786 pub fn futimes(fd: c_int, times: *const crate::timeval) -> c_int;
5787 }
5788 }
5789}
5790
5791cfg_if! {
5793 if #[cfg(not(target_env = "ohos"))] {
5794 extern "C" {
5795 pub fn getspnam_r(
5799 name: *const c_char,
5800 spbuf: *mut spwd,
5801 buf: *mut c_char,
5802 buflen: size_t,
5803 spbufp: *mut *mut spwd,
5804 ) -> c_int;
5805
5806 pub fn mq_open(name: *const c_char, oflag: c_int, ...) -> crate::mqd_t;
5807 pub fn mq_close(mqd: crate::mqd_t) -> c_int;
5808 pub fn mq_unlink(name: *const c_char) -> c_int;
5809 pub fn mq_receive(
5810 mqd: crate::mqd_t,
5811 msg_ptr: *mut c_char,
5812 msg_len: size_t,
5813 msg_prio: *mut c_uint,
5814 ) -> ssize_t;
5815 #[cfg_attr(gnu_time_bits64, link_name = "__mq_timedreceive_time64")]
5816 pub fn mq_timedreceive(
5817 mqd: crate::mqd_t,
5818 msg_ptr: *mut c_char,
5819 msg_len: size_t,
5820 msg_prio: *mut c_uint,
5821 abs_timeout: *const crate::timespec,
5822 ) -> ssize_t;
5823 pub fn mq_send(
5824 mqd: crate::mqd_t,
5825 msg_ptr: *const c_char,
5826 msg_len: size_t,
5827 msg_prio: c_uint,
5828 ) -> c_int;
5829 #[cfg_attr(gnu_time_bits64, link_name = "__mq_timedsend_time64")]
5830 pub fn mq_timedsend(
5831 mqd: crate::mqd_t,
5832 msg_ptr: *const c_char,
5833 msg_len: size_t,
5834 msg_prio: c_uint,
5835 abs_timeout: *const crate::timespec,
5836 ) -> c_int;
5837 pub fn mq_getattr(mqd: crate::mqd_t, attr: *mut crate::mq_attr) -> c_int;
5838 pub fn mq_setattr(
5839 mqd: crate::mqd_t,
5840 newattr: *const crate::mq_attr,
5841 oldattr: *mut crate::mq_attr,
5842 ) -> c_int;
5843 }
5844 }
5845}
5846
5847extern "C" {
5848 #[cfg_attr(
5849 not(any(target_env = "musl", target_env = "ohos")),
5850 link_name = "__xpg_strerror_r"
5851 )]
5852 pub fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int;
5853
5854 pub fn abs(i: c_int) -> c_int;
5855 pub fn labs(i: c_long) -> c_long;
5856 pub fn rand() -> c_int;
5857 pub fn srand(seed: c_uint);
5858
5859 pub fn drand48() -> c_double;
5860 pub fn erand48(xseed: *mut c_ushort) -> c_double;
5861 pub fn lrand48() -> c_long;
5862 pub fn nrand48(xseed: *mut c_ushort) -> c_long;
5863 pub fn mrand48() -> c_long;
5864 pub fn jrand48(xseed: *mut c_ushort) -> c_long;
5865 pub fn srand48(seed: c_long);
5866 pub fn seed48(xseed: *mut c_ushort) -> *mut c_ushort;
5867 pub fn lcong48(p: *mut c_ushort);
5868
5869 #[cfg_attr(gnu_time_bits64, link_name = "__lutimes64")]
5870 pub fn lutimes(file: *const c_char, times: *const crate::timeval) -> c_int;
5871
5872 pub fn setpwent();
5873 pub fn endpwent();
5874 pub fn getpwent() -> *mut passwd;
5875 pub fn setgrent();
5876 pub fn endgrent();
5877 pub fn getgrent() -> *mut crate::group;
5878 pub fn setspent();
5879 pub fn endspent();
5880 pub fn getspent() -> *mut spwd;
5881
5882 pub fn getspnam(name: *const c_char) -> *mut spwd;
5883
5884 pub fn shm_open(name: *const c_char, oflag: c_int, mode: mode_t) -> c_int;
5885 pub fn shm_unlink(name: *const c_char) -> c_int;
5886
5887 pub fn shmget(key: crate::key_t, size: size_t, shmflg: c_int) -> c_int;
5889 pub fn shmat(shmid: c_int, shmaddr: *const c_void, shmflg: c_int) -> *mut c_void;
5890 pub fn shmdt(shmaddr: *const c_void) -> c_int;
5891 #[cfg_attr(gnu_time_bits64, link_name = "__shmctl64")]
5892 pub fn shmctl(shmid: c_int, cmd: c_int, buf: *mut crate::shmid_ds) -> c_int;
5893 pub fn ftok(pathname: *const c_char, proj_id: c_int) -> crate::key_t;
5894 pub fn semget(key: crate::key_t, nsems: c_int, semflag: c_int) -> c_int;
5895 pub fn semop(semid: c_int, sops: *mut crate::sembuf, nsops: size_t) -> c_int;
5896 #[cfg_attr(gnu_time_bits64, link_name = "__semctl64")]
5897 pub fn semctl(semid: c_int, semnum: c_int, cmd: c_int, ...) -> c_int;
5898 #[cfg_attr(gnu_time_bits64, link_name = "__msgctl64")]
5899 pub fn msgctl(msqid: c_int, cmd: c_int, buf: *mut msqid_ds) -> c_int;
5900 pub fn msgget(key: crate::key_t, msgflg: c_int) -> c_int;
5901 pub fn msgrcv(
5902 msqid: c_int,
5903 msgp: *mut c_void,
5904 msgsz: size_t,
5905 msgtyp: c_long,
5906 msgflg: c_int,
5907 ) -> ssize_t;
5908 pub fn msgsnd(msqid: c_int, msgp: *const c_void, msgsz: size_t, msgflg: c_int) -> c_int;
5909
5910 pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int;
5911 pub fn __errno_location() -> *mut c_int;
5912
5913 #[cfg_attr(gnu_file_offset_bits64, link_name = "fallocate64")]
5914 pub fn fallocate(fd: c_int, mode: c_int, offset: off_t, len: off_t) -> c_int;
5915 #[cfg_attr(gnu_file_offset_bits64, link_name = "posix_fallocate64")]
5916 pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int;
5917 pub fn readahead(fd: c_int, offset: off64_t, count: size_t) -> ssize_t;
5918 pub fn getxattr(
5919 path: *const c_char,
5920 name: *const c_char,
5921 value: *mut c_void,
5922 size: size_t,
5923 ) -> ssize_t;
5924 pub fn lgetxattr(
5925 path: *const c_char,
5926 name: *const c_char,
5927 value: *mut c_void,
5928 size: size_t,
5929 ) -> ssize_t;
5930 pub fn fgetxattr(
5931 filedes: c_int,
5932 name: *const c_char,
5933 value: *mut c_void,
5934 size: size_t,
5935 ) -> ssize_t;
5936 pub fn setxattr(
5937 path: *const c_char,
5938 name: *const c_char,
5939 value: *const c_void,
5940 size: size_t,
5941 flags: c_int,
5942 ) -> c_int;
5943 pub fn lsetxattr(
5944 path: *const c_char,
5945 name: *const c_char,
5946 value: *const c_void,
5947 size: size_t,
5948 flags: c_int,
5949 ) -> c_int;
5950 pub fn fsetxattr(
5951 filedes: c_int,
5952 name: *const c_char,
5953 value: *const c_void,
5954 size: size_t,
5955 flags: c_int,
5956 ) -> c_int;
5957 pub fn listxattr(path: *const c_char, list: *mut c_char, size: size_t) -> ssize_t;
5958 pub fn llistxattr(path: *const c_char, list: *mut c_char, size: size_t) -> ssize_t;
5959 pub fn flistxattr(filedes: c_int, list: *mut c_char, size: size_t) -> ssize_t;
5960 pub fn removexattr(path: *const c_char, name: *const c_char) -> c_int;
5961 pub fn lremovexattr(path: *const c_char, name: *const c_char) -> c_int;
5962 pub fn fremovexattr(filedes: c_int, name: *const c_char) -> c_int;
5963 pub fn signalfd(fd: c_int, mask: *const crate::sigset_t, flags: c_int) -> c_int;
5964 pub fn timerfd_create(clockid: crate::clockid_t, flags: c_int) -> c_int;
5965 #[cfg_attr(gnu_time_bits64, link_name = "__timerfd_gettime64")]
5966 pub fn timerfd_gettime(fd: c_int, curr_value: *mut itimerspec) -> c_int;
5967 #[cfg_attr(gnu_time_bits64, link_name = "__timerfd_settime64")]
5968 pub fn timerfd_settime(
5969 fd: c_int,
5970 flags: c_int,
5971 new_value: *const itimerspec,
5972 old_value: *mut itimerspec,
5973 ) -> c_int;
5974 pub fn quotactl(cmd: c_int, special: *const c_char, id: c_int, data: *mut c_char) -> c_int;
5975 pub fn epoll_pwait(
5976 epfd: c_int,
5977 events: *mut crate::epoll_event,
5978 maxevents: c_int,
5979 timeout: c_int,
5980 sigmask: *const crate::sigset_t,
5981 ) -> c_int;
5982 pub fn dup3(oldfd: c_int, newfd: c_int, flags: c_int) -> c_int;
5983 #[cfg_attr(gnu_time_bits64, link_name = "__sigtimedwait64")]
5984 pub fn sigtimedwait(
5985 set: *const sigset_t,
5986 info: *mut siginfo_t,
5987 timeout: *const crate::timespec,
5988 ) -> c_int;
5989 pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> c_int;
5990 pub fn nl_langinfo_l(item: crate::nl_item, locale: crate::locale_t) -> *mut c_char;
5991 pub fn accept4(
5992 fd: c_int,
5993 addr: *mut crate::sockaddr,
5994 len: *mut crate::socklen_t,
5995 flg: c_int,
5996 ) -> c_int;
5997 pub fn reboot(how_to: c_int) -> c_int;
5998 pub fn setfsgid(gid: crate::gid_t) -> c_int;
5999 pub fn setfsuid(uid: crate::uid_t) -> c_int;
6000
6001 pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: mode_t) -> c_int;
6003 pub fn if_nameindex() -> *mut if_nameindex;
6004 pub fn if_freenameindex(ptr: *mut if_nameindex);
6005 pub fn sync_file_range(fd: c_int, offset: off64_t, nbytes: off64_t, flags: c_uint) -> c_int;
6006 pub fn mremap(
6007 addr: *mut c_void,
6008 len: size_t,
6009 new_len: size_t,
6010 flags: c_int,
6011 ...
6012 ) -> *mut c_void;
6013
6014 #[cfg_attr(gnu_time_bits64, link_name = "__glob64_time64")]
6015 #[cfg_attr(
6016 all(not(gnu_time_bits64), gnu_file_offset_bits64),
6017 link_name = "glob64"
6018 )]
6019 pub fn glob(
6020 pattern: *const c_char,
6021 flags: c_int,
6022 errfunc: Option<extern "C" fn(epath: *const c_char, errno: c_int) -> c_int>,
6023 pglob: *mut crate::glob_t,
6024 ) -> c_int;
6025 #[cfg_attr(gnu_time_bits64, link_name = "__globfree64_time64")]
6026 #[cfg_attr(
6027 all(not(gnu_time_bits64), gnu_file_offset_bits64),
6028 link_name = "globfree64"
6029 )]
6030 pub fn globfree(pglob: *mut crate::glob_t);
6031
6032 pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int;
6033
6034 pub fn seekdir(dirp: *mut crate::DIR, loc: c_long);
6035
6036 pub fn telldir(dirp: *mut crate::DIR) -> c_long;
6037 pub fn madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int;
6038
6039 pub fn msync(addr: *mut c_void, len: size_t, flags: c_int) -> c_int;
6040 pub fn remap_file_pages(
6041 addr: *mut c_void,
6042 size: size_t,
6043 prot: c_int,
6044 pgoff: size_t,
6045 flags: c_int,
6046 ) -> c_int;
6047 pub fn recvfrom(
6048 socket: c_int,
6049 buf: *mut c_void,
6050 len: size_t,
6051 flags: c_int,
6052 addr: *mut crate::sockaddr,
6053 addrlen: *mut crate::socklen_t,
6054 ) -> ssize_t;
6055 #[cfg_attr(gnu_file_offset_bits64, link_name = "mkstemps64")]
6056 pub fn mkstemps(template: *mut c_char, suffixlen: c_int) -> c_int;
6057
6058 pub fn nl_langinfo(item: crate::nl_item) -> *mut c_char;
6059
6060 pub fn vhangup() -> c_int;
6061 pub fn sync();
6062 pub fn syncfs(fd: c_int) -> c_int;
6063 pub fn syscall(num: c_long, ...) -> c_long;
6064 pub fn sched_getaffinity(
6065 pid: crate::pid_t,
6066 cpusetsize: size_t,
6067 cpuset: *mut cpu_set_t,
6068 ) -> c_int;
6069 pub fn sched_setaffinity(
6070 pid: crate::pid_t,
6071 cpusetsize: size_t,
6072 cpuset: *const cpu_set_t,
6073 ) -> c_int;
6074 pub fn epoll_create(size: c_int) -> c_int;
6075 pub fn epoll_create1(flags: c_int) -> c_int;
6076 pub fn epoll_wait(
6077 epfd: c_int,
6078 events: *mut crate::epoll_event,
6079 maxevents: c_int,
6080 timeout: c_int,
6081 ) -> c_int;
6082 pub fn epoll_ctl(epfd: c_int, op: c_int, fd: c_int, event: *mut crate::epoll_event) -> c_int;
6083 pub fn unshare(flags: c_int) -> c_int;
6084 pub fn umount(target: *const c_char) -> c_int;
6085 pub fn sched_get_priority_max(policy: c_int) -> c_int;
6086 pub fn tee(fd_in: c_int, fd_out: c_int, len: size_t, flags: c_uint) -> ssize_t;
6087 #[cfg_attr(gnu_time_bits64, link_name = "__settimeofday64")]
6088 pub fn settimeofday(tv: *const crate::timeval, tz: *const crate::timezone) -> c_int;
6089 pub fn splice(
6090 fd_in: c_int,
6091 off_in: *mut crate::loff_t,
6092 fd_out: c_int,
6093 off_out: *mut crate::loff_t,
6094 len: size_t,
6095 flags: c_uint,
6096 ) -> ssize_t;
6097 pub fn eventfd(initval: c_uint, flags: c_int) -> c_int;
6098 pub fn eventfd_read(fd: c_int, value: *mut eventfd_t) -> c_int;
6099 pub fn eventfd_write(fd: c_int, value: eventfd_t) -> c_int;
6100
6101 #[cfg_attr(gnu_time_bits64, link_name = "__sched_rr_get_interval64")]
6102 pub fn sched_rr_get_interval(pid: crate::pid_t, tp: *mut crate::timespec) -> c_int;
6103 #[cfg_attr(gnu_time_bits64, link_name = "__sem_timedwait64")]
6104 pub fn sem_timedwait(sem: *mut sem_t, abstime: *const crate::timespec) -> c_int;
6105 pub fn sem_getvalue(sem: *mut sem_t, sval: *mut c_int) -> c_int;
6106 pub fn sched_setparam(pid: crate::pid_t, param: *const crate::sched_param) -> c_int;
6107 pub fn setns(fd: c_int, nstype: c_int) -> c_int;
6108 pub fn swapoff(path: *const c_char) -> c_int;
6109 pub fn vmsplice(fd: c_int, iov: *const crate::iovec, nr_segs: size_t, flags: c_uint)
6110 -> ssize_t;
6111 pub fn mount(
6112 src: *const c_char,
6113 target: *const c_char,
6114 fstype: *const c_char,
6115 flags: c_ulong,
6116 data: *const c_void,
6117 ) -> c_int;
6118 pub fn personality(persona: c_ulong) -> c_int;
6119 #[cfg_attr(gnu_time_bits64, link_name = "__prctl_time64")]
6120 pub fn prctl(option: c_int, ...) -> c_int;
6121 pub fn sched_getparam(pid: crate::pid_t, param: *mut crate::sched_param) -> c_int;
6122 #[cfg_attr(gnu_time_bits64, link_name = "__ppoll64")]
6123 pub fn ppoll(
6124 fds: *mut crate::pollfd,
6125 nfds: nfds_t,
6126 timeout: *const crate::timespec,
6127 sigmask: *const sigset_t,
6128 ) -> c_int;
6129
6130 pub fn clone(
6131 cb: extern "C" fn(*mut c_void) -> c_int,
6132 child_stack: *mut c_void,
6133 flags: c_int,
6134 arg: *mut c_void,
6135 ...
6136 ) -> c_int;
6137 pub fn sched_getscheduler(pid: crate::pid_t) -> c_int;
6138 #[cfg_attr(gnu_time_bits64, link_name = "__clock_nanosleep_time64")]
6139 pub fn clock_nanosleep(
6140 clk_id: crate::clockid_t,
6141 flags: c_int,
6142 rqtp: *const crate::timespec,
6143 rmtp: *mut crate::timespec,
6144 ) -> c_int;
6145 pub fn sethostname(name: *const c_char, len: size_t) -> c_int;
6146 pub fn sched_get_priority_min(policy: c_int) -> c_int;
6147 pub fn sysinfo(info: *mut crate::sysinfo) -> c_int;
6148 pub fn umount2(target: *const c_char, flags: c_int) -> c_int;
6149 pub fn swapon(path: *const c_char, swapflags: c_int) -> c_int;
6150 pub fn sched_setscheduler(
6151 pid: crate::pid_t,
6152 policy: c_int,
6153 param: *const crate::sched_param,
6154 ) -> c_int;
6155 #[cfg_attr(gnu_file_offset_bits64, link_name = "sendfile64")]
6156 pub fn sendfile(out_fd: c_int, in_fd: c_int, offset: *mut off_t, count: size_t) -> ssize_t;
6157 pub fn sigsuspend(mask: *const crate::sigset_t) -> c_int;
6158 pub fn getgrgid_r(
6159 gid: crate::gid_t,
6160 grp: *mut crate::group,
6161 buf: *mut c_char,
6162 buflen: size_t,
6163 result: *mut *mut crate::group,
6164 ) -> c_int;
6165 pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> c_int;
6166 pub fn sem_close(sem: *mut sem_t) -> c_int;
6167 pub fn getdtablesize() -> c_int;
6168 pub fn getgrnam_r(
6169 name: *const c_char,
6170 grp: *mut crate::group,
6171 buf: *mut c_char,
6172 buflen: size_t,
6173 result: *mut *mut crate::group,
6174 ) -> c_int;
6175 pub fn initgroups(user: *const c_char, group: crate::gid_t) -> c_int;
6176 pub fn sem_open(name: *const c_char, oflag: c_int, ...) -> *mut sem_t;
6177 pub fn getgrnam(name: *const c_char) -> *mut crate::group;
6178 pub fn sem_unlink(name: *const c_char) -> c_int;
6179 pub fn daemon(nochdir: c_int, noclose: c_int) -> c_int;
6180 pub fn getpwnam_r(
6181 name: *const c_char,
6182 pwd: *mut passwd,
6183 buf: *mut c_char,
6184 buflen: size_t,
6185 result: *mut *mut passwd,
6186 ) -> c_int;
6187 pub fn getpwuid_r(
6188 uid: crate::uid_t,
6189 pwd: *mut passwd,
6190 buf: *mut c_char,
6191 buflen: size_t,
6192 result: *mut *mut passwd,
6193 ) -> c_int;
6194 pub fn sigwait(set: *const sigset_t, sig: *mut c_int) -> c_int;
6195 pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group;
6196 pub fn getgrouplist(
6197 user: *const c_char,
6198 group: crate::gid_t,
6199 groups: *mut crate::gid_t,
6200 ngroups: *mut c_int,
6201 ) -> c_int;
6202 pub fn popen(command: *const c_char, mode: *const c_char) -> *mut crate::FILE;
6203 pub fn faccessat(dirfd: c_int, pathname: *const c_char, mode: c_int, flags: c_int) -> c_int;
6204 pub fn dl_iterate_phdr(
6205 callback: Option<
6206 unsafe extern "C" fn(
6207 info: *mut crate::dl_phdr_info,
6208 size: size_t,
6209 data: *mut c_void,
6210 ) -> c_int,
6211 >,
6212 data: *mut c_void,
6213 ) -> c_int;
6214
6215 pub fn setmntent(filename: *const c_char, ty: *const c_char) -> *mut crate::FILE;
6216 pub fn getmntent(stream: *mut crate::FILE) -> *mut crate::mntent;
6217 pub fn addmntent(stream: *mut crate::FILE, mnt: *const crate::mntent) -> c_int;
6218 pub fn endmntent(streamp: *mut crate::FILE) -> c_int;
6219 pub fn hasmntopt(mnt: *const crate::mntent, opt: *const c_char) -> *mut c_char;
6220
6221 pub fn posix_spawn(
6222 pid: *mut crate::pid_t,
6223 path: *const c_char,
6224 file_actions: *const crate::posix_spawn_file_actions_t,
6225 attrp: *const crate::posix_spawnattr_t,
6226 argv: *const *mut c_char,
6227 envp: *const *mut c_char,
6228 ) -> c_int;
6229 pub fn posix_spawnp(
6230 pid: *mut crate::pid_t,
6231 file: *const c_char,
6232 file_actions: *const crate::posix_spawn_file_actions_t,
6233 attrp: *const crate::posix_spawnattr_t,
6234 argv: *const *mut c_char,
6235 envp: *const *mut c_char,
6236 ) -> c_int;
6237 pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> c_int;
6238 pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> c_int;
6239 pub fn posix_spawnattr_getsigdefault(
6240 attr: *const posix_spawnattr_t,
6241 default: *mut crate::sigset_t,
6242 ) -> c_int;
6243 pub fn posix_spawnattr_setsigdefault(
6244 attr: *mut posix_spawnattr_t,
6245 default: *const crate::sigset_t,
6246 ) -> c_int;
6247 pub fn posix_spawnattr_getsigmask(
6248 attr: *const posix_spawnattr_t,
6249 default: *mut crate::sigset_t,
6250 ) -> c_int;
6251 pub fn posix_spawnattr_setsigmask(
6252 attr: *mut posix_spawnattr_t,
6253 default: *const crate::sigset_t,
6254 ) -> c_int;
6255 pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t, flags: *mut c_short) -> c_int;
6256 pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: c_short) -> c_int;
6257 pub fn posix_spawnattr_getpgroup(
6258 attr: *const posix_spawnattr_t,
6259 flags: *mut crate::pid_t,
6260 ) -> c_int;
6261 pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int;
6262 pub fn posix_spawnattr_getschedpolicy(
6263 attr: *const posix_spawnattr_t,
6264 flags: *mut c_int,
6265 ) -> c_int;
6266 pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: c_int) -> c_int;
6267 pub fn posix_spawnattr_getschedparam(
6268 attr: *const posix_spawnattr_t,
6269 param: *mut crate::sched_param,
6270 ) -> c_int;
6271 pub fn posix_spawnattr_setschedparam(
6272 attr: *mut posix_spawnattr_t,
6273 param: *const crate::sched_param,
6274 ) -> c_int;
6275
6276 pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int;
6277 pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int;
6278 pub fn posix_spawn_file_actions_addopen(
6279 actions: *mut posix_spawn_file_actions_t,
6280 fd: c_int,
6281 path: *const c_char,
6282 oflag: c_int,
6283 mode: mode_t,
6284 ) -> c_int;
6285 pub fn posix_spawn_file_actions_addclose(
6286 actions: *mut posix_spawn_file_actions_t,
6287 fd: c_int,
6288 ) -> c_int;
6289 pub fn posix_spawn_file_actions_adddup2(
6290 actions: *mut posix_spawn_file_actions_t,
6291 fd: c_int,
6292 newfd: c_int,
6293 ) -> c_int;
6294 pub fn fread_unlocked(
6295 buf: *mut c_void,
6296 size: size_t,
6297 nobj: size_t,
6298 stream: *mut crate::FILE,
6299 ) -> size_t;
6300 pub fn inotify_rm_watch(fd: c_int, wd: c_int) -> c_int;
6301 pub fn inotify_init() -> c_int;
6302 pub fn inotify_init1(flags: c_int) -> c_int;
6303 pub fn inotify_add_watch(fd: c_int, path: *const c_char, mask: u32) -> c_int;
6304 pub fn fanotify_init(flags: c_uint, event_f_flags: c_uint) -> c_int;
6305
6306 pub fn regcomp(preg: *mut crate::regex_t, pattern: *const c_char, cflags: c_int) -> c_int;
6307
6308 pub fn regexec(
6309 preg: *const crate::regex_t,
6310 input: *const c_char,
6311 nmatch: size_t,
6312 pmatch: *mut regmatch_t,
6313 eflags: c_int,
6314 ) -> c_int;
6315
6316 pub fn regerror(
6317 errcode: c_int,
6318 preg: *const crate::regex_t,
6319 errbuf: *mut c_char,
6320 errbuf_size: size_t,
6321 ) -> size_t;
6322
6323 pub fn regfree(preg: *mut crate::regex_t);
6324
6325 pub fn iconv_open(tocode: *const c_char, fromcode: *const c_char) -> iconv_t;
6326 pub fn iconv(
6327 cd: iconv_t,
6328 inbuf: *mut *mut c_char,
6329 inbytesleft: *mut size_t,
6330 outbuf: *mut *mut c_char,
6331 outbytesleft: *mut size_t,
6332 ) -> size_t;
6333 pub fn iconv_close(cd: iconv_t) -> c_int;
6334
6335 pub fn gettid() -> crate::pid_t;
6336
6337 pub fn timer_create(
6338 clockid: crate::clockid_t,
6339 sevp: *mut crate::sigevent,
6340 timerid: *mut crate::timer_t,
6341 ) -> c_int;
6342 pub fn timer_delete(timerid: crate::timer_t) -> c_int;
6343 pub fn timer_getoverrun(timerid: crate::timer_t) -> c_int;
6344 #[cfg_attr(gnu_time_bits64, link_name = "__timer_gettime64")]
6345 pub fn timer_gettime(timerid: crate::timer_t, curr_value: *mut crate::itimerspec) -> c_int;
6346 #[cfg_attr(gnu_time_bits64, link_name = "__timer_settime64")]
6347 pub fn timer_settime(
6348 timerid: crate::timer_t,
6349 flags: c_int,
6350 new_value: *const crate::itimerspec,
6351 old_value: *mut crate::itimerspec,
6352 ) -> c_int;
6353
6354 pub fn gethostid() -> c_long;
6355
6356 pub fn memmem(
6357 haystack: *const c_void,
6358 haystacklen: size_t,
6359 needle: *const c_void,
6360 needlelen: size_t,
6361 ) -> *mut c_void;
6362 pub fn sched_getcpu() -> c_int;
6363
6364 pub fn getopt_long(
6365 argc: c_int,
6366 argv: *const *mut c_char,
6367 optstring: *const c_char,
6368 longopts: *const option,
6369 longindex: *mut c_int,
6370 ) -> c_int;
6371
6372 pub fn copy_file_range(
6373 fd_in: c_int,
6374 off_in: *mut off64_t,
6375 fd_out: c_int,
6376 off_out: *mut off64_t,
6377 len: size_t,
6378 flags: c_uint,
6379 ) -> ssize_t;
6380
6381 pub fn klogctl(syslog_type: c_int, bufp: *mut c_char, len: c_int) -> c_int;
6382}
6383
6384cfg_if! {
6388 if #[cfg(not(any(target_env = "musl", target_env = "ohos")))] {
6389 extern "C" {
6390 pub fn fallocate64(fd: c_int, mode: c_int, offset: off64_t, len: off64_t) -> c_int;
6391 pub fn fgetpos64(stream: *mut crate::FILE, ptr: *mut fpos64_t) -> c_int;
6392 pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut crate::FILE;
6393 pub fn freopen64(
6394 filename: *const c_char,
6395 mode: *const c_char,
6396 file: *mut crate::FILE,
6397 ) -> *mut crate::FILE;
6398 pub fn fseeko64(stream: *mut crate::FILE, offset: off64_t, whence: c_int) -> c_int;
6399 pub fn fsetpos64(stream: *mut crate::FILE, ptr: *const fpos64_t) -> c_int;
6400 pub fn ftello64(stream: *mut crate::FILE) -> off64_t;
6401 pub fn posix_fallocate64(fd: c_int, offset: off64_t, len: off64_t) -> c_int;
6402 pub fn sendfile64(
6403 out_fd: c_int,
6404 in_fd: c_int,
6405 offset: *mut off64_t,
6406 count: size_t,
6407 ) -> ssize_t;
6408 pub fn tmpfile64() -> *mut crate::FILE;
6409 }
6410 }
6411}
6412
6413cfg_if! {
6414 if #[cfg(target_env = "uclibc")] {
6415 mod uclibc;
6416 pub use self::uclibc::*;
6417 } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
6418 mod musl;
6419 pub use self::musl::*;
6420 } else if #[cfg(target_env = "gnu")] {
6421 mod gnu;
6422 pub use self::gnu::*;
6423 }
6424}
6425
6426mod arch;
6427pub use self::arch::*;