Bug 1324920 - Update mozjs_sys vendored crates. r?ted,sfink draft
authorRalph Giles <giles@mozilla.com>
Tue, 20 Dec 2016 14:24:05 -0800
changeset 451732 75dea725f30b8928753713d656d45de7b54dd4a4
parent 451656 7083c0d30e75fc102c715887af9faec933e936f8
child 540114 17d2ac23fb730c0ce73a5c8f34dfb6e746970fd9
push id39274
push userbmo:giles@thaumas.net
push dateTue, 20 Dec 2016 22:34:22 +0000
reviewersted, sfink
bugs1324920
milestone53.0a1
Bug 1324920 - Update mozjs_sys vendored crates. r?ted,sfink Update the vendored third-party dependencies for the mozjs-sys crate. This picks up recent bug-fixes and reduces noise in unrelated runs of 'mach vendor'. The libc crate is also used by the rust url parser. gcc 0.3.35 -> 0.3.40 libc 0.2.16 -> 0.2.18 libz-sys 1.0.6 -> 1.0.10 MozReview-Commit-ID: 5ri4nOtQQ1n
js/src/Cargo.lock
third_party/rust/gcc/.cargo-checksum.json
third_party/rust/gcc/.travis.yml
third_party/rust/gcc/Cargo.toml
third_party/rust/gcc/appveyor.yml
third_party/rust/gcc/src/lib.rs
third_party/rust/gcc/src/windows_registry.rs
third_party/rust/gcc/tests/support/mod.rs
third_party/rust/gcc/tests/test.rs
third_party/rust/libc/.cargo-checksum.json
third_party/rust/libc/.travis.yml
third_party/rust/libc/Cargo.toml
third_party/rust/libc/README.md
third_party/rust/libc/appveyor.yml
third_party/rust/libc/ci/docker/aarch64-unknown-linux-gnu/Dockerfile
third_party/rust/libc/ci/docker/arm-linux-androideabi/Dockerfile
third_party/rust/libc/ci/docker/arm-linux-androideabi/accept-licenses.sh
third_party/rust/libc/ci/docker/arm-linux-androideabi/install-ndk.sh
third_party/rust/libc/ci/docker/arm-linux-androideabi/install-sdk.sh
third_party/rust/libc/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile
third_party/rust/libc/ci/docker/i686-unknown-linux-gnu/Dockerfile
third_party/rust/libc/ci/docker/i686-unknown-linux-musl/Dockerfile
third_party/rust/libc/ci/docker/mips-unknown-linux-gnu/Dockerfile
third_party/rust/libc/ci/docker/mips-unknown-linux-musl/Dockerfile
third_party/rust/libc/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile
third_party/rust/libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile
third_party/rust/libc/ci/docker/powerpc-unknown-linux-gnu/Dockerfile
third_party/rust/libc/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile
third_party/rust/libc/ci/docker/x86_64-unknown-freebsd/Dockerfile
third_party/rust/libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile
third_party/rust/libc/ci/docker/x86_64-unknown-linux-musl/Dockerfile
third_party/rust/libc/ci/docker/x86_64-unknown-openbsd/Dockerfile
third_party/rust/libc/ci/run-docker.sh
third_party/rust/libc/ci/run-qemu.sh
third_party/rust/libc/ci/run.sh
third_party/rust/libc/src/lib.rs
third_party/rust/libc/src/redox.rs
third_party/rust/libc/src/unix/bsd/apple/mod.rs
third_party/rust/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
third_party/rust/libc/src/unix/bsd/freebsdlike/mod.rs
third_party/rust/libc/src/unix/bsd/mod.rs
third_party/rust/libc/src/unix/bsd/netbsdlike/mod.rs
third_party/rust/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
third_party/rust/libc/src/unix/bsd/netbsdlike/netbsd/other/b32/mod.rs
third_party/rust/libc/src/unix/bsd/netbsdlike/netbsd/other/b64/mod.rs
third_party/rust/libc/src/unix/bsd/netbsdlike/netbsd/other/mod.rs
third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/bitrig.rs
third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs
third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs
third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/other/b64/mod.rs
third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs
third_party/rust/libc/src/unix/bsd/openbsdlike/bitrig.rs
third_party/rust/libc/src/unix/bsd/openbsdlike/mod.rs
third_party/rust/libc/src/unix/bsd/openbsdlike/netbsd.rs
third_party/rust/libc/src/unix/bsd/openbsdlike/openbsd.rs
third_party/rust/libc/src/unix/haiku/b32.rs
third_party/rust/libc/src/unix/haiku/b64.rs
third_party/rust/libc/src/unix/haiku/mod.rs
third_party/rust/libc/src/unix/mod.rs
third_party/rust/libc/src/unix/notbsd/android/mod.rs
third_party/rust/libc/src/unix/notbsd/linux/mips.rs
third_party/rust/libc/src/unix/notbsd/linux/mips/mips32.rs
third_party/rust/libc/src/unix/notbsd/linux/mips/mips64.rs
third_party/rust/libc/src/unix/notbsd/linux/mips/mod.rs
third_party/rust/libc/src/unix/notbsd/linux/mips64.rs
third_party/rust/libc/src/unix/notbsd/linux/mod.rs
third_party/rust/libc/src/unix/notbsd/linux/musl/b32/arm.rs
third_party/rust/libc/src/unix/notbsd/linux/musl/b32/asmjs.rs
third_party/rust/libc/src/unix/notbsd/linux/musl/b32/mips.rs
third_party/rust/libc/src/unix/notbsd/linux/musl/b32/x86.rs
third_party/rust/libc/src/unix/notbsd/linux/musl/b64/mod.rs
third_party/rust/libc/src/unix/notbsd/linux/musl/mod.rs
third_party/rust/libc/src/unix/notbsd/linux/other/b32/arm.rs
third_party/rust/libc/src/unix/notbsd/linux/other/b32/powerpc.rs
third_party/rust/libc/src/unix/notbsd/linux/other/b32/x86.rs
third_party/rust/libc/src/unix/notbsd/linux/other/b64/aarch64.rs
third_party/rust/libc/src/unix/notbsd/linux/other/b64/mod.rs
third_party/rust/libc/src/unix/notbsd/linux/other/b64/x86_64.rs
third_party/rust/libc/src/unix/notbsd/linux/other/mod.rs
third_party/rust/libc/src/unix/notbsd/linux/s390x.rs
third_party/rust/libc/src/unix/notbsd/mod.rs
third_party/rust/libc/src/unix/solaris/mod.rs
third_party/rust/libc/src/windows.rs
third_party/rust/libz-sys/.cargo-checksum.json
third_party/rust/libz-sys/.travis.yml
third_party/rust/libz-sys/Cargo.toml
third_party/rust/libz-sys/appveyor.yml
third_party/rust/libz-sys/build.rs
toolkit/library/gtest/rust/Cargo.lock
toolkit/library/rust/Cargo.lock
--- a/js/src/Cargo.lock
+++ b/js/src/Cargo.lock
@@ -1,38 +1,38 @@
 [root]
 name = "mozjs_sys"
 version = "0.0.0"
 dependencies = [
- "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
- "libz-sys 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libz-sys 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "gcc"
-version = "0.3.35"
+version = "0.3.40"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "libc"
-version = "0.2.16"
+version = "0.2.18"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "libz-sys"
-version = "1.0.6"
+version = "1.0.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "gcc 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gcc 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
  "pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "pkg-config"
 version = "0.3.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [metadata]
-"checksum gcc 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)" = "91ecd03771effb0c968fd6950b37e89476a578aaf1c70297d8e92b6516ec3312"
-"checksum libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)" = "408014cace30ee0f767b1c4517980646a573ec61a57957aeeabcac8ac0a02e8d"
-"checksum libz-sys 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "40f2df7730b5d29426c3e44ce4d088d8c5def6471c2c93ba98585b89fb201ce6"
+"checksum gcc 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "872db9e59486ef2b14f8e8c10e9ef02de2bccef6363d7f34835dedb386b3d950"
+"checksum libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "a51822fc847e7a8101514d1d44e354ba2ffa7d4c194dcab48870740e327cac70"
+"checksum libz-sys 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "905c72a0c260bcd89ddca5afa1c46bebd29b52878a3d58c86865ea42402f88e6"
 "checksum pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8cee804ecc7eaf201a4a207241472cc870e825206f6c031e3ee2a72fa425f2fa"
--- a/third_party/rust/gcc/.cargo-checksum.json
+++ b/third_party/rust/gcc/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"f9b1ca6ae27d1c18215265024629a8960c31379f206d9ed20f64e0b2dcf79805",".travis.yml":"5cee7774cf6d876246a0ae0f8362cceeecec5924b751049c945faac9342565ff","Cargo.toml":"2f9146c71ba5dee801cc2e4c527902408c221b10ef67cd48c5d13802447d7557","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"ecb2d93f4c81edbd48d8742ff7887dc0a4530a5890967839090bbc972d49bebe","appveyor.yml":"0ae8475d1be56af48cbb6a7bf774c6167c88ddaea96f2eca4f4c190dd6dab5e4","src/bin/gcc-shim.rs":"11edfe1fc6f932bd42ffffda5145833302bc163e0b87dc0d54f4bd0997ad4708","src/lib.rs":"a62a24a2703d744f5a6308d48c20938ca08fe246395a6bd6a76dd33ee3729654","src/registry.rs":"3e2a42581ebb82e325dd5600c6571cef937b35003b2927dc618967f5238a2058","src/windows_registry.rs":"80b1556b1a94ae46b444268f8e74b9ac4ddd7e6d2b98eca8ae643a8bd099abe1","tests/cc_env.rs":"d92c5e3d3d43ac244e63b2cd2c93a521fcf124bf1ccf8d4c6bfa7f8333d88976","tests/support/mod.rs":"d11ed0db4dda5ecf5fb970c9b0c56428cd47421a2742f07032e2cc6b0a0f07e2","tests/test.rs":"4ef5c34f6d8954e64c97c2876e2697dad5efc7e1dacef4b567931ed3970425c6"},"package":"91ecd03771effb0c968fd6950b37e89476a578aaf1c70297d8e92b6516ec3312"}
\ No newline at end of file
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"f9b1ca6ae27d1c18215265024629a8960c31379f206d9ed20f64e0b2dcf79805",".travis.yml":"675ffe583db77282d010306f29e6d81e5070ab081deddd0300137dfbd2cb83de","Cargo.toml":"19bb617b74de761515ef5d087fd0e30912fda1d7c22fd04fa211236dab99a509","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"ecb2d93f4c81edbd48d8742ff7887dc0a4530a5890967839090bbc972d49bebe","appveyor.yml":"46c77d913eaa45871296942c2cd96ef092c9dcaf19201cb5c500a5107faeb06f","src/bin/gcc-shim.rs":"11edfe1fc6f932bd42ffffda5145833302bc163e0b87dc0d54f4bd0997ad4708","src/lib.rs":"7e7c60beccfdd145e876da81bb07dd09c5248dab0b26d93190bab4242799d51a","src/registry.rs":"3e2a42581ebb82e325dd5600c6571cef937b35003b2927dc618967f5238a2058","src/windows_registry.rs":"1f4211caec5a192b5f05c8a47efb27aa6a0ab976c659b9318a0cf603a28d6746","tests/cc_env.rs":"d92c5e3d3d43ac244e63b2cd2c93a521fcf124bf1ccf8d4c6bfa7f8333d88976","tests/support/mod.rs":"f4dad5a8133c3dd6678d9a3de057b82e624ef547b9b3e4ac9508a48962fc387b","tests/test.rs":"164220f11be2eebc20315826513999970660a82feff8cc4b15b4e9d73d98324e"},"package":"872db9e59486ef2b14f8e8c10e9ef02de2bccef6363d7f34835dedb386b3d950"}
\ No newline at end of file
--- a/third_party/rust/gcc/.travis.yml
+++ b/third_party/rust/gcc/.travis.yml
@@ -14,22 +14,24 @@ before_script:
 script:
   - cargo build --verbose
   - cargo test --verbose
   - cargo test --verbose --features parallel
   - cargo test --manifest-path gcc-test/Cargo.toml --target $TARGET
   - cargo test --manifest-path gcc-test/Cargo.toml --target $TARGET --features parallel
   - cargo test --manifest-path gcc-test/Cargo.toml --target $TARGET --release
   - cargo doc
+  - cargo clean && cargo build
   - rustdoc --test README.md -L target/debug -L target/debug/deps
 after_success:
   - travis-cargo --only nightly doc-upload
 env:
   global:
-    secure: ilbcq9zX+UaiBcwqkBGldeanbEQus9npLsi0/nF1PUxKbQsoWSVtVOehAD8Hy92D3hX2npIRyNL8GxBn85XEcBYc1h7DiWUhLcXfZie79v8Ly/qboHCfZLXlB1ofbypbyQfouEdOE9zHf0ZILYVpAgUkliv6KuVShsrKNlbn4QE=
+    secure: "CBtqrudgE0PS8x3kTr44jKbC2D4nfnmdYVecooNm0qnER4B4TSvZpZSQoCgKK6k4BYQuOSyFTOwYx6M79w39ZMOgyCP9ytB+tyMWL0/+ZuUQL04yVg4M5vd3oJMkOaXbvG56ncgPyFrseY+FPDg+mXAzvJk/nily37YXjkQj2D0="
+
   matrix:
     - ARCH=x86_64
     - ARCH=i686
 notifications:
   email:
     on_success: never
 os:
   - linux
--- a/third_party/rust/gcc/Cargo.toml
+++ b/third_party/rust/gcc/Cargo.toml
@@ -1,12 +1,12 @@
 [package]
 
 name = "gcc"
-version = "0.3.35"
+version = "0.3.40"
 authors = ["Alex Crichton <alex@alexcrichton.com>"]
 license = "MIT/Apache-2.0"
 repository = "https://github.com/alexcrichton/gcc-rs"
 documentation = "http://alexcrichton.com/gcc-rs"
 description = """
 A build-time dependency for Cargo build scripts to assist in invoking the native
 C compiler to compile native C code into a static archive to be linked into Rust
 code.
--- a/third_party/rust/gcc/appveyor.yml
+++ b/third_party/rust/gcc/appveyor.yml
@@ -23,13 +23,13 @@ install:
   - set PATH=%PATH%;C:\Program Files (x86)\Rust\bin
   - if defined MSYS_BITS set PATH=%PATH%;C:\msys64\mingw%MSYS_BITS%\bin
   - rustc -V
   - cargo -V
 
 build: false
 
 test_script:
-  - cargo test
-  - cargo test --features parallel
-  - cargo test --manifest-path gcc-test/Cargo.toml
-  - cargo test --manifest-path gcc-test/Cargo.toml --features parallel
-  - cargo test --manifest-path gcc-test/Cargo.toml --release
+  - cargo test --target %TARGET%
+  - cargo test --features parallel --target %TARGET%
+  - cargo test --manifest-path gcc-test/Cargo.toml --target %TARGET%
+  - cargo test --manifest-path gcc-test/Cargo.toml --features parallel --target %TARGET%
+  - cargo test --manifest-path gcc-test/Cargo.toml --release --target %TARGET%
--- a/third_party/rust/gcc/src/lib.rs
+++ b/third_party/rust/gcc/src/lib.rs
@@ -69,17 +69,17 @@ pub struct Config {
     flags: Vec<String>,
     files: Vec<PathBuf>,
     cpp: bool,
     cpp_link_stdlib: Option<Option<String>>,
     cpp_set_stdlib: Option<String>,
     target: Option<String>,
     host: Option<String>,
     out_dir: Option<PathBuf>,
-    opt_level: Option<u32>,
+    opt_level: Option<String>,
     debug: Option<bool>,
     env: Vec<(OsString, OsString)>,
     compiler: Option<PathBuf>,
     archiver: Option<PathBuf>,
     cargo_metadata: bool,
     pic: Option<bool>,
 }
 
@@ -245,17 +245,26 @@ impl Config {
         self
     }
 
     /// Configures the optimization level of the generated object files.
     ///
     /// This option is automatically scraped from the `OPT_LEVEL` environment
     /// variable by build scripts, so it's not required to call this function.
     pub fn opt_level(&mut self, opt_level: u32) -> &mut Config {
-        self.opt_level = Some(opt_level);
+        self.opt_level = Some(opt_level.to_string());
+        self
+    }
+
+    /// Configures the optimization level of the generated object files.
+    ///
+    /// This option is automatically scraped from the `OPT_LEVEL` environment
+    /// variable by build scripts, so it's not required to call this function.
+    pub fn opt_level_str(&mut self, opt_level: &str) -> &mut Config {
+        self.opt_level = Some(opt_level.to_string());
         self
     }
 
     /// Configures whether the compiler will emit debug information when
     /// generating object files.
     ///
     /// This option is automatically scraped from the `PROFILE` environment
     /// variable by build scripts (only enabled when the profile is "debug"), so
@@ -339,16 +348,33 @@ impl Config {
             };
             fs::create_dir_all(&obj.parent().unwrap()).unwrap();
             src_dst.push((file.to_path_buf(), obj.clone()));
             objects.push(obj);
         }
         self.compile_objects(&src_dst);
         self.assemble(lib_name, &dst.join(output), &objects);
 
+        if self.get_target().contains("msvc") {
+            let compiler = self.get_base_compiler();
+            let atlmfc_lib = compiler.env().iter().find(|&&(ref var, _)| {
+                var == OsStr::new("LIB")
+            }).and_then(|&(_, ref lib_paths)| {
+                env::split_paths(lib_paths).find(|path| {
+                    let sub = Path::new("atlmfc/lib");
+                    path.ends_with(sub) || path.parent().map_or(false, |p| p.ends_with(sub))
+                })
+            });
+
+            if let Some(atlmfc_lib) = atlmfc_lib {
+                self.print(&format!("cargo:rustc-link-search=native={}",
+                                    atlmfc_lib.display()));
+            }
+        }
+
         self.print(&format!("cargo:rustc-link-lib=static={}",
                             &output[3..output.len() - 2]));
         self.print(&format!("cargo:rustc-link-search=native={}", dst.display()));
 
         // Add specific C++ libraries, if enabled.
         if self.cpp {
             if let Some(stdlib) = self.get_cpp_link_stdlib() {
                 self.print(&format!("cargo:rustc-link-lib={}", stdlib));
@@ -432,24 +458,30 @@ impl Config {
 
         let mut cmd = self.get_base_compiler();
         let nvcc = cmd.path.to_str()
             .map(|path| path.contains("nvcc"))
             .unwrap_or(false);
 
         if msvc {
             cmd.args.push("/nologo".into());
-            cmd.args.push("/MD".into()); // link against msvcrt.dll for now
-            if opt_level != 0 {
-                cmd.args.push("/O2".into());
+            let features = env::var("CARGO_CFG_TARGET_FEATURE")
+                              .unwrap_or(String::new());
+            if features.contains("crt-static") {
+                cmd.args.push("/MT".into());
+            } else {
+                cmd.args.push("/MD".into());
             }
-            if target.contains("i686") {
-                cmd.args.push("/SAFESEH".into());
-            } else if target.contains("i586") {
-                cmd.args.push("/SAFESEH".into());
+            match &opt_level[..] {
+                "z" | "s" => cmd.args.push("/Os".into()),
+                "2" => cmd.args.push("/O2".into()),
+                "1" => cmd.args.push("/O1".into()),
+                _ => {}
+            }
+            if target.contains("i586") {
                 cmd.args.push("/ARCH:IA32".into());
             }
         } else if nvcc {
             cmd.args.push(format!("-O{}", opt_level).into());
         } else {
             cmd.args.push(format!("-O{}", opt_level).into());
             cmd.args.push("-ffunction-sections".into());
             cmd.args.push("-fdata-sections".into());
@@ -472,33 +504,78 @@ impl Config {
             }
 
             if !nvcc && self.pic.unwrap_or(!target.contains("i686") && !target.contains("windows-gnu")) {
                 cmd.args.push("-fPIC".into());
             } else if nvcc && self.pic.unwrap_or(false) {
                 cmd.args.push("-Xcompiler".into());
                 cmd.args.push("\'-fPIC\'".into());
             }
+
             if target.contains("musl") {
                 cmd.args.push("-static".into());
             }
 
+            // armv7 targets get to use armv7 instructions
             if target.starts_with("armv7-unknown-linux-") {
                 cmd.args.push("-march=armv7-a".into());
             }
+
+            // On android we can guarantee some extra float instructions
+            // (specified in the android spec online)
+            if target.starts_with("armv7-linux-androideabi") {
+                cmd.args.push("-march=armv7-a".into());
+                cmd.args.push("-mfpu=vfpv3-d16".into());
+            }
+
+            // For us arm == armv6 by default
             if target.starts_with("arm-unknown-linux-") {
                 cmd.args.push("-march=armv6".into());
                 cmd.args.push("-marm".into());
             }
+
+            // Turn codegen down on i586 to avoid some instructions.
             if target.starts_with("i586-unknown-linux-") {
                 cmd.args.push("-march=pentium".into());
             }
+
+            // Set codegen level for i686 correctly
             if target.starts_with("i686-unknown-linux-") {
                 cmd.args.push("-march=i686".into());
             }
+
+            // Looks like `musl-gcc` makes is hard for `-m32` to make its way
+            // all the way to the linker, so we need to actually instruct the
+            // linker that we're generating 32-bit executables as well. This'll
+            // typically only be used for build scripts which transitively use
+            // these flags that try to compile executables.
+            if target == "i686-unknown-linux-musl" {
+                cmd.args.push("-Wl,-melf_i386".into());
+            }
+
+            if target.starts_with("thumb") {
+                cmd.args.push("-mthumb".into());
+
+                if target.ends_with("eabihf") {
+                    cmd.args.push("-mfloat-abi=hard".into())
+                }
+            }
+            if target.starts_with("thumbv6m") {
+                cmd.args.push("-march=armv6s-m".into());
+            }
+            if target.starts_with("thumbv7em") {
+                cmd.args.push("-march=armv7e-m".into());
+
+                if target.ends_with("eabihf") {
+                    cmd.args.push("-mfpu=fpv4-sp-d16".into())
+                }
+            }
+            if target.starts_with("thumbv7m") {
+                cmd.args.push("-march=armv7-m".into());
+            }
         }
 
         if self.cpp && !msvc {
             if let Some(ref stdlib) = self.cpp_set_stdlib {
                 cmd.args.push(format!("-stdlib=lib{}", stdlib).into());
             }
         }
 
@@ -574,17 +651,17 @@ impl Config {
             let _ = fs::remove_file(&lib_dst);
             fs::hard_link(&dst, &lib_dst).or_else(|_| {
                 //if hard-link fails, just copy (ignoring the number of bytes written)
                 fs::copy(&dst, &lib_dst).map(|_| ())
             }).ok().expect("Copying from {:?} to {:?} failed.");;
         } else {
             let ar = self.get_ar();
             let cmd = ar.file_name().unwrap().to_string_lossy();
-            run(self.cmd(&ar).arg("crus")
+            run(self.cmd(&ar).arg("crs")
                                  .arg(dst)
                                  .args(objects)
                                  .args(&self.objects), &cmd);
         }
     }
 
     fn ios_flags(&self, cmd: &mut Tool) {
         enum ArchSpec {
@@ -654,47 +731,75 @@ impl Config {
         };
         self.env_tool(env).map(|(tool, args)| {
             let mut t = Tool::new(PathBuf::from(tool));
             for arg in args {
                 t.args.push(arg.into());
             }
             return t
         }).or_else(|| {
+            if target.contains("emscripten") {
+                if self.cpp {
+                    Some(Tool::new(PathBuf::from("em++")))
+                } else {
+                    Some(Tool::new(PathBuf::from("emcc")))
+                }
+            } else {
+                None
+            }
+        }).or_else(|| {
             windows_registry::find_tool(&target, "cl.exe")
         }).unwrap_or_else(|| {
             let compiler = if host.contains("windows") &&
                               target.contains("windows") {
                 if target.contains("msvc") {
                     msvc.to_string()
                 } else {
                     format!("{}.exe", gnu)
                 }
             } else if target.contains("android") {
                 format!("{}-{}", target, gnu)
             } else if self.get_host() != target {
-                let prefix = match &target[..] {
+                // CROSS_COMPILE is of the form: "arm-linux-gnueabi-"
+                let cc_env = self.getenv("CROSS_COMPILE");
+                let cross_compile = cc_env.as_ref().map(|s| s.trim_right_matches('-'));
+                let prefix = cross_compile.or(match &target[..] {
                     "aarch64-unknown-linux-gnu" => Some("aarch64-linux-gnu"),
                     "arm-unknown-linux-gnueabi" => Some("arm-linux-gnueabi"),
                     "arm-unknown-linux-gnueabihf"  => Some("arm-linux-gnueabihf"),
-                    "armv7-unknown-linux-gnueabihf" => Some("arm-linux-gnueabihf"),
                     "arm-unknown-linux-musleabi" => Some("arm-linux-musleabi"),
                     "arm-unknown-linux-musleabihf"  => Some("arm-linux-musleabihf"),
+                    "arm-unknown-netbsdelf-eabi" => Some("arm--netbsdelf-eabi"),
+                    "armv6-unknown-netbsdelf-eabihf" => Some("armv6--netbsdelf-eabihf"),
+                    "armv7-unknown-linux-gnueabihf" => Some("arm-linux-gnueabihf"),
                     "armv7-unknown-linux-musleabihf" => Some("arm-linux-musleabihf"),
+                    "armv7-unknown-netbsdelf-eabihf" => Some("armv7--netbsdelf-eabihf"),
+                    "i686-pc-windows-gnu" => Some("i686-w64-mingw32"),
+                    "i686-unknown-linux-musl" => Some("musl"),
+                    "i686-unknown-netbsdelf" => Some("i486--netbsdelf"),
+                    "mips-unknown-linux-gnu" => Some("mips-linux-gnu"),
+                    "mipsel-unknown-linux-gnu" => Some("mipsel-linux-gnu"),
+                    "mips64-unknown-linux-gnuabi64" => Some("mips64-linux-gnuabi64"),
+                    "mips64el-unknown-linux-gnuabi64" => Some("mips64el-linux-gnuabi64"),
                     "powerpc-unknown-linux-gnu" => Some("powerpc-linux-gnu"),
+                    "powerpc-unknown-netbsd" => Some("powerpc--netbsd"),
                     "powerpc64-unknown-linux-gnu" => Some("powerpc-linux-gnu"),
                     "powerpc64le-unknown-linux-gnu" => Some("powerpc64le-linux-gnu"),
-                    "mips-unknown-linux-gnu" => Some("mips-linux-gnu"),
-                    "mipsel-unknown-linux-gnu" => Some("mipsel-linux-gnu"),
-                    "i686-pc-windows-gnu" => Some("i686-w64-mingw32"),
+                    "s390x-unknown-linux-gnu" => Some("s390x-linux-gnu"),
+                    "sparc64-unknown-netbsd" => Some("sparc64--netbsd"),
+                    "thumbv6m-none-eabi" => Some("arm-none-eabi"),
+                    "thumbv7em-none-eabi" => Some("arm-none-eabi"),
+                    "thumbv7em-none-eabihf" => Some("arm-none-eabi"),
+                    "thumbv7m-none-eabi" => Some("arm-none-eabi"),
                     "x86_64-pc-windows-gnu" => Some("x86_64-w64-mingw32"),
+                    "x86_64-rumprun-netbsd" => Some("x86_64-rumprun-netbsd"),
                     "x86_64-unknown-linux-musl" => Some("musl"),
-                    "x86_64-rumprun-netbsd" => Some("x86_64-rumprun-netbsd"),
+                    "x86_64-unknown-netbsd" => Some("x86_64--netbsd"),
                     _ => None,
-                };
+                });
                 match prefix {
                     Some(prefix) => format!("{}-{}", prefix, gnu),
                     None => default.to_string(),
                 }
             } else {
                 default.to_string()
             };
             Tool::new(PathBuf::from(compiler))
@@ -741,45 +846,49 @@ impl Config {
     /// for OS X and `libstdc++` for anything else.
     fn get_cpp_link_stdlib(&self) -> Option<String> {
         self.cpp_link_stdlib.clone().unwrap_or_else(|| {
             let target = self.get_target();
             if target.contains("msvc") {
                 None
             } else if target.contains("darwin") {
                 Some("c++".to_string())
+            } else if target.contains("freebsd") {
+                Some("c++".to_string())
             } else {
                 Some("stdc++".to_string())
             }
         })
     }
 
     fn get_ar(&self) -> PathBuf {
         self.archiver.clone().or_else(|| {
             self.get_var("AR").map(PathBuf::from).ok()
         }).unwrap_or_else(|| {
             if self.get_target().contains("android") {
                 PathBuf::from(format!("{}-ar", self.get_target()))
+            } else if self.get_target().contains("emscripten") {
+                PathBuf::from("emar")
             } else {
                 PathBuf::from("ar")
             }
         })
     }
 
     fn get_target(&self) -> String {
         self.target.clone().unwrap_or_else(|| self.getenv_unwrap("TARGET"))
     }
 
     fn get_host(&self) -> String {
         self.host.clone().unwrap_or_else(|| self.getenv_unwrap("HOST"))
     }
 
-    fn get_opt_level(&self) -> u32 {
-        self.opt_level.unwrap_or_else(|| {
-            self.getenv_unwrap("OPT_LEVEL").parse().unwrap()
+    fn get_opt_level(&self) -> String {
+        self.opt_level.as_ref().cloned().unwrap_or_else(|| {
+            self.getenv_unwrap("OPT_LEVEL")
         })
     }
 
     fn get_debug(&self) -> bool {
         self.debug.unwrap_or_else(|| self.getenv_unwrap("PROFILE") == "debug")
     }
 
     fn get_out_dir(&self) -> PathBuf {
--- a/third_party/rust/gcc/src/windows_registry.rs
+++ b/third_party/rust/gcc/src/windows_registry.rs
@@ -206,16 +206,21 @@ pub fn find_tool(target: &str, tool: &st
         }).map(|(path, host)| {
             let mut tool = MsvcTool::new(path);
             tool.path.push(host);
             tool
         }).filter_map(|mut tool| {
             let sub = otry!(vc_lib_subdir(target));
             tool.libs.push(path.join("lib").join(sub));
             tool.include.push(path.join("include"));
+            let atlmfc_path = path.join("atlmfc");
+            if atlmfc_path.exists() {
+                tool.libs.push(atlmfc_path.join("lib").join(sub));
+                tool.include.push(atlmfc_path.join("include"));
+            }
             Some(tool)
         }).next()
     }
 
     // To find MSVC we look in a specific registry key for the version we are
     // trying to find.
     fn get_vc_dir(ver: &str) -> Option<PathBuf> {
         let key = r"SOFTWARE\Microsoft\VisualStudio\SxS\VC7";
@@ -309,41 +314,43 @@ pub fn find_tool(target: &str, tool: &st
     // the folder of the host toolchain for that tool which is essential when
     // using a cross linker. We return a Vec since on x64 there are often two
     // linkers that can target the architecture we desire. The 64-bit host
     // linker is preferred, and hence first, due to 64-bit allowing it more
     // address space to work with and potentially being faster.
     fn bin_subdir(target: &str) -> Vec<(&'static str, &'static str)> {
         let arch = target.split('-').next().unwrap();
         match (arch, host_arch()) {
+            ("i586", X86) |
             ("i686", X86) => vec![("", "")],
+            ("i586", X86_64) |
             ("i686", X86_64) => vec![("amd64_x86", "amd64"), ("", "")],
             ("x86_64", X86) => vec![("x86_amd64", "")],
             ("x86_64", X86_64) => vec![("amd64", "amd64"), ("x86_amd64", "")],
             ("arm", X86) => vec![("x86_arm", "")],
             ("arm", X86_64) => vec![("amd64_arm", "amd64"), ("x86_arm", "")],
             _ => vec![],
         }
     }
 
     fn lib_subdir(target: &str) -> Option<&'static str> {
         let arch = target.split('-').next().unwrap();
         match arch {
-            "i686" => Some("x86"),
+            "i586" | "i686" => Some("x86"),
             "x86_64" => Some("x64"),
             "arm" => Some("arm"),
             _ => None,
         }
     }
 
     // MSVC's x86 libraries are not in a subfolder
     fn vc_lib_subdir(target: &str) -> Option<&'static str> {
         let arch = target.split('-').next().unwrap();
         match arch {
-            "i686" => Some(""),
+            "i586" | "i686" => Some(""),
             "x86_64" => Some("amd64"),
             "arm" => Some("arm"),
             _ => None,
         }
     }
 
     #[allow(bad_style)]
     fn host_arch() -> u16 {
--- a/third_party/rust/gcc/tests/support/mod.rs
+++ b/third_party/rust/gcc/tests/support/mod.rs
@@ -18,16 +18,19 @@ pub struct Test {
 pub struct Execution {
     args: Vec<String>,
 }
 
 impl Test {
     pub fn new() -> Test {
         let mut gcc = PathBuf::from(env::current_exe().unwrap());
         gcc.pop();
+        if gcc.ends_with("deps") {
+            gcc.pop();
+        }
         gcc.push(format!("gcc-shim{}", env::consts::EXE_SUFFIX));
         Test {
             td: TempDir::new("gcc-test").unwrap(),
             gcc: gcc,
             msvc: false,
         }
     }
 
--- a/third_party/rust/gcc/tests/test.rs
+++ b/third_party/rust/gcc/tests/test.rs
@@ -27,16 +27,30 @@ fn gnu_opt_level_1() {
         .opt_level(1)
         .file("foo.c").compile("libfoo.a");
 
     test.cmd(0).must_have("-O1")
                .must_not_have("-O2");
 }
 
 #[test]
+fn gnu_opt_level_s() {
+    let test = Test::gnu();
+    test.gcc()
+        .opt_level_str("s")
+        .file("foo.c").compile("libfoo.a");
+
+    test.cmd(0).must_have("-Os")
+               .must_not_have("-O1")
+               .must_not_have("-O2")
+               .must_not_have("-O3")
+               .must_not_have("-Oz");
+}
+
+#[test]
 fn gnu_debug() {
     let test = Test::gnu();
     test.gcc()
         .debug(true)
         .file("foo.c").compile("libfoo.a");
     test.cmd(0).must_have("-g");
 }
 
--- a/third_party/rust/libc/.cargo-checksum.json
+++ b/third_party/rust/libc/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"7150ee9391a955b2ef7e0762fc61c0c1aab167620ca36d88d78062d93b8334ba",".travis.yml":"408ea7ebf4efd8760be7ee2bede160f95eacc79fd64361eb9d416aa3469c8562","Cargo.toml":"f467b45e724b7fcb97936997c026f1950847a5c240a17581ccb27c9051dc8498","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"6294cbbc2515a519dc3f1bb50573bb83f4fbb24cfc093a1d7f2a9cdd2240a3b7","appveyor.yml":"2d5f521a9166515b085b7e2d330152b717589815fd2471adab57cf1191638ac0","ci/README.md":"be804f15e2128e5fd4b160cb0b13cff5f19e7d77b55ec5254aa6fd8731c84f0d","ci/docker/aarch64-unknown-linux-gnu/Dockerfile":"e3a31e7e899bb3976f26a2be6f075ab329777bebe893cfeea70020f7e2868661","ci/docker/arm-linux-androideabi/Dockerfile":"c3d60f2ba389e60e59cb6973542751c66a0e7bd484e11589c8ee7346e9ff2bab","ci/docker/arm-unknown-linux-gnueabihf/Dockerfile":"1e9bd9c78bbd5a046043edf89f64772d69f447e4c8d88f23d44faa7d68e15c52","ci/docker/i686-unknown-linux-gnu/Dockerfile":"8fdba666cd9356fd4532de06d799d3c487abd870509362c3892a5193a1b7c94e","ci/docker/i686-unknown-linux-musl/Dockerfile":"efd110211fc9489aeb063a40a69e3a24f4d7f6174343dd203859d61e47403290","ci/docker/mips-unknown-linux-gnu/Dockerfile":"cc65290d3e5f189be836a0883fac41bbe709d1437a6691c3cbe18104f7c55277","ci/docker/mipsel-unknown-linux-musl/Dockerfile":"aace107e36ff42af705f0b652bb935982048a6c657acffbf7df47c59778b6469","ci/docker/powerpc-unknown-linux-gnu/Dockerfile":"e334ace0c994bda4f8db63fc2cb51780d0056ea3f47a4fe735f6b571e59eec7e","ci/docker/powerpc64-unknown-linux-gnu/Dockerfile":"e643db60f36ebeefda02d51bbc036c63102b8a1c106e2404c392891bb1aea0a9","ci/docker/x86_64-rumprun-netbsd/Dockerfile":"44c3107fb30380785aaed6ff73fa334017a5bb4e3b5c7d4876154f09023a2b99","ci/docker/x86_64-unknown-freebsd/Dockerfile":"2cb917b02a0736b9dd5ce8a44922e9a9f468ba431747ef1e0d36de5b07681962","ci/docker/x86_64-unknown-linux-gnu/Dockerfile":"4fd4698b6322be510a1529fc98fab1c90b86545e41a7b68c51798b17b9bec664","ci/docker/x86_64-unknown-linux-musl/Dockerfile":"cd7a0d93e7c715e7c40d1dd763b43054a15c1d239ec2bd48d3624627e7ab2095","ci/docker/x86_64-unknown-openbsd/Dockerfile":"a756b32086d80cf937be7c136ac088146ad7dfe1c0b2fa18786bc867dd382fbc","ci/dox.sh":"2161cb17ee0d6a2279a64149c6b7c73a5b2eab344f248ea1fa0e6c8f6335ec5f","ci/landing-page-footer.html":"b70b3112c2147f5c967e7481061ef38bc2d79a28dd55a16fb916d9c9426da2c4","ci/landing-page-head.html":"ad69663fac7924f27d0209bc519d55838e86edfc4133713a6fd08caadac1b142","ci/run-docker.sh":"d17d1f854c9414155ed54a7738acf3330637ce81923b50c238bdaa761ef10153","ci/run-qemu.sh":"4f9dd0a9011ca140e3482bb49e56fc21576c1c234eb7ff2782a6bf1aa34f3453","ci/run.sh":"d1548d31b0b538ecd01fe0bdf6c0ff746969e14392ac4127a6c02a49d4e0ecc9","ci/style.rs":"60564abc1d5197ed1598426dd0d6ee9939a16d2875b03373538f58843bb616c4","src/dox.rs":"eb6fbcc0b8b59430271bb71ee023961fd165337fc5fd6ca433882457a3c735bd","src/lib.rs":"4cece0e880ec8731913e5110b58d1b134148b0a43e72d6b990c1d999916fc706","src/macros.rs":"bd9802772b0e5c8b3c550d1c24307f06c0d1e4ce656b4ae1cf092142bbe5412c","src/unix/bsd/apple/b32.rs":"110ecff78da0e8d405d861447904da403d8b3f6da1f0f9dc9987633f3f04fe46","src/unix/bsd/apple/b64.rs":"e6808081c0b276cca3189628716f507c7c0d00b62417cd44addbdaefe848cec7","src/unix/bsd/apple/mod.rs":"e1effb590ae2da9613068df7367ab46ceba50d31fe35b8b06eaa1d9bb3e8ae6e","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"7784fa437c303616e58480be9b30e1a49da88e9f6154c509985f6d46f36a9e47","src/unix/bsd/freebsdlike/freebsd/mod.rs":"223109596e0dc431a4fa121e22d6ee768731205bfb333973af3b334bc582ee58","src/unix/bsd/freebsdlike/freebsd/x86.rs":"54311d3ebf2bb091ab22361e377e6ef9224aec2ecfe459fbfcedde4932db9c58","src/unix/bsd/freebsdlike/freebsd/x86_64.rs":"c7f46b9ae23fde5a9e245a28ed1380066e67f081323b4d253a18e9da3b97b860","src/unix/bsd/freebsdlike/mod.rs":"3b93986960a523940c77ad2fe5d4f5eaaa589715fa02daa4bc0ef088bd2c22fd","src/unix/bsd/mod.rs":"9cfacc89c92b93809c94a59a81b5ac613482025c1ed47c2fcc0c26c0573dd113","src/unix/bsd/openbsdlike/bitrig.rs":"030cfb1ee0caa82dedddc40fd32f5709a862c22e1a6a5f16a43cbdcdfccb376d","src/unix/bsd/openbsdlike/mod.rs":"e4b968f3504c6e6fe327cb212ef623f7a90e8fbe817a6ff0b9c01898cb746128","src/unix/bsd/openbsdlike/netbsd.rs":"de9ae04cf9a04ec3855339a76f3b42cfe1c80395e8dc9ab8d10bf69431746007","src/unix/bsd/openbsdlike/openbsd.rs":"2c3004cd9f34c8d027c4dc418a7b62ef485599d4b2136d458a6414b78b8038f4","src/unix/mod.rs":"afd8a255c9e14da431e7e4ec395dd7379fc2b0d3d7f90fd717c0e23d1db3b8ff","src/unix/notbsd/android/b32.rs":"148e1b4ed8b4f700d5aa24178af925164176e1c18b54db877ced4b55ba9f03d4","src/unix/notbsd/android/b64.rs":"302caf0aa95fa022030717c58de17d85d814b04350eca081a722ec435bc4f217","src/unix/notbsd/android/mod.rs":"081802b334414a38e7cf4cbc07a44babdb65969053c6c73d9f345e323c601242","src/unix/notbsd/linux/mips.rs":"e61e24a6309752224fd3932fbff3a68d71f59fb131a4d205dfc13ea2c1594943","src/unix/notbsd/linux/mips64.rs":"c7f58c75ac50a8177d8970e893dfe619ef708de264cb1c1af7bb912246a78b18","src/unix/notbsd/linux/mod.rs":"716d55f8598acd718e9545f6a66ffb216e7fe51706f81c5f50147ee2b42f8d3d","src/unix/notbsd/linux/musl/b32/arm.rs":"2ab4cb00932e23364d6919ce09700d2ed36206d488f9390f3e2c6de965f85ae7","src/unix/notbsd/linux/musl/b32/asmjs.rs":"f57da63ac0b9b4b2e74ec54ec01ce34b04c9e7a4a3df62ac93be402538015883","src/unix/notbsd/linux/musl/b32/mips.rs":"f28c77e1716be8eafec4c8b76a9312b8bba3271fbd5b726a69f9f467482039d8","src/unix/notbsd/linux/musl/b32/mod.rs":"bd29a02c67b69791e7cabd7666503c35ed5322d244a005b9cc7fd0cb28b552a8","src/unix/notbsd/linux/musl/b32/x86.rs":"363e2eae846f2e6c26751d92b7e73fc6dd2d3cfb1465dff366251b92acf80da8","src/unix/notbsd/linux/musl/b64/aarch64.rs":"4009c7eaf703472daef2a70bdac910d9fc395a33689ef2e8cf1c4e692445d3f0","src/unix/notbsd/linux/musl/b64/mod.rs":"03c8391e509341385ea9458d40bdc013bee0645ae31ba3e2007aecf133853c08","src/unix/notbsd/linux/musl/b64/powerpc64.rs":"dc28f5b7284235d6cf5519053cac59a1c16dc39223b71cca0871e4880755f852","src/unix/notbsd/linux/musl/b64/x86_64.rs":"43291acc0dfc92c2fec8ba6ce77ee9ca3c20bcdccec18e149f95ba911cee704b","src/unix/notbsd/linux/musl/mod.rs":"c707acce4a8f6eb7373f5bc7e77595b2e0fb7d390b3063b92558702d75cc504c","src/unix/notbsd/linux/other/b32/arm.rs":"cb0ea706eaf32733092524633acc3d34f4a140b0d7c2b4350698b9295a3f0e6a","src/unix/notbsd/linux/other/b32/mod.rs":"8b774feb5510b963ed031db7ab3d7e24f1ba5524a6396db0b851d237ccc16fd3","src/unix/notbsd/linux/other/b32/powerpc.rs":"89bef28c85fe6c81c2e661d9959692f5ada691658d69c8b9a2fb11d3b2ed1214","src/unix/notbsd/linux/other/b32/x86.rs":"aeafa92aca3b5bed951fe79081412068210cba91ef610ee2c007ba5da19ec3c6","src/unix/notbsd/linux/other/b64/aarch64.rs":"c198b3355d91a03e0ac8780ba7b58c1eb445db8beba7d9fa7704a0089174bc73","src/unix/notbsd/linux/other/b64/mod.rs":"dab63025ad3713a9a5f014283d4b3a3f6c3d167ae2bece29ee4b1d5f9489b6c7","src/unix/notbsd/linux/other/b64/powerpc64.rs":"06a795bca8e91a0143ef1787b034201ed7a21d01960ce9fe869d18c274d5bdb4","src/unix/notbsd/linux/other/b64/x86_64.rs":"5af4e657e04a863ac489de52294e7c4c34d191393d99e025a6fbbe1a26cac33f","src/unix/notbsd/linux/other/mod.rs":"3e6cbc19efba21029ae93d8f5aaf502f422cb03336c1f687c10f96efc1cf55c3","src/unix/notbsd/linux/s390x.rs":"9293453eb87dc6b134c50593ca1d92eac338a7c39091db9ce66ba2394058cb49","src/unix/notbsd/mod.rs":"3beb490a9f1f9473ec0241b30ad8da4eae2de01aa7225257ba60eb48ae248adc","src/unix/solaris/mod.rs":"a1b0cf6b80963aff8e0f472306d8a43a26c40fcd8d9fdee29f1a25618a88f781","src/windows.rs":"7bed60392ae1552b4404b38bac7151f00f26f8d6568c1b845301bfb2346fd505"},"package":"408014cace30ee0f767b1c4517980646a573ec61a57957aeeabcac8ac0a02e8d"}
\ No newline at end of file
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"7150ee9391a955b2ef7e0762fc61c0c1aab167620ca36d88d78062d93b8334ba",".travis.yml":"7cdd02047a3044fcc50a43aacede564cfbe061bab9ccd143a58e7e92e64750c2","Cargo.toml":"a6a896942913853a04393a52b33516140a6a173768fff34920f2d304fe4bb21f","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"4222225ac1d974faee08172b0b0773dfe2b312a13054f090f04c651aa1d1e6ef","appveyor.yml":"c0d70c650b6231e6ff78a352224f1a522a9be69d9da4251adbaddb3f0393294d","ci/README.md":"be804f15e2128e5fd4b160cb0b13cff5f19e7d77b55ec5254aa6fd8731c84f0d","ci/docker/aarch64-unknown-linux-gnu/Dockerfile":"62ca7317439f9c303990e897450a91cd467be05eb75dfc01456d417932ac8672","ci/docker/arm-linux-androideabi/Dockerfile":"172bac5a76024737847ffdac49f68e2b3d890cb2fc1b5e3f7aaaf19b46916830","ci/docker/arm-linux-androideabi/accept-licenses.sh":"84ad00815f628005ed22c5d6cd14990ebc97812a7163bd275b2877904eddab53","ci/docker/arm-linux-androideabi/install-ndk.sh":"eef063bb01a16c0f90471dbce1b5a395b53141d7704e15a3c9a1c4fc5e06d4b1","ci/docker/arm-linux-androideabi/install-sdk.sh":"42c04b17c4a35bef58757332e960a6e4aba1b5e41f8fc0182265163ff93f6182","ci/docker/arm-unknown-linux-gnueabihf/Dockerfile":"e349f7caa463adbde8d6ec4d2b9f7720ed81c77f48d75bbfb78c89751f55c2dc","ci/docker/i686-unknown-linux-gnu/Dockerfile":"07e9df6ba91025cbec7ae81ade63f8cfb8a54c5e1e5a8f8def0617e17bd59db0","ci/docker/i686-unknown-linux-musl/Dockerfile":"1a4d064adff4a8f58773305567cfe5d915bcd0762bcb0e101cf6f4ca628a96da","ci/docker/mips-unknown-linux-gnu/Dockerfile":"860299d96ee50ebdbd788e65eb6ba1f561ef66107647bddffcb2567ac350896b","ci/docker/mips-unknown-linux-musl/Dockerfile":"711c43122fa34cee83a69944493213924b0ff1fccd78c7a141cb2b2127526484","ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile":"163776e0fd38f66df7415421202ac29efc7d345a628947434e573c3885594ab5","ci/docker/mipsel-unknown-linux-musl/Dockerfile":"398c1c6810b07d329f6f29523b3e34603d24939fb6f6a944bcd67d36f25b08c8","ci/docker/powerpc-unknown-linux-gnu/Dockerfile":"08b846a338c2ee70100f4e80db812668dc58bfb536c44a95cd1cf004d965186b","ci/docker/powerpc64-unknown-linux-gnu/Dockerfile":"4da285ffd035d16f5da9e3701841eb86049c8cfa417fa81e53da4ef74152eac0","ci/docker/x86_64-rumprun-netbsd/Dockerfile":"44c3107fb30380785aaed6ff73fa334017a5bb4e3b5c7d4876154f09023a2b99","ci/docker/x86_64-unknown-freebsd/Dockerfile":"ef0f9f63065218728d2daafaa5ba71b17e4ccc23d72e859e0a7133fc64c0815e","ci/docker/x86_64-unknown-linux-gnu/Dockerfile":"67fabbc8c6ac02376cf9344251ad49ecdac396b71accb572fd1ae65225325bc0","ci/docker/x86_64-unknown-linux-musl/Dockerfile":"f71019fed5204b950843ef5e56144161fda7e27fad68ed0e8bc4353c388c7bcf","ci/docker/x86_64-unknown-openbsd/Dockerfile":"dfa5c23a6cff8c7a9a846668118c71a8406a360801fd3632fb12e8fbda6b7338","ci/dox.sh":"2161cb17ee0d6a2279a64149c6b7c73a5b2eab344f248ea1fa0e6c8f6335ec5f","ci/landing-page-footer.html":"b70b3112c2147f5c967e7481061ef38bc2d79a28dd55a16fb916d9c9426da2c4","ci/landing-page-head.html":"ad69663fac7924f27d0209bc519d55838e86edfc4133713a6fd08caadac1b142","ci/run-docker.sh":"7f6c68dbca93788111170ac4678608957a179e76cfe8c5a51d11dfea1742d7f2","ci/run-qemu.sh":"bb859421170871ef23a8940c5e150efec0c01b95e32d2ce2d37b79a45d9d346c","ci/run.sh":"b6a6307ea989b6a84bad0fd7d46c3206b30f7aa06d0b3e92d6cb1c855f4e0c42","ci/style.rs":"60564abc1d5197ed1598426dd0d6ee9939a16d2875b03373538f58843bb616c4","src/dox.rs":"eb6fbcc0b8b59430271bb71ee023961fd165337fc5fd6ca433882457a3c735bd","src/lib.rs":"cc328e10a4c2879e7de1858aabc30e667cb07398e021e0d2d002f4195632127a","src/macros.rs":"bd9802772b0e5c8b3c550d1c24307f06c0d1e4ce656b4ae1cf092142bbe5412c","src/redox.rs":"e4814435c11a200a8acd9ad0e40dac3e44a6881f434d89b91f1ba643c8b9b6f7","src/unix/bsd/apple/b32.rs":"110ecff78da0e8d405d861447904da403d8b3f6da1f0f9dc9987633f3f04fe46","src/unix/bsd/apple/b64.rs":"e6808081c0b276cca3189628716f507c7c0d00b62417cd44addbdaefe848cec7","src/unix/bsd/apple/mod.rs":"25aa17657431107ceecdc1f87bcfdeb5df633eeae9ae85be39187c3a6cbecb0f","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"53ff7f64e03d7aa3d779d4be0768e72fdf513689aa28813bd279a6a8fcbf824a","src/unix/bsd/freebsdlike/freebsd/mod.rs":"8670fd8cae2bef1f5f41b11e7723174d7c64fb73302893173010ee024915b4b9","src/unix/bsd/freebsdlike/freebsd/x86.rs":"54311d3ebf2bb091ab22361e377e6ef9224aec2ecfe459fbfcedde4932db9c58","src/unix/bsd/freebsdlike/freebsd/x86_64.rs":"c7f46b9ae23fde5a9e245a28ed1380066e67f081323b4d253a18e9da3b97b860","src/unix/bsd/freebsdlike/mod.rs":"cc13083464a040ae490541835f708b9c0546833335a7c891939c495ca78eb41f","src/unix/bsd/mod.rs":"bd422d4bca87a3e8ea4bd78b9ae019643399807d036913f42fdd7476f260297d","src/unix/bsd/netbsdlike/mod.rs":"7b62b89c6ba0d5a8e0cf0937587a81e0314f9c5dabb0c9a9164106b677cf4dd8","src/unix/bsd/netbsdlike/netbsd/mod.rs":"6f4535b27610c1f14e781413e8ea20713fa79788addebf96f5e8f3d4b0767c2c","src/unix/bsd/netbsdlike/netbsd/other/b32/mod.rs":"bd251a102bed65d5cb3459275f6ec3310fe5803ff4c9651212115548f86256d0","src/unix/bsd/netbsdlike/netbsd/other/b64/mod.rs":"927eeccaf3269d299db4c2a55f8010807bf43dfa894aea6a783215f5d3560baa","src/unix/bsd/netbsdlike/netbsd/other/mod.rs":"8ce39030f3e4fb45a3d676ade97da8f6d1b3d5f6d8d141224d341c993c57e090","src/unix/bsd/netbsdlike/openbsdlike/bitrig.rs":"f8cd05dacd3a3136c58da5a2fbe26f703767823b28e74fe8a2b57a7bd98d6d5c","src/unix/bsd/netbsdlike/openbsdlike/mod.rs":"b61a9ad0bf901b2aed86f69a062a70b50a5b29251165d9b62406c09c9d1830b4","src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs":"b1b9cf7be9f0e4d294a57092594074ad03a65fe0eeac9d1104fa874c313e7900","src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs":"bd251a102bed65d5cb3459275f6ec3310fe5803ff4c9651212115548f86256d0","src/unix/bsd/netbsdlike/openbsdlike/other/b64/mod.rs":"927eeccaf3269d299db4c2a55f8010807bf43dfa894aea6a783215f5d3560baa","src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs":"f5d8db6f54efd05520b31b764a6bacbf612e1aebce097d2d5bfaaef3b91f37b5","src/unix/haiku/b32.rs":"bd251a102bed65d5cb3459275f6ec3310fe5803ff4c9651212115548f86256d0","src/unix/haiku/b64.rs":"b422430c550c0ba833c9206d1350861e344e3a2eb33d7d58693efb35044be1cc","src/unix/haiku/mod.rs":"d14c45d536f24cd9cd8d5170b9829026da4c782ff2d5855644cc217553e309cf","src/unix/mod.rs":"84cf9ca2f24b1331760a5d51ba7f6bf3c1e170f6642ef9b6d25deb61a50ddcaf","src/unix/notbsd/android/b32.rs":"148e1b4ed8b4f700d5aa24178af925164176e1c18b54db877ced4b55ba9f03d4","src/unix/notbsd/android/b64.rs":"302caf0aa95fa022030717c58de17d85d814b04350eca081a722ec435bc4f217","src/unix/notbsd/android/mod.rs":"49bdee8558e8abbcc9cf1fdab3ba99bc900f3c8fd7744e375d744adefd83090a","src/unix/notbsd/linux/mips/mips32.rs":"6f946d75deed2b4de65927eaf48c98be0d72bc6d932ff5f1c1542db558ec79f2","src/unix/notbsd/linux/mips/mips64.rs":"44ded650aa3e4b251ac5b09a460400c07068e70e8daeb0815932c2f828aa8ec4","src/unix/notbsd/linux/mips/mod.rs":"478646b58921d24fa0ef487a9f0f819981bb5f0bfe5471d6d866366cd890458e","src/unix/notbsd/linux/mod.rs":"ddf67bb80c8f42cad12fa64e92d9a82ab9e90a10e62f041cc1610ae175a9d680","src/unix/notbsd/linux/musl/b32/arm.rs":"0ad8c97458743dc7d81200df0e1223f0a20936933ace77fe786477027597dd7b","src/unix/notbsd/linux/musl/b32/asmjs.rs":"085e410f990312de76f74cb9bbf9fcc27d686e94334143b34511f565d1b8bb91","src/unix/notbsd/linux/musl/b32/mips.rs":"01a92b5dc28ca67e41d7791e398f75210208368e53a848297186de5829d158ec","src/unix/notbsd/linux/musl/b32/mod.rs":"bd29a02c67b69791e7cabd7666503c35ed5322d244a005b9cc7fd0cb28b552a8","src/unix/notbsd/linux/musl/b32/x86.rs":"b47963c6bc5fceec96fded47d58e1c0466b190ec7ae207d666d23be35131c638","src/unix/notbsd/linux/musl/b64/aarch64.rs":"4009c7eaf703472daef2a70bdac910d9fc395a33689ef2e8cf1c4e692445d3f0","src/unix/notbsd/linux/musl/b64/mod.rs":"ec5ec1b11a2f4db24f7c0fadc229eab7c039c5b5b2988bd8eff7a424ef8ef6e9","src/unix/notbsd/linux/musl/b64/powerpc64.rs":"dc28f5b7284235d6cf5519053cac59a1c16dc39223b71cca0871e4880755f852","src/unix/notbsd/linux/musl/b64/x86_64.rs":"43291acc0dfc92c2fec8ba6ce77ee9ca3c20bcdccec18e149f95ba911cee704b","src/unix/notbsd/linux/musl/mod.rs":"423be2ded304c850dc6048c675204e2f8aaf086840d6c154669d7771d57a640e","src/unix/notbsd/linux/other/b32/arm.rs":"f5cb989075fa3b5f997e7101495532c8d5c9f3577412d4c07e4c8c1a16f7b43c","src/unix/notbsd/linux/other/b32/mod.rs":"8b774feb5510b963ed031db7ab3d7e24f1ba5524a6396db0b851d237ccc16fd3","src/unix/notbsd/linux/other/b32/powerpc.rs":"3b62052bb9741afa5349098e6e9c675b60e822e41fed6b5e1b694be1872097b1","src/unix/notbsd/linux/other/b32/x86.rs":"1eda37736f5966c7968b594f74f5018f56b6b8c67bbdeb31fc3db1b6e4ac31b4","src/unix/notbsd/linux/other/b64/aarch64.rs":"a978e82d037a9c8127b2f704323864aff42ac910e721ecc69c255671ca96b950","src/unix/notbsd/linux/other/b64/mod.rs":"efb7740c2fb925ea98977a6a3ff52bc0b72205c1f88a9ba281a939b66b7f0efe","src/unix/notbsd/linux/other/b64/powerpc64.rs":"06a795bca8e91a0143ef1787b034201ed7a21d01960ce9fe869d18c274d5bdb4","src/unix/notbsd/linux/other/b64/x86_64.rs":"0ed128e93f212c0d65660bd95e29190a2dae7c9d15d6fa0d3c4c6656f89e9bdc","src/unix/notbsd/linux/other/mod.rs":"8cf1a781c728da79f9087fa36008151de7af24fd596fdf2d34ffbf64885a1dde","src/unix/notbsd/linux/s390x.rs":"222778cf3e7d1c81e49cbbe9f89477178ae3deedf60e2a485d00f46ab331ea5c","src/unix/notbsd/mod.rs":"8a74a8d5cddbe94cf8fe234ed39a2d989db08cb1c9af70dbf40d87956825b542","src/unix/solaris/mod.rs":"f72395ac3e67798d51433a654e1741f252a99ac7fc4f577168fb4465724c68d9","src/windows.rs":"acccbd341e81206cb1dc66af41762c193ac0dd719d700b64f7e26c967ee7d670"},"package":"a51822fc847e7a8101514d1d44e354ba2ffa7d4c194dcab48870740e327cac70"}
\ No newline at end of file
--- a/third_party/rust/libc/.travis.yml
+++ b/third_party/rust/libc/.travis.yml
@@ -15,30 +15,30 @@ script:
     else
       export CARGO_TARGET_DIR=`pwd`/target;
       sh ci/run.sh $TARGET;
     fi
   - rustc ci/style.rs && ./style src
 osx_image: xcode7.3
 env:
   global:
-    secure: eIDEoQdTyglcsTD13zSGotAX2HDhRSXIaaTnVZTThqLSrySOc3/6KY3qmOc2Msf7XaBqfFy9QA+alk7OwfePp253eiy1Kced67ffjjFOytEcRT7FlQiYpcYQD6WNHZEj62/bJBO4LTM9sGtWNCTJVEDKW0WM8mUK7qNuC+honPM=
+    secure: "e2/3QjgRN9atOuSHp22TrYG7QVKcYUWY48Hi9b60w+r1+BhPkTseIJLte7WefRhdXtqpjjUJTooKDhnurFOeHaCT+nmBgiv+FPU893sBl4bhesY4m0vgUJVbNZcs6lTImYekWVb+aqjGdgV/XAgCw7c3kPmrZV0MzGDWL64Xaps="
 matrix:
   include:
     # 1.0.0 compat
     - os: linux
       env: TARGET=x86_64-unknown-linux-gnu
       rust: 1.0.0
       script: cargo build
       install:
 
     # build documentation
     - os: linux
       env: TARGET=x86_64-unknown-linux-gnu
-      rust: stable
+      rust: nightly
       script: sh ci/dox.sh
 
     # stable compat
     - os: linux
       env: TARGET=x86_64-unknown-linux-gnu
       rust: stable
     - os: linux
       env: TARGET=i686-unknown-linux-gnu
@@ -73,47 +73,54 @@ matrix:
     - os: linux
       env: TARGET=x86_64-rumprun-netbsd
       rust: stable
     - os: linux
       env: TARGET=powerpc-unknown-linux-gnu
       rust: stable
     - os: linux
       env: TARGET=powerpc64-unknown-linux-gnu
+      rust: beta
+    - os: linux
+      env: TARGET=mips-unknown-linux-musl
       rust: stable
     - os: linux
       env: TARGET=mipsel-unknown-linux-musl
       rust: stable
+    - os: linux
+      env: TARGET=mips64-unknown-linux-gnuabi64
+      rust: beta
+    - os: linux
+      env: TARGET=mips-unknown-linux-gnu
+      rust: beta
 
     # beta
     - os: linux
       env: TARGET=x86_64-unknown-linux-gnu
       rust: beta
     - os: osx
       env: TARGET=x86_64-apple-darwin
       rust: beta
 
     # nightly
     - os: linux
       env: TARGET=x86_64-unknown-linux-gnu
       rust: nightly
     - os: osx
       env: TARGET=x86_64-apple-darwin
       rust: nightly
-    - os: linux
-      env: TARGET=mips-unknown-linux-gnu
-      # not sure why this has to be nightly...
-      rust: nightly
 
     # QEMU based targets that compile in an emulator
     - os: linux
       env: TARGET=x86_64-unknown-freebsd
       rust: stable
     - os: linux
       env: TARGET=x86_64-unknown-openbsd QEMU=openbsd.qcow2
       rust: stable
       script: sh ci/run-docker.sh $TARGET
       install:
 
+cache: cargo
+
 notifications:
   email:
     on_success: never
   webhooks: https://buildbot.rust-lang.org/homu/travis
--- a/third_party/rust/libc/Cargo.toml
+++ b/third_party/rust/libc/Cargo.toml
@@ -1,18 +1,21 @@
 [package]
 
 name = "libc"
-version = "0.2.16"
+version = "0.2.18"
 authors = ["The Rust Project Developers"]
 license = "MIT/Apache-2.0"
 readme = "README.md"
 repository = "https://github.com/rust-lang/libc"
 homepage = "https://github.com/rust-lang/libc"
 documentation = "http://doc.rust-lang.org/libc"
 description = """
 A library for types and bindings to native C functions often found in libc or
 other common platform libraries.
 """
 
 [features]
 default = ["use_std"]
 use_std = []
+
+[workspace]
+members = ["libc-test", "libc-test/generate-files"]
--- a/third_party/rust/libc/README.md
+++ b/third_party/rust/libc/README.md
@@ -1,16 +1,16 @@
 libc
 ====
 
 A Rust library with native bindings to the types and functions commonly found on
 various systems, including libc.
 
 [![Build Status](https://travis-ci.org/rust-lang/libc.svg?branch=master)](https://travis-ci.org/rust-lang/libc)
-[![Build status](https://ci.appveyor.com/api/projects/status/34csq3uurnw7c0rl?svg=true)](https://ci.appveyor.com/project/alexcrichton/libc)
+[![Build status](https://ci.appveyor.com/api/projects/status/github/rust-lang/libc?svg=true)](https://ci.appveyor.com/project/rust-lang-libs/libc)
 
 [Documentation](#platforms-and-documentation)
 
 ## Usage
 
 First, add the following to your `Cargo.toml`:
 
 ```toml
@@ -127,9 +127,11 @@ Tested:
   * [`x86_64-unknown-openbsd`](https://doc.rust-lang.org/libc/x86_64-unknown-openbsd/libc/)
   * [`x86_64-rumprun-netbsd`](https://doc.rust-lang.org/libc/x86_64-unknown-netbsd/libc/)
 
 The following may be supported, but are not guaranteed to always work:
 
   * `i686-unknown-freebsd`
   * [`x86_64-unknown-bitrig`](https://doc.rust-lang.org/libc/x86_64-unknown-bitrig/libc/)
   * [`x86_64-unknown-dragonfly`](https://doc.rust-lang.org/libc/x86_64-unknown-dragonfly/libc/)
+  * `i686-unknown-haiku`
+  * `x86_64-unknown-haiku`
   * [`x86_64-unknown-netbsd`](https://doc.rust-lang.org/libc/x86_64-unknown-netbsd/libc/)
--- a/third_party/rust/libc/appveyor.yml
+++ b/third_party/rust/libc/appveyor.yml
@@ -12,10 +12,14 @@ install:
   - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
   - if defined MSYS2_BITS set PATH=%PATH%;C:\msys64\mingw%MSYS2_BITS%\bin
   - rustc -V
   - cargo -V
 
 build: false
 
 test_script:
-  - cargo test
-  - cargo run --manifest-path libc-test/Cargo.toml
+  - cargo test --target %TARGET%
+  - cargo run --manifest-path libc-test/Cargo.toml --target %TARGET%
+
+cache:
+  - target
+  - C:\Users\appveyor\.cargo\registry
--- a/third_party/rust/libc/ci/docker/aarch64-unknown-linux-gnu/Dockerfile
+++ b/third_party/rust/libc/ci/docker/aarch64-unknown-linux-gnu/Dockerfile
@@ -1,7 +1,7 @@
-FROM ubuntu:14.04
+FROM ubuntu:16.10
 RUN apt-get update
 RUN apt-get install -y --no-install-recommends \
   gcc libc6-dev ca-certificates \
   gcc-aarch64-linux-gnu libc6-dev-arm64-cross qemu-user
 ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
     PATH=$PATH:/rust/bin
--- a/third_party/rust/libc/ci/docker/arm-linux-androideabi/Dockerfile
+++ b/third_party/rust/libc/ci/docker/arm-linux-androideabi/Dockerfile
@@ -1,4 +1,34 @@
-FROM alexcrichton/rust-slave-android:2015-11-22
-ENV CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \
-    PATH=$PATH:/rust/bin
-ENTRYPOINT ["sh"]
+FROM ubuntu:16.04
+
+RUN dpkg --add-architecture i386 && \
+    apt-get update && \
+    apt-get install -y --no-install-recommends \
+  file \
+  curl \
+  ca-certificates \
+  python \
+  unzip \
+  expect \
+  openjdk-9-jre \
+  libstdc++6:i386 \
+  gcc \
+  libc6-dev
+
+WORKDIR /android/
+
+COPY install-ndk.sh /android/
+RUN sh /android/install-ndk.sh
+
+ENV PATH=$PATH:/android/ndk-arm/bin:/android/sdk/tools:/android/sdk/platform-tools
+
+COPY install-sdk.sh accept-licenses.sh /android/
+RUN sh /android/install-sdk.sh
+
+ENV PATH=$PATH:/rust/bin \
+    CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \
+    ANDROID_EMULATOR_FORCE_32BIT=1 \
+    HOME=/tmp
+RUN chmod 755 /android/sdk/tools/*
+
+RUN cp -r /root/.android /tmp
+RUN chmod 777 -R /tmp/.android
new file mode 100755
--- /dev/null
+++ b/third_party/rust/libc/ci/docker/arm-linux-androideabi/accept-licenses.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/expect -f
+# ignore-license
+
+set timeout 1800
+set cmd [lindex $argv 0]
+set licenses [lindex $argv 1]
+
+spawn {*}$cmd
+expect {
+  "Do you accept the license '*'*" {
+        exp_send "y\r"
+        exp_continue
+  }
+  eof
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/ci/docker/arm-linux-androideabi/install-ndk.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+# file at the top-level directory of this distribution and at
+# http://rust-lang.org/COPYRIGHT.
+#
+# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+# option. This file may not be copied, modified, or distributed
+# except according to those terms.
+
+set -ex
+
+curl -O https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
+unzip -q android-ndk-r13b-linux-x86_64.zip
+android-ndk-r13b/build/tools/make_standalone_toolchain.py \
+        --install-dir /android/ndk-arm \
+        --arch arm \
+        --api 24
+
+rm -rf ./android-ndk-r13b-linux-x86_64.zip ./android-ndk-r13b
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/ci/docker/arm-linux-androideabi/install-sdk.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+# Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+# file at the top-level directory of this distribution and at
+# http://rust-lang.org/COPYRIGHT.
+#
+# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+# option. This file may not be copied, modified, or distributed
+# except according to those terms.
+
+set -ex
+
+# Prep the SDK and emulator
+#
+# Note that the update process requires that we accept a bunch of licenses, and
+# we can't just pipe `yes` into it for some reason, so we take the same strategy
+# located in https://github.com/appunite/docker by just wrapping it in a script
+# which apparently magically accepts the licenses.
+
+mkdir sdk
+curl https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz | \
+    tar xzf - -C sdk --strip-components=1
+
+filter="platform-tools,android-21"
+filter="$filter,sys-img-armeabi-v7a-android-21"
+
+./accept-licenses.sh "android - update sdk -a --no-ui --filter $filter"
+
+echo "no" | android create avd \
+                --name arm-21 \
+                --target android-21 \
+                --abi armeabi-v7a
--- a/third_party/rust/libc/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile
+++ b/third_party/rust/libc/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile
@@ -1,7 +1,7 @@
-FROM ubuntu:16.04
+FROM ubuntu:16.10
 RUN apt-get update
 RUN apt-get install -y --no-install-recommends \
   gcc libc6-dev ca-certificates \
   gcc-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-user
 ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \
     PATH=$PATH:/rust/bin
--- a/third_party/rust/libc/ci/docker/i686-unknown-linux-gnu/Dockerfile
+++ b/third_party/rust/libc/ci/docker/i686-unknown-linux-gnu/Dockerfile
@@ -1,5 +1,5 @@
-FROM ubuntu:16.04
+FROM ubuntu:16.10
 RUN apt-get update
 RUN apt-get install -y --no-install-recommends \
   gcc-multilib libc6-dev ca-certificates
 ENV PATH=$PATH:/rust/bin
--- a/third_party/rust/libc/ci/docker/i686-unknown-linux-musl/Dockerfile
+++ b/third_party/rust/libc/ci/docker/i686-unknown-linux-musl/Dockerfile
@@ -1,13 +1,22 @@
-FROM ubuntu:16.04
+FROM ubuntu:16.10
 
 RUN apt-get update
 RUN apt-get install -y --no-install-recommends \
   gcc make libc6-dev git curl ca-certificates
-RUN curl https://www.musl-libc.org/releases/musl-1.1.14.tar.gz | \
+# Below we're cross-compiling musl for i686 using the system compiler on an
+# x86_64 system. This is an awkward thing to be doing and so we have to jump
+# through a couple hoops to get musl to be happy. In particular:
+#
+# * We specifically pass -m32 in CFLAGS and override CC when running ./configure,
+#   since otherwise the script will fail to find a compiler.
+# * We manually unset CROSS_COMPILE when running make; otherwise the makefile
+#   will call the non-existent binary 'i686-ar'.
+RUN curl https://www.musl-libc.org/releases/musl-1.1.15.tar.gz | \
     tar xzf - && \
-    cd musl-1.1.14 && \
-    CFLAGS=-m32 ./configure --prefix=/musl-i686 --disable-shared --target=i686 && \
-    make install -j4 && \
+    cd musl-1.1.15 && \
+    CC=gcc CFLAGS=-m32 ./configure --prefix=/musl-i686 --disable-shared --target=i686 && \
+    make CROSS_COMPILE= install -j4 && \
     cd .. && \
-    rm -rf musl-1.1.14
-ENV PATH=$PATH:/musl-i686/bin:/rust/bin
+    rm -rf musl-1.1.15
+ENV PATH=$PATH:/musl-i686/bin:/rust/bin \
+    CC_i686_unknown_linux_musl=musl-gcc
--- a/third_party/rust/libc/ci/docker/mips-unknown-linux-gnu/Dockerfile
+++ b/third_party/rust/libc/ci/docker/mips-unknown-linux-gnu/Dockerfile
@@ -1,9 +1,9 @@
-FROM ubuntu:16.04
+FROM ubuntu:16.10
 
 RUN apt-get update
 RUN apt-get install -y --no-install-recommends \
         gcc libc6-dev qemu-user ca-certificates \
         gcc-mips-linux-gnu libc6-dev-mips-cross \
         qemu-system-mips
 
 ENV CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_LINKER=mips-linux-gnu-gcc \
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/ci/docker/mips-unknown-linux-musl/Dockerfile
@@ -0,0 +1,17 @@
+FROM ubuntu:16.10
+
+RUN apt-get update
+RUN apt-get install -y --no-install-recommends \
+        gcc libc6-dev qemu-user ca-certificates qemu-system-mips curl \
+        bzip2
+
+RUN mkdir /toolchain
+
+# Note that this originally came from:
+# https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2
+RUN curl -L https://s3.amazonaws.com/rust-lang-ci/libc/OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 | \
+      tar xjf - -C /toolchain --strip-components=1
+
+ENV PATH=$PATH:/rust/bin:/toolchain/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.15/bin \
+    CC_mips_unknown_linux_musl=mips-openwrt-linux-gcc \
+    CARGO_TARGET_MIPS_UNKNOWN_LINUX_MUSL_LINKER=mips-openwrt-linux-gcc
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile
@@ -0,0 +1,11 @@
+FROM ubuntu:16.10
+
+RUN apt-get update
+RUN apt-get install -y --no-install-recommends \
+        gcc libc6-dev qemu-user ca-certificates \
+        gcc-mips64-linux-gnuabi64 libc6-dev-mips64-cross \
+        qemu-system-mips64
+
+ENV CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_LINKER=mips64-linux-gnuabi64-gcc \
+    CC_mips64_unknown_linux_gnuabi64=mips64-linux-gnuabi64-gcc \
+    PATH=$PATH:/rust/bin
--- a/third_party/rust/libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile
+++ b/third_party/rust/libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile
@@ -1,14 +1,17 @@
-FROM ubuntu:16.04
+FROM ubuntu:16.10
 
 RUN apt-get update
 RUN apt-get install -y --no-install-recommends \
         gcc libc6-dev qemu-user ca-certificates qemu-system-mips curl \
         bzip2
 
 RUN mkdir /toolchain
-RUN curl -L https://downloads.openwrt.org/snapshots/trunk/malta/generic/OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 | \
-      tar xjf - -C /toolchain --strip-components=2
+
+# Note that this originally came from:
+# https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2
+RUN curl -L https://s3.amazonaws.com/rust-lang-ci/libc/OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 | \
+      tar xjf - -C /toolchain --strip-components=1
 
 ENV PATH=$PATH:/rust/bin:/toolchain/bin \
     CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \
     CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_MUSL_LINKER=mipsel-openwrt-linux-gcc
--- a/third_party/rust/libc/ci/docker/powerpc-unknown-linux-gnu/Dockerfile
+++ b/third_party/rust/libc/ci/docker/powerpc-unknown-linux-gnu/Dockerfile
@@ -1,9 +1,9 @@
-FROM ubuntu:16.04
+FROM ubuntu:16.10
 
 RUN apt-get update
 RUN apt-get install -y --no-install-recommends \
         gcc libc6-dev qemu-user ca-certificates \
         gcc-powerpc-linux-gnu libc6-dev-powerpc-cross \
         qemu-system-ppc
 
 ENV CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_LINKER=powerpc-linux-gnu-gcc \
--- a/third_party/rust/libc/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile
+++ b/third_party/rust/libc/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile
@@ -1,9 +1,9 @@
-FROM ubuntu:16.04
+FROM ubuntu:16.10
 
 RUN apt-get update
 RUN apt-get install -y --no-install-recommends \
         gcc libc6-dev qemu-user ca-certificates \
         gcc-powerpc64-linux-gnu libc6-dev-ppc64-cross \
         qemu-system-ppc
 
 ENV CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_LINKER=powerpc64-linux-gnu-gcc \
--- a/third_party/rust/libc/ci/docker/x86_64-unknown-freebsd/Dockerfile
+++ b/third_party/rust/libc/ci/docker/x86_64-unknown-freebsd/Dockerfile
@@ -1,13 +1,13 @@
 FROM alexcrichton/rust-slave-linux-cross:2016-04-15
 USER root
 
 RUN apt-get update
 RUN apt-get install -y --no-install-recommends \
-  qemu qemu-kvm kmod cpu-checker
+  qemu genext2fs
 
 ENTRYPOINT ["sh"]
 
 ENV PATH=$PATH:/rust/bin \
-    QEMU=freebsd.qcow2 \
+    QEMU=2016-11-06/freebsd.qcow2.gz \
     CAN_CROSS=1 \
     CARGO_TARGET_X86_64_UNKNOWN_FREEBSD_LINKER=x86_64-unknown-freebsd10-gcc
--- a/third_party/rust/libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile
+++ b/third_party/rust/libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile
@@ -1,5 +1,5 @@
-FROM ubuntu:16.04
+FROM ubuntu:16.10
 RUN apt-get update
 RUN apt-get install -y --no-install-recommends \
   gcc libc6-dev ca-certificates
 ENV PATH=$PATH:/rust/bin
--- a/third_party/rust/libc/ci/docker/x86_64-unknown-linux-musl/Dockerfile
+++ b/third_party/rust/libc/ci/docker/x86_64-unknown-linux-musl/Dockerfile
@@ -1,13 +1,13 @@
-FROM ubuntu:16.04
+FROM ubuntu:16.10
 
 RUN apt-get update
 RUN apt-get install -y --no-install-recommends \
   gcc make libc6-dev git curl ca-certificates
-RUN curl https://www.musl-libc.org/releases/musl-1.1.14.tar.gz | \
+RUN curl https://www.musl-libc.org/releases/musl-1.1.15.tar.gz | \
     tar xzf - && \
-    cd musl-1.1.14 && \
+    cd musl-1.1.15 && \
     ./configure --prefix=/musl-x86_64 && \
     make install -j4 && \
     cd .. && \
-    rm -rf musl-1.1.14
+    rm -rf musl-1.1.15
 ENV PATH=$PATH:/musl-x86_64/bin:/rust/bin
--- a/third_party/rust/libc/ci/docker/x86_64-unknown-openbsd/Dockerfile
+++ b/third_party/rust/libc/ci/docker/x86_64-unknown-openbsd/Dockerfile
@@ -1,7 +1,8 @@
-FROM ubuntu:16.04
+FROM ubuntu:16.10
 
 RUN apt-get update
 RUN apt-get install -y --no-install-recommends \
-  gcc libc6-dev qemu qemu-kvm curl ca-certificates kmod cpu-checker
+  gcc libc6-dev qemu curl ca-certificates \
+  genext2fs
 ENV PATH=$PATH:/rust/bin \
-    QEMU=openbsd.qcow2
+    QEMU=2016-11-06/openbsd-6.0-without-pkgs.qcow2
--- a/third_party/rust/libc/ci/run-docker.sh
+++ b/third_party/rust/libc/ci/run-docker.sh
@@ -1,23 +1,31 @@
 # Small script to run tests for a target (or all targets) inside all the
 # respective docker images.
 
 set -ex
 
 run() {
     echo $1
     docker build -t libc ci/docker/$1
+    mkdir -p target
     docker run \
-      -v `rustc --print sysroot`:/rust:ro \
-      -v `pwd`:/checkout:ro \
-      -e CARGO_TARGET_DIR=/tmp/target \
-      -w /checkout \
+      --user `id -u`:`id -g` \
+      --rm \
+      --volume $HOME/.cargo:/cargo \
+      --env CARGO_HOME=/cargo \
+      --volume `rustc --print sysroot`:/rust:ro \
+      --volume `pwd`:/checkout:ro \
+      --volume `pwd`/target:/checkout/target \
+      --env CARGO_TARGET_DIR=/checkout/target \
+      --workdir /checkout \
       --privileged \
-      -it libc \
+      --interactive \
+      --tty \
+      libc \
       ci/run.sh $1
 }
 
 if [ -z "$1" ]; then
   for d in `ls ci/docker/`; do
     run $d
   done
 else
--- a/third_party/rust/libc/ci/run-qemu.sh
+++ b/third_party/rust/libc/ci/run-qemu.sh
@@ -14,20 +14,17 @@ ROOT=$1
 cp -r $ROOT/libc /tmp/libc
 cd /tmp/libc
 
 TARGET=$(cat $ROOT/TARGET)
 export CARGO_TARGET_DIR=/tmp
 
 case $TARGET in
   *-openbsd)
-    pkg_add rust curl gcc-4.8.4p4
-    curl https://static.rust-lang.org/cargo-dist/2015-04-02/cargo-nightly-x86_64-unknown-openbsd.tar.gz | \
-      tar xzf - -C /tmp
-    export PATH=$PATH:/tmp/cargo-nightly-x86_64-unknown-openbsd/cargo/bin
+    pkg_add cargo gcc%4.9 rust
     export CC=egcc
     ;;
 
   *)
     echo "Unknown target: $TARGET"
     exit 1
     ;;
 esac
--- a/third_party/rust/libc/ci/run.sh
+++ b/third_party/rust/libc/ci/run.sh
@@ -11,30 +11,38 @@ TARGET=$1
 # the scripts below. Instead, download the image, prepare a filesystem which has
 # the current state of this repository, and then run the image.
 #
 # It's assume that all images, when run with two disks, will run the `run.sh`
 # script from the second which we place inside.
 if [ "$QEMU" != "" ]; then
   tmpdir=/tmp/qemu-img-creation
   mkdir -p $tmpdir
-  if [ ! -f $tmpdir/$QEMU ]; then
-    curl https://people.mozilla.org/~acrichton/libc-test/qemu/$QEMU.gz | \
-      gunzip -d > $tmpdir/$QEMU
+
+  if [ -z "${QEMU#*.gz}" ]; then
+    # image is .gz : download and uncompress it
+    qemufile=$(echo ${QEMU%.gz} | sed 's/\//__/g')
+    if [ ! -f $tmpdir/$qemufile ]; then
+      curl https://s3.amazonaws.com/rust-lang-ci/libc/$QEMU | \
+        gunzip -d > $tmpdir/$qemufile
+    fi
+  else
+    # plain qcow2 image: just download it
+    qemufile=$(echo ${QEMU} | sed 's/\//__/g')
+    if [ ! -f $tmpdir/$qemufile ]; then
+      curl https://s3.amazonaws.com/rust-lang-ci/libc/$QEMU \
+        > $tmpdir/$qemufile
+    fi
   fi
 
   # Create a mount a fresh new filesystem image that we'll later pass to QEMU.
   # This will have a `run.sh` script will which use the artifacts inside to run
   # on the host.
   rm -f $tmpdir/libc-test.img
-  dd if=/dev/null of=$tmpdir/libc-test.img bs=1M seek=50
-  mkfs.ext2 -F $tmpdir/libc-test.img
-  rm -rf $tmpdir/mount
   mkdir $tmpdir/mount
-  mount -t ext2 -o loop $tmpdir/libc-test.img $tmpdir/mount
 
   # If we have a cross compiler, then we just do the standard rigamarole of
   # cross-compiling an executable and then the script to run just executes the
   # binary.
   #
   # If we don't have a cross-compiler, however, then we need to do some crazy
   # acrobatics to get this to work.  Generate all.{c,rs} on the host which will
   # be compiled inside QEMU. Do this here because compiling syntex_syntax in
@@ -57,35 +65,31 @@ if [ "$QEMU" != "" ]; then
     cp -r Cargo.* libc-test src ci $tmpdir/mount/libc/
     ln -s libc-test/target $tmpdir/mount/libc/target
     cp ci/run-qemu.sh $tmpdir/mount/run.sh
     echo $TARGET | tee -a $tmpdir/mount/TARGET
     cp $tmpdir/generated/* $tmpdir/mount/libc/libc-test
     cp libc-test/run-generated-Cargo.toml $tmpdir/mount/libc/libc-test/Cargo.toml
   fi
 
-  umount $tmpdir/mount
-
-  # If we can use kvm, prefer that, otherwise just fall back to user-space
-  # emulation.
-  if kvm-ok; then
-    program=kvm
-  else
-    program=qemu-system-x86_64
-  fi
+  du -sh $tmpdir/mount
+  genext2fs \
+      --root $tmpdir/mount \
+      --size-in-blocks 100000 \
+      $tmpdir/libc-test.img
 
   # Pass -snapshot to prevent tampering with the disk images, this helps when
   # running this script in development. The two drives are then passed next,
   # first is the OS and second is the one we just made. Next the network is
   # configured to work (I'm not entirely sure how), and then finally we turn off
   # graphics and redirect the serial console output to out.log.
-  $program \
+  qemu-system-x86_64 \
     -m 1024 \
     -snapshot \
-    -drive if=virtio,file=$tmpdir/$QEMU \
+    -drive if=virtio,file=$tmpdir/$qemufile \
     -drive if=virtio,file=$tmpdir/libc-test.img \
     -net nic,model=virtio \
     -net user \
     -nographic \
     -vga none 2>&1 | tee $CARGO_TARGET_DIR/out.log
   exec grep "^PASSED .* tests" $CARGO_TARGET_DIR/out.log
 fi
 
@@ -112,19 +116,28 @@ case "$TARGET" in
   arm-unknown-linux-gnueabihf)
     qemu-arm -L /usr/arm-linux-gnueabihf $CARGO_TARGET_DIR/$TARGET/debug/libc-test
     ;;
 
   mips-unknown-linux-gnu)
     qemu-mips -L /usr/mips-linux-gnu $CARGO_TARGET_DIR/$TARGET/debug/libc-test
     ;;
 
+  mips64-unknown-linux-gnuabi64)
+    qemu-mips64 -L /usr/mips64-linux-gnuabi64 $CARGO_TARGET_DIR/$TARGET/debug/libc-test
+    ;;
+
+  mips-unknown-linux-musl)
+    qemu-mips -L /toolchain/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.15 \
+              $CARGO_TARGET_DIR/$TARGET/debug/libc-test
+    ;;
+
   mipsel-unknown-linux-musl)
-    qemu-mipsel -L /toolchain $CARGO_TARGET_DIR/$TARGET/debug/libc-test
-    ;;
+      qemu-mipsel -L /toolchain $CARGO_TARGET_DIR/$TARGET/debug/libc-test
+      ;;
 
   powerpc-unknown-linux-gnu)
     qemu-ppc -L /usr/powerpc-linux-gnu $CARGO_TARGET_DIR/$TARGET/debug/libc-test
     ;;
 
   powerpc64-unknown-linux-gnu)
     qemu-ppc64 -L /usr/powerpc64-linux-gnu $CARGO_TARGET_DIR/$TARGET/debug/libc-test
     ;;
--- a/third_party/rust/libc/src/lib.rs
+++ b/third_party/rust/libc/src/lib.rs
@@ -70,16 +70,17 @@
     html_root_url = "https://doc.rust-lang.org/libc/x86_64-unknown-netbsd"
 ))]
 #![cfg_attr(target_os = "dragonfly", doc(
     html_root_url = "https://doc.rust-lang.org/libc/x86_64-unknown-dragonfly"
 ))]
 
 // Attributes needed when building as part of the standard library
 #![cfg_attr(stdbuild, feature(no_std, core, core_slice_ext, staged_api, custom_attribute, cfg_target_vendor))]
+#![cfg_attr(stdbuild, feature(link_cfg))]
 #![cfg_attr(stdbuild, no_std)]
 #![cfg_attr(stdbuild, staged_api)]
 #![cfg_attr(stdbuild, allow(warnings))]
 #![cfg_attr(stdbuild, unstable(feature = "libc",
                                reason = "use `libc` from crates.io",
                                issue = "27783"))]
 
 #![cfg_attr(not(feature = "use_std"), no_std)]
@@ -260,15 +261,18 @@ extern {
     pub fn rand() -> c_int;
     pub fn srand(seed: c_uint);
 }
 
 cfg_if! {
     if #[cfg(windows)] {
         mod windows;
         pub use windows::*;
+    } else if #[cfg(target_os = "redox")] {
+        mod redox;
+        pub use redox::*;
     } else if #[cfg(unix)] {
         mod unix;
         pub use unix::*;
     } else {
         // Unknown target_family
     }
 }
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/src/redox.rs
@@ -0,0 +1,49 @@
+pub type c_char = i8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+
+pub type wchar_t = i16;
+
+pub type off_t = usize;
+pub type mode_t = u16;
+pub type time_t = i64;
+pub type pid_t = usize;
+pub type gid_t = usize;
+pub type uid_t = usize;
+
+pub type in_addr_t = u32;
+pub type in_port_t = u16;
+
+pub type socklen_t = u32;
+pub type sa_family_t = u16;
+
+s! {
+    pub struct in_addr {
+        pub s_addr: in_addr_t,
+    }
+
+    pub struct in6_addr {
+        pub s6_addr: [u8; 16],
+        __align: [u32; 0],
+    }
+
+    pub struct sockaddr {
+        pub sa_family: sa_family_t,
+        pub sa_data: [::c_char; 14],
+    }
+
+    pub struct sockaddr_in {
+        pub sin_family: sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [u8; 8],
+    }
+
+    pub struct sockaddr_in6 {
+        pub sin6_family: sa_family_t,
+        pub sin6_port: in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: u32,
+    }
+}
--- a/third_party/rust/libc/src/unix/bsd/apple/mod.rs
+++ b/third_party/rust/libc/src/unix/bsd/apple/mod.rs
@@ -20,16 +20,26 @@ pub type speed_t = ::c_ulong;
 pub type tcflag_t = ::c_ulong;
 pub type nl_item = ::c_int;
 pub type id_t = ::c_uint;
 pub type sem_t = ::c_int;
 
 pub enum timezone {}
 
 s! {
+    pub struct aiocb {
+        pub aio_fildes: ::c_int,
+        pub aio_offset: ::off_t,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        pub aio_reqprio: ::c_int,
+        pub aio_sigevent: sigevent,
+        pub aio_lio_opcode: ::c_int
+    }
+
     pub struct utmpx {
         pub ut_user: [::c_char; _UTX_USERSIZE],
         pub ut_id: [::c_char; _UTX_IDSIZE],
         pub ut_line: [::c_char; _UTX_LINESIZE],
         pub ut_pid: ::pid_t,
         pub ut_type: ::c_short,
         pub ut_tv: ::timeval,
         pub ut_host: [::c_char; _UTX_HOSTSIZE],
@@ -298,16 +308,24 @@ s! {
         pub n_sign_posn: ::c_char,
         pub int_p_cs_precedes: ::c_char,
         pub int_n_cs_precedes: ::c_char,
         pub int_p_sep_by_space: ::c_char,
         pub int_n_sep_by_space: ::c_char,
         pub int_p_sign_posn: ::c_char,
         pub int_n_sign_posn: ::c_char,
     }
+
+    pub struct sigevent {
+        pub sigev_notify: ::c_int,
+        pub sigev_signo: ::c_int,
+        pub sigev_value: ::sigval,
+        __unused1: *mut ::c_void,       //actually a function pointer
+        pub sigev_notify_attributes: *mut ::pthread_attr_t
+    }
 }
 
 pub const _UTX_USERSIZE: usize = 256;
 pub const _UTX_LINESIZE: usize = 32;
 pub const _UTX_IDSIZE: usize = 4;
 pub const _UTX_HOSTSIZE: usize = 256;
 
 pub const EMPTY: ::c_short = 0;
@@ -616,16 +634,18 @@ pub const EPROTO: ::c_int = 100;
 pub const ETIME: ::c_int = 101;
 pub const EOPNOTSUPP: ::c_int = 102;
 pub const ENOPOLICY: ::c_int = 103;
 pub const ENOTRECOVERABLE: ::c_int = 104;
 pub const EOWNERDEAD: ::c_int = 105;
 pub const EQFULL: ::c_int = 106;
 pub const ELAST: ::c_int = 106;
 
+pub const EAI_SYSTEM: ::c_int = 11;
+
 pub const F_DUPFD: ::c_int = 0;
 pub const F_DUPFD_CLOEXEC: ::c_int = 67;
 pub const F_GETFD: ::c_int = 1;
 pub const F_SETFD: ::c_int = 2;
 pub const F_GETFL: ::c_int = 3;
 pub const F_SETFL: ::c_int = 4;
 pub const F_PREALLOCATE: ::c_int = 42;
 pub const F_RDADVISE: ::c_int = 44;
@@ -1324,16 +1344,30 @@ pub const POLLWRBAND: ::c_short = 0x100;
 
 pub const PRIO_DARWIN_THREAD: ::c_int = 3;
 pub const PRIO_DARWIN_PROCESS: ::c_int = 4;
 pub const PRIO_DARWIN_BG: ::c_int = 0x1000;
 pub const PRIO_DARWIN_NONUI: ::c_int = 0x1001;
 
 pub const SEM_FAILED: *mut sem_t = -1isize as *mut ::sem_t;
 
+pub const SIGEV_NONE: ::c_int = 0;
+pub const SIGEV_SIGNAL: ::c_int = 1;
+pub const SIGEV_THREAD: ::c_int = 3;
+
+pub const AIO_CANCELED: ::c_int = 2;
+pub const AIO_NOTCANCELED: ::c_int = 4;
+pub const AIO_ALLDONE: ::c_int = 1;
+pub const AIO_LISTIO_MAX: ::c_int = 16;
+pub const LIO_NOP: ::c_int = 0;
+pub const LIO_WRITE: ::c_int = 2;
+pub const LIO_READ: ::c_int = 1;
+pub const LIO_WAIT: ::c_int = 2;
+pub const LIO_NOWAIT: ::c_int = 1;
+
 f! {
     pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
         status >> 8
     }
 
     pub fn _WSTATUS(status: ::c_int) -> ::c_int {
         status & 0x7f
     }
@@ -1347,16 +1381,29 @@ f! {
     }
 
     pub fn WIFSTOPPED(status: ::c_int) -> bool {
         _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) != 0x13
     }
 }
 
 extern {
+    pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
+    pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
+    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
+               link_name = "aio_suspend$UNIX2003")]
+    pub fn aio_suspend(aiocb_list: *const *const aiocb, nitems: ::c_int,
+                       timeout: *const ::timespec) -> ::c_int;
+    pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+    pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb,
+                      nitems: ::c_int, sevp: *mut sigevent) -> ::c_int;
+
     pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
 
     pub fn getutxent() -> *mut utmpx;
     pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
     pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
     pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
     pub fn setutxent();
     pub fn endutxent();
--- a/third_party/rust/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
+++ b/third_party/rust/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -10,16 +10,28 @@ pub type time_t = i64;
 pub type suseconds_t = i64;
 
 pub type uuid_t = ::uuid;
 
 pub type fsblkcnt_t = u64;
 pub type fsfilcnt_t = u64;
 
 s! {
+    pub struct aiocb {
+        pub aio_fildes: ::c_int,
+        pub aio_offset: ::off_t,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        pub aio_sigevent: sigevent,
+        pub aio_lio_opcode: ::c_int,
+        pub aio_reqprio: ::c_int,
+        _aio_val: ::c_int,
+        _aio_err: ::c_int
+    }
+
     pub struct dirent {
         pub d_fileno: ::ino_t,
         pub d_namlen: u16,
         pub d_type: u8,
         __unused1: u8,
         __unused2: u32,
         pub d_name: [::c_char; 256],
     }
@@ -28,16 +40,25 @@ s! {
         pub time_low: u32,
         pub time_mid: u16,
         pub time_hi_and_version: u16,
         pub clock_seq_hi_and_reserved: u8,
         pub clock_seq_low: u8,
         pub node: [u8; 6],
     }
 
+    pub struct sigevent {
+        pub sigev_notify: ::c_int,
+        pub sigev_signo: ::c_int,       //actually a union
+        #[cfg(target_pointer_width = "64")]
+        __unused1: ::c_int,
+        pub sigev_value: ::sigval,
+        __unused2: *mut ::c_void        //actually a function pointer
+    }
+
     pub struct statvfs {
         pub f_bsize: ::c_ulong,
         pub f_frsize: ::c_ulong,
         pub f_blocks: ::fsblkcnt_t,
         pub f_bfree: ::fsblkcnt_t,
         pub f_bavail: ::fsblkcnt_t,
         pub f_files: ::fsfilcnt_t,
         pub f_ffree: ::fsfilcnt_t,
@@ -288,14 +309,16 @@ pub const NOTE_EXIT: ::uint32_t = 0x8000
 pub const NOTE_FORK: ::uint32_t = 0x40000000;
 pub const NOTE_EXEC: ::uint32_t = 0x20000000;
 pub const NOTE_PDATAMASK: ::uint32_t = 0x000fffff;
 pub const NOTE_PCTRLMASK: ::uint32_t = 0xf0000000;
 pub const NOTE_TRACK: ::uint32_t = 0x00000001;
 pub const NOTE_TRACKERR: ::uint32_t = 0x00000002;
 pub const NOTE_CHILD: ::uint32_t = 0x00000004;
 
+pub const MSG_NOSIGNAL: ::uint32_t = 0x400;
+
 extern {
     pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
                     -> ::c_int;
     pub fn clock_getres(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
     pub fn clock_gettime(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
 }
--- a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -1,42 +1,73 @@
 pub type fflags_t = u32;
 pub type clock_t = i32;
 pub type ino_t = u32;
+pub type lwpid_t = i32;
 pub type nlink_t = u16;
 pub type blksize_t = u32;
 pub type clockid_t = ::c_int;
 
 pub type fsblkcnt_t = ::uint64_t;
 pub type fsfilcnt_t = ::uint64_t;
 
 s! {
+    pub struct aiocb {
+        pub aio_fildes: ::c_int,
+        pub aio_offset: ::off_t,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        __unused1: [::c_int; 2],
+        __unused2: *mut ::c_void,
+        pub aio_lio_opcode: ::c_int,
+        pub aio_reqprio: ::c_int,
+        // unused 3 through 5 are the __aiocb_private structure
+        __unused3: ::c_long,
+        __unused4: ::c_long,
+        __unused5: *mut ::c_void,
+        pub aio_sigevent: sigevent
+    }
+
     pub struct dirent {
         pub d_fileno: u32,
         pub d_reclen: u16,
         pub d_type: u8,
         pub d_namlen: u8,
         pub d_name: [::c_char; 256],
     }
 
+    pub struct sigevent {
+        pub sigev_notify: ::c_int,
+        pub sigev_signo: ::c_int,
+        pub sigev_value: ::sigval,
+        //The rest of the structure is actually a union.  We expose only
+        //sigev_notify_thread_id because it's the most useful union member.
+        pub sigev_notify_thread_id: ::lwpid_t,
+        #[cfg(target_pointer_width = "64")]
+        __unused1: ::c_int,
+        __unused2: [::c_long; 7]
+    }
+
     pub struct statvfs {
         pub f_bavail: ::fsblkcnt_t,
         pub f_bfree: ::fsblkcnt_t,
         pub f_blocks: ::fsblkcnt_t,
         pub f_favail: ::fsfilcnt_t,
         pub f_ffree: ::fsfilcnt_t,
         pub f_files: ::fsfilcnt_t,
         pub f_bsize: ::c_ulong,
         pub f_flag: ::c_ulong,
         pub f_frsize: ::c_ulong,
         pub f_fsid: ::c_ulong,
         pub f_namemax: ::c_ulong,
     }
 }
 
+pub const SIGEV_THREAD_ID: ::c_int = 4;
+
 pub const RAND_MAX: ::c_int = 0x7fff_fffd;
 pub const PTHREAD_STACK_MIN: ::size_t = 2048;
 pub const SIGSTKSZ: ::size_t = 34816;
 pub const SF_NODISKIO: ::c_int = 0x00000001;
 pub const SF_MNOWAIT: ::c_int = 0x00000002;
 pub const SF_SYNC: ::c_int = 0x00000004;
 pub const O_CLOEXEC: ::c_int = 0x00100000;
 pub const F_GETLK: ::c_int = 11;
@@ -133,17 +164,16 @@ pub const CTL_KERN: ::c_int = 1;
 pub const CTL_VM: ::c_int = 2;
 pub const CTL_VFS: ::c_int = 3;
 pub const CTL_NET: ::c_int = 4;
 pub const CTL_DEBUG: ::c_int = 5;
 pub const CTL_HW: ::c_int = 6;
 pub const CTL_MACHDEP: ::c_int = 7;
 pub const CTL_USER: ::c_int = 8;
 pub const CTL_P1003_1B: ::c_int = 9;
-pub const CTL_MAXID: ::c_int = 10;
 pub const KERN_OSTYPE: ::c_int = 1;
 pub const KERN_OSRELEASE: ::c_int = 2;
 pub const KERN_OSREV: ::c_int = 3;
 pub const KERN_VERSION: ::c_int = 4;
 pub const KERN_MAXVNODES: ::c_int = 5;
 pub const KERN_MAXPROC: ::c_int = 6;
 pub const KERN_MAXFILES: ::c_int = 7;
 pub const KERN_ARGMAX: ::c_int = 8;
@@ -171,17 +201,16 @@ pub const KERN_DUMPDEV: ::c_int = 29;
 pub const KERN_IPC: ::c_int = 30;
 pub const KERN_DUMMY: ::c_int = 31;
 pub const KERN_PS_STRINGS: ::c_int = 32;
 pub const KERN_USRSTACK: ::c_int = 33;
 pub const KERN_LOGSIGEXIT: ::c_int = 34;
 pub const KERN_IOV_MAX: ::c_int = 35;
 pub const KERN_HOSTUUID: ::c_int = 36;
 pub const KERN_ARND: ::c_int = 37;
-pub const KERN_MAXID: ::c_int = 38;
 pub const KERN_PROC_ALL: ::c_int = 0;
 pub const KERN_PROC_PID: ::c_int = 1;
 pub const KERN_PROC_PGRP: ::c_int = 2;
 pub const KERN_PROC_SESSION: ::c_int = 3;
 pub const KERN_PROC_TTY: ::c_int = 4;
 pub const KERN_PROC_UID: ::c_int = 5;
 pub const KERN_PROC_RUID: ::c_int = 6;
 pub const KERN_PROC_ARGS: ::c_int = 7;
@@ -218,17 +247,16 @@ pub const HW_BYTEORDER: ::c_int = 4;
 pub const HW_PHYSMEM: ::c_int = 5;
 pub const HW_USERMEM: ::c_int = 6;
 pub const HW_PAGESIZE: ::c_int = 7;
 pub const HW_DISKNAMES: ::c_int = 8;
 pub const HW_DISKSTATS: ::c_int = 9;
 pub const HW_FLOATINGPT: ::c_int = 10;
 pub const HW_MACHINE_ARCH: ::c_int = 11;
 pub const HW_REALMEM: ::c_int = 12;
-pub const HW_MAXID: ::c_int = 13;
 pub const USER_CS_PATH: ::c_int = 1;
 pub const USER_BC_BASE_MAX: ::c_int = 2;
 pub const USER_BC_DIM_MAX: ::c_int = 3;
 pub const USER_BC_SCALE_MAX: ::c_int = 4;
 pub const USER_BC_STRING_MAX: ::c_int = 5;
 pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
 pub const USER_EXPR_NEST_MAX: ::c_int = 7;
 pub const USER_LINE_MAX: ::c_int = 8;
@@ -239,17 +267,16 @@ pub const USER_POSIX2_C_DEV: ::c_int = 1
 pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
 pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
 pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
 pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
 pub const USER_POSIX2_SW_DEV: ::c_int = 17;
 pub const USER_POSIX2_UPE: ::c_int = 18;
 pub const USER_STREAM_MAX: ::c_int = 19;
 pub const USER_TZNAME_MAX: ::c_int = 20;
-pub const USER_MAXID: ::c_int = 21;
 pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1;
 pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2;
 pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3;
 pub const CTL_P1003_1B_MEMLOCK_RANGE: ::c_int = 4;
 pub const CTL_P1003_1B_MEMORY_PROTECTION: ::c_int = 5;
 pub const CTL_P1003_1B_MESSAGE_PASSING: ::c_int = 6;
 pub const CTL_P1003_1B_PRIORITIZED_IO: ::c_int = 7;
 pub const CTL_P1003_1B_PRIORITY_SCHEDULING: ::c_int = 8;
@@ -265,18 +292,34 @@ pub const CTL_P1003_1B_AIO_PRIO_DELTA_MA
 pub const CTL_P1003_1B_DELAYTIMER_MAX: ::c_int = 18;
 pub const CTL_P1003_1B_MQ_OPEN_MAX: ::c_int = 19;
 pub const CTL_P1003_1B_PAGESIZE: ::c_int = 20;
 pub const CTL_P1003_1B_RTSIG_MAX: ::c_int = 21;
 pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22;
 pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23;
 pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24;
 pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25;
+
+// The *_MAXID constants never should've been used outside of the
+// FreeBSD base system.  And with the exception of CTL_P1003_1B_MAXID,
+// they were all removed in svn r262489.  They remain here for backwards
+// compatibility only, and are scheduled to be removed in libc 1.0.0.
+#[doc(hidden)]
+pub const CTL_MAXID: ::c_int = 10;
+#[doc(hidden)]
+pub const KERN_MAXID: ::c_int = 38;
+#[doc(hidden)]
+pub const HW_MAXID: ::c_int = 13;
+#[doc(hidden)]
+pub const USER_MAXID: ::c_int = 21;
+#[doc(hidden)]
 pub const CTL_P1003_1B_MAXID: ::c_int = 26;
 
+pub const MSG_NOSIGNAL: ::c_int = 0x20000;
+
 extern {
     pub fn __error() -> *mut ::c_int;
 
     pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int)
                     -> ::c_int;
 
     pub fn clock_getres(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
     pub fn clock_gettime(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
--- a/third_party/rust/libc/src/unix/bsd/freebsdlike/mod.rs
+++ b/third_party/rust/libc/src/unix/bsd/freebsdlike/mod.rs
@@ -24,24 +24,22 @@ s! {
         pub ut_pid: ::pid_t,
         pub ut_user: [::c_char; 32],
         pub ut_line: [::c_char; 16],
         pub ut_host: [::c_char; 128],
         pub __ut_spare: [::c_char; 64],
     }
 
     pub struct glob_t {
-        pub gl_pathc: ::size_t,
-        __unused1: ::size_t,
-        pub gl_offs: ::size_t,
-        __unused2: ::c_int,
+        pub gl_pathc:  ::size_t,
+        pub gl_matchc: ::size_t,
+        pub gl_offs:   ::size_t,
+        pub gl_flags:  ::c_int,
         pub gl_pathv:  *mut *mut ::c_char,
-
         __unused3: *mut ::c_void,
-
         __unused4: *mut ::c_void,
         __unused5: *mut ::c_void,
         __unused6: *mut ::c_void,
         __unused7: *mut ::c_void,
         __unused8: *mut ::c_void,
     }
 
     pub struct kevent {
@@ -89,16 +87,17 @@ s! {
 
     pub struct sigaction {
         pub sa_sigaction: ::sighandler_t,
         pub sa_flags: ::c_int,
         pub sa_mask: sigset_t,
     }
 
     pub struct stack_t {
+        // In FreeBSD 11 and later, ss_sp is actually a void*
         pub ss_sp: *mut ::c_char,
         pub ss_size: ::size_t,
         pub ss_flags: ::c_int,
     }
 
     pub struct sched_param {
         pub sched_priority: ::c_int,
     }
@@ -173,16 +172,31 @@ s! {
     }
 
     // internal structure has changed over time
     pub struct _sem {
         data: [u32; 4],
     }
 }
 
+pub const AIO_LISTIO_MAX: ::c_int = 16;
+pub const AIO_CANCELED: ::c_int = 1;
+pub const AIO_NOTCANCELED: ::c_int = 2;
+pub const AIO_ALLDONE: ::c_int = 3;
+pub const LIO_NOP: ::c_int = 0;
+pub const LIO_WRITE: ::c_int = 1;
+pub const LIO_READ: ::c_int = 2;
+pub const LIO_WAIT: ::c_int = 1;
+pub const LIO_NOWAIT: ::c_int = 0;
+
+pub const SIGEV_NONE: ::c_int = 0;
+pub const SIGEV_SIGNAL: ::c_int = 1;
+pub const SIGEV_THREAD: ::c_int = 2;
+pub const SIGEV_KEVENT: ::c_int = 3;
+
 pub const EMPTY: ::c_short = 0;
 pub const BOOT_TIME: ::c_short = 1;
 pub const OLD_TIME: ::c_short = 2;
 pub const NEW_TIME: ::c_short = 3;
 pub const USER_PROCESS: ::c_short = 4;
 pub const INIT_PROCESS: ::c_short = 5;
 pub const LOGIN_PROCESS: ::c_short = 6;
 pub const DEAD_PROCESS: ::c_short = 7;
@@ -416,16 +430,17 @@ pub const EALREADY: ::c_int = 37;
 pub const ENOTSOCK: ::c_int = 38;
 pub const EDESTADDRREQ: ::c_int = 39;
 pub const EMSGSIZE: ::c_int = 40;
 pub const EPROTOTYPE: ::c_int = 41;
 pub const ENOPROTOOPT: ::c_int = 42;
 pub const EPROTONOSUPPORT: ::c_int = 43;
 pub const ESOCKTNOSUPPORT: ::c_int = 44;
 pub const EOPNOTSUPP: ::c_int = 45;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
 pub const EPFNOSUPPORT: ::c_int = 46;
 pub const EAFNOSUPPORT: ::c_int = 47;
 pub const EADDRINUSE: ::c_int = 48;
 pub const EADDRNOTAVAIL: ::c_int = 49;
 pub const ENETDOWN: ::c_int = 50;
 pub const ENETUNREACH: ::c_int = 51;
 pub const ENETRESET: ::c_int = 52;
 pub const ECONNABORTED: ::c_int = 53;
@@ -464,16 +479,18 @@ pub const ECANCELED: ::c_int = 85;
 pub const EILSEQ: ::c_int = 86;
 pub const ENOATTR: ::c_int = 87;
 pub const EDOOFUS: ::c_int = 88;
 pub const EBADMSG: ::c_int = 89;
 pub const EMULTIHOP: ::c_int = 90;
 pub const ENOLINK: ::c_int = 91;
 pub const EPROTO: ::c_int = 92;
 
+pub const EAI_SYSTEM: ::c_int = 11;
+
 pub const F_DUPFD: ::c_int = 0;
 pub const F_GETFD: ::c_int = 1;
 pub const F_SETFD: ::c_int = 2;
 pub const F_GETFL: ::c_int = 3;
 pub const F_SETFL: ::c_int = 4;
 
 pub const SIGTRAP: ::c_int = 5;
 
@@ -740,16 +757,29 @@ extern {
     pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
     pub fn setutxent();
     pub fn getutxuser(user: *const ::c_char) -> *mut utmpx;
     pub fn setutxdb(_type: ::c_int, file: *const ::c_char) -> ::c_int;
 }
 
 #[link(name = "util")]
 extern {
+    pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
+    pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
+    pub fn aio_suspend(aiocb_list: *const *const aiocb, nitems: ::c_int,
+                       timeout: *const ::timespec) -> ::c_int;
+    pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+    pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb,
+                      nitems: ::c_int, sevp: *mut sigevent) -> ::c_int;
+    pub fn aio_waitcomplete(iocbp: *mut *mut aiocb,
+                            timeout: *mut ::timespec) -> ::ssize_t;
+
     pub fn getnameinfo(sa: *const ::sockaddr,
                        salen: ::socklen_t,
                        host: *mut ::c_char,
                        hostlen: ::size_t,
                        serv: *mut ::c_char,
                        servlen: ::size_t,
                        flags: ::c_int) -> ::c_int;
     pub fn kevent(kq: ::c_int,
@@ -857,16 +887,18 @@ extern {
                    mode: ::mode_t) -> ::c_int;
     pub fn pthread_condattr_getclock(attr: *const pthread_condattr_t,
                                      clock_id: *mut clockid_t) -> ::c_int;
     pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t,
                                      clock_id: clockid_t) -> ::c_int;
     pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int;
     pub fn sem_timedwait(sem: *mut sem_t,
                          abstime: *const ::timespec) -> ::c_int;
+    pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t,
+                                   abstime: *const ::timespec) -> ::c_int;
 }
 
 cfg_if! {
     if #[cfg(target_os = "freebsd")] {
         mod freebsd;
         pub use self::freebsd::*;
     } else if #[cfg(target_os = "dragonfly")] {
         mod dragonfly;
--- a/third_party/rust/libc/src/unix/bsd/mod.rs
+++ b/third_party/rust/libc/src/unix/bsd/mod.rs
@@ -316,16 +316,18 @@ f! {
     }
 
     pub fn WCOREDUMP(status: ::c_int) -> bool {
         (status & 0o200) != 0
     }
 }
 
 extern {
+    pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
+    pub fn freeifaddrs(ifa: *mut ::ifaddrs);
     pub fn setgroups(ngroups: ::c_int,
                      ptr: *const ::gid_t) -> ::c_int;
     pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
     pub fn kqueue() -> ::c_int;
     pub fn unmount(target: *const ::c_char, arg: ::c_int) -> ::c_int;
     pub fn syscall(num: ::c_int, ...) -> ::c_int;
     #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")]
     pub fn getpwnam_r(name: *const ::c_char,
@@ -350,17 +352,17 @@ extern {
 }
 
 cfg_if! {
     if #[cfg(any(target_os = "macos", target_os = "ios"))] {
         mod apple;
         pub use self::apple::*;
     } else if #[cfg(any(target_os = "openbsd", target_os = "netbsd",
                         target_os = "bitrig"))] {
-        mod openbsdlike;
-        pub use self::openbsdlike::*;
+        mod netbsdlike;
+        pub use self::netbsdlike::*;
     } else if #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] {
         mod freebsdlike;
         pub use self::freebsdlike::*;
     } else {
         // Unknown target_os
     }
 }
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/src/unix/bsd/netbsdlike/mod.rs
@@ -0,0 +1,547 @@
+pub type time_t = i64;
+pub type mode_t = u32;
+pub type nlink_t = ::uint32_t;
+pub type ino_t = ::uint64_t;
+pub type pthread_key_t = ::c_int;
+pub type rlim_t = u64;
+pub type speed_t = ::c_uint;
+pub type tcflag_t = ::c_uint;
+pub type nl_item = c_long;
+pub type clockid_t = ::c_int;
+pub type id_t = ::uint32_t;
+pub type sem_t = *mut sem;
+
+pub enum timezone {}
+pub enum sem {}
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+
+    pub struct sockaddr_in {
+        pub sin_len: u8,
+        pub sin_family: ::sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [::int8_t; 8],
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_cc: [::cc_t; ::NCCS],
+        pub c_ispeed: ::c_int,
+        pub c_ospeed: ::c_int,
+    }
+
+    pub struct flock {
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+    }
+}
+
+pub const D_T_FMT: ::nl_item = 0;
+pub const D_FMT: ::nl_item = 1;
+pub const T_FMT: ::nl_item = 2;
+pub const T_FMT_AMPM: ::nl_item = 3;
+pub const AM_STR: ::nl_item = 4;
+pub const PM_STR: ::nl_item = 5;
+
+pub const DAY_1: ::nl_item = 6;
+pub const DAY_2: ::nl_item = 7;
+pub const DAY_3: ::nl_item = 8;
+pub const DAY_4: ::nl_item = 9;
+pub const DAY_5: ::nl_item = 10;
+pub const DAY_6: ::nl_item = 11;
+pub const DAY_7: ::nl_item = 12;
+
+pub const ABDAY_1: ::nl_item = 13;
+pub const ABDAY_2: ::nl_item = 14;
+pub const ABDAY_3: ::nl_item = 15;
+pub const ABDAY_4: ::nl_item = 16;
+pub const ABDAY_5: ::nl_item = 17;
+pub const ABDAY_6: ::nl_item = 18;
+pub const ABDAY_7: ::nl_item = 19;
+
+pub const MON_1: ::nl_item = 20;
+pub const MON_2: ::nl_item = 21;
+pub const MON_3: ::nl_item = 22;
+pub const MON_4: ::nl_item = 23;
+pub const MON_5: ::nl_item = 24;
+pub const MON_6: ::nl_item = 25;
+pub const MON_7: ::nl_item = 26;
+pub const MON_8: ::nl_item = 27;
+pub const MON_9: ::nl_item = 28;
+pub const MON_10: ::nl_item = 29;
+pub const MON_11: ::nl_item = 30;
+pub const MON_12: ::nl_item = 31;
+
+pub const ABMON_1: ::nl_item = 32;
+pub const ABMON_2: ::nl_item = 33;
+pub const ABMON_3: ::nl_item = 34;
+pub const ABMON_4: ::nl_item = 35;
+pub const ABMON_5: ::nl_item = 36;
+pub const ABMON_6: ::nl_item = 37;
+pub const ABMON_7: ::nl_item = 38;
+pub const ABMON_8: ::nl_item = 39;
+pub const ABMON_9: ::nl_item = 40;
+pub const ABMON_10: ::nl_item = 41;
+pub const ABMON_11: ::nl_item = 42;
+pub const ABMON_12: ::nl_item = 43;
+
+pub const RADIXCHAR: ::nl_item = 44;
+pub const THOUSEP: ::nl_item = 45;
+pub const YESSTR: ::nl_item = 46;
+pub const YESEXPR: ::nl_item = 47;
+pub const NOSTR: ::nl_item = 48;
+pub const NOEXPR: ::nl_item = 49;
+pub const CRNCYSTR: ::nl_item = 50;
+
+pub const CODESET: ::nl_item = 51;
+
+pub const EXIT_FAILURE : ::c_int = 1;
+pub const EXIT_SUCCESS : ::c_int = 0;
+pub const RAND_MAX : ::c_int = 2147483647;
+pub const EOF : ::c_int = -1;
+pub const SEEK_SET : ::c_int = 0;
+pub const SEEK_CUR : ::c_int = 1;
+pub const SEEK_END : ::c_int = 2;
+pub const _IOFBF : ::c_int = 0;
+pub const _IONBF : ::c_int = 2;
+pub const _IOLBF : ::c_int = 1;
+pub const BUFSIZ : ::c_uint = 1024;
+pub const FOPEN_MAX : ::c_uint = 20;
+pub const FILENAME_MAX : ::c_uint = 1024;
+pub const L_tmpnam : ::c_uint = 1024;
+pub const O_RDONLY : ::c_int = 0;
+pub const O_WRONLY : ::c_int = 1;
+pub const O_RDWR : ::c_int = 2;
+pub const O_ACCMODE : ::c_int = 3;
+pub const O_APPEND : ::c_int = 8;
+pub const O_CREAT : ::c_int = 512;
+pub const O_EXCL : ::c_int = 2048;
+pub const O_NOCTTY : ::c_int = 32768;
+pub const O_TRUNC : ::c_int = 1024;
+pub const O_SYNC : ::c_int = 128;
+pub const S_IFIFO : mode_t = 4096;
+pub const S_IFCHR : mode_t = 8192;
+pub const S_IFBLK : mode_t = 24576;
+pub const S_IFDIR : mode_t = 16384;
+pub const S_IFREG : mode_t = 32768;
+pub const S_IFLNK : mode_t = 40960;
+pub const S_IFSOCK : mode_t = 49152;
+pub const S_IFMT : mode_t = 61440;
+pub const S_IEXEC : mode_t = 64;
+pub const S_IWRITE : mode_t = 128;
+pub const S_IREAD : mode_t = 256;
+pub const S_IRWXU : mode_t = 448;
+pub const S_IXUSR : mode_t = 64;
+pub const S_IWUSR : mode_t = 128;
+pub const S_IRUSR : mode_t = 256;
+pub const S_IRWXG : mode_t = 56;
+pub const S_IXGRP : mode_t = 8;
+pub const S_IWGRP : mode_t = 16;
+pub const S_IRGRP : mode_t = 32;
+pub const S_IRWXO : mode_t = 7;
+pub const S_IXOTH : mode_t = 1;
+pub const S_IWOTH : mode_t = 2;
+pub const S_IROTH : mode_t = 4;
+pub const F_OK : ::c_int = 0;
+pub const R_OK : ::c_int = 4;
+pub const W_OK : ::c_int = 2;
+pub const X_OK : ::c_int = 1;
+pub const STDIN_FILENO : ::c_int = 0;
+pub const STDOUT_FILENO : ::c_int = 1;
+pub const STDERR_FILENO : ::c_int = 2;
+pub const F_LOCK : ::c_int = 1;
+pub const F_TEST : ::c_int = 3;
+pub const F_TLOCK : ::c_int = 2;
+pub const F_ULOCK : ::c_int = 0;
+pub const F_GETLK: ::c_int = 7;
+pub const F_SETLK: ::c_int = 8;
+pub const F_SETLKW: ::c_int = 9;
+pub const SIGHUP : ::c_int = 1;
+pub const SIGINT : ::c_int = 2;
+pub const SIGQUIT : ::c_int = 3;
+pub const SIGILL : ::c_int = 4;
+pub const SIGABRT : ::c_int = 6;
+pub const SIGEMT: ::c_int = 7;
+pub const SIGFPE : ::c_int = 8;
+pub const SIGKILL : ::c_int = 9;
+pub const SIGSEGV : ::c_int = 11;
+pub const SIGPIPE : ::c_int = 13;
+pub const SIGALRM : ::c_int = 14;
+pub const SIGTERM : ::c_int = 15;
+pub const SIGSTKSZ : ::size_t = 40960;
+
+pub const PROT_NONE : ::c_int = 0;
+pub const PROT_READ : ::c_int = 1;
+pub const PROT_WRITE : ::c_int = 2;
+pub const PROT_EXEC : ::c_int = 4;
+
+pub const MAP_FILE : ::c_int = 0x0000;
+pub const MAP_SHARED : ::c_int = 0x0001;
+pub const MAP_PRIVATE : ::c_int = 0x0002;
+pub const MAP_FIXED : ::c_int = 0x0010;
+pub const MAP_ANON : ::c_int = 0x1000;
+
+pub const MAP_FAILED : *mut ::c_void = !0 as *mut ::c_void;
+
+pub const MCL_CURRENT : ::c_int = 0x0001;
+pub const MCL_FUTURE : ::c_int = 0x0002;
+
+pub const MS_ASYNC : ::c_int = 0x0001;
+
+pub const EPERM : ::c_int = 1;
+pub const ENOENT : ::c_int = 2;
+pub const ESRCH : ::c_int = 3;
+pub const EINTR : ::c_int = 4;
+pub const EIO : ::c_int = 5;
+pub const ENXIO : ::c_int = 6;
+pub const E2BIG : ::c_int = 7;
+pub const ENOEXEC : ::c_int = 8;
+pub const EBADF : ::c_int = 9;
+pub const ECHILD : ::c_int = 10;
+pub const EDEADLK : ::c_int = 11;
+pub const ENOMEM : ::c_int = 12;
+pub const EACCES : ::c_int = 13;
+pub const EFAULT : ::c_int = 14;
+pub const ENOTBLK : ::c_int = 15;
+pub const EBUSY : ::c_int = 16;
+pub const EEXIST : ::c_int = 17;
+pub const EXDEV : ::c_int = 18;
+pub const ENODEV : ::c_int = 19;
+pub const ENOTDIR : ::c_int = 20;
+pub const EISDIR : ::c_int = 21;
+pub const EINVAL : ::c_int = 22;
+pub const ENFILE : ::c_int = 23;
+pub const EMFILE : ::c_int = 24;
+pub const ENOTTY : ::c_int = 25;
+pub const ETXTBSY : ::c_int = 26;
+pub const EFBIG : ::c_int = 27;
+pub const ENOSPC : ::c_int = 28;
+pub const ESPIPE : ::c_int = 29;
+pub const EROFS : ::c_int = 30;
+pub const EMLINK : ::c_int = 31;
+pub const EPIPE : ::c_int = 32;
+pub const EDOM : ::c_int = 33;
+pub const ERANGE : ::c_int = 34;
+pub const EAGAIN : ::c_int = 35;
+pub const EWOULDBLOCK : ::c_int = 35;
+pub const EINPROGRESS : ::c_int = 36;
+pub const EALREADY : ::c_int = 37;
+pub const ENOTSOCK : ::c_int = 38;
+pub const EDESTADDRREQ : ::c_int = 39;
+pub const EMSGSIZE : ::c_int = 40;
+pub const EPROTOTYPE : ::c_int = 41;
+pub const ENOPROTOOPT : ::c_int = 42;
+pub const EPROTONOSUPPORT : ::c_int = 43;
+pub const ESOCKTNOSUPPORT : ::c_int = 44;
+pub const EOPNOTSUPP : ::c_int = 45;
+pub const EPFNOSUPPORT : ::c_int = 46;
+pub const EAFNOSUPPORT : ::c_int = 47;
+pub const EADDRINUSE : ::c_int = 48;
+pub const EADDRNOTAVAIL : ::c_int = 49;
+pub const ENETDOWN : ::c_int = 50;
+pub const ENETUNREACH : ::c_int = 51;
+pub const ENETRESET : ::c_int = 52;
+pub const ECONNABORTED : ::c_int = 53;
+pub const ECONNRESET : ::c_int = 54;
+pub const ENOBUFS : ::c_int = 55;
+pub const EISCONN : ::c_int = 56;
+pub const ENOTCONN : ::c_int = 57;
+pub const ESHUTDOWN : ::c_int = 58;
+pub const ETOOMANYREFS : ::c_int = 59;
+pub const ETIMEDOUT : ::c_int = 60;
+pub const ECONNREFUSED : ::c_int = 61;
+pub const ELOOP : ::c_int = 62;
+pub const ENAMETOOLONG : ::c_int = 63;
+pub const EHOSTDOWN : ::c_int = 64;
+pub const EHOSTUNREACH : ::c_int = 65;
+pub const ENOTEMPTY : ::c_int = 66;
+pub const EPROCLIM : ::c_int = 67;
+pub const EUSERS : ::c_int = 68;
+pub const EDQUOT : ::c_int = 69;
+pub const ESTALE : ::c_int = 70;
+pub const EREMOTE : ::c_int = 71;
+pub const EBADRPC : ::c_int = 72;
+pub const ERPCMISMATCH : ::c_int = 73;
+pub const EPROGUNAVAIL : ::c_int = 74;
+pub const EPROGMISMATCH : ::c_int = 75;
+pub const EPROCUNAVAIL : ::c_int = 76;
+pub const ENOLCK : ::c_int = 77;
+pub const ENOSYS : ::c_int = 78;
+pub const EFTYPE : ::c_int = 79;
+pub const EAUTH : ::c_int = 80;
+pub const ENEEDAUTH : ::c_int = 81;
+
+pub const F_DUPFD : ::c_int = 0;
+pub const F_GETFD : ::c_int = 1;
+pub const F_SETFD : ::c_int = 2;
+pub const F_GETFL : ::c_int = 3;
+pub const F_SETFL : ::c_int = 4;
+
+pub const SIGTRAP : ::c_int = 5;
+
+pub const GLOB_APPEND   : ::c_int = 0x0001;
+pub const GLOB_DOOFFS   : ::c_int = 0x0002;
+pub const GLOB_ERR      : ::c_int = 0x0004;
+pub const GLOB_MARK     : ::c_int = 0x0008;
+pub const GLOB_NOCHECK  : ::c_int = 0x0010;
+pub const GLOB_NOSORT   : ::c_int = 0x0020;
+pub const GLOB_NOESCAPE : ::c_int = 0x1000;
+
+pub const GLOB_NOSPACE  : ::c_int = -1;
+pub const GLOB_ABORTED  : ::c_int = -2;
+pub const GLOB_NOMATCH  : ::c_int = -3;
+pub const GLOB_NOSYS : ::c_int = -4;
+
+pub const POSIX_MADV_NORMAL : ::c_int = 0;
+pub const POSIX_MADV_RANDOM : ::c_int = 1;
+pub const POSIX_MADV_SEQUENTIAL : ::c_int = 2;
+pub const POSIX_MADV_WILLNEED : ::c_int = 3;
+pub const POSIX_MADV_DONTNEED : ::c_int = 4;
+
+pub const _SC_XOPEN_SHM : ::c_int = 30;
+
+pub const PTHREAD_CREATE_JOINABLE : ::c_int = 0;
+pub const PTHREAD_CREATE_DETACHED : ::c_int = 1;
+
+// http://man.openbsd.org/OpenBSD-current/man2/clock_getres.2
+// The man page says clock_gettime(3) can accept various values as clockid_t but
+// http://fxr.watson.org/fxr/source/kern/kern_time.c?v=OPENBSD;im=excerpts#L161
+// the implementation rejects anything other than the below two
+//
+// http://netbsd.gw.com/cgi-bin/man-cgi?clock_gettime
+// https://github.com/jsonn/src/blob/HEAD/sys/kern/subr_time.c#L222
+// Basically the same goes for NetBSD
+pub const CLOCK_REALTIME: clockid_t = 0;
+pub const CLOCK_MONOTONIC: clockid_t = 3;
+
+pub const RLIMIT_CPU: ::c_int = 0;
+pub const RLIMIT_FSIZE: ::c_int = 1;
+pub const RLIMIT_DATA: ::c_int = 2;
+pub const RLIMIT_STACK: ::c_int = 3;
+pub const RLIMIT_CORE: ::c_int = 4;
+pub const RLIMIT_RSS: ::c_int = 5;
+pub const RLIMIT_MEMLOCK: ::c_int = 6;
+pub const RLIMIT_NPROC: ::c_int = 7;
+pub const RLIMIT_NOFILE: ::c_int = 8;
+
+pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
+pub const RLIM_SAVED_MAX: rlim_t = RLIM_INFINITY;
+pub const RLIM_SAVED_CUR: rlim_t = RLIM_INFINITY;
+
+pub const RUSAGE_SELF: ::c_int = 0;
+pub const RUSAGE_CHILDREN: ::c_int = -1;
+
+pub const MADV_NORMAL : ::c_int = 0;
+pub const MADV_RANDOM : ::c_int = 1;
+pub const MADV_SEQUENTIAL : ::c_int = 2;
+pub const MADV_WILLNEED : ::c_int = 3;
+pub const MADV_DONTNEED : ::c_int = 4;
+pub const MADV_FREE : ::c_int = 6;
+
+pub const AF_UNIX: ::c_int = 1;
+pub const AF_INET: ::c_int = 2;
+pub const AF_INET6: ::c_int = 24;
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SOCK_RAW: ::c_int = 3;
+pub const SOCK_SEQPACKET: ::c_int = 5;
+pub const IPPROTO_TCP: ::c_int = 6;
+pub const IPPROTO_IP: ::c_int = 0;
+pub const IPPROTO_IPV6: ::c_int = 41;
+pub const IP_MULTICAST_TTL: ::c_int = 10;
+pub const IP_MULTICAST_LOOP: ::c_int = 11;
+pub const IP_TTL: ::c_int = 4;
+pub const IP_HDRINCL: ::c_int = 2;
+pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
+pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
+
+pub const TCP_NODELAY: ::c_int = 0x01;
+pub const SOL_SOCKET: ::c_int = 0xffff;
+pub const SO_DEBUG: ::c_int = 0x01;
+pub const SO_ACCEPTCONN: ::c_int = 0x0002;
+pub const SO_REUSEADDR: ::c_int = 0x0004;
+pub const SO_KEEPALIVE: ::c_int = 0x0008;
+pub const SO_DONTROUTE: ::c_int = 0x0010;
+pub const SO_BROADCAST: ::c_int = 0x0020;
+pub const SO_USELOOPBACK: ::c_int = 0x0040;
+pub const SO_LINGER: ::c_int = 0x0080;
+pub const SO_OOBINLINE: ::c_int = 0x0100;
+pub const SO_REUSEPORT: ::c_int = 0x0200;
+pub const SO_SNDBUF: ::c_int = 0x1001;
+pub const SO_RCVBUF: ::c_int = 0x1002;
+pub const SO_SNDLOWAT: ::c_int = 0x1003;
+pub const SO_RCVLOWAT: ::c_int = 0x1004;
+pub const SO_ERROR: ::c_int = 0x1007;
+pub const SO_TYPE: ::c_int = 0x1008;
+
+pub const MSG_NOSIGNAL: ::c_int = 0x400;
+
+pub const IFF_LOOPBACK: ::c_int = 0x8;
+
+pub const SHUT_RD: ::c_int = 0;
+pub const SHUT_WR: ::c_int = 1;
+pub const SHUT_RDWR: ::c_int = 2;
+
+pub const LOCK_SH: ::c_int = 1;
+pub const LOCK_EX: ::c_int = 2;
+pub const LOCK_NB: ::c_int = 4;
+pub const LOCK_UN: ::c_int = 8;
+
+pub const O_NONBLOCK : ::c_int = 4;
+
+pub const IPPROTO_RAW : ::c_int = 255;
+
+pub const _SC_ARG_MAX : ::c_int = 1;
+pub const _SC_CHILD_MAX : ::c_int = 2;
+pub const _SC_NGROUPS_MAX : ::c_int = 4;
+pub const _SC_OPEN_MAX : ::c_int = 5;
+pub const _SC_JOB_CONTROL : ::c_int = 6;
+pub const _SC_SAVED_IDS : ::c_int = 7;
+pub const _SC_VERSION : ::c_int = 8;
+pub const _SC_BC_BASE_MAX : ::c_int = 9;
+pub const _SC_BC_DIM_MAX : ::c_int = 10;
+pub const _SC_BC_SCALE_MAX : ::c_int = 11;
+pub const _SC_BC_STRING_MAX : ::c_int = 12;
+pub const _SC_COLL_WEIGHTS_MAX : ::c_int = 13;
+pub const _SC_EXPR_NEST_MAX : ::c_int = 14;
+pub const _SC_LINE_MAX : ::c_int = 15;
+pub const _SC_RE_DUP_MAX : ::c_int = 16;
+pub const _SC_2_VERSION : ::c_int = 17;
+pub const _SC_2_C_BIND : ::c_int = 18;
+pub const _SC_2_C_DEV : ::c_int = 19;
+pub const _SC_2_CHAR_TERM : ::c_int = 20;
+pub const _SC_2_FORT_DEV : ::c_int = 21;
+pub const _SC_2_FORT_RUN : ::c_int = 22;
+pub const _SC_2_LOCALEDEF : ::c_int = 23;
+pub const _SC_2_SW_DEV : ::c_int = 24;
+pub const _SC_2_UPE : ::c_int = 25;
+pub const _SC_STREAM_MAX : ::c_int = 26;
+pub const _SC_TZNAME_MAX : ::c_int = 27;
+pub const _SC_PAGESIZE : ::c_int = 28;
+pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
+pub const _SC_FSYNC : ::c_int = 29;
+
+pub const Q_GETQUOTA: ::c_int = 0x300;
+pub const Q_SETQUOTA: ::c_int = 0x400;
+
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+
+pub const LOG_NFACILITIES: ::c_int = 24;
+
+pub const HW_NCPU: ::c_int = 3;
+
+pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
+
+f! {
+    pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
+        status >> 8
+    }
+
+    pub fn WIFSIGNALED(status: ::c_int) -> bool {
+        (status & 0o177) != 0o177 && (status & 0o177) != 0
+    }
+
+    pub fn WIFSTOPPED(status: ::c_int) -> bool {
+        (status & 0o177) == 0o177
+    }
+}
+
+#[link(name = "util")]
+extern {
+    pub fn mincore(addr: *mut ::c_void, len: ::size_t,
+                   vec: *mut ::c_char) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__clock_getres50")]
+    pub fn clock_getres(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__clock_gettime50")]
+    pub fn clock_gettime(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn __errno() -> *mut ::c_int;
+    pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t)
+                    -> ::c_int;
+    pub fn memrchr(cx: *const ::c_void,
+                   c: ::c_int,
+                   n: ::size_t) -> *mut ::c_void;
+    pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
+    pub fn mkostemps(template: *mut ::c_char,
+                     suffixlen: ::c_int,
+                     flags: ::c_int) -> ::c_int;
+    pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+    pub fn fdatasync(fd: ::c_int) -> ::c_int;
+    pub fn openpty(amaster: *mut ::c_int,
+                   aslave: *mut ::c_int,
+                   name: *mut ::c_char,
+                   termp: *mut termios,
+                   winp: *mut ::winsize) -> ::c_int;
+    pub fn forkpty(amaster: *mut ::c_int,
+                   name: *mut ::c_char,
+                   termp: *mut termios,
+                   winp: *mut ::winsize) -> ::pid_t;
+    pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
+
+    pub fn openat(dirfd: ::c_int, pathname: *const ::c_char,
+                  flags: ::c_int, ...) -> ::c_int;
+    pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char,
+                     mode: ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn fchmodat(dirfd: ::c_int, pathname: *const ::c_char,
+                    mode: ::mode_t, flags: ::c_int) -> ::c_int;
+    pub fn fchownat(dirfd: ::c_int, pathname: *const ::c_char,
+                    owner: ::uid_t, group: ::gid_t,
+                    flags: ::c_int) -> ::c_int;
+    pub fn fstatat(dirfd: ::c_int, pathname: *const ::c_char,
+                   buf: *mut stat, flags: ::c_int) -> ::c_int;
+    pub fn linkat(olddirfd: ::c_int, oldpath: *const ::c_char,
+                  newdirfd: ::c_int, newpath: *const ::c_char,
+                  flags: ::c_int) -> ::c_int;
+   pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char,
+                  mode: ::mode_t) -> ::c_int;
+   pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char,
+                 mode: ::mode_t, dev: dev_t) -> ::c_int;
+   pub fn readlinkat(dirfd: ::c_int, pathname: *const ::c_char,
+                     buf: *mut ::c_char, bufsiz: ::size_t) -> ::ssize_t;
+   pub fn renameat(olddirfd: ::c_int, oldpath: *const ::c_char,
+                   newdirfd: ::c_int, newpath: *const ::c_char)
+                   -> ::c_int;
+   pub fn symlinkat(target: *const ::c_char, newdirfd: ::c_int,
+                    linkpath: *const ::c_char) -> ::c_int;
+   pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char,
+                   flags: ::c_int) -> ::c_int;
+   pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
+                   mode: ::mode_t) -> ::c_int;
+   pub fn sem_timedwait(sem: *mut sem_t,
+                        abstime: *const ::timespec) -> ::c_int;
+   pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t,
+                                    clock_id: clockid_t) -> ::c_int;
+    pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+    pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t,
+                                   abstime: *const ::timespec) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(target_os = "netbsd")] {
+        mod netbsd;
+        pub use self::netbsd::*;
+    } else if #[cfg(any(target_os = "openbsd", target_os = "bitrig"))] {
+        mod openbsdlike;
+        pub use self::openbsdlike::*;
+    } else {
+        // Unknown target_os
+    }
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -0,0 +1,664 @@
+pub type clock_t = ::c_uint;
+pub type suseconds_t = ::c_int;
+pub type dev_t = u64;
+pub type blksize_t = ::int32_t;
+pub type fsblkcnt_t = ::uint64_t;
+pub type fsfilcnt_t = ::uint64_t;
+
+s! {
+    pub struct aiocb {
+        pub aio_offset: ::off_t,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        pub aio_fildes: ::c_int,
+        pub aio_lio_opcode: ::c_int,
+        pub aio_reqprio: ::c_int,
+        pub aio_sigevent: ::sigevent,
+        _state: ::c_int,
+        _errno: ::c_int,
+        _retval: ::ssize_t
+    }
+
+    pub struct dirent {
+        pub d_fileno: ::ino_t,
+        pub d_reclen: u16,
+        pub d_namlen: u16,
+        pub d_type: u8,
+        pub d_name: [::c_char; 512],
+    }
+
+    pub struct glob_t {
+        pub gl_pathc:   ::size_t,
+        pub gl_matchc:  ::size_t,
+        pub gl_offs:    ::size_t,
+        pub gl_flags:   ::c_int,
+        pub gl_pathv:   *mut *mut ::c_char,
+
+        __unused3: *mut ::c_void,
+
+        __unused4: *mut ::c_void,
+        __unused5: *mut ::c_void,
+        __unused6: *mut ::c_void,
+        __unused7: *mut ::c_void,
+        __unused8: *mut ::c_void,
+    }
+
+    pub struct sigevent {
+        pub sigev_notify: ::c_int,
+        pub sigev_signo: ::c_int,
+        pub sigev_value: ::sigval,
+        __unused1: *mut ::c_void,       //actually a function pointer
+        pub sigev_notify_attributes: *mut ::c_void
+    }
+
+    pub struct sigset_t {
+        __bits: [u32; 4],
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_mode: ::mode_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_atime: ::time_t,
+        pub st_atimensec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtimensec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctimensec: ::c_long,
+        pub st_birthtime: ::time_t,
+        pub st_birthtimensec: ::c_long,
+        pub st_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: ::blksize_t,
+        pub st_flags: ::uint32_t,
+        pub st_gen: ::uint32_t,
+        pub st_spare: [::uint32_t; 2],
+    }
+
+    pub struct statvfs {
+        pub f_flag: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_iosize: ::c_ulong,
+
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_bresvd: ::fsblkcnt_t,
+
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fresvd: ::fsfilcnt_t,
+
+        pub f_syncreads: ::uint64_t,
+        pub f_syncwrites: ::uint64_t,
+
+        pub f_asyncreads: ::uint64_t,
+        pub f_asyncwrites: ::uint64_t,
+
+        pub f_fsidx: ::fsid_t,
+        pub f_fsid: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        pub f_owner: ::uid_t,
+
+        pub f_spare: [::uint32_t; 4],
+
+        pub f_fstypename: [::c_char; 32],
+        pub f_mntonname: [::c_char; 1024],
+        pub f_mntfromname: [::c_char; 1024],
+    }
+
+    pub struct addrinfo {
+        pub ai_flags: ::c_int,
+        pub ai_family: ::c_int,
+        pub ai_socktype: ::c_int,
+        pub ai_protocol: ::c_int,
+        pub ai_addrlen: ::socklen_t,
+        pub ai_canonname: *mut ::c_char,
+        pub ai_addr: *mut ::sockaddr,
+        pub ai_next: *mut ::addrinfo,
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_len: u8,
+        pub ss_family: ::sa_family_t,
+        __ss_pad1: [u8; 6],
+        __ss_pad2: i64,
+        __ss_pad3: [u8; 112],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_code: ::c_int,
+        pub si_errno: ::c_int,
+        __pad1: ::c_int,
+        pub si_addr: *mut ::c_void,
+        __pad2: [u64; 13],
+    }
+
+    pub struct pthread_attr_t {
+        pta_magic: ::c_uint,
+        pta_flags: ::c_int,
+        pta_private: *mut ::c_void,
+    }
+
+    pub struct pthread_mutex_t {
+        ptm_magic: ::c_uint,
+        ptm_errorcheck: ::c_uchar,
+        ptm_pad1: [u8; 3],
+        ptm_interlock: ::c_uchar,
+        ptm_pad2: [u8; 3],
+        ptm_owner: ::pthread_t,
+        ptm_waiters: *mut u8,
+        ptm_recursed: ::c_uint,
+        ptm_spare2: *mut ::c_void,
+    }
+
+    pub struct pthread_mutexattr_t {
+        ptma_magic: ::c_uint,
+        ptma_private: *mut ::c_void,
+    }
+
+    pub struct pthread_cond_t {
+        ptc_magic: ::c_uint,
+        ptc_lock: ::c_uchar,
+        ptc_waiters_first: *mut u8,
+        ptc_waiters_last: *mut u8,
+        ptc_mutex: *mut ::pthread_mutex_t,
+        ptc_private: *mut ::c_void,
+    }
+
+    pub struct pthread_condattr_t {
+        ptca_magic: ::c_uint,
+        ptca_private: *mut ::c_void,
+    }
+
+    pub struct pthread_rwlock_t {
+        ptr_magic: ::c_uint,
+        ptr_interlock: ::c_uchar,
+        ptr_rblocked_first: *mut u8,
+        ptr_rblocked_last: *mut u8,
+        ptr_wblocked_first: *mut u8,
+        ptr_wblocked_last: *mut u8,
+        ptr_nreaders: ::c_uint,
+        ptr_owner: ::pthread_t,
+        ptr_private: *mut ::c_void,
+    }
+
+    pub struct kevent {
+        pub ident: ::uintptr_t,
+        pub filter: ::uint32_t,
+        pub flags: ::uint32_t,
+        pub fflags: ::uint32_t,
+        pub data: ::int64_t,
+        pub udata: ::intptr_t,
+    }
+
+    pub struct dqblk {
+        pub dqb_bhardlimit: ::uint32_t,
+        pub dqb_bsoftlimit: ::uint32_t,
+        pub dqb_curblocks: ::uint32_t,
+        pub dqb_ihardlimit: ::uint32_t,
+        pub dqb_isoftlimit: ::uint32_t,
+        pub dqb_curinodes: ::uint32_t,
+        pub dqb_btime: ::int32_t,
+        pub dqb_itime: ::int32_t,
+    }
+
+    pub struct Dl_info {
+        pub dli_fname: *const ::c_char,
+        pub dli_fbase: *mut ::c_void,
+        pub dli_sname: *const ::c_char,
+        pub dli_saddr: *const ::c_void,
+    }
+
+    pub struct lconv {
+        pub decimal_point: *mut ::c_char,
+        pub thousands_sep: *mut ::c_char,
+        pub grouping: *mut ::c_char,
+        pub int_curr_symbol: *mut ::c_char,
+        pub currency_symbol: *mut ::c_char,
+        pub mon_decimal_point: *mut ::c_char,
+        pub mon_thousands_sep: *mut ::c_char,
+        pub mon_grouping: *mut ::c_char,
+        pub positive_sign: *mut ::c_char,
+        pub negative_sign: *mut ::c_char,
+        pub int_frac_digits: ::c_char,
+        pub frac_digits: ::c_char,
+        pub p_cs_precedes: ::c_char,
+        pub p_sep_by_space: ::c_char,
+        pub n_cs_precedes: ::c_char,
+        pub n_sep_by_space: ::c_char,
+        pub p_sign_posn: ::c_char,
+        pub n_sign_posn: ::c_char,
+        pub int_p_cs_precedes: ::c_char,
+        pub int_n_cs_precedes: ::c_char,
+        pub int_p_sep_by_space: ::c_char,
+        pub int_n_sep_by_space: ::c_char,
+        pub int_p_sign_posn: ::c_char,
+        pub int_n_sign_posn: ::c_char,
+    }
+}
+
+pub const LC_COLLATE_MASK: ::c_int = (1 << ::LC_COLLATE);
+pub const LC_CTYPE_MASK: ::c_int = (1 << ::LC_CTYPE);
+pub const LC_MONETARY_MASK: ::c_int = (1 << ::LC_MONETARY);
+pub const LC_NUMERIC_MASK: ::c_int = (1 << ::LC_NUMERIC);
+pub const LC_TIME_MASK: ::c_int = (1 << ::LC_TIME);
+pub const LC_MESSAGES_MASK: ::c_int = (1 << ::LC_MESSAGES);
+pub const LC_ALL_MASK: ::c_int = !0;
+
+pub const ERA: ::nl_item = 52;
+pub const ERA_D_FMT: ::nl_item = 53;
+pub const ERA_D_T_FMT: ::nl_item = 54;
+pub const ERA_T_FMT: ::nl_item = 55;
+pub const ALT_DIGITS: ::nl_item = 56;
+
+pub const O_CLOEXEC: ::c_int = 0x400000;
+pub const O_ALT_IO: ::c_int = 0x40000;
+pub const O_NOSIGPIPE: ::c_int = 0x1000000;
+pub const O_SEARCH: ::c_int = 0x800000;
+pub const O_EXLOCK: ::c_int = 0x20;
+pub const O_SHLOCK: ::c_int = 0x10;
+pub const O_DIRECTORY: ::c_int = 0x200000;
+
+pub const MS_SYNC : ::c_int = 0x4;
+pub const MS_INVALIDATE : ::c_int = 0x2;
+
+pub const RLIM_NLIMITS: ::c_int = 12;
+
+pub const ENOATTR : ::c_int = 93;
+pub const EILSEQ : ::c_int = 85;
+pub const EOVERFLOW : ::c_int = 84;
+pub const ECANCELED : ::c_int = 87;
+pub const EIDRM : ::c_int = 82;
+pub const ENOMSG : ::c_int = 83;
+pub const ENOTSUP : ::c_int = 86;
+pub const ELAST : ::c_int = 96;
+
+pub const F_DUPFD_CLOEXEC : ::c_int = 12;
+pub const F_CLOSEM: ::c_int = 10;
+pub const F_GETNOSIGPIPE: ::c_int = 13;
+pub const F_SETNOSIGPIPE: ::c_int = 14;
+pub const F_MAXFD: ::c_int = 11;
+
+pub const IPV6_JOIN_GROUP: ::c_int = 12;
+pub const IPV6_LEAVE_GROUP: ::c_int = 13;
+
+pub const SO_SNDTIMEO: ::c_int = 0x100b;
+pub const SO_RCVTIMEO: ::c_int = 0x100c;
+
+pub const O_DSYNC : ::c_int = 0x10000;
+
+pub const MAP_RENAME : ::c_int = 0x20;
+pub const MAP_NORESERVE : ::c_int = 0x40;
+pub const MAP_HASSEMAPHORE : ::c_int = 0x200;
+pub const MAP_WIRED: ::c_int = 0x800;
+
+pub const _SC_IOV_MAX : ::c_int = 32;
+pub const _SC_GETGR_R_SIZE_MAX : ::c_int = 47;
+pub const _SC_GETPW_R_SIZE_MAX : ::c_int = 48;
+pub const _SC_LOGIN_NAME_MAX : ::c_int = 37;
+pub const _SC_MQ_PRIO_MAX : ::c_int = 55;
+pub const _SC_NPROCESSORS_ONLN : ::c_int = 1002;
+pub const _SC_THREADS : ::c_int = 41;
+pub const _SC_THREAD_ATTR_STACKADDR : ::c_int = 61;
+pub const _SC_THREAD_ATTR_STACKSIZE : ::c_int = 62;
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : ::c_int = 57;
+pub const _SC_THREAD_KEYS_MAX : ::c_int = 58;
+pub const _SC_THREAD_PRIO_INHERIT : ::c_int = 64;
+pub const _SC_THREAD_PRIO_PROTECT : ::c_int = 65;
+pub const _SC_THREAD_PRIORITY_SCHEDULING : ::c_int = 63;
+pub const _SC_THREAD_PROCESS_SHARED : ::c_int = 66;
+pub const _SC_THREAD_SAFE_FUNCTIONS : ::c_int = 67;
+pub const _SC_THREAD_STACK_MIN : ::c_int = 59;
+pub const _SC_THREAD_THREADS_MAX : ::c_int = 60;
+pub const _SC_TTY_NAME_MAX : ::c_int = 68;
+pub const _SC_ATEXIT_MAX : ::c_int = 40;
+pub const _SC_CLK_TCK : ::c_int = 39;
+pub const _SC_AIO_LISTIO_MAX : ::c_int = 51;
+pub const _SC_AIO_MAX : ::c_int = 52;
+pub const _SC_ASYNCHRONOUS_IO : ::c_int = 50;
+pub const _SC_MAPPED_FILES : ::c_int = 33;
+pub const _SC_MEMLOCK : ::c_int = 34;
+pub const _SC_MEMLOCK_RANGE : ::c_int = 35;
+pub const _SC_MEMORY_PROTECTION : ::c_int = 36;
+pub const _SC_MESSAGE_PASSING : ::c_int = 53;
+pub const _SC_MQ_OPEN_MAX : ::c_int = 54;
+pub const _SC_PRIORITY_SCHEDULING : ::c_int = 56;
+pub const _SC_SEMAPHORES : ::c_int = 42;
+pub const _SC_SHARED_MEMORY_OBJECTS : ::c_int = 87;
+pub const _SC_SYNCHRONIZED_IO : ::c_int = 31;
+pub const _SC_TIMERS : ::c_int = 44;
+pub const _SC_HOST_NAME_MAX : ::c_int = 69;
+
+pub const FD_SETSIZE: usize = 0x100;
+
+pub const ST_NOSUID: ::c_ulong = 8;
+
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+    ptm_magic: 0x33330003,
+    ptm_errorcheck: 0,
+    ptm_interlock: 0,
+    ptm_waiters: 0 as *mut _,
+    ptm_owner: 0,
+    ptm_pad1: [0; 3],
+    ptm_pad2: [0; 3],
+    ptm_recursed: 0,
+    ptm_spare2: 0 as *mut _,
+};
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+    ptc_magic: 0x55550005,
+    ptc_lock: 0,
+    ptc_waiters_first: 0 as *mut _,
+    ptc_waiters_last: 0 as *mut _,
+    ptc_mutex: 0 as *mut _,
+    ptc_private: 0 as *mut _,
+};
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+    ptr_magic: 0x99990009,
+    ptr_interlock: 0,
+    ptr_rblocked_first: 0 as *mut _,
+    ptr_rblocked_last: 0 as *mut _,
+    ptr_wblocked_first: 0 as *mut _,
+    ptr_wblocked_last: 0 as *mut _,
+    ptr_nreaders: 0,
+    ptr_owner: 0,
+    ptr_private: 0 as *mut _,
+};
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
+
+pub const EVFILT_AIO: ::int32_t = 2;
+pub const EVFILT_PROC: ::int32_t = 4;
+pub const EVFILT_READ: ::int32_t = 0;
+pub const EVFILT_SIGNAL: ::int32_t = 5;
+pub const EVFILT_TIMER: ::int32_t = 6;
+pub const EVFILT_VNODE: ::int32_t = 3;
+pub const EVFILT_WRITE: ::int32_t = 1;
+
+pub const EV_ADD: ::uint32_t = 0x1;
+pub const EV_DELETE: ::uint32_t = 0x2;
+pub const EV_ENABLE: ::uint32_t = 0x4;
+pub const EV_DISABLE: ::uint32_t = 0x8;
+pub const EV_ONESHOT: ::uint32_t = 0x10;
+pub const EV_CLEAR: ::uint32_t = 0x20;
+pub const EV_RECEIPT: ::uint32_t = 0x40;
+pub const EV_DISPATCH: ::uint32_t = 0x80;
+pub const EV_FLAG1: ::uint32_t = 0x2000;
+pub const EV_ERROR: ::uint32_t = 0x4000;
+pub const EV_EOF: ::uint32_t = 0x8000;
+pub const EV_SYSFLAGS: ::uint32_t = 0xf000;
+
+pub const NOTE_LOWAT: ::uint32_t = 0x00000001;
+pub const NOTE_DELETE: ::uint32_t = 0x00000001;
+pub const NOTE_WRITE: ::uint32_t = 0x00000002;
+pub const NOTE_EXTEND: ::uint32_t = 0x00000004;
+pub const NOTE_ATTRIB: ::uint32_t = 0x00000008;
+pub const NOTE_LINK: ::uint32_t = 0x00000010;
+pub const NOTE_RENAME: ::uint32_t = 0x00000020;
+pub const NOTE_REVOKE: ::uint32_t = 0x00000040;
+pub const NOTE_EXIT: ::uint32_t = 0x80000000;
+pub const NOTE_FORK: ::uint32_t = 0x40000000;
+pub const NOTE_EXEC: ::uint32_t = 0x20000000;
+pub const NOTE_PDATAMASK: ::uint32_t = 0x000fffff;
+pub const NOTE_PCTRLMASK: ::uint32_t = 0xf0000000;
+pub const NOTE_TRACK: ::uint32_t = 0x00000001;
+pub const NOTE_TRACKERR: ::uint32_t = 0x00000002;
+pub const NOTE_CHILD: ::uint32_t = 0x00000004;
+
+pub const CRTSCTS: ::tcflag_t = 0x00010000;
+
+pub const TMP_MAX : ::c_uint = 308915776;
+
+pub const NI_MAXHOST: ::socklen_t = 1025;
+
+pub const RTLD_NOLOAD: ::c_int = 0x2000;
+pub const RTLD_LOCAL: ::c_int = 0x200;
+
+pub const CTL_MAXNAME: ::c_int = 12;
+pub const SYSCTL_NAMELEN: ::c_int = 32;
+pub const SYSCTL_DEFSIZE: ::c_int = 8;
+pub const CTLTYPE_NODE: ::c_int = 1;
+pub const CTLTYPE_INT: ::c_int = 2;
+pub const CTLTYPE_STRING: ::c_int = 3;
+pub const CTLTYPE_QUAD: ::c_int = 4;
+pub const CTLTYPE_STRUCT: ::c_int = 5;
+pub const CTLTYPE_BOOL: ::c_int = 6;
+pub const CTLFLAG_READONLY: ::c_int = 0x00000000;
+pub const CTLFLAG_READWRITE: ::c_int = 0x00000070;
+pub const CTLFLAG_ANYWRITE: ::c_int = 0x00000080;
+pub const CTLFLAG_PRIVATE: ::c_int = 0x00000100;
+pub const CTLFLAG_PERMANENT: ::c_int = 0x00000200;
+pub const CTLFLAG_OWNDATA: ::c_int = 0x00000400;
+pub const CTLFLAG_IMMEDIATE: ::c_int = 0x00000800;
+pub const CTLFLAG_HEX: ::c_int = 0x00001000;
+pub const CTLFLAG_ROOT: ::c_int = 0x00002000;
+pub const CTLFLAG_ANYNUMBER: ::c_int = 0x00004000;
+pub const CTLFLAG_HIDDEN: ::c_int = 0x00008000;
+pub const CTLFLAG_ALIAS: ::c_int = 0x00010000;
+pub const CTLFLAG_MMAP: ::c_int = 0x00020000;
+pub const CTLFLAG_OWNDESC: ::c_int = 0x00040000;
+pub const CTLFLAG_UNSIGNED: ::c_int = 0x00080000;
+pub const SYSCTL_VERS_MASK: ::c_int = 0xff000000;
+pub const SYSCTL_VERS_0: ::c_int = 0x00000000;
+pub const SYSCTL_VERS_1: ::c_int = 0x01000000;
+pub const SYSCTL_VERSION: ::c_int = SYSCTL_VERS_1;
+pub const CTL_EOL: ::c_int = -1;
+pub const CTL_QUERY: ::c_int = -2;
+pub const CTL_CREATE: ::c_int = -3;
+pub const CTL_CREATESYM: ::c_int = -4;
+pub const CTL_DESTROY: ::c_int = -5;
+pub const CTL_MMAP: ::c_int = -6;
+pub const CTL_DESCRIBE: ::c_int = -7;
+pub const CTL_UNSPEC: ::c_int = 0;
+pub const CTL_KERN: ::c_int = 1;
+pub const CTL_VM: ::c_int = 2;
+pub const CTL_VFS: ::c_int = 3;
+pub const CTL_NET: ::c_int = 4;
+pub const CTL_DEBUG: ::c_int = 5;
+pub const CTL_HW: ::c_int = 6;
+pub const CTL_MACHDEP: ::c_int = 7;
+pub const CTL_USER: ::c_int = 8;
+pub const CTL_DDB: ::c_int = 9;
+pub const CTL_PROC: ::c_int = 10;
+pub const CTL_VENDOR: ::c_int = 11;
+pub const CTL_EMUL: ::c_int = 12;
+pub const CTL_SECURITY: ::c_int = 13;
+pub const CTL_MAXID: ::c_int = 14;
+pub const KERN_OSTYPE: ::c_int = 1;
+pub const KERN_OSRELEASE: ::c_int = 2;
+pub const KERN_OSREV: ::c_int = 3;
+pub const KERN_VERSION: ::c_int = 4;
+pub const KERN_MAXVNODES: ::c_int = 5;
+pub const KERN_MAXPROC: ::c_int = 6;
+pub const KERN_MAXFILES: ::c_int = 7;
+pub const KERN_ARGMAX: ::c_int = 8;
+pub const KERN_SECURELVL: ::c_int = 9;
+pub const KERN_HOSTNAME: ::c_int = 10;
+pub const KERN_HOSTID: ::c_int = 11;
+pub const KERN_CLOCKRATE: ::c_int = 12;
+pub const KERN_VNODE: ::c_int = 13;
+pub const KERN_PROC: ::c_int = 14;
+pub const KERN_FILE: ::c_int = 15;
+pub const KERN_PROF: ::c_int = 16;
+pub const KERN_POSIX1: ::c_int = 17;
+pub const KERN_NGROUPS: ::c_int = 18;
+pub const KERN_JOB_CONTROL: ::c_int = 19;
+pub const KERN_SAVED_IDS: ::c_int = 20;
+pub const KERN_OBOOTTIME: ::c_int = 21;
+pub const KERN_DOMAINNAME: ::c_int = 22;
+pub const KERN_MAXPARTITIONS: ::c_int = 23;
+pub const KERN_RAWPARTITION: ::c_int = 24;
+pub const KERN_NTPTIME: ::c_int = 25;
+pub const KERN_TIMEX: ::c_int = 26;
+pub const KERN_AUTONICETIME: ::c_int = 27;
+pub const KERN_AUTONICEVAL: ::c_int = 28;
+pub const KERN_RTC_OFFSET: ::c_int = 29;
+pub const KERN_ROOT_DEVICE: ::c_int = 30;
+pub const KERN_MSGBUFSIZE: ::c_int = 31;
+pub const KERN_FSYNC: ::c_int = 32;
+pub const KERN_OLDSYSVMSG: ::c_int = 33;
+pub const KERN_OLDSYSVSEM: ::c_int = 34;
+pub const KERN_OLDSYSVSHM: ::c_int = 35;
+pub const KERN_OLDSHORTCORENAME: ::c_int = 36;
+pub const KERN_SYNCHRONIZED_IO: ::c_int = 37;
+pub const KERN_IOV_MAX: ::c_int = 38;
+pub const KERN_MBUF: ::c_int = 39;
+pub const KERN_MAPPED_FILES: ::c_int = 40;
+pub const KERN_MEMLOCK: ::c_int = 41;
+pub const KERN_MEMLOCK_RANGE: ::c_int = 42;
+pub const KERN_MEMORY_PROTECTION: ::c_int = 43;
+pub const KERN_LOGIN_NAME_MAX: ::c_int = 44;
+pub const KERN_DEFCORENAME: ::c_int = 45;
+pub const KERN_LOGSIGEXIT: ::c_int = 46;
+pub const KERN_PROC2: ::c_int = 47;
+pub const KERN_PROC_ARGS: ::c_int = 48;
+pub const KERN_FSCALE: ::c_int = 49;
+pub const KERN_CCPU: ::c_int = 50;
+pub const KERN_CP_TIME: ::c_int = 51;
+pub const KERN_OLDSYSVIPC_INFO: ::c_int = 52;
+pub const KERN_MSGBUF: ::c_int = 53;
+pub const KERN_CONSDEV: ::c_int = 54;
+pub const KERN_MAXPTYS: ::c_int = 55;
+pub const KERN_PIPE: ::c_int = 56;
+pub const KERN_MAXPHYS: ::c_int = 57;
+pub const KERN_SBMAX: ::c_int = 58;
+pub const KERN_TKSTAT: ::c_int = 59;
+pub const KERN_MONOTONIC_CLOCK: ::c_int = 60;
+pub const KERN_URND: ::c_int = 61;
+pub const KERN_LABELSECTOR: ::c_int = 62;
+pub const KERN_LABELOFFSET: ::c_int = 63;
+pub const KERN_LWP: ::c_int = 64;
+pub const KERN_FORKFSLEEP: ::c_int = 65;
+pub const KERN_POSIX_THREADS: ::c_int = 66;
+pub const KERN_POSIX_SEMAPHORES: ::c_int = 67;
+pub const KERN_POSIX_BARRIERS: ::c_int = 68;
+pub const KERN_POSIX_TIMERS: ::c_int = 69;
+pub const KERN_POSIX_SPIN_LOCKS: ::c_int = 70;
+pub const KERN_POSIX_READER_WRITER_LOCKS: ::c_int = 71;
+pub const KERN_DUMP_ON_PANIC: ::c_int = 72;
+pub const KERN_SOMAXKVA: ::c_int = 73;
+pub const KERN_ROOT_PARTITION: ::c_int = 74;
+pub const KERN_DRIVERS: ::c_int = 75;
+pub const KERN_BUF: ::c_int = 76;
+pub const KERN_FILE2: ::c_int = 77;
+pub const KERN_VERIEXEC: ::c_int = 78;
+pub const KERN_CP_ID: ::c_int = 79;
+pub const KERN_HARDCLOCK_TICKS: ::c_int = 80;
+pub const KERN_ARND: ::c_int = 81;
+pub const KERN_SYSVIPC: ::c_int = 82;
+pub const KERN_BOOTTIME: ::c_int = 83;
+pub const KERN_EVCNT: ::c_int = 84;
+pub const KERN_MAXID: ::c_int = 85;
+pub const KERN_PROC_ALL: ::c_int = 0;
+pub const KERN_PROC_PID: ::c_int = 1;
+pub const KERN_PROC_PGRP: ::c_int = 2;
+pub const KERN_PROC_SESSION: ::c_int = 3;
+pub const KERN_PROC_TTY: ::c_int = 4;
+pub const KERN_PROC_UID: ::c_int = 5;
+pub const KERN_PROC_RUID: ::c_int = 6;
+pub const KERN_PROC_GID: ::c_int = 7;
+pub const KERN_PROC_RGID: ::c_int = 8;
+
+pub const EAI_SYSTEM: ::c_int = 11;
+
+pub const AIO_CANCELED: ::c_int = 1;
+pub const AIO_NOTCANCELED: ::c_int = 2;
+pub const AIO_ALLDONE: ::c_int = 3;
+pub const LIO_NOP: ::c_int = 0;
+pub const LIO_WRITE: ::c_int = 1;
+pub const LIO_READ: ::c_int = 2;
+pub const LIO_WAIT: ::c_int = 1;
+pub const LIO_NOWAIT: ::c_int = 0;
+
+pub const SIGEV_NONE: ::c_int = 0;
+pub const SIGEV_SIGNAL: ::c_int = 1;
+pub const SIGEV_THREAD: ::c_int = 2;
+
+extern {
+    pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
+    pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
+    #[link_name = "__aio_suspend50"]
+    pub fn aio_suspend(aiocb_list: *const *const aiocb, nitems: ::c_int,
+                       timeout: *const ::timespec) -> ::c_int;
+    pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+    pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb,
+                      nitems: ::c_int, sevp: *mut sigevent) -> ::c_int;
+
+    pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
+    pub fn getnameinfo(sa: *const ::sockaddr,
+                       salen: ::socklen_t,
+                       host: *mut ::c_char,
+                       hostlen: ::socklen_t,
+                       serv: *mut ::c_char,
+                       sevlen: ::socklen_t,
+                       flags: ::c_int) -> ::c_int;
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
+                    -> ::c_int;
+    pub fn sysctl(name: *const ::c_int,
+                  namelen: ::c_uint,
+                  oldp: *mut ::c_void,
+                  oldlenp: *mut ::size_t,
+                  newp: *const ::c_void,
+                  newlen: ::size_t)
+                  -> ::c_int;
+    pub fn sysctlbyname(name: *const ::c_char,
+                        oldp: *mut ::c_void,
+                        oldlenp: *mut ::size_t,
+                        newp: *const ::c_void,
+                        newlen: ::size_t)
+                        -> ::c_int;
+    #[link_name = "__kevent50"]
+    pub fn kevent(kq: ::c_int,
+                  changelist: *const ::kevent,
+                  nchanges: ::size_t,
+                  eventlist: *mut ::kevent,
+                  nevents: ::size_t,
+                  timeout: *const ::timespec) -> ::c_int;
+    #[link_name = "__mount50"]
+    pub fn mount(src: *const ::c_char,
+                 target: *const ::c_char,
+                 flags: ::c_int,
+                 data: *mut ::c_void,
+                 size: ::size_t) -> ::c_int;
+    pub fn ptrace(requeset: ::c_int,
+                  pid: ::pid_t,
+                  addr: *mut ::c_void,
+                  data: ::c_int) -> ::c_int;
+    pub fn pthread_setname_np(t: ::pthread_t,
+                              name: *const ::c_char,
+                              arg: *mut ::c_void) -> ::c_int;
+    pub fn pthread_getattr_np(native: ::pthread_t,
+                              attr: *mut ::pthread_attr_t) -> ::c_int;
+    pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t,
+                                     guardsize: *mut ::size_t) -> ::c_int;
+    pub fn pthread_attr_getstack(attr: *const ::pthread_attr_t,
+                                 stackaddr: *mut *mut ::c_void,
+                                 stacksize: *mut ::size_t) -> ::c_int;
+    #[link_name = "__sigtimedwait50"]
+    pub fn sigtimedwait(set: *const sigset_t,
+                        info: *mut siginfo_t,
+                        timeout: *const ::timespec) -> ::c_int;
+    pub fn sigwaitinfo(set: *const sigset_t,
+                       info: *mut siginfo_t) -> ::c_int;
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn localeconv_l(loc: ::locale_t) -> *mut lconv;
+    pub fn newlocale(mask: ::c_int,
+                     locale: *const ::c_char,
+                     base: ::locale_t) -> ::locale_t;
+}
+
+mod other;
+pub use self::other::*;
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/src/unix/bsd/netbsdlike/netbsd/other/b32/mod.rs
@@ -0,0 +1,2 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/src/unix/bsd/netbsdlike/netbsd/other/b64/mod.rs
@@ -0,0 +1,2 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/src/unix/bsd/netbsdlike/netbsd/other/mod.rs
@@ -0,0 +1,13 @@
+cfg_if! {
+    if #[cfg(target_arch = "x86_64")] {
+        mod b64;
+        pub use self::b64::*;
+    } else if #[cfg(any(target_arch = "arm",
+                        target_arch = "powerpc",
+                        target_arch = "x86"))] {
+        mod b32;
+        pub use self::b32::*;
+    } else {
+        // Unknown target_arch
+    }
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/bitrig.rs
@@ -0,0 +1,75 @@
+s! {
+    pub struct lconv {
+        pub decimal_point: *mut ::c_char,
+        pub thousands_sep: *mut ::c_char,
+        pub grouping: *mut ::c_char,
+        pub int_curr_symbol: *mut ::c_char,
+        pub currency_symbol: *mut ::c_char,
+        pub mon_decimal_point: *mut ::c_char,
+        pub mon_thousands_sep: *mut ::c_char,
+        pub mon_grouping: *mut ::c_char,
+        pub positive_sign: *mut ::c_char,
+        pub negative_sign: *mut ::c_char,
+        pub int_frac_digits: ::c_char,
+        pub frac_digits: ::c_char,
+        pub p_cs_precedes: ::c_char,
+        pub p_sep_by_space: ::c_char,
+        pub n_cs_precedes: ::c_char,
+        pub n_sep_by_space: ::c_char,
+        pub p_sign_posn: ::c_char,
+        pub n_sign_posn: ::c_char,
+        pub int_p_cs_precedes: ::c_char,
+        pub int_n_cs_precedes: ::c_char,
+        pub int_p_sep_by_space: ::c_char,
+        pub int_n_sep_by_space: ::c_char,
+        pub int_p_sign_posn: ::c_char,
+        pub int_n_sign_posn: ::c_char,
+    }
+}
+
+pub const LC_COLLATE_MASK: ::c_int = (1 << 0);
+pub const LC_CTYPE_MASK: ::c_int = (1 << 1);
+pub const LC_MESSAGES_MASK: ::c_int = (1 << 2);
+pub const LC_MONETARY_MASK: ::c_int = (1 << 3);
+pub const LC_NUMERIC_MASK: ::c_int = (1 << 4);
+pub const LC_TIME_MASK: ::c_int = (1 << 5);
+pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
+                               | LC_CTYPE_MASK
+                               | LC_MESSAGES_MASK
+                               | LC_MONETARY_MASK
+                               | LC_NUMERIC_MASK
+                               | LC_TIME_MASK;
+
+pub const ERA: ::nl_item = 52;
+pub const ERA_D_FMT: ::nl_item = 53;
+pub const ERA_D_T_FMT: ::nl_item = 54;
+pub const ERA_T_FMT: ::nl_item = 55;
+pub const ALT_DIGITS: ::nl_item = 56;
+
+pub const D_MD_ORDER: ::nl_item = 57;
+
+pub const ALTMON_1: ::nl_item = 58;
+pub const ALTMON_2: ::nl_item = 59;
+pub const ALTMON_3: ::nl_item = 60;
+pub const ALTMON_4: ::nl_item = 61;
+pub const ALTMON_5: ::nl_item = 62;
+pub const ALTMON_6: ::nl_item = 63;
+pub const ALTMON_7: ::nl_item = 64;
+pub const ALTMON_8: ::nl_item = 65;
+pub const ALTMON_9: ::nl_item = 66;
+pub const ALTMON_10: ::nl_item = 67;
+pub const ALTMON_11: ::nl_item = 68;
+pub const ALTMON_12: ::nl_item = 69;
+
+pub const KERN_RND: ::c_int = 31;
+
+extern {
+    pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
+    pub fn freelocale(loc: ::locale_t) -> ::c_int;
+    pub fn newlocale(mask: ::c_int,
+                     locale: *const ::c_char,
+                     base: ::locale_t) -> ::locale_t;
+    pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+    pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
@@ -0,0 +1,451 @@
+pub type clock_t = i64;
+pub type suseconds_t = i64;
+pub type dev_t = i32;
+pub type sigset_t = ::c_uint;
+pub type blksize_t = ::int32_t;
+pub type fsblkcnt_t = ::uint64_t;
+pub type fsfilcnt_t = ::uint64_t;
+pub type pthread_attr_t = *mut ::c_void;
+pub type pthread_mutex_t = *mut ::c_void;
+pub type pthread_mutexattr_t = *mut ::c_void;
+pub type pthread_cond_t = *mut ::c_void;
+pub type pthread_condattr_t = *mut ::c_void;
+pub type pthread_rwlock_t = *mut ::c_void;
+
+s! {
+    pub struct dirent {
+        pub d_fileno: ::ino_t,
+        pub d_off: ::off_t,
+        pub d_reclen: u16,
+        pub d_type: u8,
+        pub d_namlen: u8,
+        __d_padding: [u8; 4],
+        pub d_name: [::c_char; 256],
+    }
+
+    pub struct glob_t {
+        pub gl_pathc:   ::c_int,
+        pub gl_matchc:  ::c_int,
+        pub gl_offs:    ::c_int,
+        pub gl_flags:   ::c_int,
+        pub gl_pathv:   *mut *mut ::c_char,
+        __unused1: *mut ::c_void,
+        __unused2: *mut ::c_void,
+        __unused3: *mut ::c_void,
+        __unused4: *mut ::c_void,
+        __unused5: *mut ::c_void,
+        __unused6: *mut ::c_void,
+        __unused7: *mut ::c_void,
+    }
+
+    pub struct kevent {
+        pub ident: ::uintptr_t,
+        pub filter: ::c_short,
+        pub flags: ::c_ushort,
+        pub fflags: ::c_uint,
+        pub data: ::int64_t,
+        pub udata: *mut ::c_void,
+    }
+
+    pub struct stat {
+        pub st_mode: ::mode_t,
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: ::blksize_t,
+        pub st_flags: ::uint32_t,
+        pub st_gen: ::uint32_t,
+        pub st_birthtime: ::time_t,
+        pub st_birthtime_nsec: ::c_long,
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+    }
+
+    pub struct addrinfo {
+        pub ai_flags: ::c_int,
+        pub ai_family: ::c_int,
+        pub ai_socktype: ::c_int,
+        pub ai_protocol: ::c_int,
+        pub ai_addrlen: ::socklen_t,
+        pub ai_addr: *mut ::sockaddr,
+        pub ai_canonname: *mut ::c_char,
+        pub ai_next: *mut ::addrinfo,
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_len: u8,
+        pub ss_family: ::sa_family_t,
+        __ss_pad1: [u8; 6],
+        __ss_pad2: i64,
+        __ss_pad3: [u8; 240],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_code: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_addr: *mut ::c_char,
+        __pad: [u8; 108],
+    }
+
+    pub struct Dl_info {
+        pub dli_fname: *const ::c_char,
+        pub dli_fbase: *mut ::c_void,
+        pub dli_sname: *const ::c_char,
+        pub dli_saddr: *mut ::c_void,
+    }
+
+    pub struct lastlog {
+        ll_time: ::time_t,
+        ll_line: [::c_char; UT_LINESIZE],
+        ll_host: [::c_char; UT_HOSTSIZE],
+    }
+
+    pub struct utmp {
+        pub ut_line: [::c_char; UT_LINESIZE],
+        pub ut_name: [::c_char; UT_NAMESIZE],
+        pub ut_host: [::c_char; UT_HOSTSIZE],
+        pub ut_time: ::time_t,
+    }
+}
+
+pub const UT_NAMESIZE: usize = 32;
+pub const UT_LINESIZE: usize = 8;
+pub const UT_HOSTSIZE: usize = 256;
+
+pub const O_CLOEXEC: ::c_int = 0x10000;
+
+pub const MS_SYNC : ::c_int = 0x0002;
+pub const MS_INVALIDATE : ::c_int = 0x0004;
+
+pub const PTHREAD_STACK_MIN : ::size_t = 2048;
+
+pub const ENOATTR : ::c_int = 83;
+pub const EILSEQ : ::c_int = 84;
+pub const EOVERFLOW : ::c_int = 87;
+pub const ECANCELED : ::c_int = 88;
+pub const EIDRM : ::c_int = 89;
+pub const ENOMSG : ::c_int = 90;
+pub const ENOTSUP : ::c_int = 91;
+pub const ELAST : ::c_int = 91;
+
+pub const F_DUPFD_CLOEXEC : ::c_int = 10;
+
+pub const RLIM_NLIMITS: ::c_int = 9;
+
+pub const SO_SNDTIMEO: ::c_int = 0x1005;
+pub const SO_RCVTIMEO: ::c_int = 0x1006;
+
+pub const IPV6_JOIN_GROUP: ::c_int = 12;
+pub const IPV6_LEAVE_GROUP: ::c_int = 13;
+
+pub const O_DSYNC : ::c_int = 128;
+
+pub const MAP_RENAME : ::c_int = 0x0000;
+pub const MAP_NORESERVE : ::c_int = 0x0000;
+pub const MAP_HASSEMAPHORE : ::c_int = 0x0000;
+
+pub const EIPSEC : ::c_int = 82;
+pub const ENOMEDIUM : ::c_int = 85;
+pub const EMEDIUMTYPE : ::c_int = 86;
+
+pub const EAI_SYSTEM: ::c_int = -11;
+
+pub const RUSAGE_THREAD: ::c_int = 1;
+
+pub const MAP_COPY : ::c_int = 0x0002;
+pub const MAP_NOEXTEND : ::c_int = 0x0000;
+
+pub const _SC_CLK_TCK : ::c_int = 3;
+pub const _SC_IOV_MAX : ::c_int = 51;
+pub const _SC_GETGR_R_SIZE_MAX : ::c_int = 100;
+pub const _SC_GETPW_R_SIZE_MAX : ::c_int = 101;
+pub const _SC_LOGIN_NAME_MAX : ::c_int = 102;
+pub const _SC_MQ_PRIO_MAX : ::c_int = 59;
+pub const _SC_NPROCESSORS_ONLN : ::c_int = 503;
+pub const _SC_THREADS : ::c_int = 91;
+pub const _SC_THREAD_ATTR_STACKADDR : ::c_int = 77;
+pub const _SC_THREAD_ATTR_STACKSIZE : ::c_int = 78;
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : ::c_int = 80;
+pub const _SC_THREAD_KEYS_MAX : ::c_int = 81;
+pub const _SC_THREAD_PRIO_INHERIT : ::c_int = 82;
+pub const _SC_THREAD_PRIO_PROTECT : ::c_int = 83;
+pub const _SC_THREAD_PRIORITY_SCHEDULING : ::c_int = 84;
+pub const _SC_THREAD_PROCESS_SHARED : ::c_int = 85;
+pub const _SC_THREAD_SAFE_FUNCTIONS : ::c_int = 103;
+pub const _SC_THREAD_STACK_MIN : ::c_int = 89;
+pub const _SC_THREAD_THREADS_MAX : ::c_int = 90;
+pub const _SC_TTY_NAME_MAX : ::c_int = 107;
+pub const _SC_ATEXIT_MAX : ::c_int = 46;
+pub const _SC_AIO_LISTIO_MAX : ::c_int = 42;
+pub const _SC_AIO_MAX : ::c_int = 43;
+pub const _SC_ASYNCHRONOUS_IO : ::c_int = 45;
+pub const _SC_MAPPED_FILES : ::c_int = 53;
+pub const _SC_MEMLOCK : ::c_int = 54;
+pub const _SC_MEMLOCK_RANGE : ::c_int = 55;
+pub const _SC_MEMORY_PROTECTION : ::c_int = 56;
+pub const _SC_MESSAGE_PASSING : ::c_int = 57;
+pub const _SC_MQ_OPEN_MAX : ::c_int = 58;
+pub const _SC_PRIORITY_SCHEDULING : ::c_int = 61;
+pub const _SC_SEMAPHORES : ::c_int = 67;
+pub const _SC_SHARED_MEMORY_OBJECTS : ::c_int = 68;
+pub const _SC_SYNCHRONIZED_IO : ::c_int = 75;
+pub const _SC_TIMERS : ::c_int = 94;
+pub const _SC_XOPEN_CRYPT : ::c_int = 117;
+pub const _SC_XOPEN_ENH_I18N : ::c_int = 118;
+pub const _SC_XOPEN_LEGACY : ::c_int = 119;
+pub const _SC_XOPEN_REALTIME : ::c_int = 120;
+pub const _SC_XOPEN_REALTIME_THREADS : ::c_int = 121;
+pub const _SC_XOPEN_UNIX : ::c_int = 123;
+pub const _SC_XOPEN_VERSION : ::c_int = 125;
+pub const _SC_SEM_NSEMS_MAX : ::c_int = 31;
+pub const _SC_SEM_VALUE_MAX : ::c_int = 32;
+pub const _SC_AIO_PRIO_DELTA_MAX : ::c_int = 44;
+pub const _SC_DELAYTIMER_MAX : ::c_int = 50;
+pub const _SC_PRIORITIZED_IO : ::c_int = 60;
+pub const _SC_REALTIME_SIGNALS : ::c_int = 64;
+pub const _SC_RTSIG_MAX : ::c_int = 66;
+pub const _SC_SIGQUEUE_MAX : ::c_int = 70;
+pub const _SC_TIMER_MAX : ::c_int = 93;
+pub const _SC_HOST_NAME_MAX : ::c_int = 33;
+
+pub const FD_SETSIZE: usize = 1024;
+
+pub const ST_NOSUID: ::c_ulong = 2;
+
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _;
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0 as *mut _;
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _;
+
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3;
+pub const PTHREAD_MUTEX_STRICT_NP: ::c_int = 4;
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_STRICT_NP;
+
+pub const EVFILT_AIO: ::int16_t = -3;
+pub const EVFILT_PROC: ::int16_t = -5;
+pub const EVFILT_READ: ::int16_t = -1;
+pub const EVFILT_SIGNAL: ::int16_t = -6;
+pub const EVFILT_TIMER: ::int16_t = -7;
+pub const EVFILT_VNODE: ::int16_t = -4;
+pub const EVFILT_WRITE: ::int16_t = -2;
+
+pub const EV_ADD: ::uint16_t = 0x1;
+pub const EV_DELETE: ::uint16_t = 0x2;
+pub const EV_ENABLE: ::uint16_t = 0x4;
+pub const EV_DISABLE: ::uint16_t = 0x8;
+pub const EV_ONESHOT: ::uint16_t = 0x10;
+pub const EV_CLEAR: ::uint16_t = 0x20;
+pub const EV_FLAG1: ::uint16_t = 0x2000;
+pub const EV_ERROR: ::uint16_t = 0x4000;
+pub const EV_EOF: ::uint16_t = 0x8000;
+pub const EV_SYSFLAGS: ::uint16_t = 0xf000;
+
+pub const NOTE_LOWAT: ::uint32_t = 0x00000001;
+pub const NOTE_EOF: ::uint32_t = 0x00000002;
+pub const NOTE_DELETE: ::uint32_t = 0x00000001;
+pub const NOTE_WRITE: ::uint32_t = 0x00000002;
+pub const NOTE_EXTEND: ::uint32_t = 0x00000004;
+pub const NOTE_ATTRIB: ::uint32_t = 0x00000008;
+pub const NOTE_LINK: ::uint32_t = 0x00000010;
+pub const NOTE_RENAME: ::uint32_t = 0x00000020;
+pub const NOTE_REVOKE: ::uint32_t = 0x00000040;
+pub const NOTE_TRUNCATE: ::uint32_t = 0x00000080;
+pub const NOTE_EXIT: ::uint32_t = 0x80000000;
+pub const NOTE_FORK: ::uint32_t = 0x40000000;
+pub const NOTE_EXEC: ::uint32_t = 0x20000000;
+pub const NOTE_PDATAMASK: ::uint32_t = 0x000fffff;
+pub const NOTE_PCTRLMASK: ::uint32_t = 0xf0000000;
+pub const NOTE_TRACK: ::uint32_t = 0x00000001;
+pub const NOTE_TRACKERR: ::uint32_t = 0x00000002;
+pub const NOTE_CHILD: ::uint32_t = 0x00000004;
+
+pub const TMP_MAX : ::c_uint = 0x7fffffff;
+
+pub const NI_MAXHOST: ::size_t = 256;
+
+pub const RTLD_LOCAL: ::c_int = 0;
+pub const CTL_MAXNAME: ::c_int = 12;
+pub const CTLTYPE_NODE: ::c_int = 1;
+pub const CTLTYPE_INT: ::c_int = 2;
+pub const CTLTYPE_STRING: ::c_int = 3;
+pub const CTLTYPE_QUAD: ::c_int = 4;
+pub const CTLTYPE_STRUCT: ::c_int = 5;
+pub const CTL_UNSPEC: ::c_int = 0;
+pub const CTL_KERN: ::c_int = 1;
+pub const CTL_VM: ::c_int = 2;
+pub const CTL_FS: ::c_int = 3;
+pub const CTL_NET: ::c_int = 4;
+pub const CTL_DEBUG: ::c_int = 5;
+pub const CTL_HW: ::c_int = 6;
+pub const CTL_MACHDEP: ::c_int = 7;
+pub const CTL_DDB: ::c_int = 9;
+pub const CTL_VFS: ::c_int = 10;
+pub const CTL_MAXID: ::c_int = 11;
+pub const KERN_OSTYPE: ::c_int = 1;
+pub const KERN_OSRELEASE: ::c_int = 2;
+pub const KERN_OSREV: ::c_int = 3;
+pub const KERN_VERSION: ::c_int = 4;
+pub const KERN_MAXVNODES: ::c_int = 5;
+pub const KERN_MAXPROC: ::c_int = 6;
+pub const KERN_MAXFILES: ::c_int = 7;
+pub const KERN_ARGMAX: ::c_int = 8;
+pub const KERN_SECURELVL: ::c_int = 9;
+pub const KERN_HOSTNAME: ::c_int = 10;
+pub const KERN_HOSTID: ::c_int = 11;
+pub const KERN_CLOCKRATE: ::c_int = 12;
+pub const KERN_PROF: ::c_int = 16;
+pub const KERN_POSIX1: ::c_int = 17;
+pub const KERN_NGROUPS: ::c_int = 18;
+pub const KERN_JOB_CONTROL: ::c_int = 19;
+pub const KERN_SAVED_IDS: ::c_int = 20;
+pub const KERN_BOOTTIME: ::c_int = 21;
+pub const KERN_DOMAINNAME: ::c_int = 22;
+pub const KERN_MAXPARTITIONS: ::c_int = 23;
+pub const KERN_RAWPARTITION: ::c_int = 24;
+pub const KERN_MAXTHREAD: ::c_int = 25;
+pub const KERN_NTHREADS: ::c_int = 26;
+pub const KERN_OSVERSION: ::c_int = 27;
+pub const KERN_SOMAXCONN: ::c_int = 28;
+pub const KERN_SOMINCONN: ::c_int = 29;
+pub const KERN_USERMOUNT: ::c_int = 30;
+pub const KERN_NOSUIDCOREDUMP: ::c_int = 32;
+pub const KERN_FSYNC: ::c_int = 33;
+pub const KERN_SYSVMSG: ::c_int = 34;
+pub const KERN_SYSVSEM: ::c_int = 35;
+pub const KERN_SYSVSHM: ::c_int = 36;
+pub const KERN_ARND: ::c_int = 37;
+pub const KERN_MSGBUFSIZE: ::c_int = 38;
+pub const KERN_MALLOCSTATS: ::c_int = 39;
+pub const KERN_CPTIME: ::c_int = 40;
+pub const KERN_NCHSTATS: ::c_int = 41;
+pub const KERN_FORKSTAT: ::c_int = 42;
+pub const KERN_NSELCOLL: ::c_int = 43;
+pub const KERN_TTY: ::c_int = 44;
+pub const KERN_CCPU: ::c_int = 45;
+pub const KERN_FSCALE: ::c_int = 46;
+pub const KERN_NPROCS: ::c_int = 47;
+pub const KERN_MSGBUF: ::c_int = 48;
+pub const KERN_POOL: ::c_int = 49;
+pub const KERN_STACKGAPRANDOM: ::c_int = 50;
+pub const KERN_SYSVIPC_INFO: ::c_int = 51;
+pub const KERN_SPLASSERT: ::c_int = 54;
+pub const KERN_PROC_ARGS: ::c_int = 55;
+pub const KERN_NFILES: ::c_int = 56;
+pub const KERN_TTYCOUNT: ::c_int = 57;
+pub const KERN_NUMVNODES: ::c_int = 58;
+pub const KERN_MBSTAT: ::c_int = 59;
+pub const KERN_SEMINFO: ::c_int = 61;
+pub const KERN_SHMINFO: ::c_int = 62;
+pub const KERN_INTRCNT: ::c_int = 63;
+pub const KERN_WATCHDOG: ::c_int = 64;
+pub const KERN_PROC: ::c_int = 66;
+pub const KERN_MAXCLUSTERS: ::c_int = 67;
+pub const KERN_EVCOUNT: ::c_int = 68;
+pub const KERN_TIMECOUNTER: ::c_int = 69;
+pub const KERN_MAXLOCKSPERUID: ::c_int = 70;
+pub const KERN_CPTIME2: ::c_int = 71;
+pub const KERN_CACHEPCT: ::c_int = 72;
+pub const KERN_FILE: ::c_int = 73;
+pub const KERN_CONSDEV: ::c_int = 75;
+pub const KERN_NETLIVELOCKS: ::c_int = 76;
+pub const KERN_POOL_DEBUG: ::c_int = 77;
+pub const KERN_PROC_CWD: ::c_int = 78;
+pub const KERN_PROC_NOBROADCASTKILL: ::c_int = 79;
+pub const KERN_PROC_VMMAP: ::c_int = 80;
+pub const KERN_GLOBAL_PTRACE: ::c_int = 81;
+pub const KERN_CONSBUFSIZE: ::c_int = 82;
+pub const KERN_CONSBUF: ::c_int = 83;
+pub const KERN_MAXID: ::c_int = 84;
+pub const KERN_PROC_ALL: ::c_int = 0;
+pub const KERN_PROC_PID: ::c_int = 1;
+pub const KERN_PROC_PGRP: ::c_int = 2;
+pub const KERN_PROC_SESSION: ::c_int = 3;
+pub const KERN_PROC_TTY: ::c_int = 4;
+pub const KERN_PROC_UID: ::c_int = 5;
+pub const KERN_PROC_RUID: ::c_int = 6;
+pub const KERN_PROC_KTHREAD: ::c_int = 7;
+pub const KERN_PROC_SHOW_THREADS: ::c_int = 0x40000000;
+pub const KERN_SYSVIPC_MSG_INFO: ::c_int = 1;
+pub const KERN_SYSVIPC_SEM_INFO: ::c_int = 2;
+pub const KERN_SYSVIPC_SHM_INFO: ::c_int = 3;
+pub const KERN_PROC_ARGV: ::c_int = 1;
+pub const KERN_PROC_NARGV: ::c_int = 2;
+pub const KERN_PROC_ENV: ::c_int = 3;
+pub const KERN_PROC_NENV: ::c_int = 4;
+pub const KI_NGROUPS: ::c_int = 16;
+pub const KI_MAXCOMLEN: ::c_int = 24;
+pub const KI_WMESGLEN: ::c_int = 8;
+pub const KI_MAXLOGNAME: ::c_int = 32;
+pub const KI_EMULNAMELEN: ::c_int = 8;
+
+extern {
+    pub fn getnameinfo(sa: *const ::sockaddr,
+                       salen: ::socklen_t,
+                       host: *mut ::c_char,
+                       hostlen: ::size_t,
+                       serv: *mut ::c_char,
+                       servlen: ::size_t,
+                       flags: ::c_int) -> ::c_int;
+    pub fn kevent(kq: ::c_int,
+                  changelist: *const ::kevent,
+                  nchanges: ::c_int,
+                  eventlist: *mut ::kevent,
+                  nevents: ::c_int,
+                  timeout: *const ::timespec) -> ::c_int;
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
+                    -> ::c_int;
+    pub fn pthread_main_np() -> ::c_int;
+    pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
+    pub fn pthread_stackseg_np(thread: ::pthread_t,
+                               sinfo: *mut ::stack_t) -> ::c_int;
+    pub fn sysctl(name: *const ::c_int,
+                  namelen: ::c_uint,
+                  oldp: *mut ::c_void,
+                  oldlenp: *mut ::size_t,
+                  newp: *mut ::c_void,
+                  newlen: ::size_t)
+                  -> ::c_int;
+    pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
+    pub fn pledge(promises: *const ::c_char,
+                  paths: *mut *const ::c_char) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(target_os = "openbsd")] {
+        mod openbsd;
+        pub use self::openbsd::*;
+    } else if #[cfg(target_os = "bitrig")] {
+        mod bitrig;
+        pub use self::bitrig::*;
+    } else {
+        // Unknown target_os
+    }
+}
+
+mod other;
+pub use self::other::*;
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs
@@ -0,0 +1,28 @@
+s! {
+    pub struct lconv {
+        pub decimal_point: *mut ::c_char,
+        pub thousands_sep: *mut ::c_char,
+        pub grouping: *mut ::c_char,
+        pub int_curr_symbol: *mut ::c_char,
+        pub currency_symbol: *mut ::c_char,
+        pub mon_decimal_point: *mut ::c_char,
+        pub mon_thousands_sep: *mut ::c_char,
+        pub mon_grouping: *mut ::c_char,
+        pub positive_sign: *mut ::c_char,
+        pub negative_sign: *mut ::c_char,
+        pub int_frac_digits: ::c_char,
+        pub frac_digits: ::c_char,
+        pub p_cs_precedes: ::c_char,
+        pub p_sep_by_space: ::c_char,
+        pub n_cs_precedes: ::c_char,
+        pub n_sep_by_space: ::c_char,
+        pub p_sign_posn: ::c_char,
+        pub n_sign_posn: ::c_char,
+        pub int_p_cs_precedes: ::c_char,
+        pub int_p_sep_by_space: ::c_char,
+        pub int_n_cs_precedes: ::c_char,
+        pub int_n_sep_by_space: ::c_char,
+        pub int_p_sign_posn: ::c_char,
+        pub int_n_sign_posn: ::c_char,
+    }
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs
@@ -0,0 +1,2 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/other/b64/mod.rs
@@ -0,0 +1,2 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs
@@ -0,0 +1,11 @@
+cfg_if! {
+    if #[cfg(target_arch = "x86_64")] {
+        mod b64;
+        pub use self::b64::*;
+    } else if #[cfg(target_arch = "x86")] {
+        mod b32;
+        pub use self::b32::*;
+    } else {
+        // Unknown target_arch
+    }
+}
deleted file mode 100644
--- a/third_party/rust/libc/src/unix/bsd/openbsdlike/bitrig.rs
+++ /dev/null
@@ -1,490 +0,0 @@
-pub type clock_t = i64;
-pub type suseconds_t = i64;
-pub type dev_t = i32;
-pub type sigset_t = ::c_uint;
-pub type blksize_t = ::uint32_t;
-pub type fsblkcnt_t = ::c_uint;
-pub type fsfilcnt_t = ::c_uint;
-pub type pthread_attr_t = *mut ::c_void;
-pub type pthread_mutex_t = *mut ::c_void;
-pub type pthread_mutexattr_t = *mut ::c_void;
-pub type pthread_cond_t = *mut ::c_void;
-pub type pthread_condattr_t = *mut ::c_void;
-pub type pthread_rwlock_t = *mut ::c_void;
-
-s! {
-    pub struct dirent {
-        pub d_fileno: ::ino_t,
-        pub d_off: ::off_t,
-        pub d_reclen: u16,
-        pub d_type: u8,
-        pub d_namlen: u8,
-        __d_padding: [u8; 4],
-        pub d_name: [::c_char; 256],
-    }
-
-    pub struct glob_t {
-        pub gl_pathc:  ::c_int,
-        pub gl_matchc: ::c_int,
-        pub gl_offs:   ::c_int,
-        pub gl_flags:  ::c_int,
-        pub gl_pathv:  *mut *mut ::c_char,
-        __unused1: *mut ::c_void,
-        __unused2: *mut ::c_void,
-        __unused3: *mut ::c_void,
-        __unused4: *mut ::c_void,
-        __unused5: *mut ::c_void,
-        __unused6: *mut ::c_void,
-        __unused7: *mut ::c_void,
-    }
-
-    pub struct kevent {
-        pub ident: ::uintptr_t,
-        pub filter: ::c_short,
-        pub flags: ::c_ushort,
-        pub fflags: ::c_uint,
-        pub data: ::int64_t,
-        pub udata: *mut ::c_void,
-    }
-
-    pub struct stat {
-        pub st_mode: ::mode_t,
-        pub st_dev: ::dev_t,
-        pub st_ino: ::ino_t,
-        pub st_nlink: ::nlink_t,
-        pub st_uid: ::uid_t,
-        pub st_gid: ::gid_t,
-        pub st_rdev: ::dev_t,
-        pub st_atime: ::time_t,
-        pub st_atime_nsec: ::c_long,
-        pub st_mtime: ::time_t,
-        pub st_mtime_nsec: ::c_long,
-        pub st_ctime: ::time_t,
-        pub st_ctime_nsec: ::c_long,
-        pub st_size: ::off_t,
-        pub st_blocks: ::blkcnt_t,
-        pub st_blksize: ::blksize_t,
-        pub st_flags: ::uint32_t,
-        pub st_gen: ::uint32_t,
-        pub st_birthtime: ::time_t,
-        pub st_birthtime_nsec: ::c_long,
-    }
-
-    pub struct statvfs {
-        pub f_bsize: ::c_ulong,
-        pub f_frsize: ::c_ulong,
-        pub f_blocks: ::fsblkcnt_t,
-        pub f_bfree: ::fsblkcnt_t,
-        pub f_bavail: ::fsblkcnt_t,
-        pub f_files: ::fsfilcnt_t,
-        pub f_ffree: ::fsfilcnt_t,
-        pub f_favail: ::fsfilcnt_t,
-        pub f_fsid: ::c_ulong,
-        pub f_flag: ::c_ulong,
-        pub f_namemax: ::c_ulong,
-    }
-
-    pub struct addrinfo {
-        pub ai_flags: ::c_int,
-        pub ai_family: ::c_int,
-        pub ai_socktype: ::c_int,
-        pub ai_protocol: ::c_int,
-        pub ai_addrlen: ::socklen_t,
-        pub ai_addr: *mut ::sockaddr,
-        pub ai_canonname: *mut ::c_char,
-        pub ai_next: *mut ::addrinfo,
-    }
-
-    pub struct sockaddr_storage {
-        pub ss_len: u8,
-        pub ss_family: ::sa_family_t,
-        __ss_pad1: [u8; 6],
-        __ss_pad2: i64,
-        __ss_pad3: [u8; 240],
-    }
-
-    pub struct siginfo_t {
-        pub si_signo: ::c_int,
-        pub si_code: ::c_int,
-        pub si_errno: ::c_int,
-        pub si_addr: *mut ::c_void
-    }
-
-    pub struct Dl_info {
-        pub dli_fname: *const ::c_char,
-        pub dli_fbase: *mut ::c_void,
-        pub dli_sname: *const ::c_char,
-        pub dli_saddr: *mut ::c_void,
-    }
-
-    pub struct lconv {
-        pub decimal_point: *mut ::c_char,
-        pub thousands_sep: *mut ::c_char,
-        pub grouping: *mut ::c_char,
-        pub int_curr_symbol: *mut ::c_char,
-        pub currency_symbol: *mut ::c_char,
-        pub mon_decimal_point: *mut ::c_char,
-        pub mon_thousands_sep: *mut ::c_char,
-        pub mon_grouping: *mut ::c_char,
-        pub positive_sign: *mut ::c_char,
-        pub negative_sign: *mut ::c_char,
-        pub int_frac_digits: ::c_char,
-        pub frac_digits: ::c_char,
-        pub p_cs_precedes: ::c_char,
-        pub p_sep_by_space: ::c_char,
-        pub n_cs_precedes: ::c_char,
-        pub n_sep_by_space: ::c_char,
-        pub p_sign_posn: ::c_char,
-        pub n_sign_posn: ::c_char,
-        pub int_p_cs_precedes: ::c_char,
-        pub int_n_cs_precedes: ::c_char,
-        pub int_p_sep_by_space: ::c_char,
-        pub int_n_sep_by_space: ::c_char,
-        pub int_p_sign_posn: ::c_char,
-        pub int_n_sign_posn: ::c_char,
-    }
-}
-
-pub const LC_COLLATE_MASK: ::c_int = (1 << 0);
-pub const LC_CTYPE_MASK: ::c_int = (1 << 1);
-pub const LC_MESSAGES_MASK: ::c_int = (1 << 2);
-pub const LC_MONETARY_MASK: ::c_int = (1 << 3);
-pub const LC_NUMERIC_MASK: ::c_int = (1 << 4);
-pub const LC_TIME_MASK: ::c_int = (1 << 5);
-pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
-                               | LC_CTYPE_MASK
-                               | LC_MESSAGES_MASK
-                               | LC_MONETARY_MASK
-                               | LC_NUMERIC_MASK
-                               | LC_TIME_MASK;
-
-pub const ERA: ::nl_item = 52;
-pub const ERA_D_FMT: ::nl_item = 53;
-pub const ERA_D_T_FMT: ::nl_item = 54;
-pub const ERA_T_FMT: ::nl_item = 55;
-pub const ALT_DIGITS: ::nl_item = 56;
-
-pub const D_MD_ORDER: ::nl_item = 57;
-
-pub const ALTMON_1: ::nl_item = 58;
-pub const ALTMON_2: ::nl_item = 59;
-pub const ALTMON_3: ::nl_item = 60;
-pub const ALTMON_4: ::nl_item = 61;
-pub const ALTMON_5: ::nl_item = 62;
-pub const ALTMON_6: ::nl_item = 63;
-pub const ALTMON_7: ::nl_item = 64;
-pub const ALTMON_8: ::nl_item = 65;
-pub const ALTMON_9: ::nl_item = 66;
-pub const ALTMON_10: ::nl_item = 67;
-pub const ALTMON_11: ::nl_item = 68;
-pub const ALTMON_12: ::nl_item = 69;
-
-pub const O_CLOEXEC: ::c_int = 0x10000;
-
-pub const MS_SYNC : ::c_int = 0x0002;
-pub const MS_INVALIDATE : ::c_int = 0x0004;
-
-pub const PTHREAD_STACK_MIN : ::size_t = 2048;
-
-pub const ENOATTR : ::c_int = 83;
-pub const EILSEQ : ::c_int = 84;
-pub const EOVERFLOW : ::c_int = 87;
-pub const ECANCELED : ::c_int = 88;
-pub const EIDRM : ::c_int = 89;
-pub const ENOMSG : ::c_int = 90;
-pub const ENOTSUP : ::c_int = 91;
-pub const ELAST : ::c_int = 91;
-
-pub const F_DUPFD_CLOEXEC : ::c_int = 10;
-
-pub const RLIM_NLIMITS: ::c_int = 9;
-
-pub const SO_SNDTIMEO: ::c_int = 0x1005;
-pub const SO_RCVTIMEO: ::c_int = 0x1006;
-
-pub const O_DSYNC : ::c_int = 128;
-
-pub const MAP_RENAME : ::c_int = 0x0000;
-pub const MAP_NORESERVE : ::c_int = 0x0000;
-pub const MAP_HASSEMAPHORE : ::c_int = 0x0000;
-
-pub const EIPSEC : ::c_int = 82;
-pub const ENOMEDIUM : ::c_int = 85;
-pub const EMEDIUMTYPE : ::c_int = 86;
-
-pub const RUSAGE_THREAD: ::c_int = 1;
-
-pub const IPV6_ADD_MEMBERSHIP: ::c_int = 12;
-pub const IPV6_DROP_MEMBERSHIP: ::c_int = 13;
-
-pub const MAP_COPY : ::c_int = 0x0002;
-pub const MAP_NOEXTEND : ::c_int = 0x0000;
-
-pub const _SC_IOV_MAX : ::c_int = 51;
-pub const _SC_GETGR_R_SIZE_MAX : ::c_int = 100;
-pub const _SC_GETPW_R_SIZE_MAX : ::c_int = 101;
-pub const _SC_LOGIN_NAME_MAX : ::c_int = 102;
-pub const _SC_MQ_PRIO_MAX : ::c_int = 59;
-pub const _SC_NPROCESSORS_ONLN : ::c_int = 503;
-pub const _SC_THREADS : ::c_int = 91;
-pub const _SC_THREAD_ATTR_STACKADDR : ::c_int = 77;
-pub const _SC_THREAD_ATTR_STACKSIZE : ::c_int = 78;
-pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : ::c_int = 80;
-pub const _SC_THREAD_KEYS_MAX : ::c_int = 81;
-pub const _SC_THREAD_PRIO_INHERIT : ::c_int = 82;
-pub const _SC_THREAD_PRIO_PROTECT : ::c_int = 83;
-pub const _SC_THREAD_PRIORITY_SCHEDULING : ::c_int = 84;
-pub const _SC_THREAD_PROCESS_SHARED : ::c_int = 85;
-pub const _SC_THREAD_SAFE_FUNCTIONS : ::c_int = 103;
-pub const _SC_THREAD_STACK_MIN : ::c_int = 89;
-pub const _SC_THREAD_THREADS_MAX : ::c_int = 90;
-pub const _SC_TTY_NAME_MAX : ::c_int = 107;
-pub const _SC_ATEXIT_MAX : ::c_int = 46;
-pub const _SC_CLK_TCK : ::c_int = 3;
-pub const _SC_AIO_LISTIO_MAX : ::c_int = 42;
-pub const _SC_AIO_MAX : ::c_int = 43;
-pub const _SC_ASYNCHRONOUS_IO : ::c_int = 45;
-pub const _SC_MAPPED_FILES : ::c_int = 53;
-pub const _SC_MEMLOCK : ::c_int = 54;
-pub const _SC_MEMLOCK_RANGE : ::c_int = 55;
-pub const _SC_MEMORY_PROTECTION : ::c_int = 56;
-pub const _SC_MESSAGE_PASSING : ::c_int = 57;
-pub const _SC_MQ_OPEN_MAX : ::c_int = 58;
-pub const _SC_PRIORITY_SCHEDULING : ::c_int = 61;
-pub const _SC_SEMAPHORES : ::c_int = 67;
-pub const _SC_SHARED_MEMORY_OBJECTS : ::c_int = 68;
-pub const _SC_SYNCHRONIZED_IO : ::c_int = 75;
-pub const _SC_TIMERS : ::c_int = 94;
-pub const _SC_XOPEN_CRYPT : ::c_int = 117;
-pub const _SC_XOPEN_ENH_I18N : ::c_int = 118;
-pub const _SC_XOPEN_LEGACY : ::c_int = 119;
-pub const _SC_XOPEN_REALTIME : ::c_int = 120;
-pub const _SC_XOPEN_REALTIME_THREADS : ::c_int = 121;
-pub const _SC_XOPEN_UNIX : ::c_int = 123;
-pub const _SC_XOPEN_VERSION : ::c_int = 125;
-pub const _SC_SEM_NSEMS_MAX : ::c_int = 31;
-pub const _SC_SEM_VALUE_MAX : ::c_int = 32;
-pub const _SC_AIO_PRIO_DELTA_MAX : ::c_int = 44;
-pub const _SC_DELAYTIMER_MAX : ::c_int = 50;
-pub const _SC_PRIORITIZED_IO : ::c_int = 60;
-pub const _SC_REALTIME_SIGNALS : ::c_int = 64;
-pub const _SC_RTSIG_MAX : ::c_int = 66;
-pub const _SC_SIGQUEUE_MAX : ::c_int = 70;
-pub const _SC_TIMER_MAX : ::c_int = 93;
-pub const _SC_HOST_NAME_MAX: ::c_int = 33;
-
-pub const FD_SETSIZE: usize = 1024;
-
-pub const ST_NOSUID: ::c_ulong = 2;
-
-pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _;
-pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0 as *mut _;
-pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _;
-
-pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
-pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
-pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3;
-pub const PTHREAD_MUTEX_STRICT_NP: ::c_int = 4;
-pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_STRICT_NP;
-
-pub const EVFILT_AIO: ::int16_t = -3;
-pub const EVFILT_PROC: ::int16_t = -5;
-pub const EVFILT_READ: ::int16_t = -1;
-pub const EVFILT_SIGNAL: ::int16_t = -6;
-pub const EVFILT_TIMER: ::int16_t = -7;
-pub const EVFILT_VNODE: ::int16_t = -4;
-pub const EVFILT_WRITE: ::int16_t = -2;
-
-pub const EV_ADD: ::uint16_t = 0x1;
-pub const EV_DELETE: ::uint16_t = 0x2;
-pub const EV_ENABLE: ::uint16_t = 0x4;
-pub const EV_DISABLE: ::uint16_t = 0x8;
-pub const EV_ONESHOT: ::uint16_t = 0x10;
-pub const EV_CLEAR: ::uint16_t = 0x20;
-pub const EV_FLAG1: ::uint16_t = 0x2000;
-pub const EV_ERROR: ::uint16_t = 0x4000;
-pub const EV_EOF: ::uint16_t = 0x8000;
-pub const EV_SYSFLAGS: ::uint16_t = 0xf000;
-
-pub const NOTE_LOWAT: ::uint32_t = 0x00000001;
-pub const NOTE_EOF: ::uint32_t = 0x00000002;
-pub const NOTE_DELETE: ::uint32_t = 0x00000001;
-pub const NOTE_WRITE: ::uint32_t = 0x00000002;
-pub const NOTE_EXTEND: ::uint32_t = 0x00000004;
-pub const NOTE_ATTRIB: ::uint32_t = 0x00000008;
-pub const NOTE_LINK: ::uint32_t = 0x00000010;
-pub const NOTE_RENAME: ::uint32_t = 0x00000020;
-pub const NOTE_REVOKE: ::uint32_t = 0x00000040;
-pub const NOTE_TRUNCATE: ::uint32_t = 0x00000080;
-pub const NOTE_EXIT: ::uint32_t = 0x80000000;
-pub const NOTE_FORK: ::uint32_t = 0x40000000;
-pub const NOTE_EXEC: ::uint32_t = 0x20000000;
-pub const NOTE_PDATAMASK: ::uint32_t = 0x000fffff;
-pub const NOTE_PCTRLMASK: ::uint32_t = 0xf0000000;
-pub const NOTE_TRACK: ::uint32_t = 0x00000001;
-pub const NOTE_TRACKERR: ::uint32_t = 0x00000002;
-pub const NOTE_CHILD: ::uint32_t = 0x00000004;
-
-pub const TMP_MAX : ::c_uint = 0x7fffffff;
-
-pub const NI_MAXHOST: ::size_t = 256;
-
-pub const CTL_MAXNAME: ::c_int = 12;
-pub const CTLTYPE_NODE: ::c_int = 1;
-pub const CTLTYPE_INT: ::c_int = 2;
-pub const CTLTYPE_STRING: ::c_int = 3;
-pub const CTLTYPE_QUAD: ::c_int = 4;
-pub const CTLTYPE_STRUCT: ::c_int = 5;
-pub const CTL_UNSPEC: ::c_int = 0;
-pub const CTL_KERN: ::c_int = 1;
-pub const CTL_VM: ::c_int = 2;
-pub const CTL_FS: ::c_int = 3;
-pub const CTL_NET: ::c_int = 4;
-pub const CTL_DEBUG: ::c_int = 5;
-pub const CTL_HW: ::c_int = 6;
-pub const CTL_MACHDEP: ::c_int = 7;
-pub const CTL_DDB: ::c_int = 9;
-pub const CTL_VFS: ::c_int = 10;
-pub const CTL_MAXID: ::c_int = 11;
-pub const KERN_OSTYPE: ::c_int = 1;
-pub const KERN_OSRELEASE: ::c_int = 2;
-pub const KERN_OSREV: ::c_int = 3;
-pub const KERN_VERSION: ::c_int = 4;
-pub const KERN_MAXVNODES: ::c_int = 5;
-pub const KERN_MAXPROC: ::c_int = 6;
-pub const KERN_MAXFILES: ::c_int = 7;
-pub const KERN_ARGMAX: ::c_int = 8;
-pub const KERN_SECURELVL: ::c_int = 9;
-pub const KERN_HOSTNAME: ::c_int = 10;
-pub const KERN_HOSTID: ::c_int = 11;
-pub const KERN_CLOCKRATE: ::c_int = 12;
-pub const KERN_PROF: ::c_int = 16;
-pub const KERN_POSIX1: ::c_int = 17;
-pub const KERN_NGROUPS: ::c_int = 18;
-pub const KERN_JOB_CONTROL: ::c_int = 19;
-pub const KERN_SAVED_IDS: ::c_int = 20;
-pub const KERN_BOOTTIME: ::c_int = 21;
-pub const KERN_DOMAINNAME: ::c_int = 22;
-pub const KERN_MAXPARTITIONS: ::c_int = 23;
-pub const KERN_RAWPARTITION: ::c_int = 24;
-pub const KERN_MAXTHREAD: ::c_int = 25;
-pub const KERN_NTHREADS: ::c_int = 26;
-pub const KERN_OSVERSION: ::c_int = 27;
-pub const KERN_SOMAXCONN: ::c_int = 28;
-pub const KERN_SOMINCONN: ::c_int = 29;
-pub const KERN_USERMOUNT: ::c_int = 30;
-pub const KERN_RND: ::c_int = 31;
-pub const KERN_NOSUIDCOREDUMP: ::c_int = 32;
-pub const KERN_FSYNC: ::c_int = 33;
-pub const KERN_SYSVMSG: ::c_int = 34;
-pub const KERN_SYSVSEM: ::c_int = 35;
-pub const KERN_SYSVSHM: ::c_int = 36;
-pub const KERN_ARND: ::c_int = 37;
-pub const KERN_MSGBUFSIZE: ::c_int = 38;
-pub const KERN_MALLOCSTATS: ::c_int = 39;
-pub const KERN_CPTIME: ::c_int = 40;
-pub const KERN_NCHSTATS: ::c_int = 41;
-pub const KERN_FORKSTAT: ::c_int = 42;
-pub const KERN_NSELCOLL: ::c_int = 43;
-pub const KERN_TTY: ::c_int = 44;
-pub const KERN_CCPU: ::c_int = 45;
-pub const KERN_FSCALE: ::c_int = 46;
-pub const KERN_NPROCS: ::c_int = 47;
-pub const KERN_MSGBUF: ::c_int = 48;
-pub const KERN_POOL: ::c_int = 49;
-pub const KERN_STACKGAPRANDOM: ::c_int = 50;
-pub const KERN_SYSVIPC_INFO: ::c_int = 51;
-pub const KERN_SPLASSERT: ::c_int = 54;
-pub const KERN_PROC_ARGS: ::c_int = 55;
-pub const KERN_NFILES: ::c_int = 56;
-pub const KERN_TTYCOUNT: ::c_int = 57;
-pub const KERN_NUMVNODES: ::c_int = 58;
-pub const KERN_MBSTAT: ::c_int = 59;
-pub const KERN_SEMINFO: ::c_int = 61;
-pub const KERN_SHMINFO: ::c_int = 62;
-pub const KERN_INTRCNT: ::c_int = 63;
-pub const KERN_WATCHDOG: ::c_int = 64;
-pub const KERN_PROC: ::c_int = 66;
-pub const KERN_MAXCLUSTERS: ::c_int = 67;
-pub const KERN_EVCOUNT: ::c_int = 68;
-pub const KERN_TIMECOUNTER: ::c_int = 69;
-pub const KERN_MAXLOCKSPERUID: ::c_int = 70;
-pub const KERN_CPTIME2: ::c_int = 71;
-pub const KERN_CACHEPCT: ::c_int = 72;
-pub const KERN_FILE: ::c_int = 73;
-pub const KERN_CONSDEV: ::c_int = 75;
-pub const KERN_NETLIVELOCKS: ::c_int = 76;
-pub const KERN_POOL_DEBUG: ::c_int = 77;
-pub const KERN_PROC_CWD: ::c_int = 78;
-pub const KERN_PROC_NOBROADCASTKILL: ::c_int = 79;
-pub const KERN_PROC_VMMAP: ::c_int = 80;
-pub const KERN_GLOBAL_PTRACE: ::c_int = 81;
-pub const KERN_CONSBUFSIZE: ::c_int = 82;
-pub const KERN_CONSBUF: ::c_int = 83;
-pub const KERN_MAXID: ::c_int = 84;
-pub const KERN_PROC_ALL: ::c_int = 0;
-pub const KERN_PROC_PID: ::c_int = 1;
-pub const KERN_PROC_PGRP: ::c_int = 2;
-pub const KERN_PROC_SESSION: ::c_int = 3;
-pub const KERN_PROC_TTY: ::c_int = 4;
-pub const KERN_PROC_UID: ::c_int = 5;
-pub const KERN_PROC_RUID: ::c_int = 6;
-pub const KERN_PROC_KTHREAD: ::c_int = 7;
-pub const KERN_PROC_SHOW_THREADS: ::c_int = 0x40000000;
-pub const KERN_SYSVIPC_MSG_INFO: ::c_int = 1;
-pub const KERN_SYSVIPC_SEM_INFO: ::c_int = 2;
-pub const KERN_SYSVIPC_SHM_INFO: ::c_int = 3;
-pub const KERN_PROC_ARGV: ::c_int = 1;
-pub const KERN_PROC_NARGV: ::c_int = 2;
-pub const KERN_PROC_ENV: ::c_int = 3;
-pub const KERN_PROC_NENV: ::c_int = 4;
-pub const KI_NGROUPS: ::c_int = 16;
-pub const KI_MAXCOMLEN: ::c_int = 24;
-pub const KI_WMESGLEN: ::c_int = 8;
-pub const KI_MAXLOGNAME: ::c_int = 32;
-pub const KI_EMULNAMELEN: ::c_int = 8;
-
-extern {
-    pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
-
-    pub fn getnameinfo(sa: *const ::sockaddr,
-                       salen: ::socklen_t,
-                       host: *mut ::c_char,
-                       hostlen: ::size_t,
-                       serv: *mut ::c_char,
-                       servlen: ::size_t,
-                       flags: ::c_int) -> ::c_int;
-    pub fn kevent(kq: ::c_int,
-                  changelist: *const ::kevent,
-                  nchanges: ::c_int,
-                  eventlist: *mut ::kevent,
-                  nevents: ::c_int,
-                  timeout: *const ::timespec) -> ::c_int;
-    pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int)
-                    -> ::c_int;
-    pub fn pthread_main_np() -> ::c_int;
-    pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
-    pub fn pthread_stackseg_np(thread: ::pthread_t,
-                               sinfo: *mut ::stack_t) -> ::c_int;
-    pub fn sysctl(name: *mut ::c_int,
-                  namelen: ::c_uint,
-                  oldp: *mut ::c_void,
-                  oldlenp: *mut ::size_t,
-                  newp: *mut ::c_void,
-                  newlen: ::size_t)
-                  -> ::c_int;
-    pub fn sysctlbyname(name: *const ::c_char,
-                        oldp: *mut ::c_void,
-                        oldlenp: *mut ::size_t,
-                        newp: *mut ::c_void,
-                        newlen: ::size_t)
-                        -> ::c_int;
-    pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
-    pub fn duplocale(base: ::locale_t) -> ::locale_t;
-    pub fn freelocale(loc: ::locale_t) -> ::c_int;
-    pub fn newlocale(mask: ::c_int,
-                     locale: *const ::c_char,
-                     base: ::locale_t) -> ::locale_t;
-    pub fn uselocale(loc: ::locale_t) -> ::locale_t;
-    pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
-}
deleted file mode 100644
--- a/third_party/rust/libc/src/unix/bsd/openbsdlike/mod.rs
+++ /dev/null
@@ -1,547 +0,0 @@
-pub type c_long = i64;
-pub type c_ulong = u64;
-pub type time_t = i64;
-pub type mode_t = u32;
-pub type nlink_t = ::uint32_t;
-pub type ino_t = ::uint64_t;
-pub type pthread_key_t = ::c_int;
-pub type rlim_t = u64;
-pub type speed_t = ::c_uint;
-pub type tcflag_t = ::c_uint;
-pub type nl_item = c_long;
-pub type clockid_t = ::c_int;
-pub type id_t = ::uint32_t;
-pub type sem_t = *mut sem;
-
-pub enum timezone {}
-pub enum sem {}
-
-s! {
-    pub struct sigaction {
-        pub sa_sigaction: ::sighandler_t,
-        pub sa_mask: ::sigset_t,
-        pub sa_flags: ::c_int,
-    }
-
-    pub struct stack_t {
-        pub ss_sp: *mut ::c_void,
-        pub ss_size: ::size_t,
-        pub ss_flags: ::c_int,
-    }
-
-    pub struct sockaddr_in {
-        pub sin_len: u8,
-        pub sin_family: ::sa_family_t,
-        pub sin_port: ::in_port_t,
-        pub sin_addr: ::in_addr,
-        pub sin_zero: [::int8_t; 8],
-    }
-
-    pub struct termios {
-        pub c_iflag: ::tcflag_t,
-        pub c_oflag: ::tcflag_t,
-        pub c_cflag: ::tcflag_t,
-        pub c_lflag: ::tcflag_t,
-        pub c_cc: [::cc_t; ::NCCS],
-        pub c_ispeed: ::c_int,
-        pub c_ospeed: ::c_int,
-    }
-
-    pub struct flock {
-        pub l_start: ::off_t,
-        pub l_len: ::off_t,
-        pub l_pid: ::pid_t,
-        pub l_type: ::c_short,
-        pub l_whence: ::c_short,
-    }
-}
-
-pub const D_T_FMT: ::nl_item = 0;
-pub const D_FMT: ::nl_item = 1;
-pub const T_FMT: ::nl_item = 2;
-pub const T_FMT_AMPM: ::nl_item = 3;
-pub const AM_STR: ::nl_item = 4;
-pub const PM_STR: ::nl_item = 5;
-
-pub const DAY_1: ::nl_item = 6;
-pub const DAY_2: ::nl_item = 7;
-pub const DAY_3: ::nl_item = 8;
-pub const DAY_4: ::nl_item = 9;
-pub const DAY_5: ::nl_item = 10;
-pub const DAY_6: ::nl_item = 11;
-pub const DAY_7: ::nl_item = 12;
-
-pub const ABDAY_1: ::nl_item = 13;
-pub const ABDAY_2: ::nl_item = 14;
-pub const ABDAY_3: ::nl_item = 15;
-pub const ABDAY_4: ::nl_item = 16;
-pub const ABDAY_5: ::nl_item = 17;
-pub const ABDAY_6: ::nl_item = 18;
-pub const ABDAY_7: ::nl_item = 19;
-
-pub const MON_1: ::nl_item = 20;
-pub const MON_2: ::nl_item = 21;
-pub const MON_3: ::nl_item = 22;
-pub const MON_4: ::nl_item = 23;
-pub const MON_5: ::nl_item = 24;
-pub const MON_6: ::nl_item = 25;
-pub const MON_7: ::nl_item = 26;
-pub const MON_8: ::nl_item = 27;
-pub const MON_9: ::nl_item = 28;
-pub const MON_10: ::nl_item = 29;
-pub const MON_11: ::nl_item = 30;
-pub const MON_12: ::nl_item = 31;
-
-pub const ABMON_1: ::nl_item = 32;
-pub const ABMON_2: ::nl_item = 33;
-pub const ABMON_3: ::nl_item = 34;
-pub const ABMON_4: ::nl_item = 35;
-pub const ABMON_5: ::nl_item = 36;
-pub const ABMON_6: ::nl_item = 37;
-pub const ABMON_7: ::nl_item = 38;
-pub const ABMON_8: ::nl_item = 39;
-pub const ABMON_9: ::nl_item = 40;
-pub const ABMON_10: ::nl_item = 41;
-pub const ABMON_11: ::nl_item = 42;
-pub const ABMON_12: ::nl_item = 43;
-
-pub const RADIXCHAR: ::nl_item = 44;
-pub const THOUSEP: ::nl_item = 45;
-pub const YESSTR: ::nl_item = 46;
-pub const YESEXPR: ::nl_item = 47;
-pub const NOSTR: ::nl_item = 48;
-pub const NOEXPR: ::nl_item = 49;
-pub const CRNCYSTR: ::nl_item = 50;
-
-pub const CODESET: ::nl_item = 51;
-
-pub const EXIT_FAILURE : ::c_int = 1;
-pub const EXIT_SUCCESS : ::c_int = 0;
-pub const RAND_MAX : ::c_int = 2147483647;
-pub const EOF : ::c_int = -1;
-pub const SEEK_SET : ::c_int = 0;
-pub const SEEK_CUR : ::c_int = 1;
-pub const SEEK_END : ::c_int = 2;
-pub const _IOFBF : ::c_int = 0;
-pub const _IONBF : ::c_int = 2;
-pub const _IOLBF : ::c_int = 1;
-pub const BUFSIZ : ::c_uint = 1024;
-pub const FOPEN_MAX : ::c_uint = 20;
-pub const FILENAME_MAX : ::c_uint = 1024;
-pub const L_tmpnam : ::c_uint = 1024;
-pub const O_RDONLY : ::c_int = 0;
-pub const O_WRONLY : ::c_int = 1;
-pub const O_RDWR : ::c_int = 2;
-pub const O_ACCMODE : ::c_int = 3;
-pub const O_APPEND : ::c_int = 8;
-pub const O_CREAT : ::c_int = 512;
-pub const O_EXCL : ::c_int = 2048;
-pub const O_NOCTTY : ::c_int = 32768;
-pub const O_TRUNC : ::c_int = 1024;
-pub const O_SYNC : ::c_int = 128;
-pub const S_IFIFO : mode_t = 4096;
-pub const S_IFCHR : mode_t = 8192;
-pub const S_IFBLK : mode_t = 24576;
-pub const S_IFDIR : mode_t = 16384;
-pub const S_IFREG : mode_t = 32768;
-pub const S_IFLNK : mode_t = 40960;
-pub const S_IFSOCK : mode_t = 49152;
-pub const S_IFMT : mode_t = 61440;
-pub const S_IEXEC : mode_t = 64;
-pub const S_IWRITE : mode_t = 128;
-pub const S_IREAD : mode_t = 256;
-pub const S_IRWXU : mode_t = 448;
-pub const S_IXUSR : mode_t = 64;
-pub const S_IWUSR : mode_t = 128;
-pub const S_IRUSR : mode_t = 256;
-pub const S_IRWXG : mode_t = 56;
-pub const S_IXGRP : mode_t = 8;
-pub const S_IWGRP : mode_t = 16;
-pub const S_IRGRP : mode_t = 32;
-pub const S_IRWXO : mode_t = 7;
-pub const S_IXOTH : mode_t = 1;
-pub const S_IWOTH : mode_t = 2;
-pub const S_IROTH : mode_t = 4;
-pub const F_OK : ::c_int = 0;
-pub const R_OK : ::c_int = 4;
-pub const W_OK : ::c_int = 2;
-pub const X_OK : ::c_int = 1;
-pub const STDIN_FILENO : ::c_int = 0;
-pub const STDOUT_FILENO : ::c_int = 1;
-pub const STDERR_FILENO : ::c_int = 2;
-pub const F_LOCK : ::c_int = 1;
-pub const F_TEST : ::c_int = 3;
-pub const F_TLOCK : ::c_int = 2;
-pub const F_ULOCK : ::c_int = 0;
-pub const F_GETLK: ::c_int = 7;
-pub const F_SETLK: ::c_int = 8;
-pub const F_SETLKW: ::c_int = 9;
-pub const SIGHUP : ::c_int = 1;
-pub const SIGINT : ::c_int = 2;
-pub const SIGQUIT : ::c_int = 3;
-pub const SIGILL : ::c_int = 4;
-pub const SIGABRT : ::c_int = 6;
-pub const SIGEMT: ::c_int = 7;
-pub const SIGFPE : ::c_int = 8;
-pub const SIGKILL : ::c_int = 9;
-pub const SIGSEGV : ::c_int = 11;
-pub const SIGPIPE : ::c_int = 13;
-pub const SIGALRM : ::c_int = 14;
-pub const SIGTERM : ::c_int = 15;
-pub const SIGSTKSZ : ::size_t = 40960;
-
-pub const PROT_NONE : ::c_int = 0;
-pub const PROT_READ : ::c_int = 1;
-pub const PROT_WRITE : ::c_int = 2;
-pub const PROT_EXEC : ::c_int = 4;
-
-pub const MAP_FILE : ::c_int = 0x0000;
-pub const MAP_SHARED : ::c_int = 0x0001;
-pub const MAP_PRIVATE : ::c_int = 0x0002;
-pub const MAP_FIXED : ::c_int = 0x0010;
-pub const MAP_ANON : ::c_int = 0x1000;
-
-pub const MAP_FAILED : *mut ::c_void = !0 as *mut ::c_void;
-
-pub const MCL_CURRENT : ::c_int = 0x0001;
-pub const MCL_FUTURE : ::c_int = 0x0002;
-
-pub const MS_ASYNC : ::c_int = 0x0001;
-
-pub const EPERM : ::c_int = 1;
-pub const ENOENT : ::c_int = 2;
-pub const ESRCH : ::c_int = 3;
-pub const EINTR : ::c_int = 4;
-pub const EIO : ::c_int = 5;
-pub const ENXIO : ::c_int = 6;
-pub const E2BIG : ::c_int = 7;
-pub const ENOEXEC : ::c_int = 8;
-pub const EBADF : ::c_int = 9;
-pub const ECHILD : ::c_int = 10;
-pub const EDEADLK : ::c_int = 11;
-pub const ENOMEM : ::c_int = 12;
-pub const EACCES : ::c_int = 13;
-pub const EFAULT : ::c_int = 14;
-pub const ENOTBLK : ::c_int = 15;
-pub const EBUSY : ::c_int = 16;
-pub const EEXIST : ::c_int = 17;
-pub const EXDEV : ::c_int = 18;
-pub const ENODEV : ::c_int = 19;
-pub const ENOTDIR : ::c_int = 20;
-pub const EISDIR : ::c_int = 21;
-pub const EINVAL : ::c_int = 22;
-pub const ENFILE : ::c_int = 23;
-pub const EMFILE : ::c_int = 24;
-pub const ENOTTY : ::c_int = 25;
-pub const ETXTBSY : ::c_int = 26;
-pub const EFBIG : ::c_int = 27;
-pub const ENOSPC : ::c_int = 28;
-pub const ESPIPE : ::c_int = 29;
-pub const EROFS : ::c_int = 30;
-pub const EMLINK : ::c_int = 31;
-pub const EPIPE : ::c_int = 32;
-pub const EDOM : ::c_int = 33;
-pub const ERANGE : ::c_int = 34;
-pub const EAGAIN : ::c_int = 35;
-pub const EWOULDBLOCK : ::c_int = 35;
-pub const EINPROGRESS : ::c_int = 36;
-pub const EALREADY : ::c_int = 37;
-pub const ENOTSOCK : ::c_int = 38;
-pub const EDESTADDRREQ : ::c_int = 39;
-pub const EMSGSIZE : ::c_int = 40;
-pub const EPROTOTYPE : ::c_int = 41;
-pub const ENOPROTOOPT : ::c_int = 42;
-pub const EPROTONOSUPPORT : ::c_int = 43;
-pub const ESOCKTNOSUPPORT : ::c_int = 44;
-pub const EOPNOTSUPP : ::c_int = 45;
-pub const EPFNOSUPPORT : ::c_int = 46;
-pub const EAFNOSUPPORT : ::c_int = 47;
-pub const EADDRINUSE : ::c_int = 48;
-pub const EADDRNOTAVAIL : ::c_int = 49;
-pub const ENETDOWN : ::c_int = 50;
-pub const ENETUNREACH : ::c_int = 51;
-pub const ENETRESET : ::c_int = 52;
-pub const ECONNABORTED : ::c_int = 53;
-pub const ECONNRESET : ::c_int = 54;
-pub const ENOBUFS : ::c_int = 55;
-pub const EISCONN : ::c_int = 56;
-pub const ENOTCONN : ::c_int = 57;
-pub const ESHUTDOWN : ::c_int = 58;
-pub const ETOOMANYREFS : ::c_int = 59;
-pub const ETIMEDOUT : ::c_int = 60;
-pub const ECONNREFUSED : ::c_int = 61;
-pub const ELOOP : ::c_int = 62;
-pub const ENAMETOOLONG : ::c_int = 63;
-pub const EHOSTDOWN : ::c_int = 64;
-pub const EHOSTUNREACH : ::c_int = 65;
-pub const ENOTEMPTY : ::c_int = 66;
-pub const EPROCLIM : ::c_int = 67;
-pub const EUSERS : ::c_int = 68;
-pub const EDQUOT : ::c_int = 69;
-pub const ESTALE : ::c_int = 70;
-pub const EREMOTE : ::c_int = 71;
-pub const EBADRPC : ::c_int = 72;
-pub const ERPCMISMATCH : ::c_int = 73;
-pub const EPROGUNAVAIL : ::c_int = 74;
-pub const EPROGMISMATCH : ::c_int = 75;
-pub const EPROCUNAVAIL : ::c_int = 76;
-pub const ENOLCK : ::c_int = 77;
-pub const ENOSYS : ::c_int = 78;
-pub const EFTYPE : ::c_int = 79;
-pub const EAUTH : ::c_int = 80;
-pub const ENEEDAUTH : ::c_int = 81;
-
-pub const F_DUPFD : ::c_int = 0;
-pub const F_GETFD : ::c_int = 1;
-pub const F_SETFD : ::c_int = 2;
-pub const F_GETFL : ::c_int = 3;
-pub const F_SETFL : ::c_int = 4;
-
-pub const SIGTRAP : ::c_int = 5;
-
-pub const GLOB_APPEND   : ::c_int = 0x0001;
-pub const GLOB_DOOFFS   : ::c_int = 0x0002;
-pub const GLOB_ERR      : ::c_int = 0x0004;
-pub const GLOB_MARK     : ::c_int = 0x0008;
-pub const GLOB_NOCHECK  : ::c_int = 0x0010;
-pub const GLOB_NOSORT   : ::c_int = 0x0020;
-pub const GLOB_NOESCAPE : ::c_int = 0x1000;
-
-pub const GLOB_NOSPACE  : ::c_int = -1;
-pub const GLOB_ABORTED  : ::c_int = -2;
-pub const GLOB_NOMATCH  : ::c_int = -3;
-pub const GLOB_NOSYS : ::c_int = -4;
-
-pub const POSIX_MADV_NORMAL : ::c_int = 0;
-pub const POSIX_MADV_RANDOM : ::c_int = 1;
-pub const POSIX_MADV_SEQUENTIAL : ::c_int = 2;
-pub const POSIX_MADV_WILLNEED : ::c_int = 3;
-pub const POSIX_MADV_DONTNEED : ::c_int = 4;
-
-pub const _SC_XOPEN_SHM : ::c_int = 30;
-
-pub const PTHREAD_CREATE_JOINABLE : ::c_int = 0;
-pub const PTHREAD_CREATE_DETACHED : ::c_int = 1;
-
-// http://man.openbsd.org/OpenBSD-current/man2/clock_getres.2
-// The man page says clock_gettime(3) can accept various values as clockid_t but
-// http://fxr.watson.org/fxr/source/kern/kern_time.c?v=OPENBSD;im=excerpts#L161
-// the implementation rejects anything other than the below two
-//
-// http://netbsd.gw.com/cgi-bin/man-cgi?clock_gettime
-// https://github.com/jsonn/src/blob/HEAD/sys/kern/subr_time.c#L222
-// Basically the same goes for NetBSD
-pub const CLOCK_REALTIME: clockid_t = 0;
-pub const CLOCK_MONOTONIC: clockid_t = 3;
-
-pub const RLIMIT_CPU: ::c_int = 0;
-pub const RLIMIT_FSIZE: ::c_int = 1;
-pub const RLIMIT_DATA: ::c_int = 2;
-pub const RLIMIT_STACK: ::c_int = 3;
-pub const RLIMIT_CORE: ::c_int = 4;
-pub const RLIMIT_RSS: ::c_int = 5;
-pub const RLIMIT_MEMLOCK: ::c_int = 6;
-pub const RLIMIT_NPROC: ::c_int = 7;
-pub const RLIMIT_NOFILE: ::c_int = 8;
-
-pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
-pub const RLIM_SAVED_MAX: rlim_t = RLIM_INFINITY;
-pub const RLIM_SAVED_CUR: rlim_t = RLIM_INFINITY;
-
-pub const RUSAGE_SELF: ::c_int = 0;
-pub const RUSAGE_CHILDREN: ::c_int = -1;
-
-pub const MADV_NORMAL : ::c_int = 0;
-pub const MADV_RANDOM : ::c_int = 1;
-pub const MADV_SEQUENTIAL : ::c_int = 2;
-pub const MADV_WILLNEED : ::c_int = 3;
-pub const MADV_DONTNEED : ::c_int = 4;
-pub const MADV_FREE : ::c_int = 6;
-
-pub const AF_UNIX: ::c_int = 1;
-pub const AF_INET: ::c_int = 2;
-pub const AF_INET6: ::c_int = 24;
-pub const SOCK_STREAM: ::c_int = 1;
-pub const SOCK_DGRAM: ::c_int = 2;
-pub const SOCK_RAW: ::c_int = 3;
-pub const SOCK_SEQPACKET: ::c_int = 5;
-pub const IPPROTO_TCP: ::c_int = 6;
-pub const IPPROTO_IP: ::c_int = 0;
-pub const IPPROTO_IPV6: ::c_int = 41;
-pub const IP_MULTICAST_TTL: ::c_int = 10;
-pub const IP_MULTICAST_LOOP: ::c_int = 11;
-pub const IP_TTL: ::c_int = 4;
-pub const IP_HDRINCL: ::c_int = 2;
-pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
-pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
-
-pub const TCP_NODELAY: ::c_int = 0x01;
-pub const SOL_SOCKET: ::c_int = 0xffff;
-pub const SO_DEBUG: ::c_int = 0x01;
-pub const SO_ACCEPTCONN: ::c_int = 0x0002;
-pub const SO_REUSEADDR: ::c_int = 0x0004;
-pub const SO_KEEPALIVE: ::c_int = 0x0008;
-pub const SO_DONTROUTE: ::c_int = 0x0010;
-pub const SO_BROADCAST: ::c_int = 0x0020;
-pub const SO_USELOOPBACK: ::c_int = 0x0040;
-pub const SO_LINGER: ::c_int = 0x0080;
-pub const SO_OOBINLINE: ::c_int = 0x0100;
-pub const SO_REUSEPORT: ::c_int = 0x0200;
-pub const SO_SNDBUF: ::c_int = 0x1001;
-pub const SO_RCVBUF: ::c_int = 0x1002;
-pub const SO_SNDLOWAT: ::c_int = 0x1003;
-pub const SO_RCVLOWAT: ::c_int = 0x1004;
-pub const SO_ERROR: ::c_int = 0x1007;
-pub const SO_TYPE: ::c_int = 0x1008;
-
-pub const IFF_LOOPBACK: ::c_int = 0x8;
-
-pub const SHUT_RD: ::c_int = 0;
-pub const SHUT_WR: ::c_int = 1;
-pub const SHUT_RDWR: ::c_int = 2;
-
-pub const LOCK_SH: ::c_int = 1;
-pub const LOCK_EX: ::c_int = 2;
-pub const LOCK_NB: ::c_int = 4;
-pub const LOCK_UN: ::c_int = 8;
-
-pub const O_NONBLOCK : ::c_int = 4;
-
-pub const IPPROTO_RAW : ::c_int = 255;
-
-pub const _SC_ARG_MAX : ::c_int = 1;
-pub const _SC_CHILD_MAX : ::c_int = 2;
-pub const _SC_NGROUPS_MAX : ::c_int = 4;
-pub const _SC_OPEN_MAX : ::c_int = 5;
-pub const _SC_JOB_CONTROL : ::c_int = 6;
-pub const _SC_SAVED_IDS : ::c_int = 7;
-pub const _SC_VERSION : ::c_int = 8;
-pub const _SC_BC_BASE_MAX : ::c_int = 9;
-pub const _SC_BC_DIM_MAX : ::c_int = 10;
-pub const _SC_BC_SCALE_MAX : ::c_int = 11;
-pub const _SC_BC_STRING_MAX : ::c_int = 12;
-pub const _SC_COLL_WEIGHTS_MAX : ::c_int = 13;
-pub const _SC_EXPR_NEST_MAX : ::c_int = 14;
-pub const _SC_LINE_MAX : ::c_int = 15;
-pub const _SC_RE_DUP_MAX : ::c_int = 16;
-pub const _SC_2_VERSION : ::c_int = 17;
-pub const _SC_2_C_BIND : ::c_int = 18;
-pub const _SC_2_C_DEV : ::c_int = 19;
-pub const _SC_2_CHAR_TERM : ::c_int = 20;
-pub const _SC_2_FORT_DEV : ::c_int = 21;
-pub const _SC_2_FORT_RUN : ::c_int = 22;
-pub const _SC_2_LOCALEDEF : ::c_int = 23;
-pub const _SC_2_SW_DEV : ::c_int = 24;
-pub const _SC_2_UPE : ::c_int = 25;
-pub const _SC_STREAM_MAX : ::c_int = 26;
-pub const _SC_TZNAME_MAX : ::c_int = 27;
-pub const _SC_PAGESIZE : ::c_int = 28;
-pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
-pub const _SC_FSYNC : ::c_int = 29;
-
-pub const Q_GETQUOTA: ::c_int = 0x300;
-pub const Q_SETQUOTA: ::c_int = 0x400;
-
-pub const RTLD_GLOBAL: ::c_int = 0x100;
-
-pub const LOG_NFACILITIES: ::c_int = 24;
-
-pub const HW_NCPU: ::c_int = 3;
-
-pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
-
-f! {
-    pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
-        status >> 8
-    }
-
-    pub fn WIFSIGNALED(status: ::c_int) -> bool {
-        (status & 0o177) != 0o177 && (status & 0o177) != 0
-    }
-
-    pub fn WIFSTOPPED(status: ::c_int) -> bool {
-        (status & 0o177) == 0o177
-    }
-}
-
-#[link(name = "util")]
-extern {
-    pub fn mincore(addr: *mut ::c_void, len: ::size_t,
-                   vec: *mut ::c_char) -> ::c_int;
-    #[cfg_attr(target_os = "netbsd", link_name = "__clock_getres50")]
-    pub fn clock_getres(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
-    #[cfg_attr(target_os = "netbsd", link_name = "__clock_gettime50")]
-    pub fn clock_gettime(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
-    pub fn __errno() -> *mut ::c_int;
-    pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t)
-                    -> ::c_int;
-    pub fn memrchr(cx: *const ::c_void,
-                   c: ::c_int,
-                   n: ::size_t) -> *mut ::c_void;
-    pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
-    pub fn mkostemps(template: *mut ::c_char,
-                     suffixlen: ::c_int,
-                     flags: ::c_int) -> ::c_int;
-    pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
-    pub fn fdatasync(fd: ::c_int) -> ::c_int;
-    pub fn openpty(amaster: *mut ::c_int,
-                   aslave: *mut ::c_int,
-                   name: *mut ::c_char,
-                   termp: *mut termios,
-                   winp: *mut ::winsize) -> ::c_int;
-    pub fn forkpty(amaster: *mut ::c_int,
-                   name: *mut ::c_char,
-                   termp: *mut termios,
-                   winp: *mut ::winsize) -> ::pid_t;
-    pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
-    pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
-
-    pub fn openat(dirfd: ::c_int, pathname: *const ::c_char,
-                  flags: ::c_int, ...) -> ::c_int;
-    pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char,
-                     mode: ::c_int, flags: ::c_int) -> ::c_int;
-    pub fn fchmodat(dirfd: ::c_int, pathname: *const ::c_char,
-                    mode: ::mode_t, flags: ::c_int) -> ::c_int;
-    pub fn fchownat(dirfd: ::c_int, pathname: *const ::c_char,
-                    owner: ::uid_t, group: ::gid_t,
-                    flags: ::c_int) -> ::c_int;
-    pub fn fstatat(dirfd: ::c_int, pathname: *const ::c_char,
-                   buf: *mut stat, flags: ::c_int) -> ::c_int;
-    pub fn linkat(olddirfd: ::c_int, oldpath: *const ::c_char,
-                  newdirfd: ::c_int, newpath: *const ::c_char,
-                  flags: ::c_int) -> ::c_int;
-   pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char,
-                  mode: ::mode_t) -> ::c_int;
-   pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char,
-                 mode: ::mode_t, dev: dev_t) -> ::c_int;
-   pub fn readlinkat(dirfd: ::c_int, pathname: *const ::c_char,
-                     buf: *mut ::c_char, bufsiz: ::size_t) -> ::ssize_t;
-   pub fn renameat(olddirfd: ::c_int, oldpath: *const ::c_char,
-                   newdirfd: ::c_int, newpath: *const ::c_char)
-                   -> ::c_int;
-   pub fn symlinkat(target: *const ::c_char, newdirfd: ::c_int,
-                    linkpath: *const ::c_char) -> ::c_int;
-   pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char,
-                   flags: ::c_int) -> ::c_int;
-   pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
-                   mode: ::mode_t) -> ::c_int;
-   pub fn sem_timedwait(sem: *mut sem_t,
-                        abstime: *const ::timespec) -> ::c_int;
-   pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t,
-                                    clock_id: clockid_t) -> ::c_int;
-}
-
-cfg_if! {
-    if #[cfg(target_os = "bitrig")] {
-        mod bitrig;
-        pub use self::bitrig::*;
-    } else if #[cfg(target_os = "netbsd")] {
-        mod netbsd;
-        pub use self::netbsd::*;
-    } else if #[cfg(target_os = "openbsd")] {
-        mod openbsd;
-        pub use self::openbsd::*;
-    } else {
-        // Unknown target_os
-    }
-}
deleted file mode 100644
--- a/third_party/rust/libc/src/unix/bsd/openbsdlike/netbsd.rs
+++ /dev/null
@@ -1,614 +0,0 @@
-pub type clock_t = ::c_uint;
-pub type suseconds_t = ::c_int;
-pub type dev_t = u64;
-pub type blksize_t = ::int32_t;
-pub type fsblkcnt_t = ::uint64_t;
-pub type fsfilcnt_t = ::uint64_t;
-
-s! {
-    pub struct dirent {
-        pub d_fileno: ::ino_t,
-        pub d_reclen: u16,
-        pub d_namlen: u16,
-        pub d_type: u8,
-        pub d_name: [::c_char; 512],
-    }
-
-    pub struct glob_t {
-        pub gl_pathc:   ::size_t,
-        __unused1:      ::c_int,
-        pub gl_offs:    ::size_t,
-        __unused2:      ::c_int,
-        pub gl_pathv:   *mut *mut ::c_char,
-
-        __unused3: *mut ::c_void,
-
-        __unused4: *mut ::c_void,
-        __unused5: *mut ::c_void,
-        __unused6: *mut ::c_void,
-        __unused7: *mut ::c_void,
-        __unused8: *mut ::c_void,
-    }
-
-    pub struct sigset_t {
-        __bits: [u32; 4],
-    }
-
-    pub struct stat {
-        pub st_dev: ::dev_t,
-        pub st_mode: ::mode_t,
-        pub st_ino: ::ino_t,
-        pub st_nlink: ::nlink_t,
-        pub st_uid: ::uid_t,
-        pub st_gid: ::gid_t,
-        pub st_rdev: ::dev_t,
-        pub st_atime: ::time_t,
-        pub st_atimensec: ::c_long,
-        pub st_mtime: ::time_t,
-        pub st_mtimensec: ::c_long,
-        pub st_ctime: ::time_t,
-        pub st_ctimensec: ::c_long,
-        pub st_birthtime: ::time_t,
-        pub st_birthtimensec: ::c_long,
-        pub st_size: ::off_t,
-        pub st_blocks: ::blkcnt_t,
-        pub st_blksize: ::blksize_t,
-        pub st_flags: ::uint32_t,
-        pub st_gen: ::uint32_t,
-        pub st_spare: [::uint32_t; 2],
-    }
-
-    pub struct statvfs {
-        pub f_flag: ::c_ulong,
-        pub f_bsize: ::c_ulong,
-        pub f_frsize: ::c_ulong,
-        pub f_iosize: ::c_ulong,
-
-        pub f_blocks: ::fsblkcnt_t,
-        pub f_bfree: ::fsblkcnt_t,
-        pub f_bavail: ::fsblkcnt_t,
-        pub f_bresvd: ::fsblkcnt_t,
-
-        pub f_files: ::fsfilcnt_t,
-        pub f_ffree: ::fsfilcnt_t,
-        pub f_favail: ::fsfilcnt_t,
-        pub f_fresvd: ::fsfilcnt_t,
-
-        pub f_syncreads: ::uint64_t,
-        pub f_syncwrites: ::uint64_t,
-
-        pub f_asyncreads: ::uint64_t,
-        pub f_asyncwrites: ::uint64_t,
-
-        pub f_fsidx: ::fsid_t,
-        pub f_fsid: ::c_ulong,
-        pub f_namemax: ::c_ulong,
-        pub f_owner: ::uid_t,
-
-        pub f_spare: [::uint32_t; 4],
-
-        pub f_fstypename: [::c_char; 32],
-        pub f_mntonname: [::c_char; 1024],
-        pub f_mntfromname: [::c_char; 1024],
-    }
-
-    pub struct addrinfo {
-        pub ai_flags: ::c_int,
-        pub ai_family: ::c_int,
-        pub ai_socktype: ::c_int,
-        pub ai_protocol: ::c_int,
-        pub ai_addrlen: ::socklen_t,
-        pub ai_canonname: *mut ::c_char,
-        pub ai_addr: *mut ::sockaddr,
-        pub ai_next: *mut ::addrinfo,
-    }
-
-    pub struct sockaddr_storage {
-        pub ss_len: u8,
-        pub ss_family: ::sa_family_t,
-        __ss_pad1: [u8; 6],
-        __ss_pad2: i64,
-        __ss_pad3: [u8; 112],
-    }
-
-    pub struct siginfo_t {
-        pub si_signo: ::c_int,
-        pub si_code: ::c_int,
-        pub si_errno: ::c_int,
-        __pad1: ::c_int,
-        pub si_addr: *mut ::c_void,
-        __pad2: [u64; 13],
-    }
-
-    pub struct pthread_attr_t {
-        pta_magic: ::c_uint,
-        pta_flags: ::c_int,
-        pta_private: *mut ::c_void,
-    }
-
-    pub struct pthread_mutex_t {
-        ptm_magic: ::c_uint,
-        ptm_errorcheck: ::c_uchar,
-        ptm_pad1: [u8; 3],
-        ptm_interlock: ::c_uchar,
-        ptm_pad2: [u8; 3],
-        ptm_owner: ::pthread_t,
-        ptm_waiters: *mut u8,
-        ptm_recursed: ::c_uint,
-        ptm_spare2: *mut ::c_void,
-    }
-
-    pub struct pthread_mutexattr_t {
-        ptma_magic: ::c_uint,
-        ptma_private: *mut ::c_void,
-    }
-
-    pub struct pthread_cond_t {
-        ptc_magic: ::c_uint,
-        ptc_lock: ::c_uchar,
-        ptc_waiters_first: *mut u8,
-        ptc_waiters_last: *mut u8,
-        ptc_mutex: *mut ::pthread_mutex_t,
-        ptc_private: *mut ::c_void,
-    }
-
-    pub struct pthread_condattr_t {
-        ptca_magic: ::c_uint,
-        ptca_private: *mut ::c_void,
-    }
-
-    pub struct pthread_rwlock_t {
-        ptr_magic: ::c_uint,
-        ptr_interlock: ::c_uchar,
-        ptr_rblocked_first: *mut u8,
-        ptr_rblocked_last: *mut u8,
-        ptr_wblocked_first: *mut u8,
-        ptr_wblocked_last: *mut u8,
-        ptr_nreaders: ::c_uint,
-        ptr_owner: ::pthread_t,
-        ptr_private: *mut ::c_void,
-    }
-
-    pub struct kevent {
-        pub ident: ::uintptr_t,
-        pub filter: ::uint32_t,
-        pub flags: ::uint32_t,
-        pub fflags: ::uint32_t,
-        pub data: ::int64_t,
-        pub udata: ::intptr_t,
-    }
-
-    pub struct dqblk {
-        pub dqb_bhardlimit: ::uint32_t,
-        pub dqb_bsoftlimit: ::uint32_t,
-        pub dqb_curblocks: ::uint32_t,
-        pub dqb_ihardlimit: ::uint32_t,
-        pub dqb_isoftlimit: ::uint32_t,
-        pub dqb_curinodes: ::uint32_t,
-        pub dqb_btime: ::int32_t,
-        pub dqb_itime: ::int32_t,
-    }
-
-    pub struct Dl_info {
-        pub dli_fname: *const ::c_char,
-        pub dli_fbase: *mut ::c_void,
-        pub dli_sname: *const ::c_char,
-        pub dli_saddr: *const ::c_void,
-    }
-
-    pub struct lconv {
-        pub decimal_point: *mut ::c_char,
-        pub thousands_sep: *mut ::c_char,
-        pub grouping: *mut ::c_char,
-        pub int_curr_symbol: *mut ::c_char,
-        pub currency_symbol: *mut ::c_char,
-        pub mon_decimal_point: *mut ::c_char,
-        pub mon_thousands_sep: *mut ::c_char,
-        pub mon_grouping: *mut ::c_char,
-        pub positive_sign: *mut ::c_char,
-        pub negative_sign: *mut ::c_char,
-        pub int_frac_digits: ::c_char,
-        pub frac_digits: ::c_char,
-        pub p_cs_precedes: ::c_char,
-        pub p_sep_by_space: ::c_char,
-        pub n_cs_precedes: ::c_char,
-        pub n_sep_by_space: ::c_char,
-        pub p_sign_posn: ::c_char,
-        pub n_sign_posn: ::c_char,
-        pub int_p_cs_precedes: ::c_char,
-        pub int_n_cs_precedes: ::c_char,
-        pub int_p_sep_by_space: ::c_char,
-        pub int_n_sep_by_space: ::c_char,
-        pub int_p_sign_posn: ::c_char,
-        pub int_n_sign_posn: ::c_char,
-    }
-}
-
-pub const LC_COLLATE_MASK: ::c_int = (1 << ::LC_COLLATE);
-pub const LC_CTYPE_MASK: ::c_int = (1 << ::LC_CTYPE);
-pub const LC_MONETARY_MASK: ::c_int = (1 << ::LC_MONETARY);
-pub const LC_NUMERIC_MASK: ::c_int = (1 << ::LC_NUMERIC);
-pub const LC_TIME_MASK: ::c_int = (1 << ::LC_TIME);
-pub const LC_MESSAGES_MASK: ::c_int = (1 << ::LC_MESSAGES);
-pub const LC_ALL_MASK: ::c_int = !0;
-
-pub const ERA: ::nl_item = 52;
-pub const ERA_D_FMT: ::nl_item = 53;
-pub const ERA_D_T_FMT: ::nl_item = 54;
-pub const ERA_T_FMT: ::nl_item = 55;
-pub const ALT_DIGITS: ::nl_item = 56;
-
-pub const O_CLOEXEC: ::c_int = 0x400000;
-pub const O_ALT_IO: ::c_int = 0x40000;
-pub const O_NOSIGPIPE: ::c_int = 0x1000000;
-pub const O_SEARCH: ::c_int = 0x800000;
-pub const O_EXLOCK: ::c_int = 0x20;
-pub const O_SHLOCK: ::c_int = 0x10;
-pub const O_DIRECTORY: ::c_int = 0x200000;
-
-pub const MS_SYNC : ::c_int = 0x4;
-pub const MS_INVALIDATE : ::c_int = 0x2;
-
-pub const RLIM_NLIMITS: ::c_int = 12;
-
-pub const ENOATTR : ::c_int = 93;
-pub const EILSEQ : ::c_int = 85;
-pub const EOVERFLOW : ::c_int = 84;
-pub const ECANCELED : ::c_int = 87;
-pub const EIDRM : ::c_int = 82;
-pub const ENOMSG : ::c_int = 83;
-pub const ENOTSUP : ::c_int = 86;
-pub const ELAST : ::c_int = 96;
-
-pub const F_DUPFD_CLOEXEC : ::c_int = 12;
-pub const F_CLOSEM: ::c_int = 10;
-pub const F_GETNOSIGPIPE: ::c_int = 13;
-pub const F_SETNOSIGPIPE: ::c_int = 14;
-pub const F_MAXFD: ::c_int = 11;
-
-pub const IPV6_JOIN_GROUP: ::c_int = 12;
-pub const IPV6_LEAVE_GROUP: ::c_int = 13;
-
-pub const SO_SNDTIMEO: ::c_int = 0x100b;
-pub const SO_RCVTIMEO: ::c_int = 0x100c;
-
-pub const O_DSYNC : ::c_int = 0x10000;
-
-pub const MAP_RENAME : ::c_int = 0x20;
-pub const MAP_NORESERVE : ::c_int = 0x40;
-pub const MAP_HASSEMAPHORE : ::c_int = 0x200;
-pub const MAP_WIRED: ::c_int = 0x800;
-
-pub const _SC_IOV_MAX : ::c_int = 32;
-pub const _SC_GETGR_R_SIZE_MAX : ::c_int = 47;
-pub const _SC_GETPW_R_SIZE_MAX : ::c_int = 48;
-pub const _SC_LOGIN_NAME_MAX : ::c_int = 37;
-pub const _SC_MQ_PRIO_MAX : ::c_int = 55;
-pub const _SC_NPROCESSORS_ONLN : ::c_int = 1002;
-pub const _SC_THREADS : ::c_int = 41;
-pub const _SC_THREAD_ATTR_STACKADDR : ::c_int = 61;
-pub const _SC_THREAD_ATTR_STACKSIZE : ::c_int = 62;
-pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : ::c_int = 57;
-pub const _SC_THREAD_KEYS_MAX : ::c_int = 58;
-pub const _SC_THREAD_PRIO_INHERIT : ::c_int = 64;
-pub const _SC_THREAD_PRIO_PROTECT : ::c_int = 65;
-pub const _SC_THREAD_PRIORITY_SCHEDULING : ::c_int = 63;
-pub const _SC_THREAD_PROCESS_SHARED : ::c_int = 66;
-pub const _SC_THREAD_SAFE_FUNCTIONS : ::c_int = 67;
-pub const _SC_THREAD_STACK_MIN : ::c_int = 59;
-pub const _SC_THREAD_THREADS_MAX : ::c_int = 60;
-pub const _SC_TTY_NAME_MAX : ::c_int = 68;
-pub const _SC_ATEXIT_MAX : ::c_int = 40;
-pub const _SC_CLK_TCK : ::c_int = 39;
-pub const _SC_AIO_LISTIO_MAX : ::c_int = 51;
-pub const _SC_AIO_MAX : ::c_int = 52;
-pub const _SC_ASYNCHRONOUS_IO : ::c_int = 50;
-pub const _SC_MAPPED_FILES : ::c_int = 33;
-pub const _SC_MEMLOCK : ::c_int = 34;
-pub const _SC_MEMLOCK_RANGE : ::c_int = 35;
-pub const _SC_MEMORY_PROTECTION : ::c_int = 36;
-pub const _SC_MESSAGE_PASSING : ::c_int = 53;
-pub const _SC_MQ_OPEN_MAX : ::c_int = 54;
-pub const _SC_PRIORITY_SCHEDULING : ::c_int = 56;
-pub const _SC_SEMAPHORES : ::c_int = 42;
-pub const _SC_SHARED_MEMORY_OBJECTS : ::c_int = 87;
-pub const _SC_SYNCHRONIZED_IO : ::c_int = 31;
-pub const _SC_TIMERS : ::c_int = 44;
-pub const _SC_HOST_NAME_MAX : ::c_int = 69;
-
-pub const FD_SETSIZE: usize = 0x100;
-
-pub const ST_NOSUID: ::c_ulong = 8;
-
-pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
-    ptm_magic: 0x33330003,
-    ptm_errorcheck: 0,
-    ptm_interlock: 0,
-    ptm_waiters: 0 as *mut _,
-    ptm_owner: 0,
-    ptm_pad1: [0; 3],
-    ptm_pad2: [0; 3],
-    ptm_recursed: 0,
-    ptm_spare2: 0 as *mut _,
-};
-pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
-    ptc_magic: 0x55550005,
-    ptc_lock: 0,
-    ptc_waiters_first: 0 as *mut _,
-    ptc_waiters_last: 0 as *mut _,
-    ptc_mutex: 0 as *mut _,
-    ptc_private: 0 as *mut _,
-};
-pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
-    ptr_magic: 0x99990009,
-    ptr_interlock: 0,
-    ptr_rblocked_first: 0 as *mut _,
-    ptr_rblocked_last: 0 as *mut _,
-    ptr_wblocked_first: 0 as *mut _,
-    ptr_wblocked_last: 0 as *mut _,
-    ptr_nreaders: 0,
-    ptr_owner: 0,
-    ptr_private: 0 as *mut _,
-};
-pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
-pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
-pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
-pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
-
-pub const EVFILT_AIO: ::int32_t = 2;
-pub const EVFILT_PROC: ::int32_t = 4;
-pub const EVFILT_READ: ::int32_t = 0;
-pub const EVFILT_SIGNAL: ::int32_t = 5;
-pub const EVFILT_TIMER: ::int32_t = 6;
-pub const EVFILT_VNODE: ::int32_t = 3;
-pub const EVFILT_WRITE: ::int32_t = 1;
-
-pub const EV_ADD: ::uint32_t = 0x1;
-pub const EV_DELETE: ::uint32_t = 0x2;
-pub const EV_ENABLE: ::uint32_t = 0x4;
-pub const EV_DISABLE: ::uint32_t = 0x8;
-pub const EV_ONESHOT: ::uint32_t = 0x10;
-pub const EV_CLEAR: ::uint32_t = 0x20;
-pub const EV_RECEIPT: ::uint32_t = 0x40;
-pub const EV_DISPATCH: ::uint32_t = 0x80;
-pub const EV_FLAG1: ::uint32_t = 0x2000;
-pub const EV_ERROR: ::uint32_t = 0x4000;
-pub const EV_EOF: ::uint32_t = 0x8000;
-pub const EV_SYSFLAGS: ::uint32_t = 0xf000;
-
-pub const NOTE_LOWAT: ::uint32_t = 0x00000001;
-pub const NOTE_DELETE: ::uint32_t = 0x00000001;
-pub const NOTE_WRITE: ::uint32_t = 0x00000002;
-pub const NOTE_EXTEND: ::uint32_t = 0x00000004;
-pub const NOTE_ATTRIB: ::uint32_t = 0x00000008;
-pub const NOTE_LINK: ::uint32_t = 0x00000010;
-pub const NOTE_RENAME: ::uint32_t = 0x00000020;
-pub const NOTE_REVOKE: ::uint32_t = 0x00000040;
-pub const NOTE_EXIT: ::uint32_t = 0x80000000;
-pub const NOTE_FORK: ::uint32_t = 0x40000000;
-pub const NOTE_EXEC: ::uint32_t = 0x20000000;
-pub const NOTE_PDATAMASK: ::uint32_t = 0x000fffff;
-pub const NOTE_PCTRLMASK: ::uint32_t = 0xf0000000;
-pub const NOTE_TRACK: ::uint32_t = 0x00000001;
-pub const NOTE_TRACKERR: ::uint32_t = 0x00000002;
-pub const NOTE_CHILD: ::uint32_t = 0x00000004;
-
-pub const CRTSCTS: ::tcflag_t = 0x00010000;
-
-pub const TMP_MAX : ::c_uint = 308915776;
-
-pub const NI_MAXHOST: ::socklen_t = 1025;
-
-pub const RTLD_NOLOAD: ::c_int = 0x2000;
-pub const RTLD_LOCAL: ::c_int = 0x200;
-
-pub const CTL_MAXNAME: ::c_int = 12;
-pub const SYSCTL_NAMELEN: ::c_int = 32;
-pub const SYSCTL_DEFSIZE: ::c_int = 8;
-pub const CTLTYPE_NODE: ::c_int = 1;
-pub const CTLTYPE_INT: ::c_int = 2;
-pub const CTLTYPE_STRING: ::c_int = 3;
-pub const CTLTYPE_QUAD: ::c_int = 4;
-pub const CTLTYPE_STRUCT: ::c_int = 5;
-pub const CTLTYPE_BOOL: ::c_int = 6;
-pub const CTLFLAG_READONLY: ::c_int = 0x00000000;
-pub const CTLFLAG_READWRITE: ::c_int = 0x00000070;
-pub const CTLFLAG_ANYWRITE: ::c_int = 0x00000080;
-pub const CTLFLAG_PRIVATE: ::c_int = 0x00000100;
-pub const CTLFLAG_PERMANENT: ::c_int = 0x00000200;
-pub const CTLFLAG_OWNDATA: ::c_int = 0x00000400;
-pub const CTLFLAG_IMMEDIATE: ::c_int = 0x00000800;
-pub const CTLFLAG_HEX: ::c_int = 0x00001000;
-pub const CTLFLAG_ROOT: ::c_int = 0x00002000;
-pub const CTLFLAG_ANYNUMBER: ::c_int = 0x00004000;
-pub const CTLFLAG_HIDDEN: ::c_int = 0x00008000;
-pub const CTLFLAG_ALIAS: ::c_int = 0x00010000;
-pub const CTLFLAG_MMAP: ::c_int = 0x00020000;
-pub const CTLFLAG_OWNDESC: ::c_int = 0x00040000;
-pub const CTLFLAG_UNSIGNED: ::c_int = 0x00080000;
-pub const SYSCTL_VERS_MASK: ::c_int = 0xff000000;
-pub const SYSCTL_VERS_0: ::c_int = 0x00000000;
-pub const SYSCTL_VERS_1: ::c_int = 0x01000000;
-pub const SYSCTL_VERSION: ::c_int = SYSCTL_VERS_1;
-pub const CTL_EOL: ::c_int = -1;
-pub const CTL_QUERY: ::c_int = -2;
-pub const CTL_CREATE: ::c_int = -3;
-pub const CTL_CREATESYM: ::c_int = -4;
-pub const CTL_DESTROY: ::c_int = -5;
-pub const CTL_MMAP: ::c_int = -6;
-pub const CTL_DESCRIBE: ::c_int = -7;
-pub const CTL_UNSPEC: ::c_int = 0;
-pub const CTL_KERN: ::c_int = 1;
-pub const CTL_VM: ::c_int = 2;
-pub const CTL_VFS: ::c_int = 3;
-pub const CTL_NET: ::c_int = 4;
-pub const CTL_DEBUG: ::c_int = 5;
-pub const CTL_HW: ::c_int = 6;
-pub const CTL_MACHDEP: ::c_int = 7;
-pub const CTL_USER: ::c_int = 8;
-pub const CTL_DDB: ::c_int = 9;
-pub const CTL_PROC: ::c_int = 10;
-pub const CTL_VENDOR: ::c_int = 11;
-pub const CTL_EMUL: ::c_int = 12;
-pub const CTL_SECURITY: ::c_int = 13;
-pub const CTL_MAXID: ::c_int = 14;
-pub const KERN_OSTYPE: ::c_int = 1;
-pub const KERN_OSRELEASE: ::c_int = 2;
-pub const KERN_OSREV: ::c_int = 3;
-pub const KERN_VERSION: ::c_int = 4;
-pub const KERN_MAXVNODES: ::c_int = 5;
-pub const KERN_MAXPROC: ::c_int = 6;
-pub const KERN_MAXFILES: ::c_int = 7;
-pub const KERN_ARGMAX: ::c_int = 8;
-pub const KERN_SECURELVL: ::c_int = 9;
-pub const KERN_HOSTNAME: ::c_int = 10;
-pub const KERN_HOSTID: ::c_int = 11;
-pub const KERN_CLOCKRATE: ::c_int = 12;
-pub const KERN_VNODE: ::c_int = 13;
-pub const KERN_PROC: ::c_int = 14;
-pub const KERN_FILE: ::c_int = 15;
-pub const KERN_PROF: ::c_int = 16;
-pub const KERN_POSIX1: ::c_int = 17;
-pub const KERN_NGROUPS: ::c_int = 18;
-pub const KERN_JOB_CONTROL: ::c_int = 19;
-pub const KERN_SAVED_IDS: ::c_int = 20;
-pub const KERN_OBOOTTIME: ::c_int = 21;
-pub const KERN_DOMAINNAME: ::c_int = 22;
-pub const KERN_MAXPARTITIONS: ::c_int = 23;
-pub const KERN_RAWPARTITION: ::c_int = 24;
-pub const KERN_NTPTIME: ::c_int = 25;
-pub const KERN_TIMEX: ::c_int = 26;
-pub const KERN_AUTONICETIME: ::c_int = 27;
-pub const KERN_AUTONICEVAL: ::c_int = 28;
-pub const KERN_RTC_OFFSET: ::c_int = 29;
-pub const KERN_ROOT_DEVICE: ::c_int = 30;
-pub const KERN_MSGBUFSIZE: ::c_int = 31;
-pub const KERN_FSYNC: ::c_int = 32;
-pub const KERN_OLDSYSVMSG: ::c_int = 33;
-pub const KERN_OLDSYSVSEM: ::c_int = 34;
-pub const KERN_OLDSYSVSHM: ::c_int = 35;
-pub const KERN_OLDSHORTCORENAME: ::c_int = 36;
-pub const KERN_SYNCHRONIZED_IO: ::c_int = 37;
-pub const KERN_IOV_MAX: ::c_int = 38;
-pub const KERN_MBUF: ::c_int = 39;
-pub const KERN_MAPPED_FILES: ::c_int = 40;
-pub const KERN_MEMLOCK: ::c_int = 41;
-pub const KERN_MEMLOCK_RANGE: ::c_int = 42;
-pub const KERN_MEMORY_PROTECTION: ::c_int = 43;
-pub const KERN_LOGIN_NAME_MAX: ::c_int = 44;
-pub const KERN_DEFCORENAME: ::c_int = 45;
-pub const KERN_LOGSIGEXIT: ::c_int = 46;
-pub const KERN_PROC2: ::c_int = 47;
-pub const KERN_PROC_ARGS: ::c_int = 48;
-pub const KERN_FSCALE: ::c_int = 49;
-pub const KERN_CCPU: ::c_int = 50;
-pub const KERN_CP_TIME: ::c_int = 51;
-pub const KERN_OLDSYSVIPC_INFO: ::c_int = 52;
-pub const KERN_MSGBUF: ::c_int = 53;
-pub const KERN_CONSDEV: ::c_int = 54;
-pub const KERN_MAXPTYS: ::c_int = 55;
-pub const KERN_PIPE: ::c_int = 56;
-pub const KERN_MAXPHYS: ::c_int = 57;
-pub const KERN_SBMAX: ::c_int = 58;
-pub const KERN_TKSTAT: ::c_int = 59;
-pub const KERN_MONOTONIC_CLOCK: ::c_int = 60;
-pub const KERN_URND: ::c_int = 61;
-pub const KERN_LABELSECTOR: ::c_int = 62;
-pub const KERN_LABELOFFSET: ::c_int = 63;
-pub const KERN_LWP: ::c_int = 64;
-pub const KERN_FORKFSLEEP: ::c_int = 65;
-pub const KERN_POSIX_THREADS: ::c_int = 66;
-pub const KERN_POSIX_SEMAPHORES: ::c_int = 67;
-pub const KERN_POSIX_BARRIERS: ::c_int = 68;
-pub const KERN_POSIX_TIMERS: ::c_int = 69;
-pub const KERN_POSIX_SPIN_LOCKS: ::c_int = 70;
-pub const KERN_POSIX_READER_WRITER_LOCKS: ::c_int = 71;
-pub const KERN_DUMP_ON_PANIC: ::c_int = 72;
-pub const KERN_SOMAXKVA: ::c_int = 73;
-pub const KERN_ROOT_PARTITION: ::c_int = 74;
-pub const KERN_DRIVERS: ::c_int = 75;
-pub const KERN_BUF: ::c_int = 76;
-pub const KERN_FILE2: ::c_int = 77;
-pub const KERN_VERIEXEC: ::c_int = 78;
-pub const KERN_CP_ID: ::c_int = 79;
-pub const KERN_HARDCLOCK_TICKS: ::c_int = 80;
-pub const KERN_ARND: ::c_int = 81;
-pub const KERN_SYSVIPC: ::c_int = 82;
-pub const KERN_BOOTTIME: ::c_int = 83;
-pub const KERN_EVCNT: ::c_int = 84;
-pub const KERN_MAXID: ::c_int = 85;
-pub const KERN_PROC_ALL: ::c_int = 0;
-pub const KERN_PROC_PID: ::c_int = 1;
-pub const KERN_PROC_PGRP: ::c_int = 2;
-pub const KERN_PROC_SESSION: ::c_int = 3;
-pub const KERN_PROC_TTY: ::c_int = 4;
-pub const KERN_PROC_UID: ::c_int = 5;
-pub const KERN_PROC_RUID: ::c_int = 6;
-pub const KERN_PROC_GID: ::c_int = 7;
-pub const KERN_PROC_RGID: ::c_int = 8;
-
-extern {
-    pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
-    pub fn getnameinfo(sa: *const ::sockaddr,
-                       salen: ::socklen_t,
-                       host: *mut ::c_char,
-                       hostlen: ::socklen_t,
-                       serv: *mut ::c_char,
-                       sevlen: ::socklen_t,
-                       flags: ::c_int) -> ::c_int;
-    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
-                    -> ::c_int;
-    pub fn sysctl(name: *const ::c_int,
-                  namelen: ::c_uint,
-                  oldp: *mut ::c_void,
-                  oldlenp: *mut ::size_t,
-                  newp: *const ::c_void,
-                  newlen: ::size_t)
-                  -> ::c_int;
-    pub fn sysctlbyname(name: *const ::c_char,
-                        oldp: *mut ::c_void,
-                        oldlenp: *mut ::size_t,
-                        newp: *const ::c_void,
-                        newlen: ::size_t)
-                        -> ::c_int;
-    #[link_name = "__kevent50"]
-    pub fn kevent(kq: ::c_int,
-                  changelist: *const ::kevent,
-                  nchanges: ::size_t,
-                  eventlist: *mut ::kevent,
-                  nevents: ::size_t,
-                  timeout: *const ::timespec) -> ::c_int;
-    #[link_name = "__mount50"]
-    pub fn mount(src: *const ::c_char,
-                 target: *const ::c_char,
-                 flags: ::c_int,
-                 data: *mut ::c_void,
-                 size: ::size_t) -> ::c_int;
-    pub fn ptrace(requeset: ::c_int,
-                  pid: ::pid_t,
-                  addr: *mut ::c_void,
-                  data: ::c_int) -> ::c_int;
-    pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
-    pub fn pthread_setname_np(t: ::pthread_t,
-                              name: *const ::c_char,
-                              arg: *mut ::c_void) -> ::c_int;
-    pub fn pthread_getattr_np(native: ::pthread_t,
-                              attr: *mut ::pthread_attr_t) -> ::c_int;
-    pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t,
-                                     guardsize: *mut ::size_t) -> ::c_int;
-    pub fn pthread_attr_getstack(attr: *const ::pthread_attr_t,
-                                 stackaddr: *mut *mut ::c_void,
-                                 stacksize: *mut ::size_t) -> ::c_int;
-    #[link_name = "__sigtimedwait50"]
-    pub fn sigtimedwait(set: *const sigset_t,
-                        info: *mut siginfo_t,
-                        timeout: *const ::timespec) -> ::c_int;
-    pub fn sigwaitinfo(set: *const sigset_t,
-                       info: *mut siginfo_t) -> ::c_int;
-    pub fn duplocale(base: ::locale_t) -> ::locale_t;
-    pub fn freelocale(loc: ::locale_t);
-    pub fn localeconv_l(loc: ::locale_t) -> *mut lconv;
-    pub fn newlocale(mask: ::c_int,
-                     locale: *const ::c_char,
-                     base: ::locale_t) -> ::locale_t;
-}
deleted file mode 100644
--- a/third_party/rust/libc/src/unix/bsd/openbsdlike/openbsd.rs
+++ /dev/null
@@ -1,462 +0,0 @@
-pub type clock_t = i64;
-pub type suseconds_t = i64;
-pub type dev_t = i32;
-pub type sigset_t = ::c_uint;
-pub type blksize_t = ::int32_t;
-pub type fsblkcnt_t = ::uint64_t;
-pub type fsfilcnt_t = ::uint64_t;
-pub type pthread_attr_t = *mut ::c_void;
-pub type pthread_mutex_t = *mut ::c_void;
-pub type pthread_mutexattr_t = *mut ::c_void;
-pub type pthread_cond_t = *mut ::c_void;
-pub type pthread_condattr_t = *mut ::c_void;
-pub type pthread_rwlock_t = *mut ::c_void;
-
-s! {
-    pub struct dirent {
-        pub d_fileno: ::ino_t,
-        pub d_off: ::off_t,
-        pub d_reclen: u16,
-        pub d_type: u8,
-        pub d_namlen: u8,
-        __d_padding: [u8; 4],
-        pub d_name: [::c_char; 256],
-    }
-
-    pub struct glob_t {
-        pub gl_pathc:   ::c_int,
-        __unused1:      ::c_int,
-        pub gl_offs:    ::c_int,
-        __unused2:      ::c_int,
-        pub gl_pathv:   *mut *mut ::c_char,
-
-        __unused3: *mut ::c_void,
-
-        __unused4: *mut ::c_void,
-        __unused5: *mut ::c_void,
-        __unused6: *mut ::c_void,
-        __unused7: *mut ::c_void,
-        __unused8: *mut ::c_void,
-        __unused9: *mut ::c_void,
-    }
-
-    pub struct kevent {
-        pub ident: ::uintptr_t,
-        pub filter: ::c_short,
-        pub flags: ::c_ushort,
-        pub fflags: ::c_uint,
-        pub data: ::int64_t,
-        pub udata: *mut ::c_void,
-    }
-
-    pub struct stat {
-        pub st_mode: ::mode_t,
-        pub st_dev: ::dev_t,
-        pub st_ino: ::ino_t,
-        pub st_nlink: ::nlink_t,
-        pub st_uid: ::uid_t,
-        pub st_gid: ::gid_t,
-        pub st_rdev: ::dev_t,
-        pub st_atime: ::time_t,
-        pub st_atime_nsec: ::c_long,
-        pub st_mtime: ::time_t,
-        pub st_mtime_nsec: ::c_long,
-        pub st_ctime: ::time_t,
-        pub st_ctime_nsec: ::c_long,
-        pub st_size: ::off_t,
-        pub st_blocks: ::blkcnt_t,
-        pub st_blksize: ::blksize_t,
-        pub st_flags: ::uint32_t,
-        pub st_gen: ::uint32_t,
-        pub st_birthtime: ::time_t,
-        pub st_birthtime_nsec: ::c_long,
-    }
-
-    pub struct statvfs {
-        pub f_bsize: ::c_ulong,
-        pub f_frsize: ::c_ulong,
-        pub f_blocks: ::fsblkcnt_t,
-        pub f_bfree: ::fsblkcnt_t,
-        pub f_bavail: ::fsblkcnt_t,
-        pub f_files: ::fsfilcnt_t,
-        pub f_ffree: ::fsfilcnt_t,
-        pub f_favail: ::fsfilcnt_t,
-        pub f_fsid: ::c_ulong,
-        pub f_flag: ::c_ulong,
-        pub f_namemax: ::c_ulong,
-    }
-
-    pub struct addrinfo {
-        pub ai_flags: ::c_int,
-        pub ai_family: ::c_int,
-        pub ai_socktype: ::c_int,
-        pub ai_protocol: ::c_int,
-        pub ai_addrlen: ::socklen_t,
-        pub ai_addr: *mut ::sockaddr,
-        pub ai_canonname: *mut ::c_char,
-        pub ai_next: *mut ::addrinfo,
-    }
-
-    pub struct sockaddr_storage {
-        pub ss_len: u8,
-        pub ss_family: ::sa_family_t,
-        __ss_pad1: [u8; 6],
-        __ss_pad2: i64,
-        __ss_pad3: [u8; 240],
-    }
-
-    pub struct siginfo_t {
-        pub si_signo: ::c_int,
-        pub si_code: ::c_int,
-        pub si_errno: ::c_int,
-        pub si_addr: *mut ::c_char,
-        __pad: [u8; 108],
-    }
-
-    pub struct Dl_info {
-        pub dli_fname: *const ::c_char,
-        pub dli_fbase: *mut ::c_void,
-        pub dli_sname: *const ::c_char,
-        pub dli_saddr: *mut ::c_void,
-    }
-
-    pub struct lconv {
-        pub decimal_point: *mut ::c_char,
-        pub thousands_sep: *mut ::c_char,
-        pub grouping: *mut ::c_char,
-        pub int_curr_symbol: *mut ::c_char,
-        pub currency_symbol: *mut ::c_char,
-        pub mon_decimal_point: *mut ::c_char,
-        pub mon_thousands_sep: *mut ::c_char,
-        pub mon_grouping: *mut ::c_char,
-        pub positive_sign: *mut ::c_char,
-        pub negative_sign: *mut ::c_char,
-        pub int_frac_digits: ::c_char,
-        pub frac_digits: ::c_char,
-        pub p_cs_precedes: ::c_char,
-        pub p_sep_by_space: ::c_char,
-        pub n_cs_precedes: ::c_char,
-        pub n_sep_by_space: ::c_char,
-        pub p_sign_posn: ::c_char,
-        pub n_sign_posn: ::c_char,
-        pub int_p_cs_precedes: ::c_char,
-        pub int_p_sep_by_space: ::c_char,
-        pub int_n_cs_precedes: ::c_char,
-        pub int_n_sep_by_space: ::c_char,
-        pub int_p_sign_posn: ::c_char,
-        pub int_n_sign_posn: ::c_char,
-    }
-
-    pub struct lastlog {
-        ll_time: ::time_t,
-        ll_line: [::c_char; UT_LINESIZE],
-        ll_host: [::c_char; UT_HOSTSIZE],
-    }
-
-    pub struct utmp {
-        pub ut_line: [::c_char; UT_LINESIZE],
-        pub ut_name: [::c_char; UT_NAMESIZE],
-        pub ut_host: [::c_char; UT_HOSTSIZE],
-        pub ut_time: ::time_t,
-    }
-}
-
-pub const UT_NAMESIZE: usize = 32;
-pub const UT_LINESIZE: usize = 8;
-pub const UT_HOSTSIZE: usize = 256;
-
-pub const O_CLOEXEC: ::c_int = 0x10000;
-
-pub const MS_SYNC : ::c_int = 0x0002;
-pub const MS_INVALIDATE : ::c_int = 0x0004;
-
-pub const PTHREAD_STACK_MIN : ::size_t = 2048;
-
-pub const ENOATTR : ::c_int = 83;
-pub const EILSEQ : ::c_int = 84;
-pub const EOVERFLOW : ::c_int = 87;
-pub const ECANCELED : ::c_int = 88;
-pub const EIDRM : ::c_int = 89;
-pub const ENOMSG : ::c_int = 90;
-pub const ENOTSUP : ::c_int = 91;
-pub const ELAST : ::c_int = 91;
-
-pub const F_DUPFD_CLOEXEC : ::c_int = 10;
-
-pub const RLIM_NLIMITS: ::c_int = 9;
-
-pub const SO_SNDTIMEO: ::c_int = 0x1005;
-pub const SO_RCVTIMEO: ::c_int = 0x1006;
-
-pub const IPV6_JOIN_GROUP: ::c_int = 12;
-pub const IPV6_LEAVE_GROUP: ::c_int = 13;
-
-pub const O_DSYNC : ::c_int = 128;
-
-pub const MAP_RENAME : ::c_int = 0x0000;
-pub const MAP_NORESERVE : ::c_int = 0x0000;
-pub const MAP_HASSEMAPHORE : ::c_int = 0x0000;
-
-pub const EIPSEC : ::c_int = 82;
-pub const ENOMEDIUM : ::c_int = 85;
-pub const EMEDIUMTYPE : ::c_int = 86;
-
-pub const RUSAGE_THREAD: ::c_int = 1;
-
-pub const MAP_COPY : ::c_int = 0x0002;
-pub const MAP_NOEXTEND : ::c_int = 0x0000;
-
-pub const _SC_CLK_TCK : ::c_int = 3;
-pub const _SC_IOV_MAX : ::c_int = 51;
-pub const _SC_GETGR_R_SIZE_MAX : ::c_int = 100;
-pub const _SC_GETPW_R_SIZE_MAX : ::c_int = 101;
-pub const _SC_LOGIN_NAME_MAX : ::c_int = 102;
-pub const _SC_MQ_PRIO_MAX : ::c_int = 59;
-pub const _SC_NPROCESSORS_ONLN : ::c_int = 503;
-pub const _SC_THREADS : ::c_int = 91;
-pub const _SC_THREAD_ATTR_STACKADDR : ::c_int = 77;
-pub const _SC_THREAD_ATTR_STACKSIZE : ::c_int = 78;
-pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : ::c_int = 80;
-pub const _SC_THREAD_KEYS_MAX : ::c_int = 81;
-pub const _SC_THREAD_PRIO_INHERIT : ::c_int = 82;
-pub const _SC_THREAD_PRIO_PROTECT : ::c_int = 83;
-pub const _SC_THREAD_PRIORITY_SCHEDULING : ::c_int = 84;
-pub const _SC_THREAD_PROCESS_SHARED : ::c_int = 85;
-pub const _SC_THREAD_SAFE_FUNCTIONS : ::c_int = 103;
-pub const _SC_THREAD_STACK_MIN : ::c_int = 89;
-pub const _SC_THREAD_THREADS_MAX : ::c_int = 90;
-pub const _SC_TTY_NAME_MAX : ::c_int = 107;
-pub const _SC_ATEXIT_MAX : ::c_int = 46;
-pub const _SC_AIO_LISTIO_MAX : ::c_int = 42;
-pub const _SC_AIO_MAX : ::c_int = 43;
-pub const _SC_ASYNCHRONOUS_IO : ::c_int = 45;
-pub const _SC_MAPPED_FILES : ::c_int = 53;
-pub const _SC_MEMLOCK : ::c_int = 54;
-pub const _SC_MEMLOCK_RANGE : ::c_int = 55;
-pub const _SC_MEMORY_PROTECTION : ::c_int = 56;
-pub const _SC_MESSAGE_PASSING : ::c_int = 57;
-pub const _SC_MQ_OPEN_MAX : ::c_int = 58;
-pub const _SC_PRIORITY_SCHEDULING : ::c_int = 61;
-pub const _SC_SEMAPHORES : ::c_int = 67;
-pub const _SC_SHARED_MEMORY_OBJECTS : ::c_int = 68;
-pub const _SC_SYNCHRONIZED_IO : ::c_int = 75;
-pub const _SC_TIMERS : ::c_int = 94;
-pub const _SC_XOPEN_CRYPT : ::c_int = 117;
-pub const _SC_XOPEN_ENH_I18N : ::c_int = 118;
-pub const _SC_XOPEN_LEGACY : ::c_int = 119;
-pub const _SC_XOPEN_REALTIME : ::c_int = 120;
-pub const _SC_XOPEN_REALTIME_THREADS : ::c_int = 121;
-pub const _SC_XOPEN_UNIX : ::c_int = 123;
-pub const _SC_XOPEN_VERSION : ::c_int = 125;
-pub const _SC_SEM_NSEMS_MAX : ::c_int = 31;
-pub const _SC_SEM_VALUE_MAX : ::c_int = 32;
-pub const _SC_AIO_PRIO_DELTA_MAX : ::c_int = 44;
-pub const _SC_DELAYTIMER_MAX : ::c_int = 50;
-pub const _SC_PRIORITIZED_IO : ::c_int = 60;
-pub const _SC_REALTIME_SIGNALS : ::c_int = 64;
-pub const _SC_RTSIG_MAX : ::c_int = 66;
-pub const _SC_SIGQUEUE_MAX : ::c_int = 70;
-pub const _SC_TIMER_MAX : ::c_int = 93;
-pub const _SC_HOST_NAME_MAX : ::c_int = 33;
-
-pub const FD_SETSIZE: usize = 1024;
-
-pub const ST_NOSUID: ::c_ulong = 2;
-
-pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _;
-pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0 as *mut _;
-pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _;
-
-pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
-pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
-pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3;
-pub const PTHREAD_MUTEX_STRICT_NP: ::c_int = 4;
-pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_STRICT_NP;
-
-pub const EVFILT_AIO: ::int16_t = -3;
-pub const EVFILT_PROC: ::int16_t = -5;
-pub const EVFILT_READ: ::int16_t = -1;
-pub const EVFILT_SIGNAL: ::int16_t = -6;
-pub const EVFILT_TIMER: ::int16_t = -7;
-pub const EVFILT_VNODE: ::int16_t = -4;
-pub const EVFILT_WRITE: ::int16_t = -2;
-
-pub const EV_ADD: ::uint16_t = 0x1;
-pub const EV_DELETE: ::uint16_t = 0x2;
-pub const EV_ENABLE: ::uint16_t = 0x4;
-pub const EV_DISABLE: ::uint16_t = 0x8;
-pub const EV_ONESHOT: ::uint16_t = 0x10;
-pub const EV_CLEAR: ::uint16_t = 0x20;
-pub const EV_FLAG1: ::uint16_t = 0x2000;
-pub const EV_ERROR: ::uint16_t = 0x4000;
-pub const EV_EOF: ::uint16_t = 0x8000;
-pub const EV_SYSFLAGS: ::uint16_t = 0xf000;
-
-pub const NOTE_LOWAT: ::uint32_t = 0x00000001;
-pub const NOTE_EOF: ::uint32_t = 0x00000002;
-pub const NOTE_DELETE: ::uint32_t = 0x00000001;
-pub const NOTE_WRITE: ::uint32_t = 0x00000002;
-pub const NOTE_EXTEND: ::uint32_t = 0x00000004;
-pub const NOTE_ATTRIB: ::uint32_t = 0x00000008;
-pub const NOTE_LINK: ::uint32_t = 0x00000010;
-pub const NOTE_RENAME: ::uint32_t = 0x00000020;
-pub const NOTE_REVOKE: ::uint32_t = 0x00000040;
-pub const NOTE_TRUNCATE: ::uint32_t = 0x00000080;
-pub const NOTE_EXIT: ::uint32_t = 0x80000000;
-pub const NOTE_FORK: ::uint32_t = 0x40000000;
-pub const NOTE_EXEC: ::uint32_t = 0x20000000;
-pub const NOTE_PDATAMASK: ::uint32_t = 0x000fffff;
-pub const NOTE_PCTRLMASK: ::uint32_t = 0xf0000000;
-pub const NOTE_TRACK: ::uint32_t = 0x00000001;
-pub const NOTE_TRACKERR: ::uint32_t = 0x00000002;
-pub const NOTE_CHILD: ::uint32_t = 0x00000004;
-
-pub const TMP_MAX : ::c_uint = 0x7fffffff;
-
-pub const NI_MAXHOST: ::size_t = 256;
-
-pub const RTLD_LOCAL: ::c_int = 0;
-pub const CTL_MAXNAME: ::c_int = 12;
-pub const CTLTYPE_NODE: ::c_int = 1;
-pub const CTLTYPE_INT: ::c_int = 2;
-pub const CTLTYPE_STRING: ::c_int = 3;
-pub const CTLTYPE_QUAD: ::c_int = 4;
-pub const CTLTYPE_STRUCT: ::c_int = 5;
-pub const CTL_UNSPEC: ::c_int = 0;
-pub const CTL_KERN: ::c_int = 1;
-pub const CTL_VM: ::c_int = 2;
-pub const CTL_FS: ::c_int = 3;
-pub const CTL_NET: ::c_int = 4;
-pub const CTL_DEBUG: ::c_int = 5;
-pub const CTL_HW: ::c_int = 6;
-pub const CTL_MACHDEP: ::c_int = 7;
-pub const CTL_DDB: ::c_int = 9;
-pub const CTL_VFS: ::c_int = 10;
-pub const CTL_MAXID: ::c_int = 11;
-pub const KERN_OSTYPE: ::c_int = 1;
-pub const KERN_OSRELEASE: ::c_int = 2;
-pub const KERN_OSREV: ::c_int = 3;
-pub const KERN_VERSION: ::c_int = 4;
-pub const KERN_MAXVNODES: ::c_int = 5;
-pub const KERN_MAXPROC: ::c_int = 6;
-pub const KERN_MAXFILES: ::c_int = 7;
-pub const KERN_ARGMAX: ::c_int = 8;
-pub const KERN_SECURELVL: ::c_int = 9;
-pub const KERN_HOSTNAME: ::c_int = 10;
-pub const KERN_HOSTID: ::c_int = 11;
-pub const KERN_CLOCKRATE: ::c_int = 12;
-pub const KERN_PROF: ::c_int = 16;
-pub const KERN_POSIX1: ::c_int = 17;
-pub const KERN_NGROUPS: ::c_int = 18;
-pub const KERN_JOB_CONTROL: ::c_int = 19;
-pub const KERN_SAVED_IDS: ::c_int = 20;
-pub const KERN_BOOTTIME: ::c_int = 21;
-pub const KERN_DOMAINNAME: ::c_int = 22;
-pub const KERN_MAXPARTITIONS: ::c_int = 23;
-pub const KERN_RAWPARTITION: ::c_int = 24;
-pub const KERN_MAXTHREAD: ::c_int = 25;
-pub const KERN_NTHREADS: ::c_int = 26;
-pub const KERN_OSVERSION: ::c_int = 27;
-pub const KERN_SOMAXCONN: ::c_int = 28;
-pub const KERN_SOMINCONN: ::c_int = 29;
-pub const KERN_USERMOUNT: ::c_int = 30;
-pub const KERN_RND: ::c_int = 31;
-pub const KERN_NOSUIDCOREDUMP: ::c_int = 32;
-pub const KERN_FSYNC: ::c_int = 33;
-pub const KERN_SYSVMSG: ::c_int = 34;
-pub const KERN_SYSVSEM: ::c_int = 35;
-pub const KERN_SYSVSHM: ::c_int = 36;
-pub const KERN_ARND: ::c_int = 37;
-pub const KERN_MSGBUFSIZE: ::c_int = 38;
-pub const KERN_MALLOCSTATS: ::c_int = 39;
-pub const KERN_CPTIME: ::c_int = 40;
-pub const KERN_NCHSTATS: ::c_int = 41;
-pub const KERN_FORKSTAT: ::c_int = 42;
-pub const KERN_NSELCOLL: ::c_int = 43;
-pub const KERN_TTY: ::c_int = 44;
-pub const KERN_CCPU: ::c_int = 45;
-pub const KERN_FSCALE: ::c_int = 46;
-pub const KERN_NPROCS: ::c_int = 47;
-pub const KERN_MSGBUF: ::c_int = 48;
-pub const KERN_POOL: ::c_int = 49;
-pub const KERN_STACKGAPRANDOM: ::c_int = 50;
-pub const KERN_SYSVIPC_INFO: ::c_int = 51;
-pub const KERN_SPLASSERT: ::c_int = 54;
-pub const KERN_PROC_ARGS: ::c_int = 55;
-pub const KERN_NFILES: ::c_int = 56;
-pub const KERN_TTYCOUNT: ::c_int = 57;
-pub const KERN_NUMVNODES: ::c_int = 58;
-pub const KERN_MBSTAT: ::c_int = 59;
-pub const KERN_SEMINFO: ::c_int = 61;
-pub const KERN_SHMINFO: ::c_int = 62;
-pub const KERN_INTRCNT: ::c_int = 63;
-pub const KERN_WATCHDOG: ::c_int = 64;
-pub const KERN_PROC: ::c_int = 66;
-pub const KERN_MAXCLUSTERS: ::c_int = 67;
-pub const KERN_EVCOUNT: ::c_int = 68;
-pub const KERN_TIMECOUNTER: ::c_int = 69;
-pub const KERN_MAXLOCKSPERUID: ::c_int = 70;
-pub const KERN_CPTIME2: ::c_int = 71;
-pub const KERN_CACHEPCT: ::c_int = 72;
-pub const KERN_FILE: ::c_int = 73;
-pub const KERN_CONSDEV: ::c_int = 75;
-pub const KERN_NETLIVELOCKS: ::c_int = 76;
-pub const KERN_POOL_DEBUG: ::c_int = 77;
-pub const KERN_PROC_CWD: ::c_int = 78;
-pub const KERN_PROC_NOBROADCASTKILL: ::c_int = 79;
-pub const KERN_PROC_VMMAP: ::c_int = 80;
-pub const KERN_GLOBAL_PTRACE: ::c_int = 81;
-pub const KERN_CONSBUFSIZE: ::c_int = 82;
-pub const KERN_CONSBUF: ::c_int = 83;
-pub const KERN_MAXID: ::c_int = 84;
-pub const KERN_PROC_ALL: ::c_int = 0;
-pub const KERN_PROC_PID: ::c_int = 1;
-pub const KERN_PROC_PGRP: ::c_int = 2;
-pub const KERN_PROC_SESSION: ::c_int = 3;
-pub const KERN_PROC_TTY: ::c_int = 4;
-pub const KERN_PROC_UID: ::c_int = 5;
-pub const KERN_PROC_RUID: ::c_int = 6;
-pub const KERN_PROC_KTHREAD: ::c_int = 7;
-pub const KERN_PROC_SHOW_THREADS: ::c_int = 0x40000000;
-pub const KERN_SYSVIPC_MSG_INFO: ::c_int = 1;
-pub const KERN_SYSVIPC_SEM_INFO: ::c_int = 2;
-pub const KERN_SYSVIPC_SHM_INFO: ::c_int = 3;
-pub const KERN_PROC_ARGV: ::c_int = 1;
-pub const KERN_PROC_NARGV: ::c_int = 2;
-pub const KERN_PROC_ENV: ::c_int = 3;
-pub const KERN_PROC_NENV: ::c_int = 4;
-pub const KI_NGROUPS: ::c_int = 16;
-pub const KI_MAXCOMLEN: ::c_int = 24;
-pub const KI_WMESGLEN: ::c_int = 8;
-pub const KI_MAXLOGNAME: ::c_int = 32;
-pub const KI_EMULNAMELEN: ::c_int = 8;
-
-extern {
-    pub fn getnameinfo(sa: *const ::sockaddr,
-                       salen: ::socklen_t,
-                       host: *mut ::c_char,
-                       hostlen: ::size_t,
-                       serv: *mut ::c_char,
-                       servlen: ::size_t,
-                       flags: ::c_int) -> ::c_int;
-    pub fn kevent(kq: ::c_int,
-                  changelist: *const ::kevent,
-                  nchanges: ::c_int,
-                  eventlist: *mut ::kevent,
-                  nevents: ::c_int,
-                  timeout: *const ::timespec) -> ::c_int;
-    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
-                    -> ::c_int;
-    pub fn pthread_main_np() -> ::c_int;
-    pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
-    pub fn pthread_stackseg_np(thread: ::pthread_t,
-                               sinfo: *mut ::stack_t) -> ::c_int;
-    pub fn sysctl(name: *const ::c_int,
-                  namelen: ::c_uint,
-                  oldp: *mut ::c_void,
-                  oldlenp: *mut ::size_t,
-                  newp: *mut ::c_void,
-                  newlen: ::size_t)
-                  -> ::c_int;
-    pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
-}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/src/unix/haiku/b32.rs
@@ -0,0 +1,2 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/src/unix/haiku/b64.rs
@@ -0,0 +1,2 @@
+pub type c_ulong = u64;
+pub type c_long = i64;
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/src/unix/haiku/mod.rs
@@ -0,0 +1,748 @@
+use dox::mem;
+
+pub type rlim_t = ::uintptr_t;
+pub type sa_family_t = u8;
+pub type pthread_key_t = ::c_int;
+pub type nfds_t = ::c_long;
+pub type tcflag_t = ::c_uint;
+pub type speed_t = ::c_uint;
+pub type c_char = i8;
+pub type clock_t = i32;
+pub type clockid_t = i32;
+pub type time_t = i32;
+pub type suseconds_t = i32;
+pub type wchar_t = i32;
+pub type off_t = i64;
+pub type ino_t = i64;
+pub type blkcnt_t = i64;
+pub type blksize_t = i32;
+pub type dev_t = i32;
+pub type mode_t = u32;
+pub type nlink_t = i32;
+pub type useconds_t = u32;
+pub type socklen_t = u32;
+pub type pthread_t = ::uintptr_t;
+pub type pthread_mutexattr_t = ::uintptr_t;
+pub type sigset_t = u64;
+pub type fsblkcnt_t = i64;
+pub type fsfilcnt_t = i64;
+pub type pthread_attr_t = *mut ::c_void;
+pub type nl_item = ::c_int;
+
+pub enum timezone {}
+
+s! {
+    pub struct sockaddr {
+        pub sa_len: u8,
+        pub sa_family: sa_family_t,
+        pub sa_data: [::c_char; 30],
+    }
+
+    pub struct sockaddr_in {
+        pub sin_len: u8,
+        pub sin_family: sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [u8; 24],
+    }
+
+    pub struct sockaddr_in6 {
+        pub sin6_len: u8,
+        pub sin6_family: sa_family_t,
+        pub sin6_port: ::in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: u32,
+    }
+
+    pub struct sockaddr_un {
+        pub sun_len: u8,
+        pub sun_family: sa_family_t,
+        pub sun_path: [::c_char; 126]
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_len: u8,
+        pub ss_family: sa_family_t,
+        __ss_pad1: [u8; 6],
+        __ss_pad2: u64,
+        __ss_pad3: [u8; 112],
+    }
+
+    pub struct addrinfo {
+        pub ai_flags: ::c_int,
+        pub ai_family: ::c_int,
+        pub ai_socktype: ::c_int,
+        pub ai_protocol: ::c_int,
+        pub ai_addrlen: socklen_t,
+        pub ai_canonname: *mut c_char,
+        pub ai_addr: *mut ::sockaddr,
+        pub ai_next: *mut addrinfo,
+    }
+
+    pub struct fd_set {
+        fds_bits: [c_ulong; FD_SETSIZE / ULONG_SIZE],
+    }
+
+    pub struct tm {
+        pub tm_sec: ::c_int,
+        pub tm_min: ::c_int,
+        pub tm_hour: ::c_int,
+        pub tm_mday: ::c_int,
+        pub tm_mon: ::c_int,
+        pub tm_year: ::c_int,
+        pub tm_wday: ::c_int,
+        pub tm_yday: ::c_int,
+        pub tm_isdst: ::c_int,
+        pub tm_gmtoff: ::c_long,
+        pub tm_zone: *const ::c_char,
+    }
+
+    pub struct utsname {
+        pub sysname: [::c_char; 32],
+        pub nodename: [::c_char; 32],
+        pub release: [::c_char; 32],
+        pub version: [::c_char; 32],
+        pub machine: [::c_char; 32],
+    }
+
+    pub struct lconv {
+        pub decimal_point: *mut ::c_char,
+        pub thousands_sep: *mut ::c_char,
+        pub grouping: *mut ::c_char,
+        pub int_curr_symbol: *mut ::c_char,
+        pub currency_symbol: *mut ::c_char,
+        pub mon_decimal_point: *mut ::c_char,
+        pub mon_thousands_sep: *mut ::c_char,
+        pub mon_grouping: *mut ::c_char,
+        pub positive_sign: *mut ::c_char,
+        pub negative_sign: *mut ::c_char,
+        pub int_frac_digits: ::c_char,
+        pub frac_digits: ::c_char,
+        pub p_cs_precedes: ::c_char,
+        pub p_sep_by_space: ::c_char,
+        pub n_cs_precedes: ::c_char,
+        pub n_sep_by_space: ::c_char,
+        pub p_sign_posn: ::c_char,
+        pub n_sign_posn: ::c_char,
+        pub int_p_cs_precedes: ::c_char,
+        pub int_p_sep_by_space: ::c_char,
+        pub int_n_cs_precedes: ::c_char,
+        pub int_n_sep_by_space: ::c_char,
+        pub int_p_sign_posn: ::c_char,
+        pub int_n_sign_posn: ::c_char,
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::c_int,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: ::socklen_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct Dl_info {
+        pub dli_fname: *const ::c_char,
+        pub dli_fbase: *mut ::c_void,
+        pub dli_sname: *const ::c_char,
+        pub dli_saddr: *mut ::c_void,
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line:  ::c_char,
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::speed_t,
+        pub c_cc: [::cc_t; ::NCCS],
+    }
+
+    pub struct stat {
+        pub st_dev: dev_t,
+        pub st_ino: ino_t,
+        pub st_mode: mode_t,
+        pub st_nlink: nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_size: off_t,
+        pub st_rdev: dev_t,
+        pub st_blksize: blksize_t,
+        pub st_atime: time_t,
+        pub st_atime_nsec: c_long,
+        pub st_mtime: time_t,
+        pub st_mtime_nsec: c_long,
+        pub st_ctime: time_t,
+        pub st_ctime_nsec: c_long,
+        pub st_crtime: time_t,
+        pub st_crtime_nsec: c_long,
+        pub st_type: u32,
+        pub st_blocks: blkcnt_t,
+    }
+
+    pub struct dirent {
+        pub d_dev: dev_t,
+        pub d_pdev: dev_t,
+        pub d_ino: ino_t,
+        pub d_pino: i64,
+        pub d_reclen: ::c_ushort,
+        pub d_name: [::c_char; 1024], // Max length is _POSIX_PATH_MAX
+    }
+
+    pub struct glob_t {
+        pub gl_pathc: ::size_t,
+        __unused1: ::size_t,
+        pub gl_offs: ::size_t,
+        __unused2: ::size_t,
+        pub gl_pathv: *mut *mut c_char,
+
+        __unused3: *mut ::c_void,
+        __unused4: *mut ::c_void,
+        __unused5: *mut ::c_void,
+        __unused6: *mut ::c_void,
+        __unused7: *mut ::c_void,
+        __unused8: *mut ::c_void,
+    }
+
+    pub struct pthread_mutex_t {
+        flags: u32,
+        lock: i32,
+        unused: i32,
+        owner: i32,
+        owner_count: i32,
+    }
+
+    pub struct pthread_cond_t {
+        flags: u32,
+        unused: i32,
+        mutex: *mut ::c_void,
+        waiter_count: i32,
+        lock: i32,
+    }
+
+    pub struct pthread_rwlock_t {
+        flags: u32,
+        owner: i32,
+        lock_sem: i32,      // this is actually a union
+        lock_count: i32,
+        reader_count: i32,
+        writer_count: i32,
+        waiters: [*mut ::c_void; 2],
+    }
+
+    pub struct passwd {
+        pub pw_name: *mut ::c_char,
+        pub pw_passwd: *mut ::c_char,
+        pub pw_uid: ::uid_t,
+        pub pw_gid: ::gid_t,
+        pub pw_dir: *mut ::c_char,
+        pub pw_shell: *mut ::c_char,
+        pub pw_gecos: *mut ::c_char,
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_code: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_pid: ::pid_t,
+        pub si_uid: ::uid_t,
+        pub si_addr: *mut ::c_void,
+        pub si_status: ::c_int,
+        pub si_band: c_long,
+        pub sigval: *mut ::c_void,
+    }
+
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        sa_userdata: *mut ::c_void,
+    }
+
+    pub struct sem_t {
+        pub se_type: i32,
+        pub se_named_id: i32, // this is actually a union
+        pub se_unnamed: i32,
+        pub se_padding: [i32; 4],
+    }
+
+    pub struct pthread_condattr_t {
+        pub process_shared: bool,
+        pub clock_id: i32,
+    }
+}
+
+// intentionally not public, only used for fd_set
+cfg_if! {
+    if #[cfg(target_pointer_width = "32")] {
+        const ULONG_SIZE: usize = 32;
+    } else if #[cfg(target_pointer_width = "64")] {
+        const ULONG_SIZE: usize = 64;
+    } else {
+        // Unknown target_pointer_width
+    }
+}
+
+pub const EXIT_FAILURE: ::c_int = 1;
+pub const EXIT_SUCCESS: ::c_int = 0;
+pub const RAND_MAX: ::c_int = 2147483647;
+pub const EOF: ::c_int = -1;
+pub const SEEK_SET: ::c_int = 0;
+pub const SEEK_CUR: ::c_int = 1;
+pub const SEEK_END: ::c_int = 2;
+pub const _IOFBF: ::c_int = 0;
+pub const _IONBF: ::c_int = 2;
+pub const _IOLBF: ::c_int = 1;
+
+pub const F_DUPFD: ::c_int = 0x0001;
+pub const F_GETFD: ::c_int = 0x0002;
+pub const F_SETFD: ::c_int = 0x0004;
+pub const F_GETFL: ::c_int = 0x0008;
+pub const F_SETFL: ::c_int = 0x0010;
+
+pub const SIGTRAP: ::c_int = 22;
+
+pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
+pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
+
+pub const CLOCK_REALTIME: ::c_int = -1;
+pub const CLOCK_MONOTONIC: ::c_int = 0;
+
+pub const RLIMIT_CORE: ::c_int = 0;
+pub const RLIMIT_CPU: ::c_int = 1;
+pub const RLIMIT_DATA: ::c_int = 2;
+pub const RLIMIT_FSIZE: ::c_int = 3;
+pub const RLIMIT_NOFILE: ::c_int = 4;
+pub const RLIMIT_AS: ::c_int = 6;
+// Haiku specific
+pub const RLIMIT_NOVMON: ::c_int = 7;
+pub const RLIMIT_NLIMITS: ::c_int = 8;
+
+pub const RUSAGE_SELF: ::c_int = 0;
+
+pub const NCCS: usize = 11;
+
+pub const O_RDONLY: ::c_int = 0x0000;
+pub const O_WRONLY: ::c_int = 0x0001;
+pub const O_RDWR: ::c_int = 0x0002;
+pub const O_ACCMODE: ::c_int = 0x0003;
+
+pub const O_EXCL: ::c_int = 0x0100;
+pub const O_CREAT: ::c_int = 0x0200;
+pub const O_TRUNC: ::c_int = 0x0400;
+pub const O_NOCTTY: ::c_int = 0x1000;
+pub const O_NOTRAVERSE: ::c_int = 0x2000;
+
+pub const O_CLOEXEC: ::c_int = 0x00000040;
+pub const O_NONBLOCK: ::c_int = 0x00000080;
+pub const O_APPEND: ::c_int = 0x00000800;
+pub const O_SYNC: ::c_int = 0x00010000;
+pub const O_RSYNC: ::c_int = 0x00020000;
+pub const O_DSYNC: ::c_int = 0x00040000;
+pub const O_NOFOLLOW: ::c_int = 0x00080000;
+pub const O_NOCACHE: ::c_int = 0x00100000;
+pub const O_DIRECTORY: ::c_int = 0x00200000;
+
+pub const S_IFIFO: ::mode_t = 61440;
+pub const S_IFCHR: ::mode_t = 49152;
+pub const S_IFBLK: ::mode_t = 24576;
+pub const S_IFDIR: ::mode_t = 16384;
+pub const S_IFREG: ::mode_t = 32768;
+pub const S_IFLNK: ::mode_t = 40960;
+pub const S_IFSOCK: ::mode_t = 49152;
+pub const S_IFMT: ::mode_t = 61440;
+pub const S_IRWXU: ::mode_t = 448;
+pub const S_IXUSR: ::mode_t = 64;
+pub const S_IWUSR: ::mode_t = 128;
+pub const S_IRUSR: ::mode_t = 256;
+pub const S_IRWXG: ::mode_t = 70;
+pub const S_IXGRP: ::mode_t = 10;
+pub const S_IWGRP: ::mode_t = 20;
+pub const S_IRGRP: ::mode_t = 40;
+pub const S_IRWXO: ::mode_t = 7;
+pub const S_IXOTH: ::mode_t = 1;
+pub const S_IWOTH: ::mode_t = 2;
+pub const S_IROTH: ::mode_t = 4;
+pub const F_OK: ::c_int = 0;
+pub const R_OK: ::c_int = 4;
+pub const W_OK: ::c_int = 2;
+pub const X_OK: ::c_int = 1;
+pub const STDIN_FILENO: ::c_int = 0;
+pub const STDOUT_FILENO: ::c_int = 1;
+pub const STDERR_FILENO: ::c_int = 2;
+pub const SIGHUP: ::c_int = 1;
+pub const SIGINT: ::c_int = 2;
+pub const SIGQUIT: ::c_int = 3;
+pub const SIGILL: ::c_int = 4;
+pub const SIGABRT: ::c_int = 6;
+pub const SIGFPE: ::c_int = 8;
+pub const SIGKILL: ::c_int = 9;
+pub const SIGSEGV: ::c_int = 11;
+pub const SIGPIPE: ::c_int = 7;
+pub const SIGALRM: ::c_int = 14;
+pub const SIGTERM: ::c_int = 15;
+
+pub const EAI_SYSTEM: ::c_int = 11;
+
+pub const PROT_NONE: ::c_int = 0;
+pub const PROT_READ: ::c_int = 1;
+pub const PROT_WRITE: ::c_int = 2;
+pub const PROT_EXEC: ::c_int = 4;
+
+pub const LC_ALL: ::c_int = 0;
+pub const LC_COLLATE: ::c_int = 1;
+pub const LC_CTYPE: ::c_int = 2;
+pub const LC_MONETARY: ::c_int = 3;
+pub const LC_NUMERIC: ::c_int = 4;
+pub const LC_TIME: ::c_int = 5;
+pub const LC_MESSAGES: ::c_int = 6;
+
+// TODO: Haiku does not have MAP_FILE, but libstd/os.rs requires it
+pub const MAP_FILE: ::c_int = 0x00;
+pub const MAP_SHARED: ::c_int = 0x01;
+pub const MAP_PRIVATE: ::c_int = 0x02;
+pub const MAP_FIXED: ::c_int = 0x004;
+
+pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
+
+pub const MS_ASYNC: ::c_int = 0x01;
+pub const MS_INVALIDATE: ::c_int = 0x04;
+pub const MS_SYNC: ::c_int = 0x02;
+
+pub const EPERM : ::c_int = -2147483633;
+pub const ENOENT : ::c_int = -2147459069;
+pub const ESRCH : ::c_int = -2147454963;
+pub const EINTR : ::c_int = -2147483638;
+pub const EIO : ::c_int = -2147483647;
+pub const ENXIO : ::c_int = -2147454965;
+pub const E2BIG : ::c_int = -2147454975;
+pub const ENOEXEC : ::c_int = -2147478782;
+pub const EBADF : ::c_int = -2147459072;
+pub const ECHILD : ::c_int = -2147454974;
+pub const EDEADLK : ::c_int = -2147454973;
+pub const ENOMEM : ::c_int = -2147454976;
+pub const EACCES : ::c_int = -2147483646;
+pub const EFAULT : ::c_int = -2147478783;
+// pub const ENOTBLK : ::c_int = 15;
+pub const EBUSY : ::c_int = -2147483634;
+pub const EEXIST : ::c_int = -2147459070;
+pub const EXDEV : ::c_int = -2147459061;
+pub const ENODEV : ::c_int = -2147454969;
+pub const ENOTDIR : ::c_int = -2147459067;
+pub const EISDIR : ::c_int = -2147459063;
+pub const EINVAL : ::c_int = -2147483643;
+pub const ENFILE : ::c_int = -2147454970;
+pub const EMFILE : ::c_int = -2147459062;
+pub const ENOTTY : ::c_int = -2147454966;
+pub const ETXTBSY : ::c_int = -2147454917;
+pub const EFBIG : ::c_int = -2147454972;
+pub const ENOSPC : ::c_int = -2147459065;
+pub const ESPIPE : ::c_int = -2147454964;
+pub const EROFS : ::c_int = -2147459064;
+pub const EMLINK : ::c_int = -2147454971;
+pub const EPIPE : ::c_int = -2147459059;
+pub const EDOM : ::c_int = -2147454960;
+pub const ERANGE : ::c_int = -2147454959;
+pub const EAGAIN : ::c_int = -2147483637;
+pub const EWOULDBLOCK : ::c_int = -2147483637;
+
+pub const EINPROGRESS : ::c_int = -2147454940;
+pub const EALREADY : ::c_int = -2147454939;
+pub const ENOTSOCK : ::c_int = -2147454932;
+pub const EDESTADDRREQ : ::c_int = -2147454928;
+pub const EMSGSIZE : ::c_int = -2147454934;
+pub const EPROTOTYPE : ::c_int = -2147454958;
+pub const ENOPROTOOPT : ::c_int = -2147454942;
+pub const EPROTONOSUPPORT : ::c_int = -2147454957;
+pub const EOPNOTSUPP : ::c_int = -2147454933;
+pub const EPFNOSUPPORT : ::c_int = -2147454956;
+pub const EAFNOSUPPORT : ::c_int = -2147454955;
+pub const EADDRINUSE : ::c_int = -2147454954;
+pub const EADDRNOTAVAIL : ::c_int = -2147454953;
+pub const ENETDOWN : ::c_int = -2147454953;
+pub const ENETUNREACH : ::c_int = -2147454951;
+pub const ENETRESET : ::c_int = -2147454950;
+pub const ECONNABORTED : ::c_int = -2147454949;
+pub const ECONNRESET : ::c_int = -2147454948;
+pub const ENOBUFS : ::c_int = -2147454941;
+pub const EISCONN : ::c_int = -2147454947;
+pub const ENOTCONN : ::c_int = -2147454946;
+pub const ESHUTDOWN : ::c_int = -2147454945;
+pub const ETIMEDOUT : ::c_int = -2147483639;
+pub const ECONNREFUSED : ::c_int = -2147454944;
+pub const ELOOP : ::c_int = -2147459060;
+pub const ENAMETOOLONG : ::c_int = -2147459068;
+pub const EHOSTDOWN : ::c_int = -2147454931;
+pub const EHOSTUNREACH : ::c_int = -2147454943;
+pub const ENOTEMPTY : ::c_int = -2147459066;
+pub const EDQUOT : ::c_int = -2147454927;
+pub const ESTALE : ::c_int = -2147454936;
+pub const ENOLCK : ::c_int = -2147454968;
+pub const ENOSYS : ::c_int = -2147454967;
+pub const EIDRM : ::c_int = -2147454926;
+pub const ENOMSG : ::c_int = -2147454937;
+pub const EOVERFLOW : ::c_int = -2147454935;
+pub const ECANCELED : ::c_int = -2147454929;
+pub const EILSEQ : ::c_int = -2147454938;
+pub const ENOATTR : ::c_int = -2147454916;
+pub const EBADMSG : ::c_int = -2147454930;
+pub const EMULTIHOP : ::c_int = -2147454925;
+pub const ENOLINK : ::c_int = -2147454923;
+pub const EPROTO : ::c_int = -2147454919;
+
+pub const IPPROTO_RAW: ::c_int = 255;
+
+// These are prefixed with POSIX_ on Haiku
+pub const MADV_NORMAL: ::c_int = 1;
+pub const MADV_SEQUENTIAL: ::c_int = 2;
+pub const MADV_RANDOM: ::c_int = 3;
+pub const MADV_WILLNEED: ::c_int = 4;
+pub const MADV_DONTNEED: ::c_int = 5;
+
+pub const IFF_LOOPBACK: ::c_int = 0x0008;
+
+pub const AF_UNIX: ::c_int = 9;
+pub const AF_INET: ::c_int = 1;
+pub const AF_INET6: ::c_int = 6;
+pub const SOCK_RAW: ::c_int = 3;
+pub const IPPROTO_TCP: ::c_int = 6;
+pub const IPPROTO_IP: ::c_int = 0;
+pub const IPPROTO_IPV6: ::c_int = 41;
+pub const IP_MULTICAST_TTL: ::c_int = 10;
+pub const IP_MULTICAST_LOOP: ::c_int = 11;
+pub const IP_TTL: ::c_int = 4;
+pub const IP_HDRINCL: ::c_int = 2;
+pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
+pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
+
+pub const TCP_NODELAY: ::c_int = 0x01;
+pub const TCP_MAXSEG: ::c_int = 0x02;
+pub const TCP_NOPUSH: ::c_int = 0x04;
+pub const TCP_NOOPT: ::c_int = 0x08;
+
+pub const IPV6_MULTICAST_LOOP: ::c_int = 26;
+pub const IPV6_JOIN_GROUP: ::c_int = 28;
+pub const IPV6_LEAVE_GROUP: ::c_int = 29;
+pub const IPV6_V6ONLY: ::c_int = 30;
+
+pub const SO_DEBUG: ::c_int = 0x00000004;
+
+pub const MSG_NOSIGNAL: ::c_int = 0x0800;
+
+pub const SHUT_RD: ::c_int = 0;
+pub const SHUT_WR: ::c_int = 1;
+pub const SHUT_RDWR: ::c_int = 2;
+
+pub const LOCK_SH: ::c_int = 0x01;
+pub const LOCK_EX: ::c_int = 0x02;
+pub const LOCK_NB: ::c_int = 0x04;
+pub const LOCK_UN: ::c_int = 0x08;
+
+pub const SIGSTKSZ: ::size_t = 16384;
+
+pub const SA_NODEFER: ::c_int = 0x08;
+pub const SA_RESETHAND: ::c_int = 0x04;
+pub const SA_RESTART: ::c_int = 0x10;
+pub const SA_NOCLDSTOP: ::c_int = 0x01;
+
+pub const FD_SETSIZE: usize = 1024;
+
+pub const RTLD_NOW: ::c_int = 0x1;
+pub const RTLD_DEFAULT: *mut ::c_void = 0isize as *mut ::c_void;
+
+pub const BUFSIZ: ::c_uint = 8192;
+pub const FILENAME_MAX: ::c_uint = 256;
+pub const FOPEN_MAX: ::c_uint = 128;
+pub const L_tmpnam: ::c_uint = 512;
+pub const TMP_MAX: ::c_uint = 32768;
+pub const _PC_NAME_MAX: ::c_int = 4;
+
+pub const FIONBIO: ::c_int = 0xbe000000;
+
+pub const _SC_IOV_MAX : ::c_int = 32;
+pub const _SC_GETGR_R_SIZE_MAX : ::c_int = 25;
+pub const _SC_GETPW_R_SIZE_MAX : ::c_int = 26;
+pub const _SC_PAGESIZE : ::c_int = 27;
+pub const _SC_THREAD_ATTR_STACKADDR : ::c_int = 48;
+pub const _SC_THREAD_ATTR_STACKSIZE : ::c_int = 49;
+pub const _SC_THREAD_PRIORITY_SCHEDULING : ::c_int = 50;
+pub const _SC_THREAD_PROCESS_SHARED : ::c_int = 46;
+pub const _SC_THREAD_STACK_MIN : ::c_int = 47;
+pub const _SC_THREADS : ::c_int = 31;
+pub const _SC_ATEXIT_MAX : ::c_int = 37;
+
+pub const PTHREAD_STACK_MIN: ::size_t = 8192;
+
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+    flags: 0,
+    lock: 0,
+    unused: -42,
+    owner: -1,
+    owner_count: 0,
+};
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+    flags: 0,
+    unused: -42,
+    mutex: 0 as *mut _,
+    waiter_count: 0,
+    lock: 0,
+};
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+    flags: 0,
+    owner: 0,
+    lock_sem: 0,
+    lock_count: 0,
+    reader_count: 0,
+    writer_count: 0,
+    waiters: [0 as *mut _; 2],
+};
+
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = 0;
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 1;
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 3;
+
+pub const FIOCLEX: c_ulong = 0; // TODO: does not exist on Haiku!
+
+pub const SA_ONSTACK: c_ulong = 0x20;
+pub const SA_SIGINFO: c_ulong = 0x40;
+pub const SA_NOCLDWAIT: c_ulong = 0x02;
+
+pub const SIGCHLD: ::c_int = 5;
+pub const SIGBUS: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 3;
+
+pub const RUSAGE_CHILDREN: ::c_int = -1;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const SOL_SOCKET: ::c_int = -1;
+pub const SO_ACCEPTCONN: ::c_int = 0x00000001;
+pub const SO_BROADCAST: ::c_int = 0x00000002;
+pub const SO_DONTROUTE: ::c_int = 0x00000008;
+pub const SO_KEEPALIVE: ::c_int = 0x00000010;
+pub const SO_OOBINLINE: ::c_int = 0x00000020;
+pub const SO_REUSEADDR: ::c_int = 0x00000040;
+pub const SO_REUSEPORT: ::c_int = 0x00000080;
+pub const SO_USELOOPBACK: ::c_int = 0x00000100;
+pub const SO_LINGER: ::c_int = 0x00000200;
+pub const SO_SNDBUF: ::c_int = 0x40000001;
+pub const SO_SNDLOWAT: ::c_int = 0x40000002;
+pub const SO_SNDTIMEO: ::c_int = 0x40000003;
+pub const SO_RCVBUF: ::c_int = 0x40000004;
+pub const SO_RCVLOWAT: ::c_int = 0x40000005;
+pub const SO_RCVTIMEO: ::c_int = 0x40000006;
+pub const SO_ERROR: ::c_int = 0x40000007;
+pub const SO_TYPE: ::c_int = 0x40000008;
+pub const SO_NONBLOCK: ::c_int = 0x40000009;
+pub const SO_BINDTODEVICE: ::c_int = 0x4000000a;
+pub const SO_PEERCRED: ::c_int = 0x4000000b;
+
+pub const NI_MAXHOST: ::size_t = 1025;
+
+f! {
+    pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
+        let fd = fd as usize;
+        let size = mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        (*set).fds_bits[fd / size] &= !(1 << (fd % size));
+        return
+    }
+
+    pub fn FD_ISSET(fd: ::c_int, set: *mut fd_set) -> bool {
+        let fd = fd as usize;
+        let size = mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
+    }
+
+    pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
+        let fd = fd as usize;
+        let size = mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        (*set).fds_bits[fd / size] |= 1 << (fd % size);
+        return
+    }
+
+    pub fn FD_ZERO(set: *mut fd_set) -> () {
+        for slot in (*set).fds_bits.iter_mut() {
+            *slot = 0;
+        }
+    }
+
+    pub fn WIFEXITED(status: ::c_int) -> bool {
+        (status >> 8) == 0
+    }
+
+    pub fn WEXITSTATUS(status: ::c_int) -> ::c_int {
+        (status & 0xff)
+    }
+
+    pub fn WTERMSIG(status: ::c_int) -> ::c_int {
+        (status >> 8) & 0xff
+    }
+}
+
+extern {
+    pub fn clock_gettime(clk_id: ::c_int, tp: *mut ::timespec) -> ::c_int;
+    pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t,
+                                     guardsize: *mut ::size_t) -> ::c_int;
+    pub fn pthread_attr_getstack(attr: *const ::pthread_attr_t,
+                                 stackaddr: *mut *mut ::c_void,
+                                 stacksize: *mut ::size_t) -> ::c_int;
+    pub fn pthread_condattr_getclock(attr: *const pthread_condattr_t,
+                                     clock_id: *mut clockid_t) -> ::c_int;
+    pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t,
+                                     clock_id: clockid_t) -> ::c_int;
+    pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
+    pub fn setgroups(ngroups: ::size_t,
+                     ptr: *const ::gid_t) -> ::c_int;
+    pub fn getpwuid_r(uid: ::uid_t,
+                      pwd: *mut passwd,
+                      buffer: *mut ::c_char,
+                      bufferSize: ::size_t,
+                      result: *mut *mut passwd) -> ::c_int;
+    pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
+    pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int)
+                    -> ::c_int;
+    pub fn getnameinfo(sa: *const ::sockaddr,
+                       salen: ::socklen_t,
+                       host: *mut ::c_char,
+                       hostlen: ::size_t,
+                       serv: *mut ::c_char,
+                       sevlen: ::size_t,
+                       flags: ::c_int) -> ::c_int;
+    pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t,
+                                   abstime: *const ::timespec) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(target_pointer_width = "64")] {
+        mod b64;
+        pub use self::b64::*;
+    } else {
+        mod b32;
+        pub use self::b32::*;
+    }
+}
--- a/third_party/rust/libc/src/unix/mod.rs
+++ b/third_party/rust/libc/src/unix/mod.rs
@@ -114,16 +114,21 @@ s! {
         pub ws_xpixel: ::c_ushort,
         pub ws_ypixel: ::c_ushort,
     }
 
     pub struct linger {
         pub l_onoff: ::c_int,
         pub l_linger: ::c_int,
     }
+
+    pub struct sigval {
+        // Actually a union of an int and a void*
+        pub sival_ptr: *mut ::c_void
+    }
 }
 
 pub const SIG_DFL: sighandler_t = 0 as sighandler_t;
 pub const SIG_IGN: sighandler_t = 1 as sighandler_t;
 pub const SIG_ERR: sighandler_t = !0 as sighandler_t;
 
 pub const DT_FIFO: u8 = 1;
 pub const DT_CHR: u8 = 2;
@@ -200,17 +205,18 @@ pub const PRIO_MAX: ::c_int = 20;
 
 cfg_if! {
     if #[cfg(dox)] {
         // on dox builds don't pull in anything
     } else if #[cfg(all(not(stdbuild), feature = "use_std"))] {
         // cargo build, don't pull in anything extra as the libstd  dep
         // already pulls in all libs.
     } else if #[cfg(any(all(target_env = "musl", not(target_arch = "mips"))))] {
-        #[link(name = "c", kind = "static")]
+        #[link(name = "c", kind = "static", cfg(target_feature = "crt-static"))]
+        #[link(name = "c", cfg(not(target_feature = "crt-static")))]
         extern {}
     } else if #[cfg(target_os = "emscripten")] {
         #[link(name = "c")]
         extern {}
     } else if #[cfg(all(target_os = "netbsd", target_vendor = "rumprun"))] {
         // Since we don't use -nodefaultlibs on Rumprun, libc is always pulled
         // in automatically by the linker. We avoid passing it explicitly, as it
         // causes some versions of binutils to crash with an assertion failure.
@@ -219,16 +225,24 @@ cfg_if! {
     } else if #[cfg(any(target_os = "macos",
                         target_os = "ios",
                         target_os = "android",
                         target_os = "openbsd",
                         target_os = "bitrig"))] {
         #[link(name = "c")]
         #[link(name = "m")]
         extern {}
+    } else if #[cfg(target_os = "haiku")] {
+        #[link(name = "root")]
+        #[link(name = "network")]
+        extern {}
+    } else if #[cfg(target_os = "fuchsia")] {
+        #[link(name = "c")]
+        #[link(name = "mxio")]
+        extern {}
     } else {
         #[link(name = "c")]
         #[link(name = "m")]
         #[link(name = "rt")]
         extern {}
     }
 }
 
@@ -246,16 +260,18 @@ extern {
                    format: *const ::c_char, ...) -> ::c_int;
     pub fn printf(format: *const ::c_char, ...) -> ::c_int;
     pub fn snprintf(s: *mut ::c_char, n: ::size_t,
                     format: *const ::c_char, ...) -> ::c_int;
     pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int;
     pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
     pub fn scanf(format: *const ::c_char, ...) -> ::c_int;
     pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int;
+    pub fn getchar_unlocked() -> ::c_int;
+    pub fn putchar_unlocked(c: ::c_int) -> ::c_int;
 
     #[cfg_attr(target_os = "netbsd", link_name = "__socket30")]
     pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int;
     #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
                link_name = "connect$UNIX2003")]
     pub fn connect(socket: ::c_int, address: *const sockaddr,
                    len: socklen_t) -> ::c_int;
     #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
@@ -410,16 +426,17 @@ extern {
                link_name = "sleep$UNIX2003")]
     pub fn sleep(secs: ::c_uint) -> ::c_uint;
     #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
                link_name = "nanosleep$UNIX2003")]
     #[cfg_attr(target_os = "netbsd", link_name = "__nanosleep50")]
     pub fn nanosleep(rqtp: *const timespec,
                      rmtp: *mut timespec) -> ::c_int;
     pub fn tcgetpgrp(fd: ::c_int) -> pid_t;
+    pub fn tcsetpgrp(fd: ::c_int, pgrp: ::pid_t) -> ::c_int;
     pub fn ttyname(fd: ::c_int) -> *mut c_char;
     pub fn unlink(c: *const c_char) -> ::c_int;
     #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
                link_name = "wait$UNIX2003")]
     pub fn wait(status: *mut ::c_int) -> pid_t;
     #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
                link_name = "waitpid$UNIX2003")]
     pub fn waitpid(pid: pid_t, status: *mut ::c_int, options: ::c_int)
@@ -638,16 +655,20 @@ extern {
     #[cfg_attr(target_os = "netbsd", link_name = "__gmtime_r50")]
     pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
     #[cfg_attr(target_os = "netbsd", link_name = "__localtime_r50")]
     pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
     #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
                link_name = "mktime$UNIX2003")]
     #[cfg_attr(target_os = "netbsd", link_name = "__mktime50")]
     pub fn mktime(tm: *mut tm) -> time_t;
+    #[cfg_attr(target_os = "netbsd", link_name = "__time50")]
+    pub fn time(time: *mut time_t) -> time_t;
+    #[cfg_attr(target_os = "netbsd", link_name = "__locatime50")]
+    pub fn localtime(time: *const time_t) -> *mut tm;
 
     #[cfg_attr(target_os = "netbsd", link_name = "__mknod50")]
     pub fn mknod(pathname: *const ::c_char, mode: ::mode_t,
                  dev: ::dev_t) -> ::c_int;
     #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
                link_name = "writev$UNIX2003")]
     pub fn writev(fd: ::c_int,
                   iov: *const ::iovec,
@@ -715,18 +736,16 @@ extern {
                     pshared: ::c_int,
                     value: ::c_uint)
                     -> ::c_int;
 }
 
 // TODO: get rid of this cfg(not(...))
 #[cfg(not(target_os = "android"))] // " if " -- appease style checker
 extern {
-    pub fn getifaddrs(ifap: *mut *mut ifaddrs) -> ::c_int;
-    pub fn freeifaddrs(ifa: *mut ifaddrs);
     #[cfg_attr(target_os = "macos", link_name = "glob$INODE64")]
     #[cfg_attr(target_os = "netbsd", link_name = "__glob30")]
     pub fn glob(pattern: *const c_char,
                 flags: ::c_int,
                 errfunc: Option<extern fn(epath: *const c_char,
                                           errno: ::c_int) -> ::c_int>,
                 pglob: *mut glob_t) -> ::c_int;
     #[cfg_attr(target_os = "netbsd", link_name = "__globfree30")]
@@ -820,32 +839,41 @@ extern {
 
     pub fn openlog(ident: *const ::c_char, logopt: ::c_int, facility: ::c_int);
     pub fn closelog();
     pub fn setlogmask(maskpri: ::c_int) -> ::c_int;
     pub fn syslog(priority: ::c_int, message: *const ::c_char, ...);
     #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
                link_name = "nice$UNIX2003")]
     pub fn nice(incr: ::c_int) -> ::c_int;
+
+    pub fn grantpt(fd: ::c_int) -> ::c_int;
+    pub fn posix_openpt(flags: ::c_int) -> ::c_int;
+    pub fn ptsname(fd: ::c_int) -> *mut ::c_char;
+    pub fn unlockpt(fd: ::c_int) -> ::c_int;
 }
 
 cfg_if! {
     if #[cfg(any(target_os = "linux",
                  target_os = "android",
-                 target_os = "emscripten"))] {
+                 target_os = "emscripten",
+                 target_os = "fuchsia"))] {
         mod notbsd;
         pub use self::notbsd::*;
     } else if #[cfg(any(target_os = "macos",
                         target_os = "ios",
                         target_os = "freebsd",
                         target_os = "dragonfly",
                         target_os = "openbsd",
                         target_os = "netbsd",
                         target_os = "bitrig"))] {
         mod bsd;
         pub use self::bsd::*;
     } else if #[cfg(target_os = "solaris")] {
         mod solaris;
         pub use self::solaris::*;
+    } else if #[cfg(target_os = "haiku")] {
+        mod haiku;
+        pub use self::haiku::*;
     } else {
         // Unknown target_os
     }
 }
--- a/third_party/rust/libc/src/unix/notbsd/android/mod.rs
+++ b/third_party/rust/libc/src/unix/notbsd/android/mod.rs
@@ -326,16 +326,17 @@ pub const EUSERS: ::c_int = 87;
 pub const ENOTSOCK: ::c_int = 88;
 pub const EDESTADDRREQ: ::c_int = 89;
 pub const EMSGSIZE: ::c_int = 90;
 pub const EPROTOTYPE: ::c_int = 91;
 pub const ENOPROTOOPT: ::c_int = 92;
 pub const EPROTONOSUPPORT: ::c_int = 93;
 pub const ESOCKTNOSUPPORT: ::c_int = 94;
 pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
 pub const EPFNOSUPPORT: ::c_int = 96;
 pub const EAFNOSUPPORT: ::c_int = 97;
 pub const EADDRINUSE: ::c_int = 98;
 pub const EADDRNOTAVAIL: ::c_int = 99;
 pub const ENETDOWN: ::c_int = 100;
 pub const ENETUNREACH: ::c_int = 101;
 pub const ENETRESET: ::c_int = 102;
 pub const ECONNABORTED: ::c_int = 103;
@@ -575,16 +576,79 @@ pub const ECHOK: ::tcflag_t = 0x00000020
 pub const ECHONL: ::tcflag_t = 0x00000040;
 pub const ECHOPRT: ::tcflag_t = 0x00000400;
 pub const ECHOCTL: ::tcflag_t = 0x00000200;
 pub const ISIG: ::tcflag_t = 0x00000001;
 pub const ICANON: ::tcflag_t = 0x00000002;
 pub const PENDIN: ::tcflag_t = 0x00004000;
 pub const NOFLSH: ::tcflag_t = 0x00000080;
 
+pub const EAI_SYSTEM: ::c_int = 11;
+
+pub const NETLINK_ROUTE: ::c_int = 0;
+pub const NETLINK_UNUSED: ::c_int = 1;
+pub const NETLINK_USERSOCK: ::c_int = 2;
+pub const NETLINK_FIREWALL: ::c_int = 3;
+pub const NETLINK_SOCK_DIAG: ::c_int = 4;
+pub const NETLINK_NFLOG: ::c_int = 5;
+pub const NETLINK_XFRM: ::c_int = 6;
+pub const NETLINK_SELINUX: ::c_int = 7;
+pub const NETLINK_ISCSI: ::c_int = 8;
+pub const NETLINK_AUDIT: ::c_int = 9;
+pub const NETLINK_FIB_LOOKUP: ::c_int = 10;
+pub const NETLINK_CONNECTOR: ::c_int = 11;
+pub const NETLINK_NETFILTER: ::c_int = 12;
+pub const NETLINK_IP6_FW: ::c_int = 13;
+pub const NETLINK_DNRTMSG: ::c_int = 14;
+pub const NETLINK_KOBJECT_UEVENT: ::c_int = 15;
+pub const NETLINK_GENERIC: ::c_int = 16;
+pub const NETLINK_SCSITRANSPORT: ::c_int = 18;
+pub const NETLINK_ECRYPTFS: ::c_int = 19;
+pub const NETLINK_RDMA: ::c_int = 20;
+pub const NETLINK_CRYPTO: ::c_int = 21;
+pub const NETLINK_INET_DIAG: ::c_int = NETLINK_SOCK_DIAG;
+
+pub const MAX_LINKS: ::c_int = 32;
+
+pub const NLM_F_REQUEST: ::c_int = 1;
+pub const NLM_F_MULTI: ::c_int = 2;
+pub const NLM_F_ACK: ::c_int = 4;
+pub const NLM_F_ECHO: ::c_int = 8;
+pub const NLM_F_DUMP_INTR: ::c_int = 16;
+
+pub const NLM_F_ROOT: ::c_int = 0x100;
+pub const NLM_F_MATCH: ::c_int = 0x200;
+pub const NLM_F_ATOMIC: ::c_int = 0x400;
+pub const NLM_F_DUMP: ::c_int = NLM_F_ROOT | NLM_F_MATCH;
+
+pub const NLM_F_REPLACE: ::c_int = 0x100;
+pub const NLM_F_EXCL: ::c_int = 0x200;
+pub const NLM_F_CREATE: ::c_int = 0x400;
+pub const NLM_F_APPEND: ::c_int = 0x800;
+
+pub const NLMSG_NOOP: ::c_int = 0x1;
+pub const NLMSG_ERROR: ::c_int = 0x2;
+pub const NLMSG_DONE: ::c_int = 0x3;
+pub const NLMSG_OVERRUN: ::c_int = 0x4;
+pub const NLMSG_MIN_TYPE: ::c_int = 0x10;
+
+pub const NETLINK_ADD_MEMBERSHIP: ::c_int = 1;
+pub const NETLINK_DROP_MEMBERSHIP: ::c_int = 2;
+pub const NETLINK_PKTINFO: ::c_int = 3;
+pub const NETLINK_BROADCAST_ERROR: ::c_int = 4;
+pub const NETLINK_NO_ENOBUFS: ::c_int = 5;
+pub const NETLINK_RX_RING: ::c_int = 6;
+pub const NETLINK_TX_RING: ::c_int = 7;
+
+pub const NLA_F_NESTED: ::c_int = 1 << 15;
+pub const NLA_F_NET_BYTEORDER: ::c_int = 1 << 14;
+pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER);
+
+pub const SIGEV_THREAD_ID: ::c_int = 4;
+
 f! {
     pub fn sigemptyset(set: *mut sigset_t) -> ::c_int {
         *set = 0;
         return 0
     }
     pub fn sigaddset(set: *mut sigset_t, signum: ::c_int) -> ::c_int {
         *set |= signum as sigset_t;
         return 0
deleted file mode 100644
--- a/third_party/rust/libc/src/unix/notbsd/linux/mips.rs
+++ /dev/null
@@ -1,627 +0,0 @@
-pub type c_char = i8;
-pub type c_long = i32;
-pub type c_ulong = u32;
-pub type clock_t = i32;
-pub type time_t = i32;
-pub type suseconds_t = i32;
-pub type wchar_t = i32;
-pub type off_t = i32;
-pub type ino_t = u32;
-pub type blkcnt_t = i32;
-pub type blksize_t = i32;
-pub type nlink_t = u32;
-pub type fsblkcnt_t = ::c_ulong;
-pub type fsfilcnt_t = ::c_ulong;
-pub type rlim_t = c_ulong;
-
-s! {
-    pub struct stat {
-        pub st_dev: ::c_ulong,
-        st_pad1: [::c_long; 3],
-        pub st_ino: ::ino_t,
-        pub st_mode: ::mode_t,
-        pub st_nlink: ::nlink_t,
-        pub st_uid: ::uid_t,
-        pub st_gid: ::gid_t,
-        pub st_rdev: ::c_ulong,
-        pub st_pad2: [::c_long; 2],
-        pub st_size: ::off_t,
-        st_pad3: ::c_long,
-        pub st_atime: ::time_t,
-        pub st_atime_nsec: ::c_long,
-        pub st_mtime: ::time_t,
-        pub st_mtime_nsec: ::c_long,
-        pub st_ctime: ::time_t,
-        pub st_ctime_nsec: ::c_long,
-        pub st_blksize: ::blksize_t,
-        pub st_blocks: ::blkcnt_t,
-        st_pad5: [::c_long; 14],
-    }
-
-    pub struct stat64 {
-        pub st_dev: ::c_ulong,
-        st_pad1: [::c_long; 3],
-        pub st_ino: ::ino64_t,
-        pub st_mode: ::mode_t,
-        pub st_nlink: ::nlink_t,
-        pub st_uid: ::uid_t,
-        pub st_gid: ::gid_t,
-        pub st_rdev: ::c_ulong,
-        st_pad2: [::c_long; 2],
-        pub st_size: ::off64_t,
-        pub st_atime: ::time_t,
-        pub st_atime_nsec: ::c_long,
-        pub st_mtime: ::time_t,
-        pub st_mtime_nsec: ::c_long,
-        pub st_ctime: ::time_t,
-        pub st_ctime_nsec: ::c_long,
-        pub st_blksize: ::blksize_t,
-        st_pad3: ::c_long,
-        pub st_blocks: ::blkcnt64_t,
-        st_pad5: [::c_long; 14],
-    }
-
-    pub struct pthread_attr_t {
-        __size: [u32; 9]
-    }
-
-    pub struct sigaction {
-        pub sa_flags: ::c_int,
-        pub sa_sigaction: ::sighandler_t,
-        pub sa_mask: sigset_t,
-        _restorer: *mut ::c_void,
-        _resv: [::c_int; 1],
-    }
-
-    pub struct stack_t {
-        pub ss_sp: *mut ::c_void,
-        pub ss_size: ::size_t,
-        pub ss_flags: ::c_int,
-    }
-
-    pub struct sigset_t {
-        __val: [::c_ulong; 32],
-    }
-
-    pub struct siginfo_t {
-        pub si_signo: ::c_int,
-        pub si_code: ::c_int,
-        pub si_errno: ::c_int,
-        pub _pad: [::c_int; 29],
-    }
-
-    pub struct glob64_t {
-        pub gl_pathc: ::size_t,
-        pub gl_pathv: *mut *mut ::c_char,
-        pub gl_offs: ::size_t,
-        pub gl_flags: ::c_int,
-
-        __unused1: *mut ::c_void,
-        __unused2: *mut ::c_void,
-        __unused3: *mut ::c_void,
-        __unused4: *mut ::c_void,
-        __unused5: *mut ::c_void,
-    }
-
-    pub struct ipc_perm {
-        pub __key: ::key_t,
-        pub uid: ::uid_t,
-        pub gid: ::gid_t,
-        pub cuid: ::uid_t,
-        pub cgid: ::gid_t,
-        pub mode: ::c_uint,
-        pub __seq: ::c_ushort,
-        __pad1: ::c_ushort,
-        __unused1: ::c_ulong,
-        __unused2: ::c_ulong
-    }
-
-    pub struct shmid_ds {
-        pub shm_perm: ::ipc_perm,
-        pub shm_segsz: ::size_t,
-        pub shm_atime: ::time_t,
-        pub shm_dtime: ::time_t,
-        pub shm_ctime: ::time_t,
-        pub shm_cpid: ::pid_t,
-        pub shm_lpid: ::pid_t,
-        pub shm_nattch: ::shmatt_t,
-        __unused4: ::c_ulong,
-        __unused5: ::c_ulong
-    }
-
-    pub struct statfs {
-        pub f_type: ::c_long,
-        pub f_bsize: ::c_long,
-        pub f_frsize: ::c_long,
-        pub f_blocks: ::fsblkcnt_t,
-        pub f_bfree: ::fsblkcnt_t,
-        pub f_files: ::fsblkcnt_t,
-        pub f_ffree: ::fsblkcnt_t,
-        pub f_bavail: ::fsblkcnt_t,
-        pub f_fsid: ::fsid_t,
-
-        pub f_namelen: ::c_long,
-        f_spare: [::c_long; 6],
-    }
-
-    pub struct msghdr {
-        pub msg_name: *mut ::c_void,
-        pub msg_namelen: ::socklen_t,
-        pub msg_iov: *mut ::iovec,
-        pub msg_iovlen: ::size_t,
-        pub msg_control: *mut ::c_void,
-        pub msg_controllen: ::size_t,
-        pub msg_flags: ::c_int,
-    }
-
-    pub struct termios {
-        pub c_iflag: ::tcflag_t,
-        pub c_oflag: ::tcflag_t,
-        pub c_cflag: ::tcflag_t,
-        pub c_lflag: ::tcflag_t,
-        pub c_line: ::cc_t,
-        pub c_cc: [::cc_t; ::NCCS],
-    }
-
-    pub struct flock {
-        pub l_type: ::c_short,
-        pub l_whence: ::c_short,
-        pub l_start: ::off_t,
-        pub l_len: ::off_t,
-        pub l_sysid: ::c_long,
-        pub l_pid: ::pid_t,
-        pad: [::c_long; 4],
-    }
-
-    pub struct sysinfo {
-        pub uptime: ::c_long,
-        pub loads: [::c_ulong; 3],
-        pub totalram: ::c_ulong,
-        pub freeram: ::c_ulong,
-        pub sharedram: ::c_ulong,
-        pub bufferram: ::c_ulong,
-        pub totalswap: ::c_ulong,
-        pub freeswap: ::c_ulong,
-        pub procs: ::c_ushort,
-        pub pad: ::c_ushort,
-        pub totalhigh: ::c_ulong,
-        pub freehigh: ::c_ulong,
-        pub mem_unit: ::c_uint,
-        pub _f: [::c_char; 8],
-    }
-
-    // FIXME this is actually a union
-    pub struct sem_t {
-        #[cfg(target_pointer_width = "32")]
-        __size: [::c_char; 16],
-        #[cfg(target_pointer_width = "64")]
-        __size: [::c_char; 32],
-        __align: [::c_long; 0],
-    }
-}
-
-pub const BUFSIZ: ::c_uint = 8192;
-pub const TMP_MAX: ::c_uint = 238328;
-pub const FOPEN_MAX: ::c_uint = 16;
-pub const POSIX_FADV_DONTNEED: ::c_int = 4;
-pub const POSIX_FADV_NOREUSE: ::c_int = 5;
-pub const POSIX_MADV_DONTNEED: ::c_int = 4;
-pub const _SC_2_C_VERSION: ::c_int = 96;
-pub const RUSAGE_THREAD: ::c_int = 1;
-pub const O_ACCMODE: ::c_int = 3;
-pub const O_DIRECT: ::c_int = 0x8000;
-pub const O_DIRECTORY: ::c_int = 0x10000;
-pub const O_NOFOLLOW: ::c_int = 0x20000;
-pub const RUSAGE_CHILDREN: ::c_int = -1;
-pub const ST_RELATIME: ::c_ulong = 4096;
-pub const NI_MAXHOST: ::socklen_t = 1025;
-
-pub const RLIMIT_NOFILE: ::c_int = 5;
-pub const RLIMIT_AS: ::c_int = 6;
-pub const RLIMIT_RSS: ::c_int = 7;
-pub const RLIMIT_NPROC: ::c_int = 8;
-pub const RLIMIT_MEMLOCK: ::c_int = 9;
-pub const RLIMIT_NLIMITS: ::c_int = 16;
-pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
-
-pub const O_APPEND: ::c_int = 8;
-pub const O_CREAT: ::c_int = 256;
-pub const O_EXCL: ::c_int = 1024;
-pub const O_NOCTTY: ::c_int = 2048;
-pub const O_NONBLOCK: ::c_int = 128;
-pub const O_SYNC: ::c_int = 0x4010;
-pub const O_RSYNC: ::c_int = 0x4010;
-pub const O_DSYNC: ::c_int = 0x10;
-pub const O_FSYNC: ::c_int = 0x4010;
-pub const O_ASYNC: ::c_int = 0x1000;
-pub const O_NDELAY: ::c_int = 0x80;
-
-pub const SOCK_NONBLOCK: ::c_int = 128;
-
-pub const EDEADLK: ::c_int = 45;
-pub const ENAMETOOLONG: ::c_int = 78;
-pub const ENOLCK: ::c_int = 46;
-pub const ENOSYS: ::c_int = 89;
-pub const ENOTEMPTY: ::c_int = 93;
-pub const ELOOP: ::c_int = 90;
-pub const ENOMSG: ::c_int = 35;
-pub const EIDRM: ::c_int = 36;
-pub const ECHRNG: ::c_int = 37;
-pub const EL2NSYNC: ::c_int = 38;
-pub const EL3HLT: ::c_int = 39;
-pub const EL3RST: ::c_int = 40;
-pub const ELNRNG: ::c_int = 41;
-pub const EUNATCH: ::c_int = 42;
-pub const ENOCSI: ::c_int = 43;
-pub const EL2HLT: ::c_int = 44;
-pub const EBADE: ::c_int = 50;
-pub const EBADR: ::c_int = 51;
-pub const EXFULL: ::c_int = 52;
-pub const ENOANO: ::c_int = 53;
-pub const EBADRQC: ::c_int = 54;
-pub const EBADSLT: ::c_int = 55;
-pub const EDEADLOCK: ::c_int = 56;
-pub const EMULTIHOP: ::c_int = 74;
-pub const EOVERFLOW: ::c_int = 79;
-pub const ENOTUNIQ: ::c_int = 80;
-pub const EBADFD: ::c_int = 81;
-pub const EBADMSG: ::c_int = 77;
-pub const EREMCHG: ::c_int = 82;
-pub const ELIBACC: ::c_int = 83;
-pub const ELIBBAD: ::c_int = 84;
-pub const ELIBSCN: ::c_int = 85;
-pub const ELIBMAX: ::c_int = 86;
-pub const ELIBEXEC: ::c_int = 87;
-pub const EILSEQ: ::c_int = 88;
-pub const ERESTART: ::c_int = 91;
-pub const ESTRPIPE: ::c_int = 92;
-pub const EUSERS: ::c_int = 94;
-pub const ENOTSOCK: ::c_int = 95;
-pub const EDESTADDRREQ: ::c_int = 96;
-pub const EMSGSIZE: ::c_int = 97;
-pub const EPROTOTYPE: ::c_int = 98;
-pub const ENOPROTOOPT: ::c_int = 99;
-pub const EPROTONOSUPPORT: ::c_int = 120;
-pub const ESOCKTNOSUPPORT: ::c_int = 121;
-pub const EOPNOTSUPP: ::c_int = 122;
-pub const EPFNOSUPPORT: ::c_int = 123;
-pub const EAFNOSUPPORT: ::c_int = 124;
-pub const EADDRINUSE: ::c_int = 125;
-pub const EADDRNOTAVAIL: ::c_int = 126;
-pub const ENETDOWN: ::c_int = 127;
-pub const ENETUNREACH: ::c_int = 128;
-pub const ENETRESET: ::c_int = 129;
-pub const ECONNABORTED: ::c_int = 130;
-pub const ECONNRESET: ::c_int = 131;
-pub const ENOBUFS: ::c_int = 132;
-pub const EISCONN: ::c_int = 133;
-pub const ENOTCONN: ::c_int = 134;
-pub const ESHUTDOWN: ::c_int = 143;
-pub const ETOOMANYREFS: ::c_int = 144;
-pub const ETIMEDOUT: ::c_int = 145;
-pub const ECONNREFUSED: ::c_int = 146;
-pub const EHOSTDOWN: ::c_int = 147;
-pub const EHOSTUNREACH: ::c_int = 148;
-pub const EALREADY: ::c_int = 149;
-pub const EINPROGRESS: ::c_int = 150;
-pub const ESTALE: ::c_int = 151;
-pub const EUCLEAN: ::c_int = 135;
-pub const ENOTNAM: ::c_int = 137;
-pub const ENAVAIL: ::c_int = 138;
-pub const EISNAM: ::c_int = 139;
-pub const EREMOTEIO: ::c_int = 140;
-pub const EDQUOT: ::c_int = 1133;
-pub const ENOMEDIUM: ::c_int = 159;
-pub const EMEDIUMTYPE: ::c_int = 160;
-pub const ECANCELED: ::c_int = 158;
-pub const ENOKEY: ::c_int = 161;
-pub const EKEYEXPIRED: ::c_int = 162;
-pub const EKEYREVOKED: ::c_int = 163;
-pub const EKEYREJECTED: ::c_int = 164;
-pub const EOWNERDEAD: ::c_int = 165;
-pub const ENOTRECOVERABLE: ::c_int = 166;
-pub const ERFKILL: ::c_int = 167;
-
-pub const LC_PAPER: ::c_int = 7;
-pub const LC_NAME: ::c_int = 8;
-pub const LC_ADDRESS: ::c_int = 9;
-pub const LC_TELEPHONE: ::c_int = 10;
-pub const LC_MEASUREMENT: ::c_int = 11;
-pub const LC_IDENTIFICATION: ::c_int = 12;
-pub const LC_PAPER_MASK: ::c_int = (1 << LC_PAPER);
-pub const LC_NAME_MASK: ::c_int = (1 << LC_NAME);
-pub const LC_ADDRESS_MASK: ::c_int = (1 << LC_ADDRESS);
-pub const LC_TELEPHONE_MASK: ::c_int = (1 << LC_TELEPHONE);
-pub const LC_MEASUREMENT_MASK: ::c_int = (1 << LC_MEASUREMENT);
-pub const LC_IDENTIFICATION_MASK: ::c_int = (1 << LC_IDENTIFICATION);
-pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK
-                               | ::LC_NUMERIC_MASK
-                               | ::LC_TIME_MASK
-                               | ::LC_COLLATE_MASK
-                               | ::LC_MONETARY_MASK
-                               | ::LC_MESSAGES_MASK
-                               | LC_PAPER_MASK
-                               | LC_NAME_MASK
-                               | LC_ADDRESS_MASK
-                               | LC_TELEPHONE_MASK
-                               | LC_MEASUREMENT_MASK
-                               | LC_IDENTIFICATION_MASK;
-
-pub const MAP_NORESERVE: ::c_int = 0x400;
-pub const MAP_ANON: ::c_int = 0x800;
-pub const MAP_ANONYMOUS: ::c_int = 0x800;
-pub const MAP_GROWSDOWN: ::c_int = 0x1000;
-pub const MAP_DENYWRITE: ::c_int = 0x2000;
-pub const MAP_EXECUTABLE: ::c_int = 0x4000;
-pub const MAP_LOCKED: ::c_int = 0x8000;
-pub const MAP_POPULATE: ::c_int = 0x10000;
-pub const MAP_NONBLOCK: ::c_int = 0x20000;
-pub const MAP_STACK: ::c_int = 0x40000;
-
-pub const SOCK_STREAM: ::c_int = 2;
-pub const SOCK_DGRAM: ::c_int = 1;
-pub const SOCK_SEQPACKET: ::c_int = 5;
-
-pub const SOL_SOCKET: ::c_int = 0xffff;
-
-pub const SO_REUSEADDR: ::c_int = 4;
-pub const SO_REUSEPORT: ::c_int = 0x200;
-pub const SO_TYPE: ::c_int = 4104;
-pub const SO_ERROR: ::c_int = 4103;
-pub const SO_DONTROUTE: ::c_int = 16;
-pub const SO_BROADCAST: ::c_int = 32;
-pub const SO_SNDBUF: ::c_int = 4097;
-pub const SO_RCVBUF: ::c_int = 4098;
-pub const SO_KEEPALIVE: ::c_int = 8;
-pub const SO_OOBINLINE: ::c_int = 256;
-pub const SO_LINGER: ::c_int = 128;
-pub const SO_RCVLOWAT: ::c_int = 4100;
-pub const SO_SNDLOWAT: ::c_int = 4099;
-pub const SO_RCVTIMEO: ::c_int = 4102;
-pub const SO_SNDTIMEO: ::c_int = 4101;
-pub const SO_ACCEPTCONN: ::c_int = 4105;
-
-pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
-pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24;
-pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32;
-pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
-
-pub const FIOCLEX: ::c_ulong = 0x6601;
-pub const FIONBIO: ::c_ulong = 0x667e;
-
-pub const SA_ONSTACK: ::c_int = 0x08000000;
-pub const SA_SIGINFO: ::c_int = 0x00000008;
-pub const SA_NOCLDWAIT: ::c_int = 0x00010000;
-
-pub const SIGCHLD: ::c_int = 18;
-pub const SIGBUS: ::c_int = 10;
-pub const SIGTTIN: ::c_int = 26;
-pub const SIGTTOU: ::c_int = 27;
-pub const SIGXCPU: ::c_int = 30;
-pub const SIGXFSZ: ::c_int = 31;
-pub const SIGVTALRM: ::c_int = 28;
-pub const SIGPROF: ::c_int = 29;
-pub const SIGWINCH: ::c_int = 20;
-pub const SIGUSR1: ::c_int = 16;
-pub const SIGUSR2: ::c_int = 17;
-pub const SIGCONT: ::c_int = 25;
-pub const SIGSTOP: ::c_int = 23;
-pub const SIGTSTP: ::c_int = 24;
-pub const SIGURG: ::c_int = 21;
-pub const SIGIO: ::c_int = 22;
-pub const SIGSYS: ::c_int = 12;
-pub const SIGPOLL: ::c_int = 22;
-pub const SIGPWR: ::c_int = 19;
-pub const SIG_SETMASK: ::c_int = 3;
-pub const SIG_BLOCK: ::c_int = 0x1;
-pub const SIG_UNBLOCK: ::c_int = 0x2;
-
-pub const POLLRDNORM: ::c_short = 0x040;
-pub const POLLWRNORM: ::c_short = 0x004;
-pub const POLLRDBAND: ::c_short = 0x080;
-pub const POLLWRBAND: ::c_short = 0x100;
-
-pub const PTHREAD_STACK_MIN: ::size_t = 131072;
-
-pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5;
-pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff;
-pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245;
-pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45;
-pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53;
-pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53;
-pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53;
-pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53;
-pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849;
-pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6;
-pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660;
-pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6;
-pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f;
-pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f;
-pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468;
-pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478;
-pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44;
-pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c;
-pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969;
-pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1;
-pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0;
-pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f;
-pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973;
-pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b;
-pub const TMPFS_MAGIC: ::c_long = 0x01021994;
-pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2;
-
-pub const VEOF: usize = 16;
-pub const VEOL: usize = 17;
-pub const VEOL2: usize = 6;
-pub const VMIN: usize = 4;
-pub const IEXTEN: ::tcflag_t = 0x00000100;
-pub const TOSTOP: ::tcflag_t = 0x00008000;
-pub const FLUSHO: ::tcflag_t = 0x00002000;
-pub const IUTF8: ::tcflag_t = 0x00004000;
-pub const TCSANOW: ::c_int = 0x540e;
-pub const TCSADRAIN: ::c_int = 0x540f;
-pub const TCSAFLUSH: ::c_int = 0x5410;
-
-pub const CPU_SETSIZE: ::c_int = 0x400;
-
-pub const PTRACE_TRACEME: ::c_uint = 0;
-pub const PTRACE_PEEKTEXT: ::c_uint = 1;
-pub const PTRACE_PEEKDATA: ::c_uint = 2;
-pub const PTRACE_PEEKUSER: ::c_uint = 3;
-pub const PTRACE_POKETEXT: ::c_uint = 4;
-pub const PTRACE_POKEDATA: ::c_uint = 5;
-pub const PTRACE_POKEUSER: ::c_uint = 6;
-pub const PTRACE_CONT: ::c_uint = 7;
-pub const PTRACE_KILL: ::c_uint = 8;
-pub const PTRACE_SINGLESTEP: ::c_uint = 9;
-pub const PTRACE_ATTACH: ::c_uint = 16;
-pub const PTRACE_DETACH: ::c_uint = 17;
-pub const PTRACE_SYSCALL: ::c_uint = 24;
-pub const PTRACE_SETOPTIONS: ::c_uint = 0x4200;
-pub const PTRACE_GETEVENTMSG: ::c_uint = 0x4201;
-pub const PTRACE_GETSIGINFO: ::c_uint = 0x4202;
-pub const PTRACE_SETSIGINFO: ::c_uint = 0x4203;
-pub const PTRACE_GETFPREGS: ::c_uint = 14;
-pub const PTRACE_SETFPREGS: ::c_uint = 15;
-pub const PTRACE_GETFPXREGS: ::c_uint = 18;
-pub const PTRACE_SETFPXREGS: ::c_uint = 19;
-pub const PTRACE_GETREGS: ::c_uint = 12;
-pub const PTRACE_SETREGS: ::c_uint = 13;
-
-pub const MAP_HUGETLB: ::c_int = 0x080000;
-
-pub const EFD_NONBLOCK: ::c_int = 0x80;
-
-pub const F_GETLK: ::c_int = 14;
-pub const F_GETOWN: ::c_int = 23;
-pub const F_SETOWN: ::c_int = 24;
-pub const F_SETLK: ::c_int = 6;
-pub const F_SETLKW: ::c_int = 7;
-
-pub const SFD_NONBLOCK: ::c_int = 0x80;
-
-pub const TCGETS: ::c_ulong = 0x540d;
-pub const TCSETS: ::c_ulong = 0x540e;
-pub const TCSETSW: ::c_ulong = 0x540f;
-pub const TCSETSF: ::c_ulong = 0x5410;
-pub const TCGETA: ::c_ulong = 0x5401;
-pub const TCSETA: ::c_ulong = 0x5402;
-pub const TCSETAW: ::c_ulong = 0x5403;
-pub const TCSETAF: ::c_ulong = 0x5404;
-pub const TCSBRK: ::c_ulong = 0x5405;
-pub const TCXONC: ::c_ulong = 0x5406;
-pub const TCFLSH: ::c_ulong = 0x5407;
-pub const TIOCGSOFTCAR: ::c_ulong = 0x5481;
-pub const TIOCSSOFTCAR: ::c_ulong = 0x5482;
-pub const TIOCINQ: ::c_ulong = 0x467f;
-pub const TIOCLINUX: ::c_ulong = 0x5483;
-pub const TIOCGSERIAL: ::c_ulong = 0x5484;
-pub const TIOCEXCL: ::c_ulong = 0x740d;
-pub const TIOCNXCL: ::c_ulong = 0x740e;
-pub const TIOCSCTTY: ::c_ulong = 0x5480;
-pub const TIOCGPGRP: ::c_ulong = 0x40047477;
-pub const TIOCSPGRP: ::c_ulong = 0x80047476;
-pub const TIOCOUTQ: ::c_ulong = 0x7472;
-pub const TIOCSTI: ::c_ulong = 0x5472;
-pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
-pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
-pub const TIOCMGET: ::c_ulong = 0x741d;
-pub const TIOCMBIS: ::c_ulong = 0x741b;
-pub const TIOCMBIC: ::c_ulong = 0x741c;
-pub const TIOCMSET: ::c_ulong = 0x741a;
-pub const FIONREAD: ::c_ulong = 0x467f;
-pub const TIOCCONS: ::c_ulong = 0x80047478;
-
-pub const RTLD_DEEPBIND: ::c_int = 0x10;
-pub const RTLD_GLOBAL: ::c_int = 0x4;
-pub const RTLD_NOLOAD: ::c_int = 0x8;
-
-pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead;
-pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793;
-pub const LINUX_REBOOT_MAGIC2A: ::c_int = 85072278;
-pub const LINUX_REBOOT_MAGIC2B: ::c_int = 369367448;
-pub const LINUX_REBOOT_MAGIC2C: ::c_int = 537993216;
-
-pub const LINUX_REBOOT_CMD_RESTART: ::c_int = 0x01234567;
-pub const LINUX_REBOOT_CMD_HALT: ::c_int = 0xCDEF0123;
-pub const LINUX_REBOOT_CMD_CAD_ON: ::c_int = 0x89ABCDEF;
-pub const LINUX_REBOOT_CMD_CAD_OFF: ::c_int = 0x00000000;
-pub const LINUX_REBOOT_CMD_POWER_OFF: ::c_int = 0x4321FEDC;
-pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4;
-pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2;
-pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543;
-
-pub const SYS_gettid: ::c_long = 4222;   // Valid for O32
-
-pub const MCL_CURRENT: ::c_int = 0x0001;
-pub const MCL_FUTURE: ::c_int = 0x0002;
-
-pub const SIGSTKSZ: ::size_t = 8192;
-pub const CBAUD: ::tcflag_t = 0o0010017;
-pub const TAB1: ::c_int = 0x00000800;
-pub const TAB2: ::c_int = 0x00001000;
-pub const TAB3: ::c_int = 0x00001800;
-pub const CR1: ::c_int  = 0x00000200;
-pub const CR2: ::c_int  = 0x00000400;
-pub const CR3: ::c_int  = 0x00000600;
-pub const FF1: ::c_int  = 0x00008000;
-pub const BS1: ::c_int  = 0x00002000;
-pub const VT1: ::c_int  = 0x00004000;
-pub const VWERASE: usize = 14;
-pub const VREPRINT: usize = 12;
-pub const VSUSP: usize = 10;
-pub const VSTART: usize = 8;
-pub const VSTOP: usize = 9;
-pub const VDISCARD: usize = 13;
-pub const VTIME: usize = 5;
-pub const IXON: ::tcflag_t = 0x00000400;
-pub const IXOFF: ::tcflag_t = 0x00001000;
-pub const ONLCR: ::tcflag_t = 0x4;
-pub const CSIZE: ::tcflag_t = 0x00000030;
-pub const CS6: ::tcflag_t = 0x00000010;
-pub const CS7: ::tcflag_t = 0x00000020;
-pub const CS8: ::tcflag_t = 0x00000030;
-pub const CSTOPB: ::tcflag_t = 0x00000040;
-pub const CREAD: ::tcflag_t = 0x00000080;
-pub const PARENB: ::tcflag_t = 0x00000100;
-pub const PARODD: ::tcflag_t = 0x00000200;
-pub const HUPCL: ::tcflag_t = 0x00000400;
-pub const CLOCAL: ::tcflag_t = 0x00000800;
-pub const ECHOKE: ::tcflag_t = 0x00000800;
-pub const ECHOE: ::tcflag_t = 0x00000010;
-pub const ECHOK: ::tcflag_t = 0x00000020;
-pub const ECHONL: ::tcflag_t = 0x00000040;
-pub const ECHOPRT: ::tcflag_t = 0x00000400;
-pub const ECHOCTL: ::tcflag_t = 0x00000200;
-pub const ISIG: ::tcflag_t = 0x00000001;
-pub const ICANON: ::tcflag_t = 0x00000002;
-pub const PENDIN: ::tcflag_t = 0x00004000;
-pub const NOFLSH: ::tcflag_t = 0x00000080;
-
-#[link(name = "util")]
-extern {
-    pub fn sysctl(name: *mut ::c_int,
-                  namelen: ::c_int,
-                  oldp: *mut ::c_void,
-                  oldlenp: *mut ::size_t,
-                  newp: *mut ::c_void,
-                  newlen: ::size_t)
-                  -> ::c_int;
-    pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
-    pub fn backtrace(buf: *mut *mut ::c_void,
-                     sz: ::c_int) -> ::c_int;
-    pub fn glob64(pattern: *const ::c_char,
-                  flags: ::c_int,
-                  errfunc: ::dox::Option<extern fn(epath: *const ::c_char,
-                                                   errno: ::c_int)
-                                                   -> ::c_int>,
-                  pglob: *mut glob64_t) -> ::c_int;
-    pub fn globfree64(pglob: *mut glob64_t);
-    pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
-    pub fn pthread_attr_getaffinity_np(attr: *const ::pthread_attr_t,
-                                       cpusetsize: ::size_t,
-                                       cpuset: *mut ::cpu_set_t) -> ::c_int;
-    pub fn pthread_attr_setaffinity_np(attr: *mut ::pthread_attr_t,
-                                       cpusetsize: ::size_t,
-                                       cpuset: *const ::cpu_set_t) -> ::c_int;
-}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/src/unix/notbsd/linux/mips/mips32.rs
@@ -0,0 +1,281 @@
+pub type c_char = i8;
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type clock_t = i32;
+pub type time_t = i32;
+pub type suseconds_t = i32;
+pub type wchar_t = i32;
+pub type off_t = i32;
+pub type ino_t = u32;
+pub type blkcnt_t = i32;
+pub type blksize_t = i32;
+pub type nlink_t = u32;
+pub type fsblkcnt_t = ::c_ulong;
+pub type fsfilcnt_t = ::c_ulong;
+pub type rlim_t = c_ulong;
+
+s! {
+    pub struct aiocb {
+        pub aio_fildes: ::c_int,
+        pub aio_lio_opcode: ::c_int,
+        pub aio_reqprio: ::c_int,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        pub aio_sigevent: ::sigevent,
+        __next_prio: *mut aiocb,
+        __abs_prio: ::c_int,
+        __policy: ::c_int,
+        __error_code: ::c_int,
+        __return_value: ::ssize_t,
+        pub aio_offset: off_t,
+        __unused1: [::c_char; 4],
+        __glibc_reserved: [::c_char; 32]
+    }
+
+    pub struct stat {
+        pub st_dev: ::c_ulong,
+        st_pad1: [::c_long; 3],
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulong,
+        pub st_pad2: [::c_long; 2],
+        pub st_size: ::off_t,
+        st_pad3: ::c_long,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        st_pad5: [::c_long; 14],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::c_ulong,
+        st_pad1: [::c_long; 3],
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulong,
+        st_pad2: [::c_long; 2],
+        pub st_size: ::off64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        st_pad3: ::c_long,
+        pub st_blocks: ::blkcnt64_t,
+        st_pad5: [::c_long; 14],
+    }
+
+    pub struct pthread_attr_t {
+        __size: [u32; 9]
+    }
+
+    pub struct sigaction {
+        pub sa_flags: ::c_int,
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: sigset_t,
+        _restorer: *mut ::c_void,
+        _resv: [::c_int; 1],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+
+    pub struct sigset_t {
+        __val: [::c_ulong; 32],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_code: ::c_int,
+        pub si_errno: ::c_int,
+        pub _pad: [::c_int; 29],
+    }
+
+    pub struct glob64_t {
+        pub gl_pathc: ::size_t,
+        pub gl_pathv: *mut *mut ::c_char,
+        pub gl_offs: ::size_t,
+        pub gl_flags: ::c_int,
+
+        __unused1: *mut ::c_void,
+        __unused2: *mut ::c_void,
+        __unused3: *mut ::c_void,
+        __unused4: *mut ::c_void,
+        __unused5: *mut ::c_void,
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_uint,
+        pub __seq: ::c_ushort,
+        __pad1: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        #[cfg(target_endian = "big")]
+        __glibc_reserved1: ::c_ulong,
+        pub msg_stime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __glibc_reserved1: ::c_ulong,
+        #[cfg(target_endian = "big")]
+        __glibc_reserved2: ::c_ulong,
+        pub msg_rtime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __glibc_reserved2: ::c_ulong,
+        #[cfg(target_endian = "big")]
+        __glibc_reserved3: ::c_ulong,
+        pub msg_ctime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __glibc_reserved3: ::c_ulong,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_files: ::fsblkcnt_t,
+        pub f_ffree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_fsid: ::fsid_t,
+
+        pub f_namelen: ::c_long,
+        f_spare: [::c_long; 6],
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::size_t,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: ::size_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_sysid: ::c_long,
+        pub l_pid: ::pid_t,
+        pad: [::c_long; 4],
+    }
+
+    pub struct sysinfo {
+        pub uptime: ::c_long,
+        pub loads: [::c_ulong; 3],
+        pub totalram: ::c_ulong,
+        pub freeram: ::c_ulong,
+        pub sharedram: ::c_ulong,
+        pub bufferram: ::c_ulong,
+        pub totalswap: ::c_ulong,
+        pub freeswap: ::c_ulong,
+        pub procs: ::c_ushort,
+        pub pad: ::c_ushort,
+        pub totalhigh: ::c_ulong,
+        pub freehigh: ::c_ulong,
+        pub mem_unit: ::c_uint,
+        pub _f: [::c_char; 8],
+    }
+
+    // FIXME this is actually a union
+    pub struct sem_t {
+        #[cfg(target_pointer_width = "32")]
+        __size: [::c_char; 16],
+        #[cfg(target_pointer_width = "64")]
+        __size: [::c_char; 32],
+        __align: [::c_long; 0],
+    }
+}
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+
+pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
+
+pub const SYS_gettid: ::c_long = 4222;   // Valid for O32
+
+#[link(name = "util")]
+extern {
+    pub fn sysctl(name: *mut ::c_int,
+                  namelen: ::c_int,
+                  oldp: *mut ::c_void,
+                  oldlenp: *mut ::size_t,
+                  newp: *mut ::c_void,
+                  newlen: ::size_t)
+                  -> ::c_int;
+    pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
+    pub fn backtrace(buf: *mut *mut ::c_void,
+                     sz: ::c_int) -> ::c_int;
+    pub fn glob64(pattern: *const ::c_char,
+                  flags: ::c_int,
+                  errfunc: ::dox::Option<extern fn(epath: *const ::c_char,
+                                                   errno: ::c_int)
+                                                   -> ::c_int>,
+                  pglob: *mut glob64_t) -> ::c_int;
+    pub fn globfree64(pglob: *mut glob64_t);
+    pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
+    pub fn pthread_attr_getaffinity_np(attr: *const ::pthread_attr_t,
+                                       cpusetsize: ::size_t,
+                                       cpuset: *mut ::cpu_set_t) -> ::c_int;
+    pub fn pthread_attr_setaffinity_np(attr: *mut ::pthread_attr_t,
+                                       cpusetsize: ::size_t,
+                                       cpuset: *const ::cpu_set_t) -> ::c_int;
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/src/unix/notbsd/linux/mips/mips64.rs
@@ -0,0 +1,219 @@
+pub type blkcnt_t = i64;
+pub type blksize_t = i64;
+pub type c_char = i8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type fsblkcnt_t = ::c_ulong;
+pub type fsfilcnt_t = ::c_ulong;
+pub type ino_t = u64;
+pub type nlink_t = u64;
+pub type off_t = i64;
+pub type rlim_t = ::c_ulong;
+pub type suseconds_t = i64;
+pub type time_t = i64;
+pub type wchar_t = i32;
+
+s! {
+    pub struct aiocb {
+        pub aio_fildes: ::c_int,
+        pub aio_lio_opcode: ::c_int,
+        pub aio_reqprio: ::c_int,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        pub aio_sigevent: ::sigevent,
+        __next_prio: *mut aiocb,
+        __abs_prio: ::c_int,
+        __policy: ::c_int,
+        __error_code: ::c_int,
+        __return_value: ::ssize_t,
+        pub aio_offset: off_t,
+        __glibc_reserved: [::c_char; 32]
+    }
+
+    pub struct stat {
+        pub st_dev: ::c_ulong,
+        st_pad1: [::c_long; 2],
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulong,
+        st_pad2: [::c_ulong; 1],
+        pub st_size: ::off_t,
+        st_pad3: ::c_long,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        st_pad4: ::c_long,
+        pub st_blocks: ::blkcnt_t,
+        st_pad5: [::c_long; 7],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::c_ulong,
+        st_pad1: [::c_long; 2],
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulong,
+        st_pad2: [::c_long; 2],
+        pub st_size: ::off64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        st_pad3: ::c_long,
+        pub st_blocks: ::blkcnt64_t,
+        st_pad5: [::c_long; 7],
+    }
+
+    pub struct pthread_attr_t {
+        __size: [::c_ulong; 7]
+    }
+
+    pub struct sigaction {
+        pub sa_flags: ::c_int,
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: sigset_t,
+        _restorer: *mut ::c_void,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+
+    pub struct sigset_t {
+        __size: [::c_ulong; 16],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_code: ::c_int,
+        pub si_errno: ::c_int,
+        _pad: ::c_int,
+        _pad2: [::c_long; 14],
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_uint,
+        pub __seq: ::c_ushort,
+        __pad1: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_files: ::fsblkcnt_t,
+        pub f_ffree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_fsid: ::fsid_t,
+
+        pub f_namelen: ::c_long,
+        f_spare: [::c_long; 6],
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::size_t,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: ::size_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+    }
+
+    pub struct sysinfo {
+        pub uptime: ::c_long,
+        pub loads: [::c_ulong; 3],
+        pub totalram: ::c_ulong,
+        pub freeram: ::c_ulong,
+        pub sharedram: ::c_ulong,
+        pub bufferram: ::c_ulong,
+        pub totalswap: ::c_ulong,
+        pub freeswap: ::c_ulong,
+        pub procs: ::c_ushort,
+        pub pad: ::c_ushort,
+        pub totalhigh: ::c_ulong,
+        pub freehigh: ::c_ulong,
+        pub mem_unit: ::c_uint,
+        pub _f: [::c_char; 0],
+    }
+
+    // FIXME this is actually a union
+    pub struct sem_t {
+        __size: [::c_char; 32],
+        __align: [::c_long; 0],
+    }
+}
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+
+pub const RLIM_INFINITY: ::rlim_t = 0xffff_ffff_ffff_ffff;
+
+pub const SYS_gettid: ::c_long = 5178;   // Valid for n64
+
+#[link(name = "util")]
+extern {
+    pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/libc/src/unix/notbsd/linux/mips/mod.rs
@@ -0,0 +1,400 @@
+pub const BUFSIZ: ::c_uint = 8192;
+pub const TMP_MAX: ::c_uint = 238328;
+pub const FOPEN_MAX: ::c_uint = 16;
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+pub const POSIX_MADV_DONTNEED: ::c_int = 4;
+pub const _SC_2_C_VERSION: ::c_int = 96;
+pub const O_ACCMODE: ::c_int = 3;
+pub const O_DIRECT: ::c_int = 0x8000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+pub const ST_RELATIME: ::c_ulong = 4096;
+pub const NI_MAXHOST: ::socklen_t = 1025;
+
+pub const RLIMIT_NOFILE: ::c_int = 5;
+pub const RLIMIT_AS: ::c_int = 6;
+pub const RLIMIT_RSS: ::c_int = 7;
+pub const RLIMIT_NPROC: ::c_int = 8;
+pub const RLIMIT_MEMLOCK: ::c_int = 9;
+pub const RLIMIT_NLIMITS: ::c_int = 16;
+
+pub const O_APPEND: ::c_int = 8;
+pub const O_CREAT: ::c_int = 256;
+pub const O_EXCL: ::c_int = 1024;
+pub const O_NOCTTY: ::c_int = 2048;
+pub const O_NONBLOCK: ::c_int = 128;
+pub const O_SYNC: ::c_int = 0x4010;
+pub const O_RSYNC: ::c_int = 0x4010;
+pub const O_DSYNC: ::c_int = 0x10;
+pub const O_FSYNC: ::c_int = 0x4010;
+pub const O_ASYNC: ::c_int = 0x1000;
+pub const O_NDELAY: ::c_int = 0x80;
+
+pub const SOCK_NONBLOCK: ::c_int = 128;
+
+pub const EDEADLK: ::c_int = 45;
+pub const ENAMETOOLONG: ::c_int = 78;
+pub const ENOLCK: ::c_int = 46;
+pub const ENOSYS: ::c_int = 89;
+pub const ENOTEMPTY: ::c_int = 93;
+pub const ELOOP: ::c_int = 90;
+pub const ENOMSG: ::c_int = 35;
+pub const EIDRM: ::c_int = 36;
+pub const ECHRNG: ::c_int = 37;
+pub const EL2NSYNC: ::c_int = 38;
+pub const EL3HLT: ::c_int = 39;
+pub const EL3RST: ::c_int = 40;
+pub const ELNRNG: ::c_int = 41;
+pub const EUNATCH: ::c_int = 42;
+pub const ENOCSI: ::c_int = 43;
+pub const EL2HLT: ::c_int = 44;
+pub const EBADE: ::c_int = 50;
+pub const EBADR: ::c_int = 51;
+pub const EXFULL: ::c_int = 52;
+pub const ENOANO: ::c_int = 53;
+pub const EBADRQC: ::c_int = 54;
+pub const EBADSLT: ::c_int = 55;
+pub const EDEADLOCK: ::c_int = 56;
+pub const EMULTIHOP: ::c_int = 74;
+pub const EOVERFLOW: ::c_int = 79;
+pub const ENOTUNIQ: ::c_int = 80;
+pub const EBADFD: ::c_int = 81;
+pub const EBADMSG: ::c_int = 77;
+pub const EREMCHG: ::c_int = 82;
+pub const ELIBACC: ::c_int = 83;
+pub const ELIBBAD: ::c_int = 84;
+pub const ELIBSCN: ::c_int = 85;
+pub const ELIBMAX: ::c_int = 86;
+pub const ELIBEXEC: ::c_int = 87;
+pub const EILSEQ: ::c_int = 88;
+pub const ERESTART: ::c_int = 91;
+pub const ESTRPIPE: ::c_int = 92;
+pub const EUSERS: ::c_int = 94;
+pub const ENOTSOCK: ::c_int = 95;
+pub const EDESTADDRREQ: ::c_int = 96;
+pub const EMSGSIZE: ::c_int = 97;
+pub const EPROTOTYPE: ::c_int = 98;
+pub const ENOPROTOOPT: ::c_int = 99;
+pub const EPROTONOSUPPORT: ::c_int = 120;
+pub const ESOCKTNOSUPPORT: ::c_int = 121;
+pub const EOPNOTSUPP: ::c_int = 122;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 123;
+pub const EAFNOSUPPORT: ::c_int = 124;
+pub const EADDRINUSE: ::c_int = 125;
+pub const EADDRNOTAVAIL: ::c_int = 126;
+pub const ENETDOWN: ::c_int = 127;
+pub const ENETUNREACH: ::c_int = 128;
+pub const ENETRESET: ::c_int = 129;
+pub const ECONNABORTED: ::c_int = 130;
+pub const ECONNRESET: ::c_int = 131;
+pub const ENOBUFS: ::c_int = 132;
+pub const EISCONN: ::c_int = 133;
+pub const ENOTCONN: ::c_int = 134;
+pub const ESHUTDOWN: ::c_int = 143;
+pub const ETOOMANYREFS: ::c_int = 144;
+pub const ETIMEDOUT: ::c_int = 145;
+pub const ECONNREFUSED: ::c_int = 146;
+pub const EHOSTDOWN: ::c_int = 147;
+pub const EHOSTUNREACH: ::c_int = 148;
+pub const EALREADY: ::c_int = 149;
+pub const EINPROGRESS: ::c_int = 150;
+pub const ESTALE: ::c_int = 151;
+pub const EUCLEAN: ::c_int = 135;
+pub const ENOTNAM: ::c_int = 137;
+pub const ENAVAIL: ::c_int = 138;
+pub const EISNAM: ::c_int = 139;
+pub const EREMOTEIO: ::c_int = 140;
+pub const EDQUOT: ::c_int = 1133;
+pub const ENOMEDIUM: ::c_int = 159;
+pub const EMEDIUMTYPE: ::c_int = 160;
+pub const ECANCELED: ::c_int = 158;
+pub const ENOKEY: ::c_int = 161;
+pub const EKEYEXPIRED: ::c_int = 162;
+pub const EKEYREVOKED: ::c_int = 163;
+pub const EKEYREJECTED: ::c_int = 164;
+pub const EOWNERDEAD: ::c_int = 165;
+pub const ENOTRECOVERABLE: ::c_int = 166;
+pub const ERFKILL: ::c_int = 167;
+
+pub const LC_PAPER: ::c_int = 7;
+pub const LC_NAME: ::c_int = 8;
+pub const LC_ADDRESS: ::c_int = 9;
+pub const LC_TELEPHONE: ::c_int = 10;
+pub const LC_MEASUREMENT: ::c_int = 11;
+pub const LC_IDENTIFICATION: ::c_int = 12;
+pub const LC_PAPER_MASK: ::c_int = (1 << LC_PAPER);
+pub const LC_NAME_MASK: ::c_int = (1 << LC_NAME);
+pub const LC_ADDRESS_MASK: ::c_int = (1 << LC_ADDRESS);
+pub const LC_TELEPHONE_MASK: ::c_int = (1 << LC_TELEPHONE);
+pub const LC_MEASUREMENT_MASK: ::c_int = (1 << LC_MEASUREMENT);
+pub const LC_IDENTIFICATION_MASK: ::c_int = (1 << LC_IDENTIFICATION);
+pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK
+                               | ::LC_NUMERIC_MASK
+                               | ::LC_TIME_MASK
+                               | ::LC_COLLATE_MASK
+                               | ::LC_MONETARY_MASK
+                               | ::LC_MESSAGES_MASK
+                               | LC_PAPER_MASK
+                               | LC_NAME_MASK
+                               | LC_ADDRESS_MASK
+                               | LC_TELEPHONE_MASK
+                               | LC_MEASUREMENT_MASK
+                               | LC_IDENTIFICATION_MASK;
+
+pub const MAP_NORESERVE: ::c_int = 0x400;
+pub const MAP_ANON: ::c_int = 0x800;
+pub const MAP_ANONYMOUS: ::c_int = 0x800;
+pub const MAP_GROWSDOWN: ::c_int = 0x1000;
+pub const MAP_DENYWRITE: ::c_int = 0x2000;
+pub const MAP_EXECUTABLE: ::c_int = 0x4000;
+pub const MAP_LOCKED: ::c_int = 0x8000;
+pub const MAP_POPULATE: ::c_int = 0x10000;
+pub const MAP_NONBLOCK: ::c_int = 0x20000;
+pub const MAP_STACK: ::c_int = 0x40000;
+
+pub const SOCK_STREAM: ::c_int = 2;
+pub const SOCK_DGRAM: ::c_int = 1;
+pub const SOCK_SEQPACKET: ::c_int = 5;
+
+pub const SOL_SOCKET: ::c_int = 0xffff;
+
+pub const SO_REUSEADDR: ::c_int = 4;
+pub const SO_REUSEPORT: ::c_int = 0x200;
+pub const SO_TYPE: ::c_int = 4104;
+pub const SO_ERROR: ::c_int = 4103;
+pub const SO_DONTROUTE: ::c_int = 16;
+pub const SO_BROADCAST: ::c_int = 32;
+pub const SO_SNDBUF: ::c_int = 4097;
+pub const SO_RCVBUF: ::c_int = 4098;
+pub const SO_KEEPALIVE: ::c_int = 8;
+pub const SO_OOBINLINE: ::c_int = 256;
+pub const SO_LINGER: ::c_int = 128;
+pub const SO_RCVLOWAT: ::c_int = 4100;
+pub const SO_SNDLOWAT: ::c_int = 4099;
+pub const SO_RCVTIMEO: ::c_int = 4102;
+pub const SO_SNDTIMEO: ::c_int = 4101;
+pub const SO_ACCEPTCONN: ::c_int = 4105;
+
+pub const FIOCLEX: ::c_ulong = 0x6601;
+pub const FIONBIO: ::c_ulong = 0x667e;
+
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000008;
+pub const SA_NOCLDWAIT: ::c_int = 0x00010000;
+
+pub const SIGCHLD: ::c_int = 18;
+pub const SIGBUS: ::c_int = 10;
+pub const SIGTTIN: ::c_int = 26;
+pub const SIGTTOU: ::c_int = 27;
+pub const SIGXCPU: ::c_int = 30;
+pub const SIGXFSZ: ::c_int = 31;
+pub const SIGVTALRM: ::c_int = 28;
+pub const SIGPROF: ::c_int = 29;
+pub const SIGWINCH: ::c_int = 20;
+pub const SIGUSR1: ::c_int = 16;
+pub const SIGUSR2: ::c_int = 17;
+pub const SIGCONT: ::c_int = 25;
+pub const SIGSTOP: ::c_int = 23;
+pub const SIGTSTP: ::c_int = 24;
+pub const SIGURG: ::c_int = 21;
+pub const SIGIO: ::c_int = 22;
+pub const SIGSYS: ::c_int = 12;
+pub const SIGPOLL: ::c_int = 22;
+pub const SIGPWR: ::c_int = 19;
+pub const SIG_SETMASK: ::c_int = 3;
+pub const SIG_BLOCK: ::c_int = 0x1;
+pub const SIG_UNBLOCK: ::c_int = 0x2;
+
+pub const POLLRDNORM: ::c_short = 0x040;
+pub const POLLWRNORM: ::c_short = 0x004;
+pub const POLLRDBAND: ::c_short = 0x080;
+pub const POLLWRBAND: ::c_short = 0x100;
+
+pub const PTHREAD_STACK_MIN: ::size_t = 131072;
+
+pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5;
+pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff;
+pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245;
+pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45;
+pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53;
+pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53;
+pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53;
+pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53;
+pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849;
+pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6;
+pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660;
+pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6;
+pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f;
+pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f;
+pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468;
+pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478;
+pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44;
+pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c;
+pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969;
+pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1;
+pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0;
+pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f;
+pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973;
+pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b;
+pub const TMPFS_MAGIC: ::c_long = 0x01021994;
+pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2;
+
+pub const VEOF: usize = 16;
+pub const VEOL: usize = 17;
+pub const VEOL2: usize = 6;
+pub const VMIN: usize = 4;
+pub const IEXTEN: ::tcflag_t = 0x00000100;
+pub const TOSTOP: ::tcflag_t = 0x00008000;
+pub const FLUSHO: ::tcflag_t = 0x00002000;
+pub const IUTF8: ::tcflag_t = 0x00004000;
+pub const TCSANOW: ::c_int = 0x540e;
+pub const TCSADRAIN: ::c_int = 0x540f;
+pub const TCSAFLUSH: ::c_int = 0x5410;
+
+pub const CPU_SETSIZE: ::c_int = 0x400;
+
+pub const PTRACE_TRACEME: ::c_uint = 0;
+pub const PTRACE_PEEKTEXT: ::c_uint = 1;
+pub const PTRACE_PEEKDATA: ::c_uint = 2;
+pub const PTRACE_PEEKUSER: ::c_uint = 3;
+pub const PTRACE_POKETEXT: ::c_uint = 4;
+pub const PTRACE_POKEDATA: ::c_uint = 5;
+pub const PTRACE_POKEUSER: ::c_uint = 6;
+pub const PTRACE_CONT: ::c_uint = 7;
+pub const PTRACE_KILL: ::c_uint = 8;
+pub const PTRACE_SINGLESTEP: ::c_uint = 9;
+pub const PTRACE_ATTACH: ::c_uint = 16;
+pub const PTRACE_DETACH: ::c_uint = 17;
+pub const PTRACE_SYSCALL: ::c_uint = 24;
+pub const PTRACE_SETOPTIONS: ::c_uint = 0x4200;
+pub const PTRACE_GETEVENTMSG: ::c_uint = 0x4201;
+pub const PTRACE_GETSIGINFO: ::c_uint = 0x4202;
+pub const PTRACE_SETSIGINFO: ::c_uint = 0x4203;
+pub const PTRACE_GETFPREGS: ::c_uint = 14;
+pub const PTRACE_SETFPREGS: ::c_uint = 15;
+pub const PTRACE_GETFPXREGS: ::c_uint = 18;
+pub const PTRACE_SETFPXREGS: ::c_uint = 19;
+pub const PTRACE_GETREGS: ::c_uint = 12;
+pub const PTRACE_SETREGS: ::c_uint = 13;
+
+pub const MAP_HUGETLB: ::c_int = 0x080000;
+
+pub const EFD_NONBLOCK: ::c_int = 0x80;
+
+pub const F_GETLK: ::c_int = 14;
+pub const F_GETOWN: ::c_int = 23;
+pub const F_SETOWN: ::c_int = 24;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+
+pub const SFD_NONBLOCK: ::c_int = 0x80;
+
+pub const TCGETS: ::c_ulong = 0x540d;
+pub const TCSETS: ::c_ulong = 0x540e;
+pub const TCSETSW: ::c_ulong = 0x540f;
+pub const TCSETSF: ::c_ulong = 0x5410;
+pub const TCGETA: ::c_ulong = 0x5401;
+pub const TCSETA: ::c_ulong = 0x5402;
+pub const TCSETAW: ::c_ulong = 0x5403;
+pub const TCSETAF: ::c_ulong = 0x5404;
+pub const TCSBRK: ::c_ulong = 0x5405;
+pub const TCXONC: ::c_ulong = 0x5406;
+pub const TCFLSH: ::c_ulong = 0x5407;
+pub const TIOCGSOFTCAR: ::c_ulong = 0x5481;
+pub const TIOCSSOFTCAR: ::c_ulong = 0x5482;
+pub const TIOCINQ: ::c_ulong = 0x467f;
+pub const TIOCLINUX: ::c_ulong = 0x5483;
+pub const TIOCGSERIAL: ::c_ulong = 0x5484;
+pub const TIOCEXCL: ::c_ulong = 0x740d;
+pub const TIOCNXCL: ::c_ulong = 0x740e;
+pub const TIOCSCTTY: ::c_ulong = 0x5480;
+pub const TIOCGPGRP: ::c_ulong = 0x40047477;
+pub const TIOCSPGRP: ::c_ulong = 0x80047476;
+pub const TIOCOUTQ: ::c_ulong = 0x7472;
+pub const TIOCSTI: ::c_ulong = 0x5472;
+pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
+pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
+pub const TIOCMGET: ::c_ulong = 0x741d;
+pub const TIOCMBIS: ::c_ulong = 0x741b;
+pub const TIOCMBIC: ::c_ulong = 0x741c;
+pub const TIOCMSET: ::c_ulong = 0x741a;
+pub const FIONREAD: ::c_ulong = 0x467f;
+pub const TIOCCONS: ::c_ulong = 0x80047478;
+
+pub const RTLD_DEEPBIND: ::c_int = 0x10;
+pub const RTLD_GLOBAL: ::c_int = 0x4;
+pub const RTLD_NOLOAD: ::c_int = 0x8;
+
+pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead;
+pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793;
+pub const LINUX_REBOOT_MAGIC2A: ::c_int = 85072278;
+pub const LINUX_REBOOT_MAGIC2B: ::c_int = 369367448;
+pub const LINUX_REBOOT_MAGIC2C: ::c_int = 537993216;
+
+pub const LINUX_REBOOT_CMD_RESTART: ::c_int = 0x01234567;
+pub const LINUX_REBOOT_CMD_HALT: ::c_int = 0xCDEF0123;
+pub const LINUX_REBOOT_CMD_CAD_ON: ::c_int = 0x89ABCDEF;
+pub const LINUX_REBOOT_CMD_CAD_OFF: ::c_int = 0x00000000;
+pub const LINUX_REBOOT_CMD_POWER_OFF: ::c_int = 0x4321FEDC;
+pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4;
+pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2;
+pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::c_int = 0x00000800;
+pub const TAB2: ::c_int = 0x00001000;
+pub const TAB3: ::c_int = 0x00001800;
+pub const CR1: ::c_int  = 0x00000200;
+pub const CR2: ::c_int  = 0x00000400;
+pub const CR3: ::c_int  = 0x00000600;
+pub const FF1: ::c_int  = 0x00008000;
+pub const BS1: ::c_int  = 0x00002000;
+pub const VT1: ::c_int  = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+
+cfg_if! {
+    if #[cfg(target_arch = "mips")] {
+        mod mips32;
+        pub use self::mips32::*;
+    } else if #[cfg(target_arch = "mips64")] {
+        mod mips64;
+        pub use self::mips64::*;
+    } else {
+        // Unknown target_arch
+    }
+}
deleted file mode 100644
--- a/third_party/rust/libc/src/unix/notbsd/linux/mips64.rs
+++ /dev/null
@@ -1,220 +0,0 @@
-pub type blkcnt_t = i64;
-pub type blksize_t = i64;
-pub type c_char = i8;
-pub type c_long = i64;
-pub type c_ulong = u64;
-pub type fsblkcnt_t = ::c_ulong;
-pub type fsfilcnt_t = ::c_ulong;
-pub type ino_t = u64;
-pub type nlink_t = u64;
-pub type off_t = i64;
-pub type rlim_t = ::c_ulong;
-pub type suseconds_t = i64;
-pub type time_t = i64;
-pub type wchar_t = i32;
-
-s! {
-    pub struct stat {
-        pub st_dev: ::c_ulong,
-        st_pad1: [::c_long; 2],
-        pub st_ino: ::ino_t,
-        pub st_mode: ::mode_t,
-        pub st_nlink: ::nlink_t,
-        pub st_uid: ::uid_t,
-        pub st_gid: ::gid_t,
-        pub st_rdev: ::c_ulong,
-        st_pad2: [::c_ulong; 1],
-        pub st_size: ::off_t,
-        st_pad3: ::c_long,
-        pub st_atime: ::time_t,
-        pub st_atime_nsec: ::c_long,
-        pub st_mtime: ::time_t,
-        pub st_mtime_nsec: ::c_long,
-        pub st_ctime: ::time_t,
-        pub st_ctime_nsec: ::c_long,
-        pub st_blksize: ::blksize_t,
-        st_pad4: ::c_long,
-        pub st_blocks: ::blkcnt_t,
-        st_pad5: [::c_long; 7],
-    }
-
-    pub struct stat64 {
-        pub st_dev: ::c_ulong,
-        st_pad1: [::c_long; 2],
-        pub st_ino: ::ino64_t,
-        pub st_mode: ::mode_t,
-        pub st_nlink: ::nlink_t,
-        pub st_uid: ::uid_t,
-        pub st_gid: ::gid_t,
-        pub st_rdev: ::c_ulong,
-        st_pad2: [::c_long; 2],
-        pub st_size: ::off64_t,
-        pub st_atime: ::time_t,
-        pub st_atime_nsec: ::c_long,
-        pub st_mtime: ::time_t,
-        pub st_mtime_nsec: ::c_long,
-        pub st_ctime: ::time_t,
-        pub st_ctime_nsec: ::c_long,
-        pub st_blksize: ::blksize_t,
-        st_pad3: ::c_long,
-        pub st_blocks: ::blkcnt64_t,
-        st_pad5: [::c_long; 7],
-    }
-
-    pub struct pthread_attr_t {
-        __size: [::c_ulong; 7]
-    }
-
-    pub struct sigaction {
-        pub sa_flags: ::c_int,
-        pub sa_sigaction: ::sighandler_t,
-        pub sa_mask: sigset_t,
-        _restorer: *mut ::c_void,
-    }
-
-    pub struct stack_t {
-        pub ss_sp: *mut ::c_void,
-        pub ss_size: ::size_t,
-        pub ss_flags: ::c_int,
-    }
-
-    pub struct sigset_t {
-        __size: [::c_ulong; 16],
-    }
-
-    pub struct siginfo_t {
-        pub si_signo: ::c_int,
-        pub si_code: ::c_int,
-        pub si_errno: ::c_int,
-        _pad: ::c_int,
-        _pad2: [::c_long; 14],
-    }
-
-    pub struct ipc_perm {
-        pub __key: ::key_t,
-        pub uid: ::uid_t,
-        pub gid: ::gid_t,
-        pub cuid: ::uid_t,
-        pub cgid: ::gid_t,
-        pub mode: ::c_uint,
-        pub __seq: ::c_ushort,
-        __pad1: ::c_ushort,
-        __unused1: ::c_ulong,
-        __unused2: ::c_ulong
-    }
-
-    pub struct shmid_ds {
-        pub shm_perm: ::ipc_perm,
-        pub shm_segsz: ::size_t,
-        pub shm_atime: ::time_t,
-        pub shm_dtime: ::time_t,
-        pub shm_ctime: ::time_t,
-        pub shm_cpid: ::pid_t,
-        pub shm_lpid: ::pid_t,
-        pub shm_nattch: ::shmatt_t,
-        __unused4: ::c_ulong,
-        __unused5: ::c_ulong
-    }
-
-    pub struct statfs {
-        pub f_type: ::c_long,
-        pub f_bsize: ::c_long,
-        pub f_frsize: ::c_long,
-        pub f_blocks: ::fsblkcnt_t,
-        pub f_bfree: ::fsblkcnt_t,
-        pub f_files: ::fsblkcnt_t,
-        pub f_ffree: ::fsblkcnt_t,
-        pub f_bavail: ::fsblkcnt_t,
-        pub f_fsid: ::fsid_t,
-
-        pub f_namelen: ::c_long,
-        f_spare: [::c_long; 6],
-    }
-
-    pub struct msghdr {
-        pub msg_name: *mut ::c_void,
-        pub msg_namelen: ::socklen_t,
-        pub msg_iov: *mut ::iovec,
-        pub msg_iovlen: ::size_t,
-        pub msg_control: *mut ::c_void,
-        pub msg_controllen: ::size_t,
-        pub msg_flags: ::c_int,
-    }
-
-    pub struct termios {
-        pub c_iflag: ::tcflag_t,
-        pub c_oflag: ::tcflag_t,
-        pub c_cflag: ::tcflag_t,
-        pub c_lflag: ::tcflag_t,
-        pub c_line: ::cc_t,
-        pub c_cc: [::cc_t; ::NCCS],
-    }
-
-    pub struct sysinfo {
-        pub uptime: ::c_long,
-        pub loads: [::c_ulong; 3],
-        pub totalram: ::c_ulong,
-        pub freeram: ::c_ulong,
-        pub sharedram: ::c_ulong,
-        pub bufferram: ::c_ulong,
-        pub totalswap: ::c_ulong,
-        pub freeswap: ::c_ulong,
-        pub procs: ::c_ushort,
-        pub pad: ::c_ushort,
-        pub totalhigh: ::c_ulong,
-        pub freehigh: ::c_ulong,
-        pub mem_unit: ::c_uint,
-        pub _f: [::c_char; 0],
-    }
-
-    // FIXME this is actually a union
-    pub struct sem_t {
-        __size: [::c_char; 32],
-        __align: [::c_long; 0],
-    }
-}
-
-pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
-pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
-pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
-pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
-
-pub const EADDRINUSE: ::c_int = 125;
-pub const EADDRNOTAVAIL: ::c_int = 126;
-pub const ECONNABORTED: ::c_int = 130;
-pub const ECONNREFUSED: ::c_int = 146;
-pub const ECONNRESET: ::c_int = 131;
-pub const EDEADLK: ::c_int = 45;
-pub const ENOSYS: ::c_int = 89;
-pub const ENOTCONN: ::c_int = 134;
-pub const ETIMEDOUT: ::c_int = 145;
-pub const FIOCLEX: ::c_ulong = 0x6601;
-pub const FIONBIO: ::c_ulong = 0x667e;
-pub const MAP_ANON: ::c_int = 0x800;
-pub const O_ACCMODE: ::c_int = 3;
-pub const O_APPEND: ::c_int = 8;
-pub const O_CREAT: ::c_int = 256;
-pub const O_EXCL: ::c_int = 1024;
-pub const O_NONBLOCK: ::c_int = 128;
-pub const POSIX_FADV_DONTNEED: ::c_int = 4;
-pub const POSIX_FADV_NOREUSE: ::c_int = 5;
-pub const PTHREAD_STACK_MIN: ::size_t = 131072;
-pub const RLIM_INFINITY: ::rlim_t = 0xffffffffffffffff;
-pub const SA_ONSTACK: ::c_int = 0x08000000;
-pub const SA_SIGINFO: ::c_int = 0x00000008;
-pub const SIGBUS: ::c_int = 10;
-pub const SIGSTKSZ: ::size_t = 0x2000;
-pub const SIG_SETMASK: ::c_int = 3;
-pub const SOCK_DGRAM: ::c_int = 1;
-pub const SOCK_STREAM: ::c_int = 2;
-pub const SOL_SOCKET: ::c_int = 0xffff;
-pub const SO_BROADCAST: ::c_int = 32;
-pub const SO_ERROR: ::c_int = 4103;
-pub const SO_RCVTIMEO: ::c_int = 4102;
-pub const SO_REUSEADDR: ::c_int = 4;
-pub const SO_SNDTIMEO: ::c_int = 4101;
-
-#[link(name = "util")]
-extern {
-    pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
-}
--- a/third_party/rust/libc/src/unix/notbsd/linux/mod.rs
+++ b/third_party/rust/libc/src/unix/notbsd/linux/mod.rs
@@ -6,19 +6,20 @@ pub type useconds_t = u32;
 pub type dev_t = u64;
 pub type socklen_t = u32;
 pub type pthread_t = c_ulong;
 pub type mode_t = u32;
 pub type ino64_t = u64;
 pub type off64_t = i64;
 pub type blkcnt64_t = i64;
 pub type rlim64_t = u64;
-pub type key_t = ::c_int;
 pub type shmatt_t = ::c_ulong;
 pub type mqd_t = ::c_int;
+pub type msgqnum_t = ::c_ulong;
+pub type msglen_t = ::c_ulong;
 pub type nfds_t = ::c_ulong;
 pub type nl_item = ::c_int;
 
 pub enum fpos64_t {} // TODO: fill this out with a struct
 
 s! {
     pub struct dirent {
         pub d_ino: ::ino_t,
@@ -60,31 +61,31 @@ s! {
         pub ifa_flags: ::c_uint,
         pub ifa_addr: *mut ::sockaddr,
         pub ifa_netmask: *mut ::sockaddr,
         pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union
         pub ifa_data: *mut ::c_void
     }
 
     pub struct pthread_mutex_t {
-        #[cfg(any(target_arch = "mips", target_arch = "mipsel",
-                  target_arch = "arm", target_arch = "powerpc"))]
+        #[cfg(any(target_arch = "mips", target_arch = "arm",
+                  target_arch = "powerpc"))]
         __align: [::c_long; 0],
-        #[cfg(not(any(target_arch = "mips", target_arch = "mipsel",
-                      target_arch = "arm", target_arch = "powerpc")))]
+        #[cfg(not(any(target_arch = "mips", target_arch = "arm",
+                      target_arch = "powerpc")))]
         __align: [::c_longlong; 0],
         size: [u8; __SIZEOF_PTHREAD_MUTEX_T],
     }
 
     pub struct pthread_rwlock_t {
-        #[cfg(any(target_arch = "mips", target_arch = "mipsel",
-                  target_arch = "arm", target_arch = "powerpc"))]
+        #[cfg(any(target_arch = "mips", target_arch = "arm",
+                  target_arch = "powerpc"))]
         __align: [::c_long; 0],
-        #[cfg(not(any(target_arch = "mips", target_arch = "mipsel",
-                      target_arch = "arm", target_arch = "powerpc")))]
+        #[cfg(not(any(target_arch = "mips", target_arch = "arm",
+                      target_arch = "powerpc")))]
         __align: [::c_longlong; 0],
         size: [u8; __SIZEOF_PTHREAD_RWLOCK_T],
     }
 
     pub struct pthread_mutexattr_t {
         #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64",
                   target_arch = "mips64", target_arch = "s390x"))]
         __align: [::c_int; 0],
@@ -112,28 +113,43 @@ s! {
         pub pw_passwd: *mut ::c_char,
         pub pw_uid: ::uid_t,
         pub pw_gid: ::gid_t,
         pub pw_gecos: *mut ::c_char,
         pub pw_dir: *mut ::c_char,
         pub pw_shell: *mut ::c_char,
     }
 
+    pub struct spwd {
+        pub sp_namp: *mut ::c_char,
+        pub sp_pwdp: *mut ::c_char,
+        pub sp_lstchg: ::c_long,
+        pub sp_min: ::c_long,
+        pub sp_max: ::c_long,
+        pub sp_warn: ::c_long,
+        pub sp_inact: ::c_long,
+        pub sp_expire: ::c_long,
+        pub sp_flag: ::c_ulong,
+    }
+
     pub struct statvfs {
         pub f_bsize: ::c_ulong,
         pub f_frsize: ::c_ulong,
         pub f_blocks: ::fsblkcnt_t,
         pub f_bfree: ::fsblkcnt_t,
         pub f_bavail: ::fsblkcnt_t,
         pub f_files: ::fsfilcnt_t,
         pub f_ffree: ::fsfilcnt_t,
         pub f_favail: ::fsfilcnt_t,
+        #[cfg(target_endian = "little")]
         pub f_fsid: ::c_ulong,
         #[cfg(target_pointer_width = "32")]
-        pub __f_unused: ::c_int,
+        __f_unused: ::c_int,
+        #[cfg(target_endian = "big")]
+        pub f_fsid: ::c_ulong,
         pub f_flag: ::c_ulong,
         pub f_namemax: ::c_ulong,
         __f_spare: [::c_int; 6],
     }
 
     pub struct dqblk {
         pub dqb_bhardlimit: ::uint64_t,
         pub dqb_bsoftlimit: ::uint64_t,
@@ -185,16 +201,27 @@ s! {
         bits: [u64; 16],
     }
 
     pub struct if_nameindex {
         pub if_index: ::c_uint,
         pub if_name: *mut ::c_char,
     }
 
+    // System V IPC
+    pub struct msginfo {
+        pub msgpool: ::c_int,
+        pub msgmap: ::c_int,
+        pub msgmax: ::c_int,
+        pub msgmnb: ::c_int,
+        pub msgmni: ::c_int,
+        pub msgssz: ::c_int,
+        pub msgtql: ::c_int,
+        pub msgseg: ::c_ushort,
+    }
 }
 
 pub const ABDAY_1: ::nl_item = 0x20000;
 pub const ABDAY_2: ::nl_item = 0x20001;
 pub const ABDAY_3: ::nl_item = 0x20002;
 pub const ABDAY_4: ::nl_item = 0x20003;
 pub const ABDAY_5: ::nl_item = 0x20004;
 pub const ABDAY_6: ::nl_item = 0x20005;
@@ -216,16 +243,18 @@ pub const ABMON_5: ::nl_item = 0x20012;
 pub const ABMON_6: ::nl_item = 0x20013;
 pub const ABMON_7: ::nl_item = 0x20014;
 pub const ABMON_8: ::nl_item = 0x20015;
 pub const ABMON_9: ::nl_item = 0x20016;
 pub const ABMON_10: ::nl_item = 0x20017;
 pub const ABMON_11: ::nl_item = 0x20018;
 pub const ABMON_12: ::nl_item = 0x20019;
 
+pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
+
 pub const MON_1: ::nl_item = 0x2001A;
 pub const MON_2: ::nl_item = 0x2001B;
 pub const MON_3: ::nl_item = 0x2001C;
 pub const MON_4: ::nl_item = 0x2001D;
 pub const MON_5: ::nl_item = 0x2001E;
 pub const MON_6: ::nl_item = 0x2001F;
 pub const MON_7: ::nl_item = 0x20020;
 pub const MON_8: ::nl_item = 0x20021;
@@ -247,16 +276,19 @@ pub const ERA_D_FMT: ::nl_item = 0x2002E
 pub const ALT_DIGITS: ::nl_item = 0x2002F;
 pub const ERA_D_T_FMT: ::nl_item = 0x20030;
 pub const ERA_T_FMT: ::nl_item = 0x20031;
 
 pub const CODESET: ::nl_item = 14;
 
 pub const CRNCYSTR: ::nl_item = 0x4000F;
 
+pub const RUSAGE_THREAD: ::c_int = 1;
+pub const RUSAGE_CHILDREN: ::c_int = -1;
+
 pub const RADIXCHAR: ::nl_item = 0x10000;
 pub const THOUSEP: ::nl_item = 0x10001;
 
 pub const YESEXPR: ::nl_item = 0x50000;
 pub const NOEXPR: ::nl_item = 0x50001;
 pub const YESSTR: ::nl_item = 0x50002;
 pub const NOSTR: ::nl_item = 0x50003;
 
@@ -425,24 +457,33 @@ pub const PTHREAD_MUTEX_DEFAULT: ::c_int
 pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
 
 pub const SCHED_OTHER: ::c_int = 0;
 pub const SCHED_FIFO: ::c_int = 1;
 pub const SCHED_RR: ::c_int = 2;
 pub const SCHED_BATCH: ::c_int = 3;
 pub const SCHED_IDLE: ::c_int = 5;
 
+// System V IPC
+pub const IPC_PRIVATE: ::key_t = 0;
+
 pub const IPC_CREAT: ::c_int = 0o1000;
 pub const IPC_EXCL: ::c_int = 0o2000;
 pub const IPC_NOWAIT: ::c_int = 0o4000;
 
 pub const IPC_RMID: ::c_int = 0;
 pub const IPC_SET: ::c_int = 1;
 pub const IPC_STAT: ::c_int = 2;
 pub const IPC_INFO: ::c_int = 3;
+pub const MSG_STAT: ::c_int = 11;
+pub const MSG_INFO: ::c_int = 12;
+
+pub const MSG_NOERROR: ::c_int = 0o10000;
+pub const MSG_EXCEPT: ::c_int = 0o20000;
+pub const MSG_COPY: ::c_int = 0o40000;
 
 pub const SHM_R: ::c_int = 0o400;
 pub const SHM_W: ::c_int = 0o200;
 
 pub const SHM_RDONLY: ::c_int = 0o10000;
 pub const SHM_RND: ::c_int = 0o20000;
 pub const SHM_REMAP: ::c_int = 0o40000;
 pub const SHM_EXEC: ::c_int = 0o100000;
@@ -460,34 +501,43 @@ pub const QFMT_VFS_OLD: ::c_int = 1;
 pub const QFMT_VFS_V0: ::c_int = 2;
 
 pub const SFD_CLOEXEC: ::c_int = 0x080000;
 
 pub const EFD_SEMAPHORE: ::c_int = 0x1;
 
 pub const NCCS: usize = 32;
 
-pub const AF_NETLINK: ::c_int = 16;
-
 pub const LOG_NFACILITIES: ::c_int = 24;
 
 pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t;
 
 pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32;
 pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32;
 pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32;
 pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32;
 pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32;
 pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2u32 as i32;
 pub const RB_KEXEC: ::c_int = 0x45584543u32 as i32;
 
 pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1;
 pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2;
 pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4;
 
+pub const EAI_SYSTEM: ::c_int = -11;
+
+pub const AIO_CANCELED: ::c_int = 0;
+pub const AIO_NOTCANCELED: ::c_int = 1;
+pub const AIO_ALLDONE: ::c_int = 2;
+pub const LIO_READ: ::c_int = 0;
+pub const LIO_WRITE: ::c_int = 1;
+pub const LIO_NOP: ::c_int = 2;
+pub const LIO_WAIT: ::c_int = 0;
+pub const LIO_NOWAIT: ::c_int = 1;
+
 f! {
     pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
         for slot in cpuset.bits.iter_mut() {
             *slot = 0;
         }
     }
 
     pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
@@ -511,30 +561,56 @@ f! {
     }
 
     pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
         set1.bits == set2.bits
     }
 }
 
 extern {
+    pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
+    pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
+    pub fn aio_suspend(aiocb_list: *const *const aiocb, nitems: ::c_int,
+                       timeout: *const ::timespec) -> ::c_int;
+    pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+    pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb,
+                      nitems: ::c_int, sevp: *mut ::sigevent) -> ::c_int;
+
     pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
 
     pub fn setpwent();
     pub fn getpwent() -> *mut passwd;
+    pub fn setspent();
+    pub fn endspent();
+    pub fn getspent() -> *mut spwd;
+    pub fn getspnam(__name: *const ::c_char) -> *mut spwd;
+
     pub fn shm_open(name: *const c_char, oflag: ::c_int,
                     mode: mode_t) -> ::c_int;
+
+    // System V IPC
     pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
     pub fn shmat(shmid: ::c_int,
                  shmaddr: *const ::c_void,
                  shmflg: ::c_int) -> *mut ::c_void;
     pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
     pub fn shmctl(shmid: ::c_int,
                   cmd: ::c_int,
                   buf: *mut ::shmid_ds) -> ::c_int;
+    pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
+    pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
+    pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
+    pub fn msgrcv(msqid: ::c_int, msgp: *mut ::c_void, msgsz: ::size_t,
+                  msgtyp: ::c_long, msgflg: ::c_int) -> ::ssize_t;
+    pub fn msgsnd(msqid: ::c_int, msgp: *const ::c_void, msgsz: ::size_t,
+                  msgflg: ::c_int) -> ::c_int;
+
     pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
                     -> ::c_int;
     pub fn __errno_location() -> *mut ::c_int;
 
     pub fn fopen64(filename: *const c_char,
                    mode: *const c_char) -> *mut ::FILE;
     pub fn freopen64(filename: *const c_char, mode: *const c_char,
                      file: *mut ::FILE) -> *mut ::FILE;
@@ -653,37 +729,42 @@ extern {
                             flags: ::c_ulong) -> isize;
     pub fn process_vm_writev(pid: ::pid_t,
                              local_iov: *const ::iovec,
                              liovcnt: ::c_ulong,
                              remote_iov: *const ::iovec,
                              riovcnt: ::c_ulong,
                              flags: ::c_ulong) -> isize;
     pub fn reboot(how_to: ::c_int) -> ::c_int;
+    pub fn setfsgid(gid: ::gid_t) -> ::c_int;
+    pub fn setfsuid(uid: ::uid_t) -> ::c_int;
+    pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
+    pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
 
     // Not available now on Android
     pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
                     mode: ::mode_t) -> ::c_int;
     pub fn if_nameindex() -> *mut if_nameindex;
     pub fn if_freenameindex(ptr: *mut if_nameindex);
     pub fn sync_file_range(fd: ::c_int, offset: ::off64_t,
                            nbytes: ::off64_t, flags: ::c_uint) -> ::c_int;
+    pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
+    pub fn freeifaddrs(ifa: *mut ::ifaddrs);
 }
 
 cfg_if! {
     if #[cfg(any(target_env = "musl",
+                 target_os = "fuchsia",
                  target_os = "emscripten"))] {
         mod musl;
         pub use self::musl::*;
-    } else if #[cfg(any(target_arch = "mips", target_arch = "mipsel"))] {
+    } else if #[cfg(any(target_arch = "mips",
+                        target_arch = "mips64"))] {
         mod mips;
         pub use self::mips::*;
     } else if #[cfg(any(target_arch = "s390x"))] {
         mod s390x;
         pub use self::s390x::*;
-    } else if #[cfg(any(target_arch = "mips64"))] {
-        mod mips64;
-        pub use self::mips64::*;
     } else {
         mod other;
         pub use self::other::*;
     }
 }
--- a/third_party/rust/libc/src/unix/notbsd/linux/musl/b32/arm.rs
+++ b/third_party/rust/libc/src/unix/notbsd/linux/musl/b32/arm.rs
@@ -63,16 +63,33 @@ s! {
         __unused3: ::c_int,
         pub shm_cpid: ::pid_t,
         pub shm_lpid: ::pid_t,
         pub shm_nattch: ::c_ulong,
         __pad1: ::c_ulong,
         __pad2: ::c_ulong,
     }
 
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __unused1: ::c_int,
+        pub msg_rtime: ::time_t,
+        __unused2: ::c_int,
+        pub msg_ctime: ::time_t,
+        __unused3: ::c_int,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
     pub struct statfs {
         pub f_type: ::c_ulong,
         pub f_bsize: ::c_ulong,
         pub f_blocks: ::fsblkcnt_t,
         pub f_bfree: ::fsblkcnt_t,
         pub f_bavail: ::fsblkcnt_t,
         pub f_files: ::fsfilcnt_t,
         pub f_ffree: ::fsfilcnt_t,
@@ -174,16 +191,17 @@ pub const EUSERS: ::c_int = 87;
 pub const ENOTSOCK: ::c_int = 88;
 pub const EDESTADDRREQ: ::c_int = 89;
 pub const EMSGSIZE: ::c_int = 90;
 pub const EPROTOTYPE: ::c_int = 91;
 pub const ENOPROTOOPT: ::c_int = 92;
 pub const EPROTONOSUPPORT: ::c_int = 93;
 pub const ESOCKTNOSUPPORT: ::c_int = 94;
 pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
 pub const EPFNOSUPPORT: ::c_int = 96;
 pub const EAFNOSUPPORT: ::c_int = 97;
 pub const EADDRINUSE: ::c_int = 98;
 pub const EADDRNOTAVAIL: ::c_int = 99;
 pub const ENETDOWN: ::c_int = 100;
 pub const ENETUNREACH: ::c_int = 101;
 pub const ENETRESET: ::c_int = 102;
 pub const ECONNABORTED: ::c_int = 103;
@@ -310,12 +328,10 @@ pub const TIOCMBIS: ::c_int = 0x5416;
 pub const TIOCMBIC: ::c_int = 0x5417;
 pub const TIOCMSET: ::c_int = 0x5418;
 pub const FIONREAD: ::c_int = 0x541B;
 pub const TIOCCONS: ::c_int = 0x541D;
 
 pub const SYS_gettid: ::c_long = 224;
 pub const SYS_perf_event_open: ::c_long = 364;
 
-pub const POSIX_MADV_DONTNEED: ::c_int = 0;
-pub const RUSAGE_CHILDREN: ::c_int = 1;
 pub const POLLWRNORM: ::c_short = 0x100;
 pub const POLLWRBAND: ::c_short = 0x200;
--- a/third_party/rust/libc/src/unix/notbsd/linux/musl/b32/asmjs.rs
+++ b/third_party/rust/libc/src/unix/notbsd/linux/musl/b32/asmjs.rs
@@ -63,16 +63,33 @@ s! {
         __unused3: ::c_int,
         pub shm_cpid: ::pid_t,
         pub shm_lpid: ::pid_t,
         pub shm_nattch: ::c_ulong,
         __pad1: ::c_ulong,
         __pad2: ::c_ulong,
     }
 
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __unused1: ::c_int,
+        pub msg_rtime: ::time_t,
+        __unused2: ::c_int,
+        pub msg_ctime: ::time_t,
+        __unused3: ::c_int,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
     pub struct statfs {
         pub f_type: ::c_ulong,
         pub f_bsize: ::c_ulong,
         pub f_blocks: ::fsblkcnt_t,
         pub f_bfree: ::fsblkcnt_t,
         pub f_bavail: ::fsblkcnt_t,
         pub f_files: ::fsfilcnt_t,
         pub f_ffree: ::fsfilcnt_t,
@@ -174,16 +191,17 @@ pub const EUSERS: ::c_int = 87;
 pub const ENOTSOCK: ::c_int = 88;
 pub const EDESTADDRREQ: ::c_int = 89;
 pub const EMSGSIZE: ::c_int = 90;
 pub const EPROTOTYPE: ::c_int = 91;
 pub const ENOPROTOOPT: ::c_int = 92;
 pub const EPROTONOSUPPORT: ::c_int = 93;
 pub const ESOCKTNOSUPPORT: ::c_int = 94;
 pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
 pub const EPFNOSUPPORT: ::c_int = 96;
 pub const EAFNOSUPPORT: ::c_int = 97;
 pub const EADDRINUSE: ::c_int = 98;
 pub const EADDRNOTAVAIL: ::c_int = 99;
 pub const ENETDOWN: ::c_int = 100;
 pub const ENETUNREACH: ::c_int = 101;
 pub const ENETRESET: ::c_int = 102;
 pub const ECONNABORTED: ::c_int = 103;
@@ -309,12 +327,10 @@ pub const TIOCMGET: ::c_int = 0x5415;
 pub const TIOCMBIS: ::c_int = 0x5416;
 pub const TIOCMBIC: ::c_int = 0x5417;
 pub const TIOCMSET: ::c_int = 0x5418;
 pub const FIONREAD: ::c_int = 0x541B;
 pub const TIOCCONS: ::c_int = 0x541D;
 
 pub const SYS_gettid: ::c_long = 224; // Valid for arm (32-bit) and x86 (32-bit)
 
-pub const POSIX_MADV_DONTNEED: ::c_int = 0;
-pub const RUSAGE_CHILDREN: ::c_int = 1;
 pub const POLLWRNORM: ::c_short = 0x100;
 pub const POLLWRBAND: ::c_short = 0x200;
--- a/third_party/rust/libc/src/unix/notbsd/linux/musl/b32/mips.rs
+++ b/third_party/rust/libc/src/unix/notbsd/linux/musl/b32/mips.rs
@@ -62,16 +62,42 @@ s! {
         pub shm_ctime: ::time_t,
         pub shm_cpid: ::pid_t,
         pub shm_lpid: ::pid_t,
         pub shm_nattch: ::c_ulong,
         __pad1: ::c_ulong,
         __pad2: ::c_ulong,
     }
 
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        #[cfg(target_endian = "big")]
+        __unused1: ::c_int,
+        pub msg_stime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __unused1: ::c_int,
+        #[cfg(target_endian = "big")]
+        __unused2: ::c_int,
+        pub msg_rtime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __unused2: ::c_int,
+        #[cfg(target_endian = "big")]
+        __unused3: ::c_int,
+        pub msg_ctime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __unused3: ::c_int,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
     pub struct statfs {
         pub f_type: ::c_ulong,
         pub f_bsize: ::c_ulong,
         pub f_frsize: ::c_ulong,
         pub f_blocks: ::fsblkcnt_t,
         pub f_bfree: ::fsblkcnt_t,
         pub f_files: ::fsfilcnt_t,
         pub f_ffree: ::fsfilcnt_t,
@@ -167,16 +193,17 @@ pub const EUSERS: ::c_int = 94;
 pub const ENOTSOCK: ::c_int = 95;
 pub const EDESTADDRREQ: ::c_int = 96;
 pub const EMSGSIZE: ::c_int = 97;
 pub const EPROTOTYPE: ::c_int = 98;
 pub const ENOPROTOOPT: ::c_int = 99;
 pub const EPROTONOSUPPORT: ::c_int = 120;
 pub const ESOCKTNOSUPPORT: ::c_int = 121;
 pub const EOPNOTSUPP: ::c_int = 122;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
 pub const EPFNOSUPPORT: ::c_int = 123;
 pub const EAFNOSUPPORT: ::c_int = 124;
 pub const EADDRINUSE: ::c_int = 125;
 pub const EADDRNOTAVAIL: ::c_int = 126;
 pub const ENETDOWN: ::c_int = 127;
 pub const ENETUNREACH: ::c_int = 128;
 pub const ENETRESET: ::c_int = 129;
 pub const ECONNABORTED: ::c_int = 130;
@@ -309,12 +336,10 @@ pub const TIOCMBIS: ::c_int = 0x741B;
 pub const TIOCMBIC: ::c_int = 0x741C;
 pub const TIOCMSET: ::c_int = 0x741A;
 pub const FIONREAD: ::c_int = 0x467F;
 pub const TIOCCONS: ::c_int = 0x80047478;
 
 pub const SYS_gettid: ::c_long = 4222;   // Valid for O32
 pub const SYS_perf_event_open: ::c_long = 4333;  // Valid for O32
 
-pub const POSIX_MADV_DONTNEED: ::c_int = 4;
-pub const RUSAGE_CHILDREN: ::c_int = !0;
 pub const POLLWRNORM: ::c_short = 0x4;
 pub const POLLWRBAND: ::c_short = 0x100;
--- a/third_party/rust/libc/src/unix/notbsd/linux/musl/b32/x86.rs
+++ b/third_party/rust/libc/src/unix/notbsd/linux/musl/b32/x86.rs
@@ -63,16 +63,33 @@ s! {
         __unused3: ::c_int,
         pub shm_cpid: ::pid_t,
         pub shm_lpid: ::pid_t,
         pub shm_nattch: ::c_ulong,
         __pad1: ::c_ulong,
         __pad2: ::c_ulong,
     }
 
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __unused1: ::c_int,
+        pub msg_rtime: ::time_t,
+        __unused2: ::c_int,
+        pub msg_ctime: ::time_t,
+        __unused3: ::c_int,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
     pub struct statfs {
         pub f_type: ::c_ulong,
         pub f_bsize: ::c_ulong,
         pub f_blocks: ::fsblkcnt_t,
         pub f_bfree: ::fsblkcnt_t,
         pub f_bavail: ::fsblkcnt_t,
         pub f_files: ::fsfilcnt_t,
         pub f_ffree: ::fsfilcnt_t,
@@ -187,16 +204,17 @@ pub const EUSERS: ::c_int = 87;
 pub const ENOTSOCK: ::c_int = 88;
 pub const EDESTADDRREQ: ::c_int = 89;
 pub const EMSGSIZE: ::c_int = 90;
 pub const EPROTOTYPE: ::c_int = 91;
 pub const ENOPROTOOPT: ::c_int = 92;
 pub const EPROTONOSUPPORT: ::c_int = 93;
 pub const ESOCKTNOSUPPORT: ::c_int = 94;
 pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
 pub const EPFNOSUPPORT: ::c_int = 96;
 pub const EAFNOSUPPORT: ::c_int = 97;
 pub const EADDRINUSE: ::c_int = 98;
 pub const EADDRNOTAVAIL: ::c_int = 99;
 pub const ENETDOWN: ::c_int = 100;
 pub const ENETUNREACH: ::c_int = 101;
 pub const ENETRESET: ::c_int = 102;
 pub const ECONNABORTED: ::c_int = 103;
@@ -324,12 +342,10 @@ pub const TIOCMBIS: ::c_int = 0x5416;
 pub const TIOCMBIC: ::c_int = 0x5417;
 pub const TIOCMSET: ::c_int = 0x5418;
 pub const FIONREAD: ::c_int = 0x541B;
 pub const TIOCCONS: ::c_int = 0x541D;
 
 pub const SYS_gettid: ::c_long = 224;
 pub const SYS_perf_event_open: ::c_long = 336;
 
-pub const POSIX_MADV_DONTNEED: ::c_int = 0;
-pub const RUSAGE_CHILDREN: ::c_int = 1;
 pub const POLLWRNORM: ::c_short = 0x100;
 pub const POLLWRBAND: ::c_short = 0x200;
--- a/third_party/rust/libc/src/unix/notbsd/linux/musl/b64/mod.rs
+++ b/third_party/rust/libc/src/unix/notbsd/linux/musl/b64/mod.rs
@@ -68,16 +68,30 @@ s! {
         pub shm_ctime: ::time_t,
         pub shm_cpid: ::pid_t,
         pub shm_lpid: ::pid_t,
         pub shm_nattch: ::c_ulong,
         __pad1: ::c_ulong,
         __pad2: ::c_ulong,
     }
 
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
     pub struct statfs {
         pub f_type: ::c_ulong,
         pub f_bsize: ::c_ulong,
         pub f_blocks: ::fsblkcnt_t,
         pub f_bfree: ::fsblkcnt_t,
         pub f_bavail: ::fsblkcnt_t,
         pub f_files: ::fsfilcnt_t,
         pub f_ffree: ::fsfilcnt_t,
@@ -199,16 +213,17 @@ pub const EUSERS: ::c_int = 87;
 pub const ENOTSOCK: ::c_int = 88;
 pub const EDESTADDRREQ: ::c_int = 89;
 pub const EMSGSIZE: ::c_int = 90;
 pub const EPROTOTYPE: ::c_int = 91;
 pub const ENOPROTOOPT: ::c_int = 92;
 pub const EPROTONOSUPPORT: ::c_int = 93;
 pub const ESOCKTNOSUPPORT: ::c_int = 94;
 pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
 pub const EPFNOSUPPORT: ::c_int = 96;
 pub const EAFNOSUPPORT: ::c_int = 97;
 pub const EADDRINUSE: ::c_int = 98;
 pub const EADDRNOTAVAIL: ::c_int = 99;
 pub const ENETDOWN: ::c_int = 100;
 pub const ENETUNREACH: ::c_int = 101;
 pub const ENETRESET: ::c_int = 102;
 pub const ECONNABORTED: ::c_int = 103;
@@ -332,18 +347,16 @@ pub const TIOCGWINSZ: ::c_int = 0x5413;
 pub const TIOCSWINSZ: ::c_int = 0x5414;
 pub const TIOCMGET: ::c_int = 0x5415;
 pub const TIOCMBIS: ::c_int = 0x5416;
 pub const TIOCMBIC: ::c_int = 0x5417;
 pub const TIOCMSET: ::c_int = 0x5418;
 pub const FIONREAD: ::c_int = 0x541B;
 pub const TIOCCONS: ::c_int = 0x541D;
 
-pub const POSIX_MADV_DONTNEED: ::c_int = 0;
-pub const RUSAGE_CHILDREN: ::c_int = 1;
 pub const POLLWRNORM: ::c_short = 0x100;
 pub const POLLWRBAND: ::c_short = 0x200;
 
 cfg_if! {
     if #[cfg(target_arch = "aarch64")] {
         mod aarch64;
         pub use self::aarch64::*;
     } else if #[cfg(any(target_arch = "powerpc64"))] {
--- a/third_party/rust/libc/src/unix/notbsd/linux/musl/mod.rs
+++ b/third_party/rust/libc/src/unix/notbsd/linux/musl/mod.rs
@@ -6,16 +6,36 @@ pub type off_t = i64;
 pub type blkcnt_t = i64;
 
 pub type blksize_t = c_long;
 pub type fsblkcnt_t = ::c_ulonglong;
 pub type fsfilcnt_t = ::c_ulonglong;
 pub type rlim_t = ::c_ulonglong;
 
 s! {
+    pub struct aiocb {
+        pub aio_fildes: ::c_int,
+        pub aio_lio_opcode: ::c_int,
+        pub aio_reqprio: ::c_int,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        pub aio_sigevent: ::sigevent,
+        __td: *mut ::c_void,
+        __lock: [::c_int; 2],
+        __err: ::c_int,
+        __ret: ::ssize_t,
+        pub aio_offset: off_t,
+        __next: *mut ::c_void,
+        __prev: *mut ::c_void,
+        #[cfg(target_pointer_width = "32")]
+        __dummy4: [::c_char; 24],
+        #[cfg(target_pointer_width = "64")]
+        __dummy4: [::c_char; 16],
+    }
+
     pub struct sigaction {
         pub sa_sigaction: ::sighandler_t,
         pub sa_mask: ::sigset_t,
         pub sa_flags: ::c_int,
         _restorer: *mut ::c_void,
     }
 
     pub struct ipc_perm {
@@ -72,16 +92,18 @@ pub const TMP_MAX: ::c_uint = 10000;
 pub const FOPEN_MAX: ::c_uint = 1000;
 pub const O_ACCMODE: ::c_int = 0o10000003;
 pub const O_NDELAY: ::c_int = O_NONBLOCK;
 pub const NI_MAXHOST: ::socklen_t = 255;
 pub const PTHREAD_STACK_MIN: ::size_t = 2048;
 pub const POSIX_FADV_DONTNEED: ::c_int = 4;
 pub const POSIX_FADV_NOREUSE: ::c_int = 5;
 
+pub const POSIX_MADV_DONTNEED: ::c_int = 4;
+
 pub const RLIM_INFINITY: ::rlim_t = !0;
 pub const RLIMIT_RTTIME: ::c_int = 15;
 pub const RLIMIT_NLIMITS: ::c_int = 16;
 
 pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
 
 pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
 pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
@@ -224,17 +246,17 @@ pub const NOFLSH: ::tcflag_t = 0x0000008
 extern {
     pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
     pub fn ptrace(request: ::c_int, ...) -> ::c_long;
     pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
     pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
 }
 
 cfg_if! {
-    if #[cfg(any(target_arch = "x86_64"))] {
+    if #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] {
         mod b64;
         pub use self::b64::*;
     } else if #[cfg(any(target_arch = "x86",
                         target_arch = "mips",
                         target_arch = "arm",
                         target_arch = "asmjs",
                         target_arch = "wasm32"))] {
         mod b32;
--- a/third_party/rust/libc/src/unix/notbsd/linux/other/b32/arm.rs
+++ b/third_party/rust/libc/src/unix/notbsd/linux/other/b32/arm.rs
@@ -48,16 +48,33 @@ s! {
         pub shm_ctime: ::time_t,
         __unused3: ::c_ulong,
         pub shm_cpid: ::pid_t,
         pub shm_lpid: ::pid_t,
         pub shm_nattch: ::shmatt_t,
         __unused4: ::c_ulong,
         __unused5: ::c_ulong
     }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __glibc_reserved1: ::c_ulong,
+        pub msg_rtime: ::time_t,
+        __glibc_reserved2: ::c_ulong,
+        pub msg_ctime: ::time_t,
+        __glibc_reserved3: ::c_ulong,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
 }
 
 pub const O_DIRECT: ::c_int = 0x10000;
 pub const O_DIRECTORY: ::c_int = 0x4000;
 pub const O_NOFOLLOW: ::c_int = 0x8000;
 
 pub const MAP_LOCKED: ::c_int = 0x02000;
 pub const MAP_NORESERVE: ::c_int = 0x04000;
--- a/third_party/rust/libc/src/unix/notbsd/linux/other/b32/powerpc.rs
+++ b/third_party/rust/libc/src/unix/notbsd/linux/other/b32/powerpc.rs
@@ -48,16 +48,33 @@ s! {
         __glibc_reserved4: ::c_uint,
         pub shm_segsz: ::size_t,
         pub shm_cpid: ::pid_t,
         pub shm_lpid: ::pid_t,
         pub shm_nattch: ::shmatt_t,
         __glibc_reserved5: ::c_ulong,
         __glibc_reserved6: ::c_ulong,
     }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        __glibc_reserved1: ::c_uint,
+        pub msg_stime: ::time_t,
+        __glibc_reserved2: ::c_uint,
+        pub msg_rtime: ::time_t,
+        __glibc_reserved3: ::c_uint,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
 }
 
 pub const O_DIRECT: ::c_int = 0x20000;
 pub const O_DIRECTORY: ::c_int = 0x4000;
 pub const O_NOFOLLOW: ::c_int = 0x8000;
 
 pub const MAP_LOCKED: ::c_int = 0x00080;
 pub const MAP_NORESERVE: ::c_int = 0x00040;
--- a/third_party/rust/libc/src/unix/notbsd/linux/other/b32/x86.rs
+++ b/third_party/rust/libc/src/unix/notbsd/linux/other/b32/x86.rs
@@ -82,16 +82,33 @@ s! {
         pub shm_ctime: ::time_t,
         __unused3: ::c_ulong,
         pub shm_cpid: ::pid_t,
         pub shm_lpid: ::pid_t,
         pub shm_nattch: ::shmatt_t,
         __unused4: ::c_ulong,
         __unused5: ::c_ulong
     }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __glibc_reserved1: ::c_ulong,
+        pub msg_rtime: ::time_t,
+        __glibc_reserved2: ::c_ulong,
+        pub msg_ctime: ::time_t,
+        __glibc_reserved3: ::c_ulong,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
 }
 
 pub const O_DIRECT: ::c_int = 0x4000;
 pub const O_DIRECTORY: ::c_int = 0x10000;
 pub const O_NOFOLLOW: ::c_int = 0x20000;
 
 pub const MAP_LOCKED: ::c_int = 0x02000;
 pub const MAP_NORESERVE: ::c_int = 0x04000;
--- a/third_party/rust/libc/src/unix/notbsd/linux/other/b64/aarch64.rs
+++ b/third_party/rust/libc/src/unix/notbsd/linux/other/b64/aarch64.rs
@@ -55,20 +55,19 @@ s! {
     }
 
     pub struct ipc_perm {
         pub __key: ::key_t,
         pub uid: ::uid_t,
         pub gid: ::gid_t,
         pub cuid: ::uid_t,
         pub cgid: ::gid_t,
-        pub mode: ::c_ushort,
+        pub mode: ::c_uint,
+        pub __seq: ::c_ushort,
         __pad1: ::c_ushort,
-        pub __seq: ::c_ushort,
-        __pad2: ::c_ushort,
         __unused1: ::c_ulong,
         __unused2: ::c_ulong
     }
 
     pub struct shmid_ds {
         pub shm_perm: ::ipc_perm,
         pub shm_segsz: ::size_t,
         pub shm_atime: ::time_t,
@@ -105,17 +104,17 @@ pub const FIOCLEX: ::c_ulong = 0x5451;
 pub const FIONBIO: ::c_ulong = 0x5421;
 
 pub const SYS_gettid: ::c_long = 178;
 pub const SYS_perf_event_open: ::c_long = 241;
 
 pub const MCL_CURRENT: ::c_int = 0x0001;
 pub const MCL_FUTURE: ::c_int = 0x0002;
 
-pub const SIGSTKSZ: ::size_t = 8192;
+pub const SIGSTKSZ: ::size_t = 16384;
 pub const CBAUD: ::tcflag_t = 0o0010017;
 pub const TAB1: ::c_int = 0x00000800;
 pub const TAB2: ::c_int = 0x00001000;
 pub const TAB3: ::c_int = 0x00001800;
 pub const CR1: ::c_int  = 0x00000200;
 pub const CR2: ::c_int  = 0x00000400;
 pub const CR3: ::c_int  = 0x00000600;
 pub const FF1: ::c_int  = 0x00008000;
--- a/third_party/rust/libc/src/unix/notbsd/linux/other/b64/mod.rs
+++ b/third_party/rust/libc/src/unix/notbsd/linux/other/b64/mod.rs
@@ -26,16 +26,30 @@ s! {
         pub freeswap: ::c_ulong,
         pub procs: ::c_ushort,
         pub pad: ::c_ushort,
         pub totalhigh: ::c_ulong,
         pub freehigh: ::c_ulong,
         pub mem_unit: ::c_uint,
         pub _f: [::c_char; 0],
     }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
 }
 
 pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
 
 cfg_if! {
     if #[cfg(target_arch = "aarch64")] {
         mod aarch64;
         pub use self::aarch64::*;
--- a/third_party/rust/libc/src/unix/notbsd/linux/other/b64/x86_64.rs
+++ b/third_party/rust/libc/src/unix/notbsd/linux/other/b64/x86_64.rs
@@ -144,16 +144,27 @@ pub const FIOCLEX: ::c_ulong = 0x5451;
 pub const FIONBIO: ::c_ulong = 0x5421;
 
 pub const PTRACE_GETFPREGS: ::c_uint = 14;
 pub const PTRACE_SETFPREGS: ::c_uint = 15;
 pub const PTRACE_GETFPXREGS: ::c_uint = 18;
 pub const PTRACE_SETFPXREGS: ::c_uint = 19;
 pub const PTRACE_GETREGS: ::c_uint = 12;
 pub const PTRACE_SETREGS: ::c_uint = 13;
+pub const PTRACE_O_EXITKILL: ::c_uint = 1048576;
+pub const PTRACE_O_TRACECLONE: ::c_uint = 8;
+pub const PTRACE_O_TRACEEXEC: ::c_uint = 16;
+pub const PTRACE_O_TRACEEXIT: ::c_uint = 64;
+pub const PTRACE_O_TRACEFORK: ::c_uint = 2;
+pub const PTRACE_O_TRACESYSGOOD: ::c_uint = 1;
+pub const PTRACE_O_TRACEVFORK: ::c_uint = 4;
+pub const PTRACE_O_TRACEVFORKDONE: ::c_uint = 32;
+pub const PTRACE_O_TRACESECCOMP: ::c_uint = 128;
+pub const PTRACE_O_SUSPEND_SECCOMP: ::c_uint = 2097152;
+pub const PTRACE_PEEKSIGINFO_SHARED: ::c_uint = 1;
 
 pub const SYS_gettid: ::c_long = 186;
 pub const SYS_perf_event_open: ::c_long = 298;
 
 pub const MCL_CURRENT: ::c_int = 0x0001;
 pub const MCL_FUTURE: ::c_int = 0x0002;
 
 pub const SIGSTKSZ: ::size_t = 8192;
--- a/third_party/rust/libc/src/unix/notbsd/linux/other/mod.rs
+++ b/third_party/rust/libc/src/unix/notbsd/linux/other/mod.rs
@@ -1,14 +1,32 @@
 pub type fsblkcnt_t = ::c_ulong;
 pub type fsfilcnt_t = ::c_ulong;
 pub type rlim_t = c_ulong;
 pub type __priority_which_t = ::c_uint;
 
 s! {
+    pub struct aiocb {
+        pub aio_fildes: ::c_int,
+        pub aio_lio_opcode: ::c_int,
+        pub aio_reqprio: ::c_int,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        pub aio_sigevent: ::sigevent,
+        __next_prio: *mut aiocb,
+        __abs_prio: ::c_int,
+        __policy: ::c_int,
+        __error_code: ::c_int,
+        __return_value: ::ssize_t,
+        pub aio_offset: off_t,
+        #[cfg(target_pointer_width = "32")]
+        __unused1: [::c_char; 4],
+        __glibc_reserved: [::c_char; 32]
+    }
+
     pub struct __exit_status {
         pub e_termination: ::c_short,
         pub e_exit: ::c_short,
     }
 
     pub struct __timeval {
         pub tv_sec: ::int32_t,
         pub tv_usec: ::int32_t,
@@ -242,16 +260,17 @@ pub const EUSERS: ::c_int = 87;
 pub const ENOTSOCK: ::c_int = 88;
 pub const EDESTADDRREQ: ::c_int = 89;
 pub const EMSGSIZE: ::c_int = 90;
 pub const EPROTOTYPE: ::c_int = 91;
 pub const ENOPROTOOPT: ::c_int = 92;
 pub const EPROTONOSUPPORT: ::c_int = 93;
 pub const ESOCKTNOSUPPORT: ::c_int = 94;
 pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
 pub const EPFNOSUPPORT: ::c_int = 96;
 pub const EAFNOSUPPORT: ::c_int = 97;
 pub const EADDRINUSE: ::c_int = 98;
 pub const EADDRNOTAVAIL: ::c_int = 99;
 pub const ENETDOWN: ::c_int = 100;
 pub const ENETUNREACH: ::c_int = 101;
 pub const ENETRESET: ::c_int = 102;
 pub const ECONNABORTED: ::c_int = 103;
@@ -340,36 +359,36 @@ pub const SIGVTALRM: ::c_int = 26;
 pub const SIGPROF: ::c_int = 27;
 pub const SIGWINCH: ::c_int = 28;
 pub const SIGPOLL: ::c_int = 29;
 pub const SIGPWR: ::c_int = 30;
 pub const SIG_SETMASK: ::c_int = 2;
 pub const SIG_BLOCK: ::c_int = 0x000000;
 pub const SIG_UNBLOCK: ::c_int = 0x01;
 
+pub const SIGEV_THREAD_ID: ::c_int = 4;
+
 pub const POLLRDNORM: ::c_short = 0x040;
 pub const POLLWRNORM: ::c_short = 0x100;
 pub const POLLRDBAND: ::c_short = 0x080;
 pub const POLLWRBAND: ::c_short = 0x200;
 
 pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
 pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
 
 pub const BUFSIZ: ::c_uint = 8192;
 pub const TMP_MAX: ::c_uint = 238328;
 pub const FOPEN_MAX: ::c_uint = 16;
 pub const POSIX_FADV_DONTNEED: ::c_int = 4;
 pub const POSIX_FADV_NOREUSE: ::c_int = 5;
 pub const POSIX_MADV_DONTNEED: ::c_int = 4;
 pub const _SC_2_C_VERSION: ::c_int = 96;
-pub const RUSAGE_THREAD: ::c_int = 1;
 pub const O_ACCMODE: ::c_int = 3;
 pub const O_ASYNC: ::c_int = 0x2000;
 pub const O_NDELAY: ::c_int = 0x800;
-pub const RUSAGE_CHILDREN: ::c_int = -1;
 pub const ST_RELATIME: ::c_ulong = 4096;
 pub const NI_MAXHOST: ::socklen_t = 1025;
 
 pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5;
 pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff;
 pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245;
 pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45;
 pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53;
@@ -480,16 +499,79 @@ pub const LINUX_REBOOT_CMD_RESTART: ::c_
 pub const LINUX_REBOOT_CMD_HALT: ::c_int = 0xCDEF0123;
 pub const LINUX_REBOOT_CMD_CAD_ON: ::c_int = 0x89ABCDEF;
 pub const LINUX_REBOOT_CMD_CAD_OFF: ::c_int = 0x00000000;
 pub const LINUX_REBOOT_CMD_POWER_OFF: ::c_int = 0x4321FEDC;
 pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4;
 pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2;
 pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543;
 
+pub const NETLINK_ROUTE: ::c_int = 0;
+pub const NETLINK_UNUSED: ::c_int = 1;
+pub const NETLINK_USERSOCK: ::c_int = 2;
+pub const NETLINK_FIREWALL: ::c_int = 3;
+pub const NETLINK_SOCK_DIAG: ::c_int = 4;
+pub const NETLINK_NFLOG: ::c_int = 5;
+pub const NETLINK_XFRM: ::c_int = 6;
+pub const NETLINK_SELINUX: ::c_int = 7;
+pub const NETLINK_ISCSI: ::c_int = 8;
+pub const NETLINK_AUDIT: ::c_int = 9;
+pub const NETLINK_FIB_LOOKUP: ::c_int = 10;
+pub const NETLINK_CONNECTOR: ::c_int = 11;
+pub const NETLINK_NETFILTER: ::c_int = 12;
+pub const NETLINK_IP6_FW: ::c_int = 13;
+pub const NETLINK_DNRTMSG: ::c_int = 14;
+pub const NETLINK_KOBJECT_UEVENT: ::c_int = 15;
+pub const NETLINK_GENERIC: ::c_int = 16;
+pub const NETLINK_SCSITRANSPORT: ::c_int = 18;
+pub const NETLINK_ECRYPTFS: ::c_int = 19;
+pub const NETLINK_RDMA: ::c_int = 20;
+pub const NETLINK_CRYPTO: ::c_int = 21;
+pub const NETLINK_INET_DIAG: ::c_int = NETLINK_SOCK_DIAG;
+
+pub const MAX_LINKS: ::c_int = 32;
+
+pub const NLM_F_REQUEST: ::c_int = 1;
+pub const NLM_F_MULTI: ::c_int = 2;
+pub const NLM_F_ACK: ::c_int = 4;
+pub const NLM_F_ECHO: ::c_int = 8;
+pub const NLM_F_DUMP_INTR: ::c_int = 16;
+pub const NLM_F_DUMP_FILTERED: ::c_int = 32;
+
+pub const NLM_F_ROOT: ::c_int = 0x100;
+pub const NLM_F_MATCH: ::c_int = 0x200;
+pub const NLM_F_ATOMIC: ::c_int = 0x400;
+pub const NLM_F_DUMP: ::c_int = NLM_F_ROOT | NLM_F_MATCH;
+
+pub const NLM_F_REPLACE: ::c_int = 0x100;
+pub const NLM_F_EXCL: ::c_int = 0x200;
+pub const NLM_F_CREATE: ::c_int = 0x400;
+pub const NLM_F_APPEND: ::c_int = 0x800;
+
+pub const NLMSG_NOOP: ::c_int = 0x1;
+pub const NLMSG_ERROR: ::c_int = 0x2;
+pub const NLMSG_DONE: ::c_int = 0x3;
+pub const NLMSG_OVERRUN: ::c_int = 0x4;
+pub const NLMSG_MIN_TYPE: ::c_int = 0x10;
+
+pub const NETLINK_ADD_MEMBERSHIP: ::c_int = 1;
+pub const NETLINK_DROP_MEMBERSHIP: ::c_int = 2;
+pub const NETLINK_PKTINFO: ::c_int = 3;
+pub const NETLINK_BROADCAST_ERROR: ::c_int = 4;
+pub const NETLINK_NO_ENOBUFS: ::c_int = 5;
+pub const NETLINK_RX_RING: ::c_int = 6;
+pub const NETLINK_TX_RING: ::c_int = 7;
+pub const NETLINK_LISTEN_ALL_NSID: ::c_int = 8;
+pub const NETLINK_LIST_MEMBERSHIPS: ::c_int = 9;
+pub const NETLINK_CAP_ACK: ::c_int = 10;
+
+pub const NLA_F_NESTED: ::c_int = 1 << 15;
+pub const NLA_F_NET_BYTEORDER: ::c_int = 1 << 14;
+pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER);
+
 cfg_if! {
     if #[cfg(any(target_arch = "arm", target_arch = "x86",
                  target_arch = "x86_64"))] {
         pub const PTHREAD_STACK_MIN: ::size_t = 16384;
     } else {
         pub const PTHREAD_STACK_MIN: ::size_t = 131072;
     }
 }
@@ -497,16 +579,17 @@ cfg_if! {
 extern {
     pub fn utmpxname(file: *const ::c_char) -> ::c_int;
     pub fn getutxent() -> *mut utmpx;
     pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
     pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
     pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
     pub fn setutxent();
     pub fn endutxent();
+    pub fn getpt() -> ::c_int;
 }
 
 #[link(name = "util")]
 extern {
     pub fn sysctl(name: *mut ::c_int,
                   namelen: ::c_int,
                   oldp: *mut ::c_void,
                   oldlenp: *mut ::size_t,
--- a/third_party/rust/libc/src/unix/notbsd/linux/s390x.rs
+++ b/third_party/rust/libc/src/unix/notbsd/linux/s390x.rs
@@ -13,16 +13,34 @@ pub type suseconds_t = i64;
 pub type time_t = i64;
 pub type wchar_t = i32;
 pub type greg_t = u64;
 pub type clock_t = i64;
 pub type __fsword_t = ::c_long;
 pub type __priority_which_t = ::c_uint;
 
 s! {
+    pub struct aiocb {
+        pub aio_fildes: ::c_int,
+        pub aio_lio_opcode: ::c_int,
+        pub aio_reqprio: ::c_int,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        pub aio_sigevent: ::sigevent,
+        __next_prio: *mut aiocb,
+        __abs_prio: ::c_int,
+        __policy: ::c_int,
+        __error_code: ::c_int,
+        __return_value: ::ssize_t,
+        pub aio_offset: off_t,
+        #[cfg(target_pointer_width = "32")]
+        __unused1: [::c_char; 4],
+        __glibc_reserved: [::c_char; 32]
+    }
+
     pub struct stat {
         pub st_dev: ::dev_t,
         pub st_ino: ::ino_t,
         pub st_nlink: ::nlink_t,
         pub st_mode: ::mode_t,
         pub st_uid: ::uid_t,
         pub st_gid: ::gid_t,
         st_pad0: ::c_int,
@@ -228,16 +246,30 @@ s! {
 
     pub struct ucontext_t {
         pub uc_flags: ::c_ulong,
         pub uc_link: *mut ucontext_t,
         pub uc_stack: ::stack_t,
         pub uc_mcontext: mcontext_t,
         pub uc_sigmask: ::sigset_t,
     }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
 }
 
 pub const POSIX_FADV_DONTNEED: ::c_int = 6;
 pub const POSIX_FADV_NOREUSE: ::c_int = 7;
 
 pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
 pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
 pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
@@ -370,16 +402,17 @@ pub const EUSERS: ::c_int = 87;
 pub const ENOTSOCK: ::c_int = 88;
 pub const EDESTADDRREQ: ::c_int = 89;
 pub const EMSGSIZE: ::c_int = 90;
 pub const EPROTOTYPE: ::c_int = 91;
 pub const ENOPROTOOPT: ::c_int = 92;
 pub const EPROTONOSUPPORT: ::c_int = 93;
 pub const ESOCKTNOSUPPORT: ::c_int = 94;
 pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
 pub const EPFNOSUPPORT: ::c_int = 96;
 pub const EAFNOSUPPORT: ::c_int = 97;
 pub const ENETDOWN: ::c_int = 100;
 pub const ENETUNREACH: ::c_int = 101;
 pub const ENETRESET: ::c_int = 102;
 pub const ENOBUFS: ::c_int = 105;
 pub const EISCONN: ::c_int = 106;
 pub const ESHUTDOWN: ::c_int = 108;
@@ -459,20 +492,18 @@ pub const SIG_UNBLOCK: ::c_int = 0x01;
 pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
 pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
 
 pub const BUFSIZ: ::c_uint = 8192;
 pub const TMP_MAX: ::c_uint = 238328;
 pub const FOPEN_MAX: ::c_uint = 16;
 pub const POSIX_MADV_DONTNEED: ::c_int = 4;
 pub const _SC_2_C_VERSION: ::c_int = 96;
-pub const RUSAGE_THREAD: ::c_int = 1;
 pub const O_ASYNC: ::c_int = 0x2000;
 pub const O_NDELAY: ::c_int = 0x800;
-pub const RUSAGE_CHILDREN: ::c_int = -1;
 pub const ST_RELATIME: ::c_ulong = 4096;
 pub const NI_MAXHOST: ::socklen_t = 1025;
 
 pub const ADFS_SUPER_MAGIC: ::c_int = 0x0000adf5;
 pub const AFFS_SUPER_MAGIC: ::c_int = 0x0000adff;
 pub const CODA_SUPER_MAGIC: ::c_int = 0x73757245;
 pub const CRAMFS_MAGIC: ::c_int = 0x28cd3d45;
 pub const EFS_SUPER_MAGIC: ::c_int = 0x00414a53;
--- a/third_party/rust/libc/src/unix/notbsd/mod.rs
+++ b/third_party/rust/libc/src/unix/notbsd/mod.rs
@@ -1,16 +1,17 @@
 use dox::mem;
 
 pub type sa_family_t = u16;
 pub type pthread_key_t = ::c_uint;
 pub type speed_t = ::c_uint;
 pub type tcflag_t = ::c_uint;
 pub type loff_t = ::c_longlong;
 pub type clockid_t = ::c_int;
+pub type key_t = ::c_int;
 pub type id_t = ::c_uint;
 
 pub enum timezone {}
 
 s! {
     pub struct sockaddr {
         pub sa_family: sa_family_t,
         pub sa_data: [::c_char; 14],
@@ -47,17 +48,19 @@ s! {
 
     pub struct addrinfo {
         pub ai_flags: ::c_int,
         pub ai_family: ::c_int,
         pub ai_socktype: ::c_int,
         pub ai_protocol: ::c_int,
         pub ai_addrlen: socklen_t,
 
-        #[cfg(any(target_os = "linux", target_os = "emscripten"))]
+        #[cfg(any(target_os = "linux",
+                  target_os = "emscripten",
+                  target_os = "fuchsia"))]
         pub ai_addr: *mut ::sockaddr,
 
         pub ai_canonname: *mut c_char,
 
         #[cfg(target_os = "android")]
         pub ai_addr: *mut ::sockaddr,
 
         pub ai_next: *mut addrinfo,
@@ -155,16 +158,29 @@ s! {
         pub n_sign_posn: ::c_char,
         pub int_p_cs_precedes: ::c_char,
         pub int_p_sep_by_space: ::c_char,
         pub int_n_cs_precedes: ::c_char,
         pub int_n_sep_by_space: ::c_char,
         pub int_p_sign_posn: ::c_char,
         pub int_n_sign_posn: ::c_char,
     }
+
+    pub struct sigevent {
+        pub sigev_value: ::sigval,
+        pub sigev_signo: ::c_int,
+        pub sigev_notify: ::c_int,
+        // Actually a union.  We only expose sigev_notify_thread_id because it's
+        // the most useful member
+        pub sigev_notify_thread_id: ::c_int,
+        #[cfg(target_pointer_width = "64")]
+        __unused1: [::c_int; 11],
+        #[cfg(target_pointer_width = "32")]
+        __unused1: [::c_int; 12]
+    }
 }
 
 // intentionally not public, only used for fd_set
 cfg_if! {
     if #[cfg(target_pointer_width = "32")] {
         const ULONG_SIZE: usize = 32;
     } else if #[cfg(target_pointer_width = "64")] {
         const ULONG_SIZE: usize = 64;
@@ -429,16 +445,17 @@ pub const IFF_SLAVE: ::c_int = 0x800;
 pub const IFF_MULTICAST: ::c_int = 0x1000;
 pub const IFF_PORTSEL: ::c_int = 0x2000;
 pub const IFF_AUTOMEDIA: ::c_int = 0x4000;
 pub const IFF_DYNAMIC: ::c_int = 0x8000;
 
 pub const AF_UNIX: ::c_int = 1;
 pub const AF_INET: ::c_int = 2;
 pub const AF_INET6: ::c_int = 10;
+pub const AF_NETLINK: ::c_int = 16;
 pub const SOCK_RAW: ::c_int = 3;
 pub const IPPROTO_TCP: ::c_int = 6;
 pub const IPPROTO_IP: ::c_int = 0;
 pub const IPPROTO_IPV6: ::c_int = 41;
 pub const IP_MULTICAST_TTL: ::c_int = 33;
 pub const IP_MULTICAST_LOOP: ::c_int = 34;
 pub const IP_TTL: ::c_int = 2;
 pub const IP_HDRINCL: ::c_int = 3;
@@ -462,16 +479,18 @@ pub const TCP_INFO: ::c_int = 11;
 pub const TCP_QUICKACK: ::c_int = 12;
 pub const TCP_CONGESTION: ::c_int = 13;
 
 pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
 pub const IPV6_V6ONLY: ::c_int = 26;
 
 pub const SO_DEBUG: ::c_int = 1;
 
+pub const MSG_NOSIGNAL: ::c_int = 0x4000;
+
 pub const SHUT_RD: ::c_int = 0;
 pub const SHUT_WR: ::c_int = 1;
 pub const SHUT_RDWR: ::c_int = 2;
 
 pub const LOCK_SH: ::c_int = 1;
 pub const LOCK_EX: ::c_int = 2;
 pub const LOCK_NB: ::c_int = 4;
 pub const LOCK_UN: ::c_int = 8;
@@ -621,16 +640,20 @@ pub const LOG_CRON: ::c_int = 9 << 3;
 pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
 pub const LOG_FTP: ::c_int = 11 << 3;
 pub const LOG_PERROR: ::c_int = 0x20;
 
 pub const PIPE_BUF: usize = 4096;
 
 pub const SI_LOAD_SHIFT: ::c_uint = 16;
 
+pub const SIGEV_SIGNAL: ::c_int = 0;
+pub const SIGEV_NONE: ::c_int = 1;
+pub const SIGEV_THREAD: ::c_int = 2;
+
 f! {
     pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
         let fd = fd as usize;
         let size = mem::size_of_val(&(*set).fds_bits[0]) * 8;
         (*set).fds_bits[fd / size] &= !(1 << (fd % size));
         return
     }
 
@@ -838,21 +861,29 @@ extern {
                              cpuset: *mut cpu_set_t) -> ::c_int;
     pub fn sched_setaffinity(pid: ::pid_t,
                              cpusetsize: ::size_t,
                              cpuset: *const cpu_set_t) -> ::c_int;
     pub fn unshare(flags: ::c_int) -> ::c_int;
     pub fn setns(fd: ::c_int, nstype: ::c_int) -> ::c_int;
     pub fn sem_timedwait(sem: *mut sem_t,
                          abstime: *const ::timespec) -> ::c_int;
+    pub fn accept4(fd: ::c_int, addr: *mut ::sockaddr, len: *mut ::socklen_t,
+                   flg: ::c_int) -> ::c_int;
+    pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t,
+                                   abstime: *const ::timespec) -> ::c_int;
+    pub fn ptsname_r(fd: ::c_int,
+                     buf: *mut ::c_char,
+                     buflen: ::size_t) -> ::c_int;
 }
 
 cfg_if! {
     if #[cfg(any(target_os = "linux",
-                 target_os = "emscripten"))] {
+                 target_os = "emscripten",
+                 target_os = "fuchsia"))] {
         mod linux;
         pub use self::linux::*;
     } else if #[cfg(target_os = "android")] {
         mod android;
         pub use self::android::*;
     } else {
         // Unknown target_os
     }
--- a/third_party/rust/libc/src/unix/solaris/mod.rs
+++ b/third_party/rust/libc/src/unix/solaris/mod.rs
@@ -597,16 +597,17 @@ pub const ETXTBSY: ::c_int = 26;
 pub const EFBIG: ::c_int = 27;
 pub const ENOSPC: ::c_int = 28;
 pub const ESPIPE: ::c_int = 29;
 pub const EROFS: ::c_int = 30;
 pub const EMLINK: ::c_int = 31;
 pub const EPIPE: ::c_int = 32;
 pub const EDOM: ::c_int = 33;
 pub const ERANGE: ::c_int = 34;
+pub const ENOTSUP: ::c_int = 48;
 pub const EAGAIN: ::c_int = 11;
 pub const EWOULDBLOCK: ::c_int = 11;
 pub const EINPROGRESS: ::c_int = 150;
 pub const EALREADY: ::c_int = 149;
 pub const ENOTSOCK: ::c_int = 95;
 pub const EDESTADDRREQ: ::c_int = 96;
 pub const EMSGSIZE: ::c_int = 97;
 pub const EPROTOTYPE: ::c_int = 98;
@@ -646,16 +647,18 @@ pub const ENOMSG: ::c_int = 35;
 pub const EOVERFLOW: ::c_int = 79;
 pub const ECANCELED: ::c_int = 47;
 pub const EILSEQ: ::c_int = 88;
 pub const EBADMSG: ::c_int = 77;
 pub const EMULTIHOP: ::c_int = 74;
 pub const ENOLINK: ::c_int = 67;
 pub const EPROTO: ::c_int = 71;
 
+pub const EAI_SYSTEM: ::c_int = 11;
+
 pub const F_DUPFD: ::c_int = 0;
 pub const F_GETFD: ::c_int = 1;
 pub const F_SETFD: ::c_int = 2;
 pub const F_GETFL: ::c_int = 3;
 pub const F_SETFL: ::c_int = 4;
 
 pub const SIGTRAP: ::c_int = 5;
 
@@ -948,16 +951,19 @@ f! {
     }
 
     pub fn WTERMSIG(status: ::c_int) -> ::c_int {
         status & 0x7F
     }
 }
 
 extern {
+    pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
+    pub fn freeifaddrs(ifa: *mut ::ifaddrs);
+
     pub fn stack_getbounds(sp: *mut ::stack_t) -> ::c_int;
     pub fn mincore(addr: *const ::c_void, len: ::size_t,
                    vec: *mut c_char) -> ::c_int;
     pub fn setgroups(ngroups: ::c_int,
                      ptr: *const ::gid_t) -> ::c_int;
     pub fn ioctl(fildes: ::c_int, request: ::c_int, ...) -> ::c_int;
     pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int)
                     -> ::c_int;
@@ -1032,9 +1038,11 @@ extern {
     pub fn if_nameindex() -> *mut if_nameindex;
     pub fn if_freenameindex(ptr: *mut if_nameindex);
     pub fn pthread_condattr_getclock(attr: *const pthread_condattr_t,
                                      clock_id: *mut clockid_t) -> ::c_int;
     pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t,
                                      clock_id: clockid_t) -> ::c_int;
     pub fn sem_timedwait(sem: *mut sem_t,
                          abstime: *const ::timespec) -> ::c_int;
+    pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t,
+                                   abstime: *const ::timespec) -> ::c_int;
 }
--- a/third_party/rust/libc/src/windows.rs
+++ b/third_party/rust/libc/src/windows.rs
@@ -100,18 +100,60 @@ pub const S_IREAD: ::c_int = 256;
 
 pub const LC_ALL: ::c_int = 0;
 pub const LC_COLLATE: ::c_int = 1;
 pub const LC_CTYPE: ::c_int = 2;
 pub const LC_MONETARY: ::c_int = 3;
 pub const LC_NUMERIC: ::c_int = 4;
 pub const LC_TIME: ::c_int = 5;
 
-#[cfg(target_env = "msvc")] // " if " -- appease style checker
-#[link(name = "msvcrt")]
+pub const EPERM: ::c_int = 1;
+pub const ENOENT: ::c_int = 2;
+pub const ESRCH: ::c_int = 3;
+pub const EINTR: ::c_int = 4;
+pub const EIO: ::c_int = 5;
+pub const ENXIO: ::c_int = 6;
+pub const E2BIG: ::c_int = 7;
+pub const ENOEXEC: ::c_int = 8;
+pub const EBADF: ::c_int = 9;
+pub const ECHILD: ::c_int = 10;
+pub const EAGAIN: ::c_int = 11;
+pub const ENOMEM: ::c_int = 12;
+pub const EACCES: ::c_int = 13;
+pub const EFAULT: ::c_int = 14;
+pub const EBUSY: ::c_int = 16;
+pub const EEXIST: ::c_int = 17;
+pub const EXDEV: ::c_int = 18;
+pub const ENODEV: ::c_int = 19;
+pub const ENOTDIR: ::c_int = 20;
+pub const EISDIR: ::c_int = 21;
+pub const EINVAL: ::c_int = 22;
+pub const ENFILE: ::c_int = 23;
+pub const EMFILE: ::c_int = 24;
+pub const ENOTTY: ::c_int = 25;
+pub const EFBIG: ::c_int = 27;
+pub const ENOSPC: ::c_int = 28;
+pub const ESPIPE: ::c_int = 29;
+pub const EROFS: ::c_int = 30;
+pub const EMLINK: ::c_int = 31;
+pub const EPIPE: ::c_int = 32;
+pub const EDOM: ::c_int = 33;
+pub const ERANGE: ::c_int = 34;
+pub const EDEADLK: ::c_int = 36;
+pub const EDEADLOCK: ::c_int = 36;
+pub const ENAMETOOLONG: ::c_int = 38;
+pub const ENOLCK: ::c_int = 39;
+pub const ENOSYS: ::c_int = 40;
+pub const ENOTEMPTY: ::c_int = 41;
+pub const EILSEQ: ::c_int = 42;
+pub const STRUNCATE: ::c_int = 80;
+
+#[cfg(all(target_env = "msvc", stdbuild))] // " if " -- appease style checker
+#[link(name = "msvcrt", cfg(not(target_feature = "crt-static")))]
+#[link(name = "libcmt", cfg(target_feature = "crt-static"))]
 extern {}
 
 extern {
     #[link_name = "_chmod"]
     pub fn chmod(path: *const c_char, mode: ::c_int) -> ::c_int;
     #[link_name = "_wchmod"]
     pub fn wchmod(path: *const wchar_t, mode: ::c_int) -> ::c_int;
     #[link_name = "_mkdir"]
--- a/third_party/rust/libz-sys/.cargo-checksum.json
+++ b/third_party/rust/libz-sys/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"f9b1ca6ae27d1c18215265024629a8960c31379f206d9ed20f64e0b2dcf79805",".travis.yml":"a1bfbefcf2d0e693e2ce8c5b5b8e8a50d0ab5848d420a3a5a0c9fc481b5e6018","Cargo.toml":"5a05f1700e27c694be6490b9a5c1c2e34b3362609701e31d2e569405016afc2a","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"2908cdccf74d645b28f8ef1c54146172f171c655275241fb3016dac8a5e4627d","appveyor.yml":"d0a4aaa582664475421923937ddd07b924a27e556a5ae13a50c1645dacfa4ecc","build.rs":"3efe06182c68bb56daa1791235387693956f4073744921100c9446e03fe38f91","src/lib.rs":"04206965d961a957070507355a9fc270ce37dcc98ce54ab7f92ed8d070e57eb4","src/zlib-1.2.8/CMakeLists.txt":"ff988cbc9cbb5692400b37df2b80eb25afa6d6bf0d840a6dff5673ee7c190718","src/zlib-1.2.8/ChangeLog":"1285914a14f28ad77c3eef8c34d219e49459989502237086a14ec3d6cca7a760","src/zlib-1.2.8/FAQ":"1e8a0078be0ff1b60d57561a9e4a8cad72892318a8831946cba1abd30d65521c","src/zlib-1.2.8/INDEX":"3b4e325d47ae66456d43fcf143ba21ab67a02a4f81be7ef2da480ba30d774266","src/zlib-1.2.8/Makefile":"ef23b08ce01239843f1ded3f373bfc432627a477d62f945cbf63b2ac03db118a","src/zlib-1.2.8/Makefile.in":"edb322ca9ea5055eb1c5fd0b277e152986bb9135a86500039f6de19a68d6a5f7","src/zlib-1.2.8/README":"53a466b504371dcdda1504c90d8121d4823921f03554c3526995fb2bae7159f9","src/zlib-1.2.8/adler32.c":"341d49ae2703037d2d10c8486f1a1ca3b65e0f10cc9e5fead6bfbbc0b34564ba","src/zlib-1.2.8/amiga/Makefile.pup":"a65cb3cd40b1b8ec77e288974dd9dc53d91ed78bbe495e94ccc84ddd423edf1f","src/zlib-1.2.8/amiga/Makefile.sas":"0e63cf88b505a1a04327bb666af3a985c5e11835c0c00aed4058c0dcc315d60e","src/zlib-1.2.8/as400/bndsrc":"9672d2c5e4692114e5ee23efc4ee3b0b4f3c293a9f25e394f3c8e8697c315abb","src/zlib-1.2.8/as400/compile.clp":"67cde543d10728eae8ed8318d1ea0ec55b6d883c6e668544c3beb6fe825112a1","src/zlib-1.2.8/as400/readme.txt":"eb89121904ab1a1a38ed9c360186fc52ca39a6e468a6ee848639774956e821e8","src/zlib-1.2.8/as400/zlib.inc":"d6ba9242df0742950a8b52b8cb6314fc62859879e50218cad44e220f8c3eeaea","src/zlib-1.2.8/compress.c":"0f05c385cf9f052e5fa1ae478b492ee4e04a60bc39d173c4ca4f58d799d5d1ab","src/zlib-1.2.8/configure":"94159ff86133515dee243814d92238192d1f2c36c86fdc1472e0a0a797d1dd2f","src/zlib-1.2.8/contrib/README.contrib":"b01cfbd6a67e950886c7381ef96a46e50b03a5f61d4905a99a87c8db06bfb961","src/zlib-1.2.8/contrib/ada/buffer_demo.adb":"469cf566a6965767fee6b987a239ed8cedcc66614940d45a9b434331fbb435ce","src/zlib-1.2.8/contrib/ada/mtest.adb":"41b6f31684770334afdc4375871eb1408542f37a823a073556fdbfdb63753160","src/zlib-1.2.8/contrib/ada/read.adb":"fa5b989aef0c5715a3fcb15de93985f7f10aeb0a7f5716745c95ed820eb9af9c","src/zlib-1.2.8/contrib/ada/readme.txt":"8fe9e5303f2e8e8b746c78250e74b7c4aeb7ce6212fdce751fc3a0ce56a47fe2","src/zlib-1.2.8/contrib/ada/test.adb":"5e3abe79b387e09a9a42bd0543105e228f39a335240cffc33d71f0ba66ff2511","src/zlib-1.2.8/contrib/ada/zlib-streams.adb":"f45988e2bac76eb25a0dc981f46576e7432c35dde1790bbc2b650f0090b7fa72","src/zlib-1.2.8/contrib/ada/zlib-streams.ads":"6622f7fe7d4364010eb068bb87cf4b89bc22abbfac6c5a6b06f92b8ce0f3b866","src/zlib-1.2.8/contrib/ada/zlib-thin.adb":"03d89244ee5ec9771d9b5050e586c609f851af551b2e64eb151f1d5be0b63ae9","src/zlib-1.2.8/contrib/ada/zlib-thin.ads":"fdf7da9aa7a773d5bdfaf654a0f511bab1a53e034e56a445108a1cd984b8c5f8","src/zlib-1.2.8/contrib/ada/zlib.adb":"c9ca5dc34fbcdf06e2dc777b7e9dcd0ba31085b772b440eb0e12421323ab672c","src/zlib-1.2.8/contrib/ada/zlib.ads":"02634bec0d5e4c69d8d2859124380074a57de8d8bd928398379bfacc514236d2","src/zlib-1.2.8/contrib/ada/zlib.gpr":"859bb69dce38dbe9dca06753cf7ae7bd16d48f4fece8b87582dab8e30681d3de","src/zlib-1.2.8/contrib/amd64/amd64-match.S":"166007f7e9adb58fe8b83d85bbfe823f5e05858ba1d06edf637b78886caa2c69","src/zlib-1.2.8/contrib/asm686/README.686":"c21cc7147c956ecae17dd084cb41a206b086216fa521012871fb07fafd203c6d","src/zlib-1.2.8/contrib/asm686/match.S":"873799062495629f21cd3f779ea4b927add7aae0144e32d3594d9ce70185e99d","src/zlib-1.2.8/contrib/blast/Makefile":"17d5d26c24bf51cad51045a38ffb73cc3539d29e89885aa249fcfd45a8659d5c","src/zlib-1.2.8/contrib/blast/README":"baa763ae03d88ef7ece6eb80d9a099b43d0b57639d6d281e1c7c6ca79d81daba","src/zlib-1.2.8/contrib/blast/blast.c":"65a1655f9dce77e79faabbd13d3e98c97c974303b652632f0ea791401c66f1ed","src/zlib-1.2.8/contrib/blast/blast.h":"825e2f90c605133c96dc134ace6b62b70cc08156c7306a299bc8847f8fbb8ecb","src/zlib-1.2.8/contrib/blast/test.pk":"5f5c262c545574a5c221132d5ef832478d222d70b015341795b3860204140d7c","src/zlib-1.2.8/contrib/blast/test.txt":"9679b2c98e1283222d0782b25a1c198dc64ba9ebd1addd6dc6f643a45947cda3","src/zlib-1.2.8/contrib/delphi/ZLib.pas":"ded3fe0698466d078434a82e1e2c62c912021fd26d8ce914066d0e5317e171c1","src/zlib-1.2.8/contrib/delphi/ZLibConst.pas":"84bcc580bdf397e570f86f3f5a5b8c7bf537828f30b4b72648b81911f6bf5095","src/zlib-1.2.8/contrib/delphi/readme.txt":"f7420ed2de77d4b498eefbbe6402a1d17dc2d411735289c78a265c7f10fdaee5","src/zlib-1.2.8/contrib/delphi/zlibd32.mak":"850e91b6c9ea05de61a411cbda16fa0f10118cd88bb32c4b7226988776f8d511","src/zlib-1.2.8/contrib/dotzlib/DotZLib.build":"b96137097669644ecb9f42cdd3399d1fce9c512788374609303f7e50abf597f0","src/zlib-1.2.8/contrib/dotzlib/DotZLib.chm":"20d0e3edd57f849143255a7f0df1cd59d41db464a72c0d5ab42846438a729579","src/zlib-1.2.8/contrib/dotzlib/DotZLib.sln":"a979198c5b8d144c1ac8f993bfb6f4085d135aa58ca9dcf63ebabf52b5c695f7","src/zlib-1.2.8/contrib/dotzlib/DotZLib/AssemblyInfo.cs":"314afcfb339ea95f5431047b7ab24631b11c3532c7ce5dc2094ed0cf80a7c16d","src/zlib-1.2.8/contrib/dotzlib/DotZLib/ChecksumImpl.cs":"e7c047a2c3bcf88d3d002ee3d2d05af414acf53cb4451efacc0f2e95a474ea0f","src/zlib-1.2.8/contrib/dotzlib/DotZLib/CircularBuffer.cs":"be84c9736fe7bdc2bfae70466d8fff582504e928d5b5e110fd758090090c8cb7","src/zlib-1.2.8/contrib/dotzlib/DotZLib/CodecBase.cs":"259bdda1b7d6052134e631fa24bfd9dca6e2362563496c8b85257b56c848908c","src/zlib-1.2.8/contrib/dotzlib/DotZLib/Deflater.cs":"06ba6696a3c15c53ba5fd5a1c2bf50b51f217010228fc1e4c8495ee578f480de","src/zlib-1.2.8/contrib/dotzlib/DotZLib/DotZLib.cs":"9837fe993fd631233cc5e53ff084d86754b97f05ec77c54b0764c2706f186134","src/zlib-1.2.8/contrib/dotzlib/DotZLib/DotZLib.csproj":"21606db31dfef6410dd438b73f1db68856eacabcce6c0f0411fc4f17e17001f3","src/zlib-1.2.8/contrib/dotzlib/DotZLib/GZipStream.cs":"8d1de9755c77046b4ac71340a0a54434ebf4fd11b085c44454d7663a9b4df1c5","src/zlib-1.2.8/contrib/dotzlib/DotZLib/Inflater.cs":"9016ca73818f5b6a28791abc3af6da7c4d2773b6a3804f593f6d5737a62b99ad","src/zlib-1.2.8/contrib/dotzlib/DotZLib/UnitTests.cs":"b5266d91bad91ff484582231cdc06baa916a5b4c4e4be79e380037e9be6a9429","src/zlib-1.2.8/contrib/dotzlib/LICENSE_1_0.txt":"36266a8fd073568394cb81cdb2b124f7fdae2c64c1a7ed09db34b4d22efa2951","src/zlib-1.2.8/contrib/dotzlib/readme.txt":"d04972a91b1563fb4b7acab4b9ff2b84e57368953cc0596d5f5ea17d97315fd0","src/zlib-1.2.8/contrib/gcc_gvmat64/gvmat64.S":"22ff411b8b1d1b04aeaa8418b68245400267dc43c6f44104f6ccd37f0daee89f","src/zlib-1.2.8/contrib/infback9/README":"890288f02bb3b1f9cc654b87a07fcea695f90f6b9bd672d25bf6be1da2ec1688","src/zlib-1.2.8/contrib/infback9/infback9.c":"0a715c85a1ce3bb8b5a18d60941ffabc0186a886bcc66ba2ee0c4115a8e274e9","src/zlib-1.2.8/contrib/infback9/infback9.h":"dda2302f28157fe43a6143f84802af1740393572c2766559593996fd7a5a3245","src/zlib-1.2.8/contrib/infback9/inffix9.h":"84a2ba4727767c18af6505f0e81d9c814489c8b9ed330a25dad433db72997e43","src/zlib-1.2.8/contrib/infback9/inflate9.h":"32a907676cc36e27d0fdc0d99adb83a0b23f20ab61896269216d40fecf08d349","src/zlib-1.2.8/contrib/infback9/inftree9.c":"9761abea8a34213c2d4ddea7854fd7dcc48deb2895d83c61c4c1b34294ffcfbf","src/zlib-1.2.8/contrib/infback9/inftree9.h":"8ae61d52e50d2dbdb0378548ecc54fcd88f108c8b6fc30562a3ebec1ca6a599e","src/zlib-1.2.8/contrib/inflate86/inffas86.c":"6f266f3c7e0faca653256d0189c0f00d7dc0b062d02e25df4e1202e49369595c","src/zlib-1.2.8/contrib/inflate86/inffast.S":"70777bd21526680005fc34f086d108af49e2668ad86d1749e8e8100a81bfb288","src/zlib-1.2.8/contrib/iostream/test.cpp":"0f3c77e013949eb9c91e6b690ea894e19d97944d6b0885b82806fc3ad99680cf","src/zlib-1.2.8/contrib/iostream/zfstream.cpp":"8ebb9b3d521cc3392953f27658cf1f6dcb763216079f69a1518ec5ca0e42a63b","src/zlib-1.2.8/contrib/iostream/zfstream.h":"4369c35e66f63f52ca4a5e1759bf720507ccabb8f3f132e2f18e68686c812401","src/zlib-1.2.8/contrib/iostream2/zstream.h":"d0343e0c57ff58008b6f29643d289c72713aa2d653fe3dcd2e939fc77e7e20b6","src/zlib-1.2.8/contrib/iostream2/zstream_test.cpp":"f789df183cc58b78751985466380c656308490a9036eb48a7ef79704c3d3f229","src/zlib-1.2.8/contrib/iostream3/README":"43ec48ecbd95a8c45db20b107fac73b740bb11595a4737329188f06b713972cc","src/zlib-1.2.8/contrib/iostream3/TODO":"af5ebc83fb88f69706c8af896733784753dead147687e1c046f410c0997fd88b","src/zlib-1.2.8/contrib/iostream3/test.cc":"8e17fc48dfdbc6e268838b8b427491b5843b6d18bc97caa6924de9fad7abe3da","src/zlib-1.2.8/contrib/iostream3/zfstream.cc":"8cdd67ed0b13c192c11e5ea90e9d5782d6627eb303fbc4aa5ebda2531ec00ff8","src/zlib-1.2.8/contrib/iostream3/zfstream.h":"1bd74778fac45ee090dfc0f182a23e8a849152deb630606884b2635987b357b1","src/zlib-1.2.8/contrib/masmx64/bld_ml64.bat":"1c0561908a07ebdff271b12ed757241e1813d3db0f3551501b2595c23f0833aa","src/zlib-1.2.8/contrib/masmx64/gvmat64.asm":"390c1e6d63cb615b5ba042842738953f9cdc688b2fe35aaca981fd3fae213f3f","src/zlib-1.2.8/contrib/masmx64/inffas8664.c":"f6c585e43e6e524107566b1f10104949d0ef902159ac8203e1d98e50d4bedd62","src/zlib-1.2.8/contrib/masmx64/inffasx64.asm":"8448d0041fe6e8f4188fe5916181a1b274c6d35d75cfb28da60cf4f1edde44ec","src/zlib-1.2.8/contrib/masmx64/readme.txt":"9bb66b5028100855683853f12da0be479c7bccf74365fdbf37da2542edff9927","src/zlib-1.2.8/contrib/masmx86/bld_ml32.bat":"b0b05b62715d4a81a7db5b7ca4a372d109ec95634c9d3bef9e0041ff52de22fc","src/zlib-1.2.8/contrib/masmx86/inffas32.asm":"78d2cc88f8ed0e32ef960efc987c257bc1688afe7d031a8ba18761e95a6a7c3f","src/zlib-1.2.8/contrib/masmx86/match686.asm":"9e9bea3b5517b089da7d39caded07982746a33f94f0907ca7e8afefed7be36b6","src/zlib-1.2.8/contrib/masmx86/readme.txt":"1f29a04e0227b74e20ba1b7c764b3ca5bf596dd2c06e89bc19a05fb8f9689778","src/zlib-1.2.8/contrib/minizip/Makefile":"087034de3dc0223b29e64bb3a4fc3eda7b948e93d2a9ff154aecf9fed2a1eb5b","src/zlib-1.2.8/contrib/minizip/Makefile.am":"2313a3480a2c3745fa7ce216829cd0367058907d3a0902e5832c66c84a2fdfc6","src/zlib-1.2.8/contrib/minizip/MiniZip64_Changes.txt":"302c62b328647f5472fb7755249a83459be7f8ffb1fae07e8ba318fce8f4126c","src/zlib-1.2.8/contrib/minizip/MiniZip64_info.txt":"122719c32ef1763a5f6ba9c8cdefc1d78a76f7156b09e7b6f69b73f968e0dac3","src/zlib-1.2.8/contrib/minizip/configure.ac":"90cf87b0bfee8755540271caab9f0dcd45073021ae44f257f3c25e58817113c4","src/zlib-1.2.8/contrib/minizip/crypt.h":"8e872b60255b8447da99885c7159c2e1f1bb8143523bdbe71784e60f98bfd67b","src/zlib-1.2.8/contrib/minizip/ioapi.c":"66b39c27042f6ad12cc12efb0c82cdf100c6640b5fa959b8b866e252966113a9","src/zlib-1.2.8/contrib/minizip/ioapi.h":"8655408534b78dc0889a45f9359fc6d2d5c8e8d8443b81ede596f954c720ef48","src/zlib-1.2.8/contrib/minizip/iowin32.c":"0b9c9a609f24cd8dd63e5db732efd0b6ff49815166dfc58ddd202b1570b49a8b","src/zlib-1.2.8/contrib/minizip/iowin32.h":"586f22b9c3c64da253ce2b518e0fad61f19a7b47b289fc704cc9708242294c49","src/zlib-1.2.8/contrib/minizip/make_vms.com":"65736d9c4888f2373d3db0a13864d150c5040453f5bc2a5c8784379a7ea67590","src/zlib-1.2.8/contrib/minizip/miniunz.c":"ced49f20c62536a8ffb270b35cfa4994a1dcdce45f8cf059b941c94ca0022666","src/zlib-1.2.8/contrib/minizip/miniunzip.1":"66d8684392167091ef0fe01598d6a0daa26e7e448e2df6c3cb257487735b83f7","src/zlib-1.2.8/contrib/minizip/minizip.1":"5404596e8e5587a52f563906119f32ceee30a6d97a966afa5c7afbe4d373e210","src/zlib-1.2.8/contrib/minizip/minizip.c":"fdfcf83979ef2324c1455d369e8add8678c804939d412ce53f8b024578ceabad","src/zlib-1.2.8/contrib/minizip/minizip.pc.in":"8b6670b42d8e5e519e1cc89db093efc07ba23cb1ddfedd3c93ff2df08c3ce8ac","src/zlib-1.2.8/contrib/minizip/mztools.c":"cd887c4af6d20823bd15f24008b10acf01969b4165d7848656bde843a92428d7","src/zlib-1.2.8/contrib/minizip/mztools.h":"6f82c52279e8f79165f4446be652e5741a49992ac58632470335aa34c564072a","src/zlib-1.2.8/contrib/minizip/unzip.c":"9dc09da0688e5e5bd359844a7f24b36571213ece9e634192373f1b0762b18d6a","src/zlib-1.2.8/contrib/minizip/unzip.h":"d8dc58fc0121b6a4b98f3028205bb253f956b1ddf791e9ced3cf44892502a01f","src/zlib-1.2.8/contrib/minizip/zip.c":"23e4c2e582e445d96bd7d962ff7b335eeec3ac45475de255144a5597fbc9f245","src/zlib-1.2.8/contrib/minizip/zip.h":"96163fc140e4bf08752e014d20a1eac3f5adcdc408366f6d79c1895f2599cf08","src/zlib-1.2.8/contrib/pascal/example.pas":"d842d456ecb6ff80e34cee2da31deb2072cc69ca837497bea8b8bee203403474","src/zlib-1.2.8/contrib/pascal/readme.txt":"02f997c37991ddae0cb986039f7b4f6fc816b3fd0ffd332cad371d04c12cf1b9","src/zlib-1.2.8/contrib/pascal/zlibd32.mak":"850e91b6c9ea05de61a411cbda16fa0f10118cd88bb32c4b7226988776f8d511","src/zlib-1.2.8/contrib/pascal/zlibpas.pas":"9dcd5be5329b593cc44995b1886d2a5eb7bfc5f9ebb4b37fff852a0d940da046","src/zlib-1.2.8/contrib/puff/Makefile":"d9d738030464aaae354196c14fd928adf591832fce7d71ac1977c1d8d4923a4b","src/zlib-1.2.8/contrib/puff/README":"aceca4bc1bce7d9445b8bc9b6640c672d95708185f6070d3a3baae7a9d102caf","src/zlib-1.2.8/contrib/puff/puff.c":"099226fa987168a36825317cc6093111335a02bbdc85e2fe166d861103214686","src/zlib-1.2.8/contrib/puff/puff.h":"969b7be2a930db0cdcb19b0e5b29ae6741f5a8f663b6dba6d647e12ec60cfa8e","src/zlib-1.2.8/contrib/puff/pufftest.c":"8ee0da78a1221a3c2036e22eed06c2faa27a671a46565a60e10111d4ee9c30ee","src/zlib-1.2.8/contrib/puff/zeros.raw":"b7b0887089f7af1f6d1e0b4c0a1e8eddd10223b23554299455c6c9be71b653a3","src/zlib-1.2.8/contrib/testzlib/testzlib.c":"c6c37b35c6ecc9986a9041f86d879cc37a9e4d8315af9d725071eb3b2cade0c5","src/zlib-1.2.8/contrib/testzlib/testzlib.txt":"2359bbdc84eb8a04e0f1cd16cd81a2896e957f2ad58dab3ca78ef55b7d0dc577","src/zlib-1.2.8/contrib/untgz/Makefile":"8f5ab1564813e091cea8f1bb63da32fd80ac763d029277b0cabf50f60aceefe1","src/zlib-1.2.8/contrib/untgz/Makefile.msc":"d0f537de11d9e0e36e2a98b3971c537265f4b533b4c48797094365ad9ae8388b","src/zlib-1.2.8/contrib/untgz/untgz.c":"9a12d774301d252dcd38bba07ac369319da4c04c4fef8a50fcbf40aebf29c2a1","src/zlib-1.2.8/contrib/vstudio/readme.txt":"5dd8bef90296272ce8cdca6e5658057d52f05acea8adc49b7ab1bd67386fd513","src/zlib-1.2.8/contrib/vstudio/vc10/miniunz.vcxproj":"dd607d43c64581172c20c22112821924dfe862f56b2e5eb8780bdd0714d9527b","src/zlib-1.2.8/contrib/vstudio/vc10/miniunz.vcxproj.filters":"c3db9f97952683e688ad83c13bb94c816ac3e6b5f277fdea545b0650c125aa6d","src/zlib-1.2.8/contrib/vstudio/vc10/minizip.vcxproj":"af73f2cf8ae51e65e85342faeb40849a2310c97bc77def42b38d7070460a6cf0","src/zlib-1.2.8/contrib/vstudio/vc10/minizip.vcxproj.filters":"83db58d87f5d7ca84b6087aa1f62b15cbc296194c8cf76e47a271f9077b4f3bd","src/zlib-1.2.8/contrib/vstudio/vc10/testzlib.vcxproj":"1525ed0893db56db44ec68675c8da3c229dc7867166dfc0428816783d16ad43b","src/zlib-1.2.8/contrib/vstudio/vc10/testzlib.vcxproj.filters":"d7e04ffa467d417dfa3c0f1c64234cadc84882101bbae483f0a0f5d3d6b566a7","src/zlib-1.2.8/contrib/vstudio/vc10/testzlibdll.vcxproj":"3f317d8964f17901c3e68bff5deaec10b6ccc50a572235999e8097292692984c","src/zlib-1.2.8/contrib/vstudio/vc10/testzlibdll.vcxproj.filters":"682a485f0184aabba94e12e1b284499195f37c176d43ecee0484f31e4d636f6f","src/zlib-1.2.8/contrib/vstudio/vc10/zlib.rc":"9caf00def3b7c7216c4adf4a58d840ebd74155af5dbc7f1ef6e36e8ed77fe407","src/zlib-1.2.8/contrib/vstudio/vc10/zlibstat.vcxproj":"2a38222d6c034d7e0b843c3f0540dc6c53dd48f942ae29f31620ca0327248c8e","src/zlib-1.2.8/contrib/vstudio/vc10/zlibstat.vcxproj.filters":"d9a2c381e51e4d6f027f3517db7db81656e43cec02ed9abf267a0fde6f360180","src/zlib-1.2.8/contrib/vstudio/vc10/zlibvc.def":"ed94936c1301753eff22bd2374f6a7dff3b2caf56d13debb99966b01c2ba355f","src/zlib-1.2.8/contrib/vstudio/vc10/zlibvc.sln":"e659860f705f31b87ea9139a3cb4ebe1561e120bce495383a54614fc82b49990","src/zlib-1.2.8/contrib/vstudio/vc10/zlibvc.vcxproj":"3108badf710e2f4a64eab4e7deae6642fb68cc0d94018e537149f1761e215133","src/zlib-1.2.8/contrib/vstudio/vc10/zlibvc.vcxproj.filters":"58404ba7703c68025bec64b8a17ff1fc7f3a35d15d17ae3bcc4fa753f1348425","src/zlib-1.2.8/contrib/vstudio/vc11/miniunz.vcxproj":"746e4c11fb8af4bcd6a9d68ba81ed1dc366a5de3bed56b291ee969ad733a7bb0","src/zlib-1.2.8/contrib/vstudio/vc11/minizip.vcxproj":"340617cae9cf4fcb003308021d3782ec3639e60d62d79a3aafc0a50bb55b061e","src/zlib-1.2.8/contrib/vstudio/vc11/testzlib.vcxproj":"589eec6ef6d818564ead938a629fda50abb6cbf8054b9f66ea780765c1a1b3db","src/zlib-1.2.8/contrib/vstudio/vc11/testzlibdll.vcxproj":"583bdef522b0176829f0d8139ea2a88b9cbc14379d1334f3a863989ed3df9b67","src/zlib-1.2.8/contrib/vstudio/vc11/zlib.rc":"9caf00def3b7c7216c4adf4a58d840ebd74155af5dbc7f1ef6e36e8ed77fe407","src/zlib-1.2.8/contrib/vstudio/vc11/zlibstat.vcxproj":"51aa752698d96df065a9ece02e293492f681b59a8077f036a5a60367dc621e87","src/zlib-1.2.8/contrib/vstudio/vc11/zlibvc.def":"ed94936c1301753eff22bd2374f6a7dff3b2caf56d13debb99966b01c2ba355f","src/zlib-1.2.8/contrib/vstudio/vc11/zlibvc.sln":"27389b515997defd080519f95aff87e89fcbe8b26d73c5ebb73c544cfef4d60e","src/zlib-1.2.8/contrib/vstudio/vc11/zlibvc.vcxproj":"c3dd05e56159aba411475b83656275872524cb3c2fd24d690397d8b634e7e0ed","src/zlib-1.2.8/contrib/vstudio/vc9/miniunz.vcproj":"b2b53bd9e704bfbe769b863acdc2a3368692ca149c4b4ed2a0761b0cd16c6726","src/zlib-1.2.8/contrib/vstudio/vc9/minizip.vcproj":"80a701fb41a61871ce1d25f6b03e571edb6c3abf0aa45375554b6fac52115eb6","src/zlib-1.2.8/contrib/vstudio/vc9/testzlib.vcproj":"05fc5a87682b17690d199f424f57f6ad7767b8dabb29a1039bfcb88bca1b302f","src/zlib-1.2.8/contrib/vstudio/vc9/testzlibdll.vcproj":"25c1cc5319f1c4b7dbdb595c3cfd6ec3ba217818b03b7055ef5ef440b575a43d","src/zlib-1.2.8/contrib/vstudio/vc9/zlib.rc":"9caf00def3b7c7216c4adf4a58d840ebd74155af5dbc7f1ef6e36e8ed77fe407","src/zlib-1.2.8/contrib/vstudio/vc9/zlibstat.vcproj":"e8653eea37f3bef097eec2caa55e1f698c3c74c959689bc4e97568e88d2bbc60","src/zlib-1.2.8/contrib/vstudio/vc9/zlibvc.def":"ed94936c1301753eff22bd2374f6a7dff3b2caf56d13debb99966b01c2ba355f","src/zlib-1.2.8/contrib/vstudio/vc9/zlibvc.sln":"26e58d4b2cfcd941c367fb2a18537b3b9f002f2ac1278b700ea1129c50501452","src/zlib-1.2.8/contrib/vstudio/vc9/zlibvc.vcproj":"86aa6e33db104c0a0ed4a9f21f0db8572cc7755170217aef18219fdd74b75e9d","src/zlib-1.2.8/crc32.c":"3f3daca510273dda74eaf381c46d2551e3a3506891ae063ab451b87744a7a36c","src/zlib-1.2.8/crc32.h":"407af59d0abfea84a6507c603eb29809411797f98249614fe76a661def783ce1","src/zlib-1.2.8/deflate.c":"565e68ddfff5af8efd55f71e122b860ad11527a7d9de40a76af2b16afef24cc0","src/zlib-1.2.8/deflate.h":"80570c8052491bdc7583600da28a8f1cb32c27ab1cec107ec12c83255d426cf7","src/zlib-1.2.8/doc/algorithm.txt":"992590931e982c0765286c2d83f6e9ff0a95aabb08e28c30c52bae3e8c4bd5ad","src/zlib-1.2.8/doc/rfc1950.txt":"8f0475a5c984657bf26277f73df9456c9b97f175084f0c1748f1eb1f0b9b10b9","src/zlib-1.2.8/doc/rfc1951.txt":"5ebf4b5b7fe1c3a0c0ab9aa3ac8c0f3853a7dc484905e76e03b0b0f301350009","src/zlib-1.2.8/doc/rfc1952.txt":"164ef0897b4cbec63abf1b57f069f3599bd0fb7c72c2a4dee21bd7e03ec9af67","src/zlib-1.2.8/doc/txtvsbin.txt":"47c273bb22c9773248d380549a330e5c262266b1292154b0d3014f731cc73f47","src/zlib-1.2.8/examples/README.examples":"402d72eb69c2e03a25034f4b3c02b110f0f67149ecfa4fa0e4b2bf0ceb49a8b3","src/zlib-1.2.8/examples/enough.c":"704e273f65b62c5d2eb06d5bb10c4ccffba56544aa477f0e3957e2296c501b78","src/zlib-1.2.8/examples/fitblk.c":"950769163c41aff897ee41746a8685d9aa41073b1307f42da19dabe9d3fc8b85","src/zlib-1.2.8/examples/gun.c":"2d38ab3176a404e2da885dca47b1a6bbb64fd0ae7c089131ee3887c239b40b7e","src/zlib-1.2.8/examples/gzappend.c":"4182d38bf97ffbdf1110df7f65c0e8fab0b28b1ea36ebba8621c14e8e76f1caa","src/zlib-1.2.8/examples/gzjoin.c":"90b9d6c39a5fc91cf1cc9b96b025a508a8015dc502cd9374c754b44078593f57","src/zlib-1.2.8/examples/gzlog.c":"073c99b407c738bb56396fab1e3eb1affaba9af7b8f8ebffcc0644b1591be162","src/zlib-1.2.8/examples/gzlog.h":"309556e2d7d39250924946b78e2cce0ac927857d6e1a02cab64e438f533c20c3","src/zlib-1.2.8/examples/zlib_how.html":"80fb647be8450bd7a07d8495244e1f061dfbdbdb53172ca24e7ffff8ace9c72f","src/zlib-1.2.8/examples/zpipe.c":"68140a82582ede938159630bca0fb13a93b4bf1cb2e85b08943c26242cf8f3a6","src/zlib-1.2.8/examples/zran.c":"b1b910708225a62f81ec97a08203239d35d18c33470c0775f0bcd5347820e1f6","src/zlib-1.2.8/gzclose.c":"94446cf8cde67c30e64d0a335b0c941fd3fbad2e77f30180d12e61f9c2a5a6b8","src/zlib-1.2.8/gzguts.h":"2d3c0154089061fd3a9a789903e54b2ca3cef241383599f37b63914330b9c358","src/zlib-1.2.8/gzlib.c":"90d43517bcff858312c0ed72dfa760be3a774939ba663952f0f9aa0e96f97f34","src/zlib-1.2.8/gzread.c":"b2bd8884fc467b47e425d1c34268f08e40dd54401682a49c56d2e441ee811d8c","src/zlib-1.2.8/gzwrite.c":"09d33648f5b3be2efd3ad176f6b966205d5f8abaf1d1139a196e0987b9319b7d","src/zlib-1.2.8/infback.c":"16f8418da8a86bcb5fb98f121f3ba45275ae5b57ad00b0545d4a311ed890f524","src/zlib-1.2.8/inffast.c":"fd82c328b310f2f0ecc6a13475889e51c407dd4c5e8a931a36f18ad63f319c35","src/zlib-1.2.8/inffast.h":"7d8c1c873ce9bc346ad6005bb9d75cce5c6352aaf7395385be216a9452a34908","src/zlib-1.2.8/inffixed.h":"237ba710f090e432b62ebf963bee8b302867e9691406b2d3f8ee89ee7bfef9b0","src/zlib-1.2.8/inflate.c":"fb9bfa1295e7a6ef1b4a1149eec372dd7dcce407dd4fe9fea9c23a45a6857381","src/zlib-1.2.8/inflate.h":"36e5300408aa55a175a7d9be6b2f25dc0c5f80d79b2115fe43a2fe531e84775d","src/zlib-1.2.8/inftrees.c":"608f96120ac1572002bbce6dcd2625171dae0afbecf4334070288a33e19e5952","src/zlib-1.2.8/inftrees.h":"c510b36402784b1f898be3b049b923469aa92701de2d9195aed19f6b65c0dce2","src/zlib-1.2.8/make_vms.com":"3064eb153a7684115f1494364f80759bc5a2c227799fdf08df7b9e6e50884720","src/zlib-1.2.8/msdos/Makefile.bor":"292ab363f7ffbc4ae84d37cd9bdffd2dac1003bee52d223a8489844870f20702","src/zlib-1.2.8/msdos/Makefile.dj2":"df5e05d3744e8539299c6974fae2d68a13fc5513e8564fef791b6665df592bce","src/zlib-1.2.8/msdos/Makefile.emx":"5cb73e60a327b58f755442e3444b529f8a50146f980e0a38b945c7c40c112761","src/zlib-1.2.8/msdos/Makefile.msc":"0e021a6f42212415b060e4ad468eb415d0a8c1f343137fb9dff2cb8f9ead3027","src/zlib-1.2.8/msdos/Makefile.tc":"2ae12ee2a3e62f7c5a0520d0fbe4adee772bc07fe816002b07ccb43db3daa76a","src/zlib-1.2.8/nintendods/Makefile":"ea5823efe6830132294eddf2f56dbd7db8712244c210bb4968c431b1a91bd066","src/zlib-1.2.8/nintendods/README":"e362426c47b39ff6a7d6c75c6660b20abf076cdfa5e1e421716dc629a71aef95","src/zlib-1.2.8/old/Makefile.emx":"c767d0e5505995e8e7cac2734bbcb08e1cf823f19cc734e5c845b5ef5fccced6","src/zlib-1.2.8/old/Makefile.riscos":"d1a488b160fbfd53272b68a913283a4be08ba9d490796b196dddb2ba535b41e0","src/zlib-1.2.8/old/README":"551a0f4d91fe0f827a31cbdfbb4a71d1f3dc4d06564d80a3f526b749dd104d11","src/zlib-1.2.8/old/descrip.mms":"8ff08c35c056df9c986f23c09cf8936db63ccf12c3c42f7d18a48b36f060cff7","src/zlib-1.2.8/old/os2/Makefile.os2":"7d16bade2a9c0d3847fd9ba2e75eb3a0c14d0f741610f4bf9cb3edef84c696b4","src/zlib-1.2.8/old/os2/zlib.def":"ea9c61876d2e20b67ef2d9495991a32798eb40d13ede95859a2f4f03b65b9b61","src/zlib-1.2.8/old/visual-basic.txt":"1727650acbde9a9e6aec9438896377e46a12699cca5d46c5399cef524dedc614","src/zlib-1.2.8/qnx/package.qpg":"e7795fef80cfc2d7a4377e6af90a831955b7be35c64e3b310ec87678d360dfb0","src/zlib-1.2.8/test/example.c":"63061f7e4978035e072d0906aae087605551352adef92d4499b533a79e25747c","src/zlib-1.2.8/test/infcover.c":"f3fc5682c7d99e6bb670b8ef53463257ea3a4a57dd5e20b109005f99a807e5fb","src/zlib-1.2.8/test/minigzip.c":"a181d4748927637f26d0641d5666840c9d3afbe8910d46d3020e3c6edbde1c4a","src/zlib-1.2.8/treebuild.xml":"6ddcf7cd73f4f9194addf7b3c82aca350c912062ea0c8f0df13c49c614fd9968","src/zlib-1.2.8/trees.c":"49b5289399f76281541b26cab190d9d4e34bb666728ed661e0bfc7fb402d20f1","src/zlib-1.2.8/trees.h":"bb0a9d3ca88ee00c81adb7c636e73b97085f6ef1b52d6d58edbe2b6dc3adeb4d","src/zlib-1.2.8/uncompr.c":"454902e5c47baf75e946b999fb93b9f8a3f6bbac68c5c51b3e0fe8f54542123e","src/zlib-1.2.8/watcom/watcom_f.mak":"7e039b912f9cffaa40835281430bb284fa9042b0a0d12f6b34700a06bca6576e","src/zlib-1.2.8/watcom/watcom_l.mak":"d11b4064604a034725860e63e3f6d347056372e4b1675b183e20a93533b20cc9","src/zlib-1.2.8/win32/DLL_FAQ.txt":"9e00778319381e6275691dd3a89410c99065b8c0c5db96473abe8c859cbdefd8","src/zlib-1.2.8/win32/Makefile.bor":"e878fed2313417db085fea621c110889f6a32233b5b6db46e3c4e824c1d0ed6b","src/zlib-1.2.8/win32/Makefile.gcc":"3109182015186cd089f545dffcb3e81f9538ebec30c3c9836f8a4b67b2f2ebaf","src/zlib-1.2.8/win32/Makefile.msc":"4bfc81e50e6afa9cb7935bf8176743df8df224ab943b29d81ab4cb0f72a317d7","src/zlib-1.2.8/win32/README-WIN32.txt":"5e279cfb5d0476e27b78b1713eaf97d07935c14b9fc681791e15efb2344e6a43","src/zlib-1.2.8/win32/VisualC.txt":"e309c8623a1dcff79f5e588266c6ec68ca99f662baf9782591df561d5ddd94ea","src/zlib-1.2.8/win32/zlib.def":"87e3b230a173c65b988be24f339c2f4350780001e2810029ef55240397f25193","src/zlib-1.2.8/win32/zlib1.rc":"d7f269379144d65bcd1b67c1065e5d4120579f14ce54ecf246eaba394fa989a5","src/zlib-1.2.8/zconf.h":"ec0d0a6e87b749ab5fc3f27c0e8292b7aed139ca0b6121ab27e6eb30e2e9b6ba","src/zlib-1.2.8/zconf.h.cmakein":"49c987659808d77f5250b2f64ee71e57cf32cf4b52955cea179d7ebd3c578e59","src/zlib-1.2.8/zconf.h.in":"ec0d0a6e87b749ab5fc3f27c0e8292b7aed139ca0b6121ab27e6eb30e2e9b6ba","src/zlib-1.2.8/zlib.3":"621d9c7afa32fac41b28219c0d38a4a7179fdc05358bd2f7bdf7116d25d0cecd","src/zlib-1.2.8/zlib.h":"726b0569915917b967f87f3f08a1eec039101bf9dcc29d61c0b2b0b8f271b58d","src/zlib-1.2.8/zlib.map":"2b133e742e41f08cc4e993ceddbd43ee9d2d1b76da60c53b8405e1f811274a85","src/zlib-1.2.8/zlib.pc.cmakein":"2f1d0b18ce37c2af415a469857f02aee2c41a58877aff21d29e9c6db32b55cb7","src/zlib-1.2.8/zlib.pc.in":"04c01cc2e1a0ed123518b5855f585c93a24526dd88982c414111ea1fc9f07997","src/zlib-1.2.8/zlib2ansi":"d316e3e79054f5f9fe921d35f4bbf4bf0a37b859d29d2b34ae4d7d92afc3e55c","src/zlib-1.2.8/zutil.c":"c5e9927d5a1a1dec514ccdcedfa1e0f01664c58bb33166b4997b50b8001f1d6c","src/zlib-1.2.8/zutil.h":"91cce8e78e83bcdb8c6acb98d4f0686dbdc81ca97d4a36a60c0b48f7ef78f1af"},"package":"40f2df7730b5d29426c3e44ce4d088d8c5def6471c2c93ba98585b89fb201ce6"}
\ No newline at end of file
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"f9b1ca6ae27d1c18215265024629a8960c31379f206d9ed20f64e0b2dcf79805",".travis.yml":"a19093729b3ad9644f76f43c23b3583cfc9a7cd029d8c3a728cba6fd624abf1c","Cargo.toml":"7c0ab3304b4468289835452fdfd195507a00c3c71d05ab3cda44a19ee09c9245","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"2908cdccf74d645b28f8ef1c54146172f171c655275241fb3016dac8a5e4627d","appveyor.yml":"48c2df07a5a86878c662e1485c7e00b2e405765c5206eeca002d5142f9312fae","build.rs":"91994fa0d0f962ec1bbb0feea8e5407e3fe700932ea2884987c9ecba4ca8c60b","src/lib.rs":"04206965d961a957070507355a9fc270ce37dcc98ce54ab7f92ed8d070e57eb4","src/zlib-1.2.8/CMakeLists.txt":"ff988cbc9cbb5692400b37df2b80eb25afa6d6bf0d840a6dff5673ee7c190718","src/zlib-1.2.8/ChangeLog":"1285914a14f28ad77c3eef8c34d219e49459989502237086a14ec3d6cca7a760","src/zlib-1.2.8/FAQ":"1e8a0078be0ff1b60d57561a9e4a8cad72892318a8831946cba1abd30d65521c","src/zlib-1.2.8/INDEX":"3b4e325d47ae66456d43fcf143ba21ab67a02a4f81be7ef2da480ba30d774266","src/zlib-1.2.8/Makefile":"ef23b08ce01239843f1ded3f373bfc432627a477d62f945cbf63b2ac03db118a","src/zlib-1.2.8/Makefile.in":"edb322ca9ea5055eb1c5fd0b277e152986bb9135a86500039f6de19a68d6a5f7","src/zlib-1.2.8/README":"53a466b504371dcdda1504c90d8121d4823921f03554c3526995fb2bae7159f9","src/zlib-1.2.8/adler32.c":"341d49ae2703037d2d10c8486f1a1ca3b65e0f10cc9e5fead6bfbbc0b34564ba","src/zlib-1.2.8/amiga/Makefile.pup":"a65cb3cd40b1b8ec77e288974dd9dc53d91ed78bbe495e94ccc84ddd423edf1f","src/zlib-1.2.8/amiga/Makefile.sas":"0e63cf88b505a1a04327bb666af3a985c5e11835c0c00aed4058c0dcc315d60e","src/zlib-1.2.8/as400/bndsrc":"9672d2c5e4692114e5ee23efc4ee3b0b4f3c293a9f25e394f3c8e8697c315abb","src/zlib-1.2.8/as400/compile.clp":"67cde543d10728eae8ed8318d1ea0ec55b6d883c6e668544c3beb6fe825112a1","src/zlib-1.2.8/as400/readme.txt":"eb89121904ab1a1a38ed9c360186fc52ca39a6e468a6ee848639774956e821e8","src/zlib-1.2.8/as400/zlib.inc":"d6ba9242df0742950a8b52b8cb6314fc62859879e50218cad44e220f8c3eeaea","src/zlib-1.2.8/compress.c":"0f05c385cf9f052e5fa1ae478b492ee4e04a60bc39d173c4ca4f58d799d5d1ab","src/zlib-1.2.8/configure":"94159ff86133515dee243814d92238192d1f2c36c86fdc1472e0a0a797d1dd2f","src/zlib-1.2.8/contrib/README.contrib":"b01cfbd6a67e950886c7381ef96a46e50b03a5f61d4905a99a87c8db06bfb961","src/zlib-1.2.8/contrib/ada/buffer_demo.adb":"469cf566a6965767fee6b987a239ed8cedcc66614940d45a9b434331fbb435ce","src/zlib-1.2.8/contrib/ada/mtest.adb":"41b6f31684770334afdc4375871eb1408542f37a823a073556fdbfdb63753160","src/zlib-1.2.8/contrib/ada/read.adb":"fa5b989aef0c5715a3fcb15de93985f7f10aeb0a7f5716745c95ed820eb9af9c","src/zlib-1.2.8/contrib/ada/readme.txt":"8fe9e5303f2e8e8b746c78250e74b7c4aeb7ce6212fdce751fc3a0ce56a47fe2","src/zlib-1.2.8/contrib/ada/test.adb":"5e3abe79b387e09a9a42bd0543105e228f39a335240cffc33d71f0ba66ff2511","src/zlib-1.2.8/contrib/ada/zlib-streams.adb":"f45988e2bac76eb25a0dc981f46576e7432c35dde1790bbc2b650f0090b7fa72","src/zlib-1.2.8/contrib/ada/zlib-streams.ads":"6622f7fe7d4364010eb068bb87cf4b89bc22abbfac6c5a6b06f92b8ce0f3b866","src/zlib-1.2.8/contrib/ada/zlib-thin.adb":"03d89244ee5ec9771d9b5050e586c609f851af551b2e64eb151f1d5be0b63ae9","src/zlib-1.2.8/contrib/ada/zlib-thin.ads":"fdf7da9aa7a773d5bdfaf654a0f511bab1a53e034e56a445108a1cd984b8c5f8","src/zlib-1.2.8/contrib/ada/zlib.adb":"c9ca5dc34fbcdf06e2dc777b7e9dcd0ba31085b772b440eb0e12421323ab672c","src/zlib-1.2.8/contrib/ada/zlib.ads":"02634bec0d5e4c69d8d2859124380074a57de8d8bd928398379bfacc514236d2","src/zlib-1.2.8/contrib/ada/zlib.gpr":"859bb69dce38dbe9dca06753cf7ae7bd16d48f4fece8b87582dab8e30681d3de","src/zlib-1.2.8/contrib/amd64/amd64-match.S":"166007f7e9adb58fe8b83d85bbfe823f5e05858ba1d06edf637b78886caa2c69","src/zlib-1.2.8/contrib/asm686/README.686":"c21cc7147c956ecae17dd084cb41a206b086216fa521012871fb07fafd203c6d","src/zlib-1.2.8/contrib/asm686/match.S":"873799062495629f21cd3f779ea4b927add7aae0144e32d3594d9ce70185e99d","src/zlib-1.2.8/contrib/blast/Makefile":"17d5d26c24bf51cad51045a38ffb73cc3539d29e89885aa249fcfd45a8659d5c","src/zlib-1.2.8/contrib/blast/README":"baa763ae03d88ef7ece6eb80d9a099b43d0b57639d6d281e1c7c6ca79d81daba","src/zlib-1.2.8/contrib/blast/blast.c":"65a1655f9dce77e79faabbd13d3e98c97c974303b652632f0ea791401c66f1ed","src/zlib-1.2.8/contrib/blast/blast.h":"825e2f90c605133c96dc134ace6b62b70cc08156c7306a299bc8847f8fbb8ecb","src/zlib-1.2.8/contrib/blast/test.pk":"5f5c262c545574a5c221132d5ef832478d222d70b015341795b3860204140d7c","src/zlib-1.2.8/contrib/blast/test.txt":"9679b2c98e1283222d0782b25a1c198dc64ba9ebd1addd6dc6f643a45947cda3","src/zlib-1.2.8/contrib/delphi/ZLib.pas":"ded3fe0698466d078434a82e1e2c62c912021fd26d8ce914066d0e5317e171c1","src/zlib-1.2.8/contrib/delphi/ZLibConst.pas":"84bcc580bdf397e570f86f3f5a5b8c7bf537828f30b4b72648b81911f6bf5095","src/zlib-1.2.8/contrib/delphi/readme.txt":"f7420ed2de77d4b498eefbbe6402a1d17dc2d411735289c78a265c7f10fdaee5","src/zlib-1.2.8/contrib/delphi/zlibd32.mak":"850e91b6c9ea05de61a411cbda16fa0f10118cd88bb32c4b7226988776f8d511","src/zlib-1.2.8/contrib/dotzlib/DotZLib.build":"b96137097669644ecb9f42cdd3399d1fce9c512788374609303f7e50abf597f0","src/zlib-1.2.8/contrib/dotzlib/DotZLib.chm":"20d0e3edd57f849143255a7f0df1cd59d41db464a72c0d5ab42846438a729579","src/zlib-1.2.8/contrib/dotzlib/DotZLib.sln":"a979198c5b8d144c1ac8f993bfb6f4085d135aa58ca9dcf63ebabf52b5c695f7","src/zlib-1.2.8/contrib/dotzlib/DotZLib/AssemblyInfo.cs":"314afcfb339ea95f5431047b7ab24631b11c3532c7ce5dc2094ed0cf80a7c16d","src/zlib-1.2.8/contrib/dotzlib/DotZLib/ChecksumImpl.cs":"e7c047a2c3bcf88d3d002ee3d2d05af414acf53cb4451efacc0f2e95a474ea0f","src/zlib-1.2.8/contrib/dotzlib/DotZLib/CircularBuffer.cs":"be84c9736fe7bdc2bfae70466d8fff582504e928d5b5e110fd758090090c8cb7","src/zlib-1.2.8/contrib/dotzlib/DotZLib/CodecBase.cs":"259bdda1b7d6052134e631fa24bfd9dca6e2362563496c8b85257b56c848908c","src/zlib-1.2.8/contrib/dotzlib/DotZLib/Deflater.cs":"06ba6696a3c15c53ba5fd5a1c2bf50b51f217010228fc1e4c8495ee578f480de","src/zlib-1.2.8/contrib/dotzlib/DotZLib/DotZLib.cs":"9837fe993fd631233cc5e53ff084d86754b97f05ec77c54b0764c2706f186134","src/zlib-1.2.8/contrib/dotzlib/DotZLib/DotZLib.csproj":"21606db31dfef6410dd438b73f1db68856eacabcce6c0f0411fc4f17e17001f3","src/zlib-1.2.8/contrib/dotzlib/DotZLib/GZipStream.cs":"8d1de9755c77046b4ac71340a0a54434ebf4fd11b085c44454d7663a9b4df1c5","src/zlib-1.2.8/contrib/dotzlib/DotZLib/Inflater.cs":"9016ca73818f5b6a28791abc3af6da7c4d2773b6a3804f593f6d5737a62b99ad","src/zlib-1.2.8/contrib/dotzlib/DotZLib/UnitTests.cs":"b5266d91bad91ff484582231cdc06baa916a5b4c4e4be79e380037e9be6a9429","src/zlib-1.2.8/contrib/dotzlib/LICENSE_1_0.txt":"36266a8fd073568394cb81cdb2b124f7fdae2c64c1a7ed09db34b4d22efa2951","src/zlib-1.2.8/contrib/dotzlib/readme.txt":"d04972a91b1563fb4b7acab4b9ff2b84e57368953cc0596d5f5ea17d97315fd0","src/zlib-1.2.8/contrib/gcc_gvmat64/gvmat64.S":"22ff411b8b1d1b04aeaa8418b68245400267dc43c6f44104f6ccd37f0daee89f","src/zlib-1.2.8/contrib/infback9/README":"890288f02bb3b1f9cc654b87a07fcea695f90f6b9bd672d25bf6be1da2ec1688","src/zlib-1.2.8/contrib/infback9/infback9.c":"0a715c85a1ce3bb8b5a18d60941ffabc0186a886bcc66ba2ee0c4115a8e274e9","src/zlib-1.2.8/contrib/infback9/infback9.h":"dda2302f28157fe43a6143f84802af1740393572c2766559593996fd7a5a3245","src/zlib-1.2.8/contrib/infback9/inffix9.h":"84a2ba4727767c18af6505f0e81d9c814489c8b9ed330a25dad433db72997e43","src/zlib-1.2.8/contrib/infback9/inflate9.h":"32a907676cc36e27d0fdc0d99adb83a0b23f20ab61896269216d40fecf08d349","src/zlib-1.2.8/contrib/infback9/inftree9.c":"9761abea8a34213c2d4ddea7854fd7dcc48deb2895d83c61c4c1b34294ffcfbf","src/zlib-1.2.8/contrib/infback9/inftree9.h":"8ae61d52e50d2dbdb0378548ecc54fcd88f108c8b6fc30562a3ebec1ca6a599e","src/zlib-1.2.8/contrib/inflate86/inffas86.c":"6f266f3c7e0faca653256d0189c0f00d7dc0b062d02e25df4e1202e49369595c","src/zlib-1.2.8/contrib/inflate86/inffast.S":"70777bd21526680005fc34f086d108af49e2668ad86d1749e8e8100a81bfb288","src/zlib-1.2.8/contrib/iostream/test.cpp":"0f3c77e013949eb9c91e6b690ea894e19d97944d6b0885b82806fc3ad99680cf","src/zlib-1.2.8/contrib/iostream/zfstream.cpp":"8ebb9b3d521cc3392953f27658cf1f6dcb763216079f69a1518ec5ca0e42a63b","src/zlib-1.2.8/contrib/iostream/zfstream.h":"4369c35e66f63f52ca4a5e1759bf720507ccabb8f3f132e2f18e68686c812401","src/zlib-1.2.8/contrib/iostream2/zstream.h":"d0343e0c57ff58008b6f29643d289c72713aa2d653fe3dcd2e939fc77e7e20b6","src/zlib-1.2.8/contrib/iostream2/zstream_test.cpp":"f789df183cc58b78751985466380c656308490a9036eb48a7ef79704c3d3f229","src/zlib-1.2.8/contrib/iostream3/README":"43ec48ecbd95a8c45db20b107fac73b740bb11595a4737329188f06b713972cc","src/zlib-1.2.8/contrib/iostream3/TODO":"af5ebc83fb88f69706c8af896733784753dead147687e1c046f410c0997fd88b","src/zlib-1.2.8/contrib/iostream3/test.cc":"8e17fc48dfdbc6e268838b8b427491b5843b6d18bc97caa6924de9fad7abe3da","src/zlib-1.2.8/contrib/iostream3/zfstream.cc":"8cdd67ed0b13c192c11e5ea90e9d5782d6627eb303fbc4aa5ebda2531ec00ff8","src/zlib-1.2.8/contrib/iostream3/zfstream.h":"1bd74778fac45ee090dfc0f182a23e8a849152deb630606884b2635987b357b1","src/zlib-1.2.8/contrib/masmx64/bld_ml64.bat":"1c0561908a07ebdff271b12ed757241e1813d3db0f3551501b2595c23f0833aa","src/zlib-1.2.8/contrib/masmx64/gvmat64.asm":"390c1e6d63cb615b5ba042842738953f9cdc688b2fe35aaca981fd3fae213f3f","src/zlib-1.2.8/contrib/masmx64/inffas8664.c":"f6c585e43e6e524107566b1f10104949d0ef902159ac8203e1d98e50d4bedd62","src/zlib-1.2.8/contrib/masmx64/inffasx64.asm":"8448d0041fe6e8f4188fe5916181a1b274c6d35d75cfb28da60cf4f1edde44ec","src/zlib-1.2.8/contrib/masmx64/readme.txt":"9bb66b5028100855683853f12da0be479c7bccf74365fdbf37da2542edff9927","src/zlib-1.2.8/contrib/masmx86/bld_ml32.bat":"b0b05b62715d4a81a7db5b7ca4a372d109ec95634c9d3bef9e0041ff52de22fc","src/zlib-1.2.8/contrib/masmx86/inffas32.asm":"78d2cc88f8ed0e32ef960efc987c257bc1688afe7d031a8ba18761e95a6a7c3f","src/zlib-1.2.8/contrib/masmx86/match686.asm":"9e9bea3b5517b089da7d39caded07982746a33f94f0907ca7e8afefed7be36b6","src/zlib-1.2.8/contrib/masmx86/readme.txt":"1f29a04e0227b74e20ba1b7c764b3ca5bf596dd2c06e89bc19a05fb8f9689778","src/zlib-1.2.8/contrib/minizip/Makefile":"087034de3dc0223b29e64bb3a4fc3eda7b948e93d2a9ff154aecf9fed2a1eb5b","src/zlib-1.2.8/contrib/minizip/Makefile.am":"2313a3480a2c3745fa7ce216829cd0367058907d3a0902e5832c66c84a2fdfc6","src/zlib-1.2.8/contrib/minizip/MiniZip64_Changes.txt":"302c62b328647f5472fb7755249a83459be7f8ffb1fae07e8ba318fce8f4126c","src/zlib-1.2.8/contrib/minizip/MiniZip64_info.txt":"122719c32ef1763a5f6ba9c8cdefc1d78a76f7156b09e7b6f69b73f968e0dac3","src/zlib-1.2.8/contrib/minizip/configure.ac":"90cf87b0bfee8755540271caab9f0dcd45073021ae44f257f3c25e58817113c4","src/zlib-1.2.8/contrib/minizip/crypt.h":"8e872b60255b8447da99885c7159c2e1f1bb8143523bdbe71784e60f98bfd67b","src/zlib-1.2.8/contrib/minizip/ioapi.c":"66b39c27042f6ad12cc12efb0c82cdf100c6640b5fa959b8b866e252966113a9","src/zlib-1.2.8/contrib/minizip/ioapi.h":"8655408534b78dc0889a45f9359fc6d2d5c8e8d8443b81ede596f954c720ef48","src/zlib-1.2.8/contrib/minizip/iowin32.c":"0b9c9a609f24cd8dd63e5db732efd0b6ff49815166dfc58ddd202b1570b49a8b","src/zlib-1.2.8/contrib/minizip/iowin32.h":"586f22b9c3c64da253ce2b518e0fad61f19a7b47b289fc704cc9708242294c49","src/zlib-1.2.8/contrib/minizip/make_vms.com":"65736d9c4888f2373d3db0a13864d150c5040453f5bc2a5c8784379a7ea67590","src/zlib-1.2.8/contrib/minizip/miniunz.c":"ced49f20c62536a8ffb270b35cfa4994a1dcdce45f8cf059b941c94ca0022666","src/zlib-1.2.8/contrib/minizip/miniunzip.1":"66d8684392167091ef0fe01598d6a0daa26e7e448e2df6c3cb257487735b83f7","src/zlib-1.2.8/contrib/minizip/minizip.1":"5404596e8e5587a52f563906119f32ceee30a6d97a966afa5c7afbe4d373e210","src/zlib-1.2.8/contrib/minizip/minizip.c":"fdfcf83979ef2324c1455d369e8add8678c804939d412ce53f8b024578ceabad","src/zlib-1.2.8/contrib/minizip/minizip.pc.in":"8b6670b42d8e5e519e1cc89db093efc07ba23cb1ddfedd3c93ff2df08c3ce8ac","src/zlib-1.2.8/contrib/minizip/mztools.c":"cd887c4af6d20823bd15f24008b10acf01969b4165d7848656bde843a92428d7","src/zlib-1.2.8/contrib/minizip/mztools.h":"6f82c52279e8f79165f4446be652e5741a49992ac58632470335aa34c564072a","src/zlib-1.2.8/contrib/minizip/unzip.c":"9dc09da0688e5e5bd359844a7f24b36571213ece9e634192373f1b0762b18d6a","src/zlib-1.2.8/contrib/minizip/unzip.h":"d8dc58fc0121b6a4b98f3028205bb253f956b1ddf791e9ced3cf44892502a01f","src/zlib-1.2.8/contrib/minizip/zip.c":"23e4c2e582e445d96bd7d962ff7b335eeec3ac45475de255144a5597fbc9f245","src/zlib-1.2.8/contrib/minizip/zip.h":"96163fc140e4bf08752e014d20a1eac3f5adcdc408366f6d79c1895f2599cf08","src/zlib-1.2.8/contrib/pascal/example.pas":"d842d456ecb6ff80e34cee2da31deb2072cc69ca837497bea8b8bee203403474","src/zlib-1.2.8/contrib/pascal/readme.txt":"02f997c37991ddae0cb986039f7b4f6fc816b3fd0ffd332cad371d04c12cf1b9","src/zlib-1.2.8/contrib/pascal/zlibd32.mak":"850e91b6c9ea05de61a411cbda16fa0f10118cd88bb32c4b7226988776f8d511","src/zlib-1.2.8/contrib/pascal/zlibpas.pas":"9dcd5be5329b593cc44995b1886d2a5eb7bfc5f9ebb4b37fff852a0d940da046","src/zlib-1.2.8/contrib/puff/Makefile":"d9d738030464aaae354196c14fd928adf591832fce7d71ac1977c1d8d4923a4b","src/zlib-1.2.8/contrib/puff/README":"aceca4bc1bce7d9445b8bc9b6640c672d95708185f6070d3a3baae7a9d102caf","src/zlib-1.2.8/contrib/puff/puff.c":"099226fa987168a36825317cc6093111335a02bbdc85e2fe166d861103214686","src/zlib-1.2.8/contrib/puff/puff.h":"969b7be2a930db0cdcb19b0e5b29ae6741f5a8f663b6dba6d647e12ec60cfa8e","src/zlib-1.2.8/contrib/puff/pufftest.c":"8ee0da78a1221a3c2036e22eed06c2faa27a671a46565a60e10111d4ee9c30ee","src/zlib-1.2.8/contrib/puff/zeros.raw":"b7b0887089f7af1f6d1e0b4c0a1e8eddd10223b23554299455c6c9be71b653a3","src/zlib-1.2.8/contrib/testzlib/testzlib.c":"c6c37b35c6ecc9986a9041f86d879cc37a9e4d8315af9d725071eb3b2cade0c5","src/zlib-1.2.8/contrib/testzlib/testzlib.txt":"2359bbdc84eb8a04e0f1cd16cd81a2896e957f2ad58dab3ca78ef55b7d0dc577","src/zlib-1.2.8/contrib/untgz/Makefile":"8f5ab1564813e091cea8f1bb63da32fd80ac763d029277b0cabf50f60aceefe1","src/zlib-1.2.8/contrib/untgz/Makefile.msc":"d0f537de11d9e0e36e2a98b3971c537265f4b533b4c48797094365ad9ae8388b","src/zlib-1.2.8/contrib/untgz/untgz.c":"9a12d774301d252dcd38bba07ac369319da4c04c4fef8a50fcbf40aebf29c2a1","src/zlib-1.2.8/contrib/vstudio/readme.txt":"5dd8bef90296272ce8cdca6e5658057d52f05acea8adc49b7ab1bd67386fd513","src/zlib-1.2.8/contrib/vstudio/vc10/miniunz.vcxproj":"dd607d43c64581172c20c22112821924dfe862f56b2e5eb8780bdd0714d9527b","src/zlib-1.2.8/contrib/vstudio/vc10/miniunz.vcxproj.filters":"c3db9f97952683e688ad83c13bb94c816ac3e6b5f277fdea545b0650c125aa6d","src/zlib-1.2.8/contrib/vstudio/vc10/minizip.vcxproj":"af73f2cf8ae51e65e85342faeb40849a2310c97bc77def42b38d7070460a6cf0","src/zlib-1.2.8/contrib/vstudio/vc10/minizip.vcxproj.filters":"83db58d87f5d7ca84b6087aa1f62b15cbc296194c8cf76e47a271f9077b4f3bd","src/zlib-1.2.8/contrib/vstudio/vc10/testzlib.vcxproj":"1525ed0893db56db44ec68675c8da3c229dc7867166dfc0428816783d16ad43b","src/zlib-1.2.8/contrib/vstudio/vc10/testzlib.vcxproj.filters":"d7e04ffa467d417dfa3c0f1c64234cadc84882101bbae483f0a0f5d3d6b566a7","src/zlib-1.2.8/contrib/vstudio/vc10/testzlibdll.vcxproj":"3f317d8964f17901c3e68bff5deaec10b6ccc50a572235999e8097292692984c","src/zlib-1.2.8/contrib/vstudio/vc10/testzlibdll.vcxproj.filters":"682a485f0184aabba94e12e1b284499195f37c176d43ecee0484f31e4d636f6f","src/zlib-1.2.8/contrib/vstudio/vc10/zlib.rc":"9caf00def3b7c7216c4adf4a58d840ebd74155af5dbc7f1ef6e36e8ed77fe407","src/zlib-1.2.8/contrib/vstudio/vc10/zlibstat.vcxproj":"2a38222d6c034d7e0b843c3f0540dc6c53dd48f942ae29f31620ca0327248c8e","src/zlib-1.2.8/contrib/vstudio/vc10/zlibstat.vcxproj.filters":"d9a2c381e51e4d6f027f3517db7db81656e43cec02ed9abf267a0fde6f360180","src/zlib-1.2.8/contrib/vstudio/vc10/zlibvc.def":"ed94936c1301753eff22bd2374f6a7dff3b2caf56d13debb99966b01c2ba355f","src/zlib-1.2.8/contrib/vstudio/vc10/zlibvc.sln":"e659860f705f31b87ea9139a3cb4ebe1561e120bce495383a54614fc82b49990","src/zlib-1.2.8/contrib/vstudio/vc10/zlibvc.vcxproj":"3108badf710e2f4a64eab4e7deae6642fb68cc0d94018e537149f1761e215133","src/zlib-1.2.8/contrib/vstudio/vc10/zlibvc.vcxproj.filters":"58404ba7703c68025bec64b8a17ff1fc7f3a35d15d17ae3bcc4fa753f1348425","src/zlib-1.2.8/contrib/vstudio/vc11/miniunz.vcxproj":"746e4c11fb8af4bcd6a9d68ba81ed1dc366a5de3bed56b291ee969ad733a7bb0","src/zlib-1.2.8/contrib/vstudio/vc11/minizip.vcxproj":"340617cae9cf4fcb003308021d3782ec3639e60d62d79a3aafc0a50bb55b061e","src/zlib-1.2.8/contrib/vstudio/vc11/testzlib.vcxproj":"589eec6ef6d818564ead938a629fda50abb6cbf8054b9f66ea780765c1a1b3db","src/zlib-1.2.8/contrib/vstudio/vc11/testzlibdll.vcxproj":"583bdef522b0176829f0d8139ea2a88b9cbc14379d1334f3a863989ed3df9b67","src/zlib-1.2.8/contrib/vstudio/vc11/zlib.rc":"9caf00def3b7c7216c4adf4a58d840ebd74155af5dbc7f1ef6e36e8ed77fe407","src/zlib-1.2.8/contrib/vstudio/vc11/zlibstat.vcxproj":"51aa752698d96df065a9ece02e293492f681b59a8077f036a5a60367dc621e87","src/zlib-1.2.8/contrib/vstudio/vc11/zlibvc.def":"ed94936c1301753eff22bd2374f6a7dff3b2caf56d13debb99966b01c2ba355f","src/zlib-1.2.8/contrib/vstudio/vc11/zlibvc.sln":"27389b515997defd080519f95aff87e89fcbe8b26d73c5ebb73c544cfef4d60e","src/zlib-1.2.8/contrib/vstudio/vc11/zlibvc.vcxproj":"c3dd05e56159aba411475b83656275872524cb3c2fd24d690397d8b634e7e0ed","src/zlib-1.2.8/contrib/vstudio/vc9/miniunz.vcproj":"b2b53bd9e704bfbe769b863acdc2a3368692ca149c4b4ed2a0761b0cd16c6726","src/zlib-1.2.8/contrib/vstudio/vc9/minizip.vcproj":"80a701fb41a61871ce1d25f6b03e571edb6c3abf0aa45375554b6fac52115eb6","src/zlib-1.2.8/contrib/vstudio/vc9/testzlib.vcproj":"05fc5a87682b17690d199f424f57f6ad7767b8dabb29a1039bfcb88bca1b302f","src/zlib-1.2.8/contrib/vstudio/vc9/testzlibdll.vcproj":"25c1cc5319f1c4b7dbdb595c3cfd6ec3ba217818b03b7055ef5ef440b575a43d","src/zlib-1.2.8/contrib/vstudio/vc9/zlib.rc":"9caf00def3b7c7216c4adf4a58d840ebd74155af5dbc7f1ef6e36e8ed77fe407","src/zlib-1.2.8/contrib/vstudio/vc9/zlibstat.vcproj":"e8653eea37f3bef097eec2caa55e1f698c3c74c959689bc4e97568e88d2bbc60","src/zlib-1.2.8/contrib/vstudio/vc9/zlibvc.def":"ed94936c1301753eff22bd2374f6a7dff3b2caf56d13debb99966b01c2ba355f","src/zlib-1.2.8/contrib/vstudio/vc9/zlibvc.sln":"26e58d4b2cfcd941c367fb2a18537b3b9f002f2ac1278b700ea1129c50501452","src/zlib-1.2.8/contrib/vstudio/vc9/zlibvc.vcproj":"86aa6e33db104c0a0ed4a9f21f0db8572cc7755170217aef18219fdd74b75e9d","src/zlib-1.2.8/crc32.c":"3f3daca510273dda74eaf381c46d2551e3a3506891ae063ab451b87744a7a36c","src/zlib-1.2.8/crc32.h":"407af59d0abfea84a6507c603eb29809411797f98249614fe76a661def783ce1","src/zlib-1.2.8/deflate.c":"565e68ddfff5af8efd55f71e122b860ad11527a7d9de40a76af2b16afef24cc0","src/zlib-1.2.8/deflate.h":"80570c8052491bdc7583600da28a8f1cb32c27ab1cec107ec12c83255d426cf7","src/zlib-1.2.8/doc/algorithm.txt":"992590931e982c0765286c2d83f6e9ff0a95aabb08e28c30c52bae3e8c4bd5ad","src/zlib-1.2.8/doc/rfc1950.txt":"8f0475a5c984657bf26277f73df9456c9b97f175084f0c1748f1eb1f0b9b10b9","src/zlib-1.2.8/doc/rfc1951.txt":"5ebf4b5b7fe1c3a0c0ab9aa3ac8c0f3853a7dc484905e76e03b0b0f301350009","src/zlib-1.2.8/doc/rfc1952.txt":"164ef0897b4cbec63abf1b57f069f3599bd0fb7c72c2a4dee21bd7e03ec9af67","src/zlib-1.2.8/doc/txtvsbin.txt":"47c273bb22c9773248d380549a330e5c262266b1292154b0d3014f731cc73f47","src/zlib-1.2.8/examples/README.examples":"402d72eb69c2e03a25034f4b3c02b110f0f67149ecfa4fa0e4b2bf0ceb49a8b3","src/zlib-1.2.8/examples/enough.c":"704e273f65b62c5d2eb06d5bb10c4ccffba56544aa477f0e3957e2296c501b78","src/zlib-1.2.8/examples/fitblk.c":"950769163c41aff897ee41746a8685d9aa41073b1307f42da19dabe9d3fc8b85","src/zlib-1.2.8/examples/gun.c":"2d38ab3176a404e2da885dca47b1a6bbb64fd0ae7c089131ee3887c239b40b7e","src/zlib-1.2.8/examples/gzappend.c":"4182d38bf97ffbdf1110df7f65c0e8fab0b28b1ea36ebba8621c14e8e76f1caa","src/zlib-1.2.8/examples/gzjoin.c":"90b9d6c39a5fc91cf1cc9b96b025a508a8015dc502cd9374c754b44078593f57","src/zlib-1.2.8/examples/gzlog.c":"073c99b407c738bb56396fab1e3eb1affaba9af7b8f8ebffcc0644b1591be162","src/zlib-1.2.8/examples/gzlog.h":"309556e2d7d39250924946b78e2cce0ac927857d6e1a02cab64e438f533c20c3","src/zlib-1.2.8/examples/zlib_how.html":"80fb647be8450bd7a07d8495244e1f061dfbdbdb53172ca24e7ffff8ace9c72f","src/zlib-1.2.8/examples/zpipe.c":"68140a82582ede938159630bca0fb13a93b4bf1cb2e85b08943c26242cf8f3a6","src/zlib-1.2.8/examples/zran.c":"b1b910708225a62f81ec97a08203239d35d18c33470c0775f0bcd5347820e1f6","src/zlib-1.2.8/gzclose.c":"94446cf8cde67c30e64d0a335b0c941fd3fbad2e77f30180d12e61f9c2a5a6b8","src/zlib-1.2.8/gzguts.h":"2d3c0154089061fd3a9a789903e54b2ca3cef241383599f37b63914330b9c358","src/zlib-1.2.8/gzlib.c":"90d43517bcff858312c0ed72dfa760be3a774939ba663952f0f9aa0e96f97f34","src/zlib-1.2.8/gzread.c":"b2bd8884fc467b47e425d1c34268f08e40dd54401682a49c56d2e441ee811d8c","src/zlib-1.2.8/gzwrite.c":"09d33648f5b3be2efd3ad176f6b966205d5f8abaf1d1139a196e0987b9319b7d","src/zlib-1.2.8/infback.c":"16f8418da8a86bcb5fb98f121f3ba45275ae5b57ad00b0545d4a311ed890f524","src/zlib-1.2.8/inffast.c":"fd82c328b310f2f0ecc6a13475889e51c407dd4c5e8a931a36f18ad63f319c35","src/zlib-1.2.8/inffast.h":"7d8c1c873ce9bc346ad6005bb9d75cce5c6352aaf7395385be216a9452a34908","src/zlib-1.2.8/inffixed.h":"237ba710f090e432b62ebf963bee8b302867e9691406b2d3f8ee89ee7bfef9b0","src/zlib-1.2.8/inflate.c":"fb9bfa1295e7a6ef1b4a1149eec372dd7dcce407dd4fe9fea9c23a45a6857381","src/zlib-1.2.8/inflate.h":"36e5300408aa55a175a7d9be6b2f25dc0c5f80d79b2115fe43a2fe531e84775d","src/zlib-1.2.8/inftrees.c":"608f96120ac1572002bbce6dcd2625171dae0afbecf4334070288a33e19e5952","src/zlib-1.2.8/inftrees.h":"c510b36402784b1f898be3b049b923469aa92701de2d9195aed19f6b65c0dce2","src/zlib-1.2.8/make_vms.com":"3064eb153a7684115f1494364f80759bc5a2c227799fdf08df7b9e6e50884720","src/zlib-1.2.8/msdos/Makefile.bor":"292ab363f7ffbc4ae84d37cd9bdffd2dac1003bee52d223a8489844870f20702","src/zlib-1.2.8/msdos/Makefile.dj2":"df5e05d3744e8539299c6974fae2d68a13fc5513e8564fef791b6665df592bce","src/zlib-1.2.8/msdos/Makefile.emx":"5cb73e60a327b58f755442e3444b529f8a50146f980e0a38b945c7c40c112761","src/zlib-1.2.8/msdos/Makefile.msc":"0e021a6f42212415b060e4ad468eb415d0a8c1f343137fb9dff2cb8f9ead3027","src/zlib-1.2.8/msdos/Makefile.tc":"2ae12ee2a3e62f7c5a0520d0fbe4adee772bc07fe816002b07ccb43db3daa76a","src/zlib-1.2.8/nintendods/Makefile":"ea5823efe6830132294eddf2f56dbd7db8712244c210bb4968c431b1a91bd066","src/zlib-1.2.8/nintendods/README":"e362426c47b39ff6a7d6c75c6660b20abf076cdfa5e1e421716dc629a71aef95","src/zlib-1.2.8/old/Makefile.emx":"c767d0e5505995e8e7cac2734bbcb08e1cf823f19cc734e5c845b5ef5fccced6","src/zlib-1.2.8/old/Makefile.riscos":"d1a488b160fbfd53272b68a913283a4be08ba9d490796b196dddb2ba535b41e0","src/zlib-1.2.8/old/README":"551a0f4d91fe0f827a31cbdfbb4a71d1f3dc4d06564d80a3f526b749dd104d11","src/zlib-1.2.8/old/descrip.mms":"8ff08c35c056df9c986f23c09cf8936db63ccf12c3c42f7d18a48b36f060cff7","src/zlib-1.2.8/old/os2/Makefile.os2":"7d16bade2a9c0d3847fd9ba2e75eb3a0c14d0f741610f4bf9cb3edef84c696b4","src/zlib-1.2.8/old/os2/zlib.def":"ea9c61876d2e20b67ef2d9495991a32798eb40d13ede95859a2f4f03b65b9b61","src/zlib-1.2.8/old/visual-basic.txt":"1727650acbde9a9e6aec9438896377e46a12699cca5d46c5399cef524dedc614","src/zlib-1.2.8/qnx/package.qpg":"e7795fef80cfc2d7a4377e6af90a831955b7be35c64e3b310ec87678d360dfb0","src/zlib-1.2.8/test/example.c":"63061f7e4978035e072d0906aae087605551352adef92d4499b533a79e25747c","src/zlib-1.2.8/test/infcover.c":"f3fc5682c7d99e6bb670b8ef53463257ea3a4a57dd5e20b109005f99a807e5fb","src/zlib-1.2.8/test/minigzip.c":"a181d4748927637f26d0641d5666840c9d3afbe8910d46d3020e3c6edbde1c4a","src/zlib-1.2.8/treebuild.xml":"6ddcf7cd73f4f9194addf7b3c82aca350c912062ea0c8f0df13c49c614fd9968","src/zlib-1.2.8/trees.c":"49b5289399f76281541b26cab190d9d4e34bb666728ed661e0bfc7fb402d20f1","src/zlib-1.2.8/trees.h":"bb0a9d3ca88ee00c81adb7c636e73b97085f6ef1b52d6d58edbe2b6dc3adeb4d","src/zlib-1.2.8/uncompr.c":"454902e5c47baf75e946b999fb93b9f8a3f6bbac68c5c51b3e0fe8f54542123e","src/zlib-1.2.8/watcom/watcom_f.mak":"7e039b912f9cffaa40835281430bb284fa9042b0a0d12f6b34700a06bca6576e","src/zlib-1.2.8/watcom/watcom_l.mak":"d11b4064604a034725860e63e3f6d347056372e4b1675b183e20a93533b20cc9","src/zlib-1.2.8/win32/DLL_FAQ.txt":"9e00778319381e6275691dd3a89410c99065b8c0c5db96473abe8c859cbdefd8","src/zlib-1.2.8/win32/Makefile.bor":"e878fed2313417db085fea621c110889f6a32233b5b6db46e3c4e824c1d0ed6b","src/zlib-1.2.8/win32/Makefile.gcc":"3109182015186cd089f545dffcb3e81f9538ebec30c3c9836f8a4b67b2f2ebaf","src/zlib-1.2.8/win32/Makefile.msc":"4bfc81e50e6afa9cb7935bf8176743df8df224ab943b29d81ab4cb0f72a317d7","src/zlib-1.2.8/win32/README-WIN32.txt":"5e279cfb5d0476e27b78b1713eaf97d07935c14b9fc681791e15efb2344e6a43","src/zlib-1.2.8/win32/VisualC.txt":"e309c8623a1dcff79f5e588266c6ec68ca99f662baf9782591df561d5ddd94ea","src/zlib-1.2.8/win32/zlib.def":"87e3b230a173c65b988be24f339c2f4350780001e2810029ef55240397f25193","src/zlib-1.2.8/win32/zlib1.rc":"d7f269379144d65bcd1b67c1065e5d4120579f14ce54ecf246eaba394fa989a5","src/zlib-1.2.8/zconf.h":"ec0d0a6e87b749ab5fc3f27c0e8292b7aed139ca0b6121ab27e6eb30e2e9b6ba","src/zlib-1.2.8/zconf.h.cmakein":"49c987659808d77f5250b2f64ee71e57cf32cf4b52955cea179d7ebd3c578e59","src/zlib-1.2.8/zconf.h.in":"ec0d0a6e87b749ab5fc3f27c0e8292b7aed139ca0b6121ab27e6eb30e2e9b6ba","src/zlib-1.2.8/zlib.3":"621d9c7afa32fac41b28219c0d38a4a7179fdc05358bd2f7bdf7116d25d0cecd","src/zlib-1.2.8/zlib.h":"726b0569915917b967f87f3f08a1eec039101bf9dcc29d61c0b2b0b8f271b58d","src/zlib-1.2.8/zlib.map":"2b133e742e41f08cc4e993ceddbd43ee9d2d1b76da60c53b8405e1f811274a85","src/zlib-1.2.8/zlib.pc.cmakein":"2f1d0b18ce37c2af415a469857f02aee2c41a58877aff21d29e9c6db32b55cb7","src/zlib-1.2.8/zlib.pc.in":"04c01cc2e1a0ed123518b5855f585c93a24526dd88982c414111ea1fc9f07997","src/zlib-1.2.8/zlib2ansi":"d316e3e79054f5f9fe921d35f4bbf4bf0a37b859d29d2b34ae4d7d92afc3e55c","src/zlib-1.2.8/zutil.c":"c5e9927d5a1a1dec514ccdcedfa1e0f01664c58bb33166b4997b50b8001f1d6c","src/zlib-1.2.8/zutil.h":"91cce8e78e83bcdb8c6acb98d4f0686dbdc81ca97d4a36a60c0b48f7ef78f1af"},"package":"905c72a0c260bcd89ddca5afa1c46bebd29b52878a3d58c86865ea42402f88e6"}
\ No newline at end of file
--- a/third_party/rust/libz-sys/.travis.yml
+++ b/third_party/rust/libz-sys/.travis.yml
@@ -12,12 +12,13 @@ script:
   - cargo doc --no-deps
 after_success:
   - travis-cargo --only nightly doc-upload
 notifications:
   email:
     on_success: never
 env:
   global:
-    secure: AEw7peNq5yyhDlGod702HScsujYFaFWvdOaZKiyVwUMNHkou1U4BiziBGekBqTmrPOW8+iNSS5J7MDPu8I7RAtkrlOvsBKIjmGbBYkzodkMFjR6TNNAnfAXhjqUzHh77wL5qWtNh+bz/PL4RVyjdo1Swnc6mqz5Unu9rP9S2LeE=
+    secure: "eq1KPWs3sNmvrQj6ayLRrY2Jqwpx4p9CNU5gRU6LCdx2otIQqKXY1Jj9E6uvQIspL6ZpCNzYDMDUSsRdNahdx59WQGD/mxdrFWStUonJ4t0al2FIQ97NaEy57r4vw36oViDCzqZudDlsacHZnpCpI8ei6AB73rGXfxc3g3fxk6o="
+
 os:
   - linux
   - osx
--- a/third_party/rust/libz-sys/Cargo.toml
+++ b/third_party/rust/libz-sys/Cargo.toml
@@ -1,12 +1,12 @@
 [package]
 
 name = "libz-sys"
-version = "1.0.6"
+version = "1.0.10"
 authors = ["Alex Crichton <alex@alexcrichton.com>"]
 links = "z"
 build = "build.rs"
 license = "MIT/Apache-2.0"
 repository = "https://github.com/alexcrichton/libz-sys"
 documentation = "http://alexcrichton.com/libz-sys"
 description = """
 Bindings to the system libz library (also known as zlib).
--- a/third_party/rust/libz-sys/appveyor.yml
+++ b/third_party/rust/libz-sys/appveyor.yml
@@ -12,10 +12,10 @@ install:
   - set PATH=%PATH%;C:\Program Files (x86)\Rust\bin
   - if defined MSYS_BITS set PATH=%PATH%;C:\msys64\mingw%MSYS_BITS%\bin;C:\msys64\usr\bin
   - rustc -V
   - cargo -V
 
 build: false
 
 test_script:
-  - cargo test
-  - cargo run --manifest-path systest/Cargo.toml
+  - cargo test --target %TARGET%
+  - cargo run --manifest-path systest/Cargo.toml --target %TARGET%
--- a/third_party/rust/libz-sys/build.rs
+++ b/third_party/rust/libz-sys/build.rs
@@ -1,14 +1,15 @@
 extern crate pkg_config;
 extern crate gcc;
 
 use std::env;
 use std::ffi::OsString;
-use std::fs;
+use std::fs::{self, File};
+use std::io::prelude::*;
 use std::path::{Path, PathBuf};
 use std::process::Command;
 
 macro_rules! t {
     ($e:expr) => (match $e {
         Ok(n) => n,
         Err(e) => panic!("\n{} failed with {}\n", stringify!($e), e),
     })
@@ -28,16 +29,18 @@ fn main() {
         pkg_config::find_library("zlib").is_ok() {
         return
     }
 
     // Practically all platforms come with libz installed already, but MSVC is
     // one of those sole platforms that doesn't!
     if target.contains("msvc") {
         build_msvc_zlib(&target);
+    } else if target.contains("pc-windows-gnu") {
+        build_zlib_mingw();
     } else if (target.contains("musl") ||
                target != host ||
                want_static) &&
               !target.contains("windows-gnu") &&
               !target.contains("android") {
         build_zlib();
     } else {
         println!("cargo:rustc-link-lib=z");
@@ -54,26 +57,69 @@ fn build_zlib() {
     let mut cflags = OsString::new();
     for arg in compiler.args() {
         cflags.push(arg);
         cflags.push(" ");
     }
     run(Command::new("./configure")
                 .current_dir(&build)
                 .env("CC", compiler.path())
-                .env("CFLAGS", cflags));
+                .env("CFLAGS", cflags)
+                .arg(format!("--prefix={}", dst.display())));
     run(Command::new("make")
                 .current_dir(&build)
                 .arg("libz.a"));
 
-    t!(fs::create_dir_all(dst.join("lib")));
+    t!(fs::create_dir_all(dst.join("lib/pkgconfig")));
     t!(fs::create_dir_all(dst.join("include")));
     t!(fs::copy(build.join("libz.a"), dst.join("lib/libz.a")));
     t!(fs::copy(build.join("zlib.h"), dst.join("include/zlib.h")));
     t!(fs::copy(build.join("zconf.h"), dst.join("include/zconf.h")));
+    t!(fs::copy(build.join("zlib.pc"), dst.join("lib/pkgconfig/zlib.pc")));
+
+    println!("cargo:rustc-link-lib=static=z");
+    println!("cargo:rustc-link-search={}/lib", dst.to_string_lossy());
+    println!("cargo:root={}", dst.to_string_lossy());
+    println!("cargo:include={}/include", dst.to_string_lossy());
+}
+
+fn build_zlib_mingw() {
+    let src = env::current_dir().unwrap().join("src/zlib-1.2.8");
+    let dst = PathBuf::from(env::var_os("OUT_DIR").unwrap());
+    let build = dst.join("build");
+    t!(fs::create_dir_all(&build));
+    cp_r(&src, &build);
+    let compiler = gcc::Config::new().get_compiler();
+    let mut cflags = OsString::new();
+    for arg in compiler.args() {
+        cflags.push(arg);
+        cflags.push(" ");
+    }
+    let gcc = compiler.path().to_str().unwrap();
+    let mut cmd = Command::new("make");
+    cmd.arg("-f").arg("win32/Makefile.gcc")
+       .current_dir(&build)
+       .arg("install")
+       .arg(format!("prefix={}", dst.display()))
+       .arg(format!("INCLUDE_PATH={}", dst.join("include").display()))
+       .arg(format!("LIBRARY_PATH={}", dst.join("lib").display()))
+       .arg(format!("BINARY_PATH={}", dst.join("bin").display()));
+
+    if gcc != "gcc" {
+        match gcc.find("gcc") {
+            Some(0) => {}
+            Some(i) => {
+                cmd.arg(format!("PREFIX={}", &gcc[..i]));
+            }
+            None => {}
+        }
+    }
+    run(&mut cmd);
+
+    t!(fs::create_dir_all(dst.join("lib/pkgconfig")));
 
     println!("cargo:rustc-link-lib=static=z");
     println!("cargo:rustc-link-search={}/lib", dst.to_string_lossy());
     println!("cargo:root={}", dst.to_string_lossy());
     println!("cargo:include={}/include", dst.to_string_lossy());
 }
 
 fn cp_r(dir: &Path, dst: &Path) {
@@ -94,22 +140,32 @@ fn build_msvc_zlib(target: &str) {
     let src = t!(env::current_dir()).join("src/zlib-1.2.8");
     let dst = PathBuf::from(env::var_os("OUT_DIR").unwrap());
 
     t!(fs::create_dir_all(dst.join("lib")));
     t!(fs::create_dir_all(dst.join("include")));
     t!(fs::create_dir_all(dst.join("build")));
     cp_r(&src, &dst.join("build"));
 
+    let features = env::var("CARGO_CFG_TARGET_FEATURE")
+                      .unwrap_or(String::new());
+    if features.contains("crt-static") {
+        let mut makefile = String::new();
+        let makefile_path = dst.join("build/win32/Makefile.msc");
+        t!(t!(File::open(&makefile_path)).read_to_string(&mut makefile));
+        let new_makefile = makefile.replace(" -MD ", " -MT ");
+        t!(t!(File::create(&makefile_path)).write_all(new_makefile.as_bytes()));
+    }
+
     let nmake = gcc::windows_registry::find(target, "nmake.exe");
     let mut nmake = nmake.unwrap_or(Command::new("nmake.exe"));
     run(nmake.current_dir(dst.join("build"))
              .arg("/nologo")
              .arg("/f")
-             .arg(src.join("win32/Makefile.msc"))
+             .arg(dst.join("build/win32/Makefile.msc"))
              .arg("zlib.lib"));
 
     for file in t!(fs::read_dir(&dst.join("build"))) {
         let file = t!(file).path();
         if let Some(s) = file.file_name().and_then(|s| s.to_str()) {
             if s.ends_with(".h") {
                 t!(fs::copy(&file, dst.join("include").join(s)));
             }
--- a/toolkit/library/gtest/rust/Cargo.lock
+++ b/toolkit/library/gtest/rust/Cargo.lock
@@ -28,17 +28,17 @@ source = "registry+https://github.com/ru
 dependencies = [
  "matches 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-bidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "libc"
-version = "0.2.16"
+version = "0.2.18"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "matches"
 version = "0.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -70,17 +70,17 @@ version = "0.1.0"
 dependencies = [
  "nsstring 0.1.0",
 ]
 
 [[package]]
 name = "rust_url_capi"
 version = "0.0.1"
 dependencies = [
- "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
  "nsstring 0.1.0",
  "url 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "unicode-bidi"
 version = "0.2.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -100,13 +100,13 @@ source = "registry+https://github.com/ru
 dependencies = [
  "idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "matches 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [metadata]
 "checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855"
 "checksum idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1053236e00ce4f668aeca4a769a09b3bf5a682d802abd6f3cb39374f6b162c11"
-"checksum libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)" = "408014cace30ee0f767b1c4517980646a573ec61a57957aeeabcac8ac0a02e8d"
+"checksum libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "a51822fc847e7a8101514d1d44e354ba2ffa7d4c194dcab48870740e327cac70"
 "checksum matches 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bcc3ad8109fa4b522f9b0cd81440422781f564aaf8c195de6b9d6642177ad0dd"
 "checksum unicode-bidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c1f7ceb96afdfeedee42bade65a0d585a6a0106f681b6749c8ff4daa8df30b3f"
 "checksum unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "26643a2f83bac55f1976fb716c10234485f9202dcd65cfbdf9da49867b271172"
 "checksum url 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f024e241a55f5c88401595adc1d4af0c9649e91da82d0e190fe55950231ae575"
--- a/toolkit/library/rust/Cargo.lock
+++ b/toolkit/library/rust/Cargo.lock
@@ -26,17 +26,17 @@ source = "registry+https://github.com/ru
 dependencies = [
  "matches 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-bidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "libc"
-version = "0.2.16"
+version = "0.2.18"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "matches"
 version = "0.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -57,17 +57,17 @@ dependencies = [
 [[package]]
 name = "nsstring"
 version = "0.1.0"
 
 [[package]]
 name = "rust_url_capi"
 version = "0.0.1"
 dependencies = [
- "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
  "nsstring 0.1.0",
  "url 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "unicode-bidi"
 version = "0.2.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -87,13 +87,13 @@ source = "registry+https://github.com/ru
 dependencies = [
  "idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "matches 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [metadata]
 "checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855"
 "checksum idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1053236e00ce4f668aeca4a769a09b3bf5a682d802abd6f3cb39374f6b162c11"
-"checksum libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)" = "408014cace30ee0f767b1c4517980646a573ec61a57957aeeabcac8ac0a02e8d"
+"checksum libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "a51822fc847e7a8101514d1d44e354ba2ffa7d4c194dcab48870740e327cac70"
 "checksum matches 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bcc3ad8109fa4b522f9b0cd81440422781f564aaf8c195de6b9d6642177ad0dd"
 "checksum unicode-bidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c1f7ceb96afdfeedee42bade65a0d585a6a0106f681b6749c8ff4daa8df30b3f"
 "checksum unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "26643a2f83bac55f1976fb716c10234485f9202dcd65cfbdf9da49867b271172"
 "checksum url 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f024e241a55f5c88401595adc1d4af0c9649e91da82d0e190fe55950231ae575"