(index<- )        ./libstd/libc.rs

    1  // Copyright 2012 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.
    4  //
    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.
   10  
   11  /*!
   12  * Bindings for the C standard library and other platform libraries
   13  *
   14  * This module contains bindings to the C standard library,
   15  * organized into modules by their defining standard.
   16  * Additionally, it contains some assorted platform-specific definitions.
   17  * For convenience, most functions and types are reexported from `std::libc`,
   18  * so `pub use std::libc::*` will import the available
   19  * C bindings as appropriate for the target platform. The exact
   20  * set of functions available are platform specific.
   21  *
   22  * *Note* Because these definitions are platform-specific, some may not appear in
   23  * the generated documentation.
   24  *
   25  * We consider the following specs reasonably normative with respect
   26  * to interoperating with the C standard library (libc/msvcrt):
   27  *
   28  * * ISO 9899:1990 ('C95', 'ANSI C', 'Standard C'), NA1, 1995.
   29  * * ISO 9899:1999 ('C99' or 'C9x').
   30  * * ISO 9945:1988 / IEEE 1003.1-1988 ('POSIX.1').
   31  * * ISO 9945:2001 / IEEE 1003.1-2001 ('POSIX:2001', 'SUSv3').
   32  * * ISO 9945:2008 / IEEE 1003.1-2008 ('POSIX:2008', 'SUSv4').
   33  *
   34  * Note that any reference to the 1996 revision of POSIX, or any revs
   35  * between 1990 (when '88 was approved at ISO) and 2001 (when the next
   36  * actual revision-revision happened), are merely additions of other
   37  * chapters (1b and 1c) outside the core interfaces.
   38  *
   39  * Despite having several names each, these are *reasonably* coherent
   40  * point-in-time, list-of-definition sorts of specs. You can get each under a
   41  * variety of names but will wind up with the same definition in each case.
   42  *
   43  * See standards(7) in linux-manpages for more details.
   44  *
   45  * Our interface to these libraries is complicated by the non-universality of
   46  * conformance to any of them. About the only thing universally supported is
   47  * the first (C95), beyond that definitions quickly become absent on various
   48  * platforms.
   49  *
   50  * We therefore wind up dividing our module-space up (mostly for the sake of
   51  * sanity while editing, filling-in-details and eliminating duplication) into
   52  * definitions common-to-all (held in modules named c95, c99, posix88, posix01
   53  * and posix08) and definitions that appear only on *some* platforms (named
   54  * 'extra'). This would be things like significant OSX foundation kit, or
   55  * win32 library kernel32.dll, or various fancy glibc, linux or BSD
   56  * extensions.
   57  *
   58  * In addition to the per-platform 'extra' modules, we define a module of
   59  * 'common BSD' libc routines that never quite made it into POSIX but show up
   60  * in multiple derived systems. This is the 4.4BSD r2 / 1995 release, the
   61  * final one from Berkeley after the lawsuits died down and the CSRG
   62  * dissolved.
   63  */
   64  
   65  #[allow(non_camel_case_types)];
   66  #[allow(non_uppercase_statics)];
   67  #[allow(missing_doc)];
   68  #[allow(uppercase_variables)];
   69  
   70  // Initial glob-exports mean that all the contents of all the modules
   71  // wind up exported, if you're interested in writing platform-specific code.
   72  
   73  pub use libc::types::common::c95::*;
   74  pub use libc::types::common::c99::*;
   75  pub use libc::types::common::posix88::*;
   76  pub use libc::types::common::posix01::*;
   77  pub use libc::types::common::posix08::*;
   78  pub use libc::types::common::bsd44::*;
   79  pub use libc::types::os::common::posix01::*;
   80  pub use libc::types::os::common::bsd44::*;
   81  pub use libc::types::os::arch::c95::*;
   82  pub use libc::types::os::arch::c99::*;
   83  pub use libc::types::os::arch::posix88::*;
   84  pub use libc::types::os::arch::posix01::*;
   85  pub use libc::types::os::arch::posix08::*;
   86  pub use libc::types::os::arch::bsd44::*;
   87  pub use libc::types::os::arch::extra::*;
   88  
   89  pub use libc::consts::os::c95::*;
   90  pub use libc::consts::os::c99::*;
   91  pub use libc::consts::os::posix88::*;
   92  pub use libc::consts::os::posix01::*;
   93  pub use libc::consts::os::posix08::*;
   94  pub use libc::consts::os::bsd44::*;
   95  pub use libc::consts::os::extra::*;
   96  pub use libc::consts::os::sysconf::*;
   97  
   98  pub use libc::funcs::c95::ctype::*;
   99  pub use libc::funcs::c95::stdio::*;
  100  pub use libc::funcs::c95::stdlib::*;
  101  pub use libc::funcs::c95::string::*;
  102  
  103  pub use libc::funcs::posix88::stat_::*;
  104  pub use libc::funcs::posix88::stdio::*;
  105  pub use libc::funcs::posix88::fcntl::*;
  106  pub use libc::funcs::posix88::dirent::*;
  107  pub use libc::funcs::posix88::unistd::*;
  108  pub use libc::funcs::posix88::mman::*;
  109  
  110  pub use libc::funcs::posix01::stat_::*;
  111  pub use libc::funcs::posix01::unistd::*;
  112  pub use libc::funcs::posix01::glob::*;
  113  pub use libc::funcs::posix01::mman::*;
  114  pub use libc::funcs::posix08::unistd::*;
  115  
  116  pub use libc::funcs::bsd43::*;
  117  pub use libc::funcs::bsd44::*;
  118  pub use libc::funcs::extra::*;
  119  
  120  #[cfg(target_os = "win32")]
  121  pub use libc::funcs::extra::kernel32::*;
  122  #[cfg(target_os = "win32")]
  123  pub use libc::funcs::extra::msvcrt::*;
  124  
  125  // Explicit export lists for the intersection (provided here) mean that
  126  // you can write more-platform-agnostic code if you stick to just these
  127  // symbols.
  128  
  129  pub use libc::types::common::c95::{FILE, c_void, fpos_t};
  130  pub use libc::types::common::posix88::{DIR, dirent_t};
  131  pub use libc::types::os::arch::c95::{c_char, c_double, c_float, c_int};
  132  pub use libc::types::os::arch::c95::{c_long, c_short, c_uchar, c_ulong};
  133  pub use libc::types::os::arch::c95::{c_ushort, clock_t, ptrdiff_t};
  134  pub use libc::types::os::arch::c95::{size_t, time_t};
  135  pub use libc::types::os::arch::c99::{c_longlong, c_ulonglong, intptr_t};
  136  pub use libc::types::os::arch::c99::{uintptr_t};
  137  pub use libc::types::os::arch::posix88::{dev_t, dirent_t, ino_t, mode_t};
  138  pub use libc::types::os::arch::posix88::{off_t, pid_t, ssize_t};
  139  
  140  pub use libc::consts::os::c95::{_IOFBF, _IOLBF, _IONBF, BUFSIZ, EOF};
  141  pub use libc::consts::os::c95::{EXIT_FAILURE, EXIT_SUCCESS};
  142  pub use libc::consts::os::c95::{FILENAME_MAX, FOPEN_MAX, L_tmpnam};
  143  pub use libc::consts::os::c95::{RAND_MAX, SEEK_CUR, SEEK_END};
  144  pub use libc::consts::os::c95::{SEEK_SET, TMP_MAX};
  145  pub use libc::consts::os::posix88::{F_OK, O_APPEND, O_CREAT, O_EXCL};
  146  pub use libc::consts::os::posix88::{O_RDONLY, O_RDWR, O_TRUNC, O_WRONLY};
  147  pub use libc::consts::os::posix88::{R_OK, S_IEXEC, S_IFBLK, S_IFCHR};
  148  pub use libc::consts::os::posix88::{S_IFDIR, S_IFIFO, S_IFMT, S_IFREG, S_IFLNK};
  149  pub use libc::consts::os::posix88::{S_IREAD, S_IRUSR, S_IRWXU, S_IWUSR};
  150  pub use libc::consts::os::posix88::{STDERR_FILENO, STDIN_FILENO};
  151  pub use libc::consts::os::posix88::{STDOUT_FILENO, W_OK, X_OK};
  152  
  153  pub use libc::funcs::c95::ctype::{isalnum, isalpha, iscntrl, isdigit};
  154  pub use libc::funcs::c95::ctype::{islower, isprint, ispunct, isspace};
  155  pub use libc::funcs::c95::ctype::{isupper, isxdigit, tolower, toupper};
  156  
  157  pub use libc::funcs::c95::stdio::{fclose, feof, ferror, fflush, fgetc};
  158  pub use libc::funcs::c95::stdio::{fgetpos, fgets, fopen, fputc, fputs};
  159  pub use libc::funcs::c95::stdio::{fread, freopen, fseek, fsetpos, ftell};
  160  pub use libc::funcs::c95::stdio::{fwrite, perror, puts, remove, rewind};
  161  pub use libc::funcs::c95::stdio::{setbuf, setvbuf, tmpfile, ungetc};
  162  
  163  pub use libc::funcs::c95::stdlib::{abs, atof, atoi, calloc, exit, _exit};
  164  pub use libc::funcs::c95::stdlib::{free, getenv, labs, malloc, rand};
  165  pub use libc::funcs::c95::stdlib::{realloc, srand, strtod, strtol};
  166  pub use libc::funcs::c95::stdlib::{strtoul, system};
  167  
  168  pub use libc::funcs::c95::string::{memchr, memcmp};
  169  pub use libc::funcs::c95::string::{strcat, strchr, strcmp};
  170  pub use libc::funcs::c95::string::{strcoll, strcpy, strcspn, strerror};
  171  pub use libc::funcs::c95::string::{strlen, strncat, strncmp, strncpy};
  172  pub use libc::funcs::c95::string::{strpbrk, strrchr, strspn, strstr};
  173  pub use libc::funcs::c95::string::{strtok, strxfrm};
  174  
  175  pub use libc::funcs::posix88::fcntl::{open, creat};
  176  pub use libc::funcs::posix88::stat_::{chmod, fstat, mkdir, stat};
  177  pub use libc::funcs::posix88::stdio::{fdopen, fileno, pclose, popen};
  178  pub use libc::funcs::posix88::unistd::{access, chdir, close, dup, dup2};
  179  pub use libc::funcs::posix88::unistd::{execv, execve, execvp, getcwd};
  180  pub use libc::funcs::posix88::unistd::{getpid, isatty, lseek, pipe, read};
  181  pub use libc::funcs::posix88::unistd::{rmdir, unlink, write};
  182  
  183  
  184  pub mod types {
  185  
  186      // Types tend to vary *per architecture* so we pull their definitions out
  187      // into this module.
  188  
  189      // Standard types that are opaque or common, so are not per-target.
  190      pub mod common {
  191          pub mod c95 {
  192              /**
  193              Type used to construct void pointers for use with C.
  194  
  195              This type is only useful as a pointer target. Do not use it as a
  196              return type for FFI functions which have the `void` return type in
  197              C. Use the unit type `()` or omit the return type instead.
  198  
  199              For LLVM to recognize the void pointer type and by extension
  200              functions like malloc(), we need to have it represented as i8* in
  201              LLVM bitcode. The enum used here ensures this and prevents misuse
  202              of the "raw" type by only having private variants.. We need two
  203              variants, because the compiler complains about the repr attribute
  204              otherwise.
  205              */
  206              #[repr(u8)]
  207              pub enum c_void {
  208                  priv variant1,
  209                  priv variant2
  210              }
  211              pub enum FILE {}
  212              pub enum fpos_t {}
  213          }
  214          pub mod c99 {
  215              pub type int8_t = i8;
  216              pub type int16_t = i16;
  217              pub type int32_t = i32;
  218              pub type int64_t = i64;
  219              pub type uint8_t = u8;
  220              pub type uint16_t = u16;
  221              pub type uint32_t = u32;
  222              pub type uint64_t = u64;
  223          }
  224          pub mod posix88 {
  225              pub enum DIR {}
  226              pub enum dirent_t {}
  227          }
  228          pub mod posix01 {}
  229          pub mod posix08 {}
  230          pub mod bsd44 {}
  231      }
  232  
  233      // Standard types that are scalar but vary by OS and arch.
  234  
  235      #[cfg(target_os = "linux")]
  236      #[cfg(target_os = "android")]
  237      pub mod os {
  238          pub mod common {
  239              pub mod posix01 {
  240                  use libc::types::common::c95::{c_void};
  241                  use libc::types::os::arch::c95::{c_char, c_ulong, size_t,
  242                                                   time_t, suseconds_t, c_long};
  243  
  244                  pub type pthread_t = c_ulong;
  245  
  246                  pub struct glob_t {
  247                      gl_pathc: size_t,
  248                      gl_pathv: **c_char,
  249                      gl_offs:  size_t,
  250  
  251                      __unused1: *c_void,
  252                      __unused2: *c_void,
  253                      __unused3: *c_void,
  254                      __unused4: *c_void,
  255                      __unused5: *c_void,
  256                  }
  257  
  258                  pub struct timeval {
  259                      tv_sec: time_t,
  260                      tv_usec: suseconds_t,
  261                  }
  262  
  263                  pub struct timespec {
  264                      tv_sec: time_t,
  265                      tv_nsec: c_long,
  266                  }
  267  
  268                  pub enum timezone {}
  269              }
  270              pub mod bsd44 {
  271                  use libc::types::os::arch::c95::{c_char, c_int, c_uint};
  272  
  273                  pub type socklen_t = u32;
  274                  pub type sa_family_t = u16;
  275                  pub type in_port_t = u16;
  276                  pub type in_addr_t = u32;
  277                  pub struct sockaddr {
  278                      sa_family: sa_family_t,
  279                      sa_data: [u8, ..14],
  280                  }
  281                  pub struct sockaddr_storage {
  282                      ss_family: sa_family_t,
  283                      __ss_align: i64,
  284                      __ss_pad2: [u8, ..112],
  285                  }
  286                  pub struct sockaddr_in {
  287                      sin_family: sa_family_t,
  288                      sin_port: in_port_t,
  289                      sin_addr: in_addr,
  290                      sin_zero: [u8, ..8],
  291                  }
  292                  pub struct in_addr {
  293                      s_addr: in_addr_t,
  294                  }
  295                  pub struct sockaddr_in6 {
  296                      sin6_family: sa_family_t,
  297                      sin6_port: in_port_t,
  298                      sin6_flowinfo: u32,
  299                      sin6_addr: in6_addr,
  300                      sin6_scope_id: u32,
  301                  }
  302                  pub struct in6_addr {
  303                      s6_addr: [u16, ..8]
  304                  }
  305                  pub struct ip_mreq {
  306                      imr_multiaddr: in_addr,
  307                      imr_interface: in_addr,
  308                  }
  309                  pub struct ip6_mreq {
  310                      ipv6mr_multiaddr: in6_addr,
  311                      ipv6mr_interface: c_uint,
  312                  }
  313                  pub struct addrinfo {
  314                      ai_flags: c_int,
  315                      ai_family: c_int,
  316                      ai_socktype: c_int,
  317                      ai_protocol: c_int,
  318                      ai_addrlen: socklen_t,
  319                      ai_addr: *sockaddr,
  320                      ai_canonname: *c_char,
  321                      ai_next: *addrinfo
  322                  }
  323                  pub struct sockaddr_un {
  324                      sun_family: sa_family_t,
  325                      sun_path: [c_char, ..108]
  326                  }
  327              }
  328          }
  329  
  330          #[cfg(target_arch = "x86")]
  331          #[cfg(target_arch = "arm")]
  332          #[cfg(target_arch = "mips")]
  333          pub mod arch {
  334              pub mod c95 {
  335                  pub type c_char = i8;
  336                  pub type c_schar = i8;
  337                  pub type c_uchar = u8;
  338                  pub type c_short = i16;
  339                  pub type c_ushort = u16;
  340                  pub type c_int = i32;
  341                  pub type c_uint = u32;
  342                  pub type c_long = i32;
  343                  pub type c_ulong = u32;
  344                  pub type c_float = f32;
  345                  pub type c_double = f64;
  346                  pub type size_t = u32;
  347                  pub type ptrdiff_t = i32;
  348                  pub type clock_t = i32;
  349                  pub type time_t = i32;
  350                  pub type suseconds_t = i32;
  351                  pub type wchar_t = i32;
  352              }
  353              pub mod c99 {
  354                  pub type c_longlong = i64;
  355                  pub type c_ulonglong = u64;
  356                  pub type intptr_t = int;
  357                  pub type uintptr_t = uint;
  358              }
  359              #[cfg(target_arch = "x86")]
  360              #[cfg(target_arch = "mips")]
  361              pub mod posix88 {
  362                  pub type off_t = i32;
  363                  pub type dev_t = u64;
  364                  pub type ino_t = u32;
  365                  pub type pid_t = i32;
  366                  pub type uid_t = u32;
  367                  pub type gid_t = u32;
  368                  pub type useconds_t = u32;
  369                  pub type mode_t = u32;
  370                  pub type ssize_t = i32;
  371              }
  372              #[cfg(target_arch = "arm")]
  373              pub mod posix88 {
  374                  pub type off_t = i32;
  375                  pub type dev_t = u32;
  376                  pub type ino_t = u32;
  377                  pub type pid_t = i32;
  378                  pub type uid_t = u32;
  379                  pub type gid_t = u32;
  380                  pub type useconds_t = u32;
  381                  pub type mode_t = u16;
  382                  pub type ssize_t = i32;
  383              }
  384              #[cfg(target_arch = "x86")]
  385              pub mod posix01 {
  386                  use libc::types::os::arch::c95::{c_short, c_long, time_t};
  387                  use libc::types::os::arch::posix88::{dev_t, gid_t, ino_t};
  388                  use libc::types::os::arch::posix88::{mode_t, off_t};
  389                  use libc::types::os::arch::posix88::{uid_t};
  390  
  391                  pub type nlink_t = u32;
  392                  pub type blksize_t = i32;
  393                  pub type blkcnt_t = i32;
  394  
  395                  pub struct stat {
  396                      st_dev: dev_t,
  397                      __pad1: c_short,
  398                      st_ino: ino_t,
  399                      st_mode: mode_t,
  400                      st_nlink: nlink_t,
  401                      st_uid: uid_t,
  402                      st_gid: gid_t,
  403                      st_rdev: dev_t,
  404                      __pad2: c_short,
  405                      st_size: off_t,
  406                      st_blksize: blksize_t,
  407                      st_blocks: blkcnt_t,
  408                      st_atime: time_t,
  409                      st_atime_nsec: c_long,
  410                      st_mtime: time_t,
  411                      st_mtime_nsec: c_long,
  412                      st_ctime: time_t,
  413                      st_ctime_nsec: c_long,
  414                      __unused4: c_long,
  415                      __unused5: c_long,
  416                  }
  417  
  418                  pub struct utimbuf {
  419                      actime: time_t,
  420                      modtime: time_t,
  421                  }
  422  
  423                  pub struct pthread_attr_t {
  424                      __size: [u32, ..9]
  425                  }
  426              }
  427              #[cfg(target_arch = "arm")]
  428              pub mod posix01 {
  429                  use libc::types::os::arch::c95::{c_uchar, c_uint, c_ulong, time_t};
  430                  use libc::types::os::arch::c99::{c_longlong, c_ulonglong};
  431                  use libc::types::os::arch::posix88::{uid_t, gid_t, ino_t};
  432  
  433                  pub type nlink_t = u16;
  434                  pub type blksize_t = u32;
  435                  pub type blkcnt_t = u32;
  436  
  437                  pub struct stat {
  438                      st_dev: c_ulonglong,
  439                      __pad0: [c_uchar, ..4],
  440                      __st_ino: ino_t,
  441                      st_mode: c_uint,
  442                      st_nlink: c_uint,
  443                      st_uid: uid_t,
  444                      st_gid: gid_t,
  445                      st_rdev: c_ulonglong,
  446                      __pad3: [c_uchar, ..4],
  447                      st_size: c_longlong,
  448                      st_blksize: blksize_t,
  449                      st_blocks: c_ulonglong,
  450                      st_atime: time_t,
  451                      st_atime_nsec: c_ulong,
  452                      st_mtime: time_t,
  453                      st_mtime_nsec: c_ulong,
  454                      st_ctime: time_t,
  455                      st_ctime_nsec: c_ulong,
  456                      st_ino: c_ulonglong
  457                  }
  458  
  459                  pub struct utimbuf {
  460                      actime: time_t,
  461                      modtime: time_t,
  462                  }
  463  
  464                  pub struct pthread_attr_t {
  465                      __size: [u32, ..9]
  466                  }
  467              }
  468              #[cfg(target_arch = "mips")]
  469              pub mod posix01 {
  470                  use libc::types::os::arch::c95::{c_long, c_ulong, time_t};
  471                  use libc::types::os::arch::posix88::{gid_t, ino_t};
  472                  use libc::types::os::arch::posix88::{mode_t, off_t};
  473                  use libc::types::os::arch::posix88::{uid_t};
  474  
  475                  pub type nlink_t = u32;
  476                  pub type blksize_t = i32;
  477                  pub type blkcnt_t = i32;
  478  
  479                  pub struct stat {
  480                      st_dev: c_ulong,
  481                      st_pad1: [c_long, ..3],
  482                      st_ino: ino_t,
  483                      st_mode: mode_t,
  484                      st_nlink: nlink_t,
  485                      st_uid: uid_t,
  486                      st_gid: gid_t,
  487                      st_rdev: c_ulong,
  488                      st_pad2: [c_long, ..2],
  489                      st_size: off_t,
  490                      st_pad3: c_long,
  491                      st_atime: time_t,
  492                      st_atime_nsec: c_long,
  493                      st_mtime: time_t,
  494                      st_mtime_nsec: c_long,
  495                      st_ctime: time_t,
  496                      st_ctime_nsec: c_long,
  497                      st_blksize: blksize_t,
  498                      st_blocks: blkcnt_t,
  499                      st_pad5: [c_long, ..14],
  500                  }
  501  
  502                  pub struct utimbuf {
  503                      actime: time_t,
  504                      modtime: time_t,
  505                  }
  506  
  507                  pub struct pthread_attr_t {
  508                      __size: [u32, ..9]
  509                  }
  510              }
  511              pub mod posix08 {}
  512              pub mod bsd44 {}
  513              pub mod extra {}
  514          }
  515  
  516          #[cfg(target_arch = "x86_64")]
  517          pub mod arch {
  518              pub mod c95 {
  519                  pub type c_char = i8;
  520                  pub type c_schar = i8;
  521                  pub type c_uchar = u8;
  522                  pub type c_short = i16;
  523                  pub type c_ushort = u16;
  524                  pub type c_int = i32;
  525                  pub type c_uint = u32;
  526                  pub type c_long = i64;
  527                  pub type c_ulong = u64;
  528                  pub type c_float = f32;
  529                  pub type c_double = f64;
  530                  pub type size_t = u64;
  531                  pub type ptrdiff_t = i64;
  532                  pub type clock_t = i64;
  533                  pub type time_t = i64;
  534                  pub type suseconds_t = i64;
  535                  pub type wchar_t = i32;
  536              }
  537              pub mod c99 {
  538                  pub type c_longlong = i64;
  539                  pub type c_ulonglong = u64;
  540                  pub type intptr_t = int;
  541                  pub type uintptr_t = uint;
  542              }
  543              pub mod posix88 {
  544                  pub type off_t = i64;
  545                  pub type dev_t = u64;
  546                  pub type ino_t = u64;
  547                  pub type pid_t = i32;
  548                  pub type uid_t = u32;
  549                  pub type gid_t = u32;
  550                  pub type useconds_t = u32;
  551                  pub type mode_t = u32;
  552                  pub type ssize_t = i64;
  553              }
  554              pub mod posix01 {
  555                  use libc::types::os::arch::c95::{c_int, c_long, time_t};
  556                  use libc::types::os::arch::posix88::{dev_t, gid_t, ino_t};
  557                  use libc::types::os::arch::posix88::{mode_t, off_t};
  558                  use libc::types::os::arch::posix88::{uid_t};
  559  
  560                  pub type nlink_t = u64;
  561                  pub type blksize_t = i64;
  562                  pub type blkcnt_t = i64;
  563                  pub struct stat {
  564                      st_dev: dev_t,
  565                      st_ino: ino_t,
  566                      st_nlink: nlink_t,
  567                      st_mode: mode_t,
  568                      st_uid: uid_t,
  569                      st_gid: gid_t,
  570                      __pad0: c_int,
  571                      st_rdev: dev_t,
  572                      st_size: off_t,
  573                      st_blksize: blksize_t,
  574                      st_blocks: blkcnt_t,
  575                      st_atime: time_t,
  576                      st_atime_nsec: c_long,
  577                      st_mtime: time_t,
  578                      st_mtime_nsec: c_long,
  579                      st_ctime: time_t,
  580                      st_ctime_nsec: c_long,
  581                      __unused: [c_long, ..3],
  582                  }
  583  
  584                  pub struct utimbuf {
  585                      actime: time_t,
  586                      modtime: time_t,
  587                  }
  588  
  589                  pub struct pthread_attr_t {
  590                      __size: [u64, ..7]
  591                  }
  592              }
  593              pub mod posix08 {
  594              }
  595              pub mod bsd44 {
  596              }
  597              pub mod extra {
  598              }
  599          }
  600      }
  601  
  602      #[cfg(target_os = "freebsd")]
  603      pub mod os {
  604          pub mod common {
  605              pub mod posix01 {
  606                  use libc::types::common::c95::{c_void};
  607                  use libc::types::os::arch::c95::{c_char, c_int, size_t,
  608                                                   time_t, suseconds_t, c_long};
  609                  use libc::types::os::arch::c99::{uintptr_t};
  610  
  611                  pub type pthread_t = uintptr_t;
  612  
  613                  pub struct glob_t {
  614                      gl_pathc:  size_t,
  615                      __unused1: size_t,
  616                      gl_offs:   size_t,
  617                      __unused2: c_int,
  618                      gl_pathv:  **c_char,
  619  
  620                      __unused3: *c_void,
  621  
  622                      __unused4: *c_void,
  623                      __unused5: *c_void,
  624                      __unused6: *c_void,
  625                      __unused7: *c_void,
  626                      __unused8: *c_void,
  627                  }
  628  
  629                  pub struct timeval {
  630                      tv_sec: time_t,
  631                      tv_usec: suseconds_t,
  632                  }
  633  
  634                  pub struct timespec {
  635                      tv_sec: time_t,
  636                      tv_nsec: c_long,
  637                  }
  638  
  639                  pub enum timezone {}
  640              }
  641              pub mod bsd44 {
  642                  use libc::types::os::arch::c95::{c_char, c_int, c_uint};
  643  
  644                  pub type socklen_t = u32;
  645                  pub type sa_family_t = u8;
  646                  pub type in_port_t = u16;
  647                  pub type in_addr_t = u32;
  648                  pub struct sockaddr {
  649                      sa_len: u8,
  650                      sa_family: sa_family_t,
  651                      sa_data: [u8, ..14],
  652                  }
  653                  pub struct sockaddr_storage {
  654                      ss_len: u8,
  655                      ss_family: sa_family_t,
  656                      __ss_pad1: [u8, ..6],
  657                      __ss_align: i64,
  658                      __ss_pad2: [u8, ..112],
  659                  }
  660                  pub struct sockaddr_in {
  661                      sin_len: u8,
  662                      sin_family: sa_family_t,
  663                      sin_port: in_port_t,
  664                      sin_addr: in_addr,
  665                      sin_zero: [u8, ..8],
  666                  }
  667                  pub struct in_addr {
  668                      s_addr: in_addr_t,
  669                  }
  670                  pub struct sockaddr_in6 {
  671                      sin6_len: u8,
  672                      sin6_family: sa_family_t,
  673                      sin6_port: in_port_t,
  674                      sin6_flowinfo: u32,
  675                      sin6_addr: in6_addr,
  676                      sin6_scope_id: u32,
  677                  }
  678                  pub struct in6_addr {
  679                      s6_addr: [u16, ..8]
  680                  }
  681                  pub struct ip_mreq {
  682                      imr_multiaddr: in_addr,
  683                      imr_interface: in_addr,
  684                  }
  685                  pub struct ip6_mreq {
  686                      ipv6mr_multiaddr: in6_addr,
  687                      ipv6mr_interface: c_uint,
  688                  }
  689                  pub struct addrinfo {
  690                      ai_flags: c_int,
  691                      ai_family: c_int,
  692                      ai_socktype: c_int,
  693                      ai_protocol: c_int,
  694                      ai_addrlen: socklen_t,
  695                      ai_canonname: *c_char,
  696                      ai_addr: *sockaddr,
  697                      ai_next: *addrinfo
  698                  }
  699                  pub struct sockaddr_un {
  700                      sun_len: u8,
  701                      sun_family: sa_family_t,
  702                      sun_path: [c_char, ..104]
  703                  }
  704              }
  705          }
  706  
  707          #[cfg(target_arch = "x86_64")]
  708          pub mod arch {
  709              pub mod c95 {
  710                  pub type c_char = i8;
  711                  pub type c_schar = i8;
  712                  pub type c_uchar = u8;
  713                  pub type c_short = i16;
  714                  pub type c_ushort = u16;
  715                  pub type c_int = i32;
  716                  pub type c_uint = u32;
  717                  pub type c_long = i64;
  718                  pub type c_ulong = u64;
  719                  pub type c_float = f32;
  720                  pub type c_double = f64;
  721                  pub type size_t = u64;
  722                  pub type ptrdiff_t = i64;
  723                  pub type clock_t = i32;
  724                  pub type time_t = i64;
  725                  pub type suseconds_t = i64;
  726                  pub type wchar_t = i32;
  727              }
  728              pub mod c99 {
  729                  pub type c_longlong = i64;
  730                  pub type c_ulonglong = u64;
  731                  pub type intptr_t = int;
  732                  pub type uintptr_t = uint;
  733              }
  734              pub mod posix88 {
  735                  pub type off_t = i64;
  736                  pub type dev_t = u32;
  737                  pub type ino_t = u32;
  738                  pub type pid_t = i32;
  739                  pub type uid_t = u32;
  740                  pub type gid_t = u32;
  741                  pub type useconds_t = u32;
  742                  pub type mode_t = u16;
  743                  pub type ssize_t = i64;
  744              }
  745              pub mod posix01 {
  746                  use libc::types::common::c95::{c_void};
  747                  use libc::types::common::c99::{uint8_t, uint32_t, int32_t};
  748                  use libc::types::os::arch::c95::{c_long, time_t};
  749                  use libc::types::os::arch::posix88::{dev_t, gid_t, ino_t};
  750                  use libc::types::os::arch::posix88::{mode_t, off_t};
  751                  use libc::types::os::arch::posix88::{uid_t};
  752  
  753                  pub type nlink_t = u16;
  754                  pub type blksize_t = i64;
  755                  pub type blkcnt_t = i64;
  756                  pub type fflags_t = u32;
  757                  pub struct stat {
  758                      st_dev: dev_t,
  759                      st_ino: ino_t,
  760                      st_mode: mode_t,
  761                      st_nlink: nlink_t,
  762                      st_uid: uid_t,
  763                      st_gid: gid_t,
  764                      st_rdev: dev_t,
  765                      st_atime: time_t,
  766                      st_atime_nsec: c_long,
  767                      st_mtime: time_t,
  768                      st_mtime_nsec: c_long,
  769                      st_ctime: time_t,
  770                      st_ctime_nsec: c_long,
  771                      st_size: off_t,
  772                      st_blocks: blkcnt_t,
  773                      st_blksize: blksize_t,
  774                      st_flags: fflags_t,
  775                      st_gen: uint32_t,
  776                      st_lspare: int32_t,
  777                      st_birthtime: time_t,
  778                      st_birthtime_nsec: c_long,
  779                      __unused: [uint8_t, ..2],
  780                  }
  781  
  782                  pub struct utimbuf {
  783                      actime: time_t,
  784                      modtime: time_t,
  785                  }
  786  
  787                  pub type pthread_attr_t = *c_void;
  788              }
  789              pub mod posix08 {
  790              }
  791              pub mod bsd44 {
  792              }
  793              pub mod extra {
  794              }
  795          }
  796      }
  797  
  798      #[cfg(target_os = "win32")]
  799      pub mod os {
  800          pub mod common {
  801              pub mod posix01 {
  802                  use libc::types::os::arch::c95::{c_short, time_t, suseconds_t,
  803                                                   c_long};
  804                  use libc::types::os::arch::extra::{int64, time64_t};
  805                  use libc::types::os::arch::posix88::{dev_t, ino_t};
  806                  use libc::types::os::arch::posix88::mode_t;
  807  
  808                  // Note: this is the struct called stat64 in win32. Not stat,
  809                  // nor stati64.
  810                  pub struct stat {
  811                      st_dev: dev_t,
  812                      st_ino: ino_t,
  813                      st_mode: mode_t,
  814                      st_nlink: c_short,
  815                      st_uid: c_short,
  816                      st_gid: c_short,
  817                      st_rdev: dev_t,
  818                      st_size: int64,
  819                      st_atime: time64_t,
  820                      st_mtime: time64_t,
  821                      st_ctime: time64_t,
  822                  }
  823  
  824                  // note that this is called utimbuf64 in win32
  825                  pub struct utimbuf {
  826                      actime: time64_t,
  827                      modtime: time64_t,
  828                  }
  829  
  830                  pub struct timeval {
  831                      tv_sec: time_t,
  832                      tv_usec: suseconds_t,
  833                  }
  834  
  835                  pub struct timespec {
  836                      tv_sec: time_t,
  837                      tv_nsec: c_long,
  838                  }
  839  
  840                  pub enum timezone {}
  841              }
  842  
  843              pub mod bsd44 {
  844                  use libc::types::os::arch::c95::{c_char, c_int, c_uint, size_t};
  845  
  846                  pub type SOCKET = c_uint;
  847                  pub type socklen_t = c_int;
  848                  pub type sa_family_t = u16;
  849                  pub type in_port_t = u16;
  850                  pub type in_addr_t = u32;
  851                  pub struct sockaddr {
  852                      sa_family: sa_family_t,
  853                      sa_data: [u8, ..14],
  854                  }
  855                  pub struct sockaddr_storage {
  856                      ss_family: sa_family_t,
  857                      __ss_align: i64,
  858                      __ss_pad2: [u8, ..112],
  859                  }
  860                  pub struct sockaddr_in {
  861                      sin_family: sa_family_t,
  862                      sin_port: in_port_t,
  863                      sin_addr: in_addr,
  864                      sin_zero: [u8, ..8],
  865                  }
  866                  pub struct in_addr {
  867                      s_addr: in_addr_t,
  868                  }
  869                  pub struct sockaddr_in6 {
  870                      sin6_family: sa_family_t,
  871                      sin6_port: in_port_t,
  872                      sin6_flowinfo: u32,
  873                      sin6_addr: in6_addr,
  874                      sin6_scope_id: u32,
  875                  }
  876                  pub struct in6_addr {
  877                      s6_addr: [u16, ..8]
  878                  }
  879                  pub struct ip_mreq {
  880                      imr_multiaddr: in_addr,
  881                      imr_interface: in_addr,
  882                  }
  883                  pub struct ip6_mreq {
  884                      ipv6mr_multiaddr: in6_addr,
  885                      ipv6mr_interface: c_uint,
  886                  }
  887                  pub struct addrinfo {
  888                      ai_flags: c_int,
  889                      ai_family: c_int,
  890                      ai_socktype: c_int,
  891                      ai_protocol: c_int,
  892                      ai_addrlen: size_t,
  893                      ai_canonname: *c_char,
  894                      ai_addr: *sockaddr,
  895                      ai_next: *addrinfo
  896                  }
  897                  pub struct sockaddr_un {
  898                      sun_family: sa_family_t,
  899                      sun_path: [c_char, ..108]
  900                  }
  901              }
  902          }
  903  
  904          pub mod arch {
  905              pub mod c95 {
  906                  pub type c_char = i8;
  907                  pub type c_schar = i8;
  908                  pub type c_uchar = u8;
  909                  pub type c_short = i16;
  910                  pub type c_ushort = u16;
  911                  pub type c_int = i32;
  912                  pub type c_uint = u32;
  913                  pub type c_long = i32;
  914                  pub type c_ulong = u32;
  915                  pub type c_float = f32;
  916                  pub type c_double = f64;
  917  
  918                  #[cfg(target_arch = "x86")]
  919                  pub type size_t = u32;
  920                  #[cfg(target_arch = "x86_64")]
  921                  pub type size_t = u64;
  922  
  923                  #[cfg(target_arch = "x86")]
  924                  pub type ptrdiff_t = i32;
  925                  #[cfg(target_arch = "x86_64")]
  926                  pub type ptrdiff_t = i64;
  927  
  928                  pub type clock_t = i32;
  929  
  930                  #[cfg(target_arch = "x86")]
  931                  pub type time_t = i32;
  932                  #[cfg(target_arch = "x86_64")]
  933                  pub type time_t = i64;
  934  
  935                  #[cfg(target_arch = "x86")]
  936                  pub type suseconds_t = i32;
  937                  #[cfg(target_arch = "x86_64")]
  938                  pub type suseconds_t = i64;
  939  
  940                  pub type wchar_t = u16;
  941              }
  942  
  943              pub mod c99 {
  944                  pub type c_longlong = i64;
  945                  pub type c_ulonglong = u64;
  946                  pub type intptr_t = int;
  947                  pub type uintptr_t = uint;
  948              }
  949  
  950              pub mod posix88 {
  951                  pub type off_t = i32;
  952                  pub type dev_t = u32;
  953                  pub type ino_t = i16;
  954  
  955                  #[cfg(target_arch = "x86")]
  956                  pub type pid_t = i32;
  957                  #[cfg(target_arch = "x86_64")]
  958                  pub type pid_t = i64;
  959  
  960                  pub type useconds_t = u32;
  961                  pub type mode_t = u16;
  962  
  963                  #[cfg(target_arch = "x86")]
  964                  pub type ssize_t = i32;
  965                  #[cfg(target_arch = "x86_64")]
  966                  pub type ssize_t = i64;
  967              }
  968  
  969              pub mod posix01 {
  970              }
  971              pub mod posix08 {
  972              }
  973              pub mod bsd44 {
  974              }
  975              pub mod extra {
  976                  use ptr;
  977                  use libc::consts::os::extra::{MAX_PROTOCOL_CHAIN,
  978                                                WSAPROTOCOL_LEN};
  979                  use libc::types::common::c95::c_void;
  980                  use libc::types::os::arch::c95::{c_char, c_int, c_uint, size_t};
  981                  use libc::types::os::arch::c95::{c_long, c_ulong};
  982                  use libc::types::os::arch::c95::{wchar_t};
  983                  use libc::types::os::arch::c99::{c_ulonglong, c_longlong};
  984  
  985                  pub type BOOL = c_int;
  986                  pub type BYTE = u8;
  987                  pub type BOOLEAN = BYTE;
  988                  pub type CCHAR = c_char;
  989                  pub type CHAR = c_char;
  990  
  991                  pub type DWORD = c_ulong;
  992                  pub type DWORDLONG = c_ulonglong;
  993  
  994                  pub type HANDLE = LPVOID;
  995                  pub type HMODULE = c_uint;
  996  
  997                  pub type LONG = c_long;
  998                  pub type PLONG = *mut c_long;
  999  
 1000                  #[cfg(target_arch = "x86")]
 1001                  pub type LONG_PTR = c_long;
 1002                  #[cfg(target_arch = "x86_64")]
 1003                  pub type LONG_PTR = i64;
 1004  
 1005                  pub type LARGE_INTEGER = c_longlong;
 1006                  pub type PLARGE_INTEGER = *mut c_longlong;
 1007  
 1008                  pub type LPCWSTR = *WCHAR;
 1009                  pub type LPCSTR = *CHAR;
 1010  
 1011                  pub type LPWSTR = *mut WCHAR;
 1012                  pub type LPSTR = *mut CHAR;
 1013  
 1014                  pub type LPWCH = *mut WCHAR;
 1015                  pub type LPCH = *mut CHAR;
 1016  
 1017                  // Not really, but opaque to us.
 1018                  pub type LPSECURITY_ATTRIBUTES = LPVOID;
 1019  
 1020                  pub type LPVOID = *mut c_void;
 1021                  pub type LPCVOID = *c_void;
 1022                  pub type LPBYTE = *mut BYTE;
 1023                  pub type LPWORD = *mut WORD;
 1024                  pub type LPDWORD = *mut DWORD;
 1025                  pub type LPHANDLE = *mut HANDLE;
 1026  
 1027                  pub type LRESULT = LONG_PTR;
 1028                  pub type PBOOL = *mut BOOL;
 1029                  pub type WCHAR = wchar_t;
 1030                  pub type WORD = u16;
 1031                  pub type SIZE_T = size_t;
 1032  
 1033                  pub type time64_t = i64;
 1034                  pub type int64 = i64;
 1035  
 1036                  pub struct STARTUPINFO {
 1037                      cb: DWORD,
 1038                      lpReserved: LPWSTR,
 1039                      lpDesktop: LPWSTR,
 1040                      lpTitle: LPWSTR,
 1041                      dwX: DWORD,
 1042                      dwY: DWORD,
 1043                      dwXSize: DWORD,
 1044                      dwYSize: DWORD,
 1045                      dwXCountChars: DWORD,
 1046                      dwYCountCharts: DWORD,
 1047                      dwFillAttribute: DWORD,
 1048                      dwFlags: DWORD,
 1049                      wShowWindow: WORD,
 1050                      cbReserved2: WORD,
 1051                      lpReserved2: LPBYTE,
 1052                      hStdInput: HANDLE,
 1053                      hStdOutput: HANDLE,
 1054                      hStdError: HANDLE
 1055                  }
 1056                  pub type LPSTARTUPINFO = *mut STARTUPINFO;
 1057  
 1058                  pub struct PROCESS_INFORMATION {
 1059                      hProcess: HANDLE,
 1060                      hThread: HANDLE,
 1061                      dwProcessId: DWORD,
 1062                      dwThreadId: DWORD
 1063                  }
 1064                  pub type LPPROCESS_INFORMATION = *mut PROCESS_INFORMATION;
 1065  
 1066                  pub struct SYSTEM_INFO {
 1067                      wProcessorArchitecture: WORD,
 1068                      wReserved: WORD,
 1069                      dwPageSize: DWORD,
 1070                      lpMinimumApplicationAddress: LPVOID,
 1071                      lpMaximumApplicationAddress: LPVOID,
 1072                      dwActiveProcessorMask: DWORD,
 1073                      dwNumberOfProcessors: DWORD,
 1074                      dwProcessorType: DWORD,
 1075                      dwAllocationGranularity: DWORD,
 1076                      wProcessorLevel: WORD,
 1077                      wProcessorRevision: WORD
 1078                  }
 1079                  pub type LPSYSTEM_INFO = *mut SYSTEM_INFO;
 1080  
 1081                  impl SYSTEM_INFO {
 1082                      pub fn new() -> SYSTEM_INFO {
 1083                          SYSTEM_INFO {
 1084                              wProcessorArchitecture: 0,
 1085                              wReserved: 0,
 1086                              dwPageSize: 0,
 1087                              lpMinimumApplicationAddress: ptr::mut_null(),
 1088                              lpMaximumApplicationAddress: ptr::mut_null(),
 1089                              dwActiveProcessorMask: 0,
 1090                              dwNumberOfProcessors: 0,
 1091                              dwProcessorType: 0,
 1092                              dwAllocationGranularity: 0,
 1093                              wProcessorLevel: 0,
 1094                              wProcessorRevision: 0
 1095                          }
 1096                      }
 1097                  }
 1098  
 1099                  pub struct MEMORY_BASIC_INFORMATION {
 1100                      BaseAddress: LPVOID,
 1101                      AllocationBase: LPVOID,
 1102                      AllocationProtect: DWORD,
 1103                      RegionSize: SIZE_T,
 1104                      State: DWORD,
 1105                      Protect: DWORD,
 1106                      Type: DWORD
 1107                  }
 1108                  pub type LPMEMORY_BASIC_INFORMATION = *mut MEMORY_BASIC_INFORMATION;
 1109  
 1110                  pub struct OVERLAPPED {
 1111                      Internal: *c_ulong,
 1112                      InternalHigh: *c_ulong,
 1113                      Offset: DWORD,
 1114                      OffsetHigh: DWORD,
 1115                      hEvent: HANDLE,
 1116                  }
 1117  
 1118                  pub type LPOVERLAPPED = *mut OVERLAPPED;
 1119  
 1120                  pub struct FILETIME {
 1121                      dwLowDateTime: DWORD,
 1122                      dwHighDateTime: DWORD,
 1123                  }
 1124  
 1125                  pub type LPFILETIME = *mut FILETIME;
 1126  
 1127                  pub struct GUID {
 1128                      Data1: DWORD,
 1129                      Data2: DWORD,
 1130                      Data3: DWORD,
 1131                      Data4: [BYTE, ..8],
 1132                  }
 1133  
 1134                  pub struct WSAPROTOCOLCHAIN {
 1135                      ChainLen: c_int,
 1136                      ChainEntries: [DWORD, ..MAX_PROTOCOL_CHAIN],
 1137                  }
 1138  
 1139                  pub type LPWSAPROTOCOLCHAIN = *mut WSAPROTOCOLCHAIN;
 1140  
 1141                  pub struct WSAPROTOCOL_INFO {
 1142                      dwServiceFlags1: DWORD,
 1143                      dwServiceFlags2: DWORD,
 1144                      dwServiceFlags3: DWORD,
 1145                      dwServiceFlags4: DWORD,
 1146                      dwProviderFlags: DWORD,
 1147                      ProviderId: GUID,
 1148                      dwCatalogEntryId: DWORD,
 1149                      ProtocolChain: WSAPROTOCOLCHAIN,
 1150                      iVersion: c_int,
 1151                      iAddressFamily: c_int,
 1152                      iMaxSockAddr: c_int,
 1153                      iMinSockAddr: c_int,
 1154                      iSocketType: c_int,
 1155                      iProtocol: c_int,
 1156                      iProtocolMaxOffset: c_int,
 1157                      iNetworkByteOrder: c_int,
 1158                      iSecurityScheme: c_int,
 1159                      dwMessageSize: DWORD,
 1160                      dwProviderReserved: DWORD,
 1161                      szProtocol: [u8, ..WSAPROTOCOL_LEN+1],
 1162                  }
 1163  
 1164                  pub type LPWSAPROTOCOL_INFO = *mut WSAPROTOCOL_INFO;
 1165  
 1166                  pub type GROUP = c_uint;
 1167              }
 1168          }
 1169      }
 1170  
 1171      #[cfg(target_os = "macos")]
 1172      pub mod os {
 1173          pub mod common {
 1174              pub mod posix01 {
 1175                  use libc::types::common::c95::c_void;
 1176                  use libc::types::os::arch::c95::{c_char, c_int, size_t,
 1177                                                   time_t, suseconds_t, c_long};
 1178                  use libc::types::os::arch::c99::{uintptr_t};
 1179  
 1180                  pub type pthread_t = uintptr_t;
 1181  
 1182                  pub struct glob_t {
 1183                      gl_pathc:  size_t,
 1184                      __unused1: c_int,
 1185                      gl_offs:   size_t,
 1186                      __unused2: c_int,
 1187                      gl_pathv:  **c_char,
 1188  
 1189                      __unused3: *c_void,
 1190  
 1191                      __unused4: *c_void,
 1192                      __unused5: *c_void,
 1193                      __unused6: *c_void,
 1194                      __unused7: *c_void,
 1195                      __unused8: *c_void,
 1196                  }
 1197  
 1198                  pub struct timeval {
 1199                      tv_sec: time_t,
 1200                      tv_usec: suseconds_t,
 1201                  }
 1202  
 1203                  pub struct timespec {
 1204                      tv_sec: time_t,
 1205                      tv_nsec: c_long,
 1206                  }
 1207  
 1208                  pub enum timezone {}
 1209              }
 1210  
 1211              pub mod bsd44 {
 1212                  use libc::types::os::arch::c95::{c_char, c_int, c_uint};
 1213  
 1214                  pub type socklen_t = c_int;
 1215                  pub type sa_family_t = u8;
 1216                  pub type in_port_t = u16;
 1217                  pub type in_addr_t = u32;
 1218                  pub struct sockaddr {
 1219                      sa_len: u8,
 1220                      sa_family: sa_family_t,
 1221                      sa_data: [u8, ..14],
 1222                  }
 1223                  pub struct sockaddr_storage {
 1224                      ss_len: u8,
 1225                      ss_family: sa_family_t,
 1226                      __ss_pad1: [u8, ..6],
 1227                      __ss_align: i64,
 1228                      __ss_pad2: [u8, ..112],
 1229                  }
 1230                  pub struct sockaddr_in {
 1231                      sin_len: u8,
 1232                      sin_family: sa_family_t,
 1233                      sin_port: in_port_t,
 1234                      sin_addr: in_addr,
 1235                      sin_zero: [u8, ..8],
 1236                  }
 1237                  pub struct in_addr {
 1238                      s_addr: in_addr_t,
 1239                  }
 1240                  pub struct sockaddr_in6 {
 1241                      sin6_len: u8,
 1242                      sin6_family: sa_family_t,
 1243                      sin6_port: in_port_t,
 1244                      sin6_flowinfo: u32,
 1245                      sin6_addr: in6_addr,
 1246                      sin6_scope_id: u32,
 1247                  }
 1248                  pub struct in6_addr {
 1249                      s6_addr: [u16, ..8]
 1250                  }
 1251                  pub struct ip_mreq {
 1252                      imr_multiaddr: in_addr,
 1253                      imr_interface: in_addr,
 1254                  }
 1255                  pub struct ip6_mreq {
 1256                      ipv6mr_multiaddr: in6_addr,
 1257                      ipv6mr_interface: c_uint,
 1258                  }
 1259                  pub struct addrinfo {
 1260                      ai_flags: c_int,
 1261                      ai_family: c_int,
 1262                      ai_socktype: c_int,
 1263                      ai_protocol: c_int,
 1264                      ai_addrlen: socklen_t,
 1265                      ai_canonname: *c_char,
 1266                      ai_addr: *sockaddr,
 1267                      ai_next: *addrinfo
 1268                  }
 1269                  pub struct sockaddr_un {
 1270                      sun_len: u8,
 1271                      sun_family: sa_family_t,
 1272                      sun_path: [c_char, ..104]
 1273                  }
 1274              }
 1275          }
 1276  
 1277          #[cfg(target_arch = "arm")]
 1278          #[cfg(target_arch = "x86")]
 1279          pub mod arch {
 1280              pub mod c95 {
 1281                  pub type c_char = i8;
 1282                  pub type c_schar = i8;
 1283                  pub type c_uchar = u8;
 1284                  pub type c_short = i16;
 1285                  pub type c_ushort = u16;
 1286                  pub type c_int = i32;
 1287                  pub type c_uint = u32;
 1288                  pub type c_long = i32;
 1289                  pub type c_ulong = u32;
 1290                  pub type c_float = f32;
 1291                  pub type c_double = f64;
 1292                  pub type size_t = u32;
 1293                  pub type ptrdiff_t = i32;
 1294                  pub type clock_t = u32;
 1295                  pub type time_t = i32;
 1296                  pub type suseconds_t = i32;
 1297                  pub type wchar_t = i32;
 1298              }
 1299              pub mod c99 {
 1300                  pub type c_longlong = i64;
 1301                  pub type c_ulonglong = u64;
 1302                  pub type intptr_t = int;
 1303                  pub type uintptr_t = uint;
 1304              }
 1305              pub mod posix88 {
 1306                  pub type off_t = i64;
 1307                  pub type dev_t = i32;
 1308                  pub type ino_t = u64;
 1309                  pub type pid_t = i32;
 1310                  pub type uid_t = u32;
 1311                  pub type gid_t = u32;
 1312                  pub type useconds_t = u32;
 1313                  pub type mode_t = u16;
 1314                  pub type ssize_t = i32;
 1315              }
 1316              pub mod posix01 {
 1317                  use libc::types::common::c99::{int32_t, int64_t, uint32_t};
 1318                  use libc::types::os::arch::c95::{c_char, c_long, time_t};
 1319                  use libc::types::os::arch::posix88::{dev_t, gid_t, ino_t,
 1320                                                       mode_t, off_t, uid_t};
 1321  
 1322                  pub type nlink_t = u16;
 1323                  pub type blksize_t = i64;
 1324                  pub type blkcnt_t = i32;
 1325  
 1326                  pub struct stat {
 1327                      st_dev: dev_t,
 1328                      st_mode: mode_t,
 1329                      st_nlink: nlink_t,
 1330                      st_ino: ino_t,
 1331                      st_uid: uid_t,
 1332                      st_gid: gid_t,
 1333                      st_rdev: dev_t,
 1334                      st_atime: time_t,
 1335                      st_atime_nsec: c_long,
 1336                      st_mtime: time_t,
 1337                      st_mtime_nsec: c_long,
 1338                      st_ctime: time_t,
 1339                      st_ctime_nsec: c_long,
 1340                      st_birthtime: time_t,
 1341                      st_birthtime_nsec: c_long,
 1342                      st_size: off_t,
 1343                      st_blocks: blkcnt_t,
 1344                      st_blksize: blksize_t,
 1345                      st_flags: uint32_t,
 1346                      st_gen: uint32_t,
 1347                      st_lspare: int32_t,
 1348                      st_qspare: [int64_t, ..2],
 1349                  }
 1350  
 1351                  pub struct utimbuf {
 1352                      actime: time_t,
 1353                      modtime: time_t,
 1354                  }
 1355  
 1356                  pub struct pthread_attr_t {
 1357                      __sig: c_long,
 1358                      __opaque: [c_char, ..36]
 1359                  }
 1360              }
 1361              pub mod posix08 {
 1362              }
 1363              pub mod bsd44 {
 1364              }
 1365              pub mod extra {
 1366                  pub struct mach_timebase_info {
 1367                      numer: u32,
 1368                      denom: u32,
 1369                  }
 1370  
 1371                  pub type mach_timebase_info_data_t = mach_timebase_info;
 1372              }
 1373          }
 1374  
 1375          #[cfg(target_arch = "x86_64")]
 1376          pub mod arch {
 1377              pub mod c95 {
 1378                  pub type c_char = i8;
 1379                  pub type c_schar = i8;
 1380                  pub type c_uchar = u8;
 1381                  pub type c_short = i16;
 1382                  pub type c_ushort = u16;
 1383                  pub type c_int = i32;
 1384                  pub type c_uint = u32;
 1385                  pub type c_long = i64;
 1386                  pub type c_ulong = u64;
 1387                  pub type c_float = f32;
 1388                  pub type c_double = f64;
 1389                  pub type size_t = u64;
 1390                  pub type ptrdiff_t = i64;
 1391                  pub type clock_t = u64;
 1392                  pub type time_t = i64;
 1393                  pub type suseconds_t = i32;
 1394                  pub type wchar_t = i32;
 1395              }
 1396              pub mod c99 {
 1397                  pub type c_longlong = i64;
 1398                  pub type c_ulonglong = u64;
 1399                  pub type intptr_t = int;
 1400                  pub type uintptr_t = uint;
 1401              }
 1402              pub mod posix88 {
 1403                  pub type off_t = i64;
 1404                  pub type dev_t = i32;
 1405                  pub type ino_t = u64;
 1406                  pub type pid_t = i32;
 1407                  pub type uid_t = u32;
 1408                  pub type gid_t = u32;
 1409                  pub type useconds_t = u32;
 1410                  pub type mode_t = u16;
 1411                  pub type ssize_t = i64;
 1412              }
 1413              pub mod posix01 {
 1414                  use libc::types::common::c99::{int32_t, int64_t};
 1415                  use libc::types::common::c99::{uint32_t};
 1416                  use libc::types::os::arch::c95::{c_char, c_long, time_t};
 1417                  use libc::types::os::arch::posix88::{dev_t, gid_t, ino_t};
 1418                  use libc::types::os::arch::posix88::{mode_t, off_t, uid_t};
 1419  
 1420                  pub type nlink_t = u16;
 1421                  pub type blksize_t = i64;
 1422                  pub type blkcnt_t = i32;
 1423  
 1424                  pub struct stat {
 1425                      st_dev: dev_t,
 1426                      st_mode: mode_t,
 1427                      st_nlink: nlink_t,
 1428                      st_ino: ino_t,
 1429                      st_uid: uid_t,
 1430                      st_gid: gid_t,
 1431                      st_rdev: dev_t,
 1432                      st_atime: time_t,
 1433                      st_atime_nsec: c_long,
 1434                      st_mtime: time_t,
 1435                      st_mtime_nsec: c_long,
 1436                      st_ctime: time_t,
 1437                      st_ctime_nsec: c_long,
 1438                      st_birthtime: time_t,
 1439                      st_birthtime_nsec: c_long,
 1440                      st_size: off_t,
 1441                      st_blocks: blkcnt_t,
 1442                      st_blksize: blksize_t,
 1443                      st_flags: uint32_t,
 1444                      st_gen: uint32_t,
 1445                      st_lspare: int32_t,
 1446                      st_qspare: [int64_t, ..2],
 1447                  }
 1448  
 1449                  pub struct utimbuf {
 1450                      actime: time_t,
 1451                      modtime: time_t,
 1452                  }
 1453  
 1454                  pub struct pthread_attr_t {
 1455                      __sig: c_long,
 1456                      __opaque: [c_char, ..56]
 1457                  }
 1458              }
 1459              pub mod posix08 {
 1460              }
 1461              pub mod bsd44 {
 1462              }
 1463              pub mod extra {
 1464                  pub struct mach_timebase_info {
 1465                      numer: u32,
 1466                      denom: u32,
 1467                  }
 1468  
 1469                  pub type mach_timebase_info_data_t = mach_timebase_info;
 1470              }
 1471          }
 1472      }
 1473  }
 1474  
 1475  pub mod consts {
 1476      // Consts tend to vary per OS so we pull their definitions out
 1477      // into this module.
 1478  
 1479      #[cfg(target_os = "win32")]
 1480      pub mod os {
 1481          pub mod c95 {
 1482              use libc::types::os::arch::c95::{c_int, c_uint};
 1483  
 1484              pub static EXIT_FAILURE : c_int = 1;
 1485              pub static EXIT_SUCCESS : c_int = 0;
 1486              pub static RAND_MAX : c_int = 32767;
 1487              pub static EOF : c_int = -1;
 1488              pub static SEEK_SET : c_int = 0;
 1489              pub static SEEK_CUR : c_int = 1;
 1490              pub static SEEK_END : c_int = 2;
 1491              pub static _IOFBF : c_int = 0;
 1492              pub static _IONBF : c_int = 4;
 1493              pub static _IOLBF : c_int = 64;
 1494              pub static BUFSIZ : c_uint = 512_u32;
 1495              pub static FOPEN_MAX : c_uint = 20_u32;
 1496              pub static FILENAME_MAX : c_uint = 260_u32;
 1497              pub static L_tmpnam : c_uint = 16_u32;
 1498              pub static TMP_MAX : c_uint = 32767_u32;
 1499  
 1500              pub static WSAEINTR: c_int = 10004;
 1501              pub static WSAEBADF: c_int = 10009;
 1502              pub static WSAEACCES: c_int = 10013;
 1503              pub static WSAEFAULT: c_int = 10014;
 1504              pub static WSAEINVAL: c_int = 10022;
 1505              pub static WSAEMFILE: c_int = 10024;
 1506              pub static WSAEWOULDBLOCK: c_int = 10035;
 1507              pub static WSAEINPROGRESS: c_int = 10036;
 1508              pub static WSAEALREADY: c_int = 10037;
 1509              pub static WSAENOTSOCK: c_int = 10038;
 1510              pub static WSAEDESTADDRREQ: c_int = 10039;
 1511              pub static WSAEMSGSIZE: c_int = 10040;
 1512              pub static WSAEPROTOTYPE: c_int = 10041;
 1513              pub static WSAENOPROTOOPT: c_int = 10042;
 1514              pub static WSAEPROTONOSUPPORT: c_int = 10043;
 1515              pub static WSAESOCKTNOSUPPORT: c_int = 10044;
 1516              pub static WSAEOPNOTSUPP: c_int = 10045;
 1517              pub static WSAEPFNOSUPPORT: c_int = 10046;
 1518              pub static WSAEAFNOSUPPORT: c_int = 10047;
 1519              pub static WSAEADDRINUSE: c_int = 10048;
 1520              pub static WSAEADDRNOTAVAIL: c_int = 10049;
 1521              pub static WSAENETDOWN: c_int = 10050;
 1522              pub static WSAENETUNREACH: c_int = 10051;
 1523              pub static WSAENETRESET: c_int = 10052;
 1524              pub static WSAECONNABORTED: c_int = 10053;
 1525              pub static WSAECONNRESET: c_int = 10054;
 1526              pub static WSAENOBUFS: c_int = 10055;
 1527              pub static WSAEISCONN: c_int = 10056;
 1528              pub static WSAENOTCONN: c_int = 10057;
 1529              pub static WSAESHUTDOWN: c_int = 10058;
 1530              pub static WSAETOOMANYREFS: c_int = 10059;
 1531              pub static WSAETIMEDOUT: c_int = 10060;
 1532              pub static WSAECONNREFUSED: c_int = 10061;
 1533              pub static WSAELOOP: c_int = 10062;
 1534              pub static WSAENAMETOOLONG: c_int = 10063;
 1535              pub static WSAEHOSTDOWN: c_int = 10064;
 1536              pub static WSAEHOSTUNREACH: c_int = 10065;
 1537              pub static WSAENOTEMPTY: c_int = 10066;
 1538              pub static WSAEPROCLIM: c_int = 10067;
 1539              pub static WSAEUSERS: c_int = 10068;
 1540              pub static WSAEDQUOT: c_int = 10069;
 1541              pub static WSAESTALE: c_int = 10070;
 1542              pub static WSAEREMOTE: c_int = 10071;
 1543              pub static WSASYSNOTREADY: c_int = 10091;
 1544              pub static WSAVERNOTSUPPORTED: c_int = 10092;
 1545              pub static WSANOTINITIALISED: c_int = 10093;
 1546              pub static WSAEDISCON: c_int = 10101;
 1547              pub static WSAENOMORE: c_int = 10102;
 1548              pub static WSAECANCELLED: c_int = 10103;
 1549              pub static WSAEINVALIDPROCTABLE: c_int = 10104;
 1550              pub static WSAEINVALIDPROVIDER: c_int = 10105;
 1551              pub static WSAEPROVIDERFAILEDINIT: c_int = 10106;
 1552          }
 1553          pub mod c99 {
 1554          }
 1555          pub mod posix88 {
 1556              use libc::types::os::arch::c95::c_int;
 1557  
 1558              pub static O_RDONLY : c_int = 0;
 1559              pub static O_WRONLY : c_int = 1;
 1560              pub static O_RDWR : c_int = 2;
 1561              pub static O_APPEND : c_int = 8;
 1562              pub static O_CREAT : c_int = 256;
 1563              pub static O_EXCL : c_int = 1024;
 1564              pub static O_TRUNC : c_int = 512;
 1565              pub static S_IFIFO : c_int = 4096;
 1566              pub static S_IFCHR : c_int = 8192;
 1567              pub static S_IFBLK : c_int = 12288;
 1568              pub static S_IFDIR : c_int = 16384;
 1569              pub static S_IFREG : c_int = 32768;
 1570              pub static S_IFLNK : c_int = 40960;
 1571              pub static S_IFMT : c_int = 61440;
 1572              pub static S_IEXEC : c_int = 64;
 1573              pub static S_IWRITE : c_int = 128;
 1574              pub static S_IREAD : c_int = 256;
 1575              pub static S_IRWXU : c_int = 448;
 1576              pub static S_IXUSR : c_int = 64;
 1577              pub static S_IWUSR : c_int = 128;
 1578              pub static S_IRUSR : c_int = 256;
 1579              pub static F_OK : c_int = 0;
 1580              pub static R_OK : c_int = 4;
 1581              pub static W_OK : c_int = 2;
 1582              pub static X_OK : c_int = 1;
 1583              pub static STDIN_FILENO : c_int = 0;
 1584              pub static STDOUT_FILENO : c_int = 1;
 1585              pub static STDERR_FILENO : c_int = 2;
 1586          }
 1587          pub mod posix01 {
 1588          }
 1589          pub mod posix08 {
 1590          }
 1591          pub mod bsd44 {
 1592              use libc::types::os::arch::c95::c_int;
 1593  
 1594              pub static AF_INET: c_int = 2;
 1595              pub static AF_INET6: c_int = 23;
 1596              pub static SOCK_STREAM: c_int = 1;
 1597              pub static SOCK_DGRAM: c_int = 2;
 1598              pub static IPPROTO_TCP: c_int = 6;
 1599              pub static IPPROTO_IP: c_int = 0;
 1600              pub static IPPROTO_IPV6: c_int = 41;
 1601              pub static IP_MULTICAST_TTL: c_int = 3;
 1602              pub static IP_MULTICAST_LOOP: c_int = 4;
 1603              pub static IP_ADD_MEMBERSHIP: c_int = 5;
 1604              pub static IP_DROP_MEMBERSHIP: c_int = 6;
 1605              pub static IPV6_ADD_MEMBERSHIP: c_int = 5;
 1606              pub static IPV6_DROP_MEMBERSHIP: c_int = 6;
 1607              pub static IP_TTL: c_int = 4;
 1608  
 1609              pub static TCP_NODELAY: c_int = 0x0001;
 1610              pub static SOL_SOCKET: c_int = 0xffff;
 1611              pub static SO_KEEPALIVE: c_int = 8;
 1612              pub static SO_BROADCAST: c_int = 32;
 1613              pub static SO_REUSEADDR: c_int = 4;
 1614  
 1615              pub static SHUT_RD: c_int = 0;
 1616              pub static SHUT_WR: c_int = 1;
 1617              pub static SHUT_RDWR: c_int = 2;
 1618          }
 1619          pub mod extra {
 1620              use libc::types::os::arch::c95::c_int;
 1621              use libc::types::os::arch::extra::{WORD, DWORD, BOOL};
 1622  
 1623              pub static TRUE : BOOL = 1;
 1624              pub static FALSE : BOOL = 0;
 1625  
 1626              pub static O_TEXT : c_int = 16384;
 1627              pub static O_BINARY : c_int = 32768;
 1628              pub static O_NOINHERIT: c_int = 128;
 1629  
 1630              pub static ERROR_SUCCESS : c_int = 0;
 1631              pub static ERROR_INVALID_FUNCTION: c_int = 1;
 1632              pub static ERROR_FILE_NOT_FOUND: c_int = 2;
 1633              pub static ERROR_ACCESS_DENIED: c_int = 5;
 1634              pub static ERROR_INVALID_HANDLE : c_int = 6;
 1635              pub static ERROR_BROKEN_PIPE: c_int = 109;
 1636              pub static ERROR_DISK_FULL : c_int = 112;
 1637              pub static ERROR_INSUFFICIENT_BUFFER : c_int = 122;
 1638              pub static ERROR_INVALID_NAME : c_int = 123;
 1639              pub static ERROR_ALREADY_EXISTS : c_int = 183;
 1640              pub static ERROR_PIPE_BUSY: c_int = 231;
 1641              pub static ERROR_NO_DATA: c_int = 232;
 1642              pub static ERROR_INVALID_ADDRESS : c_int = 487;
 1643              pub static ERROR_PIPE_CONNECTED: c_int = 535;
 1644              pub static ERROR_IO_PENDING: c_int = 997;
 1645              pub static ERROR_FILE_INVALID : c_int = 1006;
 1646              pub static INVALID_HANDLE_VALUE : c_int = -1;
 1647  
 1648              pub static DELETE : DWORD = 0x00010000;
 1649              pub static READ_CONTROL : DWORD = 0x00020000;
 1650              pub static SYNCHRONIZE : DWORD = 0x00100000;
 1651              pub static WRITE_DAC : DWORD = 0x00040000;
 1652              pub static WRITE_OWNER : DWORD = 0x00080000;
 1653  
 1654              pub static PROCESS_CREATE_PROCESS : DWORD = 0x0080;
 1655              pub static PROCESS_CREATE_THREAD : DWORD = 0x0002;
 1656              pub static PROCESS_DUP_HANDLE : DWORD = 0x0040;
 1657              pub static PROCESS_QUERY_INFORMATION : DWORD = 0x0400;
 1658              pub static PROCESS_QUERY_LIMITED_INFORMATION : DWORD = 0x1000;
 1659              pub static PROCESS_SET_INFORMATION : DWORD = 0x0200;
 1660              pub static PROCESS_SET_QUOTA : DWORD = 0x0100;
 1661              pub static PROCESS_SUSPEND_RESUME : DWORD = 0x0800;
 1662              pub static PROCESS_TERMINATE : DWORD = 0x0001;
 1663              pub static PROCESS_VM_OPERATION : DWORD = 0x0008;
 1664              pub static PROCESS_VM_READ : DWORD = 0x0010;
 1665              pub static PROCESS_VM_WRITE : DWORD = 0x0020;
 1666  
 1667              pub static STARTF_FORCEONFEEDBACK : DWORD = 0x00000040;
 1668              pub static STARTF_FORCEOFFFEEDBACK : DWORD = 0x00000080;
 1669              pub static STARTF_PREVENTPINNING : DWORD = 0x00002000;
 1670              pub static STARTF_RUNFULLSCREEN : DWORD = 0x00000020;
 1671              pub static STARTF_TITLEISAPPID : DWORD = 0x00001000;
 1672              pub static STARTF_TITLEISLINKNAME : DWORD = 0x00000800;
 1673              pub static STARTF_USECOUNTCHARS : DWORD = 0x00000008;
 1674              pub static STARTF_USEFILLATTRIBUTE : DWORD = 0x00000010;
 1675              pub static STARTF_USEHOTKEY : DWORD = 0x00000200;
 1676              pub static STARTF_USEPOSITION : DWORD = 0x00000004;
 1677              pub static STARTF_USESHOWWINDOW : DWORD = 0x00000001;
 1678              pub static STARTF_USESIZE : DWORD = 0x00000002;
 1679              pub static STARTF_USESTDHANDLES : DWORD = 0x00000100;
 1680  
 1681              pub static WAIT_ABANDONED : DWORD = 0x00000080;
 1682              pub static WAIT_OBJECT_0 : DWORD = 0x00000000;
 1683              pub static WAIT_TIMEOUT : DWORD = 0x00000102;
 1684              pub static WAIT_FAILED : DWORD = -1;
 1685  
 1686              pub static DUPLICATE_CLOSE_SOURCE : DWORD = 0x00000001;
 1687              pub static DUPLICATE_SAME_ACCESS : DWORD = 0x00000002;
 1688  
 1689              pub static INFINITE : DWORD = -1;
 1690              pub static STILL_ACTIVE : DWORD = 259;
 1691  
 1692              pub static MEM_COMMIT : DWORD = 0x00001000;
 1693              pub static MEM_RESERVE : DWORD = 0x00002000;
 1694              pub static MEM_DECOMMIT : DWORD = 0x00004000;
 1695              pub static MEM_RELEASE : DWORD = 0x00008000;
 1696              pub static MEM_RESET : DWORD = 0x00080000;
 1697              pub static MEM_RESET_UNDO : DWORD = 0x1000000;
 1698              pub static MEM_LARGE_PAGES : DWORD = 0x20000000;
 1699              pub static MEM_PHYSICAL : DWORD = 0x00400000;
 1700              pub static MEM_TOP_DOWN : DWORD = 0x00100000;
 1701              pub static MEM_WRITE_WATCH : DWORD = 0x00200000;
 1702  
 1703              pub static PAGE_EXECUTE : DWORD = 0x10;
 1704              pub static PAGE_EXECUTE_READ : DWORD = 0x20;
 1705              pub static PAGE_EXECUTE_READWRITE : DWORD = 0x40;
 1706              pub static PAGE_EXECUTE_WRITECOPY : DWORD = 0x80;
 1707              pub static PAGE_NOACCESS : DWORD = 0x01;
 1708              pub static PAGE_READONLY : DWORD = 0x02;
 1709              pub static PAGE_READWRITE : DWORD = 0x04;
 1710              pub static PAGE_WRITECOPY : DWORD = 0x08;
 1711              pub static PAGE_GUARD : DWORD = 0x100;
 1712              pub static PAGE_NOCACHE : DWORD = 0x200;
 1713              pub static PAGE_WRITECOMBINE : DWORD = 0x400;
 1714  
 1715              pub static SEC_COMMIT : DWORD = 0x8000000;
 1716              pub static SEC_IMAGE : DWORD = 0x1000000;
 1717              pub static SEC_IMAGE_NO_EXECUTE : DWORD = 0x11000000;
 1718              pub static SEC_LARGE_PAGES : DWORD = 0x80000000;
 1719              pub static SEC_NOCACHE : DWORD = 0x10000000;
 1720              pub static SEC_RESERVE : DWORD = 0x4000000;
 1721              pub static SEC_WRITECOMBINE : DWORD = 0x40000000;
 1722  
 1723              pub static FILE_MAP_ALL_ACCESS : DWORD = 0xf001f;
 1724              pub static FILE_MAP_READ : DWORD = 0x4;
 1725              pub static FILE_MAP_WRITE : DWORD = 0x2;
 1726              pub static FILE_MAP_COPY : DWORD = 0x1;
 1727              pub static FILE_MAP_EXECUTE : DWORD = 0x20;
 1728  
 1729              pub static PROCESSOR_ARCHITECTURE_INTEL : WORD = 0;
 1730              pub static PROCESSOR_ARCHITECTURE_ARM : WORD = 5;
 1731              pub static PROCESSOR_ARCHITECTURE_IA64 : WORD = 6;
 1732              pub static PROCESSOR_ARCHITECTURE_AMD64 : WORD = 9;
 1733              pub static PROCESSOR_ARCHITECTURE_UNKNOWN : WORD = 0xffff;
 1734  
 1735              pub static MOVEFILE_COPY_ALLOWED: DWORD = 2;
 1736              pub static MOVEFILE_CREATE_HARDLINK: DWORD = 16;
 1737              pub static MOVEFILE_DELAY_UNTIL_REBOOT: DWORD = 4;
 1738              pub static MOVEFILE_FAIL_IF_NOT_TRACKABLE: DWORD = 32;
 1739              pub static MOVEFILE_REPLACE_EXISTING: DWORD = 1;
 1740              pub static MOVEFILE_WRITE_THROUGH: DWORD = 8;
 1741  
 1742              pub static SYMBOLIC_LINK_FLAG_DIRECTORY: DWORD = 1;
 1743  
 1744              pub static FILE_SHARE_DELETE: DWORD = 0x4;
 1745              pub static FILE_SHARE_READ: DWORD = 0x1;
 1746              pub static FILE_SHARE_WRITE: DWORD = 0x2;
 1747  
 1748              pub static CREATE_ALWAYS: DWORD = 2;
 1749              pub static CREATE_NEW: DWORD = 1;
 1750              pub static OPEN_ALWAYS: DWORD = 4;
 1751              pub static OPEN_EXISTING: DWORD = 3;
 1752              pub static TRUNCATE_EXISTING: DWORD = 5;
 1753  
 1754              pub static FILE_APPEND_DATA: DWORD = 0x00000004;
 1755              pub static FILE_READ_DATA: DWORD = 0x00000001;
 1756              pub static FILE_WRITE_DATA: DWORD = 0x00000002;
 1757  
 1758              pub static FILE_ATTRIBUTE_ARCHIVE: DWORD = 0x20;
 1759              pub static FILE_ATTRIBUTE_COMPRESSED: DWORD = 0x800;
 1760              pub static FILE_ATTRIBUTE_DEVICE: DWORD = 0x40;
 1761              pub static FILE_ATTRIBUTE_DIRECTORY: DWORD = 0x10;
 1762              pub static FILE_ATTRIBUTE_ENCRYPTED: DWORD = 0x4000;
 1763              pub static FILE_ATTRIBUTE_HIDDEN: DWORD = 0x2;
 1764              pub static FILE_ATTRIBUTE_INTEGRITY_STREAM: DWORD = 0x8000;
 1765              pub static FILE_ATTRIBUTE_NORMAL: DWORD = 0x80;
 1766              pub static FILE_ATTRIBUTE_NOT_CONTENT_INDEXED: DWORD = 0x2000;
 1767              pub static FILE_ATTRIBUTE_NO_SCRUB_DATA: DWORD = 0x20000;
 1768              pub static FILE_ATTRIBUTE_OFFLINE: DWORD = 0x1000;
 1769              pub static FILE_ATTRIBUTE_READONLY: DWORD = 0x1;
 1770              pub static FILE_ATTRIBUTE_REPARSE_POINT: DWORD = 0x400;
 1771              pub static FILE_ATTRIBUTE_SPARSE_FILE: DWORD = 0x200;
 1772              pub static FILE_ATTRIBUTE_SYSTEM: DWORD = 0x4;
 1773              pub static FILE_ATTRIBUTE_TEMPORARY: DWORD = 0x100;
 1774              pub static FILE_ATTRIBUTE_VIRTUAL: DWORD = 0x10000;
 1775  
 1776              pub static FILE_FLAG_BACKUP_SEMANTICS: DWORD = 0x02000000;
 1777              pub static FILE_FLAG_DELETE_ON_CLOSE: DWORD = 0x04000000;
 1778              pub static FILE_FLAG_NO_BUFFERING: DWORD = 0x20000000;
 1779              pub static FILE_FLAG_OPEN_NO_RECALL: DWORD = 0x00100000;
 1780              pub static FILE_FLAG_OPEN_REPARSE_POINT: DWORD = 0x00200000;
 1781              pub static FILE_FLAG_OVERLAPPED: DWORD = 0x40000000;
 1782              pub static FILE_FLAG_POSIX_SEMANTICS: DWORD = 0x0100000;
 1783              pub static FILE_FLAG_RANDOM_ACCESS: DWORD = 0x10000000;
 1784              pub static FILE_FLAG_SESSION_AWARE: DWORD = 0x00800000;
 1785              pub static FILE_FLAG_SEQUENTIAL_SCAN: DWORD = 0x08000000;
 1786              pub static FILE_FLAG_WRITE_THROUGH: DWORD = 0x80000000;
 1787              pub static FILE_FLAG_FIRST_PIPE_INSTANCE: DWORD = 0x00080000;
 1788  
 1789              pub static FILE_NAME_NORMALIZED: DWORD = 0x0;
 1790              pub static FILE_NAME_OPENED: DWORD = 0x8;
 1791  
 1792              pub static VOLUME_NAME_DOS: DWORD = 0x0;
 1793              pub static VOLUME_NAME_GUID: DWORD = 0x1;
 1794              pub static VOLUME_NAME_NONE: DWORD = 0x4;
 1795              pub static VOLUME_NAME_NT: DWORD = 0x2;
 1796  
 1797              pub static GENERIC_READ: DWORD = 0x80000000;
 1798              pub static GENERIC_WRITE: DWORD = 0x40000000;
 1799              pub static GENERIC_EXECUTE: DWORD = 0x20000000;
 1800              pub static GENERIC_ALL: DWORD = 0x10000000;
 1801              pub static FILE_WRITE_ATTRIBUTES: DWORD = 0x00000100;
 1802              pub static FILE_READ_ATTRIBUTES: DWORD = 0x00000080;
 1803  
 1804              pub static STANDARD_RIGHTS_READ: DWORD = 0x20000;
 1805              pub static STANDARD_RIGHTS_WRITE: DWORD = 0x20000;
 1806              pub static FILE_WRITE_EA: DWORD = 0x00000010;
 1807              pub static FILE_READ_EA: DWORD = 0x00000008;
 1808              pub static FILE_GENERIC_READ: DWORD =
 1809                  STANDARD_RIGHTS_READ | FILE_READ_DATA |
 1810                  FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE;
 1811              pub static FILE_GENERIC_WRITE: DWORD =
 1812                  STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA |
 1813                  FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA |
 1814                  SYNCHRONIZE;
 1815  
 1816              pub static FILE_BEGIN: DWORD = 0;
 1817              pub static FILE_CURRENT: DWORD = 1;
 1818              pub static FILE_END: DWORD = 2;
 1819  
 1820              pub static MAX_PROTOCOL_CHAIN: DWORD = 7;
 1821              pub static WSAPROTOCOL_LEN: DWORD = 255;
 1822              pub static INVALID_SOCKET: DWORD = !0;
 1823  
 1824              pub static DETACHED_PROCESS: DWORD = 0x00000008;
 1825              pub static CREATE_NEW_PROCESS_GROUP: DWORD = 0x00000200;
 1826  
 1827              pub static PIPE_ACCESS_DUPLEX: DWORD = 0x00000003;
 1828              pub static PIPE_ACCESS_INBOUND: DWORD = 0x00000001;
 1829              pub static PIPE_ACCESS_OUTBOUND: DWORD = 0x00000002;
 1830              pub static PIPE_TYPE_BYTE: DWORD = 0x00000000;
 1831              pub static PIPE_TYPE_MESSAGE: DWORD = 0x00000004;
 1832              pub static PIPE_READMODE_BYTE: DWORD = 0x00000000;
 1833              pub static PIPE_READMODE_MESSAGE: DWORD = 0x00000002;
 1834              pub static PIPE_WAIT: DWORD = 0x00000000;
 1835              pub static PIPE_NOWAIT: DWORD = 0x00000001;
 1836              pub static PIPE_ACCEPT_REMOTE_CLIENTS: DWORD = 0x00000000;
 1837              pub static PIPE_REJECT_REMOTE_CLIENTS: DWORD = 0x00000008;
 1838              pub static PIPE_UNLIMITED_INSTANCES: DWORD = 255;
 1839          }
 1840          pub mod sysconf {
 1841          }
 1842      }
 1843  
 1844  
 1845      #[cfg(target_os = "linux")]
 1846      #[cfg(target_os = "android")]
 1847      pub mod os {
 1848          pub mod c95 {
 1849              use libc::types::os::arch::c95::{c_int, c_uint};
 1850  
 1851              pub static EXIT_FAILURE : c_int = 1;
 1852              pub static EXIT_SUCCESS : c_int = 0;
 1853              pub static RAND_MAX : c_int = 2147483647;
 1854              pub static EOF : c_int = -1;
 1855              pub static SEEK_SET : c_int = 0;
 1856              pub static SEEK_CUR : c_int = 1;
 1857              pub static SEEK_END : c_int = 2;
 1858              pub static _IOFBF : c_int = 0;
 1859              pub static _IONBF : c_int = 2;
 1860              pub static _IOLBF : c_int = 1;
 1861              pub static BUFSIZ : c_uint = 8192_u32;
 1862              pub static FOPEN_MAX : c_uint = 16_u32;
 1863              pub static FILENAME_MAX : c_uint = 4096_u32;
 1864              pub static L_tmpnam : c_uint = 20_u32;
 1865              pub static TMP_MAX : c_uint = 238328_u32;
 1866          }
 1867          pub mod c99 {
 1868          }
 1869          #[cfg(target_arch = "x86")]
 1870          #[cfg(target_arch = "x86_64")]
 1871          #[cfg(target_arch = "arm")]
 1872          pub mod posix88 {
 1873              use libc::types::os::arch::c95::c_int;
 1874              use libc::types::common::c95::c_void;
 1875  
 1876              pub static O_RDONLY : c_int = 0;
 1877              pub static O_WRONLY : c_int = 1;
 1878              pub static O_RDWR : c_int = 2;
 1879              pub static O_APPEND : c_int = 1024;
 1880              pub static O_CREAT : c_int = 64;
 1881              pub static O_EXCL : c_int = 128;
 1882              pub static O_TRUNC : c_int = 512;
 1883              pub static S_IFIFO : c_int = 4096;
 1884              pub static S_IFCHR : c_int = 8192;
 1885              pub static S_IFBLK : c_int = 24576;
 1886              pub static S_IFDIR : c_int = 16384;
 1887              pub static S_IFREG : c_int = 32768;
 1888              pub static S_IFLNK : c_int = 40960;
 1889              pub static S_IFMT : c_int = 61440;
 1890              pub static S_IEXEC : c_int = 64;
 1891              pub static S_IWRITE : c_int = 128;
 1892              pub static S_IREAD : c_int = 256;
 1893              pub static S_IRWXU : c_int = 448;
 1894              pub static S_IXUSR : c_int = 64;
 1895              pub static S_IWUSR : c_int = 128;
 1896              pub static S_IRUSR : c_int = 256;
 1897              pub static F_OK : c_int = 0;
 1898              pub static R_OK : c_int = 4;
 1899              pub static W_OK : c_int = 2;
 1900              pub static X_OK : c_int = 1;
 1901              pub static STDIN_FILENO : c_int = 0;
 1902              pub static STDOUT_FILENO : c_int = 1;
 1903              pub static STDERR_FILENO : c_int = 2;
 1904              pub static F_LOCK : c_int = 1;
 1905              pub static F_TEST : c_int = 3;
 1906              pub static F_TLOCK : c_int = 2;
 1907              pub static F_ULOCK : c_int = 0;
 1908              pub static SIGHUP : c_int = 1;
 1909              pub static SIGINT : c_int = 2;
 1910              pub static SIGQUIT : c_int = 3;
 1911              pub static SIGILL : c_int = 4;
 1912              pub static SIGABRT : c_int = 6;
 1913              pub static SIGFPE : c_int = 8;
 1914              pub static SIGKILL : c_int = 9;
 1915              pub static SIGSEGV : c_int = 11;
 1916              pub static SIGPIPE : c_int = 13;
 1917              pub static SIGALRM : c_int = 14;
 1918              pub static SIGTERM : c_int = 15;
 1919  
 1920              pub static PROT_NONE : c_int = 0;
 1921              pub static PROT_READ : c_int = 1;
 1922              pub static PROT_WRITE : c_int = 2;
 1923              pub static PROT_EXEC : c_int = 4;
 1924  
 1925              pub static MAP_FILE : c_int = 0x0000;
 1926              pub static MAP_SHARED : c_int = 0x0001;
 1927              pub static MAP_PRIVATE : c_int = 0x0002;
 1928              pub static MAP_FIXED : c_int = 0x0010;
 1929              pub static MAP_ANON : c_int = 0x0020;
 1930  
 1931              pub static MAP_FAILED : *c_void = -1 as *c_void;
 1932  
 1933              pub static MCL_CURRENT : c_int = 0x0001;
 1934              pub static MCL_FUTURE : c_int = 0x0002;
 1935  
 1936              pub static MS_ASYNC : c_int = 0x0001;
 1937              pub static MS_INVALIDATE : c_int = 0x0002;
 1938              pub static MS_SYNC : c_int = 0x0004;
 1939  
 1940              pub static EPERM : c_int = 1;
 1941              pub static ENOENT : c_int = 2;
 1942              pub static ESRCH : c_int = 3;
 1943              pub static EINTR : c_int = 4;
 1944              pub static EIO : c_int = 5;
 1945              pub static ENXIO : c_int = 6;
 1946              pub static E2BIG : c_int = 7;
 1947              pub static ENOEXEC : c_int = 8;
 1948              pub static EBADF : c_int = 9;
 1949              pub static ECHILD : c_int = 10;
 1950              pub static EAGAIN : c_int = 11;
 1951              pub static ENOMEM : c_int = 12;
 1952              pub static EACCES : c_int = 13;
 1953              pub static EFAULT : c_int = 14;
 1954              pub static ENOTBLK : c_int = 15;
 1955              pub static EBUSY : c_int = 16;
 1956              pub static EEXIST : c_int = 17;
 1957              pub static EXDEV : c_int = 18;
 1958              pub static ENODEV : c_int = 19;
 1959              pub static ENOTDIR : c_int = 20;
 1960              pub static EISDIR : c_int = 21;
 1961              pub static EINVAL : c_int = 22;
 1962              pub static ENFILE : c_int = 23;
 1963              pub static EMFILE : c_int = 24;
 1964              pub static ENOTTY : c_int = 25;
 1965              pub static ETXTBSY : c_int = 26;
 1966              pub static EFBIG : c_int = 27;
 1967              pub static ENOSPC : c_int = 28;
 1968              pub static ESPIPE : c_int = 29;
 1969              pub static EROFS : c_int = 30;
 1970              pub static EMLINK : c_int = 31;
 1971              pub static EPIPE : c_int = 32;
 1972              pub static EDOM : c_int = 33;
 1973              pub static ERANGE : c_int = 34;
 1974  
 1975              pub static EDEADLK: c_int = 35;
 1976              pub static ENAMETOOLONG: c_int = 36;
 1977              pub static ENOLCK: c_int = 37;
 1978              pub static ENOSYS: c_int = 38;
 1979              pub static ENOTEMPTY: c_int = 39;
 1980              pub static ELOOP: c_int = 40;
 1981              pub static EWOULDBLOCK: c_int = EAGAIN;
 1982              pub static ENOMSG: c_int = 42;
 1983              pub static EIDRM: c_int = 43;
 1984              pub static ECHRNG: c_int = 44;
 1985              pub static EL2NSYNC: c_int = 45;
 1986              pub static EL3HLT: c_int = 46;
 1987              pub static EL3RST: c_int = 47;
 1988              pub static ELNRNG: c_int = 48;
 1989              pub static EUNATCH: c_int = 49;
 1990              pub static ENOCSI: c_int = 50;
 1991              pub static EL2HLT: c_int = 51;
 1992              pub static EBADE: c_int = 52;
 1993              pub static EBADR: c_int = 53;
 1994              pub static EXFULL: c_int = 54;
 1995              pub static ENOANO: c_int = 55;
 1996              pub static EBADRQC: c_int = 56;
 1997              pub static EBADSLT: c_int = 57;
 1998  
 1999              pub static EDEADLOCK: c_int = EDEADLK;
 2000  
 2001              pub static EBFONT: c_int = 59;
 2002              pub static ENOSTR: c_int = 60;
 2003              pub static ENODATA: c_int = 61;
 2004              pub static ETIME: c_int = 62;
 2005              pub static ENOSR: c_int = 63;
 2006              pub static ENONET: c_int = 64;
 2007              pub static ENOPKG: c_int = 65;
 2008              pub static EREMOTE: c_int = 66;
 2009              pub static ENOLINK: c_int = 67;
 2010              pub static EADV: c_int = 68;
 2011              pub static ESRMNT: c_int = 69;
 2012              pub static ECOMM: c_int = 70;
 2013              pub static EPROTO: c_int = 71;
 2014              pub static EMULTIHOP: c_int = 72;
 2015              pub static EDOTDOT: c_int = 73;
 2016              pub static EBADMSG: c_int = 74;
 2017              pub static EOVERFLOW: c_int = 75;
 2018              pub static ENOTUNIQ: c_int = 76;
 2019              pub static EBADFD: c_int = 77;
 2020              pub static EREMCHG: c_int = 78;
 2021              pub static ELIBACC: c_int = 79;
 2022              pub static ELIBBAD: c_int = 80;
 2023              pub static ELIBSCN: c_int = 81;
 2024              pub static ELIBMAX: c_int = 82;
 2025              pub static ELIBEXEC: c_int = 83;
 2026              pub static EILSEQ: c_int = 84;
 2027              pub static ERESTART: c_int = 85;
 2028              pub static ESTRPIPE: c_int = 86;
 2029              pub static EUSERS: c_int = 87;
 2030              pub static ENOTSOCK: c_int = 88;
 2031              pub static EDESTADDRREQ: c_int = 89;
 2032              pub static EMSGSIZE: c_int = 90;
 2033              pub static EPROTOTYPE: c_int = 91;
 2034              pub static ENOPROTOOPT: c_int = 92;
 2035              pub static EPROTONOSUPPORT: c_int = 93;
 2036              pub static ESOCKTNOSUPPORT: c_int = 94;
 2037              pub static EOPNOTSUPP: c_int = 95;
 2038              pub static EPFNOSUPPORT: c_int = 96;
 2039              pub static EAFNOSUPPORT: c_int = 97;
 2040              pub static EADDRINUSE: c_int = 98;
 2041              pub static EADDRNOTAVAIL: c_int = 99;
 2042              pub static ENETDOWN: c_int = 100;
 2043              pub static ENETUNREACH: c_int = 101;
 2044              pub static ENETRESET: c_int = 102;
 2045              pub static ECONNABORTED: c_int = 103;
 2046              pub static ECONNRESET: c_int = 104;
 2047              pub static ENOBUFS: c_int = 105;
 2048              pub static EISCONN: c_int = 106;
 2049              pub static ENOTCONN: c_int = 107;
 2050              pub static ESHUTDOWN: c_int = 108;
 2051              pub static ETOOMANYREFS: c_int = 109;
 2052              pub static ETIMEDOUT: c_int = 110;
 2053              pub static ECONNREFUSED: c_int = 111;
 2054              pub static EHOSTDOWN: c_int = 112;
 2055              pub static EHOSTUNREACH: c_int = 113;
 2056              pub static EALREADY: c_int = 114;
 2057              pub static EINPROGRESS: c_int = 115;
 2058              pub static ESTALE: c_int = 116;
 2059              pub static EUCLEAN: c_int = 117;
 2060              pub static ENOTNAM: c_int = 118;
 2061              pub static ENAVAIL: c_int = 119;
 2062              pub static EISNAM: c_int = 120;
 2063              pub static EREMOTEIO: c_int = 121;
 2064              pub static EDQUOT: c_int = 122;
 2065  
 2066              pub static ENOMEDIUM: c_int = 123;
 2067              pub static EMEDIUMTYPE: c_int = 124;
 2068              pub static ECANCELED: c_int = 125;
 2069              pub static ENOKEY: c_int = 126;
 2070              pub static EKEYEXPIRED: c_int = 127;
 2071              pub static EKEYREVOKED: c_int = 128;
 2072              pub static EKEYREJECTED: c_int = 129;
 2073  
 2074              pub static EOWNERDEAD: c_int = 130;
 2075              pub static ENOTRECOVERABLE: c_int = 131;
 2076  
 2077              pub static ERFKILL: c_int = 132;
 2078  
 2079              pub static EHWPOISON: c_int = 133;
 2080          }
 2081  
 2082          #[cfg(target_arch = "mips")]
 2083          pub mod posix88 {
 2084              use libc::types::os::arch::c95::c_int;
 2085              use libc::types::common::c95::c_void;
 2086  
 2087              pub static O_RDONLY : c_int = 0;
 2088              pub static O_WRONLY : c_int = 1;
 2089              pub static O_RDWR : c_int = 2;
 2090              pub static O_APPEND : c_int = 8;
 2091              pub static O_CREAT : c_int = 256;
 2092              pub static O_EXCL : c_int = 1024;
 2093              pub static O_TRUNC : c_int = 512;
 2094              pub static S_IFIFO : c_int = 4096;
 2095              pub static S_IFCHR : c_int = 8192;
 2096              pub static S_IFBLK : c_int = 24576;
 2097              pub static S_IFDIR : c_int = 16384;
 2098              pub static S_IFREG : c_int = 32768;
 2099              pub static S_IFLNK : c_int = 40960;
 2100              pub static S_IFMT : c_int = 61440;
 2101              pub static S_IEXEC : c_int = 64;
 2102              pub static S_IWRITE : c_int = 128;
 2103              pub static S_IREAD : c_int = 256;
 2104              pub static S_IRWXU : c_int = 448;
 2105              pub static S_IXUSR : c_int = 64;
 2106              pub static S_IWUSR : c_int = 128;
 2107              pub static S_IRUSR : c_int = 256;
 2108              pub static F_OK : c_int = 0;
 2109              pub static R_OK : c_int = 4;
 2110              pub static W_OK : c_int = 2;
 2111              pub static X_OK : c_int = 1;
 2112              pub static STDIN_FILENO : c_int = 0;
 2113              pub static STDOUT_FILENO : c_int = 1;
 2114              pub static STDERR_FILENO : c_int = 2;
 2115              pub static F_LOCK : c_int = 1;
 2116              pub static F_TEST : c_int = 3;
 2117              pub static F_TLOCK : c_int = 2;
 2118              pub static F_ULOCK : c_int = 0;
 2119              pub static SIGHUP : c_int = 1;
 2120              pub static SIGINT : c_int = 2;
 2121              pub static SIGQUIT : c_int = 3;
 2122              pub static SIGILL : c_int = 4;
 2123              pub static SIGABRT : c_int = 6;
 2124              pub static SIGFPE : c_int = 8;
 2125              pub static SIGKILL : c_int = 9;
 2126              pub static SIGSEGV : c_int = 11;
 2127              pub static SIGPIPE : c_int = 13;
 2128              pub static SIGALRM : c_int = 14;
 2129              pub static SIGTERM : c_int = 15;
 2130  
 2131              pub static PROT_NONE : c_int = 0;
 2132              pub static PROT_READ : c_int = 1;
 2133              pub static PROT_WRITE : c_int = 2;
 2134              pub static PROT_EXEC : c_int = 4;
 2135  
 2136              pub static MAP_FILE : c_int = 0x0000;
 2137              pub static MAP_SHARED : c_int = 0x0001;
 2138              pub static MAP_PRIVATE : c_int = 0x0002;
 2139              pub static MAP_FIXED : c_int = 0x0010;
 2140              pub static MAP_ANON : c_int = 0x0800;
 2141  
 2142              pub static MAP_FAILED : *c_void = -1 as *c_void;
 2143  
 2144              pub static MCL_CURRENT : c_int = 0x0001;
 2145              pub static MCL_FUTURE : c_int = 0x0002;
 2146  
 2147              pub static MS_ASYNC : c_int = 0x0001;
 2148              pub static MS_INVALIDATE : c_int = 0x0002;
 2149              pub static MS_SYNC : c_int = 0x0004;
 2150  
 2151              pub static EPERM : c_int = 1;
 2152              pub static ENOENT : c_int = 2;
 2153              pub static ESRCH : c_int = 3;
 2154              pub static EINTR : c_int = 4;
 2155              pub static EIO : c_int = 5;
 2156              pub static ENXIO : c_int = 6;
 2157              pub static E2BIG : c_int = 7;
 2158              pub static ENOEXEC : c_int = 8;
 2159              pub static EBADF : c_int = 9;
 2160              pub static ECHILD : c_int = 10;
 2161              pub static EAGAIN : c_int = 11;
 2162              pub static ENOMEM : c_int = 12;
 2163              pub static EACCES : c_int = 13;
 2164              pub static EFAULT : c_int = 14;
 2165              pub static ENOTBLK : c_int = 15;
 2166              pub static EBUSY : c_int = 16;
 2167              pub static EEXIST : c_int = 17;
 2168              pub static EXDEV : c_int = 18;
 2169              pub static ENODEV : c_int = 19;
 2170              pub static ENOTDIR : c_int = 20;
 2171              pub static EISDIR : c_int = 21;
 2172              pub static EINVAL : c_int = 22;
 2173              pub static ENFILE : c_int = 23;
 2174              pub static EMFILE : c_int = 24;
 2175              pub static ENOTTY : c_int = 25;
 2176              pub static ETXTBSY : c_int = 26;
 2177              pub static EFBIG : c_int = 27;
 2178              pub static ENOSPC : c_int = 28;
 2179              pub static ESPIPE : c_int = 29;
 2180              pub static EROFS : c_int = 30;
 2181              pub static EMLINK : c_int = 31;
 2182              pub static EPIPE : c_int = 32;
 2183              pub static EDOM : c_int = 33;
 2184              pub static ERANGE : c_int = 34;
 2185  
 2186              pub static ENOMSG: c_int = 35;
 2187              pub static EIDRM: c_int = 36;
 2188              pub static ECHRNG: c_int = 37;
 2189              pub static EL2NSYNC: c_int = 38;
 2190              pub static EL3HLT: c_int = 39;
 2191              pub static EL3RST: c_int = 40;
 2192              pub static ELNRNG: c_int = 41;
 2193              pub static EUNATCH: c_int = 42;
 2194              pub static ENOCSI: c_int = 43;
 2195              pub static EL2HLT: c_int = 44;
 2196              pub static EDEADLK: c_int = 45;
 2197              pub static ENOLCK: c_int = 46;
 2198              pub static EBADE: c_int = 50;
 2199              pub static EBADR: c_int = 51;
 2200              pub static EXFULL: c_int = 52;
 2201              pub static ENOANO: c_int = 53;
 2202              pub static EBADRQC: c_int = 54;
 2203              pub static EBADSLT: c_int = 55;
 2204              pub static EDEADLOCK: c_int = 56;
 2205              pub static EBFONT: c_int = 59;
 2206              pub static ENOSTR: c_int = 60;
 2207              pub static ENODATA: c_int = 61;
 2208              pub static ETIME: c_int = 62;
 2209              pub static ENOSR: c_int = 63;
 2210              pub static ENONET: c_int = 64;
 2211              pub static ENOPKG: c_int = 65;
 2212              pub static EREMOTE: c_int = 66;
 2213              pub static ENOLINK: c_int = 67;
 2214              pub static EADV: c_int = 68;
 2215              pub static ESRMNT: c_int = 69;
 2216              pub static ECOMM: c_int = 70;
 2217              pub static EPROTO: c_int = 71;
 2218              pub static EDOTDOT: c_int = 73;
 2219              pub static EMULTIHOP: c_int = 74;
 2220              pub static EBADMSG: c_int = 77;
 2221              pub static ENAMETOOLONG: c_int = 78;
 2222              pub static EOVERFLOW: c_int = 79;
 2223              pub static ENOTUNIQ: c_int = 80;
 2224              pub static EBADFD: c_int = 81;
 2225              pub static EREMCHG: c_int = 82;
 2226              pub static ELIBACC: c_int = 83;
 2227              pub static ELIBBAD: c_int = 84;
 2228              pub static ELIBSCN: c_int = 95;
 2229              pub static ELIBMAX: c_int = 86;
 2230              pub static ELIBEXEC: c_int = 87;
 2231              pub static EILSEQ: c_int = 88;
 2232              pub static ENOSYS: c_int = 89;
 2233              pub static ELOOP: c_int = 90;
 2234              pub static ERESTART: c_int = 91;
 2235              pub static ESTRPIPE: c_int = 92;
 2236              pub static ENOTEMPTY: c_int = 93;
 2237              pub static EUSERS: c_int = 94;
 2238              pub static ENOTSOCK: c_int = 95;
 2239              pub static EDESTADDRREQ: c_int = 96;
 2240              pub static EMSGSIZE: c_int = 97;
 2241              pub static EPROTOTYPE: c_int = 98;
 2242              pub static ENOPROTOOPT: c_int = 99;
 2243              pub static EPROTONOSUPPORT: c_int = 120;
 2244              pub static ESOCKTNOSUPPORT: c_int = 121;
 2245              pub static EOPNOTSUPP: c_int = 122;
 2246              pub static EPFNOSUPPORT: c_int = 123;
 2247              pub static EAFNOSUPPORT: c_int = 124;
 2248              pub static EADDRINUSE: c_int = 125;
 2249              pub static EADDRNOTAVAIL: c_int = 126;
 2250              pub static ENETDOWN: c_int = 127;
 2251              pub static ENETUNREACH: c_int = 128;
 2252              pub static ENETRESET: c_int = 129;
 2253              pub static ECONNABORTED: c_int = 130;
 2254              pub static ECONNRESET: c_int = 131;
 2255              pub static ENOBUFS: c_int = 132;
 2256              pub static EISCONN: c_int = 133;
 2257              pub static ENOTCONN: c_int = 134;
 2258              pub static EUCLEAN: c_int = 135;
 2259              pub static ENOTNAM: c_int = 137;
 2260              pub static ENAVAIL: c_int = 138;
 2261              pub static EISNAM: c_int = 139;
 2262              pub static EREMOTEIO: c_int = 140;
 2263              pub static ESHUTDOWN: c_int = 143;
 2264              pub static ETOOMANYREFS: c_int = 144;
 2265              pub static ETIMEDOUT: c_int = 145;
 2266              pub static ECONNREFUSED: c_int = 146;
 2267              pub static EHOSTDOWN: c_int = 147;
 2268              pub static EHOSTUNREACH: c_int = 148;
 2269              pub static EWOULDBLOCK: c_int = EAGAIN;
 2270              pub static EALREADY: c_int = 149;
 2271              pub static EINPROGRESS: c_int = 150;
 2272              pub static ESTALE: c_int = 151;
 2273              pub static ECANCELED: c_int = 158;
 2274  
 2275              pub static ENOMEDIUM: c_int = 159;
 2276              pub static EMEDIUMTYPE: c_int = 160;
 2277              pub static ENOKEY: c_int = 161;
 2278              pub static EKEYEXPIRED: c_int = 162;
 2279              pub static EKEYREVOKED: c_int = 163;
 2280              pub static EKEYREJECTED: c_int = 164;
 2281  
 2282              pub static EOWNERDEAD: c_int = 165;
 2283              pub static ENOTRECOVERABLE: c_int = 166;
 2284  
 2285              pub static ERFKILL: c_int = 167;
 2286  
 2287              pub static EHWPOISON: c_int = 168;
 2288  
 2289              pub static EDQUOT: c_int = 1133;
 2290          }
 2291          pub mod posix01 {
 2292              use libc::types::os::arch::c95::{c_int, size_t};
 2293  
 2294              pub static SIGTRAP : c_int = 5;
 2295  
 2296              pub static GLOB_ERR      : c_int = 1 << 0;
 2297              pub static GLOB_MARK     : c_int = 1 << 1;
 2298              pub static GLOB_NOSORT   : c_int = 1 << 2;
 2299              pub static GLOB_DOOFFS   : c_int = 1 << 3;
 2300              pub static GLOB_NOCHECK  : c_int = 1 << 4;
 2301              pub static GLOB_APPEND   : c_int = 1 << 5;
 2302              pub static GLOB_NOESCAPE : c_int = 1 << 6;
 2303  
 2304              pub static GLOB_NOSPACE  : c_int = 1;
 2305              pub static GLOB_ABORTED  : c_int = 2;
 2306              pub static GLOB_NOMATCH  : c_int = 3;
 2307  
 2308              pub static POSIX_MADV_NORMAL : c_int = 0;
 2309              pub static POSIX_MADV_RANDOM : c_int = 1;
 2310              pub static POSIX_MADV_SEQUENTIAL : c_int = 2;
 2311              pub static POSIX_MADV_WILLNEED : c_int = 3;
 2312              pub static POSIX_MADV_DONTNEED : c_int = 4;
 2313  
 2314              pub static _SC_MQ_PRIO_MAX : c_int = 28;
 2315              pub static _SC_IOV_MAX : c_int = 60;
 2316              pub static _SC_GETGR_R_SIZE_MAX : c_int = 69;
 2317              pub static _SC_GETPW_R_SIZE_MAX : c_int = 70;
 2318              pub static _SC_LOGIN_NAME_MAX : c_int = 71;
 2319              pub static _SC_TTY_NAME_MAX : c_int = 72;
 2320              pub static _SC_THREADS : c_int = 67;
 2321              pub static _SC_THREAD_SAFE_FUNCTIONS : c_int = 68;
 2322              pub static _SC_THREAD_DESTRUCTOR_ITERATIONS : c_int = 73;
 2323              pub static _SC_THREAD_KEYS_MAX : c_int = 74;
 2324              pub static _SC_THREAD_STACK_MIN : c_int = 75;
 2325              pub static _SC_THREAD_THREADS_MAX : c_int = 76;
 2326              pub static _SC_THREAD_ATTR_STACKADDR : c_int = 77;
 2327              pub static _SC_THREAD_ATTR_STACKSIZE : c_int = 78;
 2328              pub static _SC_THREAD_PRIORITY_SCHEDULING : c_int = 79;
 2329              pub static _SC_THREAD_PRIO_INHERIT : c_int = 80;
 2330              pub static _SC_THREAD_PRIO_PROTECT : c_int = 81;
 2331              pub static _SC_THREAD_PROCESS_SHARED : c_int = 82;
 2332              pub static _SC_ATEXIT_MAX : c_int = 87;
 2333              pub static _SC_XOPEN_VERSION : c_int = 89;
 2334              pub static _SC_XOPEN_XCU_VERSION : c_int = 90;
 2335              pub static _SC_XOPEN_UNIX : c_int = 91;
 2336              pub static _SC_XOPEN_CRYPT : c_int = 92;
 2337              pub static _SC_XOPEN_ENH_I18N : c_int = 93;
 2338              pub static _SC_XOPEN_SHM : c_int = 94;
 2339              pub static _SC_XOPEN_LEGACY : c_int = 129;
 2340              pub static _SC_XOPEN_REALTIME : c_int = 130;
 2341              pub static _SC_XOPEN_REALTIME_THREADS : c_int = 131;
 2342  
 2343              pub static PTHREAD_CREATE_JOINABLE: c_int = 0;
 2344              pub static PTHREAD_CREATE_DETACHED: c_int = 1;
 2345  
 2346              #[cfg(target_os = "android")]
 2347              pub static PTHREAD_STACK_MIN: size_t = 8192;
 2348  
 2349              #[cfg(target_arch = "arm", target_os = "linux")]
 2350              #[cfg(target_arch = "x86", target_os = "linux")]
 2351              #[cfg(target_arch = "x86_64", target_os = "linux")]
 2352              pub static PTHREAD_STACK_MIN: size_t = 16384;
 2353  
 2354              #[cfg(target_arch = "mips", target_os = "linux")]
 2355              pub static PTHREAD_STACK_MIN: size_t = 131072;
 2356  
 2357              pub static CLOCK_REALTIME: c_int = 0;
 2358              pub static CLOCK_MONOTONIC: c_int = 1;
 2359          }
 2360          pub mod posix08 {
 2361          }
 2362          pub mod bsd44 {
 2363              use libc::types::os::arch::c95::c_int;
 2364  
 2365              pub static MADV_NORMAL : c_int = 0;
 2366              pub static MADV_RANDOM : c_int = 1;
 2367              pub static MADV_SEQUENTIAL : c_int = 2;
 2368              pub static MADV_WILLNEED : c_int = 3;
 2369              pub static MADV_DONTNEED : c_int = 4;
 2370              pub static MADV_REMOVE : c_int = 9;
 2371              pub static MADV_DONTFORK : c_int = 10;
 2372              pub static MADV_DOFORK : c_int = 11;
 2373              pub static MADV_MERGEABLE : c_int = 12;
 2374              pub static MADV_UNMERGEABLE : c_int = 13;
 2375              pub static MADV_HWPOISON : c_int = 100;
 2376  
 2377              pub static AF_UNIX: c_int = 1;
 2378              pub static AF_INET: c_int = 2;
 2379              pub static AF_INET6: c_int = 10;
 2380              pub static SOCK_STREAM: c_int = 1;
 2381              pub static SOCK_DGRAM: c_int = 2;
 2382              pub static IPPROTO_TCP: c_int = 6;
 2383              pub static IPPROTO_IP: c_int = 0;
 2384              pub static IPPROTO_IPV6: c_int = 41;
 2385              pub static IP_MULTICAST_TTL: c_int = 33;
 2386              pub static IP_MULTICAST_LOOP: c_int = 34;
 2387              pub static IP_TTL: c_int = 2;
 2388              pub static IP_ADD_MEMBERSHIP: c_int = 35;
 2389              pub static IP_DROP_MEMBERSHIP: c_int = 36;
 2390              pub static IPV6_ADD_MEMBERSHIP: c_int = 20;
 2391              pub static IPV6_DROP_MEMBERSHIP: c_int = 21;
 2392  
 2393              pub static TCP_NODELAY: c_int = 1;
 2394              pub static SOL_SOCKET: c_int = 1;
 2395              pub static SO_KEEPALIVE: c_int = 9;
 2396              pub static SO_BROADCAST: c_int = 6;
 2397              pub static SO_REUSEADDR: c_int = 2;
 2398  
 2399              pub static SHUT_RD: c_int = 0;
 2400              pub static SHUT_WR: c_int = 1;
 2401              pub static SHUT_RDWR: c_int = 2;
 2402          }
 2403          #[cfg(target_arch = "x86")]
 2404          #[cfg(target_arch = "x86_64")]
 2405          #[cfg(target_arch = "arm")]
 2406          pub mod extra {
 2407              use libc::types::os::arch::c95::c_int;
 2408  
 2409              pub static O_RSYNC : c_int = 1052672;
 2410              pub static O_DSYNC : c_int = 4096;
 2411              pub static O_SYNC : c_int = 1052672;
 2412  
 2413              pub static PROT_GROWSDOWN : c_int = 0x010000000;
 2414              pub static PROT_GROWSUP : c_int = 0x020000000;
 2415  
 2416              pub static MAP_TYPE : c_int = 0x000f;
 2417              pub static MAP_ANONONYMOUS : c_int = 0x0020;
 2418              pub static MAP_32BIT : c_int = 0x0040;
 2419              pub static MAP_GROWSDOWN : c_int = 0x0100;
 2420              pub static MAP_DENYWRITE : c_int = 0x0800;
 2421              pub static MAP_EXECUTABLE : c_int = 0x01000;
 2422              pub static MAP_LOCKED : c_int = 0x02000;
 2423              pub static MAP_NONRESERVE : c_int = 0x04000;
 2424              pub static MAP_POPULATE : c_int = 0x08000;
 2425              pub static MAP_NONBLOCK : c_int = 0x010000;
 2426              pub static MAP_STACK : c_int = 0x020000;
 2427          }
 2428          #[cfg(target_arch = "mips")]
 2429          pub mod extra {
 2430              use libc::types::os::arch::c95::c_int;
 2431  
 2432              pub static O_RSYNC : c_int = 16400;
 2433              pub static O_DSYNC : c_int = 16;
 2434              pub static O_SYNC : c_int = 16400;
 2435  
 2436              pub static PROT_GROWSDOWN : c_int = 0x01000000;
 2437              pub static PROT_GROWSUP : c_int = 0x02000000;
 2438  
 2439              pub static MAP_TYPE : c_int = 0x000f;
 2440              pub static MAP_ANONONYMOUS : c_int = 0x0800;
 2441              pub static MAP_GROWSDOWN : c_int = 0x01000;
 2442              pub static MAP_DENYWRITE : c_int = 0x02000;
 2443              pub static MAP_EXECUTABLE : c_int = 0x04000;
 2444              pub static MAP_LOCKED : c_int = 0x08000;
 2445              pub static MAP_NONRESERVE : c_int = 0x0400;
 2446              pub static MAP_POPULATE : c_int = 0x010000;
 2447              pub static MAP_NONBLOCK : c_int = 0x020000;
 2448              pub static MAP_STACK : c_int = 0x040000;
 2449          }
 2450          #[cfg(target_os = "linux")]
 2451          pub mod sysconf {
 2452              use libc::types::os::arch::c95::c_int;
 2453  
 2454              pub static _SC_ARG_MAX : c_int = 0;
 2455              pub static _SC_CHILD_MAX : c_int = 1;
 2456              pub static _SC_CLK_TCK : c_int = 2;
 2457              pub static _SC_NGROUPS_MAX : c_int = 3;
 2458              pub static _SC_OPEN_MAX : c_int = 4;
 2459              pub static _SC_STREAM_MAX : c_int = 5;
 2460              pub static _SC_TZNAME_MAX : c_int = 6;
 2461              pub static _SC_JOB_CONTROL : c_int = 7;
 2462              pub static _SC_SAVED_IDS : c_int = 8;
 2463              pub static _SC_REALTIME_SIGNALS : c_int = 9;
 2464              pub static _SC_PRIORITY_SCHEDULING : c_int = 10;
 2465              pub static _SC_TIMERS : c_int = 11;
 2466              pub static _SC_ASYNCHRONOUS_IO : c_int = 12;
 2467              pub static _SC_PRIORITIZED_IO : c_int = 13;
 2468              pub static _SC_SYNCHRONIZED_IO : c_int = 14;
 2469              pub static _SC_FSYNC : c_int = 15;
 2470              pub static _SC_MAPPED_FILES : c_int = 16;
 2471              pub static _SC_MEMLOCK : c_int = 17;
 2472              pub static _SC_MEMLOCK_RANGE : c_int = 18;
 2473              pub static _SC_MEMORY_PROTECTION : c_int = 19;
 2474              pub static _SC_MESSAGE_PASSING : c_int = 20;
 2475              pub static _SC_SEMAPHORES : c_int = 21;
 2476              pub static _SC_SHARED_MEMORY_OBJECTS : c_int = 22;
 2477              pub static _SC_AIO_LISTIO_MAX : c_int = 23;
 2478              pub static _SC_AIO_MAX : c_int = 24;
 2479              pub static _SC_AIO_PRIO_DELTA_MAX : c_int = 25;
 2480              pub static _SC_DELAYTIMER_MAX : c_int = 26;
 2481              pub static _SC_MQ_OPEN_MAX : c_int = 27;
 2482              pub static _SC_VERSION : c_int = 29;
 2483              pub static _SC_PAGESIZE : c_int = 30;
 2484              pub static _SC_RTSIG_MAX : c_int = 31;
 2485              pub static _SC_SEM_NSEMS_MAX : c_int = 32;
 2486              pub static _SC_SEM_VALUE_MAX : c_int = 33;
 2487              pub static _SC_SIGQUEUE_MAX : c_int = 34;
 2488              pub static _SC_TIMER_MAX : c_int = 35;
 2489              pub static _SC_BC_BASE_MAX : c_int = 36;
 2490              pub static _SC_BC_DIM_MAX : c_int = 37;
 2491              pub static _SC_BC_SCALE_MAX : c_int = 38;
 2492              pub static _SC_BC_STRING_MAX : c_int = 39;
 2493              pub static _SC_COLL_WEIGHTS_MAX : c_int = 40;
 2494              pub static _SC_EXPR_NEST_MAX : c_int = 42;
 2495              pub static _SC_LINE_MAX : c_int = 43;
 2496              pub static _SC_RE_DUP_MAX : c_int = 44;
 2497              pub static _SC_2_VERSION : c_int = 46;
 2498              pub static _SC_2_C_BIND : c_int = 47;
 2499              pub static _SC_2_C_DEV : c_int = 48;
 2500              pub static _SC_2_FORT_DEV : c_int = 49;
 2501              pub static _SC_2_FORT_RUN : c_int = 50;
 2502              pub static _SC_2_SW_DEV : c_int = 51;
 2503              pub static _SC_2_LOCALEDEF : c_int = 52;
 2504              pub static _SC_2_CHAR_TERM : c_int = 95;
 2505              pub static _SC_2_C_VERSION : c_int = 96;
 2506              pub static _SC_2_UPE : c_int = 97;
 2507              pub static _SC_XBS5_ILP32_OFF32 : c_int = 125;
 2508              pub static _SC_XBS5_ILP32_OFFBIG : c_int = 126;
 2509              pub static _SC_XBS5_LPBIG_OFFBIG : c_int = 128;
 2510          }
 2511          #[cfg(target_os = "android")]
 2512          pub mod sysconf {
 2513              use libc::types::os::arch::c95::c_int;
 2514  
 2515              pub static _SC_ARG_MAX : c_int = 0;
 2516              pub static _SC_BC_BASE_MAX : c_int = 1;
 2517              pub static _SC_BC_DIM_MAX : c_int = 2;
 2518              pub static _SC_BC_SCALE_MAX : c_int = 3;
 2519              pub static _SC_BC_STRING_MAX : c_int = 4;
 2520              pub static _SC_CHILD_MAX : c_int = 5;
 2521              pub static _SC_CLK_TCK : c_int = 6;
 2522              pub static _SC_COLL_WEIGHTS_MAX : c_int = 7;
 2523              pub static _SC_EXPR_NEST_MAX : c_int = 8;
 2524              pub static _SC_LINE_MAX : c_int = 9;
 2525              pub static _SC_NGROUPS_MAX : c_int = 10;
 2526              pub static _SC_OPEN_MAX : c_int = 11;
 2527              pub static _SC_2_C_BIND : c_int = 13;
 2528              pub static _SC_2_C_DEV : c_int = 14;
 2529              pub static _SC_2_C_VERSION : c_int = 15;
 2530              pub static _SC_2_CHAR_TERM : c_int = 16;
 2531              pub static _SC_2_FORT_DEV : c_int = 17;
 2532              pub static _SC_2_FORT_RUN : c_int = 18;
 2533              pub static _SC_2_LOCALEDEF : c_int = 19;
 2534              pub static _SC_2_SW_DEV : c_int = 20;
 2535              pub static _SC_2_UPE : c_int = 21;
 2536              pub static _SC_2_VERSION : c_int = 22;
 2537              pub static _SC_JOB_CONTROL : c_int = 23;
 2538              pub static _SC_SAVED_IDS : c_int = 24;
 2539              pub static _SC_VERSION : c_int = 25;
 2540              pub static _SC_RE_DUP_MAX : c_int = 26;
 2541              pub static _SC_STREAM_MAX : c_int = 27;
 2542              pub static _SC_TZNAME_MAX : c_int = 28;
 2543              pub static _SC_PAGESIZE : c_int = 39;
 2544          }
 2545      }
 2546  
 2547      #[cfg(target_os = "freebsd")]
 2548      pub mod os {
 2549          pub mod c95 {
 2550              use libc::types::os::arch::c95::{c_int, c_uint};
 2551  
 2552              pub static EXIT_FAILURE : c_int = 1;
 2553              pub static EXIT_SUCCESS : c_int = 0;
 2554              pub static RAND_MAX : c_int = 2147483647;
 2555              pub static EOF : c_int = -1;
 2556              pub static SEEK_SET : c_int = 0;
 2557              pub static SEEK_CUR : c_int = 1;
 2558              pub static SEEK_END : c_int = 2;
 2559              pub static _IOFBF : c_int = 0;
 2560              pub static _IONBF : c_int = 2;
 2561              pub static _IOLBF : c_int = 1;
 2562              pub static BUFSIZ : c_uint = 1024_u32;
 2563              pub static FOPEN_MAX : c_uint = 20_u32;
 2564              pub static FILENAME_MAX : c_uint = 1024_u32;
 2565              pub static L_tmpnam : c_uint = 1024_u32;
 2566              pub static TMP_MAX : c_uint = 308915776_u32;
 2567          }
 2568          pub mod c99 {
 2569          }
 2570          pub mod posix88 {
 2571              use libc::types::common::c95::c_void;
 2572              use libc::types::os::arch::c95::c_int;
 2573  
 2574              pub static O_RDONLY : c_int = 0;
 2575              pub static O_WRONLY : c_int = 1;
 2576              pub static O_RDWR : c_int = 2;
 2577              pub static O_APPEND : c_int = 8;
 2578              pub static O_CREAT : c_int = 512;
 2579              pub static O_EXCL : c_int = 2048;
 2580              pub static O_TRUNC : c_int = 1024;
 2581              pub static S_IFIFO : c_int = 4096;
 2582              pub static S_IFCHR : c_int = 8192;
 2583              pub static S_IFBLK : c_int = 24576;
 2584              pub static S_IFDIR : c_int = 16384;
 2585              pub static S_IFREG : c_int = 32768;
 2586              pub static S_IFLNK : c_int = 40960;
 2587              pub static S_IFMT : c_int = 61440;
 2588              pub static S_IEXEC : c_int = 64;
 2589              pub static S_IWRITE : c_int = 128;
 2590              pub static S_IREAD : c_int = 256;
 2591              pub static S_IRWXU : c_int = 448;
 2592              pub static S_IXUSR : c_int = 64;
 2593              pub static S_IWUSR : c_int = 128;
 2594              pub static S_IRUSR : c_int = 256;
 2595              pub static F_OK : c_int = 0;
 2596              pub static R_OK : c_int = 4;
 2597              pub static W_OK : c_int = 2;
 2598              pub static X_OK : c_int = 1;
 2599              pub static STDIN_FILENO : c_int = 0;
 2600              pub static STDOUT_FILENO : c_int = 1;
 2601              pub static STDERR_FILENO : c_int = 2;
 2602              pub static F_LOCK : c_int = 1;
 2603              pub static F_TEST : c_int = 3;
 2604              pub static F_TLOCK : c_int = 2;
 2605              pub static F_ULOCK : c_int = 0;
 2606              pub static SIGHUP : c_int = 1;
 2607              pub static SIGINT : c_int = 2;
 2608              pub static SIGQUIT : c_int = 3;
 2609              pub static SIGILL : c_int = 4;
 2610              pub static SIGABRT : c_int = 6;
 2611              pub static SIGFPE : c_int = 8;
 2612              pub static SIGKILL : c_int = 9;
 2613              pub static SIGSEGV : c_int = 11;
 2614              pub static SIGPIPE : c_int = 13;
 2615              pub static SIGALRM : c_int = 14;
 2616              pub static SIGTERM : c_int = 15;
 2617  
 2618              pub static PROT_NONE : c_int = 0;
 2619              pub static PROT_READ : c_int = 1;
 2620              pub static PROT_WRITE : c_int = 2;
 2621              pub static PROT_EXEC : c_int = 4;
 2622  
 2623              pub static MAP_FILE : c_int = 0x0000;
 2624              pub static MAP_SHARED : c_int = 0x0001;
 2625              pub static MAP_PRIVATE : c_int = 0x0002;
 2626              pub static MAP_FIXED : c_int = 0x0010;
 2627              pub static MAP_ANON : c_int = 0x1000;
 2628  
 2629              pub static MAP_FAILED : *c_void = -1 as *c_void;
 2630  
 2631              pub static MCL_CURRENT : c_int = 0x0001;
 2632              pub static MCL_FUTURE : c_int = 0x0002;
 2633  
 2634              pub static MS_SYNC : c_int = 0x0000;
 2635              pub static MS_ASYNC : c_int = 0x0001;
 2636              pub static MS_INVALIDATE : c_int = 0x0002;
 2637  
 2638              pub static EPERM : c_int = 1;
 2639              pub static ENOENT : c_int = 2;
 2640              pub static ESRCH : c_int = 3;
 2641              pub static EINTR : c_int = 4;
 2642              pub static EIO : c_int = 5;
 2643              pub static ENXIO : c_int = 6;
 2644              pub static E2BIG : c_int = 7;
 2645              pub static ENOEXEC : c_int = 8;
 2646              pub static EBADF : c_int = 9;
 2647              pub static ECHILD : c_int = 10;
 2648              pub static EDEADLK : c_int = 11;
 2649              pub static ENOMEM : c_int = 12;
 2650              pub static EACCES : c_int = 13;
 2651              pub static EFAULT : c_int = 14;
 2652              pub static ENOTBLK : c_int = 15;
 2653              pub static EBUSY : c_int = 16;
 2654              pub static EEXIST : c_int = 17;
 2655              pub static EXDEV : c_int = 18;
 2656              pub static ENODEV : c_int = 19;
 2657              pub static ENOTDIR : c_int = 20;
 2658              pub static EISDIR : c_int = 21;
 2659              pub static EINVAL : c_int = 22;
 2660              pub static ENFILE : c_int = 23;
 2661              pub static EMFILE : c_int = 24;
 2662              pub static ENOTTY : c_int = 25;
 2663              pub static ETXTBSY : c_int = 26;
 2664              pub static EFBIG : c_int = 27;
 2665              pub static ENOSPC : c_int = 28;
 2666              pub static ESPIPE : c_int = 29;
 2667              pub static EROFS : c_int = 30;
 2668              pub static EMLINK : c_int = 31;
 2669              pub static EPIPE : c_int = 32;
 2670              pub static EDOM : c_int = 33;
 2671              pub static ERANGE : c_int = 34;
 2672              pub static EAGAIN : c_int = 35;
 2673              pub static EWOULDBLOCK : c_int = 35;
 2674              pub static EINPROGRESS : c_int = 36;
 2675              pub static EALREADY : c_int = 37;
 2676              pub static ENOTSOCK : c_int = 38;
 2677              pub static EDESTADDRREQ : c_int = 39;
 2678              pub static EMSGSIZE : c_int = 40;
 2679              pub static EPROTOTYPE : c_int = 41;
 2680              pub static ENOPROTOOPT : c_int = 42;
 2681              pub static EPROTONOSUPPORT : c_int = 43;
 2682              pub static ESOCKTNOSUPPORT : c_int = 44;
 2683              pub static EOPNOTSUPP : c_int = 45;
 2684              pub static EPFNOSUPPORT : c_int = 46;
 2685              pub static EAFNOSUPPORT : c_int = 47;
 2686              pub static EADDRINUSE : c_int = 48;
 2687              pub static EADDRNOTAVAIL : c_int = 49;
 2688              pub static ENETDOWN : c_int = 50;
 2689              pub static ENETUNREACH : c_int = 51;
 2690              pub static ENETRESET : c_int = 52;
 2691              pub static ECONNABORTED : c_int = 53;
 2692              pub static ECONNRESET : c_int = 54;
 2693              pub static ENOBUFS : c_int = 55;
 2694              pub static EISCONN : c_int = 56;
 2695              pub static ENOTCONN : c_int = 57;
 2696              pub static ESHUTDOWN : c_int = 58;
 2697              pub static ETOOMANYREFS : c_int = 59;
 2698              pub static ETIMEDOUT : c_int = 60;
 2699              pub static ECONNREFUSED : c_int = 61;
 2700              pub static ELOOP : c_int = 62;
 2701              pub static ENAMETOOLONG : c_int = 63;
 2702              pub static EHOSTDOWN : c_int = 64;
 2703              pub static EHOSTUNREACH : c_int = 65;
 2704              pub static ENOTEMPTY : c_int = 66;
 2705              pub static EPROCLIM : c_int = 67;
 2706              pub static EUSERS : c_int = 68;
 2707              pub static EDQUOT : c_int = 69;
 2708              pub static ESTALE : c_int = 70;
 2709              pub static EREMOTE : c_int = 71;
 2710              pub static EBADRPC : c_int = 72;
 2711              pub static ERPCMISMATCH : c_int = 73;
 2712              pub static EPROGUNAVAIL : c_int = 74;
 2713              pub static EPROGMISMATCH : c_int = 75;
 2714              pub static EPROCUNAVAIL : c_int = 76;
 2715              pub static ENOLCK : c_int = 77;
 2716              pub static ENOSYS : c_int = 78;
 2717              pub static EFTYPE : c_int = 79;
 2718              pub static EAUTH : c_int = 80;
 2719              pub static ENEEDAUTH : c_int = 81;
 2720              pub static EIDRM : c_int = 82;
 2721              pub static ENOMSG : c_int = 83;
 2722              pub static EOVERFLOW : c_int = 84;
 2723              pub static ECANCELED : c_int = 85;
 2724              pub static EILSEQ : c_int = 86;
 2725              pub static ENOATTR : c_int = 87;
 2726              pub static EDOOFUS : c_int = 88;
 2727              pub static EBADMSG : c_int = 89;
 2728              pub static EMULTIHOP : c_int = 90;
 2729              pub static ENOLINK : c_int = 91;
 2730              pub static EPROTO : c_int = 92;
 2731              pub static ENOMEDIUM : c_int = 93;
 2732              pub static EUNUSED94 : c_int = 94;
 2733              pub static EUNUSED95 : c_int = 95;
 2734              pub static EUNUSED96 : c_int = 96;
 2735              pub static EUNUSED97 : c_int = 97;
 2736              pub static EUNUSED98 : c_int = 98;
 2737              pub static EASYNC : c_int = 99;
 2738              pub static ELAST : c_int = 99;
 2739          }
 2740          pub mod posix01 {
 2741              use libc::types::os::arch::c95::{c_int, size_t};
 2742  
 2743              pub static SIGTRAP : c_int = 5;
 2744  
 2745              pub static GLOB_APPEND   : c_int = 0x0001;
 2746              pub static GLOB_DOOFFS   : c_int = 0x0002;
 2747              pub static GLOB_ERR      : c_int = 0x0004;
 2748              pub static GLOB_MARK     : c_int = 0x0008;
 2749              pub static GLOB_NOCHECK  : c_int = 0x0010;
 2750              pub static GLOB_NOSORT   : c_int = 0x0020;
 2751              pub static GLOB_NOESCAPE : c_int = 0x2000;
 2752  
 2753              pub static GLOB_NOSPACE  : c_int = -1;
 2754              pub static GLOB_ABORTED  : c_int = -2;
 2755              pub static GLOB_NOMATCH  : c_int = -3;
 2756  
 2757              pub static POSIX_MADV_NORMAL : c_int = 0;
 2758              pub static POSIX_MADV_RANDOM : c_int = 1;
 2759              pub static POSIX_MADV_SEQUENTIAL : c_int = 2;
 2760              pub static POSIX_MADV_WILLNEED : c_int = 3;
 2761              pub static POSIX_MADV_DONTNEED : c_int = 4;
 2762  
 2763              pub static _SC_IOV_MAX : c_int = 56;
 2764              pub static _SC_GETGR_R_SIZE_MAX : c_int = 70;
 2765              pub static _SC_GETPW_R_SIZE_MAX : c_int = 71;
 2766              pub static _SC_LOGIN_NAME_MAX : c_int = 73;
 2767              pub static _SC_MQ_PRIO_MAX : c_int = 75;
 2768              pub static _SC_THREAD_ATTR_STACKADDR : c_int = 82;
 2769              pub static _SC_THREAD_ATTR_STACKSIZE : c_int = 83;
 2770              pub static _SC_THREAD_DESTRUCTOR_ITERATIONS : c_int = 85;
 2771              pub static _SC_THREAD_KEYS_MAX : c_int = 86;
 2772              pub static _SC_THREAD_PRIO_INHERIT : c_int = 87;
 2773              pub static _SC_THREAD_PRIO_PROTECT : c_int = 88;
 2774              pub static _SC_THREAD_PRIORITY_SCHEDULING : c_int = 89;
 2775              pub static _SC_THREAD_PROCESS_SHARED : c_int = 90;
 2776              pub static _SC_THREAD_SAFE_FUNCTIONS : c_int = 91;
 2777              pub static _SC_THREAD_STACK_MIN : c_int = 93;
 2778              pub static _SC_THREAD_THREADS_MAX : c_int = 94;
 2779              pub static _SC_THREADS : c_int = 96;
 2780              pub static _SC_TTY_NAME_MAX : c_int = 101;
 2781              pub static _SC_ATEXIT_MAX : c_int = 107;
 2782              pub static _SC_XOPEN_CRYPT : c_int = 108;
 2783              pub static _SC_XOPEN_ENH_I18N : c_int = 109;
 2784              pub static _SC_XOPEN_LEGACY : c_int = 110;
 2785              pub static _SC_XOPEN_REALTIME : c_int = 111;
 2786              pub static _SC_XOPEN_REALTIME_THREADS : c_int = 112;
 2787              pub static _SC_XOPEN_SHM : c_int = 113;
 2788              pub static _SC_XOPEN_UNIX : c_int = 115;
 2789              pub static _SC_XOPEN_VERSION : c_int = 116;
 2790              pub static _SC_XOPEN_XCU_VERSION : c_int = 117;
 2791  
 2792              pub static PTHREAD_CREATE_JOINABLE: c_int = 0;
 2793              pub static PTHREAD_CREATE_DETACHED: c_int = 1;
 2794  
 2795              #[cfg(target_arch = "arm")]
 2796              pub static PTHREAD_STACK_MIN: size_t = 4096;
 2797  
 2798              #[cfg(target_arch = "mips")]
 2799              #[cfg(target_arch = "x86")]
 2800              #[cfg(target_arch = "x86_64")]
 2801              pub static PTHREAD_STACK_MIN: size_t = 2048;
 2802  
 2803              pub static CLOCK_REALTIME: c_int = 0;
 2804              pub static CLOCK_MONOTONIC: c_int = 4;
 2805          }
 2806          pub mod posix08 {
 2807          }
 2808          pub mod bsd44 {
 2809              use libc::types::os::arch::c95::c_int;
 2810  
 2811              pub static MADV_NORMAL : c_int = 0;
 2812              pub static MADV_RANDOM : c_int = 1;
 2813              pub static MADV_SEQUENTIAL : c_int = 2;
 2814              pub static MADV_WILLNEED : c_int = 3;
 2815              pub static MADV_DONTNEED : c_int = 4;
 2816              pub static MADV_FREE : c_int = 5;
 2817              pub static MADV_NOSYNC : c_int = 6;
 2818              pub static MADV_AUTOSYNC : c_int = 7;
 2819              pub static MADV_NOCORE : c_int = 8;
 2820              pub static MADV_CORE : c_int = 9;
 2821              pub static MADV_PROTECT : c_int = 10;
 2822  
 2823              pub static MINCORE_INCORE : c_int =  0x1;
 2824              pub static MINCORE_REFERENCED : c_int = 0x2;
 2825              pub static MINCORE_MODIFIED : c_int = 0x4;
 2826              pub static MINCORE_REFERENCED_OTHER : c_int = 0x8;
 2827              pub static MINCORE_MODIFIED_OTHER : c_int = 0x10;
 2828              pub static MINCORE_SUPER : c_int = 0x20;
 2829  
 2830              pub static AF_INET: c_int = 2;
 2831              pub static AF_INET6: c_int = 28;
 2832              pub static AF_UNIX: c_int = 1;
 2833              pub static SOCK_STREAM: c_int = 1;
 2834              pub static SOCK_DGRAM: c_int = 2;
 2835              pub static IPPROTO_TCP: c_int = 6;
 2836              pub static IPPROTO_IP: c_int = 0;
 2837              pub static IPPROTO_IPV6: c_int = 41;
 2838              pub static IP_MULTICAST_TTL: c_int = 10;
 2839              pub static IP_MULTICAST_LOOP: c_int = 11;
 2840              pub static IP_TTL: c_int = 4;
 2841              pub static IP_ADD_MEMBERSHIP: c_int = 12;
 2842              pub static IP_DROP_MEMBERSHIP: c_int = 13;
 2843              pub static IPV6_ADD_MEMBERSHIP: c_int = 12;
 2844              pub static IPV6_DROP_MEMBERSHIP: c_int = 13;
 2845  
 2846              pub static TCP_NODELAY: c_int = 1;
 2847              pub static TCP_KEEPIDLE: c_int = 256;
 2848              pub static SOL_SOCKET: c_int = 0xffff;
 2849              pub static SO_KEEPALIVE: c_int = 0x0008;
 2850              pub static SO_BROADCAST: c_int = 0x0020;
 2851              pub static SO_REUSEADDR: c_int = 0x0004;
 2852  
 2853              pub static SHUT_RD: c_int = 0;
 2854              pub static SHUT_WR: c_int = 1;
 2855              pub static SHUT_RDWR: c_int = 2;
 2856          }
 2857          pub mod extra {
 2858              use libc::types::os::arch::c95::c_int;
 2859  
 2860              pub static O_SYNC : c_int = 128;
 2861              pub static CTL_KERN: c_int = 1;
 2862              pub static KERN_PROC: c_int = 14;
 2863              pub static KERN_PROC_PATHNAME: c_int = 12;
 2864  
 2865              pub static MAP_COPY : c_int = 0x0002;
 2866              pub static MAP_RENAME : c_int = 0x0020;
 2867              pub static MAP_NORESERVE : c_int = 0x0040;
 2868              pub static MAP_HASSEMAPHORE : c_int = 0x0200;
 2869              pub static MAP_STACK : c_int = 0x0400;
 2870              pub static MAP_NOSYNC : c_int = 0x0800;
 2871              pub static MAP_NOCORE : c_int = 0x020000;
 2872          }
 2873          pub mod sysconf {
 2874              use libc::types::os::arch::c95::c_int;
 2875  
 2876              pub static _SC_ARG_MAX : c_int = 1;
 2877              pub static _SC_CHILD_MAX : c_int = 2;
 2878              pub static _SC_CLK_TCK : c_int = 3;
 2879              pub static _SC_NGROUPS_MAX : c_int = 4;
 2880              pub static _SC_OPEN_MAX : c_int = 5;
 2881              pub static _SC_JOB_CONTROL : c_int = 6;
 2882              pub static _SC_SAVED_IDS : c_int = 7;
 2883              pub static _SC_VERSION : c_int = 8;
 2884              pub static _SC_BC_BASE_MAX : c_int = 9;
 2885              pub static _SC_BC_DIM_MAX : c_int = 10;
 2886              pub static _SC_BC_SCALE_MAX : c_int = 11;
 2887              pub static _SC_BC_STRING_MAX : c_int = 12;
 2888              pub static _SC_COLL_WEIGHTS_MAX : c_int = 13;
 2889              pub static _SC_EXPR_NEST_MAX : c_int = 14;
 2890              pub static _SC_LINE_MAX : c_int = 15;
 2891              pub static _SC_RE_DUP_MAX : c_int = 16;
 2892              pub static _SC_2_VERSION : c_int = 17;
 2893              pub static _SC_2_C_BIND : c_int = 18;
 2894              pub static _SC_2_C_DEV : c_int = 19;
 2895              pub static _SC_2_CHAR_TERM : c_int = 20;
 2896              pub static _SC_2_FORT_DEV : c_int = 21;
 2897              pub static _SC_2_FORT_RUN : c_int = 22;
 2898              pub static _SC_2_LOCALEDEF : c_int = 23;
 2899              pub static _SC_2_SW_DEV : c_int = 24;
 2900              pub static _SC_2_UPE : c_int = 25;
 2901              pub static _SC_STREAM_MAX : c_int = 26;
 2902              pub static _SC_TZNAME_MAX : c_int = 27;
 2903              pub static _SC_ASYNCHRONOUS_IO : c_int = 28;
 2904              pub static _SC_MAPPED_FILES : c_int = 29;
 2905              pub static _SC_MEMLOCK : c_int = 30;
 2906              pub static _SC_MEMLOCK_RANGE : c_int = 31;
 2907              pub static _SC_MEMORY_PROTECTION : c_int = 32;
 2908              pub static _SC_MESSAGE_PASSING : c_int = 33;
 2909              pub static _SC_PRIORITIZED_IO : c_int = 34;
 2910              pub static _SC_PRIORITY_SCHEDULING : c_int = 35;
 2911              pub static _SC_REALTIME_SIGNALS : c_int = 36;
 2912              pub static _SC_SEMAPHORES : c_int = 37;
 2913              pub static _SC_FSYNC : c_int = 38;
 2914              pub static _SC_SHARED_MEMORY_OBJECTS : c_int = 39;
 2915              pub static _SC_SYNCHRONIZED_IO : c_int = 40;
 2916              pub static _SC_TIMERS : c_int = 41;
 2917              pub static _SC_AIO_LISTIO_MAX : c_int = 42;
 2918              pub static _SC_AIO_MAX : c_int = 43;
 2919              pub static _SC_AIO_PRIO_DELTA_MAX : c_int = 44;
 2920              pub static _SC_DELAYTIMER_MAX : c_int = 45;
 2921              pub static _SC_MQ_OPEN_MAX : c_int = 46;
 2922              pub static _SC_PAGESIZE : c_int = 47;
 2923              pub static _SC_RTSIG_MAX : c_int = 48;
 2924              pub static _SC_SEM_NSEMS_MAX : c_int = 49;
 2925              pub static _SC_SEM_VALUE_MAX : c_int = 50;
 2926              pub static _SC_SIGQUEUE_MAX : c_int = 51;
 2927              pub static _SC_TIMER_MAX : c_int = 52;
 2928          }
 2929      }
 2930  
 2931      #[cfg(target_os = "macos")]
 2932      pub mod os {
 2933          pub mod c95 {
 2934              use libc::types::os::arch::c95::{c_int, c_uint};
 2935  
 2936              pub static EXIT_FAILURE : c_int = 1;
 2937              pub static EXIT_SUCCESS : c_int = 0;
 2938              pub static RAND_MAX : c_int = 2147483647;
 2939              pub static EOF : c_int = -1;
 2940              pub static SEEK_SET : c_int = 0;
 2941              pub static SEEK_CUR : c_int = 1;
 2942              pub static SEEK_END : c_int = 2;
 2943              pub static _IOFBF : c_int = 0;
 2944              pub static _IONBF : c_int = 2;
 2945              pub static _IOLBF : c_int = 1;
 2946              pub static BUFSIZ : c_uint = 1024_u32;
 2947              pub static FOPEN_MAX : c_uint = 20_u32;
 2948              pub static FILENAME_MAX : c_uint = 1024_u32;
 2949              pub static L_tmpnam : c_uint = 1024_u32;
 2950              pub static TMP_MAX : c_uint = 308915776_u32;
 2951          }
 2952          pub mod c99 {
 2953          }
 2954          pub mod posix88 {
 2955              use libc::types::common::c95::c_void;
 2956              use libc::types::os::arch::c95::c_int;
 2957  
 2958              pub static O_RDONLY : c_int = 0;
 2959              pub static O_WRONLY : c_int = 1;
 2960              pub static O_RDWR : c_int = 2;
 2961              pub static O_APPEND : c_int = 8;
 2962              pub static O_CREAT : c_int = 512;
 2963              pub static O_EXCL : c_int = 2048;
 2964              pub static O_TRUNC : c_int = 1024;
 2965              pub static S_IFIFO : c_int = 4096;
 2966              pub static S_IFCHR : c_int = 8192;
 2967              pub static S_IFBLK : c_int = 24576;
 2968              pub static S_IFDIR : c_int = 16384;
 2969              pub static S_IFREG : c_int = 32768;
 2970              pub static S_IFLNK : c_int = 40960;
 2971              pub static S_IFMT : c_int = 61440;
 2972              pub static S_IEXEC : c_int = 64;
 2973              pub static S_IWRITE : c_int = 128;
 2974              pub static S_IREAD : c_int = 256;
 2975              pub static S_IRWXU : c_int = 448;
 2976              pub static S_IXUSR : c_int = 64;
 2977              pub static S_IWUSR : c_int = 128;
 2978              pub static S_IRUSR : c_int = 256;
 2979              pub static F_OK : c_int = 0;
 2980              pub static R_OK : c_int = 4;
 2981              pub static W_OK : c_int = 2;
 2982              pub static X_OK : c_int = 1;
 2983              pub static STDIN_FILENO : c_int = 0;
 2984              pub static STDOUT_FILENO : c_int = 1;
 2985              pub static STDERR_FILENO : c_int = 2;
 2986              pub static F_LOCK : c_int = 1;
 2987              pub static F_TEST : c_int = 3;
 2988              pub static F_TLOCK : c_int = 2;
 2989              pub static F_ULOCK : c_int = 0;
 2990              pub static SIGHUP : c_int = 1;
 2991              pub static SIGINT : c_int = 2;
 2992              pub static SIGQUIT : c_int = 3;
 2993              pub static SIGILL : c_int = 4;
 2994              pub static SIGABRT : c_int = 6;
 2995              pub static SIGFPE : c_int = 8;
 2996              pub static SIGKILL : c_int = 9;
 2997              pub static SIGSEGV : c_int = 11;
 2998              pub static SIGPIPE : c_int = 13;
 2999              pub static SIGALRM : c_int = 14;
 3000              pub static SIGTERM : c_int = 15;
 3001  
 3002              pub static PROT_NONE : c_int = 0;
 3003              pub static PROT_READ : c_int = 1;
 3004              pub static PROT_WRITE : c_int = 2;
 3005              pub static PROT_EXEC : c_int = 4;
 3006  
 3007              pub static MAP_FILE : c_int = 0x0000;
 3008              pub static MAP_SHARED : c_int = 0x0001;
 3009              pub static MAP_PRIVATE : c_int = 0x0002;
 3010              pub static MAP_FIXED : c_int = 0x0010;
 3011              pub static MAP_ANON : c_int = 0x1000;
 3012              pub static MAP_STACK : c_int = 0;
 3013  
 3014              pub static MAP_FAILED : *c_void = -1 as *c_void;
 3015  
 3016              pub static MCL_CURRENT : c_int = 0x0001;
 3017              pub static MCL_FUTURE : c_int = 0x0002;
 3018  
 3019              pub static MS_ASYNC : c_int = 0x0001;
 3020              pub static MS_INVALIDATE : c_int = 0x0002;
 3021              pub static MS_SYNC : c_int = 0x0010;
 3022  
 3023              pub static MS_KILLPAGES : c_int = 0x0004;
 3024              pub static MS_DEACTIVATE : c_int = 0x0008;
 3025  
 3026              pub static EPERM : c_int = 1;
 3027              pub static ENOENT : c_int = 2;
 3028              pub static ESRCH : c_int = 3;
 3029              pub static EINTR : c_int = 4;
 3030              pub static EIO : c_int = 5;
 3031              pub static ENXIO : c_int = 6;
 3032              pub static E2BIG : c_int = 7;
 3033              pub static ENOEXEC : c_int = 8;
 3034              pub static EBADF : c_int = 9;
 3035              pub static ECHILD : c_int = 10;
 3036              pub static EDEADLK : c_int = 11;
 3037              pub static ENOMEM : c_int = 12;
 3038              pub static EACCES : c_int = 13;
 3039              pub static EFAULT : c_int = 14;
 3040              pub static ENOTBLK : c_int = 15;
 3041              pub static EBUSY : c_int = 16;
 3042              pub static EEXIST : c_int = 17;
 3043              pub static EXDEV : c_int = 18;
 3044              pub static ENODEV : c_int = 19;
 3045              pub static ENOTDIR : c_int = 20;
 3046              pub static EISDIR : c_int = 21;
 3047              pub static EINVAL : c_int = 22;
 3048              pub static ENFILE : c_int = 23;
 3049              pub static EMFILE : c_int = 24;
 3050              pub static ENOTTY : c_int = 25;
 3051              pub static ETXTBSY : c_int = 26;
 3052              pub static EFBIG : c_int = 27;
 3053              pub static ENOSPC : c_int = 28;
 3054              pub static ESPIPE : c_int = 29;
 3055              pub static EROFS : c_int = 30;
 3056              pub static EMLINK : c_int = 31;
 3057              pub static EPIPE : c_int = 32;
 3058              pub static EDOM : c_int = 33;
 3059              pub static ERANGE : c_int = 34;
 3060              pub static EAGAIN : c_int = 35;
 3061              pub static EWOULDBLOCK : c_int = EAGAIN;
 3062              pub static EINPROGRESS : c_int = 36;
 3063              pub static EALREADY : c_int = 37;
 3064              pub static ENOTSOCK : c_int = 38;
 3065              pub static EDESTADDRREQ : c_int = 39;
 3066              pub static EMSGSIZE : c_int = 40;
 3067              pub static EPROTOTYPE : c_int = 41;
 3068              pub static ENOPROTOOPT : c_int = 42;
 3069              pub static EPROTONOSUPPORT : c_int = 43;
 3070              pub static ESOCKTNOSUPPORT : c_int = 44;
 3071              pub static ENOTSUP : c_int = 45;
 3072              pub static EPFNOSUPPORT : c_int = 46;
 3073              pub static EAFNOSUPPORT : c_int = 47;
 3074              pub static EADDRINUSE : c_int = 48;
 3075              pub static EADDRNOTAVAIL : c_int = 49;
 3076              pub static ENETDOWN : c_int = 50;
 3077              pub static ENETUNREACH : c_int = 51;
 3078              pub static ENETRESET : c_int = 52;
 3079              pub static ECONNABORTED : c_int = 53;
 3080              pub static ECONNRESET : c_int = 54;
 3081              pub static ENOBUFS : c_int = 55;
 3082              pub static EISCONN : c_int = 56;
 3083              pub static ENOTCONN : c_int = 57;
 3084              pub static ESHUTDOWN : c_int = 58;
 3085              pub static ETOOMANYREFS : c_int = 59;
 3086              pub static ETIMEDOUT : c_int = 60;
 3087              pub static ECONNREFUSED : c_int = 61;
 3088              pub static ELOOP : c_int = 62;
 3089              pub static ENAMETOOLONG : c_int = 63;
 3090              pub static EHOSTDOWN : c_int = 64;
 3091              pub static EHOSTUNREACH : c_int = 65;
 3092              pub static ENOTEMPTY : c_int = 66;
 3093              pub static EPROCLIM : c_int = 67;
 3094              pub static EUSERS : c_int = 68;
 3095              pub static EDQUOT : c_int = 69;
 3096              pub static ESTALE : c_int = 70;
 3097              pub static EREMOTE : c_int = 71;
 3098              pub static EBADRPC : c_int = 72;
 3099              pub static ERPCMISMATCH : c_int = 73;
 3100              pub static EPROGUNAVAIL : c_int = 74;
 3101              pub static EPROGMISMATCH : c_int = 75;
 3102              pub static EPROCUNAVAIL : c_int = 76;
 3103              pub static ENOLCK : c_int = 77;
 3104              pub static ENOSYS : c_int = 78;
 3105              pub static EFTYPE : c_int = 79;
 3106              pub static EAUTH : c_int = 80;
 3107              pub static ENEEDAUTH : c_int = 81;
 3108              pub static EPWROFF : c_int = 82;
 3109              pub static EDEVERR : c_int = 83;
 3110              pub static EOVERFLOW : c_int = 84;
 3111              pub static EBADEXEC : c_int = 85;
 3112              pub static EBADARCH : c_int = 86;
 3113              pub static ESHLIBVERS : c_int = 87;
 3114              pub static EBADMACHO : c_int = 88;
 3115              pub static ECANCELED : c_int = 89;
 3116              pub static EIDRM : c_int = 90;
 3117              pub static ENOMSG : c_int = 91;
 3118              pub static EILSEQ : c_int = 92;
 3119              pub static ENOATTR : c_int = 93;
 3120              pub static EBADMSG : c_int = 94;
 3121              pub static EMULTIHOP : c_int = 95;
 3122              pub static ENODATA : c_int = 96;
 3123              pub static ENOLINK : c_int = 97;
 3124              pub static ENOSR : c_int = 98;
 3125              pub static ENOSTR : c_int = 99;
 3126              pub static EPROTO : c_int = 100;
 3127              pub static ETIME : c_int = 101;
 3128              pub static EOPNOTSUPP : c_int = 102;
 3129              pub static ENOPOLICY : c_int = 103;
 3130              pub static ENOTRECOVERABLE : c_int = 104;
 3131              pub static EOWNERDEAD : c_int = 105;
 3132              pub static EQFULL : c_int = 106;
 3133              pub static ELAST : c_int = 106;
 3134          }
 3135          pub mod posix01 {
 3136              use libc::types::os::arch::c95::{c_int, size_t};
 3137  
 3138              pub static SIGTRAP : c_int = 5;
 3139  
 3140              pub static GLOB_APPEND   : c_int = 0x0001;
 3141              pub static GLOB_DOOFFS   : c_int = 0x0002;
 3142              pub static GLOB_ERR      : c_int = 0x0004;
 3143              pub static GLOB_MARK     : c_int = 0x0008;
 3144              pub static GLOB_NOCHECK  : c_int = 0x0010;
 3145              pub static GLOB_NOSORT   : c_int = 0x0020;
 3146              pub static GLOB_NOESCAPE : c_int = 0x2000;
 3147  
 3148              pub static GLOB_NOSPACE  : c_int = -1;
 3149              pub static GLOB_ABORTED  : c_int = -2;
 3150              pub static GLOB_NOMATCH  : c_int = -3;
 3151  
 3152              pub static POSIX_MADV_NORMAL : c_int = 0;
 3153              pub static POSIX_MADV_RANDOM : c_int = 1;
 3154              pub static POSIX_MADV_SEQUENTIAL : c_int = 2;
 3155              pub static POSIX_MADV_WILLNEED : c_int = 3;
 3156              pub static POSIX_MADV_DONTNEED : c_int = 4;
 3157  
 3158              pub static _SC_IOV_MAX : c_int = 56;
 3159              pub static _SC_GETGR_R_SIZE_MAX : c_int = 70;
 3160              pub static _SC_GETPW_R_SIZE_MAX : c_int = 71;
 3161              pub static _SC_LOGIN_NAME_MAX : c_int = 73;
 3162              pub static _SC_MQ_PRIO_MAX : c_int = 75;
 3163              pub static _SC_THREAD_ATTR_STACKADDR : c_int = 82;
 3164              pub static _SC_THREAD_ATTR_STACKSIZE : c_int = 83;
 3165              pub static _SC_THREAD_DESTRUCTOR_ITERATIONS : c_int = 85;
 3166              pub static _SC_THREAD_KEYS_MAX : c_int = 86;
 3167              pub static _SC_THREAD_PRIO_INHERIT : c_int = 87;
 3168              pub static _SC_THREAD_PRIO_PROTECT : c_int = 88;
 3169              pub static _SC_THREAD_PRIORITY_SCHEDULING : c_int = 89;
 3170              pub static _SC_THREAD_PROCESS_SHARED : c_int = 90;
 3171              pub static _SC_THREAD_SAFE_FUNCTIONS : c_int = 91;
 3172              pub static _SC_THREAD_STACK_MIN : c_int = 93;
 3173              pub static _SC_THREAD_THREADS_MAX : c_int = 94;
 3174              pub static _SC_THREADS : c_int = 96;
 3175              pub static _SC_TTY_NAME_MAX : c_int = 101;
 3176              pub static _SC_ATEXIT_MAX : c_int = 107;
 3177              pub static _SC_XOPEN_CRYPT : c_int = 108;
 3178              pub static _SC_XOPEN_ENH_I18N : c_int = 109;
 3179              pub static _SC_XOPEN_LEGACY : c_int = 110;
 3180              pub static _SC_XOPEN_REALTIME : c_int = 111;
 3181              pub static _SC_XOPEN_REALTIME_THREADS : c_int = 112;
 3182              pub static _SC_XOPEN_SHM : c_int = 113;
 3183              pub static _SC_XOPEN_UNIX : c_int = 115;
 3184              pub static _SC_XOPEN_VERSION : c_int = 116;
 3185              pub static _SC_XOPEN_XCU_VERSION : c_int = 121;
 3186  
 3187              pub static PTHREAD_CREATE_JOINABLE: c_int = 1;
 3188              pub static PTHREAD_CREATE_DETACHED: c_int = 2;
 3189              pub static PTHREAD_STACK_MIN: size_t = 8192;
 3190          }
 3191          pub mod posix08 {
 3192          }
 3193          pub mod bsd44 {
 3194              use libc::types::os::arch::c95::c_int;
 3195  
 3196              pub static MADV_NORMAL : c_int = 0;
 3197              pub static MADV_RANDOM : c_int = 1;
 3198              pub static MADV_SEQUENTIAL : c_int = 2;
 3199              pub static MADV_WILLNEED : c_int = 3;
 3200              pub static MADV_DONTNEED : c_int = 4;
 3201              pub static MADV_FREE : c_int = 5;
 3202              pub static MADV_ZERO_WIRED_PAGES : c_int = 6;
 3203              pub static MADV_FREE_REUSABLE : c_int = 7;
 3204              pub static MADV_FREE_REUSE : c_int = 8;
 3205              pub static MADV_CAN_REUSE : c_int = 9;
 3206  
 3207              pub static MINCORE_INCORE : c_int =  0x1;
 3208              pub static MINCORE_REFERENCED : c_int = 0x2;
 3209              pub static MINCORE_MODIFIED : c_int = 0x4;
 3210              pub static MINCORE_REFERENCED_OTHER : c_int = 0x8;
 3211              pub static MINCORE_MODIFIED_OTHER : c_int = 0x10;
 3212  
 3213              pub static AF_UNIX: c_int = 1;
 3214              pub static AF_INET: c_int = 2;
 3215              pub static AF_INET6: c_int = 30;
 3216              pub static SOCK_STREAM: c_int = 1;
 3217              pub static SOCK_DGRAM: c_int = 2;
 3218              pub static IPPROTO_TCP: c_int = 6;
 3219              pub static IPPROTO_IP: c_int = 0;
 3220              pub static IPPROTO_IPV6: c_int = 41;
 3221              pub static IP_MULTICAST_TTL: c_int = 10;
 3222              pub static IP_MULTICAST_LOOP: c_int = 11;
 3223              pub static IP_TTL: c_int = 4;
 3224              pub static IP_ADD_MEMBERSHIP: c_int = 12;
 3225              pub static IP_DROP_MEMBERSHIP: c_int = 13;
 3226              pub static IPV6_ADD_MEMBERSHIP: c_int = 12;
 3227              pub static IPV6_DROP_MEMBERSHIP: c_int = 13;
 3228  
 3229              pub static TCP_NODELAY: c_int = 0x01;
 3230              pub static TCP_KEEPALIVE: c_int = 0x10;
 3231              pub static SOL_SOCKET: c_int = 0xffff;
 3232              pub static SO_KEEPALIVE: c_int = 0x0008;
 3233              pub static SO_BROADCAST: c_int = 0x0020;
 3234              pub static SO_REUSEADDR: c_int = 0x0004;
 3235  
 3236              pub static SHUT_RD: c_int = 0;
 3237              pub static SHUT_WR: c_int = 1;
 3238              pub static SHUT_RDWR: c_int = 2;
 3239          }
 3240          pub mod extra {
 3241              use libc::types::os::arch::c95::c_int;
 3242  
 3243              pub static O_DSYNC : c_int = 4194304;
 3244              pub static O_SYNC : c_int = 128;
 3245              pub static F_FULLFSYNC : c_int = 51;
 3246  
 3247              pub static MAP_COPY : c_int = 0x0002;
 3248              pub static MAP_RENAME : c_int = 0x0020;
 3249              pub static MAP_NORESERVE : c_int = 0x0040;
 3250              pub static MAP_NOEXTEND : c_int = 0x0100;
 3251              pub static MAP_HASSEMAPHORE : c_int = 0x0200;
 3252              pub static MAP_NOCACHE : c_int = 0x0400;
 3253              pub static MAP_JIT : c_int = 0x0800;
 3254          }
 3255          pub mod sysconf {
 3256              use libc::types::os::arch::c95::c_int;
 3257  
 3258              pub static _SC_ARG_MAX : c_int = 1;
 3259              pub static _SC_CHILD_MAX : c_int = 2;
 3260              pub static _SC_CLK_TCK : c_int = 3;
 3261              pub static _SC_NGROUPS_MAX : c_int = 4;
 3262              pub static _SC_OPEN_MAX : c_int = 5;
 3263              pub static _SC_JOB_CONTROL : c_int = 6;
 3264              pub static _SC_SAVED_IDS : c_int = 7;
 3265              pub static _SC_VERSION : c_int = 8;
 3266              pub static _SC_BC_BASE_MAX : c_int = 9;
 3267              pub static _SC_BC_DIM_MAX : c_int = 10;
 3268              pub static _SC_BC_SCALE_MAX : c_int = 11;
 3269              pub static _SC_BC_STRING_MAX : c_int = 12;
 3270              pub static _SC_COLL_WEIGHTS_MAX : c_int = 13;
 3271              pub static _SC_EXPR_NEST_MAX : c_int = 14;
 3272              pub static _SC_LINE_MAX : c_int = 15;
 3273              pub static _SC_RE_DUP_MAX : c_int = 16;
 3274              pub static _SC_2_VERSION : c_int = 17;
 3275              pub static _SC_2_C_BIND : c_int = 18;
 3276              pub static _SC_2_C_DEV : c_int = 19;
 3277              pub static _SC_2_CHAR_TERM : c_int = 20;
 3278              pub static _SC_2_FORT_DEV : c_int = 21;
 3279              pub static _SC_2_FORT_RUN : c_int = 22;
 3280              pub static _SC_2_LOCALEDEF : c_int = 23;
 3281              pub static _SC_2_SW_DEV : c_int = 24;
 3282              pub static _SC_2_UPE : c_int = 25;
 3283              pub static _SC_STREAM_MAX : c_int = 26;
 3284              pub static _SC_TZNAME_MAX : c_int = 27;
 3285              pub static _SC_ASYNCHRONOUS_IO : c_int = 28;
 3286              pub static _SC_PAGESIZE : c_int = 29;
 3287              pub static _SC_MEMLOCK : c_int = 30;
 3288              pub static _SC_MEMLOCK_RANGE : c_int = 31;
 3289              pub static _SC_MEMORY_PROTECTION : c_int = 32;
 3290              pub static _SC_MESSAGE_PASSING : c_int = 33;
 3291              pub static _SC_PRIORITIZED_IO : c_int = 34;
 3292              pub static _SC_PRIORITY_SCHEDULING : c_int = 35;
 3293              pub static _SC_REALTIME_SIGNALS : c_int = 36;
 3294              pub static _SC_SEMAPHORES : c_int = 37;
 3295              pub static _SC_FSYNC : c_int = 38;
 3296              pub static _SC_SHARED_MEMORY_OBJECTS : c_int = 39;
 3297              pub static _SC_SYNCHRONIZED_IO : c_int = 40;
 3298              pub static _SC_TIMERS : c_int = 41;
 3299              pub static _SC_AIO_LISTIO_MAX : c_int = 42;
 3300              pub static _SC_AIO_MAX : c_int = 43;
 3301              pub static _SC_AIO_PRIO_DELTA_MAX : c_int = 44;
 3302              pub static _SC_DELAYTIMER_MAX : c_int = 45;
 3303              pub static _SC_MQ_OPEN_MAX : c_int = 46;
 3304              pub static _SC_MAPPED_FILES : c_int = 47;
 3305              pub static _SC_RTSIG_MAX : c_int = 48;
 3306              pub static _SC_SEM_NSEMS_MAX : c_int = 49;
 3307              pub static _SC_SEM_VALUE_MAX : c_int = 50;
 3308              pub static _SC_SIGQUEUE_MAX : c_int = 51;
 3309              pub static _SC_TIMER_MAX : c_int = 52;
 3310              pub static _SC_XBS5_ILP32_OFF32 : c_int = 122;
 3311              pub static _SC_XBS5_ILP32_OFFBIG : c_int = 123;
 3312              pub static _SC_XBS5_LP64_OFF64 : c_int = 124;
 3313              pub static _SC_XBS5_LPBIG_OFFBIG : c_int = 125;
 3314          }
 3315      }
 3316  }
 3317  
 3318  
 3319  pub mod funcs {
 3320      // Thankfull most of c95 is universally available and does not vary by OS
 3321      // or anything. The same is not true of POSIX.
 3322  
 3323      pub mod c95 {
 3324          pub mod ctype {
 3325              use libc::types::os::arch::c95::{c_char, c_int};
 3326  
 3327              extern {
 3328                  pub fn isalnum(cc_int) -> c_int;
 3329                  pub fn isalpha(cc_int) -> c_int;
 3330                  pub fn iscntrl(cc_int) -> c_int;
 3331                  pub fn isdigit(cc_int) -> c_int;
 3332                  pub fn isgraph(cc_int) -> c_int;
 3333                  pub fn islower(cc_int) -> c_int;
 3334                  pub fn isprint(cc_int) -> c_int;
 3335                  pub fn ispunct(cc_int) -> c_int;
 3336                  pub fn isspace(cc_int) -> c_int;
 3337                  pub fn isupper(cc_int) -> c_int;
 3338                  pub fn isxdigit(cc_int) -> c_int;
 3339                  pub fn tolower(cc_char) -> c_char;
 3340                  pub fn toupper(cc_char) -> c_char;
 3341              }
 3342          }
 3343  
 3344          pub mod stdio {
 3345              use libc::types::common::c95::{FILE, c_void, fpos_t};
 3346              use libc::types::os::arch::c95::{c_char, c_int, c_long, size_t};
 3347  
 3348              extern {
 3349                  pub fn fopen(filename*c_char, mode*c_char) -> *FILE;
 3350                  pub fn freopen(filename*c_char, mode*c_char, file*FILE)
 3351                                 -> *FILE;
 3352                  pub fn fflush(file*FILE) -> c_int;
 3353                  pub fn fclose(file*FILE) -> c_int;
 3354                  pub fn remove(filename*c_char) -> c_int;
 3355                  pub fn rename(oldname*c_char, newname*c_char) -> c_int;
 3356                  pub fn tmpfile() -> *FILE;
 3357                  pub fn setvbuf(stream*FILE,
 3358                                 buffer*c_char,
 3359                                 modec_int,
 3360                                 sizesize_t)
 3361                                 -> c_int;
 3362                  pub fn setbuf(stream*FILE, buf*c_char);
 3363                  // Omitted: printf and scanf variants.
 3364                  pub fn fgetc(stream*FILE) -> c_int;
 3365                  pub fn fgets(buf*mut c_char, nc_int, stream*FILE)
 3366                               -> *c_char;
 3367                  pub fn fputc(cc_int, stream*FILE) -> c_int;
 3368                  pub fn fputs(s*c_char, stream*FILE) -> *c_char;
 3369                  // Omitted: getc, getchar (might be macros).
 3370  
 3371                  // Omitted: gets, so ridiculously unsafe that it should not
 3372                  // survive.
 3373  
 3374                  // Omitted: putc, putchar (might be macros).
 3375                  pub fn puts(s*c_char) -> c_int;
 3376                  pub fn ungetc(cc_int, stream*FILE) -> c_int;
 3377                  pub fn fread(ptr*mut c_void,
 3378                               sizesize_t,
 3379                               nobjsize_t,
 3380                               stream*FILE)
 3381                               -> size_t;
 3382                  pub fn fwrite(ptr*c_void,
 3383                                sizesize_t,
 3384                                nobjsize_t,
 3385                                stream*FILE)
 3386                                -> size_t;
 3387                  pub fn fseek(stream*FILE, offsetc_long, whencec_int)
 3388                               -> c_int;
 3389                  pub fn ftell(stream*FILE) -> c_long;
 3390                  pub fn rewind(stream*FILE);
 3391                  pub fn fgetpos(stream*FILE, ptr*fpos_t) -> c_int;
 3392                  pub fn fsetpos(stream*FILE, ptr*fpos_t) -> c_int;
 3393                  pub fn feof(stream*FILE) -> c_int;
 3394                  pub fn ferror(stream*FILE) -> c_int;
 3395                  pub fn perror(s*c_char);
 3396              }
 3397          }
 3398  
 3399          pub mod stdlib {
 3400              use libc::types::common::c95::c_void;
 3401              use libc::types::os::arch::c95::{c_char, c_double, c_int};
 3402              use libc::types::os::arch::c95::{c_long, c_uint, c_ulong};
 3403              use libc::types::os::arch::c95::{size_t};
 3404  
 3405              extern {
 3406                  pub fn abs(ic_int) -> c_int;
 3407                  pub fn labs(ic_long) -> c_long;
 3408                  // Omitted: div, ldiv (return pub type incomplete).
 3409                  pub fn atof(s*c_char) -> c_double;
 3410                  pub fn atoi(s*c_char) -> c_int;
 3411                  pub fn strtod(s*c_char, endp**c_char) -> c_double;
 3412                  pub fn strtol(s*c_char, endp**c_char, basec_int)
 3413                                -> c_long;
 3414                  pub fn strtoul(s*c_char, endp**c_char, basec_int)
 3415                                 -> c_ulong;
 3416                  pub fn calloc(nobjsize_t, sizesize_t) -> *c_void;
 3417                  pub fn malloc(sizesize_t) -> *mut c_void;
 3418                  pub fn realloc(p*mut c_void, sizesize_t) -> *mut c_void;
 3419                  pub fn free(p*mut c_void);
 3420                  pub fn exit(statusc_int) -> !;
 3421                  pub fn _exit(statusc_int) -> !;
 3422                  // Omitted: atexit.
 3423                  pub fn system(s*c_char) -> c_int;
 3424                  pub fn getenv(s*c_char) -> *c_char;
 3425                  // Omitted: bsearch, qsort
 3426                  pub fn rand() -> c_int;
 3427                  pub fn srand(seedc_uint);
 3428              }
 3429          }
 3430  
 3431          pub mod string {
 3432              use libc::types::common::c95::c_void;
 3433              use libc::types::os::arch::c95::{c_char, c_int, size_t};
 3434              use libc::types::os::arch::c95::{wchar_t};
 3435  
 3436              extern {
 3437                  pub fn strcpy(dst*c_char, src*c_char) -> *c_char;
 3438                  pub fn strncpy(dst*c_char, src*c_char, nsize_t)
 3439                                 -> *c_char;
 3440                  pub fn strcat(s*c_char, ct*c_char) -> *c_char;
 3441                  pub fn strncat(s*c_char, ct*c_char, nsize_t) -> *c_char;
 3442                  pub fn strcmp(cs*c_char, ct*c_char) -> c_int;
 3443                  pub fn strncmp(cs*c_char, ct*c_char, nsize_t) -> c_int;
 3444                  pub fn strcoll(cs*c_char, ct*c_char) -> c_int;
 3445                  pub fn strchr(cs*c_char, cc_int) -> *c_char;
 3446                  pub fn strrchr(cs*c_char, cc_int) -> *c_char;
 3447                  pub fn strspn(cs*c_char, ct*c_char) -> size_t;
 3448                  pub fn strcspn(cs*c_char, ct*c_char) -> size_t;
 3449                  pub fn strpbrk(cs*c_char, ct*c_char) -> *c_char;
 3450                  pub fn strstr(cs*c_char, ct*c_char) -> *c_char;
 3451                  pub fn strlen(cs*c_char) -> size_t;
 3452                  pub fn strerror(nc_int) -> *c_char;
 3453                  pub fn strtok(s*c_char, t*c_char) -> *c_char;
 3454                  pub fn strxfrm(s*c_char, ct*c_char, nsize_t) -> size_t;
 3455                  pub fn wcslen(buf*wchar_t) -> size_t;
 3456  
 3457                  // Omitted: memcpy, memmove, memset (provided by LLVM)
 3458  
 3459                  // These are fine to execute on the Rust stack. They must be,
 3460                  // in fact, because LLVM generates calls to them!
 3461                  pub fn memcmp(cx*c_void, ct*c_void, nsize_t) -> c_int;
 3462                  pub fn memchr(cx*c_void, cc_int, nsize_t) -> *c_void;
 3463              }
 3464          }
 3465      }
 3466  
 3467      // Microsoft helpfully underscore-qualifies all of its POSIX-like symbols
 3468      // to make sure you don't use them accidentally. It also randomly deviates
 3469      // from the exact signatures you might otherwise expect, and omits much,
 3470      // so be careful when trying to write portable code; it won't always work
 3471      // with the same POSIX functions and types as other platforms.
 3472  
 3473      #[cfg(target_os = "win32")]
 3474      pub mod posix88 {
 3475          pub mod stat_ {
 3476              use libc::types::os::common::posix01::{stat, utimbuf};
 3477              use libc::types::os::arch::c95::{c_int, c_char, wchar_t};
 3478  
 3479              extern {
 3480                  #[link_name = "_chmod"]
 3481                  pub fn chmod(path: *c_char, mode: c_int) -> c_int;
 3482                  #[link_name = "_wchmod"]
 3483                  pub fn wchmod(path: *wchar_t, mode: c_int) -> c_int;
 3484                  #[link_name = "_mkdir"]
 3485                  pub fn mkdir(path: *c_char) -> c_int;
 3486                  #[link_name = "_wrmdir"]
 3487                  pub fn wrmdir(path: *wchar_t) -> c_int;
 3488                  #[link_name = "_fstat64"]
 3489                  pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
 3490                  #[link_name = "_stat64"]
 3491                  pub fn stat(path: *c_char, buf: *mut stat) -> c_int;
 3492                  #[link_name = "_wstat64"]
 3493                  pub fn wstat(path: *wchar_t, buf: *mut stat) -> c_int;
 3494                  #[link_name = "_wutime64"]
 3495                  pub fn wutime(file: *wchar_t, buf: *utimbuf) -> c_int;
 3496              }
 3497          }
 3498  
 3499          pub mod stdio {
 3500              use libc::types::common::c95::FILE;
 3501              use libc::types::os::arch::c95::{c_int, c_char};
 3502  
 3503              extern {
 3504                  #[link_name = "_popen"]
 3505                  pub fn popen(command: *c_char, mode: *c_char) -> *FILE;
 3506                  #[link_name = "_pclose"]
 3507                  pub fn pclose(stream: *FILE) -> c_int;
 3508                  #[link_name = "_fdopen"]
 3509                  pub fn fdopen(fd: c_int, mode: *c_char) -> *FILE;
 3510                  #[link_name = "_fileno"]
 3511                  pub fn fileno(stream: *FILE) -> c_int;
 3512              }
 3513          }
 3514  
 3515          pub mod fcntl {
 3516              use libc::types::os::arch::c95::{c_int, c_char, wchar_t};
 3517              extern {
 3518                  #[link_name = "_open"]
 3519                  pub fn open(path: *c_char, oflag: c_int, mode: c_int)
 3520                              -> c_int;
 3521                  #[link_name = "_wopen"]
 3522                  pub fn wopen(path: *wchar_t, oflag: c_int, mode: c_int)
 3523                              -> c_int;
 3524                  #[link_name = "_creat"]
 3525                  pub fn creat(path: *c_char, mode: c_int) -> c_int;
 3526              }
 3527          }
 3528  
 3529          pub mod dirent {
 3530              // Not supplied at all.
 3531          }
 3532  
 3533          pub mod unistd {
 3534              use libc::types::common::c95::c_void;
 3535              use libc::types::os::arch::c95::{c_int, c_uint, c_char,
 3536                                               c_long, size_t};
 3537              use libc::types::os::arch::c99::intptr_t;
 3538  
 3539              extern {
 3540                  #[link_name = "_access"]
 3541                  pub fn access(path: *c_char, amode: c_int) -> c_int;
 3542                  #[link_name = "_chdir"]
 3543                  pub fn chdir(dir: *c_char) -> c_int;
 3544                  #[link_name = "_close"]
 3545                  pub fn close(fd: c_int) -> c_int;
 3546                  #[link_name = "_dup"]
 3547                  pub fn dup(fd: c_int) -> c_int;
 3548                  #[link_name = "_dup2"]
 3549                  pub fn dup2(src: c_int, dst: c_int) -> c_int;
 3550                  #[link_name = "_execv"]
 3551                  pub fn execv(prog: *c_char, argv: **c_char) -> intptr_t;
 3552                  #[link_name = "_execve"]
 3553                  pub fn execve(prog: *c_char, argv: **c_char, envp: **c_char)
 3554                                -> c_int;
 3555                  #[link_name = "_execvp"]
 3556                  pub fn execvp(c: *c_char, argv: **c_char) -> c_int;
 3557                  #[link_name = "_execvpe"]
 3558                  pub fn execvpe(c: *c_char, argv: **c_char, envp: **c_char)
 3559                                 -> c_int;
 3560                  #[link_name = "_getcwd"]
 3561                  pub fn getcwd(buf: *mut c_char, size: size_t) -> *c_char;
 3562                  #[link_name = "_getpid"]
 3563                  pub fn getpid() -> c_int;
 3564                  #[link_name = "_isatty"]
 3565                  pub fn isatty(fd: c_int) -> c_int;
 3566                  #[link_name = "_lseek"]
 3567                  pub fn lseek(fd: c_int, offset: c_long, origin: c_int)
 3568                               -> c_long;
 3569                  #[link_name = "_pipe"]
 3570                  pub fn pipe(fds: *mut c_int, psize: c_uint, textmode: c_int)
 3571                              -> c_int;
 3572                  #[link_name = "_read"]
 3573                  pub fn read(fd: c_int, buf: *mut c_void, count: c_uint)
 3574                              -> c_int;
 3575                  #[link_name = "_rmdir"]
 3576                  pub fn rmdir(path: *c_char) -> c_int;
 3577                  #[link_name = "_unlink"]
 3578                  pub fn unlink(c: *c_char) -> c_int;
 3579                  #[link_name = "_write"]
 3580                  pub fn write(fd: c_int, buf: *c_void, count: c_uint) -> c_int;
 3581              }
 3582          }
 3583  
 3584          pub mod mman {
 3585          }
 3586      }
 3587  
 3588  
 3589      #[cfg(target_os = "linux")]
 3590      #[cfg(target_os = "android")]
 3591      #[cfg(target_os = "macos")]
 3592      #[cfg(target_os = "freebsd")]
 3593      pub mod posix88 {
 3594          pub mod stat_ {
 3595              use libc::types::os::arch::c95::{c_char, c_int};
 3596              use libc::types::os::arch::posix01::stat;
 3597              use libc::types::os::arch::posix88::mode_t;
 3598  
 3599              extern {
 3600                  pub fn chmod(path*c_char, modemode_t) -> c_int;
 3601                  pub fn fchmod(fdc_int, modemode_t) -> c_int;
 3602  
 3603                  #[cfg(target_os = "linux")]
 3604                  #[cfg(target_os = "freebsd")]
 3605                  #[cfg(target_os = "android")]
 3606                  pub fn fstat(fildesc_int, buf*mut stat) -> c_int;
 3607  
 3608                  #[cfg(target_os = "macos")]
 3609                  #[link_name = "fstat64"]
 3610                  pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
 3611  
 3612                  pub fn mkdir(path*c_char, modemode_t) -> c_int;
 3613                  pub fn mkfifo(path*c_char, modemode_t) -> c_int;
 3614  
 3615                  #[cfg(target_os = "linux")]
 3616                  #[cfg(target_os = "freebsd")]
 3617                  #[cfg(target_os = "android")]
 3618                  pub fn stat(path*c_char, buf*mut stat) -> c_int;
 3619  
 3620                  #[cfg(target_os = "macos")]
 3621                  #[link_name = "stat64"]
 3622                  pub fn stat(path: *c_char, buf: *mut stat) -> c_int;
 3623              }
 3624          }
 3625  
 3626          pub mod stdio {
 3627              use libc::types::common::c95::FILE;
 3628              use libc::types::os::arch::c95::{c_char, c_int};
 3629  
 3630              extern {
 3631                  pub fn popen(command*c_char, mode*c_char) -> *FILE;
 3632                  pub fn pclose(stream*FILE) -> c_int;
 3633                  pub fn fdopen(fdc_int, mode*c_char) -> *FILE;
 3634                  pub fn fileno(stream*FILE) -> c_int;
 3635              }
 3636          }
 3637  
 3638          pub mod fcntl {
 3639              use libc::types::os::arch::c95::{c_char, c_int};
 3640              use libc::types::os::arch::posix88::mode_t;
 3641  
 3642              extern {
 3643                  pub fn open(path*c_char, oflagc_int, modec_int)
 3644                              -> c_int;
 3645                  pub fn creat(path*c_char, modemode_t) -> c_int;
 3646                  pub fn fcntl(fdc_int, cmdc_int, ...) -> c_int;
 3647              }
 3648          }
 3649  
 3650          pub mod dirent {
 3651              use libc::types::common::posix88::{DIR, dirent_t};
 3652              use libc::types::os::arch::c95::{c_char, c_int, c_long};
 3653  
 3654              // NB: On OS X opendir and readdir have two versions,
 3655              // one for 32-bit kernelspace and one for 64.
 3656              // We should be linking to the 64-bit ones, called
 3657              // opendir$INODE64, etc. but for some reason rustc
 3658              // doesn't link it correctly on i686, so we're going
 3659              // through a C function that mysteriously does work.
 3660              pub unsafe fn opendir(dirname*c_char) -> *DIR {
 3661                  rust_opendir(dirname)
 3662              }
 3663              pub unsafe fn readdir_r(dirp*DIR,
 3664                                      entry*mut dirent_t,
 3665                                      result*mut *mut dirent_t) -> c_int {
 3666                  rust_readdir_r(dirp, entry, result)
 3667              }
 3668  
 3669              extern {
 3670                  fn rust_opendir(dirname*c_char) -> *DIR;
 3671                  fn rust_readdir_r(dirp*DIR, entry*mut dirent_t,
 3672                                    result*mut *mut dirent_t) -> c_int;
 3673              }
 3674  
 3675              extern {
 3676                  pub fn closedir(dirp*DIR) -> c_int;
 3677                  pub fn rewinddir(dirp*DIR);
 3678                  pub fn seekdir(dirp*DIR, locc_long);
 3679                  pub fn telldir(dirp*DIR) -> c_long;
 3680              }
 3681          }
 3682  
 3683          pub mod unistd {
 3684              use libc::types::common::c95::c_void;
 3685              use libc::types::os::arch::c95::{c_char, c_int, c_long, c_uint};
 3686              use libc::types::os::arch::c95::{size_t};
 3687              use libc::types::os::common::posix01::timespec;
 3688              use libc::types::os::arch::posix01::utimbuf;
 3689              use libc::types::os::arch::posix88::{gid_t, off_t, pid_t};
 3690              use libc::types::os::arch::posix88::{ssize_t, uid_t};
 3691  
 3692              pub static _PC_NAME_MAX: c_int = 4;
 3693  
 3694              extern {
 3695                  pub fn access(path*c_char, amodec_int) -> c_int;
 3696                  pub fn alarm(secondsc_uint) -> c_uint;
 3697                  pub fn chdir(dir*c_char) -> c_int;
 3698                  pub fn chown(path*c_char, uiduid_t, gidgid_t) -> c_int;
 3699                  pub fn close(fdc_int) -> c_int;
 3700                  pub fn dup(fdc_int) -> c_int;
 3701                  pub fn dup2(srcc_int, dstc_int) -> c_int;
 3702                  pub fn execv(prog*c_char, argv**c_char) -> c_int;
 3703                  pub fn execve(prog*c_char, argv**c_char, envp**c_char)
 3704                                -> c_int;
 3705                  pub fn execvp(c*c_char, argv**c_char) -> c_int;
 3706                  pub fn fork() -> pid_t;
 3707                  pub fn fpathconf(filedesc_int, namec_int) -> c_long;
 3708                  pub fn getcwd(buf*mut c_char, sizesize_t) -> *c_char;
 3709                  pub fn getegid() -> gid_t;
 3710                  pub fn geteuid() -> uid_t;
 3711                  pub fn getgid() -> gid_t ;
 3712                  pub fn getgroups(ngroups_maxc_int, groups*mut gid_t)
 3713                                   -> c_int;
 3714                  pub fn getlogin() -> *c_char;
 3715                  pub fn getopt(argcc_int, argv**c_char, optstr*c_char)
 3716                                -> c_int;
 3717                  pub fn getpgrp() -> pid_t;
 3718                  pub fn getpid() -> pid_t;
 3719                  pub fn getppid() -> pid_t;
 3720                  pub fn getuid() -> uid_t;
 3721                  pub fn isatty(fdc_int) -> c_int;
 3722                  pub fn link(src*c_char, dst*c_char) -> c_int;
 3723                  pub fn lseek(fdc_int, offsetoff_t, whencec_int)
 3724                               -> off_t;
 3725                  pub fn pathconf(path*c_char, namec_int) -> c_long;
 3726                  pub fn pause() -> c_int;
 3727                  pub fn pipe(fds*mut c_int) -> c_int;
 3728                  pub fn read(fdc_int, buf*mut c_void, countsize_t)
 3729                              -> ssize_t;
 3730                  pub fn rmdir(path*c_char) -> c_int;
 3731                  pub fn setgid(gidgid_t) -> c_int;
 3732                  pub fn setpgid(pidpid_t, pgidpid_t) -> c_int;
 3733                  pub fn setsid() -> pid_t;
 3734                  pub fn setuid(uiduid_t) -> c_int;
 3735                  pub fn sleep(secsc_uint) -> c_uint;
 3736                  pub fn usleep(secsc_uint) -> c_int;
 3737                  pub fn nanosleep(rqtp*timespec, rmtp*mut timespec) -> c_int;
 3738                  pub fn sysconf(namec_int) -> c_long;
 3739                  pub fn tcgetpgrp(fdc_int) -> pid_t;
 3740                  pub fn ttyname(fdc_int) -> *c_char;
 3741                  pub fn unlink(c*c_char) -> c_int;
 3742                  pub fn write(fdc_int, buf*c_void, countsize_t)
 3743                               -> ssize_t;
 3744                  pub fn pread(fdc_int, buf*c_void, countsize_t,
 3745                               offsetoff_t) -> ssize_t;
 3746                  pub fn pwrite(fdc_int, buf*c_void, countsize_t,
 3747                                offsetoff_t) -> ssize_t;
 3748                  pub fn utime(file*c_char, buf*utimbuf) -> c_int;
 3749              }
 3750          }
 3751  
 3752          pub mod signal {
 3753              use libc::types::os::arch::c95::{c_int};
 3754              use libc::types::os::arch::posix88::{pid_t};
 3755  
 3756              extern {
 3757                  pub fn kill(pidpid_t, sigc_int) -> c_int;
 3758              }
 3759          }
 3760  
 3761          pub mod mman {
 3762              use libc::types::common::c95::{c_void};
 3763              use libc::types::os::arch::c95::{size_t, c_int, c_char};
 3764              use libc::types::os::arch::posix88::{mode_t, off_t};
 3765  
 3766              extern {
 3767                  pub fn mlock(addr*c_void, lensize_t) -> c_int;
 3768                  pub fn munlock(addr*c_void, lensize_t) -> c_int;
 3769                  pub fn mlockall(flagsc_int) -> c_int;
 3770                  pub fn munlockall() -> c_int;
 3771  
 3772                  pub fn mmap(addr*c_void,
 3773                              lensize_t,
 3774                              protc_int,
 3775                              flagsc_int,
 3776                              fdc_int,
 3777                              offsetoff_t)
 3778                              -> *mut c_void;
 3779                  pub fn munmap(addr*c_void, lensize_t) -> c_int;
 3780  
 3781                  pub fn mprotect(addr*c_void, lensize_t, protc_int)
 3782                                  -> c_int;
 3783  
 3784                  pub fn msync(addr*c_void, lensize_t, flagsc_int)
 3785                               -> c_int;
 3786                  pub fn shm_open(name*c_char, oflagc_int, modemode_t)
 3787                                  -> c_int;
 3788                  pub fn shm_unlink(name*c_char) -> c_int;
 3789              }
 3790          }
 3791      }
 3792  
 3793      #[cfg(target_os = "linux")]
 3794      #[cfg(target_os = "android")]
 3795      #[cfg(target_os = "macos")]
 3796      #[cfg(target_os = "freebsd")]
 3797      pub mod posix01 {
 3798          pub mod stat_ {
 3799              use libc::types::os::arch::c95::{c_char, c_int};
 3800              use libc::types::os::arch::posix01::stat;
 3801  
 3802              extern {
 3803                  #[cfg(target_os = "linux")]
 3804                  #[cfg(target_os = "freebsd")]
 3805                  #[cfg(target_os = "android")]
 3806                  pub fn lstat(path*c_char, buf*mut stat) -> c_int;
 3807  
 3808                  #[cfg(target_os = "macos")]
 3809                  #[link_name = "lstat64"]
 3810                  pub fn lstat(path: *c_char, buf: *mut stat) -> c_int;
 3811              }
 3812          }
 3813  
 3814          pub mod unistd {
 3815              use libc::types::os::arch::c95::{c_char, c_int, size_t};
 3816              use libc::types::os::arch::posix88::{ssize_t, off_t};
 3817  
 3818              extern {
 3819                  pub fn readlink(path*c_char,
 3820                                  buf*mut c_char,
 3821                                  bufszsize_t)
 3822                                  -> ssize_t;
 3823  
 3824                  pub fn fsync(fdc_int) -> c_int;
 3825  
 3826                  #[cfg(target_os = "linux")]
 3827                  #[cfg(target_os = "android")]
 3828                  pub fn fdatasync(fdc_int) -> c_int;
 3829  
 3830                  pub fn setenv(name*c_char, val*c_char, overwritec_int)
 3831                                -> c_int;
 3832                  pub fn unsetenv(name*c_char) -> c_int;
 3833                  pub fn putenv(string*c_char) -> c_int;
 3834  
 3835                  pub fn symlink(path1*c_char, path2*c_char) -> c_int;
 3836  
 3837                  pub fn ftruncate(fdc_int, lengthoff_t) -> c_int;
 3838              }
 3839          }
 3840  
 3841          pub mod wait {
 3842              use libc::types::os::arch::c95::{c_int};
 3843              use libc::types::os::arch::posix88::{pid_t};
 3844  
 3845              extern {
 3846                  pub fn waitpid(pidpid_t, status*mut c_int, optionsc_int)
 3847                                 -> pid_t;
 3848              }
 3849          }
 3850  
 3851          pub mod glob {
 3852              use libc::types::os::arch::c95::{c_char, c_int};
 3853              use libc::types::os::common::posix01::{glob_t};
 3854              use option::Option;
 3855  
 3856              extern {
 3857                  pub fn glob(pattern*c_char,
 3858                              flagsc_int,
 3859                              errfuncOption<extern "C" fn(epath: *c_char, errno: int) -> int>,
 3860                              pglob*mut glob_t);
 3861                  pub fn globfree(pglob*mut glob_t);
 3862              }
 3863          }
 3864  
 3865          pub mod mman {
 3866              use libc::types::common::c95::{c_void};
 3867              use libc::types::os::arch::c95::{c_int, size_t};
 3868  
 3869              extern {
 3870                  pub fn posix_madvise(addr*c_void,
 3871                                       lensize_t,
 3872                                       advicec_int)
 3873                                       -> c_int;
 3874              }
 3875          }
 3876      }
 3877  
 3878      #[cfg(target_os = "win32")]
 3879      pub mod posix01 {
 3880          pub mod stat_ {
 3881          }
 3882  
 3883          pub mod unistd {
 3884          }
 3885  
 3886          pub mod glob {
 3887          }
 3888  
 3889          pub mod mman {
 3890          }
 3891      }
 3892  
 3893  
 3894      #[cfg(target_os = "win32")]
 3895      #[cfg(target_os = "linux")]
 3896      #[cfg(target_os = "android")]
 3897      #[cfg(target_os = "macos")]
 3898      #[cfg(target_os = "freebsd")]
 3899      pub mod posix08 {
 3900          pub mod unistd {
 3901          }
 3902      }
 3903  
 3904      #[cfg(not(windows))]
 3905      pub mod bsd43 {
 3906          use libc::types::common::c95::{c_void};
 3907          use libc::types::os::common::bsd44::{socklen_t, sockaddr};
 3908          use libc::types::os::arch::c95::{c_int, size_t};
 3909          use libc::types::os::arch::posix88::ssize_t;
 3910  
 3911          extern "system" {
 3912              pub fn socket(domainc_int, tyc_int, protocolc_int) -> c_int;
 3913              pub fn connect(socketc_int, address*sockaddr,
 3914                             lensocklen_t) -> c_int;
 3915              pub fn bind(socketc_int, address*sockaddr,
 3916                          address_lensocklen_t) -> c_int;
 3917              pub fn listen(socketc_int, backlogc_int) -> c_int;
 3918              pub fn accept(socketc_int, address*mut sockaddr,
 3919                            address_len*mut socklen_t) -> c_int;
 3920              pub fn getpeername(socketc_int, address*mut sockaddr,
 3921                                 address_len*mut socklen_t) -> c_int;
 3922              pub fn getsockname(socketc_int, address*mut sockaddr,
 3923                                 address_len*mut socklen_t) -> c_int;
 3924              pub fn setsockopt(socketc_int, levelc_int, namec_int,
 3925                                value*c_void, option_lensocklen_t) -> c_int;
 3926              pub fn recv(socketc_int, buf*mut c_void, lensize_t,
 3927                          flagsc_int) -> ssize_t;
 3928              pub fn send(socketc_int, buf*mut c_void, lensize_t,
 3929                          flagsc_int) -> ssize_t;
 3930              pub fn recvfrom(socketc_int, buf*mut c_void, lensize_t,
 3931                              flagsc_int, addr*mut sockaddr,
 3932                              addrlen*mut socklen_t) -> ssize_t;
 3933              pub fn sendto(socketc_int, buf*c_void, lensize_t,
 3934                            flagsc_int, addr*sockaddr,
 3935                            addrlensocklen_t) -> ssize_t;
 3936              pub fn shutdown(socketc_int, howc_int) -> c_int;
 3937          }
 3938      }
 3939  
 3940      #[cfg(windows)]
 3941      pub mod bsd43 {
 3942          use libc::types::common::c95::{c_void};
 3943          use libc::types::os::common::bsd44::{socklen_t, sockaddr, SOCKET};
 3944          use libc::types::os::arch::c95::c_int;
 3945          use libc::types::os::arch::posix88::ssize_t;
 3946  
 3947          extern "system" {
 3948              pub fn socket(domain: c_int, ty: c_int, protocol: c_int) -> SOCKET;
 3949              pub fn connect(socket: SOCKET, address: *sockaddr,
 3950                             len: socklen_t) -> c_int;
 3951              pub fn bind(socket: SOCKET, address: *sockaddr,
 3952                          address_len: socklen_t) -> c_int;
 3953              pub fn listen(socket: SOCKET, backlog: c_int) -> c_int;
 3954              pub fn accept(socket: SOCKET, address: *mut sockaddr,
 3955                            address_len: *mut socklen_t) -> SOCKET;
 3956              pub fn getpeername(socket: SOCKET, address: *mut sockaddr,
 3957                                 address_len: *mut socklen_t) -> c_int;
 3958              pub fn getsockname(socket: SOCKET, address: *mut sockaddr,
 3959                                 address_len: *mut socklen_t) -> c_int;
 3960              pub fn setsockopt(socket: SOCKET, level: c_int, name: c_int,
 3961                                value: *c_void, option_len: socklen_t) -> c_int;
 3962              pub fn closesocket(socket: SOCKET) -> c_int;
 3963              pub fn recv(socket: SOCKET, buf: *mut c_void, len: c_int,
 3964                          flags: c_int) -> c_int;
 3965              pub fn send(socket: SOCKET, buf: *mut c_void, len: c_int,
 3966                          flags: c_int) -> c_int;
 3967              pub fn recvfrom(socket: SOCKET, buf: *mut c_void, len: c_int,
 3968                              flags: c_int, addr: *mut sockaddr,
 3969                              addrlen: *mut c_int) -> ssize_t;
 3970              pub fn sendto(socket: SOCKET, buf: *c_void, len: c_int,
 3971                            flags: c_int, addr: *sockaddr,
 3972                            addrlen: c_int) -> c_int;
 3973              pub fn shutdown(socket: SOCKET, how: c_int) -> c_int;
 3974          }
 3975      }
 3976  
 3977      #[cfg(target_os = "macos")]
 3978      #[cfg(target_os = "freebsd")]
 3979      pub mod bsd44 {
 3980          use libc::types::common::c95::{c_void};
 3981          use libc::types::os::arch::c95::{c_char, c_uchar, c_int, c_uint, size_t};
 3982  
 3983          extern {
 3984              pub fn sysctl(name: *c_int,
 3985                            namelen: c_uint,
 3986                            oldp: *mut c_void,
 3987                            oldlenp: *mut size_t,
 3988                            newp: *c_void,
 3989                            newlen: size_t)
 3990                            -> c_int;
 3991              pub fn sysctlbyname(name: *c_char,
 3992                                  oldp: *mut c_void,
 3993                                  oldlenp: *mut size_t,
 3994                                  newp: *c_void,
 3995                                  newlen: size_t)
 3996                                  -> c_int;
 3997              pub fn sysctlnametomib(name: *c_char,
 3998                                     mibp: *mut c_int,
 3999                                     sizep: *mut size_t)
 4000                                     -> c_int;
 4001              pub fn getdtablesize() -> c_int;
 4002              pub fn madvise(addr: *c_void, len: size_t, advice: c_int)
 4003                             -> c_int;
 4004              pub fn mincore(addr: *c_void, len: size_t, vec: *c_uchar)
 4005                             -> c_int;
 4006          }
 4007      }
 4008  
 4009  
 4010      #[cfg(target_os = "linux")]
 4011      #[cfg(target_os = "android")]
 4012      pub mod bsd44 {
 4013          use libc::types::common::c95::{c_void};
 4014          use libc::types::os::arch::c95::{c_uchar, c_int, size_t};
 4015  
 4016          extern {
 4017              pub fn getdtablesize() -> c_int;
 4018              pub fn madvise(addr*c_void, lensize_t, advicec_int)
 4019                             -> c_int;
 4020              pub fn mincore(addr*c_void, lensize_t, vec*c_uchar)
 4021                             -> c_int;
 4022          }
 4023      }
 4024  
 4025  
 4026      #[cfg(target_os = "win32")]
 4027      pub mod bsd44 {
 4028      }
 4029  
 4030      #[cfg(target_os = "macos")]
 4031      pub mod extra {
 4032          use libc::types::os::arch::c95::{c_char, c_int};
 4033  
 4034          extern {
 4035              pub fn _NSGetExecutablePath(buf: *mut c_char, bufsize: *mut u32)
 4036                                          -> c_int;
 4037          }
 4038      }
 4039  
 4040      #[cfg(target_os = "freebsd")]
 4041      pub mod extra {
 4042      }
 4043  
 4044      #[cfg(target_os = "linux")]
 4045      #[cfg(target_os = "android")]
 4046      pub mod extra {
 4047      }
 4048  
 4049  
 4050      #[cfg(target_os = "win32")]
 4051      pub mod extra {
 4052  
 4053          pub mod kernel32 {
 4054              use libc::types::os::arch::c95::{c_uint};
 4055              use libc::types::os::arch::extra::{BOOL, DWORD, SIZE_T, HMODULE,
 4056                                                 LPCWSTR, LPWSTR, LPCSTR, LPSTR,
 4057                                                 LPCH, LPDWORD, LPVOID,
 4058                                                 LPCVOID, LPOVERLAPPED,
 4059                                                 LPSECURITY_ATTRIBUTES,
 4060                                                 LPSTARTUPINFO,
 4061                                                 LPPROCESS_INFORMATION,
 4062                                                 LPMEMORY_BASIC_INFORMATION,
 4063                                                 LPSYSTEM_INFO, BOOLEAN,
 4064                                                 HANDLE, LPHANDLE, LARGE_INTEGER,
 4065                                                 PLARGE_INTEGER, LPFILETIME};
 4066  
 4067              extern "system" {
 4068                  pub fn GetEnvironmentVariableW(n: LPCWSTR,
 4069                                                 v: LPWSTR,
 4070                                                 nsize: DWORD)
 4071                                                 -> DWORD;
 4072                  pub fn SetEnvironmentVariableW(n: LPCWSTR, v: LPCWSTR)
 4073                                                 -> BOOL;
 4074                  pub fn GetEnvironmentStringsA() -> LPCH;
 4075                  pub fn FreeEnvironmentStringsA(env_ptr: LPCH) -> BOOL;
 4076                  pub fn GetModuleFileNameW(hModule: HMODULE,
 4077                                            lpFilename: LPWSTR,
 4078                                            nSize: DWORD)
 4079                                            -> DWORD;
 4080                  pub fn CreateDirectoryW(lpPathName: LPCWSTR,
 4081                                          lpSecurityAttributes:
 4082                                          LPSECURITY_ATTRIBUTES)
 4083                                          -> BOOL;
 4084                  pub fn CopyFileW(lpExistingFileName: LPCWSTR,
 4085                                   lpNewFileName: LPCWSTR,
 4086                                   bFailIfExists: BOOL)
 4087                                   -> BOOL;
 4088                  pub fn DeleteFileW(lpPathName: LPCWSTR) -> BOOL;
 4089                  pub fn RemoveDirectoryW(lpPathName: LPCWSTR) -> BOOL;
 4090                  pub fn GetCurrentDirectoryW(nBufferLength: DWORD,
 4091                                              lpBuffer: LPWSTR)
 4092                                              -> DWORD;
 4093                  pub fn SetCurrentDirectoryW(lpPathName: LPCWSTR) -> BOOL;
 4094                  pub fn GetLastError() -> DWORD;
 4095                  pub fn FindFirstFileW(fileName: *u16, findFileData: HANDLE)
 4096                                        -> HANDLE;
 4097                  pub fn FindNextFileW(findFile: HANDLE, findFileData: HANDLE)
 4098                                       -> BOOL;
 4099                  pub fn FindClose(findFile: HANDLE) -> BOOL;
 4100                  pub fn DuplicateHandle(hSourceProcessHandle: HANDLE,
 4101                                         hSourceHandle: HANDLE,
 4102                                         hTargetProcessHandle: HANDLE,
 4103                                         lpTargetHandle: LPHANDLE,
 4104                                         dwDesiredAccess: DWORD,
 4105                                         bInheritHandle: BOOL,
 4106                                         dwOptions: DWORD)
 4107                                         -> BOOL;
 4108                  pub fn CloseHandle(hObject: HANDLE) -> BOOL;
 4109                  pub fn OpenProcess(dwDesiredAccess: DWORD,
 4110                                     bInheritHandle: BOOL,
 4111                                     dwProcessId: DWORD)
 4112                                     -> HANDLE;
 4113                  pub fn GetCurrentProcess() -> HANDLE;
 4114                  pub fn CreateProcessA(lpApplicationName: LPCSTR,
 4115                                        lpCommandLine: LPSTR,
 4116                                        lpProcessAttributes:
 4117                                        LPSECURITY_ATTRIBUTES,
 4118                                        lpThreadAttributes:
 4119                                        LPSECURITY_ATTRIBUTES,
 4120                                        bInheritHandles: BOOL,
 4121                                        dwCreationFlags: DWORD,
 4122                                        lpEnvironment: LPVOID,
 4123                                        lpCurrentDirectory: LPCSTR,
 4124                                        lpStartupInfo: LPSTARTUPINFO,
 4125                                        lpProcessInformation:
 4126                                        LPPROCESS_INFORMATION)
 4127                                        -> BOOL;
 4128                  pub fn WaitForSingleObject(hHandle: HANDLE,
 4129                                             dwMilliseconds: DWORD)
 4130                                             -> DWORD;
 4131                  pub fn TerminateProcess(hProcess: HANDLE, uExitCode: c_uint)
 4132                                          -> BOOL;
 4133                  pub fn GetExitCodeProcess(hProcess: HANDLE,
 4134                                            lpExitCode: LPDWORD)
 4135                                            -> BOOL;
 4136                  pub fn GetSystemInfo(lpSystemInfo: LPSYSTEM_INFO);
 4137                  pub fn VirtualAlloc(lpAddress: LPVOID,
 4138                                      dwSize: SIZE_T,
 4139                                      flAllocationType: DWORD,
 4140                                      flProtect: DWORD)
 4141                                      -> LPVOID;
 4142                  pub fn VirtualFree(lpAddress: LPVOID,
 4143                                     dwSize: SIZE_T,
 4144                                     dwFreeType: DWORD)
 4145                                     -> BOOL;
 4146                  pub fn VirtualLock(lpAddress: LPVOID, dwSize: SIZE_T) -> BOOL;
 4147                  pub fn VirtualUnlock(lpAddress: LPVOID, dwSize: SIZE_T)
 4148                                       -> BOOL;
 4149                  pub fn VirtualProtect(lpAddress: LPVOID,
 4150                                        dwSize: SIZE_T,
 4151                                        flNewProtect: DWORD,
 4152                                        lpflOldProtect: LPDWORD)
 4153                                        -> BOOL;
 4154                  pub fn VirtualQuery(lpAddress: LPCVOID,
 4155                                      lpBuffer: LPMEMORY_BASIC_INFORMATION,
 4156                                      dwLength: SIZE_T)
 4157                                      -> SIZE_T;
 4158                  pub fn CreateFileMappingW(hFile: HANDLE,
 4159                                            lpAttributes: LPSECURITY_ATTRIBUTES,
 4160                                            flProtect: DWORD,
 4161                                            dwMaximumSizeHigh: DWORD,
 4162                                            dwMaximumSizeLow: DWORD,
 4163                                            lpName: LPCWSTR)
 4164                                            -> HANDLE;
 4165                  pub fn MapViewOfFile(hFileMappingObject: HANDLE,
 4166                                       dwDesiredAccess: DWORD,
 4167                                       dwFileOffsetHigh: DWORD,
 4168                                       dwFileOffsetLow: DWORD,
 4169                                       dwNumberOfBytesToMap: SIZE_T)
 4170                                       -> LPVOID;
 4171                  pub fn UnmapViewOfFile(lpBaseAddress: LPCVOID) -> BOOL;
 4172                  pub fn MoveFileExW(lpExistingFileName: LPCWSTR,
 4173                                     lpNewFileName: LPCWSTR,
 4174                                     dwFlags: DWORD) -> BOOL;
 4175                  pub fn CreateSymbolicLinkW(lpSymlinkFileName: LPCWSTR,
 4176                                             lpTargetFileName: LPCWSTR,
 4177                                             dwFlags: DWORD) -> BOOLEAN;
 4178                  pub fn CreateHardLinkW(lpSymlinkFileName: LPCWSTR,
 4179                                         lpTargetFileName: LPCWSTR,
 4180                                         lpSecurityAttributes: LPSECURITY_ATTRIBUTES)
 4181                                          -> BOOL;
 4182                  pub fn FlushFileBuffers(hFile: HANDLE) -> BOOL;
 4183                  pub fn CreateFileW(lpFileName: LPCWSTR,
 4184                                     dwDesiredAccess: DWORD,
 4185                                     dwShareMode: DWORD,
 4186                                     lpSecurityAttributes: LPSECURITY_ATTRIBUTES,
 4187                                     dwCreationDisposition: DWORD,
 4188                                     dwFlagsAndAttributes: DWORD,
 4189                                     hTemplateFile: HANDLE) -> HANDLE;
 4190                  pub fn GetFinalPathNameByHandleW(hFile: HANDLE,
 4191                                                   lpszFilePath: LPCWSTR,
 4192                                                   cchFilePath: DWORD,
 4193                                                   dwFlags: DWORD) -> DWORD;
 4194                  pub fn ReadFile(hFile: HANDLE,
 4195                                  lpBuffer: LPVOID,
 4196                                  nNumberOfBytesToRead: DWORD,
 4197                                  lpNumberOfBytesRead: LPDWORD,
 4198                                  lpOverlapped: LPOVERLAPPED) -> BOOL;
 4199                  pub fn WriteFile(hFile: HANDLE,
 4200                                   lpBuffer: LPVOID,
 4201                                   nNumberOfBytesToRead: DWORD,
 4202                                   lpNumberOfBytesRead: LPDWORD,
 4203                                   lpOverlapped: LPOVERLAPPED) -> BOOL;
 4204                  pub fn SetFilePointerEx(hFile: HANDLE,
 4205                                          liDistanceToMove: LARGE_INTEGER,
 4206                                          lpNewFilePointer: PLARGE_INTEGER,
 4207                                          dwMoveMethod: DWORD) -> BOOL;
 4208                  pub fn SetEndOfFile(hFile: HANDLE) -> BOOL;
 4209  
 4210                  pub fn GetSystemTimeAsFileTime(
 4211                              lpSystemTimeAsFileTime: LPFILETIME);
 4212  
 4213                  pub fn QueryPerformanceFrequency(
 4214                              lpFrequency: *mut LARGE_INTEGER) -> BOOL;
 4215                  pub fn QueryPerformanceCounter(
 4216                              lpPerformanceCount: *mut LARGE_INTEGER) -> BOOL;
 4217  
 4218                  pub fn GetCurrentProcessId() -> DWORD;
 4219                  pub fn CreateNamedPipeW(
 4220                              lpName: LPCWSTR,
 4221                              dwOpenMode: DWORD,
 4222                              dwPipeMode: DWORD,
 4223                              nMaxInstances: DWORD,
 4224                              nOutBufferSize: DWORD,
 4225                              nInBufferSize: DWORD,
 4226                              nDefaultTimeOut: DWORD,
 4227                              lpSecurityAttributes: LPSECURITY_ATTRIBUTES
 4228                              ) -> HANDLE;
 4229                  pub fn ConnectNamedPipe(hNamedPipe: HANDLE,
 4230                                          lpOverlapped: LPOVERLAPPED) -> BOOL;
 4231                  pub fn WaitNamedPipeW(lpNamedPipeName: LPCWSTR,
 4232                                        nTimeOut: DWORD) -> BOOL;
 4233                  pub fn SetNamedPipeHandleState(hNamedPipe: HANDLE,
 4234                                                 lpMode: LPDWORD,
 4235                                                 lpMaxCollectionCount: LPDWORD,
 4236                                                 lpCollectDataTimeout: LPDWORD)
 4237                                                              -> BOOL;
 4238                  pub fn CreateEventW(lpEventAttributes: LPSECURITY_ATTRIBUTES,
 4239                                      bManualReset: BOOL,
 4240                                      bInitialState: BOOL,
 4241                                      lpName: LPCWSTR) -> HANDLE;
 4242                  pub fn GetOverlappedResult(hFile: HANDLE,
 4243                                             lpOverlapped: LPOVERLAPPED,
 4244                                             lpNumberOfBytesTransferred: LPDWORD,
 4245                                             bWait: BOOL) -> BOOL;
 4246                  pub fn DisconnectNamedPipe(hNamedPipe: HANDLE) -> BOOL;
 4247              }
 4248          }
 4249  
 4250          pub mod msvcrt {
 4251              use libc::types::os::arch::c95::{c_int, c_long};
 4252              use libc::types::os::arch::c99::intptr_t;
 4253  
 4254              extern {
 4255                  #[link_name = "_commit"]
 4256                  pub fn commit(fd: c_int) -> c_int;
 4257  
 4258                  #[link_name = "_get_osfhandle"]
 4259                  pub fn get_osfhandle(fd: c_int) -> c_long;
 4260  
 4261                  #[link_name = "_open_osfhandle"]
 4262                  pub fn open_osfhandle(osfhandle: intptr_t,
 4263                                        flags: c_int) -> c_int;
 4264              }
 4265          }
 4266      }
 4267  }

