xref: /rust-libc-0.2.174/src/unix/hurd/mod.rs (revision 790180ba)
1 #![allow(dead_code)]
2 
3 use crate::c_schar;
4 use crate::prelude::*;
5 
6 // types
7 pub type __s16_type = c_short;
8 pub type __u16_type = c_ushort;
9 pub type __s32_type = c_int;
10 pub type __u32_type = c_uint;
11 pub type __slongword_type = c_long;
12 pub type __ulongword_type = c_ulong;
13 
14 pub type __u_char = c_uchar;
15 pub type __u_short = c_ushort;
16 pub type __u_int = c_uint;
17 pub type __u_long = c_ulong;
18 pub type __int8_t = c_schar;
19 pub type __uint8_t = c_uchar;
20 pub type __int16_t = c_short;
21 pub type __uint16_t = c_ushort;
22 pub type __int32_t = c_int;
23 pub type __uint32_t = c_uint;
24 pub type __int_least8_t = __int8_t;
25 pub type __uint_least8_t = __uint8_t;
26 pub type __int_least16_t = __int16_t;
27 pub type __uint_least16_t = __uint16_t;
28 pub type __int_least32_t = __int32_t;
29 pub type __uint_least32_t = __uint32_t;
30 pub type __int_least64_t = __int64_t;
31 pub type __uint_least64_t = __uint64_t;
32 
33 pub type __dev_t = __uword_type;
34 pub type __uid_t = __u32_type;
35 pub type __gid_t = __u32_type;
36 pub type __ino_t = __ulongword_type;
37 pub type __ino64_t = __uquad_type;
38 pub type __mode_t = __u32_type;
39 pub type __nlink_t = __uword_type;
40 pub type __off_t = __slongword_type;
41 pub type __off64_t = __squad_type;
42 pub type __pid_t = __s32_type;
43 pub type __rlim_t = __ulongword_type;
44 pub type __rlim64_t = __uquad_type;
45 pub type __blkcnt_t = __slongword_type;
46 pub type __blkcnt64_t = __squad_type;
47 pub type __fsblkcnt_t = __ulongword_type;
48 pub type __fsblkcnt64_t = __uquad_type;
49 pub type __fsfilcnt_t = __ulongword_type;
50 pub type __fsfilcnt64_t = __uquad_type;
51 pub type __fsword_t = __sword_type;
52 pub type __id_t = __u32_type;
53 pub type __clock_t = __slongword_type;
54 pub type __time_t = __slongword_type;
55 pub type __useconds_t = __u32_type;
56 pub type __suseconds_t = __slongword_type;
57 pub type __suseconds64_t = __squad_type;
58 pub type __daddr_t = __s32_type;
59 pub type __key_t = __s32_type;
60 pub type __clockid_t = __s32_type;
61 pub type __timer_t = __uword_type;
62 pub type __blksize_t = __slongword_type;
63 pub type __fsid_t = __uquad_type;
64 pub type __ssize_t = __sword_type;
65 pub type __syscall_slong_t = __slongword_type;
66 pub type __syscall_ulong_t = __ulongword_type;
67 pub type __cpu_mask = __ulongword_type;
68 
69 pub type __loff_t = __off64_t;
70 pub type __caddr_t = *mut c_char;
71 pub type __intptr_t = __sword_type;
72 pub type __ptrdiff_t = __sword_type;
73 pub type __socklen_t = __u32_type;
74 pub type __sig_atomic_t = c_int;
75 pub type __time64_t = __int64_t;
76 pub type wchar_t = c_int;
77 pub type wint_t = c_uint;
78 pub type gid_t = __gid_t;
79 pub type uid_t = __uid_t;
80 pub type off_t = __off_t;
81 pub type off64_t = __off64_t;
82 pub type useconds_t = __useconds_t;
83 pub type pid_t = __pid_t;
84 pub type socklen_t = __socklen_t;
85 
86 pub type in_addr_t = u32;
87 
88 pub type _Float32 = f32;
89 pub type _Float64 = f64;
90 pub type _Float32x = f64;
91 pub type _Float64x = f64;
92 
93 pub type __locale_t = *mut __locale_struct;
94 pub type locale_t = __locale_t;
95 
96 pub type u_char = __u_char;
97 pub type u_short = __u_short;
98 pub type u_int = __u_int;
99 pub type u_long = __u_long;
100 pub type quad_t = __quad_t;
101 pub type u_quad_t = __u_quad_t;
102 pub type fsid_t = __fsid_t;
103 pub type loff_t = __loff_t;
104 pub type ino_t = __ino_t;
105 pub type ino64_t = __ino64_t;
106 pub type dev_t = __dev_t;
107 pub type mode_t = __mode_t;
108 pub type nlink_t = __nlink_t;
109 pub type id_t = __id_t;
110 pub type daddr_t = __daddr_t;
111 pub type caddr_t = __caddr_t;
112 pub type key_t = __key_t;
113 pub type clock_t = __clock_t;
114 pub type clockid_t = __clockid_t;
115 pub type time_t = __time_t;
116 pub type timer_t = __timer_t;
117 pub type suseconds_t = __suseconds_t;
118 pub type ulong = c_ulong;
119 pub type ushort = c_ushort;
120 pub type uint = c_uint;
121 pub type u_int8_t = __uint8_t;
122 pub type u_int16_t = __uint16_t;
123 pub type u_int32_t = __uint32_t;
124 pub type u_int64_t = __uint64_t;
125 pub type register_t = c_int;
126 pub type __sigset_t = c_ulong;
127 pub type sigset_t = __sigset_t;
128 
129 pub type __fd_mask = c_long;
130 pub type fd_mask = __fd_mask;
131 pub type blksize_t = __blksize_t;
132 pub type blkcnt_t = __blkcnt_t;
133 pub type fsblkcnt_t = __fsblkcnt_t;
134 pub type fsfilcnt_t = __fsfilcnt_t;
135 pub type blkcnt64_t = __blkcnt64_t;
136 pub type fsblkcnt64_t = __fsblkcnt64_t;
137 pub type fsfilcnt64_t = __fsfilcnt64_t;
138 
139 pub type __pthread_spinlock_t = c_int;
140 pub type __tss_t = c_int;
141 pub type __thrd_t = c_long;
142 pub type __pthread_t = c_long;
143 pub type pthread_t = __pthread_t;
144 pub type __pthread_process_shared = c_uint;
145 pub type __pthread_inheritsched = c_uint;
146 pub type __pthread_contentionscope = c_uint;
147 pub type __pthread_detachstate = c_uint;
148 pub type pthread_attr_t = __pthread_attr;
149 pub type __pthread_mutex_protocol = c_uint;
150 pub type __pthread_mutex_type = c_uint;
151 pub type __pthread_mutex_robustness = c_uint;
152 pub type pthread_mutexattr_t = __pthread_mutexattr;
153 pub type pthread_mutex_t = __pthread_mutex;
154 pub type pthread_condattr_t = __pthread_condattr;
155 pub type pthread_cond_t = __pthread_cond;
156 pub type pthread_spinlock_t = __pthread_spinlock_t;
157 pub type pthread_rwlockattr_t = __pthread_rwlockattr;
158 pub type pthread_rwlock_t = __pthread_rwlock;
159 pub type pthread_barrierattr_t = __pthread_barrierattr;
160 pub type pthread_barrier_t = __pthread_barrier;
161 pub type __pthread_key = c_int;
162 pub type pthread_key_t = __pthread_key;
163 pub type pthread_once_t = __pthread_once;
164 
165 pub type __rlimit_resource = c_uint;
166 pub type __rlimit_resource_t = __rlimit_resource;
167 pub type rlim_t = __rlim_t;
168 pub type rlim64_t = __rlim64_t;
169 
170 pub type __rusage_who = c_int;
171 
172 pub type __priority_which = c_uint;
173 
174 pub type sa_family_t = c_uchar;
175 
176 pub type in_port_t = u16;
177 
178 pub type __sigval_t = crate::sigval;
179 
180 pub type sigevent_t = sigevent;
181 
182 pub type nfds_t = c_ulong;
183 
184 pub type tcflag_t = c_uint;
185 pub type cc_t = c_uchar;
186 pub type speed_t = c_int;
187 
188 pub type sigval_t = crate::sigval;
189 
190 pub type greg_t = c_int;
191 pub type gregset_t = [greg_t; 19usize];
192 
193 pub type __ioctl_dir = c_uint;
194 
195 pub type __ioctl_datum = c_uint;
196 
197 pub type __error_t_codes = c_int;
198 
199 pub type int_least8_t = __int_least8_t;
200 pub type int_least16_t = __int_least16_t;
201 pub type int_least32_t = __int_least32_t;
202 pub type int_least64_t = __int_least64_t;
203 pub type uint_least8_t = __uint_least8_t;
204 pub type uint_least16_t = __uint_least16_t;
205 pub type uint_least32_t = __uint_least32_t;
206 pub type uint_least64_t = __uint_least64_t;
207 pub type int_fast8_t = c_schar;
208 pub type uint_fast8_t = c_uchar;
209 pub type intmax_t = __intmax_t;
210 pub type uintmax_t = __uintmax_t;
211 
212 pub type tcp_seq = u32;
213 
214 pub type tcp_ca_state = c_uint;
215 
216 pub type idtype_t = c_uint;
217 
218 pub type mqd_t = c_int;
219 
220 pub type Lmid_t = c_long;
221 
222 pub type regoff_t = c_int;
223 
224 pub type nl_item = c_int;
225 
226 pub type iconv_t = *mut c_void;
227 
228 #[cfg_attr(feature = "extra_traits", derive(Debug))]
229 pub enum fpos64_t {} // FIXME(hurd): fill this out with a struct
230 impl Copy for fpos64_t {}
231 impl Clone for fpos64_t {
clone(&self) -> fpos64_t232     fn clone(&self) -> fpos64_t {
233         *self
234     }
235 }
236 
237 #[cfg_attr(feature = "extra_traits", derive(Debug))]
238 pub enum timezone {}
239 impl Copy for timezone {}
240 impl Clone for timezone {
clone(&self) -> timezone241     fn clone(&self) -> timezone {
242         *self
243     }
244 }
245 
246 // structs
247 s! {
248     pub struct ip_mreq {
249         pub imr_multiaddr: in_addr,
250         pub imr_interface: in_addr,
251     }
252 
253     pub struct ip_mreqn {
254         pub imr_multiaddr: in_addr,
255         pub imr_address: in_addr,
256         pub imr_ifindex: c_int,
257     }
258 
259     pub struct ip_mreq_source {
260         pub imr_multiaddr: in_addr,
261         pub imr_interface: in_addr,
262         pub imr_sourceaddr: in_addr,
263     }
264 
265     pub struct sockaddr {
266         pub sa_len: c_uchar,
267         pub sa_family: sa_family_t,
268         pub sa_data: [c_char; 14usize],
269     }
270 
271     pub struct in_addr {
272         pub s_addr: in_addr_t,
273     }
274 
275     pub struct sockaddr_in {
276         pub sin_len: c_uchar,
277         pub sin_family: sa_family_t,
278         pub sin_port: in_port_t,
279         pub sin_addr: crate::in_addr,
280         pub sin_zero: [c_uchar; 8usize],
281     }
282 
283     pub struct sockaddr_in6 {
284         pub sin6_len: c_uchar,
285         pub sin6_family: sa_family_t,
286         pub sin6_port: in_port_t,
287         pub sin6_flowinfo: u32,
288         pub sin6_addr: crate::in6_addr,
289         pub sin6_scope_id: u32,
290     }
291 
292     pub struct sockaddr_un {
293         pub sun_len: c_uchar,
294         pub sun_family: sa_family_t,
295         pub sun_path: [c_char; 108usize],
296     }
297 
298     pub struct sockaddr_storage {
299         pub ss_len: c_uchar,
300         pub ss_family: sa_family_t,
301         pub __ss_padding: [c_char; 122usize],
302         pub __ss_align: __uint32_t,
303     }
304 
305     pub struct sockaddr_at {
306         pub _address: u8,
307     }
308 
309     pub struct sockaddr_ax25 {
310         pub _address: u8,
311     }
312 
313     pub struct sockaddr_x25 {
314         pub _address: u8,
315     }
316 
317     pub struct sockaddr_dl {
318         pub _address: u8,
319     }
320     pub struct sockaddr_eon {
321         pub _address: u8,
322     }
323     pub struct sockaddr_inarp {
324         pub _address: u8,
325     }
326 
327     pub struct sockaddr_ipx {
328         pub _address: u8,
329     }
330     pub struct sockaddr_iso {
331         pub _address: u8,
332     }
333 
334     pub struct sockaddr_ns {
335         pub _address: u8,
336     }
337 
338     pub struct addrinfo {
339         pub ai_flags: c_int,
340         pub ai_family: c_int,
341         pub ai_socktype: c_int,
342         pub ai_protocol: c_int,
343         pub ai_addrlen: crate::socklen_t,
344         pub ai_addr: *mut sockaddr,
345         pub ai_canonname: *mut c_char,
346         pub ai_next: *mut addrinfo,
347     }
348 
349     pub struct msghdr {
350         pub msg_name: *mut c_void,
351         pub msg_namelen: crate::socklen_t,
352         pub msg_iov: *mut crate::iovec,
353         pub msg_iovlen: c_int,
354         pub msg_control: *mut c_void,
355         pub msg_controllen: crate::socklen_t,
356         pub msg_flags: c_int,
357     }
358 
359     pub struct cmsghdr {
360         pub cmsg_len: crate::socklen_t,
361         pub cmsg_level: c_int,
362         pub cmsg_type: c_int,
363     }
364 
365     pub struct dirent {
366         pub d_ino: __ino_t,
367         pub d_reclen: c_ushort,
368         pub d_type: c_uchar,
369         pub d_namlen: c_uchar,
370         pub d_name: [c_char; 1usize],
371     }
372 
373     pub struct dirent64 {
374         pub d_ino: __ino64_t,
375         pub d_reclen: c_ushort,
376         pub d_type: c_uchar,
377         pub d_namlen: c_uchar,
378         pub d_name: [c_char; 1usize],
379     }
380 
381     pub struct fd_set {
382         pub fds_bits: [__fd_mask; 8usize],
383     }
384 
385     pub struct termios {
386         pub c_iflag: crate::tcflag_t,
387         pub c_oflag: crate::tcflag_t,
388         pub c_cflag: crate::tcflag_t,
389         pub c_lflag: crate::tcflag_t,
390         pub c_cc: [crate::cc_t; 20usize],
391         pub __ispeed: crate::speed_t,
392         pub __ospeed: crate::speed_t,
393     }
394 
395     pub struct mallinfo {
396         pub arena: c_int,
397         pub ordblks: c_int,
398         pub smblks: c_int,
399         pub hblks: c_int,
400         pub hblkhd: c_int,
401         pub usmblks: c_int,
402         pub fsmblks: c_int,
403         pub uordblks: c_int,
404         pub fordblks: c_int,
405         pub keepcost: c_int,
406     }
407 
408     pub struct mallinfo2 {
409         pub arena: size_t,
410         pub ordblks: size_t,
411         pub smblks: size_t,
412         pub hblks: size_t,
413         pub hblkhd: size_t,
414         pub usmblks: size_t,
415         pub fsmblks: size_t,
416         pub uordblks: size_t,
417         pub fordblks: size_t,
418         pub keepcost: size_t,
419     }
420 
421     pub struct sigaction {
422         pub sa_sigaction: crate::sighandler_t,
423         pub sa_mask: __sigset_t,
424         pub sa_flags: c_int,
425     }
426 
427     pub struct sigevent {
428         pub sigev_value: crate::sigval,
429         pub sigev_signo: c_int,
430         pub sigev_notify: c_int,
431         __unused1: *mut c_void, //actually a function pointer
432         pub sigev_notify_attributes: *mut pthread_attr_t,
433     }
434 
435     pub struct siginfo_t {
436         pub si_signo: c_int,
437         pub si_errno: c_int,
438         pub si_code: c_int,
439         pub si_pid: __pid_t,
440         pub si_uid: __uid_t,
441         pub si_addr: *mut c_void,
442         pub si_status: c_int,
443         pub si_band: c_long,
444         pub si_value: crate::sigval,
445     }
446 
447     pub struct timespec {
448         pub tv_sec: __time_t,
449         pub tv_nsec: __syscall_slong_t,
450     }
451 
452     pub struct __timeval {
453         pub tv_sec: i32,
454         pub tv_usec: i32,
455     }
456 
457     pub struct __locale_data {
458         pub _address: u8,
459     }
460 
461     pub struct stat {
462         pub st_fstype: c_int,
463         pub st_dev: __fsid_t, /* Actually st_fsid */
464         pub st_ino: __ino_t,
465         pub st_gen: c_uint,
466         pub st_rdev: __dev_t,
467         pub st_mode: __mode_t,
468         pub st_nlink: __nlink_t,
469         pub st_uid: __uid_t,
470         pub st_gid: __gid_t,
471         pub st_size: __off_t,
472         pub st_atim: crate::timespec,
473         pub st_mtim: crate::timespec,
474         pub st_ctim: crate::timespec,
475         pub st_blksize: __blksize_t,
476         pub st_blocks: __blkcnt_t,
477         pub st_author: __uid_t,
478         pub st_flags: c_uint,
479         pub st_spare: [c_int; 11usize],
480     }
481 
482     pub struct stat64 {
483         pub st_fstype: c_int,
484         pub st_dev: __fsid_t, /* Actually st_fsid */
485         pub st_ino: __ino64_t,
486         pub st_gen: c_uint,
487         pub st_rdev: __dev_t,
488         pub st_mode: __mode_t,
489         pub st_nlink: __nlink_t,
490         pub st_uid: __uid_t,
491         pub st_gid: __gid_t,
492         pub st_size: __off64_t,
493         pub st_atim: crate::timespec,
494         pub st_mtim: crate::timespec,
495         pub st_ctim: crate::timespec,
496         pub st_blksize: __blksize_t,
497         pub st_blocks: __blkcnt64_t,
498         pub st_author: __uid_t,
499         pub st_flags: c_uint,
500         pub st_spare: [c_int; 8usize],
501     }
502 
503     pub struct statx {
504         pub stx_mask: u32,
505         pub stx_blksize: u32,
506         pub stx_attributes: u64,
507         pub stx_nlink: u32,
508         pub stx_uid: u32,
509         pub stx_gid: u32,
510         pub stx_mode: u16,
511         __statx_pad1: [u16; 1],
512         pub stx_ino: u64,
513         pub stx_size: u64,
514         pub stx_blocks: u64,
515         pub stx_attributes_mask: u64,
516         pub stx_atime: crate::statx_timestamp,
517         pub stx_btime: crate::statx_timestamp,
518         pub stx_ctime: crate::statx_timestamp,
519         pub stx_mtime: crate::statx_timestamp,
520         pub stx_rdev_major: u32,
521         pub stx_rdev_minor: u32,
522         pub stx_dev_major: u32,
523         pub stx_dev_minor: u32,
524         __statx_pad2: [u64; 14],
525     }
526 
527     pub struct statx_timestamp {
528         pub tv_sec: i64,
529         pub tv_nsec: u32,
530         pub __statx_timestamp_pad1: [i32; 1],
531     }
532 
533     pub struct statfs {
534         pub f_type: c_uint,
535         pub f_bsize: c_ulong,
536         pub f_blocks: __fsblkcnt_t,
537         pub f_bfree: __fsblkcnt_t,
538         pub f_bavail: __fsblkcnt_t,
539         pub f_files: __fsblkcnt_t,
540         pub f_ffree: __fsblkcnt_t,
541         pub f_fsid: __fsid_t,
542         pub f_namelen: c_ulong,
543         pub f_favail: __fsfilcnt_t,
544         pub f_frsize: c_ulong,
545         pub f_flag: c_ulong,
546         pub f_spare: [c_uint; 3usize],
547     }
548 
549     pub struct statfs64 {
550         pub f_type: c_uint,
551         pub f_bsize: c_ulong,
552         pub f_blocks: __fsblkcnt64_t,
553         pub f_bfree: __fsblkcnt64_t,
554         pub f_bavail: __fsblkcnt64_t,
555         pub f_files: __fsblkcnt64_t,
556         pub f_ffree: __fsblkcnt64_t,
557         pub f_fsid: __fsid_t,
558         pub f_namelen: c_ulong,
559         pub f_favail: __fsfilcnt64_t,
560         pub f_frsize: c_ulong,
561         pub f_flag: c_ulong,
562         pub f_spare: [c_uint; 3usize],
563     }
564 
565     pub struct statvfs {
566         pub __f_type: c_uint,
567         pub f_bsize: c_ulong,
568         pub f_blocks: __fsblkcnt_t,
569         pub f_bfree: __fsblkcnt_t,
570         pub f_bavail: __fsblkcnt_t,
571         pub f_files: __fsfilcnt_t,
572         pub f_ffree: __fsfilcnt_t,
573         pub f_fsid: __fsid_t,
574         pub f_namemax: c_ulong,
575         pub f_favail: __fsfilcnt_t,
576         pub f_frsize: c_ulong,
577         pub f_flag: c_ulong,
578         pub f_spare: [c_uint; 3usize],
579     }
580 
581     pub struct statvfs64 {
582         pub __f_type: c_uint,
583         pub f_bsize: c_ulong,
584         pub f_blocks: __fsblkcnt64_t,
585         pub f_bfree: __fsblkcnt64_t,
586         pub f_bavail: __fsblkcnt64_t,
587         pub f_files: __fsfilcnt64_t,
588         pub f_ffree: __fsfilcnt64_t,
589         pub f_fsid: __fsid_t,
590         pub f_namemax: c_ulong,
591         pub f_favail: __fsfilcnt64_t,
592         pub f_frsize: c_ulong,
593         pub f_flag: c_ulong,
594         pub f_spare: [c_uint; 3usize],
595     }
596 
597     pub struct aiocb {
598         pub aio_fildes: c_int,
599         pub aio_lio_opcode: c_int,
600         pub aio_reqprio: c_int,
601         pub aio_buf: *mut c_void,
602         pub aio_nbytes: size_t,
603         pub aio_sigevent: crate::sigevent,
604         __next_prio: *mut aiocb,
605         __abs_prio: c_int,
606         __policy: c_int,
607         __error_code: c_int,
608         __return_value: ssize_t,
609         pub aio_offset: off_t,
610         #[cfg(all(not(target_arch = "x86_64"), target_pointer_width = "32"))]
611         __unused1: [c_char; 4],
612         __glibc_reserved: [c_char; 32],
613     }
614 
615     pub struct mq_attr {
616         pub mq_flags: c_long,
617         pub mq_maxmsg: c_long,
618         pub mq_msgsize: c_long,
619         pub mq_curmsgs: c_long,
620     }
621 
622     pub struct __exit_status {
623         pub e_termination: c_short,
624         pub e_exit: c_short,
625     }
626 
627     #[cfg_attr(target_pointer_width = "32", repr(align(4)))]
628     #[cfg_attr(target_pointer_width = "64", repr(align(8)))]
629     pub struct sem_t {
630         __size: [c_char; 20usize],
631     }
632 
633     pub struct __pthread {
634         pub _address: u8,
635     }
636 
637     pub struct __pthread_mutexattr {
638         pub __prioceiling: c_int,
639         pub __protocol: __pthread_mutex_protocol,
640         pub __pshared: __pthread_process_shared,
641         pub __mutex_type: __pthread_mutex_type,
642     }
643     pub struct __pthread_mutex {
644         pub __lock: c_uint,
645         pub __owner_id: c_uint,
646         pub __cnt: c_uint,
647         pub __shpid: c_int,
648         pub __type: c_int,
649         pub __flags: c_int,
650         pub __reserved1: c_uint,
651         pub __reserved2: c_uint,
652     }
653 
654     pub struct __pthread_condattr {
655         pub __pshared: __pthread_process_shared,
656         pub __clock: __clockid_t,
657     }
658 
659     pub struct __pthread_rwlockattr {
660         pub __pshared: __pthread_process_shared,
661     }
662 
663     pub struct __pthread_barrierattr {
664         pub __pshared: __pthread_process_shared,
665     }
666 
667     pub struct __pthread_once {
668         pub __run: c_int,
669         pub __lock: __pthread_spinlock_t,
670     }
671 
672     pub struct __pthread_cond {
673         pub __lock: __pthread_spinlock_t,
674         pub __queue: *mut __pthread,
675         pub __attr: *mut __pthread_condattr,
676         pub __wrefs: c_uint,
677         pub __data: *mut c_void,
678     }
679 
680     pub struct __pthread_attr {
681         pub __schedparam: sched_param,
682         pub __stackaddr: *mut c_void,
683         pub __stacksize: size_t,
684         pub __guardsize: size_t,
685         pub __detachstate: __pthread_detachstate,
686         pub __inheritsched: __pthread_inheritsched,
687         pub __contentionscope: __pthread_contentionscope,
688         pub __schedpolicy: c_int,
689     }
690 
691     pub struct __pthread_rwlock {
692         pub __held: __pthread_spinlock_t,
693         pub __lock: __pthread_spinlock_t,
694         pub __readers: c_int,
695         pub __readerqueue: *mut __pthread,
696         pub __writerqueue: *mut __pthread,
697         pub __attr: *mut __pthread_rwlockattr,
698         pub __data: *mut c_void,
699     }
700 
701     pub struct __pthread_barrier {
702         pub __lock: __pthread_spinlock_t,
703         pub __queue: *mut __pthread,
704         pub __pending: c_uint,
705         pub __count: c_uint,
706         pub __attr: *mut __pthread_barrierattr,
707         pub __data: *mut c_void,
708     }
709 
710     pub struct seminfo {
711         pub semmap: c_int,
712         pub semmni: c_int,
713         pub semmns: c_int,
714         pub semmnu: c_int,
715         pub semmsl: c_int,
716         pub semopm: c_int,
717         pub semume: c_int,
718         pub semusz: c_int,
719         pub semvmx: c_int,
720         pub semaem: c_int,
721     }
722 
723     pub struct _IO_FILE {
724         _unused: [u8; 0],
725     }
726 
727     pub struct sched_param {
728         pub sched_priority: c_int,
729     }
730 
731     pub struct iovec {
732         pub iov_base: *mut c_void,
733         pub iov_len: size_t,
734     }
735 
736     pub struct passwd {
737         pub pw_name: *mut c_char,
738         pub pw_passwd: *mut c_char,
739         pub pw_uid: __uid_t,
740         pub pw_gid: __gid_t,
741         pub pw_gecos: *mut c_char,
742         pub pw_dir: *mut c_char,
743         pub pw_shell: *mut c_char,
744     }
745 
746     pub struct spwd {
747         pub sp_namp: *mut c_char,
748         pub sp_pwdp: *mut c_char,
749         pub sp_lstchg: c_long,
750         pub sp_min: c_long,
751         pub sp_max: c_long,
752         pub sp_warn: c_long,
753         pub sp_inact: c_long,
754         pub sp_expire: c_long,
755         pub sp_flag: c_ulong,
756     }
757 
758     pub struct itimerspec {
759         pub it_interval: crate::timespec,
760         pub it_value: crate::timespec,
761     }
762 
763     pub struct tm {
764         pub tm_sec: c_int,
765         pub tm_min: c_int,
766         pub tm_hour: c_int,
767         pub tm_mday: c_int,
768         pub tm_mon: c_int,
769         pub tm_year: c_int,
770         pub tm_wday: c_int,
771         pub tm_yday: c_int,
772         pub tm_isdst: c_int,
773         pub tm_gmtoff: c_long,
774         pub tm_zone: *const c_char,
775     }
776 
777     pub struct lconv {
778         pub decimal_point: *mut c_char,
779         pub thousands_sep: *mut c_char,
780         pub grouping: *mut c_char,
781         pub int_curr_symbol: *mut c_char,
782         pub currency_symbol: *mut c_char,
783         pub mon_decimal_point: *mut c_char,
784         pub mon_thousands_sep: *mut c_char,
785         pub mon_grouping: *mut c_char,
786         pub positive_sign: *mut c_char,
787         pub negative_sign: *mut c_char,
788         pub int_frac_digits: c_char,
789         pub frac_digits: c_char,
790         pub p_cs_precedes: c_char,
791         pub p_sep_by_space: c_char,
792         pub n_cs_precedes: c_char,
793         pub n_sep_by_space: c_char,
794         pub p_sign_posn: c_char,
795         pub n_sign_posn: c_char,
796         pub int_p_cs_precedes: c_char,
797         pub int_p_sep_by_space: c_char,
798         pub int_n_cs_precedes: c_char,
799         pub int_n_sep_by_space: c_char,
800         pub int_p_sign_posn: c_char,
801         pub int_n_sign_posn: c_char,
802     }
803 
804     pub struct Dl_info {
805         pub dli_fname: *const c_char,
806         pub dli_fbase: *mut c_void,
807         pub dli_sname: *const c_char,
808         pub dli_saddr: *mut c_void,
809     }
810 
811     pub struct ifaddrs {
812         pub ifa_next: *mut ifaddrs,
813         pub ifa_name: *mut c_char,
814         pub ifa_flags: c_uint,
815         pub ifa_addr: *mut crate::sockaddr,
816         pub ifa_netmask: *mut crate::sockaddr,
817         pub ifa_ifu: *mut crate::sockaddr, // FIXME(union) This should be a union
818         pub ifa_data: *mut c_void,
819     }
820 
821     pub struct arpreq {
822         pub arp_pa: crate::sockaddr,
823         pub arp_ha: crate::sockaddr,
824         pub arp_flags: c_int,
825         pub arp_netmask: crate::sockaddr,
826         pub arp_dev: [c_char; 16],
827     }
828 
829     pub struct arpreq_old {
830         pub arp_pa: crate::sockaddr,
831         pub arp_ha: crate::sockaddr,
832         pub arp_flags: c_int,
833         pub arp_netmask: crate::sockaddr,
834     }
835 
836     pub struct arphdr {
837         pub ar_hrd: u16,
838         pub ar_pro: u16,
839         pub ar_hln: u8,
840         pub ar_pln: u8,
841         pub ar_op: u16,
842     }
843 
844     pub struct arpd_request {
845         pub req: c_ushort,
846         pub ip: u32,
847         pub dev: c_ulong,
848         pub stamp: c_ulong,
849         pub updated: c_ulong,
850         pub ha: [c_uchar; crate::MAX_ADDR_LEN],
851     }
852 
853     pub struct mmsghdr {
854         pub msg_hdr: crate::msghdr,
855         pub msg_len: c_uint,
856     }
857 
858     pub struct ifreq {
859         /// interface name, e.g. "en0"
860         pub ifr_name: [c_char; crate::IFNAMSIZ],
861         pub ifr_ifru: crate::sockaddr,
862     }
863 
864     pub struct __locale_struct {
865         pub __locales: [*mut __locale_data; 13usize],
866         pub __ctype_b: *const c_ushort,
867         pub __ctype_tolower: *const c_int,
868         pub __ctype_toupper: *const c_int,
869         pub __names: [*const c_char; 13usize],
870     }
871 
872     pub struct utsname {
873         pub sysname: [c_char; _UTSNAME_LENGTH],
874         pub nodename: [c_char; _UTSNAME_LENGTH],
875         pub release: [c_char; _UTSNAME_LENGTH],
876         pub version: [c_char; _UTSNAME_LENGTH],
877         pub machine: [c_char; _UTSNAME_LENGTH],
878         pub domainname: [c_char; _UTSNAME_LENGTH],
879     }
880 
881     pub struct rlimit64 {
882         pub rlim_cur: rlim64_t,
883         pub rlim_max: rlim64_t,
884     }
885 
886     pub struct stack_t {
887         pub ss_sp: *mut c_void,
888         pub ss_size: size_t,
889         pub ss_flags: c_int,
890     }
891 
892     pub struct dl_phdr_info {
893         pub dlpi_addr: Elf_Addr,
894         pub dlpi_name: *const c_char,
895         pub dlpi_phdr: *const Elf_Phdr,
896         pub dlpi_phnum: Elf_Half,
897         pub dlpi_adds: c_ulonglong,
898         pub dlpi_subs: c_ulonglong,
899         pub dlpi_tls_modid: size_t,
900         pub dlpi_tls_data: *mut c_void,
901     }
902 
903     pub struct flock {
904         #[cfg(target_pointer_width = "32")]
905         pub l_type: c_int,
906         #[cfg(target_pointer_width = "32")]
907         pub l_whence: c_int,
908         #[cfg(target_pointer_width = "64")]
909         pub l_type: c_short,
910         #[cfg(target_pointer_width = "64")]
911         pub l_whence: c_short,
912         pub l_start: __off_t,
913         pub l_len: __off_t,
914         pub l_pid: __pid_t,
915     }
916 
917     pub struct flock64 {
918         #[cfg(target_pointer_width = "32")]
919         pub l_type: c_int,
920         #[cfg(target_pointer_width = "32")]
921         pub l_whence: c_int,
922         #[cfg(target_pointer_width = "64")]
923         pub l_type: c_short,
924         #[cfg(target_pointer_width = "64")]
925         pub l_whence: c_short,
926         pub l_start: __off_t,
927         pub l_len: __off64_t,
928         pub l_pid: __pid_t,
929     }
930 
931     pub struct glob_t {
932         pub gl_pathc: size_t,
933         pub gl_pathv: *mut *mut c_char,
934         pub gl_offs: size_t,
935         pub gl_flags: c_int,
936 
937         __unused1: *mut c_void,
938         __unused2: *mut c_void,
939         __unused3: *mut c_void,
940         __unused4: *mut c_void,
941         __unused5: *mut c_void,
942     }
943 
944     pub struct glob64_t {
945         pub gl_pathc: size_t,
946         pub gl_pathv: *mut *mut c_char,
947         pub gl_offs: size_t,
948         pub gl_flags: c_int,
949 
950         __unused1: *mut c_void,
951         __unused2: *mut c_void,
952         __unused3: *mut c_void,
953         __unused4: *mut c_void,
954         __unused5: *mut c_void,
955     }
956 
957     pub struct regex_t {
958         __buffer: *mut c_void,
959         __allocated: size_t,
960         __used: size_t,
961         __syntax: c_ulong,
962         __fastmap: *mut c_char,
963         __translate: *mut c_char,
964         __re_nsub: size_t,
965         __bitfield: u8,
966     }
967 
968     pub struct cpu_set_t {
969         #[cfg(all(target_pointer_width = "32", not(target_arch = "x86_64")))]
970         bits: [u32; 32],
971         #[cfg(not(all(target_pointer_width = "32", not(target_arch = "x86_64"))))]
972         bits: [u64; 16],
973     }
974 
975     pub struct if_nameindex {
976         pub if_index: c_uint,
977         pub if_name: *mut c_char,
978     }
979 
980     // System V IPC
981     pub struct msginfo {
982         pub msgpool: c_int,
983         pub msgmap: c_int,
984         pub msgmax: c_int,
985         pub msgmnb: c_int,
986         pub msgmni: c_int,
987         pub msgssz: c_int,
988         pub msgtql: c_int,
989         pub msgseg: c_ushort,
990     }
991 
992     pub struct sembuf {
993         pub sem_num: c_ushort,
994         pub sem_op: c_short,
995         pub sem_flg: c_short,
996     }
997 
998     pub struct mntent {
999         pub mnt_fsname: *mut c_char,
1000         pub mnt_dir: *mut c_char,
1001         pub mnt_type: *mut c_char,
1002         pub mnt_opts: *mut c_char,
1003         pub mnt_freq: c_int,
1004         pub mnt_passno: c_int,
1005     }
1006 
1007     pub struct posix_spawn_file_actions_t {
1008         __allocated: c_int,
1009         __used: c_int,
1010         __actions: *mut c_int,
1011         __pad: [c_int; 16],
1012     }
1013 
1014     pub struct posix_spawnattr_t {
1015         __flags: c_short,
1016         __pgrp: crate::pid_t,
1017         __sd: crate::sigset_t,
1018         __ss: crate::sigset_t,
1019         __sp: crate::sched_param,
1020         __policy: c_int,
1021         __pad: [c_int; 16],
1022     }
1023 
1024     pub struct regmatch_t {
1025         pub rm_so: regoff_t,
1026         pub rm_eo: regoff_t,
1027     }
1028 
1029     pub struct option {
1030         pub name: *const c_char,
1031         pub has_arg: c_int,
1032         pub flag: *mut c_int,
1033         pub val: c_int,
1034     }
1035 }
1036 
1037 s_no_extra_traits! {
1038     pub struct utmpx {
1039         pub ut_type: c_short,
1040         pub ut_pid: crate::pid_t,
1041         pub ut_line: [c_char; __UT_LINESIZE],
1042         pub ut_id: [c_char; 4],
1043 
1044         pub ut_user: [c_char; __UT_NAMESIZE],
1045         pub ut_host: [c_char; __UT_HOSTSIZE],
1046         pub ut_exit: __exit_status,
1047 
1048         #[cfg(any(all(target_pointer_width = "32", not(target_arch = "x86_64"))))]
1049         pub ut_session: c_long,
1050         #[cfg(any(all(target_pointer_width = "32", not(target_arch = "x86_64"))))]
1051         pub ut_tv: crate::timeval,
1052 
1053         #[cfg(not(any(all(target_pointer_width = "32", not(target_arch = "x86_64")))))]
1054         pub ut_session: i32,
1055         #[cfg(not(any(all(target_pointer_width = "32", not(target_arch = "x86_64")))))]
1056         pub ut_tv: __timeval,
1057 
1058         pub ut_addr_v6: [i32; 4],
1059         __glibc_reserved: [c_char; 20],
1060     }
1061 }
1062 
1063 cfg_if! {
1064     if #[cfg(feature = "extra_traits")] {
1065         impl PartialEq for utmpx {
1066             fn eq(&self, other: &utmpx) -> bool {
1067                 self.ut_type == other.ut_type
1068                     && self.ut_pid == other.ut_pid
1069                     && self.ut_line == other.ut_line
1070                     && self.ut_id == other.ut_id
1071                     && self.ut_user == other.ut_user
1072                     && self
1073                         .ut_host
1074                         .iter()
1075                         .zip(other.ut_host.iter())
1076                         .all(|(a, b)| a == b)
1077                     && self.ut_exit == other.ut_exit
1078                     && self.ut_session == other.ut_session
1079                     && self.ut_tv == other.ut_tv
1080                     && self.ut_addr_v6 == other.ut_addr_v6
1081                     && self.__glibc_reserved == other.__glibc_reserved
1082             }
1083         }
1084 
1085         impl Eq for utmpx {}
1086 
1087         impl hash::Hash for utmpx {
1088             fn hash<H: hash::Hasher>(&self, state: &mut H) {
1089                 self.ut_type.hash(state);
1090                 self.ut_pid.hash(state);
1091                 self.ut_line.hash(state);
1092                 self.ut_id.hash(state);
1093                 self.ut_user.hash(state);
1094                 self.ut_host.hash(state);
1095                 self.ut_exit.hash(state);
1096                 self.ut_session.hash(state);
1097                 self.ut_tv.hash(state);
1098                 self.ut_addr_v6.hash(state);
1099                 self.__glibc_reserved.hash(state);
1100             }
1101         }
1102     }
1103 }
1104 
1105 impl siginfo_t {
si_addr(&self) -> *mut c_void1106     pub unsafe fn si_addr(&self) -> *mut c_void {
1107         self.si_addr
1108     }
1109 
si_value(&self) -> crate::sigval1110     pub unsafe fn si_value(&self) -> crate::sigval {
1111         self.si_value
1112     }
1113 
si_pid(&self) -> crate::pid_t1114     pub unsafe fn si_pid(&self) -> crate::pid_t {
1115         self.si_pid
1116     }
1117 
si_uid(&self) -> crate::uid_t1118     pub unsafe fn si_uid(&self) -> crate::uid_t {
1119         self.si_uid
1120     }
1121 
si_status(&self) -> c_int1122     pub unsafe fn si_status(&self) -> c_int {
1123         self.si_status
1124     }
1125 }
1126 
1127 // const
1128 
1129 // aio.h
1130 pub const AIO_CANCELED: c_int = 0;
1131 pub const AIO_NOTCANCELED: c_int = 1;
1132 pub const AIO_ALLDONE: c_int = 2;
1133 pub const LIO_READ: c_int = 0;
1134 pub const LIO_WRITE: c_int = 1;
1135 pub const LIO_NOP: c_int = 2;
1136 pub const LIO_WAIT: c_int = 0;
1137 pub const LIO_NOWAIT: c_int = 1;
1138 
1139 // glob.h
1140 pub const GLOB_ERR: c_int = 1 << 0;
1141 pub const GLOB_MARK: c_int = 1 << 1;
1142 pub const GLOB_NOSORT: c_int = 1 << 2;
1143 pub const GLOB_DOOFFS: c_int = 1 << 3;
1144 pub const GLOB_NOCHECK: c_int = 1 << 4;
1145 pub const GLOB_APPEND: c_int = 1 << 5;
1146 pub const GLOB_NOESCAPE: c_int = 1 << 6;
1147 
1148 pub const GLOB_NOSPACE: c_int = 1;
1149 pub const GLOB_ABORTED: c_int = 2;
1150 pub const GLOB_NOMATCH: c_int = 3;
1151 
1152 pub const GLOB_PERIOD: c_int = 1 << 7;
1153 pub const GLOB_ALTDIRFUNC: c_int = 1 << 9;
1154 pub const GLOB_BRACE: c_int = 1 << 10;
1155 pub const GLOB_NOMAGIC: c_int = 1 << 11;
1156 pub const GLOB_TILDE: c_int = 1 << 12;
1157 pub const GLOB_ONLYDIR: c_int = 1 << 13;
1158 pub const GLOB_TILDE_CHECK: c_int = 1 << 14;
1159 
1160 // ipc.h
1161 pub const IPC_PRIVATE: crate::key_t = 0;
1162 
1163 pub const IPC_CREAT: c_int = 0o1000;
1164 pub const IPC_EXCL: c_int = 0o2000;
1165 pub const IPC_NOWAIT: c_int = 0o4000;
1166 
1167 pub const IPC_RMID: c_int = 0;
1168 pub const IPC_SET: c_int = 1;
1169 pub const IPC_STAT: c_int = 2;
1170 pub const IPC_INFO: c_int = 3;
1171 pub const MSG_STAT: c_int = 11;
1172 pub const MSG_INFO: c_int = 12;
1173 
1174 pub const MSG_NOERROR: c_int = 0o10000;
1175 pub const MSG_EXCEPT: c_int = 0o20000;
1176 
1177 // shm.h
1178 pub const SHM_R: c_int = 0o400;
1179 pub const SHM_W: c_int = 0o200;
1180 
1181 pub const SHM_RDONLY: c_int = 0o10000;
1182 pub const SHM_RND: c_int = 0o20000;
1183 pub const SHM_REMAP: c_int = 0o40000;
1184 
1185 pub const SHM_LOCK: c_int = 11;
1186 pub const SHM_UNLOCK: c_int = 12;
1187 // unistd.h
1188 pub const STDIN_FILENO: c_int = 0;
1189 pub const STDOUT_FILENO: c_int = 1;
1190 pub const STDERR_FILENO: c_int = 2;
1191 pub const __FD_SETSIZE: usize = 256;
1192 pub const R_OK: c_int = 4;
1193 pub const W_OK: c_int = 2;
1194 pub const X_OK: c_int = 1;
1195 pub const F_OK: c_int = 0;
1196 pub const SEEK_SET: c_int = 0;
1197 pub const SEEK_CUR: c_int = 1;
1198 pub const SEEK_END: c_int = 2;
1199 pub const SEEK_DATA: c_int = 3;
1200 pub const SEEK_HOLE: c_int = 4;
1201 pub const L_SET: c_int = 0;
1202 pub const L_INCR: c_int = 1;
1203 pub const L_XTND: c_int = 2;
1204 pub const F_ULOCK: c_int = 0;
1205 pub const F_LOCK: c_int = 1;
1206 pub const F_TLOCK: c_int = 2;
1207 pub const F_TEST: c_int = 3;
1208 pub const CLOSE_RANGE_CLOEXEC: c_int = 4;
1209 
1210 // stdio.h
1211 pub const EOF: c_int = -1;
1212 
1213 // stdlib.h
1214 pub const WNOHANG: c_int = 1;
1215 pub const WUNTRACED: c_int = 2;
1216 pub const WSTOPPED: c_int = 2;
1217 pub const WCONTINUED: c_int = 4;
1218 pub const WNOWAIT: c_int = 8;
1219 pub const WEXITED: c_int = 16;
1220 pub const __W_CONTINUED: c_int = 65535;
1221 pub const __WCOREFLAG: c_int = 128;
1222 pub const RAND_MAX: c_int = 2147483647;
1223 pub const EXIT_FAILURE: c_int = 1;
1224 pub const EXIT_SUCCESS: c_int = 0;
1225 pub const __LITTLE_ENDIAN: usize = 1234;
1226 pub const __BIG_ENDIAN: usize = 4321;
1227 pub const __PDP_ENDIAN: usize = 3412;
1228 pub const __BYTE_ORDER: usize = 1234;
1229 pub const __FLOAT_WORD_ORDER: usize = 1234;
1230 pub const LITTLE_ENDIAN: usize = 1234;
1231 pub const BIG_ENDIAN: usize = 4321;
1232 pub const PDP_ENDIAN: usize = 3412;
1233 pub const BYTE_ORDER: usize = 1234;
1234 
1235 // sys/select.h
1236 pub const FD_SETSIZE: usize = 256;
1237 pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32;
1238 pub const __SIZEOF_PTHREAD_ATTR_T: usize = 32;
1239 pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 28;
1240 pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 24;
1241 pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 16;
1242 pub const __SIZEOF_PTHREAD_COND_T: usize = 20;
1243 pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 8;
1244 pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 4;
1245 pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
1246 pub const __SIZEOF_PTHREAD_ONCE_T: usize = 8;
1247 pub const __PTHREAD_SPIN_LOCK_INITIALIZER: c_int = 0;
1248 pub const PTHREAD_MUTEX_NORMAL: c_int = 0;
1249 
1250 // sys/resource.h
1251 pub const RLIM_INFINITY: crate::rlim_t = 2147483647;
1252 pub const RLIM64_INFINITY: crate::rlim64_t = 9223372036854775807;
1253 pub const RLIM_SAVED_MAX: crate::rlim_t = RLIM_INFINITY;
1254 pub const RLIM_SAVED_CUR: crate::rlim_t = RLIM_INFINITY;
1255 pub const PRIO_MIN: c_int = -20;
1256 pub const PRIO_MAX: c_int = 20;
1257 
1258 // pwd.h
1259 pub const NSS_BUFLEN_PASSWD: usize = 1024;
1260 
1261 // sys/socket.h
1262 pub const SOCK_TYPE_MASK: usize = 15;
1263 pub const PF_UNSPEC: c_int = 0;
1264 pub const PF_LOCAL: c_int = 1;
1265 pub const PF_UNIX: c_int = 1;
1266 pub const PF_FILE: c_int = 1;
1267 pub const PF_INET: c_int = 2;
1268 pub const PF_IMPLINK: c_int = 3;
1269 pub const PF_PUP: c_int = 4;
1270 pub const PF_CHAOS: c_int = 5;
1271 pub const PF_NS: c_int = 6;
1272 pub const PF_ISO: c_int = 7;
1273 pub const PF_OSI: c_int = 7;
1274 pub const PF_ECMA: c_int = 8;
1275 pub const PF_DATAKIT: c_int = 9;
1276 pub const PF_CCITT: c_int = 10;
1277 pub const PF_SNA: c_int = 11;
1278 pub const PF_DECnet: c_int = 12;
1279 pub const PF_DLI: c_int = 13;
1280 pub const PF_LAT: c_int = 14;
1281 pub const PF_HYLINK: c_int = 15;
1282 pub const PF_APPLETALK: c_int = 16;
1283 pub const PF_ROUTE: c_int = 17;
1284 pub const PF_XTP: c_int = 19;
1285 pub const PF_COIP: c_int = 20;
1286 pub const PF_CNT: c_int = 21;
1287 pub const PF_RTIP: c_int = 22;
1288 pub const PF_IPX: c_int = 23;
1289 pub const PF_SIP: c_int = 24;
1290 pub const PF_PIP: c_int = 25;
1291 pub const PF_INET6: c_int = 26;
1292 pub const PF_MAX: c_int = 27;
1293 pub const AF_UNSPEC: c_int = 0;
1294 pub const AF_LOCAL: c_int = 1;
1295 pub const AF_UNIX: c_int = 1;
1296 pub const AF_FILE: c_int = 1;
1297 pub const AF_INET: c_int = 2;
1298 pub const AF_IMPLINK: c_int = 3;
1299 pub const AF_PUP: c_int = 4;
1300 pub const AF_CHAOS: c_int = 5;
1301 pub const AF_NS: c_int = 6;
1302 pub const AF_ISO: c_int = 7;
1303 pub const AF_OSI: c_int = 7;
1304 pub const AF_ECMA: c_int = 8;
1305 pub const AF_DATAKIT: c_int = 9;
1306 pub const AF_CCITT: c_int = 10;
1307 pub const AF_SNA: c_int = 11;
1308 pub const AF_DECnet: c_int = 12;
1309 pub const AF_DLI: c_int = 13;
1310 pub const AF_LAT: c_int = 14;
1311 pub const AF_HYLINK: c_int = 15;
1312 pub const AF_APPLETALK: c_int = 16;
1313 pub const AF_ROUTE: c_int = 17;
1314 pub const pseudo_AF_XTP: c_int = 19;
1315 pub const AF_COIP: c_int = 20;
1316 pub const AF_CNT: c_int = 21;
1317 pub const pseudo_AF_RTIP: c_int = 22;
1318 pub const AF_IPX: c_int = 23;
1319 pub const AF_SIP: c_int = 24;
1320 pub const pseudo_AF_PIP: c_int = 25;
1321 pub const AF_INET6: c_int = 26;
1322 pub const AF_MAX: c_int = 27;
1323 pub const SOMAXCONN: c_int = 4096;
1324 pub const _SS_SIZE: usize = 128;
1325 pub const CMGROUP_MAX: usize = 16;
1326 pub const SOL_SOCKET: c_int = 65535;
1327 
1328 // sys/time.h
1329 pub const ITIMER_REAL: c_int = 0;
1330 pub const ITIMER_VIRTUAL: c_int = 1;
1331 pub const ITIMER_PROF: c_int = 2;
1332 
1333 // netinet/in.h
1334 pub const SOL_IP: c_int = 0;
1335 pub const SOL_TCP: c_int = 6;
1336 pub const SOL_UDP: c_int = 17;
1337 pub const SOL_IPV6: c_int = 41;
1338 pub const SOL_ICMPV6: c_int = 58;
1339 pub const IP_OPTIONS: c_int = 1;
1340 pub const IP_HDRINCL: c_int = 2;
1341 pub const IP_TOS: c_int = 3;
1342 pub const IP_TTL: c_int = 4;
1343 pub const IP_RECVOPTS: c_int = 5;
1344 pub const IP_RECVRETOPTS: c_int = 6;
1345 pub const IP_RECVDSTADDR: c_int = 7;
1346 pub const IP_RETOPTS: c_int = 8;
1347 pub const IP_MULTICAST_IF: c_int = 9;
1348 pub const IP_MULTICAST_TTL: c_int = 10;
1349 pub const IP_MULTICAST_LOOP: c_int = 11;
1350 pub const IP_ADD_MEMBERSHIP: c_int = 12;
1351 pub const IP_DROP_MEMBERSHIP: c_int = 13;
1352 pub const IPV6_ADDRFORM: c_int = 1;
1353 pub const IPV6_2292PKTINFO: c_int = 2;
1354 pub const IPV6_2292HOPOPTS: c_int = 3;
1355 pub const IPV6_2292DSTOPTS: c_int = 4;
1356 pub const IPV6_2292RTHDR: c_int = 5;
1357 pub const IPV6_2292PKTOPTIONS: c_int = 6;
1358 pub const IPV6_CHECKSUM: c_int = 7;
1359 pub const IPV6_2292HOPLIMIT: c_int = 8;
1360 pub const IPV6_RXINFO: c_int = 2;
1361 pub const IPV6_TXINFO: c_int = 2;
1362 pub const SCM_SRCINFO: c_int = 2;
1363 pub const IPV6_UNICAST_HOPS: c_int = 16;
1364 pub const IPV6_MULTICAST_IF: c_int = 17;
1365 pub const IPV6_MULTICAST_HOPS: c_int = 18;
1366 pub const IPV6_MULTICAST_LOOP: c_int = 19;
1367 pub const IPV6_JOIN_GROUP: c_int = 20;
1368 pub const IPV6_LEAVE_GROUP: c_int = 21;
1369 pub const IPV6_ROUTER_ALERT: c_int = 22;
1370 pub const IPV6_MTU_DISCOVER: c_int = 23;
1371 pub const IPV6_MTU: c_int = 24;
1372 pub const IPV6_RECVERR: c_int = 25;
1373 pub const IPV6_V6ONLY: c_int = 26;
1374 pub const IPV6_JOIN_ANYCAST: c_int = 27;
1375 pub const IPV6_LEAVE_ANYCAST: c_int = 28;
1376 pub const IPV6_RECVPKTINFO: c_int = 49;
1377 pub const IPV6_PKTINFO: c_int = 50;
1378 pub const IPV6_RECVHOPLIMIT: c_int = 51;
1379 pub const IPV6_HOPLIMIT: c_int = 52;
1380 pub const IPV6_RECVHOPOPTS: c_int = 53;
1381 pub const IPV6_HOPOPTS: c_int = 54;
1382 pub const IPV6_RTHDRDSTOPTS: c_int = 55;
1383 pub const IPV6_RECVRTHDR: c_int = 56;
1384 pub const IPV6_RTHDR: c_int = 57;
1385 pub const IPV6_RECVDSTOPTS: c_int = 58;
1386 pub const IPV6_DSTOPTS: c_int = 59;
1387 pub const IPV6_RECVPATHMTU: c_int = 60;
1388 pub const IPV6_PATHMTU: c_int = 61;
1389 pub const IPV6_DONTFRAG: c_int = 62;
1390 pub const IPV6_RECVTCLASS: c_int = 66;
1391 pub const IPV6_TCLASS: c_int = 67;
1392 pub const IPV6_ADDR_PREFERENCES: c_int = 72;
1393 pub const IPV6_MINHOPCOUNT: c_int = 73;
1394 pub const IPV6_ADD_MEMBERSHIP: c_int = 20;
1395 pub const IPV6_DROP_MEMBERSHIP: c_int = 21;
1396 pub const IPV6_RXHOPOPTS: c_int = 3;
1397 pub const IPV6_RXDSTOPTS: c_int = 4;
1398 pub const IPV6_RTHDR_LOOSE: c_int = 0;
1399 pub const IPV6_RTHDR_STRICT: c_int = 1;
1400 pub const IPV6_RTHDR_TYPE_0: c_int = 0;
1401 pub const IN_CLASSA_NET: u32 = 4278190080;
1402 pub const IN_CLASSA_NSHIFT: usize = 24;
1403 pub const IN_CLASSA_HOST: u32 = 16777215;
1404 pub const IN_CLASSA_MAX: u32 = 128;
1405 pub const IN_CLASSB_NET: u32 = 4294901760;
1406 pub const IN_CLASSB_NSHIFT: usize = 16;
1407 pub const IN_CLASSB_HOST: u32 = 65535;
1408 pub const IN_CLASSB_MAX: u32 = 65536;
1409 pub const IN_CLASSC_NET: u32 = 4294967040;
1410 pub const IN_CLASSC_NSHIFT: usize = 8;
1411 pub const IN_CLASSC_HOST: u32 = 255;
1412 pub const IN_LOOPBACKNET: u32 = 127;
1413 pub const INET_ADDRSTRLEN: usize = 16;
1414 pub const INET6_ADDRSTRLEN: usize = 46;
1415 
1416 // netinet/ip.h
1417 pub const IPTOS_TOS_MASK: u8 = 0x1E;
1418 pub const IPTOS_PREC_MASK: u8 = 0xE0;
1419 
1420 pub const IPTOS_ECN_NOT_ECT: u8 = 0x00;
1421 
1422 pub const IPTOS_LOWDELAY: u8 = 0x10;
1423 pub const IPTOS_THROUGHPUT: u8 = 0x08;
1424 pub const IPTOS_RELIABILITY: u8 = 0x04;
1425 pub const IPTOS_MINCOST: u8 = 0x02;
1426 
1427 pub const IPTOS_PREC_NETCONTROL: u8 = 0xe0;
1428 pub const IPTOS_PREC_INTERNETCONTROL: u8 = 0xc0;
1429 pub const IPTOS_PREC_CRITIC_ECP: u8 = 0xa0;
1430 pub const IPTOS_PREC_FLASHOVERRIDE: u8 = 0x80;
1431 pub const IPTOS_PREC_FLASH: u8 = 0x60;
1432 pub const IPTOS_PREC_IMMEDIATE: u8 = 0x40;
1433 pub const IPTOS_PREC_PRIORITY: u8 = 0x20;
1434 pub const IPTOS_PREC_ROUTINE: u8 = 0x00;
1435 
1436 pub const IPTOS_ECN_MASK: u8 = 0x03;
1437 pub const IPTOS_ECN_ECT1: u8 = 0x01;
1438 pub const IPTOS_ECN_ECT0: u8 = 0x02;
1439 pub const IPTOS_ECN_CE: u8 = 0x03;
1440 
1441 pub const IPOPT_COPY: u8 = 0x80;
1442 pub const IPOPT_CLASS_MASK: u8 = 0x60;
1443 pub const IPOPT_NUMBER_MASK: u8 = 0x1f;
1444 
1445 pub const IPOPT_CONTROL: u8 = 0x00;
1446 pub const IPOPT_RESERVED1: u8 = 0x20;
1447 pub const IPOPT_MEASUREMENT: u8 = 0x40;
1448 pub const IPOPT_RESERVED2: u8 = 0x60;
1449 pub const IPOPT_END: u8 = 0 | IPOPT_CONTROL;
1450 pub const IPOPT_NOOP: u8 = 1 | IPOPT_CONTROL;
1451 pub const IPOPT_SEC: u8 = 2 | IPOPT_CONTROL | IPOPT_COPY;
1452 pub const IPOPT_LSRR: u8 = 3 | IPOPT_CONTROL | IPOPT_COPY;
1453 pub const IPOPT_TIMESTAMP: u8 = 4 | IPOPT_MEASUREMENT;
1454 pub const IPOPT_RR: u8 = 7 | IPOPT_CONTROL;
1455 pub const IPOPT_SID: u8 = 8 | IPOPT_CONTROL | IPOPT_COPY;
1456 pub const IPOPT_SSRR: u8 = 9 | IPOPT_CONTROL | IPOPT_COPY;
1457 pub const IPOPT_RA: u8 = 20 | IPOPT_CONTROL | IPOPT_COPY;
1458 pub const IPVERSION: u8 = 4;
1459 pub const MAXTTL: u8 = 255;
1460 pub const IPDEFTTL: u8 = 64;
1461 pub const IPOPT_OPTVAL: u8 = 0;
1462 pub const IPOPT_OLEN: u8 = 1;
1463 pub const IPOPT_OFFSET: u8 = 2;
1464 pub const IPOPT_MINOFF: u8 = 4;
1465 pub const MAX_IPOPTLEN: u8 = 40;
1466 pub const IPOPT_NOP: u8 = IPOPT_NOOP;
1467 pub const IPOPT_EOL: u8 = IPOPT_END;
1468 pub const IPOPT_TS: u8 = IPOPT_TIMESTAMP;
1469 pub const IPOPT_TS_TSONLY: u8 = 0;
1470 pub const IPOPT_TS_TSANDADDR: u8 = 1;
1471 pub const IPOPT_TS_PRESPEC: u8 = 3;
1472 
1473 // net/if_arp.h
1474 pub const ARPOP_REQUEST: u16 = 1;
1475 pub const ARPOP_REPLY: u16 = 2;
1476 pub const ARPOP_RREQUEST: u16 = 3;
1477 pub const ARPOP_RREPLY: u16 = 4;
1478 pub const ARPOP_InREQUEST: u16 = 8;
1479 pub const ARPOP_InREPLY: u16 = 9;
1480 pub const ARPOP_NAK: u16 = 10;
1481 
1482 pub const MAX_ADDR_LEN: usize = 7;
1483 pub const ARPD_UPDATE: c_ushort = 0x01;
1484 pub const ARPD_LOOKUP: c_ushort = 0x02;
1485 pub const ARPD_FLUSH: c_ushort = 0x03;
1486 pub const ATF_MAGIC: c_int = 0x80;
1487 
1488 pub const ATF_NETMASK: c_int = 0x20;
1489 pub const ATF_DONTPUB: c_int = 0x40;
1490 
1491 pub const ARPHRD_NETROM: u16 = 0;
1492 pub const ARPHRD_ETHER: u16 = 1;
1493 pub const ARPHRD_EETHER: u16 = 2;
1494 pub const ARPHRD_AX25: u16 = 3;
1495 pub const ARPHRD_PRONET: u16 = 4;
1496 pub const ARPHRD_CHAOS: u16 = 5;
1497 pub const ARPHRD_IEEE802: u16 = 6;
1498 pub const ARPHRD_ARCNET: u16 = 7;
1499 pub const ARPHRD_APPLETLK: u16 = 8;
1500 pub const ARPHRD_DLCI: u16 = 15;
1501 pub const ARPHRD_ATM: u16 = 19;
1502 pub const ARPHRD_METRICOM: u16 = 23;
1503 pub const ARPHRD_IEEE1394: u16 = 24;
1504 pub const ARPHRD_EUI64: u16 = 27;
1505 pub const ARPHRD_INFINIBAND: u16 = 32;
1506 
1507 pub const ARPHRD_SLIP: u16 = 256;
1508 pub const ARPHRD_CSLIP: u16 = 257;
1509 pub const ARPHRD_SLIP6: u16 = 258;
1510 pub const ARPHRD_CSLIP6: u16 = 259;
1511 pub const ARPHRD_RSRVD: u16 = 260;
1512 pub const ARPHRD_ADAPT: u16 = 264;
1513 pub const ARPHRD_ROSE: u16 = 270;
1514 pub const ARPHRD_X25: u16 = 271;
1515 pub const ARPHRD_HWX25: u16 = 272;
1516 pub const ARPHRD_CAN: u16 = 280;
1517 pub const ARPHRD_PPP: u16 = 512;
1518 pub const ARPHRD_CISCO: u16 = 513;
1519 pub const ARPHRD_HDLC: u16 = ARPHRD_CISCO;
1520 pub const ARPHRD_LAPB: u16 = 516;
1521 pub const ARPHRD_DDCMP: u16 = 517;
1522 pub const ARPHRD_RAWHDLC: u16 = 518;
1523 
1524 pub const ARPHRD_TUNNEL: u16 = 768;
1525 pub const ARPHRD_TUNNEL6: u16 = 769;
1526 pub const ARPHRD_FRAD: u16 = 770;
1527 pub const ARPHRD_SKIP: u16 = 771;
1528 pub const ARPHRD_LOOPBACK: u16 = 772;
1529 pub const ARPHRD_LOCALTLK: u16 = 773;
1530 pub const ARPHRD_FDDI: u16 = 774;
1531 pub const ARPHRD_BIF: u16 = 775;
1532 pub const ARPHRD_SIT: u16 = 776;
1533 pub const ARPHRD_IPDDP: u16 = 777;
1534 pub const ARPHRD_IPGRE: u16 = 778;
1535 pub const ARPHRD_PIMREG: u16 = 779;
1536 pub const ARPHRD_HIPPI: u16 = 780;
1537 pub const ARPHRD_ASH: u16 = 781;
1538 pub const ARPHRD_ECONET: u16 = 782;
1539 pub const ARPHRD_IRDA: u16 = 783;
1540 pub const ARPHRD_FCPP: u16 = 784;
1541 pub const ARPHRD_FCAL: u16 = 785;
1542 pub const ARPHRD_FCPL: u16 = 786;
1543 pub const ARPHRD_FCFABRIC: u16 = 787;
1544 pub const ARPHRD_IEEE802_TR: u16 = 800;
1545 pub const ARPHRD_IEEE80211: u16 = 801;
1546 pub const ARPHRD_IEEE80211_PRISM: u16 = 802;
1547 pub const ARPHRD_IEEE80211_RADIOTAP: u16 = 803;
1548 pub const ARPHRD_IEEE802154: u16 = 804;
1549 
1550 pub const ARPHRD_VOID: u16 = 0xFFFF;
1551 pub const ARPHRD_NONE: u16 = 0xFFFE;
1552 
1553 // bits/posix1_lim.h
1554 pub const _POSIX_AIO_LISTIO_MAX: usize = 2;
1555 pub const _POSIX_AIO_MAX: usize = 1;
1556 pub const _POSIX_ARG_MAX: usize = 4096;
1557 pub const _POSIX_CHILD_MAX: usize = 25;
1558 pub const _POSIX_DELAYTIMER_MAX: usize = 32;
1559 pub const _POSIX_HOST_NAME_MAX: usize = 255;
1560 pub const _POSIX_LINK_MAX: usize = 8;
1561 pub const _POSIX_LOGIN_NAME_MAX: usize = 9;
1562 pub const _POSIX_MAX_CANON: usize = 255;
1563 pub const _POSIX_MAX_INPUT: usize = 255;
1564 pub const _POSIX_MQ_OPEN_MAX: usize = 8;
1565 pub const _POSIX_MQ_PRIO_MAX: usize = 32;
1566 pub const _POSIX_NAME_MAX: usize = 14;
1567 pub const _POSIX_NGROUPS_MAX: usize = 8;
1568 pub const _POSIX_OPEN_MAX: usize = 20;
1569 pub const _POSIX_FD_SETSIZE: usize = 20;
1570 pub const _POSIX_PATH_MAX: usize = 256;
1571 pub const _POSIX_PIPE_BUF: usize = 512;
1572 pub const _POSIX_RE_DUP_MAX: usize = 255;
1573 pub const _POSIX_RTSIG_MAX: usize = 8;
1574 pub const _POSIX_SEM_NSEMS_MAX: usize = 256;
1575 pub const _POSIX_SEM_VALUE_MAX: usize = 32767;
1576 pub const _POSIX_SIGQUEUE_MAX: usize = 32;
1577 pub const _POSIX_SSIZE_MAX: usize = 32767;
1578 pub const _POSIX_STREAM_MAX: usize = 8;
1579 pub const _POSIX_SYMLINK_MAX: usize = 255;
1580 pub const _POSIX_SYMLOOP_MAX: usize = 8;
1581 pub const _POSIX_TIMER_MAX: usize = 32;
1582 pub const _POSIX_TTY_NAME_MAX: usize = 9;
1583 pub const _POSIX_TZNAME_MAX: usize = 6;
1584 pub const _POSIX_QLIMIT: usize = 1;
1585 pub const _POSIX_HIWAT: usize = 512;
1586 pub const _POSIX_UIO_MAXIOV: usize = 16;
1587 pub const _POSIX_CLOCKRES_MIN: usize = 20000000;
1588 pub const NAME_MAX: usize = 255;
1589 pub const NGROUPS_MAX: usize = 256;
1590 pub const _POSIX_THREAD_KEYS_MAX: usize = 128;
1591 pub const _POSIX_THREAD_DESTRUCTOR_ITERATIONS: usize = 4;
1592 pub const _POSIX_THREAD_THREADS_MAX: usize = 64;
1593 pub const SEM_VALUE_MAX: c_int = 2147483647;
1594 pub const MAXNAMLEN: usize = 255;
1595 
1596 // netdb.h
1597 pub const _PATH_HEQUIV: &'static [u8; 17usize] = b"/etc/hosts.equiv\0";
1598 pub const _PATH_HOSTS: &'static [u8; 11usize] = b"/etc/hosts\0";
1599 pub const _PATH_NETWORKS: &'static [u8; 14usize] = b"/etc/networks\0";
1600 pub const _PATH_NSSWITCH_CONF: &'static [u8; 19usize] = b"/etc/nsswitch.conf\0";
1601 pub const _PATH_PROTOCOLS: &'static [u8; 15usize] = b"/etc/protocols\0";
1602 pub const _PATH_SERVICES: &'static [u8; 14usize] = b"/etc/services\0";
1603 pub const HOST_NOT_FOUND: c_int = 1;
1604 pub const TRY_AGAIN: c_int = 2;
1605 pub const NO_RECOVERY: c_int = 3;
1606 pub const NO_DATA: c_int = 4;
1607 pub const NETDB_INTERNAL: c_int = -1;
1608 pub const NETDB_SUCCESS: c_int = 0;
1609 pub const NO_ADDRESS: c_int = 4;
1610 pub const IPPORT_RESERVED: c_int = 1024;
1611 pub const SCOPE_DELIMITER: u8 = 37u8;
1612 pub const GAI_WAIT: c_int = 0;
1613 pub const GAI_NOWAIT: c_int = 1;
1614 pub const AI_PASSIVE: c_int = 1;
1615 pub const AI_CANONNAME: c_int = 2;
1616 pub const AI_NUMERICHOST: c_int = 4;
1617 pub const AI_V4MAPPED: c_int = 8;
1618 pub const AI_ALL: c_int = 16;
1619 pub const AI_ADDRCONFIG: c_int = 32;
1620 pub const AI_IDN: c_int = 64;
1621 pub const AI_CANONIDN: c_int = 128;
1622 pub const AI_NUMERICSERV: c_int = 1024;
1623 pub const EAI_BADFLAGS: c_int = -1;
1624 pub const EAI_NONAME: c_int = -2;
1625 pub const EAI_AGAIN: c_int = -3;
1626 pub const EAI_FAIL: c_int = -4;
1627 pub const EAI_FAMILY: c_int = -6;
1628 pub const EAI_SOCKTYPE: c_int = -7;
1629 pub const EAI_SERVICE: c_int = -8;
1630 pub const EAI_MEMORY: c_int = -10;
1631 pub const EAI_SYSTEM: c_int = -11;
1632 pub const EAI_OVERFLOW: c_int = -12;
1633 pub const EAI_NODATA: c_int = -5;
1634 pub const EAI_ADDRFAMILY: c_int = -9;
1635 pub const EAI_INPROGRESS: c_int = -100;
1636 pub const EAI_CANCELED: c_int = -101;
1637 pub const EAI_NOTCANCELED: c_int = -102;
1638 pub const EAI_ALLDONE: c_int = -103;
1639 pub const EAI_INTR: c_int = -104;
1640 pub const EAI_IDN_ENCODE: c_int = -105;
1641 pub const NI_MAXHOST: usize = 1025;
1642 pub const NI_MAXSERV: usize = 32;
1643 pub const NI_NUMERICHOST: c_int = 1;
1644 pub const NI_NUMERICSERV: c_int = 2;
1645 pub const NI_NOFQDN: c_int = 4;
1646 pub const NI_NAMEREQD: c_int = 8;
1647 pub const NI_DGRAM: c_int = 16;
1648 pub const NI_IDN: c_int = 32;
1649 
1650 // time.h
1651 pub const CLOCK_REALTIME: crate::clockid_t = 0;
1652 pub const CLOCK_MONOTONIC: crate::clockid_t = 1;
1653 pub const CLOCK_PROCESS_CPUTIME_ID: crate::clockid_t = 2;
1654 pub const CLOCK_THREAD_CPUTIME_ID: crate::clockid_t = 3;
1655 pub const CLOCK_MONOTONIC_RAW: crate::clockid_t = 4;
1656 pub const CLOCK_REALTIME_COARSE: crate::clockid_t = 5;
1657 pub const CLOCK_MONOTONIC_COARSE: crate::clockid_t = 6;
1658 pub const TIMER_ABSTIME: c_int = 1;
1659 pub const TIME_UTC: c_int = 1;
1660 
1661 // sys/poll.h
1662 pub const POLLIN: i16 = 1;
1663 pub const POLLPRI: i16 = 2;
1664 pub const POLLOUT: i16 = 4;
1665 pub const POLLRDNORM: i16 = 1;
1666 pub const POLLRDBAND: i16 = 2;
1667 pub const POLLWRNORM: i16 = 4;
1668 pub const POLLWRBAND: i16 = 4;
1669 pub const POLLERR: i16 = 8;
1670 pub const POLLHUP: i16 = 16;
1671 pub const POLLNVAL: i16 = 32;
1672 
1673 // locale.h
1674 pub const __LC_CTYPE: usize = 0;
1675 pub const __LC_NUMERIC: usize = 1;
1676 pub const __LC_TIME: usize = 2;
1677 pub const __LC_COLLATE: usize = 3;
1678 pub const __LC_MONETARY: usize = 4;
1679 pub const __LC_MESSAGES: usize = 5;
1680 pub const __LC_ALL: usize = 6;
1681 pub const __LC_PAPER: usize = 7;
1682 pub const __LC_NAME: usize = 8;
1683 pub const __LC_ADDRESS: usize = 9;
1684 pub const __LC_TELEPHONE: usize = 10;
1685 pub const __LC_MEASUREMENT: usize = 11;
1686 pub const __LC_IDENTIFICATION: usize = 12;
1687 pub const LC_CTYPE: c_int = 0;
1688 pub const LC_NUMERIC: c_int = 1;
1689 pub const LC_TIME: c_int = 2;
1690 pub const LC_COLLATE: c_int = 3;
1691 pub const LC_MONETARY: c_int = 4;
1692 pub const LC_MESSAGES: c_int = 5;
1693 pub const LC_ALL: c_int = 6;
1694 pub const LC_PAPER: c_int = 7;
1695 pub const LC_NAME: c_int = 8;
1696 pub const LC_ADDRESS: c_int = 9;
1697 pub const LC_TELEPHONE: c_int = 10;
1698 pub const LC_MEASUREMENT: c_int = 11;
1699 pub const LC_IDENTIFICATION: c_int = 12;
1700 pub const LC_CTYPE_MASK: c_int = 1;
1701 pub const LC_NUMERIC_MASK: c_int = 2;
1702 pub const LC_TIME_MASK: c_int = 4;
1703 pub const LC_COLLATE_MASK: c_int = 8;
1704 pub const LC_MONETARY_MASK: c_int = 16;
1705 pub const LC_MESSAGES_MASK: c_int = 32;
1706 pub const LC_PAPER_MASK: c_int = 128;
1707 pub const LC_NAME_MASK: c_int = 256;
1708 pub const LC_ADDRESS_MASK: c_int = 512;
1709 pub const LC_TELEPHONE_MASK: c_int = 1024;
1710 pub const LC_MEASUREMENT_MASK: c_int = 2048;
1711 pub const LC_IDENTIFICATION_MASK: c_int = 4096;
1712 pub const LC_ALL_MASK: c_int = 8127;
1713 
1714 pub const ABDAY_1: crate::nl_item = 0x20000;
1715 pub const ABDAY_2: crate::nl_item = 0x20001;
1716 pub const ABDAY_3: crate::nl_item = 0x20002;
1717 pub const ABDAY_4: crate::nl_item = 0x20003;
1718 pub const ABDAY_5: crate::nl_item = 0x20004;
1719 pub const ABDAY_6: crate::nl_item = 0x20005;
1720 pub const ABDAY_7: crate::nl_item = 0x20006;
1721 
1722 pub const DAY_1: crate::nl_item = 0x20007;
1723 pub const DAY_2: crate::nl_item = 0x20008;
1724 pub const DAY_3: crate::nl_item = 0x20009;
1725 pub const DAY_4: crate::nl_item = 0x2000A;
1726 pub const DAY_5: crate::nl_item = 0x2000B;
1727 pub const DAY_6: crate::nl_item = 0x2000C;
1728 pub const DAY_7: crate::nl_item = 0x2000D;
1729 
1730 pub const ABMON_1: crate::nl_item = 0x2000E;
1731 pub const ABMON_2: crate::nl_item = 0x2000F;
1732 pub const ABMON_3: crate::nl_item = 0x20010;
1733 pub const ABMON_4: crate::nl_item = 0x20011;
1734 pub const ABMON_5: crate::nl_item = 0x20012;
1735 pub const ABMON_6: crate::nl_item = 0x20013;
1736 pub const ABMON_7: crate::nl_item = 0x20014;
1737 pub const ABMON_8: crate::nl_item = 0x20015;
1738 pub const ABMON_9: crate::nl_item = 0x20016;
1739 pub const ABMON_10: crate::nl_item = 0x20017;
1740 pub const ABMON_11: crate::nl_item = 0x20018;
1741 pub const ABMON_12: crate::nl_item = 0x20019;
1742 
1743 pub const MON_1: crate::nl_item = 0x2001A;
1744 pub const MON_2: crate::nl_item = 0x2001B;
1745 pub const MON_3: crate::nl_item = 0x2001C;
1746 pub const MON_4: crate::nl_item = 0x2001D;
1747 pub const MON_5: crate::nl_item = 0x2001E;
1748 pub const MON_6: crate::nl_item = 0x2001F;
1749 pub const MON_7: crate::nl_item = 0x20020;
1750 pub const MON_8: crate::nl_item = 0x20021;
1751 pub const MON_9: crate::nl_item = 0x20022;
1752 pub const MON_10: crate::nl_item = 0x20023;
1753 pub const MON_11: crate::nl_item = 0x20024;
1754 pub const MON_12: crate::nl_item = 0x20025;
1755 
1756 pub const AM_STR: crate::nl_item = 0x20026;
1757 pub const PM_STR: crate::nl_item = 0x20027;
1758 
1759 pub const D_T_FMT: crate::nl_item = 0x20028;
1760 pub const D_FMT: crate::nl_item = 0x20029;
1761 pub const T_FMT: crate::nl_item = 0x2002A;
1762 pub const T_FMT_AMPM: crate::nl_item = 0x2002B;
1763 
1764 pub const ERA: crate::nl_item = 0x2002C;
1765 pub const ERA_D_FMT: crate::nl_item = 0x2002E;
1766 pub const ALT_DIGITS: crate::nl_item = 0x2002F;
1767 pub const ERA_D_T_FMT: crate::nl_item = 0x20030;
1768 pub const ERA_T_FMT: crate::nl_item = 0x20031;
1769 
1770 pub const CODESET: crate::nl_item = 14;
1771 pub const CRNCYSTR: crate::nl_item = 0x4000F;
1772 pub const RADIXCHAR: crate::nl_item = 0x10000;
1773 pub const THOUSEP: crate::nl_item = 0x10001;
1774 pub const YESEXPR: crate::nl_item = 0x50000;
1775 pub const NOEXPR: crate::nl_item = 0x50001;
1776 pub const YESSTR: crate::nl_item = 0x50002;
1777 pub const NOSTR: crate::nl_item = 0x50003;
1778 
1779 // reboot.h
1780 pub const RB_AUTOBOOT: c_int = 0x0;
1781 pub const RB_ASKNAME: c_int = 0x1;
1782 pub const RB_SINGLE: c_int = 0x2;
1783 pub const RB_KBD: c_int = 0x4;
1784 pub const RB_HALT: c_int = 0x8;
1785 pub const RB_INITNAME: c_int = 0x10;
1786 pub const RB_DFLTROOT: c_int = 0x20;
1787 pub const RB_NOBOOTRC: c_int = 0x20;
1788 pub const RB_ALTBOOT: c_int = 0x40;
1789 pub const RB_UNIPROC: c_int = 0x80;
1790 pub const RB_DEBUGGER: c_int = 0x1000;
1791 
1792 // semaphore.h
1793 pub const __SIZEOF_SEM_T: usize = 20;
1794 pub const SEM_FAILED: *mut crate::sem_t = 0 as *mut sem_t;
1795 
1796 // termios.h
1797 pub const IGNBRK: crate::tcflag_t = 1;
1798 pub const BRKINT: crate::tcflag_t = 2;
1799 pub const IGNPAR: crate::tcflag_t = 4;
1800 pub const PARMRK: crate::tcflag_t = 8;
1801 pub const INPCK: crate::tcflag_t = 16;
1802 pub const ISTRIP: crate::tcflag_t = 32;
1803 pub const INLCR: crate::tcflag_t = 64;
1804 pub const IGNCR: crate::tcflag_t = 128;
1805 pub const ICRNL: crate::tcflag_t = 256;
1806 pub const IXON: crate::tcflag_t = 512;
1807 pub const IXOFF: crate::tcflag_t = 1024;
1808 pub const IXANY: crate::tcflag_t = 2048;
1809 pub const IMAXBEL: crate::tcflag_t = 8192;
1810 pub const IUCLC: crate::tcflag_t = 16384;
1811 pub const OPOST: crate::tcflag_t = 1;
1812 pub const ONLCR: crate::tcflag_t = 2;
1813 pub const ONOEOT: crate::tcflag_t = 8;
1814 pub const OCRNL: crate::tcflag_t = 16;
1815 pub const ONOCR: crate::tcflag_t = 32;
1816 pub const ONLRET: crate::tcflag_t = 64;
1817 pub const NLDLY: crate::tcflag_t = 768;
1818 pub const NL0: crate::tcflag_t = 0;
1819 pub const NL1: crate::tcflag_t = 256;
1820 pub const TABDLY: crate::tcflag_t = 3076;
1821 pub const TAB0: crate::tcflag_t = 0;
1822 pub const TAB1: crate::tcflag_t = 1024;
1823 pub const TAB2: crate::tcflag_t = 2048;
1824 pub const TAB3: crate::tcflag_t = 4;
1825 pub const CRDLY: crate::tcflag_t = 12288;
1826 pub const CR0: crate::tcflag_t = 0;
1827 pub const CR1: crate::tcflag_t = 4096;
1828 pub const CR2: crate::tcflag_t = 8192;
1829 pub const CR3: crate::tcflag_t = 12288;
1830 pub const FFDLY: crate::tcflag_t = 16384;
1831 pub const FF0: crate::tcflag_t = 0;
1832 pub const FF1: crate::tcflag_t = 16384;
1833 pub const BSDLY: crate::tcflag_t = 32768;
1834 pub const BS0: crate::tcflag_t = 0;
1835 pub const BS1: crate::tcflag_t = 32768;
1836 pub const VTDLY: crate::tcflag_t = 65536;
1837 pub const VT0: crate::tcflag_t = 0;
1838 pub const VT1: crate::tcflag_t = 65536;
1839 pub const OLCUC: crate::tcflag_t = 131072;
1840 pub const OFILL: crate::tcflag_t = 262144;
1841 pub const OFDEL: crate::tcflag_t = 524288;
1842 pub const CIGNORE: crate::tcflag_t = 1;
1843 pub const CSIZE: crate::tcflag_t = 768;
1844 pub const CS5: crate::tcflag_t = 0;
1845 pub const CS6: crate::tcflag_t = 256;
1846 pub const CS7: crate::tcflag_t = 512;
1847 pub const CS8: crate::tcflag_t = 768;
1848 pub const CSTOPB: crate::tcflag_t = 1024;
1849 pub const CREAD: crate::tcflag_t = 2048;
1850 pub const PARENB: crate::tcflag_t = 4096;
1851 pub const PARODD: crate::tcflag_t = 8192;
1852 pub const HUPCL: crate::tcflag_t = 16384;
1853 pub const CLOCAL: crate::tcflag_t = 32768;
1854 pub const CRTSCTS: crate::tcflag_t = 65536;
1855 pub const CRTS_IFLOW: crate::tcflag_t = 65536;
1856 pub const CCTS_OFLOW: crate::tcflag_t = 65536;
1857 pub const CDTRCTS: crate::tcflag_t = 131072;
1858 pub const MDMBUF: crate::tcflag_t = 1048576;
1859 pub const CHWFLOW: crate::tcflag_t = 1245184;
1860 pub const ECHOKE: crate::tcflag_t = 1;
1861 pub const _ECHOE: crate::tcflag_t = 2;
1862 pub const ECHOE: crate::tcflag_t = 2;
1863 pub const _ECHOK: crate::tcflag_t = 4;
1864 pub const ECHOK: crate::tcflag_t = 4;
1865 pub const _ECHO: crate::tcflag_t = 8;
1866 pub const ECHO: crate::tcflag_t = 8;
1867 pub const _ECHONL: crate::tcflag_t = 16;
1868 pub const ECHONL: crate::tcflag_t = 16;
1869 pub const ECHOPRT: crate::tcflag_t = 32;
1870 pub const ECHOCTL: crate::tcflag_t = 64;
1871 pub const _ISIG: crate::tcflag_t = 128;
1872 pub const ISIG: crate::tcflag_t = 128;
1873 pub const _ICANON: crate::tcflag_t = 256;
1874 pub const ICANON: crate::tcflag_t = 256;
1875 pub const ALTWERASE: crate::tcflag_t = 512;
1876 pub const _IEXTEN: crate::tcflag_t = 1024;
1877 pub const IEXTEN: crate::tcflag_t = 1024;
1878 pub const EXTPROC: crate::tcflag_t = 2048;
1879 pub const _TOSTOP: crate::tcflag_t = 4194304;
1880 pub const TOSTOP: crate::tcflag_t = 4194304;
1881 pub const FLUSHO: crate::tcflag_t = 8388608;
1882 pub const NOKERNINFO: crate::tcflag_t = 33554432;
1883 pub const PENDIN: crate::tcflag_t = 536870912;
1884 pub const _NOFLSH: crate::tcflag_t = 2147483648;
1885 pub const NOFLSH: crate::tcflag_t = 2147483648;
1886 pub const VEOF: usize = 0;
1887 pub const VEOL: usize = 1;
1888 pub const VEOL2: usize = 2;
1889 pub const VERASE: usize = 3;
1890 pub const VWERASE: usize = 4;
1891 pub const VKILL: usize = 5;
1892 pub const VREPRINT: usize = 6;
1893 pub const VINTR: usize = 8;
1894 pub const VQUIT: usize = 9;
1895 pub const VSUSP: usize = 10;
1896 pub const VDSUSP: usize = 11;
1897 pub const VSTART: usize = 12;
1898 pub const VSTOP: usize = 13;
1899 pub const VLNEXT: usize = 14;
1900 pub const VDISCARD: usize = 15;
1901 pub const VMIN: usize = 16;
1902 pub const VTIME: usize = 17;
1903 pub const VSTATUS: usize = 18;
1904 pub const NCCS: usize = 20;
1905 pub const B0: crate::speed_t = 0;
1906 pub const B50: crate::speed_t = 50;
1907 pub const B75: crate::speed_t = 75;
1908 pub const B110: crate::speed_t = 110;
1909 pub const B134: crate::speed_t = 134;
1910 pub const B150: crate::speed_t = 150;
1911 pub const B200: crate::speed_t = 200;
1912 pub const B300: crate::speed_t = 300;
1913 pub const B600: crate::speed_t = 600;
1914 pub const B1200: crate::speed_t = 1200;
1915 pub const B1800: crate::speed_t = 1800;
1916 pub const B2400: crate::speed_t = 2400;
1917 pub const B4800: crate::speed_t = 4800;
1918 pub const B9600: crate::speed_t = 9600;
1919 pub const B7200: crate::speed_t = 7200;
1920 pub const B14400: crate::speed_t = 14400;
1921 pub const B19200: crate::speed_t = 19200;
1922 pub const B28800: crate::speed_t = 28800;
1923 pub const B38400: crate::speed_t = 38400;
1924 pub const EXTA: crate::speed_t = B19200;
1925 pub const EXTB: crate::speed_t = B38400;
1926 pub const B57600: crate::speed_t = 57600;
1927 pub const B76800: crate::speed_t = 76800;
1928 pub const B115200: crate::speed_t = 115200;
1929 pub const B230400: crate::speed_t = 230400;
1930 pub const B460800: crate::speed_t = 460800;
1931 pub const B500000: crate::speed_t = 500000;
1932 pub const B576000: crate::speed_t = 576000;
1933 pub const B921600: crate::speed_t = 921600;
1934 pub const B1000000: crate::speed_t = 1000000;
1935 pub const B1152000: crate::speed_t = 1152000;
1936 pub const B1500000: crate::speed_t = 1500000;
1937 pub const B2000000: crate::speed_t = 2000000;
1938 pub const B2500000: crate::speed_t = 2500000;
1939 pub const B3000000: crate::speed_t = 3000000;
1940 pub const B3500000: crate::speed_t = 3500000;
1941 pub const B4000000: crate::speed_t = 4000000;
1942 pub const TCSANOW: c_int = 0;
1943 pub const TCSADRAIN: c_int = 1;
1944 pub const TCSAFLUSH: c_int = 2;
1945 pub const TCSASOFT: c_int = 16;
1946 pub const TCIFLUSH: c_int = 1;
1947 pub const TCOFLUSH: c_int = 2;
1948 pub const TCIOFLUSH: c_int = 3;
1949 pub const TCOOFF: c_int = 1;
1950 pub const TCOON: c_int = 2;
1951 pub const TCIOFF: c_int = 3;
1952 pub const TCION: c_int = 4;
1953 pub const TTYDEF_IFLAG: crate::tcflag_t = 11042;
1954 pub const TTYDEF_LFLAG: crate::tcflag_t = 1483;
1955 pub const TTYDEF_CFLAG: crate::tcflag_t = 23040;
1956 pub const TTYDEF_SPEED: crate::tcflag_t = 9600;
1957 pub const CEOL: u8 = 0u8;
1958 pub const CERASE: u8 = 127;
1959 pub const CMIN: u8 = 1;
1960 pub const CQUIT: u8 = 28;
1961 pub const CTIME: u8 = 0;
1962 pub const CBRK: u8 = 0u8;
1963 
1964 // dlfcn.h
1965 pub const RTLD_DEFAULT: *mut c_void = 0i64 as *mut c_void;
1966 pub const RTLD_NEXT: *mut c_void = -1i64 as *mut c_void;
1967 pub const RTLD_LAZY: c_int = 1;
1968 pub const RTLD_NOW: c_int = 2;
1969 pub const RTLD_BINDING_MASK: c_int = 3;
1970 pub const RTLD_NOLOAD: c_int = 4;
1971 pub const RTLD_DEEPBIND: c_int = 8;
1972 pub const RTLD_GLOBAL: c_int = 256;
1973 pub const RTLD_LOCAL: c_int = 0;
1974 pub const RTLD_NODELETE: c_int = 4096;
1975 pub const DLFO_STRUCT_HAS_EH_DBASE: usize = 1;
1976 pub const DLFO_STRUCT_HAS_EH_COUNT: usize = 0;
1977 pub const LM_ID_BASE: c_long = 0;
1978 pub const LM_ID_NEWLM: c_long = -1;
1979 
1980 // bits/signum_generic.h
1981 pub const SIGINT: c_int = 2;
1982 pub const SIGILL: c_int = 4;
1983 pub const SIGABRT: c_int = 6;
1984 pub const SIGFPE: c_int = 8;
1985 pub const SIGSEGV: c_int = 11;
1986 pub const SIGTERM: c_int = 15;
1987 pub const SIGHUP: c_int = 1;
1988 pub const SIGQUIT: c_int = 3;
1989 pub const SIGTRAP: c_int = 5;
1990 pub const SIGKILL: c_int = 9;
1991 pub const SIGPIPE: c_int = 13;
1992 pub const SIGALRM: c_int = 14;
1993 pub const SIGIOT: c_int = 6;
1994 pub const SIGBUS: c_int = 10;
1995 pub const SIGSYS: c_int = 12;
1996 pub const SIGEMT: c_int = 7;
1997 pub const SIGINFO: c_int = 29;
1998 pub const SIGLOST: c_int = 32;
1999 pub const SIGURG: c_int = 16;
2000 pub const SIGSTOP: c_int = 17;
2001 pub const SIGTSTP: c_int = 18;
2002 pub const SIGCONT: c_int = 19;
2003 pub const SIGCHLD: c_int = 20;
2004 pub const SIGTTIN: c_int = 21;
2005 pub const SIGTTOU: c_int = 22;
2006 pub const SIGPOLL: c_int = 23;
2007 pub const SIGXCPU: c_int = 24;
2008 pub const SIGVTALRM: c_int = 26;
2009 pub const SIGPROF: c_int = 27;
2010 pub const SIGXFSZ: c_int = 25;
2011 pub const SIGUSR1: c_int = 30;
2012 pub const SIGUSR2: c_int = 31;
2013 pub const SIGWINCH: c_int = 28;
2014 pub const SIGIO: c_int = 23;
2015 pub const SIGCLD: c_int = 20;
2016 pub const __SIGRTMIN: usize = 32;
2017 pub const __SIGRTMAX: usize = 32;
2018 pub const _NSIG: usize = 33;
2019 pub const NSIG: usize = 33;
2020 
2021 // bits/sigaction.h
2022 pub const SA_ONSTACK: c_int = 1;
2023 pub const SA_RESTART: c_int = 2;
2024 pub const SA_NODEFER: c_int = 16;
2025 pub const SA_RESETHAND: c_int = 4;
2026 pub const SA_NOCLDSTOP: c_int = 8;
2027 pub const SA_SIGINFO: c_int = 64;
2028 pub const SA_INTERRUPT: c_int = 0;
2029 pub const SA_NOMASK: c_int = 16;
2030 pub const SA_ONESHOT: c_int = 4;
2031 pub const SA_STACK: c_int = 1;
2032 pub const SIG_BLOCK: c_int = 1;
2033 pub const SIG_UNBLOCK: c_int = 2;
2034 pub const SIG_SETMASK: c_int = 3;
2035 
2036 // bits/sigcontext.h
2037 pub const FPC_IE: u16 = 1;
2038 pub const FPC_IM: u16 = 1;
2039 pub const FPC_DE: u16 = 2;
2040 pub const FPC_DM: u16 = 2;
2041 pub const FPC_ZE: u16 = 4;
2042 pub const FPC_ZM: u16 = 4;
2043 pub const FPC_OE: u16 = 8;
2044 pub const FPC_OM: u16 = 8;
2045 pub const FPC_UE: u16 = 16;
2046 pub const FPC_PE: u16 = 32;
2047 pub const FPC_PC: u16 = 768;
2048 pub const FPC_PC_24: u16 = 0;
2049 pub const FPC_PC_53: u16 = 512;
2050 pub const FPC_PC_64: u16 = 768;
2051 pub const FPC_RC: u16 = 3072;
2052 pub const FPC_RC_RN: u16 = 0;
2053 pub const FPC_RC_RD: u16 = 1024;
2054 pub const FPC_RC_RU: u16 = 2048;
2055 pub const FPC_RC_CHOP: u16 = 3072;
2056 pub const FPC_IC: u16 = 4096;
2057 pub const FPC_IC_PROJ: u16 = 0;
2058 pub const FPC_IC_AFF: u16 = 4096;
2059 pub const FPS_IE: u16 = 1;
2060 pub const FPS_DE: u16 = 2;
2061 pub const FPS_ZE: u16 = 4;
2062 pub const FPS_OE: u16 = 8;
2063 pub const FPS_UE: u16 = 16;
2064 pub const FPS_PE: u16 = 32;
2065 pub const FPS_SF: u16 = 64;
2066 pub const FPS_ES: u16 = 128;
2067 pub const FPS_C0: u16 = 256;
2068 pub const FPS_C1: u16 = 512;
2069 pub const FPS_C2: u16 = 1024;
2070 pub const FPS_TOS: u16 = 14336;
2071 pub const FPS_TOS_SHIFT: u16 = 11;
2072 pub const FPS_C3: u16 = 16384;
2073 pub const FPS_BUSY: u16 = 32768;
2074 pub const FPE_INTOVF_TRAP: c_int = 1;
2075 pub const FPE_INTDIV_FAULT: c_int = 2;
2076 pub const FPE_FLTOVF_FAULT: c_int = 3;
2077 pub const FPE_FLTDIV_FAULT: c_int = 4;
2078 pub const FPE_FLTUND_FAULT: c_int = 5;
2079 pub const FPE_SUBRNG_FAULT: c_int = 7;
2080 pub const FPE_FLTDNR_FAULT: c_int = 8;
2081 pub const FPE_FLTINX_FAULT: c_int = 9;
2082 pub const FPE_EMERR_FAULT: c_int = 10;
2083 pub const FPE_EMBND_FAULT: c_int = 11;
2084 pub const ILL_INVOPR_FAULT: c_int = 1;
2085 pub const ILL_STACK_FAULT: c_int = 2;
2086 pub const ILL_FPEOPR_FAULT: c_int = 3;
2087 pub const DBG_SINGLE_TRAP: c_int = 1;
2088 pub const DBG_BRKPNT_FAULT: c_int = 2;
2089 pub const __NGREG: usize = 19;
2090 pub const NGREG: usize = 19;
2091 
2092 // bits/sigstack.h
2093 pub const MINSIGSTKSZ: usize = 8192;
2094 pub const SIGSTKSZ: usize = 40960;
2095 
2096 // sys/stat.h
2097 pub const __S_IFMT: mode_t = 0o17_0000;
2098 pub const __S_IFDIR: mode_t = 0o4_0000;
2099 pub const __S_IFCHR: mode_t = 0o2_0000;
2100 pub const __S_IFBLK: mode_t = 0o6_0000;
2101 pub const __S_IFREG: mode_t = 0o10_0000;
2102 pub const __S_IFLNK: mode_t = 0o12_0000;
2103 pub const __S_IFSOCK: mode_t = 0o14_0000;
2104 pub const __S_IFIFO: mode_t = 0o1_0000;
2105 pub const __S_ISUID: mode_t = 0o4000;
2106 pub const __S_ISGID: mode_t = 0o2000;
2107 pub const __S_ISVTX: mode_t = 0o1000;
2108 pub const __S_IREAD: mode_t = 0o0400;
2109 pub const __S_IWRITE: mode_t = 0o0200;
2110 pub const __S_IEXEC: mode_t = 0o0100;
2111 pub const S_INOCACHE: mode_t = 0o20_0000;
2112 pub const S_IUSEUNK: mode_t = 0o40_0000;
2113 pub const S_IUNKNOWN: mode_t = 0o700_0000;
2114 pub const S_IUNKSHIFT: mode_t = 0o0014;
2115 pub const S_IPTRANS: mode_t = 0o1000_0000;
2116 pub const S_IATRANS: mode_t = 0o2000_0000;
2117 pub const S_IROOT: mode_t = 0o4000_0000;
2118 pub const S_ITRANS: mode_t = 0o7000_0000;
2119 pub const S_IMMAP0: mode_t = 0o10000_0000;
2120 pub const CMASK: mode_t = 18;
2121 pub const UF_SETTABLE: c_uint = 65535;
2122 pub const UF_NODUMP: c_uint = 1;
2123 pub const UF_IMMUTABLE: c_uint = 2;
2124 pub const UF_APPEND: c_uint = 4;
2125 pub const UF_OPAQUE: c_uint = 8;
2126 pub const UF_NOUNLINK: c_uint = 16;
2127 pub const SF_SETTABLE: c_uint = 4294901760;
2128 pub const SF_ARCHIVED: c_uint = 65536;
2129 pub const SF_IMMUTABLE: c_uint = 131072;
2130 pub const SF_APPEND: c_uint = 262144;
2131 pub const SF_NOUNLINK: c_uint = 1048576;
2132 pub const SF_SNAPSHOT: c_uint = 2097152;
2133 pub const UTIME_NOW: c_long = -1;
2134 pub const UTIME_OMIT: c_long = -2;
2135 pub const S_IFMT: mode_t = 0o17_0000;
2136 pub const S_IFDIR: mode_t = 0o4_0000;
2137 pub const S_IFCHR: mode_t = 0o2_0000;
2138 pub const S_IFBLK: mode_t = 0o6_0000;
2139 pub const S_IFREG: mode_t = 0o10_0000;
2140 pub const S_IFIFO: mode_t = 0o1_0000;
2141 pub const S_IFLNK: mode_t = 0o12_0000;
2142 pub const S_IFSOCK: mode_t = 0o14_0000;
2143 pub const S_ISUID: mode_t = 0o4000;
2144 pub const S_ISGID: mode_t = 0o2000;
2145 pub const S_ISVTX: mode_t = 0o1000;
2146 pub const S_IRUSR: mode_t = 0o0400;
2147 pub const S_IWUSR: mode_t = 0o0200;
2148 pub const S_IXUSR: mode_t = 0o0100;
2149 pub const S_IRWXU: mode_t = 0o0700;
2150 pub const S_IREAD: mode_t = 0o0400;
2151 pub const S_IWRITE: mode_t = 0o0200;
2152 pub const S_IEXEC: mode_t = 0o0100;
2153 pub const S_IRGRP: mode_t = 0o0040;
2154 pub const S_IWGRP: mode_t = 0o0020;
2155 pub const S_IXGRP: mode_t = 0o0010;
2156 pub const S_IRWXG: mode_t = 0o0070;
2157 pub const S_IROTH: mode_t = 0o0004;
2158 pub const S_IWOTH: mode_t = 0o0002;
2159 pub const S_IXOTH: mode_t = 0o0001;
2160 pub const S_IRWXO: mode_t = 0o0007;
2161 pub const ACCESSPERMS: mode_t = 511;
2162 pub const ALLPERMS: mode_t = 4095;
2163 pub const DEFFILEMODE: mode_t = 438;
2164 pub const S_BLKSIZE: usize = 512;
2165 pub const STATX_TYPE: c_uint = 1;
2166 pub const STATX_MODE: c_uint = 2;
2167 pub const STATX_NLINK: c_uint = 4;
2168 pub const STATX_UID: c_uint = 8;
2169 pub const STATX_GID: c_uint = 16;
2170 pub const STATX_ATIME: c_uint = 32;
2171 pub const STATX_MTIME: c_uint = 64;
2172 pub const STATX_CTIME: c_uint = 128;
2173 pub const STATX_INO: c_uint = 256;
2174 pub const STATX_SIZE: c_uint = 512;
2175 pub const STATX_BLOCKS: c_uint = 1024;
2176 pub const STATX_BASIC_STATS: c_uint = 2047;
2177 pub const STATX_ALL: c_uint = 4095;
2178 pub const STATX_BTIME: c_uint = 2048;
2179 pub const STATX_MNT_ID: c_uint = 4096;
2180 pub const STATX_DIOALIGN: c_uint = 8192;
2181 pub const STATX__RESERVED: c_uint = 2147483648;
2182 pub const STATX_ATTR_COMPRESSED: c_uint = 4;
2183 pub const STATX_ATTR_IMMUTABLE: c_uint = 16;
2184 pub const STATX_ATTR_APPEND: c_uint = 32;
2185 pub const STATX_ATTR_NODUMP: c_uint = 64;
2186 pub const STATX_ATTR_ENCRYPTED: c_uint = 2048;
2187 pub const STATX_ATTR_AUTOMOUNT: c_uint = 4096;
2188 pub const STATX_ATTR_MOUNT_ROOT: c_uint = 8192;
2189 pub const STATX_ATTR_VERITY: c_uint = 1048576;
2190 pub const STATX_ATTR_DAX: c_uint = 2097152;
2191 
2192 // sys/ioctl.h
2193 pub const TIOCM_LE: c_int = 1;
2194 pub const TIOCM_DTR: c_int = 2;
2195 pub const TIOCM_RTS: c_int = 4;
2196 pub const TIOCM_ST: c_int = 8;
2197 pub const TIOCM_SR: c_int = 16;
2198 pub const TIOCM_CTS: c_int = 32;
2199 pub const TIOCM_CAR: c_int = 64;
2200 pub const TIOCM_CD: c_int = 64;
2201 pub const TIOCM_RNG: c_int = 128;
2202 pub const TIOCM_RI: c_int = 128;
2203 pub const TIOCM_DSR: c_int = 256;
2204 pub const TIOCPKT_DATA: c_int = 0;
2205 pub const TIOCPKT_FLUSHREAD: c_int = 1;
2206 pub const TIOCPKT_FLUSHWRITE: c_int = 2;
2207 pub const TIOCPKT_STOP: c_int = 4;
2208 pub const TIOCPKT_START: c_int = 8;
2209 pub const TIOCPKT_NOSTOP: c_int = 16;
2210 pub const TIOCPKT_DOSTOP: c_int = 32;
2211 pub const TIOCPKT_IOCTL: c_int = 64;
2212 pub const TTYDISC: c_int = 0;
2213 pub const TABLDISC: c_int = 3;
2214 pub const SLIPDISC: c_int = 4;
2215 pub const TANDEM: crate::tcflag_t = 1;
2216 pub const CBREAK: crate::tcflag_t = 2;
2217 pub const LCASE: crate::tcflag_t = 4;
2218 pub const CRMOD: crate::tcflag_t = 16;
2219 pub const RAW: crate::tcflag_t = 32;
2220 pub const ODDP: crate::tcflag_t = 64;
2221 pub const EVENP: crate::tcflag_t = 128;
2222 pub const ANYP: crate::tcflag_t = 192;
2223 pub const NLDELAY: crate::tcflag_t = 768;
2224 pub const NL2: crate::tcflag_t = 512;
2225 pub const NL3: crate::tcflag_t = 768;
2226 pub const TBDELAY: crate::tcflag_t = 3072;
2227 pub const XTABS: crate::tcflag_t = 3072;
2228 pub const CRDELAY: crate::tcflag_t = 12288;
2229 pub const VTDELAY: crate::tcflag_t = 16384;
2230 pub const BSDELAY: crate::tcflag_t = 32768;
2231 pub const ALLDELAY: crate::tcflag_t = 65280;
2232 pub const CRTBS: crate::tcflag_t = 65536;
2233 pub const PRTERA: crate::tcflag_t = 131072;
2234 pub const CRTERA: crate::tcflag_t = 262144;
2235 pub const TILDE: crate::tcflag_t = 524288;
2236 pub const LITOUT: crate::tcflag_t = 2097152;
2237 pub const NOHANG: crate::tcflag_t = 16777216;
2238 pub const L001000: crate::tcflag_t = 33554432;
2239 pub const CRTKIL: crate::tcflag_t = 67108864;
2240 pub const PASS8: crate::tcflag_t = 134217728;
2241 pub const CTLECH: crate::tcflag_t = 268435456;
2242 pub const DECCTQ: crate::tcflag_t = 1073741824;
2243 
2244 pub const FIONBIO: c_ulong = 0xa008007e;
2245 pub const FIONREAD: c_ulong = 0x6008007f;
2246 pub const TIOCSWINSZ: c_ulong = 0x90200767;
2247 pub const TIOCGWINSZ: c_ulong = 0x50200768;
2248 pub const TIOCEXCL: c_ulong = 0x70d;
2249 pub const TIOCNXCL: c_ulong = 0x70e;
2250 pub const TIOCSCTTY: c_ulong = 0x761;
2251 
2252 pub const FIOCLEX: c_ulong = 1;
2253 
2254 // fcntl.h
2255 pub const O_EXEC: c_int = 4;
2256 pub const O_NORW: c_int = 0;
2257 pub const O_RDONLY: c_int = 1;
2258 pub const O_WRONLY: c_int = 2;
2259 pub const O_RDWR: c_int = 3;
2260 pub const O_ACCMODE: c_int = 3;
2261 pub const O_LARGEFILE: c_int = 0;
2262 pub const O_CREAT: c_int = 16;
2263 pub const O_EXCL: c_int = 32;
2264 pub const O_NOLINK: c_int = 64;
2265 pub const O_NOTRANS: c_int = 128;
2266 pub const O_NOFOLLOW: c_int = 1048576;
2267 pub const O_DIRECTORY: c_int = 2097152;
2268 pub const O_APPEND: c_int = 256;
2269 pub const O_ASYNC: c_int = 512;
2270 pub const O_FSYNC: c_int = 1024;
2271 pub const O_SYNC: c_int = 1024;
2272 pub const O_NOATIME: c_int = 2048;
2273 pub const O_SHLOCK: c_int = 131072;
2274 pub const O_EXLOCK: c_int = 262144;
2275 pub const O_DSYNC: c_int = 1024;
2276 pub const O_RSYNC: c_int = 1024;
2277 pub const O_NONBLOCK: c_int = 8;
2278 pub const O_NDELAY: c_int = 8;
2279 pub const O_HURD: c_int = 458751;
2280 pub const O_TRUNC: c_int = 65536;
2281 pub const O_CLOEXEC: c_int = 4194304;
2282 pub const O_IGNORE_CTTY: c_int = 524288;
2283 pub const O_TMPFILE: c_int = 8388608;
2284 pub const O_NOCTTY: c_int = 0;
2285 pub const FREAD: c_int = 1;
2286 pub const FWRITE: c_int = 2;
2287 pub const FASYNC: c_int = 512;
2288 pub const FCREAT: c_int = 16;
2289 pub const FEXCL: c_int = 32;
2290 pub const FTRUNC: c_int = 65536;
2291 pub const FNOCTTY: c_int = 0;
2292 pub const FFSYNC: c_int = 1024;
2293 pub const FSYNC: c_int = 1024;
2294 pub const FAPPEND: c_int = 256;
2295 pub const FNONBLOCK: c_int = 8;
2296 pub const FNDELAY: c_int = 8;
2297 pub const F_DUPFD: c_int = 0;
2298 pub const F_GETFD: c_int = 1;
2299 pub const F_SETFD: c_int = 2;
2300 pub const F_GETFL: c_int = 3;
2301 pub const F_SETFL: c_int = 4;
2302 pub const F_GETOWN: c_int = 5;
2303 pub const F_SETOWN: c_int = 6;
2304 pub const F_GETLK: c_int = 7;
2305 pub const F_SETLK: c_int = 8;
2306 pub const F_SETLKW: c_int = 9;
2307 pub const F_GETLK64: c_int = 10;
2308 pub const F_SETLK64: c_int = 11;
2309 pub const F_SETLKW64: c_int = 12;
2310 pub const F_DUPFD_CLOEXEC: c_int = 1030;
2311 pub const FD_CLOEXEC: c_int = 1;
2312 pub const F_RDLCK: c_int = 1;
2313 pub const F_WRLCK: c_int = 2;
2314 pub const F_UNLCK: c_int = 3;
2315 pub const POSIX_FADV_NORMAL: c_int = 0;
2316 pub const POSIX_FADV_RANDOM: c_int = 1;
2317 pub const POSIX_FADV_SEQUENTIAL: c_int = 2;
2318 pub const POSIX_FADV_WILLNEED: c_int = 3;
2319 pub const POSIX_FADV_DONTNEED: c_int = 4;
2320 pub const POSIX_FADV_NOREUSE: c_int = 5;
2321 pub const AT_FDCWD: c_int = -100;
2322 pub const AT_SYMLINK_NOFOLLOW: c_int = 256;
2323 pub const AT_REMOVEDIR: c_int = 512;
2324 pub const AT_SYMLINK_FOLLOW: c_int = 1024;
2325 pub const AT_NO_AUTOMOUNT: c_int = 2048;
2326 pub const AT_EMPTY_PATH: c_int = 4096;
2327 pub const AT_STATX_SYNC_TYPE: c_int = 24576;
2328 pub const AT_STATX_SYNC_AS_STAT: c_int = 0;
2329 pub const AT_STATX_FORCE_SYNC: c_int = 8192;
2330 pub const AT_STATX_DONT_SYNC: c_int = 16384;
2331 pub const AT_RECURSIVE: c_int = 32768;
2332 pub const AT_EACCESS: c_int = 512;
2333 
2334 // sys/uio.h
2335 pub const RWF_HIPRI: c_int = 1;
2336 pub const RWF_DSYNC: c_int = 2;
2337 pub const RWF_SYNC: c_int = 4;
2338 pub const RWF_NOWAIT: c_int = 8;
2339 pub const RWF_APPEND: c_int = 16;
2340 
2341 // errno.h
2342 pub const EPERM: c_int = 1073741825;
2343 pub const ENOENT: c_int = 1073741826;
2344 pub const ESRCH: c_int = 1073741827;
2345 pub const EINTR: c_int = 1073741828;
2346 pub const EIO: c_int = 1073741829;
2347 pub const ENXIO: c_int = 1073741830;
2348 pub const E2BIG: c_int = 1073741831;
2349 pub const ENOEXEC: c_int = 1073741832;
2350 pub const EBADF: c_int = 1073741833;
2351 pub const ECHILD: c_int = 1073741834;
2352 pub const EDEADLK: c_int = 1073741835;
2353 pub const ENOMEM: c_int = 1073741836;
2354 pub const EACCES: c_int = 1073741837;
2355 pub const EFAULT: c_int = 1073741838;
2356 pub const ENOTBLK: c_int = 1073741839;
2357 pub const EBUSY: c_int = 1073741840;
2358 pub const EEXIST: c_int = 1073741841;
2359 pub const EXDEV: c_int = 1073741842;
2360 pub const ENODEV: c_int = 1073741843;
2361 pub const ENOTDIR: c_int = 1073741844;
2362 pub const EISDIR: c_int = 1073741845;
2363 pub const EINVAL: c_int = 1073741846;
2364 pub const EMFILE: c_int = 1073741848;
2365 pub const ENFILE: c_int = 1073741847;
2366 pub const ENOTTY: c_int = 1073741849;
2367 pub const ETXTBSY: c_int = 1073741850;
2368 pub const EFBIG: c_int = 1073741851;
2369 pub const ENOSPC: c_int = 1073741852;
2370 pub const ESPIPE: c_int = 1073741853;
2371 pub const EROFS: c_int = 1073741854;
2372 pub const EMLINK: c_int = 1073741855;
2373 pub const EPIPE: c_int = 1073741856;
2374 pub const EDOM: c_int = 1073741857;
2375 pub const ERANGE: c_int = 1073741858;
2376 pub const EAGAIN: c_int = 1073741859;
2377 pub const EWOULDBLOCK: c_int = 1073741859;
2378 pub const EINPROGRESS: c_int = 1073741860;
2379 pub const EALREADY: c_int = 1073741861;
2380 pub const ENOTSOCK: c_int = 1073741862;
2381 pub const EMSGSIZE: c_int = 1073741864;
2382 pub const EPROTOTYPE: c_int = 1073741865;
2383 pub const ENOPROTOOPT: c_int = 1073741866;
2384 pub const EPROTONOSUPPORT: c_int = 1073741867;
2385 pub const ESOCKTNOSUPPORT: c_int = 1073741868;
2386 pub const EOPNOTSUPP: c_int = 1073741869;
2387 pub const EPFNOSUPPORT: c_int = 1073741870;
2388 pub const EAFNOSUPPORT: c_int = 1073741871;
2389 pub const EADDRINUSE: c_int = 1073741872;
2390 pub const EADDRNOTAVAIL: c_int = 1073741873;
2391 pub const ENETDOWN: c_int = 1073741874;
2392 pub const ENETUNREACH: c_int = 1073741875;
2393 pub const ENETRESET: c_int = 1073741876;
2394 pub const ECONNABORTED: c_int = 1073741877;
2395 pub const ECONNRESET: c_int = 1073741878;
2396 pub const ENOBUFS: c_int = 1073741879;
2397 pub const EISCONN: c_int = 1073741880;
2398 pub const ENOTCONN: c_int = 1073741881;
2399 pub const EDESTADDRREQ: c_int = 1073741863;
2400 pub const ESHUTDOWN: c_int = 1073741882;
2401 pub const ETOOMANYREFS: c_int = 1073741883;
2402 pub const ETIMEDOUT: c_int = 1073741884;
2403 pub const ECONNREFUSED: c_int = 1073741885;
2404 pub const ELOOP: c_int = 1073741886;
2405 pub const ENAMETOOLONG: c_int = 1073741887;
2406 pub const EHOSTDOWN: c_int = 1073741888;
2407 pub const EHOSTUNREACH: c_int = 1073741889;
2408 pub const ENOTEMPTY: c_int = 1073741890;
2409 pub const EPROCLIM: c_int = 1073741891;
2410 pub const EUSERS: c_int = 1073741892;
2411 pub const EDQUOT: c_int = 1073741893;
2412 pub const ESTALE: c_int = 1073741894;
2413 pub const EREMOTE: c_int = 1073741895;
2414 pub const EBADRPC: c_int = 1073741896;
2415 pub const ERPCMISMATCH: c_int = 1073741897;
2416 pub const EPROGUNAVAIL: c_int = 1073741898;
2417 pub const EPROGMISMATCH: c_int = 1073741899;
2418 pub const EPROCUNAVAIL: c_int = 1073741900;
2419 pub const ENOLCK: c_int = 1073741901;
2420 pub const EFTYPE: c_int = 1073741903;
2421 pub const EAUTH: c_int = 1073741904;
2422 pub const ENEEDAUTH: c_int = 1073741905;
2423 pub const ENOSYS: c_int = 1073741902;
2424 pub const ELIBEXEC: c_int = 1073741907;
2425 pub const ENOTSUP: c_int = 1073741942;
2426 pub const EILSEQ: c_int = 1073741930;
2427 pub const EBACKGROUND: c_int = 1073741924;
2428 pub const EDIED: c_int = 1073741925;
2429 pub const EGREGIOUS: c_int = 1073741927;
2430 pub const EIEIO: c_int = 1073741928;
2431 pub const EGRATUITOUS: c_int = 1073741929;
2432 pub const EBADMSG: c_int = 1073741931;
2433 pub const EIDRM: c_int = 1073741932;
2434 pub const EMULTIHOP: c_int = 1073741933;
2435 pub const ENODATA: c_int = 1073741934;
2436 pub const ENOLINK: c_int = 1073741935;
2437 pub const ENOMSG: c_int = 1073741936;
2438 pub const ENOSR: c_int = 1073741937;
2439 pub const ENOSTR: c_int = 1073741938;
2440 pub const EOVERFLOW: c_int = 1073741939;
2441 pub const EPROTO: c_int = 1073741940;
2442 pub const ETIME: c_int = 1073741941;
2443 pub const ECANCELED: c_int = 1073741943;
2444 pub const EOWNERDEAD: c_int = 1073741944;
2445 pub const ENOTRECOVERABLE: c_int = 1073741945;
2446 pub const EMACH_SEND_IN_PROGRESS: c_int = 268435457;
2447 pub const EMACH_SEND_INVALID_DATA: c_int = 268435458;
2448 pub const EMACH_SEND_INVALID_DEST: c_int = 268435459;
2449 pub const EMACH_SEND_TIMED_OUT: c_int = 268435460;
2450 pub const EMACH_SEND_WILL_NOTIFY: c_int = 268435461;
2451 pub const EMACH_SEND_NOTIFY_IN_PROGRESS: c_int = 268435462;
2452 pub const EMACH_SEND_INTERRUPTED: c_int = 268435463;
2453 pub const EMACH_SEND_MSG_TOO_SMALL: c_int = 268435464;
2454 pub const EMACH_SEND_INVALID_REPLY: c_int = 268435465;
2455 pub const EMACH_SEND_INVALID_RIGHT: c_int = 268435466;
2456 pub const EMACH_SEND_INVALID_NOTIFY: c_int = 268435467;
2457 pub const EMACH_SEND_INVALID_MEMORY: c_int = 268435468;
2458 pub const EMACH_SEND_NO_BUFFER: c_int = 268435469;
2459 pub const EMACH_SEND_NO_NOTIFY: c_int = 268435470;
2460 pub const EMACH_SEND_INVALID_TYPE: c_int = 268435471;
2461 pub const EMACH_SEND_INVALID_HEADER: c_int = 268435472;
2462 pub const EMACH_RCV_IN_PROGRESS: c_int = 268451841;
2463 pub const EMACH_RCV_INVALID_NAME: c_int = 268451842;
2464 pub const EMACH_RCV_TIMED_OUT: c_int = 268451843;
2465 pub const EMACH_RCV_TOO_LARGE: c_int = 268451844;
2466 pub const EMACH_RCV_INTERRUPTED: c_int = 268451845;
2467 pub const EMACH_RCV_PORT_CHANGED: c_int = 268451846;
2468 pub const EMACH_RCV_INVALID_NOTIFY: c_int = 268451847;
2469 pub const EMACH_RCV_INVALID_DATA: c_int = 268451848;
2470 pub const EMACH_RCV_PORT_DIED: c_int = 268451849;
2471 pub const EMACH_RCV_IN_SET: c_int = 268451850;
2472 pub const EMACH_RCV_HEADER_ERROR: c_int = 268451851;
2473 pub const EMACH_RCV_BODY_ERROR: c_int = 268451852;
2474 pub const EKERN_INVALID_ADDRESS: c_int = 1;
2475 pub const EKERN_PROTECTION_FAILURE: c_int = 2;
2476 pub const EKERN_NO_SPACE: c_int = 3;
2477 pub const EKERN_INVALID_ARGUMENT: c_int = 4;
2478 pub const EKERN_FAILURE: c_int = 5;
2479 pub const EKERN_RESOURCE_SHORTAGE: c_int = 6;
2480 pub const EKERN_NOT_RECEIVER: c_int = 7;
2481 pub const EKERN_NO_ACCESS: c_int = 8;
2482 pub const EKERN_MEMORY_FAILURE: c_int = 9;
2483 pub const EKERN_MEMORY_ERROR: c_int = 10;
2484 pub const EKERN_NOT_IN_SET: c_int = 12;
2485 pub const EKERN_NAME_EXISTS: c_int = 13;
2486 pub const EKERN_ABORTED: c_int = 14;
2487 pub const EKERN_INVALID_NAME: c_int = 15;
2488 pub const EKERN_INVALID_TASK: c_int = 16;
2489 pub const EKERN_INVALID_RIGHT: c_int = 17;
2490 pub const EKERN_INVALID_VALUE: c_int = 18;
2491 pub const EKERN_UREFS_OVERFLOW: c_int = 19;
2492 pub const EKERN_INVALID_CAPABILITY: c_int = 20;
2493 pub const EKERN_RIGHT_EXISTS: c_int = 21;
2494 pub const EKERN_INVALID_HOST: c_int = 22;
2495 pub const EKERN_MEMORY_PRESENT: c_int = 23;
2496 pub const EKERN_WRITE_PROTECTION_FAILURE: c_int = 24;
2497 pub const EKERN_TERMINATED: c_int = 26;
2498 pub const EKERN_TIMEDOUT: c_int = 27;
2499 pub const EKERN_INTERRUPTED: c_int = 28;
2500 pub const EMIG_TYPE_ERROR: c_int = -300;
2501 pub const EMIG_REPLY_MISMATCH: c_int = -301;
2502 pub const EMIG_REMOTE_ERROR: c_int = -302;
2503 pub const EMIG_BAD_ID: c_int = -303;
2504 pub const EMIG_BAD_ARGUMENTS: c_int = -304;
2505 pub const EMIG_NO_REPLY: c_int = -305;
2506 pub const EMIG_EXCEPTION: c_int = -306;
2507 pub const EMIG_ARRAY_TOO_LARGE: c_int = -307;
2508 pub const EMIG_SERVER_DIED: c_int = -308;
2509 pub const EMIG_DESTROY_REQUEST: c_int = -309;
2510 pub const ED_IO_ERROR: c_int = 2500;
2511 pub const ED_WOULD_BLOCK: c_int = 2501;
2512 pub const ED_NO_SUCH_DEVICE: c_int = 2502;
2513 pub const ED_ALREADY_OPEN: c_int = 2503;
2514 pub const ED_DEVICE_DOWN: c_int = 2504;
2515 pub const ED_INVALID_OPERATION: c_int = 2505;
2516 pub const ED_INVALID_RECNUM: c_int = 2506;
2517 pub const ED_INVALID_SIZE: c_int = 2507;
2518 pub const ED_NO_MEMORY: c_int = 2508;
2519 pub const ED_READ_ONLY: c_int = 2509;
2520 pub const _HURD_ERRNOS: usize = 122;
2521 
2522 // sched.h
2523 pub const SCHED_OTHER: c_int = 0;
2524 pub const SCHED_FIFO: c_int = 1;
2525 pub const SCHED_RR: c_int = 2;
2526 pub const _BITS_TYPES_STRUCT_SCHED_PARAM: usize = 1;
2527 pub const __CPU_SETSIZE: usize = 1024;
2528 pub const CPU_SETSIZE: usize = 1024;
2529 
2530 // pthread.h
2531 pub const PTHREAD_SPINLOCK_INITIALIZER: c_int = 0;
2532 pub const PTHREAD_CANCEL_DISABLE: c_int = 0;
2533 pub const PTHREAD_CANCEL_ENABLE: c_int = 1;
2534 pub const PTHREAD_CANCEL_DEFERRED: c_int = 0;
2535 pub const PTHREAD_CANCEL_ASYNCHRONOUS: c_int = 1;
2536 pub const PTHREAD_BARRIER_SERIAL_THREAD: c_int = -1;
2537 
2538 // netinet/tcp.h
2539 pub const TCP_NODELAY: c_int = 1;
2540 pub const TCP_MAXSEG: c_int = 2;
2541 pub const TCP_CORK: c_int = 3;
2542 pub const TCP_KEEPIDLE: c_int = 4;
2543 pub const TCP_KEEPINTVL: c_int = 5;
2544 pub const TCP_KEEPCNT: c_int = 6;
2545 pub const TCP_SYNCNT: c_int = 7;
2546 pub const TCP_LINGER2: c_int = 8;
2547 pub const TCP_DEFER_ACCEPT: c_int = 9;
2548 pub const TCP_WINDOW_CLAMP: c_int = 10;
2549 pub const TCP_INFO: c_int = 11;
2550 pub const TCP_QUICKACK: c_int = 12;
2551 pub const TCP_CONGESTION: c_int = 13;
2552 pub const TCP_MD5SIG: c_int = 14;
2553 pub const TCP_COOKIE_TRANSACTIONS: c_int = 15;
2554 pub const TCP_THIN_LINEAR_TIMEOUTS: c_int = 16;
2555 pub const TCP_THIN_DUPACK: c_int = 17;
2556 pub const TCP_USER_TIMEOUT: c_int = 18;
2557 pub const TCP_REPAIR: c_int = 19;
2558 pub const TCP_REPAIR_QUEUE: c_int = 20;
2559 pub const TCP_QUEUE_SEQ: c_int = 21;
2560 pub const TCP_REPAIR_OPTIONS: c_int = 22;
2561 pub const TCP_FASTOPEN: c_int = 23;
2562 pub const TCP_TIMESTAMP: c_int = 24;
2563 pub const TCP_NOTSENT_LOWAT: c_int = 25;
2564 pub const TCP_CC_INFO: c_int = 26;
2565 pub const TCP_SAVE_SYN: c_int = 27;
2566 pub const TCP_SAVED_SYN: c_int = 28;
2567 pub const TCP_REPAIR_WINDOW: c_int = 29;
2568 pub const TCP_FASTOPEN_CONNECT: c_int = 30;
2569 pub const TCP_ULP: c_int = 31;
2570 pub const TCP_MD5SIG_EXT: c_int = 32;
2571 pub const TCP_FASTOPEN_KEY: c_int = 33;
2572 pub const TCP_FASTOPEN_NO_COOKIE: c_int = 34;
2573 pub const TCP_ZEROCOPY_RECEIVE: c_int = 35;
2574 pub const TCP_INQ: c_int = 36;
2575 pub const TCP_CM_INQ: c_int = 36;
2576 pub const TCP_TX_DELAY: c_int = 37;
2577 pub const TCP_REPAIR_ON: c_int = 1;
2578 pub const TCP_REPAIR_OFF: c_int = 0;
2579 pub const TCP_REPAIR_OFF_NO_WP: c_int = -1;
2580 
2581 // stdint.h
2582 pub const INT8_MIN: i8 = -128;
2583 pub const INT16_MIN: i16 = -32768;
2584 pub const INT32_MIN: i32 = -2147483648;
2585 pub const INT8_MAX: i8 = 127;
2586 pub const INT16_MAX: i16 = 32767;
2587 pub const INT32_MAX: i32 = 2147483647;
2588 pub const UINT8_MAX: u8 = 255;
2589 pub const UINT16_MAX: u16 = 65535;
2590 pub const UINT32_MAX: u32 = 4294967295;
2591 pub const INT_LEAST8_MIN: int_least8_t = -128;
2592 pub const INT_LEAST16_MIN: int_least16_t = -32768;
2593 pub const INT_LEAST32_MIN: int_least32_t = -2147483648;
2594 pub const INT_LEAST8_MAX: int_least8_t = 127;
2595 pub const INT_LEAST16_MAX: int_least16_t = 32767;
2596 pub const INT_LEAST32_MAX: int_least32_t = 2147483647;
2597 pub const UINT_LEAST8_MAX: uint_least8_t = 255;
2598 pub const UINT_LEAST16_MAX: uint_least16_t = 65535;
2599 pub const UINT_LEAST32_MAX: uint_least32_t = 4294967295;
2600 pub const INT_FAST8_MIN: int_fast8_t = -128;
2601 pub const INT_FAST16_MIN: int_fast16_t = -2147483648;
2602 pub const INT_FAST32_MIN: int_fast32_t = -2147483648;
2603 pub const INT_FAST8_MAX: int_fast8_t = 127;
2604 pub const INT_FAST16_MAX: int_fast16_t = 2147483647;
2605 pub const INT_FAST32_MAX: int_fast32_t = 2147483647;
2606 pub const UINT_FAST8_MAX: uint_fast8_t = 255;
2607 pub const UINT_FAST16_MAX: uint_fast16_t = 4294967295;
2608 pub const UINT_FAST32_MAX: uint_fast32_t = 4294967295;
2609 pub const INTPTR_MIN: __intptr_t = -2147483648;
2610 pub const INTPTR_MAX: __intptr_t = 2147483647;
2611 pub const UINTPTR_MAX: usize = 4294967295;
2612 pub const PTRDIFF_MIN: __ptrdiff_t = -2147483648;
2613 pub const PTRDIFF_MAX: __ptrdiff_t = 2147483647;
2614 pub const SIG_ATOMIC_MIN: __sig_atomic_t = -2147483648;
2615 pub const SIG_ATOMIC_MAX: __sig_atomic_t = 2147483647;
2616 pub const SIZE_MAX: usize = 4294967295;
2617 pub const WINT_MIN: wint_t = 0;
2618 pub const WINT_MAX: wint_t = 4294967295;
2619 pub const INT8_WIDTH: usize = 8;
2620 pub const UINT8_WIDTH: usize = 8;
2621 pub const INT16_WIDTH: usize = 16;
2622 pub const UINT16_WIDTH: usize = 16;
2623 pub const INT32_WIDTH: usize = 32;
2624 pub const UINT32_WIDTH: usize = 32;
2625 pub const INT64_WIDTH: usize = 64;
2626 pub const UINT64_WIDTH: usize = 64;
2627 pub const INT_LEAST8_WIDTH: usize = 8;
2628 pub const UINT_LEAST8_WIDTH: usize = 8;
2629 pub const INT_LEAST16_WIDTH: usize = 16;
2630 pub const UINT_LEAST16_WIDTH: usize = 16;
2631 pub const INT_LEAST32_WIDTH: usize = 32;
2632 pub const UINT_LEAST32_WIDTH: usize = 32;
2633 pub const INT_LEAST64_WIDTH: usize = 64;
2634 pub const UINT_LEAST64_WIDTH: usize = 64;
2635 pub const INT_FAST8_WIDTH: usize = 8;
2636 pub const UINT_FAST8_WIDTH: usize = 8;
2637 pub const INT_FAST16_WIDTH: usize = 32;
2638 pub const UINT_FAST16_WIDTH: usize = 32;
2639 pub const INT_FAST32_WIDTH: usize = 32;
2640 pub const UINT_FAST32_WIDTH: usize = 32;
2641 pub const INT_FAST64_WIDTH: usize = 64;
2642 pub const UINT_FAST64_WIDTH: usize = 64;
2643 pub const INTPTR_WIDTH: usize = 32;
2644 pub const UINTPTR_WIDTH: usize = 32;
2645 pub const INTMAX_WIDTH: usize = 64;
2646 pub const UINTMAX_WIDTH: usize = 64;
2647 pub const PTRDIFF_WIDTH: usize = 32;
2648 pub const SIG_ATOMIC_WIDTH: usize = 32;
2649 pub const SIZE_WIDTH: usize = 32;
2650 pub const WCHAR_WIDTH: usize = 32;
2651 pub const WINT_WIDTH: usize = 32;
2652 
2653 pub const TH_FIN: u8 = 1;
2654 pub const TH_SYN: u8 = 2;
2655 pub const TH_RST: u8 = 4;
2656 pub const TH_PUSH: u8 = 8;
2657 pub const TH_ACK: u8 = 16;
2658 pub const TH_URG: u8 = 32;
2659 pub const TCPOPT_EOL: u8 = 0;
2660 pub const TCPOPT_NOP: u8 = 1;
2661 pub const TCPOPT_MAXSEG: u8 = 2;
2662 pub const TCPOLEN_MAXSEG: u8 = 4;
2663 pub const TCPOPT_WINDOW: u8 = 3;
2664 pub const TCPOLEN_WINDOW: u8 = 3;
2665 pub const TCPOPT_SACK_PERMITTED: u8 = 4;
2666 pub const TCPOLEN_SACK_PERMITTED: u8 = 2;
2667 pub const TCPOPT_SACK: u8 = 5;
2668 pub const TCPOPT_TIMESTAMP: u8 = 8;
2669 pub const TCPOLEN_TIMESTAMP: u8 = 10;
2670 pub const TCPOLEN_TSTAMP_APPA: u8 = 12;
2671 pub const TCPOPT_TSTAMP_HDR: u32 = 16844810;
2672 pub const TCP_MSS: usize = 512;
2673 pub const TCP_MAXWIN: usize = 65535;
2674 pub const TCP_MAX_WINSHIFT: usize = 14;
2675 pub const TCPI_OPT_TIMESTAMPS: u8 = 1;
2676 pub const TCPI_OPT_SACK: u8 = 2;
2677 pub const TCPI_OPT_WSCALE: u8 = 4;
2678 pub const TCPI_OPT_ECN: u8 = 8;
2679 pub const TCPI_OPT_ECN_SEEN: u8 = 16;
2680 pub const TCPI_OPT_SYN_DATA: u8 = 32;
2681 pub const TCP_MD5SIG_MAXKEYLEN: usize = 80;
2682 pub const TCP_MD5SIG_FLAG_PREFIX: usize = 1;
2683 pub const TCP_COOKIE_MIN: usize = 8;
2684 pub const TCP_COOKIE_MAX: usize = 16;
2685 pub const TCP_COOKIE_PAIR_SIZE: usize = 32;
2686 pub const TCP_COOKIE_IN_ALWAYS: c_int = 1;
2687 pub const TCP_COOKIE_OUT_NEVER: c_int = 2;
2688 pub const TCP_S_DATA_IN: c_int = 4;
2689 pub const TCP_S_DATA_OUT: c_int = 8;
2690 pub const TCP_MSS_DEFAULT: usize = 536;
2691 pub const TCP_MSS_DESIRED: usize = 1220;
2692 
2693 // sys/wait.h
2694 pub const WCOREFLAG: c_int = 128;
2695 pub const WAIT_ANY: pid_t = -1;
2696 pub const WAIT_MYPGRP: pid_t = 0;
2697 
2698 // sys/file.h
2699 pub const LOCK_SH: c_int = 1;
2700 pub const LOCK_EX: c_int = 2;
2701 pub const LOCK_UN: c_int = 8;
2702 pub const LOCK_NB: c_int = 4;
2703 
2704 // sys/mman.h
2705 pub const PROT_NONE: c_int = 0;
2706 pub const PROT_READ: c_int = 4;
2707 pub const PROT_WRITE: c_int = 2;
2708 pub const PROT_EXEC: c_int = 1;
2709 pub const MAP_FILE: c_int = 1;
2710 pub const MAP_ANON: c_int = 2;
2711 pub const MAP_ANONYMOUS: c_int = MAP_ANON;
2712 pub const MAP_TYPE: c_int = 15;
2713 pub const MAP_COPY: c_int = 32;
2714 pub const MAP_SHARED: c_int = 16;
2715 pub const MAP_PRIVATE: c_int = 0;
2716 pub const MAP_FIXED: c_int = 256;
2717 pub const MAP_NOEXTEND: c_int = 512;
2718 pub const MAP_HASSEMAPHORE: c_int = 1024;
2719 pub const MAP_INHERIT: c_int = 2048;
2720 pub const MAP_32BIT: c_int = 4096;
2721 pub const MAP_EXCL: c_int = 16384;
2722 pub const MAP_FAILED: *mut c_void = !0 as *mut c_void;
2723 pub const MADV_NORMAL: c_int = 0;
2724 pub const MADV_RANDOM: c_int = 1;
2725 pub const MADV_SEQUENTIAL: c_int = 2;
2726 pub const MADV_WILLNEED: c_int = 3;
2727 pub const MADV_DONTNEED: c_int = 4;
2728 pub const POSIX_MADV_NORMAL: c_int = 0;
2729 pub const POSIX_MADV_RANDOM: c_int = 1;
2730 pub const POSIX_MADV_SEQUENTIAL: c_int = 2;
2731 pub const POSIX_MADV_WILLNEED: c_int = 3;
2732 pub const POSIX_MADV_WONTNEED: c_int = 4;
2733 
2734 pub const MS_ASYNC: c_int = 1;
2735 pub const MS_SYNC: c_int = 0;
2736 pub const MS_INVALIDATE: c_int = 2;
2737 pub const MREMAP_MAYMOVE: c_int = 1;
2738 pub const MREMAP_FIXED: c_int = 2;
2739 pub const MCL_CURRENT: c_int = 0x0001;
2740 pub const MCL_FUTURE: c_int = 0x0002;
2741 
2742 // sys/xattr.h
2743 pub const XATTR_CREATE: c_int = 0x1;
2744 pub const XATTR_REPLACE: c_int = 0x2;
2745 
2746 // spawn.h
2747 pub const POSIX_SPAWN_USEVFORK: c_int = 64;
2748 pub const POSIX_SPAWN_SETSID: c_int = 128;
2749 
2750 // sys/syslog.h
2751 pub const LOG_CRON: c_int = 9 << 3;
2752 pub const LOG_AUTHPRIV: c_int = 10 << 3;
2753 pub const LOG_FTP: c_int = 11 << 3;
2754 pub const LOG_PERROR: c_int = 0x20;
2755 
2756 // net/if.h
2757 pub const IFF_UP: c_int = 0x1;
2758 pub const IFF_BROADCAST: c_int = 0x2;
2759 pub const IFF_DEBUG: c_int = 0x4;
2760 pub const IFF_LOOPBACK: c_int = 0x8;
2761 pub const IFF_POINTOPOINT: c_int = 0x10;
2762 pub const IFF_NOTRAILERS: c_int = 0x20;
2763 pub const IFF_RUNNING: c_int = 0x40;
2764 pub const IFF_NOARP: c_int = 0x80;
2765 pub const IFF_PROMISC: c_int = 0x100;
2766 pub const IFF_ALLMULTI: c_int = 0x200;
2767 pub const IFF_MASTER: c_int = 0x400;
2768 pub const IFF_SLAVE: c_int = 0x800;
2769 pub const IFF_MULTICAST: c_int = 0x1000;
2770 pub const IFF_PORTSEL: c_int = 0x2000;
2771 pub const IFF_AUTOMEDIA: c_int = 0x4000;
2772 pub const IFF_DYNAMIC: c_int = 0x8000;
2773 
2774 // random.h
2775 pub const GRND_NONBLOCK: c_uint = 1;
2776 pub const GRND_RANDOM: c_uint = 2;
2777 pub const GRND_INSECURE: c_uint = 4;
2778 
2779 pub const _PC_LINK_MAX: c_int = 0;
2780 pub const _PC_MAX_CANON: c_int = 1;
2781 pub const _PC_MAX_INPUT: c_int = 2;
2782 pub const _PC_NAME_MAX: c_int = 3;
2783 pub const _PC_PATH_MAX: c_int = 4;
2784 pub const _PC_PIPE_BUF: c_int = 5;
2785 pub const _PC_CHOWN_RESTRICTED: c_int = 6;
2786 pub const _PC_NO_TRUNC: c_int = 7;
2787 pub const _PC_VDISABLE: c_int = 8;
2788 pub const _PC_SYNC_IO: c_int = 9;
2789 pub const _PC_ASYNC_IO: c_int = 10;
2790 pub const _PC_PRIO_IO: c_int = 11;
2791 pub const _PC_SOCK_MAXBUF: c_int = 12;
2792 pub const _PC_FILESIZEBITS: c_int = 13;
2793 pub const _PC_REC_INCR_XFER_SIZE: c_int = 14;
2794 pub const _PC_REC_MAX_XFER_SIZE: c_int = 15;
2795 pub const _PC_REC_MIN_XFER_SIZE: c_int = 16;
2796 pub const _PC_REC_XFER_ALIGN: c_int = 17;
2797 pub const _PC_ALLOC_SIZE_MIN: c_int = 18;
2798 pub const _PC_SYMLINK_MAX: c_int = 19;
2799 pub const _PC_2_SYMLINKS: c_int = 20;
2800 pub const _SC_ARG_MAX: c_int = 0;
2801 pub const _SC_CHILD_MAX: c_int = 1;
2802 pub const _SC_CLK_TCK: c_int = 2;
2803 pub const _SC_NGROUPS_MAX: c_int = 3;
2804 pub const _SC_OPEN_MAX: c_int = 4;
2805 pub const _SC_STREAM_MAX: c_int = 5;
2806 pub const _SC_TZNAME_MAX: c_int = 6;
2807 pub const _SC_JOB_CONTROL: c_int = 7;
2808 pub const _SC_SAVED_IDS: c_int = 8;
2809 pub const _SC_REALTIME_SIGNALS: c_int = 9;
2810 pub const _SC_PRIORITY_SCHEDULING: c_int = 10;
2811 pub const _SC_TIMERS: c_int = 11;
2812 pub const _SC_ASYNCHRONOUS_IO: c_int = 12;
2813 pub const _SC_PRIORITIZED_IO: c_int = 13;
2814 pub const _SC_SYNCHRONIZED_IO: c_int = 14;
2815 pub const _SC_FSYNC: c_int = 15;
2816 pub const _SC_MAPPED_FILES: c_int = 16;
2817 pub const _SC_MEMLOCK: c_int = 17;
2818 pub const _SC_MEMLOCK_RANGE: c_int = 18;
2819 pub const _SC_MEMORY_PROTECTION: c_int = 19;
2820 pub const _SC_MESSAGE_PASSING: c_int = 20;
2821 pub const _SC_SEMAPHORES: c_int = 21;
2822 pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 22;
2823 pub const _SC_AIO_LISTIO_MAX: c_int = 23;
2824 pub const _SC_AIO_MAX: c_int = 24;
2825 pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 25;
2826 pub const _SC_DELAYTIMER_MAX: c_int = 26;
2827 pub const _SC_MQ_OPEN_MAX: c_int = 27;
2828 pub const _SC_MQ_PRIO_MAX: c_int = 28;
2829 pub const _SC_VERSION: c_int = 29;
2830 pub const _SC_PAGESIZE: c_int = 30;
2831 pub const _SC_PAGE_SIZE: c_int = 30;
2832 pub const _SC_RTSIG_MAX: c_int = 31;
2833 pub const _SC_SEM_NSEMS_MAX: c_int = 32;
2834 pub const _SC_SEM_VALUE_MAX: c_int = 33;
2835 pub const _SC_SIGQUEUE_MAX: c_int = 34;
2836 pub const _SC_TIMER_MAX: c_int = 35;
2837 pub const _SC_BC_BASE_MAX: c_int = 36;
2838 pub const _SC_BC_DIM_MAX: c_int = 37;
2839 pub const _SC_BC_SCALE_MAX: c_int = 38;
2840 pub const _SC_BC_STRING_MAX: c_int = 39;
2841 pub const _SC_COLL_WEIGHTS_MAX: c_int = 40;
2842 pub const _SC_EQUIV_CLASS_MAX: c_int = 41;
2843 pub const _SC_EXPR_NEST_MAX: c_int = 42;
2844 pub const _SC_LINE_MAX: c_int = 43;
2845 pub const _SC_RE_DUP_MAX: c_int = 44;
2846 pub const _SC_CHARCLASS_NAME_MAX: c_int = 45;
2847 pub const _SC_2_VERSION: c_int = 46;
2848 pub const _SC_2_C_BIND: c_int = 47;
2849 pub const _SC_2_C_DEV: c_int = 48;
2850 pub const _SC_2_FORT_DEV: c_int = 49;
2851 pub const _SC_2_FORT_RUN: c_int = 50;
2852 pub const _SC_2_SW_DEV: c_int = 51;
2853 pub const _SC_2_LOCALEDEF: c_int = 52;
2854 pub const _SC_PII: c_int = 53;
2855 pub const _SC_PII_XTI: c_int = 54;
2856 pub const _SC_PII_SOCKET: c_int = 55;
2857 pub const _SC_PII_INTERNET: c_int = 56;
2858 pub const _SC_PII_OSI: c_int = 57;
2859 pub const _SC_POLL: c_int = 58;
2860 pub const _SC_SELECT: c_int = 59;
2861 pub const _SC_UIO_MAXIOV: c_int = 60;
2862 pub const _SC_IOV_MAX: c_int = 60;
2863 pub const _SC_PII_INTERNET_STREAM: c_int = 61;
2864 pub const _SC_PII_INTERNET_DGRAM: c_int = 62;
2865 pub const _SC_PII_OSI_COTS: c_int = 63;
2866 pub const _SC_PII_OSI_CLTS: c_int = 64;
2867 pub const _SC_PII_OSI_M: c_int = 65;
2868 pub const _SC_T_IOV_MAX: c_int = 66;
2869 pub const _SC_THREADS: c_int = 67;
2870 pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 68;
2871 pub const _SC_GETGR_R_SIZE_MAX: c_int = 69;
2872 pub const _SC_GETPW_R_SIZE_MAX: c_int = 70;
2873 pub const _SC_LOGIN_NAME_MAX: c_int = 71;
2874 pub const _SC_TTY_NAME_MAX: c_int = 72;
2875 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 73;
2876 pub const _SC_THREAD_KEYS_MAX: c_int = 74;
2877 pub const _SC_THREAD_STACK_MIN: c_int = 75;
2878 pub const _SC_THREAD_THREADS_MAX: c_int = 76;
2879 pub const _SC_THREAD_ATTR_STACKADDR: c_int = 77;
2880 pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 78;
2881 pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 79;
2882 pub const _SC_THREAD_PRIO_INHERIT: c_int = 80;
2883 pub const _SC_THREAD_PRIO_PROTECT: c_int = 81;
2884 pub const _SC_THREAD_PROCESS_SHARED: c_int = 82;
2885 pub const _SC_NPROCESSORS_CONF: c_int = 83;
2886 pub const _SC_NPROCESSORS_ONLN: c_int = 84;
2887 pub const _SC_PHYS_PAGES: c_int = 85;
2888 pub const _SC_AVPHYS_PAGES: c_int = 86;
2889 pub const _SC_ATEXIT_MAX: c_int = 87;
2890 pub const _SC_PASS_MAX: c_int = 88;
2891 pub const _SC_XOPEN_VERSION: c_int = 89;
2892 pub const _SC_XOPEN_XCU_VERSION: c_int = 90;
2893 pub const _SC_XOPEN_UNIX: c_int = 91;
2894 pub const _SC_XOPEN_CRYPT: c_int = 92;
2895 pub const _SC_XOPEN_ENH_I18N: c_int = 93;
2896 pub const _SC_XOPEN_SHM: c_int = 94;
2897 pub const _SC_2_CHAR_TERM: c_int = 95;
2898 pub const _SC_2_C_VERSION: c_int = 96;
2899 pub const _SC_2_UPE: c_int = 97;
2900 pub const _SC_XOPEN_XPG2: c_int = 98;
2901 pub const _SC_XOPEN_XPG3: c_int = 99;
2902 pub const _SC_XOPEN_XPG4: c_int = 100;
2903 pub const _SC_CHAR_BIT: c_int = 101;
2904 pub const _SC_CHAR_MAX: c_int = 102;
2905 pub const _SC_CHAR_MIN: c_int = 103;
2906 pub const _SC_INT_MAX: c_int = 104;
2907 pub const _SC_INT_MIN: c_int = 105;
2908 pub const _SC_LONG_BIT: c_int = 106;
2909 pub const _SC_WORD_BIT: c_int = 107;
2910 pub const _SC_MB_LEN_MAX: c_int = 108;
2911 pub const _SC_NZERO: c_int = 109;
2912 pub const _SC_SSIZE_MAX: c_int = 110;
2913 pub const _SC_SCHAR_MAX: c_int = 111;
2914 pub const _SC_SCHAR_MIN: c_int = 112;
2915 pub const _SC_SHRT_MAX: c_int = 113;
2916 pub const _SC_SHRT_MIN: c_int = 114;
2917 pub const _SC_UCHAR_MAX: c_int = 115;
2918 pub const _SC_UINT_MAX: c_int = 116;
2919 pub const _SC_ULONG_MAX: c_int = 117;
2920 pub const _SC_USHRT_MAX: c_int = 118;
2921 pub const _SC_NL_ARGMAX: c_int = 119;
2922 pub const _SC_NL_LANGMAX: c_int = 120;
2923 pub const _SC_NL_MSGMAX: c_int = 121;
2924 pub const _SC_NL_NMAX: c_int = 122;
2925 pub const _SC_NL_SETMAX: c_int = 123;
2926 pub const _SC_NL_TEXTMAX: c_int = 124;
2927 pub const _SC_XBS5_ILP32_OFF32: c_int = 125;
2928 pub const _SC_XBS5_ILP32_OFFBIG: c_int = 126;
2929 pub const _SC_XBS5_LP64_OFF64: c_int = 127;
2930 pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 128;
2931 pub const _SC_XOPEN_LEGACY: c_int = 129;
2932 pub const _SC_XOPEN_REALTIME: c_int = 130;
2933 pub const _SC_XOPEN_REALTIME_THREADS: c_int = 131;
2934 pub const _SC_ADVISORY_INFO: c_int = 132;
2935 pub const _SC_BARRIERS: c_int = 133;
2936 pub const _SC_BASE: c_int = 134;
2937 pub const _SC_C_LANG_SUPPORT: c_int = 135;
2938 pub const _SC_C_LANG_SUPPORT_R: c_int = 136;
2939 pub const _SC_CLOCK_SELECTION: c_int = 137;
2940 pub const _SC_CPUTIME: c_int = 138;
2941 pub const _SC_THREAD_CPUTIME: c_int = 139;
2942 pub const _SC_DEVICE_IO: c_int = 140;
2943 pub const _SC_DEVICE_SPECIFIC: c_int = 141;
2944 pub const _SC_DEVICE_SPECIFIC_R: c_int = 142;
2945 pub const _SC_FD_MGMT: c_int = 143;
2946 pub const _SC_FIFO: c_int = 144;
2947 pub const _SC_PIPE: c_int = 145;
2948 pub const _SC_FILE_ATTRIBUTES: c_int = 146;
2949 pub const _SC_FILE_LOCKING: c_int = 147;
2950 pub const _SC_FILE_SYSTEM: c_int = 148;
2951 pub const _SC_MONOTONIC_CLOCK: c_int = 149;
2952 pub const _SC_MULTI_PROCESS: c_int = 150;
2953 pub const _SC_SINGLE_PROCESS: c_int = 151;
2954 pub const _SC_NETWORKING: c_int = 152;
2955 pub const _SC_READER_WRITER_LOCKS: c_int = 153;
2956 pub const _SC_SPIN_LOCKS: c_int = 154;
2957 pub const _SC_REGEXP: c_int = 155;
2958 pub const _SC_REGEX_VERSION: c_int = 156;
2959 pub const _SC_SHELL: c_int = 157;
2960 pub const _SC_SIGNALS: c_int = 158;
2961 pub const _SC_SPAWN: c_int = 159;
2962 pub const _SC_SPORADIC_SERVER: c_int = 160;
2963 pub const _SC_THREAD_SPORADIC_SERVER: c_int = 161;
2964 pub const _SC_SYSTEM_DATABASE: c_int = 162;
2965 pub const _SC_SYSTEM_DATABASE_R: c_int = 163;
2966 pub const _SC_TIMEOUTS: c_int = 164;
2967 pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 165;
2968 pub const _SC_USER_GROUPS: c_int = 166;
2969 pub const _SC_USER_GROUPS_R: c_int = 167;
2970 pub const _SC_2_PBS: c_int = 168;
2971 pub const _SC_2_PBS_ACCOUNTING: c_int = 169;
2972 pub const _SC_2_PBS_LOCATE: c_int = 170;
2973 pub const _SC_2_PBS_MESSAGE: c_int = 171;
2974 pub const _SC_2_PBS_TRACK: c_int = 172;
2975 pub const _SC_SYMLOOP_MAX: c_int = 173;
2976 pub const _SC_STREAMS: c_int = 174;
2977 pub const _SC_2_PBS_CHECKPOINT: c_int = 175;
2978 pub const _SC_V6_ILP32_OFF32: c_int = 176;
2979 pub const _SC_V6_ILP32_OFFBIG: c_int = 177;
2980 pub const _SC_V6_LP64_OFF64: c_int = 178;
2981 pub const _SC_V6_LPBIG_OFFBIG: c_int = 179;
2982 pub const _SC_HOST_NAME_MAX: c_int = 180;
2983 pub const _SC_TRACE: c_int = 181;
2984 pub const _SC_TRACE_EVENT_FILTER: c_int = 182;
2985 pub const _SC_TRACE_INHERIT: c_int = 183;
2986 pub const _SC_TRACE_LOG: c_int = 184;
2987 pub const _SC_LEVEL1_ICACHE_SIZE: c_int = 185;
2988 pub const _SC_LEVEL1_ICACHE_ASSOC: c_int = 186;
2989 pub const _SC_LEVEL1_ICACHE_LINESIZE: c_int = 187;
2990 pub const _SC_LEVEL1_DCACHE_SIZE: c_int = 188;
2991 pub const _SC_LEVEL1_DCACHE_ASSOC: c_int = 189;
2992 pub const _SC_LEVEL1_DCACHE_LINESIZE: c_int = 190;
2993 pub const _SC_LEVEL2_CACHE_SIZE: c_int = 191;
2994 pub const _SC_LEVEL2_CACHE_ASSOC: c_int = 192;
2995 pub const _SC_LEVEL2_CACHE_LINESIZE: c_int = 193;
2996 pub const _SC_LEVEL3_CACHE_SIZE: c_int = 194;
2997 pub const _SC_LEVEL3_CACHE_ASSOC: c_int = 195;
2998 pub const _SC_LEVEL3_CACHE_LINESIZE: c_int = 196;
2999 pub const _SC_LEVEL4_CACHE_SIZE: c_int = 197;
3000 pub const _SC_LEVEL4_CACHE_ASSOC: c_int = 198;
3001 pub const _SC_LEVEL4_CACHE_LINESIZE: c_int = 199;
3002 pub const _SC_IPV6: c_int = 235;
3003 pub const _SC_RAW_SOCKETS: c_int = 236;
3004 pub const _SC_V7_ILP32_OFF32: c_int = 237;
3005 pub const _SC_V7_ILP32_OFFBIG: c_int = 238;
3006 pub const _SC_V7_LP64_OFF64: c_int = 239;
3007 pub const _SC_V7_LPBIG_OFFBIG: c_int = 240;
3008 pub const _SC_SS_REPL_MAX: c_int = 241;
3009 pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 242;
3010 pub const _SC_TRACE_NAME_MAX: c_int = 243;
3011 pub const _SC_TRACE_SYS_MAX: c_int = 244;
3012 pub const _SC_TRACE_USER_EVENT_MAX: c_int = 245;
3013 pub const _SC_XOPEN_STREAMS: c_int = 246;
3014 pub const _SC_THREAD_ROBUST_PRIO_INHERIT: c_int = 247;
3015 pub const _SC_THREAD_ROBUST_PRIO_PROTECT: c_int = 248;
3016 pub const _SC_MINSIGSTKSZ: c_int = 249;
3017 pub const _SC_SIGSTKSZ: c_int = 250;
3018 
3019 pub const _CS_PATH: c_int = 0;
3020 pub const _CS_V6_WIDTH_RESTRICTED_ENVS: c_int = 1;
3021 pub const _CS_GNU_LIBC_VERSION: c_int = 2;
3022 pub const _CS_GNU_LIBPTHREAD_VERSION: c_int = 3;
3023 pub const _CS_V5_WIDTH_RESTRICTED_ENVS: c_int = 4;
3024 pub const _CS_V7_WIDTH_RESTRICTED_ENVS: c_int = 5;
3025 pub const _CS_LFS_CFLAGS: c_int = 1000;
3026 pub const _CS_LFS_LDFLAGS: c_int = 1001;
3027 pub const _CS_LFS_LIBS: c_int = 1002;
3028 pub const _CS_LFS_LINTFLAGS: c_int = 1003;
3029 pub const _CS_LFS64_CFLAGS: c_int = 1004;
3030 pub const _CS_LFS64_LDFLAGS: c_int = 1005;
3031 pub const _CS_LFS64_LIBS: c_int = 1006;
3032 pub const _CS_LFS64_LINTFLAGS: c_int = 1007;
3033 pub const _CS_XBS5_ILP32_OFF32_CFLAGS: c_int = 1100;
3034 pub const _CS_XBS5_ILP32_OFF32_LDFLAGS: c_int = 1101;
3035 pub const _CS_XBS5_ILP32_OFF32_LIBS: c_int = 1102;
3036 pub const _CS_XBS5_ILP32_OFF32_LINTFLAGS: c_int = 1103;
3037 pub const _CS_XBS5_ILP32_OFFBIG_CFLAGS: c_int = 1104;
3038 pub const _CS_XBS5_ILP32_OFFBIG_LDFLAGS: c_int = 1105;
3039 pub const _CS_XBS5_ILP32_OFFBIG_LIBS: c_int = 1106;
3040 pub const _CS_XBS5_ILP32_OFFBIG_LINTFLAGS: c_int = 1107;
3041 pub const _CS_XBS5_LP64_OFF64_CFLAGS: c_int = 1108;
3042 pub const _CS_XBS5_LP64_OFF64_LDFLAGS: c_int = 1109;
3043 pub const _CS_XBS5_LP64_OFF64_LIBS: c_int = 1110;
3044 pub const _CS_XBS5_LP64_OFF64_LINTFLAGS: c_int = 1111;
3045 pub const _CS_XBS5_LPBIG_OFFBIG_CFLAGS: c_int = 1112;
3046 pub const _CS_XBS5_LPBIG_OFFBIG_LDFLAGS: c_int = 1113;
3047 pub const _CS_XBS5_LPBIG_OFFBIG_LIBS: c_int = 1114;
3048 pub const _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS: c_int = 1115;
3049 pub const _CS_POSIX_V6_ILP32_OFF32_CFLAGS: c_int = 1116;
3050 pub const _CS_POSIX_V6_ILP32_OFF32_LDFLAGS: c_int = 1117;
3051 pub const _CS_POSIX_V6_ILP32_OFF32_LIBS: c_int = 1118;
3052 pub const _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS: c_int = 1119;
3053 pub const _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS: c_int = 1120;
3054 pub const _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS: c_int = 1121;
3055 pub const _CS_POSIX_V6_ILP32_OFFBIG_LIBS: c_int = 1122;
3056 pub const _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS: c_int = 1123;
3057 pub const _CS_POSIX_V6_LP64_OFF64_CFLAGS: c_int = 1124;
3058 pub const _CS_POSIX_V6_LP64_OFF64_LDFLAGS: c_int = 1125;
3059 pub const _CS_POSIX_V6_LP64_OFF64_LIBS: c_int = 1126;
3060 pub const _CS_POSIX_V6_LP64_OFF64_LINTFLAGS: c_int = 1127;
3061 pub const _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS: c_int = 1128;
3062 pub const _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS: c_int = 1129;
3063 pub const _CS_POSIX_V6_LPBIG_OFFBIG_LIBS: c_int = 1130;
3064 pub const _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS: c_int = 1131;
3065 pub const _CS_POSIX_V7_ILP32_OFF32_CFLAGS: c_int = 1132;
3066 pub const _CS_POSIX_V7_ILP32_OFF32_LDFLAGS: c_int = 1133;
3067 pub const _CS_POSIX_V7_ILP32_OFF32_LIBS: c_int = 1134;
3068 pub const _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS: c_int = 1135;
3069 pub const _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS: c_int = 1136;
3070 pub const _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS: c_int = 1137;
3071 pub const _CS_POSIX_V7_ILP32_OFFBIG_LIBS: c_int = 1138;
3072 pub const _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS: c_int = 1139;
3073 pub const _CS_POSIX_V7_LP64_OFF64_CFLAGS: c_int = 1140;
3074 pub const _CS_POSIX_V7_LP64_OFF64_LDFLAGS: c_int = 1141;
3075 pub const _CS_POSIX_V7_LP64_OFF64_LIBS: c_int = 1142;
3076 pub const _CS_POSIX_V7_LP64_OFF64_LINTFLAGS: c_int = 1143;
3077 pub const _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS: c_int = 1144;
3078 pub const _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS: c_int = 1145;
3079 pub const _CS_POSIX_V7_LPBIG_OFFBIG_LIBS: c_int = 1146;
3080 pub const _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS: c_int = 1147;
3081 pub const _CS_V6_ENV: c_int = 1148;
3082 pub const _CS_V7_ENV: c_int = 1149;
3083 
3084 pub const PTHREAD_PROCESS_PRIVATE: __pthread_process_shared = 0;
3085 pub const PTHREAD_PROCESS_SHARED: __pthread_process_shared = 1;
3086 
3087 pub const PTHREAD_EXPLICIT_SCHED: __pthread_inheritsched = 0;
3088 pub const PTHREAD_INHERIT_SCHED: __pthread_inheritsched = 1;
3089 
3090 pub const PTHREAD_SCOPE_SYSTEM: __pthread_contentionscope = 0;
3091 pub const PTHREAD_SCOPE_PROCESS: __pthread_contentionscope = 1;
3092 
3093 pub const PTHREAD_CREATE_JOINABLE: __pthread_detachstate = 0;
3094 pub const PTHREAD_CREATE_DETACHED: __pthread_detachstate = 1;
3095 
3096 pub const PTHREAD_PRIO_NONE: __pthread_mutex_protocol = 0;
3097 pub const PTHREAD_PRIO_INHERIT: __pthread_mutex_protocol = 1;
3098 pub const PTHREAD_PRIO_PROTECT: __pthread_mutex_protocol = 2;
3099 
3100 pub const PTHREAD_MUTEX_TIMED: __pthread_mutex_type = 0;
3101 pub const PTHREAD_MUTEX_ERRORCHECK: __pthread_mutex_type = 1;
3102 pub const PTHREAD_MUTEX_RECURSIVE: __pthread_mutex_type = 2;
3103 
3104 pub const PTHREAD_MUTEX_STALLED: __pthread_mutex_robustness = 0;
3105 pub const PTHREAD_MUTEX_ROBUST: __pthread_mutex_robustness = 256;
3106 
3107 pub const RLIMIT_CPU: crate::__rlimit_resource_t = 0;
3108 pub const RLIMIT_FSIZE: crate::__rlimit_resource_t = 1;
3109 pub const RLIMIT_DATA: crate::__rlimit_resource_t = 2;
3110 pub const RLIMIT_STACK: crate::__rlimit_resource_t = 3;
3111 pub const RLIMIT_CORE: crate::__rlimit_resource_t = 4;
3112 pub const RLIMIT_RSS: crate::__rlimit_resource_t = 5;
3113 pub const RLIMIT_MEMLOCK: crate::__rlimit_resource_t = 6;
3114 pub const RLIMIT_NPROC: crate::__rlimit_resource_t = 7;
3115 pub const RLIMIT_OFILE: crate::__rlimit_resource_t = 8;
3116 pub const RLIMIT_NOFILE: crate::__rlimit_resource_t = 8;
3117 pub const RLIMIT_SBSIZE: crate::__rlimit_resource_t = 9;
3118 pub const RLIMIT_AS: crate::__rlimit_resource_t = 10;
3119 pub const RLIMIT_VMEM: crate::__rlimit_resource_t = 10;
3120 pub const RLIMIT_NLIMITS: crate::__rlimit_resource_t = 11;
3121 pub const RLIM_NLIMITS: crate::__rlimit_resource_t = 11;
3122 
3123 pub const RUSAGE_SELF: __rusage_who = 0;
3124 pub const RUSAGE_CHILDREN: __rusage_who = -1;
3125 
3126 pub const PRIO_PROCESS: __priority_which = 0;
3127 pub const PRIO_PGRP: __priority_which = 1;
3128 pub const PRIO_USER: __priority_which = 2;
3129 
3130 pub const __UT_LINESIZE: usize = 32;
3131 pub const __UT_NAMESIZE: usize = 32;
3132 pub const __UT_HOSTSIZE: usize = 256;
3133 
3134 pub const SOCK_STREAM: c_int = 1;
3135 pub const SOCK_DGRAM: c_int = 2;
3136 pub const SOCK_RAW: c_int = 3;
3137 pub const SOCK_RDM: c_int = 4;
3138 pub const SOCK_SEQPACKET: c_int = 5;
3139 pub const SOCK_CLOEXEC: c_int = 4194304;
3140 pub const SOCK_NONBLOCK: c_int = 2048;
3141 
3142 pub const MSG_OOB: c_int = 1;
3143 pub const MSG_PEEK: c_int = 2;
3144 pub const MSG_DONTROUTE: c_int = 4;
3145 pub const MSG_EOR: c_int = 8;
3146 pub const MSG_TRUNC: c_int = 16;
3147 pub const MSG_CTRUNC: c_int = 32;
3148 pub const MSG_WAITALL: c_int = 64;
3149 pub const MSG_DONTWAIT: c_int = 128;
3150 pub const MSG_NOSIGNAL: c_int = 1024;
3151 pub const MSG_CMSG_CLOEXEC: c_int = 0x40000000;
3152 
3153 pub const SCM_RIGHTS: c_int = 1;
3154 pub const SCM_TIMESTAMP: c_int = 2;
3155 pub const SCM_CREDS: c_int = 3;
3156 
3157 pub const SO_DEBUG: c_int = 1;
3158 pub const SO_ACCEPTCONN: c_int = 2;
3159 pub const SO_REUSEADDR: c_int = 4;
3160 pub const SO_KEEPALIVE: c_int = 8;
3161 pub const SO_DONTROUTE: c_int = 16;
3162 pub const SO_BROADCAST: c_int = 32;
3163 pub const SO_USELOOPBACK: c_int = 64;
3164 pub const SO_LINGER: c_int = 128;
3165 pub const SO_OOBINLINE: c_int = 256;
3166 pub const SO_REUSEPORT: c_int = 512;
3167 pub const SO_SNDBUF: c_int = 4097;
3168 pub const SO_RCVBUF: c_int = 4098;
3169 pub const SO_SNDLOWAT: c_int = 4099;
3170 pub const SO_RCVLOWAT: c_int = 4100;
3171 pub const SO_SNDTIMEO: c_int = 4101;
3172 pub const SO_RCVTIMEO: c_int = 4102;
3173 pub const SO_ERROR: c_int = 4103;
3174 pub const SO_STYLE: c_int = 4104;
3175 pub const SO_TYPE: c_int = 4104;
3176 
3177 pub const IPPROTO_IP: c_int = 0;
3178 pub const IPPROTO_ICMP: c_int = 1;
3179 pub const IPPROTO_IGMP: c_int = 2;
3180 pub const IPPROTO_IPIP: c_int = 4;
3181 pub const IPPROTO_TCP: c_int = 6;
3182 pub const IPPROTO_EGP: c_int = 8;
3183 pub const IPPROTO_PUP: c_int = 12;
3184 pub const IPPROTO_UDP: c_int = 17;
3185 pub const IPPROTO_IDP: c_int = 22;
3186 pub const IPPROTO_TP: c_int = 29;
3187 pub const IPPROTO_DCCP: c_int = 33;
3188 pub const IPPROTO_IPV6: c_int = 41;
3189 pub const IPPROTO_RSVP: c_int = 46;
3190 pub const IPPROTO_GRE: c_int = 47;
3191 pub const IPPROTO_ESP: c_int = 50;
3192 pub const IPPROTO_AH: c_int = 51;
3193 pub const IPPROTO_MTP: c_int = 92;
3194 pub const IPPROTO_BEETPH: c_int = 94;
3195 pub const IPPROTO_ENCAP: c_int = 98;
3196 pub const IPPROTO_PIM: c_int = 103;
3197 pub const IPPROTO_COMP: c_int = 108;
3198 pub const IPPROTO_L2TP: c_int = 115;
3199 pub const IPPROTO_SCTP: c_int = 132;
3200 pub const IPPROTO_UDPLITE: c_int = 136;
3201 pub const IPPROTO_MPLS: c_int = 137;
3202 pub const IPPROTO_ETHERNET: c_int = 143;
3203 pub const IPPROTO_RAW: c_int = 255;
3204 pub const IPPROTO_MPTCP: c_int = 262;
3205 pub const IPPROTO_MAX: c_int = 263;
3206 
3207 pub const IPPROTO_HOPOPTS: c_int = 0;
3208 pub const IPPROTO_ROUTING: c_int = 43;
3209 pub const IPPROTO_FRAGMENT: c_int = 44;
3210 pub const IPPROTO_ICMPV6: c_int = 58;
3211 pub const IPPROTO_NONE: c_int = 59;
3212 pub const IPPROTO_DSTOPTS: c_int = 60;
3213 pub const IPPROTO_MH: c_int = 135;
3214 
3215 pub const IPPORT_ECHO: in_port_t = 7;
3216 pub const IPPORT_DISCARD: in_port_t = 9;
3217 pub const IPPORT_SYSTAT: in_port_t = 11;
3218 pub const IPPORT_DAYTIME: in_port_t = 13;
3219 pub const IPPORT_NETSTAT: in_port_t = 15;
3220 pub const IPPORT_FTP: in_port_t = 21;
3221 pub const IPPORT_TELNET: in_port_t = 23;
3222 pub const IPPORT_SMTP: in_port_t = 25;
3223 pub const IPPORT_TIMESERVER: in_port_t = 37;
3224 pub const IPPORT_NAMESERVER: in_port_t = 42;
3225 pub const IPPORT_WHOIS: in_port_t = 43;
3226 pub const IPPORT_MTP: in_port_t = 57;
3227 pub const IPPORT_TFTP: in_port_t = 69;
3228 pub const IPPORT_RJE: in_port_t = 77;
3229 pub const IPPORT_FINGER: in_port_t = 79;
3230 pub const IPPORT_TTYLINK: in_port_t = 87;
3231 pub const IPPORT_SUPDUP: in_port_t = 95;
3232 pub const IPPORT_EXECSERVER: in_port_t = 512;
3233 pub const IPPORT_LOGINSERVER: in_port_t = 513;
3234 pub const IPPORT_CMDSERVER: in_port_t = 514;
3235 pub const IPPORT_EFSSERVER: in_port_t = 520;
3236 pub const IPPORT_BIFFUDP: in_port_t = 512;
3237 pub const IPPORT_WHOSERVER: in_port_t = 513;
3238 pub const IPPORT_ROUTESERVER: in_port_t = 520;
3239 pub const IPPORT_USERRESERVED: in_port_t = 5000;
3240 
3241 pub const DT_UNKNOWN: c_uchar = 0;
3242 pub const DT_FIFO: c_uchar = 1;
3243 pub const DT_CHR: c_uchar = 2;
3244 pub const DT_DIR: c_uchar = 4;
3245 pub const DT_BLK: c_uchar = 6;
3246 pub const DT_REG: c_uchar = 8;
3247 pub const DT_LNK: c_uchar = 10;
3248 pub const DT_SOCK: c_uchar = 12;
3249 pub const DT_WHT: c_uchar = 14;
3250 
3251 pub const ST_RDONLY: c_ulong = 1;
3252 pub const ST_NOSUID: c_ulong = 2;
3253 pub const ST_NOEXEC: c_ulong = 8;
3254 pub const ST_SYNCHRONOUS: c_ulong = 16;
3255 pub const ST_NOATIME: c_ulong = 32;
3256 pub const ST_RELATIME: c_ulong = 64;
3257 
3258 pub const RTLD_DI_LMID: c_int = 1;
3259 pub const RTLD_DI_LINKMAP: c_int = 2;
3260 pub const RTLD_DI_CONFIGADDR: c_int = 3;
3261 pub const RTLD_DI_SERINFO: c_int = 4;
3262 pub const RTLD_DI_SERINFOSIZE: c_int = 5;
3263 pub const RTLD_DI_ORIGIN: c_int = 6;
3264 pub const RTLD_DI_PROFILENAME: c_int = 7;
3265 pub const RTLD_DI_PROFILEOUT: c_int = 8;
3266 pub const RTLD_DI_TLS_MODID: c_int = 9;
3267 pub const RTLD_DI_TLS_DATA: c_int = 10;
3268 pub const RTLD_DI_PHDR: c_int = 11;
3269 pub const RTLD_DI_MAX: c_int = 11;
3270 
3271 pub const SI_ASYNCIO: c_int = -4;
3272 pub const SI_MESGQ: c_int = -3;
3273 pub const SI_TIMER: c_int = -2;
3274 pub const SI_QUEUE: c_int = -1;
3275 pub const SI_USER: c_int = 0;
3276 
3277 pub const ILL_ILLOPC: c_int = 1;
3278 pub const ILL_ILLOPN: c_int = 2;
3279 pub const ILL_ILLADR: c_int = 3;
3280 pub const ILL_ILLTRP: c_int = 4;
3281 pub const ILL_PRVOPC: c_int = 5;
3282 pub const ILL_PRVREG: c_int = 6;
3283 pub const ILL_COPROC: c_int = 7;
3284 pub const ILL_BADSTK: c_int = 8;
3285 
3286 pub const FPE_INTDIV: c_int = 1;
3287 pub const FPE_INTOVF: c_int = 2;
3288 pub const FPE_FLTDIV: c_int = 3;
3289 pub const FPE_FLTOVF: c_int = 4;
3290 pub const FPE_FLTUND: c_int = 5;
3291 pub const FPE_FLTRES: c_int = 6;
3292 pub const FPE_FLTINV: c_int = 7;
3293 pub const FPE_FLTSUB: c_int = 8;
3294 
3295 pub const SEGV_MAPERR: c_int = 1;
3296 pub const SEGV_ACCERR: c_int = 2;
3297 
3298 pub const BUS_ADRALN: c_int = 1;
3299 pub const BUS_ADRERR: c_int = 2;
3300 pub const BUS_OBJERR: c_int = 3;
3301 
3302 pub const TRAP_BRKPT: c_int = 1;
3303 pub const TRAP_TRACE: c_int = 2;
3304 
3305 pub const CLD_EXITED: c_int = 1;
3306 pub const CLD_KILLED: c_int = 2;
3307 pub const CLD_DUMPED: c_int = 3;
3308 pub const CLD_TRAPPED: c_int = 4;
3309 pub const CLD_STOPPED: c_int = 5;
3310 pub const CLD_CONTINUED: c_int = 6;
3311 
3312 pub const POLL_IN: c_int = 1;
3313 pub const POLL_OUT: c_int = 2;
3314 pub const POLL_MSG: c_int = 3;
3315 pub const POLL_ERR: c_int = 4;
3316 pub const POLL_PRI: c_int = 5;
3317 pub const POLL_HUP: c_int = 6;
3318 
3319 pub const SIGEV_SIGNAL: c_int = 0;
3320 pub const SIGEV_NONE: c_int = 1;
3321 pub const SIGEV_THREAD: c_int = 2;
3322 
3323 pub const REG_GS: c_uint = 0;
3324 pub const REG_FS: c_uint = 1;
3325 pub const REG_ES: c_uint = 2;
3326 pub const REG_DS: c_uint = 3;
3327 pub const REG_EDI: c_uint = 4;
3328 pub const REG_ESI: c_uint = 5;
3329 pub const REG_EBP: c_uint = 6;
3330 pub const REG_ESP: c_uint = 7;
3331 pub const REG_EBX: c_uint = 8;
3332 pub const REG_EDX: c_uint = 9;
3333 pub const REG_ECX: c_uint = 10;
3334 pub const REG_EAX: c_uint = 11;
3335 pub const REG_TRAPNO: c_uint = 12;
3336 pub const REG_ERR: c_uint = 13;
3337 pub const REG_EIP: c_uint = 14;
3338 pub const REG_CS: c_uint = 15;
3339 pub const REG_EFL: c_uint = 16;
3340 pub const REG_UESP: c_uint = 17;
3341 pub const REG_SS: c_uint = 18;
3342 
3343 pub const IOC_VOID: __ioctl_dir = 0;
3344 pub const IOC_OUT: __ioctl_dir = 1;
3345 pub const IOC_IN: __ioctl_dir = 2;
3346 pub const IOC_INOUT: __ioctl_dir = 3;
3347 
3348 pub const IOC_8: __ioctl_datum = 0;
3349 pub const IOC_16: __ioctl_datum = 1;
3350 pub const IOC_32: __ioctl_datum = 2;
3351 pub const IOC_64: __ioctl_datum = 3;
3352 
3353 pub const TCP_ESTABLISHED: c_uint = 1;
3354 pub const TCP_SYN_SENT: c_uint = 2;
3355 pub const TCP_SYN_RECV: c_uint = 3;
3356 pub const TCP_FIN_WAIT1: c_uint = 4;
3357 pub const TCP_FIN_WAIT2: c_uint = 5;
3358 pub const TCP_TIME_WAIT: c_uint = 6;
3359 pub const TCP_CLOSE: c_uint = 7;
3360 pub const TCP_CLOSE_WAIT: c_uint = 8;
3361 pub const TCP_LAST_ACK: c_uint = 9;
3362 pub const TCP_LISTEN: c_uint = 10;
3363 pub const TCP_CLOSING: c_uint = 11;
3364 
3365 pub const TCP_CA_Open: tcp_ca_state = 0;
3366 pub const TCP_CA_Disorder: tcp_ca_state = 1;
3367 pub const TCP_CA_CWR: tcp_ca_state = 2;
3368 pub const TCP_CA_Recovery: tcp_ca_state = 3;
3369 pub const TCP_CA_Loss: tcp_ca_state = 4;
3370 
3371 pub const TCP_NO_QUEUE: c_uint = 0;
3372 pub const TCP_RECV_QUEUE: c_uint = 1;
3373 pub const TCP_SEND_QUEUE: c_uint = 2;
3374 pub const TCP_QUEUES_NR: c_uint = 3;
3375 
3376 pub const P_ALL: idtype_t = 0;
3377 pub const P_PID: idtype_t = 1;
3378 pub const P_PGID: idtype_t = 2;
3379 
3380 pub const SS_ONSTACK: c_int = 1;
3381 pub const SS_DISABLE: c_int = 4;
3382 
3383 pub const SHUT_RD: c_int = 0;
3384 pub const SHUT_WR: c_int = 1;
3385 pub const SHUT_RDWR: c_int = 2;
3386 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
3387     __lock: 0,
3388     __owner_id: 0,
3389     __cnt: 0,
3390     __shpid: 0,
3391     __type: PTHREAD_MUTEX_TIMED as c_int,
3392     __flags: 0,
3393     __reserved1: 0,
3394     __reserved2: 0,
3395 };
3396 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
3397     __lock: __PTHREAD_SPIN_LOCK_INITIALIZER,
3398     __queue: 0i64 as *mut __pthread,
3399     __attr: 0i64 as *mut __pthread_condattr,
3400     __wrefs: 0,
3401     __data: 0i64 as *mut c_void,
3402 };
3403 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
3404     __held: __PTHREAD_SPIN_LOCK_INITIALIZER,
3405     __lock: __PTHREAD_SPIN_LOCK_INITIALIZER,
3406     __readers: 0,
3407     __readerqueue: 0i64 as *mut __pthread,
3408     __writerqueue: 0i64 as *mut __pthread,
3409     __attr: 0i64 as *mut __pthread_rwlockattr,
3410     __data: 0i64 as *mut c_void,
3411 };
3412 pub const PTHREAD_STACK_MIN: size_t = 0;
3413 
3414 // Non-public helper constants
3415 const _UTSNAME_LENGTH: usize = 1024;
3416 
3417 const_fn! {
3418     {const} fn CMSG_ALIGN(len: usize) -> usize {
3419         len + mem::size_of::<usize>() - 1 & !(mem::size_of::<usize>() - 1)
3420     }
3421 }
3422 
3423 // functions
3424 f! {
3425     pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
3426         if (*mhdr).msg_controllen as usize >= mem::size_of::<cmsghdr>() {
3427             (*mhdr).msg_control as *mut cmsghdr
3428         } else {
3429             core::ptr::null_mut::<cmsghdr>()
3430         }
3431     }
3432 
3433     pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar {
3434         (cmsg as *mut c_uchar).offset(CMSG_ALIGN(mem::size_of::<cmsghdr>()) as isize)
3435     }
3436 
3437     pub {const} fn CMSG_SPACE(length: c_uint) -> c_uint {
3438         (CMSG_ALIGN(length as usize) + CMSG_ALIGN(mem::size_of::<cmsghdr>())) as c_uint
3439     }
3440 
3441     pub {const} fn CMSG_LEN(length: c_uint) -> c_uint {
3442         CMSG_ALIGN(mem::size_of::<cmsghdr>()) as c_uint + length
3443     }
3444 
3445     pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr {
3446         if ((*cmsg).cmsg_len as usize) < mem::size_of::<cmsghdr>() {
3447             return core::ptr::null_mut::<cmsghdr>();
3448         }
3449         let next = (cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr;
3450         let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize;
3451         if (next.offset(1)) as usize > max
3452             || next as usize + CMSG_ALIGN((*next).cmsg_len as usize) > max
3453         {
3454             core::ptr::null_mut::<cmsghdr>()
3455         } else {
3456             next as *mut cmsghdr
3457         }
3458     }
3459 
3460     pub fn CPU_ALLOC_SIZE(count: c_int) -> size_t {
3461         let _dummy: cpu_set_t = mem::zeroed();
3462         let size_in_bits = 8 * mem::size_of_val(&_dummy.bits[0]);
3463         ((count as size_t + size_in_bits - 1) / 8) as size_t
3464     }
3465 
3466     pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
3467         for slot in cpuset.bits.iter_mut() {
3468             *slot = 0;
3469         }
3470     }
3471 
3472     pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
3473         let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
3474         let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
3475         cpuset.bits[idx] |= 1 << offset;
3476         ()
3477     }
3478 
3479     pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
3480         let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
3481         let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
3482         cpuset.bits[idx] &= !(1 << offset);
3483         ()
3484     }
3485 
3486     pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
3487         let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]);
3488         let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
3489         0 != (cpuset.bits[idx] & (1 << offset))
3490     }
3491 
3492     pub fn CPU_COUNT_S(size: usize, cpuset: &cpu_set_t) -> c_int {
3493         let mut s: u32 = 0;
3494         let size_of_mask = mem::size_of_val(&cpuset.bits[0]);
3495         for i in cpuset.bits[..(size / size_of_mask)].iter() {
3496             s += i.count_ones();
3497         }
3498         s as c_int
3499     }
3500 
3501     pub fn CPU_COUNT(cpuset: &cpu_set_t) -> c_int {
3502         CPU_COUNT_S(mem::size_of::<cpu_set_t>(), cpuset)
3503     }
3504 
3505     pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
3506         set1.bits == set2.bits
3507     }
3508 
3509     pub fn IPTOS_TOS(tos: u8) -> u8 {
3510         tos & IPTOS_TOS_MASK
3511     }
3512 
3513     pub fn IPTOS_PREC(tos: u8) -> u8 {
3514         tos & IPTOS_PREC_MASK
3515     }
3516 
3517     pub fn FD_CLR(fd: c_int, set: *mut fd_set) -> () {
3518         let fd = fd as usize;
3519         let size = mem::size_of_val(&(*set).fds_bits[0]) * 8;
3520         (*set).fds_bits[fd / size] &= !(1 << (fd % size));
3521         return;
3522     }
3523 
3524     pub fn FD_ISSET(fd: c_int, set: *const fd_set) -> bool {
3525         let fd = fd as usize;
3526         let size = mem::size_of_val(&(*set).fds_bits[0]) * 8;
3527         return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0;
3528     }
3529 
3530     pub fn FD_SET(fd: c_int, set: *mut fd_set) -> () {
3531         let fd = fd as usize;
3532         let size = mem::size_of_val(&(*set).fds_bits[0]) * 8;
3533         (*set).fds_bits[fd / size] |= 1 << (fd % size);
3534         return;
3535     }
3536 
3537     pub fn FD_ZERO(set: *mut fd_set) -> () {
3538         for slot in (*set).fds_bits.iter_mut() {
3539             *slot = 0;
3540         }
3541     }
3542 }
3543 
3544 extern "C" {
lutimes(file: *const c_char, times: *const crate::timeval) -> c_int3545     pub fn lutimes(file: *const c_char, times: *const crate::timeval) -> c_int;
3546 
futimes(fd: c_int, times: *const crate::timeval) -> c_int3547     pub fn futimes(fd: c_int, times: *const crate::timeval) -> c_int;
futimens(__fd: c_int, __times: *const crate::timespec) -> c_int3548     pub fn futimens(__fd: c_int, __times: *const crate::timespec) -> c_int;
3549 
utimensat( dirfd: c_int, path: *const c_char, times: *const crate::timespec, flag: c_int, ) -> c_int3550     pub fn utimensat(
3551         dirfd: c_int,
3552         path: *const c_char,
3553         times: *const crate::timespec,
3554         flag: c_int,
3555     ) -> c_int;
3556 
mkfifoat(__fd: c_int, __path: *const c_char, __mode: __mode_t) -> c_int3557     pub fn mkfifoat(__fd: c_int, __path: *const c_char, __mode: __mode_t) -> c_int;
3558 
mknodat(dirfd: c_int, pathname: *const c_char, mode: mode_t, dev: dev_t) -> c_int3559     pub fn mknodat(dirfd: c_int, pathname: *const c_char, mode: mode_t, dev: dev_t) -> c_int;
3560 
__libc_current_sigrtmin() -> c_int3561     pub fn __libc_current_sigrtmin() -> c_int;
3562 
__libc_current_sigrtmax() -> c_int3563     pub fn __libc_current_sigrtmax() -> c_int;
3564 
wait4( pid: crate::pid_t, status: *mut c_int, options: c_int, rusage: *mut crate::rusage, ) -> crate::pid_t3565     pub fn wait4(
3566         pid: crate::pid_t,
3567         status: *mut c_int,
3568         options: c_int,
3569         rusage: *mut crate::rusage,
3570     ) -> crate::pid_t;
3571 
waitid( idtype: idtype_t, id: id_t, infop: *mut crate::siginfo_t, options: c_int, ) -> c_int3572     pub fn waitid(
3573         idtype: idtype_t,
3574         id: id_t,
3575         infop: *mut crate::siginfo_t,
3576         options: c_int,
3577     ) -> c_int;
3578 
sigwait(__set: *const sigset_t, __sig: *mut c_int) -> c_int3579     pub fn sigwait(__set: *const sigset_t, __sig: *mut c_int) -> c_int;
3580 
sigsuspend(mask: *const crate::sigset_t) -> c_int3581     pub fn sigsuspend(mask: *const crate::sigset_t) -> c_int;
sigtimedwait( set: *const sigset_t, info: *mut siginfo_t, timeout: *const crate::timespec, ) -> c_int3582     pub fn sigtimedwait(
3583         set: *const sigset_t,
3584         info: *mut siginfo_t,
3585         timeout: *const crate::timespec,
3586     ) -> c_int;
sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> c_int3587     pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> c_int;
3588 
sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> c_int3589     pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> c_int;
3590 
ioctl(__fd: c_int, __request: c_ulong, ...) -> c_int3591     pub fn ioctl(__fd: c_int, __request: c_ulong, ...) -> c_int;
3592 
pipe2(fds: *mut c_int, flags: c_int) -> c_int3593     pub fn pipe2(fds: *mut c_int, flags: c_int) -> c_int;
3594 
dup3(oldfd: c_int, newfd: c_int, flags: c_int) -> c_int3595     pub fn dup3(oldfd: c_int, newfd: c_int, flags: c_int) -> c_int;
3596 
pread64(fd: c_int, buf: *mut c_void, count: size_t, offset: off64_t) -> ssize_t3597     pub fn pread64(fd: c_int, buf: *mut c_void, count: size_t, offset: off64_t) -> ssize_t;
pwrite64(fd: c_int, buf: *const c_void, count: size_t, offset: off64_t) -> ssize_t3598     pub fn pwrite64(fd: c_int, buf: *const c_void, count: size_t, offset: off64_t) -> ssize_t;
3599 
readv(__fd: c_int, __iovec: *const crate::iovec, __count: c_int) -> ssize_t3600     pub fn readv(__fd: c_int, __iovec: *const crate::iovec, __count: c_int) -> ssize_t;
writev(__fd: c_int, __iovec: *const crate::iovec, __count: c_int) -> ssize_t3601     pub fn writev(__fd: c_int, __iovec: *const crate::iovec, __count: c_int) -> ssize_t;
3602 
preadv( __fd: c_int, __iovec: *const crate::iovec, __count: c_int, __offset: __off_t, ) -> ssize_t3603     pub fn preadv(
3604         __fd: c_int,
3605         __iovec: *const crate::iovec,
3606         __count: c_int,
3607         __offset: __off_t,
3608     ) -> ssize_t;
pwritev( __fd: c_int, __iovec: *const crate::iovec, __count: c_int, __offset: __off_t, ) -> ssize_t3609     pub fn pwritev(
3610         __fd: c_int,
3611         __iovec: *const crate::iovec,
3612         __count: c_int,
3613         __offset: __off_t,
3614     ) -> ssize_t;
3615 
preadv64(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off64_t) -> ssize_t3616     pub fn preadv64(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off64_t)
3617         -> ssize_t;
pwritev64( fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off64_t, ) -> ssize_t3618     pub fn pwritev64(
3619         fd: c_int,
3620         iov: *const crate::iovec,
3621         iovcnt: c_int,
3622         offset: off64_t,
3623     ) -> ssize_t;
3624 
fread_unlocked( buf: *mut c_void, size: size_t, nobj: size_t, stream: *mut crate::FILE, ) -> size_t3625     pub fn fread_unlocked(
3626         buf: *mut c_void,
3627         size: size_t,
3628         nobj: size_t,
3629         stream: *mut crate::FILE,
3630     ) -> size_t;
3631 
aio_read(aiocbp: *mut aiocb) -> c_int3632     pub fn aio_read(aiocbp: *mut aiocb) -> c_int;
aio_write(aiocbp: *mut aiocb) -> c_int3633     pub fn aio_write(aiocbp: *mut aiocb) -> c_int;
aio_fsync(op: c_int, aiocbp: *mut aiocb) -> c_int3634     pub fn aio_fsync(op: c_int, aiocbp: *mut aiocb) -> c_int;
aio_error(aiocbp: *const aiocb) -> c_int3635     pub fn aio_error(aiocbp: *const aiocb) -> c_int;
aio_return(aiocbp: *mut aiocb) -> ssize_t3636     pub fn aio_return(aiocbp: *mut aiocb) -> ssize_t;
aio_suspend( aiocb_list: *const *const aiocb, nitems: c_int, timeout: *const crate::timespec, ) -> c_int3637     pub fn aio_suspend(
3638         aiocb_list: *const *const aiocb,
3639         nitems: c_int,
3640         timeout: *const crate::timespec,
3641     ) -> c_int;
aio_cancel(fd: c_int, aiocbp: *mut aiocb) -> c_int3642     pub fn aio_cancel(fd: c_int, aiocbp: *mut aiocb) -> c_int;
lio_listio( mode: c_int, aiocb_list: *const *mut aiocb, nitems: c_int, sevp: *mut crate::sigevent, ) -> c_int3643     pub fn lio_listio(
3644         mode: c_int,
3645         aiocb_list: *const *mut aiocb,
3646         nitems: c_int,
3647         sevp: *mut crate::sigevent,
3648     ) -> c_int;
3649 
mq_open(name: *const c_char, oflag: c_int, ...) -> crate::mqd_t3650     pub fn mq_open(name: *const c_char, oflag: c_int, ...) -> crate::mqd_t;
mq_close(mqd: crate::mqd_t) -> c_int3651     pub fn mq_close(mqd: crate::mqd_t) -> c_int;
mq_unlink(name: *const c_char) -> c_int3652     pub fn mq_unlink(name: *const c_char) -> c_int;
mq_receive( mqd: crate::mqd_t, msg_ptr: *mut c_char, msg_len: size_t, msg_prio: *mut c_uint, ) -> ssize_t3653     pub fn mq_receive(
3654         mqd: crate::mqd_t,
3655         msg_ptr: *mut c_char,
3656         msg_len: size_t,
3657         msg_prio: *mut c_uint,
3658     ) -> ssize_t;
mq_timedreceive( mqd: crate::mqd_t, msg_ptr: *mut c_char, msg_len: size_t, msg_prio: *mut c_uint, abs_timeout: *const crate::timespec, ) -> ssize_t3659     pub fn mq_timedreceive(
3660         mqd: crate::mqd_t,
3661         msg_ptr: *mut c_char,
3662         msg_len: size_t,
3663         msg_prio: *mut c_uint,
3664         abs_timeout: *const crate::timespec,
3665     ) -> ssize_t;
mq_send( mqd: crate::mqd_t, msg_ptr: *const c_char, msg_len: size_t, msg_prio: c_uint, ) -> c_int3666     pub fn mq_send(
3667         mqd: crate::mqd_t,
3668         msg_ptr: *const c_char,
3669         msg_len: size_t,
3670         msg_prio: c_uint,
3671     ) -> c_int;
mq_timedsend( mqd: crate::mqd_t, msg_ptr: *const c_char, msg_len: size_t, msg_prio: c_uint, abs_timeout: *const crate::timespec, ) -> c_int3672     pub fn mq_timedsend(
3673         mqd: crate::mqd_t,
3674         msg_ptr: *const c_char,
3675         msg_len: size_t,
3676         msg_prio: c_uint,
3677         abs_timeout: *const crate::timespec,
3678     ) -> c_int;
mq_getattr(mqd: crate::mqd_t, attr: *mut crate::mq_attr) -> c_int3679     pub fn mq_getattr(mqd: crate::mqd_t, attr: *mut crate::mq_attr) -> c_int;
mq_setattr( mqd: crate::mqd_t, newattr: *const crate::mq_attr, oldattr: *mut crate::mq_attr, ) -> c_int3680     pub fn mq_setattr(
3681         mqd: crate::mqd_t,
3682         newattr: *const crate::mq_attr,
3683         oldattr: *mut crate::mq_attr,
3684     ) -> c_int;
3685 
lseek64(__fd: c_int, __offset: __off64_t, __whence: c_int) -> __off64_t3686     pub fn lseek64(__fd: c_int, __offset: __off64_t, __whence: c_int) -> __off64_t;
3687 
lseek(__fd: c_int, __offset: __off_t, __whence: c_int) -> __off_t3688     pub fn lseek(__fd: c_int, __offset: __off_t, __whence: c_int) -> __off_t;
3689 
fgetpos64(stream: *mut crate::FILE, ptr: *mut fpos64_t) -> c_int3690     pub fn fgetpos64(stream: *mut crate::FILE, ptr: *mut fpos64_t) -> c_int;
fseeko64(stream: *mut crate::FILE, offset: off64_t, whence: c_int) -> c_int3691     pub fn fseeko64(stream: *mut crate::FILE, offset: off64_t, whence: c_int) -> c_int;
fsetpos64(stream: *mut crate::FILE, ptr: *const fpos64_t) -> c_int3692     pub fn fsetpos64(stream: *mut crate::FILE, ptr: *const fpos64_t) -> c_int;
ftello64(stream: *mut crate::FILE) -> off64_t3693     pub fn ftello64(stream: *mut crate::FILE) -> off64_t;
3694 
bind(__fd: c_int, __addr: *const sockaddr, __len: crate::socklen_t) -> c_int3695     pub fn bind(__fd: c_int, __addr: *const sockaddr, __len: crate::socklen_t) -> c_int;
3696 
accept4( fd: c_int, addr: *mut crate::sockaddr, len: *mut crate::socklen_t, flg: c_int, ) -> c_int3697     pub fn accept4(
3698         fd: c_int,
3699         addr: *mut crate::sockaddr,
3700         len: *mut crate::socklen_t,
3701         flg: c_int,
3702     ) -> c_int;
3703 
ppoll( fds: *mut crate::pollfd, nfds: nfds_t, timeout: *const crate::timespec, sigmask: *const sigset_t, ) -> c_int3704     pub fn ppoll(
3705         fds: *mut crate::pollfd,
3706         nfds: nfds_t,
3707         timeout: *const crate::timespec,
3708         sigmask: *const sigset_t,
3709     ) -> c_int;
3710 
recvmsg(__fd: c_int, __message: *mut msghdr, __flags: c_int) -> ssize_t3711     pub fn recvmsg(__fd: c_int, __message: *mut msghdr, __flags: c_int) -> ssize_t;
3712 
sendmsg(__fd: c_int, __message: *const msghdr, __flags: c_int) -> ssize_t3713     pub fn sendmsg(__fd: c_int, __message: *const msghdr, __flags: c_int) -> ssize_t;
3714 
recvfrom( socket: c_int, buf: *mut c_void, len: size_t, flags: c_int, addr: *mut crate::sockaddr, addrlen: *mut crate::socklen_t, ) -> ssize_t3715     pub fn recvfrom(
3716         socket: c_int,
3717         buf: *mut c_void,
3718         len: size_t,
3719         flags: c_int,
3720         addr: *mut crate::sockaddr,
3721         addrlen: *mut crate::socklen_t,
3722     ) -> ssize_t;
3723 
sendfile(out_fd: c_int, in_fd: c_int, offset: *mut off_t, count: size_t) -> ssize_t3724     pub fn sendfile(out_fd: c_int, in_fd: c_int, offset: *mut off_t, count: size_t) -> ssize_t;
sendfile64(out_fd: c_int, in_fd: c_int, offset: *mut off64_t, count: size_t) -> ssize_t3725     pub fn sendfile64(out_fd: c_int, in_fd: c_int, offset: *mut off64_t, count: size_t) -> ssize_t;
3726 
shutdown(__fd: c_int, __how: c_int) -> c_int3727     pub fn shutdown(__fd: c_int, __how: c_int) -> c_int;
3728 
sethostname(name: *const c_char, len: size_t) -> c_int3729     pub fn sethostname(name: *const c_char, len: size_t) -> c_int;
getdomainname(name: *mut c_char, len: size_t) -> c_int3730     pub fn getdomainname(name: *mut c_char, len: size_t) -> c_int;
setdomainname(name: *const c_char, len: size_t) -> c_int3731     pub fn setdomainname(name: *const c_char, len: size_t) -> c_int;
if_nameindex() -> *mut if_nameindex3732     pub fn if_nameindex() -> *mut if_nameindex;
if_freenameindex(ptr: *mut if_nameindex)3733     pub fn if_freenameindex(ptr: *mut if_nameindex);
3734 
getnameinfo( sa: *const crate::sockaddr, salen: crate::socklen_t, host: *mut c_char, hostlen: crate::socklen_t, serv: *mut c_char, servlen: crate::socklen_t, flags: c_int, ) -> c_int3735     pub fn getnameinfo(
3736         sa: *const crate::sockaddr,
3737         salen: crate::socklen_t,
3738         host: *mut c_char,
3739         hostlen: crate::socklen_t,
3740         serv: *mut c_char,
3741         servlen: crate::socklen_t,
3742         flags: c_int,
3743     ) -> c_int;
3744 
getifaddrs(ifap: *mut *mut crate::ifaddrs) -> c_int3745     pub fn getifaddrs(ifap: *mut *mut crate::ifaddrs) -> c_int;
freeifaddrs(ifa: *mut crate::ifaddrs)3746     pub fn freeifaddrs(ifa: *mut crate::ifaddrs);
3747 
uname(buf: *mut crate::utsname) -> c_int3748     pub fn uname(buf: *mut crate::utsname) -> c_int;
3749 
gethostid() -> c_long3750     pub fn gethostid() -> c_long;
sethostid(hostid: c_long) -> c_int3751     pub fn sethostid(hostid: c_long) -> c_int;
3752 
setpwent()3753     pub fn setpwent();
endpwent()3754     pub fn endpwent();
getpwent() -> *mut passwd3755     pub fn getpwent() -> *mut passwd;
setgrent()3756     pub fn setgrent();
endgrent()3757     pub fn endgrent();
getgrent() -> *mut crate::group3758     pub fn getgrent() -> *mut crate::group;
setspent()3759     pub fn setspent();
endspent()3760     pub fn endspent();
getspent() -> *mut spwd3761     pub fn getspent() -> *mut spwd;
3762 
getspnam(name: *const c_char) -> *mut spwd3763     pub fn getspnam(name: *const c_char) -> *mut spwd;
3764 
getpwent_r( pwd: *mut crate::passwd, buf: *mut c_char, buflen: size_t, result: *mut *mut crate::passwd, ) -> c_int3765     pub fn getpwent_r(
3766         pwd: *mut crate::passwd,
3767         buf: *mut c_char,
3768         buflen: size_t,
3769         result: *mut *mut crate::passwd,
3770     ) -> c_int;
getgrent_r( grp: *mut crate::group, buf: *mut c_char, buflen: size_t, result: *mut *mut crate::group, ) -> c_int3771     pub fn getgrent_r(
3772         grp: *mut crate::group,
3773         buf: *mut c_char,
3774         buflen: size_t,
3775         result: *mut *mut crate::group,
3776     ) -> c_int;
fgetpwent_r( stream: *mut crate::FILE, pwd: *mut crate::passwd, buf: *mut c_char, buflen: size_t, result: *mut *mut crate::passwd, ) -> c_int3777     pub fn fgetpwent_r(
3778         stream: *mut crate::FILE,
3779         pwd: *mut crate::passwd,
3780         buf: *mut c_char,
3781         buflen: size_t,
3782         result: *mut *mut crate::passwd,
3783     ) -> c_int;
fgetgrent_r( stream: *mut crate::FILE, grp: *mut crate::group, buf: *mut c_char, buflen: size_t, result: *mut *mut crate::group, ) -> c_int3784     pub fn fgetgrent_r(
3785         stream: *mut crate::FILE,
3786         grp: *mut crate::group,
3787         buf: *mut c_char,
3788         buflen: size_t,
3789         result: *mut *mut crate::group,
3790     ) -> c_int;
3791 
putpwent(p: *const crate::passwd, stream: *mut crate::FILE) -> c_int3792     pub fn putpwent(p: *const crate::passwd, stream: *mut crate::FILE) -> c_int;
putgrent(grp: *const crate::group, stream: *mut crate::FILE) -> c_int3793     pub fn putgrent(grp: *const crate::group, stream: *mut crate::FILE) -> c_int;
3794 
getpwnam_r( name: *const c_char, pwd: *mut passwd, buf: *mut c_char, buflen: size_t, result: *mut *mut passwd, ) -> c_int3795     pub fn getpwnam_r(
3796         name: *const c_char,
3797         pwd: *mut passwd,
3798         buf: *mut c_char,
3799         buflen: size_t,
3800         result: *mut *mut passwd,
3801     ) -> c_int;
3802 
getpwuid_r( uid: crate::uid_t, pwd: *mut passwd, buf: *mut c_char, buflen: size_t, result: *mut *mut passwd, ) -> c_int3803     pub fn getpwuid_r(
3804         uid: crate::uid_t,
3805         pwd: *mut passwd,
3806         buf: *mut c_char,
3807         buflen: size_t,
3808         result: *mut *mut passwd,
3809     ) -> c_int;
3810 
fgetspent_r( fp: *mut crate::FILE, spbuf: *mut crate::spwd, buf: *mut c_char, buflen: size_t, spbufp: *mut *mut crate::spwd, ) -> c_int3811     pub fn fgetspent_r(
3812         fp: *mut crate::FILE,
3813         spbuf: *mut crate::spwd,
3814         buf: *mut c_char,
3815         buflen: size_t,
3816         spbufp: *mut *mut crate::spwd,
3817     ) -> c_int;
sgetspent_r( s: *const c_char, spbuf: *mut crate::spwd, buf: *mut c_char, buflen: size_t, spbufp: *mut *mut crate::spwd, ) -> c_int3818     pub fn sgetspent_r(
3819         s: *const c_char,
3820         spbuf: *mut crate::spwd,
3821         buf: *mut c_char,
3822         buflen: size_t,
3823         spbufp: *mut *mut crate::spwd,
3824     ) -> c_int;
getspent_r( spbuf: *mut crate::spwd, buf: *mut c_char, buflen: size_t, spbufp: *mut *mut crate::spwd, ) -> c_int3825     pub fn getspent_r(
3826         spbuf: *mut crate::spwd,
3827         buf: *mut c_char,
3828         buflen: size_t,
3829         spbufp: *mut *mut crate::spwd,
3830     ) -> c_int;
3831 
getspnam_r( name: *const c_char, spbuf: *mut spwd, buf: *mut c_char, buflen: size_t, spbufp: *mut *mut spwd, ) -> c_int3832     pub fn getspnam_r(
3833         name: *const c_char,
3834         spbuf: *mut spwd,
3835         buf: *mut c_char,
3836         buflen: size_t,
3837         spbufp: *mut *mut spwd,
3838     ) -> c_int;
3839 
3840     // mntent.h
getmntent_r( stream: *mut crate::FILE, mntbuf: *mut crate::mntent, buf: *mut c_char, buflen: c_int, ) -> *mut crate::mntent3841     pub fn getmntent_r(
3842         stream: *mut crate::FILE,
3843         mntbuf: *mut crate::mntent,
3844         buf: *mut c_char,
3845         buflen: c_int,
3846     ) -> *mut crate::mntent;
3847 
utmpname(file: *const c_char) -> c_int3848     pub fn utmpname(file: *const c_char) -> c_int;
utmpxname(file: *const c_char) -> c_int3849     pub fn utmpxname(file: *const c_char) -> c_int;
getutxent() -> *mut utmpx3850     pub fn getutxent() -> *mut utmpx;
getutxid(ut: *const utmpx) -> *mut utmpx3851     pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
getutxline(ut: *const utmpx) -> *mut utmpx3852     pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
pututxline(ut: *const utmpx) -> *mut utmpx3853     pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
setutxent()3854     pub fn setutxent();
endutxent()3855     pub fn endutxent();
3856 
getresuid( ruid: *mut crate::uid_t, euid: *mut crate::uid_t, suid: *mut crate::uid_t, ) -> c_int3857     pub fn getresuid(
3858         ruid: *mut crate::uid_t,
3859         euid: *mut crate::uid_t,
3860         suid: *mut crate::uid_t,
3861     ) -> c_int;
getresgid( rgid: *mut crate::gid_t, egid: *mut crate::gid_t, sgid: *mut crate::gid_t, ) -> c_int3862     pub fn getresgid(
3863         rgid: *mut crate::gid_t,
3864         egid: *mut crate::gid_t,
3865         sgid: *mut crate::gid_t,
3866     ) -> c_int;
setresuid(ruid: crate::uid_t, euid: crate::uid_t, suid: crate::uid_t) -> c_int3867     pub fn setresuid(ruid: crate::uid_t, euid: crate::uid_t, suid: crate::uid_t) -> c_int;
setresgid(rgid: crate::gid_t, egid: crate::gid_t, sgid: crate::gid_t) -> c_int3868     pub fn setresgid(rgid: crate::gid_t, egid: crate::gid_t, sgid: crate::gid_t) -> c_int;
3869 
initgroups(user: *const c_char, group: crate::gid_t) -> c_int3870     pub fn initgroups(user: *const c_char, group: crate::gid_t) -> c_int;
3871 
getgrgid(gid: crate::gid_t) -> *mut crate::group3872     pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group;
getgrgid_r( gid: crate::gid_t, grp: *mut crate::group, buf: *mut c_char, buflen: size_t, result: *mut *mut crate::group, ) -> c_int3873     pub fn getgrgid_r(
3874         gid: crate::gid_t,
3875         grp: *mut crate::group,
3876         buf: *mut c_char,
3877         buflen: size_t,
3878         result: *mut *mut crate::group,
3879     ) -> c_int;
3880 
getgrnam(name: *const c_char) -> *mut crate::group3881     pub fn getgrnam(name: *const c_char) -> *mut crate::group;
getgrnam_r( name: *const c_char, grp: *mut crate::group, buf: *mut c_char, buflen: size_t, result: *mut *mut crate::group, ) -> c_int3882     pub fn getgrnam_r(
3883         name: *const c_char,
3884         grp: *mut crate::group,
3885         buf: *mut c_char,
3886         buflen: size_t,
3887         result: *mut *mut crate::group,
3888     ) -> c_int;
3889 
getgrouplist( user: *const c_char, group: crate::gid_t, groups: *mut crate::gid_t, ngroups: *mut c_int, ) -> c_int3890     pub fn getgrouplist(
3891         user: *const c_char,
3892         group: crate::gid_t,
3893         groups: *mut crate::gid_t,
3894         ngroups: *mut c_int,
3895     ) -> c_int;
3896 
setgroups(ngroups: size_t, ptr: *const crate::gid_t) -> c_int3897     pub fn setgroups(ngroups: size_t, ptr: *const crate::gid_t) -> c_int;
3898 
acct(filename: *const c_char) -> c_int3899     pub fn acct(filename: *const c_char) -> c_int;
3900 
setmntent(filename: *const c_char, ty: *const c_char) -> *mut crate::FILE3901     pub fn setmntent(filename: *const c_char, ty: *const c_char) -> *mut crate::FILE;
getmntent(stream: *mut crate::FILE) -> *mut crate::mntent3902     pub fn getmntent(stream: *mut crate::FILE) -> *mut crate::mntent;
addmntent(stream: *mut crate::FILE, mnt: *const crate::mntent) -> c_int3903     pub fn addmntent(stream: *mut crate::FILE, mnt: *const crate::mntent) -> c_int;
endmntent(streamp: *mut crate::FILE) -> c_int3904     pub fn endmntent(streamp: *mut crate::FILE) -> c_int;
hasmntopt(mnt: *const crate::mntent, opt: *const c_char) -> *mut c_char3905     pub fn hasmntopt(mnt: *const crate::mntent, opt: *const c_char) -> *mut c_char;
3906 
pthread_create( native: *mut crate::pthread_t, attr: *const crate::pthread_attr_t, f: extern "C" fn(*mut c_void) -> *mut c_void, value: *mut c_void, ) -> c_int3907     pub fn pthread_create(
3908         native: *mut crate::pthread_t,
3909         attr: *const crate::pthread_attr_t,
3910         f: extern "C" fn(*mut c_void) -> *mut c_void,
3911         value: *mut c_void,
3912     ) -> c_int;
pthread_kill(__threadid: crate::pthread_t, __signo: c_int) -> c_int3913     pub fn pthread_kill(__threadid: crate::pthread_t, __signo: c_int) -> c_int;
pthread_cancel(thread: crate::pthread_t) -> c_int3914     pub fn pthread_cancel(thread: crate::pthread_t) -> c_int;
__pthread_equal(__t1: __pthread_t, __t2: __pthread_t) -> c_int3915     pub fn __pthread_equal(__t1: __pthread_t, __t2: __pthread_t) -> c_int;
3916 
pthread_getattr_np(__thr: crate::pthread_t, __attr: *mut pthread_attr_t) -> c_int3917     pub fn pthread_getattr_np(__thr: crate::pthread_t, __attr: *mut pthread_attr_t) -> c_int;
3918 
pthread_attr_getguardsize( __attr: *const pthread_attr_t, __guardsize: *mut size_t, ) -> c_int3919     pub fn pthread_attr_getguardsize(
3920         __attr: *const pthread_attr_t,
3921         __guardsize: *mut size_t,
3922     ) -> c_int;
pthread_attr_setguardsize(attr: *mut crate::pthread_attr_t, guardsize: size_t) -> c_int3923     pub fn pthread_attr_setguardsize(attr: *mut crate::pthread_attr_t, guardsize: size_t) -> c_int;
3924 
pthread_attr_getstack( __attr: *const pthread_attr_t, __stackaddr: *mut *mut c_void, __stacksize: *mut size_t, ) -> c_int3925     pub fn pthread_attr_getstack(
3926         __attr: *const pthread_attr_t,
3927         __stackaddr: *mut *mut c_void,
3928         __stacksize: *mut size_t,
3929     ) -> c_int;
3930 
pthread_mutexattr_getpshared( attr: *const pthread_mutexattr_t, pshared: *mut c_int, ) -> c_int3931     pub fn pthread_mutexattr_getpshared(
3932         attr: *const pthread_mutexattr_t,
3933         pshared: *mut c_int,
3934     ) -> c_int;
pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, pshared: c_int) -> c_int3935     pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, pshared: c_int) -> c_int;
3936 
pthread_mutex_timedlock( lock: *mut pthread_mutex_t, abstime: *const crate::timespec, ) -> c_int3937     pub fn pthread_mutex_timedlock(
3938         lock: *mut pthread_mutex_t,
3939         abstime: *const crate::timespec,
3940     ) -> c_int;
3941 
pthread_rwlockattr_getpshared( attr: *const pthread_rwlockattr_t, val: *mut c_int, ) -> c_int3942     pub fn pthread_rwlockattr_getpshared(
3943         attr: *const pthread_rwlockattr_t,
3944         val: *mut c_int,
3945     ) -> c_int;
pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: c_int) -> c_int3946     pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: c_int) -> c_int;
3947 
pthread_condattr_getclock( attr: *const pthread_condattr_t, clock_id: *mut clockid_t, ) -> c_int3948     pub fn pthread_condattr_getclock(
3949         attr: *const pthread_condattr_t,
3950         clock_id: *mut clockid_t,
3951     ) -> c_int;
pthread_condattr_setclock( __attr: *mut pthread_condattr_t, __clock_id: __clockid_t, ) -> c_int3952     pub fn pthread_condattr_setclock(
3953         __attr: *mut pthread_condattr_t,
3954         __clock_id: __clockid_t,
3955     ) -> c_int;
pthread_condattr_getpshared( attr: *const pthread_condattr_t, pshared: *mut c_int, ) -> c_int3956     pub fn pthread_condattr_getpshared(
3957         attr: *const pthread_condattr_t,
3958         pshared: *mut c_int,
3959     ) -> c_int;
pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: c_int) -> c_int3960     pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: c_int) -> c_int;
3961 
pthread_once(control: *mut pthread_once_t, routine: extern "C" fn()) -> c_int3962     pub fn pthread_once(control: *mut pthread_once_t, routine: extern "C" fn()) -> c_int;
3963 
pthread_barrierattr_init(attr: *mut crate::pthread_barrierattr_t) -> c_int3964     pub fn pthread_barrierattr_init(attr: *mut crate::pthread_barrierattr_t) -> c_int;
pthread_barrierattr_destroy(attr: *mut crate::pthread_barrierattr_t) -> c_int3965     pub fn pthread_barrierattr_destroy(attr: *mut crate::pthread_barrierattr_t) -> c_int;
pthread_barrierattr_getpshared( attr: *const crate::pthread_barrierattr_t, shared: *mut c_int, ) -> c_int3966     pub fn pthread_barrierattr_getpshared(
3967         attr: *const crate::pthread_barrierattr_t,
3968         shared: *mut c_int,
3969     ) -> c_int;
pthread_barrierattr_setpshared( attr: *mut crate::pthread_barrierattr_t, shared: c_int, ) -> c_int3970     pub fn pthread_barrierattr_setpshared(
3971         attr: *mut crate::pthread_barrierattr_t,
3972         shared: c_int,
3973     ) -> c_int;
pthread_barrier_init( barrier: *mut pthread_barrier_t, attr: *const crate::pthread_barrierattr_t, count: c_uint, ) -> c_int3974     pub fn pthread_barrier_init(
3975         barrier: *mut pthread_barrier_t,
3976         attr: *const crate::pthread_barrierattr_t,
3977         count: c_uint,
3978     ) -> c_int;
pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> c_int3979     pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> c_int;
pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> c_int3980     pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> c_int;
pthread_spin_init(lock: *mut crate::pthread_spinlock_t, pshared: c_int) -> c_int3981     pub fn pthread_spin_init(lock: *mut crate::pthread_spinlock_t, pshared: c_int) -> c_int;
pthread_spin_destroy(lock: *mut crate::pthread_spinlock_t) -> c_int3982     pub fn pthread_spin_destroy(lock: *mut crate::pthread_spinlock_t) -> c_int;
pthread_spin_lock(lock: *mut crate::pthread_spinlock_t) -> c_int3983     pub fn pthread_spin_lock(lock: *mut crate::pthread_spinlock_t) -> c_int;
pthread_spin_trylock(lock: *mut crate::pthread_spinlock_t) -> c_int3984     pub fn pthread_spin_trylock(lock: *mut crate::pthread_spinlock_t) -> c_int;
pthread_spin_unlock(lock: *mut crate::pthread_spinlock_t) -> c_int3985     pub fn pthread_spin_unlock(lock: *mut crate::pthread_spinlock_t) -> c_int;
pthread_atfork( prepare: Option<unsafe extern "C" fn()>, parent: Option<unsafe extern "C" fn()>, child: Option<unsafe extern "C" fn()>, ) -> c_int3986     pub fn pthread_atfork(
3987         prepare: Option<unsafe extern "C" fn()>,
3988         parent: Option<unsafe extern "C" fn()>,
3989         child: Option<unsafe extern "C" fn()>,
3990     ) -> c_int;
3991 
pthread_sigmask( __how: c_int, __newmask: *const __sigset_t, __oldmask: *mut __sigset_t, ) -> c_int3992     pub fn pthread_sigmask(
3993         __how: c_int,
3994         __newmask: *const __sigset_t,
3995         __oldmask: *mut __sigset_t,
3996     ) -> c_int;
3997 
sched_getparam(pid: crate::pid_t, param: *mut crate::sched_param) -> c_int3998     pub fn sched_getparam(pid: crate::pid_t, param: *mut crate::sched_param) -> c_int;
sched_setparam(pid: crate::pid_t, param: *const crate::sched_param) -> c_int3999     pub fn sched_setparam(pid: crate::pid_t, param: *const crate::sched_param) -> c_int;
sched_getscheduler(pid: crate::pid_t) -> c_int4000     pub fn sched_getscheduler(pid: crate::pid_t) -> c_int;
sched_setscheduler( pid: crate::pid_t, policy: c_int, param: *const crate::sched_param, ) -> c_int4001     pub fn sched_setscheduler(
4002         pid: crate::pid_t,
4003         policy: c_int,
4004         param: *const crate::sched_param,
4005     ) -> c_int;
pthread_getschedparam( native: crate::pthread_t, policy: *mut c_int, param: *mut crate::sched_param, ) -> c_int4006     pub fn pthread_getschedparam(
4007         native: crate::pthread_t,
4008         policy: *mut c_int,
4009         param: *mut crate::sched_param,
4010     ) -> c_int;
pthread_setschedparam( native: crate::pthread_t, policy: c_int, param: *const crate::sched_param, ) -> c_int4011     pub fn pthread_setschedparam(
4012         native: crate::pthread_t,
4013         policy: c_int,
4014         param: *const crate::sched_param,
4015     ) -> c_int;
4016 
pthread_getcpuclockid(thread: crate::pthread_t, clk_id: *mut crate::clockid_t) -> c_int4017     pub fn pthread_getcpuclockid(thread: crate::pthread_t, clk_id: *mut crate::clockid_t) -> c_int;
4018 
sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int4019     pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int;
sem_destroy(sem: *mut sem_t) -> c_int4020     pub fn sem_destroy(sem: *mut sem_t) -> c_int;
sem_timedwait(sem: *mut sem_t, abstime: *const crate::timespec) -> c_int4021     pub fn sem_timedwait(sem: *mut sem_t, abstime: *const crate::timespec) -> c_int;
sem_getvalue(sem: *mut sem_t, sval: *mut c_int) -> c_int4022     pub fn sem_getvalue(sem: *mut sem_t, sval: *mut c_int) -> c_int;
4023 
clock_getres(__clock_id: clockid_t, __res: *mut crate::timespec) -> c_int4024     pub fn clock_getres(__clock_id: clockid_t, __res: *mut crate::timespec) -> c_int;
clock_gettime(__clock_id: clockid_t, __tp: *mut crate::timespec) -> c_int4025     pub fn clock_gettime(__clock_id: clockid_t, __tp: *mut crate::timespec) -> c_int;
clock_settime(__clock_id: clockid_t, __tp: *const crate::timespec) -> c_int4026     pub fn clock_settime(__clock_id: clockid_t, __tp: *const crate::timespec) -> c_int;
clock_getcpuclockid(pid: crate::pid_t, clk_id: *mut crate::clockid_t) -> c_int4027     pub fn clock_getcpuclockid(pid: crate::pid_t, clk_id: *mut crate::clockid_t) -> c_int;
4028 
clock_nanosleep( clk_id: crate::clockid_t, flags: c_int, rqtp: *const crate::timespec, rmtp: *mut crate::timespec, ) -> c_int4029     pub fn clock_nanosleep(
4030         clk_id: crate::clockid_t,
4031         flags: c_int,
4032         rqtp: *const crate::timespec,
4033         rmtp: *mut crate::timespec,
4034     ) -> c_int;
4035 
gettimeofday(tp: *mut crate::timeval, tz: *mut crate::timezone) -> c_int4036     pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut crate::timezone) -> c_int;
settimeofday(tv: *const crate::timeval, tz: *const crate::timezone) -> c_int4037     pub fn settimeofday(tv: *const crate::timeval, tz: *const crate::timezone) -> c_int;
4038 
asctime_r(tm: *const crate::tm, buf: *mut c_char) -> *mut c_char4039     pub fn asctime_r(tm: *const crate::tm, buf: *mut c_char) -> *mut c_char;
ctime_r(timep: *const time_t, buf: *mut c_char) -> *mut c_char4040     pub fn ctime_r(timep: *const time_t, buf: *mut c_char) -> *mut c_char;
4041 
strftime( s: *mut c_char, max: size_t, format: *const c_char, tm: *const crate::tm, ) -> size_t4042     pub fn strftime(
4043         s: *mut c_char,
4044         max: size_t,
4045         format: *const c_char,
4046         tm: *const crate::tm,
4047     ) -> size_t;
strptime(s: *const c_char, format: *const c_char, tm: *mut crate::tm) -> *mut c_char4048     pub fn strptime(s: *const c_char, format: *const c_char, tm: *mut crate::tm) -> *mut c_char;
4049 
timer_create( clockid: crate::clockid_t, sevp: *mut crate::sigevent, timerid: *mut crate::timer_t, ) -> c_int4050     pub fn timer_create(
4051         clockid: crate::clockid_t,
4052         sevp: *mut crate::sigevent,
4053         timerid: *mut crate::timer_t,
4054     ) -> c_int;
timer_delete(timerid: crate::timer_t) -> c_int4055     pub fn timer_delete(timerid: crate::timer_t) -> c_int;
timer_getoverrun(timerid: crate::timer_t) -> c_int4056     pub fn timer_getoverrun(timerid: crate::timer_t) -> c_int;
timer_gettime(timerid: crate::timer_t, curr_value: *mut crate::itimerspec) -> c_int4057     pub fn timer_gettime(timerid: crate::timer_t, curr_value: *mut crate::itimerspec) -> c_int;
timer_settime( timerid: crate::timer_t, flags: c_int, new_value: *const crate::itimerspec, old_value: *mut crate::itimerspec, ) -> c_int4058     pub fn timer_settime(
4059         timerid: crate::timer_t,
4060         flags: c_int,
4061         new_value: *const crate::itimerspec,
4062         old_value: *mut crate::itimerspec,
4063     ) -> c_int;
4064 
fstat(__fd: c_int, __buf: *mut stat) -> c_int4065     pub fn fstat(__fd: c_int, __buf: *mut stat) -> c_int;
fstat64(__fd: c_int, __buf: *mut stat64) -> c_int4066     pub fn fstat64(__fd: c_int, __buf: *mut stat64) -> c_int;
4067 
fstatat(__fd: c_int, __file: *const c_char, __buf: *mut stat, __flag: c_int) -> c_int4068     pub fn fstatat(__fd: c_int, __file: *const c_char, __buf: *mut stat, __flag: c_int) -> c_int;
fstatat64( __fd: c_int, __file: *const c_char, __buf: *mut stat64, __flag: c_int, ) -> c_int4069     pub fn fstatat64(
4070         __fd: c_int,
4071         __file: *const c_char,
4072         __buf: *mut stat64,
4073         __flag: c_int,
4074     ) -> c_int;
4075 
statx( dirfd: c_int, pathname: *const c_char, flags: c_int, mask: c_uint, statxbuf: *mut statx, ) -> c_int4076     pub fn statx(
4077         dirfd: c_int,
4078         pathname: *const c_char,
4079         flags: c_int,
4080         mask: c_uint,
4081         statxbuf: *mut statx,
4082     ) -> c_int;
4083 
ftruncate(__fd: c_int, __length: __off_t) -> c_int4084     pub fn ftruncate(__fd: c_int, __length: __off_t) -> c_int;
ftruncate64(__fd: c_int, __length: __off64_t) -> c_int4085     pub fn ftruncate64(__fd: c_int, __length: __off64_t) -> c_int;
truncate64(__file: *const c_char, __length: __off64_t) -> c_int4086     pub fn truncate64(__file: *const c_char, __length: __off64_t) -> c_int;
4087 
lstat(__file: *const c_char, __buf: *mut stat) -> c_int4088     pub fn lstat(__file: *const c_char, __buf: *mut stat) -> c_int;
lstat64(__file: *const c_char, __buf: *mut stat64) -> c_int4089     pub fn lstat64(__file: *const c_char, __buf: *mut stat64) -> c_int;
4090 
statfs(path: *const c_char, buf: *mut statfs) -> c_int4091     pub fn statfs(path: *const c_char, buf: *mut statfs) -> c_int;
statfs64(__file: *const c_char, __buf: *mut statfs64) -> c_int4092     pub fn statfs64(__file: *const c_char, __buf: *mut statfs64) -> c_int;
fstatfs(fd: c_int, buf: *mut statfs) -> c_int4093     pub fn fstatfs(fd: c_int, buf: *mut statfs) -> c_int;
fstatfs64(__fildes: c_int, __buf: *mut statfs64) -> c_int4094     pub fn fstatfs64(__fildes: c_int, __buf: *mut statfs64) -> c_int;
4095 
statvfs(__file: *const c_char, __buf: *mut statvfs) -> c_int4096     pub fn statvfs(__file: *const c_char, __buf: *mut statvfs) -> c_int;
statvfs64(__file: *const c_char, __buf: *mut statvfs64) -> c_int4097     pub fn statvfs64(__file: *const c_char, __buf: *mut statvfs64) -> c_int;
fstatvfs(__fildes: c_int, __buf: *mut statvfs) -> c_int4098     pub fn fstatvfs(__fildes: c_int, __buf: *mut statvfs) -> c_int;
fstatvfs64(__fildes: c_int, __buf: *mut statvfs64) -> c_int4099     pub fn fstatvfs64(__fildes: c_int, __buf: *mut statvfs64) -> c_int;
4100 
open(__file: *const c_char, __oflag: c_int, ...) -> c_int4101     pub fn open(__file: *const c_char, __oflag: c_int, ...) -> c_int;
open64(__file: *const c_char, __oflag: c_int, ...) -> c_int4102     pub fn open64(__file: *const c_char, __oflag: c_int, ...) -> c_int;
4103 
openat(__fd: c_int, __file: *const c_char, __oflag: c_int, ...) -> c_int4104     pub fn openat(__fd: c_int, __file: *const c_char, __oflag: c_int, ...) -> c_int;
openat64(__fd: c_int, __file: *const c_char, __oflag: c_int, ...) -> c_int4105     pub fn openat64(__fd: c_int, __file: *const c_char, __oflag: c_int, ...) -> c_int;
4106 
fopen64(filename: *const c_char, mode: *const c_char) -> *mut crate::FILE4107     pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut crate::FILE;
freopen64( filename: *const c_char, mode: *const c_char, file: *mut crate::FILE, ) -> *mut crate::FILE4108     pub fn freopen64(
4109         filename: *const c_char,
4110         mode: *const c_char,
4111         file: *mut crate::FILE,
4112     ) -> *mut crate::FILE;
4113 
creat64(path: *const c_char, mode: mode_t) -> c_int4114     pub fn creat64(path: *const c_char, mode: mode_t) -> c_int;
4115 
mkostemp(template: *mut c_char, flags: c_int) -> c_int4116     pub fn mkostemp(template: *mut c_char, flags: c_int) -> c_int;
mkostemps(template: *mut c_char, suffixlen: c_int, flags: c_int) -> c_int4117     pub fn mkostemps(template: *mut c_char, suffixlen: c_int, flags: c_int) -> c_int;
mkstemps(template: *mut c_char, suffixlen: c_int) -> c_int4118     pub fn mkstemps(template: *mut c_char, suffixlen: c_int) -> c_int;
tmpfile64() -> *mut crate::FILE4119     pub fn tmpfile64() -> *mut crate::FILE;
4120 
popen(command: *const c_char, mode: *const c_char) -> *mut crate::FILE4121     pub fn popen(command: *const c_char, mode: *const c_char) -> *mut crate::FILE;
4122 
getdtablesize() -> c_int4123     pub fn getdtablesize() -> c_int;
4124 
4125     // Added in `glibc` 2.34
close_range(first: c_uint, last: c_uint, flags: c_int) -> c_int4126     pub fn close_range(first: c_uint, last: c_uint, flags: c_int) -> c_int;
4127 
openpty( __amaster: *mut c_int, __aslave: *mut c_int, __name: *mut c_char, __termp: *const termios, __winp: *const crate::winsize, ) -> c_int4128     pub fn openpty(
4129         __amaster: *mut c_int,
4130         __aslave: *mut c_int,
4131         __name: *mut c_char,
4132         __termp: *const termios,
4133         __winp: *const crate::winsize,
4134     ) -> c_int;
4135 
forkpty( __amaster: *mut c_int, __name: *mut c_char, __termp: *const termios, __winp: *const crate::winsize, ) -> crate::pid_t4136     pub fn forkpty(
4137         __amaster: *mut c_int,
4138         __name: *mut c_char,
4139         __termp: *const termios,
4140         __winp: *const crate::winsize,
4141     ) -> crate::pid_t;
4142 
getpt() -> c_int4143     pub fn getpt() -> c_int;
ptsname_r(fd: c_int, buf: *mut c_char, buflen: size_t) -> c_int4144     pub fn ptsname_r(fd: c_int, buf: *mut c_char, buflen: size_t) -> c_int;
login_tty(fd: c_int) -> c_int4145     pub fn login_tty(fd: c_int) -> c_int;
4146 
ctermid(s: *mut c_char) -> *mut c_char4147     pub fn ctermid(s: *mut c_char) -> *mut c_char;
4148 
clearenv() -> c_int4149     pub fn clearenv() -> c_int;
4150 
execveat( dirfd: c_int, pathname: *const c_char, argv: *const *mut c_char, envp: *const *mut c_char, flags: c_int, ) -> c_int4151     pub fn execveat(
4152         dirfd: c_int,
4153         pathname: *const c_char,
4154         argv: *const *mut c_char,
4155         envp: *const *mut c_char,
4156         flags: c_int,
4157     ) -> c_int;
4158 
4159     // DIFF(main): changed to `*const *mut` in e77f551de9
execvpe( file: *const c_char, argv: *const *const c_char, envp: *const *const c_char, ) -> c_int4160     pub fn execvpe(
4161         file: *const c_char,
4162         argv: *const *const c_char,
4163         envp: *const *const c_char,
4164     ) -> c_int;
fexecve(fd: c_int, argv: *const *const c_char, envp: *const *const c_char) -> c_int4165     pub fn fexecve(fd: c_int, argv: *const *const c_char, envp: *const *const c_char) -> c_int;
4166 
daemon(nochdir: c_int, noclose: c_int) -> c_int4167     pub fn daemon(nochdir: c_int, noclose: c_int) -> c_int;
4168 
4169     // posix/spawn.h
posix_spawn( pid: *mut crate::pid_t, path: *const c_char, file_actions: *const crate::posix_spawn_file_actions_t, attrp: *const crate::posix_spawnattr_t, argv: *const *mut c_char, envp: *const *mut c_char, ) -> c_int4170     pub fn posix_spawn(
4171         pid: *mut crate::pid_t,
4172         path: *const c_char,
4173         file_actions: *const crate::posix_spawn_file_actions_t,
4174         attrp: *const crate::posix_spawnattr_t,
4175         argv: *const *mut c_char,
4176         envp: *const *mut c_char,
4177     ) -> c_int;
posix_spawnp( pid: *mut crate::pid_t, file: *const c_char, file_actions: *const crate::posix_spawn_file_actions_t, attrp: *const crate::posix_spawnattr_t, argv: *const *mut c_char, envp: *const *mut c_char, ) -> c_int4178     pub fn posix_spawnp(
4179         pid: *mut crate::pid_t,
4180         file: *const c_char,
4181         file_actions: *const crate::posix_spawn_file_actions_t,
4182         attrp: *const crate::posix_spawnattr_t,
4183         argv: *const *mut c_char,
4184         envp: *const *mut c_char,
4185     ) -> c_int;
posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> c_int4186     pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> c_int;
posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> c_int4187     pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> c_int;
posix_spawnattr_getsigdefault( attr: *const posix_spawnattr_t, default: *mut crate::sigset_t, ) -> c_int4188     pub fn posix_spawnattr_getsigdefault(
4189         attr: *const posix_spawnattr_t,
4190         default: *mut crate::sigset_t,
4191     ) -> c_int;
posix_spawnattr_setsigdefault( attr: *mut posix_spawnattr_t, default: *const crate::sigset_t, ) -> c_int4192     pub fn posix_spawnattr_setsigdefault(
4193         attr: *mut posix_spawnattr_t,
4194         default: *const crate::sigset_t,
4195     ) -> c_int;
posix_spawnattr_getsigmask( attr: *const posix_spawnattr_t, default: *mut crate::sigset_t, ) -> c_int4196     pub fn posix_spawnattr_getsigmask(
4197         attr: *const posix_spawnattr_t,
4198         default: *mut crate::sigset_t,
4199     ) -> c_int;
posix_spawnattr_setsigmask( attr: *mut posix_spawnattr_t, default: *const crate::sigset_t, ) -> c_int4200     pub fn posix_spawnattr_setsigmask(
4201         attr: *mut posix_spawnattr_t,
4202         default: *const crate::sigset_t,
4203     ) -> c_int;
posix_spawnattr_getflags(attr: *const posix_spawnattr_t, flags: *mut c_short) -> c_int4204     pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t, flags: *mut c_short) -> c_int;
posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: c_short) -> c_int4205     pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: c_short) -> c_int;
posix_spawnattr_getpgroup( attr: *const posix_spawnattr_t, flags: *mut crate::pid_t, ) -> c_int4206     pub fn posix_spawnattr_getpgroup(
4207         attr: *const posix_spawnattr_t,
4208         flags: *mut crate::pid_t,
4209     ) -> c_int;
posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int4210     pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int;
posix_spawnattr_getschedpolicy( attr: *const posix_spawnattr_t, flags: *mut c_int, ) -> c_int4211     pub fn posix_spawnattr_getschedpolicy(
4212         attr: *const posix_spawnattr_t,
4213         flags: *mut c_int,
4214     ) -> c_int;
posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: c_int) -> c_int4215     pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: c_int) -> c_int;
posix_spawnattr_getschedparam( attr: *const posix_spawnattr_t, param: *mut crate::sched_param, ) -> c_int4216     pub fn posix_spawnattr_getschedparam(
4217         attr: *const posix_spawnattr_t,
4218         param: *mut crate::sched_param,
4219     ) -> c_int;
posix_spawnattr_setschedparam( attr: *mut posix_spawnattr_t, param: *const crate::sched_param, ) -> c_int4220     pub fn posix_spawnattr_setschedparam(
4221         attr: *mut posix_spawnattr_t,
4222         param: *const crate::sched_param,
4223     ) -> c_int;
4224 
posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int4225     pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int;
posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int4226     pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int;
posix_spawn_file_actions_addopen( actions: *mut posix_spawn_file_actions_t, fd: c_int, path: *const c_char, oflag: c_int, mode: mode_t, ) -> c_int4227     pub fn posix_spawn_file_actions_addopen(
4228         actions: *mut posix_spawn_file_actions_t,
4229         fd: c_int,
4230         path: *const c_char,
4231         oflag: c_int,
4232         mode: mode_t,
4233     ) -> c_int;
posix_spawn_file_actions_addclose( actions: *mut posix_spawn_file_actions_t, fd: c_int, ) -> c_int4234     pub fn posix_spawn_file_actions_addclose(
4235         actions: *mut posix_spawn_file_actions_t,
4236         fd: c_int,
4237     ) -> c_int;
posix_spawn_file_actions_adddup2( actions: *mut posix_spawn_file_actions_t, fd: c_int, newfd: c_int, ) -> c_int4238     pub fn posix_spawn_file_actions_adddup2(
4239         actions: *mut posix_spawn_file_actions_t,
4240         fd: c_int,
4241         newfd: c_int,
4242     ) -> c_int;
4243 
4244     // Added in `glibc` 2.29
posix_spawn_file_actions_addchdir_np( actions: *mut crate::posix_spawn_file_actions_t, path: *const c_char, ) -> c_int4245     pub fn posix_spawn_file_actions_addchdir_np(
4246         actions: *mut crate::posix_spawn_file_actions_t,
4247         path: *const c_char,
4248     ) -> c_int;
4249     // Added in `glibc` 2.29
posix_spawn_file_actions_addfchdir_np( actions: *mut crate::posix_spawn_file_actions_t, fd: c_int, ) -> c_int4250     pub fn posix_spawn_file_actions_addfchdir_np(
4251         actions: *mut crate::posix_spawn_file_actions_t,
4252         fd: c_int,
4253     ) -> c_int;
4254     // Added in `glibc` 2.34
posix_spawn_file_actions_addclosefrom_np( actions: *mut crate::posix_spawn_file_actions_t, from: c_int, ) -> c_int4255     pub fn posix_spawn_file_actions_addclosefrom_np(
4256         actions: *mut crate::posix_spawn_file_actions_t,
4257         from: c_int,
4258     ) -> c_int;
4259     // Added in `glibc` 2.35
posix_spawn_file_actions_addtcsetpgrp_np( actions: *mut crate::posix_spawn_file_actions_t, tcfd: c_int, ) -> c_int4260     pub fn posix_spawn_file_actions_addtcsetpgrp_np(
4261         actions: *mut crate::posix_spawn_file_actions_t,
4262         tcfd: c_int,
4263     ) -> c_int;
4264 
shm_open(name: *const c_char, oflag: c_int, mode: mode_t) -> c_int4265     pub fn shm_open(name: *const c_char, oflag: c_int, mode: mode_t) -> c_int;
shm_unlink(name: *const c_char) -> c_int4266     pub fn shm_unlink(name: *const c_char) -> c_int;
4267 
euidaccess(pathname: *const c_char, mode: c_int) -> c_int4268     pub fn euidaccess(pathname: *const c_char, mode: c_int) -> c_int;
eaccess(pathname: *const c_char, mode: c_int) -> c_int4269     pub fn eaccess(pathname: *const c_char, mode: c_int) -> c_int;
4270 
faccessat(dirfd: c_int, pathname: *const c_char, mode: c_int, flags: c_int) -> c_int4271     pub fn faccessat(dirfd: c_int, pathname: *const c_char, mode: c_int, flags: c_int) -> c_int;
4272 
stat(__file: *const c_char, __buf: *mut stat) -> c_int4273     pub fn stat(__file: *const c_char, __buf: *mut stat) -> c_int;
stat64(__file: *const c_char, __buf: *mut stat64) -> c_int4274     pub fn stat64(__file: *const c_char, __buf: *mut stat64) -> c_int;
4275 
readdir(dirp: *mut crate::DIR) -> *mut crate::dirent4276     pub fn readdir(dirp: *mut crate::DIR) -> *mut crate::dirent;
readdir64(dirp: *mut crate::DIR) -> *mut crate::dirent644277     pub fn readdir64(dirp: *mut crate::DIR) -> *mut crate::dirent64;
readdir_r( dirp: *mut crate::DIR, entry: *mut crate::dirent, result: *mut *mut crate::dirent, ) -> c_int4278     pub fn readdir_r(
4279         dirp: *mut crate::DIR,
4280         entry: *mut crate::dirent,
4281         result: *mut *mut crate::dirent,
4282     ) -> c_int;
readdir64_r( dirp: *mut crate::DIR, entry: *mut crate::dirent64, result: *mut *mut crate::dirent64, ) -> c_int4283     pub fn readdir64_r(
4284         dirp: *mut crate::DIR,
4285         entry: *mut crate::dirent64,
4286         result: *mut *mut crate::dirent64,
4287     ) -> c_int;
seekdir(dirp: *mut crate::DIR, loc: c_long)4288     pub fn seekdir(dirp: *mut crate::DIR, loc: c_long);
telldir(dirp: *mut crate::DIR) -> c_long4289     pub fn telldir(dirp: *mut crate::DIR) -> c_long;
4290 
dirfd(dirp: *mut crate::DIR) -> c_int4291     pub fn dirfd(dirp: *mut crate::DIR) -> c_int;
4292 
4293     #[link_name = "__xpg_strerror_r"]
strerror_r(__errnum: c_int, __buf: *mut c_char, __buflen: size_t) -> c_int4294     pub fn strerror_r(__errnum: c_int, __buf: *mut c_char, __buflen: size_t) -> c_int;
4295 
__errno_location() -> *mut c_int4296     pub fn __errno_location() -> *mut c_int;
4297 
mmap64( __addr: *mut c_void, __len: size_t, __prot: c_int, __flags: c_int, __fd: c_int, __offset: __off64_t, ) -> *mut c_void4298     pub fn mmap64(
4299         __addr: *mut c_void,
4300         __len: size_t,
4301         __prot: c_int,
4302         __flags: c_int,
4303         __fd: c_int,
4304         __offset: __off64_t,
4305     ) -> *mut c_void;
4306 
mremap( addr: *mut c_void, len: size_t, new_len: size_t, flags: c_int, ... ) -> *mut c_void4307     pub fn mremap(
4308         addr: *mut c_void,
4309         len: size_t,
4310         new_len: size_t,
4311         flags: c_int,
4312         ...
4313     ) -> *mut c_void;
4314 
mprotect(__addr: *mut c_void, __len: size_t, __prot: c_int) -> c_int4315     pub fn mprotect(__addr: *mut c_void, __len: size_t, __prot: c_int) -> c_int;
4316 
msync(__addr: *mut c_void, __len: size_t, __flags: c_int) -> c_int4317     pub fn msync(__addr: *mut c_void, __len: size_t, __flags: c_int) -> c_int;
sync()4318     pub fn sync();
syncfs(fd: c_int) -> c_int4319     pub fn syncfs(fd: c_int) -> c_int;
fdatasync(fd: c_int) -> c_int4320     pub fn fdatasync(fd: c_int) -> c_int;
4321 
fallocate64(fd: c_int, mode: c_int, offset: off64_t, len: off64_t) -> c_int4322     pub fn fallocate64(fd: c_int, mode: c_int, offset: off64_t, len: off64_t) -> c_int;
posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int4323     pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int;
posix_fallocate64(fd: c_int, offset: off64_t, len: off64_t) -> c_int4324     pub fn posix_fallocate64(fd: c_int, offset: off64_t, len: off64_t) -> c_int;
4325 
posix_fadvise(fd: c_int, offset: off_t, len: off_t, advise: c_int) -> c_int4326     pub fn posix_fadvise(fd: c_int, offset: off_t, len: off_t, advise: c_int) -> c_int;
4327 
posix_fadvise64(fd: c_int, offset: off64_t, len: off64_t, advise: c_int) -> c_int4328     pub fn posix_fadvise64(fd: c_int, offset: off64_t, len: off64_t, advise: c_int) -> c_int;
4329 
madvise(__addr: *mut c_void, __len: size_t, __advice: c_int) -> c_int4330     pub fn madvise(__addr: *mut c_void, __len: size_t, __advice: c_int) -> c_int;
4331 
posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int4332     pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int;
4333 
getrlimit(resource: crate::__rlimit_resource_t, rlim: *mut crate::rlimit) -> c_int4334     pub fn getrlimit(resource: crate::__rlimit_resource_t, rlim: *mut crate::rlimit) -> c_int;
getrlimit64(resource: crate::__rlimit_resource_t, rlim: *mut crate::rlimit64) -> c_int4335     pub fn getrlimit64(resource: crate::__rlimit_resource_t, rlim: *mut crate::rlimit64) -> c_int;
setrlimit(resource: crate::__rlimit_resource_t, rlim: *const crate::rlimit) -> c_int4336     pub fn setrlimit(resource: crate::__rlimit_resource_t, rlim: *const crate::rlimit) -> c_int;
setrlimit64(resource: crate::__rlimit_resource_t, rlim: *const crate::rlimit64) -> c_int4337     pub fn setrlimit64(resource: crate::__rlimit_resource_t, rlim: *const crate::rlimit64)
4338         -> c_int;
4339 
getpriority(which: crate::__priority_which, who: crate::id_t) -> c_int4340     pub fn getpriority(which: crate::__priority_which, who: crate::id_t) -> c_int;
setpriority(which: crate::__priority_which, who: crate::id_t, prio: c_int) -> c_int4341     pub fn setpriority(which: crate::__priority_which, who: crate::id_t, prio: c_int) -> c_int;
4342 
getrandom(__buffer: *mut c_void, __length: size_t, __flags: c_uint) -> ssize_t4343     pub fn getrandom(__buffer: *mut c_void, __length: size_t, __flags: c_uint) -> ssize_t;
getentropy(__buffer: *mut c_void, __length: size_t) -> c_int4344     pub fn getentropy(__buffer: *mut c_void, __length: size_t) -> c_int;
4345 
memrchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void4346     pub fn memrchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
memmem( haystack: *const c_void, haystacklen: size_t, needle: *const c_void, needlelen: size_t, ) -> *mut c_void4347     pub fn memmem(
4348         haystack: *const c_void,
4349         haystacklen: size_t,
4350         needle: *const c_void,
4351         needlelen: size_t,
4352     ) -> *mut c_void;
strchrnul(s: *const c_char, c: c_int) -> *mut c_char4353     pub fn strchrnul(s: *const c_char, c: c_int) -> *mut c_char;
4354 
abs(i: c_int) -> c_int4355     pub fn abs(i: c_int) -> c_int;
labs(i: c_long) -> c_long4356     pub fn labs(i: c_long) -> c_long;
rand() -> c_int4357     pub fn rand() -> c_int;
srand(seed: c_uint)4358     pub fn srand(seed: c_uint);
4359 
drand48() -> c_double4360     pub fn drand48() -> c_double;
erand48(xseed: *mut c_ushort) -> c_double4361     pub fn erand48(xseed: *mut c_ushort) -> c_double;
lrand48() -> c_long4362     pub fn lrand48() -> c_long;
nrand48(xseed: *mut c_ushort) -> c_long4363     pub fn nrand48(xseed: *mut c_ushort) -> c_long;
mrand48() -> c_long4364     pub fn mrand48() -> c_long;
jrand48(xseed: *mut c_ushort) -> c_long4365     pub fn jrand48(xseed: *mut c_ushort) -> c_long;
srand48(seed: c_long)4366     pub fn srand48(seed: c_long);
seed48(xseed: *mut c_ushort) -> *mut c_ushort4367     pub fn seed48(xseed: *mut c_ushort) -> *mut c_ushort;
lcong48(p: *mut c_ushort)4368     pub fn lcong48(p: *mut c_ushort);
4369 
qsort_r( base: *mut c_void, num: size_t, size: size_t, compar: Option<unsafe extern "C" fn(*const c_void, *const c_void, *mut c_void) -> c_int>, arg: *mut c_void, )4370     pub fn qsort_r(
4371         base: *mut c_void,
4372         num: size_t,
4373         size: size_t,
4374         compar: Option<unsafe extern "C" fn(*const c_void, *const c_void, *mut c_void) -> c_int>,
4375         arg: *mut c_void,
4376     );
4377 
brk(addr: *mut c_void) -> c_int4378     pub fn brk(addr: *mut c_void) -> c_int;
sbrk(increment: intptr_t) -> *mut c_void4379     pub fn sbrk(increment: intptr_t) -> *mut c_void;
4380 
memalign(align: size_t, size: size_t) -> *mut c_void4381     pub fn memalign(align: size_t, size: size_t) -> *mut c_void;
mallopt(param: c_int, value: c_int) -> c_int4382     pub fn mallopt(param: c_int, value: c_int) -> c_int;
4383 
mallinfo() -> crate::mallinfo4384     pub fn mallinfo() -> crate::mallinfo;
mallinfo2() -> crate::mallinfo24385     pub fn mallinfo2() -> crate::mallinfo2;
malloc_info(options: c_int, stream: *mut crate::FILE) -> c_int4386     pub fn malloc_info(options: c_int, stream: *mut crate::FILE) -> c_int;
malloc_usable_size(ptr: *mut c_void) -> size_t4387     pub fn malloc_usable_size(ptr: *mut c_void) -> size_t;
malloc_trim(__pad: size_t) -> c_int4388     pub fn malloc_trim(__pad: size_t) -> c_int;
4389 
iconv_open(tocode: *const c_char, fromcode: *const c_char) -> iconv_t4390     pub fn iconv_open(tocode: *const c_char, fromcode: *const c_char) -> iconv_t;
iconv( cd: iconv_t, inbuf: *mut *mut c_char, inbytesleft: *mut size_t, outbuf: *mut *mut c_char, outbytesleft: *mut size_t, ) -> size_t4391     pub fn iconv(
4392         cd: iconv_t,
4393         inbuf: *mut *mut c_char,
4394         inbytesleft: *mut size_t,
4395         outbuf: *mut *mut c_char,
4396         outbytesleft: *mut size_t,
4397     ) -> size_t;
iconv_close(cd: iconv_t) -> c_int4398     pub fn iconv_close(cd: iconv_t) -> c_int;
4399 
getopt_long( argc: c_int, argv: *const *mut c_char, optstring: *const c_char, longopts: *const option, longindex: *mut c_int, ) -> c_int4400     pub fn getopt_long(
4401         argc: c_int,
4402         argv: *const *mut c_char,
4403         optstring: *const c_char,
4404         longopts: *const option,
4405         longindex: *mut c_int,
4406     ) -> c_int;
4407 
backtrace(buf: *mut *mut c_void, sz: c_int) -> c_int4408     pub fn backtrace(buf: *mut *mut c_void, sz: c_int) -> c_int;
4409 
reboot(how_to: c_int) -> c_int4410     pub fn reboot(how_to: c_int) -> c_int;
4411 
getloadavg(loadavg: *mut c_double, nelem: c_int) -> c_int4412     pub fn getloadavg(loadavg: *mut c_double, nelem: c_int) -> c_int;
4413 
regexec( preg: *const crate::regex_t, input: *const c_char, nmatch: size_t, pmatch: *mut regmatch_t, eflags: c_int, ) -> c_int4414     pub fn regexec(
4415         preg: *const crate::regex_t,
4416         input: *const c_char,
4417         nmatch: size_t,
4418         pmatch: *mut regmatch_t,
4419         eflags: c_int,
4420     ) -> c_int;
4421 
regerror( errcode: c_int, preg: *const crate::regex_t, errbuf: *mut c_char, errbuf_size: size_t, ) -> size_t4422     pub fn regerror(
4423         errcode: c_int,
4424         preg: *const crate::regex_t,
4425         errbuf: *mut c_char,
4426         errbuf_size: size_t,
4427     ) -> size_t;
4428 
regfree(preg: *mut crate::regex_t)4429     pub fn regfree(preg: *mut crate::regex_t);
4430 
glob( pattern: *const c_char, flags: c_int, errfunc: Option<extern "C" fn(epath: *const c_char, errno: c_int) -> c_int>, pglob: *mut crate::glob_t, ) -> c_int4431     pub fn glob(
4432         pattern: *const c_char,
4433         flags: c_int,
4434         errfunc: Option<extern "C" fn(epath: *const c_char, errno: c_int) -> c_int>,
4435         pglob: *mut crate::glob_t,
4436     ) -> c_int;
globfree(pglob: *mut crate::glob_t)4437     pub fn globfree(pglob: *mut crate::glob_t);
4438 
glob64( pattern: *const c_char, flags: c_int, errfunc: Option<extern "C" fn(epath: *const c_char, errno: c_int) -> c_int>, pglob: *mut glob64_t, ) -> c_int4439     pub fn glob64(
4440         pattern: *const c_char,
4441         flags: c_int,
4442         errfunc: Option<extern "C" fn(epath: *const c_char, errno: c_int) -> c_int>,
4443         pglob: *mut glob64_t,
4444     ) -> c_int;
globfree64(pglob: *mut glob64_t)4445     pub fn globfree64(pglob: *mut glob64_t);
4446 
getxattr( path: *const c_char, name: *const c_char, value: *mut c_void, size: size_t, ) -> ssize_t4447     pub fn getxattr(
4448         path: *const c_char,
4449         name: *const c_char,
4450         value: *mut c_void,
4451         size: size_t,
4452     ) -> ssize_t;
lgetxattr( path: *const c_char, name: *const c_char, value: *mut c_void, size: size_t, ) -> ssize_t4453     pub fn lgetxattr(
4454         path: *const c_char,
4455         name: *const c_char,
4456         value: *mut c_void,
4457         size: size_t,
4458     ) -> ssize_t;
fgetxattr( filedes: c_int, name: *const c_char, value: *mut c_void, size: size_t, ) -> ssize_t4459     pub fn fgetxattr(
4460         filedes: c_int,
4461         name: *const c_char,
4462         value: *mut c_void,
4463         size: size_t,
4464     ) -> ssize_t;
setxattr( path: *const c_char, name: *const c_char, value: *const c_void, size: size_t, flags: c_int, ) -> c_int4465     pub fn setxattr(
4466         path: *const c_char,
4467         name: *const c_char,
4468         value: *const c_void,
4469         size: size_t,
4470         flags: c_int,
4471     ) -> c_int;
lsetxattr( path: *const c_char, name: *const c_char, value: *const c_void, size: size_t, flags: c_int, ) -> c_int4472     pub fn lsetxattr(
4473         path: *const c_char,
4474         name: *const c_char,
4475         value: *const c_void,
4476         size: size_t,
4477         flags: c_int,
4478     ) -> c_int;
fsetxattr( filedes: c_int, name: *const c_char, value: *const c_void, size: size_t, flags: c_int, ) -> c_int4479     pub fn fsetxattr(
4480         filedes: c_int,
4481         name: *const c_char,
4482         value: *const c_void,
4483         size: size_t,
4484         flags: c_int,
4485     ) -> c_int;
listxattr(path: *const c_char, list: *mut c_char, size: size_t) -> ssize_t4486     pub fn listxattr(path: *const c_char, list: *mut c_char, size: size_t) -> ssize_t;
llistxattr(path: *const c_char, list: *mut c_char, size: size_t) -> ssize_t4487     pub fn llistxattr(path: *const c_char, list: *mut c_char, size: size_t) -> ssize_t;
flistxattr(filedes: c_int, list: *mut c_char, size: size_t) -> ssize_t4488     pub fn flistxattr(filedes: c_int, list: *mut c_char, size: size_t) -> ssize_t;
removexattr(path: *const c_char, name: *const c_char) -> c_int4489     pub fn removexattr(path: *const c_char, name: *const c_char) -> c_int;
lremovexattr(path: *const c_char, name: *const c_char) -> c_int4490     pub fn lremovexattr(path: *const c_char, name: *const c_char) -> c_int;
fremovexattr(filedes: c_int, name: *const c_char) -> c_int4491     pub fn fremovexattr(filedes: c_int, name: *const c_char) -> c_int;
4492 
dirname(path: *mut c_char) -> *mut c_char4493     pub fn dirname(path: *mut c_char) -> *mut c_char;
4494     /// POSIX version of `basename(3)`, defined in `libgen.h`.
4495     #[link_name = "__xpg_basename"]
posix_basename(path: *mut c_char) -> *mut c_char4496     pub fn posix_basename(path: *mut c_char) -> *mut c_char;
4497     /// GNU version of `basename(3)`, defined in `string.h`.
4498     #[link_name = "basename"]
gnu_basename(path: *const c_char) -> *mut c_char4499     pub fn gnu_basename(path: *const c_char) -> *mut c_char;
4500 
dlmopen(lmid: Lmid_t, filename: *const c_char, flag: c_int) -> *mut c_void4501     pub fn dlmopen(lmid: Lmid_t, filename: *const c_char, flag: c_int) -> *mut c_void;
dlinfo(handle: *mut c_void, request: c_int, info: *mut c_void) -> c_int4502     pub fn dlinfo(handle: *mut c_void, request: c_int, info: *mut c_void) -> c_int;
dladdr1( addr: *const c_void, info: *mut crate::Dl_info, extra_info: *mut *mut c_void, flags: c_int, ) -> c_int4503     pub fn dladdr1(
4504         addr: *const c_void,
4505         info: *mut crate::Dl_info,
4506         extra_info: *mut *mut c_void,
4507         flags: c_int,
4508     ) -> c_int;
4509 
duplocale(base: crate::locale_t) -> crate::locale_t4510     pub fn duplocale(base: crate::locale_t) -> crate::locale_t;
freelocale(loc: crate::locale_t)4511     pub fn freelocale(loc: crate::locale_t);
newlocale(mask: c_int, locale: *const c_char, base: crate::locale_t) -> crate::locale_t4512     pub fn newlocale(mask: c_int, locale: *const c_char, base: crate::locale_t) -> crate::locale_t;
uselocale(loc: crate::locale_t) -> crate::locale_t4513     pub fn uselocale(loc: crate::locale_t) -> crate::locale_t;
nl_langinfo(item: crate::nl_item) -> *mut c_char4514     pub fn nl_langinfo(item: crate::nl_item) -> *mut c_char;
nl_langinfo_l(item: crate::nl_item, locale: crate::locale_t) -> *mut c_char4515     pub fn nl_langinfo_l(item: crate::nl_item, locale: crate::locale_t) -> *mut c_char;
4516 
dl_iterate_phdr( callback: Option< unsafe extern "C" fn( info: *mut crate::dl_phdr_info, size: size_t, data: *mut c_void, ) -> c_int, >, data: *mut c_void, ) -> c_int4517     pub fn dl_iterate_phdr(
4518         callback: Option<
4519             unsafe extern "C" fn(
4520                 info: *mut crate::dl_phdr_info,
4521                 size: size_t,
4522                 data: *mut c_void,
4523             ) -> c_int,
4524         >,
4525         data: *mut c_void,
4526     ) -> c_int;
4527 
gnu_get_libc_release() -> *const c_char4528     pub fn gnu_get_libc_release() -> *const c_char;
gnu_get_libc_version() -> *const c_char4529     pub fn gnu_get_libc_version() -> *const c_char;
4530 }
4531 
4532 safe_f! {
4533     pub {const} fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t {
4534         let major = major as crate::dev_t;
4535         let minor = minor as crate::dev_t;
4536         let mut dev = 0;
4537         dev |= major << 8;
4538         dev |= minor;
4539         dev
4540     }
4541 
4542     pub {const} fn major(dev: crate::dev_t) -> c_uint {
4543         ((dev >> 8) & 0xff) as c_uint
4544     }
4545 
4546     pub {const} fn minor(dev: crate::dev_t) -> c_uint {
4547         (dev & 0xffff00ff) as c_uint
4548     }
4549 
4550     pub fn SIGRTMAX() -> c_int {
4551         unsafe { __libc_current_sigrtmax() }
4552     }
4553 
4554     pub fn SIGRTMIN() -> c_int {
4555         unsafe { __libc_current_sigrtmin() }
4556     }
4557 
4558     pub {const} fn WIFSTOPPED(status: c_int) -> bool {
4559         (status & 0xff) == 0x7f
4560     }
4561 
4562     pub {const} fn WSTOPSIG(status: c_int) -> c_int {
4563         (status >> 8) & 0xff
4564     }
4565 
4566     pub {const} fn WIFCONTINUED(status: c_int) -> bool {
4567         status == 0xffff
4568     }
4569 
4570     pub {const} fn WIFSIGNALED(status: c_int) -> bool {
4571         ((status & 0x7f) + 1) as i8 >= 2
4572     }
4573 
4574     pub {const} fn WTERMSIG(status: c_int) -> c_int {
4575         status & 0x7f
4576     }
4577 
4578     pub {const} fn WIFEXITED(status: c_int) -> bool {
4579         (status & 0x7f) == 0
4580     }
4581 
4582     pub {const} fn WEXITSTATUS(status: c_int) -> c_int {
4583         (status >> 8) & 0xff
4584     }
4585 
4586     pub {const} fn WCOREDUMP(status: c_int) -> bool {
4587         (status & 0x80) != 0
4588     }
4589 
4590     pub {const} fn W_EXITCODE(ret: c_int, sig: c_int) -> c_int {
4591         (ret << 8) | sig
4592     }
4593 
4594     pub {const} fn W_STOPCODE(sig: c_int) -> c_int {
4595         (sig << 8) | 0x7f
4596     }
4597 
4598     pub {const} fn QCMD(cmd: c_int, type_: c_int) -> c_int {
4599         (cmd << 8) | (type_ & 0x00ff)
4600     }
4601 
4602     pub {const} fn IPOPT_COPIED(o: u8) -> u8 {
4603         o & IPOPT_COPY
4604     }
4605 
4606     pub {const} fn IPOPT_CLASS(o: u8) -> u8 {
4607         o & IPOPT_CLASS_MASK
4608     }
4609 
4610     pub {const} fn IPOPT_NUMBER(o: u8) -> u8 {
4611         o & IPOPT_NUMBER_MASK
4612     }
4613 
4614     pub {const} fn IPTOS_ECN(x: u8) -> u8 {
4615         x & crate::IPTOS_ECN_MASK
4616     }
4617 }
4618 
4619 cfg_if! {
4620     if #[cfg(target_pointer_width = "64")] {
4621         mod b64;
4622         pub use self::b64::*;
4623     } else {
4624         mod b32;
4625         pub use self::b32::*;
4626     }
4627 }
4628