1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(feature = "std")]
pub use std::os::raw as ctypes;

#[cfg(all(not(feature = "std"), feature = "no_std"))]
pub mod ctypes {
    // The signedness of `char` is platform-specific, however a consequence
    // of it being platform-specific is that any code which depends on the
    // signedness of `char` is already non-portable. So we can just use `u8`
    // here and no portable code will notice.
    pub type c_char = u8;

    // The following assumes that Linux is always either ILP32 or LP64,
    // and char is always 8-bit.
    //
    // In theory, `c_long` and `c_ulong` could be `isize` and `usize`
    // respectively, however in practice Linux doesn't use them in that way
    // consistently. So stick with the convention followed by `libc` and
    // others and use the fixed-width types.
    pub type c_schar = i8;
    pub type c_uchar = u8;
    pub type c_short = i16;
    pub type c_ushort = u16;
    pub type c_int = i32;
    pub type c_uint = u32;
    #[cfg(target_pointer_width = "32")]
    pub type c_long = i32;
    #[cfg(target_pointer_width = "32")]
    pub type c_ulong = u32;
    #[cfg(target_pointer_width = "64")]
    pub type c_long = i64;
    #[cfg(target_pointer_width = "64")]
    pub type c_ulong = u64;
    pub type c_longlong = i64;
    pub type c_ulonglong = u64;
    pub type c_float = f32;
    pub type c_double = f64;

    pub use core::ffi::c_void;
}

// Confirm that our type definitions above match the actual type definitions.
#[cfg(test)]
mod assertions {
    use super::ctypes;
    static_assertions::assert_eq_size!(ctypes::c_char, libc::c_char);
    static_assertions::assert_type_eq_all!(ctypes::c_schar, libc::c_schar);
    static_assertions::assert_type_eq_all!(ctypes::c_uchar, libc::c_uchar);
    static_assertions::assert_type_eq_all!(ctypes::c_short, libc::c_short);
    static_assertions::assert_type_eq_all!(ctypes::c_ushort, libc::c_ushort);
    static_assertions::assert_type_eq_all!(ctypes::c_int, libc::c_int);
    static_assertions::assert_type_eq_all!(ctypes::c_uint, libc::c_uint);
    static_assertions::assert_type_eq_all!(ctypes::c_long, libc::c_long);
    static_assertions::assert_type_eq_all!(ctypes::c_ulong, libc::c_ulong);
    static_assertions::assert_type_eq_all!(ctypes::c_longlong, libc::c_longlong);
    static_assertions::assert_type_eq_all!(ctypes::c_ulonglong, libc::c_ulonglong);
    static_assertions::assert_type_eq_all!(ctypes::c_float, libc::c_float);
    static_assertions::assert_type_eq_all!(ctypes::c_double, libc::c_double);
}

// We don't enable `derive_eq` in bindgen because adding `PartialEq`/`Eq` to
// *all* structs noticeably increases compile times. But we can add a few
// manual impls where they're especially useful.
#[cfg(feature = "general")]
impl PartialEq for general::__kernel_timespec {
    fn eq(&self, other: &Self) -> bool {
        ({
            let Self { tv_sec, tv_nsec } = self;
            (tv_sec, tv_nsec)
        }) == ({
            let Self { tv_sec, tv_nsec } = other;
            (tv_sec, tv_nsec)
        })
    }
}
#[cfg(feature = "general")]
impl Eq for general::__kernel_timespec {}

#[cfg(feature = "net")]
pub mod cmsg_macros {
    use crate::ctypes::{c_long, c_uchar, c_uint};
    use crate::net::{cmsghdr, msghdr};
    use core::mem::size_of;
    use core::ptr;

    pub const unsafe fn CMSG_ALIGN(len: c_uint) -> c_uint {
        let c_long_size = size_of::<c_long>() as c_uint;
        (len + c_long_size - 1) & !(c_long_size - 1)
    }

    pub const unsafe fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar {
        (cmsg as *mut c_uchar).add(size_of::<cmsghdr>())
    }

    pub const unsafe fn CMSG_SPACE(len: c_uint) -> c_uint {
        size_of::<cmsghdr>() as c_uint + CMSG_ALIGN(len)
    }

    pub const unsafe fn CMSG_LEN(len: c_uint) -> c_uint {
        size_of::<cmsghdr>() as c_uint + len
    }

    pub const unsafe fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
        if (*mhdr).msg_controllen < size_of::<cmsghdr>() as _ {
            return ptr::null_mut();
        }

        (*mhdr).msg_control as *mut cmsghdr
    }

    pub unsafe fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr {
        // We convert from raw pointers to usize here, which may not be sound in a
        // future version of Rust. Once the provenance rules are set in stone,
        // it will be a good idea to give this function a once-over.

        let cmsg_len = (*cmsg).cmsg_len;
        let next_cmsg = (cmsg as *mut u8).add(CMSG_ALIGN(cmsg_len as _) as usize) as *mut cmsghdr;
        let max = ((*mhdr).msg_control as usize) + ((*mhdr).msg_controllen as usize);

        if cmsg_len < size_of::<cmsghdr>() as _ {
            return ptr::null_mut();
        }

        if next_cmsg.add(1) as usize > max
            || next_cmsg as usize + CMSG_ALIGN((*next_cmsg).cmsg_len as _) as usize > max
        {
            return ptr::null_mut();
        }

        next_cmsg
    }
}