libstd/libc.rs:226:12-226:12 -enum- definition:
            pub enum dirent_t {}
        }
references:-
3672:                                   result: *mut *mut dirent_t) -> c_int;
3664:                                     entry: *mut dirent_t,
3671:                 fn rust_readdir_r(dirp: *DIR, entry: *mut dirent_t,
3665:                                     result: *mut *mut dirent_t) -> c_int {


libstd/libc.rs:225:12-225:12 -enum- definition:
            pub enum DIR {}
            pub enum dirent_t {}
references:-
3678:                 pub fn seekdir(dirp: *DIR, loc: c_long);
3670:                 fn rust_opendir(dirname: *c_char) -> *DIR;
3677:                 pub fn rewinddir(dirp: *DIR);
3671:                 fn rust_readdir_r(dirp: *DIR, entry: *mut dirent_t,
3679:                 pub fn telldir(dirp: *DIR) -> c_long;
3660:             pub unsafe fn opendir(dirname: *c_char) -> *DIR {
3663:             pub unsafe fn readdir_r(dirp: *DIR,
3676:                 pub fn closedir(dirp: *DIR) -> c_int;


libstd/libc.rs:274:16-274:16 -ty- definition:
                pub type sa_family_t = u16;
                pub type in_port_t = u16;
references:-
296:                     sin6_family: sa_family_t,
278:                     sa_family: sa_family_t,
282:                     ss_family: sa_family_t,
324:                     sun_family: sa_family_t,
287:                     sin_family: sa_family_t,


libstd/libc.rs:313:16-313:16 -struct- definition:
                pub struct addrinfo {
                    ai_flags: c_int,
references:-
321:                     ai_next: *addrinfo


libstd/libc.rs:562:16-562:16 -ty- definition:
                pub type blkcnt_t = i64;
                pub struct stat {
references:-
574:                     st_blocks: blkcnt_t,


libstd/libc.rs:529:16-529:16 -ty- definition:
                pub type c_double = f64;
                pub type size_t = u64;
references:-
3409:                 pub fn atof(s: *c_char) -> c_double;
3411:                 pub fn strtod(s: *c_char, endp: **c_char) -> c_double;
libstd/num/cmath.rs:
30:         pub fn cbrt(n: c_double) -> c_double;
41:         pub fn fmax(a: c_double, b: c_double) -> c_double;
79:         pub fn y1(n: c_double) -> c_double;
68:         pub fn tan(n: c_double) -> c_double;
63:         pub fn modf(n: c_double, iptr: &mut c_double) -> c_double;
70:         pub fn tgamma(n: c_double) -> c_double;
60:         pub fn ln_1p(n: c_double) -> c_double;
27:         pub fn asin(n: c_double) -> c_double;
31:         pub fn cosh(n: c_double) -> c_double;
80:         pub fn yn(i: c_int, n: c_double) -> c_double;
48:         pub fn ldexp(x: c_double, n: c_int) -> c_double;
26:         pub fn acos(n: c_double) -> c_double;
46:         pub fn frexp(n: c_double, value: &mut c_int) -> c_double;
75:         pub fn j1(n: c_double) -> c_double;
29:         pub fn atan2(a: c_double, b: c_double) -> c_double;
47:         pub fn hypot(x: c_double, y: c_double) -> c_double;
46:         pub fn frexp(n: c_double, value: &mut c_int) -> c_double;
33:         pub fn erfc(n: c_double) -> c_double;
47:         pub fn hypot(x: c_double, y: c_double) -> c_double;
66:         pub fn ldexp_radix(n: c_double, i: c_int) -> c_double;
63:         pub fn modf(n: c_double, iptr: &mut c_double) -> c_double;
70:         pub fn tgamma(n: c_double) -> c_double;
28:         pub fn atan(n: c_double) -> c_double;
43:         pub fn fmin(a: c_double, b: c_double) -> c_double;
29:         pub fn atan2(a: c_double, b: c_double) -> c_double;
32:         pub fn erf(n: c_double) -> c_double;
45:         pub fn next_after(x: c_double, y: c_double) -> c_double;
29:         pub fn atan2(a: c_double, b: c_double) -> c_double;
(39)(62)(67)(66)(74)(76)(45)(76)(41)(39)(57)(43)(45)(51)(47)(69)(68)(78)(80)(43)(41)(26)(32)(33)(69)(51)(30)(48)(60)(36)(27)(39)(78)(31)(67)(28)(57)(74)(75)
libstd/num/f64.rs:
(74)(73)(79)(85)(83)(70)(74)(79)(80)(75)(79)(90)(82)(85)(91)(89)(72)(91)(78)(81)(73)
libstd/num/cmath.rs:
..18more..


libstd/libc.rs:549:16-549:16 -ty- definition:
                pub type gid_t = u32;
                pub type useconds_t = u32;
references:-
3731:                 pub fn setgid(gid: gid_t) -> c_int;
3712:                 pub fn getgroups(ngroups_max: c_int, groups: *mut gid_t)
3709:                 pub fn getegid() -> gid_t;
569:                     st_gid: gid_t,
3711:                 pub fn getgid() -> gid_t ;
3698:                 pub fn chown(path: *c_char, uid: uid_t, gid: gid_t) -> c_int;


libstd/libc.rs:530:16-530:16 -ty- definition:
                pub type size_t = u64;
                pub type ptrdiff_t = i64;
references:-
3728:                 pub fn read(fd: c_int, buf: *mut c_void, count: size_t)
3454:                 pub fn strxfrm(s: *c_char, ct: *c_char, n: size_t) -> size_t;
3784:                 pub fn msync(addr: *c_void, len: size_t, flags: c_int)
3416:                 pub fn calloc(nobj: size_t, size: size_t) -> *c_void;
3767:                 pub fn mlock(addr: *c_void, len: size_t) -> c_int;
3416:                 pub fn calloc(nobj: size_t, size: size_t) -> *c_void;
3768:                 pub fn munlock(addr: *c_void, len: size_t) -> c_int;
3378:                              size: size_t,
4018:             pub fn madvise(addr: *c_void, len: size_t, advice: c_int)
3871:                                      len: size_t,
3381:                              -> size_t;
3386:                               -> size_t;
3781:                 pub fn mprotect(addr: *c_void, len: size_t, prot: c_int)
3821:                                 bufsz: size_t)
3448:                 pub fn strcspn(cs: *c_char, ct: *c_char) -> size_t;
3443:                 pub fn strncmp(cs: *c_char, ct: *c_char, n: size_t) -> c_int;
3451:                 pub fn strlen(cs: *c_char) -> size_t;
3461:                 pub fn memcmp(cx: *c_void, ct: *c_void, n: size_t) -> c_int;
3928:             pub fn send(socket: c_int, buf: *mut c_void, len: size_t,
3383:                               size: size_t,
3708:                 pub fn getcwd(buf: *mut c_char, size: size_t) -> *c_char;
3746:                 pub fn pwrite(fd: c_int, buf: *c_void, count: size_t,
3744:                 pub fn pread(fd: c_int, buf: *c_void, count: size_t,
3384:                               nobj: size_t,
2352:             pub static PTHREAD_STACK_MIN: size_t = 16384;
3933:             pub fn sendto(socket: c_int, buf: *c_void, len: size_t,
3926:             pub fn recv(socket: c_int, buf: *mut c_void, len: size_t,
249:                     gl_offs:  size_t,
3742:                 pub fn write(fd: c_int, buf: *c_void, count: size_t)
4020:             pub fn mincore(addr: *c_void, len: size_t, vec: *c_uchar)
(3462)(3455)(247)(3360)(3417)(3379)(3447)(3438)(3773)(3441)(3779)(3418)(3930)(3454)
libstd/os.rs:
(74)(684)(1136)(1096)(696)
libstd/io/stdio.rs:
(236)
libstd/rt/global_heap.rs:
(58)(40)
libstd/rt/thread.rs:
(305)(235)(277)(225)(275)
libstd/rt/util.rs:
(81)
libstd/str.rs:
(700)
libstd/sync/deque.rs:
(348)
libstd/os.rs:
(680)

libstd/libc.rs:548:16-548:16 -ty- definition:
                pub type uid_t = u32;
                pub type gid_t = u32;
references:-
3734:                 pub fn setuid(uid: uid_t) -> c_int;
3698:                 pub fn chown(path: *c_char, uid: uid_t, gid: gid_t) -> c_int;
3710:                 pub fn geteuid() -> uid_t;
568:                     st_uid: uid_t,
3720:                 pub fn getuid() -> uid_t;


libstd/libc.rs:544:16-544:16 -ty- definition:
                pub type off_t = i64;
                pub type dev_t = u64;
references:-
3724:                              -> off_t;
3777:                             offset: off_t)
3747:                               offset: off_t) -> ssize_t;
3837:                 pub fn ftruncate(fd: c_int, length: off_t) -> c_int;
3723:                 pub fn lseek(fd: c_int, offset: off_t, whence: c_int)
572:                     st_size: off_t,
libstd/os.rs:
1089:                 MapOffset(offset_) => { offset = offset_ as off_t; },
libstd/libc.rs:
3745:                              offset: off_t) -> ssize_t;


libstd/libc.rs:292:16-292:16 -struct- definition:
                pub struct in_addr {
                    s_addr: in_addr_t,
references:-
289:                     sin_addr: in_addr,
306:                     imr_multiaddr: in_addr,
307:                     imr_interface: in_addr,


libstd/libc.rs:521:16-521:16 -ty- definition:
                pub type c_uchar = u8;
                pub type c_short = i16;
references:-
4020:             pub fn mincore(addr: *c_void, len: size_t, vec: *c_uchar)


libstd/libc.rs:545:16-545:16 -ty- definition:
                pub type dev_t = u64;
                pub type ino_t = u64;
references:-
571:                     st_rdev: dev_t,
564:                     st_dev: dev_t,


libstd/libc.rs:546:16-546:16 -ty- definition:
                pub type ino_t = u64;
                pub type pid_t = i32;
references:-
565:                     st_ino: ino_t,


libstd/libc.rs:541:16-541:16 -ty- definition:
                pub type uintptr_t = uint;
            }
references:-
libstd/unstable/mod.rs:
62:     fn rust_running_on_valgrind() -> uintptr_t;
libstd/rt/libunwind.rs:
107:     pub fn _Unwind_GetIP(ctx: *_Unwind_Context) -> libc::uintptr_t;
57: pub type _Unwind_Word = libc::uintptr_t;
libstd/rt/backtrace.rs:
460:             backtrace_syminfo(state, addr as libc::uintptr_t,
362:                           symsize: libc::uintptr_t);
361:                           symval: libc::uintptr_t,
376:                                  addr: libc::uintptr_t,
394:                              _symsize: libc::uintptr_t) {
391:                              _pc: libc::uintptr_t,
359:                           pc: libc::uintptr_t,
libstd/rt/util.rs:
36:         fn rust_get_num_cpus() -> libc::uintptr_t;
libstd/rt/backtrace.rs:
393:                              _symval: libc::uintptr_t,


libstd/libc.rs:275:16-275:16 -ty- definition:
                pub type in_port_t = u16;
                pub type in_addr_t = u32;
references:-
288:                     sin_port: in_port_t,
297:                     sin6_port: in_port_t,


libstd/libc.rs:211:12-211:12 -enum- definition:
            pub enum FILE {}
            pub enum fpos_t {}
references:-
3376:                 pub fn ungetc(c: c_int, stream: *FILE) -> c_int;
3394:                 pub fn ferror(stream: *FILE) -> c_int;
3632:                 pub fn pclose(stream: *FILE) -> c_int;
3393:                 pub fn feof(stream: *FILE) -> c_int;
3357:                 pub fn setvbuf(stream: *FILE,
3364:                 pub fn fgetc(stream: *FILE) -> c_int;
3362:                 pub fn setbuf(stream: *FILE, buf: *c_char);
3392:                 pub fn fsetpos(stream: *FILE, ptr: *fpos_t) -> c_int;
3351:                                -> *FILE;
3349:                 pub fn fopen(filename: *c_char, mode: *c_char) -> *FILE;
3389:                 pub fn ftell(stream: *FILE) -> c_long;
3633:                 pub fn fdopen(fd: c_int, mode: *c_char) -> *FILE;
3350:                 pub fn freopen(filename: *c_char, mode: *c_char, file: *FILE)
3356:                 pub fn tmpfile() -> *FILE;
3365:                 pub fn fgets(buf: *mut c_char, n: c_int, stream: *FILE)
3385:                               stream: *FILE)
3391:                 pub fn fgetpos(stream: *FILE, ptr: *fpos_t) -> c_int;
3631:                 pub fn popen(command: *c_char, mode: *c_char) -> *FILE;
3368:                 pub fn fputs(s: *c_char, stream: *FILE) -> *c_char;
3380:                              stream: *FILE)
3390:                 pub fn rewind(stream: *FILE);
3352:                 pub fn fflush(file: *FILE) -> c_int;
3367:                 pub fn fputc(c: c_int, stream: *FILE) -> c_int;
3353:                 pub fn fclose(file: *FILE) -> c_int;
3387:                 pub fn fseek(stream: *FILE, offset: c_long, whence: c_int)
3634:                 pub fn fileno(stream: *FILE) -> c_int;


libstd/libc.rs:563:16-563:16 -struct- definition:
                pub struct stat {
                    st_dev: dev_t,
references:-
3806:                 pub fn lstat(path: *c_char, buf: *mut stat) -> c_int;
3618:                 pub fn stat(path: *c_char, buf: *mut stat) -> c_int;
3606:                 pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int;


libstd/libc.rs:525:16-525:16 -ty- definition:
                pub type c_uint = u32;
                pub type c_long = i64;
references:-
3735:                 pub fn sleep(secs: c_uint) -> c_uint;
1862:             pub static FOPEN_MAX : c_uint = 16_u32;
3696:                 pub fn alarm(seconds: c_uint) -> c_uint;
1864:             pub static L_tmpnam : c_uint = 20_u32;
1861:             pub static BUFSIZ : c_uint = 8192_u32;
3736:                 pub fn usleep(secs: c_uint) -> c_int;
1863:             pub static FILENAME_MAX : c_uint = 4096_u32;
3427:                 pub fn srand(seed: c_uint);
1865:             pub static TMP_MAX : c_uint = 238328_u32;
3696:                 pub fn alarm(seconds: c_uint) -> c_uint;
libstd/rt/thread_local_storage.rs:
51: type pthread_key_t = ::libc::c_uint;
libstd/libc.rs:
311:                     ipv6mr_interface: c_uint,
..1more..


libstd/libc.rs:528:16-528:16 -ty- definition:
                pub type c_float = f32;
                pub type c_double = f64;
references:-
libstd/num/cmath.rs:
141:         pub fn ldexp_radix(n: c_float, i: c_int) -> c_float;
110:         pub fn abs_sub(a: c_float, b: c_float) -> c_float;
92:         pub fn acos(n: c_float) -> c_float;
94:         pub fn asin(n: c_float) -> c_float;
145:         pub fn tan(n: c_float) -> c_float;
114:         pub fn fmax(a: c_float, b: c_float) -> c_float;
96:         pub fn atan(n: c_float) -> c_float;
135:         pub fn ln_1p(n: c_float) -> c_float;
141:         pub fn ldexp_radix(n: c_float, i: c_int) -> c_float;
120:         pub fn hypot(x: c_float, y: c_float) -> c_float;
143:         pub fn sinh(n: c_float) -> c_float;
112:         pub fn frexp(n: c_float, value: &mut c_int) -> c_float;
108:         pub fn exp_m1(n: c_float) -> c_float;
116:         pub fn fmin(a: c_float, b: c_float) -> c_float;
98:         pub fn atan2(a: c_float, b: c_float) -> c_float;
114:         pub fn fmax(a: c_float, b: c_float) -> c_float;
108:         pub fn exp_m1(n: c_float) -> c_float;
135:         pub fn ln_1p(n: c_float) -> c_float;
100:         pub fn cbrt(n: c_float) -> c_float;
104:         pub fn erf(n: c_float) -> c_float;
143:         pub fn sinh(n: c_float) -> c_float;
94:         pub fn asin(n: c_float) -> c_float;
145:         pub fn tan(n: c_float) -> c_float;
118:         pub fn next_after(x: c_float, y: c_float) -> c_float;
122:         pub fn ldexp(x: c_float, n: c_int) -> c_float;
96:         pub fn atan(n: c_float) -> c_float;
110:         pub fn abs_sub(a: c_float, b: c_float) -> c_float;
133:         pub fn log_radix(n: c_float) -> c_float;
104:         pub fn erf(n: c_float) -> c_float;
120:         pub fn hypot(x: c_float, y: c_float) -> c_float;
(116)(120)(102)(118)(149)(137)(92)(126)(133)(149)(106)(147)(110)(139)(116)(114)(139)(106)(126)(118)(139)(147)(112)(122)(98)(102)(100)
libstd/num/f32.rs:
(82)(89)(81)(80)(89)(91)(75)(79)(85)(78)(83)(85)(73)(78)(73)(80)(90)(82)(71)(75)(83)(74)(72)(73)(72)(81)(82)(79)(80)(90)(70)(91)(71)..4more..


libstd/libc.rs:244:16-244:16 -ty- definition:
                pub type pthread_t = c_ulong;

references:-
libstd/rt/thread.rs:
217:         let mut native: libc::pthread_t = mem::uninit();
297:         fn pthread_create(native: *mut libc::pthread_t,
308:         fn pthread_detach(thread: libc::pthread_t) -> libc::c_int;
213:     pub type rust_thread = libc::pthread_t;
301:         fn pthread_join(native: libc::pthread_t,


libstd/libc.rs:273:16-273:16 -ty- definition:
                pub type socklen_t = u32;
                pub type sa_family_t = u16;
references:-
3923:                                address_len: *mut socklen_t) -> c_int;
3921:                                address_len: *mut socklen_t) -> c_int;
3925:                               value: *c_void, option_len: socklen_t) -> c_int;
3932:                             addrlen: *mut socklen_t) -> ssize_t;
3916:                         address_len: socklen_t) -> c_int;
3914:                            len: socklen_t) -> c_int;
318:                     ai_addrlen: socklen_t,
3919:                           address_len: *mut socklen_t) -> c_int;
3935:                           addrlen: socklen_t) -> ssize_t;


libstd/libc.rs:533:16-533:16 -ty- definition:
                pub type time_t = i64;
                pub type suseconds_t = i64;
references:-
577:                     st_mtime: time_t,
585:                     actime: time_t,
259:                     tv_sec: time_t,
264:                     tv_sec: time_t,
586:                     modtime: time_t,
575:                     st_atime: time_t,
579:                     st_ctime: time_t,


libstd/libc.rs:589:16-589:16 -struct- definition:
                pub struct pthread_attr_t {
                    __size: [u64, ..7]
references:-
libstd/rt/thread.rs:
275:     fn min_stack_size(attr: *libc::pthread_attr_t) -> libc::size_t {
304:         fn pthread_attr_setstacksize(attr: *mut libc::pthread_attr_t,
303:         fn pthread_attr_init(attr: *mut libc::pthread_attr_t) -> libc::c_int;
298:                           attr: *libc::pthread_attr_t,
306:         fn pthread_attr_setdetachstate(attr: *mut libc::pthread_attr_t,
277:         type F = extern "C" unsafe fn(*libc::pthread_attr_t) -> libc::size_t;
218:         let mut attr: libc::pthread_attr_t = mem::uninit();


libstd/libc.rs:535:16-535:16 -ty- definition:
                pub type wchar_t = i32;
            }
references:-
3455:                 pub fn wcslen(buf: *wchar_t) -> size_t;


libstd/libc.rs:547:16-547:16 -ty- definition:
                pub type pid_t = i32;
                pub type uid_t = u32;
references:-
3732:                 pub fn setpgid(pid: pid_t, pgid: pid_t) -> c_int;
3739:                 pub fn tcgetpgrp(fd: c_int) -> pid_t;
3733:                 pub fn setsid() -> pid_t;
3847:                                -> pid_t;
3732:                 pub fn setpgid(pid: pid_t, pgid: pid_t) -> c_int;
3718:                 pub fn getpid() -> pid_t;
3717:                 pub fn getpgrp() -> pid_t;
3757:                 pub fn kill(pid: pid_t, sig: c_int) -> c_int;
3706:                 pub fn fork() -> pid_t;
3846:                 pub fn waitpid(pid: pid_t, status: *mut c_int, options: c_int)
libstd/io/process.rs:
340:     pub fn id(&self) -> libc::pid_t { self.handle.id() }
335:     pub fn kill(id: libc::pid_t, signal: int) -> IoResult<()> {
libstd/rt/rtio.rs:
182:     fn kill(&mut self, pid: libc::pid_t, signal: int) -> Result<(), IoError>;
254:     fn id(&self) -> libc::pid_t;
libstd/libc.rs:
3719:                 pub fn getppid() -> pid_t;


libstd/libc.rs:519:16-519:16 -ty- definition:
                pub type c_char = i8;
                pub type c_schar = i8;
references:-
3424:                 pub fn getenv(s: *c_char) -> *c_char;
3437:                 pub fn strcpy(dst: *c_char, src: *c_char) -> *c_char;
3715:                 pub fn getopt(argc: c_int, argv: **c_char, optstr: *c_char)
3703:                 pub fn execve(prog: *c_char, argv: **c_char, envp: **c_char)
3660:             pub unsafe fn opendir(dirname: *c_char) -> *DIR {
3368:                 pub fn fputs(s: *c_char, stream: *FILE) -> *c_char;
3448:                 pub fn strcspn(cs: *c_char, ct: *c_char) -> size_t;
3365:                 pub fn fgets(buf: *mut c_char, n: c_int, stream: *FILE)
3349:                 pub fn fopen(filename: *c_char, mode: *c_char) -> *FILE;
3705:                 pub fn execvp(c: *c_char, argv: **c_char) -> c_int;
3695:                 pub fn access(path: *c_char, amode: c_int) -> c_int;
3442:                 pub fn strcmp(cs: *c_char, ct: *c_char) -> c_int;
3449:                 pub fn strpbrk(cs: *c_char, ct: *c_char) -> *c_char;
320:                     ai_canonname: *c_char,
3447:                 pub fn strspn(cs: *c_char, ct: *c_char) -> size_t;
3740:                 pub fn ttyname(fd: c_int) -> *c_char;
3358:                                buffer: *c_char,
3454:                 pub fn strxfrm(s: *c_char, ct: *c_char, n: size_t) -> size_t;
3354:                 pub fn remove(filename: *c_char) -> c_int;
3440:                 pub fn strcat(s: *c_char, ct: *c_char) -> *c_char;
3450:                 pub fn strstr(cs: *c_char, ct: *c_char) -> *c_char;
3722:                 pub fn link(src: *c_char, dst: *c_char) -> c_int;
3349:                 pub fn fopen(filename: *c_char, mode: *c_char) -> *FILE;
3368:                 pub fn fputs(s: *c_char, stream: *FILE) -> *c_char;
3631:                 pub fn popen(command: *c_char, mode: *c_char) -> *FILE;
3440:                 pub fn strcat(s: *c_char, ct: *c_char) -> *c_char;
3830:                 pub fn setenv(name: *c_char, val: *c_char, overwrite: c_int)
3835:                 pub fn symlink(path1: *c_char, path2: *c_char) -> c_int;
3730:                 pub fn rmdir(path: *c_char) -> c_int;
3446:                 pub fn strrchr(cs: *c_char, c: c_int) -> *c_char;
(3414)(3612)(3708)(3355)(3643)(3438)(3703)(3447)(3340)(3443)(3440)(3437)(248)(3859)(3437)(3670)(3411)(3832)(325)(3441)(3705)(3439)(3446)(3339)(3449)(3454)(3444)(3703)(3698)(3741)(3714)(3453)(3414)(3442)(3820)(3452)(3748)(3830)(3453)(3362)(3350)(3633)(3600)(3618)(3449)(3409)(3788)(3451)(3438)(3708)(3395)(3702)(3340)(3355)(3453)(3725)(3833)(3702)(3424)(3441)
libstd/c_str.rs:
libstd/os.rs:
libstd/unstable/dynamic_lib.rs:
libstd/rt/unwind.rs:
libstd/rt/backtrace.rs:
libstd/rt/args.rs:
libstd/str.rs:
libstd/os.rs:
..77more..


libstd/libc.rs:277:16-277:16 -struct- definition:
                pub struct sockaddr {
                    sa_family: sa_family_t,
references:-
3915:             pub fn bind(socket: c_int, address: *sockaddr,
3920:             pub fn getpeername(socket: c_int, address: *mut sockaddr,
3934:                           flags: c_int, addr: *sockaddr,
3922:             pub fn getsockname(socket: c_int, address: *mut sockaddr,
3931:                             flags: c_int, addr: *mut sockaddr,
319:                     ai_addr: *sockaddr,
3913:             pub fn connect(socket: c_int, address: *sockaddr,
3918:             pub fn accept(socket: c_int, address: *mut sockaddr,


libstd/libc.rs:207:12-207:12 -enum- definition:
            pub enum c_void {
                priv variant1,
references:-
3926:             pub fn recv(socket: c_int, buf: *mut c_void, len: size_t,
3417:                 pub fn malloc(size: size_t) -> *mut c_void;
3781:                 pub fn mprotect(addr: *c_void, len: size_t, prot: c_int)
3778:                             -> *mut c_void;
3779:                 pub fn munmap(addr: *c_void, len: size_t) -> c_int;
3870:                 pub fn posix_madvise(addr: *c_void,
252:                     __unused2: *c_void,
4018:             pub fn madvise(addr: *c_void, len: size_t, advice: c_int)
3767:                 pub fn mlock(addr: *c_void, len: size_t) -> c_int;
3462:                 pub fn memchr(cx: *c_void, c: c_int, n: size_t) -> *c_void;
253:                     __unused3: *c_void,
3746:                 pub fn pwrite(fd: c_int, buf: *c_void, count: size_t,
3933:             pub fn sendto(socket: c_int, buf: *c_void, len: size_t,
3728:                 pub fn read(fd: c_int, buf: *mut c_void, count: size_t)
3462:                 pub fn memchr(cx: *c_void, c: c_int, n: size_t) -> *c_void;
3418:                 pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
3382:                 pub fn fwrite(ptr: *c_void,
3461:                 pub fn memcmp(cx: *c_void, ct: *c_void, n: size_t) -> c_int;
3744:                 pub fn pread(fd: c_int, buf: *c_void, count: size_t,
251:                     __unused1: *c_void,
3768:                 pub fn munlock(addr: *c_void, len: size_t) -> c_int;
3461:                 pub fn memcmp(cx: *c_void, ct: *c_void, n: size_t) -> c_int;
254:                     __unused4: *c_void,
3377:                 pub fn fread(ptr: *mut c_void,
3928:             pub fn send(socket: c_int, buf: *mut c_void, len: size_t,
1931:             pub static MAP_FAILED : *c_void = -1 as *c_void;
3418:                 pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
1931:             pub static MAP_FAILED : *c_void = -1 as *c_void;
255:                     __unused5: *c_void,
3772:                 pub fn mmap(addr: *c_void,
(3930)(3419)(3925)(4020)(3784)(3742)(3416)
libstd/c_str.rs:
(230)
libstd/os.rs:
(1096)(1136)
libstd/io/stdio.rs:
(235)
libstd/unstable/dynamic_lib.rs:
(193)(192)(190)(175)(178)
libstd/unstable/mutex.rs:
(398)(270)(397)(269)
libstd/rt/global_heap.rs:
(105)(58)(55)
libstd/rt/thread.rs:
(43)(243)(26)(300)(302)
libstd/rt/unwind.rs:
(125)(100)(101)(108)(124)(123)
libstd/rt/libunwind.rs:
(110)(85)(102)
libstd/rt/backtrace.rs:
(462)(358)(373)(276)(345)(386)(264)(472)(390)(278)(379)(364)
libstd/rt/util.rs:
(80)
libstd/vec.rs:
(454)(1299)(578)(1318)
libstd/str.rs:
(699)(698)
libstd/sync/deque.rs:
(392)
libstd/rt/unwind.rs:
(123)..3more..


libstd/libc.rs:302:16-302:16 -struct- definition:
                pub struct in6_addr {
                    s6_addr: [u16, ..8]
references:-
310:                     ipv6mr_multiaddr: in6_addr,
299:                     sin6_addr: in6_addr,


libstd/libc.rs:524:16-524:16 -ty- definition:
                pub type c_int = i32;
                pub type c_uint = u32;
references:-
2458:             pub static _SC_OPEN_MAX : c_int = 4;
1938:             pub static MS_SYNC : c_int = 0x0004;
3420:                 pub fn exit(status: c_int) -> !;
4018:             pub fn madvise(addr: *c_void, len: size_t, advice: c_int)
3332:                 pub fn isgraph(c: c_int) -> c_int;
2048:             pub static EISCONN: c_int = 106;
3830:                 pub fn setenv(name: *c_char, val: *c_char, overwrite: c_int)
1984:             pub static ECHRNG: c_int = 44;
2414:             pub static PROT_GROWSUP : c_int = 0x020000000;
3919:                           address_len: *mut socklen_t) -> c_int;
1901:             pub static STDIN_FILENO : c_int = 0;
2030:             pub static ENOTSOCK: c_int = 88;
1990:             pub static ENOCSI: c_int = 50;
3376:                 pub fn ungetc(c: c_int, stream: *FILE) -> c_int;
2002:             pub static ENOSTR: c_int = 60;
2377:             pub static AF_UNIX: c_int = 1;
3872:                                      advice: c_int)
1955:             pub static EBUSY : c_int = 16;
2060:             pub static ENOTNAM: c_int = 118;
2487:             pub static _SC_SIGQUEUE_MAX : c_int = 34;
2369:             pub static MADV_DONTNEED : c_int = 4;
2498:             pub static _SC_2_C_BIND : c_int = 47;
2038:             pub static EPFNOSUPPORT: c_int = 96;
3768:                 pub fn munlock(addr: *c_void, len: size_t) -> c_int;
3916:                         address_len: socklen_t) -> c_int;
3643:                 pub fn open(path: *c_char, oflag: c_int, mode: c_int)
3739:                 pub fn tcgetpgrp(fd: c_int) -> pid_t;
3933:             pub fn sendto(socket: c_int, buf: *c_void, len: size_t,
3737:                 pub fn nanosleep(rqtp: *timespec, rmtp: *mut timespec) -> c_int;
3835:                 pub fn symlink(path1: *c_char, path2: *c_char) -> c_int;
(3707)(2067)(3334)(3367)(3912)(2315)(3335)(1972)(1957)(1856)(1986)(2029)(2309)(2070)(3767)(2379)(1885)(1917)(2468)(2333)(3392)(1999)(1914)(1881)(1923)(1922)(2320)(3375)(1950)(1982)(3676)(2316)(2504)(2074)(2051)(1946)(2032)(3699)(3446)(1913)(3698)(2455)(3846)(4019)(2326)(2373)(3414)(3601)(2470)(3924)(2500)(2062)(2010)(3832)(2501)(2384)(2482)(3833)(2380)(2034)
libstd/os.rs:
libstd/io/pipe.rs:
libstd/io/process.rs:
libstd/io/stdio.rs:
libstd/unstable/dynamic_lib.rs:
libstd/unstable/mutex.rs:
libstd/num/cmath.rs:
libstd/rt/rtio.rs:
libstd/rt/thread.rs:
libstd/rt/thread_local_storage.rs:
libstd/rt/unwind.rs:
libstd/rt/backtrace.rs:
libstd/num/f32.rs:
libstd/num/f64.rs:
libstd/libc.rs:
..536more..


libstd/libc.rs:534:16-534:16 -ty- definition:
                pub type suseconds_t = i64;
                pub type wchar_t = i32;
references:-
260:                     tv_usec: suseconds_t,


libstd/libc.rs:561:16-561:16 -ty- definition:
                pub type blksize_t = i64;
                pub type blkcnt_t = i64;
references:-
573:                     st_blksize: blksize_t,


libstd/libc.rs:212:12-212:12 -enum- definition:
            pub enum fpos_t {}
        }
references:-
3392:                 pub fn fsetpos(stream: *FILE, ptr: *fpos_t) -> c_int;
3391:                 pub fn fgetpos(stream: *FILE, ptr: *fpos_t) -> c_int;


libstd/libc.rs:552:16-552:16 -ty- definition:
                pub type ssize_t = i64;
            }
references:-
3745:                              offset: off_t) -> ssize_t;
3935:                           addrlen: socklen_t) -> ssize_t;
3932:                             addrlen: *mut socklen_t) -> ssize_t;
3747:                               offset: off_t) -> ssize_t;
3822:                                 -> ssize_t;
3927:                         flags: c_int) -> ssize_t;
3729:                             -> ssize_t;
3929:                         flags: c_int) -> ssize_t;
3743:                              -> ssize_t;


libstd/libc.rs:526:16-526:16 -ty- definition:
                pub type c_long = i64;
                pub type c_ulong = u64;
references:-
581:                     __unused: [c_long, ..3],
3407:                 pub fn labs(i: c_long) -> c_long;
3679:                 pub fn telldir(dirp: *DIR) -> c_long;
3413:                               -> c_long;
3678:                 pub fn seekdir(dirp: *DIR, loc: c_long);
265:                     tv_nsec: c_long,
3387:                 pub fn fseek(stream: *FILE, offset: c_long, whence: c_int)
3707:                 pub fn fpathconf(filedes: c_int, name: c_int) -> c_long;
578:                     st_mtime_nsec: c_long,
3738:                 pub fn sysconf(name: c_int) -> c_long;
3389:                 pub fn ftell(stream: *FILE) -> c_long;
3407:                 pub fn labs(i: c_long) -> c_long;
3725:                 pub fn pathconf(path: *c_char, name: c_int) -> c_long;
576:                     st_atime_nsec: c_long,
580:                     st_ctime_nsec: c_long,


libstd/libc.rs:551:16-551:16 -ty- definition:
                pub type mode_t = u32;
                pub type ssize_t = i64;
references:-
3612:                 pub fn mkdir(path: *c_char, mode: mode_t) -> c_int;
3600:                 pub fn chmod(path: *c_char, mode: mode_t) -> c_int;
3786:                 pub fn shm_open(name: *c_char, oflag: c_int, mode: mode_t)
3645:                 pub fn creat(path: *c_char, mode: mode_t) -> c_int;
3613:                 pub fn mkfifo(path: *c_char, mode: mode_t) -> c_int;
567:                     st_mode: mode_t,
3601:                 pub fn fchmod(fd: c_int, mode: mode_t) -> c_int;


libstd/libc.rs:538:16-538:16 -ty- definition:
                pub type c_longlong = i64;
                pub type c_ulonglong = u64;
references:-
libstd/unstable/mutex.rs:
342:             __align: libc::c_longlong,
346:             __align: libc::c_longlong,


libstd/libc.rs:527:16-527:16 -ty- definition:
                pub type c_ulong = u64;
                pub type c_float = f32;
references:-
3415:                                -> c_ulong;
244:                 pub type pthread_t = c_ulong;


libstd/libc.rs:263:16-263:16 -struct- definition:
                pub struct timespec {
                    tv_sec: time_t,
references:-
3737:                 pub fn nanosleep(rqtp: *timespec, rmtp: *mut timespec) -> c_int;
..1more..


libstd/libc.rs:584:16-584:16 -struct- definition:
                pub struct utimbuf {
                    actime: time_t,
references:-
3748:                 pub fn utime(file: *c_char, buf: *utimbuf) -> c_int;


libstd/libc.rs:246:16-246:16 -struct- definition:
                pub struct glob_t {
                    gl_pathc: size_t,
references:-
3861:                 pub fn globfree(pglob: *mut glob_t);
3860:                             pglob: *mut glob_t);


libstd/libc.rs:560:16-560:16 -ty- definition:
                pub type nlink_t = u64;
                pub type blksize_t = i64;
references:-
566:                     st_nlink: nlink_t,


libstd/libc.rs:276:16-276:16 -ty- definition:
                pub type in_addr_t = u32;
                pub struct sockaddr {
references:-
293:                     s_addr: in_addr_t,