ax-posix-api 0.5.1

POSIX-compatible APIs for ArceOS modules
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
/* automatically generated by rust-bindgen 0.72.1 */

pub const O_CREAT: u32 = 64;
pub const O_EXCL: u32 = 128;
pub const O_NOCTTY: u32 = 256;
pub const O_TRUNC: u32 = 512;
pub const O_APPEND: u32 = 1024;
pub const O_NONBLOCK: u32 = 2048;
pub const O_DSYNC: u32 = 4096;
pub const O_SYNC: u32 = 1052672;
pub const O_RSYNC: u32 = 1052672;
pub const O_DIRECTORY: u32 = 65536;
pub const O_NOFOLLOW: u32 = 131072;
pub const O_CLOEXEC: u32 = 524288;
pub const O_ASYNC: u32 = 8192;
pub const O_DIRECT: u32 = 16384;
pub const O_LARGEFILE: u32 = 32768;
pub const O_NOATIME: u32 = 262144;
pub const O_PATH: u32 = 2097152;
pub const O_TMPFILE: u32 = 4259840;
pub const O_NDELAY: u32 = 2048;
pub const O_SEARCH: u32 = 2097152;
pub const O_EXEC: u32 = 2097152;
pub const O_TTY_INIT: u32 = 0;
pub const O_ACCMODE: u32 = 2097155;
pub const O_RDONLY: u32 = 0;
pub const O_WRONLY: u32 = 1;
pub const O_RDWR: u32 = 2;
pub const F_DUPFD: u32 = 0;
pub const F_GETFD: u32 = 1;
pub const F_SETFD: u32 = 2;
pub const F_GETFL: u32 = 3;
pub const F_SETFL: u32 = 4;
pub const F_SETOWN: u32 = 8;
pub const F_GETOWN: u32 = 9;
pub const F_SETSIG: u32 = 10;
pub const F_GETSIG: u32 = 11;
pub const F_GETLK: u32 = 5;
pub const F_SETLK: u32 = 6;
pub const F_SETLKW: u32 = 7;
pub const FD_CLOEXEC: u32 = 1;
pub const F_DUPFD_CLOEXEC: u32 = 1030;
pub const F_RDLCK: u32 = 0;
pub const F_WRLCK: u32 = 1;
pub const F_UNLCK: u32 = 2;
pub const F_OK: u32 = 0;
pub const F_ULOCK: u32 = 0;
pub const F_LOCK: u32 = 1;
pub const F_TLOCK: u32 = 2;
pub const F_TEST: u32 = 3;
pub const SOCK_STREAM: u32 = 1;
pub const SOCK_DGRAM: u32 = 2;
pub const SOCK_RAW: u32 = 3;
pub const SOCK_RDM: u32 = 4;
pub const SOCK_SEQPACKET: u32 = 5;
pub const SOCK_DCCP: u32 = 6;
pub const SOCK_PACKET: u32 = 10;
pub const SOCK_CLOEXEC: u32 = 524288;
pub const SOCK_NONBLOCK: u32 = 2048;
pub const AF_UNSPEC: u32 = 0;
pub const AF_LOCAL: u32 = 1;
pub const AF_UNIX: u32 = 1;
pub const AF_FILE: u32 = 1;
pub const AF_INET: u32 = 2;
pub const AF_AX25: u32 = 3;
pub const AF_IPX: u32 = 4;
pub const AF_APPLETALK: u32 = 5;
pub const AF_NETROM: u32 = 6;
pub const AF_BRIDGE: u32 = 7;
pub const AF_ATMPVC: u32 = 8;
pub const AF_X25: u32 = 9;
pub const AF_INET6: u32 = 10;
pub const AF_ROSE: u32 = 11;
pub const AF_DECnet: u32 = 12;
pub const AF_NETBEUI: u32 = 13;
pub const AF_SECURITY: u32 = 14;
pub const AF_KEY: u32 = 15;
pub const AF_NETLINK: u32 = 16;
pub const AF_ROUTE: u32 = 16;
pub const AF_PACKET: u32 = 17;
pub const AF_ASH: u32 = 18;
pub const AF_ECONET: u32 = 19;
pub const AF_ATMSVC: u32 = 20;
pub const AF_RDS: u32 = 21;
pub const AF_SNA: u32 = 22;
pub const AF_IRDA: u32 = 23;
pub const AF_PPPOX: u32 = 24;
pub const AF_WANPIPE: u32 = 25;
pub const AF_LLC: u32 = 26;
pub const AF_IB: u32 = 27;
pub const AF_MPLS: u32 = 28;
pub const AF_CAN: u32 = 29;
pub const AF_TIPC: u32 = 30;
pub const AF_BLUETOOTH: u32 = 31;
pub const AF_IUCV: u32 = 32;
pub const AF_RXRPC: u32 = 33;
pub const AF_ISDN: u32 = 34;
pub const AF_PHONET: u32 = 35;
pub const AF_IEEE802154: u32 = 36;
pub const AF_CAIF: u32 = 37;
pub const AF_ALG: u32 = 38;
pub const AF_NFC: u32 = 39;
pub const AF_VSOCK: u32 = 40;
pub const AF_KCM: u32 = 41;
pub const AF_QIPCRTR: u32 = 42;
pub const AF_SMC: u32 = 43;
pub const AF_XDP: u32 = 44;
pub const AF_MAX: u32 = 45;
pub const IPPROTO_IP: u32 = 0;
pub const IPPROTO_HOPOPTS: u32 = 0;
pub const IPPROTO_ICMP: u32 = 1;
pub const IPPROTO_IGMP: u32 = 2;
pub const IPPROTO_IPIP: u32 = 4;
pub const IPPROTO_TCP: u32 = 6;
pub const IPPROTO_EGP: u32 = 8;
pub const IPPROTO_PUP: u32 = 12;
pub const IPPROTO_UDP: u32 = 17;
pub const IPPROTO_IDP: u32 = 22;
pub const IPPROTO_TP: u32 = 29;
pub const IPPROTO_DCCP: u32 = 33;
pub const IPPROTO_IPV6: u32 = 41;
pub const IPPROTO_ROUTING: u32 = 43;
pub const IPPROTO_FRAGMENT: u32 = 44;
pub const IPPROTO_RSVP: u32 = 46;
pub const IPPROTO_GRE: u32 = 47;
pub const IPPROTO_ESP: u32 = 50;
pub const IPPROTO_AH: u32 = 51;
pub const IPPROTO_ICMPV6: u32 = 58;
pub const IPPROTO_NONE: u32 = 59;
pub const IPPROTO_DSTOPTS: u32 = 60;
pub const IPPROTO_MTP: u32 = 92;
pub const IPPROTO_BEETPH: u32 = 94;
pub const IPPROTO_ENCAP: u32 = 98;
pub const IPPROTO_PIM: u32 = 103;
pub const IPPROTO_COMP: u32 = 108;
pub const IPPROTO_SCTP: u32 = 132;
pub const IPPROTO_MH: u32 = 135;
pub const IPPROTO_UDPLITE: u32 = 136;
pub const IPPROTO_MPLS: u32 = 137;
pub const IPPROTO_ETHERNET: u32 = 143;
pub const IPPROTO_RAW: u32 = 255;
pub const IPPROTO_MPTCP: u32 = 262;
pub const IPPROTO_MAX: u32 = 263;
pub const EAI_BADFLAGS: i32 = -1;
pub const EAI_NONAME: i32 = -2;
pub const EAI_AGAIN: i32 = -3;
pub const EAI_FAIL: i32 = -4;
pub const EAI_FAMILY: i32 = -6;
pub const EAI_SOCKTYPE: i32 = -7;
pub const EAI_SERVICE: i32 = -8;
pub const EAI_MEMORY: i32 = -10;
pub const EAI_SYSTEM: i32 = -11;
pub const EAI_OVERFLOW: i32 = -12;
pub const MAXADDRS: u32 = 48;
pub const CLOCK_REALTIME: u32 = 0;
pub const CLOCK_MONOTONIC: u32 = 1;
pub const EPOLL_CLOEXEC: u32 = 524288;
pub const EPOLL_NONBLOCK: u32 = 2048;
pub const EPOLLIN: u32 = 1;
pub const EPOLLPRI: u32 = 2;
pub const EPOLLOUT: u32 = 4;
pub const EPOLLRDNORM: u32 = 64;
pub const EPOLLNVAL: u32 = 32;
pub const EPOLLRDBAND: u32 = 128;
pub const EPOLLWRNORM: u32 = 256;
pub const EPOLLWRBAND: u32 = 512;
pub const EPOLLMSG: u32 = 1024;
pub const EPOLLERR: u32 = 8;
pub const EPOLLHUP: u32 = 16;
pub const EPOLLRDHUP: u32 = 8192;
pub const EPOLLEXCLUSIVE: u32 = 268435456;
pub const EPOLLWAKEUP: u32 = 536870912;
pub const EPOLLONESHOT: u32 = 1073741824;
pub const EPOLLET: u32 = 2147483648;
pub const EPOLL_CTL_ADD: u32 = 1;
pub const EPOLL_CTL_DEL: u32 = 2;
pub const EPOLL_CTL_MOD: u32 = 3;
pub const RLIMIT_CPU: u32 = 0;
pub const RLIMIT_FSIZE: u32 = 1;
pub const RLIMIT_DATA: u32 = 2;
pub const RLIMIT_STACK: u32 = 3;
pub const RLIMIT_CORE: u32 = 4;
pub const RLIMIT_RSS: u32 = 5;
pub const RLIMIT_NPROC: u32 = 6;
pub const RLIMIT_NOFILE: u32 = 7;
pub const RLIMIT_MEMLOCK: u32 = 8;
pub const RLIMIT_AS: u32 = 9;
pub const RLIMIT_LOCKS: u32 = 10;
pub const RLIMIT_SIGPENDING: u32 = 11;
pub const RLIMIT_MSGQUEUE: u32 = 12;
pub const RLIMIT_NICE: u32 = 13;
pub const RLIMIT_RTPRIO: u32 = 14;
pub const RLIMIT_RTTIME: u32 = 15;
pub const RLIMIT_NLIMITS: u32 = 16;
pub const FD_SETSIZE: u32 = 1024;
pub const _SC_ARG_MAX: u32 = 0;
pub const _SC_CHILD_MAX: u32 = 1;
pub const _SC_CLK_TCK: u32 = 2;
pub const _SC_NGROUPS_MAX: u32 = 3;
pub const _SC_OPEN_MAX: u32 = 4;
pub const _SC_STREAM_MAX: u32 = 5;
pub const _SC_TZNAME_MAX: u32 = 6;
pub const _SC_JOB_CONTROL: u32 = 7;
pub const _SC_SAVED_IDS: u32 = 8;
pub const _SC_REALTIME_SIGNALS: u32 = 9;
pub const _SC_PRIORITY_SCHEDULING: u32 = 10;
pub const _SC_TIMERS: u32 = 11;
pub const _SC_ASYNCHRONOUS_IO: u32 = 12;
pub const _SC_PRIORITIZED_IO: u32 = 13;
pub const _SC_SYNCHRONIZED_IO: u32 = 14;
pub const _SC_FSYNC: u32 = 15;
pub const _SC_MAPPED_FILES: u32 = 16;
pub const _SC_MEMLOCK: u32 = 17;
pub const _SC_MEMLOCK_RANGE: u32 = 18;
pub const _SC_MEMORY_PROTECTION: u32 = 19;
pub const _SC_MESSAGE_PASSING: u32 = 20;
pub const _SC_SEMAPHORES: u32 = 21;
pub const _SC_SHARED_MEMORY_OBJECTS: u32 = 22;
pub const _SC_AIO_LISTIO_MAX: u32 = 23;
pub const _SC_AIO_MAX: u32 = 24;
pub const _SC_AIO_PRIO_DELTA_MAX: u32 = 25;
pub const _SC_DELAYTIMER_MAX: u32 = 26;
pub const _SC_MQ_OPEN_MAX: u32 = 27;
pub const _SC_MQ_PRIO_MAX: u32 = 28;
pub const _SC_VERSION: u32 = 29;
pub const _SC_PAGE_SIZE: u32 = 30;
pub const _SC_PAGESIZE: u32 = 30;
pub const _SC_RTSIG_MAX: u32 = 31;
pub const _SC_SEM_NSEMS_MAX: u32 = 32;
pub const _SC_SEM_VALUE_MAX: u32 = 33;
pub const _SC_SIGQUEUE_MAX: u32 = 34;
pub const _SC_TIMER_MAX: u32 = 35;
pub const _SC_BC_BASE_MAX: u32 = 36;
pub const _SC_BC_DIM_MAX: u32 = 37;
pub const _SC_BC_SCALE_MAX: u32 = 38;
pub const _SC_BC_STRING_MAX: u32 = 39;
pub const _SC_COLL_WEIGHTS_MAX: u32 = 40;
pub const _SC_EXPR_NEST_MAX: u32 = 42;
pub const _SC_LINE_MAX: u32 = 43;
pub const _SC_RE_DUP_MAX: u32 = 44;
pub const _SC_2_VERSION: u32 = 46;
pub const _SC_2_C_BIND: u32 = 47;
pub const _SC_2_C_DEV: u32 = 48;
pub const _SC_2_FORT_DEV: u32 = 49;
pub const _SC_2_FORT_RUN: u32 = 50;
pub const _SC_2_SW_DEV: u32 = 51;
pub const _SC_2_LOCALEDEF: u32 = 52;
pub const _SC_UIO_MAXIOV: u32 = 60;
pub const _SC_IOV_MAX: u32 = 60;
pub const _SC_THREADS: u32 = 67;
pub const _SC_THREAD_SAFE_FUNCTIONS: u32 = 68;
pub const _SC_GETGR_R_SIZE_MAX: u32 = 69;
pub const _SC_GETPW_R_SIZE_MAX: u32 = 70;
pub const _SC_LOGIN_NAME_MAX: u32 = 71;
pub const _SC_TTY_NAME_MAX: u32 = 72;
pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: u32 = 73;
pub const _SC_THREAD_KEYS_MAX: u32 = 74;
pub const _SC_THREAD_STACK_MIN: u32 = 75;
pub const _SC_THREAD_THREADS_MAX: u32 = 76;
pub const _SC_THREAD_ATTR_STACKADDR: u32 = 77;
pub const _SC_THREAD_ATTR_STACKSIZE: u32 = 78;
pub const _SC_THREAD_PRIORITY_SCHEDULING: u32 = 79;
pub const _SC_THREAD_PRIO_INHERIT: u32 = 80;
pub const _SC_THREAD_PRIO_PROTECT: u32 = 81;
pub const _SC_THREAD_PROCESS_SHARED: u32 = 82;
pub const _SC_NPROCESSORS_CONF: u32 = 83;
pub const _SC_NPROCESSORS_ONLN: u32 = 84;
pub const _SC_PHYS_PAGES: u32 = 85;
pub const _SC_AVPHYS_PAGES: u32 = 86;
pub const _SC_ATEXIT_MAX: u32 = 87;
pub const _SC_PASS_MAX: u32 = 88;
pub const _SC_XOPEN_VERSION: u32 = 89;
pub const _SC_XOPEN_XCU_VERSION: u32 = 90;
pub const _SC_XOPEN_UNIX: u32 = 91;
pub const _SC_XOPEN_CRYPT: u32 = 92;
pub const _SC_XOPEN_ENH_I18N: u32 = 93;
pub const _SC_XOPEN_SHM: u32 = 94;
pub const _SC_2_CHAR_TERM: u32 = 95;
pub const _SC_2_UPE: u32 = 97;
pub const _SC_XOPEN_XPG2: u32 = 98;
pub const _SC_XOPEN_XPG3: u32 = 99;
pub const _SC_XOPEN_XPG4: u32 = 100;
pub const _SC_NZERO: u32 = 109;
pub const _SC_XBS5_ILP32_OFF32: u32 = 125;
pub const _SC_XBS5_ILP32_OFFBIG: u32 = 126;
pub const _SC_XBS5_LP64_OFF64: u32 = 127;
pub const _SC_XBS5_LPBIG_OFFBIG: u32 = 128;
pub const _SC_XOPEN_LEGACY: u32 = 129;
pub const _SC_XOPEN_REALTIME: u32 = 130;
pub const _SC_XOPEN_REALTIME_THREADS: u32 = 131;
pub const _SC_ADVISORY_INFO: u32 = 132;
pub const _SC_BARRIERS: u32 = 133;
pub const _SC_CLOCK_SELECTION: u32 = 137;
pub const _SC_CPUTIME: u32 = 138;
pub const _SC_THREAD_CPUTIME: u32 = 139;
pub const _SC_MONOTONIC_CLOCK: u32 = 149;
pub const _SC_READER_WRITER_LOCKS: u32 = 153;
pub const _SC_SPIN_LOCKS: u32 = 154;
pub const _SC_REGEXP: u32 = 155;
pub const _SC_SHELL: u32 = 157;
pub const _SC_SPAWN: u32 = 159;
pub const _SC_SPORADIC_SERVER: u32 = 160;
pub const _SC_THREAD_SPORADIC_SERVER: u32 = 161;
pub const _SC_TIMEOUTS: u32 = 164;
pub const _SC_TYPED_MEMORY_OBJECTS: u32 = 165;
pub const _SC_2_PBS: u32 = 168;
pub const _SC_2_PBS_ACCOUNTING: u32 = 169;
pub const _SC_2_PBS_LOCATE: u32 = 170;
pub const _SC_2_PBS_MESSAGE: u32 = 171;
pub const _SC_2_PBS_TRACK: u32 = 172;
pub const _SC_SYMLOOP_MAX: u32 = 173;
pub const _SC_STREAMS: u32 = 174;
pub const _SC_2_PBS_CHECKPOINT: u32 = 175;
pub const _SC_V6_ILP32_OFF32: u32 = 176;
pub const _SC_V6_ILP32_OFFBIG: u32 = 177;
pub const _SC_V6_LP64_OFF64: u32 = 178;
pub const _SC_V6_LPBIG_OFFBIG: u32 = 179;
pub const _SC_HOST_NAME_MAX: u32 = 180;
pub const _SC_TRACE: u32 = 181;
pub const _SC_TRACE_EVENT_FILTER: u32 = 182;
pub const _SC_TRACE_INHERIT: u32 = 183;
pub const _SC_TRACE_LOG: u32 = 184;
pub const _SC_IPV6: u32 = 235;
pub const _SC_RAW_SOCKETS: u32 = 236;
pub const _SC_V7_ILP32_OFF32: u32 = 237;
pub const _SC_V7_ILP32_OFFBIG: u32 = 238;
pub const _SC_V7_LP64_OFF64: u32 = 239;
pub const _SC_V7_LPBIG_OFFBIG: u32 = 240;
pub const _SC_SS_REPL_MAX: u32 = 241;
pub const _SC_TRACE_EVENT_NAME_MAX: u32 = 242;
pub const _SC_TRACE_NAME_MAX: u32 = 243;
pub const _SC_TRACE_SYS_MAX: u32 = 244;
pub const _SC_TRACE_USER_EVENT_MAX: u32 = 245;
pub const _SC_XOPEN_STREAMS: u32 = 246;
pub const _SC_THREAD_ROBUST_PRIO_INHERIT: u32 = 247;
pub const _SC_THREAD_ROBUST_PRIO_PROTECT: u32 = 248;
pub type size_t = usize;
pub type ssize_t = isize;
pub type clockid_t = ::core::ffi::c_int;
pub type mode_t = ::core::ffi::c_uint;
pub type nlink_t = u32;
pub type off_t = i64;
pub type ino_t = u64;
pub type dev_t = u64;
pub type blksize_t = ::core::ffi::c_long;
pub type blkcnt_t = i64;
pub type uid_t = ::core::ffi::c_uint;
pub type gid_t = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct iovec {
    pub iov_base: *mut ::core::ffi::c_void,
    pub iov_len: size_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of iovec"][::core::mem::size_of::<iovec>() - 16usize];
    ["Alignment of iovec"][::core::mem::align_of::<iovec>() - 8usize];
    ["Offset of field: iovec::iov_base"][::core::mem::offset_of!(iovec, iov_base) - 0usize];
    ["Offset of field: iovec::iov_len"][::core::mem::offset_of!(iovec, iov_len) - 8usize];
};
impl Default for iovec {
    fn default() -> Self {
        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type socklen_t = ::core::ffi::c_uint;
pub type sa_family_t = ::core::ffi::c_ushort;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct sockaddr {
    pub sa_family: sa_family_t,
    pub sa_data: [::core::ffi::c_char; 14usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of sockaddr"][::core::mem::size_of::<sockaddr>() - 16usize];
    ["Alignment of sockaddr"][::core::mem::align_of::<sockaddr>() - 2usize];
    ["Offset of field: sockaddr::sa_family"][::core::mem::offset_of!(sockaddr, sa_family) - 0usize];
    ["Offset of field: sockaddr::sa_data"][::core::mem::offset_of!(sockaddr, sa_data) - 2usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sockaddr_storage {
    pub ss_family: sa_family_t,
    pub __ss_padding: [::core::ffi::c_char; 118usize],
    pub __ss_align: ::core::ffi::c_ulong,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of sockaddr_storage"][::core::mem::size_of::<sockaddr_storage>() - 128usize];
    ["Alignment of sockaddr_storage"][::core::mem::align_of::<sockaddr_storage>() - 8usize];
    ["Offset of field: sockaddr_storage::ss_family"]
        [::core::mem::offset_of!(sockaddr_storage, ss_family) - 0usize];
    ["Offset of field: sockaddr_storage::__ss_padding"]
        [::core::mem::offset_of!(sockaddr_storage, __ss_padding) - 2usize];
    ["Offset of field: sockaddr_storage::__ss_align"]
        [::core::mem::offset_of!(sockaddr_storage, __ss_align) - 120usize];
};
impl Default for sockaddr_storage {
    fn default() -> Self {
        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type in_port_t = u16;
pub type in_addr_t = u32;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct in_addr {
    pub s_addr: in_addr_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of in_addr"][::core::mem::size_of::<in_addr>() - 4usize];
    ["Alignment of in_addr"][::core::mem::align_of::<in_addr>() - 4usize];
    ["Offset of field: in_addr::s_addr"][::core::mem::offset_of!(in_addr, s_addr) - 0usize];
};
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct sockaddr_in {
    pub sin_family: sa_family_t,
    pub sin_port: in_port_t,
    pub sin_addr: in_addr,
    pub sin_zero: [u8; 8usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of sockaddr_in"][::core::mem::size_of::<sockaddr_in>() - 16usize];
    ["Alignment of sockaddr_in"][::core::mem::align_of::<sockaddr_in>() - 4usize];
    ["Offset of field: sockaddr_in::sin_family"]
        [::core::mem::offset_of!(sockaddr_in, sin_family) - 0usize];
    ["Offset of field: sockaddr_in::sin_port"]
        [::core::mem::offset_of!(sockaddr_in, sin_port) - 2usize];
    ["Offset of field: sockaddr_in::sin_addr"]
        [::core::mem::offset_of!(sockaddr_in, sin_addr) - 4usize];
    ["Offset of field: sockaddr_in::sin_zero"]
        [::core::mem::offset_of!(sockaddr_in, sin_zero) - 8usize];
};
#[repr(C)]
#[derive(Copy, Clone)]
pub struct in6_addr {
    pub __in6_union: in6_addr__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union in6_addr__bindgen_ty_1 {
    pub __s6_addr: [u8; 16usize],
    pub __s6_addr16: [u16; 8usize],
    pub __s6_addr32: [u32; 4usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of in6_addr__bindgen_ty_1"][::core::mem::size_of::<in6_addr__bindgen_ty_1>() - 16usize];
    ["Alignment of in6_addr__bindgen_ty_1"]
        [::core::mem::align_of::<in6_addr__bindgen_ty_1>() - 4usize];
    ["Offset of field: in6_addr__bindgen_ty_1::__s6_addr"]
        [::core::mem::offset_of!(in6_addr__bindgen_ty_1, __s6_addr) - 0usize];
    ["Offset of field: in6_addr__bindgen_ty_1::__s6_addr16"]
        [::core::mem::offset_of!(in6_addr__bindgen_ty_1, __s6_addr16) - 0usize];
    ["Offset of field: in6_addr__bindgen_ty_1::__s6_addr32"]
        [::core::mem::offset_of!(in6_addr__bindgen_ty_1, __s6_addr32) - 0usize];
};
impl Default for in6_addr__bindgen_ty_1 {
    fn default() -> Self {
        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of in6_addr"][::core::mem::size_of::<in6_addr>() - 16usize];
    ["Alignment of in6_addr"][::core::mem::align_of::<in6_addr>() - 4usize];
    ["Offset of field: in6_addr::__in6_union"]
        [::core::mem::offset_of!(in6_addr, __in6_union) - 0usize];
};
impl Default for in6_addr {
    fn default() -> Self {
        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct sockaddr_in6 {
    pub sin6_family: sa_family_t,
    pub sin6_port: in_port_t,
    pub sin6_flowinfo: u32,
    pub sin6_addr: in6_addr,
    pub sin6_scope_id: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of sockaddr_in6"][::core::mem::size_of::<sockaddr_in6>() - 28usize];
    ["Alignment of sockaddr_in6"][::core::mem::align_of::<sockaddr_in6>() - 4usize];
    ["Offset of field: sockaddr_in6::sin6_family"]
        [::core::mem::offset_of!(sockaddr_in6, sin6_family) - 0usize];
    ["Offset of field: sockaddr_in6::sin6_port"]
        [::core::mem::offset_of!(sockaddr_in6, sin6_port) - 2usize];
    ["Offset of field: sockaddr_in6::sin6_flowinfo"]
        [::core::mem::offset_of!(sockaddr_in6, sin6_flowinfo) - 4usize];
    ["Offset of field: sockaddr_in6::sin6_addr"]
        [::core::mem::offset_of!(sockaddr_in6, sin6_addr) - 8usize];
    ["Offset of field: sockaddr_in6::sin6_scope_id"]
        [::core::mem::offset_of!(sockaddr_in6, sin6_scope_id) - 24usize];
};
impl Default for sockaddr_in6 {
    fn default() -> Self {
        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct addrinfo {
    pub ai_flags: ::core::ffi::c_int,
    pub ai_family: ::core::ffi::c_int,
    pub ai_socktype: ::core::ffi::c_int,
    pub ai_protocol: ::core::ffi::c_int,
    pub ai_addrlen: socklen_t,
    pub ai_addr: *mut sockaddr,
    pub ai_canonname: *mut ::core::ffi::c_char,
    pub ai_next: *mut addrinfo,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of addrinfo"][::core::mem::size_of::<addrinfo>() - 48usize];
    ["Alignment of addrinfo"][::core::mem::align_of::<addrinfo>() - 8usize];
    ["Offset of field: addrinfo::ai_flags"][::core::mem::offset_of!(addrinfo, ai_flags) - 0usize];
    ["Offset of field: addrinfo::ai_family"][::core::mem::offset_of!(addrinfo, ai_family) - 4usize];
    ["Offset of field: addrinfo::ai_socktype"]
        [::core::mem::offset_of!(addrinfo, ai_socktype) - 8usize];
    ["Offset of field: addrinfo::ai_protocol"]
        [::core::mem::offset_of!(addrinfo, ai_protocol) - 12usize];
    ["Offset of field: addrinfo::ai_addrlen"]
        [::core::mem::offset_of!(addrinfo, ai_addrlen) - 16usize];
    ["Offset of field: addrinfo::ai_addr"][::core::mem::offset_of!(addrinfo, ai_addr) - 24usize];
    ["Offset of field: addrinfo::ai_canonname"]
        [::core::mem::offset_of!(addrinfo, ai_canonname) - 32usize];
    ["Offset of field: addrinfo::ai_next"][::core::mem::offset_of!(addrinfo, ai_next) - 40usize];
};
impl Default for addrinfo {
    fn default() -> Self {
        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct aibuf {
    pub ai: addrinfo,
    pub sa: aibuf_sa,
    pub lock: [::core::ffi::c_int; 1usize],
    pub slot: ::core::ffi::c_short,
    pub ref_: ::core::ffi::c_short,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union aibuf_sa {
    pub sin: sockaddr_in,
    pub sin6: sockaddr_in6,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of aibuf_sa"][::core::mem::size_of::<aibuf_sa>() - 28usize];
    ["Alignment of aibuf_sa"][::core::mem::align_of::<aibuf_sa>() - 4usize];
    ["Offset of field: aibuf_sa::sin"][::core::mem::offset_of!(aibuf_sa, sin) - 0usize];
    ["Offset of field: aibuf_sa::sin6"][::core::mem::offset_of!(aibuf_sa, sin6) - 0usize];
};
impl Default for aibuf_sa {
    fn default() -> Self {
        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of aibuf"][::core::mem::size_of::<aibuf>() - 88usize];
    ["Alignment of aibuf"][::core::mem::align_of::<aibuf>() - 8usize];
    ["Offset of field: aibuf::ai"][::core::mem::offset_of!(aibuf, ai) - 0usize];
    ["Offset of field: aibuf::sa"][::core::mem::offset_of!(aibuf, sa) - 48usize];
    ["Offset of field: aibuf::lock"][::core::mem::offset_of!(aibuf, lock) - 76usize];
    ["Offset of field: aibuf::slot"][::core::mem::offset_of!(aibuf, slot) - 80usize];
    ["Offset of field: aibuf::ref_"][::core::mem::offset_of!(aibuf, ref_) - 82usize];
};
impl Default for aibuf {
    fn default() -> Self {
        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type time_t = ::core::ffi::c_longlong;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct timeval {
    pub tv_sec: time_t,
    pub tv_usec: ::core::ffi::c_long,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of timeval"][::core::mem::size_of::<timeval>() - 16usize];
    ["Alignment of timeval"][::core::mem::align_of::<timeval>() - 8usize];
    ["Offset of field: timeval::tv_sec"][::core::mem::offset_of!(timeval, tv_sec) - 0usize];
    ["Offset of field: timeval::tv_usec"][::core::mem::offset_of!(timeval, tv_usec) - 8usize];
};
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct timespec {
    pub tv_sec: time_t,
    pub tv_nsec: ::core::ffi::c_long,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of timespec"][::core::mem::size_of::<timespec>() - 16usize];
    ["Alignment of timespec"][::core::mem::align_of::<timespec>() - 8usize];
    ["Offset of field: timespec::tv_sec"][::core::mem::offset_of!(timespec, tv_sec) - 0usize];
    ["Offset of field: timespec::tv_nsec"][::core::mem::offset_of!(timespec, tv_nsec) - 8usize];
};
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct pthread_mutex_t {
    pub __l: [::core::ffi::c_long; 1usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pthread_mutex_t"][::core::mem::size_of::<pthread_mutex_t>() - 8usize];
    ["Alignment of pthread_mutex_t"][::core::mem::align_of::<pthread_mutex_t>() - 8usize];
    ["Offset of field: pthread_mutex_t::__l"]
        [::core::mem::offset_of!(pthread_mutex_t, __l) - 0usize];
};
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct pthread_mutexattr_t {
    pub __attr: ::core::ffi::c_uint,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pthread_mutexattr_t"][::core::mem::size_of::<pthread_mutexattr_t>() - 4usize];
    ["Alignment of pthread_mutexattr_t"][::core::mem::align_of::<pthread_mutexattr_t>() - 4usize];
    ["Offset of field: pthread_mutexattr_t::__attr"]
        [::core::mem::offset_of!(pthread_mutexattr_t, __attr) - 0usize];
};
#[repr(C)]
#[derive(Copy, Clone)]
pub struct pthread_attr_t {
    pub __u: pthread_attr_t__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union pthread_attr_t__bindgen_ty_1 {
    pub __i: [::core::ffi::c_int; 14usize],
    pub __vi: [::core::ffi::c_int; 14usize],
    pub __s: [::core::ffi::c_ulong; 7usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pthread_attr_t__bindgen_ty_1"]
        [::core::mem::size_of::<pthread_attr_t__bindgen_ty_1>() - 56usize];
    ["Alignment of pthread_attr_t__bindgen_ty_1"]
        [::core::mem::align_of::<pthread_attr_t__bindgen_ty_1>() - 8usize];
    ["Offset of field: pthread_attr_t__bindgen_ty_1::__i"]
        [::core::mem::offset_of!(pthread_attr_t__bindgen_ty_1, __i) - 0usize];
    ["Offset of field: pthread_attr_t__bindgen_ty_1::__vi"]
        [::core::mem::offset_of!(pthread_attr_t__bindgen_ty_1, __vi) - 0usize];
    ["Offset of field: pthread_attr_t__bindgen_ty_1::__s"]
        [::core::mem::offset_of!(pthread_attr_t__bindgen_ty_1, __s) - 0usize];
};
impl Default for pthread_attr_t__bindgen_ty_1 {
    fn default() -> Self {
        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pthread_attr_t"][::core::mem::size_of::<pthread_attr_t>() - 56usize];
    ["Alignment of pthread_attr_t"][::core::mem::align_of::<pthread_attr_t>() - 8usize];
    ["Offset of field: pthread_attr_t::__u"][::core::mem::offset_of!(pthread_attr_t, __u) - 0usize];
};
impl Default for pthread_attr_t {
    fn default() -> Self {
        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type pthread_t = *mut ::core::ffi::c_void;
#[repr(C)]
#[derive(Copy, Clone)]
pub union epoll_data {
    pub ptr: *mut ::core::ffi::c_void,
    pub fd: ::core::ffi::c_int,
    pub u32_: u32,
    pub u64_: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of epoll_data"][::core::mem::size_of::<epoll_data>() - 8usize];
    ["Alignment of epoll_data"][::core::mem::align_of::<epoll_data>() - 8usize];
    ["Offset of field: epoll_data::ptr"][::core::mem::offset_of!(epoll_data, ptr) - 0usize];
    ["Offset of field: epoll_data::fd"][::core::mem::offset_of!(epoll_data, fd) - 0usize];
    ["Offset of field: epoll_data::u32_"][::core::mem::offset_of!(epoll_data, u32_) - 0usize];
    ["Offset of field: epoll_data::u64_"][::core::mem::offset_of!(epoll_data, u64_) - 0usize];
};
impl Default for epoll_data {
    fn default() -> Self {
        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type epoll_data_t = epoll_data;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct epoll_event {
    pub events: u32,
    pub data: epoll_data_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of epoll_event"][::core::mem::size_of::<epoll_event>() - 16usize];
    ["Alignment of epoll_event"][::core::mem::align_of::<epoll_event>() - 8usize];
    ["Offset of field: epoll_event::events"][::core::mem::offset_of!(epoll_event, events) - 0usize];
    ["Offset of field: epoll_event::data"][::core::mem::offset_of!(epoll_event, data) - 8usize];
};
impl Default for epoll_event {
    fn default() -> Self {
        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type rlim_t = ::core::ffi::c_ulonglong;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct rlimit {
    pub rlim_cur: rlim_t,
    pub rlim_max: rlim_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of rlimit"][::core::mem::size_of::<rlimit>() - 16usize];
    ["Alignment of rlimit"][::core::mem::align_of::<rlimit>() - 8usize];
    ["Offset of field: rlimit::rlim_cur"][::core::mem::offset_of!(rlimit, rlim_cur) - 0usize];
    ["Offset of field: rlimit::rlim_max"][::core::mem::offset_of!(rlimit, rlim_max) - 8usize];
};
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct fd_set {
    pub fds_bits: [::core::ffi::c_ulong; 16usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fd_set"][::core::mem::size_of::<fd_set>() - 128usize];
    ["Alignment of fd_set"][::core::mem::align_of::<fd_set>() - 8usize];
    ["Offset of field: fd_set::fds_bits"][::core::mem::offset_of!(fd_set, fds_bits) - 0usize];
};
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct stat {
    pub st_dev: dev_t,
    pub st_ino: ino_t,
    pub st_mode: mode_t,
    pub st_nlink: nlink_t,
    pub st_uid: uid_t,
    pub st_gid: gid_t,
    pub st_rdev: dev_t,
    pub st_size: off_t,
    pub st_blksize: blksize_t,
    pub st_blocks: blkcnt_t,
    pub st_atime: timespec,
    pub st_mtime: timespec,
    pub st_ctime: timespec,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of stat"][::core::mem::size_of::<stat>() - 112usize];
    ["Alignment of stat"][::core::mem::align_of::<stat>() - 8usize];
    ["Offset of field: stat::st_dev"][::core::mem::offset_of!(stat, st_dev) - 0usize];
    ["Offset of field: stat::st_ino"][::core::mem::offset_of!(stat, st_ino) - 8usize];
    ["Offset of field: stat::st_mode"][::core::mem::offset_of!(stat, st_mode) - 16usize];
    ["Offset of field: stat::st_nlink"][::core::mem::offset_of!(stat, st_nlink) - 20usize];
    ["Offset of field: stat::st_uid"][::core::mem::offset_of!(stat, st_uid) - 24usize];
    ["Offset of field: stat::st_gid"][::core::mem::offset_of!(stat, st_gid) - 28usize];
    ["Offset of field: stat::st_rdev"][::core::mem::offset_of!(stat, st_rdev) - 32usize];
    ["Offset of field: stat::st_size"][::core::mem::offset_of!(stat, st_size) - 40usize];
    ["Offset of field: stat::st_blksize"][::core::mem::offset_of!(stat, st_blksize) - 48usize];
    ["Offset of field: stat::st_blocks"][::core::mem::offset_of!(stat, st_blocks) - 56usize];
    ["Offset of field: stat::st_atime"][::core::mem::offset_of!(stat, st_atime) - 64usize];
    ["Offset of field: stat::st_mtime"][::core::mem::offset_of!(stat, st_mtime) - 80usize];
    ["Offset of field: stat::st_ctime"][::core::mem::offset_of!(stat, st_ctime) - 96usize];
};