#[cfg(feature = "general")]
pub mod select_macros {
    use crate::ctypes::c_int;
    use crate::general::__kernel_fd_set;
    use core::mem::size_of;

    pub unsafe fn FD_CLR(fd: c_int, set: *mut __kernel_fd_set) {
        let bytes = set as *mut u8;
        if fd >= 0 {
            *bytes.add((fd / 8) as usize) &= !(1 << (fd % 8));
        }
    }

    pub unsafe fn FD_SET(fd: c_int, set: *mut __kernel_fd_set) {
        let bytes = set as *mut u8;
        if fd >= 0 {
            *bytes.add((fd / 8) as usize) |= 1 << (fd % 8);
        }
    }

    pub unsafe fn FD_ISSET(fd: c_int, set: *const __kernel_fd_set) -> bool {
        let bytes = set as *const u8;
        if fd >= 0 {
            *bytes.add((fd / 8) as usize) & (1 << (fd % 8)) != 0
        } else {
            false
        }
    }

    pub unsafe fn FD_ZERO(set: *mut __kernel_fd_set) {
        let bytes = set as *mut u8;
        core::ptr::write_bytes(bytes, 0, size_of::<__kernel_fd_set>());
    }
}

#[cfg(feature = "general")]
pub mod signal_macros {
    pub const SIG_DFL: super::general::__kernel_sighandler_t = None;

    /// Rust doesn't currently permit us to use `transmute` to convert the
    /// `SIG_IGN` value into a function pointer in a `const` initializer, so
    /// we make it a function instead.
    ///
    #[inline]
    pub const fn sig_ign() -> super::general::__kernel_sighandler_t {
        // Safety: This creates an invalid pointer, but the pointer type
        // includes `unsafe`, which covers the safety of calling it.
        Some(unsafe {
            core::mem::transmute::<usize, unsafe extern "C" fn(crate::ctypes::c_int)>(1)
        })
    }
}

#[cfg(feature = "elf")]
pub mod elf;

