1 // Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 #![crate_name = "libc"]
12 #![crate_type = "rlib"]
13 #![cfg_attr(not(feature = "cargo-build"),
14 unstable(feature = "libc"))]
15 #![cfg_attr(not(feature = "cargo-build"), feature(staged_api))]
16 #![cfg_attr(not(feature = "cargo-build"), staged_api)]
17 #![cfg_attr(not(feature = "cargo-build"), feature(core))]
20 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
21 html_favicon_url = "http://www.rust-lang.org/favicon.ico",
22 html_root_url = "http://doc.rust-lang.org/nightly/",
23 html_playground_url = "http://play.rust-lang.org/")]
24 #![cfg_attr(test, feature(test))]
26 //! Bindings for the C standard library and other platform libraries
28 //! **NOTE:** These are *architecture and libc* specific. On Linux, these
29 //! bindings are only correct for glibc.
31 //! This module contains bindings to the C standard library, organized into
32 //! modules by their defining standard. Additionally, it contains some assorted
33 //! platform-specific definitions. For convenience, most functions and types
34 //! are reexported, so `use libc::*` will import the available C bindings as
35 //! appropriate for the target platform. The exact set of functions available
36 //! are platform specific.
38 //! *Note:* Because these definitions are platform-specific, some may not appear
39 //! in the generated documentation.
41 //! We consider the following specs reasonably normative with respect to
42 //! interoperating with the C standard library (libc/msvcrt):
44 //! * ISO 9899:1990 ('C95', 'ANSI C', 'Standard C'), NA1, 1995.
45 //! * ISO 9899:1999 ('C99' or 'C9x').
46 //! * ISO 9945:1988 / IEEE 1003.1-1988 ('POSIX.1').
47 //! * ISO 9945:2001 / IEEE 1003.1-2001 ('POSIX:2001', 'SUSv3').
48 //! * ISO 9945:2008 / IEEE 1003.1-2008 ('POSIX:2008', 'SUSv4').
50 //! Note that any reference to the 1996 revision of POSIX, or any revs between
51 //! 1990 (when '88 was approved at ISO) and 2001 (when the next actual
52 //! revision-revision happened), are merely additions of other chapters (1b and
53 //! 1c) outside the core interfaces.
55 //! Despite having several names each, these are *reasonably* coherent
56 //! point-in-time, list-of-definition sorts of specs. You can get each under a
57 //! variety of names but will wind up with the same definition in each case.
59 //! See standards(7) in linux-manpages for more details.
61 //! Our interface to these libraries is complicated by the non-universality of
62 //! conformance to any of them. About the only thing universally supported is
63 //! the first (C95), beyond that definitions quickly become absent on various
66 //! We therefore wind up dividing our module-space up (mostly for the sake of
67 //! sanity while editing, filling-in-details and eliminating duplication) into
68 //! definitions common-to-all (held in modules named c95, c99, posix88, posix01
69 //! and posix08) and definitions that appear only on *some* platforms (named
70 //! 'extra'). This would be things like significant OSX foundation kit, or Windows
71 //! library kernel32.dll, or various fancy glibc, Linux or BSD extensions.
73 //! In addition to the per-platform 'extra' modules, we define a module of
74 //! 'common BSD' libc routines that never quite made it into POSIX but show up
75 //! in multiple derived systems. This is the 4.4BSD r2 / 1995 release, the final
76 //! one from Berkeley after the lawsuits died down and the CSRG dissolved.
78 #![allow(bad_style, raw_pointer_derive)]
79 #![cfg_attr(target_os = "nacl", allow(unused_imports))]
80 #[cfg(feature = "cargo-build")] extern crate "std" as core;
81 #[cfg(not(feature = "cargo-build"))] extern crate core;
83 #[cfg(test)] extern crate std;
84 #[cfg(test)] extern crate test;
86 // Explicit export lists for the intersection (provided here) mean that
87 // you can write more-platform-agnostic code if you stick to just these
90 pub use types::common::c95::*;
91 pub use types::common::c99::*;
92 pub use types::common::posix88::*;
93 pub use types::os::common::posix01::*;
94 pub use types::os::common::bsd44::*;
95 pub use types::os::arch::c95::*;
96 pub use types::os::arch::c99::*;
97 pub use types::os::arch::posix88::*;
98 pub use types::os::arch::posix01::*;
99 pub use types::os::arch::extra::*;
101 pub use consts::os::c95::*;
102 pub use consts::os::posix88::*;
103 pub use consts::os::posix01::*;
104 pub use consts::os::bsd44::*;
105 pub use consts::os::extra::*;
107 pub use funcs::c95::ctype::*;
108 pub use funcs::c95::stdio::*;
109 pub use funcs::c95::stdlib::*;
110 pub use funcs::c95::string::*;
111 pub use funcs::posix88::fcntl::*;
112 pub use funcs::posix88::stat_::*;
113 pub use funcs::posix88::stdio::*;
114 pub use funcs::posix88::unistd::*;
116 pub use funcs::bsd43::*;
118 // But we also reexport most everything
119 // if you're interested in writing platform-specific code.
121 // FIXME: This is a mess, but the design of this entire module needs to be
122 // reconsidered, so I'm not inclined to do better right now. As part of
123 // #11870 I removed all the pub globs here, leaving explicit reexports
124 // of everything that is actually used in-tree.
126 // So the following exports don't follow any particular plan.
128 #[cfg(unix)] pub use consts::os::sysconf::*;
130 #[cfg(unix)] pub use funcs::posix88::mman::*;
131 #[cfg(unix)] pub use funcs::posix88::dirent::*;
132 #[cfg(unix)] pub use funcs::posix88::net::*;
133 #[cfg(unix)] pub use funcs::posix01::stat_::*;
134 #[cfg(unix)] pub use funcs::posix01::unistd::*;
137 #[cfg(windows)] pub use funcs::extra::kernel32::*;
138 #[cfg(windows)] pub use funcs::extra::winsock::*;
139 #[cfg(windows)] pub use funcs::extra::msvcrt::*;
141 // On NaCl, these libraries are static. Thus it would be a Bad Idea to link them
142 // in when creating a test crate.
143 #[cfg(not(any(windows, all(target_os = "nacl", test))))]
148 // libnacl provides functions that require a trip through the IRT to work.
149 // ie: _exit, mmap, nanosleep, etc. Anything that would otherwise require a trip
151 #[cfg(all(target_os = "nacl", not(feature = "cargo-build"), not(test)))]
152 #[link(name = "nacl", kind = "static")]
155 // pnaclmm provides a number of functions that the toolchain's Clang emits calls
156 // to when codegening atomic ops. All the functions within wrap various atomic
158 // Yes, it could be linked by rustc explicitly, however by linking it here
159 // instead we save a bit of time where bins are involved (by not running the
160 // optimizations on the whole pnaclmm foreach binary built).
161 #[cfg(all(target_os = "nacl", not(feature = "cargo-build"), not(test)))]
162 #[link(name = "pnaclmm", kind = "static")]
167 // Types tend to vary *per architecture* so we pull their definitions out
170 // Standard types that are opaque or common, so are not per-target.
173 /// Type used to construct void pointers for use with C.
175 /// This type is only useful as a pointer target. Do not use it as a
176 /// return type for FFI functions which have the `void` return type in
177 /// C. Use the unit type `()` or omit the return type instead.
179 /// For LLVM to recognize the void pointer type and by extension
180 /// functions like malloc(), we need to have it represented as i8* in
181 /// LLVM bitcode. The enum used here ensures this and prevents misuse
182 /// of the "raw" type by only having private variants.. We need two
183 /// variants, because the compiler complains about the repr attribute
195 pub type int8_t = i8;
196 pub type int16_t = i16;
197 pub type int32_t = i32;
198 pub type int64_t = i64;
199 pub type uint8_t = u8;
200 pub type uint16_t = u16;
201 pub type uint32_t = u32;
202 pub type uint64_t = u64;
213 // Standard types that are scalar but vary by OS and arch.
215 #[cfg(any(target_os = "linux", target_os = "android", target_os = "nacl"))]
219 use types::common::c95::{c_void};
220 use types::os::arch::c95::{c_char, c_ulong, size_t,
221 time_t, suseconds_t, c_long};
223 #[cfg(not(target_os = "nacl"))]
224 pub type pthread_t = c_ulong;
225 #[cfg(target_os = "nacl")]
226 pub type pthread_t = *mut c_void;
229 #[derive(Copy)] pub struct glob_t {
230 pub gl_pathc: size_t,
231 pub gl_pathv: *mut *mut c_char,
234 pub __unused1: *mut c_void,
235 pub __unused2: *mut c_void,
236 pub __unused3: *mut c_void,
237 pub __unused4: *mut c_void,
238 pub __unused5: *mut c_void,
242 #[derive(Copy)] pub struct timeval {
244 pub tv_usec: suseconds_t,
248 #[derive(Copy)] pub struct timespec {
253 #[derive(Copy)] pub enum timezone {}
255 pub type sighandler_t = size_t;
258 use types::common::c95::{c_void};
259 use types::os::arch::c95::{c_char, c_int, c_uint};
261 pub type socklen_t = u32;
262 pub type sa_family_t = u16;
263 pub type in_port_t = u16;
264 pub type in_addr_t = u32;
266 #[derive(Copy)] pub struct sockaddr {
267 pub sa_family: sa_family_t,
268 pub sa_data: [u8; 14],
271 #[derive(Copy)] pub struct sockaddr_storage {
272 pub ss_family: sa_family_t,
274 pub __ss_pad2: [u8; 112],
277 #[derive(Copy)] pub struct sockaddr_in {
278 pub sin_family: sa_family_t,
279 pub sin_port: in_port_t,
280 pub sin_addr: in_addr,
281 pub sin_zero: [u8; 8],
284 #[derive(Copy)] pub struct in_addr {
285 pub s_addr: in_addr_t,
288 #[derive(Copy)] pub struct sockaddr_in6 {
289 pub sin6_family: sa_family_t,
290 pub sin6_port: in_port_t,
291 pub sin6_flowinfo: u32,
292 pub sin6_addr: in6_addr,
293 pub sin6_scope_id: u32,
296 #[derive(Copy)] pub struct in6_addr {
297 pub s6_addr: [u16; 8]
300 #[derive(Copy)] pub struct ip_mreq {
301 pub imr_multiaddr: in_addr,
302 pub imr_interface: in_addr,
305 #[derive(Copy)] pub struct ip6_mreq {
306 pub ipv6mr_multiaddr: in6_addr,
307 pub ipv6mr_interface: c_uint,
310 #[derive(Copy)] pub struct addrinfo {
312 pub ai_family: c_int,
313 pub ai_socktype: c_int,
314 pub ai_protocol: c_int,
315 pub ai_addrlen: socklen_t,
317 #[cfg(target_os = "linux")]
318 pub ai_addr: *mut sockaddr,
320 #[cfg(target_os = "linux")]
321 pub ai_canonname: *mut c_char,
323 #[cfg(any(target_os = "android", target_os = "nacl"))]
324 pub ai_canonname: *mut c_char,
326 #[cfg(any(target_os = "android", target_os = "nacl"))]
327 pub ai_addr: *mut sockaddr,
329 pub ai_next: *mut addrinfo,
332 #[derive(Copy)] pub struct sockaddr_un {
333 pub sun_family: sa_family_t,
334 pub sun_path: [c_char; 108]
338 #[derive(Copy)] pub struct ifaddrs {
339 pub ifa_next: *mut ifaddrs,
340 pub ifa_name: *mut c_char,
341 pub ifa_flags: c_uint,
342 pub ifa_addr: *mut sockaddr,
343 pub ifa_netmask: *mut sockaddr,
344 pub ifa_ifu: *mut sockaddr, // FIXME This should be a union
345 pub ifa_data: *mut c_void
351 #[cfg(any(target_arch = "x86",
353 target_arch = "mips",
354 target_arch = "mipsel",
355 target_arch = "powerpc",
356 target_arch = "le32"))]
359 pub type c_char = i8;
360 pub type c_schar = i8;
361 pub type c_uchar = u8;
362 pub type c_short = i16;
363 pub type c_ushort = u16;
364 pub type c_int = i32;
365 pub type c_uint = u32;
366 pub type c_long = i32;
367 pub type c_ulong = u32;
368 pub type c_float = f32;
369 pub type c_double = f64;
370 pub type size_t = u32;
371 pub type ptrdiff_t = i32;
372 pub type clock_t = i32;
373 pub type time_t = i32;
374 pub type suseconds_t = i32;
375 pub type wchar_t = i32;
378 pub type c_longlong = i64;
379 pub type c_ulonglong = u64;
380 pub type intptr_t = i32;
381 pub type uintptr_t = u32;
382 pub type intmax_t = i64;
383 pub type uintmax_t = u64;
385 #[cfg(any(target_arch = "x86",
386 target_arch = "mips",
387 target_arch = "mipsel",
388 target_arch = "powerpc",
389 target_arch = "le32"))]
391 pub type off_t = i32;
392 pub type dev_t = u64;
393 pub type ino_t = u32;
394 pub type pid_t = i32;
395 pub type uid_t = u32;
396 pub type gid_t = u32;
397 pub type useconds_t = u32;
398 pub type mode_t = u32;
399 pub type ssize_t = i32;
401 #[cfg(target_arch = "arm")]
403 pub type off_t = i32;
404 pub type dev_t = u32;
405 pub type ino_t = u32;
406 pub type pid_t = i32;
407 pub type uid_t = u32;
408 pub type gid_t = u32;
409 pub type useconds_t = u32;
410 pub type mode_t = u16;
411 pub type ssize_t = i32;
413 #[cfg(any(target_arch = "x86",
414 target_arch = "le32",
415 target_arch = "powerpc"))]
417 use types::os::arch::c95::{c_short, c_long, time_t};
418 use types::os::arch::posix88::{dev_t, gid_t, ino_t};
419 use types::os::arch::posix88::{mode_t, off_t};
420 use types::os::arch::posix88::{uid_t};
422 pub type nlink_t = u32;
423 pub type blksize_t = i32;
424 pub type blkcnt_t = i32;
427 #[derive(Copy)] pub struct stat {
432 pub st_nlink: nlink_t,
438 pub st_blksize: blksize_t,
439 pub st_blocks: blkcnt_t,
440 pub st_atime: time_t,
441 pub st_atime_nsec: c_long,
442 pub st_mtime: time_t,
443 pub st_mtime_nsec: c_long,
444 pub st_ctime: time_t,
445 pub st_ctime_nsec: c_long,
446 pub __unused4: c_long,
447 pub __unused5: c_long,
451 #[derive(Copy)] pub struct utimbuf {
457 #[derive(Copy)] pub struct pthread_attr_t {
461 #[cfg(target_arch = "arm")]
463 use types::os::arch::c95::{c_uchar, c_uint, c_ulong, time_t};
464 use types::os::arch::c99::{c_longlong, c_ulonglong};
465 use types::os::arch::posix88::{uid_t, gid_t, ino_t};
467 pub type nlink_t = u16;
468 pub type blksize_t = u32;
469 pub type blkcnt_t = u32;
472 #[derive(Copy)] pub struct stat {
473 pub st_dev: c_ulonglong,
474 pub __pad0: [c_uchar; 4],
477 pub st_nlink: c_uint,
480 pub st_rdev: c_ulonglong,
481 pub __pad3: [c_uchar; 4],
482 pub st_size: c_longlong,
483 pub st_blksize: blksize_t,
484 pub st_blocks: c_ulonglong,
485 pub st_atime: time_t,
486 pub st_atime_nsec: c_ulong,
487 pub st_mtime: time_t,
488 pub st_mtime_nsec: c_ulong,
489 pub st_ctime: time_t,
490 pub st_ctime_nsec: c_ulong,
491 pub st_ino: c_ulonglong,
495 #[derive(Copy)] pub struct utimbuf {
501 #[derive(Copy)] pub struct pthread_attr_t {
505 #[cfg(any(target_arch = "mips",
506 target_arch = "mipsel"))]
508 use types::os::arch::c95::{c_long, c_ulong, time_t};
509 use types::os::arch::posix88::{gid_t, ino_t};
510 use types::os::arch::posix88::{mode_t, off_t};
511 use types::os::arch::posix88::{uid_t};
513 pub type nlink_t = u32;
514 pub type blksize_t = i32;
515 pub type blkcnt_t = i32;
518 #[derive(Copy)] pub struct stat {
520 pub st_pad1: [c_long; 3],
523 pub st_nlink: nlink_t,
526 pub st_rdev: c_ulong,
527 pub st_pad2: [c_long; 2],
530 pub st_atime: time_t,
531 pub st_atime_nsec: c_long,
532 pub st_mtime: time_t,
533 pub st_mtime_nsec: c_long,
534 pub st_ctime: time_t,
535 pub st_ctime_nsec: c_long,
536 pub st_blksize: blksize_t,
537 pub st_blocks: blkcnt_t,
538 pub st_pad5: [c_long; 14],
542 #[derive(Copy)] pub struct utimbuf {
548 #[derive(Copy)] pub struct pthread_attr_t {
555 use types::os::arch::c95::{c_ushort, c_int, c_uchar};
557 #[derive(Copy)] pub struct sockaddr_ll {
558 pub sll_family: c_ushort,
559 pub sll_protocol: c_ushort,
560 pub sll_ifindex: c_int,
561 pub sll_hatype: c_ushort,
562 pub sll_pkttype: c_uchar,
563 pub sll_halen: c_uchar,
564 pub sll_addr: [c_uchar; 8]
570 #[cfg(any(target_arch = "x86_64",
571 target_arch = "aarch64"))]
574 #[cfg(not(target_arch = "aarch64"))]
575 pub type c_char = i8;
576 #[cfg(target_arch = "aarch64")]
577 pub type c_char = u8;
578 pub type c_schar = i8;
579 pub type c_uchar = u8;
580 pub type c_short = i16;
581 pub type c_ushort = u16;
582 pub type c_int = i32;
583 pub type c_uint = u32;
584 pub type c_long = i64;
585 pub type c_ulong = u64;
586 pub type c_float = f32;
587 pub type c_double = f64;
588 pub type size_t = u64;
589 pub type ptrdiff_t = i64;
590 pub type clock_t = i64;
591 pub type time_t = i64;
592 pub type suseconds_t = i64;
593 #[cfg(not(target_arch = "aarch64"))]
594 pub type wchar_t = i32;
595 #[cfg(target_arch = "aarch64")]
596 pub type wchar_t = u32;
599 pub type c_longlong = i64;
600 pub type c_ulonglong = u64;
601 pub type intptr_t = i64;
602 pub type uintptr_t = u64;
603 pub type intmax_t = i64;
604 pub type uintmax_t = u64;
607 pub type off_t = i64;
608 pub type dev_t = u64;
609 pub type ino_t = u64;
610 pub type pid_t = i32;
611 pub type uid_t = u32;
612 pub type gid_t = u32;
613 pub type useconds_t = u32;
614 pub type mode_t = u32;
615 pub type ssize_t = i64;
617 #[cfg(not(target_arch = "aarch64"))]
619 use types::os::arch::c95::{c_int, c_long, time_t};
620 use types::os::arch::posix88::{dev_t, gid_t, ino_t};
621 use types::os::arch::posix88::{mode_t, off_t};
622 use types::os::arch::posix88::{uid_t};
624 pub type nlink_t = u64;
625 pub type blksize_t = i64;
626 pub type blkcnt_t = i64;
629 #[derive(Copy)] pub struct stat {
632 pub st_nlink: nlink_t,
639 pub st_blksize: blksize_t,
640 pub st_blocks: blkcnt_t,
641 pub st_atime: time_t,
642 pub st_atime_nsec: c_long,
643 pub st_mtime: time_t,
644 pub st_mtime_nsec: c_long,
645 pub st_ctime: time_t,
646 pub st_ctime_nsec: c_long,
647 pub __unused: [c_long; 3],
651 #[derive(Copy)] pub struct utimbuf {
657 #[derive(Copy)] pub struct pthread_attr_t {
661 #[cfg(target_arch = "aarch64")]
663 use types::os::arch::c95::{c_int, c_long, time_t};
664 use types::os::arch::posix88::{dev_t, gid_t, ino_t};
665 use types::os::arch::posix88::{mode_t, off_t};
666 use types::os::arch::posix88::{uid_t};
668 pub type nlink_t = u32;
669 pub type blksize_t = i32;
670 pub type blkcnt_t = i64;
673 #[derive(Copy)] pub struct stat {
677 pub st_nlink: nlink_t,
683 pub st_blksize: blksize_t,
685 pub st_blocks: blkcnt_t,
686 pub st_atime: time_t,
687 pub st_atime_nsec: c_long,
688 pub st_mtime: time_t,
689 pub st_mtime_nsec: c_long,
690 pub st_ctime: time_t,
691 pub st_ctime_nsec: c_long,
692 pub __unused: [c_int; 2],
696 #[derive(Copy)] pub struct utimbuf {
702 #[derive(Copy)] pub struct pthread_attr_t {
711 use types::os::arch::c95::{c_ushort, c_int, c_uchar};
712 #[derive(Copy)] pub struct sockaddr_ll {
713 pub sll_family: c_ushort,
714 pub sll_protocol: c_ushort,
715 pub sll_ifindex: c_int,
716 pub sll_hatype: c_ushort,
717 pub sll_pkttype: c_uchar,
718 pub sll_halen: c_uchar,
719 pub sll_addr: [c_uchar; 8]
726 #[cfg(target_os = "freebsd")]
730 use types::common::c95::{c_void};
731 use types::os::arch::c95::{c_char, c_int, size_t,
732 time_t, suseconds_t, c_long};
733 use types::os::arch::c99::{uintptr_t};
735 pub type pthread_t = uintptr_t;
738 #[derive(Copy)] pub struct glob_t {
739 pub gl_pathc: size_t,
740 pub __unused1: size_t,
742 pub __unused2: c_int,
743 pub gl_pathv: *mut *mut c_char,
745 pub __unused3: *mut c_void,
747 pub __unused4: *mut c_void,
748 pub __unused5: *mut c_void,
749 pub __unused6: *mut c_void,
750 pub __unused7: *mut c_void,
751 pub __unused8: *mut c_void,
755 #[derive(Copy)] pub struct timeval {
757 pub tv_usec: suseconds_t,
761 #[derive(Copy)] pub struct timespec {
766 #[derive(Copy)] pub enum timezone {}
768 pub type sighandler_t = size_t;
771 use types::common::c95::{c_void};
772 use types::os::arch::c95::{c_char, c_int, c_uint};
774 pub type socklen_t = u32;
775 pub type sa_family_t = u8;
776 pub type in_port_t = u16;
777 pub type in_addr_t = u32;
779 #[derive(Copy)] pub struct sockaddr {
781 pub sa_family: sa_family_t,
782 pub sa_data: [u8; 14],
785 #[derive(Copy)] pub struct sockaddr_storage {
787 pub ss_family: sa_family_t,
788 pub __ss_pad1: [u8; 6],
790 pub __ss_pad2: [u8; 112],
793 #[derive(Copy)] pub struct sockaddr_in {
795 pub sin_family: sa_family_t,
796 pub sin_port: in_port_t,
797 pub sin_addr: in_addr,
798 pub sin_zero: [u8; 8],
801 #[derive(Copy)] pub struct in_addr {
802 pub s_addr: in_addr_t,
805 #[derive(Copy)] pub struct sockaddr_in6 {
807 pub sin6_family: sa_family_t,
808 pub sin6_port: in_port_t,
809 pub sin6_flowinfo: u32,
810 pub sin6_addr: in6_addr,
811 pub sin6_scope_id: u32,
814 #[derive(Copy)] pub struct in6_addr {
815 pub s6_addr: [u16; 8]
818 #[derive(Copy)] pub struct ip_mreq {
819 pub imr_multiaddr: in_addr,
820 pub imr_interface: in_addr,
823 #[derive(Copy)] pub struct ip6_mreq {
824 pub ipv6mr_multiaddr: in6_addr,
825 pub ipv6mr_interface: c_uint,
828 #[derive(Copy)] pub struct addrinfo {
830 pub ai_family: c_int,
831 pub ai_socktype: c_int,
832 pub ai_protocol: c_int,
833 pub ai_addrlen: socklen_t,
834 pub ai_canonname: *mut c_char,
835 pub ai_addr: *mut sockaddr,
836 pub ai_next: *mut addrinfo,
839 #[derive(Copy)] pub struct sockaddr_un {
841 pub sun_family: sa_family_t,
842 pub sun_path: [c_char; 104]
845 #[derive(Copy)] pub struct ifaddrs {
846 pub ifa_next: *mut ifaddrs,
847 pub ifa_name: *mut c_char,
848 pub ifa_flags: c_uint,
849 pub ifa_addr: *mut sockaddr,
850 pub ifa_netmask: *mut sockaddr,
851 pub ifa_dstaddr: *mut sockaddr,
852 pub ifa_data: *mut c_void
859 #[cfg(target_arch = "x86_64")]
862 pub type c_char = i8;
863 pub type c_schar = i8;
864 pub type c_uchar = u8;
865 pub type c_short = i16;
866 pub type c_ushort = u16;
867 pub type c_int = i32;
868 pub type c_uint = u32;
869 pub type c_long = i64;
870 pub type c_ulong = u64;
871 pub type c_float = f32;
872 pub type c_double = f64;
873 pub type size_t = u64;
874 pub type ptrdiff_t = i64;
875 pub type clock_t = i32;
876 pub type time_t = i64;
877 pub type suseconds_t = i64;
878 pub type wchar_t = i32;
881 pub type c_longlong = i64;
882 pub type c_ulonglong = u64;
883 pub type intptr_t = i64;
884 pub type uintptr_t = u64;
885 pub type intmax_t = i64;
886 pub type uintmax_t = u64;
889 pub type off_t = i64;
890 pub type dev_t = u32;
891 pub type ino_t = u32;
892 pub type pid_t = i32;
893 pub type uid_t = u32;
894 pub type gid_t = u32;
895 pub type useconds_t = u32;
896 pub type mode_t = u16;
897 pub type ssize_t = i64;
900 use types::common::c95::{c_void};
901 use types::common::c99::{uint8_t, uint32_t, int32_t};
902 use types::os::arch::c95::{c_long, time_t};
903 use types::os::arch::posix88::{dev_t, gid_t, ino_t};
904 use types::os::arch::posix88::{mode_t, off_t};
905 use types::os::arch::posix88::{uid_t};
907 pub type nlink_t = u16;
908 pub type blksize_t = i64;
909 pub type blkcnt_t = i64;
910 pub type fflags_t = u32;
912 #[derive(Copy)] pub struct stat {
916 pub st_nlink: nlink_t,
920 pub st_atime: time_t,
921 pub st_atime_nsec: c_long,
922 pub st_mtime: time_t,
923 pub st_mtime_nsec: c_long,
924 pub st_ctime: time_t,
925 pub st_ctime_nsec: c_long,
927 pub st_blocks: blkcnt_t,
928 pub st_blksize: blksize_t,
929 pub st_flags: fflags_t,
930 pub st_gen: uint32_t,
931 pub st_lspare: int32_t,
932 pub st_birthtime: time_t,
933 pub st_birthtime_nsec: c_long,
934 pub __unused: [uint8_t; 2],
938 #[derive(Copy)] pub struct utimbuf {
943 pub type pthread_attr_t = *mut c_void;
954 #[cfg(target_os = "dragonfly")]
958 use types::common::c95::{c_void};
959 use types::os::arch::c95::{c_char, c_int, size_t,
960 time_t, suseconds_t, c_long};
961 use types::os::arch::c99::{uintptr_t};
963 pub type pthread_t = uintptr_t;
966 #[derive(Copy)] pub struct glob_t {
967 pub gl_pathc: size_t,
968 pub __unused1: size_t,
970 pub __unused2: c_int,
971 pub gl_pathv: *mut *mut c_char,
973 pub __unused3: *mut c_void,
975 pub __unused4: *mut c_void,
976 pub __unused5: *mut c_void,
977 pub __unused6: *mut c_void,
978 pub __unused7: *mut c_void,
979 pub __unused8: *mut c_void,
983 #[derive(Copy)] pub struct timeval {
985 pub tv_usec: suseconds_t,
989 #[derive(Copy)] pub struct timespec {
994 #[derive(Copy)] pub enum timezone {}
996 pub type sighandler_t = size_t;
999 use types::common::c95::{c_void};
1000 use types::os::arch::c95::{c_char, c_int, c_uint};
1002 pub type socklen_t = u32;
1003 pub type sa_family_t = u8;
1004 pub type in_port_t = u16;
1005 pub type in_addr_t = u32;
1007 #[derive(Copy)] pub struct sockaddr {
1009 pub sa_family: sa_family_t,
1010 pub sa_data: [u8; 14],
1013 #[derive(Copy)] pub struct sockaddr_storage {
1015 pub ss_family: sa_family_t,
1016 pub __ss_pad1: [u8; 6],
1017 pub __ss_align: i64,
1018 pub __ss_pad2: [u8; 112],
1021 #[derive(Copy)] pub struct sockaddr_in {
1023 pub sin_family: sa_family_t,
1024 pub sin_port: in_port_t,
1025 pub sin_addr: in_addr,
1026 pub sin_zero: [u8; 8],
1029 #[derive(Copy)] pub struct in_addr {
1030 pub s_addr: in_addr_t,
1033 #[derive(Copy)] pub struct sockaddr_in6 {
1035 pub sin6_family: sa_family_t,
1036 pub sin6_port: in_port_t,
1037 pub sin6_flowinfo: u32,
1038 pub sin6_addr: in6_addr,
1039 pub sin6_scope_id: u32,
1042 #[derive(Copy)] pub struct in6_addr {
1043 pub s6_addr: [u16; 8]
1046 #[derive(Copy)] pub struct ip_mreq {
1047 pub imr_multiaddr: in_addr,
1048 pub imr_interface: in_addr,
1051 #[derive(Copy)] pub struct ip6_mreq {
1052 pub ipv6mr_multiaddr: in6_addr,
1053 pub ipv6mr_interface: c_uint,
1056 #[derive(Copy)] pub struct addrinfo {
1057 pub ai_flags: c_int,
1058 pub ai_family: c_int,
1059 pub ai_socktype: c_int,
1060 pub ai_protocol: c_int,
1061 pub ai_addrlen: socklen_t,
1062 pub ai_canonname: *mut c_char,
1063 pub ai_addr: *mut sockaddr,
1064 pub ai_next: *mut addrinfo,
1067 #[derive(Copy)] pub struct sockaddr_un {
1069 pub sun_family: sa_family_t,
1070 pub sun_path: [c_char; 104]
1073 #[derive(Copy)] pub struct ifaddrs {
1074 pub ifa_next: *mut ifaddrs,
1075 pub ifa_name: *mut c_char,
1076 pub ifa_flags: c_uint,
1077 pub ifa_addr: *mut sockaddr,
1078 pub ifa_netmask: *mut sockaddr,
1079 pub ifa_dstaddr: *mut sockaddr,
1080 pub ifa_data: *mut c_void
1086 #[cfg(target_arch = "x86_64")]
1089 pub type c_char = i8;
1090 pub type c_schar = i8;
1091 pub type c_uchar = u8;
1092 pub type c_short = i16;
1093 pub type c_ushort = u16;
1094 pub type c_int = i32;
1095 pub type c_uint = u32;
1096 pub type c_long = i64;
1097 pub type c_ulong = u64;
1098 pub type c_float = f32;
1099 pub type c_double = f64;
1100 pub type size_t = u64;
1101 pub type ptrdiff_t = i64;
1102 pub type clock_t = i32;
1103 pub type time_t = i64;
1104 pub type suseconds_t = i64;
1105 pub type wchar_t = i32;
1108 pub type c_longlong = i64;
1109 pub type c_ulonglong = u64;
1110 pub type intptr_t = i64;
1111 pub type uintptr_t = u64;
1112 pub type intmax_t = i64;
1113 pub type uintmax_t = u64;
1116 pub type off_t = i64;
1117 pub type dev_t = u32;
1118 pub type pid_t = i32;
1119 pub type uid_t = u32;
1120 pub type gid_t = u32;
1121 pub type useconds_t = u32;
1122 pub type mode_t = u16;
1123 pub type ssize_t = i64;
1126 use types::common::c95::{c_void};
1127 use types::common::c99::{uint16_t, uint32_t, int32_t, uint64_t, int64_t};
1128 use types::os::arch::c95::{c_long, time_t};
1129 use types::os::arch::posix88::{dev_t, gid_t};
1130 use types::os::arch::posix88::{mode_t, off_t};
1131 use types::os::arch::posix88::{uid_t};
1133 pub type nlink_t = u16;
1134 pub type blksize_t = uint32_t;
1135 pub type ino_t = uint64_t;
1136 pub type blkcnt_t = i64;
1137 pub type fflags_t = u32;
1140 #[derive(Copy)] pub struct stat {
1142 pub st_nlink: nlink_t,
1144 pub st_mode: mode_t,
1145 pub st_padding1: uint16_t,
1149 pub st_atime: time_t,
1150 pub st_atime_nsec: c_long,
1151 pub st_mtime: time_t,
1152 pub st_mtime_nsec: c_long,
1153 pub st_ctime: time_t,
1154 pub st_ctime_nsec: c_long,
1156 pub st_blocks: blkcnt_t,
1157 pub st_blksize: blksize_t,
1158 pub st_flags: fflags_t,
1159 pub st_gen: uint32_t,
1160 pub st_lspare: int32_t,
1161 pub st_qspare1: int64_t,
1162 pub st_qspare2: int64_t,
1165 #[derive(Copy)] pub struct utimbuf {
1167 pub modtime: time_t,
1170 pub type pthread_attr_t = *mut c_void;
1181 #[cfg(any(target_os = "bitrig", target_os = "openbsd"))]
1185 use types::common::c95::{c_void};
1186 use types::os::arch::c95::{c_char, c_int, size_t,
1187 time_t, suseconds_t, c_long};
1188 use types::os::arch::c99::{uintptr_t};
1190 pub type pthread_t = uintptr_t;
1192 #[cfg(target_os = "bitrig")]
1194 #[derive(Copy)] pub struct glob_t {
1195 pub gl_pathc: c_int,
1196 pub gl_matchc: c_int,
1198 pub gl_flags: c_int,
1199 pub gl_pathv: *mut *mut c_char,
1200 pub __unused1: *mut c_void,
1201 pub __unused2: *mut c_void,
1202 pub __unused3: *mut c_void,
1203 pub __unused4: *mut c_void,
1204 pub __unused5: *mut c_void,
1205 pub __unused6: *mut c_void,
1206 pub __unused7: *mut c_void,
1209 #[cfg(target_os = "openbsd")]
1211 #[derive(Copy)] pub struct glob_t {
1212 pub gl_pathc: c_int,
1213 pub __unused1: c_int,
1215 pub __unused2: c_int,
1216 pub gl_pathv: *mut *mut c_char,
1218 pub __unused3: *mut c_void,
1220 pub __unused4: *mut c_void,
1221 pub __unused5: *mut c_void,
1222 pub __unused6: *mut c_void,
1223 pub __unused7: *mut c_void,
1224 pub __unused8: *mut c_void,
1225 pub __unused9: *mut c_void,
1229 #[derive(Copy)] pub struct timeval {
1231 pub tv_usec: suseconds_t,
1235 #[derive(Copy)] pub struct timespec {
1237 pub tv_nsec: c_long,
1240 #[derive(Copy)] pub enum timezone {}
1242 pub type sighandler_t = size_t;
1245 use types::common::c95::{c_void};
1246 use types::os::arch::c95::{c_char, c_int, c_uint};
1248 pub type socklen_t = u32;
1249 pub type sa_family_t = u8;
1250 pub type in_port_t = u16;
1251 pub type in_addr_t = u32;
1253 #[derive(Copy)] pub struct sockaddr {
1255 pub sa_family: sa_family_t,
1256 pub sa_data: [u8; 14],
1259 #[derive(Copy)] pub struct sockaddr_storage {
1261 pub ss_family: sa_family_t,
1262 pub __ss_pad1: [u8; 6],
1264 pub __ss_pad3: [u8; 240],
1267 #[derive(Copy)] pub struct sockaddr_in {
1269 pub sin_family: sa_family_t,
1270 pub sin_port: in_port_t,
1271 pub sin_addr: in_addr,
1272 pub sin_zero: [u8; 8],
1275 #[derive(Copy)] pub struct in_addr {
1276 pub s_addr: in_addr_t,
1279 #[derive(Copy)] pub struct sockaddr_in6 {
1281 pub sin6_family: sa_family_t,
1282 pub sin6_port: in_port_t,
1283 pub sin6_flowinfo: u32,
1284 pub sin6_addr: in6_addr,
1285 pub sin6_scope_id: u32,
1288 #[derive(Copy)] pub struct in6_addr {
1289 pub s6_addr: [u16; 8]
1292 #[derive(Copy)] pub struct ip_mreq {
1293 pub imr_multiaddr: in_addr,
1294 pub imr_interface: in_addr,
1297 #[derive(Copy)] pub struct ip6_mreq {
1298 pub ipv6mr_multiaddr: in6_addr,
1299 pub ipv6mr_interface: c_uint,
1302 #[derive(Copy)] pub struct addrinfo {
1303 pub ai_flags: c_int,
1304 pub ai_family: c_int,
1305 pub ai_socktype: c_int,
1306 pub ai_protocol: c_int,
1307 pub ai_addrlen: socklen_t,
1308 pub ai_addr: *mut sockaddr,
1309 pub ai_canonname: *mut c_char,
1310 pub ai_next: *mut addrinfo,
1313 #[derive(Copy)] pub struct sockaddr_un {
1315 pub sun_family: sa_family_t,
1316 pub sun_path: [c_char; 104]
1319 #[derive(Copy)] pub struct ifaddrs {
1320 pub ifa_next: *mut ifaddrs,
1321 pub ifa_name: *mut c_char,
1322 pub ifa_flags: c_uint,
1323 pub ifa_addr: *mut sockaddr,
1324 pub ifa_netmask: *mut sockaddr,
1325 pub ifa_dstaddr: *mut sockaddr,
1326 pub ifa_data: *mut c_void
1331 #[cfg(target_arch = "x86_64")]
1334 pub type c_char = i8;
1335 pub type c_schar = i8;
1336 pub type c_uchar = u8;
1337 pub type c_short = i16;
1338 pub type c_ushort = u16;
1339 pub type c_int = i32;
1340 pub type c_uint = u32;
1341 pub type c_long = i64;
1342 pub type c_ulong = u64;
1343 pub type c_float = f32;
1344 pub type c_double = f64;
1345 pub type size_t = u64;
1346 pub type ptrdiff_t = i64;
1347 pub type clock_t = i64;
1348 pub type time_t = i64;
1349 pub type suseconds_t = i64;
1350 pub type wchar_t = i32;
1353 pub type c_longlong = i64;
1354 pub type c_ulonglong = u64;
1355 pub type intptr_t = i64;
1356 pub type uintptr_t = u64;
1357 pub type intmax_t = i64;
1358 pub type uintmax_t = u64;
1361 use types::os::arch::c95::{c_long};
1362 pub type off_t = i64;
1363 pub type dev_t = i32;
1364 pub type pid_t = i32;
1365 pub type uid_t = u32;
1366 pub type gid_t = u32;
1367 pub type useconds_t = u32;
1368 pub type mode_t = u32;
1369 pub type ssize_t = c_long;
1372 use types::common::c95::{c_void};
1373 use types::common::c99::{uint32_t, uint64_t};
1374 use types::os::arch::c95::{c_long, time_t};
1375 use types::os::arch::posix88::{dev_t, gid_t};
1376 use types::os::arch::posix88::{mode_t, off_t};
1377 use types::os::arch::posix88::{uid_t};
1379 pub type nlink_t = uint32_t;
1380 pub type blksize_t = uint32_t;
1381 pub type ino_t = uint64_t;
1382 pub type blkcnt_t = i64;
1383 pub type fflags_t = u32; // type not declared, but struct stat have u_int32_t
1386 #[derive(Copy)] pub struct stat {
1387 pub st_mode: mode_t,
1390 pub st_nlink: nlink_t,
1394 pub st_atime: time_t,
1395 pub st_atime_nsec: c_long,
1396 pub st_mtime: time_t,
1397 pub st_mtime_nsec: c_long,
1398 pub st_ctime: time_t,
1399 pub st_ctime_nsec: c_long,
1401 pub st_blocks: blkcnt_t,
1402 pub st_blksize: blksize_t,
1403 pub st_flags: fflags_t,
1404 pub st_gen: uint32_t,
1405 pub st_birthtime: time_t,
1406 pub st_birthtime_nsec: c_long,
1409 #[derive(Copy)] pub struct utimbuf {
1411 pub modtime: time_t,
1414 pub type pthread_attr_t = *mut c_void;
1425 #[cfg(target_os = "windows")]
1429 use types::os::arch::c95::{c_short, time_t, c_long};
1430 use types::os::arch::extra::{int64, time64_t};
1431 use types::os::arch::posix88::{dev_t, ino_t};
1433 // pub Note: this is the struct called stat64 in Windows. Not stat,
1436 #[derive(Copy)] pub struct stat {
1440 pub st_nlink: c_short,
1441 pub st_uid: c_short,
1442 pub st_gid: c_short,
1445 pub st_atime: time64_t,
1446 pub st_mtime: time64_t,
1447 pub st_ctime: time64_t,
1450 // note that this is called utimbuf64 in Windows
1452 #[derive(Copy)] pub struct utimbuf {
1453 pub actime: time64_t,
1454 pub modtime: time64_t,
1458 #[derive(Copy)] pub struct timeval {
1460 pub tv_usec: c_long,
1464 #[derive(Copy)] pub struct timespec {
1466 pub tv_nsec: c_long,
1469 #[derive(Copy)] pub enum timezone {}
1473 use types::os::arch::c95::{c_char, c_int, c_uint, size_t};
1474 use types::os::arch::c99::uintptr_t;
1476 pub type SOCKET = uintptr_t;
1477 pub type socklen_t = c_int;
1478 pub type sa_family_t = u16;
1479 pub type in_port_t = u16;
1480 pub type in_addr_t = u32;
1482 #[derive(Copy)] pub struct sockaddr {
1483 pub sa_family: sa_family_t,
1484 pub sa_data: [u8; 14],
1487 #[derive(Copy)] pub struct sockaddr_storage {
1488 pub ss_family: sa_family_t,
1489 pub __ss_pad1: [u8; 6],
1490 pub __ss_align: i64,
1491 pub __ss_pad2: [u8; 112],
1494 #[derive(Copy)] pub struct sockaddr_in {
1495 pub sin_family: sa_family_t,
1496 pub sin_port: in_port_t,
1497 pub sin_addr: in_addr,
1498 pub sin_zero: [u8; 8],
1501 #[derive(Copy)] pub struct in_addr {
1502 pub s_addr: in_addr_t,
1505 #[derive(Copy)] pub struct sockaddr_in6 {
1506 pub sin6_family: sa_family_t,
1507 pub sin6_port: in_port_t,
1508 pub sin6_flowinfo: u32,
1509 pub sin6_addr: in6_addr,
1510 pub sin6_scope_id: u32,
1513 #[derive(Copy)] pub struct in6_addr {
1514 pub s6_addr: [u16; 8]
1517 #[derive(Copy)] pub struct ip_mreq {
1518 pub imr_multiaddr: in_addr,
1519 pub imr_interface: in_addr,
1522 #[derive(Copy)] pub struct ip6_mreq {
1523 pub ipv6mr_multiaddr: in6_addr,
1524 pub ipv6mr_interface: c_uint,
1527 #[derive(Copy)] pub struct addrinfo {
1528 pub ai_flags: c_int,
1529 pub ai_family: c_int,
1530 pub ai_socktype: c_int,
1531 pub ai_protocol: c_int,
1532 pub ai_addrlen: size_t,
1533 pub ai_canonname: *mut c_char,
1534 pub ai_addr: *mut sockaddr,
1535 pub ai_next: *mut addrinfo,
1538 #[derive(Copy)] pub struct sockaddr_un {
1539 pub sun_family: sa_family_t,
1540 pub sun_path: [c_char; 108]
1547 pub type c_char = i8;
1548 pub type c_schar = i8;
1549 pub type c_uchar = u8;
1550 pub type c_short = i16;
1551 pub type c_ushort = u16;
1552 pub type c_int = i32;
1553 pub type c_uint = u32;
1554 pub type c_long = i32;
1555 pub type c_ulong = u32;
1556 pub type c_float = f32;
1557 pub type c_double = f64;
1559 #[cfg(target_arch = "x86")]
1560 pub type size_t = u32;
1561 #[cfg(target_arch = "x86_64")]
1562 pub type size_t = u64;
1564 #[cfg(target_arch = "x86")]
1565 pub type ptrdiff_t = i32;
1566 #[cfg(target_arch = "x86_64")]
1567 pub type ptrdiff_t = i64;
1569 pub type clock_t = i32;
1571 #[cfg(target_arch = "x86")]
1572 pub type time_t = i32;
1573 #[cfg(target_arch = "x86_64")]
1574 pub type time_t = i64;
1576 #[cfg(target_arch = "x86")]
1577 pub type suseconds_t = i32;
1578 #[cfg(target_arch = "x86_64")]
1579 pub type suseconds_t = i64;
1581 pub type wchar_t = u16;
1585 pub type c_longlong = i64;
1586 pub type c_ulonglong = u64;
1588 #[cfg(target_arch = "x86")]
1589 pub type intptr_t = i32;
1590 #[cfg(target_arch = "x86_64")]
1591 pub type intptr_t = i64;
1593 #[cfg(target_arch = "x86")]
1594 pub type uintptr_t = u32;
1595 #[cfg(target_arch = "x86_64")]
1596 pub type uintptr_t = u64;
1598 pub type intmax_t = i64;
1599 pub type uintmax_t = u64;
1603 pub type off_t = i32;
1604 pub type dev_t = u32;
1605 pub type ino_t = u16;
1607 pub type pid_t = u32;
1609 pub type useconds_t = u32;
1610 pub type mode_t = u16;
1612 #[cfg(target_arch = "x86")]
1613 pub type ssize_t = i32;
1614 #[cfg(target_arch = "x86_64")]
1615 pub type ssize_t = i64;
1625 use consts::os::extra::{MAX_PROTOCOL_CHAIN,
1627 use types::common::c95::c_void;
1628 use types::os::arch::c95::{c_char, c_int, c_uint, size_t};
1629 use types::os::arch::c95::{c_long, c_ulong};
1630 use types::os::arch::c95::{wchar_t};
1631 use types::os::arch::c99::{c_ulonglong, c_longlong, uintptr_t};
1633 pub type BOOL = c_int;
1635 pub type BOOLEAN = BYTE;
1636 pub type CCHAR = c_char;
1637 pub type CHAR = c_char;
1639 pub type DWORD = c_ulong;
1640 pub type DWORDLONG = c_ulonglong;
1642 pub type HANDLE = LPVOID;
1643 pub type HINSTANCE = HANDLE;
1644 pub type HMODULE = HINSTANCE;
1646 pub type LONG = c_long;
1647 pub type PLONG = *mut c_long;
1649 #[cfg(target_arch = "x86")]
1650 pub type LONG_PTR = c_long;
1651 #[cfg(target_arch = "x86_64")]
1652 pub type LONG_PTR = i64;
1654 pub type LARGE_INTEGER = c_longlong;
1655 pub type PLARGE_INTEGER = *mut c_longlong;
1657 pub type LPCWSTR = *const WCHAR;
1658 pub type LPCSTR = *const CHAR;
1660 pub type LPWSTR = *mut WCHAR;
1661 pub type LPSTR = *mut CHAR;
1663 pub type LPWCH = *mut WCHAR;
1664 pub type LPCH = *mut CHAR;
1667 #[derive(Copy)] pub struct SECURITY_ATTRIBUTES {
1669 pub lpSecurityDescriptor: LPVOID,
1670 pub bInheritHandle: BOOL,
1672 pub type LPSECURITY_ATTRIBUTES = *mut SECURITY_ATTRIBUTES;
1674 pub type LPVOID = *mut c_void;
1675 pub type LPCVOID = *const c_void;
1676 pub type LPBYTE = *mut BYTE;
1677 pub type LPWORD = *mut WORD;
1678 pub type LPDWORD = *mut DWORD;
1679 pub type LPHANDLE = *mut HANDLE;
1681 pub type LRESULT = LONG_PTR;
1682 pub type PBOOL = *mut BOOL;
1683 pub type WCHAR = wchar_t;
1684 pub type WORD = u16;
1685 pub type SIZE_T = size_t;
1687 pub type time64_t = i64;
1688 pub type int64 = i64;
1691 #[derive(Copy)] pub struct STARTUPINFO {
1693 pub lpReserved: LPWSTR,
1694 pub lpDesktop: LPWSTR,
1695 pub lpTitle: LPWSTR,
1700 pub dwXCountChars: DWORD,
1701 pub dwYCountCharts: DWORD,
1702 pub dwFillAttribute: DWORD,
1704 pub wShowWindow: WORD,
1705 pub cbReserved2: WORD,
1706 pub lpReserved2: LPBYTE,
1707 pub hStdInput: HANDLE,
1708 pub hStdOutput: HANDLE,
1709 pub hStdError: HANDLE,
1711 pub type LPSTARTUPINFO = *mut STARTUPINFO;
1714 #[derive(Copy)] pub struct PROCESS_INFORMATION {
1715 pub hProcess: HANDLE,
1716 pub hThread: HANDLE,
1717 pub dwProcessId: DWORD,
1718 pub dwThreadId: DWORD,
1720 pub type LPPROCESS_INFORMATION = *mut PROCESS_INFORMATION;
1723 #[derive(Copy)] pub struct SYSTEM_INFO {
1724 pub wProcessorArchitecture: WORD,
1725 pub wReserved: WORD,
1726 pub dwPageSize: DWORD,
1727 pub lpMinimumApplicationAddress: LPVOID,
1728 pub lpMaximumApplicationAddress: LPVOID,
1729 pub dwActiveProcessorMask: uintptr_t,
1730 pub dwNumberOfProcessors: DWORD,
1731 pub dwProcessorType: DWORD,
1732 pub dwAllocationGranularity: DWORD,
1733 pub wProcessorLevel: WORD,
1734 pub wProcessorRevision: WORD,
1736 pub type LPSYSTEM_INFO = *mut SYSTEM_INFO;
1739 #[derive(Copy)] pub struct MEMORY_BASIC_INFORMATION {
1740 pub BaseAddress: LPVOID,
1741 pub AllocationBase: LPVOID,
1742 pub AllocationProtect: DWORD,
1743 pub RegionSize: SIZE_T,
1748 pub type LPMEMORY_BASIC_INFORMATION = *mut MEMORY_BASIC_INFORMATION;
1751 #[derive(Copy)] pub struct OVERLAPPED {
1752 pub Internal: *mut c_ulong,
1753 pub InternalHigh: *mut c_ulong,
1755 pub OffsetHigh: DWORD,
1759 pub type LPOVERLAPPED = *mut OVERLAPPED;
1762 #[derive(Copy)] pub struct FILETIME {
1763 pub dwLowDateTime: DWORD,
1764 pub dwHighDateTime: DWORD,
1767 pub type LPFILETIME = *mut FILETIME;
1770 #[derive(Copy)] pub struct GUID {
1774 pub Data4: [BYTE; 8],
1778 #[derive(Copy)] pub struct WSAPROTOCOLCHAIN {
1779 pub ChainLen: c_int,
1780 pub ChainEntries: [DWORD; MAX_PROTOCOL_CHAIN as usize],
1783 pub type LPWSAPROTOCOLCHAIN = *mut WSAPROTOCOLCHAIN;
1786 #[derive(Copy)] pub struct WSAPROTOCOL_INFO {
1787 pub dwServiceFlags1: DWORD,
1788 pub dwServiceFlags2: DWORD,
1789 pub dwServiceFlags3: DWORD,
1790 pub dwServiceFlags4: DWORD,
1791 pub dwProviderFlags: DWORD,
1792 pub ProviderId: GUID,
1793 pub dwCatalogEntryId: DWORD,
1794 pub ProtocolChain: WSAPROTOCOLCHAIN,
1795 pub iVersion: c_int,
1796 pub iAddressFamily: c_int,
1797 pub iMaxSockAddr: c_int,
1798 pub iMinSockAddr: c_int,
1799 pub iSocketType: c_int,
1800 pub iProtocol: c_int,
1801 pub iProtocolMaxOffset: c_int,
1802 pub iNetworkByteOrder: c_int,
1803 pub iSecurityScheme: c_int,
1804 pub dwMessageSize: DWORD,
1805 pub dwProviderReserved: DWORD,
1806 pub szProtocol: [u8; WSAPROTOCOL_LEN as usize + 1],
1809 pub type LPWSAPROTOCOL_INFO = *mut WSAPROTOCOL_INFO;
1811 pub type GROUP = c_uint;
1814 #[derive(Copy)] pub struct WIN32_FIND_DATAW {
1815 pub dwFileAttributes: DWORD,
1816 pub ftCreationTime: FILETIME,
1817 pub ftLastAccessTime: FILETIME,
1818 pub ftLastWriteTime: FILETIME,
1819 pub nFileSizeHigh: DWORD,
1820 pub nFileSizeLow: DWORD,
1821 pub dwReserved0: DWORD,
1822 pub dwReserved1: DWORD,
1823 pub cFileName: [wchar_t; 260], // #define MAX_PATH 260
1824 pub cAlternateFileName: [wchar_t; 14],
1827 pub type LPWIN32_FIND_DATAW = *mut WIN32_FIND_DATAW;
1832 #[cfg(any(target_os = "macos", target_os = "ios"))]
1836 use types::common::c95::c_void;
1837 use types::os::arch::c95::{c_char, c_int, size_t, time_t};
1838 use types::os::arch::c95::{suseconds_t, c_long};
1839 use types::os::arch::c99::{uintptr_t};
1841 pub type pthread_t = uintptr_t;
1844 #[derive(Copy)] pub struct glob_t {
1845 pub gl_pathc: size_t,
1846 pub __unused1: c_int,
1847 pub gl_offs: size_t,
1848 pub __unused2: c_int,
1849 pub gl_pathv: *mut *mut c_char,
1851 pub __unused3: *mut c_void,
1853 pub __unused4: *mut c_void,
1854 pub __unused5: *mut c_void,
1855 pub __unused6: *mut c_void,
1856 pub __unused7: *mut c_void,
1857 pub __unused8: *mut c_void,
1861 #[derive(Copy)] pub struct timeval {
1863 pub tv_usec: suseconds_t,
1867 #[derive(Copy)] pub struct timespec {
1869 pub tv_nsec: c_long,
1872 #[derive(Copy)] pub enum timezone {}
1874 pub type sighandler_t = size_t;
1878 use types::common::c95::{c_void};
1879 use types::os::arch::c95::{c_char, c_int, c_uint};
1881 pub type socklen_t = u32;
1882 pub type sa_family_t = u8;
1883 pub type in_port_t = u16;
1884 pub type in_addr_t = u32;
1886 #[derive(Copy)] pub struct sockaddr {
1888 pub sa_family: sa_family_t,
1889 pub sa_data: [u8; 14],
1893 #[derive(Copy)] pub struct sockaddr_storage {
1895 pub ss_family: sa_family_t,
1896 pub __ss_pad1: [u8; 6],
1897 pub __ss_align: i64,
1898 pub __ss_pad2: [u8; 112],
1902 #[derive(Copy)] pub struct sockaddr_in {
1904 pub sin_family: sa_family_t,
1905 pub sin_port: in_port_t,
1906 pub sin_addr: in_addr,
1907 pub sin_zero: [u8; 8],
1911 #[derive(Copy)] pub struct in_addr {
1912 pub s_addr: in_addr_t,
1916 #[derive(Copy)] pub struct sockaddr_in6 {
1918 pub sin6_family: sa_family_t,
1919 pub sin6_port: in_port_t,
1920 pub sin6_flowinfo: u32,
1921 pub sin6_addr: in6_addr,
1922 pub sin6_scope_id: u32,
1926 #[derive(Copy)] pub struct in6_addr {
1927 pub s6_addr: [u16; 8]
1931 #[derive(Copy)] pub struct ip_mreq {
1932 pub imr_multiaddr: in_addr,
1933 pub imr_interface: in_addr,
1937 #[derive(Copy)] pub struct ip6_mreq {
1938 pub ipv6mr_multiaddr: in6_addr,
1939 pub ipv6mr_interface: c_uint,
1943 #[derive(Copy)] pub struct addrinfo {
1944 pub ai_flags: c_int,
1945 pub ai_family: c_int,
1946 pub ai_socktype: c_int,
1947 pub ai_protocol: c_int,
1948 pub ai_addrlen: socklen_t,
1949 pub ai_canonname: *mut c_char,
1950 pub ai_addr: *mut sockaddr,
1951 pub ai_next: *mut addrinfo,
1955 #[derive(Copy)] pub struct sockaddr_un {
1957 pub sun_family: sa_family_t,
1958 pub sun_path: [c_char; 104]
1962 #[derive(Copy)] pub struct ifaddrs {
1963 pub ifa_next: *mut ifaddrs,
1964 pub ifa_name: *mut c_char,
1965 pub ifa_flags: c_uint,
1966 pub ifa_addr: *mut sockaddr,
1967 pub ifa_netmask: *mut sockaddr,
1968 pub ifa_dstaddr: *mut sockaddr,
1969 pub ifa_data: *mut c_void
1974 #[cfg(any(target_arch = "arm", target_arch = "x86"))]
1977 pub type c_char = i8;
1978 pub type c_schar = i8;
1979 pub type c_uchar = u8;
1980 pub type c_short = i16;
1981 pub type c_ushort = u16;
1982 pub type c_int = i32;
1983 pub type c_uint = u32;
1984 pub type c_long = i32;
1985 pub type c_ulong = u32;
1986 pub type c_float = f32;
1987 pub type c_double = f64;
1988 pub type size_t = u32;
1989 pub type ptrdiff_t = i32;
1990 pub type clock_t = c_ulong;
1991 pub type time_t = c_long;
1992 pub type suseconds_t = i32;
1993 pub type wchar_t = i32;
1996 pub type c_longlong = i64;
1997 pub type c_ulonglong = u64;
1998 pub type intptr_t = i32;
1999 pub type uintptr_t = u32;
2000 pub type intmax_t = i64;
2001 pub type uintmax_t = u64;
2004 use types::os::arch::c95::c_long;
2006 pub type off_t = i64;
2007 pub type dev_t = i32;
2008 pub type ino_t = u64;
2009 pub type pid_t = i32;
2010 pub type uid_t = u32;
2011 pub type gid_t = u32;
2012 pub type useconds_t = u32;
2013 pub type mode_t = u16;
2014 pub type ssize_t = c_long;
2017 use types::common::c99::{int32_t, int64_t, uint32_t};
2018 use types::os::arch::c95::{c_char, c_long, time_t};
2019 use types::os::arch::posix88::{dev_t, gid_t, ino_t,
2020 mode_t, off_t, uid_t};
2022 pub type nlink_t = u16;
2023 pub type blksize_t = i32;
2024 pub type blkcnt_t = i64;
2027 #[derive(Copy)] pub struct stat {
2029 pub st_mode: mode_t,
2030 pub st_nlink: nlink_t,
2035 pub st_atime: time_t,
2036 pub st_atime_nsec: c_long,
2037 pub st_mtime: time_t,
2038 pub st_mtime_nsec: c_long,
2039 pub st_ctime: time_t,
2040 pub st_ctime_nsec: c_long,
2041 pub st_birthtime: time_t,
2042 pub st_birthtime_nsec: c_long,
2044 pub st_blocks: blkcnt_t,
2045 pub st_blksize: blksize_t,
2046 pub st_flags: uint32_t,
2047 pub st_gen: uint32_t,
2048 pub st_lspare: int32_t,
2049 pub st_qspare: [int64_t; 2],
2053 #[derive(Copy)] pub struct utimbuf {
2055 pub modtime: time_t,
2059 #[derive(Copy)] pub struct pthread_attr_t {
2061 pub __opaque: [c_char; 36]
2070 #[derive(Copy)] pub struct mach_timebase_info {
2075 pub type mach_timebase_info_data_t = mach_timebase_info;
2079 #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
2082 pub type c_char = i8;
2083 pub type c_schar = i8;
2084 pub type c_uchar = u8;
2085 pub type c_short = i16;
2086 pub type c_ushort = u16;
2087 pub type c_int = i32;
2088 pub type c_uint = u32;
2089 pub type c_long = i64;
2090 pub type c_ulong = u64;
2091 pub type c_float = f32;
2092 pub type c_double = f64;
2093 pub type size_t = u64;
2094 pub type ptrdiff_t = i64;
2095 pub type clock_t = c_ulong;
2096 pub type time_t = c_long;
2097 pub type suseconds_t = i32;
2098 pub type wchar_t = i32;
2101 pub type c_longlong = i64;
2102 pub type c_ulonglong = u64;
2103 pub type intptr_t = i64;
2104 pub type uintptr_t = u64;
2105 pub type intmax_t = i64;
2106 pub type uintmax_t = u64;
2109 use types::os::arch::c95::c_long;
2111 pub type off_t = i64;
2112 pub type dev_t = i32;
2113 pub type ino_t = u64;
2114 pub type pid_t = i32;
2115 pub type uid_t = u32;
2116 pub type gid_t = u32;
2117 pub type useconds_t = u32;
2118 pub type mode_t = u16;
2119 pub type ssize_t = c_long;
2122 use types::common::c99::{int32_t, int64_t};
2123 use types::common::c99::{uint32_t};
2124 use types::os::arch::c95::{c_char, c_long, time_t};
2125 use types::os::arch::posix88::{dev_t, gid_t, ino_t};
2126 use types::os::arch::posix88::{mode_t, off_t, uid_t};
2128 pub type nlink_t = u16;
2129 pub type blksize_t = i32;
2130 pub type blkcnt_t = i64;
2133 #[derive(Copy)] pub struct stat {
2135 pub st_mode: mode_t,
2136 pub st_nlink: nlink_t,
2141 pub st_atime: time_t,
2142 pub st_atime_nsec: c_long,
2143 pub st_mtime: time_t,
2144 pub st_mtime_nsec: c_long,
2145 pub st_ctime: time_t,
2146 pub st_ctime_nsec: c_long,
2147 pub st_birthtime: time_t,
2148 pub st_birthtime_nsec: c_long,
2150 pub st_blocks: blkcnt_t,
2151 pub st_blksize: blksize_t,
2152 pub st_flags: uint32_t,
2153 pub st_gen: uint32_t,
2154 pub st_lspare: int32_t,
2155 pub st_qspare: [int64_t; 2],
2159 #[derive(Copy)] pub struct utimbuf {
2161 pub modtime: time_t,
2165 #[derive(Copy)] pub struct pthread_attr_t {
2167 pub __opaque: [c_char; 56]
2176 #[derive(Copy)] pub struct mach_timebase_info {
2181 pub type mach_timebase_info_data_t = mach_timebase_info;
2188 // Consts tend to vary per OS so we pull their definitions out
2189 // into this module.
2191 #[cfg(target_os = "windows")]
2194 use types::os::arch::c95::{c_int, c_uint};
2196 pub const EXIT_FAILURE : c_int = 1;
2197 pub const EXIT_SUCCESS : c_int = 0;
2198 pub const RAND_MAX : c_int = 32767;
2199 pub const EOF : c_int = -1;
2200 pub const SEEK_SET : c_int = 0;
2201 pub const SEEK_CUR : c_int = 1;
2202 pub const SEEK_END : c_int = 2;
2203 pub const _IOFBF : c_int = 0;
2204 pub const _IONBF : c_int = 4;
2205 pub const _IOLBF : c_int = 64;
2206 pub const BUFSIZ : c_uint = 512_u32;
2207 pub const FOPEN_MAX : c_uint = 20_u32;
2208 pub const FILENAME_MAX : c_uint = 260_u32;
2209 pub const L_tmpnam : c_uint = 16_u32;
2210 pub const TMP_MAX : c_uint = 32767_u32;
2212 pub const WSAEINTR: c_int = 10004;
2213 pub const WSAEBADF: c_int = 10009;
2214 pub const WSAEACCES: c_int = 10013;
2215 pub const WSAEFAULT: c_int = 10014;
2216 pub const WSAEINVAL: c_int = 10022;
2217 pub const WSAEMFILE: c_int = 10024;
2218 pub const WSAEWOULDBLOCK: c_int = 10035;
2219 pub const WSAEINPROGRESS: c_int = 10036;
2220 pub const WSAEALREADY: c_int = 10037;
2221 pub const WSAENOTSOCK: c_int = 10038;
2222 pub const WSAEDESTADDRREQ: c_int = 10039;
2223 pub const WSAEMSGSIZE: c_int = 10040;
2224 pub const WSAEPROTOTYPE: c_int = 10041;
2225 pub const WSAENOPROTOOPT: c_int = 10042;
2226 pub const WSAEPROTONOSUPPORT: c_int = 10043;
2227 pub const WSAESOCKTNOSUPPORT: c_int = 10044;
2228 pub const WSAEOPNOTSUPP: c_int = 10045;
2229 pub const WSAEPFNOSUPPORT: c_int = 10046;
2230 pub const WSAEAFNOSUPPORT: c_int = 10047;
2231 pub const WSAEADDRINUSE: c_int = 10048;
2232 pub const WSAEADDRNOTAVAIL: c_int = 10049;
2233 pub const WSAENETDOWN: c_int = 10050;
2234 pub const WSAENETUNREACH: c_int = 10051;
2235 pub const WSAENETRESET: c_int = 10052;
2236 pub const WSAECONNABORTED: c_int = 10053;
2237 pub const WSAECONNRESET: c_int = 10054;
2238 pub const WSAENOBUFS: c_int = 10055;
2239 pub const WSAEISCONN: c_int = 10056;
2240 pub const WSAENOTCONN: c_int = 10057;
2241 pub const WSAESHUTDOWN: c_int = 10058;
2242 pub const WSAETOOMANYREFS: c_int = 10059;
2243 pub const WSAETIMEDOUT: c_int = 10060;
2244 pub const WSAECONNREFUSED: c_int = 10061;
2245 pub const WSAELOOP: c_int = 10062;
2246 pub const WSAENAMETOOLONG: c_int = 10063;
2247 pub const WSAEHOSTDOWN: c_int = 10064;
2248 pub const WSAEHOSTUNREACH: c_int = 10065;
2249 pub const WSAENOTEMPTY: c_int = 10066;
2250 pub const WSAEPROCLIM: c_int = 10067;
2251 pub const WSAEUSERS: c_int = 10068;
2252 pub const WSAEDQUOT: c_int = 10069;
2253 pub const WSAESTALE: c_int = 10070;
2254 pub const WSAEREMOTE: c_int = 10071;
2255 pub const WSASYSNOTREADY: c_int = 10091;
2256 pub const WSAVERNOTSUPPORTED: c_int = 10092;
2257 pub const WSANOTINITIALISED: c_int = 10093;
2258 pub const WSAEDISCON: c_int = 10101;
2259 pub const WSAENOMORE: c_int = 10102;
2260 pub const WSAECANCELLED: c_int = 10103;
2261 pub const WSAEINVALIDPROCTABLE: c_int = 10104;
2262 pub const WSAEINVALIDPROVIDER: c_int = 10105;
2263 pub const WSAEPROVIDERFAILEDINIT: c_int = 10106;
2268 use types::os::arch::c95::c_int;
2270 pub const O_RDONLY : c_int = 0;
2271 pub const O_WRONLY : c_int = 1;
2272 pub const O_RDWR : c_int = 2;
2273 pub const O_APPEND : c_int = 8;
2274 pub const O_CREAT : c_int = 256;
2275 pub const O_EXCL : c_int = 1024;
2276 pub const O_TRUNC : c_int = 512;
2277 pub const S_IFIFO : c_int = 4096;
2278 pub const S_IFCHR : c_int = 8192;
2279 pub const S_IFBLK : c_int = 12288;
2280 pub const S_IFDIR : c_int = 16384;
2281 pub const S_IFREG : c_int = 32768;
2282 pub const S_IFLNK : c_int = 40960;
2283 pub const S_IFMT : c_int = 61440;
2284 pub const S_IEXEC : c_int = 64;
2285 pub const S_IWRITE : c_int = 128;
2286 pub const S_IREAD : c_int = 256;
2287 pub const S_IRWXU : c_int = 448;
2288 pub const S_IXUSR : c_int = 64;
2289 pub const S_IWUSR : c_int = 128;
2290 pub const S_IRUSR : c_int = 256;
2291 pub const F_OK : c_int = 0;
2292 pub const R_OK : c_int = 4;
2293 pub const W_OK : c_int = 2;
2294 pub const X_OK : c_int = 1;
2295 pub const STDIN_FILENO : c_int = 0;
2296 pub const STDOUT_FILENO : c_int = 1;
2297 pub const STDERR_FILENO : c_int = 2;
2304 use types::os::arch::c95::c_int;
2306 pub const AF_INET: c_int = 2;
2307 pub const AF_INET6: c_int = 23;
2308 pub const SOCK_STREAM: c_int = 1;
2309 pub const SOCK_DGRAM: c_int = 2;
2310 pub const SOCK_RAW: c_int = 3;
2311 pub const IPPROTO_TCP: c_int = 6;
2312 pub const IPPROTO_IP: c_int = 0;
2313 pub const IPPROTO_IPV6: c_int = 41;
2314 pub const IP_MULTICAST_TTL: c_int = 10;
2315 pub const IP_MULTICAST_LOOP: c_int = 11;
2316 pub const IP_ADD_MEMBERSHIP: c_int = 12;
2317 pub const IP_DROP_MEMBERSHIP: c_int = 13;
2318 pub const IPV6_ADD_MEMBERSHIP: c_int = 5;
2319 pub const IPV6_DROP_MEMBERSHIP: c_int = 6;
2320 pub const IP_TTL: c_int = 4;
2321 pub const IP_HDRINCL: c_int = 2;
2323 pub const TCP_NODELAY: c_int = 0x0001;
2324 pub const SOL_SOCKET: c_int = 0xffff;
2325 pub const SO_KEEPALIVE: c_int = 8;
2326 pub const SO_BROADCAST: c_int = 32;
2327 pub const SO_REUSEADDR: c_int = 4;
2328 pub const SO_ERROR: c_int = 0x1007;
2330 pub const IFF_LOOPBACK: c_int = 4;
2332 pub const SHUT_RD: c_int = 0;
2333 pub const SHUT_WR: c_int = 1;
2334 pub const SHUT_RDWR: c_int = 2;
2337 use types::os::common::bsd44::SOCKET;
2338 use types::os::arch::c95::{c_int, c_long};
2339 use types::os::arch::extra::{WORD, DWORD, BOOL, HANDLE};
2341 pub const TRUE : BOOL = 1;
2342 pub const FALSE : BOOL = 0;
2344 pub const O_TEXT : c_int = 16384;
2345 pub const O_BINARY : c_int = 32768;
2346 pub const O_NOINHERIT: c_int = 128;
2348 pub const ERROR_SUCCESS : c_int = 0;
2349 pub const ERROR_INVALID_FUNCTION: c_int = 1;
2350 pub const ERROR_FILE_NOT_FOUND: c_int = 2;
2351 pub const ERROR_ACCESS_DENIED: c_int = 5;
2352 pub const ERROR_INVALID_HANDLE : c_int = 6;
2353 pub const ERROR_BROKEN_PIPE: c_int = 109;
2354 pub const ERROR_DISK_FULL : c_int = 112;
2355 pub const ERROR_CALL_NOT_IMPLEMENTED : c_int = 120;
2356 pub const ERROR_INSUFFICIENT_BUFFER : c_int = 122;
2357 pub const ERROR_INVALID_NAME : c_int = 123;
2358 pub const ERROR_ALREADY_EXISTS : c_int = 183;
2359 pub const ERROR_PIPE_BUSY: c_int = 231;
2360 pub const ERROR_NO_DATA: c_int = 232;
2361 pub const ERROR_INVALID_ADDRESS : c_int = 487;
2362 pub const ERROR_PIPE_CONNECTED: c_int = 535;
2363 pub const ERROR_NOTHING_TO_TERMINATE: c_int = 758;
2364 pub const ERROR_OPERATION_ABORTED: c_int = 995;
2365 pub const ERROR_IO_PENDING: c_int = 997;
2366 pub const ERROR_FILE_INVALID : c_int = 1006;
2367 pub const ERROR_NOT_FOUND: c_int = 1168;
2368 pub const INVALID_HANDLE_VALUE: HANDLE = -1 as HANDLE;
2370 pub const DELETE : DWORD = 0x00010000;
2371 pub const READ_CONTROL : DWORD = 0x00020000;
2372 pub const SYNCHRONIZE : DWORD = 0x00100000;
2373 pub const WRITE_DAC : DWORD = 0x00040000;
2374 pub const WRITE_OWNER : DWORD = 0x00080000;
2376 pub const PROCESS_CREATE_PROCESS : DWORD = 0x0080;
2377 pub const PROCESS_CREATE_THREAD : DWORD = 0x0002;
2378 pub const PROCESS_DUP_HANDLE : DWORD = 0x0040;
2379 pub const PROCESS_QUERY_INFORMATION : DWORD = 0x0400;
2380 pub const PROCESS_QUERY_LIMITED_INFORMATION : DWORD = 0x1000;
2381 pub const PROCESS_SET_INFORMATION : DWORD = 0x0200;
2382 pub const PROCESS_SET_QUOTA : DWORD = 0x0100;
2383 pub const PROCESS_SUSPEND_RESUME : DWORD = 0x0800;
2384 pub const PROCESS_TERMINATE : DWORD = 0x0001;
2385 pub const PROCESS_VM_OPERATION : DWORD = 0x0008;
2386 pub const PROCESS_VM_READ : DWORD = 0x0010;
2387 pub const PROCESS_VM_WRITE : DWORD = 0x0020;
2389 pub const STARTF_FORCEONFEEDBACK : DWORD = 0x00000040;
2390 pub const STARTF_FORCEOFFFEEDBACK : DWORD = 0x00000080;
2391 pub const STARTF_PREVENTPINNING : DWORD = 0x00002000;
2392 pub const STARTF_RUNFULLSCREEN : DWORD = 0x00000020;
2393 pub const STARTF_TITLEISAPPID : DWORD = 0x00001000;
2394 pub const STARTF_TITLEISLINKNAME : DWORD = 0x00000800;
2395 pub const STARTF_USECOUNTCHARS : DWORD = 0x00000008;
2396 pub const STARTF_USEFILLATTRIBUTE : DWORD = 0x00000010;
2397 pub const STARTF_USEHOTKEY : DWORD = 0x00000200;
2398 pub const STARTF_USEPOSITION : DWORD = 0x00000004;
2399 pub const STARTF_USESHOWWINDOW : DWORD = 0x00000001;
2400 pub const STARTF_USESIZE : DWORD = 0x00000002;
2401 pub const STARTF_USESTDHANDLES : DWORD = 0x00000100;
2403 pub const WAIT_ABANDONED : DWORD = 0x00000080;
2404 pub const WAIT_OBJECT_0 : DWORD = 0x00000000;
2405 pub const WAIT_TIMEOUT : DWORD = 0x00000102;
2406 pub const WAIT_FAILED : DWORD = -1;
2408 pub const DUPLICATE_CLOSE_SOURCE : DWORD = 0x00000001;
2409 pub const DUPLICATE_SAME_ACCESS : DWORD = 0x00000002;
2411 pub const INFINITE : DWORD = -1;
2412 pub const STILL_ACTIVE : DWORD = 259;
2414 pub const MEM_COMMIT : DWORD = 0x00001000;
2415 pub const MEM_RESERVE : DWORD = 0x00002000;
2416 pub const MEM_DECOMMIT : DWORD = 0x00004000;
2417 pub const MEM_RELEASE : DWORD = 0x00008000;
2418 pub const MEM_RESET : DWORD = 0x00080000;
2419 pub const MEM_RESET_UNDO : DWORD = 0x1000000;
2420 pub const MEM_LARGE_PAGES : DWORD = 0x20000000;
2421 pub const MEM_PHYSICAL : DWORD = 0x00400000;
2422 pub const MEM_TOP_DOWN : DWORD = 0x00100000;
2423 pub const MEM_WRITE_WATCH : DWORD = 0x00200000;
2425 pub const PAGE_EXECUTE : DWORD = 0x10;
2426 pub const PAGE_EXECUTE_READ : DWORD = 0x20;
2427 pub const PAGE_EXECUTE_READWRITE : DWORD = 0x40;
2428 pub const PAGE_EXECUTE_WRITECOPY : DWORD = 0x80;
2429 pub const PAGE_NOACCESS : DWORD = 0x01;
2430 pub const PAGE_READONLY : DWORD = 0x02;
2431 pub const PAGE_READWRITE : DWORD = 0x04;
2432 pub const PAGE_WRITECOPY : DWORD = 0x08;
2433 pub const PAGE_GUARD : DWORD = 0x100;
2434 pub const PAGE_NOCACHE : DWORD = 0x200;
2435 pub const PAGE_WRITECOMBINE : DWORD = 0x400;
2437 pub const SEC_COMMIT : DWORD = 0x8000000;
2438 pub const SEC_IMAGE : DWORD = 0x1000000;
2439 pub const SEC_IMAGE_NO_EXECUTE : DWORD = 0x11000000;
2440 pub const SEC_LARGE_PAGES : DWORD = 0x80000000;
2441 pub const SEC_NOCACHE : DWORD = 0x10000000;
2442 pub const SEC_RESERVE : DWORD = 0x4000000;
2443 pub const SEC_WRITECOMBINE : DWORD = 0x40000000;
2445 pub const FILE_MAP_ALL_ACCESS : DWORD = 0xf001f;
2446 pub const FILE_MAP_READ : DWORD = 0x4;
2447 pub const FILE_MAP_WRITE : DWORD = 0x2;
2448 pub const FILE_MAP_COPY : DWORD = 0x1;
2449 pub const FILE_MAP_EXECUTE : DWORD = 0x20;
2451 pub const PROCESSOR_ARCHITECTURE_INTEL : WORD = 0;
2452 pub const PROCESSOR_ARCHITECTURE_ARM : WORD = 5;
2453 pub const PROCESSOR_ARCHITECTURE_IA64 : WORD = 6;
2454 pub const PROCESSOR_ARCHITECTURE_AMD64 : WORD = 9;
2455 pub const PROCESSOR_ARCHITECTURE_UNKNOWN : WORD = 0xffff;
2457 pub const MOVEFILE_COPY_ALLOWED: DWORD = 2;
2458 pub const MOVEFILE_CREATE_HARDLINK: DWORD = 16;
2459 pub const MOVEFILE_DELAY_UNTIL_REBOOT: DWORD = 4;
2460 pub const MOVEFILE_FAIL_IF_NOT_TRACKABLE: DWORD = 32;
2461 pub const MOVEFILE_REPLACE_EXISTING: DWORD = 1;
2462 pub const MOVEFILE_WRITE_THROUGH: DWORD = 8;
2464 pub const SYMBOLIC_LINK_FLAG_DIRECTORY: DWORD = 1;
2466 pub const FILE_SHARE_DELETE: DWORD = 0x4;
2467 pub const FILE_SHARE_READ: DWORD = 0x1;
2468 pub const FILE_SHARE_WRITE: DWORD = 0x2;
2470 pub const CREATE_ALWAYS: DWORD = 2;
2471 pub const CREATE_NEW: DWORD = 1;
2472 pub const OPEN_ALWAYS: DWORD = 4;
2473 pub const OPEN_EXISTING: DWORD = 3;
2474 pub const TRUNCATE_EXISTING: DWORD = 5;
2476 pub const FILE_APPEND_DATA: DWORD = 0x00000004;
2477 pub const FILE_READ_DATA: DWORD = 0x00000001;
2478 pub const FILE_WRITE_DATA: DWORD = 0x00000002;
2480 pub const FILE_ATTRIBUTE_ARCHIVE: DWORD = 0x20;
2481 pub const FILE_ATTRIBUTE_COMPRESSED: DWORD = 0x800;
2482 pub const FILE_ATTRIBUTE_DEVICE: DWORD = 0x40;
2483 pub const FILE_ATTRIBUTE_DIRECTORY: DWORD = 0x10;
2484 pub const FILE_ATTRIBUTE_ENCRYPTED: DWORD = 0x4000;
2485 pub const FILE_ATTRIBUTE_HIDDEN: DWORD = 0x2;
2486 pub const FILE_ATTRIBUTE_INTEGRITY_STREAM: DWORD = 0x8000;
2487 pub const FILE_ATTRIBUTE_NORMAL: DWORD = 0x80;
2488 pub const FILE_ATTRIBUTE_NOT_CONTENT_INDEXED: DWORD = 0x2000;
2489 pub const FILE_ATTRIBUTE_NO_SCRUB_DATA: DWORD = 0x20000;
2490 pub const FILE_ATTRIBUTE_OFFLINE: DWORD = 0x1000;
2491 pub const FILE_ATTRIBUTE_READONLY: DWORD = 0x1;
2492 pub const FILE_ATTRIBUTE_REPARSE_POINT: DWORD = 0x400;
2493 pub const FILE_ATTRIBUTE_SPARSE_FILE: DWORD = 0x200;
2494 pub const FILE_ATTRIBUTE_SYSTEM: DWORD = 0x4;
2495 pub const FILE_ATTRIBUTE_TEMPORARY: DWORD = 0x100;
2496 pub const FILE_ATTRIBUTE_VIRTUAL: DWORD = 0x10000;
2498 pub const FILE_FLAG_BACKUP_SEMANTICS: DWORD = 0x02000000;
2499 pub const FILE_FLAG_DELETE_ON_CLOSE: DWORD = 0x04000000;
2500 pub const FILE_FLAG_NO_BUFFERING: DWORD = 0x20000000;
2501 pub const FILE_FLAG_OPEN_NO_RECALL: DWORD = 0x00100000;
2502 pub const FILE_FLAG_OPEN_REPARSE_POINT: DWORD = 0x00200000;
2503 pub const FILE_FLAG_OVERLAPPED: DWORD = 0x40000000;
2504 pub const FILE_FLAG_POSIX_SEMANTICS: DWORD = 0x0100000;
2505 pub const FILE_FLAG_RANDOM_ACCESS: DWORD = 0x10000000;
2506 pub const FILE_FLAG_SESSION_AWARE: DWORD = 0x00800000;
2507 pub const FILE_FLAG_SEQUENTIAL_SCAN: DWORD = 0x08000000;
2508 pub const FILE_FLAG_WRITE_THROUGH: DWORD = 0x80000000;
2509 pub const FILE_FLAG_FIRST_PIPE_INSTANCE: DWORD = 0x00080000;
2511 pub const FILE_NAME_NORMALIZED: DWORD = 0x0;
2512 pub const FILE_NAME_OPENED: DWORD = 0x8;
2514 pub const VOLUME_NAME_DOS: DWORD = 0x0;
2515 pub const VOLUME_NAME_GUID: DWORD = 0x1;
2516 pub const VOLUME_NAME_NONE: DWORD = 0x4;
2517 pub const VOLUME_NAME_NT: DWORD = 0x2;
2519 pub const GENERIC_READ: DWORD = 0x80000000;
2520 pub const GENERIC_WRITE: DWORD = 0x40000000;
2521 pub const GENERIC_EXECUTE: DWORD = 0x20000000;
2522 pub const GENERIC_ALL: DWORD = 0x10000000;
2523 pub const FILE_WRITE_ATTRIBUTES: DWORD = 0x00000100;
2524 pub const FILE_READ_ATTRIBUTES: DWORD = 0x00000080;
2526 pub const STANDARD_RIGHTS_READ: DWORD = 0x20000;
2527 pub const STANDARD_RIGHTS_WRITE: DWORD = 0x20000;
2528 pub const FILE_WRITE_EA: DWORD = 0x00000010;
2529 pub const FILE_READ_EA: DWORD = 0x00000008;
2530 pub const FILE_GENERIC_READ: DWORD =
2531 STANDARD_RIGHTS_READ | FILE_READ_DATA |
2532 FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE;
2533 pub const FILE_GENERIC_WRITE: DWORD =
2534 STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA |
2535 FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA |
2538 pub const FILE_BEGIN: DWORD = 0;
2539 pub const FILE_CURRENT: DWORD = 1;
2540 pub const FILE_END: DWORD = 2;
2542 pub const MAX_PROTOCOL_CHAIN: DWORD = 7;
2543 pub const WSAPROTOCOL_LEN: DWORD = 255;
2544 pub const INVALID_SOCKET: SOCKET = !0;
2546 pub const DETACHED_PROCESS: DWORD = 0x00000008;
2547 pub const CREATE_NEW_PROCESS_GROUP: DWORD = 0x00000200;
2548 pub const CREATE_UNICODE_ENVIRONMENT: DWORD = 0x00000400;
2550 pub const PIPE_ACCESS_DUPLEX: DWORD = 0x00000003;
2551 pub const PIPE_ACCESS_INBOUND: DWORD = 0x00000001;
2552 pub const PIPE_ACCESS_OUTBOUND: DWORD = 0x00000002;
2553 pub const PIPE_TYPE_BYTE: DWORD = 0x00000000;
2554 pub const PIPE_TYPE_MESSAGE: DWORD = 0x00000004;
2555 pub const PIPE_READMODE_BYTE: DWORD = 0x00000000;
2556 pub const PIPE_READMODE_MESSAGE: DWORD = 0x00000002;
2557 pub const PIPE_WAIT: DWORD = 0x00000000;
2558 pub const PIPE_NOWAIT: DWORD = 0x00000001;
2559 pub const PIPE_ACCEPT_REMOTE_CLIENTS: DWORD = 0x00000000;
2560 pub const PIPE_REJECT_REMOTE_CLIENTS: DWORD = 0x00000008;
2561 pub const PIPE_UNLIMITED_INSTANCES: DWORD = 255;
2563 pub const IPPROTO_RAW: c_int = 255;
2565 pub const FIONBIO: c_long = -0x7FFB9982;
2572 #[cfg(any(target_os = "linux", target_os = "android", target_os = "nacl"))]
2575 use types::os::arch::c95::{c_int, c_uint};
2577 pub const EXIT_FAILURE : c_int = 1;
2578 pub const EXIT_SUCCESS : c_int = 0;
2579 pub const RAND_MAX : c_int = 2147483647;
2580 pub const EOF : c_int = -1;
2581 pub const SEEK_SET : c_int = 0;
2582 pub const SEEK_CUR : c_int = 1;
2583 pub const SEEK_END : c_int = 2;
2584 pub const _IOFBF : c_int = 0;
2585 pub const _IONBF : c_int = 2;
2586 pub const _IOLBF : c_int = 1;
2587 pub const BUFSIZ : c_uint = 8192_u32;
2588 pub const FOPEN_MAX : c_uint = 16_u32;
2589 pub const FILENAME_MAX : c_uint = 4096_u32;
2590 pub const L_tmpnam : c_uint = 20_u32;
2591 pub const TMP_MAX : c_uint = 238328_u32;
2595 #[cfg(any(target_arch = "x86",
2596 target_arch = "x86_64",
2597 target_arch = "arm",
2598 target_arch = "aarch64",
2599 target_arch = "le32",
2600 target_arch = "powerpc"))]
2602 use types::os::arch::c95::c_int;
2603 use types::common::c95::c_void;
2604 use types::os::arch::posix88::mode_t;
2606 pub const O_RDONLY : c_int = 0;
2607 pub const O_WRONLY : c_int = 1;
2608 pub const O_RDWR : c_int = 2;
2609 pub const O_APPEND : c_int = 1024;
2610 pub const O_CREAT : c_int = 64;
2611 pub const O_EXCL : c_int = 128;
2612 pub const O_TRUNC : c_int = 512;
2613 pub const S_IFIFO : mode_t = 4096;
2614 pub const S_IFCHR : mode_t = 8192;
2615 pub const S_IFBLK : mode_t = 24576;
2616 pub const S_IFDIR : mode_t = 16384;
2617 pub const S_IFREG : mode_t = 32768;
2618 pub const S_IFLNK : mode_t = 40960;
2619 pub const S_IFMT : mode_t = 61440;
2620 pub const S_IEXEC : mode_t = 64;
2621 pub const S_IWRITE : mode_t = 128;
2622 pub const S_IREAD : mode_t = 256;
2623 pub const S_IRWXU : mode_t = 448;
2624 pub const S_IXUSR : mode_t = 64;
2625 pub const S_IWUSR : mode_t = 128;
2626 pub const S_IRUSR : mode_t = 256;
2627 pub const F_OK : c_int = 0;
2628 pub const R_OK : c_int = 4;
2629 pub const W_OK : c_int = 2;
2630 pub const X_OK : c_int = 1;
2631 pub const STDIN_FILENO : c_int = 0;
2632 pub const STDOUT_FILENO : c_int = 1;
2633 pub const STDERR_FILENO : c_int = 2;
2634 pub const F_LOCK : c_int = 1;
2635 pub const F_TEST : c_int = 3;
2636 pub const F_TLOCK : c_int = 2;
2637 pub const F_ULOCK : c_int = 0;
2638 pub const SIGHUP : c_int = 1;
2639 pub const SIGINT : c_int = 2;
2640 pub const SIGQUIT : c_int = 3;
2641 pub const SIGILL : c_int = 4;
2642 pub const SIGABRT : c_int = 6;
2643 pub const SIGFPE : c_int = 8;
2644 pub const SIGKILL : c_int = 9;
2645 pub const SIGSEGV : c_int = 11;
2646 pub const SIGPIPE : c_int = 13;
2647 pub const SIGALRM : c_int = 14;
2648 pub const SIGTERM : c_int = 15;
2650 pub const PROT_NONE : c_int = 0;
2651 pub const PROT_READ : c_int = 1;
2652 pub const PROT_WRITE : c_int = 2;
2653 pub const PROT_EXEC : c_int = 4;
2655 pub const MAP_FILE : c_int = 0x0000;
2656 pub const MAP_SHARED : c_int = 0x0001;
2657 pub const MAP_PRIVATE : c_int = 0x0002;
2658 pub const MAP_FIXED : c_int = 0x0010;
2659 pub const MAP_ANON : c_int = 0x0020;
2661 pub const MAP_FAILED : *mut c_void = -1 as *mut c_void;
2663 pub const MCL_CURRENT : c_int = 0x0001;
2664 pub const MCL_FUTURE : c_int = 0x0002;
2666 pub const MS_ASYNC : c_int = 0x0001;
2667 pub const MS_INVALIDATE : c_int = 0x0002;
2668 pub const MS_SYNC : c_int = 0x0004;
2670 pub const EPERM : c_int = 1;
2671 pub const ENOENT : c_int = 2;
2672 pub const ESRCH : c_int = 3;
2673 pub const EINTR : c_int = 4;
2674 pub const EIO : c_int = 5;
2675 pub const ENXIO : c_int = 6;
2676 pub const E2BIG : c_int = 7;
2677 pub const ENOEXEC : c_int = 8;
2678 pub const EBADF : c_int = 9;
2679 pub const ECHILD : c_int = 10;
2680 pub const EAGAIN : c_int = 11;
2681 pub const ENOMEM : c_int = 12;
2682 pub const EACCES : c_int = 13;
2683 pub const EFAULT : c_int = 14;
2684 pub const ENOTBLK : c_int = 15;
2685 pub const EBUSY : c_int = 16;
2686 pub const EEXIST : c_int = 17;
2687 pub const EXDEV : c_int = 18;
2688 pub const ENODEV : c_int = 19;
2689 pub const ENOTDIR : c_int = 20;
2690 pub const EISDIR : c_int = 21;
2691 pub const EINVAL : c_int = 22;
2692 pub const ENFILE : c_int = 23;
2693 pub const EMFILE : c_int = 24;
2694 pub const ENOTTY : c_int = 25;
2695 pub const ETXTBSY : c_int = 26;
2696 pub const EFBIG : c_int = 27;
2697 pub const ENOSPC : c_int = 28;
2698 pub const ESPIPE : c_int = 29;
2699 pub const EROFS : c_int = 30;
2700 pub const EMLINK : c_int = 31;
2701 pub const EPIPE : c_int = 32;
2702 pub const EDOM : c_int = 33;
2703 pub const ERANGE : c_int = 34;
2705 pub const EDEADLK: c_int = 35;
2706 pub const ENAMETOOLONG: c_int = 36;
2707 pub const ENOLCK: c_int = 37;
2708 pub const ENOSYS: c_int = 38;
2709 pub const ENOTEMPTY: c_int = 39;
2710 pub const ELOOP: c_int = 40;
2711 pub const EWOULDBLOCK: c_int = EAGAIN;
2712 pub const ENOMSG: c_int = 42;
2713 pub const EIDRM: c_int = 43;
2714 pub const ECHRNG: c_int = 44;
2715 pub const EL2NSYNC: c_int = 45;
2716 pub const EL3HLT: c_int = 46;
2717 pub const EL3RST: c_int = 47;
2718 pub const ELNRNG: c_int = 48;
2719 pub const EUNATCH: c_int = 49;
2720 pub const ENOCSI: c_int = 50;
2721 pub const EL2HLT: c_int = 51;
2722 pub const EBADE: c_int = 52;
2723 pub const EBADR: c_int = 53;
2724 pub const EXFULL: c_int = 54;
2725 pub const ENOANO: c_int = 55;
2726 pub const EBADRQC: c_int = 56;
2727 pub const EBADSLT: c_int = 57;
2729 pub const EDEADLOCK: c_int = EDEADLK;
2731 pub const EBFONT: c_int = 59;
2732 pub const ENOSTR: c_int = 60;
2733 pub const ENODATA: c_int = 61;
2734 pub const ETIME: c_int = 62;
2735 pub const ENOSR: c_int = 63;
2736 pub const ENONET: c_int = 64;
2737 pub const ENOPKG: c_int = 65;
2738 pub const EREMOTE: c_int = 66;
2739 pub const ENOLINK: c_int = 67;
2740 pub const EADV: c_int = 68;
2741 pub const ESRMNT: c_int = 69;
2742 pub const ECOMM: c_int = 70;
2743 pub const EPROTO: c_int = 71;
2744 pub const EMULTIHOP: c_int = 72;
2745 pub const EDOTDOT: c_int = 73;
2746 pub const EBADMSG: c_int = 74;
2747 pub const EOVERFLOW: c_int = 75;
2748 pub const ENOTUNIQ: c_int = 76;
2749 pub const EBADFD: c_int = 77;
2750 pub const EREMCHG: c_int = 78;
2751 pub const ELIBACC: c_int = 79;
2752 pub const ELIBBAD: c_int = 80;
2753 pub const ELIBSCN: c_int = 81;
2754 pub const ELIBMAX: c_int = 82;
2755 pub const ELIBEXEC: c_int = 83;
2756 pub const EILSEQ: c_int = 84;
2757 pub const ERESTART: c_int = 85;
2758 pub const ESTRPIPE: c_int = 86;
2759 pub const EUSERS: c_int = 87;
2760 pub const ENOTSOCK: c_int = 88;
2761 pub const EDESTADDRREQ: c_int = 89;
2762 pub const EMSGSIZE: c_int = 90;
2763 pub const EPROTOTYPE: c_int = 91;
2764 pub const ENOPROTOOPT: c_int = 92;
2765 pub const EPROTONOSUPPORT: c_int = 93;
2766 pub const ESOCKTNOSUPPORT: c_int = 94;
2767 pub const EOPNOTSUPP: c_int = 95;
2768 pub const EPFNOSUPPORT: c_int = 96;
2769 pub const EAFNOSUPPORT: c_int = 97;
2770 pub const EADDRINUSE: c_int = 98;
2771 pub const EADDRNOTAVAIL: c_int = 99;
2772 pub const ENETDOWN: c_int = 100;
2773 pub const ENETUNREACH: c_int = 101;
2774 pub const ENETRESET: c_int = 102;
2775 pub const ECONNABORTED: c_int = 103;
2776 pub const ECONNRESET: c_int = 104;
2777 pub const ENOBUFS: c_int = 105;
2778 pub const EISCONN: c_int = 106;
2779 pub const ENOTCONN: c_int = 107;
2780 pub const ESHUTDOWN: c_int = 108;
2781 pub const ETOOMANYREFS: c_int = 109;
2782 pub const ETIMEDOUT: c_int = 110;
2783 pub const ECONNREFUSED: c_int = 111;
2784 pub const EHOSTDOWN: c_int = 112;
2785 pub const EHOSTUNREACH: c_int = 113;
2786 pub const EALREADY: c_int = 114;
2787 pub const EINPROGRESS: c_int = 115;
2788 pub const ESTALE: c_int = 116;
2789 pub const EUCLEAN: c_int = 117;
2790 pub const ENOTNAM: c_int = 118;
2791 pub const ENAVAIL: c_int = 119;
2792 pub const EISNAM: c_int = 120;
2793 pub const EREMOTEIO: c_int = 121;
2794 pub const EDQUOT: c_int = 122;
2796 pub const ENOMEDIUM: c_int = 123;
2797 pub const EMEDIUMTYPE: c_int = 124;
2798 pub const ECANCELED: c_int = 125;
2799 pub const ENOKEY: c_int = 126;
2800 pub const EKEYEXPIRED: c_int = 127;
2801 pub const EKEYREVOKED: c_int = 128;
2802 pub const EKEYREJECTED: c_int = 129;
2804 pub const EOWNERDEAD: c_int = 130;
2805 pub const ENOTRECOVERABLE: c_int = 131;
2807 pub const ERFKILL: c_int = 132;
2809 pub const EHWPOISON: c_int = 133;
2812 #[cfg(any(target_arch = "mips",
2813 target_arch = "mipsel"))]
2815 use types::os::arch::c95::c_int;
2816 use types::common::c95::c_void;
2817 use types::os::arch::posix88::mode_t;
2819 pub const O_RDONLY : c_int = 0;
2820 pub const O_WRONLY : c_int = 1;
2821 pub const O_RDWR : c_int = 2;
2822 pub const O_APPEND : c_int = 8;
2823 pub const O_CREAT : c_int = 256;
2824 pub const O_EXCL : c_int = 1024;
2825 pub const O_TRUNC : c_int = 512;
2826 pub const S_IFIFO : mode_t = 4096;
2827 pub const S_IFCHR : mode_t = 8192;
2828 pub const S_IFBLK : mode_t = 24576;
2829 pub const S_IFDIR : mode_t = 16384;
2830 pub const S_IFREG : mode_t = 32768;
2831 pub const S_IFLNK : mode_t = 40960;
2832 pub const S_IFMT : mode_t = 61440;
2833 pub const S_IEXEC : mode_t = 64;
2834 pub const S_IWRITE : mode_t = 128;
2835 pub const S_IREAD : mode_t = 256;
2836 pub const S_IRWXU : mode_t = 448;
2837 pub const S_IXUSR : mode_t = 64;
2838 pub const S_IWUSR : mode_t = 128;
2839 pub const S_IRUSR : mode_t = 256;
2840 pub const F_OK : c_int = 0;
2841 pub const R_OK : c_int = 4;
2842 pub const W_OK : c_int = 2;
2843 pub const X_OK : c_int = 1;
2844 pub const STDIN_FILENO : c_int = 0;
2845 pub const STDOUT_FILENO : c_int = 1;
2846 pub const STDERR_FILENO : c_int = 2;
2847 pub const F_LOCK : c_int = 1;
2848 pub const F_TEST : c_int = 3;
2849 pub const F_TLOCK : c_int = 2;
2850 pub const F_ULOCK : c_int = 0;
2851 pub const SIGHUP : c_int = 1;
2852 pub const SIGINT : c_int = 2;
2853 pub const SIGQUIT : c_int = 3;
2854 pub const SIGILL : c_int = 4;
2855 pub const SIGABRT : c_int = 6;
2856 pub const SIGFPE : c_int = 8;
2857 pub const SIGKILL : c_int = 9;
2858 pub const SIGSEGV : c_int = 11;
2859 pub const SIGPIPE : c_int = 13;
2860 pub const SIGALRM : c_int = 14;
2861 pub const SIGTERM : c_int = 15;
2863 pub const PROT_NONE : c_int = 0;
2864 pub const PROT_READ : c_int = 1;
2865 pub const PROT_WRITE : c_int = 2;
2866 pub const PROT_EXEC : c_int = 4;
2868 pub const MAP_FILE : c_int = 0x0000;
2869 pub const MAP_SHARED : c_int = 0x0001;
2870 pub const MAP_PRIVATE : c_int = 0x0002;
2871 pub const MAP_FIXED : c_int = 0x0010;
2872 pub const MAP_ANON : c_int = 0x0800;
2874 pub const MAP_FAILED : *mut c_void = -1 as *mut c_void;
2876 pub const MCL_CURRENT : c_int = 0x0001;
2877 pub const MCL_FUTURE : c_int = 0x0002;
2879 pub const MS_ASYNC : c_int = 0x0001;
2880 pub const MS_INVALIDATE : c_int = 0x0002;
2881 pub const MS_SYNC : c_int = 0x0004;
2883 pub const EPERM : c_int = 1;
2884 pub const ENOENT : c_int = 2;
2885 pub const ESRCH : c_int = 3;
2886 pub const EINTR : c_int = 4;
2887 pub const EIO : c_int = 5;
2888 pub const ENXIO : c_int = 6;
2889 pub const E2BIG : c_int = 7;
2890 pub const ENOEXEC : c_int = 8;
2891 pub const EBADF : c_int = 9;
2892 pub const ECHILD : c_int = 10;
2893 pub const EAGAIN : c_int = 11;
2894 pub const ENOMEM : c_int = 12;
2895 pub const EACCES : c_int = 13;
2896 pub const EFAULT : c_int = 14;
2897 pub const ENOTBLK : c_int = 15;
2898 pub const EBUSY : c_int = 16;
2899 pub const EEXIST : c_int = 17;
2900 pub const EXDEV : c_int = 18;
2901 pub const ENODEV : c_int = 19;
2902 pub const ENOTDIR : c_int = 20;
2903 pub const EISDIR : c_int = 21;
2904 pub const EINVAL : c_int = 22;
2905 pub const ENFILE : c_int = 23;
2906 pub const EMFILE : c_int = 24;
2907 pub const ENOTTY : c_int = 25;
2908 pub const ETXTBSY : c_int = 26;
2909 pub const EFBIG : c_int = 27;
2910 pub const ENOSPC : c_int = 28;
2911 pub const ESPIPE : c_int = 29;
2912 pub const EROFS : c_int = 30;
2913 pub const EMLINK : c_int = 31;
2914 pub const EPIPE : c_int = 32;
2915 pub const EDOM : c_int = 33;
2916 pub const ERANGE : c_int = 34;
2918 pub const ENOMSG: c_int = 35;
2919 pub const EIDRM: c_int = 36;
2920 pub const ECHRNG: c_int = 37;
2921 pub const EL2NSYNC: c_int = 38;
2922 pub const EL3HLT: c_int = 39;
2923 pub const EL3RST: c_int = 40;
2924 pub const ELNRNG: c_int = 41;
2925 pub const EUNATCH: c_int = 42;
2926 pub const ENOCSI: c_int = 43;
2927 pub const EL2HLT: c_int = 44;
2928 pub const EDEADLK: c_int = 45;
2929 pub const ENOLCK: c_int = 46;
2930 pub const EBADE: c_int = 50;
2931 pub const EBADR: c_int = 51;
2932 pub const EXFULL: c_int = 52;
2933 pub const ENOANO: c_int = 53;
2934 pub const EBADRQC: c_int = 54;
2935 pub const EBADSLT: c_int = 55;
2936 pub const EDEADLOCK: c_int = 56;
2937 pub const EBFONT: c_int = 59;
2938 pub const ENOSTR: c_int = 60;
2939 pub const ENODATA: c_int = 61;
2940 pub const ETIME: c_int = 62;
2941 pub const ENOSR: c_int = 63;
2942 pub const ENONET: c_int = 64;
2943 pub const ENOPKG: c_int = 65;
2944 pub const EREMOTE: c_int = 66;
2945 pub const ENOLINK: c_int = 67;
2946 pub const EADV: c_int = 68;
2947 pub const ESRMNT: c_int = 69;
2948 pub const ECOMM: c_int = 70;
2949 pub const EPROTO: c_int = 71;
2950 pub const EDOTDOT: c_int = 73;
2951 pub const EMULTIHOP: c_int = 74;
2952 pub const EBADMSG: c_int = 77;
2953 pub const ENAMETOOLONG: c_int = 78;
2954 pub const EOVERFLOW: c_int = 79;
2955 pub const ENOTUNIQ: c_int = 80;
2956 pub const EBADFD: c_int = 81;
2957 pub const EREMCHG: c_int = 82;
2958 pub const ELIBACC: c_int = 83;
2959 pub const ELIBBAD: c_int = 84;
2960 pub const ELIBSCN: c_int = 95;
2961 pub const ELIBMAX: c_int = 86;
2962 pub const ELIBEXEC: c_int = 87;
2963 pub const EILSEQ: c_int = 88;
2964 pub const ENOSYS: c_int = 89;
2965 pub const ELOOP: c_int = 90;
2966 pub const ERESTART: c_int = 91;
2967 pub const ESTRPIPE: c_int = 92;
2968 pub const ENOTEMPTY: c_int = 93;
2969 pub const EUSERS: c_int = 94;
2970 pub const ENOTSOCK: c_int = 95;
2971 pub const EDESTADDRREQ: c_int = 96;
2972 pub const EMSGSIZE: c_int = 97;
2973 pub const EPROTOTYPE: c_int = 98;
2974 pub const ENOPROTOOPT: c_int = 99;
2975 pub const EPROTONOSUPPORT: c_int = 120;
2976 pub const ESOCKTNOSUPPORT: c_int = 121;
2977 pub const EOPNOTSUPP: c_int = 122;
2978 pub const EPFNOSUPPORT: c_int = 123;
2979 pub const EAFNOSUPPORT: c_int = 124;
2980 pub const EADDRINUSE: c_int = 125;
2981 pub const EADDRNOTAVAIL: c_int = 126;
2982 pub const ENETDOWN: c_int = 127;
2983 pub const ENETUNREACH: c_int = 128;
2984 pub const ENETRESET: c_int = 129;
2985 pub const ECONNABORTED: c_int = 130;
2986 pub const ECONNRESET: c_int = 131;
2987 pub const ENOBUFS: c_int = 132;
2988 pub const EISCONN: c_int = 133;
2989 pub const ENOTCONN: c_int = 134;
2990 pub const EUCLEAN: c_int = 135;
2991 pub const ENOTNAM: c_int = 137;
2992 pub const ENAVAIL: c_int = 138;
2993 pub const EISNAM: c_int = 139;
2994 pub const EREMOTEIO: c_int = 140;
2995 pub const ESHUTDOWN: c_int = 143;
2996 pub const ETOOMANYREFS: c_int = 144;
2997 pub const ETIMEDOUT: c_int = 145;
2998 pub const ECONNREFUSED: c_int = 146;
2999 pub const EHOSTDOWN: c_int = 147;
3000 pub const EHOSTUNREACH: c_int = 148;
3001 pub const EWOULDBLOCK: c_int = EAGAIN;
3002 pub const EALREADY: c_int = 149;
3003 pub const EINPROGRESS: c_int = 150;
3004 pub const ESTALE: c_int = 151;
3005 pub const ECANCELED: c_int = 158;
3007 pub const ENOMEDIUM: c_int = 159;
3008 pub const EMEDIUMTYPE: c_int = 160;
3009 pub const ENOKEY: c_int = 161;
3010 pub const EKEYEXPIRED: c_int = 162;
3011 pub const EKEYREVOKED: c_int = 163;
3012 pub const EKEYREJECTED: c_int = 164;
3014 pub const EOWNERDEAD: c_int = 165;
3015 pub const ENOTRECOVERABLE: c_int = 166;
3017 pub const ERFKILL: c_int = 167;
3019 pub const EHWPOISON: c_int = 168;
3021 pub const EDQUOT: c_int = 1133;
3023 #[cfg(not(target_os = "nacl"))]
3025 use types::os::arch::c95::{c_int, size_t};
3027 pub const F_DUPFD : c_int = 0;
3028 pub const F_GETFD : c_int = 1;
3029 pub const F_SETFD : c_int = 2;
3030 pub const F_GETFL : c_int = 3;
3031 pub const F_SETFL : c_int = 4;
3033 pub const SIGTRAP : c_int = 5;
3034 pub const SIG_IGN: size_t = 1;
3036 pub const GLOB_ERR : c_int = 1 << 0;
3037 pub const GLOB_MARK : c_int = 1 << 1;
3038 pub const GLOB_NOSORT : c_int = 1 << 2;
3039 pub const GLOB_DOOFFS : c_int = 1 << 3;
3040 pub const GLOB_NOCHECK : c_int = 1 << 4;
3041 pub const GLOB_APPEND : c_int = 1 << 5;
3042 pub const GLOB_NOESCAPE : c_int = 1 << 6;
3044 pub const GLOB_NOSPACE : c_int = 1;
3045 pub const GLOB_ABORTED : c_int = 2;
3046 pub const GLOB_NOMATCH : c_int = 3;
3048 pub const POSIX_MADV_NORMAL : c_int = 0;
3049 pub const POSIX_MADV_RANDOM : c_int = 1;
3050 pub const POSIX_MADV_SEQUENTIAL : c_int = 2;
3051 pub const POSIX_MADV_WILLNEED : c_int = 3;
3052 pub const POSIX_MADV_DONTNEED : c_int = 4;
3054 pub const _SC_MQ_PRIO_MAX : c_int = 28;
3055 pub const _SC_IOV_MAX : c_int = 60;
3056 pub const _SC_GETGR_R_SIZE_MAX : c_int = 69;
3057 pub const _SC_GETPW_R_SIZE_MAX : c_int = 70;
3058 pub const _SC_LOGIN_NAME_MAX : c_int = 71;
3059 pub const _SC_TTY_NAME_MAX : c_int = 72;
3060 pub const _SC_THREADS : c_int = 67;
3061 pub const _SC_THREAD_SAFE_FUNCTIONS : c_int = 68;
3062 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : c_int = 73;
3063 pub const _SC_THREAD_KEYS_MAX : c_int = 74;
3064 pub const _SC_THREAD_STACK_MIN : c_int = 75;
3065 pub const _SC_THREAD_THREADS_MAX : c_int = 76;
3066 pub const _SC_THREAD_ATTR_STACKADDR : c_int = 77;
3067 pub const _SC_THREAD_ATTR_STACKSIZE : c_int = 78;
3068 pub const _SC_THREAD_PRIORITY_SCHEDULING : c_int = 79;
3069 pub const _SC_THREAD_PRIO_INHERIT : c_int = 80;
3070 pub const _SC_THREAD_PRIO_PROTECT : c_int = 81;
3071 pub const _SC_THREAD_PROCESS_SHARED : c_int = 82;
3072 pub const _SC_ATEXIT_MAX : c_int = 87;
3073 pub const _SC_XOPEN_VERSION : c_int = 89;
3074 pub const _SC_XOPEN_XCU_VERSION : c_int = 90;
3075 pub const _SC_XOPEN_UNIX : c_int = 91;
3076 pub const _SC_XOPEN_CRYPT : c_int = 92;
3077 pub const _SC_XOPEN_ENH_I18N : c_int = 93;
3078 pub const _SC_XOPEN_SHM : c_int = 94;
3079 pub const _SC_XOPEN_LEGACY : c_int = 129;
3080 pub const _SC_XOPEN_REALTIME : c_int = 130;
3081 pub const _SC_XOPEN_REALTIME_THREADS : c_int = 131;
3083 pub const PTHREAD_CREATE_JOINABLE: c_int = 0;
3084 pub const PTHREAD_CREATE_DETACHED: c_int = 1;
3086 #[cfg(target_os = "android")]
3087 pub const PTHREAD_STACK_MIN: size_t = 8192;
3089 #[cfg(all(target_os = "linux",
3090 any(target_arch = "arm",
3091 target_arch = "x86",
3092 target_arch = "x86_64")))]
3093 pub const PTHREAD_STACK_MIN: size_t = 16384;
3095 #[cfg(all(target_os = "linux",
3096 any(target_arch = "mips",
3097 target_arch = "mipsel",
3098 target_arch = "aarch64",
3099 target_arch = "powerpc")))]
3100 pub const PTHREAD_STACK_MIN: size_t = 131072;
3102 pub const CLOCK_REALTIME: c_int = 0;
3103 pub const CLOCK_MONOTONIC: c_int = 1;
3105 #[cfg(target_os = "nacl")]
3107 use types::os::arch::c95::{c_int, size_t};
3109 pub const F_DUPFD : c_int = 0;
3110 pub const F_GETFD : c_int = 1;
3111 pub const F_SETFD : c_int = 2;
3112 pub const F_GETFL : c_int = 3;
3113 pub const F_SETFL : c_int = 4;
3115 pub const SIGTRAP : c_int = 5;
3116 pub const SIG_IGN: size_t = 1;
3118 pub const GLOB_ERR : c_int = 1 << 0;
3119 pub const GLOB_MARK : c_int = 1 << 1;
3120 pub const GLOB_NOSORT : c_int = 1 << 2;
3121 pub const GLOB_DOOFFS : c_int = 1 << 3;
3122 pub const GLOB_NOCHECK : c_int = 1 << 4;
3123 pub const GLOB_APPEND : c_int = 1 << 5;
3124 pub const GLOB_NOESCAPE : c_int = 1 << 6;
3126 pub const GLOB_NOSPACE : c_int = 1;
3127 pub const GLOB_ABORTED : c_int = 2;
3128 pub const GLOB_NOMATCH : c_int = 3;
3130 pub const POSIX_MADV_NORMAL : c_int = 0;
3131 pub const POSIX_MADV_RANDOM : c_int = 1;
3132 pub const POSIX_MADV_SEQUENTIAL : c_int = 2;
3133 pub const POSIX_MADV_WILLNEED : c_int = 3;
3134 pub const POSIX_MADV_DONTNEED : c_int = 4;
3136 pub const _SC_MQ_PRIO_MAX : c_int = 28;
3137 pub const _SC_IOV_MAX : c_int = 60;
3138 pub const _SC_GETGR_R_SIZE_MAX : c_int = 69;
3139 pub const _SC_GETPW_R_SIZE_MAX : c_int = 70;
3140 pub const _SC_LOGIN_NAME_MAX : c_int = 71;
3141 pub const _SC_TTY_NAME_MAX : c_int = 72;
3142 pub const _SC_THREADS : c_int = 67;
3143 pub const _SC_THREAD_SAFE_FUNCTIONS : c_int = 68;
3144 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : c_int = 73;
3145 pub const _SC_THREAD_KEYS_MAX : c_int = 74;
3146 pub const _SC_THREAD_STACK_MIN : c_int = 75;
3147 pub const _SC_THREAD_THREADS_MAX : c_int = 76;
3148 pub const _SC_THREAD_ATTR_STACKADDR : c_int = 77;
3149 pub const _SC_THREAD_ATTR_STACKSIZE : c_int = 78;
3150 pub const _SC_THREAD_PRIORITY_SCHEDULING : c_int = 79;
3151 pub const _SC_THREAD_PRIO_INHERIT : c_int = 80;
3152 pub const _SC_THREAD_PRIO_PROTECT : c_int = 81;
3153 pub const _SC_THREAD_PROCESS_SHARED : c_int = 82;
3154 pub const _SC_ATEXIT_MAX : c_int = 87;
3155 pub const _SC_XOPEN_VERSION : c_int = 89;
3156 pub const _SC_XOPEN_XCU_VERSION : c_int = 90;
3157 pub const _SC_XOPEN_UNIX : c_int = 91;
3158 pub const _SC_XOPEN_CRYPT : c_int = 92;
3159 pub const _SC_XOPEN_ENH_I18N : c_int = 93;
3160 pub const _SC_XOPEN_SHM : c_int = 94;
3161 pub const _SC_XOPEN_LEGACY : c_int = 129;
3162 pub const _SC_XOPEN_REALTIME : c_int = 130;
3163 pub const _SC_XOPEN_REALTIME_THREADS : c_int = 131;
3165 pub const PTHREAD_CREATE_JOINABLE: c_int = 1;
3166 pub const PTHREAD_CREATE_DETACHED: c_int = 0;
3168 pub const PTHREAD_STACK_MIN: size_t = 1024;
3170 pub const CLOCK_REALTIME: c_int = 0;
3171 pub const CLOCK_MONOTONIC: c_int = 1;
3175 #[cfg(any(target_arch = "arm",
3176 target_arch = "aarch64",
3177 target_arch = "x86",
3178 target_arch = "x86_64",
3179 target_arch = "le32",
3180 target_arch = "powerpc"))]
3182 use types::os::arch::c95::c_int;
3184 pub const MADV_NORMAL : c_int = 0;
3185 pub const MADV_RANDOM : c_int = 1;
3186 pub const MADV_SEQUENTIAL : c_int = 2;
3187 pub const MADV_WILLNEED : c_int = 3;
3188 pub const MADV_DONTNEED : c_int = 4;
3189 pub const MADV_REMOVE : c_int = 9;
3190 pub const MADV_DONTFORK : c_int = 10;
3191 pub const MADV_DOFORK : c_int = 11;
3192 pub const MADV_MERGEABLE : c_int = 12;
3193 pub const MADV_UNMERGEABLE : c_int = 13;
3194 pub const MADV_HWPOISON : c_int = 100;
3196 pub const IFF_LOOPBACK: c_int = 0x8;
3198 pub const AF_UNIX: c_int = 1;
3199 pub const AF_INET: c_int = 2;
3200 pub const AF_INET6: c_int = 10;
3201 pub const SOCK_STREAM: c_int = 1;
3202 pub const SOCK_DGRAM: c_int = 2;
3203 pub const SOCK_RAW: c_int = 3;
3204 pub const IPPROTO_TCP: c_int = 6;
3205 pub const IPPROTO_IP: c_int = 0;
3206 pub const IPPROTO_IPV6: c_int = 41;
3207 pub const IP_MULTICAST_TTL: c_int = 33;
3208 pub const IP_MULTICAST_LOOP: c_int = 34;
3209 pub const IP_TTL: c_int = 2;
3210 pub const IP_HDRINCL: c_int = 3;
3211 pub const IP_ADD_MEMBERSHIP: c_int = 35;
3212 pub const IP_DROP_MEMBERSHIP: c_int = 36;
3213 pub const IPV6_ADD_MEMBERSHIP: c_int = 20;
3214 pub const IPV6_DROP_MEMBERSHIP: c_int = 21;
3216 pub const TCP_NODELAY: c_int = 1;
3217 pub const SOL_SOCKET: c_int = 1;
3218 pub const SO_KEEPALIVE: c_int = 9;
3219 pub const SO_BROADCAST: c_int = 6;
3220 pub const SO_REUSEADDR: c_int = 2;
3221 pub const SO_ERROR: c_int = 4;
3223 pub const SHUT_RD: c_int = 0;
3224 pub const SHUT_WR: c_int = 1;
3225 pub const SHUT_RDWR: c_int = 2;
3227 #[cfg(any(target_arch = "mips",
3228 target_arch = "mipsel"))]
3230 use types::os::arch::c95::c_int;
3232 pub const MADV_NORMAL : c_int = 0;
3233 pub const MADV_RANDOM : c_int = 1;
3234 pub const MADV_SEQUENTIAL : c_int = 2;
3235 pub const MADV_WILLNEED : c_int = 3;
3236 pub const MADV_DONTNEED : c_int = 4;
3237 pub const MADV_REMOVE : c_int = 9;
3238 pub const MADV_DONTFORK : c_int = 10;
3239 pub const MADV_DOFORK : c_int = 11;
3240 pub const MADV_MERGEABLE : c_int = 12;
3241 pub const MADV_UNMERGEABLE : c_int = 13;
3242 pub const MADV_HWPOISON : c_int = 100;
3244 pub const AF_UNIX: c_int = 1;
3245 pub const AF_INET: c_int = 2;
3246 pub const AF_INET6: c_int = 10;
3247 pub const SOCK_STREAM: c_int = 2;
3248 pub const SOCK_DGRAM: c_int = 1;
3249 pub const SOCK_RAW: c_int = 3;
3250 pub const IPPROTO_TCP: c_int = 6;
3251 pub const IPPROTO_IP: c_int = 0;
3252 pub const IPPROTO_IPV6: c_int = 41;
3253 pub const IP_MULTICAST_TTL: c_int = 33;
3254 pub const IP_MULTICAST_LOOP: c_int = 34;
3255 pub const IP_TTL: c_int = 2;
3256 pub const IP_HDRINCL: c_int = 3;
3257 pub const IP_ADD_MEMBERSHIP: c_int = 35;
3258 pub const IP_DROP_MEMBERSHIP: c_int = 36;
3259 pub const IPV6_ADD_MEMBERSHIP: c_int = 20;
3260 pub const IPV6_DROP_MEMBERSHIP: c_int = 21;
3262 pub const TCP_NODELAY: c_int = 1;
3263 pub const SOL_SOCKET: c_int = 65535;
3264 pub const SO_KEEPALIVE: c_int = 8;
3265 pub const SO_BROADCAST: c_int = 32;
3266 pub const SO_REUSEADDR: c_int = 4;
3267 pub const SO_ERROR: c_int = 4103;
3269 pub const SHUT_RD: c_int = 0;
3270 pub const SHUT_WR: c_int = 1;
3271 pub const SHUT_RDWR: c_int = 2;
3273 #[cfg(any(target_arch = "x86",
3274 target_arch = "x86_64",
3275 target_arch = "arm",
3276 target_arch = "aarch64",
3277 target_arch = "le32",
3278 target_arch = "powerpc"))]
3280 use types::os::arch::c95::c_int;
3282 pub const AF_PACKET : c_int = 17;
3283 pub const IPPROTO_RAW : c_int = 255;
3285 pub const O_RSYNC : c_int = 1052672;
3286 pub const O_DSYNC : c_int = 4096;
3287 pub const O_NONBLOCK : c_int = 2048;
3288 pub const O_SYNC : c_int = 1052672;
3290 pub const PROT_GROWSDOWN : c_int = 0x010000000;
3291 pub const PROT_GROWSUP : c_int = 0x020000000;
3293 pub const MAP_TYPE : c_int = 0x000f;
3294 pub const MAP_ANONYMOUS : c_int = 0x0020;
3295 pub const MAP_32BIT : c_int = 0x0040;
3296 pub const MAP_GROWSDOWN : c_int = 0x0100;
3297 pub const MAP_DENYWRITE : c_int = 0x0800;
3298 pub const MAP_EXECUTABLE : c_int = 0x01000;
3299 pub const MAP_LOCKED : c_int = 0x02000;
3300 pub const MAP_NONRESERVE : c_int = 0x04000;
3301 pub const MAP_POPULATE : c_int = 0x08000;
3302 pub const MAP_NONBLOCK : c_int = 0x010000;
3303 pub const MAP_STACK : c_int = 0x020000;
3305 #[cfg(any(target_arch = "mips",
3306 target_arch = "mipsel"))]
3308 use types::os::arch::c95::c_int;
3310 pub const AF_PACKET : c_int = 17;
3311 pub const IPPROTO_RAW : c_int = 255;
3313 pub const O_RSYNC : c_int = 16400;
3314 pub const O_DSYNC : c_int = 16;
3315 pub const O_NONBLOCK : c_int = 128;
3316 pub const O_SYNC : c_int = 16400;
3318 pub const PROT_GROWSDOWN : c_int = 0x01000000;
3319 pub const PROT_GROWSUP : c_int = 0x02000000;
3321 pub const MAP_TYPE : c_int = 0x000f;
3322 pub const MAP_ANONYMOUS : c_int = 0x0800;
3323 pub const MAP_GROWSDOWN : c_int = 0x01000;
3324 pub const MAP_DENYWRITE : c_int = 0x02000;
3325 pub const MAP_EXECUTABLE : c_int = 0x04000;
3326 pub const MAP_LOCKED : c_int = 0x08000;
3327 pub const MAP_NONRESERVE : c_int = 0x0400;
3328 pub const MAP_POPULATE : c_int = 0x010000;
3329 pub const MAP_NONBLOCK : c_int = 0x020000;
3330 pub const MAP_STACK : c_int = 0x040000;
3332 #[cfg(target_os = "linux")]
3334 use types::os::arch::c95::c_int;
3336 pub const _SC_ARG_MAX : c_int = 0;
3337 pub const _SC_CHILD_MAX : c_int = 1;
3338 pub const _SC_CLK_TCK : c_int = 2;
3339 pub const _SC_NGROUPS_MAX : c_int = 3;
3340 pub const _SC_OPEN_MAX : c_int = 4;
3341 pub const _SC_STREAM_MAX : c_int = 5;
3342 pub const _SC_TZNAME_MAX : c_int = 6;
3343 pub const _SC_JOB_CONTROL : c_int = 7;
3344 pub const _SC_SAVED_IDS : c_int = 8;
3345 pub const _SC_REALTIME_SIGNALS : c_int = 9;
3346 pub const _SC_PRIORITY_SCHEDULING : c_int = 10;
3347 pub const _SC_TIMERS : c_int = 11;
3348 pub const _SC_ASYNCHRONOUS_IO : c_int = 12;
3349 pub const _SC_PRIORITIZED_IO : c_int = 13;
3350 pub const _SC_SYNCHRONIZED_IO : c_int = 14;
3351 pub const _SC_FSYNC : c_int = 15;
3352 pub const _SC_MAPPED_FILES : c_int = 16;
3353 pub const _SC_MEMLOCK : c_int = 17;
3354 pub const _SC_MEMLOCK_RANGE : c_int = 18;
3355 pub const _SC_MEMORY_PROTECTION : c_int = 19;
3356 pub const _SC_MESSAGE_PASSING : c_int = 20;
3357 pub const _SC_SEMAPHORES : c_int = 21;
3358 pub const _SC_SHARED_MEMORY_OBJECTS : c_int = 22;
3359 pub const _SC_AIO_LISTIO_MAX : c_int = 23;
3360 pub const _SC_AIO_MAX : c_int = 24;
3361 pub const _SC_AIO_PRIO_DELTA_MAX : c_int = 25;
3362 pub const _SC_DELAYTIMER_MAX : c_int = 26;
3363 pub const _SC_MQ_OPEN_MAX : c_int = 27;
3364 pub const _SC_VERSION : c_int = 29;
3365 pub const _SC_PAGESIZE : c_int = 30;
3366 pub const _SC_RTSIG_MAX : c_int = 31;
3367 pub const _SC_SEM_NSEMS_MAX : c_int = 32;
3368 pub const _SC_SEM_VALUE_MAX : c_int = 33;
3369 pub const _SC_SIGQUEUE_MAX : c_int = 34;
3370 pub const _SC_TIMER_MAX : c_int = 35;
3371 pub const _SC_BC_BASE_MAX : c_int = 36;
3372 pub const _SC_BC_DIM_MAX : c_int = 37;
3373 pub const _SC_BC_SCALE_MAX : c_int = 38;
3374 pub const _SC_BC_STRING_MAX : c_int = 39;
3375 pub const _SC_COLL_WEIGHTS_MAX : c_int = 40;
3376 pub const _SC_EXPR_NEST_MAX : c_int = 42;
3377 pub const _SC_LINE_MAX : c_int = 43;
3378 pub const _SC_RE_DUP_MAX : c_int = 44;
3379 pub const _SC_2_VERSION : c_int = 46;
3380 pub const _SC_2_C_BIND : c_int = 47;
3381 pub const _SC_2_C_DEV : c_int = 48;
3382 pub const _SC_2_FORT_DEV : c_int = 49;
3383 pub const _SC_2_FORT_RUN : c_int = 50;
3384 pub const _SC_2_SW_DEV : c_int = 51;
3385 pub const _SC_2_LOCALEDEF : c_int = 52;
3386 pub const _SC_2_CHAR_TERM : c_int = 95;
3387 pub const _SC_2_C_VERSION : c_int = 96;
3388 pub const _SC_2_UPE : c_int = 97;
3389 pub const _SC_XBS5_ILP32_OFF32 : c_int = 125;
3390 pub const _SC_XBS5_ILP32_OFFBIG : c_int = 126;
3391 pub const _SC_XBS5_LPBIG_OFFBIG : c_int = 128;
3393 #[cfg(target_os = "nacl")]
3395 use types::os::arch::c95::c_int;
3397 pub static _SC_SENDMSG_MAX_SIZE : c_int = 0;
3398 pub static _SC_NPROCESSORS_ONLN : c_int = 1;
3399 pub static _SC_PAGESIZE : c_int = 2;
3401 #[cfg(target_os = "android")]
3403 use types::os::arch::c95::c_int;
3405 pub const _SC_ARG_MAX : c_int = 0;
3406 pub const _SC_BC_BASE_MAX : c_int = 1;
3407 pub const _SC_BC_DIM_MAX : c_int = 2;
3408 pub const _SC_BC_SCALE_MAX : c_int = 3;
3409 pub const _SC_BC_STRING_MAX : c_int = 4;
3410 pub const _SC_CHILD_MAX : c_int = 5;
3411 pub const _SC_CLK_TCK : c_int = 6;
3412 pub const _SC_COLL_WEIGHTS_MAX : c_int = 7;
3413 pub const _SC_EXPR_NEST_MAX : c_int = 8;
3414 pub const _SC_LINE_MAX : c_int = 9;
3415 pub const _SC_NGROUPS_MAX : c_int = 10;
3416 pub const _SC_OPEN_MAX : c_int = 11;
3417 pub const _SC_2_C_BIND : c_int = 13;
3418 pub const _SC_2_C_DEV : c_int = 14;
3419 pub const _SC_2_C_VERSION : c_int = 15;
3420 pub const _SC_2_CHAR_TERM : c_int = 16;
3421 pub const _SC_2_FORT_DEV : c_int = 17;
3422 pub const _SC_2_FORT_RUN : c_int = 18;
3423 pub const _SC_2_LOCALEDEF : c_int = 19;
3424 pub const _SC_2_SW_DEV : c_int = 20;
3425 pub const _SC_2_UPE : c_int = 21;
3426 pub const _SC_2_VERSION : c_int = 22;
3427 pub const _SC_JOB_CONTROL : c_int = 23;
3428 pub const _SC_SAVED_IDS : c_int = 24;
3429 pub const _SC_VERSION : c_int = 25;
3430 pub const _SC_RE_DUP_MAX : c_int = 26;
3431 pub const _SC_STREAM_MAX : c_int = 27;
3432 pub const _SC_TZNAME_MAX : c_int = 28;
3433 pub const _SC_PAGESIZE : c_int = 39;
3437 #[cfg(any(target_os = "freebsd",
3438 target_os = "dragonfly"))]
3441 use types::os::arch::c95::{c_int, c_uint};
3443 pub const EXIT_FAILURE : c_int = 1;
3444 pub const EXIT_SUCCESS : c_int = 0;
3445 pub const RAND_MAX : c_int = 2147483647;
3446 pub const EOF : c_int = -1;
3447 pub const SEEK_SET : c_int = 0;
3448 pub const SEEK_CUR : c_int = 1;
3449 pub const SEEK_END : c_int = 2;
3450 pub const _IOFBF : c_int = 0;
3451 pub const _IONBF : c_int = 2;
3452 pub const _IOLBF : c_int = 1;
3453 pub const BUFSIZ : c_uint = 1024_u32;
3454 pub const FOPEN_MAX : c_uint = 20_u32;
3455 pub const FILENAME_MAX : c_uint = 1024_u32;
3456 pub const L_tmpnam : c_uint = 1024_u32;
3457 pub const TMP_MAX : c_uint = 308915776_u32;
3462 use types::common::c95::c_void;
3463 use types::os::arch::c95::c_int;
3464 use types::os::arch::posix88::mode_t;
3466 pub const O_RDONLY : c_int = 0;
3467 pub const O_WRONLY : c_int = 1;
3468 pub const O_RDWR : c_int = 2;
3469 pub const O_APPEND : c_int = 8;
3470 pub const O_CREAT : c_int = 512;
3471 pub const O_EXCL : c_int = 2048;
3472 pub const O_TRUNC : c_int = 1024;
3473 pub const S_IFIFO : mode_t = 4096;
3474 pub const S_IFCHR : mode_t = 8192;
3475 pub const S_IFBLK : mode_t = 24576;
3476 pub const S_IFDIR : mode_t = 16384;
3477 pub const S_IFREG : mode_t = 32768;
3478 pub const S_IFLNK : mode_t = 40960;
3479 pub const S_IFMT : mode_t = 61440;
3480 pub const S_IEXEC : mode_t = 64;
3481 pub const S_IWRITE : mode_t = 128;
3482 pub const S_IREAD : mode_t = 256;
3483 pub const S_IRWXU : mode_t = 448;
3484 pub const S_IXUSR : mode_t = 64;
3485 pub const S_IWUSR : mode_t = 128;
3486 pub const S_IRUSR : mode_t = 256;
3487 pub const F_OK : c_int = 0;
3488 pub const R_OK : c_int = 4;
3489 pub const W_OK : c_int = 2;
3490 pub const X_OK : c_int = 1;
3491 pub const STDIN_FILENO : c_int = 0;
3492 pub const STDOUT_FILENO : c_int = 1;
3493 pub const STDERR_FILENO : c_int = 2;
3494 pub const F_LOCK : c_int = 1;
3495 pub const F_TEST : c_int = 3;
3496 pub const F_TLOCK : c_int = 2;
3497 pub const F_ULOCK : c_int = 0;
3498 pub const SIGHUP : c_int = 1;
3499 pub const SIGINT : c_int = 2;
3500 pub const SIGQUIT : c_int = 3;
3501 pub const SIGILL : c_int = 4;
3502 pub const SIGABRT : c_int = 6;
3503 pub const SIGFPE : c_int = 8;
3504 pub const SIGKILL : c_int = 9;
3505 pub const SIGSEGV : c_int = 11;
3506 pub const SIGPIPE : c_int = 13;
3507 pub const SIGALRM : c_int = 14;
3508 pub const SIGTERM : c_int = 15;
3510 pub const PROT_NONE : c_int = 0;
3511 pub const PROT_READ : c_int = 1;
3512 pub const PROT_WRITE : c_int = 2;
3513 pub const PROT_EXEC : c_int = 4;
3515 pub const MAP_FILE : c_int = 0x0000;
3516 pub const MAP_SHARED : c_int = 0x0001;
3517 pub const MAP_PRIVATE : c_int = 0x0002;
3518 pub const MAP_FIXED : c_int = 0x0010;
3519 pub const MAP_ANON : c_int = 0x1000;
3521 pub const MAP_FAILED : *mut c_void = -1 as *mut c_void;
3523 pub const MCL_CURRENT : c_int = 0x0001;
3524 pub const MCL_FUTURE : c_int = 0x0002;
3526 pub const MS_SYNC : c_int = 0x0000;
3527 pub const MS_ASYNC : c_int = 0x0001;
3528 pub const MS_INVALIDATE : c_int = 0x0002;
3530 pub const EPERM : c_int = 1;
3531 pub const ENOENT : c_int = 2;
3532 pub const ESRCH : c_int = 3;
3533 pub const EINTR : c_int = 4;
3534 pub const EIO : c_int = 5;
3535 pub const ENXIO : c_int = 6;
3536 pub const E2BIG : c_int = 7;
3537 pub const ENOEXEC : c_int = 8;
3538 pub const EBADF : c_int = 9;
3539 pub const ECHILD : c_int = 10;
3540 pub const EDEADLK : c_int = 11;
3541 pub const ENOMEM : c_int = 12;
3542 pub const EACCES : c_int = 13;
3543 pub const EFAULT : c_int = 14;
3544 pub const ENOTBLK : c_int = 15;
3545 pub const EBUSY : c_int = 16;
3546 pub const EEXIST : c_int = 17;
3547 pub const EXDEV : c_int = 18;
3548 pub const ENODEV : c_int = 19;
3549 pub const ENOTDIR : c_int = 20;
3550 pub const EISDIR : c_int = 21;
3551 pub const EINVAL : c_int = 22;
3552 pub const ENFILE : c_int = 23;
3553 pub const EMFILE : c_int = 24;
3554 pub const ENOTTY : c_int = 25;
3555 pub const ETXTBSY : c_int = 26;
3556 pub const EFBIG : c_int = 27;
3557 pub const ENOSPC : c_int = 28;
3558 pub const ESPIPE : c_int = 29;
3559 pub const EROFS : c_int = 30;
3560 pub const EMLINK : c_int = 31;
3561 pub const EPIPE : c_int = 32;
3562 pub const EDOM : c_int = 33;
3563 pub const ERANGE : c_int = 34;
3564 pub const EAGAIN : c_int = 35;
3565 pub const EWOULDBLOCK : c_int = 35;
3566 pub const EINPROGRESS : c_int = 36;
3567 pub const EALREADY : c_int = 37;
3568 pub const ENOTSOCK : c_int = 38;
3569 pub const EDESTADDRREQ : c_int = 39;
3570 pub const EMSGSIZE : c_int = 40;
3571 pub const EPROTOTYPE : c_int = 41;
3572 pub const ENOPROTOOPT : c_int = 42;
3573 pub const EPROTONOSUPPORT : c_int = 43;
3574 pub const ESOCKTNOSUPPORT : c_int = 44;
3575 pub const EOPNOTSUPP : c_int = 45;
3576 pub const EPFNOSUPPORT : c_int = 46;
3577 pub const EAFNOSUPPORT : c_int = 47;
3578 pub const EADDRINUSE : c_int = 48;
3579 pub const EADDRNOTAVAIL : c_int = 49;
3580 pub const ENETDOWN : c_int = 50;
3581 pub const ENETUNREACH : c_int = 51;
3582 pub const ENETRESET : c_int = 52;
3583 pub const ECONNABORTED : c_int = 53;
3584 pub const ECONNRESET : c_int = 54;
3585 pub const ENOBUFS : c_int = 55;
3586 pub const EISCONN : c_int = 56;
3587 pub const ENOTCONN : c_int = 57;
3588 pub const ESHUTDOWN : c_int = 58;
3589 pub const ETOOMANYREFS : c_int = 59;
3590 pub const ETIMEDOUT : c_int = 60;
3591 pub const ECONNREFUSED : c_int = 61;
3592 pub const ELOOP : c_int = 62;
3593 pub const ENAMETOOLONG : c_int = 63;
3594 pub const EHOSTDOWN : c_int = 64;
3595 pub const EHOSTUNREACH : c_int = 65;
3596 pub const ENOTEMPTY : c_int = 66;
3597 pub const EPROCLIM : c_int = 67;
3598 pub const EUSERS : c_int = 68;
3599 pub const EDQUOT : c_int = 69;
3600 pub const ESTALE : c_int = 70;
3601 pub const EREMOTE : c_int = 71;
3602 pub const EBADRPC : c_int = 72;
3603 pub const ERPCMISMATCH : c_int = 73;
3604 pub const EPROGUNAVAIL : c_int = 74;
3605 pub const EPROGMISMATCH : c_int = 75;
3606 pub const EPROCUNAVAIL : c_int = 76;
3607 pub const ENOLCK : c_int = 77;
3608 pub const ENOSYS : c_int = 78;
3609 pub const EFTYPE : c_int = 79;
3610 pub const EAUTH : c_int = 80;
3611 pub const ENEEDAUTH : c_int = 81;
3612 pub const EIDRM : c_int = 82;
3613 pub const ENOMSG : c_int = 83;
3614 pub const EOVERFLOW : c_int = 84;
3615 pub const ECANCELED : c_int = 85;
3616 pub const EILSEQ : c_int = 86;
3617 pub const ENOATTR : c_int = 87;
3618 pub const EDOOFUS : c_int = 88;
3619 pub const EBADMSG : c_int = 89;
3620 pub const EMULTIHOP : c_int = 90;
3621 pub const ENOLINK : c_int = 91;
3622 pub const EPROTO : c_int = 92;
3623 pub const ENOMEDIUM : c_int = 93;
3624 pub const EUNUSED94 : c_int = 94;
3625 pub const EUNUSED95 : c_int = 95;
3626 pub const EUNUSED96 : c_int = 96;
3627 pub const EUNUSED97 : c_int = 97;
3628 pub const EUNUSED98 : c_int = 98;
3629 pub const EASYNC : c_int = 99;
3630 pub const ELAST : c_int = 99;
3633 use types::os::arch::c95::{c_int, size_t};
3635 pub const F_DUPFD : c_int = 0;
3636 pub const F_GETFD : c_int = 1;
3637 pub const F_SETFD : c_int = 2;
3638 pub const F_GETFL : c_int = 3;
3639 pub const F_SETFL : c_int = 4;
3641 pub const SIGTRAP : c_int = 5;
3642 pub const SIG_IGN: size_t = 1;
3644 pub const GLOB_APPEND : c_int = 0x0001;
3645 pub const GLOB_DOOFFS : c_int = 0x0002;
3646 pub const GLOB_ERR : c_int = 0x0004;
3647 pub const GLOB_MARK : c_int = 0x0008;
3648 pub const GLOB_NOCHECK : c_int = 0x0010;
3649 pub const GLOB_NOSORT : c_int = 0x0020;
3650 pub const GLOB_NOESCAPE : c_int = 0x2000;
3652 pub const GLOB_NOSPACE : c_int = -1;
3653 pub const GLOB_ABORTED : c_int = -2;
3654 pub const GLOB_NOMATCH : c_int = -3;
3656 pub const POSIX_MADV_NORMAL : c_int = 0;
3657 pub const POSIX_MADV_RANDOM : c_int = 1;
3658 pub const POSIX_MADV_SEQUENTIAL : c_int = 2;
3659 pub const POSIX_MADV_WILLNEED : c_int = 3;
3660 pub const POSIX_MADV_DONTNEED : c_int = 4;
3662 pub const _SC_IOV_MAX : c_int = 56;
3663 pub const _SC_GETGR_R_SIZE_MAX : c_int = 70;
3664 pub const _SC_GETPW_R_SIZE_MAX : c_int = 71;
3665 pub const _SC_LOGIN_NAME_MAX : c_int = 73;
3666 pub const _SC_MQ_PRIO_MAX : c_int = 75;
3667 pub const _SC_THREAD_ATTR_STACKADDR : c_int = 82;
3668 pub const _SC_THREAD_ATTR_STACKSIZE : c_int = 83;
3669 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : c_int = 85;
3670 pub const _SC_THREAD_KEYS_MAX : c_int = 86;
3671 pub const _SC_THREAD_PRIO_INHERIT : c_int = 87;
3672 pub const _SC_THREAD_PRIO_PROTECT : c_int = 88;
3673 pub const _SC_THREAD_PRIORITY_SCHEDULING : c_int = 89;
3674 pub const _SC_THREAD_PROCESS_SHARED : c_int = 90;
3675 pub const _SC_THREAD_SAFE_FUNCTIONS : c_int = 91;
3676 pub const _SC_THREAD_STACK_MIN : c_int = 93;
3677 pub const _SC_THREAD_THREADS_MAX : c_int = 94;
3678 pub const _SC_THREADS : c_int = 96;
3679 pub const _SC_TTY_NAME_MAX : c_int = 101;
3680 pub const _SC_ATEXIT_MAX : c_int = 107;
3681 pub const _SC_XOPEN_CRYPT : c_int = 108;
3682 pub const _SC_XOPEN_ENH_I18N : c_int = 109;
3683 pub const _SC_XOPEN_LEGACY : c_int = 110;
3684 pub const _SC_XOPEN_REALTIME : c_int = 111;
3685 pub const _SC_XOPEN_REALTIME_THREADS : c_int = 112;
3686 pub const _SC_XOPEN_SHM : c_int = 113;
3687 pub const _SC_XOPEN_UNIX : c_int = 115;
3688 pub const _SC_XOPEN_VERSION : c_int = 116;
3689 pub const _SC_XOPEN_XCU_VERSION : c_int = 117;
3691 pub const PTHREAD_CREATE_JOINABLE: c_int = 0;
3692 pub const PTHREAD_CREATE_DETACHED: c_int = 1;
3694 #[cfg(target_arch = "arm")]
3695 pub const PTHREAD_STACK_MIN: size_t = 4096;
3697 #[cfg(all(target_os = "freebsd",
3698 any(target_arch = "mips",
3699 target_arch = "mipsel",
3700 target_arch = "x86",
3701 target_arch = "x86_64")))]
3702 pub const PTHREAD_STACK_MIN: size_t = 2048;
3704 #[cfg(target_os = "dragonfly")]
3705 pub const PTHREAD_STACK_MIN: size_t = 1024;
3707 pub const CLOCK_REALTIME: c_int = 0;
3708 pub const CLOCK_MONOTONIC: c_int = 4;
3713 use types::os::arch::c95::c_int;
3715 pub const MADV_NORMAL : c_int = 0;
3716 pub const MADV_RANDOM : c_int = 1;
3717 pub const MADV_SEQUENTIAL : c_int = 2;
3718 pub const MADV_WILLNEED : c_int = 3;
3719 pub const MADV_DONTNEED : c_int = 4;
3720 pub const MADV_FREE : c_int = 5;
3721 pub const MADV_NOSYNC : c_int = 6;
3722 pub const MADV_AUTOSYNC : c_int = 7;
3723 pub const MADV_NOCORE : c_int = 8;
3724 pub const MADV_CORE : c_int = 9;
3725 pub const MADV_PROTECT : c_int = 10;
3727 pub const MINCORE_INCORE : c_int = 0x1;
3728 pub const MINCORE_REFERENCED : c_int = 0x2;
3729 pub const MINCORE_MODIFIED : c_int = 0x4;
3730 pub const MINCORE_REFERENCED_OTHER : c_int = 0x8;
3731 pub const MINCORE_MODIFIED_OTHER : c_int = 0x10;
3732 pub const MINCORE_SUPER : c_int = 0x20;
3734 pub const AF_INET: c_int = 2;
3735 pub const AF_INET6: c_int = 28;
3736 pub const AF_UNIX: c_int = 1;
3737 pub const SOCK_STREAM: c_int = 1;
3738 pub const SOCK_DGRAM: c_int = 2;
3739 pub const SOCK_RAW: c_int = 3;
3740 pub const IPPROTO_TCP: c_int = 6;
3741 pub const IPPROTO_IP: c_int = 0;
3742 pub const IPPROTO_IPV6: c_int = 41;
3743 pub const IP_MULTICAST_TTL: c_int = 10;
3744 pub const IP_MULTICAST_LOOP: c_int = 11;
3745 pub const IP_TTL: c_int = 4;
3746 pub const IP_HDRINCL: c_int = 2;
3747 pub const IP_ADD_MEMBERSHIP: c_int = 12;
3748 pub const IP_DROP_MEMBERSHIP: c_int = 13;
3749 pub const IPV6_ADD_MEMBERSHIP: c_int = 12;
3750 pub const IPV6_DROP_MEMBERSHIP: c_int = 13;
3752 pub const TCP_NODELAY: c_int = 1;
3753 pub const TCP_KEEPIDLE: c_int = 256;
3754 pub const SOL_SOCKET: c_int = 0xffff;
3755 pub const SO_KEEPALIVE: c_int = 0x0008;
3756 pub const SO_BROADCAST: c_int = 0x0020;
3757 pub const SO_REUSEADDR: c_int = 0x0004;
3758 pub const SO_ERROR: c_int = 0x1007;
3760 pub const IFF_LOOPBACK: c_int = 0x8;
3762 pub const SHUT_RD: c_int = 0;
3763 pub const SHUT_WR: c_int = 1;
3764 pub const SHUT_RDWR: c_int = 2;
3767 use types::os::arch::c95::c_int;
3769 pub const O_SYNC : c_int = 128;
3770 pub const O_NONBLOCK : c_int = 4;
3771 pub const CTL_KERN: c_int = 1;
3772 pub const KERN_PROC: c_int = 14;
3773 #[cfg(target_os = "freebsd")]
3774 pub const KERN_PROC_PATHNAME: c_int = 12;
3775 #[cfg(target_os = "dragonfly")]
3776 pub const KERN_PROC_PATHNAME: c_int = 9;
3778 pub const MAP_COPY : c_int = 0x0002;
3779 pub const MAP_RENAME : c_int = 0x0020;
3780 pub const MAP_NORESERVE : c_int = 0x0040;
3781 pub const MAP_HASSEMAPHORE : c_int = 0x0200;
3782 pub const MAP_STACK : c_int = 0x0400;
3783 pub const MAP_NOSYNC : c_int = 0x0800;
3784 pub const MAP_NOCORE : c_int = 0x020000;
3786 pub const IPPROTO_RAW : c_int = 255;
3789 use types::os::arch::c95::c_int;
3791 pub const _SC_ARG_MAX : c_int = 1;
3792 pub const _SC_CHILD_MAX : c_int = 2;
3793 pub const _SC_CLK_TCK : c_int = 3;
3794 pub const _SC_NGROUPS_MAX : c_int = 4;
3795 pub const _SC_OPEN_MAX : c_int = 5;
3796 pub const _SC_JOB_CONTROL : c_int = 6;
3797 pub const _SC_SAVED_IDS : c_int = 7;
3798 pub const _SC_VERSION : c_int = 8;
3799 pub const _SC_BC_BASE_MAX : c_int = 9;
3800 pub const _SC_BC_DIM_MAX : c_int = 10;
3801 pub const _SC_BC_SCALE_MAX : c_int = 11;
3802 pub const _SC_BC_STRING_MAX : c_int = 12;
3803 pub const _SC_COLL_WEIGHTS_MAX : c_int = 13;
3804 pub const _SC_EXPR_NEST_MAX : c_int = 14;
3805 pub const _SC_LINE_MAX : c_int = 15;
3806 pub const _SC_RE_DUP_MAX : c_int = 16;
3807 pub const _SC_2_VERSION : c_int = 17;
3808 pub const _SC_2_C_BIND : c_int = 18;
3809 pub const _SC_2_C_DEV : c_int = 19;
3810 pub const _SC_2_CHAR_TERM : c_int = 20;
3811 pub const _SC_2_FORT_DEV : c_int = 21;
3812 pub const _SC_2_FORT_RUN : c_int = 22;
3813 pub const _SC_2_LOCALEDEF : c_int = 23;
3814 pub const _SC_2_SW_DEV : c_int = 24;
3815 pub const _SC_2_UPE : c_int = 25;
3816 pub const _SC_STREAM_MAX : c_int = 26;
3817 pub const _SC_TZNAME_MAX : c_int = 27;
3818 pub const _SC_ASYNCHRONOUS_IO : c_int = 28;
3819 pub const _SC_MAPPED_FILES : c_int = 29;
3820 pub const _SC_MEMLOCK : c_int = 30;
3821 pub const _SC_MEMLOCK_RANGE : c_int = 31;
3822 pub const _SC_MEMORY_PROTECTION : c_int = 32;
3823 pub const _SC_MESSAGE_PASSING : c_int = 33;
3824 pub const _SC_PRIORITIZED_IO : c_int = 34;
3825 pub const _SC_PRIORITY_SCHEDULING : c_int = 35;
3826 pub const _SC_REALTIME_SIGNALS : c_int = 36;
3827 pub const _SC_SEMAPHORES : c_int = 37;
3828 pub const _SC_FSYNC : c_int = 38;
3829 pub const _SC_SHARED_MEMORY_OBJECTS : c_int = 39;
3830 pub const _SC_SYNCHRONIZED_IO : c_int = 40;
3831 pub const _SC_TIMERS : c_int = 41;
3832 pub const _SC_AIO_LISTIO_MAX : c_int = 42;
3833 pub const _SC_AIO_MAX : c_int = 43;
3834 pub const _SC_AIO_PRIO_DELTA_MAX : c_int = 44;
3835 pub const _SC_DELAYTIMER_MAX : c_int = 45;
3836 pub const _SC_MQ_OPEN_MAX : c_int = 46;
3837 pub const _SC_PAGESIZE : c_int = 47;
3838 pub const _SC_RTSIG_MAX : c_int = 48;
3839 pub const _SC_SEM_NSEMS_MAX : c_int = 49;
3840 pub const _SC_SEM_VALUE_MAX : c_int = 50;
3841 pub const _SC_SIGQUEUE_MAX : c_int = 51;
3842 pub const _SC_TIMER_MAX : c_int = 52;
3846 #[cfg(any(target_os = "bitrig", target_os = "openbsd"))]
3849 use types::os::arch::c95::{c_int, c_uint};
3851 pub const EXIT_FAILURE : c_int = 1;
3852 pub const EXIT_SUCCESS : c_int = 0;
3853 pub const RAND_MAX : c_int = 2147483647;
3854 pub const EOF : c_int = -1;
3855 pub const SEEK_SET : c_int = 0;
3856 pub const SEEK_CUR : c_int = 1;
3857 pub const SEEK_END : c_int = 2;
3858 pub const _IOFBF : c_int = 0;
3859 pub const _IONBF : c_int = 2;
3860 pub const _IOLBF : c_int = 1;
3861 pub const BUFSIZ : c_uint = 1024_u32;
3862 pub const FOPEN_MAX : c_uint = 20_u32;
3863 pub const FILENAME_MAX : c_uint = 1024_u32;
3864 pub const L_tmpnam : c_uint = 1024_u32;
3865 pub const TMP_MAX : c_uint = 308915776_u32;
3870 use types::common::c95::c_void;
3871 use types::os::arch::c95::c_int;
3872 use types::os::arch::posix88::mode_t;
3874 pub const O_RDONLY : c_int = 0;
3875 pub const O_WRONLY : c_int = 1;
3876 pub const O_RDWR : c_int = 2;
3877 pub const O_APPEND : c_int = 8;
3878 pub const O_CREAT : c_int = 512;
3879 pub const O_EXCL : c_int = 2048;
3880 pub const O_TRUNC : c_int = 1024;
3881 pub const S_IFIFO : mode_t = 4096;
3882 pub const S_IFCHR : mode_t = 8192;
3883 pub const S_IFBLK : mode_t = 24576;
3884 pub const S_IFDIR : mode_t = 16384;
3885 pub const S_IFREG : mode_t = 32768;
3886 pub const S_IFLNK : mode_t = 40960;
3887 pub const S_IFMT : mode_t = 61440;
3888 pub const S_IEXEC : mode_t = 64;
3889 pub const S_IWRITE : mode_t = 128;
3890 pub const S_IREAD : mode_t = 256;
3891 pub const S_IRWXU : mode_t = 448;
3892 pub const S_IXUSR : mode_t = 64;
3893 pub const S_IWUSR : mode_t = 128;
3894 pub const S_IRUSR : mode_t = 256;
3895 pub const F_OK : c_int = 0;
3896 pub const R_OK : c_int = 4;
3897 pub const W_OK : c_int = 2;
3898 pub const X_OK : c_int = 1;
3899 pub const STDIN_FILENO : c_int = 0;
3900 pub const STDOUT_FILENO : c_int = 1;
3901 pub const STDERR_FILENO : c_int = 2;
3902 pub const F_LOCK : c_int = 1;
3903 pub const F_TEST : c_int = 3;
3904 pub const F_TLOCK : c_int = 2;
3905 pub const F_ULOCK : c_int = 0;
3906 pub const SIGHUP : c_int = 1;
3907 pub const SIGINT : c_int = 2;
3908 pub const SIGQUIT : c_int = 3;
3909 pub const SIGILL : c_int = 4;
3910 pub const SIGABRT : c_int = 6;
3911 pub const SIGFPE : c_int = 8;
3912 pub const SIGKILL : c_int = 9;
3913 pub const SIGSEGV : c_int = 11;
3914 pub const SIGPIPE : c_int = 13;
3915 pub const SIGALRM : c_int = 14;
3916 pub const SIGTERM : c_int = 15;
3918 pub const PROT_NONE : c_int = 0;
3919 pub const PROT_READ : c_int = 1;
3920 pub const PROT_WRITE : c_int = 2;
3921 pub const PROT_EXEC : c_int = 4;
3923 pub const MAP_FILE : c_int = 0x0000;
3924 pub const MAP_SHARED : c_int = 0x0001;
3925 pub const MAP_PRIVATE : c_int = 0x0002;
3926 pub const MAP_FIXED : c_int = 0x0010;
3927 pub const MAP_ANON : c_int = 0x1000;
3929 pub const MAP_FAILED : *mut c_void = -1 as *mut c_void;
3931 pub const MCL_CURRENT : c_int = 0x0001;
3932 pub const MCL_FUTURE : c_int = 0x0002;
3934 pub const MS_ASYNC : c_int = 0x0001;
3935 pub const MS_SYNC : c_int = 0x0002;
3936 pub const MS_INVALIDATE : c_int = 0x0004;
3938 pub const EPERM : c_int = 1;
3939 pub const ENOENT : c_int = 2;
3940 pub const ESRCH : c_int = 3;
3941 pub const EINTR : c_int = 4;
3942 pub const EIO : c_int = 5;
3943 pub const ENXIO : c_int = 6;
3944 pub const E2BIG : c_int = 7;
3945 pub const ENOEXEC : c_int = 8;
3946 pub const EBADF : c_int = 9;
3947 pub const ECHILD : c_int = 10;
3948 pub const EDEADLK : c_int = 11;
3949 pub const ENOMEM : c_int = 12;
3950 pub const EACCES : c_int = 13;
3951 pub const EFAULT : c_int = 14;
3952 pub const ENOTBLK : c_int = 15;
3953 pub const EBUSY : c_int = 16;
3954 pub const EEXIST : c_int = 17;
3955 pub const EXDEV : c_int = 18;
3956 pub const ENODEV : c_int = 19;
3957 pub const ENOTDIR : c_int = 20;
3958 pub const EISDIR : c_int = 21;
3959 pub const EINVAL : c_int = 22;
3960 pub const ENFILE : c_int = 23;
3961 pub const EMFILE : c_int = 24;
3962 pub const ENOTTY : c_int = 25;
3963 pub const ETXTBSY : c_int = 26;
3964 pub const EFBIG : c_int = 27;
3965 pub const ENOSPC : c_int = 28;
3966 pub const ESPIPE : c_int = 29;
3967 pub const EROFS : c_int = 30;
3968 pub const EMLINK : c_int = 31;
3969 pub const EPIPE : c_int = 32;
3970 pub const EDOM : c_int = 33;
3971 pub const ERANGE : c_int = 34;
3972 pub const EAGAIN : c_int = 35;
3973 pub const EWOULDBLOCK : c_int = 35;
3974 pub const EINPROGRESS : c_int = 36;
3975 pub const EALREADY : c_int = 37;
3976 pub const ENOTSOCK : c_int = 38;
3977 pub const EDESTADDRREQ : c_int = 39;
3978 pub const EMSGSIZE : c_int = 40;
3979 pub const EPROTOTYPE : c_int = 41;
3980 pub const ENOPROTOOPT : c_int = 42;
3981 pub const EPROTONOSUPPORT : c_int = 43;
3982 pub const ESOCKTNOSUPPORT : c_int = 44;
3983 pub const EOPNOTSUPP : c_int = 45;
3984 pub const EPFNOSUPPORT : c_int = 46;
3985 pub const EAFNOSUPPORT : c_int = 47;
3986 pub const EADDRINUSE : c_int = 48;
3987 pub const EADDRNOTAVAIL : c_int = 49;
3988 pub const ENETDOWN : c_int = 50;
3989 pub const ENETUNREACH : c_int = 51;
3990 pub const ENETRESET : c_int = 52;
3991 pub const ECONNABORTED : c_int = 53;
3992 pub const ECONNRESET : c_int = 54;
3993 pub const ENOBUFS : c_int = 55;
3994 pub const EISCONN : c_int = 56;
3995 pub const ENOTCONN : c_int = 57;
3996 pub const ESHUTDOWN : c_int = 58;
3997 pub const ETOOMANYREFS : c_int = 59;
3998 pub const ETIMEDOUT : c_int = 60;
3999 pub const ECONNREFUSED : c_int = 61;
4000 pub const ELOOP : c_int = 62;
4001 pub const ENAMETOOLONG : c_int = 63;
4002 pub const EHOSTDOWN : c_int = 64;
4003 pub const EHOSTUNREACH : c_int = 65;
4004 pub const ENOTEMPTY : c_int = 66;
4005 pub const EPROCLIM : c_int = 67;
4006 pub const EUSERS : c_int = 68;
4007 pub const EDQUOT : c_int = 69;
4008 pub const ESTALE : c_int = 70;
4009 pub const EREMOTE : c_int = 71;
4010 pub const EBADRPC : c_int = 72;
4011 pub const ERPCMISMATCH : c_int = 73;
4012 pub const EPROGUNAVAIL : c_int = 74;
4013 pub const EPROGMISMATCH : c_int = 75;
4014 pub const EPROCUNAVAIL : c_int = 76;
4015 pub const ENOLCK : c_int = 77;
4016 pub const ENOSYS : c_int = 78;
4017 pub const EFTYPE : c_int = 79;
4018 pub const EAUTH : c_int = 80;
4019 pub const ENEEDAUTH : c_int = 81;
4020 pub const EIPSEC : c_int = 82;
4021 pub const ENOATTR : c_int = 83;
4022 pub const EILSEQ : c_int = 84;
4023 pub const ENOMEDIUM : c_int = 85;
4024 pub const EMEDIUMTYPE : c_int = 86;
4025 pub const EOVERFLOW : c_int = 87;
4026 pub const ECANCELED : c_int = 88;
4027 pub const EIDRM : c_int = 89;
4028 pub const ENOMSG : c_int = 90;
4029 pub const ENOTSUP : c_int = 91;
4030 pub const ELAST : c_int = 91; // must be equal to largest errno
4033 use types::os::arch::c95::{c_int, size_t};
4035 pub const F_DUPFD : c_int = 0;
4036 pub const F_GETFD : c_int = 1;
4037 pub const F_SETFD : c_int = 2;
4038 pub const F_GETFL : c_int = 3;
4039 pub const F_SETFL : c_int = 4;
4040 pub const F_GETOWN : c_int = 5;
4041 pub const F_SETOWN : c_int = 6;
4042 pub const F_GETLK : c_int = 7;
4043 pub const F_SETLK : c_int = 8;
4044 pub const F_SETLKW : c_int = 9;
4045 pub const F_DUPFD_CLOEXEC : c_int = 10;
4047 pub const SIGTRAP : c_int = 5;
4048 pub const SIG_IGN: size_t = 1;
4050 pub const GLOB_APPEND : c_int = 0x0001;
4051 pub const GLOB_DOOFFS : c_int = 0x0002;
4052 pub const GLOB_ERR : c_int = 0x0004;
4053 pub const GLOB_MARK : c_int = 0x0008;
4054 pub const GLOB_NOCHECK : c_int = 0x0010;
4055 pub const GLOB_NOSORT : c_int = 0x0020;
4056 pub const GLOB_NOESCAPE : c_int = 0x1000;
4058 pub const GLOB_NOSPACE : c_int = -1;
4059 pub const GLOB_ABORTED : c_int = -2;
4060 pub const GLOB_NOMATCH : c_int = -3;
4061 pub const GLOB_NOSYS : c_int = -4;
4063 pub const POSIX_MADV_NORMAL : c_int = 0;
4064 pub const POSIX_MADV_RANDOM : c_int = 1;
4065 pub const POSIX_MADV_SEQUENTIAL : c_int = 2;
4066 pub const POSIX_MADV_WILLNEED : c_int = 3;
4067 pub const POSIX_MADV_DONTNEED : c_int = 4;
4069 pub const _SC_IOV_MAX : c_int = 51;
4070 pub const _SC_GETGR_R_SIZE_MAX : c_int = 100;
4071 pub const _SC_GETPW_R_SIZE_MAX : c_int = 101;
4072 pub const _SC_LOGIN_NAME_MAX : c_int = 102;
4073 pub const _SC_MQ_PRIO_MAX : c_int = 59;
4074 pub const _SC_THREAD_ATTR_STACKADDR : c_int = 77;
4075 pub const _SC_THREAD_ATTR_STACKSIZE : c_int = 78;
4076 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : c_int = 80;
4077 pub const _SC_THREAD_KEYS_MAX : c_int = 81;
4078 pub const _SC_THREAD_PRIO_INHERIT : c_int = 82;
4079 pub const _SC_THREAD_PRIO_PROTECT : c_int = 83;
4080 pub const _SC_THREAD_PRIORITY_SCHEDULING : c_int = 84;
4081 pub const _SC_THREAD_PROCESS_SHARED : c_int = 85;
4082 pub const _SC_THREAD_SAFE_FUNCTIONS : c_int = 103;
4083 pub const _SC_THREAD_STACK_MIN : c_int = 89;
4084 pub const _SC_THREAD_THREADS_MAX : c_int = 90;
4085 pub const _SC_THREADS : c_int = 91;
4086 pub const _SC_TTY_NAME_MAX : c_int = 107;
4087 pub const _SC_ATEXIT_MAX : c_int = 46;
4088 pub const _SC_XOPEN_CRYPT : c_int = 117;
4089 pub const _SC_XOPEN_ENH_I18N : c_int = 118;
4090 pub const _SC_XOPEN_LEGACY : c_int = 119;
4091 pub const _SC_XOPEN_REALTIME : c_int = 120;
4092 pub const _SC_XOPEN_REALTIME_THREADS : c_int = 121;
4093 pub const _SC_XOPEN_SHM : c_int = 30;
4094 pub const _SC_XOPEN_UNIX : c_int = 123;
4095 pub const _SC_XOPEN_VERSION : c_int = 125;
4097 pub const PTHREAD_CREATE_JOINABLE : c_int = 0;
4098 pub const PTHREAD_CREATE_DETACHED : c_int = 1;
4099 pub const PTHREAD_STACK_MIN : size_t = 2048;
4101 pub const CLOCK_REALTIME : c_int = 0;
4102 pub const CLOCK_MONOTONIC : c_int = 3;
4107 use types::os::arch::c95::c_int;
4109 pub const MADV_NORMAL : c_int = 0;
4110 pub const MADV_RANDOM : c_int = 1;
4111 pub const MADV_SEQUENTIAL : c_int = 2;
4112 pub const MADV_WILLNEED : c_int = 3;
4113 pub const MADV_DONTNEED : c_int = 4;
4114 pub const MADV_FREE : c_int = 6;
4116 pub const AF_UNIX: c_int = 1;
4117 pub const AF_INET: c_int = 2;
4118 pub const AF_INET6: c_int = 24;
4119 pub const SOCK_STREAM: c_int = 1;
4120 pub const SOCK_DGRAM: c_int = 2;
4121 pub const SOCK_RAW: c_int = 3;
4122 pub const IPPROTO_TCP: c_int = 6;
4123 pub const IPPROTO_IP: c_int = 0;
4124 pub const IPPROTO_IPV6: c_int = 41;
4125 pub const IP_MULTICAST_TTL: c_int = 10;
4126 pub const IP_MULTICAST_LOOP: c_int = 11;
4127 pub const IP_TTL: c_int = 4;
4128 pub const IP_HDRINCL: c_int = 2;
4129 pub const IP_ADD_MEMBERSHIP: c_int = 12;
4130 pub const IP_DROP_MEMBERSHIP: c_int = 13;
4131 pub const IPV6_ADD_MEMBERSHIP: c_int = 12; // don't exist
4132 pub const IPV6_DROP_MEMBERSHIP: c_int = 13; // don't exist
4134 pub const TCP_NODELAY: c_int = 0x01;
4135 pub const SOL_SOCKET: c_int = 0xffff;
4136 pub const SO_KEEPALIVE: c_int = 0x0008;
4137 pub const SO_BROADCAST: c_int = 0x0020;
4138 pub const SO_REUSEADDR: c_int = 0x0004;
4139 pub const SO_ERROR: c_int = 0x1007;
4141 pub const IFF_LOOPBACK: c_int = 0x8;
4143 pub const SHUT_RD: c_int = 0;
4144 pub const SHUT_WR: c_int = 1;
4145 pub const SHUT_RDWR: c_int = 2;
4148 use types::os::arch::c95::c_int;
4150 pub const O_DSYNC : c_int = 128; // same as SYNC
4151 pub const O_SYNC : c_int = 128;
4152 pub const O_NONBLOCK : c_int = 4;
4153 pub const CTL_KERN : c_int = 1;
4154 pub const KERN_PROC : c_int = 66;
4156 pub const MAP_COPY : c_int = 0x0002;
4157 pub const MAP_RENAME : c_int = 0x0000;
4158 pub const MAP_NORESERVE : c_int = 0x0000;
4159 pub const MAP_NOEXTEND : c_int = 0x0000;
4160 pub const MAP_HASSEMAPHORE : c_int = 0x0000;
4162 pub const IPPROTO_RAW : c_int = 255;
4164 pub const PATH_MAX: c_int = 1024;
4167 use types::os::arch::c95::c_int;
4169 pub const _SC_ARG_MAX : c_int = 1;
4170 pub const _SC_CHILD_MAX : c_int = 2;
4171 pub const _SC_CLK_TCK : c_int = 3;
4172 pub const _SC_NGROUPS_MAX : c_int = 4;
4173 pub const _SC_OPEN_MAX : c_int = 5;
4174 pub const _SC_JOB_CONTROL : c_int = 6;
4175 pub const _SC_SAVED_IDS : c_int = 7;
4176 pub const _SC_VERSION : c_int = 8;
4177 pub const _SC_BC_BASE_MAX : c_int = 9;
4178 pub const _SC_BC_DIM_MAX : c_int = 10;
4179 pub const _SC_BC_SCALE_MAX : c_int = 11;
4180 pub const _SC_BC_STRING_MAX : c_int = 12;
4181 pub const _SC_COLL_WEIGHTS_MAX : c_int = 13;
4182 pub const _SC_EXPR_NEST_MAX : c_int = 14;
4183 pub const _SC_LINE_MAX : c_int = 15;
4184 pub const _SC_RE_DUP_MAX : c_int = 16;
4185 pub const _SC_2_VERSION : c_int = 17;
4186 pub const _SC_2_C_BIND : c_int = 18;
4187 pub const _SC_2_C_DEV : c_int = 19;
4188 pub const _SC_2_CHAR_TERM : c_int = 20;
4189 pub const _SC_2_FORT_DEV : c_int = 21;
4190 pub const _SC_2_FORT_RUN : c_int = 22;
4191 pub const _SC_2_LOCALEDEF : c_int = 23;
4192 pub const _SC_2_SW_DEV : c_int = 24;
4193 pub const _SC_2_UPE : c_int = 25;
4194 pub const _SC_STREAM_MAX : c_int = 26;
4195 pub const _SC_TZNAME_MAX : c_int = 27;
4196 pub const _SC_PAGESIZE : c_int = 28;
4197 pub const _SC_FSYNC : c_int = 29;
4198 pub const _SC_SEM_NSEMS_MAX : c_int = 31;
4199 pub const _SC_SEM_VALUE_MAX : c_int = 32;
4200 pub const _SC_AIO_LISTIO_MAX : c_int = 42;
4201 pub const _SC_AIO_MAX : c_int = 43;
4202 pub const _SC_AIO_PRIO_DELTA_MAX : c_int = 44;
4203 pub const _SC_ASYNCHRONOUS_IO : c_int = 45;
4204 pub const _SC_DELAYTIMER_MAX : c_int = 50;
4205 pub const _SC_MAPPED_FILES : c_int = 53;
4206 pub const _SC_MEMLOCK : c_int = 54;
4207 pub const _SC_MEMLOCK_RANGE : c_int = 55;
4208 pub const _SC_MEMORY_PROTECTION : c_int = 56;
4209 pub const _SC_MESSAGE_PASSING : c_int = 57;
4210 pub const _SC_MQ_OPEN_MAX : c_int = 58;
4211 pub const _SC_PRIORITIZED_IO : c_int = 60;
4212 pub const _SC_PRIORITY_SCHEDULING : c_int = 61;
4213 pub const _SC_REALTIME_SIGNALS : c_int = 64;
4214 pub const _SC_RTSIG_MAX : c_int = 66;
4215 pub const _SC_SEMAPHORES : c_int = 67;
4216 pub const _SC_SHARED_MEMORY_OBJECTS : c_int = 68;
4217 pub const _SC_SIGQUEUE_MAX : c_int = 70;
4218 pub const _SC_SYNCHRONIZED_IO : c_int = 75;
4219 pub const _SC_TIMER_MAX : c_int = 93;
4220 pub const _SC_TIMERS : c_int = 94;
4224 #[cfg(any(target_os = "macos", target_os = "ios"))]
4227 use types::os::arch::c95::{c_int, c_uint};
4229 pub const EXIT_FAILURE : c_int = 1;
4230 pub const EXIT_SUCCESS : c_int = 0;
4231 pub const RAND_MAX : c_int = 2147483647;
4232 pub const EOF : c_int = -1;
4233 pub const SEEK_SET : c_int = 0;
4234 pub const SEEK_CUR : c_int = 1;
4235 pub const SEEK_END : c_int = 2;
4236 pub const _IOFBF : c_int = 0;
4237 pub const _IONBF : c_int = 2;
4238 pub const _IOLBF : c_int = 1;
4239 pub const BUFSIZ : c_uint = 1024_u32;
4240 pub const FOPEN_MAX : c_uint = 20_u32;
4241 pub const FILENAME_MAX : c_uint = 1024_u32;
4242 pub const L_tmpnam : c_uint = 1024_u32;
4243 pub const TMP_MAX : c_uint = 308915776_u32;
4248 use types::common::c95::c_void;
4249 use types::os::arch::c95::c_int;
4250 use types::os::arch::posix88::mode_t;
4252 pub const O_RDONLY : c_int = 0;
4253 pub const O_WRONLY : c_int = 1;
4254 pub const O_RDWR : c_int = 2;
4255 pub const O_APPEND : c_int = 8;
4256 pub const O_CREAT : c_int = 512;
4257 pub const O_EXCL : c_int = 2048;
4258 pub const O_TRUNC : c_int = 1024;
4259 pub const S_IFIFO : mode_t = 4096;
4260 pub const S_IFCHR : mode_t = 8192;
4261 pub const S_IFBLK : mode_t = 24576;
4262 pub const S_IFDIR : mode_t = 16384;
4263 pub const S_IFREG : mode_t = 32768;
4264 pub const S_IFLNK : mode_t = 40960;
4265 pub const S_IFMT : mode_t = 61440;
4266 pub const S_IEXEC : mode_t = 64;
4267 pub const S_IWRITE : mode_t = 128;
4268 pub const S_IREAD : mode_t = 256;
4269 pub const S_IRWXU : mode_t = 448;
4270 pub const S_IXUSR : mode_t = 64;
4271 pub const S_IWUSR : mode_t = 128;
4272 pub const S_IRUSR : mode_t = 256;
4273 pub const F_OK : c_int = 0;
4274 pub const R_OK : c_int = 4;
4275 pub const W_OK : c_int = 2;
4276 pub const X_OK : c_int = 1;
4277 pub const STDIN_FILENO : c_int = 0;
4278 pub const STDOUT_FILENO : c_int = 1;
4279 pub const STDERR_FILENO : c_int = 2;
4280 pub const F_LOCK : c_int = 1;
4281 pub const F_TEST : c_int = 3;
4282 pub const F_TLOCK : c_int = 2;
4283 pub const F_ULOCK : c_int = 0;
4284 pub const SIGHUP : c_int = 1;
4285 pub const SIGINT : c_int = 2;
4286 pub const SIGQUIT : c_int = 3;
4287 pub const SIGILL : c_int = 4;
4288 pub const SIGABRT : c_int = 6;
4289 pub const SIGFPE : c_int = 8;
4290 pub const SIGKILL : c_int = 9;
4291 pub const SIGSEGV : c_int = 11;
4292 pub const SIGPIPE : c_int = 13;
4293 pub const SIGALRM : c_int = 14;
4294 pub const SIGTERM : c_int = 15;
4296 pub const PROT_NONE : c_int = 0;
4297 pub const PROT_READ : c_int = 1;
4298 pub const PROT_WRITE : c_int = 2;
4299 pub const PROT_EXEC : c_int = 4;
4301 pub const MAP_FILE : c_int = 0x0000;
4302 pub const MAP_SHARED : c_int = 0x0001;
4303 pub const MAP_PRIVATE : c_int = 0x0002;
4304 pub const MAP_FIXED : c_int = 0x0010;
4305 pub const MAP_ANON : c_int = 0x1000;
4307 pub const MAP_FAILED : *mut c_void = -1 as *mut c_void;
4309 pub const MCL_CURRENT : c_int = 0x0001;
4310 pub const MCL_FUTURE : c_int = 0x0002;
4312 pub const MS_ASYNC : c_int = 0x0001;
4313 pub const MS_INVALIDATE : c_int = 0x0002;
4314 pub const MS_SYNC : c_int = 0x0010;
4316 pub const MS_KILLPAGES : c_int = 0x0004;
4317 pub const MS_DEACTIVATE : c_int = 0x0008;
4319 pub const EPERM : c_int = 1;
4320 pub const ENOENT : c_int = 2;
4321 pub const ESRCH : c_int = 3;
4322 pub const EINTR : c_int = 4;
4323 pub const EIO : c_int = 5;
4324 pub const ENXIO : c_int = 6;
4325 pub const E2BIG : c_int = 7;
4326 pub const ENOEXEC : c_int = 8;
4327 pub const EBADF : c_int = 9;
4328 pub const ECHILD : c_int = 10;
4329 pub const EDEADLK : c_int = 11;
4330 pub const ENOMEM : c_int = 12;
4331 pub const EACCES : c_int = 13;
4332 pub const EFAULT : c_int = 14;
4333 pub const ENOTBLK : c_int = 15;
4334 pub const EBUSY : c_int = 16;
4335 pub const EEXIST : c_int = 17;
4336 pub const EXDEV : c_int = 18;
4337 pub const ENODEV : c_int = 19;
4338 pub const ENOTDIR : c_int = 20;
4339 pub const EISDIR : c_int = 21;
4340 pub const EINVAL : c_int = 22;
4341 pub const ENFILE : c_int = 23;
4342 pub const EMFILE : c_int = 24;
4343 pub const ENOTTY : c_int = 25;
4344 pub const ETXTBSY : c_int = 26;
4345 pub const EFBIG : c_int = 27;
4346 pub const ENOSPC : c_int = 28;
4347 pub const ESPIPE : c_int = 29;
4348 pub const EROFS : c_int = 30;
4349 pub const EMLINK : c_int = 31;
4350 pub const EPIPE : c_int = 32;
4351 pub const EDOM : c_int = 33;
4352 pub const ERANGE : c_int = 34;
4353 pub const EAGAIN : c_int = 35;
4354 pub const EWOULDBLOCK : c_int = EAGAIN;
4355 pub const EINPROGRESS : c_int = 36;
4356 pub const EALREADY : c_int = 37;
4357 pub const ENOTSOCK : c_int = 38;
4358 pub const EDESTADDRREQ : c_int = 39;
4359 pub const EMSGSIZE : c_int = 40;
4360 pub const EPROTOTYPE : c_int = 41;
4361 pub const ENOPROTOOPT : c_int = 42;
4362 pub const EPROTONOSUPPORT : c_int = 43;
4363 pub const ESOCKTNOSUPPORT : c_int = 44;
4364 pub const ENOTSUP : c_int = 45;
4365 pub const EPFNOSUPPORT : c_int = 46;
4366 pub const EAFNOSUPPORT : c_int = 47;
4367 pub const EADDRINUSE : c_int = 48;
4368 pub const EADDRNOTAVAIL : c_int = 49;
4369 pub const ENETDOWN : c_int = 50;
4370 pub const ENETUNREACH : c_int = 51;
4371 pub const ENETRESET : c_int = 52;
4372 pub const ECONNABORTED : c_int = 53;
4373 pub const ECONNRESET : c_int = 54;
4374 pub const ENOBUFS : c_int = 55;
4375 pub const EISCONN : c_int = 56;
4376 pub const ENOTCONN : c_int = 57;
4377 pub const ESHUTDOWN : c_int = 58;
4378 pub const ETOOMANYREFS : c_int = 59;
4379 pub const ETIMEDOUT : c_int = 60;
4380 pub const ECONNREFUSED : c_int = 61;
4381 pub const ELOOP : c_int = 62;
4382 pub const ENAMETOOLONG : c_int = 63;
4383 pub const EHOSTDOWN : c_int = 64;
4384 pub const EHOSTUNREACH : c_int = 65;
4385 pub const ENOTEMPTY : c_int = 66;
4386 pub const EPROCLIM : c_int = 67;
4387 pub const EUSERS : c_int = 68;
4388 pub const EDQUOT : c_int = 69;
4389 pub const ESTALE : c_int = 70;
4390 pub const EREMOTE : c_int = 71;
4391 pub const EBADRPC : c_int = 72;
4392 pub const ERPCMISMATCH : c_int = 73;
4393 pub const EPROGUNAVAIL : c_int = 74;
4394 pub const EPROGMISMATCH : c_int = 75;
4395 pub const EPROCUNAVAIL : c_int = 76;
4396 pub const ENOLCK : c_int = 77;
4397 pub const ENOSYS : c_int = 78;
4398 pub const EFTYPE : c_int = 79;
4399 pub const EAUTH : c_int = 80;
4400 pub const ENEEDAUTH : c_int = 81;
4401 pub const EPWROFF : c_int = 82;
4402 pub const EDEVERR : c_int = 83;
4403 pub const EOVERFLOW : c_int = 84;
4404 pub const EBADEXEC : c_int = 85;
4405 pub const EBADARCH : c_int = 86;
4406 pub const ESHLIBVERS : c_int = 87;
4407 pub const EBADMACHO : c_int = 88;
4408 pub const ECANCELED : c_int = 89;
4409 pub const EIDRM : c_int = 90;
4410 pub const ENOMSG : c_int = 91;
4411 pub const EILSEQ : c_int = 92;
4412 pub const ENOATTR : c_int = 93;
4413 pub const EBADMSG : c_int = 94;
4414 pub const EMULTIHOP : c_int = 95;
4415 pub const ENODATA : c_int = 96;
4416 pub const ENOLINK : c_int = 97;
4417 pub const ENOSR : c_int = 98;
4418 pub const ENOSTR : c_int = 99;
4419 pub const EPROTO : c_int = 100;
4420 pub const ETIME : c_int = 101;
4421 pub const EOPNOTSUPP : c_int = 102;
4422 pub const ENOPOLICY : c_int = 103;
4423 pub const ENOTRECOVERABLE : c_int = 104;
4424 pub const EOWNERDEAD : c_int = 105;
4425 pub const EQFULL : c_int = 106;
4426 pub const ELAST : c_int = 106;
4429 use types::os::arch::c95::{c_int, size_t};
4431 pub const F_DUPFD : c_int = 0;
4432 pub const F_GETFD : c_int = 1;
4433 pub const F_SETFD : c_int = 2;
4434 pub const F_GETFL : c_int = 3;
4435 pub const F_SETFL : c_int = 4;
4437 pub const SIGTRAP : c_int = 5;
4438 pub const SIG_IGN: size_t = 1;
4440 pub const GLOB_APPEND : c_int = 0x0001;
4441 pub const GLOB_DOOFFS : c_int = 0x0002;
4442 pub const GLOB_ERR : c_int = 0x0004;
4443 pub const GLOB_MARK : c_int = 0x0008;
4444 pub const GLOB_NOCHECK : c_int = 0x0010;
4445 pub const GLOB_NOSORT : c_int = 0x0020;
4446 pub const GLOB_NOESCAPE : c_int = 0x2000;
4448 pub const GLOB_NOSPACE : c_int = -1;
4449 pub const GLOB_ABORTED : c_int = -2;
4450 pub const GLOB_NOMATCH : c_int = -3;
4452 pub const POSIX_MADV_NORMAL : c_int = 0;
4453 pub const POSIX_MADV_RANDOM : c_int = 1;
4454 pub const POSIX_MADV_SEQUENTIAL : c_int = 2;
4455 pub const POSIX_MADV_WILLNEED : c_int = 3;
4456 pub const POSIX_MADV_DONTNEED : c_int = 4;
4458 pub const _SC_IOV_MAX : c_int = 56;
4459 pub const _SC_GETGR_R_SIZE_MAX : c_int = 70;
4460 pub const _SC_GETPW_R_SIZE_MAX : c_int = 71;
4461 pub const _SC_LOGIN_NAME_MAX : c_int = 73;
4462 pub const _SC_MQ_PRIO_MAX : c_int = 75;
4463 pub const _SC_THREAD_ATTR_STACKADDR : c_int = 82;
4464 pub const _SC_THREAD_ATTR_STACKSIZE : c_int = 83;
4465 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : c_int = 85;
4466 pub const _SC_THREAD_KEYS_MAX : c_int = 86;
4467 pub const _SC_THREAD_PRIO_INHERIT : c_int = 87;
4468 pub const _SC_THREAD_PRIO_PROTECT : c_int = 88;
4469 pub const _SC_THREAD_PRIORITY_SCHEDULING : c_int = 89;
4470 pub const _SC_THREAD_PROCESS_SHARED : c_int = 90;
4471 pub const _SC_THREAD_SAFE_FUNCTIONS : c_int = 91;
4472 pub const _SC_THREAD_STACK_MIN : c_int = 93;
4473 pub const _SC_THREAD_THREADS_MAX : c_int = 94;
4474 pub const _SC_THREADS : c_int = 96;
4475 pub const _SC_TTY_NAME_MAX : c_int = 101;
4476 pub const _SC_ATEXIT_MAX : c_int = 107;
4477 pub const _SC_XOPEN_CRYPT : c_int = 108;
4478 pub const _SC_XOPEN_ENH_I18N : c_int = 109;
4479 pub const _SC_XOPEN_LEGACY : c_int = 110;
4480 pub const _SC_XOPEN_REALTIME : c_int = 111;
4481 pub const _SC_XOPEN_REALTIME_THREADS : c_int = 112;
4482 pub const _SC_XOPEN_SHM : c_int = 113;
4483 pub const _SC_XOPEN_UNIX : c_int = 115;
4484 pub const _SC_XOPEN_VERSION : c_int = 116;
4485 pub const _SC_XOPEN_XCU_VERSION : c_int = 121;
4487 pub const PTHREAD_CREATE_JOINABLE: c_int = 1;
4488 pub const PTHREAD_CREATE_DETACHED: c_int = 2;
4489 pub const PTHREAD_STACK_MIN: size_t = 8192;
4494 use types::os::arch::c95::c_int;
4496 pub const MADV_NORMAL : c_int = 0;
4497 pub const MADV_RANDOM : c_int = 1;
4498 pub const MADV_SEQUENTIAL : c_int = 2;
4499 pub const MADV_WILLNEED : c_int = 3;
4500 pub const MADV_DONTNEED : c_int = 4;
4501 pub const MADV_FREE : c_int = 5;
4502 pub const MADV_ZERO_WIRED_PAGES : c_int = 6;
4503 pub const MADV_FREE_REUSABLE : c_int = 7;
4504 pub const MADV_FREE_REUSE : c_int = 8;
4505 pub const MADV_CAN_REUSE : c_int = 9;
4507 pub const MINCORE_INCORE : c_int = 0x1;
4508 pub const MINCORE_REFERENCED : c_int = 0x2;
4509 pub const MINCORE_MODIFIED : c_int = 0x4;
4510 pub const MINCORE_REFERENCED_OTHER : c_int = 0x8;
4511 pub const MINCORE_MODIFIED_OTHER : c_int = 0x10;
4513 pub const AF_UNIX: c_int = 1;
4514 pub const AF_INET: c_int = 2;
4515 pub const AF_INET6: c_int = 30;
4516 pub const SOCK_STREAM: c_int = 1;
4517 pub const SOCK_DGRAM: c_int = 2;
4518 pub const SOCK_RAW: c_int = 3;
4519 pub const IPPROTO_TCP: c_int = 6;
4520 pub const IPPROTO_IP: c_int = 0;
4521 pub const IPPROTO_IPV6: c_int = 41;
4522 pub const IP_MULTICAST_TTL: c_int = 10;
4523 pub const IP_MULTICAST_LOOP: c_int = 11;
4524 pub const IP_TTL: c_int = 4;
4525 pub const IP_HDRINCL: c_int = 2;
4526 pub const IP_ADD_MEMBERSHIP: c_int = 12;
4527 pub const IP_DROP_MEMBERSHIP: c_int = 13;
4528 pub const IPV6_ADD_MEMBERSHIP: c_int = 12;
4529 pub const IPV6_DROP_MEMBERSHIP: c_int = 13;
4531 pub const TCP_NODELAY: c_int = 0x01;
4532 pub const TCP_KEEPALIVE: c_int = 0x10;
4533 pub const SOL_SOCKET: c_int = 0xffff;
4534 pub const SO_KEEPALIVE: c_int = 0x0008;
4535 pub const SO_BROADCAST: c_int = 0x0020;
4536 pub const SO_REUSEADDR: c_int = 0x0004;
4537 pub const SO_ERROR: c_int = 0x1007;
4539 pub const IFF_LOOPBACK: c_int = 0x8;
4541 pub const SHUT_RD: c_int = 0;
4542 pub const SHUT_WR: c_int = 1;
4543 pub const SHUT_RDWR: c_int = 2;
4546 use types::os::arch::c95::c_int;
4548 pub const O_DSYNC : c_int = 4194304;
4549 pub const O_SYNC : c_int = 128;
4550 pub const O_NONBLOCK : c_int = 4;
4551 pub const F_FULLFSYNC : c_int = 51;
4553 pub const MAP_COPY : c_int = 0x0002;
4554 pub const MAP_RENAME : c_int = 0x0020;
4555 pub const MAP_NORESERVE : c_int = 0x0040;
4556 pub const MAP_NOEXTEND : c_int = 0x0100;
4557 pub const MAP_HASSEMAPHORE : c_int = 0x0200;
4558 pub const MAP_NOCACHE : c_int = 0x0400;
4559 pub const MAP_JIT : c_int = 0x0800;
4560 pub const MAP_STACK : c_int = 0;
4562 pub const IPPROTO_RAW : c_int = 255;
4565 use types::os::arch::c95::c_int;
4567 pub const _SC_ARG_MAX : c_int = 1;
4568 pub const _SC_CHILD_MAX : c_int = 2;
4569 pub const _SC_CLK_TCK : c_int = 3;
4570 pub const _SC_NGROUPS_MAX : c_int = 4;
4571 pub const _SC_OPEN_MAX : c_int = 5;
4572 pub const _SC_JOB_CONTROL : c_int = 6;
4573 pub const _SC_SAVED_IDS : c_int = 7;
4574 pub const _SC_VERSION : c_int = 8;
4575 pub const _SC_BC_BASE_MAX : c_int = 9;
4576 pub const _SC_BC_DIM_MAX : c_int = 10;
4577 pub const _SC_BC_SCALE_MAX : c_int = 11;
4578 pub const _SC_BC_STRING_MAX : c_int = 12;
4579 pub const _SC_COLL_WEIGHTS_MAX : c_int = 13;
4580 pub const _SC_EXPR_NEST_MAX : c_int = 14;
4581 pub const _SC_LINE_MAX : c_int = 15;
4582 pub const _SC_RE_DUP_MAX : c_int = 16;
4583 pub const _SC_2_VERSION : c_int = 17;
4584 pub const _SC_2_C_BIND : c_int = 18;
4585 pub const _SC_2_C_DEV : c_int = 19;
4586 pub const _SC_2_CHAR_TERM : c_int = 20;
4587 pub const _SC_2_FORT_DEV : c_int = 21;
4588 pub const _SC_2_FORT_RUN : c_int = 22;
4589 pub const _SC_2_LOCALEDEF : c_int = 23;
4590 pub const _SC_2_SW_DEV : c_int = 24;
4591 pub const _SC_2_UPE : c_int = 25;
4592 pub const _SC_STREAM_MAX : c_int = 26;
4593 pub const _SC_TZNAME_MAX : c_int = 27;
4594 pub const _SC_ASYNCHRONOUS_IO : c_int = 28;
4595 pub const _SC_PAGESIZE : c_int = 29;
4596 pub const _SC_MEMLOCK : c_int = 30;
4597 pub const _SC_MEMLOCK_RANGE : c_int = 31;
4598 pub const _SC_MEMORY_PROTECTION : c_int = 32;
4599 pub const _SC_MESSAGE_PASSING : c_int = 33;
4600 pub const _SC_PRIORITIZED_IO : c_int = 34;
4601 pub const _SC_PRIORITY_SCHEDULING : c_int = 35;
4602 pub const _SC_REALTIME_SIGNALS : c_int = 36;
4603 pub const _SC_SEMAPHORES : c_int = 37;
4604 pub const _SC_FSYNC : c_int = 38;
4605 pub const _SC_SHARED_MEMORY_OBJECTS : c_int = 39;
4606 pub const _SC_SYNCHRONIZED_IO : c_int = 40;
4607 pub const _SC_TIMERS : c_int = 41;
4608 pub const _SC_AIO_LISTIO_MAX : c_int = 42;
4609 pub const _SC_AIO_MAX : c_int = 43;
4610 pub const _SC_AIO_PRIO_DELTA_MAX : c_int = 44;
4611 pub const _SC_DELAYTIMER_MAX : c_int = 45;
4612 pub const _SC_MQ_OPEN_MAX : c_int = 46;
4613 pub const _SC_MAPPED_FILES : c_int = 47;
4614 pub const _SC_RTSIG_MAX : c_int = 48;
4615 pub const _SC_SEM_NSEMS_MAX : c_int = 49;
4616 pub const _SC_SEM_VALUE_MAX : c_int = 50;
4617 pub const _SC_SIGQUEUE_MAX : c_int = 51;
4618 pub const _SC_TIMER_MAX : c_int = 52;
4619 pub const _SC_XBS5_ILP32_OFF32 : c_int = 122;
4620 pub const _SC_XBS5_ILP32_OFFBIG : c_int = 123;
4621 pub const _SC_XBS5_LP64_OFF64 : c_int = 124;
4622 pub const _SC_XBS5_LPBIG_OFFBIG : c_int = 125;
4629 // Thankfully most of c95 is universally available and does not vary by OS
4630 // or anything. The same is not true of POSIX.
4634 use types::os::arch::c95::{c_char, c_int};
4637 pub fn isalnum(c: c_int) -> c_int;
4638 pub fn isalpha(c: c_int) -> c_int;
4639 pub fn iscntrl(c: c_int) -> c_int;
4640 pub fn isdigit(c: c_int) -> c_int;
4641 pub fn isgraph(c: c_int) -> c_int;
4642 pub fn islower(c: c_int) -> c_int;
4643 pub fn isprint(c: c_int) -> c_int;
4644 pub fn ispunct(c: c_int) -> c_int;
4645 pub fn isspace(c: c_int) -> c_int;
4646 pub fn isupper(c: c_int) -> c_int;
4647 pub fn isxdigit(c: c_int) -> c_int;
4648 pub fn tolower(c: c_char) -> c_char;
4649 pub fn toupper(c: c_char) -> c_char;
4654 use types::common::c95::{FILE, c_void, fpos_t};
4655 use types::os::arch::c95::{c_char, c_int, c_long, size_t};
4658 pub fn fopen(filename: *const c_char,
4659 mode: *const c_char) -> *mut FILE;
4660 pub fn freopen(filename: *const c_char, mode: *const c_char,
4663 pub fn fflush(file: *mut FILE) -> c_int;
4664 pub fn fclose(file: *mut FILE) -> c_int;
4665 pub fn remove(filename: *const c_char) -> c_int;
4666 pub fn rename(oldname: *const c_char,
4667 newname: *const c_char) -> c_int;
4668 pub fn tmpfile() -> *mut FILE;
4669 pub fn setvbuf(stream: *mut FILE,
4670 buffer: *mut c_char,
4674 pub fn setbuf(stream: *mut FILE, buf: *mut c_char);
4675 // Omitted: printf and scanf variants.
4676 pub fn fgetc(stream: *mut FILE) -> c_int;
4677 pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE)
4679 pub fn fputc(c: c_int, stream: *mut FILE) -> c_int;
4680 pub fn fputs(s: *const c_char, stream: *mut FILE)-> c_int;
4681 // Omitted: getc, getchar (might be macros).
4683 // Omitted: gets, so ridiculously unsafe that it should not
4686 // Omitted: putc, putchar (might be macros).
4687 pub fn puts(s: *const c_char) -> c_int;
4688 pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int;
4689 pub fn fread(ptr: *mut c_void,
4694 pub fn fwrite(ptr: *const c_void,
4699 pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int)
4701 pub fn ftell(stream: *mut FILE) -> c_long;
4702 pub fn rewind(stream: *mut FILE);
4703 pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int;
4704 pub fn fsetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int;
4705 pub fn feof(stream: *mut FILE) -> c_int;
4706 pub fn ferror(stream: *mut FILE) -> c_int;
4707 pub fn perror(s: *const c_char);
4712 use types::common::c95::c_void;
4713 use types::os::arch::c95::{c_char, c_double, c_int};
4714 use types::os::arch::c95::{c_long, c_uint, c_ulong};
4715 use types::os::arch::c95::{size_t};
4718 pub fn abs(i: c_int) -> c_int;
4719 pub fn labs(i: c_long) -> c_long;
4720 // Omitted: div, ldiv (return pub type incomplete).
4721 pub fn atof(s: *const c_char) -> c_double;
4722 pub fn atoi(s: *const c_char) -> c_int;
4723 pub fn strtod(s: *const c_char,
4724 endp: *mut *mut c_char) -> c_double;
4725 pub fn strtol(s: *const c_char,
4726 endp: *mut *mut c_char, base: c_int) -> c_long;
4727 pub fn strtoul(s: *const c_char, endp: *mut *mut c_char,
4728 base: c_int) -> c_ulong;
4729 pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
4730 pub fn malloc(size: size_t) -> *mut c_void;
4731 pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
4732 pub fn free(p: *mut c_void);
4734 /// Exits the running program in a possibly dangerous manner.
4738 /// While this forces your program to exit, it does so in a way that has
4739 /// consequences. This will skip all unwinding code, which means that anything
4740 /// relying on unwinding for cleanup (such as flushing and closing a buffer to a
4741 /// file) may act in an unexpected way.
4746 /// extern crate libc;
4754 pub fn exit(status: c_int) -> !;
4755 pub fn _exit(status: c_int) -> !;
4756 pub fn atexit(cb: extern fn()) -> c_int;
4757 pub fn system(s: *const c_char) -> c_int;
4758 pub fn getenv(s: *const c_char) -> *mut c_char;
4759 // Omitted: bsearch, qsort
4760 pub fn rand() -> c_int;
4761 pub fn srand(seed: c_uint);
4766 use types::common::c95::c_void;
4767 use types::os::arch::c95::{c_char, c_int, size_t};
4768 use types::os::arch::c95::{wchar_t};
4771 pub fn strcpy(dst: *mut c_char,
4772 src: *const c_char) -> *mut c_char;
4773 pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t)
4775 pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char;
4776 pub fn strncat(s: *mut c_char, ct: *const c_char,
4777 n: size_t) -> *mut c_char;
4778 pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int;
4779 pub fn strncmp(cs: *const c_char, ct: *const c_char,
4780 n: size_t) -> c_int;
4781 pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int;
4782 pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char;
4783 pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char;
4784 pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t;
4785 pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t;
4786 pub fn strpbrk(cs: *const c_char,
4787 ct: *const c_char) -> *mut c_char;
4788 pub fn strstr(cs: *const c_char,
4789 ct: *const c_char) -> *mut c_char;
4790 pub fn strlen(cs: *const c_char) -> size_t;
4791 pub fn strerror(n: c_int) -> *mut c_char;
4792 pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char;
4793 pub fn strxfrm(s: *mut c_char, ct: *const c_char,
4794 n: size_t) -> size_t;
4795 pub fn wcslen(buf: *const wchar_t) -> size_t;
4797 // Omitted: memcpy, memmove, memset (provided by LLVM)
4799 // These are fine to execute on the Rust stack. They must be,
4800 // in fact, because LLVM generates calls to them!
4801 pub fn memcmp(cx: *const c_void, ct: *const c_void,
4802 n: size_t) -> c_int;
4803 pub fn memchr(cx: *const c_void, c: c_int,
4804 n: size_t) -> *mut c_void;
4809 // Microsoft helpfully underscore-qualifies all of its POSIX-like symbols
4810 // to make sure you don't use them accidentally. It also randomly deviates
4811 // from the exact signatures you might otherwise expect, and omits much,
4812 // so be careful when trying to write portable code; it won't always work
4813 // with the same POSIX functions and types as other platforms.
4815 #[cfg(target_os = "windows")]
4818 use types::os::common::posix01::{stat, utimbuf};
4819 use types::os::arch::c95::{c_int, c_char, wchar_t};
4822 #[link_name = "_chmod"]
4823 pub fn chmod(path: *const c_char, mode: c_int) -> c_int;
4824 #[link_name = "_wchmod"]
4825 pub fn wchmod(path: *const wchar_t, mode: c_int) -> c_int;
4826 #[link_name = "_mkdir"]
4827 pub fn mkdir(path: *const c_char) -> c_int;
4828 #[link_name = "_wrmdir"]
4829 pub fn wrmdir(path: *const wchar_t) -> c_int;
4830 #[link_name = "_fstat64"]
4831 pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
4832 #[link_name = "_stat64"]
4833 pub fn stat(path: *const c_char, buf: *mut stat) -> c_int;
4834 #[link_name = "_wstat64"]
4835 pub fn wstat(path: *const wchar_t, buf: *mut stat) -> c_int;
4836 #[link_name = "_wutime64"]
4837 pub fn wutime(file: *const wchar_t, buf: *mut utimbuf) -> c_int;
4842 use types::common::c95::FILE;
4843 use types::os::arch::c95::{c_int, c_char};
4846 #[link_name = "_popen"]
4847 pub fn popen(command: *const c_char,
4848 mode: *const c_char) -> *mut FILE;
4849 #[link_name = "_pclose"]
4850 pub fn pclose(stream: *mut FILE) -> c_int;
4851 #[link_name = "_fdopen"]
4852 pub fn fdopen(fd: c_int, mode: *const c_char) -> *mut FILE;
4853 #[link_name = "_fileno"]
4854 pub fn fileno(stream: *mut FILE) -> c_int;
4859 use types::os::arch::c95::{c_int, c_char, wchar_t};
4861 #[link_name = "_open"]
4862 pub fn open(path: *const c_char, oflag: c_int, mode: c_int)
4864 #[link_name = "_wopen"]
4865 pub fn wopen(path: *const wchar_t, oflag: c_int, mode: c_int)
4867 #[link_name = "_creat"]
4868 pub fn creat(path: *const c_char, mode: c_int) -> c_int;
4873 // Not supplied at all.
4877 use types::common::c95::c_void;
4878 use types::os::arch::c95::{c_int, c_uint, c_char,
4880 use types::os::arch::c99::intptr_t;
4883 #[link_name = "_access"]
4884 pub fn access(path: *const c_char, amode: c_int) -> c_int;
4885 #[link_name = "_chdir"]
4886 pub fn chdir(dir: *const c_char) -> c_int;
4887 #[link_name = "_close"]
4888 pub fn close(fd: c_int) -> c_int;
4889 #[link_name = "_dup"]
4890 pub fn dup(fd: c_int) -> c_int;
4891 #[link_name = "_dup2"]
4892 pub fn dup2(src: c_int, dst: c_int) -> c_int;
4893 #[link_name = "_execv"]
4894 pub fn execv(prog: *const c_char,
4895 argv: *mut *const c_char) -> intptr_t;
4896 #[link_name = "_execve"]
4897 pub fn execve(prog: *const c_char, argv: *mut *const c_char,
4898 envp: *mut *const c_char)
4900 #[link_name = "_execvp"]
4901 pub fn execvp(c: *const c_char,
4902 argv: *mut *const c_char) -> c_int;
4903 #[link_name = "_execvpe"]
4904 pub fn execvpe(c: *const c_char, argv: *mut *const c_char,
4905 envp: *mut *const c_char) -> c_int;
4906 #[link_name = "_getcwd"]
4907 pub fn getcwd(buf: *mut c_char, size: size_t) -> *mut c_char;
4908 #[link_name = "_getpid"]
4909 pub fn getpid() -> c_int;
4910 #[link_name = "_isatty"]
4911 pub fn isatty(fd: c_int) -> c_int;
4912 #[link_name = "_lseek"]
4913 pub fn lseek(fd: c_int, offset: c_long, origin: c_int)
4915 #[link_name = "_pipe"]
4916 pub fn pipe(fds: *mut c_int, psize: c_uint, textmode: c_int)
4918 #[link_name = "_read"]
4919 pub fn read(fd: c_int, buf: *mut c_void, count: c_uint)
4921 #[link_name = "_rmdir"]
4922 pub fn rmdir(path: *const c_char) -> c_int;
4923 #[link_name = "_unlink"]
4924 pub fn unlink(c: *const c_char) -> c_int;
4925 #[link_name = "_write"]
4926 pub fn write(fd: c_int, buf: *const c_void,
4927 count: c_uint) -> c_int;
4935 #[cfg(any(target_os = "linux",
4936 target_os = "android",
4937 target_os = "macos",
4939 target_os = "freebsd",
4940 target_os = "dragonfly",
4941 target_os = "bitrig",
4942 target_os = "openbsd",
4943 target_os = "nacl"))]
4946 use types::os::arch::c95::{c_char, c_int};
4947 use types::os::arch::posix01::stat;
4948 use types::os::arch::posix88::mode_t;
4951 pub fn chmod(path: *const c_char, mode: mode_t) -> c_int;
4952 pub fn fchmod(fd: c_int, mode: mode_t) -> c_int;
4954 #[cfg(any(target_os = "linux",
4955 target_os = "freebsd",
4956 target_os = "dragonfly",
4957 target_os = "bitrig",
4958 target_os = "openbsd",
4959 target_os = "android",
4961 target_os = "nacl"))]
4962 pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
4964 #[cfg(target_os = "macos")]
4965 #[link_name = "fstat64"]
4966 pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
4968 pub fn mkdir(path: *const c_char, mode: mode_t) -> c_int;
4969 #[cfg(not(target_os = "nacl"))]
4970 pub fn mkfifo(path: *const c_char, mode: mode_t) -> c_int;
4972 #[cfg(any(target_os = "linux",
4973 target_os = "freebsd",
4974 target_os = "dragonfly",
4975 target_os = "bitrig",
4976 target_os = "openbsd",
4977 target_os = "android",
4979 target_os = "nacl"))]
4980 pub fn stat(path: *const c_char, buf: *mut stat) -> c_int;
4982 #[cfg(target_os = "macos")]
4983 #[link_name = "stat64"]
4984 pub fn stat(path: *const c_char, buf: *mut stat) -> c_int;
4989 use types::common::c95::FILE;
4990 use types::os::arch::c95::{c_char, c_int};
4993 pub fn popen(command: *const c_char,
4994 mode: *const c_char) -> *mut FILE;
4995 pub fn pclose(stream: *mut FILE) -> c_int;
4996 pub fn fdopen(fd: c_int, mode: *const c_char) -> *mut FILE;
4997 pub fn fileno(stream: *mut FILE) -> c_int;
5002 use types::os::arch::c95::{c_char, c_int};
5003 use types::os::arch::posix88::mode_t;
5006 pub fn open(path: *const c_char, oflag: c_int, mode: mode_t)
5008 pub fn creat(path: *const c_char, mode: mode_t) -> c_int;
5009 pub fn fcntl(fd: c_int, cmd: c_int, ...) -> c_int;
5014 use types::common::posix88::{DIR, dirent_t};
5015 use types::os::arch::c95::{c_char, c_int, c_long};
5017 // NB: On OS X opendir and readdir have two versions,
5018 // one for 32-bit kernelspace and one for 64.
5019 // We should be linking to the 64-bit ones, called
5020 // opendir$INODE64, etc. but for some reason rustc
5021 // doesn't link it correctly on i686, so we're going
5022 // through a C function that mysteriously does work.
5025 #[link_name="rust_opendir"]
5026 pub fn opendir(dirname: *const c_char) -> *mut DIR;
5027 #[link_name="rust_readdir_r"]
5028 pub fn readdir_r(dirp: *mut DIR, entry: *mut dirent_t,
5029 result: *mut *mut dirent_t) -> c_int;
5033 pub fn closedir(dirp: *mut DIR) -> c_int;
5034 pub fn rewinddir(dirp: *mut DIR);
5035 pub fn seekdir(dirp: *mut DIR, loc: c_long);
5036 pub fn telldir(dirp: *mut DIR) -> c_long;
5041 use types::common::c95::c_void;
5042 use types::os::arch::c95::{c_char, c_int, c_long, c_uint};
5043 use types::os::arch::c95::{size_t};
5044 use types::os::common::posix01::timespec;
5045 use types::os::arch::posix01::utimbuf;
5046 use types::os::arch::posix88::{gid_t, off_t, pid_t};
5047 use types::os::arch::posix88::{ssize_t, uid_t};
5049 pub const _PC_NAME_MAX: c_int = 4;
5051 #[cfg(not(target_os = "nacl"))]
5053 pub fn access(path: *const c_char, amode: c_int) -> c_int;
5054 pub fn alarm(seconds: c_uint) -> c_uint;
5055 pub fn chdir(dir: *const c_char) -> c_int;
5056 pub fn chown(path: *const c_char, uid: uid_t,
5057 gid: gid_t) -> c_int;
5058 pub fn close(fd: c_int) -> c_int;
5059 pub fn dup(fd: c_int) -> c_int;
5060 pub fn dup2(src: c_int, dst: c_int) -> c_int;
5061 pub fn execv(prog: *const c_char,
5062 argv: *mut *const c_char) -> c_int;
5063 pub fn execve(prog: *const c_char, argv: *mut *const c_char,
5064 envp: *mut *const c_char)
5066 pub fn execvp(c: *const c_char,
5067 argv: *mut *const c_char) -> c_int;
5068 pub fn fork() -> pid_t;
5069 pub fn fpathconf(filedes: c_int, name: c_int) -> c_long;
5070 pub fn getcwd(buf: *mut c_char, size: size_t) -> *mut c_char;
5071 pub fn getegid() -> gid_t;
5072 pub fn geteuid() -> uid_t;
5073 pub fn getgid() -> gid_t;
5074 pub fn getgroups(ngroups_max: c_int, groups: *mut gid_t)
5076 pub fn getlogin() -> *mut c_char;
5077 pub fn getopt(argc: c_int, argv: *mut *const c_char,
5078 optstr: *const c_char) -> c_int;
5079 pub fn getpgrp() -> pid_t;
5080 pub fn getpid() -> pid_t;
5081 pub fn getppid() -> pid_t;
5082 pub fn getuid() -> uid_t;
5083 pub fn getsid(pid: pid_t) -> pid_t;
5084 pub fn isatty(fd: c_int) -> c_int;
5085 pub fn link(src: *const c_char, dst: *const c_char) -> c_int;
5086 pub fn lseek(fd: c_int, offset: off_t, whence: c_int)
5088 pub fn pathconf(path: *mut c_char, name: c_int) -> c_long;
5089 pub fn pause() -> c_int;
5090 pub fn pipe(fds: *mut c_int) -> c_int;
5091 pub fn read(fd: c_int, buf: *mut c_void, count: size_t)
5093 pub fn rmdir(path: *const c_char) -> c_int;
5094 pub fn setgid(gid: gid_t) -> c_int;
5095 pub fn setpgid(pid: pid_t, pgid: pid_t) -> c_int;
5096 pub fn setsid() -> pid_t;
5097 pub fn setuid(uid: uid_t) -> c_int;
5098 pub fn sleep(secs: c_uint) -> c_uint;
5099 pub fn usleep(secs: c_uint) -> c_int;
5100 pub fn nanosleep(rqtp: *const timespec,
5101 rmtp: *mut timespec) -> c_int;
5102 pub fn sysconf(name: c_int) -> c_long;
5103 pub fn tcgetpgrp(fd: c_int) -> pid_t;
5104 pub fn ttyname(fd: c_int) -> *mut c_char;
5105 pub fn unlink(c: *const c_char) -> c_int;
5106 pub fn write(fd: c_int, buf: *const c_void, count: size_t)
5108 pub fn pread(fd: c_int, buf: *mut c_void, count: size_t,
5109 offset: off_t) -> ssize_t;
5110 pub fn pwrite(fd: c_int, buf: *const c_void, count: size_t,
5111 offset: off_t) -> ssize_t;
5112 pub fn utime(file: *const c_char, buf: *const utimbuf) -> c_int;
5114 #[cfg(target_os = "nacl")]
5116 pub fn access(path: *const c_char, amode: c_int) -> c_int;
5117 pub fn chdir(dir: *const c_char) -> c_int;
5118 pub fn chown(path: *const c_char, uid: uid_t,
5119 gid: gid_t) -> c_int;
5120 pub fn close(fd: c_int) -> c_int;
5121 pub fn dup(fd: c_int) -> c_int;
5122 pub fn dup2(src: c_int, dst: c_int) -> c_int;
5123 pub fn execv(prog: *const c_char,
5124 argv: *mut *const c_char) -> c_int;
5125 pub fn execve(prog: *const c_char, argv: *mut *const c_char,
5126 envp: *mut *const c_char)
5128 pub fn execvp(c: *const c_char,
5129 argv: *mut *const c_char) -> c_int;
5130 pub fn fork() -> pid_t;
5131 pub fn getcwd(buf: *mut c_char, size: size_t) -> *mut c_char;
5132 pub fn getegid() -> gid_t;
5133 pub fn geteuid() -> uid_t;
5134 pub fn getgid() -> gid_t;
5135 pub fn getlogin() -> *mut c_char;
5136 pub fn getopt(argc: c_int, argv: *mut *const c_char,
5137 optstr: *const c_char) -> c_int;
5138 pub fn getuid() -> uid_t;
5139 pub fn getsid(pid: pid_t) -> pid_t;
5140 pub fn isatty(fd: c_int) -> c_int;
5141 pub fn link(src: *const c_char, dst: *const c_char) -> c_int;
5142 pub fn lseek(fd: c_int, offset: off_t, whence: c_int)
5144 pub fn pipe(fds: *mut c_int) -> c_int;
5145 pub fn read(fd: c_int, buf: *mut c_void, count: size_t)
5147 pub fn rmdir(path: *const c_char) -> c_int;
5148 pub fn setgid(gid: gid_t) -> c_int;
5149 pub fn setuid(uid: uid_t) -> c_int;
5150 pub fn sleep(secs: c_uint) -> c_uint;
5151 pub fn usleep(secs: c_uint) -> c_int;
5152 pub fn nanosleep(rqtp: *const timespec,
5153 rmtp: *mut timespec) -> c_int;
5154 pub fn sysconf(name: c_int) -> c_long;
5155 pub fn ttyname(fd: c_int) -> *mut c_char;
5156 pub fn unlink(c: *const c_char) -> c_int;
5157 pub fn write(fd: c_int, buf: *const c_void, count: size_t)
5159 pub fn pread(fd: c_int, buf: *mut c_void, count: size_t,
5160 offset: off_t) -> ssize_t;
5161 pub fn pwrite(fd: c_int, buf: *const c_void, count: size_t,
5162 offset: off_t) -> ssize_t;
5163 pub fn utime(file: *const c_char, buf: *const utimbuf) -> c_int;
5168 use types::os::arch::c95::{c_int};
5169 use types::os::arch::posix88::{pid_t};
5172 pub fn kill(pid: pid_t, sig: c_int) -> c_int;
5177 use types::common::c95::{c_void};
5178 use types::os::arch::c95::{size_t, c_int, c_char};
5179 use types::os::arch::posix88::{mode_t, off_t};
5181 #[cfg(not(target_os = "nacl"))]
5183 pub fn mlock(addr: *const c_void, len: size_t) -> c_int;
5184 pub fn munlock(addr: *const c_void, len: size_t) -> c_int;
5185 pub fn mlockall(flags: c_int) -> c_int;
5186 pub fn munlockall() -> c_int;
5188 pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int)
5191 pub fn msync(addr: *mut c_void, len: size_t, flags: c_int)
5193 pub fn shm_open(name: *const c_char, oflag: c_int, mode: mode_t)
5195 pub fn shm_unlink(name: *const c_char) -> c_int;
5199 pub fn mmap(addr: *mut c_void,
5206 pub fn munmap(addr: *mut c_void, len: size_t) -> c_int;
5212 use types::os::arch::c95::{c_char, c_uint};
5215 pub fn if_nametoindex(ifname: *const c_char) -> c_uint;
5221 #[cfg(any(target_os = "linux",
5222 target_os = "android",
5223 target_os = "macos",
5225 target_os = "freebsd",
5226 target_os = "dragonfly",
5227 target_os = "bitrig",
5228 target_os = "openbsd",
5229 target_os = "nacl"))]
5232 use types::os::arch::c95::{c_char, c_int};
5233 use types::os::arch::posix01::stat;
5236 #[cfg(any(target_os = "linux",
5237 target_os = "freebsd",
5238 target_os = "dragonfly",
5239 target_os = "bitrig",
5240 target_os = "openbsd",
5241 target_os = "android",
5243 target_os = "nacl"))]
5244 pub fn lstat(path: *const c_char, buf: *mut stat) -> c_int;
5246 #[cfg(target_os = "macos")]
5247 #[link_name = "lstat64"]
5248 pub fn lstat(path: *const c_char, buf: *mut stat) -> c_int;
5253 use types::os::arch::c95::{c_char, c_int, size_t};
5254 use types::os::arch::posix88::{ssize_t, off_t};
5257 pub fn readlink(path: *const c_char,
5262 pub fn fsync(fd: c_int) -> c_int;
5264 #[cfg(any(target_os = "linux", target_os = "android"))]
5265 pub fn fdatasync(fd: c_int) -> c_int;
5267 pub fn setenv(name: *const c_char, val: *const c_char,
5268 overwrite: c_int) -> c_int;
5269 pub fn unsetenv(name: *const c_char) -> c_int;
5270 pub fn putenv(string: *mut c_char) -> c_int;
5272 pub fn symlink(path1: *const c_char,
5273 path2: *const c_char) -> c_int;
5275 pub fn ftruncate(fd: c_int, length: off_t) -> c_int;
5280 use types::os::arch::c95::c_int;
5281 use types::os::common::posix01::sighandler_t;
5283 #[cfg(not(all(target_os = "android", target_arch = "arm")))]
5285 pub fn signal(signum: c_int,
5286 handler: sighandler_t) -> sighandler_t;
5289 #[cfg(all(target_os = "android", target_arch = "arm"))]
5291 #[link_name = "bsd_signal"]
5292 pub fn signal(signum: c_int,
5293 handler: sighandler_t) -> sighandler_t;
5298 use types::os::arch::c95::{c_char, c_int};
5299 use types::os::common::posix01::{glob_t};
5302 pub fn glob(pattern: *const c_char,
5304 errfunc: ::core::option::Option<extern "C" fn(epath: *const c_char,
5305 errno: c_int) -> c_int>,
5306 pglob: *mut glob_t);
5307 pub fn globfree(pglob: *mut glob_t);
5312 use types::common::c95::{c_void};
5313 use types::os::arch::c95::{c_int, size_t};
5315 #[cfg(not(target_os = "nacl"))]
5317 pub fn posix_madvise(addr: *mut c_void,
5325 #[cfg(target_os = "windows")]
5344 #[cfg(any(target_os = "windows",
5345 target_os = "linux",
5346 target_os = "android",
5347 target_os = "macos",
5349 target_os = "freebsd",
5350 target_os = "dragonfly",
5351 target_os = "bitrig",
5352 target_os = "openbsd",
5353 target_os = "nacl"))]
5359 #[cfg(not(windows))]
5361 use types::common::c95::{c_void};
5362 use types::os::common::bsd44::{socklen_t, sockaddr, ifaddrs};
5363 use types::os::arch::c95::{c_int, size_t};
5364 use types::os::arch::posix88::ssize_t;
5367 pub fn socket(domain: c_int, ty: c_int, protocol: c_int) -> c_int;
5368 pub fn connect(socket: c_int, address: *const sockaddr,
5369 len: socklen_t) -> c_int;
5370 pub fn bind(socket: c_int, address: *const sockaddr,
5371 address_len: socklen_t) -> c_int;
5372 pub fn listen(socket: c_int, backlog: c_int) -> c_int;
5373 pub fn accept(socket: c_int, address: *mut sockaddr,
5374 address_len: *mut socklen_t) -> c_int;
5375 pub fn getpeername(socket: c_int, address: *mut sockaddr,
5376 address_len: *mut socklen_t) -> c_int;
5377 pub fn getsockname(socket: c_int, address: *mut sockaddr,
5378 address_len: *mut socklen_t) -> c_int;
5379 pub fn setsockopt(socket: c_int, level: c_int, name: c_int,
5380 value: *const c_void,
5381 option_len: socklen_t) -> c_int;
5382 pub fn recv(socket: c_int, buf: *mut c_void, len: size_t,
5383 flags: c_int) -> ssize_t;
5384 pub fn send(socket: c_int, buf: *const c_void, len: size_t,
5385 flags: c_int) -> ssize_t;
5386 pub fn recvfrom(socket: c_int, buf: *mut c_void, len: size_t,
5387 flags: c_int, addr: *mut sockaddr,
5388 addrlen: *mut socklen_t) -> ssize_t;
5389 pub fn sendto(socket: c_int, buf: *const c_void, len: size_t,
5390 flags: c_int, addr: *const sockaddr,
5391 addrlen: socklen_t) -> ssize_t;
5392 pub fn getifaddrs(ifap: *mut *mut ifaddrs) -> c_int;
5393 pub fn freeifaddrs(ifa: *mut ifaddrs);
5394 pub fn shutdown(socket: c_int, how: c_int) -> c_int;
5400 use types::common::c95::{c_void};
5401 use types::os::common::bsd44::{socklen_t, sockaddr, SOCKET};
5402 use types::os::arch::c95::c_int;
5403 use types::os::arch::posix88::ssize_t;
5406 pub fn socket(domain: c_int, ty: c_int, protocol: c_int) -> SOCKET;
5407 pub fn connect(socket: SOCKET, address: *const sockaddr,
5408 len: socklen_t) -> c_int;
5409 pub fn bind(socket: SOCKET, address: *const sockaddr,
5410 address_len: socklen_t) -> c_int;
5411 pub fn listen(socket: SOCKET, backlog: c_int) -> c_int;
5412 pub fn accept(socket: SOCKET, address: *mut sockaddr,
5413 address_len: *mut socklen_t) -> SOCKET;
5414 pub fn getpeername(socket: SOCKET, address: *mut sockaddr,
5415 address_len: *mut socklen_t) -> c_int;
5416 pub fn getsockname(socket: SOCKET, address: *mut sockaddr,
5417 address_len: *mut socklen_t) -> c_int;
5418 pub fn setsockopt(socket: SOCKET, level: c_int, name: c_int,
5419 value: *const c_void,
5420 option_len: socklen_t) -> c_int;
5421 pub fn closesocket(socket: SOCKET) -> c_int;
5422 pub fn recv(socket: SOCKET, buf: *mut c_void, len: c_int,
5423 flags: c_int) -> c_int;
5424 pub fn send(socket: SOCKET, buf: *const c_void, len: c_int,
5425 flags: c_int) -> c_int;
5426 pub fn recvfrom(socket: SOCKET, buf: *mut c_void, len: c_int,
5427 flags: c_int, addr: *mut sockaddr,
5428 addrlen: *mut c_int) -> ssize_t;
5429 pub fn sendto(socket: SOCKET, buf: *const c_void, len: c_int,
5430 flags: c_int, addr: *const sockaddr,
5431 addrlen: c_int) -> c_int;
5432 pub fn shutdown(socket: SOCKET, how: c_int) -> c_int;
5436 #[cfg(any(target_os = "macos",
5438 target_os = "freebsd",
5439 target_os = "dragonfly",
5440 target_os = "bitrig",
5441 target_os = "openbsd"))]
5443 use types::common::c95::{c_void};
5444 use types::os::arch::c95::{c_char, c_uchar, c_int, c_uint, c_ulong, size_t};
5447 pub fn ioctl(d: c_int, request: c_ulong, ...) -> c_int;
5448 pub fn sysctl(name: *mut c_int,
5451 oldlenp: *mut size_t,
5455 pub fn sysctlbyname(name: *const c_char,
5457 oldlenp: *mut size_t,
5461 pub fn sysctlnametomib(name: *const c_char,
5465 pub fn getdtablesize() -> c_int;
5466 pub fn madvise(addr: *mut c_void, len: size_t, advice: c_int)
5468 pub fn mincore(addr: *mut c_void, len: size_t, vec: *mut c_uchar)
5470 pub fn realpath(pathname: *const c_char, resolved: *mut c_char)
5475 #[cfg(any(target_os = "linux", target_os = "android"))]
5477 use types::common::c95::{c_void};
5478 use types::os::arch::c95::{c_uchar, c_int, size_t};
5481 #[cfg(not(all(target_os = "android", target_arch = "aarch64")))]
5482 pub fn getdtablesize() -> c_int;
5483 pub fn ioctl(d: c_int, request: c_int, ...) -> c_int;
5484 pub fn madvise(addr: *mut c_void, len: size_t, advice: c_int)
5486 pub fn mincore(addr: *mut c_void, len: size_t, vec: *mut c_uchar)
5491 #[cfg(target_os = "nacl")]
5493 use types::os::arch::c95::c_int;
5495 pub fn getdtablesize() -> c_int;
5499 #[cfg(target_os = "windows")]
5503 #[cfg(any(target_os = "macos", target_os = "ios"))]
5505 use types::os::arch::c95::{c_char, c_int};
5508 pub fn _NSGetExecutablePath(buf: *mut c_char, bufsize: *mut u32)
5513 #[cfg(any(target_os = "freebsd",
5514 target_os = "dragonfly",
5515 target_os = "bitrig",
5516 target_os = "openbsd"))]
5520 #[cfg(any(target_os = "linux", target_os = "android", target_os = "nacl"))]
5525 #[cfg(target_os = "windows")]
5529 use types::os::arch::c95::{c_uint};
5530 use types::os::arch::extra::{BOOL, DWORD, SIZE_T, HMODULE,
5532 LPWCH, LPDWORD, LPVOID,
5533 LPCVOID, LPOVERLAPPED,
5534 LPSECURITY_ATTRIBUTES,
5536 LPPROCESS_INFORMATION,
5537 LPMEMORY_BASIC_INFORMATION,
5538 LPSYSTEM_INFO, HANDLE, LPHANDLE,
5539 LARGE_INTEGER, PLARGE_INTEGER,
5540 LPFILETIME, LPWIN32_FIND_DATAW};
5543 pub fn GetEnvironmentVariableW(n: LPCWSTR,
5547 pub fn SetEnvironmentVariableW(n: LPCWSTR, v: LPCWSTR)
5549 pub fn GetEnvironmentStringsW() -> LPWCH;
5550 pub fn FreeEnvironmentStringsW(env_ptr: LPWCH) -> BOOL;
5551 pub fn GetModuleFileNameW(hModule: HMODULE,
5555 pub fn CreateDirectoryW(lpPathName: LPCWSTR,
5556 lpSecurityAttributes:
5557 LPSECURITY_ATTRIBUTES)
5559 pub fn CopyFileW(lpExistingFileName: LPCWSTR,
5560 lpNewFileName: LPCWSTR,
5561 bFailIfExists: BOOL)
5563 pub fn DeleteFileW(lpPathName: LPCWSTR) -> BOOL;
5564 pub fn RemoveDirectoryW(lpPathName: LPCWSTR) -> BOOL;
5565 pub fn GetCurrentDirectoryW(nBufferLength: DWORD,
5568 pub fn SetCurrentDirectoryW(lpPathName: LPCWSTR) -> BOOL;
5569 pub fn GetLastError() -> DWORD;
5570 pub fn FindFirstFileW(fileName: LPCWSTR, findFileData: LPWIN32_FIND_DATAW)
5572 pub fn FindNextFileW(findFile: HANDLE, findFileData: LPWIN32_FIND_DATAW)
5574 pub fn FindClose(findFile: HANDLE) -> BOOL;
5575 pub fn DuplicateHandle(hSourceProcessHandle: HANDLE,
5576 hSourceHandle: HANDLE,
5577 hTargetProcessHandle: HANDLE,
5578 lpTargetHandle: LPHANDLE,
5579 dwDesiredAccess: DWORD,
5580 bInheritHandle: BOOL,
5583 pub fn CloseHandle(hObject: HANDLE) -> BOOL;
5584 pub fn OpenProcess(dwDesiredAccess: DWORD,
5585 bInheritHandle: BOOL,
5588 pub fn GetCurrentProcess() -> HANDLE;
5589 pub fn CreateProcessW(lpApplicationName: LPCWSTR,
5590 lpCommandLine: LPWSTR,
5591 lpProcessAttributes:
5592 LPSECURITY_ATTRIBUTES,
5594 LPSECURITY_ATTRIBUTES,
5595 bInheritHandles: BOOL,
5596 dwCreationFlags: DWORD,
5597 lpEnvironment: LPVOID,
5598 lpCurrentDirectory: LPCWSTR,
5599 lpStartupInfo: LPSTARTUPINFO,
5600 lpProcessInformation:
5601 LPPROCESS_INFORMATION)
5603 pub fn WaitForSingleObject(hHandle: HANDLE,
5604 dwMilliseconds: DWORD)
5606 pub fn TerminateProcess(hProcess: HANDLE, uExitCode: c_uint)
5608 pub fn GetExitCodeProcess(hProcess: HANDLE,
5609 lpExitCode: LPDWORD)
5611 pub fn GetSystemInfo(lpSystemInfo: LPSYSTEM_INFO);
5612 pub fn VirtualAlloc(lpAddress: LPVOID,
5614 flAllocationType: DWORD,
5617 pub fn VirtualFree(lpAddress: LPVOID,
5621 pub fn VirtualLock(lpAddress: LPVOID, dwSize: SIZE_T) -> BOOL;
5622 pub fn VirtualUnlock(lpAddress: LPVOID, dwSize: SIZE_T)
5624 pub fn VirtualProtect(lpAddress: LPVOID,
5626 flNewProtect: DWORD,
5627 lpflOldProtect: LPDWORD)
5629 pub fn VirtualQuery(lpAddress: LPCVOID,
5630 lpBuffer: LPMEMORY_BASIC_INFORMATION,
5633 pub fn CreateFileMappingW(hFile: HANDLE,
5634 lpAttributes: LPSECURITY_ATTRIBUTES,
5636 dwMaximumSizeHigh: DWORD,
5637 dwMaximumSizeLow: DWORD,
5640 pub fn MapViewOfFile(hFileMappingObject: HANDLE,
5641 dwDesiredAccess: DWORD,
5642 dwFileOffsetHigh: DWORD,
5643 dwFileOffsetLow: DWORD,
5644 dwNumberOfBytesToMap: SIZE_T)
5646 pub fn UnmapViewOfFile(lpBaseAddress: LPCVOID) -> BOOL;
5647 pub fn MoveFileExW(lpExistingFileName: LPCWSTR,
5648 lpNewFileName: LPCWSTR,
5649 dwFlags: DWORD) -> BOOL;
5650 pub fn CreateHardLinkW(lpSymlinkFileName: LPCWSTR,
5651 lpTargetFileName: LPCWSTR,
5652 lpSecurityAttributes: LPSECURITY_ATTRIBUTES)
5654 pub fn FlushFileBuffers(hFile: HANDLE) -> BOOL;
5655 pub fn CreateFileW(lpFileName: LPCWSTR,
5656 dwDesiredAccess: DWORD,
5658 lpSecurityAttributes: LPSECURITY_ATTRIBUTES,
5659 dwCreationDisposition: DWORD,
5660 dwFlagsAndAttributes: DWORD,
5661 hTemplateFile: HANDLE) -> HANDLE;
5662 pub fn ReadFile(hFile: HANDLE,
5664 nNumberOfBytesToRead: DWORD,
5665 lpNumberOfBytesRead: LPDWORD,
5666 lpOverlapped: LPOVERLAPPED) -> BOOL;
5667 pub fn WriteFile(hFile: HANDLE,
5669 nNumberOfBytesToRead: DWORD,
5670 lpNumberOfBytesRead: LPDWORD,
5671 lpOverlapped: LPOVERLAPPED) -> BOOL;
5672 pub fn SetFilePointerEx(hFile: HANDLE,
5673 liDistanceToMove: LARGE_INTEGER,
5674 lpNewFilePointer: PLARGE_INTEGER,
5675 dwMoveMethod: DWORD) -> BOOL;
5676 pub fn SetEndOfFile(hFile: HANDLE) -> BOOL;
5678 pub fn GetSystemTimeAsFileTime(
5679 lpSystemTimeAsFileTime: LPFILETIME);
5681 pub fn QueryPerformanceFrequency(
5682 lpFrequency: *mut LARGE_INTEGER) -> BOOL;
5683 pub fn QueryPerformanceCounter(
5684 lpPerformanceCount: *mut LARGE_INTEGER) -> BOOL;
5686 pub fn GetCurrentProcessId() -> DWORD;
5687 pub fn CreateNamedPipeW(
5691 nMaxInstances: DWORD,
5692 nOutBufferSize: DWORD,
5693 nInBufferSize: DWORD,
5694 nDefaultTimeOut: DWORD,
5695 lpSecurityAttributes: LPSECURITY_ATTRIBUTES
5697 pub fn ConnectNamedPipe(hNamedPipe: HANDLE,
5698 lpOverlapped: LPOVERLAPPED) -> BOOL;
5699 pub fn WaitNamedPipeW(lpNamedPipeName: LPCWSTR,
5700 nTimeOut: DWORD) -> BOOL;
5701 pub fn SetNamedPipeHandleState(hNamedPipe: HANDLE,
5703 lpMaxCollectionCount: LPDWORD,
5704 lpCollectDataTimeout: LPDWORD)
5706 pub fn CreateEventW(lpEventAttributes: LPSECURITY_ATTRIBUTES,
5708 bInitialState: BOOL,
5709 lpName: LPCWSTR) -> HANDLE;
5710 pub fn GetOverlappedResult(hFile: HANDLE,
5711 lpOverlapped: LPOVERLAPPED,
5712 lpNumberOfBytesTransferred: LPDWORD,
5713 bWait: BOOL) -> BOOL;
5714 pub fn DisconnectNamedPipe(hNamedPipe: HANDLE) -> BOOL;
5719 use types::os::arch::c95::{c_int, c_long};
5720 use types::os::arch::c99::intptr_t;
5723 #[link_name = "_commit"]
5724 pub fn commit(fd: c_int) -> c_int;
5726 #[link_name = "_get_osfhandle"]
5727 pub fn get_osfhandle(fd: c_int) -> c_long;
5729 #[link_name = "_open_osfhandle"]
5730 pub fn open_osfhandle(osfhandle: intptr_t,
5731 flags: c_int) -> c_int;
5736 use types::os::arch::c95::{c_int, c_long, c_ulong};
5737 use types::os::common::bsd44::SOCKET;
5740 pub fn ioctlsocket(s: SOCKET, cmd: c_long, argp: *mut c_ulong) -> c_int;
5747 pub fn issue_14344_workaround() {} // FIXME #14344 force linkage to happen correctly
5749 #[test] fn work_on_windows() { } // FIXME #10872 needed for a happy windows