1 pub type c_char = i8;
2 pub type wchar_t = i32;
3 pub type useconds_t = u32;
4 pub type dev_t = u32;
5 pub type socklen_t = u32;
6 pub type pthread_t = c_ulong;
7 pub type mode_t = u32;
8 pub type ino64_t = u64;
9 pub type off64_t = i64;
10 pub type blkcnt64_t = i32;
11 pub type rlim64_t = u64;
12 pub type shmatt_t = ::c_ulong;
13 pub type mqd_t = ::c_int;
14 pub type msgqnum_t = ::c_ulong;
15 pub type msglen_t = ::c_ulong;
16 pub type nfds_t = ::c_ulong;
17 pub type nl_item = ::c_int;
18 pub type idtype_t = ::c_uint;
19 pub type loff_t = i64;
20 pub type pthread_key_t = ::c_uint;
21 
22 pub type clock_t = c_long;
23 pub type time_t = c_long;
24 pub type suseconds_t = c_long;
25 pub type ino_t = u64;
26 pub type off_t = i64;
27 pub type blkcnt_t = i32;
28 
29 pub type blksize_t = c_long;
30 pub type fsblkcnt_t = u32;
31 pub type fsfilcnt_t = u32;
32 pub type rlim_t = ::c_ulonglong;
33 pub type c_long = i32;
34 pub type c_ulong = u32;
35 pub type nlink_t = u32;
36 
37 #[cfg_attr(feature = "extra_traits", derive(Debug))]
38 pub enum fpos64_t {} // FIXME: fill this out with a struct
39 impl ::Copy for fpos64_t {}
40 impl ::Clone for fpos64_t {
41     fn clone(&self) -> fpos64_t {
42         *self
43     }
44 }
45 
46 s! {
47     pub struct rlimit64 {
48         pub rlim_cur: rlim64_t,
49         pub rlim_max: rlim64_t,
50     }
51 
52     pub struct glob_t {
53         pub gl_pathc: ::size_t,
54         pub gl_pathv: *mut *mut c_char,
55         pub gl_offs: ::size_t,
56         pub gl_flags: ::c_int,
57 
58         __unused1: *mut ::c_void,
59         __unused2: *mut ::c_void,
60         __unused3: *mut ::c_void,
61         __unused4: *mut ::c_void,
62         __unused5: *mut ::c_void,
63     }
64 
65     pub struct passwd {
66         pub pw_name: *mut ::c_char,
67         pub pw_passwd: *mut ::c_char,
68         pub pw_uid: ::uid_t,
69         pub pw_gid: ::gid_t,
70         pub pw_gecos: *mut ::c_char,
71         pub pw_dir: *mut ::c_char,
72         pub pw_shell: *mut ::c_char,
73     }
74 
75     pub struct spwd {
76         pub sp_namp: *mut ::c_char,
77         pub sp_pwdp: *mut ::c_char,
78         pub sp_lstchg: ::c_long,
79         pub sp_min: ::c_long,
80         pub sp_max: ::c_long,
81         pub sp_warn: ::c_long,
82         pub sp_inact: ::c_long,
83         pub sp_expire: ::c_long,
84         pub sp_flag: ::c_ulong,
85     }
86 
87     pub struct statvfs {
88         pub f_bsize: ::c_ulong,
89         pub f_frsize: ::c_ulong,
90         pub f_blocks: ::fsblkcnt_t,
91         pub f_bfree: ::fsblkcnt_t,
92         pub f_bavail: ::fsblkcnt_t,
93         pub f_files: ::fsfilcnt_t,
94         pub f_ffree: ::fsfilcnt_t,
95         pub f_favail: ::fsfilcnt_t,
96         pub f_fsid: ::c_ulong,
97         __f_unused: ::c_int,
98         pub f_flag: ::c_ulong,
99         pub f_namemax: ::c_ulong,
100         __f_spare: [::c_int; 6],
101     }
102 
103     pub struct dqblk {
104         pub dqb_bhardlimit: u64,
105         pub dqb_bsoftlimit: u64,
106         pub dqb_curspace: u64,
107         pub dqb_ihardlimit: u64,
108         pub dqb_isoftlimit: u64,
109         pub dqb_curinodes: u64,
110         pub dqb_btime: u64,
111         pub dqb_itime: u64,
112         pub dqb_valid: u32,
113     }
114 
115     pub struct signalfd_siginfo {
116         pub ssi_signo: u32,
117         pub ssi_errno: i32,
118         pub ssi_code: i32,
119         pub ssi_pid: u32,
120         pub ssi_uid: u32,
121         pub ssi_fd: i32,
122         pub ssi_tid: u32,
123         pub ssi_band: u32,
124         pub ssi_overrun: u32,
125         pub ssi_trapno: u32,
126         pub ssi_status: i32,
127         pub ssi_int: i32,
128         pub ssi_ptr: u64,
129         pub ssi_utime: u64,
130         pub ssi_stime: u64,
131         pub ssi_addr: u64,
132         pub ssi_addr_lsb: u16,
133         _pad2: u16,
134         pub ssi_syscall: i32,
135         pub ssi_call_addr: u64,
136         pub ssi_arch: u32,
137         _pad: [u8; 28],
138     }
139 
140     pub struct fsid_t {
141         __val: [::c_int; 2],
142     }
143 
144     pub struct cpu_set_t {
145         bits: [u32; 32],
146     }
147 
148     pub struct if_nameindex {
149         pub if_index: ::c_uint,
150         pub if_name: *mut ::c_char,
151     }
152 
153     // System V IPC
154     pub struct msginfo {
155         pub msgpool: ::c_int,
156         pub msgmap: ::c_int,
157         pub msgmax: ::c_int,
158         pub msgmnb: ::c_int,
159         pub msgmni: ::c_int,
160         pub msgssz: ::c_int,
161         pub msgtql: ::c_int,
162         pub msgseg: ::c_ushort,
163     }
164 
165     pub struct sembuf {
166         pub sem_num: ::c_ushort,
167         pub sem_op: ::c_short,
168         pub sem_flg: ::c_short,
169     }
170 
171     pub struct aiocb {
172         pub aio_fildes: ::c_int,
173         pub aio_lio_opcode: ::c_int,
174         pub aio_reqprio: ::c_int,
175         pub aio_buf: *mut ::c_void,
176         pub aio_nbytes: ::size_t,
177         pub aio_sigevent: ::sigevent,
178         __td: *mut ::c_void,
179         __lock: [::c_int; 2],
180         __err: ::c_int,
181         __ret: ::ssize_t,
182         pub aio_offset: off_t,
183         __next: *mut ::c_void,
184         __prev: *mut ::c_void,
185         __dummy4: [::c_char; 24],
186     }
187 
188     pub struct sigaction {
189         pub sa_sigaction: ::sighandler_t,
190         pub sa_mask: ::sigset_t,
191         pub sa_flags: ::c_int,
192         pub sa_restorer: ::Option<extern fn()>,
193     }
194 
195     pub struct ipc_perm {
196         pub __ipc_perm_key: ::key_t,
197         pub uid: ::uid_t,
198         pub gid: ::gid_t,
199         pub cuid: ::uid_t,
200         pub cgid: ::gid_t,
201         pub mode: ::mode_t,
202         pub __seq: ::c_int,
203         __unused1: ::c_long,
204         __unused2: ::c_long
205     }
206 
207     pub struct termios {
208         pub c_iflag: ::tcflag_t,
209         pub c_oflag: ::tcflag_t,
210         pub c_cflag: ::tcflag_t,
211         pub c_lflag: ::tcflag_t,
212         pub c_line: ::cc_t,
213         pub c_cc: [::cc_t; ::NCCS],
214         pub __c_ispeed: ::speed_t,
215         pub __c_ospeed: ::speed_t,
216     }
217 
218     pub struct flock {
219         pub l_type: ::c_short,
220         pub l_whence: ::c_short,
221         pub l_start: ::off_t,
222         pub l_len: ::off_t,
223         pub l_pid: ::pid_t,
224     }
225 
226     pub struct flock64 {
227         pub l_type: ::c_short,
228         pub l_whence: ::c_short,
229         pub l_start: ::off64_t,
230         pub l_len: ::off64_t,
231         pub l_pid: ::pid_t,
232     }
233 
234     pub struct pthread_attr_t {
235         __size: [u32; 11]
236     }
237 
238     pub struct sigset_t {
239         __val: [::c_ulong; 32],
240     }
241 
242     pub struct msghdr {
243         pub msg_name: *mut ::c_void,
244         pub msg_namelen: ::socklen_t,
245         pub msg_iov: *mut ::iovec,
246         pub msg_iovlen: ::c_int,
247         pub msg_control: *mut ::c_void,
248         pub msg_controllen: ::socklen_t,
249         pub msg_flags: ::c_int,
250     }
251 
252     pub struct cmsghdr {
253         pub cmsg_len: ::socklen_t,
254         pub cmsg_level: ::c_int,
255         pub cmsg_type: ::c_int,
256     }
257 
258     pub struct sem_t {
259         __val: [::c_int; 4],
260     }
261     pub struct stat {
262         pub st_dev: ::dev_t,
263         #[cfg(not(emscripten_new_stat_abi))]
264         __st_dev_padding: ::c_int,
265         #[cfg(not(emscripten_new_stat_abi))]
266         __st_ino_truncated: ::c_long,
267         pub st_mode: ::mode_t,
268         pub st_nlink: ::nlink_t,
269         pub st_uid: ::uid_t,
270         pub st_gid: ::gid_t,
271         pub st_rdev: ::dev_t,
272         #[cfg(not(emscripten_new_stat_abi))]
273         __st_rdev_padding: ::c_int,
274         pub st_size: ::off_t,
275         pub st_blksize: ::blksize_t,
276         pub st_blocks: ::blkcnt_t,
277         pub st_atime: ::time_t,
278         pub st_atime_nsec: ::c_long,
279         pub st_mtime: ::time_t,
280         pub st_mtime_nsec: ::c_long,
281         pub st_ctime: ::time_t,
282         pub st_ctime_nsec: ::c_long,
283         pub st_ino: ::ino_t,
284     }
285 
286     pub struct stat64 {
287         pub st_dev: ::dev_t,
288         #[cfg(not(emscripten_new_stat_abi))]
289         __st_dev_padding: ::c_int,
290         #[cfg(not(emscripten_new_stat_abi))]
291         __st_ino_truncated: ::c_long,
292         pub st_mode: ::mode_t,
293         pub st_nlink: ::nlink_t,
294         pub st_uid: ::uid_t,
295         pub st_gid: ::gid_t,
296         pub st_rdev: ::dev_t,
297         #[cfg(not(emscripten_new_stat_abi))]
298         __st_rdev_padding: ::c_int,
299         pub st_size: ::off_t,
300         pub st_blksize: ::blksize_t,
301         pub st_blocks: ::blkcnt_t,
302         pub st_atime: ::time_t,
303         pub st_atime_nsec: ::c_long,
304         pub st_mtime: ::time_t,
305         pub st_mtime_nsec: ::c_long,
306         pub st_ctime: ::time_t,
307         pub st_ctime_nsec: ::c_long,
308         pub st_ino: ::ino_t,
309     }
310 
311     pub struct stack_t {
312         pub ss_sp: *mut ::c_void,
313         pub ss_flags: ::c_int,
314         pub ss_size: ::size_t
315     }
316 
317     pub struct shmid_ds {
318         pub shm_perm: ::ipc_perm,
319         pub shm_segsz: ::size_t,
320         pub shm_atime: ::time_t,
321         __unused1: ::c_int,
322         pub shm_dtime: ::time_t,
323         __unused2: ::c_int,
324         pub shm_ctime: ::time_t,
325         __unused3: ::c_int,
326         pub shm_cpid: ::pid_t,
327         pub shm_lpid: ::pid_t,
328         pub shm_nattch: ::c_ulong,
329         __pad1: ::c_ulong,
330         __pad2: ::c_ulong,
331     }
332 
333     pub struct msqid_ds {
334         pub msg_perm: ::ipc_perm,
335         pub msg_stime: ::time_t,
336         __unused1: ::c_int,
337         pub msg_rtime: ::time_t,
338         __unused2: ::c_int,
339         pub msg_ctime: ::time_t,
340         __unused3: ::c_int,
341         __msg_cbytes: ::c_ulong,
342         pub msg_qnum: ::msgqnum_t,
343         pub msg_qbytes: ::msglen_t,
344         pub msg_lspid: ::pid_t,
345         pub msg_lrpid: ::pid_t,
346         __pad1: ::c_ulong,
347         __pad2: ::c_ulong,
348     }
349 
350     pub struct statfs {
351         pub f_type: ::c_ulong,
352         pub f_bsize: ::c_ulong,
353         pub f_blocks: ::fsblkcnt_t,
354         pub f_bfree: ::fsblkcnt_t,
355         pub f_bavail: ::fsblkcnt_t,
356         pub f_files: ::fsfilcnt_t,
357         pub f_ffree: ::fsfilcnt_t,
358         pub f_fsid: ::fsid_t,
359         pub f_namelen: ::c_ulong,
360         pub f_frsize: ::c_ulong,
361         pub f_flags: ::c_ulong,
362         pub f_spare: [::c_ulong; 4],
363     }
364 
365     pub struct siginfo_t {
366         pub si_signo: ::c_int,
367         pub si_errno: ::c_int,
368         pub si_code: ::c_int,
369         pub _pad: [::c_int; 29],
370         _align: [usize; 0],
371     }
372 
373     pub struct statfs64 {
374         pub f_type: ::c_ulong,
375         pub f_bsize: ::c_ulong,
376         pub f_blocks: ::fsblkcnt_t,
377         pub f_bfree: ::fsblkcnt_t,
378         pub f_bavail: ::fsblkcnt_t,
379         pub f_files: ::fsfilcnt_t,
380         pub f_ffree: ::fsfilcnt_t,
381         pub f_fsid: ::fsid_t,
382         pub f_namelen: ::c_ulong,
383         pub f_frsize: ::c_ulong,
384         pub f_flags: ::c_ulong,
385         pub f_spare: [::c_ulong; 4],
386     }
387 
388     pub struct statvfs64 {
389         pub f_bsize: ::c_ulong,
390         pub f_frsize: ::c_ulong,
391         pub f_blocks: u32,
392         pub f_bfree: u32,
393         pub f_bavail: u32,
394         pub f_files: u32,
395         pub f_ffree: u32,
396         pub f_favail: u32,
397         pub f_fsid: ::c_ulong,
398         __f_unused: ::c_int,
399         pub f_flag: ::c_ulong,
400         pub f_namemax: ::c_ulong,
401         __f_spare: [::c_int; 6],
402     }
403 
404     pub struct arpd_request {
405         pub req: ::c_ushort,
406         pub ip: u32,
407         pub dev: ::c_ulong,
408         pub stamp: ::c_ulong,
409         pub updated: ::c_ulong,
410         pub ha: [::c_uchar; ::MAX_ADDR_LEN],
411     }
412 }
413 
414 s_no_extra_traits! {
415     pub struct dirent {
416         pub d_ino: ::ino_t,
417         pub d_off: ::off_t,
418         pub d_reclen: ::c_ushort,
419         pub d_type: ::c_uchar,
420         pub d_name: [::c_char; 256],
421     }
422 
423     pub struct dirent64 {
424         pub d_ino: ::ino64_t,
425         pub d_off: ::off64_t,
426         pub d_reclen: ::c_ushort,
427         pub d_type: ::c_uchar,
428         pub d_name: [::c_char; 256],
429     }
430 
431     pub struct sysinfo {
432         pub uptime: ::c_ulong,
433         pub loads: [::c_ulong; 3],
434         pub totalram: ::c_ulong,
435         pub freeram: ::c_ulong,
436         pub sharedram: ::c_ulong,
437         pub bufferram: ::c_ulong,
438         pub totalswap: ::c_ulong,
439         pub freeswap: ::c_ulong,
440         pub procs: ::c_ushort,
441         pub pad: ::c_ushort,
442         pub totalhigh: ::c_ulong,
443         pub freehigh: ::c_ulong,
444         pub mem_unit: ::c_uint,
445         pub __reserved: [::c_char; 256],
446     }
447 
448     pub struct mq_attr {
449         pub mq_flags: ::c_long,
450         pub mq_maxmsg: ::c_long,
451         pub mq_msgsize: ::c_long,
452         pub mq_curmsgs: ::c_long,
453         pad: [::c_long; 4]
454     }
455 }
456 
457 cfg_if! {
458     if #[cfg(feature = "extra_traits")] {
459         impl PartialEq for dirent {
460             fn eq(&self, other: &dirent) -> bool {
461                 self.d_ino == other.d_ino
462                     && self.d_off == other.d_off
463                     && self.d_reclen == other.d_reclen
464                     && self.d_type == other.d_type
465                     && self
466                     .d_name
467                     .iter()
468                     .zip(other.d_name.iter())
469                     .all(|(a,b)| a == b)
470             }
471         }
472         impl Eq for dirent {}
473         impl ::fmt::Debug for dirent {
474             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
475                 f.debug_struct("dirent")
476                     .field("d_ino", &self.d_ino)
477                     .field("d_off", &self.d_off)
478                     .field("d_reclen", &self.d_reclen)
479                     .field("d_type", &self.d_type)
480                     // FIXME: .field("d_name", &self.d_name)
481                     .finish()
482             }
483         }
484         impl ::hash::Hash for dirent {
485             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
486                 self.d_ino.hash(state);
487                 self.d_off.hash(state);
488                 self.d_reclen.hash(state);
489                 self.d_type.hash(state);
490                 self.d_name.hash(state);
491             }
492         }
493 
494         impl PartialEq for dirent64 {
495             fn eq(&self, other: &dirent64) -> bool {
496                 self.d_ino == other.d_ino
497                     && self.d_off == other.d_off
498                     && self.d_reclen == other.d_reclen
499                     && self.d_type == other.d_type
500                     && self
501                     .d_name
502                     .iter()
503                     .zip(other.d_name.iter())
504                     .all(|(a,b)| a == b)
505             }
506         }
507         impl Eq for dirent64 {}
508         impl ::fmt::Debug for dirent64 {
509             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
510                 f.debug_struct("dirent64")
511                     .field("d_ino", &self.d_ino)
512                     .field("d_off", &self.d_off)
513                     .field("d_reclen", &self.d_reclen)
514                     .field("d_type", &self.d_type)
515                     // FIXME: .field("d_name", &self.d_name)
516                     .finish()
517             }
518         }
519         impl ::hash::Hash for dirent64 {
520             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
521                 self.d_ino.hash(state);
522                 self.d_off.hash(state);
523                 self.d_reclen.hash(state);
524                 self.d_type.hash(state);
525                 self.d_name.hash(state);
526             }
527         }
528 
529         impl PartialEq for sysinfo {
530             fn eq(&self, other: &sysinfo) -> bool {
531                 self.uptime == other.uptime
532                     && self.loads == other.loads
533                     && self.totalram == other.totalram
534                     && self.freeram == other.freeram
535                     && self.sharedram == other.sharedram
536                     && self.bufferram == other.bufferram
537                     && self.totalswap == other.totalswap
538                     && self.freeswap == other.freeswap
539                     && self.procs == other.procs
540                     && self.pad == other.pad
541                     && self.totalhigh == other.totalhigh
542                     && self.freehigh == other.freehigh
543                     && self.mem_unit == other.mem_unit
544                     && self
545                     .__reserved
546                     .iter()
547                     .zip(other.__reserved.iter())
548                     .all(|(a,b)| a == b)
549             }
550         }
551         impl Eq for sysinfo {}
552         impl ::fmt::Debug for sysinfo {
553             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
554                 f.debug_struct("sysinfo")
555                     .field("uptime", &self.uptime)
556                     .field("loads", &self.loads)
557                     .field("totalram", &self.totalram)
558                     .field("freeram", &self.freeram)
559                     .field("sharedram", &self.sharedram)
560                     .field("bufferram", &self.bufferram)
561                     .field("totalswap", &self.totalswap)
562                     .field("freeswap", &self.freeswap)
563                     .field("procs", &self.procs)
564                     .field("pad", &self.pad)
565                     .field("totalhigh", &self.totalhigh)
566                     .field("freehigh", &self.freehigh)
567                     .field("mem_unit", &self.mem_unit)
568                     // FIXME: .field("__reserved", &self.__reserved)
569                     .finish()
570             }
571         }
572         impl ::hash::Hash for sysinfo {
573             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
574                 self.uptime.hash(state);
575                 self.loads.hash(state);
576                 self.totalram.hash(state);
577                 self.freeram.hash(state);
578                 self.sharedram.hash(state);
579                 self.bufferram.hash(state);
580                 self.totalswap.hash(state);
581                 self.freeswap.hash(state);
582                 self.procs.hash(state);
583                 self.pad.hash(state);
584                 self.totalhigh.hash(state);
585                 self.freehigh.hash(state);
586                 self.mem_unit.hash(state);
587                 self.__reserved.hash(state);
588             }
589         }
590 
591         impl PartialEq for mq_attr {
592             fn eq(&self, other: &mq_attr) -> bool {
593                 self.mq_flags == other.mq_flags &&
594                 self.mq_maxmsg == other.mq_maxmsg &&
595                 self.mq_msgsize == other.mq_msgsize &&
596                 self.mq_curmsgs == other.mq_curmsgs
597             }
598         }
599         impl Eq for mq_attr {}
600         impl ::fmt::Debug for mq_attr {
601             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
602                 f.debug_struct("mq_attr")
603                     .field("mq_flags", &self.mq_flags)
604                     .field("mq_maxmsg", &self.mq_maxmsg)
605                     .field("mq_msgsize", &self.mq_msgsize)
606                     .field("mq_curmsgs", &self.mq_curmsgs)
607                     .finish()
608             }
609         }
610         impl ::hash::Hash for mq_attr {
611             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
612                 self.mq_flags.hash(state);
613                 self.mq_maxmsg.hash(state);
614                 self.mq_msgsize.hash(state);
615                 self.mq_curmsgs.hash(state);
616             }
617         }
618     }
619 }
620 
621 pub const MADV_SOFT_OFFLINE: ::c_int = 101;
622 pub const MS_NOUSER: ::c_ulong = 0x80000000;
623 pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
624 
625 pub const ABDAY_1: ::nl_item = 0x20000;
626 pub const ABDAY_2: ::nl_item = 0x20001;
627 pub const ABDAY_3: ::nl_item = 0x20002;
628 pub const ABDAY_4: ::nl_item = 0x20003;
629 pub const ABDAY_5: ::nl_item = 0x20004;
630 pub const ABDAY_6: ::nl_item = 0x20005;
631 pub const ABDAY_7: ::nl_item = 0x20006;
632 
633 pub const DAY_1: ::nl_item = 0x20007;
634 pub const DAY_2: ::nl_item = 0x20008;
635 pub const DAY_3: ::nl_item = 0x20009;
636 pub const DAY_4: ::nl_item = 0x2000A;
637 pub const DAY_5: ::nl_item = 0x2000B;
638 pub const DAY_6: ::nl_item = 0x2000C;
639 pub const DAY_7: ::nl_item = 0x2000D;
640 
641 pub const ABMON_1: ::nl_item = 0x2000E;
642 pub const ABMON_2: ::nl_item = 0x2000F;
643 pub const ABMON_3: ::nl_item = 0x20010;
644 pub const ABMON_4: ::nl_item = 0x20011;
645 pub const ABMON_5: ::nl_item = 0x20012;
646 pub const ABMON_6: ::nl_item = 0x20013;
647 pub const ABMON_7: ::nl_item = 0x20014;
648 pub const ABMON_8: ::nl_item = 0x20015;
649 pub const ABMON_9: ::nl_item = 0x20016;
650 pub const ABMON_10: ::nl_item = 0x20017;
651 pub const ABMON_11: ::nl_item = 0x20018;
652 pub const ABMON_12: ::nl_item = 0x20019;
653 
654 pub const MON_1: ::nl_item = 0x2001A;
655 pub const MON_2: ::nl_item = 0x2001B;
656 pub const MON_3: ::nl_item = 0x2001C;
657 pub const MON_4: ::nl_item = 0x2001D;
658 pub const MON_5: ::nl_item = 0x2001E;
659 pub const MON_6: ::nl_item = 0x2001F;
660 pub const MON_7: ::nl_item = 0x20020;
661 pub const MON_8: ::nl_item = 0x20021;
662 pub const MON_9: ::nl_item = 0x20022;
663 pub const MON_10: ::nl_item = 0x20023;
664 pub const MON_11: ::nl_item = 0x20024;
665 pub const MON_12: ::nl_item = 0x20025;
666 
667 pub const AM_STR: ::nl_item = 0x20026;
668 pub const PM_STR: ::nl_item = 0x20027;
669 
670 pub const D_T_FMT: ::nl_item = 0x20028;
671 pub const D_FMT: ::nl_item = 0x20029;
672 pub const T_FMT: ::nl_item = 0x2002A;
673 pub const T_FMT_AMPM: ::nl_item = 0x2002B;
674 
675 pub const ERA: ::nl_item = 0x2002C;
676 pub const ERA_D_FMT: ::nl_item = 0x2002E;
677 pub const ALT_DIGITS: ::nl_item = 0x2002F;
678 pub const ERA_D_T_FMT: ::nl_item = 0x20030;
679 pub const ERA_T_FMT: ::nl_item = 0x20031;
680 
681 pub const CODESET: ::nl_item = 14;
682 
683 pub const CRNCYSTR: ::nl_item = 0x4000F;
684 
685 pub const RUSAGE_THREAD: ::c_int = 1;
686 pub const RUSAGE_CHILDREN: ::c_int = -1;
687 
688 pub const RADIXCHAR: ::nl_item = 0x10000;
689 pub const THOUSEP: ::nl_item = 0x10001;
690 
691 pub const YESEXPR: ::nl_item = 0x50000;
692 pub const NOEXPR: ::nl_item = 0x50001;
693 pub const YESSTR: ::nl_item = 0x50002;
694 pub const NOSTR: ::nl_item = 0x50003;
695 
696 pub const FILENAME_MAX: ::c_uint = 4096;
697 pub const L_tmpnam: ::c_uint = 20;
698 pub const _PC_LINK_MAX: ::c_int = 0;
699 pub const _PC_MAX_CANON: ::c_int = 1;
700 pub const _PC_MAX_INPUT: ::c_int = 2;
701 pub const _PC_NAME_MAX: ::c_int = 3;
702 pub const _PC_PATH_MAX: ::c_int = 4;
703 pub const _PC_PIPE_BUF: ::c_int = 5;
704 pub const _PC_CHOWN_RESTRICTED: ::c_int = 6;
705 pub const _PC_NO_TRUNC: ::c_int = 7;
706 pub const _PC_VDISABLE: ::c_int = 8;
707 pub const _PC_SYNC_IO: ::c_int = 9;
708 pub const _PC_ASYNC_IO: ::c_int = 10;
709 pub const _PC_PRIO_IO: ::c_int = 11;
710 pub const _PC_SOCK_MAXBUF: ::c_int = 12;
711 pub const _PC_FILESIZEBITS: ::c_int = 13;
712 pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14;
713 pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15;
714 pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16;
715 pub const _PC_REC_XFER_ALIGN: ::c_int = 17;
716 pub const _PC_ALLOC_SIZE_MIN: ::c_int = 18;
717 pub const _PC_SYMLINK_MAX: ::c_int = 19;
718 pub const _PC_2_SYMLINKS: ::c_int = 20;
719 
720 pub const _SC_ARG_MAX: ::c_int = 0;
721 pub const _SC_CHILD_MAX: ::c_int = 1;
722 pub const _SC_CLK_TCK: ::c_int = 2;
723 pub const _SC_NGROUPS_MAX: ::c_int = 3;
724 pub const _SC_OPEN_MAX: ::c_int = 4;
725 pub const _SC_STREAM_MAX: ::c_int = 5;
726 pub const _SC_TZNAME_MAX: ::c_int = 6;
727 pub const _SC_JOB_CONTROL: ::c_int = 7;
728 pub const _SC_SAVED_IDS: ::c_int = 8;
729 pub const _SC_REALTIME_SIGNALS: ::c_int = 9;
730 pub const _SC_PRIORITY_SCHEDULING: ::c_int = 10;
731 pub const _SC_TIMERS: ::c_int = 11;
732 pub const _SC_ASYNCHRONOUS_IO: ::c_int = 12;
733 pub const _SC_PRIORITIZED_IO: ::c_int = 13;
734 pub const _SC_SYNCHRONIZED_IO: ::c_int = 14;
735 pub const _SC_FSYNC: ::c_int = 15;
736 pub const _SC_MAPPED_FILES: ::c_int = 16;
737 pub const _SC_MEMLOCK: ::c_int = 17;
738 pub const _SC_MEMLOCK_RANGE: ::c_int = 18;
739 pub const _SC_MEMORY_PROTECTION: ::c_int = 19;
740 pub const _SC_MESSAGE_PASSING: ::c_int = 20;
741 pub const _SC_SEMAPHORES: ::c_int = 21;
742 pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 22;
743 pub const _SC_AIO_LISTIO_MAX: ::c_int = 23;
744 pub const _SC_AIO_MAX: ::c_int = 24;
745 pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 25;
746 pub const _SC_DELAYTIMER_MAX: ::c_int = 26;
747 pub const _SC_MQ_OPEN_MAX: ::c_int = 27;
748 pub const _SC_MQ_PRIO_MAX: ::c_int = 28;
749 pub const _SC_VERSION: ::c_int = 29;
750 pub const _SC_PAGESIZE: ::c_int = 30;
751 pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
752 pub const _SC_RTSIG_MAX: ::c_int = 31;
753 pub const _SC_SEM_NSEMS_MAX: ::c_int = 32;
754 pub const _SC_SEM_VALUE_MAX: ::c_int = 33;
755 pub const _SC_SIGQUEUE_MAX: ::c_int = 34;
756 pub const _SC_TIMER_MAX: ::c_int = 35;
757 pub const _SC_BC_BASE_MAX: ::c_int = 36;
758 pub const _SC_BC_DIM_MAX: ::c_int = 37;
759 pub const _SC_BC_SCALE_MAX: ::c_int = 38;
760 pub const _SC_BC_STRING_MAX: ::c_int = 39;
761 pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 40;
762 pub const _SC_EXPR_NEST_MAX: ::c_int = 42;
763 pub const _SC_LINE_MAX: ::c_int = 43;
764 pub const _SC_RE_DUP_MAX: ::c_int = 44;
765 pub const _SC_2_VERSION: ::c_int = 46;
766 pub const _SC_2_C_BIND: ::c_int = 47;
767 pub const _SC_2_C_DEV: ::c_int = 48;
768 pub const _SC_2_FORT_DEV: ::c_int = 49;
769 pub const _SC_2_FORT_RUN: ::c_int = 50;
770 pub const _SC_2_SW_DEV: ::c_int = 51;
771 pub const _SC_2_LOCALEDEF: ::c_int = 52;
772 pub const _SC_UIO_MAXIOV: ::c_int = 60;
773 pub const _SC_IOV_MAX: ::c_int = 60;
774 pub const _SC_THREADS: ::c_int = 67;
775 pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 68;
776 pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 69;
777 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 70;
778 pub const _SC_LOGIN_NAME_MAX: ::c_int = 71;
779 pub const _SC_TTY_NAME_MAX: ::c_int = 72;
780 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 73;
781 pub const _SC_THREAD_KEYS_MAX: ::c_int = 74;
782 pub const _SC_THREAD_STACK_MIN: ::c_int = 75;
783 pub const _SC_THREAD_THREADS_MAX: ::c_int = 76;
784 pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77;
785 pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78;
786 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79;
787 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80;
788 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81;
789 pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 82;
790 pub const _SC_NPROCESSORS_CONF: ::c_int = 83;
791 pub const _SC_NPROCESSORS_ONLN: ::c_int = 84;
792 pub const _SC_PHYS_PAGES: ::c_int = 85;
793 pub const _SC_AVPHYS_PAGES: ::c_int = 86;
794 pub const _SC_ATEXIT_MAX: ::c_int = 87;
795 pub const _SC_PASS_MAX: ::c_int = 88;
796 pub const _SC_XOPEN_VERSION: ::c_int = 89;
797 pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90;
798 pub const _SC_XOPEN_UNIX: ::c_int = 91;
799 pub const _SC_XOPEN_CRYPT: ::c_int = 92;
800 pub const _SC_XOPEN_ENH_I18N: ::c_int = 93;
801 pub const _SC_XOPEN_SHM: ::c_int = 94;
802 pub const _SC_2_CHAR_TERM: ::c_int = 95;
803 pub const _SC_2_UPE: ::c_int = 97;
804 pub const _SC_XOPEN_XPG2: ::c_int = 98;
805 pub const _SC_XOPEN_XPG3: ::c_int = 99;
806 pub const _SC_XOPEN_XPG4: ::c_int = 100;
807 pub const _SC_NZERO: ::c_int = 109;
808 pub const _SC_XBS5_ILP32_OFF32: ::c_int = 125;
809 pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126;
810 pub const _SC_XBS5_LP64_OFF64: ::c_int = 127;
811 pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 128;
812 pub const _SC_XOPEN_LEGACY: ::c_int = 129;
813 pub const _SC_XOPEN_REALTIME: ::c_int = 130;
814 pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 131;
815 pub const _SC_ADVISORY_INFO: ::c_int = 132;
816 pub const _SC_BARRIERS: ::c_int = 133;
817 pub const _SC_CLOCK_SELECTION: ::c_int = 137;
818 pub const _SC_CPUTIME: ::c_int = 138;
819 pub const _SC_THREAD_CPUTIME: ::c_int = 139;
820 pub const _SC_MONOTONIC_CLOCK: ::c_int = 149;
821 pub const _SC_READER_WRITER_LOCKS: ::c_int = 153;
822 pub const _SC_SPIN_LOCKS: ::c_int = 154;
823 pub const _SC_REGEXP: ::c_int = 155;
824 pub const _SC_SHELL: ::c_int = 157;
825 pub const _SC_SPAWN: ::c_int = 159;
826 pub const _SC_SPORADIC_SERVER: ::c_int = 160;
827 pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 161;
828 pub const _SC_TIMEOUTS: ::c_int = 164;
829 pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 165;
830 pub const _SC_2_PBS: ::c_int = 168;
831 pub const _SC_2_PBS_ACCOUNTING: ::c_int = 169;
832 pub const _SC_2_PBS_LOCATE: ::c_int = 170;
833 pub const _SC_2_PBS_MESSAGE: ::c_int = 171;
834 pub const _SC_2_PBS_TRACK: ::c_int = 172;
835 pub const _SC_SYMLOOP_MAX: ::c_int = 173;
836 pub const _SC_STREAMS: ::c_int = 174;
837 pub const _SC_2_PBS_CHECKPOINT: ::c_int = 175;
838 pub const _SC_V6_ILP32_OFF32: ::c_int = 176;
839 pub const _SC_V6_ILP32_OFFBIG: ::c_int = 177;
840 pub const _SC_V6_LP64_OFF64: ::c_int = 178;
841 pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 179;
842 pub const _SC_HOST_NAME_MAX: ::c_int = 180;
843 pub const _SC_TRACE: ::c_int = 181;
844 pub const _SC_TRACE_EVENT_FILTER: ::c_int = 182;
845 pub const _SC_TRACE_INHERIT: ::c_int = 183;
846 pub const _SC_TRACE_LOG: ::c_int = 184;
847 pub const _SC_IPV6: ::c_int = 235;
848 pub const _SC_RAW_SOCKETS: ::c_int = 236;
849 pub const _SC_V7_ILP32_OFF32: ::c_int = 237;
850 pub const _SC_V7_ILP32_OFFBIG: ::c_int = 238;
851 pub const _SC_V7_LP64_OFF64: ::c_int = 239;
852 pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 240;
853 pub const _SC_SS_REPL_MAX: ::c_int = 241;
854 pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 242;
855 pub const _SC_TRACE_NAME_MAX: ::c_int = 243;
856 pub const _SC_TRACE_SYS_MAX: ::c_int = 244;
857 pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 245;
858 pub const _SC_XOPEN_STREAMS: ::c_int = 246;
859 pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 247;
860 pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 248;
861 
862 pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY;
863 pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY;
864 
865 pub const GLOB_ERR: ::c_int = 1 << 0;
866 pub const GLOB_MARK: ::c_int = 1 << 1;
867 pub const GLOB_NOSORT: ::c_int = 1 << 2;
868 pub const GLOB_DOOFFS: ::c_int = 1 << 3;
869 pub const GLOB_NOCHECK: ::c_int = 1 << 4;
870 pub const GLOB_APPEND: ::c_int = 1 << 5;
871 pub const GLOB_NOESCAPE: ::c_int = 1 << 6;
872 
873 pub const GLOB_NOSPACE: ::c_int = 1;
874 pub const GLOB_ABORTED: ::c_int = 2;
875 pub const GLOB_NOMATCH: ::c_int = 3;
876 
877 pub const POSIX_MADV_NORMAL: ::c_int = 0;
878 pub const POSIX_MADV_RANDOM: ::c_int = 1;
879 pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
880 pub const POSIX_MADV_WILLNEED: ::c_int = 3;
881 
882 pub const S_IEXEC: mode_t = 64;
883 pub const S_IWRITE: mode_t = 128;
884 pub const S_IREAD: mode_t = 256;
885 
886 pub const F_LOCK: ::c_int = 1;
887 pub const F_TEST: ::c_int = 3;
888 pub const F_TLOCK: ::c_int = 2;
889 pub const F_ULOCK: ::c_int = 0;
890 
891 pub const ST_RDONLY: ::c_ulong = 1;
892 pub const ST_NOSUID: ::c_ulong = 2;
893 pub const ST_NODEV: ::c_ulong = 4;
894 pub const ST_NOEXEC: ::c_ulong = 8;
895 pub const ST_SYNCHRONOUS: ::c_ulong = 16;
896 pub const ST_MANDLOCK: ::c_ulong = 64;
897 pub const ST_WRITE: ::c_ulong = 128;
898 pub const ST_APPEND: ::c_ulong = 256;
899 pub const ST_IMMUTABLE: ::c_ulong = 512;
900 pub const ST_NOATIME: ::c_ulong = 1024;
901 pub const ST_NODIRATIME: ::c_ulong = 2048;
902 
903 pub const RTLD_NEXT: *mut ::c_void = -1i64 as *mut ::c_void;
904 pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
905 pub const RTLD_NODELETE: ::c_int = 0x1000;
906 pub const RTLD_NOW: ::c_int = 0x2;
907 
908 align_const! {
909     pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
910         size: [0; __SIZEOF_PTHREAD_MUTEX_T],
911     };
912     pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
913         size: [0; __SIZEOF_PTHREAD_COND_T],
914     };
915     pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
916         size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
917     };
918 }
919 
920 pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
921 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
922 pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
923 pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
924 pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
925 pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
926 pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
927 
928 pub const SCHED_OTHER: ::c_int = 0;
929 pub const SCHED_FIFO: ::c_int = 1;
930 pub const SCHED_RR: ::c_int = 2;
931 pub const SCHED_BATCH: ::c_int = 3;
932 pub const SCHED_IDLE: ::c_int = 5;
933 
934 pub const AF_IB: ::c_int = 27;
935 pub const AF_MPLS: ::c_int = 28;
936 pub const AF_NFC: ::c_int = 39;
937 pub const AF_VSOCK: ::c_int = 40;
938 pub const PF_IB: ::c_int = AF_IB;
939 pub const PF_MPLS: ::c_int = AF_MPLS;
940 pub const PF_NFC: ::c_int = AF_NFC;
941 pub const PF_VSOCK: ::c_int = AF_VSOCK;
942 
943 // System V IPC
944 pub const IPC_PRIVATE: ::key_t = 0;
945 
946 pub const IPC_CREAT: ::c_int = 0o1000;
947 pub const IPC_EXCL: ::c_int = 0o2000;
948 pub const IPC_NOWAIT: ::c_int = 0o4000;
949 
950 pub const IPC_RMID: ::c_int = 0;
951 pub const IPC_SET: ::c_int = 1;
952 pub const IPC_STAT: ::c_int = 2;
953 pub const IPC_INFO: ::c_int = 3;
954 pub const MSG_STAT: ::c_int = 11;
955 pub const MSG_INFO: ::c_int = 12;
956 
957 pub const MSG_NOERROR: ::c_int = 0o10000;
958 pub const MSG_EXCEPT: ::c_int = 0o20000;
959 
960 pub const SHM_R: ::c_int = 0o400;
961 pub const SHM_W: ::c_int = 0o200;
962 
963 pub const SHM_RDONLY: ::c_int = 0o10000;
964 pub const SHM_RND: ::c_int = 0o20000;
965 pub const SHM_REMAP: ::c_int = 0o40000;
966 pub const SHM_EXEC: ::c_int = 0o100000;
967 
968 pub const SHM_LOCK: ::c_int = 11;
969 pub const SHM_UNLOCK: ::c_int = 12;
970 
971 pub const SHM_HUGETLB: ::c_int = 0o4000;
972 pub const SHM_NORESERVE: ::c_int = 0o10000;
973 
974 pub const QFMT_VFS_OLD: ::c_int = 1;
975 pub const QFMT_VFS_V0: ::c_int = 2;
976 
977 pub const EFD_SEMAPHORE: ::c_int = 0x1;
978 
979 pub const LOG_NFACILITIES: ::c_int = 24;
980 
981 pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t;
982 
983 pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32;
984 pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32;
985 pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32;
986 pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32;
987 pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32;
988 pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2u32 as i32;
989 pub const RB_KEXEC: ::c_int = 0x45584543u32 as i32;
990 
991 pub const AI_PASSIVE: ::c_int = 0x0001;
992 pub const AI_CANONNAME: ::c_int = 0x0002;
993 pub const AI_NUMERICHOST: ::c_int = 0x0004;
994 pub const AI_V4MAPPED: ::c_int = 0x0008;
995 pub const AI_ALL: ::c_int = 0x0010;
996 pub const AI_ADDRCONFIG: ::c_int = 0x0020;
997 
998 pub const AI_NUMERICSERV: ::c_int = 0x0400;
999 
1000 pub const EAI_BADFLAGS: ::c_int = -1;
1001 pub const EAI_NONAME: ::c_int = -2;
1002 pub const EAI_AGAIN: ::c_int = -3;
1003 pub const EAI_FAIL: ::c_int = -4;
1004 pub const EAI_FAMILY: ::c_int = -6;
1005 pub const EAI_SOCKTYPE: ::c_int = -7;
1006 pub const EAI_SERVICE: ::c_int = -8;
1007 pub const EAI_MEMORY: ::c_int = -10;
1008 pub const EAI_OVERFLOW: ::c_int = -12;
1009 
1010 pub const NI_NUMERICHOST: ::c_int = 1;
1011 pub const NI_NUMERICSERV: ::c_int = 2;
1012 pub const NI_NOFQDN: ::c_int = 4;
1013 pub const NI_NAMEREQD: ::c_int = 8;
1014 pub const NI_DGRAM: ::c_int = 16;
1015 
1016 pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1;
1017 pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2;
1018 pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4;
1019 
1020 pub const EAI_SYSTEM: ::c_int = -11;
1021 
1022 pub const AIO_CANCELED: ::c_int = 0;
1023 pub const AIO_NOTCANCELED: ::c_int = 1;
1024 pub const AIO_ALLDONE: ::c_int = 2;
1025 pub const LIO_READ: ::c_int = 0;
1026 pub const LIO_WRITE: ::c_int = 1;
1027 pub const LIO_NOP: ::c_int = 2;
1028 pub const LIO_WAIT: ::c_int = 0;
1029 pub const LIO_NOWAIT: ::c_int = 1;
1030 
1031 pub const MREMAP_MAYMOVE: ::c_int = 1;
1032 pub const MREMAP_FIXED: ::c_int = 2;
1033 
1034 pub const PR_SET_PDEATHSIG: ::c_int = 1;
1035 pub const PR_GET_PDEATHSIG: ::c_int = 2;
1036 
1037 pub const PR_GET_DUMPABLE: ::c_int = 3;
1038 pub const PR_SET_DUMPABLE: ::c_int = 4;
1039 
1040 pub const PR_GET_UNALIGN: ::c_int = 5;
1041 pub const PR_SET_UNALIGN: ::c_int = 6;
1042 pub const PR_UNALIGN_NOPRINT: ::c_int = 1;
1043 pub const PR_UNALIGN_SIGBUS: ::c_int = 2;
1044 
1045 pub const PR_GET_KEEPCAPS: ::c_int = 7;
1046 pub const PR_SET_KEEPCAPS: ::c_int = 8;
1047 
1048 pub const PR_GET_FPEMU: ::c_int = 9;
1049 pub const PR_SET_FPEMU: ::c_int = 10;
1050 pub const PR_FPEMU_NOPRINT: ::c_int = 1;
1051 pub const PR_FPEMU_SIGFPE: ::c_int = 2;
1052 
1053 pub const PR_GET_FPEXC: ::c_int = 11;
1054 pub const PR_SET_FPEXC: ::c_int = 12;
1055 pub const PR_FP_EXC_SW_ENABLE: ::c_int = 0x80;
1056 pub const PR_FP_EXC_DIV: ::c_int = 0x010000;
1057 pub const PR_FP_EXC_OVF: ::c_int = 0x020000;
1058 pub const PR_FP_EXC_UND: ::c_int = 0x040000;
1059 pub const PR_FP_EXC_RES: ::c_int = 0x080000;
1060 pub const PR_FP_EXC_INV: ::c_int = 0x100000;
1061 pub const PR_FP_EXC_DISABLED: ::c_int = 0;
1062 pub const PR_FP_EXC_NONRECOV: ::c_int = 1;
1063 pub const PR_FP_EXC_ASYNC: ::c_int = 2;
1064 pub const PR_FP_EXC_PRECISE: ::c_int = 3;
1065 
1066 pub const PR_GET_TIMING: ::c_int = 13;
1067 pub const PR_SET_TIMING: ::c_int = 14;
1068 pub const PR_TIMING_STATISTICAL: ::c_int = 0;
1069 pub const PR_TIMING_TIMESTAMP: ::c_int = 1;
1070 
1071 pub const PR_SET_NAME: ::c_int = 15;
1072 pub const PR_GET_NAME: ::c_int = 16;
1073 
1074 pub const PR_GET_ENDIAN: ::c_int = 19;
1075 pub const PR_SET_ENDIAN: ::c_int = 20;
1076 pub const PR_ENDIAN_BIG: ::c_int = 0;
1077 pub const PR_ENDIAN_LITTLE: ::c_int = 1;
1078 pub const PR_ENDIAN_PPC_LITTLE: ::c_int = 2;
1079 
1080 pub const PR_GET_SECCOMP: ::c_int = 21;
1081 pub const PR_SET_SECCOMP: ::c_int = 22;
1082 
1083 pub const PR_CAPBSET_READ: ::c_int = 23;
1084 pub const PR_CAPBSET_DROP: ::c_int = 24;
1085 
1086 pub const PR_GET_TSC: ::c_int = 25;
1087 pub const PR_SET_TSC: ::c_int = 26;
1088 pub const PR_TSC_ENABLE: ::c_int = 1;
1089 pub const PR_TSC_SIGSEGV: ::c_int = 2;
1090 
1091 pub const PR_GET_SECUREBITS: ::c_int = 27;
1092 pub const PR_SET_SECUREBITS: ::c_int = 28;
1093 
1094 pub const PR_SET_TIMERSLACK: ::c_int = 29;
1095 pub const PR_GET_TIMERSLACK: ::c_int = 30;
1096 
1097 pub const PR_TASK_PERF_EVENTS_DISABLE: ::c_int = 31;
1098 pub const PR_TASK_PERF_EVENTS_ENABLE: ::c_int = 32;
1099 
1100 pub const PR_MCE_KILL: ::c_int = 33;
1101 pub const PR_MCE_KILL_CLEAR: ::c_int = 0;
1102 pub const PR_MCE_KILL_SET: ::c_int = 1;
1103 
1104 pub const PR_MCE_KILL_LATE: ::c_int = 0;
1105 pub const PR_MCE_KILL_EARLY: ::c_int = 1;
1106 pub const PR_MCE_KILL_DEFAULT: ::c_int = 2;
1107 
1108 pub const PR_MCE_KILL_GET: ::c_int = 34;
1109 
1110 pub const PR_SET_MM: ::c_int = 35;
1111 pub const PR_SET_MM_START_CODE: ::c_int = 1;
1112 pub const PR_SET_MM_END_CODE: ::c_int = 2;
1113 pub const PR_SET_MM_START_DATA: ::c_int = 3;
1114 pub const PR_SET_MM_END_DATA: ::c_int = 4;
1115 pub const PR_SET_MM_START_STACK: ::c_int = 5;
1116 pub const PR_SET_MM_START_BRK: ::c_int = 6;
1117 pub const PR_SET_MM_BRK: ::c_int = 7;
1118 pub const PR_SET_MM_ARG_START: ::c_int = 8;
1119 pub const PR_SET_MM_ARG_END: ::c_int = 9;
1120 pub const PR_SET_MM_ENV_START: ::c_int = 10;
1121 pub const PR_SET_MM_ENV_END: ::c_int = 11;
1122 pub const PR_SET_MM_AUXV: ::c_int = 12;
1123 pub const PR_SET_MM_EXE_FILE: ::c_int = 13;
1124 pub const PR_SET_MM_MAP: ::c_int = 14;
1125 pub const PR_SET_MM_MAP_SIZE: ::c_int = 15;
1126 
1127 pub const PR_SET_PTRACER: ::c_int = 0x59616d61;
1128 pub const PR_SET_PTRACER_ANY: ::c_ulong = 0xffffffffffffffff;
1129 
1130 pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36;
1131 pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37;
1132 
1133 pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38;
1134 pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39;
1135 
1136 pub const PR_GET_TID_ADDRESS: ::c_int = 40;
1137 
1138 pub const PR_SET_THP_DISABLE: ::c_int = 41;
1139 pub const PR_GET_THP_DISABLE: ::c_int = 42;
1140 
1141 pub const PR_MPX_ENABLE_MANAGEMENT: ::c_int = 43;
1142 pub const PR_MPX_DISABLE_MANAGEMENT: ::c_int = 44;
1143 
1144 pub const PR_SET_FP_MODE: ::c_int = 45;
1145 pub const PR_GET_FP_MODE: ::c_int = 46;
1146 pub const PR_FP_MODE_FR: ::c_int = 1 << 0;
1147 pub const PR_FP_MODE_FRE: ::c_int = 1 << 1;
1148 
1149 pub const PR_CAP_AMBIENT: ::c_int = 47;
1150 pub const PR_CAP_AMBIENT_IS_SET: ::c_int = 1;
1151 pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2;
1152 pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3;
1153 pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4;
1154 
1155 pub const ITIMER_REAL: ::c_int = 0;
1156 pub const ITIMER_VIRTUAL: ::c_int = 1;
1157 pub const ITIMER_PROF: ::c_int = 2;
1158 
1159 pub const _POSIX_VDISABLE: ::cc_t = 0;
1160 
1161 pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
1162 pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
1163 
1164 // On Linux, libc doesn't define this constant, libattr does instead.
1165 // We still define it for Linux as it's defined by libc on other platforms,
1166 // and it's mentioned in the man pages for getxattr and setxattr.
1167 pub const SFD_CLOEXEC: ::c_int = 0x080000;
1168 
1169 pub const NCCS: usize = 32;
1170 
1171 pub const O_TRUNC: ::c_int = 512;
1172 pub const O_NOATIME: ::c_int = 0o1000000;
1173 pub const O_CLOEXEC: ::c_int = 0x80000;
1174 
1175 // Defined as wasi value.
1176 pub const EPERM: ::c_int = 63;
1177 pub const ENOENT: ::c_int = 44;
1178 pub const ESRCH: ::c_int = 71;
1179 pub const EINTR: ::c_int = 27;
1180 pub const EIO: ::c_int = 29;
1181 pub const ENXIO: ::c_int = 60;
1182 pub const E2BIG: ::c_int = 1;
1183 pub const ENOEXEC: ::c_int = 45;
1184 pub const EBADF: ::c_int = 8;
1185 pub const ECHILD: ::c_int = 12;
1186 pub const EAGAIN: ::c_int = 6;
1187 pub const ENOMEM: ::c_int = 48;
1188 pub const EACCES: ::c_int = 2;
1189 pub const EFAULT: ::c_int = 21;
1190 pub const ENOTBLK: ::c_int = 105;
1191 pub const EBUSY: ::c_int = 10;
1192 pub const EEXIST: ::c_int = 20;
1193 pub const EXDEV: ::c_int = 75;
1194 pub const ENODEV: ::c_int = 43;
1195 pub const ENOTDIR: ::c_int = 54;
1196 pub const EISDIR: ::c_int = 31;
1197 pub const EINVAL: ::c_int = 28;
1198 pub const ENFILE: ::c_int = 41;
1199 pub const EMFILE: ::c_int = 33;
1200 pub const ENOTTY: ::c_int = 59;
1201 pub const ETXTBSY: ::c_int = 74;
1202 pub const EFBIG: ::c_int = 22;
1203 pub const ENOSPC: ::c_int = 51;
1204 pub const ESPIPE: ::c_int = 70;
1205 pub const EROFS: ::c_int = 69;
1206 pub const EMLINK: ::c_int = 34;
1207 pub const EPIPE: ::c_int = 64;
1208 pub const EDOM: ::c_int = 18;
1209 pub const ERANGE: ::c_int = 68;
1210 pub const EWOULDBLOCK: ::c_int = EAGAIN;
1211 pub const ENOLINK: ::c_int = 47;
1212 pub const EPROTO: ::c_int = 65;
1213 pub const EDEADLK: ::c_int = 16;
1214 pub const EDEADLOCK: ::c_int = EDEADLK;
1215 pub const ENAMETOOLONG: ::c_int = 37;
1216 pub const ENOLCK: ::c_int = 46;
1217 pub const ENOSYS: ::c_int = 52;
1218 pub const ENOTEMPTY: ::c_int = 55;
1219 pub const ELOOP: ::c_int = 32;
1220 pub const ENOMSG: ::c_int = 49;
1221 pub const EIDRM: ::c_int = 24;
1222 pub const EMULTIHOP: ::c_int = 36;
1223 pub const EBADMSG: ::c_int = 9;
1224 pub const EOVERFLOW: ::c_int = 61;
1225 pub const EILSEQ: ::c_int = 25;
1226 pub const ENOTSOCK: ::c_int = 57;
1227 pub const EDESTADDRREQ: ::c_int = 17;
1228 pub const EMSGSIZE: ::c_int = 35;
1229 pub const EPROTOTYPE: ::c_int = 67;
1230 pub const ENOPROTOOPT: ::c_int = 50;
1231 pub const EPROTONOSUPPORT: ::c_int = 66;
1232 pub const EAFNOSUPPORT: ::c_int = 5;
1233 pub const EADDRINUSE: ::c_int = 3;
1234 pub const EADDRNOTAVAIL: ::c_int = 4;
1235 pub const ENETDOWN: ::c_int = 38;
1236 pub const ENETUNREACH: ::c_int = 40;
1237 pub const ENETRESET: ::c_int = 39;
1238 pub const ECONNABORTED: ::c_int = 13;
1239 pub const ECONNRESET: ::c_int = 15;
1240 pub const ENOBUFS: ::c_int = 42;
1241 pub const EISCONN: ::c_int = 30;
1242 pub const ENOTCONN: ::c_int = 53;
1243 pub const ETIMEDOUT: ::c_int = 73;
1244 pub const ECONNREFUSED: ::c_int = 14;
1245 pub const EHOSTUNREACH: ::c_int = 23;
1246 pub const EALREADY: ::c_int = 7;
1247 pub const EINPROGRESS: ::c_int = 26;
1248 pub const ESTALE: ::c_int = 72;
1249 pub const EDQUOT: ::c_int = 19;
1250 pub const ECANCELED: ::c_int = 11;
1251 pub const EOWNERDEAD: ::c_int = 62;
1252 pub const ENOTRECOVERABLE: ::c_int = 56;
1253 
1254 pub const ENOSTR: ::c_int = 100;
1255 pub const EBFONT: ::c_int = 101;
1256 pub const EBADSLT: ::c_int = 102;
1257 pub const EBADRQC: ::c_int = 103;
1258 pub const ENOANO: ::c_int = 104;
1259 pub const ECHRNG: ::c_int = 106;
1260 pub const EL3HLT: ::c_int = 107;
1261 pub const EL3RST: ::c_int = 108;
1262 pub const ELNRNG: ::c_int = 109;
1263 pub const EUNATCH: ::c_int = 110;
1264 pub const ENOCSI: ::c_int = 111;
1265 pub const EL2HLT: ::c_int = 112;
1266 pub const EBADE: ::c_int = 113;
1267 pub const EBADR: ::c_int = 114;
1268 pub const EXFULL: ::c_int = 115;
1269 pub const ENODATA: ::c_int = 116;
1270 pub const ETIME: ::c_int = 117;
1271 pub const ENOSR: ::c_int = 118;
1272 pub const ENONET: ::c_int = 119;
1273 pub const ENOPKG: ::c_int = 120;
1274 pub const EREMOTE: ::c_int = 121;
1275 pub const EADV: ::c_int = 122;
1276 pub const ESRMNT: ::c_int = 123;
1277 pub const ECOMM: ::c_int = 124;
1278 pub const EDOTDOT: ::c_int = 125;
1279 pub const ENOTUNIQ: ::c_int = 126;
1280 pub const EBADFD: ::c_int = 127;
1281 pub const EREMCHG: ::c_int = 128;
1282 pub const ELIBACC: ::c_int = 129;
1283 pub const ELIBBAD: ::c_int = 130;
1284 pub const ELIBSCN: ::c_int = 131;
1285 pub const ELIBMAX: ::c_int = 132;
1286 pub const ELIBEXEC: ::c_int = 133;
1287 pub const ERESTART: ::c_int = 134;
1288 pub const ESTRPIPE: ::c_int = 135;
1289 pub const EUSERS: ::c_int = 136;
1290 pub const ESOCKTNOSUPPORT: ::c_int = 137;
1291 pub const EOPNOTSUPP: ::c_int = 138;
1292 pub const ENOTSUP: ::c_int = EOPNOTSUPP;
1293 pub const EPFNOSUPPORT: ::c_int = 139;
1294 pub const ESHUTDOWN: ::c_int = 140;
1295 pub const ETOOMANYREFS: ::c_int = 141;
1296 pub const EHOSTDOWN: ::c_int = 142;
1297 pub const EUCLEAN: ::c_int = 143;
1298 pub const ENOTNAM: ::c_int = 144;
1299 pub const ENAVAIL: ::c_int = 145;
1300 pub const EISNAM: ::c_int = 146;
1301 pub const EREMOTEIO: ::c_int = 147;
1302 pub const ENOMEDIUM: ::c_int = 148;
1303 pub const EMEDIUMTYPE: ::c_int = 149;
1304 pub const ENOKEY: ::c_int = 150;
1305 pub const EKEYEXPIRED: ::c_int = 151;
1306 pub const EKEYREVOKED: ::c_int = 152;
1307 pub const EKEYREJECTED: ::c_int = 153;
1308 pub const ERFKILL: ::c_int = 154;
1309 pub const EHWPOISON: ::c_int = 155;
1310 pub const EL2NSYNC: ::c_int = 156;
1311 
1312 pub const SA_NODEFER: ::c_int = 0x40000000;
1313 pub const SA_RESETHAND: ::c_int = 0x80000000;
1314 pub const SA_RESTART: ::c_int = 0x10000000;
1315 pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
1316 
1317 pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
1318 
1319 pub const EFD_CLOEXEC: ::c_int = 0x80000;
1320 
1321 pub const BUFSIZ: ::c_uint = 1024;
1322 pub const TMP_MAX: ::c_uint = 10000;
1323 pub const FOPEN_MAX: ::c_uint = 1000;
1324 pub const O_PATH: ::c_int = 0o10000000;
1325 pub const O_EXEC: ::c_int = 0o10000000;
1326 pub const O_SEARCH: ::c_int = 0o10000000;
1327 pub const O_ACCMODE: ::c_int = 0o10000003;
1328 pub const O_NDELAY: ::c_int = O_NONBLOCK;
1329 pub const NI_MAXHOST: ::socklen_t = 255;
1330 pub const PTHREAD_STACK_MIN: ::size_t = 2048;
1331 pub const POSIX_FADV_DONTNEED: ::c_int = 4;
1332 pub const POSIX_FADV_NOREUSE: ::c_int = 5;
1333 
1334 pub const POSIX_MADV_DONTNEED: ::c_int = 0;
1335 
1336 pub const RLIM_INFINITY: ::rlim_t = !0;
1337 pub const RLIMIT_NLIMITS: ::c_int = 15;
1338 pub const RLIM_NLIMITS: ::c_int = RLIMIT_NLIMITS;
1339 
1340 pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
1341 
1342 #[doc(hidden)]
1343 #[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
1344 pub const SIGUNUSED: ::c_int = ::SIGSYS;
1345 
1346 pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
1347 pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
1348 pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
1349 
1350 pub const CPU_SETSIZE: ::c_int = 128;
1351 
1352 pub const QFMT_VFS_V1: ::c_int = 4;
1353 
1354 pub const PTRACE_TRACEME: ::c_int = 0;
1355 pub const PTRACE_PEEKTEXT: ::c_int = 1;
1356 pub const PTRACE_PEEKDATA: ::c_int = 2;
1357 pub const PTRACE_PEEKUSER: ::c_int = 3;
1358 pub const PTRACE_POKETEXT: ::c_int = 4;
1359 pub const PTRACE_POKEDATA: ::c_int = 5;
1360 pub const PTRACE_POKEUSER: ::c_int = 6;
1361 pub const PTRACE_CONT: ::c_int = 7;
1362 pub const PTRACE_KILL: ::c_int = 8;
1363 pub const PTRACE_SINGLESTEP: ::c_int = 9;
1364 pub const PTRACE_ATTACH: ::c_int = 16;
1365 pub const PTRACE_DETACH: ::c_int = 17;
1366 pub const PTRACE_SYSCALL: ::c_int = 24;
1367 pub const PTRACE_SETOPTIONS: ::c_int = 0x4200;
1368 pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201;
1369 pub const PTRACE_GETSIGINFO: ::c_int = 0x4202;
1370 pub const PTRACE_SETSIGINFO: ::c_int = 0x4203;
1371 pub const PTRACE_GETREGSET: ::c_int = 0x4204;
1372 pub const PTRACE_SETREGSET: ::c_int = 0x4205;
1373 pub const PTRACE_SEIZE: ::c_int = 0x4206;
1374 pub const PTRACE_INTERRUPT: ::c_int = 0x4207;
1375 pub const PTRACE_LISTEN: ::c_int = 0x4208;
1376 pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
1377 
1378 pub const PTRACE_GETFPREGS: ::c_uint = 14;
1379 pub const PTRACE_SETFPREGS: ::c_uint = 15;
1380 pub const PTRACE_GETFPXREGS: ::c_uint = 18;
1381 pub const PTRACE_SETFPXREGS: ::c_uint = 19;
1382 pub const PTRACE_GETREGS: ::c_uint = 12;
1383 pub const PTRACE_SETREGS: ::c_uint = 13;
1384 
1385 pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
1386 
1387 pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
1388 
1389 pub const TCSANOW: ::c_int = 0;
1390 pub const TCSADRAIN: ::c_int = 1;
1391 pub const TCSAFLUSH: ::c_int = 2;
1392 
1393 pub const TIOCINQ: ::c_int = ::FIONREAD;
1394 
1395 pub const RTLD_GLOBAL: ::c_int = 0x100;
1396 pub const RTLD_NOLOAD: ::c_int = 0x4;
1397 
1398 pub const CLOCK_SGI_CYCLE: ::clockid_t = 10;
1399 
1400 pub const MCL_CURRENT: ::c_int = 0x0001;
1401 pub const MCL_FUTURE: ::c_int = 0x0002;
1402 
1403 pub const SIGSTKSZ: ::size_t = 8192;
1404 pub const MINSIGSTKSZ: ::size_t = 2048;
1405 pub const CBAUD: ::tcflag_t = 0o0010017;
1406 pub const TAB1: ::c_int = 0x00000800;
1407 pub const TAB2: ::c_int = 0x00001000;
1408 pub const TAB3: ::c_int = 0x00001800;
1409 pub const CR1: ::c_int = 0x00000200;
1410 pub const CR2: ::c_int = 0x00000400;
1411 pub const CR3: ::c_int = 0x00000600;
1412 pub const FF1: ::c_int = 0x00008000;
1413 pub const BS1: ::c_int = 0x00002000;
1414 pub const VT1: ::c_int = 0x00004000;
1415 pub const VWERASE: usize = 14;
1416 pub const VREPRINT: usize = 12;
1417 pub const VSUSP: usize = 10;
1418 pub const VSTART: usize = 8;
1419 pub const VSTOP: usize = 9;
1420 pub const VDISCARD: usize = 13;
1421 pub const VTIME: usize = 5;
1422 pub const IXON: ::tcflag_t = 0x00000400;
1423 pub const IXOFF: ::tcflag_t = 0x00001000;
1424 pub const ONLCR: ::tcflag_t = 0x4;
1425 pub const CSIZE: ::tcflag_t = 0x00000030;
1426 pub const CS6: ::tcflag_t = 0x00000010;
1427 pub const CS7: ::tcflag_t = 0x00000020;
1428 pub const CS8: ::tcflag_t = 0x00000030;
1429 pub const CSTOPB: ::tcflag_t = 0x00000040;
1430 pub const CREAD: ::tcflag_t = 0x00000080;
1431 pub const PARENB: ::tcflag_t = 0x00000100;
1432 pub const PARODD: ::tcflag_t = 0x00000200;
1433 pub const HUPCL: ::tcflag_t = 0x00000400;
1434 pub const CLOCAL: ::tcflag_t = 0x00000800;
1435 pub const ECHOKE: ::tcflag_t = 0x00000800;
1436 pub const ECHOE: ::tcflag_t = 0x00000010;
1437 pub const ECHOK: ::tcflag_t = 0x00000020;
1438 pub const ECHONL: ::tcflag_t = 0x00000040;
1439 pub const ECHOPRT: ::tcflag_t = 0x00000400;
1440 pub const ECHOCTL: ::tcflag_t = 0x00000200;
1441 pub const ISIG: ::tcflag_t = 0x00000001;
1442 pub const ICANON: ::tcflag_t = 0x00000002;
1443 pub const PENDIN: ::tcflag_t = 0x00004000;
1444 pub const NOFLSH: ::tcflag_t = 0x00000080;
1445 pub const CBAUDEX: ::tcflag_t = 0o010000;
1446 pub const VSWTC: usize = 7;
1447 pub const OLCUC: ::tcflag_t = 0o000002;
1448 pub const NLDLY: ::tcflag_t = 0o000400;
1449 pub const CRDLY: ::tcflag_t = 0o003000;
1450 pub const TABDLY: ::tcflag_t = 0o014000;
1451 pub const BSDLY: ::tcflag_t = 0o020000;
1452 pub const FFDLY: ::tcflag_t = 0o100000;
1453 pub const VTDLY: ::tcflag_t = 0o040000;
1454 pub const XTABS: ::tcflag_t = 0o014000;
1455 
1456 pub const B0: ::speed_t = 0o000000;
1457 pub const B50: ::speed_t = 0o000001;
1458 pub const B75: ::speed_t = 0o000002;
1459 pub const B110: ::speed_t = 0o000003;
1460 pub const B134: ::speed_t = 0o000004;
1461 pub const B150: ::speed_t = 0o000005;
1462 pub const B200: ::speed_t = 0o000006;
1463 pub const B300: ::speed_t = 0o000007;
1464 pub const B600: ::speed_t = 0o000010;
1465 pub const B1200: ::speed_t = 0o000011;
1466 pub const B1800: ::speed_t = 0o000012;
1467 pub const B2400: ::speed_t = 0o000013;
1468 pub const B4800: ::speed_t = 0o000014;
1469 pub const B9600: ::speed_t = 0o000015;
1470 pub const B19200: ::speed_t = 0o000016;
1471 pub const B38400: ::speed_t = 0o000017;
1472 pub const B57600: ::speed_t = 0o010001;
1473 pub const B115200: ::speed_t = 0o010002;
1474 pub const B230400: ::speed_t = 0o010003;
1475 pub const B460800: ::speed_t = 0o010004;
1476 pub const B500000: ::speed_t = 0o010005;
1477 pub const B576000: ::speed_t = 0o010006;
1478 pub const B921600: ::speed_t = 0o010007;
1479 pub const B1000000: ::speed_t = 0o010010;
1480 pub const B1152000: ::speed_t = 0o010011;
1481 pub const B1500000: ::speed_t = 0o010012;
1482 pub const B2000000: ::speed_t = 0o010013;
1483 pub const B2500000: ::speed_t = 0o010014;
1484 pub const B3000000: ::speed_t = 0o010015;
1485 pub const B3500000: ::speed_t = 0o010016;
1486 pub const B4000000: ::speed_t = 0o010017;
1487 
1488 pub const SO_BINDTODEVICE: ::c_int = 25;
1489 pub const SO_TIMESTAMP: ::c_int = 29;
1490 pub const SO_MARK: ::c_int = 36;
1491 pub const SO_RXQ_OVFL: ::c_int = 40;
1492 pub const SO_PEEK_OFF: ::c_int = 42;
1493 pub const SO_BUSY_POLL: ::c_int = 46;
1494 
1495 pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32;
1496 pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 28;
1497 
1498 pub const O_DIRECT: ::c_int = 0x4000;
1499 pub const O_DIRECTORY: ::c_int = 0x10000;
1500 pub const O_NOFOLLOW: ::c_int = 0x20000;
1501 pub const O_ASYNC: ::c_int = 0x2000;
1502 
1503 pub const FIOCLEX: ::c_int = 0x5451;
1504 pub const FIONBIO: ::c_int = 0x5421;
1505 
1506 pub const RLIMIT_RSS: ::c_int = 5;
1507 pub const RLIMIT_NOFILE: ::c_int = 7;
1508 pub const RLIMIT_AS: ::c_int = 9;
1509 pub const RLIMIT_NPROC: ::c_int = 6;
1510 pub const RLIMIT_MEMLOCK: ::c_int = 8;
1511 pub const RLIMIT_CPU: ::c_int = 0;
1512 pub const RLIMIT_FSIZE: ::c_int = 1;
1513 pub const RLIMIT_DATA: ::c_int = 2;
1514 pub const RLIMIT_STACK: ::c_int = 3;
1515 pub const RLIMIT_CORE: ::c_int = 4;
1516 pub const RLIMIT_LOCKS: ::c_int = 10;
1517 pub const RLIMIT_SIGPENDING: ::c_int = 11;
1518 pub const RLIMIT_MSGQUEUE: ::c_int = 12;
1519 pub const RLIMIT_NICE: ::c_int = 13;
1520 pub const RLIMIT_RTPRIO: ::c_int = 14;
1521 
1522 pub const O_APPEND: ::c_int = 1024;
1523 pub const O_CREAT: ::c_int = 64;
1524 pub const O_EXCL: ::c_int = 128;
1525 pub const O_NOCTTY: ::c_int = 256;
1526 pub const O_NONBLOCK: ::c_int = 2048;
1527 pub const O_SYNC: ::c_int = 1052672;
1528 pub const O_RSYNC: ::c_int = 1052672;
1529 pub const O_DSYNC: ::c_int = 4096;
1530 
1531 pub const SOCK_NONBLOCK: ::c_int = 2048;
1532 
1533 pub const MAP_ANON: ::c_int = 0x0020;
1534 pub const MAP_GROWSDOWN: ::c_int = 0x0100;
1535 pub const MAP_DENYWRITE: ::c_int = 0x0800;
1536 pub const MAP_EXECUTABLE: ::c_int = 0x01000;
1537 pub const MAP_LOCKED: ::c_int = 0x02000;
1538 pub const MAP_NORESERVE: ::c_int = 0x04000;
1539 pub const MAP_POPULATE: ::c_int = 0x08000;
1540 pub const MAP_NONBLOCK: ::c_int = 0x010000;
1541 pub const MAP_STACK: ::c_int = 0x020000;
1542 
1543 pub const SOCK_STREAM: ::c_int = 1;
1544 pub const SOCK_DGRAM: ::c_int = 2;
1545 pub const SOCK_SEQPACKET: ::c_int = 5;
1546 
1547 pub const IPPROTO_MAX: ::c_int = 256;
1548 
1549 pub const SOL_SOCKET: ::c_int = 1;
1550 
1551 pub const SO_REUSEADDR: ::c_int = 2;
1552 pub const SO_TYPE: ::c_int = 3;
1553 pub const SO_ERROR: ::c_int = 4;
1554 pub const SO_DONTROUTE: ::c_int = 5;
1555 pub const SO_BROADCAST: ::c_int = 6;
1556 pub const SO_SNDBUF: ::c_int = 7;
1557 pub const SO_RCVBUF: ::c_int = 8;
1558 pub const SO_KEEPALIVE: ::c_int = 9;
1559 pub const SO_OOBINLINE: ::c_int = 10;
1560 pub const SO_LINGER: ::c_int = 13;
1561 pub const SO_REUSEPORT: ::c_int = 15;
1562 pub const SO_RCVLOWAT: ::c_int = 18;
1563 pub const SO_SNDLOWAT: ::c_int = 19;
1564 pub const SO_RCVTIMEO: ::c_int = 20;
1565 pub const SO_SNDTIMEO: ::c_int = 21;
1566 pub const SO_ACCEPTCONN: ::c_int = 30;
1567 
1568 pub const IPV6_RTHDR_LOOSE: ::c_int = 0;
1569 pub const IPV6_RTHDR_STRICT: ::c_int = 1;
1570 
1571 pub const SA_ONSTACK: ::c_int = 0x08000000;
1572 pub const SA_SIGINFO: ::c_int = 0x00000004;
1573 pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
1574 
1575 pub const SIGCHLD: ::c_int = 17;
1576 pub const SIGBUS: ::c_int = 7;
1577 pub const SIGTTIN: ::c_int = 21;
1578 pub const SIGTTOU: ::c_int = 22;
1579 pub const SIGXCPU: ::c_int = 24;
1580 pub const SIGXFSZ: ::c_int = 25;
1581 pub const SIGVTALRM: ::c_int = 26;
1582 pub const SIGPROF: ::c_int = 27;
1583 pub const SIGWINCH: ::c_int = 28;
1584 pub const SIGUSR1: ::c_int = 10;
1585 pub const SIGUSR2: ::c_int = 12;
1586 pub const SIGCONT: ::c_int = 18;
1587 pub const SIGSTOP: ::c_int = 19;
1588 pub const SIGTSTP: ::c_int = 20;
1589 pub const SIGURG: ::c_int = 23;
1590 pub const SIGIO: ::c_int = 29;
1591 pub const SIGSYS: ::c_int = 31;
1592 pub const SIGSTKFLT: ::c_int = 16;
1593 pub const SIGPOLL: ::c_int = 29;
1594 pub const SIGPWR: ::c_int = 30;
1595 pub const SIG_SETMASK: ::c_int = 2;
1596 pub const SIG_BLOCK: ::c_int = 0x000000;
1597 pub const SIG_UNBLOCK: ::c_int = 0x01;
1598 
1599 pub const EXTPROC: ::tcflag_t = 0x00010000;
1600 
1601 pub const MAP_HUGETLB: ::c_int = 0x040000;
1602 
1603 pub const F_GETLK: ::c_int = 12;
1604 pub const F_GETOWN: ::c_int = 9;
1605 pub const F_SETLK: ::c_int = 13;
1606 pub const F_SETLKW: ::c_int = 14;
1607 pub const F_SETOWN: ::c_int = 8;
1608 pub const F_OFD_GETLK: ::c_int = 36;
1609 pub const F_OFD_SETLK: ::c_int = 37;
1610 pub const F_OFD_SETLKW: ::c_int = 38;
1611 
1612 pub const VEOF: usize = 4;
1613 pub const VEOL: usize = 11;
1614 pub const VEOL2: usize = 16;
1615 pub const VMIN: usize = 6;
1616 pub const IEXTEN: ::tcflag_t = 0x00008000;
1617 pub const TOSTOP: ::tcflag_t = 0x00000100;
1618 pub const FLUSHO: ::tcflag_t = 0x00001000;
1619 
1620 pub const TCGETS: ::c_int = 0x5401;
1621 pub const TCSETS: ::c_int = 0x5402;
1622 pub const TCSETSW: ::c_int = 0x5403;
1623 pub const TCSETSF: ::c_int = 0x5404;
1624 pub const TCGETA: ::c_int = 0x5405;
1625 pub const TCSETA: ::c_int = 0x5406;
1626 pub const TCSETAW: ::c_int = 0x5407;
1627 pub const TCSETAF: ::c_int = 0x5408;
1628 pub const TCSBRK: ::c_int = 0x5409;
1629 pub const TCXONC: ::c_int = 0x540A;
1630 pub const TCFLSH: ::c_int = 0x540B;
1631 pub const TIOCGSOFTCAR: ::c_int = 0x5419;
1632 pub const TIOCSSOFTCAR: ::c_int = 0x541A;
1633 pub const TIOCLINUX: ::c_int = 0x541C;
1634 pub const TIOCGSERIAL: ::c_int = 0x541E;
1635 pub const TIOCEXCL: ::c_int = 0x540C;
1636 pub const TIOCNXCL: ::c_int = 0x540D;
1637 pub const TIOCSCTTY: ::c_int = 0x540E;
1638 pub const TIOCGPGRP: ::c_int = 0x540F;
1639 pub const TIOCSPGRP: ::c_int = 0x5410;
1640 pub const TIOCOUTQ: ::c_int = 0x5411;
1641 pub const TIOCSTI: ::c_int = 0x5412;
1642 pub const TIOCGWINSZ: ::c_int = 0x5413;
1643 pub const TIOCSWINSZ: ::c_int = 0x5414;
1644 pub const TIOCMGET: ::c_int = 0x5415;
1645 pub const TIOCMBIS: ::c_int = 0x5416;
1646 pub const TIOCMBIC: ::c_int = 0x5417;
1647 pub const TIOCMSET: ::c_int = 0x5418;
1648 pub const FIONREAD: ::c_int = 0x541B;
1649 pub const TIOCCONS: ::c_int = 0x541D;
1650 
1651 pub const SYS_gettid: ::c_long = 224; // Valid for arm (32-bit) and x86 (32-bit)
1652 
1653 pub const POLLWRNORM: ::c_short = 0x100;
1654 pub const POLLWRBAND: ::c_short = 0x200;
1655 
1656 pub const TIOCM_LE: ::c_int = 0x001;
1657 pub const TIOCM_DTR: ::c_int = 0x002;
1658 pub const TIOCM_RTS: ::c_int = 0x004;
1659 pub const TIOCM_ST: ::c_int = 0x008;
1660 pub const TIOCM_SR: ::c_int = 0x010;
1661 pub const TIOCM_CTS: ::c_int = 0x020;
1662 pub const TIOCM_CAR: ::c_int = 0x040;
1663 pub const TIOCM_RNG: ::c_int = 0x080;
1664 pub const TIOCM_DSR: ::c_int = 0x100;
1665 pub const TIOCM_CD: ::c_int = TIOCM_CAR;
1666 pub const TIOCM_RI: ::c_int = TIOCM_RNG;
1667 pub const O_TMPFILE: ::c_int = 0x400000;
1668 
1669 pub const MAX_ADDR_LEN: usize = 7;
1670 pub const ARPD_UPDATE: ::c_ushort = 0x01;
1671 pub const ARPD_LOOKUP: ::c_ushort = 0x02;
1672 pub const ARPD_FLUSH: ::c_ushort = 0x03;
1673 pub const ATF_MAGIC: ::c_int = 0x80;
1674 
1675 pub const PRIO_PROCESS: ::c_int = 0;
1676 pub const PRIO_PGRP: ::c_int = 1;
1677 pub const PRIO_USER: ::c_int = 2;
1678 
1679 pub const SOMAXCONN: ::c_int = 128;
1680 
1681 f! {
1682     pub fn CMSG_NXTHDR(mhdr: *const msghdr,
1683                        cmsg: *const cmsghdr) -> *mut cmsghdr {
1684         if ((*cmsg).cmsg_len as usize) < ::mem::size_of::<cmsghdr>() {
1685             return 0 as *mut cmsghdr;
1686         };
1687         let next = (cmsg as usize +
1688                     super::CMSG_ALIGN((*cmsg).cmsg_len as usize))
1689             as *mut cmsghdr;
1690         let max = (*mhdr).msg_control as usize
1691             + (*mhdr).msg_controllen as usize;
1692         if (next.offset(1)) as usize > max {
1693             0 as *mut cmsghdr
1694         } else {
1695             next as *mut cmsghdr
1696         }
1697     }
1698 
1699     pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
1700         for slot in cpuset.bits.iter_mut() {
1701             *slot = 0;
1702         }
1703     }
1704 
1705     pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
1706         let size_in_bits
1707             = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
1708         let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
1709         cpuset.bits[idx] |= 1 << offset;
1710         ()
1711     }
1712 
1713     pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
1714         let size_in_bits
1715             = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
1716         let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
1717         cpuset.bits[idx] &= !(1 << offset);
1718         ()
1719     }
1720 
1721     pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
1722         let size_in_bits = 8 * ::mem::size_of_val(&cpuset.bits[0]);
1723         let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
1724         0 != (cpuset.bits[idx] & (1 << offset))
1725     }
1726 
1727     pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
1728         set1.bits == set2.bits
1729     }
1730 
1731     pub fn major(dev: ::dev_t) -> ::c_uint {
1732         // see
1733         // https://github.com/emscripten-core/emscripten/blob/
1734         // main/system/lib/libc/musl/include/sys/sysmacros.h
1735         let mut major = 0;
1736         major |= (dev & 0x00000fff) >> 8;
1737         major |= (dev & 0xfffff000) >> 31 >> 1;
1738         major as ::c_uint
1739     }
1740 
1741     pub fn minor(dev: ::dev_t) -> ::c_uint {
1742         // see
1743         // https://github.com/emscripten-core/emscripten/blob/
1744         // main/system/lib/libc/musl/include/sys/sysmacros.h
1745         let mut minor = 0;
1746         minor |= (dev & 0x000000ff) >> 0;
1747         minor |= (dev & 0xffffff00) >> 12;
1748         minor as ::c_uint
1749     }
1750 }
1751 
1752 safe_f! {
1753     pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
1754         let major = major as ::dev_t;
1755         let minor = minor as ::dev_t;
1756         let mut dev = 0;
1757         dev |= (major & 0x00000fff) << 8;
1758         dev |= (major & 0xfffff000) << 31 << 1;
1759         dev |= (minor & 0x000000ff) << 0;
1760         dev |= (minor & 0xffffff00) << 12;
1761         dev
1762     }
1763 }
1764 
1765 extern "C" {
1766     pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int;
1767     pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int;
1768     pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
1769     pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
1770     pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
1771 
1772     pub fn abs(i: ::c_int) -> ::c_int;
1773     pub fn labs(i: ::c_long) -> ::c_long;
1774     pub fn rand() -> ::c_int;
1775     pub fn srand(seed: ::c_uint);
1776 
1777     pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
1778 
1779     pub fn setpwent();
1780     pub fn endpwent();
1781     pub fn getpwent() -> *mut passwd;
1782 
1783     pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;
1784 
1785     pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
1786     pub fn __errno_location() -> *mut ::c_int;
1787 
1788     pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut ::FILE;
1789     pub fn freopen64(
1790         filename: *const c_char,
1791         mode: *const c_char,
1792         file: *mut ::FILE,
1793     ) -> *mut ::FILE;
1794     pub fn tmpfile64() -> *mut ::FILE;
1795     pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int;
1796     pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int;
1797     pub fn fseeko64(stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int) -> ::c_int;
1798     pub fn ftello64(stream: *mut ::FILE) -> ::off64_t;
1799     pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
1800     pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
1801         -> ::ssize_t;
1802     pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
1803     pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int;
1804     pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
1805     pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
1806     pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
1807     pub fn accept4(
1808         fd: ::c_int,
1809         addr: *mut ::sockaddr,
1810         len: *mut ::socklen_t,
1811         flg: ::c_int,
1812     ) -> ::c_int;
1813     pub fn getnameinfo(
1814         sa: *const ::sockaddr,
1815         salen: ::socklen_t,
1816         host: *mut ::c_char,
1817         hostlen: ::socklen_t,
1818         serv: *mut ::c_char,
1819         sevlen: ::socklen_t,
1820         flags: ::c_int,
1821     ) -> ::c_int;
1822     pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
1823 
1824     pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
1825     pub fn if_nameindex() -> *mut if_nameindex;
1826     pub fn if_freenameindex(ptr: *mut if_nameindex);
1827 
1828     pub fn mremap(
1829         addr: *mut ::c_void,
1830         len: ::size_t,
1831         new_len: ::size_t,
1832         flags: ::c_int,
1833         ...
1834     ) -> *mut ::c_void;
1835 
1836     pub fn glob(
1837         pattern: *const c_char,
1838         flags: ::c_int,
1839         errfunc: ::Option<extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int>,
1840         pglob: *mut ::glob_t,
1841     ) -> ::c_int;
1842     pub fn globfree(pglob: *mut ::glob_t);
1843 
1844     pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
1845 
1846     pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
1847 
1848     pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
1849 
1850     pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
1851     pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
1852 
1853     pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
1854 
1855     pub fn recvfrom(
1856         socket: ::c_int,
1857         buf: *mut ::c_void,
1858         len: ::size_t,
1859         flags: ::c_int,
1860         addr: *mut ::sockaddr,
1861         addrlen: *mut ::socklen_t,
1862     ) -> ::ssize_t;
1863     pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
1864     pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
1865 
1866     pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
1867     pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
1868     pub fn sendmmsg(
1869         sockfd: ::c_int,
1870         msgvec: *mut ::mmsghdr,
1871         vlen: ::c_uint,
1872         flags: ::c_uint,
1873     ) -> ::c_int;
1874     pub fn recvmmsg(
1875         sockfd: ::c_int,
1876         msgvec: *mut ::mmsghdr,
1877         vlen: ::c_uint,
1878         flags: ::c_uint,
1879         timeout: *mut ::timespec,
1880     ) -> ::c_int;
1881     pub fn sync();
1882     pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
1883     pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
1884     pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
1885     pub fn pthread_create(
1886         native: *mut ::pthread_t,
1887         attr: *const ::pthread_attr_t,
1888         f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
1889         value: *mut ::c_void,
1890     ) -> ::c_int;
1891 
1892     pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
1893 }
1894 
1895 cfg_if! {
1896     if #[cfg(libc_align)] {
1897         #[macro_use]
1898         mod align;
1899     } else {
1900         #[macro_use]
1901         mod no_align;
1902     }
1903 }
1904 expand_align!();
1905