// The rest of this file is auto-generated!
#[cfg(feature = "errno")]
#[cfg(target_arch = "arm")]
#[path = "arm/errno.rs"]
pub mod errno;
#[cfg(feature = "general")]
#[cfg(target_arch = "arm")]
#[path = "arm/general.rs"]
pub mod general;
#[cfg(feature = "if_ether")]
#[cfg(target_arch = "arm")]
#[path = "arm/if_ether.rs"]
pub mod if_ether;
#[cfg(feature = "if_packet")]
#[cfg(target_arch = "arm")]
#[path = "arm/if_packet.rs"]
pub mod if_packet;
#[cfg(feature = "io_uring")]
#[cfg(target_arch = "arm")]
#[path = "arm/io_uring.rs"]
pub mod io_uring;
#[cfg(feature = "ioctl")]
#[cfg(target_arch = "arm")]
#[path = "arm/ioctl.rs"]
pub mod ioctl;
#[cfg(feature = "mempolicy")]
#[cfg(target_arch = "arm")]
#[path = "arm/mempolicy.rs"]
pub mod mempolicy;
#[cfg(feature = "net")]
#[cfg(target_arch = "arm")]
#[path = "arm/net.rs"]
pub mod net;
#[cfg(feature = "netlink")]
#[cfg(target_arch = "arm")]
#[path = "arm/netlink.rs"]
pub mod netlink;
#[cfg(feature = "prctl")]
#[cfg(target_arch = "arm")]
#[path = "arm/prctl.rs"]
pub mod prctl;
#[cfg(feature = "system")]
#[cfg(target_arch = "arm")]
#[path = "arm/system.rs"]
pub mod system;
#[cfg(feature = "xdp")]
#[cfg(target_arch = "arm")]
#[path = "arm/xdp.rs"]
pub mod xdp;
#[cfg(feature = "errno")]
#[cfg(target_arch = "aarch64")]
#[path = "aarch64/errno.rs"]
pub mod errno;
#[cfg(feature = "general")]
#[cfg(target_arch = "aarch64")]
#[path = "aarch64/general.rs"]
pub mod general;
#[cfg(feature = "if_ether")]
#[cfg(target_arch = "aarch64")]
#[path = "aarch64/if_ether.rs"]
pub mod if_ether;
#[cfg(feature = "if_packet")]
#[cfg(target_arch = "aarch64")]
#[path = "aarch64/if_packet.rs"]
pub mod if_packet;
#[cfg(feature = "io_uring")]
#[cfg(target_arch = "aarch64")]
#[path = "aarch64/io_uring.rs"]
pub mod io_uring;
#[cfg(feature = "ioctl")]
#[cfg(target_arch = "aarch64")]
#[path = "aarch64/ioctl.rs"]
pub mod ioctl;
#[cfg(feature = "mempolicy")]
#[cfg(target_arch = "aarch64")]
#[path = "aarch64/mempolicy.rs"]
pub mod mempolicy;
#[cfg(feature = "net")]
#[cfg(target_arch = "aarch64")]
#[path = "aarch64/net.rs"]
pub mod net;
#[cfg(feature = "netlink")]
#[cfg(target_arch = "aarch64")]
#[path = "aarch64/netlink.rs"]
pub mod netlink;
#[cfg(feature = "prctl")]
#[cfg(target_arch = "aarch64")]
#[path = "aarch64/prctl.rs"]
pub mod prctl;
#[cfg(feature = "system")]
#[cfg(target_arch = "aarch64")]
#[path = "aarch64/system.rs"]
pub mod system;
#[cfg(feature = "xdp")]
#[cfg(target_arch = "aarch64")]
#[path = "aarch64/xdp.rs"]
pub mod xdp;
#[cfg(feature = "errno")]
#[cfg(target_arch = "csky")]
#[path = "csky/errno.rs"]
pub mod errno;
#[cfg(feature = "general")]
#[cfg(target_arch = "csky")]
#[path = "csky/general.rs"]
pub mod general;
#[cfg(feature = "if_ether")]
#[cfg(target_arch = "csky")]
#[path = "csky/if_ether.rs"]
pub mod if_ether;
#[cfg(feature = "if_packet")]
#[cfg(target_arch = "csky")]
#[path = "csky/if_packet.rs"]
pub mod if_packet;
#[cfg(feature = "io_uring")]
#[cfg(target_arch = "csky")]
#[path = "csky/io_uring.rs"]
pub mod io_uring;
#[cfg(feature = "ioctl")]
#[cfg(target_arch = "csky")]
#[path = "csky/ioctl.rs"]
pub mod ioctl;
#[cfg(feature = "mempolicy")]
#[cfg(target_arch = "csky")]
#[path = "csky/mempolicy.rs"]
pub mod mempolicy;
#[cfg(feature = "net")]
#[cfg(target_arch = "csky")]
#[path = "csky/net.rs"]
pub mod net;
#[cfg(feature = "netlink")]
#[cfg(target_arch = "csky")]
#[path = "csky/netlink.rs"]
pub mod netlink;
#[cfg(feature = "prctl")]
#[cfg(target_arch = "csky")]
#[path = "csky/prctl.rs"]
pub mod prctl;
#[cfg(feature = "system")]
#[cfg(target_arch = "csky")]
#[path = "csky/system.rs"]
pub mod system;
#[cfg(feature = "xdp")]
#[cfg(target_arch = "csky")]
#[path = "csky/xdp.rs"]
pub mod xdp;
#[cfg(feature = "errno")]
#[cfg(target_arch = "loongarch64")]
#[path = "loongarch64/errno.rs"]
pub mod errno;
#[cfg(feature = "general")]
#[cfg(target_arch = "loongarch64")]
#[path = "loongarch64/general.rs"]
pub mod general;
#[cfg(feature = "if_ether")]
#[cfg(target_arch = "loongarch64")]
#[path = "loongarch64/if_ether.rs"]
pub mod if_ether;
#[cfg(feature = "if_packet")]
#[cfg(target_arch = "loongarch64")]
#[path = "loongarch64/if_packet.rs"]
pub mod if_packet;
#[cfg(feature = "io_uring")]
#[cfg(target_arch = "loongarch64")]
#[path = "loongarch64/io_uring.rs"]
pub mod io_uring;
#[cfg(feature = "ioctl")]
#[cfg(target_arch = "loongarch64")]
#[path = "loongarch64/ioctl.rs"]
pub mod ioctl;
#[cfg(feature = "mempolicy")]
#[cfg(target_arch = "loongarch64")]
#[path = "loongarch64/mempolicy.rs"]
pub mod mempolicy;
#[cfg(feature = "net")]
#[cfg(target_arch = "loongarch64")]
#[path = "loongarch64/net.rs"]
pub mod net;
#[cfg(feature = "netlink")]
#[cfg(target_arch = "loongarch64")]
#[path = "loongarch64/netlink.rs"]
pub mod netlink;
#[cfg(feature = "prctl")]
#[cfg(target_arch = "loongarch64")]
#[path = "loongarch64/prctl.rs"]
pub mod prctl;
#[cfg(feature = "system")]
#[cfg(target_arch = "loongarch64")]
#[path = "loongarch64/system.rs"]
pub mod system;
#[cfg(feature = "xdp")]
#[cfg(target_arch = "loongarch64")]
#[path = "loongarch64/xdp.rs"]
pub mod xdp;
#[cfg(feature = "errno")]
#[cfg(target_arch = "mips")]
#[path = "mips/errno.rs"]
pub mod errno;
#[cfg(feature = "general")]
#[cfg(target_arch = "mips")]
#[path = "mips/general.rs"]
pub mod general;
#[cfg(feature = "if_ether")]
#[cfg(target_arch = "mips")]
#[path = "mips/if_ether.rs"]
pub mod if_ether;
#[cfg(feature = "if_packet")]
#[cfg(target_arch = "mips")]
#[path = "mips/if_packet.rs"]
pub mod if_packet;
#[cfg(feature = "io_uring")]
#[cfg(target_arch = "mips")]
#[path = "mips/io_uring.rs"]
pub mod io_uring;
#[cfg(feature = "ioctl")]
#[cfg(target_arch = "mips")]
#[path = "mips/ioctl.rs"]
pub mod ioctl;
#[cfg(feature = "mempolicy")]
#[cfg(target_arch = "mips")]
#[path = "mips/mempolicy.rs"]
pub mod mempolicy;
#[cfg(feature = "net")]
#[cfg(target_arch = "mips")]
#[path = "mips/net.rs"]
pub mod net;
#[cfg(feature = "netlink")]
#[cfg(target_arch = "mips")]
#[path = "mips/netlink.rs"]
pub mod netlink;
#[cfg(feature = "prctl")]
#[cfg(target_arch = "mips")]
#[path = "mips/prctl.rs"]
pub mod prctl;
#[cfg(feature = "system")]
#[cfg(target_arch = "mips")]
#[path = "mips/system.rs"]
pub mod system;
#[cfg(feature = "xdp")]
#[cfg(target_arch = "mips")]
#[path = "mips/xdp.rs"]
pub mod xdp;
#[cfg(feature = "errno")]
#[cfg(target_arch = "mips64")]
#[path = "mips64/errno.rs"]
pub mod errno;
#[cfg(feature = "general")]
#[cfg(target_arch = "mips64")]
#[path = "mips64/general.rs"]
pub mod general;
#[cfg(feature = "if_ether")]
#[cfg(target_arch = "mips64")]
#[path = "mips64/if_ether.rs"]
pub mod if_ether;
#[cfg(feature = "if_packet")]
#[cfg(target_arch = "mips64")]
#[path = "mips64/if_packet.rs"]
pub mod if_packet;
#[cfg(feature = "io_uring")]
#[cfg(target_arch = "mips64")]
#[path = "mips64/io_uring.rs"]
pub mod io_uring;
#[cfg(feature = "ioctl")]
#[cfg(target_arch = "mips64")]
#[path = "mips64/ioctl.rs"]
pub mod ioctl;
#[cfg(feature = "mempolicy")]
#[cfg(target_arch = "mips64")]
#[path = "mips64/mempolicy.rs"]
pub mod mempolicy;
#[cfg(feature = "net")]
#[cfg(target_arch = "mips64")]
#[path = "mips64/net.rs"]
pub mod net;
#[cfg(feature = "netlink")]
#[cfg(target_arch = "mips64")]
#[path = "mips64/netlink.rs"]
pub mod netlink;
#[cfg(feature = "prctl")]
#[cfg(target_arch = "mips64")]
#[path = "mips64/prctl.rs"]
pub mod prctl;
#[cfg(feature = "system")]
#[cfg(target_arch = "mips64")]
#[path = "mips64/system.rs"]
pub mod system;
#[cfg(feature = "xdp")]
#[cfg(target_arch = "mips64")]
#[path = "mips64/xdp.rs"]
pub mod xdp;
#[cfg(feature = "errno")]
#[cfg(target_arch = "mips32r6")]
#[path = "mips32r6/errno.rs"]
pub mod errno;
#[cfg(feature = "general")]
#[cfg(target_arch = "mips32r6")]
#[path = "mips32r6/general.rs"]
pub mod general;
#[cfg(feature = "if_ether")]
#[cfg(target_arch = "mips32r6")]
#[path = "mips32r6/if_ether.rs"]
pub mod if_ether;
#[cfg(feature = "if_packet")]
#[cfg(target_arch = "mips32r6")]
#[path = "mips32r6/if_packet.rs"]
pub mod if_packet;
#[cfg(feature = "io_uring")]
#[cfg(target_arch = "mips32r6")]
#[path = "mips32r6/io_uring.rs"]
pub mod io_uring;
#[cfg(feature = "ioctl")]
#[cfg(target_arch = "mips32r6")]
#[path = "mips32r6/ioctl.rs"]
pub mod ioctl;
#[cfg(feature = "mempolicy")]
#[cfg(target_arch = "mips32r6")]
#[path = "mips32r6/mempolicy.rs"]
pub mod mempolicy;
#[cfg(feature = "net")]
#[cfg(target_arch = "mips32r6")]
#[path = "mips32r6/net.rs"]
pub mod net;
#[cfg(feature = "netlink")]
#[cfg(target_arch = "mips32r6")]
#[path = "mips32r6/netlink.rs"]
pub mod netlink;
#[cfg(feature = "prctl")]
#[cfg(target_arch = "mips32r6")]
#[path = "mips32r6/prctl.rs"]
pub mod prctl;
#[cfg(feature = "system")]
#[cfg(target_arch = "mips32r6")]
#[path = "mips32r6/system.rs"]
pub mod system;
#[cfg(feature = "xdp")]
#[cfg(target_arch = "mips32r6")]
#[path = "mips32r6/xdp.rs"]
pub mod xdp;
#[cfg(feature = "errno")]
#[cfg(target_arch = "mips64r6")]
#[path = "mips64r6/errno.rs"]
pub mod errno;
#[cfg(feature = "general")]
#[cfg(target_arch = "mips64r6")]
#[path = "mips64r6/general.rs"]
pub mod general;
#[cfg(feature = "if_ether")]
#[cfg(target_arch = "mips64r6")]
#[path = "mips64r6/if_ether.rs"]
pub mod if_ether;
#[cfg(feature = "if_packet")]
#[cfg(target_arch = "mips64r6")]
#[path = "mips64r6/if_packet.rs"]
pub mod if_packet;
#[cfg(feature = "io_uring")]
#[cfg(target_arch = "mips64r6")]
#[path = "mips64r6/io_uring.rs"]
pub mod io_uring;
#[cfg(feature = "ioctl")]
#[cfg(target_arch = "mips64r6")]
#[path = "mips64r6/ioctl.rs"]
pub mod ioctl;
#[cfg(feature = "mempolicy")]
#[cfg(target_arch = "mips64r6")]
#[path = "mips64r6/mempolicy.rs"]
pub mod mempolicy;
#[cfg(feature = "net")]
#[cfg(target_arch = "mips64r6")]
#[path = "mips64r6/net.rs"]
pub mod net;
#[cfg(feature = "netlink")]
#[cfg(target_arch = "mips64r6")]
#[path = "mips64r6/netlink.rs"]
pub mod netlink;
#[cfg(feature = "prctl")]
#[cfg(target_arch = "mips64r6")]
#[path = "mips64r6/prctl.rs"]
pub mod prctl;
#[cfg(feature = "system")]
#[cfg(target_arch = "mips64r6")]
#[path = "mips64r6/system.rs"]
pub mod system;
#[cfg(feature = "xdp")]
#[cfg(target_arch = "mips64r6")]
#[path = "mips64r6/xdp.rs"]
pub mod xdp;
#[cfg(feature = "errno")]
#[cfg(target_arch = "powerpc")]
#[path = "powerpc/errno.rs"]
pub mod errno;
#[cfg(feature = "general")]
#[cfg(target_arch = "powerpc")]
#[path = "powerpc/general.rs"]
pub mod general;
#[cfg(feature = "if_ether")]
#[cfg(target_arch = "powerpc")]
#[path = "powerpc/if_ether.rs"]
pub mod if_ether;
#[cfg(feature = "if_packet")]
#[cfg(target_arch = "powerpc")]
#[path = "powerpc/if_packet.rs"]
pub mod if_packet;
#[cfg(feature = "io_uring")]
#[cfg(target_arch = "powerpc")]
#[path = "powerpc/io_uring.rs"]
pub mod io_uring;
#[cfg(feature = "ioctl")]
#[cfg(target_arch = "powerpc")]
#[path = "powerpc/ioctl.rs"]
pub mod ioctl;
#[cfg(feature = "mempolicy")]
#[cfg(target_arch = "powerpc")]
#[path = "powerpc/mempolicy.rs"]
pub mod mempolicy;
#[cfg(feature = "net")]
#[cfg(target_arch = "powerpc")]
#[path = "powerpc/net.rs"]
pub mod net;
#[cfg(feature = "netlink")]
#[cfg(target_arch = "powerpc")]
#[path = "powerpc/netlink.rs"]
pub mod netlink;
#[cfg(feature = "prctl")]
#[cfg(target_arch = "powerpc")]
#[path = "powerpc/prctl.rs"]
pub mod prctl;
#[cfg(feature = "system")]
#[cfg(target_arch = "powerpc")]
#[path = "powerpc/system.rs"]
pub mod system;
#[cfg(feature = "xdp")]
#[cfg(target_arch = "powerpc")]
#[path = "powerpc/xdp.rs"]
pub mod xdp;
#[cfg(feature = "errno")]
#[cfg(target_arch = "powerpc64")]
#[path = "powerpc64/errno.rs"]
pub mod errno;
#[cfg(feature = "general")]
#[cfg(target_arch = "powerpc64")]
#[path = "powerpc64/general.rs"]
pub mod general;
#[cfg(feature = "if_ether")]
#[cfg(target_arch = "powerpc64")]
#[path = "powerpc64/if_ether.rs"]
pub mod if_ether;
#[cfg(feature = "if_packet")]
#[cfg(target_arch = "powerpc64")]
#[path = "powerpc64/if_packet.rs"]
pub mod if_packet;
#[cfg(feature = "io_uring")]
#[cfg(target_arch = "powerpc64")]
#[path = "powerpc64/io_uring.rs"]
pub mod io_uring;
#[cfg(feature = "ioctl")]
#[cfg(target_arch = "powerpc64")]
#[path = "powerpc64/ioctl.rs"]
pub mod ioctl;
#[cfg(feature = "mempolicy")]
#[cfg(target_arch = "powerpc64")]
#[path = "powerpc64/mempolicy.rs"]
pub mod mempolicy;
#[cfg(feature = "net")]
#[cfg(target_arch = "powerpc64")]
#[path = "powerpc64/net.rs"]
pub mod net;
#[cfg(feature = "netlink")]
#[cfg(target_arch = "powerpc64")]
#[path = "powerpc64/netlink.rs"]
pub mod netlink;
#[cfg(feature = "prctl")]
#[cfg(target_arch = "powerpc64")]
#[path = "powerpc64/prctl.rs"]
pub mod prctl;
#[cfg(feature = "system")]
#[cfg(target_arch = "powerpc64")]
#[path = "powerpc64/system.rs"]
pub mod system;
#[cfg(feature = "xdp")]
#[cfg(target_arch = "powerpc64")]
#[path = "powerpc64/xdp.rs"]
pub mod xdp;
#[cfg(feature = "errno")]
#[cfg(target_arch = "riscv32")]
#[path = "riscv32/errno.rs"]
pub mod errno;
#[cfg(feature = "general")]
#[cfg(target_arch = "riscv32")]
#[path = "riscv32/general.rs"]
pub mod general;
#[cfg(feature = "if_ether")]
#[cfg(target_arch = "riscv32")]
#[path = "riscv32/if_ether.rs"]
pub mod if_ether;
#[cfg(feature = "if_packet")]
#[cfg(target_arch = "riscv32")]
#[path = "riscv32/if_packet.rs"]
pub mod if_packet;
#[cfg(feature = "io_uring")]
#[cfg(target_arch = "riscv32")]
#[path = "riscv32/io_uring.rs"]
pub mod io_uring;
#[cfg(feature = "ioctl")]
#[cfg(target_arch = "riscv32")]
#[path = "riscv32/ioctl.rs"]
pub mod ioctl;
#[cfg(feature = "mempolicy")]
#[cfg(target_arch = "riscv32")]
#[path = "riscv32/mempolicy.rs"]
pub mod mempolicy;
#[cfg(feature = "net")]
#[cfg(target_arch = "riscv32")]
#[path = "riscv32/net.rs"]
pub mod net;
#[cfg(feature = "netlink")]
#[cfg(target_arch = "riscv32")]
#[path = "riscv32/netlink.rs"]
pub mod netlink;
#[cfg(feature = "prctl")]
#[cfg(target_arch = "riscv32")]
#[path = "riscv32/prctl.rs"]
pub mod prctl;
#[cfg(feature = "system")]
#[cfg(target_arch = "riscv32")]
#[path = "riscv32/system.rs"]
pub mod system;
#[cfg(feature = "xdp")]
#[cfg(target_arch = "riscv32")]
#[path = "riscv32/xdp.rs"]
pub mod xdp;
#[cfg(feature = "errno")]
#[cfg(target_arch = "riscv64")]
#[path = "riscv64/errno.rs"]
pub mod errno;
#[cfg(feature = "general")]
#[cfg(target_arch = "riscv64")]
#[path = "riscv64/general.rs"]
pub mod general;
#[cfg(feature = "if_ether")]
#[cfg(target_arch = "riscv64")]
#[path = "riscv64/if_ether.rs"]
pub mod if_ether;
#[cfg(feature = "if_packet")]
#[cfg(target_arch = "riscv64")]
#[path = "riscv64/if_packet.rs"]
pub mod if_packet;
#[cfg(feature = "io_uring")]
#[cfg(target_arch = "riscv64")]
#[path = "riscv64/io_uring.rs"]
pub mod io_uring;
#[cfg(feature = "ioctl")]
#[cfg(target_arch = "riscv64")]
#[path = "riscv64/ioctl.rs"]
pub mod ioctl;
#[cfg(feature = "mempolicy")]
#[cfg(target_arch = "riscv64")]
#[path = "riscv64/mempolicy.rs"]
pub mod mempolicy;
#[cfg(feature = "net")]
#[cfg(target_arch = "riscv64")]
#[path = "riscv64/net.rs"]
pub mod net;
#[cfg(feature = "netlink")]
#[cfg(target_arch = "riscv64")]
#[path = "riscv64/netlink.rs"]
pub mod netlink;
#[cfg(feature = "prctl")]
#[cfg(target_arch = "riscv64")]
#[path = "riscv64/prctl.rs"]
pub mod prctl;
#[cfg(feature = "system")]
#[cfg(target_arch = "riscv64")]
#[path = "riscv64/system.rs"]
pub mod system;
#[cfg(feature = "xdp")]
#[cfg(target_arch = "riscv64")]
#[path = "riscv64/xdp.rs"]
pub mod xdp;
#[cfg(feature = "errno")]
#[cfg(target_arch = "s390x")]
#[path = "s390x/errno.rs"]
pub mod errno;
#[cfg(feature = "general")]
#[cfg(target_arch = "s390x")]
#[path = "s390x/general.rs"]
pub mod general;
#[cfg(feature = "if_ether")]
#[cfg(target_arch = "s390x")]
#[path = "s390x/if_ether.rs"]
pub mod if_ether;
#[cfg(feature = "if_packet")]
#[cfg(target_arch = "s390x")]
#[path = "s390x/if_packet.rs"]
pub mod if_packet;
#[cfg(feature = "io_uring")]
#[cfg(target_arch = "s390x")]
#[path = "s390x/io_uring.rs"]
pub mod io_uring;
#[cfg(feature = "ioctl")]
#[cfg(target_arch = "s390x")]
#[path = "s390x/ioctl.rs"]
pub mod ioctl;
#[cfg(feature = "mempolicy")]
#[cfg(target_arch = "s390x")]
#[path = "s390x/mempolicy.rs"]
pub mod mempolicy;
#[cfg(feature = "net")]
#[cfg(target_arch = "s390x")]
#[path = "s390x/net.rs"]
pub mod net;
#[cfg(feature = "netlink")]
#[cfg(target_arch = "s390x")]
#[path = "s390x/netlink.rs"]
pub mod netlink;
#[cfg(feature = "prctl")]
#[cfg(target_arch = "s390x")]
#[path = "s390x/prctl.rs"]
pub mod prctl;
#[cfg(feature = "system")]
#[cfg(target_arch = "s390x")]
#[path = "s390x/system.rs"]
pub mod system;
#[cfg(feature = "xdp")]
#[cfg(target_arch = "s390x")]
#[path = "s390x/xdp.rs"]
pub mod xdp;
#[cfg(feature = "errno")]
#[cfg(target_arch = "sparc")]
#[path = "sparc/errno.rs"]
pub mod errno;
#[cfg(feature = "general")]
#[cfg(target_arch = "sparc")]
#[path = "sparc/general.rs"]
pub mod general;
#[cfg(feature = "if_ether")]
#[cfg(target_arch = "sparc")]
#[path = "sparc/if_ether.rs"]
pub mod if_ether;
#[cfg(feature = "if_packet")]
#[cfg(target_arch = "sparc")]
#[path = "sparc/if_packet.rs"]
pub mod if_packet;
#[cfg(feature = "io_uring")]
#[cfg(target_arch = "sparc")]
#[path = "sparc/io_uring.rs"]
pub mod io_uring;
#[cfg(feature = "ioctl")]
#[cfg(target_arch = "sparc")]
#[path = "sparc/ioctl.rs"]
pub mod ioctl;
#[cfg(feature = "mempolicy")]
#[cfg(target_arch = "sparc")]
#[path = "sparc/mempolicy.rs"]
pub mod mempolicy;
#[cfg(feature = "net")]
#[cfg(target_arch = "sparc")]
#[path = "sparc/net.rs"]
pub mod net;
#[cfg(feature = "netlink")]
#[cfg(target_arch = "sparc")]
#[path = "sparc/netlink.rs"]
pub mod netlink;
#[cfg(feature = "prctl")]
#[cfg(target_arch = "sparc")]
#[path = "sparc/prctl.rs"]
pub mod prctl;
#[cfg(feature = "system")]
#[cfg(target_arch = "sparc")]
#[path = "sparc/system.rs"]
pub mod system;
#[cfg(feature = "xdp")]
#[cfg(target_arch = "sparc")]
#[path = "sparc/xdp.rs"]
pub mod xdp;
#[cfg(feature = "errno")]
#[cfg(target_arch = "sparc64")]
#[path = "sparc64/errno.rs"]
pub mod errno;
#[cfg(feature = "general")]
#[cfg(target_arch = "sparc64")]
#[path = "sparc64/general.rs"]
pub mod general;
#[cfg(feature = "if_ether")]
#[cfg(target_arch = "sparc64")]
#[path = "sparc64/if_ether.rs"]
pub mod if_ether;
#[cfg(feature = "if_packet")]
#[cfg(target_arch = "sparc64")]
#[path = "sparc64/if_packet.rs"]
pub mod if_packet;
#[cfg(feature = "io_uring")]
#[cfg(target_arch = "sparc64")]
#[path = "sparc64/io_uring.rs"]
pub mod io_uring;
#[cfg(feature = "ioctl")]
#[cfg(target_arch = "sparc64")]
#[path = "sparc64/ioctl.rs"]
pub mod ioctl;
#[cfg(feature = "mempolicy")]
#[cfg(target_arch = "sparc64")]
#[path = "sparc64/mempolicy.rs"]
pub mod mempolicy;
#[cfg(feature = "net")]
#[cfg(target_arch = "sparc64")]
#[path = "sparc64/net.rs"]
pub mod net;
#[cfg(feature = "netlink")]
#[cfg(target_arch = "sparc64")]
#[path = "sparc64/netlink.rs"]
pub mod netlink;
#[cfg(feature = "prctl")]
#[cfg(target_arch = "sparc64")]
#[path = "sparc64/prctl.rs"]
pub mod prctl;
#[cfg(feature = "system")]
#[cfg(target_arch = "sparc64")]
#[path = "sparc64/system.rs"]
pub mod system;
#[cfg(feature = "xdp")]
#[cfg(target_arch = "sparc64")]
#[path = "sparc64/xdp.rs"]
pub mod xdp;
#[cfg(feature = "errno")]
#[cfg(target_arch = "x86")]
#[path = "x86/errno.rs"]
pub mod errno;
#[cfg(feature = "general")]
#[cfg(target_arch = "x86")]
#[path = "x86/general.rs"]
pub mod general;
#[cfg(feature = "if_ether")]
#[cfg(target_arch = "x86")]
#[path = "x86/if_ether.rs"]
pub mod if_ether;
#[cfg(feature = "if_packet")]
#[cfg(target_arch = "x86")]
#[path = "x86/if_packet.rs"]
pub mod if_packet;
#[cfg(feature = "io_uring")]
#[cfg(target_arch = "x86")]
#[path = "x86/io_uring.rs"]
pub mod io_uring;
#[cfg(feature = "ioctl")]
#[cfg(target_arch = "x86")]
#[path = "x86/ioctl.rs"]
pub mod ioctl;
#[cfg(feature = "mempolicy")]
#[cfg(target_arch = "x86")]
#[path = "x86/mempolicy.rs"]
pub mod mempolicy;
#[cfg(feature = "net")]
#[cfg(target_arch = "x86")]
#[path = "x86/net.rs"]
pub mod net;
#[cfg(feature = "netlink")]
#[cfg(target_arch = "x86")]
#[path = "x86/netlink.rs"]
pub mod netlink;
#[cfg(feature = "prctl")]
#[cfg(target_arch = "x86")]
#[path = "x86/prctl.rs"]
pub mod prctl;
#[cfg(feature = "system")]
#[cfg(target_arch = "x86")]
#[path = "x86/system.rs"]
pub mod system;
#[cfg(feature = "xdp")]
#[cfg(target_arch = "x86")]
#[path = "x86/xdp.rs"]
pub mod xdp;
#[cfg(feature = "errno")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
#[path = "x86_64/errno.rs"]
pub mod errno;
#[cfg(feature = "general")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
#[path = "x86_64/general.rs"]
pub mod general;
#[cfg(feature = "if_ether")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
#[path = "x86_64/if_ether.rs"]
pub mod if_ether;
#[cfg(feature = "if_packet")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
#[path = "x86_64/if_packet.rs"]
pub mod if_packet;
#[cfg(feature = "io_uring")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
#[path = "x86_64/io_uring.rs"]
pub mod io_uring;
#[cfg(feature = "ioctl")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
#[path = "x86_64/ioctl.rs"]
pub mod ioctl;
#[cfg(feature = "mempolicy")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
#[path = "x86_64/mempolicy.rs"]
pub mod mempolicy;
#[cfg(feature = "net")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
#[path = "x86_64/net.rs"]
pub mod net;
#[cfg(feature = "netlink")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
#[path = "x86_64/netlink.rs"]
pub mod netlink;
#[cfg(feature = "prctl")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
#[path = "x86_64/prctl.rs"]
pub mod prctl;
#[cfg(feature = "system")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
#[path = "x86_64/system.rs"]
pub mod system;
#[cfg(feature = "xdp")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
#[path = "x86_64/xdp.rs"]
pub mod xdp;
#[cfg(feature = "errno")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
#[path = "x32/errno.rs"]
pub mod errno;
#[cfg(feature = "general")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
#[path = "x32/general.rs"]
pub mod general;
#[cfg(feature = "if_ether")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
#[path = "x32/if_ether.rs"]
pub mod if_ether;
#[cfg(feature = "if_packet")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
#[path = "x32/if_packet.rs"]
pub mod if_packet;
#[cfg(feature = "io_uring")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
#[path = "x32/io_uring.rs"]
pub mod io_uring;
#[cfg(feature = "ioctl")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
#[path = "x32/ioctl.rs"]
pub mod ioctl;
#[cfg(feature = "mempolicy")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
#[path = "x32/mempolicy.rs"]
pub mod mempolicy;
#[cfg(feature = "net")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
#[path = "x32/net.rs"]
pub mod net;
#[cfg(feature = "netlink")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
#[path = "x32/netlink.rs"]
pub mod netlink;
#[cfg(feature = "prctl")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
#[path = "x32/prctl.rs"]
pub mod prctl;
#[cfg(feature = "system")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
#[path = "x32/system.rs"]
pub mod system;
#[cfg(feature = "xdp")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
#[path = "x32/xdp.rs"]
pub mod xdp;