Debian Codegraph @

third_party/rust/libc/src/unix/nto/mod.rs

raw
1 use crate::prelude::*;
2
3 pub type clock_t = u32;
4
5 pub type sa_family_t = u8;
6 pub type speed_t = c_uint;
7 pub type tcflag_t = c_uint;
8 pub type clockid_t = c_int;
9 pub type timer_t = c_int;
10 pub type key_t = c_uint;
11 pub type id_t = c_int;
12
13 pub type useconds_t = u32;
14 pub type dev_t = u32;
15 pub type socklen_t = u32;
16 pub type mode_t = u32;
17 pub type rlim64_t = u64;
18 pub type mqd_t = c_int;
19 pub type nfds_t = c_uint;
20 pub type idtype_t = c_uint;
21 pub type errno_t = c_int;
22 pub type rsize_t = c_ulong;
23
24 pub type Elf32_Half = u16;
25 pub type Elf32_Word = u32;
26 pub type Elf32_Off = u32;
27 pub type Elf32_Addr = u32;
28 pub type Elf32_Lword = u64;
29 pub type Elf32_Sword = i32;
30
31 pub type Elf64_Half = u16;
32 pub type Elf64_Word = u32;
33 pub type Elf64_Off = u64;
34 pub type Elf64_Addr = u64;
35 pub type Elf64_Xword = u64;
36 pub type Elf64_Sxword = i64;
37 pub type Elf64_Lword = u64;
38 pub type Elf64_Sword = i32;
39
40 pub type Elf32_Section = u16;
41 pub type Elf64_Section = u16;
42
43 pub type _Time32t = u32;
44
45 pub type pthread_t = c_int;
46 pub type regoff_t = ssize_t;
47
48 pub type nlink_t = u32;
49 pub type blksize_t = u32;
50 pub type suseconds_t = i32;
51
52 pub type ino_t = u64;
53 pub type off_t = i64;
54 pub type blkcnt_t = u64;
55 pub type msgqnum_t = u64;
56 pub type msglen_t = u64;
57 pub type fsblkcnt_t = u64;
58 pub type fsfilcnt_t = u64;
59 pub type rlim_t = u64;
60 pub type posix_spawn_file_actions_t = *mut c_void;
61 pub type posix_spawnattr_t = crate::uintptr_t;
62
63 pub type pthread_mutex_t = crate::sync_t;
64 pub type pthread_mutexattr_t = crate::_sync_attr;
65 pub type pthread_cond_t = crate::sync_t;
66 pub type pthread_condattr_t = crate::_sync_attr;
67 pub type pthread_rwlockattr_t = crate::_sync_attr;
68 pub type pthread_key_t = c_int;
69 pub type pthread_spinlock_t = sync_t;
70 pub type pthread_barrierattr_t = _sync_attr;
71 pub type sem_t = sync_t;
72
73 pub type nl_item = c_int;
74
75 #[cfg_attr(feature = "extra_traits", derive(Debug))]
76 pub enum timezone {}
77 impl Copy for timezone {}
78 impl Clone for timezone {
79 fn clone(&self) -> timezone {
80 *self
81 }
82 }
83
84 s! {
85 pub struct dirent_extra {
86 pub d_datalen: u16,
87 pub d_type: u16,
88 pub d_reserved: u32,
89 }
90
91 pub struct stat {
92 pub st_ino: crate::ino_t,
93 pub st_size: off_t,
94 pub st_dev: crate::dev_t,
95 pub st_rdev: crate::dev_t,
96 pub st_uid: crate::uid_t,
97 pub st_gid: crate::gid_t,
98 pub __old_st_mtime: crate::_Time32t,
99 pub __old_st_atime: crate::_Time32t,
100 pub __old_st_ctime: crate::_Time32t,
101 pub st_mode: crate::mode_t,
102 pub st_nlink: crate::nlink_t,
103 pub st_blocksize: crate::blksize_t,
104 pub st_nblocks: i32,
105 pub st_blksize: crate::blksize_t,
106 pub st_blocks: crate::blkcnt_t,
107 pub st_mtim: crate::timespec,
108 pub st_atim: crate::timespec,
109 pub st_ctim: crate::timespec,
110 }
111
112 pub struct ip_mreq {
113 pub imr_multiaddr: in_addr,
114 pub imr_interface: in_addr,
115 }
116
117 #[repr(packed)]
118 pub struct in_addr {
119 pub s_addr: crate::in_addr_t,
120 }
121
122 pub struct sockaddr {
123 pub sa_len: u8,
124 pub sa_family: sa_family_t,
125 pub sa_data: [c_char; 14],
126 }
127
128 pub struct sockaddr_in {
129 pub sin_len: u8,
130 pub sin_family: sa_family_t,
131 pub sin_port: crate::in_port_t,
132 pub sin_addr: crate::in_addr,
133 pub sin_zero: [i8; 8],
134 }
135
136 pub struct sockaddr_in6 {
137 pub sin6_len: u8,
138 pub sin6_family: sa_family_t,
139 pub sin6_port: crate::in_port_t,
140 pub sin6_flowinfo: u32,
141 pub sin6_addr: crate::in6_addr,
142 pub sin6_scope_id: u32,
143 }
144
145 // The order of the `ai_addr` field in this struct is crucial
146 // for converting between the Rust and C types.
147 pub struct addrinfo {
148 pub ai_flags: c_int,
149 pub ai_family: c_int,
150 pub ai_socktype: c_int,
151 pub ai_protocol: c_int,
152 pub ai_addrlen: socklen_t,
153 pub ai_canonname: *mut c_char,
154 pub ai_addr: *mut crate::sockaddr,
155 pub ai_next: *mut addrinfo,
156 }
157
158 pub struct fd_set {
159 fds_bits: [c_uint; 2 * FD_SETSIZE as usize / ULONG_SIZE],
160 }
161
162 pub struct tm {
163 pub tm_sec: c_int,
164 pub tm_min: c_int,
165 pub tm_hour: c_int,
166 pub tm_mday: c_int,
167 pub tm_mon: c_int,
168 pub tm_year: c_int,
169 pub tm_wday: c_int,
170 pub tm_yday: c_int,
171 pub tm_isdst: c_int,
172 pub tm_gmtoff: c_long,
173 pub tm_zone: *const c_char,
174 }
175
176 #[repr(align(8))]
177 pub struct sched_param {
178 pub sched_priority: c_int,
179 pub sched_curpriority: c_int,
180 pub reserved: [c_int; 10],
181 }
182
183 #[repr(align(8))]
184 pub struct __sched_param {
185 pub __sched_priority: c_int,
186 pub __sched_curpriority: c_int,
187 pub reserved: [c_int; 10],
188 }
189
190 pub struct Dl_info {
191 pub dli_fname: *const c_char,
192 pub dli_fbase: *mut c_void,
193 pub dli_sname: *const c_char,
194 pub dli_saddr: *mut c_void,
195 }
196
197 pub struct lconv {
198 pub currency_symbol: *mut c_char,
199 pub int_curr_symbol: *mut c_char,
200 pub mon_decimal_point: *mut c_char,
201 pub mon_grouping: *mut c_char,
202 pub mon_thousands_sep: *mut c_char,
203 pub negative_sign: *mut c_char,
204 pub positive_sign: *mut c_char,
205 pub frac_digits: c_char,
206 pub int_frac_digits: c_char,
207 pub n_cs_precedes: c_char,
208 pub n_sep_by_space: c_char,
209 pub n_sign_posn: c_char,
210 pub p_cs_precedes: c_char,
211 pub p_sep_by_space: c_char,
212 pub p_sign_posn: c_char,
213
214 pub int_n_cs_precedes: c_char,
215 pub int_n_sep_by_space: c_char,
216 pub int_n_sign_posn: c_char,
217 pub int_p_cs_precedes: c_char,
218 pub int_p_sep_by_space: c_char,
219 pub int_p_sign_posn: c_char,
220
221 pub decimal_point: *mut c_char,
222 pub grouping: *mut c_char,
223 pub thousands_sep: *mut c_char,
224
225 pub _Frac_grouping: *mut c_char,
226 pub _Frac_sep: *mut c_char,
227 pub _False: *mut c_char,
228 pub _True: *mut c_char,
229
230 pub _No: *mut c_char,
231 pub _Yes: *mut c_char,
232 pub _Nostr: *mut c_char,
233 pub _Yesstr: *mut c_char,
234 pub _Reserved: [*mut c_char; 8],
235 }
236
237 pub struct in_pktinfo {
238 pub ipi_addr: crate::in_addr,
239 pub ipi_ifindex: c_uint,
240 }
241
242 pub struct ifaddrs {
243 pub ifa_next: *mut ifaddrs,
244 pub ifa_name: *mut c_char,
245 pub ifa_flags: c_uint,
246 pub ifa_addr: *mut crate::sockaddr,
247 pub ifa_netmask: *mut crate::sockaddr,
248 pub ifa_dstaddr: *mut crate::sockaddr,
249 pub ifa_data: *mut c_void,
250 }
251
252 pub struct arpreq {
253 pub arp_pa: crate::sockaddr,
254 pub arp_ha: crate::sockaddr,
255 pub arp_flags: c_int,
256 }
257
258 #[repr(packed)]
259 pub struct arphdr {
260 pub ar_hrd: u16,
261 pub ar_pro: u16,
262 pub ar_hln: u8,
263 pub ar_pln: u8,
264 pub ar_op: u16,
265 }
266
267 pub struct mmsghdr {
268 pub msg_hdr: crate::msghdr,
269 pub msg_len: c_uint,
270 }
271
272 #[repr(align(8))]
273 pub struct siginfo_t {
274 pub si_signo: c_int,
275 pub si_code: c_int,
276 pub si_errno: c_int,
277 __data: [u8; 36], // union
278 }
279
280 pub struct sigaction {
281 pub sa_sigaction: crate::sighandler_t,
282 pub sa_flags: c_int,
283 pub sa_mask: crate::sigset_t,
284 }
285
286 pub struct _sync {
287 _union: c_uint,
288 __owner: c_uint,
289 }
290 pub struct rlimit64 {
291 pub rlim_cur: rlim64_t,
292 pub rlim_max: rlim64_t,
293 }
294
295 pub struct glob_t {
296 pub gl_pathc: size_t,
297 pub gl_matchc: c_int,
298 pub gl_pathv: *mut *mut c_char,
299 pub gl_offs: size_t,
300 pub gl_flags: c_int,
301 pub gl_errfunc: extern "C" fn(*const c_char, c_int) -> c_int,
302
303 __unused1: *mut c_void,
304 __unused2: *mut c_void,
305 __unused3: *mut c_void,
306 __unused4: *mut c_void,
307 __unused5: *mut c_void,
308 }
309
310 pub struct passwd {
311 pub pw_name: *mut c_char,
312 pub pw_passwd: *mut c_char,
313 pub pw_uid: crate::uid_t,
314 pub pw_gid: crate::gid_t,
315 pub pw_age: *mut c_char,
316 pub pw_comment: *mut c_char,
317 pub pw_gecos: *mut c_char,
318 pub pw_dir: *mut c_char,
319 pub pw_shell: *mut c_char,
320 }
321
322 pub struct if_nameindex {
323 pub if_index: c_uint,
324 pub if_name: *mut c_char,
325 }
326
327 pub struct sembuf {
328 pub sem_num: c_ushort,
329 pub sem_op: c_short,
330 pub sem_flg: c_short,
331 }
332
333 pub struct Elf32_Ehdr {
334 pub e_ident: [c_uchar; 16],
335 pub e_type: Elf32_Half,
336 pub e_machine: Elf32_Half,
337 pub e_version: Elf32_Word,
338 pub e_entry: Elf32_Addr,
339 pub e_phoff: Elf32_Off,
340 pub e_shoff: Elf32_Off,
341 pub e_flags: Elf32_Word,
342 pub e_ehsize: Elf32_Half,
343 pub e_phentsize: Elf32_Half,
344 pub e_phnum: Elf32_Half,
345 pub e_shentsize: Elf32_Half,
346 pub e_shnum: Elf32_Half,
347 pub e_shstrndx: Elf32_Half,
348 }
349
350 pub struct Elf64_Ehdr {
351 pub e_ident: [c_uchar; 16],
352 pub e_type: Elf64_Half,
353 pub e_machine: Elf64_Half,
354 pub e_version: Elf64_Word,
355 pub e_entry: Elf64_Addr,
356 pub e_phoff: Elf64_Off,
357 pub e_shoff: Elf64_Off,
358 pub e_flags: Elf64_Word,
359 pub e_ehsize: Elf64_Half,
360 pub e_phentsize: Elf64_Half,
361 pub e_phnum: Elf64_Half,
362 pub e_shentsize: Elf64_Half,
363 pub e_shnum: Elf64_Half,
364 pub e_shstrndx: Elf64_Half,
365 }
366
367 pub struct Elf32_Sym {
368 pub st_name: Elf32_Word,
369 pub st_value: Elf32_Addr,
370 pub st_size: Elf32_Word,
371 pub st_info: c_uchar,
372 pub st_other: c_uchar,
373 pub st_shndx: Elf32_Section,
374 }
375
376 pub struct Elf64_Sym {
377 pub st_name: Elf64_Word,
378 pub st_info: c_uchar,
379 pub st_other: c_uchar,
380 pub st_shndx: Elf64_Section,
381 pub st_value: Elf64_Addr,
382 pub st_size: Elf64_Xword,
383 }
384
385 pub struct Elf32_Phdr {
386 pub p_type: Elf32_Word,
387 pub p_offset: Elf32_Off,
388 pub p_vaddr: Elf32_Addr,
389 pub p_paddr: Elf32_Addr,
390 pub p_filesz: Elf32_Word,
391 pub p_memsz: Elf32_Word,
392 pub p_flags: Elf32_Word,
393 pub p_align: Elf32_Word,
394 }
395
396 pub struct Elf64_Phdr {
397 pub p_type: Elf64_Word,
398 pub p_flags: Elf64_Word,
399 pub p_offset: Elf64_Off,
400 pub p_vaddr: Elf64_Addr,
401 pub p_paddr: Elf64_Addr,
402 pub p_filesz: Elf64_Xword,
403 pub p_memsz: Elf64_Xword,
404 pub p_align: Elf64_Xword,
405 }
406
407 pub struct Elf32_Shdr {
408 pub sh_name: Elf32_Word,
409 pub sh_type: Elf32_Word,
410 pub sh_flags: Elf32_Word,
411 pub sh_addr: Elf32_Addr,
412 pub sh_offset: Elf32_Off,
413 pub sh_size: Elf32_Word,
414 pub sh_link: Elf32_Word,
415 pub sh_info: Elf32_Word,
416 pub sh_addralign: Elf32_Word,
417 pub sh_entsize: Elf32_Word,
418 }
419
420 pub struct Elf64_Shdr {
421 pub sh_name: Elf64_Word,
422 pub sh_type: Elf64_Word,
423 pub sh_flags: Elf64_Xword,
424 pub sh_addr: Elf64_Addr,
425 pub sh_offset: Elf64_Off,
426 pub sh_size: Elf64_Xword,
427 pub sh_link: Elf64_Word,
428 pub sh_info: Elf64_Word,
429 pub sh_addralign: Elf64_Xword,
430 pub sh_entsize: Elf64_Xword,
431 }
432
433 pub struct in6_pktinfo {
434 pub ipi6_addr: crate::in6_addr,
435 pub ipi6_ifindex: c_uint,
436 }
437
438 pub struct inotify_event {
439 pub wd: c_int,
440 pub mask: u32,
441 pub cookie: u32,
442 pub len: u32,
443 }
444
445 pub struct regmatch_t {
446 pub rm_so: regoff_t,
447 pub rm_eo: regoff_t,
448 }
449
450 pub struct msghdr {
451 pub msg_name: *mut c_void,
452 pub msg_namelen: crate::socklen_t,
453 pub msg_iov: *mut crate::iovec,
454 pub msg_iovlen: c_int,
455 pub msg_control: *mut c_void,
456 pub msg_controllen: crate::socklen_t,
457 pub msg_flags: c_int,
458 }
459
460 pub struct cmsghdr {
461 pub cmsg_len: crate::socklen_t,
462 pub cmsg_level: c_int,
463 pub cmsg_type: c_int,
464 }
465
466 pub struct termios {
467 pub c_iflag: crate::tcflag_t,
468 pub c_oflag: crate::tcflag_t,
469 pub c_cflag: crate::tcflag_t,
470 pub c_lflag: crate::tcflag_t,
471 pub c_cc: [crate::cc_t; crate::NCCS],
472 __reserved: [c_uint; 3],
473 pub c_ispeed: crate::speed_t,
474 pub c_ospeed: crate::speed_t,
475 }
476
477 pub struct mallinfo {
478 pub arena: c_int,
479 pub ordblks: c_int,
480 pub smblks: c_int,
481 pub hblks: c_int,
482 pub hblkhd: c_int,
483 pub usmblks: c_int,
484 pub fsmblks: c_int,
485 pub uordblks: c_int,
486 pub fordblks: c_int,
487 pub keepcost: c_int,
488 }
489
490 pub struct flock {
491 pub l_type: i16,
492 pub l_whence: i16,
493 pub l_zero1: i32,
494 pub l_start: off_t,
495 pub l_len: off_t,
496 pub l_pid: crate::pid_t,
497 pub l_sysid: u32,
498 }
499
500 pub struct statvfs {
501 pub f_bsize: c_ulong,
502 pub f_frsize: c_ulong,
503 pub f_blocks: crate::fsblkcnt_t,
504 pub f_bfree: crate::fsblkcnt_t,
505 pub f_bavail: crate::fsblkcnt_t,
506 pub f_files: crate::fsfilcnt_t,
507 pub f_ffree: crate::fsfilcnt_t,
508 pub f_favail: crate::fsfilcnt_t,
509 pub f_fsid: c_ulong,
510 pub f_basetype: [c_char; 16],
511 pub f_flag: c_ulong,
512 pub f_namemax: c_ulong,
513 f_filler: [c_uint; 21],
514 }
515
516 pub struct aiocb {
517 pub aio_fildes: c_int,
518 pub aio_reqprio: c_int,
519 pub aio_offset: off_t,
520 pub aio_buf: *mut c_void,
521 pub aio_nbytes: size_t,
522 pub aio_sigevent: crate::sigevent,
523 pub aio_lio_opcode: c_int,
524 pub _aio_lio_state: *mut c_void,
525 _aio_pad: [c_int; 3],
526 pub _aio_next: *mut crate::aiocb,
527 pub _aio_flag: c_uint,
528 pub _aio_iotype: c_uint,
529 pub _aio_result: ssize_t,
530 pub _aio_error: c_uint,
531 pub _aio_suspend: *mut c_void,
532 pub _aio_plist: *mut c_void,
533 pub _aio_policy: c_int,
534 pub _aio_param: crate::__sched_param,
535 }
536
537 pub struct pthread_attr_t {
538 __data1: c_long,
539 __data2: [u8; 96],
540 }
541
542 pub struct ipc_perm {
543 pub uid: crate::uid_t,
544 pub gid: crate::gid_t,
545 pub cuid: crate::uid_t,
546 pub cgid: crate::gid_t,
547 pub mode: crate::mode_t,
548 pub seq: c_uint,
549 pub key: crate::key_t,
550 _reserved: [c_int; 4],
551 }
552
553 pub struct regex_t {
554 re_magic: c_int,
555 re_nsub: size_t,
556 re_endp: *const c_char,
557 re_g: *mut c_void,
558 }
559
560 pub struct _thread_attr {
561 pub __flags: c_int,
562 pub __stacksize: size_t,
563 pub __stackaddr: *mut c_void,
564 pub __exitfunc: Option<unsafe extern "C" fn(_fake: *mut c_void)>,
565 pub __policy: c_int,
566 pub __param: crate::__sched_param,
567 pub __guardsize: c_uint,
568 pub __prealloc: c_uint,
569 __spare: [c_int; 2],
570 }
571
572 pub struct _sync_attr {
573 pub __protocol: c_int,
574 pub __flags: c_int,
575 pub __prioceiling: c_int,
576 pub __clockid: c_int,
577 pub __count: c_int,
578 __reserved: [c_int; 3],
579 }
580
581 pub struct sockcred {
582 pub sc_uid: crate::uid_t,
583 pub sc_euid: crate::uid_t,
584 pub sc_gid: crate::gid_t,
585 pub sc_egid: crate::gid_t,
586 pub sc_ngroups: c_int,
587 pub sc_groups: [crate::gid_t; 1],
588 }
589
590 pub struct bpf_program {
591 pub bf_len: c_uint,
592 pub bf_insns: *mut crate::bpf_insn,
593 }
594
595 pub struct bpf_stat {
596 pub bs_recv: u64,
597 pub bs_drop: u64,
598 pub bs_capt: u64,
599 bs_padding: [u64; 13],
600 }
601
602 pub struct bpf_version {
603 pub bv_major: c_ushort,
604 pub bv_minor: c_ushort,
605 }
606
607 pub struct bpf_hdr {
608 pub bh_tstamp: crate::timeval,
609 pub bh_caplen: u32,
610 pub bh_datalen: u32,
611 pub bh_hdrlen: u16,
612 }
613
614 pub struct bpf_insn {
615 pub code: u16,
616 pub jt: c_uchar,
617 pub jf: c_uchar,
618 pub k: u32,
619 }
620
621 pub struct bpf_dltlist {
622 pub bfl_len: c_uint,
623 pub bfl_list: *mut c_uint,
624 }
625
626 pub struct unpcbid {
627 pub unp_pid: crate::pid_t,
628 pub unp_euid: crate::uid_t,
629 pub unp_egid: crate::gid_t,
630 }
631
632 pub struct dl_phdr_info {
633 pub dlpi_addr: crate::Elf64_Addr,
634 pub dlpi_name: *const c_char,
635 pub dlpi_phdr: *const crate::Elf64_Phdr,
636 pub dlpi_phnum: crate::Elf64_Half,
637 }
638
639 #[repr(align(8))]
640 pub struct ucontext_t {
641 pub uc_link: *mut ucontext_t,
642 pub uc_sigmask: crate::sigset_t,
643 pub uc_stack: stack_t,
644 pub uc_mcontext: mcontext_t,
645 }
646 }
647
648 s_no_extra_traits! {
649 pub struct sockaddr_un {
650 pub sun_len: u8,
651 pub sun_family: sa_family_t,
652 pub sun_path: [c_char; 104],
653 }
654
655 pub struct sockaddr_storage {
656 pub ss_len: u8,
657 pub ss_family: sa_family_t,
658 __ss_pad1: [c_char; 6],
659 __ss_align: i64,
660 __ss_pad2: [c_char; 112],
661 }
662
663 pub struct utsname {
664 pub sysname: [c_char; _SYSNAME_SIZE],
665 pub nodename: [c_char; _SYSNAME_SIZE],
666 pub release: [c_char; _SYSNAME_SIZE],
667 pub version: [c_char; _SYSNAME_SIZE],
668 pub machine: [c_char; _SYSNAME_SIZE],
669 }
670
671 pub struct sigevent {
672 pub sigev_notify: c_int,
673 pub __padding1: c_int,
674 pub sigev_signo: c_int, // union
675 pub __padding2: c_int,
676 pub sigev_value: crate::sigval,
677 __sigev_un2: usize, // union
678 }
679 pub struct dirent {
680 pub d_ino: crate::ino_t,
681 pub d_offset: off_t,
682 pub d_reclen: c_short,
683 pub d_namelen: c_short,
684 pub d_name: [c_char; 1], // flex array
685 }
686
687 pub struct sigset_t {
688 __val: [u32; 2],
689 }
690
691 pub struct mq_attr {
692 pub mq_maxmsg: c_long,
693 pub mq_msgsize: c_long,
694 pub mq_flags: c_long,
695 pub mq_curmsgs: c_long,
696 pub mq_sendwait: c_long,
697 pub mq_recvwait: c_long,
698 }
699
700 pub struct msg {
701 pub msg_next: *mut crate::msg,
702 pub msg_type: c_long,
703 pub msg_ts: c_ushort,
704 pub msg_spot: c_short,
705 _pad: [u8; 4],
706 }
707
708 pub struct msqid_ds {
709 pub msg_perm: crate::ipc_perm,
710 pub msg_first: *mut crate::msg,
711 pub msg_last: *mut crate::msg,
712 pub msg_cbytes: crate::msglen_t,
713 pub msg_qnum: crate::msgqnum_t,
714 pub msg_qbytes: crate::msglen_t,
715 pub msg_lspid: crate::pid_t,
716 pub msg_lrpid: crate::pid_t,
717 pub msg_stime: crate::time_t,
718 msg_pad1: c_long,
719 pub msg_rtime: crate::time_t,
720 msg_pad2: c_long,
721 pub msg_ctime: crate::time_t,
722 msg_pad3: c_long,
723 msg_pad4: [c_long; 4],
724 }
725
726 pub struct sockaddr_dl {
727 pub sdl_len: c_uchar,
728 pub sdl_family: crate::sa_family_t,
729 pub sdl_index: u16,
730 pub sdl_type: c_uchar,
731 pub sdl_nlen: c_uchar,
732 pub sdl_alen: c_uchar,
733 pub sdl_slen: c_uchar,
734 pub sdl_data: [c_char; 12],
735 }
736
737 pub struct sync_t {
738 __u: c_uint, // union
739 pub __owner: c_uint,
740 }
741
742 #[repr(align(4))]
743 pub struct pthread_barrier_t {
744 // union
745 __pad: [u8; 28], // union
746 }
747
748 pub struct pthread_rwlock_t {
749 pub __active: c_int,
750 pub __blockedwriters: c_int,
751 pub __blockedreaders: c_int,
752 pub __heavy: c_int,
753 pub __lock: crate::pthread_mutex_t, // union
754 pub __rcond: crate::pthread_cond_t, // union
755 pub __wcond: crate::pthread_cond_t, // union
756 pub __owner: c_uint,
757 pub __spare: c_uint,
758 }
759 }
760
761 cfg_if! {
762 if #[cfg(feature = "extra_traits")] {
763 // sigevent
764 impl PartialEq for sigevent {
765 fn eq(&self, other: &sigevent) -> bool {
766 self.sigev_notify == other.sigev_notify
767 && self.sigev_signo == other.sigev_signo
768 && self.sigev_value == other.sigev_value
769 && self.__sigev_un2 == other.__sigev_un2
770 }
771 }
772 impl Eq for sigevent {}
773 impl fmt::Debug for sigevent {
774 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
775 f.debug_struct("sigevent")
776 .field("sigev_notify", &self.sigev_notify)
777 .field("sigev_signo", &self.sigev_signo)
778 .field("sigev_value", &self.sigev_value)
779 .field("__sigev_un2", &self.__sigev_un2)
780 .finish()
781 }
782 }
783 impl hash::Hash for sigevent {
784 fn hash<H: hash::Hasher>(&self, state: &mut H) {
785 self.sigev_notify.hash(state);
786 self.sigev_signo.hash(state);
787 self.sigev_value.hash(state);
788 self.__sigev_un2.hash(state);
789 }
790 }
791
792 impl PartialEq for sockaddr_un {
793 fn eq(&self, other: &sockaddr_un) -> bool {
794 self.sun_len == other.sun_len
795 && self.sun_family == other.sun_family
796 && self
797 .sun_path
798 .iter()
799 .zip(other.sun_path.iter())
800 .all(|(a, b)| a == b)
801 }
802 }
803 impl Eq for sockaddr_un {}
804 impl fmt::Debug for sockaddr_un {
805 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
806 f.debug_struct("sockaddr_un")
807 .field("sun_len", &self.sun_len)
808 .field("sun_family", &self.sun_family)
809 // FIXME(debug): .field("sun_path", &self.sun_path)
810 .finish()
811 }
812 }
813
814 impl hash::Hash for sockaddr_un {
815 fn hash<H: hash::Hasher>(&self, state: &mut H) {
816 self.sun_len.hash(state);
817 self.sun_family.hash(state);
818 self.sun_path.hash(state);
819 }
820 }
821
822 // sigset_t
823 impl PartialEq for sigset_t {
824 fn eq(&self, other: &sigset_t) -> bool {
825 self.__val == other.__val
826 }
827 }
828 impl Eq for sigset_t {}
829 impl fmt::Debug for sigset_t {
830 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
831 f.debug_struct("sigset_t")
832 .field("__val", &self.__val)
833 .finish()
834 }
835 }
836 impl hash::Hash for sigset_t {
837 fn hash<H: hash::Hasher>(&self, state: &mut H) {
838 self.__val.hash(state);
839 }
840 }
841
842 // msg
843 impl fmt::Debug for msg {
844 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
845 f.debug_struct("msg")
846 .field("msg_next", &self.msg_next)
847 .field("msg_type", &self.msg_type)
848 .field("msg_ts", &self.msg_ts)
849 .field("msg_spot", &self.msg_spot)
850 .finish()
851 }
852 }
853
854 // msqid_ds
855 impl fmt::Debug for msqid_ds {
856 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
857 f.debug_struct("msqid_ds")
858 .field("msg_perm", &self.msg_perm)
859 .field("msg_first", &self.msg_first)
860 .field("msg_cbytes", &self.msg_cbytes)
861 .field("msg_qnum", &self.msg_qnum)
862 .field("msg_qbytes", &self.msg_qbytes)
863 .field("msg_lspid", &self.msg_lspid)
864 .field("msg_lrpid", &self.msg_lrpid)
865 .field("msg_stime", &self.msg_stime)
866 .field("msg_rtime", &self.msg_rtime)
867 .field("msg_ctime", &self.msg_ctime)
868 .finish()
869 }
870 }
871
872 // sockaddr_dl
873 impl fmt::Debug for sockaddr_dl {
874 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
875 f.debug_struct("sockaddr_dl")
876 .field("sdl_len", &self.sdl_len)
877 .field("sdl_family", &self.sdl_family)
878 .field("sdl_index", &self.sdl_index)
879 .field("sdl_type", &self.sdl_type)
880 .field("sdl_nlen", &self.sdl_nlen)
881 .field("sdl_alen", &self.sdl_alen)
882 .field("sdl_slen", &self.sdl_slen)
883 .field("sdl_data", &self.sdl_data)
884 .finish()
885 }
886 }
887 impl PartialEq for sockaddr_dl {
888 fn eq(&self, other: &sockaddr_dl) -> bool {
889 self.sdl_len == other.sdl_len
890 && self.sdl_family == other.sdl_family
891 && self.sdl_index == other.sdl_index
892 && self.sdl_type == other.sdl_type
893 && self.sdl_nlen == other.sdl_nlen
894 && self.sdl_alen == other.sdl_alen
895 && self.sdl_slen == other.sdl_slen
896 && self
897 .sdl_data
898 .iter()
899 .zip(other.sdl_data.iter())
900 .all(|(a, b)| a == b)
901 }
902 }
903 impl Eq for sockaddr_dl {}
904 impl hash::Hash for sockaddr_dl {
905 fn hash<H: hash::Hasher>(&self, state: &mut H) {
906 self.sdl_len.hash(state);
907 self.sdl_family.hash(state);
908 self.sdl_index.hash(state);
909 self.sdl_type.hash(state);
910 self.sdl_nlen.hash(state);
911 self.sdl_alen.hash(state);
912 self.sdl_slen.hash(state);
913 self.sdl_data.hash(state);
914 }
915 }
916
917 // sync_t
918 impl fmt::Debug for sync_t {
919 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
920 f.debug_struct("sync_t")
921 .field("__owner", &self.__owner)
922 .field("__u", &self.__u)
923 .finish()
924 }
925 }
926
927 // pthread_barrier_t
928 impl fmt::Debug for pthread_barrier_t {
929 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
930 f.debug_struct("pthread_barrier_t")
931 .field("__pad", &self.__pad)
932 .finish()
933 }
934 }
935
936 // pthread_rwlock_t
937 impl fmt::Debug for pthread_rwlock_t {
938 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
939 f.debug_struct("pthread_rwlock_t")
940 .field("__active", &self.__active)
941 .field("__blockedwriters", &self.__blockedwriters)
942 .field("__blockedreaders", &self.__blockedreaders)
943 .field("__heavy", &self.__heavy)
944 .field("__lock", &self.__lock)
945 .field("__rcond", &self.__rcond)
946 .field("__wcond", &self.__wcond)
947 .field("__owner", &self.__owner)
948 .field("__spare", &self.__spare)
949 .finish()
950 }
951 }
952
953 // syspage_entry
954 impl fmt::Debug for syspage_entry {
955 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
956 f.debug_struct("syspage_entry")
957 .field("size", &self.size)
958 .field("total_size", &self.total_size)
959 .field("type_", &self.type_)
960 .field("num_cpu", &self.num_cpu)
961 .field("system_private", &self.system_private)
962 .field("old_asinfo", &self.old_asinfo)
963 .field("hwinfo", &self.hwinfo)
964 .field("old_cpuinfo", &self.old_cpuinfo)
965 .field("old_cacheattr", &self.old_cacheattr)
966 .field("qtime", &self.qtime)
967 .field("callout", &self.callout)
968 .field("callin", &self.callin)
969 .field("typed_strings", &self.typed_strings)
970 .field("strings", &self.strings)
971 .field("old_intrinfo", &self.old_intrinfo)
972 .field("smp", &self.smp)
973 .field("pminfo", &self.pminfo)
974 .field("old_mdriver", &self.old_mdriver)
975 .field("new_asinfo", &self.new_asinfo)
976 .field("new_cpuinfo", &self.new_cpuinfo)
977 .field("new_cacheattr", &self.new_cacheattr)
978 .field("new_intrinfo", &self.new_intrinfo)
979 .field("new_mdriver", &self.new_mdriver)
980 .finish()
981 }
982 }
983
984 impl PartialEq for utsname {
985 fn eq(&self, other: &utsname) -> bool {
986 self.sysname
987 .iter()
988 .zip(other.sysname.iter())
989 .all(|(a, b)| a == b)
990 && self
991 .nodename
992 .iter()
993 .zip(other.nodename.iter())
994 .all(|(a, b)| a == b)
995 && self
996 .release
997 .iter()
998 .zip(other.release.iter())
999 .all(|(a, b)| a == b)
1000 && self
1001 .version
1002 .iter()
1003 .zip(other.version.iter())
1004 .all(|(a, b)| a == b)
1005 && self
1006 .machine
1007 .iter()
1008 .zip(other.machine.iter())
1009 .all(|(a, b)| a == b)
1010 }
1011 }
1012
1013 impl Eq for utsname {}
1014
1015 impl fmt::Debug for utsname {
1016 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1017 f.debug_struct("utsname")
1018 // FIXME(debug): .field("sysname", &self.sysname)
1019 // FIXME(debug): .field("nodename", &self.nodename)
1020 // FIXME(debug): .field("release", &self.release)
1021 // FIXME(debug): .field("version", &self.version)
1022 // FIXME(debug): .field("machine", &self.machine)
1023 .finish()
1024 }
1025 }
1026
1027 impl hash::Hash for utsname {
1028 fn hash<H: hash::Hasher>(&self, state: &mut H) {
1029 self.sysname.hash(state);
1030 self.nodename.hash(state);
1031 self.release.hash(state);
1032 self.version.hash(state);
1033 self.machine.hash(state);
1034 }
1035 }
1036
1037 impl PartialEq for mq_attr {
1038 fn eq(&self, other: &mq_attr) -> bool {
1039 self.mq_maxmsg == other.mq_maxmsg
1040 && self.mq_msgsize == other.mq_msgsize
1041 && self.mq_flags == other.mq_flags
1042 && self.mq_curmsgs == other.mq_curmsgs
1043 && self.mq_msgsize == other.mq_msgsize
1044 && self.mq_sendwait == other.mq_sendwait
1045 && self.mq_recvwait == other.mq_recvwait
1046 }
1047 }
1048
1049 impl Eq for mq_attr {}
1050
1051 impl fmt::Debug for mq_attr {
1052 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1053 f.debug_struct("mq_attr")
1054 .field("mq_maxmsg", &self.mq_maxmsg)
1055 .field("mq_msgsize", &self.mq_msgsize)
1056 .field("mq_flags", &self.mq_flags)
1057 .field("mq_curmsgs", &self.mq_curmsgs)
1058 .field("mq_msgsize", &self.mq_msgsize)
1059 .field("mq_sendwait", &self.mq_sendwait)
1060 .field("mq_recvwait", &self.mq_recvwait)
1061 .finish()
1062 }
1063 }
1064 impl hash::Hash for mq_attr {
1065 fn hash<H: hash::Hasher>(&self, state: &mut H) {
1066 self.mq_maxmsg.hash(state);
1067 self.mq_msgsize.hash(state);
1068 self.mq_flags.hash(state);
1069 self.mq_curmsgs.hash(state);
1070 self.mq_sendwait.hash(state);
1071 self.mq_recvwait.hash(state);
1072 }
1073 }
1074
1075 impl PartialEq for sockaddr_storage {
1076 fn eq(&self, other: &sockaddr_storage) -> bool {
1077 self.ss_len == other.ss_len
1078 && self.ss_family == other.ss_family
1079 && self.__ss_pad1 == other.__ss_pad1
1080 && self.__ss_align == other.__ss_align
1081 && self
1082 .__ss_pad2
1083 .iter()
1084 .zip(other.__ss_pad2.iter())
1085 .all(|(a, b)| a == b)
1086 }
1087 }
1088
1089 impl Eq for sockaddr_storage {}
1090
1091 impl fmt::Debug for sockaddr_storage {
1092 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1093 f.debug_struct("sockaddr_storage")
1094 .field("ss_len", &self.ss_len)
1095 .field("ss_family", &self.ss_family)
1096 .field("__ss_pad1", &self.__ss_pad1)
1097 .field("__ss_align", &self.__ss_align)
1098 // FIXME(debug): .field("__ss_pad2", &self.__ss_pad2)
1099 .finish()
1100 }
1101 }
1102
1103 impl hash::Hash for sockaddr_storage {
1104 fn hash<H: hash::Hasher>(&self, state: &mut H) {
1105 self.ss_len.hash(state);
1106 self.ss_family.hash(state);
1107 self.__ss_pad1.hash(state);
1108 self.__ss_align.hash(state);
1109 self.__ss_pad2.hash(state);
1110 }
1111 }
1112
1113 impl PartialEq for dirent {
1114 fn eq(&self, other: &dirent) -> bool {
1115 self.d_ino == other.d_ino
1116 && self.d_offset == other.d_offset
1117 && self.d_reclen == other.d_reclen
1118 && self.d_namelen == other.d_namelen
1119 && self.d_name[..self.d_namelen as _]
1120 .iter()
1121 .zip(other.d_name.iter())
1122 .all(|(a, b)| a == b)
1123 }
1124 }
1125
1126 impl Eq for dirent {}
1127
1128 impl fmt::Debug for dirent {
1129 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1130 f.debug_struct("dirent")
1131 .field("d_ino", &self.d_ino)
1132 .field("d_offset", &self.d_offset)
1133 .field("d_reclen", &self.d_reclen)
1134 .field("d_namelen", &self.d_namelen)
1135 .field("d_name", &&self.d_name[..self.d_namelen as _])
1136 .finish()
1137 }
1138 }
1139
1140 impl hash::Hash for dirent {
1141 fn hash<H: hash::Hasher>(&self, state: &mut H) {
1142 self.d_ino.hash(state);
1143 self.d_offset.hash(state);
1144 self.d_reclen.hash(state);
1145 self.d_namelen.hash(state);
1146 self.d_name[..self.d_namelen as _].hash(state);
1147 }
1148 }
1149 }
1150 }
1151
1152 pub const _SYSNAME_SIZE: usize = 256 + 1;
1153 pub const RLIM_INFINITY: crate::rlim_t = 0xfffffffffffffffd;
1154 pub const O_LARGEFILE: c_int = 0o0100000;
1155
1156 // intentionally not public, only used for fd_set
1157 cfg_if! {
1158 if #[cfg(target_pointer_width = "32")] {
1159 const ULONG_SIZE: usize = 32;
1160 } else if #[cfg(target_pointer_width = "64")] {
1161 const ULONG_SIZE: usize = 64;
1162 } else {
1163 // Unknown target_pointer_width
1164 }
1165 }
1166
1167 pub const EXIT_FAILURE: c_int = 1;
1168 pub const EXIT_SUCCESS: c_int = 0;
1169 pub const RAND_MAX: c_int = 32767;
1170 pub const EOF: c_int = -1;
1171 pub const SEEK_SET: c_int = 0;
1172 pub const SEEK_CUR: c_int = 1;
1173 pub const SEEK_END: c_int = 2;
1174 pub const _IOFBF: c_int = 0;
1175 pub const _IONBF: c_int = 2;
1176 pub const _IOLBF: c_int = 1;
1177
1178 pub const F_DUPFD: c_int = 0;
1179 pub const F_GETFD: c_int = 1;
1180 pub const F_SETFD: c_int = 2;
1181 pub const F_GETFL: c_int = 3;
1182 pub const F_SETFL: c_int = 4;
1183
1184 pub const F_DUPFD_CLOEXEC: c_int = 5;
1185
1186 pub const SIGTRAP: c_int = 5;
1187
1188 pub const CLOCK_REALTIME: crate::clockid_t = 0;
1189 pub const CLOCK_MONOTONIC: crate::clockid_t = 2;
1190 pub const CLOCK_PROCESS_CPUTIME_ID: crate::clockid_t = 3;
1191 pub const CLOCK_THREAD_CPUTIME_ID: crate::clockid_t = 4;
1192 pub const TIMER_ABSTIME: c_uint = 0x80000000;
1193
1194 pub const RUSAGE_SELF: c_int = 0;
1195
1196 pub const F_OK: c_int = 0;
1197 pub const X_OK: c_int = 1;
1198 pub const W_OK: c_int = 2;
1199 pub const R_OK: c_int = 4;
1200
1201 pub const STDIN_FILENO: c_int = 0;
1202 pub const STDOUT_FILENO: c_int = 1;
1203 pub const STDERR_FILENO: c_int = 2;
1204
1205 pub const SIGHUP: c_int = 1;
1206 pub const SIGINT: c_int = 2;
1207 pub const SIGQUIT: c_int = 3;
1208 pub const SIGILL: c_int = 4;
1209 pub const SIGABRT: c_int = 6;
1210 pub const SIGFPE: c_int = 8;
1211 pub const SIGKILL: c_int = 9;
1212 pub const SIGSEGV: c_int = 11;
1213 pub const SIGPIPE: c_int = 13;
1214 pub const SIGALRM: c_int = 14;
1215 pub const SIGTERM: c_int = 15;
1216
1217 pub const PROT_NONE: c_int = 0x00000000;
1218 pub const PROT_READ: c_int = 0x00000100;
1219 pub const PROT_WRITE: c_int = 0x00000200;
1220 pub const PROT_EXEC: c_int = 0x00000400;
1221
1222 pub const MAP_FILE: c_int = 0;
1223 pub const MAP_SHARED: c_int = 1;
1224 pub const MAP_PRIVATE: c_int = 2;
1225 pub const MAP_FIXED: c_int = 0x10;
1226
1227 pub const MAP_FAILED: *mut c_void = !0 as *mut c_void;
1228
1229 pub const MS_ASYNC: c_int = 1;
1230 pub const MS_INVALIDATE: c_int = 4;
1231 pub const MS_SYNC: c_int = 2;
1232
1233 pub const SCM_RIGHTS: c_int = 0x01;
1234 pub const SCM_TIMESTAMP: c_int = 0x02;
1235 pub const SCM_CREDS: c_int = 0x04;
1236
1237 pub const MAP_TYPE: c_int = 0x3;
1238
1239 pub const IFF_UP: c_int = 0x00000001;
1240 pub const IFF_BROADCAST: c_int = 0x00000002;
1241 pub const IFF_DEBUG: c_int = 0x00000004;
1242 pub const IFF_LOOPBACK: c_int = 0x00000008;
1243 pub const IFF_POINTOPOINT: c_int = 0x00000010;
1244 pub const IFF_NOTRAILERS: c_int = 0x00000020;
1245 pub const IFF_RUNNING: c_int = 0x00000040;
1246 pub const IFF_NOARP: c_int = 0x00000080;
1247 pub const IFF_PROMISC: c_int = 0x00000100;
1248 pub const IFF_ALLMULTI: c_int = 0x00000200;
1249 pub const IFF_MULTICAST: c_int = 0x00008000;
1250
1251 pub const AF_UNSPEC: c_int = 0;
1252 pub const AF_UNIX: c_int = AF_LOCAL;
1253 pub const AF_LOCAL: c_int = 1;
1254 pub const AF_INET: c_int = 2;
1255 pub const AF_IPX: c_int = 23;
1256 pub const AF_APPLETALK: c_int = 16;
1257 pub const AF_INET6: c_int = 24;
1258 pub const AF_ROUTE: c_int = 17;
1259 pub const AF_SNA: c_int = 11;
1260 pub const AF_BLUETOOTH: c_int = 31;
1261 pub const AF_ISDN: c_int = 26;
1262
1263 pub const PF_UNSPEC: c_int = AF_UNSPEC;
1264 pub const PF_UNIX: c_int = PF_LOCAL;
1265 pub const PF_LOCAL: c_int = AF_LOCAL;
1266 pub const PF_INET: c_int = AF_INET;
1267 pub const PF_IPX: c_int = AF_IPX;
1268 pub const PF_APPLETALK: c_int = AF_APPLETALK;
1269 pub const PF_INET6: c_int = AF_INET6;
1270 pub const pseudo_AF_KEY: c_int = 29;
1271 pub const PF_KEY: c_int = pseudo_AF_KEY;
1272 pub const PF_ROUTE: c_int = AF_ROUTE;
1273 pub const PF_SNA: c_int = AF_SNA;
1274
1275 pub const PF_BLUETOOTH: c_int = AF_BLUETOOTH;
1276 pub const PF_ISDN: c_int = AF_ISDN;
1277
1278 pub const SOMAXCONN: c_int = 128;
1279
1280 pub const MSG_OOB: c_int = 0x0001;
1281 pub const MSG_PEEK: c_int = 0x0002;
1282 pub const MSG_DONTROUTE: c_int = 0x0004;
1283 pub const MSG_CTRUNC: c_int = 0x0020;
1284 pub const MSG_TRUNC: c_int = 0x0010;
1285 pub const MSG_DONTWAIT: c_int = 0x0080;
1286 pub const MSG_EOR: c_int = 0x0008;
1287 pub const MSG_WAITALL: c_int = 0x0040;
1288 pub const MSG_NOSIGNAL: c_int = 0x0800;
1289 pub const MSG_WAITFORONE: c_int = 0x2000;
1290
1291 pub const IP_TOS: c_int = 3;
1292 pub const IP_TTL: c_int = 4;
1293 pub const IP_HDRINCL: c_int = 2;
1294 pub const IP_OPTIONS: c_int = 1;
1295 pub const IP_RECVOPTS: c_int = 5;
1296 pub const IP_RETOPTS: c_int = 8;
1297 pub const IP_PKTINFO: c_int = 25;
1298 pub const IP_IPSEC_POLICY_COMPAT: c_int = 22;
1299 pub const IP_MULTICAST_IF: c_int = 9;
1300 pub const IP_MULTICAST_TTL: c_int = 10;
1301 pub const IP_MULTICAST_LOOP: c_int = 11;
1302 pub const IP_ADD_MEMBERSHIP: c_int = 12;
1303 pub const IP_DROP_MEMBERSHIP: c_int = 13;
1304 pub const IP_DEFAULT_MULTICAST_TTL: c_int = 1;
1305 pub const IP_DEFAULT_MULTICAST_LOOP: c_int = 1;
1306
1307 pub const IPPROTO_HOPOPTS: c_int = 0;
1308 pub const IPPROTO_IGMP: c_int = 2;
1309 pub const IPPROTO_IPIP: c_int = 4;
1310 pub const IPPROTO_EGP: c_int = 8;
1311 pub const IPPROTO_PUP: c_int = 12;
1312 pub const IPPROTO_IDP: c_int = 22;
1313 pub const IPPROTO_TP: c_int = 29;
1314 pub const IPPROTO_ROUTING: c_int = 43;
1315 pub const IPPROTO_FRAGMENT: c_int = 44;
1316 pub const IPPROTO_RSVP: c_int = 46;
1317 pub const IPPROTO_GRE: c_int = 47;
1318 pub const IPPROTO_ESP: c_int = 50;
1319 pub const IPPROTO_AH: c_int = 51;
1320 pub const IPPROTO_NONE: c_int = 59;
1321 pub const IPPROTO_DSTOPTS: c_int = 60;
1322 pub const IPPROTO_ENCAP: c_int = 98;
1323 pub const IPPROTO_PIM: c_int = 103;
1324 pub const IPPROTO_SCTP: c_int = 132;
1325 pub const IPPROTO_RAW: c_int = 255;
1326 pub const IPPROTO_MAX: c_int = 256;
1327 pub const IPPROTO_CARP: c_int = 112;
1328 pub const IPPROTO_DIVERT: c_int = 259;
1329 pub const IPPROTO_DONE: c_int = 257;
1330 pub const IPPROTO_EON: c_int = 80;
1331 pub const IPPROTO_ETHERIP: c_int = 97;
1332 pub const IPPROTO_GGP: c_int = 3;
1333 pub const IPPROTO_IPCOMP: c_int = 108;
1334 pub const IPPROTO_MOBILE: c_int = 55;
1335
1336 pub const IPV6_RTHDR_LOOSE: c_int = 0;
1337 pub const IPV6_RTHDR_STRICT: c_int = 1;
1338 pub const IPV6_UNICAST_HOPS: c_int = 4;
1339 pub const IPV6_MULTICAST_IF: c_int = 9;
1340 pub const IPV6_MULTICAST_HOPS: c_int = 10;
1341 pub const IPV6_MULTICAST_LOOP: c_int = 11;
1342 pub const IPV6_JOIN_GROUP: c_int = 12;
1343 pub const IPV6_LEAVE_GROUP: c_int = 13;
1344 pub const IPV6_CHECKSUM: c_int = 26;
1345 pub const IPV6_V6ONLY: c_int = 27;
1346 pub const IPV6_IPSEC_POLICY_COMPAT: c_int = 28;
1347 pub const IPV6_RTHDRDSTOPTS: c_int = 35;
1348 pub const IPV6_RECVPKTINFO: c_int = 36;
1349 pub const IPV6_RECVHOPLIMIT: c_int = 37;
1350 pub const IPV6_RECVRTHDR: c_int = 38;
1351 pub const IPV6_RECVHOPOPTS: c_int = 39;
1352 pub const IPV6_RECVDSTOPTS: c_int = 40;
1353 pub const IPV6_RECVPATHMTU: c_int = 43;
1354 pub const IPV6_PATHMTU: c_int = 44;
1355 pub const IPV6_PKTINFO: c_int = 46;
1356 pub const IPV6_HOPLIMIT: c_int = 47;
1357 pub const IPV6_NEXTHOP: c_int = 48;
1358 pub const IPV6_HOPOPTS: c_int = 49;
1359 pub const IPV6_DSTOPTS: c_int = 50;
1360 pub const IPV6_RECVTCLASS: c_int = 57;
1361 pub const IPV6_TCLASS: c_int = 61;
1362 pub const IPV6_DONTFRAG: c_int = 62;
1363
1364 pub const TCP_NODELAY: c_int = 0x01;
1365 pub const TCP_MAXSEG: c_int = 0x02;
1366 pub const TCP_MD5SIG: c_int = 0x10;
1367 pub const TCP_KEEPALIVE: c_int = 0x04;
1368
1369 pub const SHUT_RD: c_int = 0;
1370 pub const SHUT_WR: c_int = 1;
1371 pub const SHUT_RDWR: c_int = 2;
1372
1373 pub const LOCK_SH: c_int = 0x1;
1374 pub const LOCK_EX: c_int = 0x2;
1375 pub const LOCK_NB: c_int = 0x4;
1376 pub const LOCK_UN: c_int = 0x8;
1377
1378 pub const SS_ONSTACK: c_int = 1;
1379 pub const SS_DISABLE: c_int = 2;
1380
1381 pub const PATH_MAX: c_int = 1024;
1382
1383 pub const UIO_MAXIOV: c_int = 1024;
1384
1385 pub const FD_SETSIZE: usize = 256;
1386
1387 pub const TCIOFF: c_int = 0x0002;
1388 pub const TCION: c_int = 0x0003;
1389 pub const TCOOFF: c_int = 0x0000;
1390 pub const TCOON: c_int = 0x0001;
1391 pub const TCIFLUSH: c_int = 0;
1392 pub const TCOFLUSH: c_int = 1;
1393 pub const TCIOFLUSH: c_int = 2;
1394 pub const NL0: crate::tcflag_t = 0x000;
1395 pub const NL1: crate::tcflag_t = 0x100;
1396 pub const TAB0: crate::tcflag_t = 0x0000;
1397 pub const CR0: crate::tcflag_t = 0x000;
1398 pub const FF0: crate::tcflag_t = 0x0000;
1399 pub const BS0: crate::tcflag_t = 0x0000;
1400 pub const VT0: crate::tcflag_t = 0x0000;
1401 pub const VERASE: usize = 2;
1402 pub const VKILL: usize = 3;
1403 pub const VINTR: usize = 0;
1404 pub const VQUIT: usize = 1;
1405 pub const VLNEXT: usize = 15;
1406 pub const IGNBRK: crate::tcflag_t = 0x00000001;
1407 pub const BRKINT: crate::tcflag_t = 0x00000002;
1408 pub const IGNPAR: crate::tcflag_t = 0x00000004;
1409 pub const PARMRK: crate::tcflag_t = 0x00000008;
1410 pub const INPCK: crate::tcflag_t = 0x00000010;
1411 pub const ISTRIP: crate::tcflag_t = 0x00000020;
1412 pub const INLCR: crate::tcflag_t = 0x00000040;
1413 pub const IGNCR: crate::tcflag_t = 0x00000080;
1414 pub const ICRNL: crate::tcflag_t = 0x00000100;
1415 pub const IXANY: crate::tcflag_t = 0x00000800;
1416 pub const IMAXBEL: crate::tcflag_t = 0x00002000;
1417 pub const OPOST: crate::tcflag_t = 0x00000001;
1418 pub const CS5: crate::tcflag_t = 0x00;
1419 pub const ECHO: crate::tcflag_t = 0x00000008;
1420 pub const OCRNL: crate::tcflag_t = 0x00000008;
1421 pub const ONOCR: crate::tcflag_t = 0x00000010;
1422 pub const ONLRET: crate::tcflag_t = 0x00000020;
1423 pub const OFILL: crate::tcflag_t = 0x00000040;
1424 pub const OFDEL: crate::tcflag_t = 0x00000080;
1425
1426 pub const WNOHANG: c_int = 0x0040;
1427 pub const WUNTRACED: c_int = 0x0004;
1428 pub const WSTOPPED: c_int = WUNTRACED;
1429 pub const WEXITED: c_int = 0x0001;
1430 pub const WCONTINUED: c_int = 0x0008;
1431 pub const WNOWAIT: c_int = 0x0080;
1432 pub const WTRAPPED: c_int = 0x0002;
1433
1434 pub const RTLD_LOCAL: c_int = 0x0200;
1435 pub const RTLD_LAZY: c_int = 0x0001;
1436
1437 pub const POSIX_FADV_NORMAL: c_int = 0;
1438 pub const POSIX_FADV_RANDOM: c_int = 2;
1439 pub const POSIX_FADV_SEQUENTIAL: c_int = 1;
1440 pub const POSIX_FADV_WILLNEED: c_int = 3;
1441
1442 pub const AT_FDCWD: c_int = -100;
1443 pub const AT_EACCESS: c_int = 0x0001;
1444 pub const AT_SYMLINK_NOFOLLOW: c_int = 0x0002;
1445 pub const AT_SYMLINK_FOLLOW: c_int = 0x0004;
1446 pub const AT_REMOVEDIR: c_int = 0x0008;
1447
1448 pub const LOG_CRON: c_int = 9 << 3;
1449 pub const LOG_AUTHPRIV: c_int = 10 << 3;
1450 pub const LOG_FTP: c_int = 11 << 3;
1451 pub const LOG_PERROR: c_int = 0x20;
1452
1453 pub const PIPE_BUF: usize = 5120;
1454
1455 pub const CLD_EXITED: c_int = 1;
1456 pub const CLD_KILLED: c_int = 2;
1457 pub const CLD_DUMPED: c_int = 3;
1458 pub const CLD_TRAPPED: c_int = 4;
1459 pub const CLD_STOPPED: c_int = 5;
1460 pub const CLD_CONTINUED: c_int = 6;
1461
1462 pub const UTIME_OMIT: c_long = 0x40000002;
1463 pub const UTIME_NOW: c_long = 0x40000001;
1464
1465 pub const POLLIN: c_short = POLLRDNORM | POLLRDBAND;
1466 pub const POLLPRI: c_short = 0x0008;
1467 pub const POLLOUT: c_short = 0x0002;
1468 pub const POLLERR: c_short = 0x0020;
1469 pub const POLLHUP: c_short = 0x0040;
1470 pub const POLLNVAL: c_short = 0x1000;
1471 pub const POLLRDNORM: c_short = 0x0001;
1472 pub const POLLRDBAND: c_short = 0x0004;
1473
1474 pub const IPTOS_LOWDELAY: u8 = 0x10;
1475 pub const IPTOS_THROUGHPUT: u8 = 0x08;
1476 pub const IPTOS_RELIABILITY: u8 = 0x04;
1477 pub const IPTOS_MINCOST: u8 = 0x02;
1478
1479 pub const IPTOS_PREC_NETCONTROL: u8 = 0xe0;
1480 pub const IPTOS_PREC_INTERNETCONTROL: u8 = 0xc0;
1481 pub const IPTOS_PREC_CRITIC_ECP: u8 = 0xa0;
1482 pub const IPTOS_PREC_FLASHOVERRIDE: u8 = 0x80;
1483 pub const IPTOS_PREC_FLASH: u8 = 0x60;
1484 pub const IPTOS_PREC_IMMEDIATE: u8 = 0x40;
1485 pub const IPTOS_PREC_PRIORITY: u8 = 0x20;
1486 pub const IPTOS_PREC_ROUTINE: u8 = 0x00;
1487
1488 pub const IPTOS_ECN_MASK: u8 = 0x03;
1489 pub const IPTOS_ECN_ECT1: u8 = 0x01;
1490 pub const IPTOS_ECN_ECT0: u8 = 0x02;
1491 pub const IPTOS_ECN_CE: u8 = 0x03;
1492
1493 pub const IPOPT_CONTROL: u8 = 0x00;
1494 pub const IPOPT_RESERVED1: u8 = 0x20;
1495 pub const IPOPT_RESERVED2: u8 = 0x60;
1496 pub const IPOPT_LSRR: u8 = 131;
1497 pub const IPOPT_RR: u8 = 7;
1498 pub const IPOPT_SSRR: u8 = 137;
1499 pub const IPDEFTTL: u8 = 64;
1500 pub const IPOPT_OPTVAL: u8 = 0;
1501 pub const IPOPT_OLEN: u8 = 1;
1502 pub const IPOPT_OFFSET: u8 = 2;
1503 pub const IPOPT_MINOFF: u8 = 4;
1504 pub const IPOPT_NOP: u8 = 1;
1505 pub const IPOPT_EOL: u8 = 0;
1506 pub const IPOPT_TS: u8 = 68;
1507 pub const IPOPT_TS_TSONLY: u8 = 0;
1508 pub const IPOPT_TS_TSANDADDR: u8 = 1;
1509 pub const IPOPT_TS_PRESPEC: u8 = 3;
1510
1511 pub const MAX_IPOPTLEN: u8 = 40;
1512 pub const IPVERSION: u8 = 4;
1513 pub const MAXTTL: u8 = 255;
1514
1515 pub const ARPHRD_ETHER: u16 = 1;
1516 pub const ARPHRD_IEEE802: u16 = 6;
1517 pub const ARPHRD_ARCNET: u16 = 7;
1518 pub const ARPHRD_IEEE1394: u16 = 24;
1519
1520 pub const SOL_SOCKET: c_int = 0xffff;
1521
1522 pub const SO_DEBUG: c_int = 0x0001;
1523 pub const SO_REUSEADDR: c_int = 0x0004;
1524 pub const SO_TYPE: c_int = 0x1008;
1525 pub const SO_ERROR: c_int = 0x1007;
1526 pub const SO_DONTROUTE: c_int = 0x0010;
1527 pub const SO_BROADCAST: c_int = 0x0020;
1528 pub const SO_SNDBUF: c_int = 0x1001;
1529 pub const SO_RCVBUF: c_int = 0x1002;
1530 pub const SO_KEEPALIVE: c_int = 0x0008;
1531 pub const SO_OOBINLINE: c_int = 0x0100;
1532 pub const SO_LINGER: c_int = 0x0080;
1533 pub const SO_REUSEPORT: c_int = 0x0200;
1534 pub const SO_RCVLOWAT: c_int = 0x1004;
1535 pub const SO_SNDLOWAT: c_int = 0x1003;
1536 pub const SO_RCVTIMEO: c_int = 0x1006;
1537 pub const SO_SNDTIMEO: c_int = 0x1005;
1538 pub const SO_BINDTODEVICE: c_int = 0x0800;
1539 pub const SO_TIMESTAMP: c_int = 0x0400;
1540 pub const SO_ACCEPTCONN: c_int = 0x0002;
1541
1542 pub const TIOCM_LE: c_int = 0x0100;
1543 pub const TIOCM_DTR: c_int = 0x0001;
1544 pub const TIOCM_RTS: c_int = 0x0002;
1545 pub const TIOCM_ST: c_int = 0x0200;
1546 pub const TIOCM_SR: c_int = 0x0400;
1547 pub const TIOCM_CTS: c_int = 0x1000;
1548 pub const TIOCM_CAR: c_int = TIOCM_CD;
1549 pub const TIOCM_CD: c_int = 0x8000;
1550 pub const TIOCM_RNG: c_int = TIOCM_RI;
1551 pub const TIOCM_RI: c_int = 0x4000;
1552 pub const TIOCM_DSR: c_int = 0x2000;
1553
1554 pub const SCHED_OTHER: c_int = 3;
1555 pub const SCHED_FIFO: c_int = 1;
1556 pub const SCHED_RR: c_int = 2;
1557
1558 pub const IPC_PRIVATE: crate::key_t = 0;
1559
1560 pub const IPC_CREAT: c_int = 0o001000;
1561 pub const IPC_EXCL: c_int = 0o002000;
1562 pub const IPC_NOWAIT: c_int = 0o004000;
1563
1564 pub const IPC_RMID: c_int = 0;
1565 pub const IPC_SET: c_int = 1;
1566 pub const IPC_STAT: c_int = 2;
1567
1568 pub const MSG_NOERROR: c_int = 0o010000;
1569
1570 pub const LOG_NFACILITIES: c_int = 24;
1571
1572 pub const SEM_FAILED: *mut crate::sem_t = 0xFFFFFFFFFFFFFFFF as *mut sem_t;
1573
1574 pub const AI_PASSIVE: c_int = 0x00000001;
1575 pub const AI_CANONNAME: c_int = 0x00000002;
1576 pub const AI_NUMERICHOST: c_int = 0x00000004;
1577
1578 pub const AI_NUMERICSERV: c_int = 0x00000008;
1579
1580 pub const EAI_BADFLAGS: c_int = 3;
1581 pub const EAI_NONAME: c_int = 8;
1582 pub const EAI_AGAIN: c_int = 2;
1583 pub const EAI_FAIL: c_int = 4;
1584 pub const EAI_NODATA: c_int = 7;
1585 pub const EAI_FAMILY: c_int = 5;
1586 pub const EAI_SOCKTYPE: c_int = 10;
1587 pub const EAI_SERVICE: c_int = 9;
1588 pub const EAI_MEMORY: c_int = 6;
1589 pub const EAI_SYSTEM: c_int = 11;
1590 pub const EAI_OVERFLOW: c_int = 14;
1591
1592 pub const NI_NUMERICHOST: c_int = 0x00000002;
1593 pub const NI_NUMERICSERV: c_int = 0x00000008;
1594 pub const NI_NOFQDN: c_int = 0x00000001;
1595 pub const NI_NAMEREQD: c_int = 0x00000004;
1596 pub const NI_DGRAM: c_int = 0x00000010;
1597
1598 pub const AIO_CANCELED: c_int = 0;
1599 pub const AIO_NOTCANCELED: c_int = 2;
1600 pub const AIO_ALLDONE: c_int = 1;
1601 pub const LIO_READ: c_int = 1;
1602 pub const LIO_WRITE: c_int = 2;
1603 pub const LIO_NOP: c_int = 0;
1604 pub const LIO_WAIT: c_int = 1;
1605 pub const LIO_NOWAIT: c_int = 0;
1606
1607 pub const ITIMER_REAL: c_int = 0;
1608 pub const ITIMER_VIRTUAL: c_int = 1;
1609 pub const ITIMER_PROF: c_int = 2;
1610
1611 // DIFF(main): changed to `c_short` in f62eb023ab
1612 pub const POSIX_SPAWN_RESETIDS: c_int = 0x00000010;
1613 pub const POSIX_SPAWN_SETPGROUP: c_int = 0x00000001;
1614 pub const POSIX_SPAWN_SETSIGDEF: c_int = 0x00000004;
1615 pub const POSIX_SPAWN_SETSIGMASK: c_int = 0x00000002;
1616 pub const POSIX_SPAWN_SETSCHEDPARAM: c_int = 0x00000400;
1617 pub const POSIX_SPAWN_SETSCHEDULER: c_int = 0x00000040;
1618
1619 pub const IPTOS_ECN_NOT_ECT: u8 = 0x00;
1620
1621 pub const RTF_UP: c_ushort = 0x0001;
1622 pub const RTF_GATEWAY: c_ushort = 0x0002;
1623
1624 pub const RTF_HOST: c_ushort = 0x0004;
1625 pub const RTF_DYNAMIC: c_ushort = 0x0010;
1626 pub const RTF_MODIFIED: c_ushort = 0x0020;
1627 pub const RTF_REJECT: c_ushort = 0x0008;
1628 pub const RTF_STATIC: c_ushort = 0x0800;
1629 pub const RTF_XRESOLVE: c_ushort = 0x0200;
1630 pub const RTF_BROADCAST: u32 = 0x80000;
1631 pub const RTM_NEWADDR: u16 = 0xc;
1632 pub const RTM_DELADDR: u16 = 0xd;
1633 pub const RTA_DST: c_ushort = 0x1;
1634 pub const RTA_GATEWAY: c_ushort = 0x2;
1635
1636 pub const UDP_ENCAP: c_int = 100;
1637
1638 pub const IN_ACCESS: u32 = 0x00000001;
1639 pub const IN_MODIFY: u32 = 0x00000002;
1640 pub const IN_ATTRIB: u32 = 0x00000004;
1641 pub const IN_CLOSE_WRITE: u32 = 0x00000008;
1642 pub const IN_CLOSE_NOWRITE: u32 = 0x00000010;
1643 pub const IN_CLOSE: u32 = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE;
1644 pub const IN_OPEN: u32 = 0x00000020;
1645 pub const IN_MOVED_FROM: u32 = 0x00000040;
1646 pub const IN_MOVED_TO: u32 = 0x00000080;
1647 pub const IN_MOVE: u32 = IN_MOVED_FROM | IN_MOVED_TO;
1648 pub const IN_CREATE: u32 = 0x00000100;
1649 pub const IN_DELETE: u32 = 0x00000200;
1650 pub const IN_DELETE_SELF: u32 = 0x00000400;
1651 pub const IN_MOVE_SELF: u32 = 0x00000800;
1652 pub const IN_UNMOUNT: u32 = 0x00002000;
1653 pub const IN_Q_OVERFLOW: u32 = 0x00004000;
1654 pub const IN_IGNORED: u32 = 0x00008000;
1655 pub const IN_ONLYDIR: u32 = 0x01000000;
1656 pub const IN_DONT_FOLLOW: u32 = 0x02000000;
1657
1658 pub const IN_ISDIR: u32 = 0x40000000;
1659 pub const IN_ONESHOT: u32 = 0x80000000;
1660
1661 pub const REG_EXTENDED: c_int = 0o0001;
1662 pub const REG_ICASE: c_int = 0o0002;
1663 pub const REG_NEWLINE: c_int = 0o0010;
1664 pub const REG_NOSUB: c_int = 0o0004;
1665
1666 pub const REG_NOTBOL: c_int = 0o00001;
1667 pub const REG_NOTEOL: c_int = 0o00002;
1668
1669 pub const REG_ENOSYS: c_int = 17;
1670 pub const REG_NOMATCH: c_int = 1;
1671 pub const REG_BADPAT: c_int = 2;
1672 pub const REG_ECOLLATE: c_int = 3;
1673 pub const REG_ECTYPE: c_int = 4;
1674 pub const REG_EESCAPE: c_int = 5;
1675 pub const REG_ESUBREG: c_int = 6;
1676 pub const REG_EBRACK: c_int = 7;
1677 pub const REG_EPAREN: c_int = 8;
1678 pub const REG_EBRACE: c_int = 9;
1679 pub const REG_BADBR: c_int = 10;
1680 pub const REG_ERANGE: c_int = 11;
1681 pub const REG_ESPACE: c_int = 12;
1682 pub const REG_BADRPT: c_int = 13;
1683
1684 // errno.h
1685 pub const EOK: c_int = 0;
1686 pub const EWOULDBLOCK: c_int = EAGAIN;
1687 pub const EPERM: c_int = 1;
1688 pub const ENOENT: c_int = 2;
1689 pub const ESRCH: c_int = 3;
1690 pub const EINTR: c_int = 4;
1691 pub const EIO: c_int = 5;
1692 pub const ENXIO: c_int = 6;
1693 pub const E2BIG: c_int = 7;
1694 pub const ENOEXEC: c_int = 8;
1695 pub const EBADF: c_int = 9;
1696 pub const ECHILD: c_int = 10;
1697 pub const EAGAIN: c_int = 11;
1698 pub const ENOMEM: c_int = 12;
1699 pub const EACCES: c_int = 13;
1700 pub const EFAULT: c_int = 14;
1701 pub const ENOTBLK: c_int = 15;
1702 pub const EBUSY: c_int = 16;
1703 pub const EEXIST: c_int = 17;
1704 pub const EXDEV: c_int = 18;
1705 pub const ENODEV: c_int = 19;
1706 pub const ENOTDIR: c_int = 20;
1707 pub const EISDIR: c_int = 21;
1708 pub const EINVAL: c_int = 22;
1709 pub const ENFILE: c_int = 23;
1710 pub const EMFILE: c_int = 24;
1711 pub const ENOTTY: c_int = 25;
1712 pub const ETXTBSY: c_int = 26;
1713 pub const EFBIG: c_int = 27;
1714 pub const ENOSPC: c_int = 28;
1715 pub const ESPIPE: c_int = 29;
1716 pub const EROFS: c_int = 30;
1717 pub const EMLINK: c_int = 31;
1718 pub const EPIPE: c_int = 32;
1719 pub const EDOM: c_int = 33;
1720 pub const ERANGE: c_int = 34;
1721 pub const ENOMSG: c_int = 35;
1722 pub const EIDRM: c_int = 36;
1723 pub const ECHRNG: c_int = 37;
1724 pub const EL2NSYNC: c_int = 38;
1725 pub const EL3HLT: c_int = 39;
1726 pub const EL3RST: c_int = 40;
1727 pub const ELNRNG: c_int = 41;
1728 pub const EUNATCH: c_int = 42;
1729 pub const ENOCSI: c_int = 43;
1730 pub const EL2HLT: c_int = 44;
1731 pub const EDEADLK: c_int = 45;
1732 pub const ENOLCK: c_int = 46;
1733 pub const ECANCELED: c_int = 47;
1734 pub const EDQUOT: c_int = 49;
1735 pub const EBADE: c_int = 50;
1736 pub const EBADR: c_int = 51;
1737 pub const EXFULL: c_int = 52;
1738 pub const ENOANO: c_int = 53;
1739 pub const EBADRQC: c_int = 54;
1740 pub const EBADSLT: c_int = 55;
1741 pub const EDEADLOCK: c_int = 56;
1742 pub const EBFONT: c_int = 57;
1743 pub const EOWNERDEAD: c_int = 58;
1744 pub const ENOSTR: c_int = 60;
1745 pub const ENODATA: c_int = 61;
1746 pub const ETIME: c_int = 62;
1747 pub const ENOSR: c_int = 63;
1748 pub const ENONET: c_int = 64;
1749 pub const ENOPKG: c_int = 65;
1750 pub const EREMOTE: c_int = 66;
1751 pub const ENOLINK: c_int = 67;
1752 pub const EADV: c_int = 68;
1753 pub const ESRMNT: c_int = 69;
1754 pub const ECOMM: c_int = 70;
1755 pub const EPROTO: c_int = 71;
1756 pub const EMULTIHOP: c_int = 74;
1757 pub const EBADMSG: c_int = 77;
1758 pub const ENAMETOOLONG: c_int = 78;
1759 pub const EOVERFLOW: c_int = 79;
1760 pub const ENOTUNIQ: c_int = 80;
1761 pub const EBADFD: c_int = 81;
1762 pub const EREMCHG: c_int = 82;
1763 pub const ELIBACC: c_int = 83;
1764 pub const ELIBBAD: c_int = 84;
1765 pub const ELIBSCN: c_int = 85;
1766 pub const ELIBMAX: c_int = 86;
1767 pub const ELIBEXEC: c_int = 87;
1768 pub const EILSEQ: c_int = 88;
1769 pub const ENOSYS: c_int = 89;
1770 pub const ELOOP: c_int = 90;
1771 pub const ERESTART: c_int = 91;
1772 pub const ESTRPIPE: c_int = 92;
1773 pub const ENOTEMPTY: c_int = 93;
1774 pub const EUSERS: c_int = 94;
1775 pub const ENOTRECOVERABLE: c_int = 95;
1776 pub const EOPNOTSUPP: c_int = 103;
1777 pub const EFPOS: c_int = 110;
1778 pub const ESTALE: c_int = 122;
1779 pub const EINPROGRESS: c_int = 236;
1780 pub const EALREADY: c_int = 237;
1781 pub const ENOTSOCK: c_int = 238;
1782 pub const EDESTADDRREQ: c_int = 239;
1783 pub const EMSGSIZE: c_int = 240;
1784 pub const EPROTOTYPE: c_int = 241;
1785 pub const ENOPROTOOPT: c_int = 242;
1786 pub const EPROTONOSUPPORT: c_int = 243;
1787 pub const ESOCKTNOSUPPORT: c_int = 244;
1788 pub const EPFNOSUPPORT: c_int = 246;
1789 pub const EAFNOSUPPORT: c_int = 247;
1790 pub const EADDRINUSE: c_int = 248;
1791 pub const EADDRNOTAVAIL: c_int = 249;
1792 pub const ENETDOWN: c_int = 250;
1793 pub const ENETUNREACH: c_int = 251;
1794 pub const ENETRESET: c_int = 252;
1795 pub const ECONNABORTED: c_int = 253;
1796 pub const ECONNRESET: c_int = 254;
1797 pub const ENOBUFS: c_int = 255;
1798 pub const EISCONN: c_int = 256;
1799 pub const ENOTCONN: c_int = 257;
1800 pub const ESHUTDOWN: c_int = 258;
1801 pub const ETOOMANYREFS: c_int = 259;
1802 pub const ETIMEDOUT: c_int = 260;
1803 pub const ECONNREFUSED: c_int = 261;
1804 pub const EHOSTDOWN: c_int = 264;
1805 pub const EHOSTUNREACH: c_int = 265;
1806 pub const EBADRPC: c_int = 272;
1807 pub const ERPCMISMATCH: c_int = 273;
1808 pub const EPROGUNAVAIL: c_int = 274;
1809 pub const EPROGMISMATCH: c_int = 275;
1810 pub const EPROCUNAVAIL: c_int = 276;
1811 pub const ENOREMOTE: c_int = 300;
1812 pub const ENONDP: c_int = 301;
1813 pub const EBADFSYS: c_int = 302;
1814 pub const EMORE: c_int = 309;
1815 pub const ECTRLTERM: c_int = 310;
1816 pub const ENOLIC: c_int = 311;
1817 pub const ESRVRFAULT: c_int = 312;
1818 pub const EENDIAN: c_int = 313;
1819 pub const ESECTYPEINVAL: c_int = 314;
1820
1821 pub const RUSAGE_CHILDREN: c_int = -1;
1822 pub const L_tmpnam: c_uint = 255;
1823
1824 pub const _PC_LINK_MAX: c_int = 1;
1825 pub const _PC_MAX_CANON: c_int = 2;
1826 pub const _PC_MAX_INPUT: c_int = 3;
1827 pub const _PC_NAME_MAX: c_int = 4;
1828 pub const _PC_PATH_MAX: c_int = 5;
1829 pub const _PC_PIPE_BUF: c_int = 6;
1830 pub const _PC_CHOWN_RESTRICTED: c_int = 9;
1831 pub const _PC_NO_TRUNC: c_int = 7;
1832 pub const _PC_VDISABLE: c_int = 8;
1833 pub const _PC_SYNC_IO: c_int = 14;
1834 pub const _PC_ASYNC_IO: c_int = 12;
1835 pub const _PC_PRIO_IO: c_int = 13;
1836 pub const _PC_SOCK_MAXBUF: c_int = 15;
1837 pub const _PC_FILESIZEBITS: c_int = 16;
1838 pub const _PC_REC_INCR_XFER_SIZE: c_int = 22;
1839 pub const _PC_REC_MAX_XFER_SIZE: c_int = 23;
1840 pub const _PC_REC_MIN_XFER_SIZE: c_int = 24;
1841 pub const _PC_REC_XFER_ALIGN: c_int = 25;
1842 pub const _PC_ALLOC_SIZE_MIN: c_int = 21;
1843 pub const _PC_SYMLINK_MAX: c_int = 17;
1844 pub const _PC_2_SYMLINKS: c_int = 20;
1845
1846 pub const _SC_PAGE_SIZE: c_int = _SC_PAGESIZE;
1847 pub const _SC_ARG_MAX: c_int = 1;
1848 pub const _SC_CHILD_MAX: c_int = 2;
1849 pub const _SC_CLK_TCK: c_int = 3;
1850 pub const _SC_NGROUPS_MAX: c_int = 4;
1851 pub const _SC_OPEN_MAX: c_int = 5;
1852 pub const _SC_JOB_CONTROL: c_int = 6;
1853 pub const _SC_SAVED_IDS: c_int = 7;
1854 pub const _SC_VERSION: c_int = 8;
1855 pub const _SC_PASS_MAX: c_int = 9;
1856 pub const _SC_PAGESIZE: c_int = 11;
1857 pub const _SC_XOPEN_VERSION: c_int = 12;
1858 pub const _SC_STREAM_MAX: c_int = 13;
1859 pub const _SC_TZNAME_MAX: c_int = 14;
1860 pub const _SC_AIO_LISTIO_MAX: c_int = 15;
1861 pub const _SC_AIO_MAX: c_int = 16;
1862 pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 17;
1863 pub const _SC_DELAYTIMER_MAX: c_int = 18;
1864 pub const _SC_MQ_OPEN_MAX: c_int = 19;
1865 pub const _SC_MQ_PRIO_MAX: c_int = 20;
1866 pub const _SC_RTSIG_MAX: c_int = 21;
1867 pub const _SC_SEM_NSEMS_MAX: c_int = 22;
1868 pub const _SC_SEM_VALUE_MAX: c_int = 23;
1869 pub const _SC_SIGQUEUE_MAX: c_int = 24;
1870 pub const _SC_TIMER_MAX: c_int = 25;
1871 pub const _SC_ASYNCHRONOUS_IO: c_int = 26;
1872 pub const _SC_FSYNC: c_int = 27;
1873 pub const _SC_MAPPED_FILES: c_int = 28;
1874 pub const _SC_MEMLOCK: c_int = 29;
1875 pub const _SC_MEMLOCK_RANGE: c_int = 30;
1876 pub const _SC_MEMORY_PROTECTION: c_int = 31;
1877 pub const _SC_MESSAGE_PASSING: c_int = 32;
1878 pub const _SC_PRIORITIZED_IO: c_int = 33;
1879 pub const _SC_PRIORITY_SCHEDULING: c_int = 34;
1880 pub const _SC_REALTIME_SIGNALS: c_int = 35;
1881 pub const _SC_SEMAPHORES: c_int = 36;
1882 pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 37;
1883 pub const _SC_SYNCHRONIZED_IO: c_int = 38;
1884 pub const _SC_TIMERS: c_int = 39;
1885 pub const _SC_GETGR_R_SIZE_MAX: c_int = 40;
1886 pub const _SC_GETPW_R_SIZE_MAX: c_int = 41;
1887 pub const _SC_LOGIN_NAME_MAX: c_int = 42;
1888 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 43;
1889 pub const _SC_THREAD_KEYS_MAX: c_int = 44;
1890 pub const _SC_THREAD_STACK_MIN: c_int = 45;
1891 pub const _SC_THREAD_THREADS_MAX: c_int = 46;
1892 pub const _SC_TTY_NAME_MAX: c_int = 47;
1893 pub const _SC_THREADS: c_int = 48;
1894 pub const _SC_THREAD_ATTR_STACKADDR: c_int = 49;
1895 pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 50;
1896 pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 51;
1897 pub const _SC_THREAD_PRIO_INHERIT: c_int = 52;
1898 pub const _SC_THREAD_PRIO_PROTECT: c_int = 53;
1899 pub const _SC_THREAD_PROCESS_SHARED: c_int = 54;
1900 pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 55;
1901 pub const _SC_2_CHAR_TERM: c_int = 56;
1902 pub const _SC_2_C_BIND: c_int = 57;
1903 pub const _SC_2_C_DEV: c_int = 58;
1904 pub const _SC_2_C_VERSION: c_int = 59;
1905 pub const _SC_2_FORT_DEV: c_int = 60;
1906 pub const _SC_2_FORT_RUN: c_int = 61;
1907 pub const _SC_2_LOCALEDEF: c_int = 62;
1908 pub const _SC_2_SW_DEV: c_int = 63;
1909 pub const _SC_2_UPE: c_int = 64;
1910 pub const _SC_2_VERSION: c_int = 65;
1911 pub const _SC_ATEXIT_MAX: c_int = 66;
1912 pub const _SC_AVPHYS_PAGES: c_int = 67;
1913 pub const _SC_BC_BASE_MAX: c_int = 68;
1914 pub const _SC_BC_DIM_MAX: c_int = 69;
1915 pub const _SC_BC_SCALE_MAX: c_int = 70;
1916 pub const _SC_BC_STRING_MAX: c_int = 71;
1917 pub const _SC_CHARCLASS_NAME_MAX: c_int = 72;
1918 pub const _SC_CHAR_BIT: c_int = 73;
1919 pub const _SC_CHAR_MAX: c_int = 74;
1920 pub const _SC_CHAR_MIN: c_int = 75;
1921 pub const _SC_COLL_WEIGHTS_MAX: c_int = 76;
1922 pub const _SC_EQUIV_CLASS_MAX: c_int = 77;
1923 pub const _SC_EXPR_NEST_MAX: c_int = 78;
1924 pub const _SC_INT_MAX: c_int = 79;
1925 pub const _SC_INT_MIN: c_int = 80;
1926 pub const _SC_LINE_MAX: c_int = 81;
1927 pub const _SC_LONG_BIT: c_int = 82;
1928 pub const _SC_MB_LEN_MAX: c_int = 83;
1929 pub const _SC_NL_ARGMAX: c_int = 84;
1930 pub const _SC_NL_LANGMAX: c_int = 85;
1931 pub const _SC_NL_MSGMAX: c_int = 86;
1932 pub const _SC_NL_NMAX: c_int = 87;
1933 pub const _SC_NL_SETMAX: c_int = 88;
1934 pub const _SC_NL_TEXTMAX: c_int = 89;
1935 pub const _SC_NPROCESSORS_CONF: c_int = 90;
1936 pub const _SC_NPROCESSORS_ONLN: c_int = 91;
1937 pub const _SC_NZERO: c_int = 92;
1938 pub const _SC_PHYS_PAGES: c_int = 93;
1939 pub const _SC_PII: c_int = 94;
1940 pub const _SC_PII_INTERNET: c_int = 95;
1941 pub const _SC_PII_INTERNET_DGRAM: c_int = 96;
1942 pub const _SC_PII_INTERNET_STREAM: c_int = 97;
1943 pub const _SC_PII_OSI: c_int = 98;
1944 pub const _SC_PII_OSI_CLTS: c_int = 99;
1945 pub const _SC_PII_OSI_COTS: c_int = 100;
1946 pub const _SC_PII_OSI_M: c_int = 101;
1947 pub const _SC_PII_SOCKET: c_int = 102;
1948 pub const _SC_PII_XTI: c_int = 103;
1949 pub const _SC_POLL: c_int = 104;
1950 pub const _SC_RE_DUP_MAX: c_int = 105;
1951 pub const _SC_SCHAR_MAX: c_int = 106;
1952 pub const _SC_SCHAR_MIN: c_int = 107;
1953 pub const _SC_SELECT: c_int = 108;
1954 pub const _SC_SHRT_MAX: c_int = 109;
1955 pub const _SC_SHRT_MIN: c_int = 110;
1956 pub const _SC_SSIZE_MAX: c_int = 111;
1957 pub const _SC_T_IOV_MAX: c_int = 112;
1958 pub const _SC_UCHAR_MAX: c_int = 113;
1959 pub const _SC_UINT_MAX: c_int = 114;
1960 pub const _SC_UIO_MAXIOV: c_int = 115;
1961 pub const _SC_ULONG_MAX: c_int = 116;
1962 pub const _SC_USHRT_MAX: c_int = 117;
1963 pub const _SC_WORD_BIT: c_int = 118;
1964 pub const _SC_XOPEN_CRYPT: c_int = 119;
1965 pub const _SC_XOPEN_ENH_I18N: c_int = 120;
1966 pub const _SC_XOPEN_SHM: c_int = 121;
1967 pub const _SC_XOPEN_UNIX: c_int = 122;
1968 pub const _SC_XOPEN_XCU_VERSION: c_int = 123;
1969 pub const _SC_XOPEN_XPG2: c_int = 124;
1970 pub const _SC_XOPEN_XPG3: c_int = 125;
1971 pub const _SC_XOPEN_XPG4: c_int = 126;
1972 pub const _SC_XBS5_ILP32_OFF32: c_int = 127;
1973 pub const _SC_XBS5_ILP32_OFFBIG: c_int = 128;
1974 pub const _SC_XBS5_LP64_OFF64: c_int = 129;
1975 pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 130;
1976 pub const _SC_ADVISORY_INFO: c_int = 131;
1977 pub const _SC_CPUTIME: c_int = 132;
1978 pub const _SC_SPAWN: c_int = 133;
1979 pub const _SC_SPORADIC_SERVER: c_int = 134;
1980 pub const _SC_THREAD_CPUTIME: c_int = 135;
1981 pub const _SC_THREAD_SPORADIC_SERVER: c_int = 136;
1982 pub const _SC_TIMEOUTS: c_int = 137;
1983 pub const _SC_BARRIERS: c_int = 138;
1984 pub const _SC_CLOCK_SELECTION: c_int = 139;
1985 pub const _SC_MONOTONIC_CLOCK: c_int = 140;
1986 pub const _SC_READER_WRITER_LOCKS: c_int = 141;
1987 pub const _SC_SPIN_LOCKS: c_int = 142;
1988 pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 143;
1989 pub const _SC_TRACE_EVENT_FILTER: c_int = 144;
1990 pub const _SC_TRACE: c_int = 145;
1991 pub const _SC_TRACE_INHERIT: c_int = 146;
1992 pub const _SC_TRACE_LOG: c_int = 147;
1993 pub const _SC_2_PBS: c_int = 148;
1994 pub const _SC_2_PBS_ACCOUNTING: c_int = 149;
1995 pub const _SC_2_PBS_CHECKPOINT: c_int = 150;
1996 pub const _SC_2_PBS_LOCATE: c_int = 151;
1997 pub const _SC_2_PBS_MESSAGE: c_int = 152;
1998 pub const _SC_2_PBS_TRACK: c_int = 153;
1999 pub const _SC_HOST_NAME_MAX: c_int = 154;
2000 pub const _SC_IOV_MAX: c_int = 155;
2001 pub const _SC_IPV6: c_int = 156;
2002 pub const _SC_RAW_SOCKETS: c_int = 157;
2003 pub const _SC_REGEXP: c_int = 158;
2004 pub const _SC_SHELL: c_int = 159;
2005 pub const _SC_SS_REPL_MAX: c_int = 160;
2006 pub const _SC_SYMLOOP_MAX: c_int = 161;
2007 pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 162;
2008 pub const _SC_TRACE_NAME_MAX: c_int = 163;
2009 pub const _SC_TRACE_SYS_MAX: c_int = 164;
2010 pub const _SC_TRACE_USER_EVENT_MAX: c_int = 165;
2011 pub const _SC_V6_ILP32_OFF32: c_int = 166;
2012 pub const _SC_V6_ILP32_OFFBIG: c_int = 167;
2013 pub const _SC_V6_LP64_OFF64: c_int = 168;
2014 pub const _SC_V6_LPBIG_OFFBIG: c_int = 169;
2015 pub const _SC_XOPEN_REALTIME: c_int = 170;
2016 pub const _SC_XOPEN_REALTIME_THREADS: c_int = 171;
2017 pub const _SC_XOPEN_LEGACY: c_int = 172;
2018 pub const _SC_XOPEN_STREAMS: c_int = 173;
2019 pub const _SC_V7_ILP32_OFF32: c_int = 176;
2020 pub const _SC_V7_ILP32_OFFBIG: c_int = 177;
2021 pub const _SC_V7_LP64_OFF64: c_int = 178;
2022 pub const _SC_V7_LPBIG_OFFBIG: c_int = 179;
2023
2024 pub const GLOB_ERR: c_int = 0x0001;
2025 pub const GLOB_MARK: c_int = 0x0002;
2026 pub const GLOB_NOSORT: c_int = 0x0004;
2027 pub const GLOB_DOOFFS: c_int = 0x0008;
2028 pub const GLOB_NOCHECK: c_int = 0x0010;
2029 pub const GLOB_APPEND: c_int = 0x0020;
2030 pub const GLOB_NOESCAPE: c_int = 0x0040;
2031
2032 pub const GLOB_NOSPACE: c_int = 1;
2033 pub const GLOB_ABORTED: c_int = 2;
2034 pub const GLOB_NOMATCH: c_int = 3;
2035
2036 pub const S_IEXEC: mode_t = crate::S_IXUSR;
2037 pub const S_IWRITE: mode_t = crate::S_IWUSR;
2038 pub const S_IREAD: mode_t = crate::S_IRUSR;
2039
2040 pub const S_IFIFO: crate::mode_t = 0o1_0000;
2041 pub const S_IFCHR: crate::mode_t = 0o2_0000;
2042 pub const S_IFDIR: crate::mode_t = 0o4_0000;
2043 pub const S_IFBLK: crate::mode_t = 0o6_0000;
2044 pub const S_IFREG: crate::mode_t = 0o10_0000;
2045 pub const S_IFLNK: crate::mode_t = 0o12_0000;
2046 pub const S_IFSOCK: crate::mode_t = 0o14_0000;
2047 pub const S_IFMT: crate::mode_t = 0o17_0000;
2048
2049 pub const S_IXOTH: crate::mode_t = 0o0001;
2050 pub const S_IWOTH: crate::mode_t = 0o0002;
2051 pub const S_IROTH: crate::mode_t = 0o0004;
2052 pub const S_IRWXO: crate::mode_t = 0o0007;
2053 pub const S_IXGRP: crate::mode_t = 0o0010;
2054 pub const S_IWGRP: crate::mode_t = 0o0020;
2055 pub const S_IRGRP: crate::mode_t = 0o0040;
2056 pub const S_IRWXG: crate::mode_t = 0o0070;
2057 pub const S_IXUSR: crate::mode_t = 0o0100;
2058 pub const S_IWUSR: crate::mode_t = 0o0200;
2059 pub const S_IRUSR: crate::mode_t = 0o0400;
2060 pub const S_IRWXU: crate::mode_t = 0o0700;
2061
2062 pub const F_LOCK: c_int = 1;
2063 pub const F_TEST: c_int = 3;
2064 pub const F_TLOCK: c_int = 2;
2065 pub const F_ULOCK: c_int = 0;
2066
2067 pub const ST_RDONLY: c_ulong = 0x01;
2068 pub const ST_NOSUID: c_ulong = 0x04;
2069 pub const ST_NOEXEC: c_ulong = 0x02;
2070 pub const ST_NOATIME: c_ulong = 0x20;
2071
2072 pub const RTLD_NEXT: *mut c_void = -3i64 as *mut c_void;
2073 pub const RTLD_DEFAULT: *mut c_void = -2i64 as *mut c_void;
2074 pub const RTLD_NODELETE: c_int = 0x1000;
2075 pub const RTLD_NOW: c_int = 0x0002;
2076
2077 pub const EMPTY: c_short = 0;
2078 pub const RUN_LVL: c_short = 1;
2079 pub const BOOT_TIME: c_short = 2;
2080 pub const NEW_TIME: c_short = 4;
2081 pub const OLD_TIME: c_short = 3;
2082 pub const INIT_PROCESS: c_short = 5;
2083 pub const LOGIN_PROCESS: c_short = 6;
2084 pub const USER_PROCESS: c_short = 7;
2085 pub const DEAD_PROCESS: c_short = 8;
2086 pub const ACCOUNTING: c_short = 9;
2087
2088 pub const ENOTSUP: c_int = 48;
2089
2090 pub const BUFSIZ: c_uint = 1024;
2091 pub const TMP_MAX: c_uint = 26 * 26 * 26;
2092 pub const FOPEN_MAX: c_uint = 16;
2093 pub const FILENAME_MAX: c_uint = 255;
2094
2095 pub const NI_MAXHOST: crate::socklen_t = 1025;
2096 pub const M_KEEP: c_int = 4;
2097 pub const REG_STARTEND: c_int = 0o00004;
2098 pub const VEOF: usize = 4;
2099
2100 pub const RTLD_GLOBAL: c_int = 0x0100;
2101 pub const RTLD_NOLOAD: c_int = 0x0004;
2102
2103 pub const O_RDONLY: c_int = 0o000000;
2104 pub const O_WRONLY: c_int = 0o000001;
2105 pub const O_RDWR: c_int = 0o000002;
2106
2107 pub const O_EXEC: c_int = 0o00003;
2108 pub const O_ASYNC: c_int = 0o0200000;
2109 pub const O_NDELAY: c_int = O_NONBLOCK;
2110 pub const O_TRUNC: c_int = 0o001000;
2111 pub const O_CLOEXEC: c_int = 0o020000;
2112 pub const O_DIRECTORY: c_int = 0o4000000;
2113 pub const O_ACCMODE: c_int = 0o000007;
2114 pub const O_APPEND: c_int = 0o000010;
2115 pub const O_CREAT: c_int = 0o000400;
2116 pub const O_EXCL: c_int = 0o002000;
2117 pub const O_NOCTTY: c_int = 0o004000;
2118 pub const O_NONBLOCK: c_int = 0o000200;
2119 pub const O_SYNC: c_int = 0o000040;
2120 pub const O_RSYNC: c_int = 0o000100;
2121 pub const O_DSYNC: c_int = 0o000020;
2122 pub const O_NOFOLLOW: c_int = 0o010000;
2123
2124 pub const POSIX_FADV_DONTNEED: c_int = 4;
2125 pub const POSIX_FADV_NOREUSE: c_int = 5;
2126
2127 pub const SOCK_SEQPACKET: c_int = 5;
2128 pub const SOCK_STREAM: c_int = 1;
2129 pub const SOCK_DGRAM: c_int = 2;
2130 pub const SOCK_RAW: c_int = 3;
2131 pub const SOCK_RDM: c_int = 4;
2132 pub const SOCK_CLOEXEC: c_int = 0x10000000;
2133
2134 pub const SA_SIGINFO: c_int = 0x0002;
2135 pub const SA_NOCLDWAIT: c_int = 0x0020;
2136 pub const SA_NODEFER: c_int = 0x0010;
2137 pub const SA_RESETHAND: c_int = 0x0004;
2138 pub const SA_NOCLDSTOP: c_int = 0x0001;
2139
2140 pub const SIGTTIN: c_int = 26;
2141 pub const SIGTTOU: c_int = 27;
2142 pub const SIGXCPU: c_int = 30;
2143 pub const SIGXFSZ: c_int = 31;
2144 pub const SIGVTALRM: c_int = 28;
2145 pub const SIGPROF: c_int = 29;
2146 pub const SIGWINCH: c_int = 20;
2147 pub const SIGCHLD: c_int = 18;
2148 pub const SIGBUS: c_int = 10;
2149 pub const SIGUSR1: c_int = 16;
2150 pub const SIGUSR2: c_int = 17;
2151 pub const SIGCONT: c_int = 25;
2152 pub const SIGSTOP: c_int = 23;
2153 pub const SIGTSTP: c_int = 24;
2154 pub const SIGURG: c_int = 21;
2155 pub const SIGIO: c_int = SIGPOLL;
2156 pub const SIGSYS: c_int = 12;
2157 pub const SIGPOLL: c_int = 22;
2158 pub const SIGPWR: c_int = 19;
2159 pub const SIG_SETMASK: c_int = 2;
2160 pub const SIG_BLOCK: c_int = 0;
2161 pub const SIG_UNBLOCK: c_int = 1;
2162
2163 pub const POLLWRNORM: c_short = crate::POLLOUT;
2164 pub const POLLWRBAND: c_short = 0x0010;
2165
2166 pub const F_SETLK: c_int = 106;
2167 pub const F_SETLKW: c_int = 107;
2168 pub const F_ALLOCSP: c_int = 110;
2169 pub const F_FREESP: c_int = 111;
2170 pub const F_GETLK: c_int = 114;
2171
2172 pub const F_RDLCK: c_int = 1;
2173 pub const F_WRLCK: c_int = 2;
2174 pub const F_UNLCK: c_int = 3;
2175
2176 pub const NCCS: usize = 40;
2177
2178 pub const MAP_ANON: c_int = MAP_ANONYMOUS;
2179 pub const MAP_ANONYMOUS: c_int = 0x00080000;
2180
2181 pub const MCL_CURRENT: c_int = 0x000000001;
2182 pub const MCL_FUTURE: c_int = 0x000000002;
2183
2184 pub const _TIO_CBAUD: crate::tcflag_t = 15;
2185 pub const CBAUD: crate::tcflag_t = _TIO_CBAUD;
2186 pub const TAB1: crate::tcflag_t = 0x0800;
2187 pub const TAB2: crate::tcflag_t = 0x1000;
2188 pub const TAB3: crate::tcflag_t = 0x1800;
2189 pub const CR1: crate::tcflag_t = 0x200;
2190 pub const CR2: crate::tcflag_t = 0x400;
2191 pub const CR3: crate::tcflag_t = 0x600;
2192 pub const FF1: crate::tcflag_t = 0x8000;
2193 pub const BS1: crate::tcflag_t = 0x2000;
2194 pub const VT1: crate::tcflag_t = 0x4000;
2195 pub const VWERASE: usize = 14;
2196 pub const VREPRINT: usize = 12;
2197 pub const VSUSP: usize = 10;
2198 pub const VSTART: usize = 8;
2199 pub const VSTOP: usize = 9;
2200 pub const VDISCARD: usize = 13;
2201 pub const VTIME: usize = 17;
2202 pub const IXON: crate::tcflag_t = 0x00000400;
2203 pub const IXOFF: crate::tcflag_t = 0x00001000;
2204 pub const ONLCR: crate::tcflag_t = 0x00000004;
2205 pub const CSIZE: crate::tcflag_t = 0x00000030;
2206 pub const CS6: crate::tcflag_t = 0x10;
2207 pub const CS7: crate::tcflag_t = 0x20;
2208 pub const CS8: crate::tcflag_t = 0x30;
2209 pub const CSTOPB: crate::tcflag_t = 0x00000040;
2210 pub const CREAD: crate::tcflag_t = 0x00000080;
2211 pub const PARENB: crate::tcflag_t = 0x00000100;
2212 pub const PARODD: crate::tcflag_t = 0x00000200;
2213 pub const HUPCL: crate::tcflag_t = 0x00000400;
2214 pub const CLOCAL: crate::tcflag_t = 0x00000800;
2215 pub const ECHOKE: crate::tcflag_t = 0x00000800;
2216 pub const ECHOE: crate::tcflag_t = 0x00000010;
2217 pub const ECHOK: crate::tcflag_t = 0x00000020;
2218 pub const ECHONL: crate::tcflag_t = 0x00000040;
2219 pub const ECHOCTL: crate::tcflag_t = 0x00000200;
2220 pub const ISIG: crate::tcflag_t = 0x00000001;
2221 pub const ICANON: crate::tcflag_t = 0x00000002;
2222 pub const NOFLSH: crate::tcflag_t = 0x00000080;
2223 pub const OLCUC: crate::tcflag_t = 0x00000002;
2224 pub const NLDLY: crate::tcflag_t = 0x00000100;
2225 pub const CRDLY: crate::tcflag_t = 0x00000600;
2226 pub const TABDLY: crate::tcflag_t = 0x00001800;
2227 pub const BSDLY: crate::tcflag_t = 0x00002000;
2228 pub const FFDLY: crate::tcflag_t = 0x00008000;
2229 pub const VTDLY: crate::tcflag_t = 0x00004000;
2230 pub const XTABS: crate::tcflag_t = 0x1800;
2231
2232 pub const B0: crate::speed_t = 0;
2233 pub const B50: crate::speed_t = 1;
2234 pub const B75: crate::speed_t = 2;
2235 pub const B110: crate::speed_t = 3;
2236 pub const B134: crate::speed_t = 4;
2237 pub const B150: crate::speed_t = 5;
2238 pub const B200: crate::speed_t = 6;
2239 pub const B300: crate::speed_t = 7;
2240 pub const B600: crate::speed_t = 8;
2241 pub const B1200: crate::speed_t = 9;
2242 pub const B1800: crate::speed_t = 10;
2243 pub const B2400: crate::speed_t = 11;
2244 pub const B4800: crate::speed_t = 12;
2245 pub const B9600: crate::speed_t = 13;
2246 pub const B19200: crate::speed_t = 14;
2247 pub const B38400: crate::speed_t = 15;
2248 pub const EXTA: crate::speed_t = 14;
2249 pub const EXTB: crate::speed_t = 15;
2250 pub const B57600: crate::speed_t = 57600;
2251 pub const B115200: crate::speed_t = 115200;
2252
2253 pub const VEOL: usize = 5;
2254 pub const VEOL2: usize = 6;
2255 pub const VMIN: usize = 16;
2256 pub const IEXTEN: crate::tcflag_t = 0x00008000;
2257 pub const TOSTOP: crate::tcflag_t = 0x00000100;
2258
2259 pub const TCSANOW: c_int = 0x0001;
2260 pub const TCSADRAIN: c_int = 0x0002;
2261 pub const TCSAFLUSH: c_int = 0x0004;
2262
2263 pub const HW_MACHINE: c_int = 1;
2264 pub const HW_MODEL: c_int = 2;
2265 pub const HW_NCPU: c_int = 3;
2266 pub const HW_BYTEORDER: c_int = 4;
2267 pub const HW_PHYSMEM: c_int = 5;
2268 pub const HW_USERMEM: c_int = 6;
2269 pub const HW_PAGESIZE: c_int = 7;
2270 pub const HW_DISKNAMES: c_int = 8;
2271 pub const HW_IOSTATS: c_int = 9;
2272 pub const HW_MACHINE_ARCH: c_int = 10;
2273 pub const HW_ALIGNBYTES: c_int = 11;
2274 pub const HW_CNMAGIC: c_int = 12;
2275 pub const HW_PHYSMEM64: c_int = 13;
2276 pub const HW_USERMEM64: c_int = 14;
2277 pub const HW_IOSTATNAMES: c_int = 15;
2278 pub const HW_MAXID: c_int = 15;
2279
2280 pub const CTL_UNSPEC: c_int = 0;
2281 pub const CTL_KERN: c_int = 1;
2282 pub const CTL_VM: c_int = 2;
2283 pub const CTL_VFS: c_int = 3;
2284 pub const CTL_NET: c_int = 4;
2285 pub const CTL_DEBUG: c_int = 5;
2286 pub const CTL_HW: c_int = 6;
2287 pub const CTL_MACHDEP: c_int = 7;
2288 pub const CTL_USER: c_int = 8;
2289 pub const CTL_QNX: c_int = 9;
2290 pub const CTL_PROC: c_int = 10;
2291 pub const CTL_VENDOR: c_int = 11;
2292 pub const CTL_EMUL: c_int = 12;
2293 pub const CTL_SECURITY: c_int = 13;
2294 pub const CTL_MAXID: c_int = 14;
2295
2296 pub const DAY_1: crate::nl_item = 8;
2297 pub const DAY_2: crate::nl_item = 9;
2298 pub const DAY_3: crate::nl_item = 10;
2299 pub const DAY_4: crate::nl_item = 11;
2300 pub const DAY_5: crate::nl_item = 12;
2301 pub const DAY_6: crate::nl_item = 13;
2302 pub const DAY_7: crate::nl_item = 14;
2303
2304 pub const MON_1: crate::nl_item = 22;
2305 pub const MON_2: crate::nl_item = 23;
2306 pub const MON_3: crate::nl_item = 24;
2307 pub const MON_4: crate::nl_item = 25;
2308 pub const MON_5: crate::nl_item = 26;
2309 pub const MON_6: crate::nl_item = 27;
2310 pub const MON_7: crate::nl_item = 28;
2311 pub const MON_8: crate::nl_item = 29;
2312 pub const MON_9: crate::nl_item = 30;
2313 pub const MON_10: crate::nl_item = 31;
2314 pub const MON_11: crate::nl_item = 32;
2315 pub const MON_12: crate::nl_item = 33;
2316
2317 pub const ABDAY_1: crate::nl_item = 15;
2318 pub const ABDAY_2: crate::nl_item = 16;
2319 pub const ABDAY_3: crate::nl_item = 17;
2320 pub const ABDAY_4: crate::nl_item = 18;
2321 pub const ABDAY_5: crate::nl_item = 19;
2322 pub const ABDAY_6: crate::nl_item = 20;
2323 pub const ABDAY_7: crate::nl_item = 21;
2324
2325 pub const ABMON_1: crate::nl_item = 34;
2326 pub const ABMON_2: crate::nl_item = 35;
2327 pub const ABMON_3: crate::nl_item = 36;
2328 pub const ABMON_4: crate::nl_item = 37;
2329 pub const ABMON_5: crate::nl_item = 38;
2330 pub const ABMON_6: crate::nl_item = 39;
2331 pub const ABMON_7: crate::nl_item = 40;
2332 pub const ABMON_8: crate::nl_item = 41;
2333 pub const ABMON_9: crate::nl_item = 42;
2334 pub const ABMON_10: crate::nl_item = 43;
2335 pub const ABMON_11: crate::nl_item = 44;
2336 pub const ABMON_12: crate::nl_item = 45;
2337
2338 pub const AF_ARP: c_int = 28;
2339 pub const AF_CCITT: c_int = 10;
2340 pub const AF_CHAOS: c_int = 5;
2341 pub const AF_CNT: c_int = 21;
2342 pub const AF_COIP: c_int = 20;
2343 pub const AF_DATAKIT: c_int = 9;
2344 pub const AF_DECnet: c_int = 12;
2345 pub const AF_DLI: c_int = 13;
2346 pub const AF_E164: c_int = 26;
2347 pub const AF_ECMA: c_int = 8;
2348 pub const AF_HYLINK: c_int = 15;
2349 pub const AF_IEEE80211: c_int = 32;
2350 pub const AF_IMPLINK: c_int = 3;
2351 pub const AF_ISO: c_int = 7;
2352 pub const AF_LAT: c_int = 14;
2353 pub const AF_LINK: c_int = 18;
2354 pub const AF_NATM: c_int = 27;
2355 pub const AF_NS: c_int = 6;
2356 pub const AF_OSI: c_int = 7;
2357 pub const AF_PUP: c_int = 4;
2358 pub const ALT_DIGITS: crate::nl_item = 50;
2359 pub const AM_STR: crate::nl_item = 6;
2360 pub const B76800: crate::speed_t = 76800;
2361
2362 pub const BIOCFLUSH: c_int = 17000;
2363 pub const BIOCGBLEN: c_int = 1074020966;
2364 pub const BIOCGDLT: c_int = 1074020970;
2365 pub const BIOCGDLTLIST: c_int = -1072676233;
2366 pub const BIOCGETIF: c_int = 1083196011;
2367 pub const BIOCGHDRCMPLT: c_int = 1074020980;
2368 pub const BIOCGRTIMEOUT: c_int = 1074807406;
2369 pub const BIOCGSEESENT: c_int = 1074020984;
2370 pub const BIOCGSTATS: c_int = 1082147439;
2371 pub const BIOCIMMEDIATE: c_int = -2147204496;
2372 pub const BIOCPROMISC: c_int = 17001;
2373 pub const BIOCSBLEN: c_int = -1073462682;
2374 pub const BIOCSDLT: c_int = -2147204490;
2375 pub const BIOCSETF: c_int = -2146418073;
2376 pub const BIOCSETIF: c_int = -2138029460;
2377 pub const BIOCSHDRCMPLT: c_int = -2147204491;
2378 pub const BIOCSRTIMEOUT: c_int = -2146418067;
2379 pub const BIOCSSEESENT: c_int = -2147204487;
2380 pub const BIOCVERSION: c_int = 1074020977;
2381
2382 pub const BPF_ALIGNMENT: usize = mem::size_of::<c_long>();
2383 pub const CHAR_BIT: usize = 8;
2384 pub const CODESET: crate::nl_item = 1;
2385 pub const CRNCYSTR: crate::nl_item = 55;
2386
2387 pub const D_FLAG_FILTER: c_int = 0x00000001;
2388 pub const D_FLAG_STAT: c_int = 0x00000002;
2389 pub const D_FLAG_STAT_FORM_MASK: c_int = 0x000000f0;
2390 pub const D_FLAG_STAT_FORM_T32_2001: c_int = 0x00000010;
2391 pub const D_FLAG_STAT_FORM_T32_2008: c_int = 0x00000020;
2392 pub const D_FLAG_STAT_FORM_T64_2008: c_int = 0x00000030;
2393 pub const D_FLAG_STAT_FORM_UNSET: c_int = 0x00000000;
2394
2395 pub const D_FMT: crate::nl_item = 3;
2396 pub const D_GETFLAG: c_int = 1;
2397 pub const D_SETFLAG: c_int = 2;
2398 pub const D_T_FMT: crate::nl_item = 2;
2399 pub const ERA: crate::nl_item = 46;
2400 pub const ERA_D_FMT: crate::nl_item = 47;
2401 pub const ERA_D_T_FMT: crate::nl_item = 48;
2402 pub const ERA_T_FMT: crate::nl_item = 49;
2403 pub const RADIXCHAR: crate::nl_item = 51;
2404 pub const THOUSEP: crate::nl_item = 52;
2405 pub const YESEXPR: crate::nl_item = 53;
2406 pub const NOEXPR: crate::nl_item = 54;
2407 pub const F_GETOWN: c_int = 35;
2408
2409 pub const FIONBIO: c_int = -2147195266;
2410 pub const FIOASYNC: c_int = -2147195267;
2411 pub const FIOCLEX: c_int = 26113;
2412 pub const FIOGETOWN: c_int = 1074030203;
2413 pub const FIONCLEX: c_int = 26114;
2414 pub const FIONREAD: c_int = 1074030207;
2415 pub const FIONSPACE: c_int = 1074030200;
2416 pub const FIONWRITE: c_int = 1074030201;
2417 pub const FIOSETOWN: c_int = -2147195268;
2418
2419 pub const F_SETOWN: c_int = 36;
2420 pub const IFF_ACCEPTRTADV: c_int = 0x40000000;
2421 pub const IFF_IP6FORWARDING: c_int = 0x20000000;
2422 pub const IFF_LINK0: c_int = 0x00001000;
2423 pub const IFF_LINK1: c_int = 0x00002000;
2424 pub const IFF_LINK2: c_int = 0x00004000;
2425 pub const IFF_OACTIVE: c_int = 0x00000400;
2426 pub const IFF_SHIM: c_int = 0x80000000;
2427 pub const IFF_SIMPLEX: c_int = 0x00000800;
2428 pub const IHFLOW: tcflag_t = 0x00000001;
2429 pub const IIDLE: tcflag_t = 0x00000008;
2430 pub const IP_RECVDSTADDR: c_int = 7;
2431 pub const IP_RECVIF: c_int = 20;
2432 pub const IPTOS_ECN_NOTECT: u8 = 0x00;
2433 pub const IUCLC: tcflag_t = 0x00000200;
2434 pub const IUTF8: tcflag_t = 0x0004000;
2435
2436 pub const KERN_ARGMAX: c_int = 8;
2437 pub const KERN_ARND: c_int = 81;
2438 pub const KERN_BOOTTIME: c_int = 21;
2439 pub const KERN_CLOCKRATE: c_int = 12;
2440 pub const KERN_FILE: c_int = 15;
2441 pub const KERN_HOSTID: c_int = 11;
2442 pub const KERN_HOSTNAME: c_int = 10;
2443 pub const KERN_IOV_MAX: c_int = 38;
2444 pub const KERN_JOB_CONTROL: c_int = 19;
2445 pub const KERN_LOGSIGEXIT: c_int = 46;
2446 pub const KERN_MAXFILES: c_int = 7;
2447 pub const KERN_MAXID: c_int = 83;
2448 pub const KERN_MAXPROC: c_int = 6;
2449 pub const KERN_MAXVNODES: c_int = 5;
2450 pub const KERN_NGROUPS: c_int = 18;
2451 pub const KERN_OSRELEASE: c_int = 2;
2452 pub const KERN_OSREV: c_int = 3;
2453 pub const KERN_OSTYPE: c_int = 1;
2454 pub const KERN_POSIX1: c_int = 17;
2455 pub const KERN_PROC: c_int = 14;
2456 pub const KERN_PROC_ALL: c_int = 0;
2457 pub const KERN_PROC_ARGS: c_int = 48;
2458 pub const KERN_PROC_ENV: c_int = 3;
2459 pub const KERN_PROC_GID: c_int = 7;
2460 pub const KERN_PROC_PGRP: c_int = 2;
2461 pub const KERN_PROC_PID: c_int = 1;
2462 pub const KERN_PROC_RGID: c_int = 8;
2463 pub const KERN_PROC_RUID: c_int = 6;
2464 pub const KERN_PROC_SESSION: c_int = 3;
2465 pub const KERN_PROC_TTY: c_int = 4;
2466 pub const KERN_PROC_UID: c_int = 5;
2467 pub const KERN_PROF: c_int = 16;
2468 pub const KERN_SAVED_IDS: c_int = 20;
2469 pub const KERN_SECURELVL: c_int = 9;
2470 pub const KERN_VERSION: c_int = 4;
2471 pub const KERN_VNODE: c_int = 13;
2472
2473 pub const LC_ALL: c_int = 63;
2474 pub const LC_COLLATE: c_int = 1;
2475 pub const LC_CTYPE: c_int = 2;
2476 pub const LC_MESSAGES: c_int = 32;
2477 pub const LC_MONETARY: c_int = 4;
2478 pub const LC_NUMERIC: c_int = 8;
2479 pub const LC_TIME: c_int = 16;
2480
2481 pub const LOCAL_CONNWAIT: c_int = 0x0002;
2482 pub const LOCAL_CREDS: c_int = 0x0001;
2483 pub const LOCAL_PEEREID: c_int = 0x0003;
2484
2485 pub const MAP_STACK: c_int = 0x00001000;
2486 pub const MNT_NOEXEC: c_int = 0x02;
2487 pub const MNT_NOSUID: c_int = 0x04;
2488 pub const MNT_RDONLY: c_int = 0x01;
2489
2490 pub const MSG_NOTIFICATION: c_int = 0x0400;
2491
2492 pub const NET_RT_DUMP: c_int = 1;
2493 pub const NET_RT_FLAGS: c_int = 2;
2494 pub const NET_RT_IFLIST: c_int = 4;
2495 pub const NI_NUMERICSCOPE: c_int = 0x00000040;
2496 pub const OHFLOW: tcflag_t = 0x00000002;
2497 pub const P_ALL: idtype_t = 0;
2498 pub const PARSTK: tcflag_t = 0x00000004;
2499 pub const PF_ARP: c_int = 28;
2500 pub const PF_CCITT: c_int = 10;
2501 pub const PF_CHAOS: c_int = 5;
2502 pub const PF_CNT: c_int = 21;
2503 pub const PF_COIP: c_int = 20;
2504 pub const PF_DATAKIT: c_int = 9;
2505 pub const PF_DECnet: c_int = 12;
2506 pub const PF_DLI: c_int = 13;
2507 pub const PF_ECMA: c_int = 8;
2508 pub const PF_HYLINK: c_int = 15;
2509 pub const PF_IMPLINK: c_int = 3;
2510 pub const PF_ISO: c_int = 7;
2511 pub const PF_LAT: c_int = 14;
2512 pub const PF_LINK: c_int = 18;
2513 pub const PF_NATM: c_int = 27;
2514 pub const PF_OSI: c_int = 7;
2515 pub const PF_PIP: c_int = 25;
2516 pub const PF_PUP: c_int = 4;
2517 pub const PF_RTIP: c_int = 22;
2518 pub const PF_XTP: c_int = 19;
2519 pub const PM_STR: crate::nl_item = 7;
2520 pub const POSIX_MADV_DONTNEED: c_int = 4;
2521 pub const POSIX_MADV_NORMAL: c_int = 0;
2522 pub const POSIX_MADV_RANDOM: c_int = 2;
2523 pub const POSIX_MADV_SEQUENTIAL: c_int = 1;
2524 pub const POSIX_MADV_WILLNEED: c_int = 3;
2525 pub const _POSIX_VDISABLE: c_int = 0;
2526 pub const P_PGID: idtype_t = 2;
2527 pub const P_PID: idtype_t = 1;
2528 pub const PRIO_PGRP: c_int = 1;
2529 pub const PRIO_PROCESS: c_int = 0;
2530 pub const PRIO_USER: c_int = 2;
2531 pub const pseudo_AF_HDRCMPLT: c_int = 30;
2532 pub const pseudo_AF_PIP: c_int = 25;
2533 pub const pseudo_AF_RTIP: c_int = 22;
2534 pub const pseudo_AF_XTP: c_int = 19;
2535 pub const REG_ASSERT: c_int = 15;
2536 pub const REG_ATOI: c_int = 255;
2537 pub const REG_BACKR: c_int = 0x400;
2538 pub const REG_BASIC: c_int = 0x00;
2539 pub const REG_DUMP: c_int = 0x80;
2540 pub const REG_EMPTY: c_int = 14;
2541 pub const REG_INVARG: c_int = 16;
2542 pub const REG_ITOA: c_int = 0o400;
2543 pub const REG_LARGE: c_int = 0x200;
2544 pub const REG_NOSPEC: c_int = 0x10;
2545 pub const REG_OK: c_int = 0;
2546 pub const REG_PEND: c_int = 0x20;
2547 pub const REG_TRACE: c_int = 0x100;
2548
2549 pub const RLIMIT_AS: c_int = 6;
2550 pub const RLIMIT_CORE: c_int = 4;
2551 pub const RLIMIT_CPU: c_int = 0;
2552 pub const RLIMIT_DATA: c_int = 2;
2553 pub const RLIMIT_FSIZE: c_int = 1;
2554 pub const RLIMIT_MEMLOCK: c_int = 7;
2555 pub const RLIMIT_NOFILE: c_int = 5;
2556 pub const RLIMIT_NPROC: c_int = 8;
2557 pub const RLIMIT_RSS: c_int = 6;
2558 pub const RLIMIT_STACK: c_int = 3;
2559 pub const RLIMIT_VMEM: c_int = 6;
2560 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
2561 pub const RLIM_NLIMITS: c_int = 14;
2562
2563 pub const SCHED_ADJTOHEAD: c_int = 5;
2564 pub const SCHED_ADJTOTAIL: c_int = 6;
2565 pub const SCHED_MAXPOLICY: c_int = 7;
2566 pub const SCHED_SETPRIO: c_int = 7;
2567 pub const SCHED_SPORADIC: c_int = 4;
2568
2569 pub const SHM_ANON: *mut c_char = -1isize as *mut c_char;
2570 pub const SIGCLD: c_int = SIGCHLD;
2571 pub const SIGDEADLK: c_int = 7;
2572 pub const SIGEMT: c_int = 7;
2573 pub const SIGEV_NONE: c_int = 0;
2574 pub const SIGEV_SIGNAL: c_int = 129;
2575 pub const SIGEV_THREAD: c_int = 135;
2576 pub const SIOCGIFADDR: c_int = -1064277727;
2577 pub const SO_FIB: c_int = 0x100a;
2578 pub const SO_OVERFLOWED: c_int = 0x1009;
2579 pub const SO_SETFIB: c_int = 0x100a;
2580 pub const SO_TXPRIO: c_int = 0x100b;
2581 pub const SO_USELOOPBACK: c_int = 0x0040;
2582 pub const SO_VLANPRIO: c_int = 0x100c;
2583 pub const _SS_ALIGNSIZE: usize = mem::size_of::<i64>();
2584 pub const _SS_MAXSIZE: usize = 128;
2585 pub const _SS_PAD1SIZE: usize = _SS_ALIGNSIZE - 2;
2586 pub const _SS_PAD2SIZE: usize = _SS_MAXSIZE - 2 - _SS_PAD1SIZE - _SS_ALIGNSIZE;
2587 pub const TC_CPOSIX: tcflag_t = CLOCAL | CREAD | CSIZE | CSTOPB | HUPCL | PARENB | PARODD;
2588 pub const TCGETS: c_int = 0x404c540d;
2589 pub const TC_IPOSIX: tcflag_t =
2590 BRKINT | ICRNL | IGNBRK | IGNPAR | INLCR | INPCK | ISTRIP | IXOFF | IXON | PARMRK;
2591 pub const TC_LPOSIX: tcflag_t =
2592 ECHO | ECHOE | ECHOK | ECHONL | ICANON | IEXTEN | ISIG | NOFLSH | TOSTOP;
2593 pub const TC_OPOSIX: tcflag_t = OPOST;
2594 pub const T_FMT_AMPM: crate::nl_item = 5;
2595
2596 pub const TIOCCBRK: c_int = 29818;
2597 pub const TIOCCDTR: c_int = 29816;
2598 pub const TIOCDRAIN: c_int = 29790;
2599 pub const TIOCEXCL: c_int = 29709;
2600 pub const TIOCFLUSH: c_int = -2147191792;
2601 pub const TIOCGETA: c_int = 1078752275;
2602 pub const TIOCGPGRP: c_int = 1074033783;
2603 pub const TIOCGWINSZ: c_int = 1074295912;
2604 pub const TIOCMBIC: c_int = -2147191701;
2605 pub const TIOCMBIS: c_int = -2147191700;
2606 pub const TIOCMGET: c_int = 1074033770;
2607 pub const TIOCMSET: c_int = -2147191699;
2608 pub const TIOCNOTTY: c_int = 29809;
2609 pub const TIOCNXCL: c_int = 29710;
2610 pub const TIOCOUTQ: c_int = 1074033779;
2611 pub const TIOCPKT: c_int = -2147191696;
2612 pub const TIOCPKT_DATA: c_int = 0x00;
2613 pub const TIOCPKT_DOSTOP: c_int = 0x20;
2614 pub const TIOCPKT_FLUSHREAD: c_int = 0x01;
2615 pub const TIOCPKT_FLUSHWRITE: c_int = 0x02;
2616 pub const TIOCPKT_IOCTL: c_int = 0x40;
2617 pub const TIOCPKT_NOSTOP: c_int = 0x10;
2618 pub const TIOCPKT_START: c_int = 0x08;
2619 pub const TIOCPKT_STOP: c_int = 0x04;
2620 pub const TIOCSBRK: c_int = 29819;
2621 pub const TIOCSCTTY: c_int = 29793;
2622 pub const TIOCSDTR: c_int = 29817;
2623 pub const TIOCSETA: c_int = -2142473196;
2624 pub const TIOCSETAF: c_int = -2142473194;
2625 pub const TIOCSETAW: c_int = -2142473195;
2626 pub const TIOCSPGRP: c_int = -2147191690;
2627 pub const TIOCSTART: c_int = 29806;
2628 pub const TIOCSTI: c_int = -2147388302;
2629 pub const TIOCSTOP: c_int = 29807;
2630 pub const TIOCSWINSZ: c_int = -2146929561;
2631
2632 pub const USER_CS_PATH: c_int = 1;
2633 pub const USER_BC_BASE_MAX: c_int = 2;
2634 pub const USER_BC_DIM_MAX: c_int = 3;
2635 pub const USER_BC_SCALE_MAX: c_int = 4;
2636 pub const USER_BC_STRING_MAX: c_int = 5;
2637 pub const USER_COLL_WEIGHTS_MAX: c_int = 6;
2638 pub const USER_EXPR_NEST_MAX: c_int = 7;
2639 pub const USER_LINE_MAX: c_int = 8;
2640 pub const USER_RE_DUP_MAX: c_int = 9;
2641 pub const USER_POSIX2_VERSION: c_int = 10;
2642 pub const USER_POSIX2_C_BIND: c_int = 11;
2643 pub const USER_POSIX2_C_DEV: c_int = 12;
2644 pub const USER_POSIX2_CHAR_TERM: c_int = 13;
2645 pub const USER_POSIX2_FORT_DEV: c_int = 14;
2646 pub const USER_POSIX2_FORT_RUN: c_int = 15;
2647 pub const USER_POSIX2_LOCALEDEF: c_int = 16;
2648 pub const USER_POSIX2_SW_DEV: c_int = 17;
2649 pub const USER_POSIX2_UPE: c_int = 18;
2650 pub const USER_STREAM_MAX: c_int = 19;
2651 pub const USER_TZNAME_MAX: c_int = 20;
2652 pub const USER_ATEXIT_MAX: c_int = 21;
2653 pub const USER_MAXID: c_int = 22;
2654
2655 pub const VDOWN: usize = 31;
2656 pub const VINS: usize = 32;
2657 pub const VDEL: usize = 33;
2658 pub const VRUB: usize = 34;
2659 pub const VCAN: usize = 35;
2660 pub const VHOME: usize = 36;
2661 pub const VEND: usize = 37;
2662 pub const VSPARE3: usize = 38;
2663 pub const VSPARE4: usize = 39;
2664 pub const VSWTCH: usize = 7;
2665 pub const VDSUSP: usize = 11;
2666 pub const VFWD: usize = 18;
2667 pub const VLOGIN: usize = 19;
2668 pub const VPREFIX: usize = 20;
2669 pub const VSUFFIX: usize = 24;
2670 pub const VLEFT: usize = 28;
2671 pub const VRIGHT: usize = 29;
2672 pub const VUP: usize = 30;
2673 pub const XCASE: tcflag_t = 0x00000004;
2674
2675 pub const PTHREAD_BARRIER_SERIAL_THREAD: c_int = -1;
2676 pub const PTHREAD_CREATE_JOINABLE: c_int = 0x00;
2677 pub const PTHREAD_CREATE_DETACHED: c_int = 0x01;
2678
2679 pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 1;
2680 pub const PTHREAD_MUTEX_RECURSIVE: c_int = 2;
2681 pub const PTHREAD_MUTEX_NORMAL: c_int = 3;
2682 pub const PTHREAD_STACK_MIN: size_t = 256;
2683 pub const PTHREAD_MUTEX_DEFAULT: c_int = 0;
2684 pub const PTHREAD_MUTEX_STALLED: c_int = 0x00;
2685 pub const PTHREAD_MUTEX_ROBUST: c_int = 0x10;
2686 pub const PTHREAD_PROCESS_PRIVATE: c_int = 0x00;
2687 pub const PTHREAD_PROCESS_SHARED: c_int = 0x01;
2688
2689 pub const PTHREAD_KEYS_MAX: usize = 128;
2690
2691 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
2692 __u: 0x80000000,
2693 __owner: 0xffffffff,
2694 };
2695 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
2696 __u: CLOCK_REALTIME as u32,
2697 __owner: 0xfffffffb,
2698 };
2699 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
2700 __active: 0,
2701 __blockedwriters: 0,
2702 __blockedreaders: 0,
2703 __heavy: 0,
2704 __lock: PTHREAD_MUTEX_INITIALIZER,
2705 __rcond: PTHREAD_COND_INITIALIZER,
2706 __wcond: PTHREAD_COND_INITIALIZER,
2707 __owner: -2i32 as c_uint,
2708 __spare: 0,
2709 };
2710
2711 const_fn! {
2712 {const} fn _CMSG_ALIGN(len: usize) -> usize {
2713 len + mem::size_of::<usize>() - 1 & !(mem::size_of::<usize>() - 1)
2714 }
2715
2716 {const} fn _ALIGN(p: usize, b: usize) -> usize {
2717 (p + b - 1) & !(b - 1)
2718 }
2719 }
2720
2721 f! {
2722 pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
2723 if (*mhdr).msg_controllen as usize >= mem::size_of::<cmsghdr>() {
2724 (*mhdr).msg_control as *mut cmsghdr
2725 } else {
2726 0 as *mut cmsghdr
2727 }
2728 }
2729
2730 pub fn CMSG_NXTHDR(mhdr: *const crate::msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr {
2731 let msg = _CMSG_ALIGN((*cmsg).cmsg_len as usize);
2732 let next = cmsg as usize + msg + _CMSG_ALIGN(mem::size_of::<cmsghdr>());
2733 if next > (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize {
2734 0 as *mut cmsghdr
2735 } else {
2736 (cmsg as usize + msg) as *mut cmsghdr
2737 }
2738 }
2739
2740 pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar {
2741 (cmsg as *mut c_uchar).offset(_CMSG_ALIGN(mem::size_of::<cmsghdr>()) as isize)
2742 }
2743
2744 pub {const} fn CMSG_LEN(length: c_uint) -> c_uint {
2745 _CMSG_ALIGN(mem::size_of::<cmsghdr>()) as c_uint + length
2746 }
2747
2748 pub {const} fn CMSG_SPACE(length: c_uint) -> c_uint {
2749 (_CMSG_ALIGN(mem::size_of::<cmsghdr>()) + _CMSG_ALIGN(length as usize)) as c_uint
2750 }
2751
2752 pub fn FD_CLR(fd: c_int, set: *mut fd_set) -> () {
2753 let fd = fd as usize;
2754 let size = mem::size_of_val(&(*set).fds_bits[0]) * 8;
2755 (*set).fds_bits[fd / size] &= !(1 << (fd % size));
2756 return;
2757 }
2758
2759 pub fn FD_ISSET(fd: c_int, set: *const fd_set) -> bool {
2760 let fd = fd as usize;
2761 let size = mem::size_of_val(&(*set).fds_bits[0]) * 8;
2762 return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0;
2763 }
2764
2765 pub fn FD_SET(fd: c_int, set: *mut fd_set) -> () {
2766 let fd = fd as usize;
2767 let size = mem::size_of_val(&(*set).fds_bits[0]) * 8;
2768 (*set).fds_bits[fd / size] |= 1 << (fd % size);
2769 return;
2770 }
2771
2772 pub fn FD_ZERO(set: *mut fd_set) -> () {
2773 for slot in (*set).fds_bits.iter_mut() {
2774 *slot = 0;
2775 }
2776 }
2777
2778 pub fn _DEXTRA_FIRST(_d: *const dirent) -> *mut crate::dirent_extra {
2779 let _f = &((*(_d)).d_name) as *const _;
2780 let _s = _d as usize;
2781
2782 _ALIGN(_s + _f as usize - _s + (*_d).d_namelen as usize + 1, 8) as *mut crate::dirent_extra
2783 }
2784
2785 pub fn _DEXTRA_VALID(_x: *const crate::dirent_extra, _d: *const dirent) -> bool {
2786 let sz = _x as usize - _d as usize + mem::size_of::<crate::dirent_extra>();
2787 let rsz = (*_d).d_reclen as usize;
2788
2789 if sz > rsz || sz + (*_x).d_datalen as usize > rsz {
2790 false
2791 } else {
2792 true
2793 }
2794 }
2795
2796 pub fn _DEXTRA_NEXT(_x: *const crate::dirent_extra) -> *mut crate::dirent_extra {
2797 _ALIGN(
2798 _x as usize + mem::size_of::<crate::dirent_extra>() + (*_x).d_datalen as usize,
2799 8,
2800 ) as *mut crate::dirent_extra
2801 }
2802
2803 pub fn SOCKCREDSIZE(ngrps: usize) -> usize {
2804 let ngrps = if ngrps > 0 { ngrps - 1 } else { 0 };
2805 mem::size_of::<sockcred>() + mem::size_of::<crate::gid_t>() * ngrps
2806 }
2807 }
2808
2809 safe_f! {
2810 pub {const} fn WIFSTOPPED(status: c_int) -> bool {
2811 (status & 0xff) == 0x7f
2812 }
2813
2814 pub {const} fn WSTOPSIG(status: c_int) -> c_int {
2815 (status >> 8) & 0xff
2816 }
2817
2818 pub {const} fn WIFCONTINUED(status: c_int) -> bool {
2819 status == 0xffff
2820 }
2821
2822 pub {const} fn WIFSIGNALED(status: c_int) -> bool {
2823 ((status & 0x7f) + 1) as i8 >= 2
2824 }
2825
2826 pub {const} fn WTERMSIG(status: c_int) -> c_int {
2827 status & 0x7f
2828 }
2829
2830 pub {const} fn WIFEXITED(status: c_int) -> bool {
2831 (status & 0x7f) == 0
2832 }
2833
2834 pub {const} fn WEXITSTATUS(status: c_int) -> c_int {
2835 (status >> 8) & 0xff
2836 }
2837
2838 pub {const} fn WCOREDUMP(status: c_int) -> bool {
2839 (status & 0x80) != 0
2840 }
2841
2842 pub {const} fn IPTOS_ECN(x: u8) -> u8 {
2843 x & crate::IPTOS_ECN_MASK
2844 }
2845
2846 pub {const} fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t {
2847 ((major << 10) | (minor)) as crate::dev_t
2848 }
2849
2850 pub {const} fn major(dev: crate::dev_t) -> c_uint {
2851 ((dev as c_uint) >> 10) & 0x3f
2852 }
2853
2854 pub {const} fn minor(dev: crate::dev_t) -> c_uint {
2855 (dev as c_uint) & 0x3ff
2856 }
2857 }
2858
2859 // Network related functions are provided by libsocket and regex
2860 // functions are provided by libregex.
2861 // In QNX <=7.0, libregex functions were included in libc itself.
2862 #[link(name = "socket")]
2863 #[cfg_attr(not(target_env = "nto70"), link(name = "regex"))]
2864 extern "C" {
2865 pub fn sem_destroy(sem: *mut sem_t) -> c_int;
2866 pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int;
2867 pub fn fdatasync(fd: c_int) -> c_int;
2868 pub fn getpriority(which: c_int, who: crate::id_t) -> c_int;
2869 pub fn setpriority(which: c_int, who: crate::id_t, prio: c_int) -> c_int;
2870 pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t) -> c_int;
2871 pub fn mknodat(
2872 __fd: c_int,
2873 pathname: *const c_char,
2874 mode: crate::mode_t,
2875 dev: crate::dev_t,
2876 ) -> c_int;
2877
2878 pub fn clock_getres(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int;
2879 pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int;
2880 pub fn clock_settime(clk_id: crate::clockid_t, tp: *const crate::timespec) -> c_int;
2881 pub fn clock_getcpuclockid(pid: crate::pid_t, clk_id: *mut crate::clockid_t) -> c_int;
2882
2883 pub fn pthread_attr_getstack(
2884 attr: *const crate::pthread_attr_t,
2885 stackaddr: *mut *mut c_void,
2886 stacksize: *mut size_t,
2887 ) -> c_int;
2888 pub fn memalign(align: size_t, size: size_t) -> *mut c_void;
2889 pub fn setgroups(ngroups: c_int, ptr: *const crate::gid_t) -> c_int;
2890
2891 pub fn posix_fadvise(fd: c_int, offset: off_t, len: off_t, advise: c_int) -> c_int;
2892 pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int;
2893 pub fn nl_langinfo(item: crate::nl_item) -> *mut c_char;
2894
2895 pub fn utimensat(
2896 dirfd: c_int,
2897 path: *const c_char,
2898 times: *const crate::timespec,
2899 flag: c_int,
2900 ) -> c_int;
2901
2902 pub fn pthread_condattr_getclock(
2903 attr: *const pthread_condattr_t,
2904 clock_id: *mut clockid_t,
2905 ) -> c_int;
2906 pub fn pthread_condattr_setclock(
2907 attr: *mut pthread_condattr_t,
2908 clock_id: crate::clockid_t,
2909 ) -> c_int;
2910 pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: c_int) -> c_int;
2911 pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, pshared: c_int) -> c_int;
2912 pub fn pthread_rwlockattr_getpshared(
2913 attr: *const pthread_rwlockattr_t,
2914 val: *mut c_int,
2915 ) -> c_int;
2916 pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: c_int) -> c_int;
2917 pub fn ptsname_r(fd: c_int, buf: *mut c_char, buflen: size_t) -> *mut c_char;
2918 pub fn clearenv() -> c_int;
2919 pub fn waitid(
2920 idtype: idtype_t,
2921 id: id_t,
2922 infop: *mut crate::siginfo_t,
2923 options: c_int,
2924 ) -> c_int;
2925 pub fn wait4(
2926 pid: crate::pid_t,
2927 status: *mut c_int,
2928 options: c_int,
2929 rusage: *mut crate::rusage,
2930 ) -> crate::pid_t;
2931
2932 // DIFF(main): changed to `*const *mut` in e77f551de9
2933 pub fn execvpe(
2934 file: *const c_char,
2935 argv: *const *const c_char,
2936 envp: *const *const c_char,
2937 ) -> c_int;
2938
2939 pub fn getifaddrs(ifap: *mut *mut crate::ifaddrs) -> c_int;
2940 pub fn freeifaddrs(ifa: *mut crate::ifaddrs);
2941 pub fn bind(
2942 socket: c_int,
2943 address: *const crate::sockaddr,
2944 address_len: crate::socklen_t,
2945 ) -> c_int;
2946
2947 pub fn writev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t;
2948 pub fn readv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t;
2949
2950 pub fn sendmsg(fd: c_int, msg: *const crate::msghdr, flags: c_int) -> ssize_t;
2951 pub fn recvmsg(fd: c_int, msg: *mut crate::msghdr, flags: c_int) -> ssize_t;
2952 pub fn openpty(
2953 amaster: *mut c_int,
2954 aslave: *mut c_int,
2955 name: *mut c_char,
2956 termp: *mut termios,
2957 winp: *mut crate::winsize,
2958 ) -> c_int;
2959 pub fn forkpty(
2960 amaster: *mut c_int,
2961 name: *mut c_char,
2962 termp: *mut termios,
2963 winp: *mut crate::winsize,
2964 ) -> crate::pid_t;
2965 pub fn login_tty(fd: c_int) -> c_int;
2966
2967 pub fn uname(buf: *mut crate::utsname) -> c_int;
2968
2969 pub fn getpeereid(socket: c_int, euid: *mut crate::uid_t, egid: *mut crate::gid_t) -> c_int;
2970
2971 pub fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int;
2972
2973 pub fn abs(i: c_int) -> c_int;
2974 pub fn labs(i: c_long) -> c_long;
2975 pub fn rand() -> c_int;
2976 pub fn srand(seed: c_uint);
2977
2978 pub fn setpwent();
2979 pub fn endpwent();
2980 pub fn getpwent() -> *mut passwd;
2981 pub fn setgrent();
2982 pub fn endgrent();
2983 pub fn getgrent() -> *mut crate::group;
2984 pub fn setspent();
2985 pub fn endspent();
2986
2987 pub fn shm_open(name: *const c_char, oflag: c_int, mode: mode_t) -> c_int;
2988
2989 pub fn ftok(pathname: *const c_char, proj_id: c_int) -> crate::key_t;
2990 pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int;
2991
2992 pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int;
2993 pub fn mkostemp(template: *mut c_char, flags: c_int) -> c_int;
2994 pub fn mkostemps(template: *mut c_char, suffixlen: c_int, flags: c_int) -> c_int;
2995 pub fn sigtimedwait(
2996 set: *const sigset_t,
2997 info: *mut siginfo_t,
2998 timeout: *const crate::timespec,
2999 ) -> c_int;
3000 pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> c_int;
3001 pub fn pthread_setschedprio(native: crate::pthread_t, priority: c_int) -> c_int;
3002
3003 pub fn if_nameindex() -> *mut if_nameindex;
3004 pub fn if_freenameindex(ptr: *mut if_nameindex);
3005
3006 pub fn glob(
3007 pattern: *const c_char,
3008 flags: c_int,
3009 errfunc: Option<extern "C" fn(epath: *const c_char, errno: c_int) -> c_int>,
3010 pglob: *mut crate::glob_t,
3011 ) -> c_int;
3012 pub fn globfree(pglob: *mut crate::glob_t);
3013
3014 pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int;
3015
3016 pub fn shm_unlink(name: *const c_char) -> c_int;
3017
3018 pub fn seekdir(dirp: *mut crate::DIR, loc: c_long);
3019
3020 pub fn telldir(dirp: *mut crate::DIR) -> c_long;
3021
3022 pub fn msync(addr: *mut c_void, len: size_t, flags: c_int) -> c_int;
3023
3024 pub fn recvfrom(
3025 socket: c_int,
3026 buf: *mut c_void,
3027 len: size_t,
3028 flags: c_int,
3029 addr: *mut crate::sockaddr,
3030 addrlen: *mut crate::socklen_t,
3031 ) -> ssize_t;
3032 pub fn mkstemps(template: *mut c_char, suffixlen: c_int) -> c_int;
3033
3034 pub fn getdomainname(name: *mut c_char, len: size_t) -> c_int;
3035 pub fn setdomainname(name: *const c_char, len: size_t) -> c_int;
3036 pub fn sync();
3037 pub fn pthread_getschedparam(
3038 native: crate::pthread_t,
3039 policy: *mut c_int,
3040 param: *mut crate::sched_param,
3041 ) -> c_int;
3042 pub fn umount(target: *const c_char, flags: c_int) -> c_int;
3043 pub fn sched_get_priority_max(policy: c_int) -> c_int;
3044 pub fn settimeofday(tv: *const crate::timeval, tz: *const c_void) -> c_int;
3045 pub fn sched_rr_get_interval(pid: crate::pid_t, tp: *mut crate::timespec) -> c_int;
3046 pub fn sem_timedwait(sem: *mut sem_t, abstime: *const crate::timespec) -> c_int;
3047 pub fn sem_getvalue(sem: *mut sem_t, sval: *mut c_int) -> c_int;
3048 pub fn sched_setparam(pid: crate::pid_t, param: *const crate::sched_param) -> c_int;
3049 pub fn mount(
3050 special_device: *const c_char,
3051 mount_directory: *const c_char,
3052 flags: c_int,
3053 mount_type: *const c_char,
3054 mount_data: *const c_void,
3055 mount_datalen: c_int,
3056 ) -> c_int;
3057 pub fn sched_getparam(pid: crate::pid_t, param: *mut crate::sched_param) -> c_int;
3058 pub fn pthread_mutex_consistent(mutex: *mut pthread_mutex_t) -> c_int;
3059 pub fn pthread_mutex_timedlock(
3060 lock: *mut pthread_mutex_t,
3061 abstime: *const crate::timespec,
3062 ) -> c_int;
3063 pub fn pthread_spin_init(lock: *mut crate::pthread_spinlock_t, pshared: c_int) -> c_int;
3064 pub fn pthread_spin_destroy(lock: *mut crate::pthread_spinlock_t) -> c_int;
3065 pub fn pthread_spin_lock(lock: *mut crate::pthread_spinlock_t) -> c_int;
3066 pub fn pthread_spin_trylock(lock: *mut crate::pthread_spinlock_t) -> c_int;
3067 pub fn pthread_spin_unlock(lock: *mut crate::pthread_spinlock_t) -> c_int;
3068 pub fn pthread_barrierattr_init(__attr: *mut crate::pthread_barrierattr_t) -> c_int;
3069 pub fn pthread_barrierattr_destroy(__attr: *mut crate::pthread_barrierattr_t) -> c_int;
3070 pub fn pthread_barrierattr_getpshared(
3071 __attr: *const crate::pthread_barrierattr_t,
3072 __pshared: *mut c_int,
3073 ) -> c_int;
3074 pub fn pthread_barrierattr_setpshared(
3075 __attr: *mut crate::pthread_barrierattr_t,
3076 __pshared: c_int,
3077 ) -> c_int;
3078 pub fn pthread_barrier_init(
3079 __barrier: *mut crate::pthread_barrier_t,
3080 __attr: *const crate::pthread_barrierattr_t,
3081 __count: c_uint,
3082 ) -> c_int;
3083 pub fn pthread_barrier_destroy(__barrier: *mut crate::pthread_barrier_t) -> c_int;
3084 pub fn pthread_barrier_wait(__barrier: *mut crate::pthread_barrier_t) -> c_int;
3085
3086 pub fn sched_getscheduler(pid: crate::pid_t) -> c_int;
3087 pub fn clock_nanosleep(
3088 clk_id: crate::clockid_t,
3089 flags: c_int,
3090 rqtp: *const crate::timespec,
3091 rmtp: *mut crate::timespec,
3092 ) -> c_int;
3093 pub fn pthread_attr_getguardsize(
3094 attr: *const crate::pthread_attr_t,
3095 guardsize: *mut size_t,
3096 ) -> c_int;
3097 pub fn pthread_attr_setguardsize(attr: *mut crate::pthread_attr_t, guardsize: size_t) -> c_int;
3098 pub fn sethostname(name: *const c_char, len: size_t) -> c_int;
3099 pub fn sched_get_priority_min(policy: c_int) -> c_int;
3100 pub fn pthread_condattr_getpshared(
3101 attr: *const pthread_condattr_t,
3102 pshared: *mut c_int,
3103 ) -> c_int;
3104 pub fn pthread_setschedparam(
3105 native: crate::pthread_t,
3106 policy: c_int,
3107 param: *const crate::sched_param,
3108 ) -> c_int;
3109 pub fn sched_setscheduler(
3110 pid: crate::pid_t,
3111 policy: c_int,
3112 param: *const crate::sched_param,
3113 ) -> c_int;
3114 pub fn sigsuspend(mask: *const crate::sigset_t) -> c_int;
3115 pub fn getgrgid_r(
3116 gid: crate::gid_t,
3117 grp: *mut crate::group,
3118 buf: *mut c_char,
3119 buflen: size_t,
3120 result: *mut *mut crate::group,
3121 ) -> c_int;
3122 pub fn sem_close(sem: *mut sem_t) -> c_int;
3123 pub fn getdtablesize() -> c_int;
3124 pub fn getgrnam_r(
3125 name: *const c_char,
3126 grp: *mut crate::group,
3127 buf: *mut c_char,
3128 buflen: size_t,
3129 result: *mut *mut crate::group,
3130 ) -> c_int;
3131 pub fn initgroups(user: *const c_char, group: crate::gid_t) -> c_int;
3132 pub fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *mut sigset_t) -> c_int;
3133 pub fn sem_open(name: *const c_char, oflag: c_int, ...) -> *mut sem_t;
3134 pub fn getgrnam(name: *const c_char) -> *mut crate::group;
3135 pub fn pthread_cancel(thread: crate::pthread_t) -> c_int;
3136 pub fn pthread_kill(thread: crate::pthread_t, sig: c_int) -> c_int;
3137 pub fn sem_unlink(name: *const c_char) -> c_int;
3138 pub fn daemon(nochdir: c_int, noclose: c_int) -> c_int;
3139 pub fn getpwnam_r(
3140 name: *const c_char,
3141 pwd: *mut passwd,
3142 buf: *mut c_char,
3143 buflen: size_t,
3144 result: *mut *mut passwd,
3145 ) -> c_int;
3146 pub fn getpwuid_r(
3147 uid: crate::uid_t,
3148 pwd: *mut passwd,
3149 buf: *mut c_char,
3150 buflen: size_t,
3151 result: *mut *mut passwd,
3152 ) -> c_int;
3153 pub fn sigwait(set: *const sigset_t, sig: *mut c_int) -> c_int;
3154 pub fn pthread_atfork(
3155 prepare: Option<unsafe extern "C" fn()>,
3156 parent: Option<unsafe extern "C" fn()>,
3157 child: Option<unsafe extern "C" fn()>,
3158 ) -> c_int;
3159 pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group;
3160 pub fn getgrouplist(
3161 user: *const c_char,
3162 group: crate::gid_t,
3163 groups: *mut crate::gid_t,
3164 ngroups: *mut c_int,
3165 ) -> c_int;
3166 pub fn pthread_mutexattr_getpshared(
3167 attr: *const pthread_mutexattr_t,
3168 pshared: *mut c_int,
3169 ) -> c_int;
3170 pub fn pthread_mutexattr_getrobust(
3171 attr: *const pthread_mutexattr_t,
3172 robustness: *mut c_int,
3173 ) -> c_int;
3174 pub fn pthread_mutexattr_setrobust(attr: *mut pthread_mutexattr_t, robustness: c_int) -> c_int;
3175 pub fn pthread_create(
3176 native: *mut crate::pthread_t,
3177 attr: *const crate::pthread_attr_t,
3178 f: extern "C" fn(*mut c_void) -> *mut c_void,
3179 value: *mut c_void,
3180 ) -> c_int;
3181 pub fn getitimer(which: c_int, curr_value: *mut crate::itimerval) -> c_int;
3182 pub fn setitimer(
3183 which: c_int,
3184 value: *const crate::itimerval,
3185 ovalue: *mut crate::itimerval,
3186 ) -> c_int;
3187 pub fn posix_spawn(
3188 pid: *mut crate::pid_t,
3189 path: *const c_char,
3190 file_actions: *const crate::posix_spawn_file_actions_t,
3191 attrp: *const crate::posix_spawnattr_t,
3192 argv: *const *mut c_char,
3193 envp: *const *mut c_char,
3194 ) -> c_int;
3195 pub fn posix_spawnp(
3196 pid: *mut crate::pid_t,
3197 file: *const c_char,
3198 file_actions: *const crate::posix_spawn_file_actions_t,
3199 attrp: *const crate::posix_spawnattr_t,
3200 argv: *const *mut c_char,
3201 envp: *const *mut c_char,
3202 ) -> c_int;
3203 pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> c_int;
3204 pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> c_int;
3205 pub fn posix_spawnattr_getsigdefault(
3206 attr: *const posix_spawnattr_t,
3207 default: *mut crate::sigset_t,
3208 ) -> c_int;
3209 pub fn posix_spawnattr_setsigdefault(
3210 attr: *mut posix_spawnattr_t,
3211 default: *const crate::sigset_t,
3212 ) -> c_int;
3213 pub fn posix_spawnattr_getsigmask(
3214 attr: *const posix_spawnattr_t,
3215 default: *mut crate::sigset_t,
3216 ) -> c_int;
3217 pub fn posix_spawnattr_setsigmask(
3218 attr: *mut posix_spawnattr_t,
3219 default: *const crate::sigset_t,
3220 ) -> c_int;
3221 pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t, flags: *mut c_short) -> c_int;
3222 pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: c_short) -> c_int;
3223 pub fn posix_spawnattr_getpgroup(
3224 attr: *const posix_spawnattr_t,
3225 flags: *mut crate::pid_t,
3226 ) -> c_int;
3227 pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int;
3228 pub fn posix_spawnattr_getschedpolicy(
3229 attr: *const posix_spawnattr_t,
3230 flags: *mut c_int,
3231 ) -> c_int;
3232 pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: c_int) -> c_int;
3233 pub fn posix_spawnattr_getschedparam(
3234 attr: *const posix_spawnattr_t,
3235 param: *mut crate::sched_param,
3236 ) -> c_int;
3237 pub fn posix_spawnattr_setschedparam(
3238 attr: *mut posix_spawnattr_t,
3239 param: *const crate::sched_param,
3240 ) -> c_int;
3241
3242 pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int;
3243 pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int;
3244 pub fn posix_spawn_file_actions_addopen(
3245 actions: *mut posix_spawn_file_actions_t,
3246 fd: c_int,
3247 path: *const c_char,
3248 oflag: c_int,
3249 mode: crate::mode_t,
3250 ) -> c_int;
3251 pub fn posix_spawn_file_actions_addclose(
3252 actions: *mut posix_spawn_file_actions_t,
3253 fd: c_int,
3254 ) -> c_int;
3255 pub fn posix_spawn_file_actions_adddup2(
3256 actions: *mut posix_spawn_file_actions_t,
3257 fd: c_int,
3258 newfd: c_int,
3259 ) -> c_int;
3260 pub fn popen(command: *const c_char, mode: *const c_char) -> *mut crate::FILE;
3261 pub fn faccessat(dirfd: c_int, pathname: *const c_char, mode: c_int, flags: c_int) -> c_int;
3262 pub fn inotify_rm_watch(fd: c_int, wd: c_int) -> c_int;
3263 pub fn inotify_init() -> c_int;
3264 pub fn inotify_add_watch(fd: c_int, path: *const c_char, mask: u32) -> c_int;
3265
3266 pub fn gettid() -> crate::pid_t;
3267
3268 pub fn pthread_getcpuclockid(thread: crate::pthread_t, clk_id: *mut crate::clockid_t) -> c_int;
3269
3270 pub fn getnameinfo(
3271 sa: *const crate::sockaddr,
3272 salen: crate::socklen_t,
3273 host: *mut c_char,
3274 hostlen: crate::socklen_t,
3275 serv: *mut c_char,
3276 servlen: crate::socklen_t,
3277 flags: c_int,
3278 ) -> c_int;
3279
3280 pub fn sendmmsg(
3281 sockfd: c_int,
3282 msgvec: *mut crate::mmsghdr,
3283 vlen: c_uint,
3284 flags: c_uint,
3285 ) -> c_int;
3286 pub fn recvmmsg(
3287 sockfd: c_int,
3288 msgvec: *mut crate::mmsghdr,
3289 vlen: c_uint,
3290 flags: c_uint,
3291 timeout: *mut crate::timespec,
3292 ) -> c_int;
3293
3294 pub fn mallopt(param: c_int, value: i64) -> c_int;
3295 pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int;
3296
3297 pub fn ctermid(s: *mut c_char) -> *mut c_char;
3298 pub fn ioctl(fd: c_int, request: c_int, ...) -> c_int;
3299
3300 pub fn mallinfo() -> crate::mallinfo;
3301 pub fn getpwent_r(
3302 pwd: *mut crate::passwd,
3303 buf: *mut c_char,
3304 __bufsize: c_int,
3305 __result: *mut *mut crate::passwd,
3306 ) -> c_int;
3307 pub fn pthread_getname_np(thread: crate::pthread_t, name: *mut c_char, len: c_int) -> c_int;
3308 pub fn pthread_setname_np(thread: crate::pthread_t, name: *const c_char) -> c_int;
3309
3310 pub fn sysctl(
3311 _: *const c_int,
3312 _: c_uint,
3313 _: *mut c_void,
3314 _: *mut size_t,
3315 _: *const c_void,
3316 _: size_t,
3317 ) -> c_int;
3318
3319 pub fn getrlimit(resource: c_int, rlim: *mut crate::rlimit) -> c_int;
3320 pub fn setrlimit(resource: c_int, rlp: *const crate::rlimit) -> c_int;
3321
3322 pub fn lio_listio(
3323 __mode: c_int,
3324 __list: *const *mut aiocb,
3325 __nent: c_int,
3326 __sig: *mut sigevent,
3327 ) -> c_int;
3328
3329 pub fn dl_iterate_phdr(
3330 callback: Option<
3331 unsafe extern "C" fn(
3332 // The original .h file declares this as *const, but for consistency with other platforms,
3333 // changing this to *mut to make it easier to use.
3334 // Maybe in v0.3 all platforms should use this as a *const.
3335 info: *mut dl_phdr_info,
3336 size: size_t,
3337 data: *mut c_void,
3338 ) -> c_int,
3339 >,
3340 data: *mut c_void,
3341 ) -> c_int;
3342
3343 pub fn memset_s(s: *mut c_void, smax: size_t, c: c_int, n: size_t) -> c_int;
3344
3345 pub fn regcomp(__preg: *mut crate::regex_t, __pattern: *const c_char, __cflags: c_int)
3346 -> c_int;
3347 pub fn regexec(
3348 __preg: *const crate::regex_t,
3349 __str: *const c_char,
3350 __nmatch: size_t,
3351 __pmatch: *mut crate::regmatch_t,
3352 __eflags: c_int,
3353 ) -> c_int;
3354 pub fn regerror(
3355 __errcode: c_int,
3356 __preg: *const crate::regex_t,
3357 __errbuf: *mut c_char,
3358 __errbuf_size: size_t,
3359 ) -> size_t;
3360 pub fn regfree(__preg: *mut crate::regex_t);
3361 pub fn dirfd(__dirp: *mut crate::DIR) -> c_int;
3362 pub fn dircntl(dir: *mut crate::DIR, cmd: c_int, ...) -> c_int;
3363
3364 pub fn aio_cancel(__fd: c_int, __aiocbp: *mut crate::aiocb) -> c_int;
3365 pub fn aio_error(__aiocbp: *const crate::aiocb) -> c_int;
3366 pub fn aio_fsync(__operation: c_int, __aiocbp: *mut crate::aiocb) -> c_int;
3367 pub fn aio_read(__aiocbp: *mut crate::aiocb) -> c_int;
3368 pub fn aio_return(__aiocpb: *mut crate::aiocb) -> ssize_t;
3369 pub fn aio_suspend(
3370 __list: *const *const crate::aiocb,
3371 __nent: c_int,
3372 __timeout: *const crate::timespec,
3373 ) -> c_int;
3374 pub fn aio_write(__aiocpb: *mut crate::aiocb) -> c_int;
3375
3376 pub fn mq_close(__mqdes: crate::mqd_t) -> c_int;
3377 pub fn mq_getattr(__mqdes: crate::mqd_t, __mqstat: *mut crate::mq_attr) -> c_int;
3378 pub fn mq_notify(__mqdes: crate::mqd_t, __notification: *const crate::sigevent) -> c_int;
3379 pub fn mq_open(__name: *const c_char, __oflag: c_int, ...) -> crate::mqd_t;
3380 pub fn mq_receive(
3381 __mqdes: crate::mqd_t,
3382 __msg_ptr: *mut c_char,
3383 __msg_len: size_t,
3384 __msg_prio: *mut c_uint,
3385 ) -> ssize_t;
3386 pub fn mq_send(
3387 __mqdes: crate::mqd_t,
3388 __msg_ptr: *const c_char,
3389 __msg_len: size_t,
3390 __msg_prio: c_uint,
3391 ) -> c_int;
3392 pub fn mq_setattr(
3393 __mqdes: crate::mqd_t,
3394 __mqstat: *const mq_attr,
3395 __omqstat: *mut mq_attr,
3396 ) -> c_int;
3397 pub fn mq_timedreceive(
3398 __mqdes: crate::mqd_t,
3399 __msg_ptr: *mut c_char,
3400 __msg_len: size_t,
3401 __msg_prio: *mut c_uint,
3402 __abs_timeout: *const crate::timespec,
3403 ) -> ssize_t;
3404 pub fn mq_timedsend(
3405 __mqdes: crate::mqd_t,
3406 __msg_ptr: *const c_char,
3407 __msg_len: size_t,
3408 __msg_prio: c_uint,
3409 __abs_timeout: *const crate::timespec,
3410 ) -> c_int;
3411 pub fn mq_unlink(__name: *const c_char) -> c_int;
3412 pub fn __get_errno_ptr() -> *mut c_int;
3413
3414 // System page, see https://www.qnx.com/developers/docs/7.1#com.qnx.doc.neutrino.building/topic/syspage/syspage_about.html
3415 pub static mut _syspage_ptr: *mut syspage_entry;
3416
3417 // Function on the stack after a call to pthread_create(). This is used
3418 // as a sentinel to work around an infitnite loop in the unwinding code.
3419 pub fn __my_thread_exit(value_ptr: *mut *const c_void);
3420 }
3421
3422 // Models the implementation in stdlib.h. Ctest will fail if trying to use the
3423 // default symbol from libc
3424 pub unsafe fn atexit(cb: extern "C" fn()) -> c_int {
3425 extern "C" {
3426 static __dso_handle: *mut c_void;
3427 pub fn __cxa_atexit(cb: extern "C" fn(), __arg: *mut c_void, __dso: *mut c_void) -> c_int;
3428 }
3429 __cxa_atexit(cb, 0 as *mut c_void, __dso_handle)
3430 }
3431
3432 impl siginfo_t {
3433 pub unsafe fn si_addr(&self) -> *mut c_void {
3434 #[repr(C)]
3435 struct siginfo_si_addr {
3436 _pad: [u8; 32],
3437 si_addr: *mut c_void,
3438 }
3439 (*(self as *const siginfo_t as *const siginfo_si_addr)).si_addr
3440 }
3441
3442 pub unsafe fn si_value(&self) -> crate::sigval {
3443 #[repr(C)]
3444 struct siginfo_si_value {
3445 _pad: [u8; 32],
3446 si_value: crate::sigval,
3447 }
3448 (*(self as *const siginfo_t as *const siginfo_si_value)).si_value
3449 }
3450
3451 pub unsafe fn si_pid(&self) -> crate::pid_t {
3452 #[repr(C)]
3453 struct siginfo_si_pid {
3454 _pad: [u8; 16],
3455 si_pid: crate::pid_t,
3456 }
3457 (*(self as *const siginfo_t as *const siginfo_si_pid)).si_pid
3458 }
3459
3460 pub unsafe fn si_uid(&self) -> crate::uid_t {
3461 #[repr(C)]
3462 struct siginfo_si_uid {
3463 _pad: [u8; 24],
3464 si_uid: crate::uid_t,
3465 }
3466 (*(self as *const siginfo_t as *const siginfo_si_uid)).si_uid
3467 }
3468
3469 pub unsafe fn si_status(&self) -> c_int {
3470 #[repr(C)]
3471 struct siginfo_si_status {
3472 _pad: [u8; 28],
3473 si_status: c_int,
3474 }
3475 (*(self as *const siginfo_t as *const siginfo_si_status)).si_status
3476 }
3477 }
3478
3479 cfg_if! {
3480 if #[cfg(target_arch = "x86_64")] {
3481 mod x86_64;
3482 pub use self::x86_64::*;
3483 } else if #[cfg(target_arch = "aarch64")] {
3484 mod aarch64;
3485 pub use self::aarch64::*;
3486 } else {
3487 panic!("Unsupported arch");
3488 }
3489 }
3490
3491 mod neutrino;
3492 pub use self::neutrino::*;