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