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