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