diff --git a/rpm/0103-Bug-1716518-Upgrade-rental-to-v0.5.6.-r-emilio.patch b/rpm/0103-Bug-1716518-Upgrade-rental-to-v0.5.6.-r-emilio.patch new file mode 100644 index 0000000000000..2daff14397b6d --- /dev/null +++ b/rpm/0103-Bug-1716518-Upgrade-rental-to-v0.5.6.-r-emilio.patch @@ -0,0 +1,117 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mike Hommey +Date: Tue, 15 Jun 2021 20:39:42 +0000 +Subject: [PATCH] Bug 1716518 - Upgrade rental to v0.5.6. r=emilio + +Differential Revision: https://phabricator.services.mozilla.com/D117748 +--- + Cargo.lock | 4 ++-- + third_party/rust/rental/.cargo-checksum.json | 2 +- + third_party/rust/rental/Cargo.toml | 2 +- + third_party/rust/rental/README.md | 5 ++++- + third_party/rust/rental/src/lib.rs | 10 +++++----- + 5 files changed, 13 insertions(+), 10 deletions(-) + +diff --git a/Cargo.lock b/Cargo.lock +index 990d6a4a582b1d24e4e377084f1efb6838e573f6..ecd1e025b8dd5e42982af3c9b4c7a61534461056 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -3993,9 +3993,9 @@ dependencies = [ + + [[package]] + name = "rental" +-version = "0.5.5" ++version = "0.5.6" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "8545debe98b2b139fb04cad8618b530e9b07c152d99a5de83c860b877d67847f" ++checksum = "cc89fe2acac36d212474d138aaf939c04a82df5b61d07011571ebce5aef81f2e" + dependencies = [ + "rental-impl", + "stable_deref_trait", +diff --git a/third_party/rust/rental/.cargo-checksum.json b/third_party/rust/rental/.cargo-checksum.json +index 24a34677109d076edbbf86b60322a78ea5309a35..020e203d55288252aa9aec6c609f067488f024b6 100644 +--- a/third_party/rust/rental/.cargo-checksum.json ++++ b/third_party/rust/rental/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"99e1c578dbb4b110ee59a7ba54e0812067bda50b2e39954a86c95db0cbcbc460","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0caa93d2b69a83cfb0c2d4db6b782a5dba5ecc4f9fa1f54b04b268af739bf868","README.md":"f45eef4d1177d0b66657e49fbda9dfc963b2a0110e5825e9c9b19d9d9a26dd3d","src/lib.rs":"2cfcf8833642107e34dab2a4457a9c9be144b21dd6d37090444f055067fd551b","tests/clone.rs":"0bf3267771ef8b3bf3c0d0ab98b7e99597c808f50596e0b6c12dfd5598eaf820","tests/complex.rs":"7c7f685e7ae7435698e34f8c29bd5bd8b89143ea43c3381a4627d366902b1285","tests/complex_mut.rs":"374d4a0782b00a5679b55d73b112c424977c0dba525072fadf0fc96ed00f632a","tests/covariant.rs":"fc5697208f44b96047e6423f8b9621a379e29cc5709dcf91f860f1424ef2a0d1","tests/debug.rs":"38e345ca450effc80898a267a1214a72d615441fa31697410ed1465638b85813","tests/drop_order.rs":"8c98fef9f0ea4eac8cebbd384be8c8e8db6d5aaffe42b83a6390e74d91dfd1ac","tests/generic.rs":"2f9d7aa9cc3dd3887b7270835cad8d914150b9809fb41430dc317b14788d3fa5","tests/lt_params.rs":"4f3e9252a35836c4a3a76a68b4fe4eeedb002169b278a0cbc82705716b2a3e6a","tests/map.rs":"314c5cd5163e6bef174fd7a4e37d9b8b9248d4e71f3387f5d6aa29ee784332b7","tests/simple_mut.rs":"beaabd34ed1c06c2f60d05c19c103c32588f52621e7a953e1bf3e2a0759cb09d","tests/simple_ref.rs":"aa64fa94f08926957293129cd26c128c6be21934f026bd052aa9b49a2e8987c7","tests/string.rs":"4e12df6b4e67991c8d912422935f75f2b0016dfa2d26a3305532fc98facc7c67","tests/subrental.rs":"dad1f751c9c8ef3b76e1be6513ae7419ddd16032e5fd71d8baa445d3d3f9e044","tests/target_ty_hack.rs":"d13301dbfb36646eb461928edbb088fe4ed5b01934c12fa1c2b3cd486f7bfb8d","tests/trait.rs":"b3697d80b7b61238401d133f53d058d2e3ad17e6925cc45ed8b8718bcf755e1a","tests/unused.rs":"e420e6d13bcd8b8e3def4a77e8de6502fdf5fd55d44ccad611f16e57c2d67704","tests/vec_slice.rs":"bd2826caeba5ae64268c0e2aed870afacc6d8ba3da850a309b19c7f0b17428eb"},"package":"8545debe98b2b139fb04cad8618b530e9b07c152d99a5de83c860b877d67847f"} +\ No newline at end of file ++{"files":{"Cargo.toml":"84a87592ab606b0ec7cf484472679111fc1513ab6f493f496a876d432e1f77ab","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0caa93d2b69a83cfb0c2d4db6b782a5dba5ecc4f9fa1f54b04b268af739bf868","README.md":"d0abd379ad7ad547be83a98d6dabecfe6ea2ec53b811c50ddc2d4bb09a9448a0","src/lib.rs":"da0e1cbfcaa47662e74216231ddc1cd10a450d79132decbe99d05832649301e1","tests/clone.rs":"0bf3267771ef8b3bf3c0d0ab98b7e99597c808f50596e0b6c12dfd5598eaf820","tests/complex.rs":"7c7f685e7ae7435698e34f8c29bd5bd8b89143ea43c3381a4627d366902b1285","tests/complex_mut.rs":"374d4a0782b00a5679b55d73b112c424977c0dba525072fadf0fc96ed00f632a","tests/covariant.rs":"fc5697208f44b96047e6423f8b9621a379e29cc5709dcf91f860f1424ef2a0d1","tests/debug.rs":"38e345ca450effc80898a267a1214a72d615441fa31697410ed1465638b85813","tests/drop_order.rs":"8c98fef9f0ea4eac8cebbd384be8c8e8db6d5aaffe42b83a6390e74d91dfd1ac","tests/generic.rs":"2f9d7aa9cc3dd3887b7270835cad8d914150b9809fb41430dc317b14788d3fa5","tests/lt_params.rs":"4f3e9252a35836c4a3a76a68b4fe4eeedb002169b278a0cbc82705716b2a3e6a","tests/map.rs":"314c5cd5163e6bef174fd7a4e37d9b8b9248d4e71f3387f5d6aa29ee784332b7","tests/simple_mut.rs":"beaabd34ed1c06c2f60d05c19c103c32588f52621e7a953e1bf3e2a0759cb09d","tests/simple_ref.rs":"aa64fa94f08926957293129cd26c128c6be21934f026bd052aa9b49a2e8987c7","tests/string.rs":"4e12df6b4e67991c8d912422935f75f2b0016dfa2d26a3305532fc98facc7c67","tests/subrental.rs":"dad1f751c9c8ef3b76e1be6513ae7419ddd16032e5fd71d8baa445d3d3f9e044","tests/target_ty_hack.rs":"d13301dbfb36646eb461928edbb088fe4ed5b01934c12fa1c2b3cd486f7bfb8d","tests/trait.rs":"b3697d80b7b61238401d133f53d058d2e3ad17e6925cc45ed8b8718bcf755e1a","tests/unused.rs":"e420e6d13bcd8b8e3def4a77e8de6502fdf5fd55d44ccad611f16e57c2d67704","tests/vec_slice.rs":"bd2826caeba5ae64268c0e2aed870afacc6d8ba3da850a309b19c7f0b17428eb"},"package":"cc89fe2acac36d212474d138aaf939c04a82df5b61d07011571ebce5aef81f2e"} +\ No newline at end of file +diff --git a/third_party/rust/rental/Cargo.toml b/third_party/rust/rental/Cargo.toml +index 2634b4881dc3873b5d121a061a3e00ce75a1162c..ef2e79c313b005567e194071cfba2df96781a989 100644 +--- a/third_party/rust/rental/Cargo.toml ++++ b/third_party/rust/rental/Cargo.toml +@@ -12,7 +12,7 @@ + + [package] + name = "rental" +-version = "0.5.5" ++version = "0.5.6" + authors = ["Jameson Ernst "] + description = "A macro to generate safe self-referential structs, plus premade types for common use cases." + documentation = "https://docs.rs/rental" +diff --git a/third_party/rust/rental/README.md b/third_party/rust/rental/README.md +index 4124f178cf65ef8674ae468178cb04092d7e458e..c8624275ed97ad8386fbbf16845cd2fa3b27e0e4 100644 +--- a/third_party/rust/rental/README.md ++++ b/third_party/rust/rental/README.md +@@ -1,10 +1,13 @@ ++# WARNING: This crate is NO LONGER MAINTAINED OR SUPPORTED ++I'm not going to yank the crate because it's still fit for its intended purpose, but as time goes on it will become increasingly out of step with Rust's evolution, so users are encouraged to explore other solutions. I will also not merge any pull requests, as the code is sufficiently complicated that I'm no longer confident in my ability to effectively review them. Rental can be considered "frozen" in its current state, and any further development will need to take place under a fork for whoever wishes to do so. ++ + # Rental - A macro to generate safe self-referential structs, plus premade types for common use cases. + + [Documentation](http://docs.rs/rental) + + # Overview + It can sometimes occur in the course of designing an API that it would be convenient, or even necessary, to allow fields within a struct to hold references to other fields within that same struct. Rust's concept of ownership and borrowing is powerful, but can't express such a scenario yet. +-//! ++ + Creating such a struct manually would require unsafe code to erase lifetime parameters from the field types. Accessing the fields directly would be completely unsafe as a result. This library addresses that issue by allowing access to the internal fields only under carefully controlled circumstances, through closures that are bounded by generic lifetimes to prevent infiltration or exfiltration of any data with an incorrect lifetime. In short, while the struct internally uses unsafe code to store the fields, the interface exposed to the consumer of the struct is completely safe. The implementation of this interface is subtle and verbose, hence the macro to automate the process. + + The API of this crate consists of the `rental` macro that generates safe self-referential structs, a few example instantiations to demonstrate the API provided by such structs (see `examples`), and a module of premade instantiations to cover common use cases (see `common`). +diff --git a/third_party/rust/rental/src/lib.rs b/third_party/rust/rental/src/lib.rs +index d7c9f8aaaf0b8fe20aad5c793da231ef5493287a..c3907d150359f7551f513530fe0212851d5a985f 100644 +--- a/third_party/rust/rental/src/lib.rs ++++ b/third_party/rust/rental/src/lib.rs +@@ -1,4 +1,4 @@ +-//! A macro to generate safe self-referntial structs, plus premade types for common use cases. ++//! A macro to generate safe self-referential structs, plus premade types for common use cases. + //! + //! # Overview + //! It can sometimes occur in the course of designing an API that it would be convenient, or even necessary, to allow fields within a struct to hold references to other fields within that same struct. Rust's concept of ownership and borrowing is powerful, but can't express such a scenario yet. +@@ -92,7 +92,7 @@ macro_rules! define_rental_traits { + #[allow(unused)] + #[derive(__rental_traits)] + enum ProceduralMasqueradeDummyType { +- Input = (0, stringify!($max_arity)).0 ++ Input = (0, stringify!($max_arity)).0, + } + }; + } +@@ -238,7 +238,7 @@ macro_rules! rental { + #[allow(unused)] + #[derive(__rental_structs_and_impls)] + enum ProceduralMasqueradeDummyType { +- Input = (0, stringify!($($body)*)).0 ++ Input = (0, stringify!($($body)*)).0, + } + } + }; +@@ -256,7 +256,7 @@ macro_rules! rental { + #[allow(unused)] + #[derive(__rental_structs_and_impls)] + enum ProceduralMasqueradeDummyType { +- Input = (0, stringify!($($body)*)).0 ++ Input = (0, stringify!($($body)*)).0, + } + } + }; +@@ -274,7 +274,7 @@ macro_rules! rental { + #[allow(unused)] + #[derive(__rental_structs_and_impls)] + enum ProceduralMasqueradeDummyType { +- Input = (0, stringify!($($body)*)).0 ++ Input = (0, stringify!($($body)*)).0, + } + } + }; diff --git a/rpm/0104-Bug-1661961-Upgrade-cstr-to-0.2.x.-r-emilio.patch b/rpm/0104-Bug-1661961-Upgrade-cstr-to-0.2.x.-r-emilio.patch new file mode 100644 index 0000000000000..95d2d23c12a9a --- /dev/null +++ b/rpm/0104-Bug-1661961-Upgrade-cstr-to-0.2.x.-r-emilio.patch @@ -0,0 +1,1427 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Xidorn Quan +Date: Mon, 7 Dec 2020 08:01:04 +0000 +Subject: [PATCH] Bug 1661961 - Upgrade cstr to 0.2.x. r=emilio + +Differential Revision: https://phabricator.services.mozilla.com/D98839 +--- + Cargo.lock | 24 +- + gfx/webrender_bindings/Cargo.lock | 24 +- + gfx/wr/Cargo.lock | 26 +- + gfx/wr/webrender/Cargo.toml | 2 +- + .../firefox-accounts-bridge/Cargo.toml | 2 +- + services/sync/golden_gate/Cargo.toml | 2 +- + servo/ports/geckolib/Cargo.toml | 2 +- + servo/ports/geckolib/tests/Cargo.toml | 2 +- + .../rust/cstr-macros/.cargo-checksum.json | 1 - + third_party/rust/cstr-macros/Cargo.toml | 31 --- + third_party/rust/cstr-macros/LICENSE | 25 -- + third_party/rust/cstr-macros/src/lib.rs | 72 ----- + third_party/rust/cstr/.cargo-checksum.json | 2 +- + third_party/rust/cstr/Cargo.toml | 22 +- + third_party/rust/cstr/LICENSE | 2 +- + third_party/rust/cstr/README.md | 30 +++ + third_party/rust/cstr/src/lib.rs | 75 ++++-- + third_party/rust/cstr/src/parse.rs | 225 ++++++++++++++++ + third_party/rust/cstr/tests/clippy_lints.rs | 10 + + .../rust/cstr/tests/compile_fail/empty.rs | 5 + + .../rust/cstr/tests/compile_fail/empty.stderr | 7 + + .../cstr/tests/compile_fail/interior-nul.rs | 5 + + .../tests/compile_fail/interior-nul.stderr | 5 + + .../rust/cstr/tests/compile_fail/non-str.rs | 7 + + .../cstr/tests/compile_fail/non-str.stderr | 17 ++ + .../cstr/tests/compile_fail/trash-after.rs | 5 + + .../tests/compile_fail/trash-after.stderr | 5 + + third_party/rust/cstr/tests/compile_test.rs | 6 + + .../rust/cstr/tests/pass/byte_str_lit.rs | 7 + + third_party/rust/cstr/tests/pass/const.rs | 10 + + third_party/rust/cstr/tests/pass/ident.rs | 9 + + third_party/rust/cstr/tests/pass/macro.rs | 21 ++ + third_party/rust/cstr/tests/pass/str_lit.rs | 8 + + .../.cargo-checksum.json | 1 - + .../rust/procedural-masquerade/Cargo.toml | 12 - + third_party/rust/procedural-masquerade/lib.rs | 250 ------------------ + .../storage/webext_storage_bridge/Cargo.toml | 2 +- + toolkit/components/kvstore/Cargo.toml | 2 +- + .../places/bookmark_sync/Cargo.toml | 2 +- + toolkit/components/xulstore/Cargo.toml | 2 +- + 40 files changed, 468 insertions(+), 499 deletions(-) + delete mode 100644 third_party/rust/cstr-macros/.cargo-checksum.json + delete mode 100644 third_party/rust/cstr-macros/Cargo.toml + delete mode 100644 third_party/rust/cstr-macros/LICENSE + delete mode 100644 third_party/rust/cstr-macros/src/lib.rs + create mode 100644 third_party/rust/cstr/README.md + create mode 100644 third_party/rust/cstr/src/parse.rs + create mode 100644 third_party/rust/cstr/tests/clippy_lints.rs + create mode 100644 third_party/rust/cstr/tests/compile_fail/empty.rs + create mode 100644 third_party/rust/cstr/tests/compile_fail/empty.stderr + create mode 100644 third_party/rust/cstr/tests/compile_fail/interior-nul.rs + create mode 100644 third_party/rust/cstr/tests/compile_fail/interior-nul.stderr + create mode 100644 third_party/rust/cstr/tests/compile_fail/non-str.rs + create mode 100644 third_party/rust/cstr/tests/compile_fail/non-str.stderr + create mode 100644 third_party/rust/cstr/tests/compile_fail/trash-after.rs + create mode 100644 third_party/rust/cstr/tests/compile_fail/trash-after.stderr + create mode 100644 third_party/rust/cstr/tests/compile_test.rs + create mode 100644 third_party/rust/cstr/tests/pass/byte_str_lit.rs + create mode 100644 third_party/rust/cstr/tests/pass/const.rs + create mode 100644 third_party/rust/cstr/tests/pass/ident.rs + create mode 100644 third_party/rust/cstr/tests/pass/macro.rs + create mode 100644 third_party/rust/cstr/tests/pass/str_lit.rs + delete mode 100644 third_party/rust/procedural-masquerade/.cargo-checksum.json + delete mode 100644 third_party/rust/procedural-masquerade/Cargo.toml + delete mode 100644 third_party/rust/procedural-masquerade/lib.rs + +diff --git a/Cargo.lock b/Cargo.lock +index ecd1e025b8dd5e42982af3c9b4c7a61534461056..f6f9cd165d7a546c911234a22ced9913b1a01cac 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -925,22 +925,12 @@ dependencies = [ + + [[package]] + name = "cstr" +-version = "0.1.3" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "b6557bdb1dc9647eae1cf7f5601b14cd45fc3c7ccf2df618387416fe542da6ea" +-dependencies = [ +- "cstr-macros", +- "procedural-masquerade", +-] +- +-[[package]] +-name = "cstr-macros" +-version = "0.1.6" ++version = "0.2.8" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "cd670e5ff58768ef624207fb95709ce63b8d05573fb9a05165f0eef471ea6a3a" ++checksum = "c11a39d776a3b35896711da8a04dc1835169dcd36f710878187637314e47941b" + dependencies = [ +- "procedural-masquerade", +- "syn", ++ "proc-macro2", ++ "quote", + ] + + [[package]] +@@ -3725,12 +3715,6 @@ dependencies = [ + "unicode-xid", + ] + +-[[package]] +-name = "procedural-masquerade" +-version = "0.1.1" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "9f566249236c6ca4340f7ca78968271f0ed2b0f234007a61b66f9ecd0af09260" +- + [[package]] + name = "profiler_helper" + version = "0.1.0" +diff --git a/gfx/webrender_bindings/Cargo.lock b/gfx/webrender_bindings/Cargo.lock +index 72ebcff8a4632db19f28b84a779a5a97f3246b79..cc7933a201632f15805b4eb67ebfc2ee17381964 100644 +--- a/gfx/webrender_bindings/Cargo.lock ++++ b/gfx/webrender_bindings/Cargo.lock +@@ -258,22 +258,12 @@ dependencies = [ + + [[package]] + name = "cstr" +-version = "0.1.7" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "19f7a08ed4ecd7e077d4cee63937473e6f7cf57b702a9114ef41751b2cbc0f60" +-dependencies = [ +- "cstr-macros", +- "procedural-masquerade", +-] +- +-[[package]] +-name = "cstr-macros" +-version = "0.1.6" ++version = "0.2.8" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "cd670e5ff58768ef624207fb95709ce63b8d05573fb9a05165f0eef471ea6a3a" ++checksum = "c11a39d776a3b35896711da8a04dc1835169dcd36f710878187637314e47941b" + dependencies = [ +- "procedural-masquerade", +- "syn", ++ "proc-macro2", ++ "quote", + ] + + [[package]] +@@ -834,12 +824,6 @@ dependencies = [ + "unicode-xid", + ] + +-[[package]] +-name = "procedural-masquerade" +-version = "0.1.6" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "9a1574a51c3fd37b26d2c0032b649d08a7d51d4cca9c41bbc5bf7118fa4509d0" +- + [[package]] + name = "quote" + version = "1.0.4" +diff --git a/gfx/wr/Cargo.lock b/gfx/wr/Cargo.lock +index 2b742a1d201a87221769b3b1c20ac08da07192cd..5de2ad1fba2b9a371f1e0499fbc8c26eb54e64db 100644 +--- a/gfx/wr/Cargo.lock ++++ b/gfx/wr/Cargo.lock +@@ -387,20 +387,11 @@ dependencies = [ + + [[package]] + name = "cstr" +-version = "0.1.7" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-dependencies = [ +- "cstr-macros 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +- "procedural-masquerade 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +-] +- +-[[package]] +-name = "cstr-macros" +-version = "0.1.6" ++version = "0.2.8" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "procedural-masquerade 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", ++ "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -1174,11 +1165,6 @@ dependencies = [ + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + ] + +-[[package]] +-name = "procedural-masquerade" +-version = "0.1.6" +-source = "registry+https://github.com/rust-lang/crates.io-index" +- + [[package]] + name = "quick-error" + version = "1.2.3" +@@ -1759,7 +1745,7 @@ dependencies = [ + "core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-text 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "cstr 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ++ "cstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "dwrote 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)", + "freetype 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -2052,8 +2038,7 @@ dependencies = [ + "checksum crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" + "checksum crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" + "checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +-"checksum cstr 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "19f7a08ed4ecd7e077d4cee63937473e6f7cf57b702a9114ef41751b2cbc0f60" +-"checksum cstr-macros 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "cd670e5ff58768ef624207fb95709ce63b8d05573fb9a05165f0eef471ea6a3a" ++"checksum cstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c11a39d776a3b35896711da8a04dc1835169dcd36f710878187637314e47941b" + "checksum deflate 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e7e5d2a2273fed52a7f947ee55b092c4057025d7a3e04e5ecdbd25d6c3fb1bd7" + "checksum derive_more 0.99.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e2323f3f47db9a0e77ce7a300605d8d2098597fc451ed1a97bb1f6411bb550a7" + "checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +@@ -2141,7 +2126,6 @@ dependencies = [ + "checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" + "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" + "checksum proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "df246d292ff63439fea9bc8c0a270bed0e390d5ebd4db4ba15aba81111b5abe3" +-"checksum procedural-masquerade 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9a1574a51c3fd37b26d2c0032b649d08a7d51d4cca9c41bbc5bf7118fa4509d0" + "checksum quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" + "checksum quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" +diff --git a/gfx/wr/webrender/Cargo.toml b/gfx/wr/webrender/Cargo.toml +index dcf26d91330a81f74e6e39325a70a0b8cd4b1842..418932ad604c2abc76119d4fdc77328b3965e04a 100644 +--- a/gfx/wr/webrender/Cargo.toml ++++ b/gfx/wr/webrender/Cargo.toml +@@ -31,7 +31,7 @@ bincode = "1.0" + bitflags = "1.2" + byteorder = "1.0" + cfg-if = "0.1.2" +-cstr = "0.1.2" ++cstr = "0.2" + euclid = { version = "0.20.0", features = ["serde"] } + fxhash = "0.2.1" + gleam = "0.11.0" +diff --git a/services/fxaccounts/rust-bridge/firefox-accounts-bridge/Cargo.toml b/services/fxaccounts/rust-bridge/firefox-accounts-bridge/Cargo.toml +index 9a9739695ea694a3dda7187460015c2be969f058..e608f1af59e5a9f4539ba252822fe6db0bc7f1bb 100644 +--- a/services/fxaccounts/rust-bridge/firefox-accounts-bridge/Cargo.toml ++++ b/services/fxaccounts/rust-bridge/firefox-accounts-bridge/Cargo.toml +@@ -8,7 +8,7 @@ edition = "2018" + + [dependencies] + atomic_refcell = "0.1" +-cstr = "0.1" ++cstr = "0.2" + libc = "0.2" + once_cell = "1" + paste = "0.1" +diff --git a/services/sync/golden_gate/Cargo.toml b/services/sync/golden_gate/Cargo.toml +index 541d656cfaed28536dfde16a9b35bebd782b6526..c12ec000333b3ebf240e1d0a9a099d8890c52e25 100644 +--- a/services/sync/golden_gate/Cargo.toml ++++ b/services/sync/golden_gate/Cargo.toml +@@ -7,7 +7,7 @@ edition = "2018" + + [dependencies] + atomic_refcell = "0.1" +-cstr = "0.1" ++cstr = "0.2" + interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "61dcc364ac0d6d0816ab88a494bbf20d824b009b" } + log = "0.4" + moz_task = { path = "../../../xpcom/rust/moz_task" } +diff --git a/servo/ports/geckolib/Cargo.toml b/servo/ports/geckolib/Cargo.toml +index b197f6669fb7b700afd9499fb9afd78c35efc3d3..f1a22238e303d0f67419ae38912f5b1526508b14 100644 +--- a/servo/ports/geckolib/Cargo.toml ++++ b/servo/ports/geckolib/Cargo.toml +@@ -17,7 +17,7 @@ gecko_refcount_logging = ["style/gecko_refcount_logging", "servo_arc/gecko_refco + atomic_refcell = "0.1" + bincode = "1.0" + cssparser = "0.28" +-cstr = "0.1.2" ++cstr = "0.2" + libc = "0.2" + log = {version = "0.4", features = ["release_max_level_info"]} + malloc_size_of = {path = "../../components/malloc_size_of"} +diff --git a/servo/ports/geckolib/tests/Cargo.toml b/servo/ports/geckolib/tests/Cargo.toml +index adee8ea04c15a76a8bf490aa253f450de6ea7db2..d795d000892d1946d2dd6a6fe3f2608810c3d0e8 100644 +--- a/servo/ports/geckolib/tests/Cargo.toml ++++ b/servo/ports/geckolib/tests/Cargo.toml +@@ -12,7 +12,7 @@ doctest = false + [dependencies] + atomic_refcell = "0.1" + cssparser = "0.28" +-cstr = "0.1.2" ++cstr = "0.2" + env_logger = { version = "0.6", default-features = false } + geckoservo = {path = "../../../ports/geckolib"} + libc = "0.2" +diff --git a/third_party/rust/cstr-macros/.cargo-checksum.json b/third_party/rust/cstr-macros/.cargo-checksum.json +deleted file mode 100644 +index df2a97c4b9c75f13c1bb0908b8edfc93767f8534..0000000000000000000000000000000000000000 +--- a/third_party/rust/cstr-macros/.cargo-checksum.json ++++ /dev/null +@@ -1 +0,0 @@ +-{"files":{"Cargo.toml":"5637fc23a942454c72de3d59d855a2bbc72d1ea1e837cbc3bf67044e3c391fc5","LICENSE":"2c6fc9268c3b765da5bf34fe4909425437f61be05674c2516c7f8cf1251c20aa","src/lib.rs":"b1de1d679338b008dd22e4aea5384f89d7a9424d65102b4fa536d8d9eaa56e22"},"package":"cd670e5ff58768ef624207fb95709ce63b8d05573fb9a05165f0eef471ea6a3a"} +\ No newline at end of file +diff --git a/third_party/rust/cstr-macros/Cargo.toml b/third_party/rust/cstr-macros/Cargo.toml +deleted file mode 100644 +index 20dad2b3413727bf48c66a25146e00bfcba8e72c..0000000000000000000000000000000000000000 +--- a/third_party/rust/cstr-macros/Cargo.toml ++++ /dev/null +@@ -1,31 +0,0 @@ +-# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +-# +-# When uploading crates to the registry Cargo will automatically +-# "normalize" Cargo.toml files for maximal compatibility +-# with all versions of Cargo and also rewrite `path` dependencies +-# to registry (e.g., crates.io) dependencies +-# +-# If you believe there's an error in this file please file an +-# issue against the rust-lang/cargo repository. If you're +-# editing this file be aware that the upstream Cargo.toml +-# will likely look very different (and much more reasonable) +- +-[package] +-name = "cstr-macros" +-version = "0.1.6" +-authors = ["Xidorn Quan "] +-description = "Procedural macros for cstr" +-license = "MIT" +-repository = "https://github.com/upsuper/cstr" +- +-[lib] +-proc-macro = true +-[dependencies.procedural-masquerade] +-version = "0.1" +- +-[dependencies.syn] +-version = "1" +-features = ["derive", "parsing"] +-default-features = false +-[dev-dependencies.quote] +-version = "1" +diff --git a/third_party/rust/cstr-macros/LICENSE b/third_party/rust/cstr-macros/LICENSE +deleted file mode 100644 +index 5af3fbc968fc73a20e9b384afedd3bb5adbe31f6..0000000000000000000000000000000000000000 +--- a/third_party/rust/cstr-macros/LICENSE ++++ /dev/null +@@ -1,25 +0,0 @@ +-Copyright (c) 2018 Xidorn Quan +- +-Permission is hereby granted, free of charge, to any +-person obtaining a copy of this software and associated +-documentation files (the "Software"), to deal in the +-Software without restriction, including without +-limitation the rights to use, copy, modify, merge, +-publish, distribute, sublicense, and/or sell copies of +-the Software, and to permit persons to whom the Software +-is furnished to do so, subject to the following +-conditions: +- +-The above copyright notice and this permission notice +-shall be included in all copies or substantial portions +-of the Software. +- +-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +-ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +-TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +-PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +-SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +-DEALINGS IN THE SOFTWARE. +diff --git a/third_party/rust/cstr-macros/src/lib.rs b/third_party/rust/cstr-macros/src/lib.rs +deleted file mode 100644 +index 1c69f2f7b0d40f97ec0a1e263ec9ba340e778ec4..0000000000000000000000000000000000000000 +--- a/third_party/rust/cstr-macros/src/lib.rs ++++ /dev/null +@@ -1,72 +0,0 @@ +-#[macro_use] +-extern crate procedural_masquerade; +-extern crate proc_macro; +-#[cfg(test)] +-#[macro_use] +-extern crate quote; +-extern crate syn; +- +-use std::ascii::escape_default; +-use std::ffi::CString; +- +-define_proc_macros! { +- #[allow(non_snake_case)] +- pub fn cstr_internal__build_bytes(input: &str) -> String { +- let bytes = build_bytes(input); +- format!("const BYTES: &'static [u8] = {};", bytes) +- } +-} +- +-fn input_to_string(input: &str) -> String { +- if let Ok(s) = syn::parse_str::(input) { +- return s.value(); +- } +- if let Ok(i) = syn::parse_str::(input) { +- return i.to_string(); +- } +- panic!("expected a string literal or an identifier, got {}", input) +-} +- +-fn build_bytes(input: &str) -> String { +- let s = input_to_string(input); +- let cstr = match CString::new(s.as_bytes()) { +- Ok(s) => s, +- _ => panic!("literal must not contain NUL byte") +- }; +- let mut bytes = Vec::new(); +- bytes.extend(br#"b""#); +- bytes.extend(cstr.as_bytes().iter().flat_map(|&b| escape_default(b))); +- bytes.extend(br#"\0""#); +- String::from_utf8(bytes).unwrap() +-} +- +-#[cfg(test)] +-mod tests { +- use super::build_bytes; +- +- macro_rules! build_bytes { +- ($($t:tt)*) => { +- build_bytes("e!($($t)*).to_string()) +- } +- } +- macro_rules! result { +- ($($t:tt)*) => { +- quote!($($t)*).to_string() +- } +- } +- +- #[test] +- fn test_build_bytes() { +- assert_eq!(build_bytes!("aaa"), result!(b"aaa\0")); +- assert_eq!(build_bytes!("\t\n\r\"\\'"), result!(b"\t\n\r\"\\\'\0")); +- assert_eq!(build_bytes!("\x01\x02 \x7f"), result!(b"\x01\x02 \x7f\0")); +- assert_eq!(build_bytes!("你好"), result!(b"\xe4\xbd\xa0\xe5\xa5\xbd\0")); +- assert_eq!(build_bytes!(foobar), result!(b"foobar\0")); +- } +- +- #[test] +- #[should_panic] +- fn test_build_bytes_nul_inside() { +- build_bytes!("a\x00a"); +- } +-} +diff --git a/third_party/rust/cstr/.cargo-checksum.json b/third_party/rust/cstr/.cargo-checksum.json +index dc31b0570984c6d72dcf9dc7b6c766aaf408eeca..db45bf78d0e22aa101c9dd155beb047e9fad3e88 100644 +--- a/third_party/rust/cstr/.cargo-checksum.json ++++ b/third_party/rust/cstr/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"6906aff00530782954ae2e4ef4a64cf7fc0b6ddbe4557464815921bd4b966d17","LICENSE":"2c6fc9268c3b765da5bf34fe4909425437f61be05674c2516c7f8cf1251c20aa","src/lib.rs":"01e21fd1789ccbaab8d4d46cfcfc4b1997ffae3598cb83db0852f613b93f17b1"},"package":"b6557bdb1dc9647eae1cf7f5601b14cd45fc3c7ccf2df618387416fe542da6ea"} +\ No newline at end of file ++{"files":{"Cargo.toml":"a9eadcc48a51c9399980e7d0860b668a1277940899a5da781fcbfbc0a9db2660","LICENSE":"5a9bf0e7661617253ca7c12313f51a96aa62dec0bcd15a59c533c88b8093d124","README.md":"555193ce26ab91766d36d9d824ebae66cf18259e8dc37633d98cfa0cec7ce869","src/lib.rs":"2e8f10e1a260a1121cd87190dc67d5ff204258dd1740d64d891524d52424af05","src/parse.rs":"8eb3a7975a2ca73ca16fd3552d3874d04fea0c59a0c45f88194df486b5b2443f","tests/clippy_lints.rs":"4398124cd5bc3a7f295f6203d543fc7d99abfd945eb7418ccfa60535586d7e37","tests/compile_fail/empty.rs":"52dc3c0d4d6ee0bd6d89a34d1caf38d159830401f24ba30f5655f9de92697903","tests/compile_fail/empty.stderr":"c839ce87d482a1e65a668e5267067dd1bd310f60256a795fa8f080888a5c249b","tests/compile_fail/interior-nul.rs":"ecc09440020287377ca18e4b8308d1d516620a87612a5381bafc01fe48734d34","tests/compile_fail/interior-nul.stderr":"8bd003a7dfff248411403bdf666f8a0631307f468d589cf01e475b062db4b101","tests/compile_fail/non-str.rs":"e08be18a524a4482fb7f34cbc6e8448a878b41cf2c26dea99268aaabab6c3f3f","tests/compile_fail/non-str.stderr":"8dff245264d9c69dc151f742542a72400d7422f2a0f2b133a9f4d4fc96a4016a","tests/compile_fail/trash-after.rs":"7dff7a301c9087984c5acda183e34492f3d0f2ebec14b8dc0d2b11aab972a111","tests/compile_fail/trash-after.stderr":"487b5d6b687c52b80f9d9cba691a8654067a88f7d03d2d952d7e97d610ab70f3","tests/compile_test.rs":"13e3e0d22ec0dffa4d0be0c4db6381a03feff50cc25aa65c4950cc7e865d122d","tests/pass/byte_str_lit.rs":"9085e1f1e67dae193d33ff59c253cac23c9e23e9d8c7f92f0aba99097ade132e","tests/pass/const.rs":"777aeb93c3030349529a41ac62b3577b36badc4bada4ec46e45b5055d3676dbd","tests/pass/ident.rs":"5116ee71578d479d899345e039e5955b5dee442234dc504e1a9bfb9260cf8f15","tests/pass/macro.rs":"9596c936ed4d963fb40459ecd98b60610d3d90e41918f350ff45b6129b1aa0b7","tests/pass/str_lit.rs":"955fb887ebc01538bafe10fa810381eb53aebaafb8b36053e8712c081862fe7a"},"package":"c11a39d776a3b35896711da8a04dc1835169dcd36f710878187637314e47941b"} +\ No newline at end of file +diff --git a/third_party/rust/cstr/Cargo.toml b/third_party/rust/cstr/Cargo.toml +index 90caaa0adae2db1a85b9290d17ffc99fd8220383..746983257602148dbf4a97d55fbf0de95b4b318b 100644 +--- a/third_party/rust/cstr/Cargo.toml ++++ b/third_party/rust/cstr/Cargo.toml +@@ -3,7 +3,7 @@ + # When uploading crates to the registry Cargo will automatically + # "normalize" Cargo.toml files for maximal compatibility + # with all versions of Cargo and also rewrite `path` dependencies +-# to registry (e.g. crates.io) dependencies ++# to registry (e.g., crates.io) dependencies + # + # If you believe there's an error in this file please file an + # issue against the rust-lang/cargo repository. If you're +@@ -11,15 +11,25 @@ + # will likely look very different (and much more reasonable) + + [package] ++edition = "2018" + name = "cstr" +-version = "0.1.3" ++version = "0.2.8" + authors = ["Xidorn Quan "] + description = "Macro for building static CStr reference" ++readme = "README.md" + keywords = ["macro", "cstr"] + license = "MIT" + repository = "https://github.com/upsuper/cstr" +-[dependencies.cstr-macros] +-version = "0.1.2" + +-[dependencies.procedural-masquerade] +-version = "0.1" ++[lib] ++proc-macro = true ++[dependencies.proc-macro2] ++version = "1" ++ ++[dependencies.quote] ++version = "1" ++[dev-dependencies.trybuild] ++version = "1.0.30" ++[badges.travis-ci] ++branch = "master" ++repository = "upsuper/cstr" +diff --git a/third_party/rust/cstr/LICENSE b/third_party/rust/cstr/LICENSE +index 5af3fbc968fc73a20e9b384afedd3bb5adbe31f6..82ec98b7ccb454dfac311099dc97861c5b57cf38 100644 +--- a/third_party/rust/cstr/LICENSE ++++ b/third_party/rust/cstr/LICENSE +@@ -1,4 +1,4 @@ +-Copyright (c) 2018 Xidorn Quan ++Copyright (c) 2018-2020 Xidorn Quan + + Permission is hereby granted, free of charge, to any + person obtaining a copy of this software and associated +diff --git a/third_party/rust/cstr/README.md b/third_party/rust/cstr/README.md +new file mode 100644 +index 0000000000000000000000000000000000000000..e8950e7d11ab3ca23011c0a81f5ed5ccea95f0a6 +--- /dev/null ++++ b/third_party/rust/cstr/README.md +@@ -0,0 +1,30 @@ ++# cstr ++ ++[![CI](https://github.com/upsuper/cstr/workflows/CI/badge.svg)](https://github.com/upsuper/cstr/actions) ++[![Crates.io](https://img.shields.io/crates/v/cstr.svg)](https://crates.io/crates/cstr) ++[![Docs](https://docs.rs/cstr/badge.svg)](https://docs.rs/cstr) ++ ++ ++ ++A macro for getting `&'static CStr` from literal or identifier. ++ ++This macro checks whether the given literal is valid for `CStr` ++at compile time, and returns a static reference of `CStr`. ++ ++This macro can be used to to initialize constants on Rust 1.46 and above. ++ ++## Example ++ ++```rust ++use cstr::cstr; ++use std::ffi::CStr; ++ ++let test = cstr!(b"hello\xff"); ++assert_eq!(test, CStr::from_bytes_with_nul(b"hello\xff\0").unwrap()); ++let test = cstr!("hello"); ++assert_eq!(test, CStr::from_bytes_with_nul(b"hello\0").unwrap()); ++let test = cstr!(hello); ++assert_eq!(test, CStr::from_bytes_with_nul(b"hello\0").unwrap()); ++``` ++ ++ +diff --git a/third_party/rust/cstr/src/lib.rs b/third_party/rust/cstr/src/lib.rs +index 859343a80cfd6efc8fd2eec48da76a22224ea025..d78eaa1b214c649c36675c4cc55532a107381d1c 100644 +--- a/third_party/rust/cstr/src/lib.rs ++++ b/third_party/rust/cstr/src/lib.rs +@@ -1,48 +1,65 @@ +-//! A macro for getting `&'static CStr` from literal. ++//! A macro for getting `&'static CStr` from literal or identifier. + //! + //! This macro checks whether the given literal is valid for `CStr` + //! at compile time, and returns a static reference of `CStr`. + //! +-//! Note that it currently cannot be used to initialize constants due +-//! to restriction of Rust. ++//! This macro can be used to to initialize constants on Rust 1.46 and above. + //! +-//! Also, it currently only supports a UTF-8 string as input because +-//! Rust's tokenizer only accepts that without the `b` prefix. This +-//! may be expanded in the future if necessary. +-//! +-//! # Example ++//! ## Example + //! + //! ``` +-//! #[macro_use] extern crate cstr; ++//! use cstr::cstr; + //! use std::ffi::CStr; + //! +-//! # fn main() { ++//! let test = cstr!(b"hello\xff"); ++//! assert_eq!(test, CStr::from_bytes_with_nul(b"hello\xff\0").unwrap()); + //! let test = cstr!("hello"); + //! assert_eq!(test, CStr::from_bytes_with_nul(b"hello\0").unwrap()); +-//! # } ++//! let test = cstr!(hello); ++//! assert_eq!(test, CStr::from_bytes_with_nul(b"hello\0").unwrap()); + //! ``` + +-#[allow(unused_imports)] +-#[macro_use] +-extern crate cstr_macros; +-#[macro_use] +-extern crate procedural_masquerade; ++// While this isn't necessary when using Cargo >= 1.42, omitting it actually requires path-less ++// `--extern proc_macro` to be passed to `rustc` when building this crate. Some tools may not do ++// this correctly. So it's added as a precaution. ++extern crate proc_macro; ++ ++use crate::parse::parse_input; ++use proc_macro::TokenStream as RawTokenStream; ++use proc_macro2::{Literal, Span, TokenStream}; ++use quote::{quote, quote_spanned}; ++use std::ffi::CString; + +-#[doc(hidden)] +-pub use cstr_macros::*; ++mod parse; + +-define_invoke_proc_macro!(cstr__invoke_build_bytes); ++struct Error(Span, &'static str); ++ ++#[proc_macro] ++pub fn cstr(input: RawTokenStream) -> RawTokenStream { ++ let tokens = match build_byte_str(input.into()) { ++ // We can't use `&*ptr` to convert the raw pointer to reference, because as of Rust 1.46, ++ // dereferencing raw pointer in constants is unstable. ++ // This is being tracked in https://github.com/rust-lang/rust/issues/51911 ++ // So we explicitly disable the clippy lint for this expression. ++ Ok(s) => quote!(unsafe { ++ #[allow(clippy::transmute_ptr_to_ref)] ++ ::std::mem::transmute::<_, &::std::ffi::CStr>( ++ #s as *const [u8] as *const ::std::ffi::CStr ++ ) ++ }), ++ Err(Error(span, msg)) => quote_spanned!(span => compile_error!(#msg)), ++ }; ++ tokens.into() ++} + +-#[macro_export] +-macro_rules! cstr { +- ($t: tt) => { +- { +- cstr__invoke_build_bytes! { +- cstr_internal__build_bytes!($t) +- } +- unsafe { +- ::std::ffi::CStr::from_bytes_with_nul_unchecked(BYTES) +- } ++fn build_byte_str(input: TokenStream) -> Result { ++ let (bytes, span) = parse_input(input)?; ++ match CString::new(bytes) { ++ Ok(s) => { ++ let mut lit = Literal::byte_string(s.as_bytes_with_nul()); ++ lit.set_span(span); ++ Ok(lit) + } ++ Err(_) => Err(Error(span, "nul byte found in the literal")), + } + } +diff --git a/third_party/rust/cstr/src/parse.rs b/third_party/rust/cstr/src/parse.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..19e8a548ea7eea7904807d1884d17551e88b2477 +--- /dev/null ++++ b/third_party/rust/cstr/src/parse.rs +@@ -0,0 +1,225 @@ ++use crate::Error; ++use proc_macro2::{Delimiter, Ident, Literal, Span, TokenStream, TokenTree}; ++use std::char; ++ ++macro_rules! unexpected_content { ++ () => { ++ "expected one of: byte string literal, string literal, identifier" ++ }; ++} ++ ++pub(crate) fn parse_input(mut input: TokenStream) -> Result<(Vec, Span), Error> { ++ loop { ++ let mut tokens = input.into_iter(); ++ let token = match tokens.next() { ++ Some(token) => token, ++ None => { ++ return Err(Error( ++ Span::call_site(), ++ concat!("unexpected end of input, ", unexpected_content!()), ++ )) ++ } ++ }; ++ let span = token.span(); ++ let result = match token { ++ // Unwrap any empty group which may be created from macro expansion. ++ TokenTree::Group(group) if group.delimiter() == Delimiter::None => Err(group), ++ TokenTree::Literal(literal) => match parse_literal(literal) { ++ Ok(result) => Ok(result), ++ Err(msg) => return Err(Error(span, msg)), ++ }, ++ TokenTree::Ident(ident) => Ok(parse_ident(ident)), ++ _ => return Err(Error(span, unexpected_content!())), ++ }; ++ if let Some(token) = tokens.next() { ++ return Err(Error(token.span(), "unexpected token")); ++ } ++ match result { ++ Ok(result) => return Ok((result, span)), ++ Err(group) => input = group.stream(), ++ } ++ } ++} ++ ++fn parse_literal(literal: Literal) -> Result, &'static str> { ++ let s = literal.to_string(); ++ let s = s.as_bytes(); ++ match s[0] { ++ b'"' => Ok(parse_cooked_content(&s)), ++ b'r' => Ok(parse_raw_content(&s[1..])), ++ b'b' => match s[1] { ++ b'"' => Ok(parse_cooked_content(&s[1..])), ++ b'r' => Ok(parse_raw_content(&s[2..])), ++ _ => Err(unexpected_content!()), ++ }, ++ _ => Err(unexpected_content!()), ++ } ++} ++ ++fn all_pounds(bytes: &[u8]) -> bool { ++ bytes.iter().all(|b| *b == b'#') ++} ++ ++/// Parses raw string / bytes content after `r` prefix. ++fn parse_raw_content(s: &[u8]) -> Vec { ++ let q_start = s.iter().position(|b| *b == b'"').unwrap(); ++ let q_end = s.iter().rposition(|b| *b == b'"').unwrap(); ++ assert!(all_pounds(&s[0..q_start])); ++ assert!(all_pounds(&s[q_end + 1..q_end + q_start + 1])); ++ Vec::from(&s[q_start + 1..q_end]) ++} ++ ++/// Parses the cooked string / bytes content within quotes. ++fn parse_cooked_content(mut s: &[u8]) -> Vec { ++ s = &s[1..s.iter().rposition(|b| *b == b'"').unwrap()]; ++ let mut result = Vec::new(); ++ while !s.is_empty() { ++ match s[0] { ++ b'\\' => {} ++ b'\r' => { ++ assert_eq!(s[1], b'\n'); ++ result.push(b'\n'); ++ s = &s[2..]; ++ continue; ++ } ++ b => { ++ result.push(b); ++ s = &s[1..]; ++ continue; ++ } ++ } ++ let b = s[1]; ++ s = &s[2..]; ++ match b { ++ b'x' => { ++ let (b, rest) = backslash_x(&s); ++ result.push(b); ++ s = rest; ++ } ++ b'u' => { ++ let (c, rest) = backslash_u(&s); ++ result.extend_from_slice(c.encode_utf8(&mut [0; 4]).as_bytes()); ++ s = rest; ++ } ++ b'n' => result.push(b'\n'), ++ b'r' => result.push(b'\r'), ++ b't' => result.push(b'\t'), ++ b'\\' => result.push(b'\\'), ++ b'0' => result.push(b'\0'), ++ b'\'' => result.push(b'\''), ++ b'"' => result.push(b'"'), ++ b'\r' | b'\n' => { ++ let next = s.iter().position(|b| { ++ let ch = char::from_u32(u32::from(*b)).unwrap(); ++ !ch.is_whitespace() ++ }); ++ match next { ++ Some(pos) => s = &s[pos..], ++ None => s = b"", ++ } ++ } ++ b => panic!("unexpected byte {:?} after \\", b), ++ } ++ } ++ result ++} ++ ++fn backslash_x(s: &[u8]) -> (u8, &[u8]) { ++ let ch = hex_to_u8(s[0]) * 0x10 + hex_to_u8(s[1]); ++ (ch, &s[2..]) ++} ++ ++fn hex_to_u8(b: u8) -> u8 { ++ match b { ++ b'0'..=b'9' => b - b'0', ++ b'a'..=b'f' => b - b'a' + 10, ++ b'A'..=b'F' => b - b'A' + 10, ++ _ => unreachable!("unexpected non-hex character {:?} after \\x", b), ++ } ++} ++ ++fn backslash_u(s: &[u8]) -> (char, &[u8]) { ++ assert_eq!(s[0], b'{'); ++ let end = s[1..].iter().position(|b| *b == b'}').unwrap(); ++ let mut ch = 0; ++ for b in &s[1..=end] { ++ ch *= 0x10; ++ ch += u32::from(hex_to_u8(*b)); ++ } ++ (char::from_u32(ch).unwrap(), &s[end + 2..]) ++} ++ ++fn parse_ident(ident: Ident) -> Vec { ++ ident.to_string().into_bytes() ++} ++ ++#[cfg(test)] ++mod tests { ++ use super::*; ++ use std::str::FromStr; ++ ++ // Tests below were modified from ++ // https://github.com/dtolnay/syn/blob/cd5fdc0f530f822446fccaf831669cd0cf4a0fc9/tests/test_lit.rs ++ ++ fn lit(s: &str) -> Vec { ++ match TokenStream::from_str(s) ++ .unwrap() ++ .into_iter() ++ .next() ++ .unwrap() ++ { ++ TokenTree::Literal(lit) => parse_literal(lit).unwrap(), ++ _ => panic!(), ++ } ++ } ++ ++ #[test] ++ fn strings() { ++ #[track_caller] ++ fn test_string(s: &str, value: &[u8]) { ++ assert_eq!(lit(s), value); ++ } ++ ++ test_string("\"a\"", b"a"); ++ test_string("\"\\n\"", b"\n"); ++ test_string("\"\\r\"", b"\r"); ++ test_string("\"\\t\"", b"\t"); ++ test_string("\"🐕\"", b"\xf0\x9f\x90\x95"); // NOTE: This is an emoji ++ test_string("\"\\\"\"", b"\""); ++ test_string("\"'\"", b"'"); ++ test_string("\"\"", b""); ++ test_string("\"\\u{1F415}\"", b"\xf0\x9f\x90\x95"); ++ test_string( ++ "\"contains\nnewlines\\\nescaped newlines\"", ++ b"contains\nnewlinesescaped newlines", ++ ); ++ test_string("r\"raw\nstring\\\nhere\"", b"raw\nstring\\\nhere"); ++ test_string("\"...\"q", b"..."); ++ test_string("r\"...\"q", b"..."); ++ test_string("r##\"...\"##q", b"..."); ++ } ++ ++ #[test] ++ fn byte_strings() { ++ #[track_caller] ++ fn test_byte_string(s: &str, value: &[u8]) { ++ assert_eq!(lit(s), value); ++ } ++ ++ test_byte_string("b\"a\"", b"a"); ++ test_byte_string("b\"\\n\"", b"\n"); ++ test_byte_string("b\"\\r\"", b"\r"); ++ test_byte_string("b\"\\t\"", b"\t"); ++ test_byte_string("b\"\\\"\"", b"\""); ++ test_byte_string("b\"'\"", b"'"); ++ test_byte_string("b\"\"", b""); ++ test_byte_string( ++ "b\"contains\nnewlines\\\nescaped newlines\"", ++ b"contains\nnewlinesescaped newlines", ++ ); ++ test_byte_string("br\"raw\nstring\\\nhere\"", b"raw\nstring\\\nhere"); ++ test_byte_string("b\"...\"q", b"..."); ++ test_byte_string("br\"...\"q", b"..."); ++ test_byte_string("br##\"...\"##q", b"..."); ++ } ++} +diff --git a/third_party/rust/cstr/tests/clippy_lints.rs b/third_party/rust/cstr/tests/clippy_lints.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..47d7f27e2bb4a47a14118f42ca8f15c3eefc0008 +--- /dev/null ++++ b/third_party/rust/cstr/tests/clippy_lints.rs +@@ -0,0 +1,10 @@ ++use cstr::cstr; ++use std::ffi::CStr; ++ ++#[test] ++#[deny(clippy::transmute_ptr_to_ref)] ++fn deny_transmute_ptr_to_ref() { ++ let s: &'static CStr = cstr!("foo\u{4e00}bar"); ++ let expected = b"foo\xe4\xb8\x80bar\0"; ++ assert_eq!(s, CStr::from_bytes_with_nul(expected).unwrap()); ++} +diff --git a/third_party/rust/cstr/tests/compile_fail/empty.rs b/third_party/rust/cstr/tests/compile_fail/empty.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..0ac967273e590d92764c6075205fb24630de4f8d +--- /dev/null ++++ b/third_party/rust/cstr/tests/compile_fail/empty.rs +@@ -0,0 +1,5 @@ ++use cstr::cstr; ++ ++fn main() { ++ let _foo = cstr!(); ++} +diff --git a/third_party/rust/cstr/tests/compile_fail/empty.stderr b/third_party/rust/cstr/tests/compile_fail/empty.stderr +new file mode 100644 +index 0000000000000000000000000000000000000000..738692f22c142601827c5e385804bb3236ec5d86 +--- /dev/null ++++ b/third_party/rust/cstr/tests/compile_fail/empty.stderr +@@ -0,0 +1,7 @@ ++error: unexpected end of input, expected one of: byte string literal, string literal, identifier ++ --> $DIR/empty.rs:4:16 ++ | ++4 | let _foo = cstr!(); ++ | ^^^^^^^ ++ | ++ = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) +diff --git a/third_party/rust/cstr/tests/compile_fail/interior-nul.rs b/third_party/rust/cstr/tests/compile_fail/interior-nul.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..a6876aeb1d5925979f740d0d7896d5af2eea4aff +--- /dev/null ++++ b/third_party/rust/cstr/tests/compile_fail/interior-nul.rs +@@ -0,0 +1,5 @@ ++use cstr::cstr; ++ ++fn main() { ++ let _foo = cstr!("foo\0bar"); ++} +diff --git a/third_party/rust/cstr/tests/compile_fail/interior-nul.stderr b/third_party/rust/cstr/tests/compile_fail/interior-nul.stderr +new file mode 100644 +index 0000000000000000000000000000000000000000..0c6ced1a4506bcd4180ca7d737aaa37d18a5074b +--- /dev/null ++++ b/third_party/rust/cstr/tests/compile_fail/interior-nul.stderr +@@ -0,0 +1,5 @@ ++error: nul byte found in the literal ++ --> $DIR/interior-nul.rs:4:22 ++ | ++4 | let _foo = cstr!("foo\0bar"); ++ | ^^^^^^^^^^ +diff --git a/third_party/rust/cstr/tests/compile_fail/non-str.rs b/third_party/rust/cstr/tests/compile_fail/non-str.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..172b14559059da058b3d8c7500833e734dce89d3 +--- /dev/null ++++ b/third_party/rust/cstr/tests/compile_fail/non-str.rs +@@ -0,0 +1,7 @@ ++use cstr::cstr; ++ ++fn main() { ++ let _foo = cstr!(1); ++ let _foo = cstr!(("a")); ++ let _foo = cstr!(&1); ++} +diff --git a/third_party/rust/cstr/tests/compile_fail/non-str.stderr b/third_party/rust/cstr/tests/compile_fail/non-str.stderr +new file mode 100644 +index 0000000000000000000000000000000000000000..bbbf7e71691512d23337c7eb0cebca3dada2654e +--- /dev/null ++++ b/third_party/rust/cstr/tests/compile_fail/non-str.stderr +@@ -0,0 +1,17 @@ ++error: expected one of: byte string literal, string literal, identifier ++ --> $DIR/non-str.rs:4:22 ++ | ++4 | let _foo = cstr!(1); ++ | ^ ++ ++error: expected one of: byte string literal, string literal, identifier ++ --> $DIR/non-str.rs:5:22 ++ | ++5 | let _foo = cstr!(("a")); ++ | ^^^^^ ++ ++error: expected one of: byte string literal, string literal, identifier ++ --> $DIR/non-str.rs:6:22 ++ | ++6 | let _foo = cstr!(&1); ++ | ^ +diff --git a/third_party/rust/cstr/tests/compile_fail/trash-after.rs b/third_party/rust/cstr/tests/compile_fail/trash-after.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..5e4f7c3f08496bb86f0662cf336da704ddd95d1f +--- /dev/null ++++ b/third_party/rust/cstr/tests/compile_fail/trash-after.rs +@@ -0,0 +1,5 @@ ++use cstr::cstr; ++ ++fn main() { ++ let _foo = cstr!("foo" + "bar"); ++} +diff --git a/third_party/rust/cstr/tests/compile_fail/trash-after.stderr b/third_party/rust/cstr/tests/compile_fail/trash-after.stderr +new file mode 100644 +index 0000000000000000000000000000000000000000..d6bb1530af76ce461ac24a9e1e1c3ff819196a84 +--- /dev/null ++++ b/third_party/rust/cstr/tests/compile_fail/trash-after.stderr +@@ -0,0 +1,5 @@ ++error: unexpected token ++ --> $DIR/trash-after.rs:4:28 ++ | ++4 | let _foo = cstr!("foo" + "bar"); ++ | ^ +diff --git a/third_party/rust/cstr/tests/compile_test.rs b/third_party/rust/cstr/tests/compile_test.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..b3b9d9f6cecfd5bc9f5fcc84dd5ec51a45e1115c +--- /dev/null ++++ b/third_party/rust/cstr/tests/compile_test.rs +@@ -0,0 +1,6 @@ ++#[test] ++fn compile_test() { ++ let t = trybuild::TestCases::new(); ++ t.pass("tests/pass/*.rs"); ++ t.compile_fail("tests/compile_fail/*.rs"); ++} +diff --git a/third_party/rust/cstr/tests/pass/byte_str_lit.rs b/third_party/rust/cstr/tests/pass/byte_str_lit.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..fd87f176c2804efcc2ef8980d85ccf8a051b97eb +--- /dev/null ++++ b/third_party/rust/cstr/tests/pass/byte_str_lit.rs +@@ -0,0 +1,7 @@ ++use cstr::cstr; ++use std::ffi::CStr; ++ ++fn main() { ++ let foo: &'static CStr = cstr!(b"foo\xffbar"); ++ assert_eq!(foo, CStr::from_bytes_with_nul(b"foo\xffbar\0").unwrap()); ++} +diff --git a/third_party/rust/cstr/tests/pass/const.rs b/third_party/rust/cstr/tests/pass/const.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..ae8647b9540ca61d675407b309347edfaa36de9e +--- /dev/null ++++ b/third_party/rust/cstr/tests/pass/const.rs +@@ -0,0 +1,10 @@ ++use cstr::cstr; ++use std::ffi::CStr; ++ ++const FOO: &CStr = cstr!(b"foo\xffbar"); ++static BAR: &CStr = cstr!("bar"); ++ ++fn main() { ++ assert_eq!(FOO, CStr::from_bytes_with_nul(b"foo\xffbar\0").unwrap()); ++ assert_eq!(BAR, CStr::from_bytes_with_nul(b"bar\0").unwrap()); ++} +diff --git a/third_party/rust/cstr/tests/pass/ident.rs b/third_party/rust/cstr/tests/pass/ident.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..55e41c86213fe7d0e263178ac3a8ca9567fb57fd +--- /dev/null ++++ b/third_party/rust/cstr/tests/pass/ident.rs +@@ -0,0 +1,9 @@ ++use cstr::cstr; ++use std::ffi::CStr; ++ ++fn main() { ++ let foo: &'static CStr = cstr!(foobar); ++ assert_eq!(foo, CStr::from_bytes_with_nul(b"foobar\0").unwrap()); ++ let foo: &'static CStr = cstr!(r#foobar); ++ assert_eq!(foo, CStr::from_bytes_with_nul(b"r#foobar\0").unwrap()); ++} +diff --git a/third_party/rust/cstr/tests/pass/macro.rs b/third_party/rust/cstr/tests/pass/macro.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..e89deac648a06cfc647fab4496c973581337d2f9 +--- /dev/null ++++ b/third_party/rust/cstr/tests/pass/macro.rs +@@ -0,0 +1,21 @@ ++use cstr::cstr; ++use std::ffi::CStr; ++ ++macro_rules! cstr_expr { ++ ($s:expr) => { ++ cstr!($s) ++ }; ++} ++ ++macro_rules! cstr_literal { ++ ($s:literal) => { ++ cstr!($s) ++ }; ++} ++ ++fn main() { ++ let foo: &'static CStr = cstr_expr!("foo"); ++ assert_eq!(foo, CStr::from_bytes_with_nul(b"foo\0").unwrap()); ++ let bar: &'static CStr = cstr_literal!("bar"); ++ assert_eq!(bar, CStr::from_bytes_with_nul(b"bar\0").unwrap()); ++} +diff --git a/third_party/rust/cstr/tests/pass/str_lit.rs b/third_party/rust/cstr/tests/pass/str_lit.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..d925859a9a51daa1f1fc1e4040184b5f7b3c2d72 +--- /dev/null ++++ b/third_party/rust/cstr/tests/pass/str_lit.rs +@@ -0,0 +1,8 @@ ++use cstr::cstr; ++use std::ffi::CStr; ++ ++fn main() { ++ let foo: &'static CStr = cstr!("foo\u{4e00}bar"); ++ let expected = b"foo\xe4\xb8\x80bar\0"; ++ assert_eq!(foo, CStr::from_bytes_with_nul(expected).unwrap()); ++} +diff --git a/third_party/rust/procedural-masquerade/.cargo-checksum.json b/third_party/rust/procedural-masquerade/.cargo-checksum.json +deleted file mode 100644 +index 5913908af6f9737c828c058eb0ee0a61ce0c5a0a..0000000000000000000000000000000000000000 +--- a/third_party/rust/procedural-masquerade/.cargo-checksum.json ++++ /dev/null +@@ -1 +0,0 @@ +-{"files":{"Cargo.toml":"3aad5ce464f7224e4b86fc0a70d89c354635ed624bf4bb12cf4ca597c45879b7","lib.rs":"f0f2793a21bc85ae3ee3e040ef703da87b558a1ce524873ef872bf44de795931"},"package":"9f566249236c6ca4340f7ca78968271f0ed2b0f234007a61b66f9ecd0af09260"} +\ No newline at end of file +diff --git a/third_party/rust/procedural-masquerade/Cargo.toml b/third_party/rust/procedural-masquerade/Cargo.toml +deleted file mode 100644 +index d1cdccc4d60e4e0bc81731ba15587a9ea2648c4b..0000000000000000000000000000000000000000 +--- a/third_party/rust/procedural-masquerade/Cargo.toml ++++ /dev/null +@@ -1,12 +0,0 @@ +-[package] +-name = "procedural-masquerade" +-version = "0.1.1" +-authors = ["Simon Sapin "] +-description = "macro_rules for making proc_macro_derive pretending to be proc_macro" +-documentation = "https://docs.rs/procedural-masquerade/" +-repository = "https://github.com/servo/rust-cssparser" +-license = "MIT/Apache-2.0" +- +-[lib] +-path = "lib.rs" +-doctest = false +diff --git a/third_party/rust/procedural-masquerade/lib.rs b/third_party/rust/procedural-masquerade/lib.rs +deleted file mode 100644 +index c2bd6b481e1f47d7c7f463faca3597dd42c615d4..0000000000000000000000000000000000000000 +--- a/third_party/rust/procedural-masquerade/lib.rs ++++ /dev/null +@@ -1,250 +0,0 @@ +-//! # Custom `derive` pretending to be functional procedural macros on Rust 1.15 +-//! +-//! This crate enables creating function-like macros (invoked as `foo!(...)`) +-//! with a procedural component, +-//! based on both custom `derive` (a.k.a. *Macros 1.1*) and `macro_rules!`. +-//! +-//! This convoluted mechanism enables such macros to run on stable Rust 1.15, +-//! even though functional procedural macros (a.k.a. *Macros 2.0*) are not available yet. +-//! +-//! A library defining such a macro needs two crates: a “normal” one, and a `proc-macro` one. +-//! In the example below we’ll call them `libfoo` and `libfoo-macros`, respectively. +-//! +-//! # Credits +-//! +-//! The trick that makes this crate work +-//! is based on an idea from [David Tolnay](https://github.com/dtolnay). +-//! Many thanks! +-//! +-//! # Example +-//! +-//! As a simple example, we’re going to re-implement the `stringify!` macro. +-//! This is useless since `stringify!` already exists in the standard library, +-//! and a bit absurd since this crate uses `stringify!` internally. +-//! +-//! Nevertheless, it serves as a simple example to demonstrate the use of this crate. +-//! +-//! ## The `proc-macro` crate +-//! +-//! The minimal `Cargo.toml` file is typical for Macros 1.1: +-//! +-//! ```toml +-//! [package] +-//! name = "libfoo-macros" +-//! version = "1.0.0" +-//! +-//! [lib] +-//! proc-macro = true +-//! ``` +-//! +-//! In the code, we define the procedural part of our macro in a function. +-//! This function will not be used directly by end users, +-//! but it still needs to be re-exported to them +-//! (because of limitations in `macro_rules!`). +-//! +-//! To avoid name collisions, we and a long and explicit prefix in the function’s name. +-//! +-//! The function takes a string containing arbitrary Rust tokens, +-//! and returns a string that is parsed as *items*. +-//! The returned string can contain constants, statics, functions, `impl`s, etc., +-//! but not expressions directly. +-//! +-//! ```rust +-//! #[macro_use] extern crate procedural_masquerade; +-//! extern crate proc_macro; +-//! +-//! define_proc_macros! { +-//! #[allow(non_snake_case)] +-//! pub fn foo_internal__stringify_const(input: &str) -> String { +-//! format!("const STRINGIFIED: &'static str = {:?};", input) +-//! } +-//! } +-//! ``` +-//! +-//! A less trivial macro would probably use +-//! the [`syn`](https://github.com/dtolnay/syn/) crate to parse its input +-//! and the [`quote`](https://github.com/dtolnay/quote) crate to generate its output. +-//! +-//! ## The library crate +-//! +-//! ```toml +-//! [package] +-//! name = "libfoo" +-//! version = "1.0.0" +-//! +-//! [dependencies] +-//! cssparser-macros = {path = "./macros", version = "1.0"} +-//! ``` +-//! +-//! ```rust +-//! #[macro_use] extern crate libfoo_macros; // (1) +-//! +-//! pub use libfoo_macros::*; // (2) +-//! +-//! define_invoke_proc_macro!(libfoo__invoke_proc_macro); // (3) +-//! +-//! #[macro_export] +-//! macro_rules! foo_stringify { // (4) +-//! ( $( $tts: tt ) ) => { +-//! { // (5) +-//! libfoo__invoke_proc_macro! { // (6) +-//! foo_internal__stringify_const!( $( $tts ) ) // (7) +-//! } +-//! STRINGIFIED // (8) +-//! } +-//! } +-//! } +-//! ``` +-//! +-//! Let’s go trough the numbered lines one by one: +-//! +-//! 1. `libfoo` depends on the other `libfoo-macros`, and imports its macros. +-//! 2. Everything exported by `libfoo-macros` (which is one custom `derive`) +-//! is re-exported to users of `libfoo`. +-//! They’re not expected to use it directly, +-//! but expansion of the `foo_stringify` macro needs it. +-//! 3. This macro invocation defines yet another macro, called `libfoo__invoke_proc_macro`, +-//! which is also exported. +-//! This indirection is necessary +-//! because re-exporting `macro_rules!` macros doesn’t work currently, +-//! and once again it is used by the expansion of `foo_stringify`. +-//! Again, we use a long prefix to avoid name collisions. +-//! 4. Finally, we define the macro that we really want. +-//! This one has a name that users will use. +-//! 5. The expansion of this macro will define some items, +-//! whose names are not hygienic in `macro_rules`. +-//! So we wrap everything in an extra `{…}` block to prevent these names for leaking. +-//! 6. Here we use the macro defined in (3), +-//! which allows us to write something that look like invoking a functional procedural macro, +-//! but really uses a custom `derive`. +-//! This will define a type called `ProceduralMasqueradeDummyType`, +-//! as a placeholder to use `derive`. +-//! If `libfoo__invoke_proc_macro!` is to be used more than once, +-//! each use needs to be nested in another block +-//! so that the names of multiple dummy types don’t collide. +-//! 7. In addition to the dummy type, +-//! the items returned by our procedural component are inserted here. +-//! (In this case the `STRINGIFIED` constant.) +-//! 8. Finally, we write the expression that we want the macro to evaluate to. +-//! This expression can use parts of `foo_stringify`’s input, +-//! it can contain control-flow statements like `return` or `continue`, +-//! and of course refer to procedurally-defined items. +-//! +-//! This macro can be used in an expression context. +-//! It expands to a block-expression that contains some items (as an implementation detail) +-//! and ends with another expression. +-//! +-//! ## For users +-//! +-//! Users of `libfoo` don’t need to worry about any of these implementation details. +-//! They can use the `foo_stringify` macro as if it were a simle `macro_rules` macro: +-//! +-//! ```rust +-//! #[macro_use] extern crate libfoo; +-//! +-//! fn main() { +-//! do_something(foo_stringify!(1 + 2)); +-//! } +-//! +-//! fn do_something(_: &str) { /* ... */ } +-//! ``` +-//! +-//! # More +-//! +-//! To see a more complex example, look at +-//! [`cssparser`’s `src/macros.rs](https://github.com/servo/rust-cssparser/blob/master/src/macros.rs) +-//! and +-//! [`cssparser-macros`’s `macros/lib.rs](https://github.com/servo/rust-cssparser/blob/master/macros/lib.rs). +- +-/// This macro wraps `&str -> String` functions +-/// in custom `derive` implementations with `#[proc_macro_derive]`. +-/// +-/// See crate documentation for details. +-#[macro_export] +-macro_rules! define_proc_macros { +- ( +- $( +- $( #[$attr:meta] )* +- pub fn $proc_macro_name: ident ($input: ident : &str) -> String +- $body: block +- )+ +- ) => { +- $( +- $( #[$attr] )* +- #[proc_macro_derive($proc_macro_name)] +- pub fn $proc_macro_name(derive_input: ::proc_macro::TokenStream) +- -> ::proc_macro::TokenStream { +- let $input = derive_input.to_string(); +- let $input = $crate::_extract_input(&$input); +- $body.parse().unwrap() +- } +- )+ +- } +-} +- +-/// Implementation detail of `define_proc_macros!`. +-/// +-/// **This function is not part of the public API. It can change or be removed between any versions.** +-#[doc(hidden)] +-pub fn _extract_input(derive_input: &str) -> &str { +- let mut input = derive_input; +- +- for expected in &["#[allow(unused)]", "enum", "ProceduralMasqueradeDummyType", "{", +- "Input", "=", "(0,", "stringify!", "("] { +- input = input.trim_left(); +- assert!(input.starts_with(expected), +- "expected prefix {:?} not found in {:?}", expected, derive_input); +- input = &input[expected.len()..]; +- } +- +- for expected in [")", ").0,", "}"].iter().rev() { +- input = input.trim_right(); +- assert!(input.ends_with(expected), +- "expected suffix {:?} not found in {:?}", expected, derive_input); +- let end = input.len() - expected.len(); +- input = &input[..end]; +- } +- +- input +-} +- +-/// This macro expands to the definition of another macro (whose name is given as a parameter). +-/// +-/// See crate documentation for details. +-#[macro_export] +-macro_rules! define_invoke_proc_macro { +- ($macro_name: ident) => { +- /// Implementation detail of other macros in this crate. +- #[doc(hidden)] +- #[macro_export] +- macro_rules! $macro_name { +- ($proc_macro_name: ident ! $paren: tt) => { +- #[derive($proc_macro_name)] +- #[allow(unused)] +- enum ProceduralMasqueradeDummyType { +- // The magic happens here. +- // +- // We use an `enum` with an explicit discriminant +- // because that is the only case where a type definition +- // can contain a (const) expression. +- // +- // `(0, "foo").0` evalutes to 0, with the `"foo"` part ignored. +- // +- // By the time the `#[proc_macro_derive]` function +- // implementing `#[derive($proc_macro_name)]` is called, +- // `$paren` has already been replaced with the input of this inner macro, +- // but `stringify!` has not been expanded yet. +- // +- // This how arbitrary tokens can be inserted +- // in the input to the `#[proc_macro_derive]` function. +- // +- // Later, `stringify!(...)` is expanded into a string literal +- // which is then ignored. +- // Using `stringify!` enables passing arbitrary tokens +- // rather than only what can be parsed as a const expression. +- Input = (0, stringify! $paren ).0 +- } +- } +- } +- } +-} +diff --git a/toolkit/components/extensions/storage/webext_storage_bridge/Cargo.toml b/toolkit/components/extensions/storage/webext_storage_bridge/Cargo.toml +index a8330748bd61c7a0760ced379ec965267ebd70e0..e467dc9b2f03589ef6428dd10bbb90b918ba877d 100644 +--- a/toolkit/components/extensions/storage/webext_storage_bridge/Cargo.toml ++++ b/toolkit/components/extensions/storage/webext_storage_bridge/Cargo.toml +@@ -7,7 +7,7 @@ edition = "2018" + + [dependencies] + atomic_refcell = "0.1" +-cstr = "0.1" ++cstr = "0.2" + golden_gate = { path = "../../../../../services/sync/golden_gate" } + moz_task = { path = "../../../../../xpcom/rust/moz_task" } + nserror = { path = "../../../../../xpcom/rust/nserror" } +diff --git a/toolkit/components/kvstore/Cargo.toml b/toolkit/components/kvstore/Cargo.toml +index 76c47764bf3c524e0ddf89ec11ce202c870ce7e2..faccb22a437b29fa695ee1a2dc97761f88ba222c 100644 +--- a/toolkit/components/kvstore/Cargo.toml ++++ b/toolkit/components/kvstore/Cargo.toml +@@ -6,7 +6,7 @@ authors = ["Myk Melez "] + [dependencies] + atomic_refcell = "0.1" + crossbeam-utils = "0.6.3" +-cstr = "0.1" ++cstr = "0.2" + lazy_static = "1" + libc = "0.2" + lmdb-rkv = "0.14" +diff --git a/toolkit/components/places/bookmark_sync/Cargo.toml b/toolkit/components/places/bookmark_sync/Cargo.toml +index 80c1c6b20d1094cc091b9ecfc06a03987bb1d5b6..c5a37608ed7df3033c1f490b305521d0c30a959c 100644 +--- a/toolkit/components/places/bookmark_sync/Cargo.toml ++++ b/toolkit/components/places/bookmark_sync/Cargo.toml +@@ -9,7 +9,7 @@ atomic_refcell = "0.1" + dogear = "0.4.0" + libc = "0.2" + log = "0.4" +-cstr = "0.1" ++cstr = "0.2" + moz_task = { path = "../../../../xpcom/rust/moz_task" } + nserror = { path = "../../../../xpcom/rust/nserror" } + nsstring = { path = "../../../../xpcom/rust/nsstring" } +diff --git a/toolkit/components/xulstore/Cargo.toml b/toolkit/components/xulstore/Cargo.toml +index af21706de25a83884b11b702ac36ecb0f46ed13c..279a5b8654d768d27ac8bd82401c478c19c7b02d 100644 +--- a/toolkit/components/xulstore/Cargo.toml ++++ b/toolkit/components/xulstore/Cargo.toml +@@ -6,7 +6,7 @@ license = "MPL-2.0" + + [dependencies] + crossbeam-utils = "0.6.3" +-cstr = "0.1" ++cstr = "0.2" + libc = "0.2" + lmdb-rkv = "0.14" + log = "0.4" diff --git a/rpm/0105-Bug-1655929-run-cargo-update-and-mach-vendor-rust-fo.patch b/rpm/0105-Bug-1655929-run-cargo-update-and-mach-vendor-rust-fo.patch new file mode 100644 index 0000000000000..423f8c4328c64 --- /dev/null +++ b/rpm/0105-Bug-1655929-run-cargo-update-and-mach-vendor-rust-fo.patch @@ -0,0 +1,42642 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nathan Froyd +Date: Thu, 30 Jul 2020 15:54:20 +0000 +Subject: [PATCH] Bug 1655929 - run `cargo update` and `mach vendor rust` for + rlbox + lucet updates; r=firefox-build-system-reviewers,rstewart + +As the commit title suggests, this is a manual update, but we need to also +update `config/rules.mk` for the changed location of the wasi bindings. + +Depends on D85408 + +Differential Revision: https://phabricator.services.mozilla.com/D85409 +--- + Cargo.lock | 63 +- + config/rules.mk | 2 +- + third_party/rust/libc/.cargo-checksum.json | 2 +- + third_party/rust/libc/CONTRIBUTING.md | 15 +- + third_party/rust/libc/Cargo.toml | 14 +- + third_party/rust/libc/LICENSE-MIT | 2 +- + third_party/rust/libc/README.md | 36 +- + third_party/rust/libc/build.rs | 67 +- + third_party/rust/libc/src/cloudabi/mod.rs | 116 +- + third_party/rust/libc/src/fixed_width_ints.rs | 40 +- + third_party/rust/libc/src/fuchsia/align.rs | 2 +- + third_party/rust/libc/src/fuchsia/mod.rs | 1689 +++--- + third_party/rust/libc/src/fuchsia/no_align.rs | 2 +- + third_party/rust/libc/src/hermit/mod.rs | 10 - + third_party/rust/libc/src/lib.rs | 38 +- + third_party/rust/libc/src/macros.rs | 126 +- + third_party/rust/libc/src/psp.rs | 4709 +++++++++++++++++ + third_party/rust/libc/src/switch.rs | 1 - + .../rust/libc/src/unix/bsd/apple/b32/align.rs | 7 + + .../src/unix/bsd/apple/{b32.rs => b32/mod.rs} | 28 +- + .../rust/libc/src/unix/bsd/apple/b64.rs | 102 - + .../rust/libc/src/unix/bsd/apple/b64/align.rs | 7 + + .../rust/libc/src/unix/bsd/apple/b64/mod.rs | 222 + + .../rust/libc/src/unix/bsd/apple/mod.rs | 944 +++- + .../unix/bsd/freebsdlike/dragonfly/errno.rs | 12 + + .../src/unix/bsd/freebsdlike/dragonfly/mod.rs | 111 +- + .../unix/bsd/freebsdlike/freebsd/aarch64.rs | 29 +- + .../src/unix/bsd/freebsdlike/freebsd/arm.rs | 3 + + .../freebsd/freebsd11/{x86_64.rs => b64.rs} | 4 +- + .../bsd/freebsdlike/freebsd/freebsd11/mod.rs | 27 +- + .../freebsd/freebsd12/{x86_64.rs => b64.rs} | 4 +- + .../bsd/freebsdlike/freebsd/freebsd12/mod.rs | 41 +- + .../src/unix/bsd/freebsdlike/freebsd/mod.rs | 538 +- + .../unix/bsd/freebsdlike/freebsd/powerpc64.rs | 3 + + .../src/unix/bsd/freebsdlike/freebsd/x86.rs | 5 +- + .../unix/bsd/freebsdlike/freebsd/x86_64.rs | 17 - + .../bsd/freebsdlike/freebsd/x86_64/align.rs | 197 + + .../bsd/freebsdlike/freebsd/x86_64/mod.rs | 208 + + .../rust/libc/src/unix/bsd/freebsdlike/mod.rs | 686 ++- + third_party/rust/libc/src/unix/bsd/mod.rs | 430 +- + .../rust/libc/src/unix/bsd/netbsdlike/mod.rs | 679 ++- + .../src/unix/bsd/netbsdlike/netbsd/mod.rs | 915 +++- + .../unix/bsd/netbsdlike/openbsd/aarch64.rs | 2 + + .../src/unix/bsd/netbsdlike/openbsd/mod.rs | 480 +- + .../unix/bsd/netbsdlike/openbsd/sparc64.rs | 8 + + .../src/unix/bsd/netbsdlike/openbsd/x86.rs | 2 + + .../src/unix/bsd/netbsdlike/openbsd/x86_64.rs | 2 + + third_party/rust/libc/src/unix/haiku/mod.rs | 813 +-- + third_party/rust/libc/src/unix/hermit/mod.rs | 93 +- + .../src/unix/linux_like/android/b32/arm.rs | 166 + + .../src/unix/linux_like/android/b32/mod.rs | 30 +- + .../unix/linux_like/android/b32/x86/align.rs | 7 + + .../android/b32/{x86.rs => x86/mod.rs} | 167 + + .../linux_like/android/b64/aarch64/align.rs | 29 + + .../b64/{aarch64.rs => aarch64/mod.rs} | 9 +- + .../src/unix/linux_like/android/b64/mod.rs | 14 +- + .../src/unix/linux_like/android/b64/x86_64.rs | 420 -- + .../linux_like/android/b64/x86_64/align.rs | 7 + + .../x86_64.rs => android/b64/x86_64/mod.rs} | 435 +- + .../libc/src/unix/linux_like/android/mod.rs | 970 +++- + .../src/unix/linux_like/emscripten/align.rs | 10 +- + .../src/unix/linux_like/emscripten/mod.rs | 510 +- + .../unix/linux_like/emscripten/no_align.rs | 2 +- + .../libc/src/unix/linux_like/linux/align.rs | 27 +- + .../linux_like/linux/gnu/b32/arm/align.rs | 7 + + .../linux/gnu/b32/{arm.rs => arm/mod.rs} | 35 +- + .../linux_like/linux/gnu/b32/mips/align.rs | 7 + + .../linux/gnu/b32/{mips.rs => mips/mod.rs} | 192 +- + .../src/unix/linux_like/linux/gnu/b32/mod.rs | 27 +- + .../unix/linux_like/linux/gnu/b32/powerpc.rs | 28 +- + .../linux_like/linux/gnu/b32/sparc/align.rs | 7 + + .../linux_like/linux/gnu/b32/sparc/mod.rs | 982 ++++ + .../linux_like/linux/gnu/b32/x86/align.rs | 7 + + .../linux/gnu/b32/{x86.rs => x86/mod.rs} | 56 +- + .../linux_like/linux/gnu/b64/aarch64/align.rs | 29 + + .../gnu/b64/{aarch64.rs => aarch64/mod.rs} | 116 +- + .../linux_like/linux/gnu/b64/mips64/align.rs | 7 + + .../gnu/b64/{mips64.rs => mips64/mod.rs} | 232 +- + .../src/unix/linux_like/linux/gnu/b64/mod.rs | 3 + + .../linux/gnu/b64/powerpc64/align.rs | 7 + + .../b64/{powerpc64.rs => powerpc64/mod.rs} | 57 +- + .../linux_like/linux/gnu/b64/riscv64/mod.rs | 859 +++ + .../unix/linux_like/linux/gnu/b64/s390x.rs | 76 +- + .../linux_like/linux/gnu/b64/sparc64/align.rs | 7 + + .../gnu/b64/{sparc64.rs => sparc64/mod.rs} | 71 +- + .../linux_like/linux/gnu/b64/x86_64/align.rs | 7 + + .../linux_like/linux/gnu/b64/x86_64/mod.rs | 72 +- + .../linux/gnu/b64/x86_64/not_x32.rs | 17 +- + .../libc/src/unix/linux_like/linux/gnu/mod.rs | 721 ++- + .../libc/src/unix/linux_like/linux/mod.rs | 1581 ++++-- + .../linux_like/linux/musl/b32/arm/align.rs | 7 + + .../linux/musl/b32/{arm.rs => arm/mod.rs} | 58 +- + .../unix/linux_like/linux/musl/b32/hexagon.rs | 796 +++ + .../linux_like/linux/musl/b32/mips/align.rs | 7 + + .../linux/musl/b32/{mips.rs => mips/mod.rs} | 228 +- + .../src/unix/linux_like/linux/musl/b32/mod.rs | 6 +- + .../unix/linux_like/linux/musl/b32/powerpc.rs | 31 +- + .../linux_like/linux/musl/b32/x86/align.rs | 7 + + .../linux/musl/b32/{x86.rs => x86/mod.rs} | 65 +- + .../linux/musl/b64/aarch64/align.rs | 7 + + .../musl/b64/{aarch64.rs => aarch64/mod.rs} | 211 +- + .../unix/linux_like/linux/musl/b64/mips64.rs | 775 +++ + .../src/unix/linux_like/linux/musl/b64/mod.rs | 176 +- + .../linux_like/linux/musl/b64/powerpc64.rs | 199 +- + .../linux_like/linux/musl/b64/x86_64/align.rs | 7 + + .../linux_like/linux/musl/b64/x86_64/mod.rs | 983 ++++ + .../src/unix/linux_like/linux/musl/mod.rs | 301 +- + .../src/unix/linux_like/linux/no_align.rs | 19 +- + .../rust/libc/src/unix/linux_like/mod.rs | 459 +- + third_party/rust/libc/src/unix/mod.rs | 1184 +++-- + .../rust/libc/src/unix/newlib/aarch64/mod.rs | 47 + + .../rust/libc/src/unix/newlib/align.rs | 2 +- + .../rust/libc/src/unix/newlib/arm/mod.rs | 49 + + third_party/rust/libc/src/unix/newlib/mod.rs | 225 +- + .../rust/libc/src/unix/newlib/xtensa/mod.rs | 106 + + third_party/rust/libc/src/unix/redox/mod.rs | 917 +++- + .../rust/libc/src/unix/solarish/compat.rs | 40 +- + .../rust/libc/src/unix/solarish/illumos.rs | 33 + + .../rust/libc/src/unix/solarish/mod.rs | 1121 ++-- + .../rust/libc/src/unix/solarish/solaris.rs | 92 + + .../rust/libc/src/unix/uclibc/align.rs | 2 +- + .../rust/libc/src/unix/uclibc/arm/mod.rs | 38 +- + .../libc/src/unix/uclibc/mips/mips32/mod.rs | 220 +- + .../libc/src/unix/uclibc/mips/mips64/mod.rs | 4 +- + .../src/unix/uclibc/mips/mips64/no_align.rs | 1 - + third_party/rust/libc/src/unix/uclibc/mod.rs | 910 ++-- + .../rust/libc/src/unix/uclibc/x86_64/align.rs | 14 +- + .../rust/libc/src/unix/uclibc/x86_64/mod.rs | 20 +- + .../libc/src/unix/uclibc/x86_64/no_align.rs | 12 +- + third_party/rust/libc/src/vxworks/aarch64.rs | 4 + + third_party/rust/libc/src/vxworks/arm.rs | 4 + + third_party/rust/libc/src/vxworks/mod.rs | 2134 ++++++++ + third_party/rust/libc/src/vxworks/powerpc.rs | 4 + + .../rust/libc/src/vxworks/powerpc64.rs | 4 + + third_party/rust/libc/src/vxworks/x86.rs | 4 + + third_party/rust/libc/src/vxworks/x86_64.rs | 4 + + third_party/rust/libc/src/wasi.rs | 818 +-- + third_party/rust/libc/src/windows/gnu.rs | 13 - + .../rust/libc/src/windows/gnu/align.rs | 19 + + third_party/rust/libc/src/windows/gnu/mod.rs | 31 + + third_party/rust/libc/src/windows/mod.rs | 303 +- + third_party/rust/libc/src/windows/msvc.rs | 13 +- + third_party/rust/libc/tests/const_fn.rs | 5 + + third_party/rust/libc/triagebot.toml | 1 + + .../.cargo-checksum.json | 2 +- + .../Cargo.toml | 4 +- + .../src/bindings.rs | 0 + .../src/error.rs | 0 + .../src/functions.rs | 0 + .../src/globals.rs | 0 + .../src/lib.rs | 0 + .../src/linear_memory.rs | 0 + .../src/module.rs | 0 + .../src/module_data.rs | 0 + .../src/runtime.rs | 0 + .../src/signature.rs | 0 + .../src/tables.rs | 0 + .../src/traps.rs | 0 + .../src/types.rs | 0 + .../tests/bindings/bad_bindings.json | 0 + .../tests/bindings/bindings_test.json | 0 + .../tests/bindings/garbage.json | 0 + .../.cargo-checksum.json | 2 +- + .../Cargo.toml | 13 +- + .../build.rs | 0 + .../src/alloc/mod.rs | 0 + .../src/alloc/tests.rs | 0 + .../src/c_api.rs | 0 + .../src/context/context_asm.S | 0 + .../src/context/mod.rs | 0 + .../src/context/tests/c_child.c | 0 + .../src/context/tests/c_child.rs | 0 + .../src/context/tests/mod.rs | 0 + .../src/context/tests/rust_child.rs | 0 + .../src/embed_ctx.rs | 0 + .../src/error.rs | 0 + .../src/hostcall_macros.rs | 0 + .../src/instance.rs | 0 + .../src/instance/siginfo_ext.c | 0 + .../src/instance/siginfo_ext.rs | 0 + .../src/instance/signals.rs | 0 + .../src/instance/state.rs | 0 + .../src/lib.rs | 0 + .../src/module.rs | 0 + .../src/module/dl.rs | 0 + .../src/module/mock.rs | 0 + .../src/module/sparse_page_data.rs | 0 + .../src/region/mmap.rs | 0 + .../src/region/mod.rs | 0 + .../src/sysdeps/linux.rs | 0 + .../src/sysdeps/macos.rs | 0 + .../src/sysdeps/mod.rs | 0 + .../src/test_helpers.rs | 0 + .../src/val.rs | 0 + .../src/vmctx.rs | 0 + .../.cargo-checksum.json | 2 +- + .../Cargo.toml | 8 +- + .../LICENSE | 0 + .../build.rs | 0 + .../include/lucet.h | 0 + .../include/lucet_types.h | 0 + .../include/lucet_val.h | 0 + .../include/lucet_vmctx.h | 0 + .../src/c_api.rs | 0 + .../src/lib.rs | 0 + .../tests/c_api.c | 0 + .../tests/entrypoint.rs | 0 + .../tests/globals.rs | 0 + .../tests/guest_fault.rs | 0 + .../tests/guests/null.c | 0 + .../tests/guests/yield_resume.c | 0 + .../tests/guests/yield_resume_bindings.json | 0 + .../tests/host.rs | 0 + .../tests/instruction_counting.rs | 0 + .../instruction_counting/arithmetic_count.wat | 0 + .../instruction_counting/br_table_count.wat | 0 + .../tests/instruction_counting/calls.wat | 0 + .../instruction_counting/count_after_br.wat | 0 + .../tests/instruction_counting/empty_loop.wat | 0 + .../instruction_counting/empty_loop_2.wat | 0 + .../tests/instruction_counting/if_count.wat | 0 + .../if_not_taken_count.wat | 0 + .../instruction_counting/indirect_calls.wat | 0 + .../tests/instruction_counting/loops.wat | 0 + .../instruction_counting/unreachable_call.wat | 0 + .../tests/memory.rs | 0 + .../tests/stack.rs | 0 + .../tests/start.rs | 0 + .../tests/strcmp.rs | 0 + .../tests/val.rs | 0 + .../.cargo-checksum.json | 2 +- + .../Cargo.toml | 10 +- + .../LICENSE | 0 + .../LICENSE.cloudabi-utils | 0 + .../LICENSE.wasmtime | 0 + .../bindings.json | 0 + .../build.rs | 0 + .../examples/.gitignore | 0 + .../examples/Makefile | 0 + .../examples/README.md | 0 + .../examples/hello.c | 0 + .../examples/pseudoquine.c | 0 + .../include/lucet_wasi.h | 0 + .../src/bindings.rs | 0 + .../src/c_api.rs | 0 + .../src/ctx.rs | 0 + .../src/fdentry.rs | 0 + .../src/host.rs | 0 + .../src/hostcalls/fs.rs | 0 + .../src/hostcalls/fs_helpers.rs | 0 + .../src/hostcalls/misc.rs | 0 + .../src/hostcalls/mod.rs | 0 + .../src/hostcalls/timers.rs | 0 + .../src/lib.rs | 0 + .../src/memory.rs | 0 + .../src/wasi_host.rs | 0 + .../src/wasm32.rs | 0 + .../tests/guests/cant_dotdot.c | 0 + .../tests/guests/clock_getres.c | 0 + .../tests/guests/duplicate_import.wat | 0 + .../tests/guests/exitcode.c | 0 + .../tests/guests/follow_symlink.c | 0 + .../tests/guests/fs.c | 0 + .../tests/guests/getentropy.c | 0 + .../tests/guests/getrusage.c | 0 + .../tests/guests/gettimeofday.c | 0 + .../tests/guests/notdir.c | 0 + .../tests/guests/poll.c | 0 + .../tests/guests/preopen_populates.c | 0 + .../tests/guests/read_file.c | 0 + .../tests/guests/read_file_twice.c | 0 + .../tests/guests/stat.c | 0 + .../tests/guests/stdin.c | 0 + .../tests/guests/symlink_escape.c | 0 + .../tests/guests/symlink_loop.c | 0 + .../tests/guests/write_file.c | 0 + .../tests/test_helpers/mod.rs | 0 + .../tests/tests.rs | 0 + .../rlbox_lucet_sandbox/.cargo-checksum.json | 2 +- + .../rust/rlbox_lucet_sandbox/CMakeLists.txt | 48 +- + .../rust/rlbox_lucet_sandbox/Cargo.toml | 8 +- + .../rust/rlbox_lucet_sandbox/README.md | 20 +- + 282 files changed, 26494 insertions(+), 7933 deletions(-) + create mode 100644 third_party/rust/libc/src/psp.rs + create mode 100644 third_party/rust/libc/src/unix/bsd/apple/b32/align.rs + rename third_party/rust/libc/src/unix/bsd/apple/{b32.rs => b32/mod.rs} (83%) + delete mode 100644 third_party/rust/libc/src/unix/bsd/apple/b64.rs + create mode 100644 third_party/rust/libc/src/unix/bsd/apple/b64/align.rs + create mode 100644 third_party/rust/libc/src/unix/bsd/apple/b64/mod.rs + create mode 100644 third_party/rust/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs + rename third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/{x86_64.rs => b64.rs} (93%) + rename third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/{x86_64.rs => b64.rs} (93%) + delete mode 100644 third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/x86_64.rs + create mode 100644 third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs + create mode 100644 third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs + create mode 100644 third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs + create mode 100644 third_party/rust/libc/src/unix/linux_like/android/b32/x86/align.rs + rename third_party/rust/libc/src/unix/linux_like/android/b32/{x86.rs => x86/mod.rs} (72%) + create mode 100644 third_party/rust/libc/src/unix/linux_like/android/b64/aarch64/align.rs + rename third_party/rust/libc/src/unix/linux_like/android/b64/{aarch64.rs => aarch64/mod.rs} (98%) + delete mode 100644 third_party/rust/libc/src/unix/linux_like/android/b64/x86_64.rs + create mode 100644 third_party/rust/libc/src/unix/linux_like/android/b64/x86_64/align.rs + rename third_party/rust/libc/src/unix/linux_like/{linux/musl/b64/x86_64.rs => android/b64/x86_64/mod.rs} (67%) + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs + rename third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/{arm.rs => arm/mod.rs} (97%) + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs + rename third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/{mips.rs => mips/mod.rs} (87%) + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs + rename third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/{x86.rs => x86/mod.rs} (97%) + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs + rename third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/{aarch64.rs => aarch64/mod.rs} (90%) + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs + rename third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/{mips64.rs => mips64/mod.rs} (86%) + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs + rename third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/{powerpc64.rs => powerpc64/mod.rs} (97%) + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs + rename third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/{sparc64.rs => sparc64/mod.rs} (96%) + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs + rename third_party/rust/libc/src/unix/linux_like/linux/musl/b32/{arm.rs => arm/mod.rs} (96%) + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/musl/b32/hexagon.rs + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs + rename third_party/rust/libc/src/unix/linux_like/linux/musl/b32/{mips.rs => mips/mod.rs} (84%) + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs + rename third_party/rust/libc/src/unix/linux_like/linux/musl/b32/{x86.rs => x86/mod.rs} (96%) + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs + rename third_party/rust/libc/src/unix/linux_like/linux/musl/b64/{aarch64.rs => aarch64/mod.rs} (72%) + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/musl/b64/mips64.rs + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs + create mode 100644 third_party/rust/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs + create mode 100644 third_party/rust/libc/src/unix/newlib/xtensa/mod.rs + create mode 100644 third_party/rust/libc/src/unix/solarish/illumos.rs + create mode 100644 third_party/rust/libc/src/unix/solarish/solaris.rs + create mode 100644 third_party/rust/libc/src/vxworks/aarch64.rs + create mode 100644 third_party/rust/libc/src/vxworks/arm.rs + create mode 100755 third_party/rust/libc/src/vxworks/mod.rs + create mode 100644 third_party/rust/libc/src/vxworks/powerpc.rs + create mode 100644 third_party/rust/libc/src/vxworks/powerpc64.rs + create mode 100644 third_party/rust/libc/src/vxworks/x86.rs + create mode 100644 third_party/rust/libc/src/vxworks/x86_64.rs + delete mode 100644 third_party/rust/libc/src/windows/gnu.rs + create mode 100644 third_party/rust/libc/src/windows/gnu/align.rs + create mode 100644 third_party/rust/libc/src/windows/gnu/mod.rs + create mode 100644 third_party/rust/libc/tests/const_fn.rs + create mode 100644 third_party/rust/libc/triagebot.toml + rename third_party/rust/{lucet-module => lucet-module-wasmsbx}/.cargo-checksum.json (89%) + rename third_party/rust/{lucet-module => lucet-module-wasmsbx}/Cargo.toml (92%) + rename third_party/rust/{lucet-module => lucet-module-wasmsbx}/src/bindings.rs (100%) + rename third_party/rust/{lucet-module => lucet-module-wasmsbx}/src/error.rs (100%) + rename third_party/rust/{lucet-module => lucet-module-wasmsbx}/src/functions.rs (100%) + rename third_party/rust/{lucet-module => lucet-module-wasmsbx}/src/globals.rs (100%) + rename third_party/rust/{lucet-module => lucet-module-wasmsbx}/src/lib.rs (100%) + rename third_party/rust/{lucet-module => lucet-module-wasmsbx}/src/linear_memory.rs (100%) + rename third_party/rust/{lucet-module => lucet-module-wasmsbx}/src/module.rs (100%) + rename third_party/rust/{lucet-module => lucet-module-wasmsbx}/src/module_data.rs (100%) + rename third_party/rust/{lucet-module => lucet-module-wasmsbx}/src/runtime.rs (100%) + rename third_party/rust/{lucet-module => lucet-module-wasmsbx}/src/signature.rs (100%) + rename third_party/rust/{lucet-module => lucet-module-wasmsbx}/src/tables.rs (100%) + rename third_party/rust/{lucet-module => lucet-module-wasmsbx}/src/traps.rs (100%) + rename third_party/rust/{lucet-module => lucet-module-wasmsbx}/src/types.rs (100%) + rename third_party/rust/{lucet-module => lucet-module-wasmsbx}/tests/bindings/bad_bindings.json (100%) + rename third_party/rust/{lucet-module => lucet-module-wasmsbx}/tests/bindings/bindings_test.json (100%) + rename third_party/rust/{lucet-module => lucet-module-wasmsbx}/tests/bindings/garbage.json (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/.cargo-checksum.json (93%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/Cargo.toml (53%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/build.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/alloc/mod.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/alloc/tests.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/c_api.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/context/context_asm.S (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/context/mod.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/context/tests/c_child.c (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/context/tests/c_child.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/context/tests/mod.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/context/tests/rust_child.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/embed_ctx.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/error.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/hostcall_macros.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/instance.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/instance/siginfo_ext.c (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/instance/siginfo_ext.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/instance/signals.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/instance/state.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/lib.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/module.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/module/dl.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/module/mock.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/module/sparse_page_data.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/region/mmap.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/region/mod.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/sysdeps/linux.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/sysdeps/macos.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/sysdeps/mod.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/test_helpers.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/val.rs (100%) + rename third_party/rust/{lucet-runtime-internals => lucet-runtime-internals-wasmsbx}/src/vmctx.rs (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/.cargo-checksum.json (95%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/Cargo.toml (86%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/LICENSE (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/build.rs (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/include/lucet.h (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/include/lucet_types.h (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/include/lucet_val.h (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/include/lucet_vmctx.h (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/src/c_api.rs (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/src/lib.rs (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/c_api.c (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/entrypoint.rs (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/globals.rs (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/guest_fault.rs (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/guests/null.c (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/guests/yield_resume.c (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/guests/yield_resume_bindings.json (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/host.rs (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/instruction_counting.rs (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/instruction_counting/arithmetic_count.wat (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/instruction_counting/br_table_count.wat (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/instruction_counting/calls.wat (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/instruction_counting/count_after_br.wat (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/instruction_counting/empty_loop.wat (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/instruction_counting/empty_loop_2.wat (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/instruction_counting/if_count.wat (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/instruction_counting/if_not_taken_count.wat (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/instruction_counting/indirect_calls.wat (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/instruction_counting/loops.wat (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/instruction_counting/unreachable_call.wat (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/memory.rs (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/stack.rs (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/start.rs (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/strcmp.rs (100%) + rename third_party/rust/{lucet-runtime => lucet-runtime-wasmsbx}/tests/val.rs (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/.cargo-checksum.json (96%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/Cargo.toml (87%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/LICENSE (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/LICENSE.cloudabi-utils (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/LICENSE.wasmtime (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/bindings.json (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/build.rs (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/examples/.gitignore (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/examples/Makefile (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/examples/README.md (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/examples/hello.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/examples/pseudoquine.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/include/lucet_wasi.h (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/src/bindings.rs (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/src/c_api.rs (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/src/ctx.rs (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/src/fdentry.rs (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/src/host.rs (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/src/hostcalls/fs.rs (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/src/hostcalls/fs_helpers.rs (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/src/hostcalls/misc.rs (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/src/hostcalls/mod.rs (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/src/hostcalls/timers.rs (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/src/lib.rs (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/src/memory.rs (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/src/wasi_host.rs (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/src/wasm32.rs (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/cant_dotdot.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/clock_getres.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/duplicate_import.wat (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/exitcode.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/follow_symlink.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/fs.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/getentropy.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/getrusage.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/gettimeofday.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/notdir.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/poll.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/preopen_populates.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/read_file.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/read_file_twice.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/stat.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/stdin.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/symlink_escape.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/symlink_loop.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/guests/write_file.c (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/test_helpers/mod.rs (100%) + rename third_party/rust/{lucet-wasi => lucet-wasi-wasmsbx}/tests/tests.rs (100%) + +diff --git a/Cargo.lock b/Cargo.lock +index f6f9cd165d7a546c911234a22ced9913b1a01cac..dd840a7706b077cf81257d1b0eba57a4da36503c 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -802,7 +802,7 @@ source = "git+https://github.com/bytecodealliance/wasmtime?rev=b7cfd39b531680217 + [[package]] + name = "cranelift-entity" + version = "0.41.0" +-source = "git+https://github.com/PLSysSec/lucet_sandbox_compiler?rev=5e870faf6f95d79d11efc813e56370ad124bbed5#5e870faf6f95d79d11efc813e56370ad124bbed5" ++source = "git+https://github.com/PLSysSec/lucet_sandbox_compiler?rev=6594bb9dfab7e67eb6eb2fefbc66ab7c491ce730#6594bb9dfab7e67eb6eb2fefbc66ab7c491ce730" + + [[package]] + name = "cranelift-entity" +@@ -2525,9 +2525,9 @@ checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" + + [[package]] + name = "libc" +-version = "0.2.59" ++version = "0.2.74" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "3262021842bf00fe07dbd6cf34ff25c99d7a7ebef8deea84db72be3ea3bb0aff" ++checksum = "a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10" + + [[package]] + name = "libdbus-sys" +@@ -2655,9 +2655,9 @@ dependencies = [ + ] + + [[package]] +-name = "lucet-module" ++name = "lucet-module-wasmsbx" + version = "0.1.1" +-source = "git+https://github.com/PLSysSec/lucet_sandbox_compiler?rev=5e870faf6f95d79d11efc813e56370ad124bbed5#5e870faf6f95d79d11efc813e56370ad124bbed5" ++source = "git+https://github.com/PLSysSec/lucet_sandbox_compiler?rev=6594bb9dfab7e67eb6eb2fefbc66ab7c491ce730#6594bb9dfab7e67eb6eb2fefbc66ab7c491ce730" + dependencies = [ + "bincode", + "byteorder", +@@ -2671,33 +2671,19 @@ dependencies = [ + ] + + [[package]] +-name = "lucet-runtime" ++name = "lucet-runtime-internals-wasmsbx" + version = "0.1.1" +-source = "git+https://github.com/PLSysSec/lucet_sandbox_compiler?rev=5e870faf6f95d79d11efc813e56370ad124bbed5#5e870faf6f95d79d11efc813e56370ad124bbed5" +-dependencies = [ +- "cc", +- "libc", +- "lucet-module", +- "lucet-runtime-internals", +- "num-derive", +- "num-traits", +-] +- +-[[package]] +-name = "lucet-runtime-internals" +-version = "0.1.1" +-source = "git+https://github.com/PLSysSec/lucet_sandbox_compiler?rev=5e870faf6f95d79d11efc813e56370ad124bbed5#5e870faf6f95d79d11efc813e56370ad124bbed5" ++source = "git+https://github.com/PLSysSec/lucet_sandbox_compiler?rev=6594bb9dfab7e67eb6eb2fefbc66ab7c491ce730#6594bb9dfab7e67eb6eb2fefbc66ab7c491ce730" + dependencies = [ + "bincode", + "bitflags", + "byteorder", + "cc", + "failure", +- "getrandom", + "lazy_static", + "libc", + "libloading", +- "lucet-module", ++ "lucet-module-wasmsbx", + "memoffset", + "nix", + "num-derive", +@@ -2707,16 +2693,29 @@ dependencies = [ + ] + + [[package]] +-name = "lucet-wasi" ++name = "lucet-runtime-wasmsbx" ++version = "0.1.1" ++source = "git+https://github.com/PLSysSec/lucet_sandbox_compiler?rev=6594bb9dfab7e67eb6eb2fefbc66ab7c491ce730#6594bb9dfab7e67eb6eb2fefbc66ab7c491ce730" ++dependencies = [ ++ "cc", ++ "libc", ++ "lucet-module-wasmsbx", ++ "lucet-runtime-internals-wasmsbx", ++ "num-derive", ++ "num-traits", ++] ++ ++[[package]] ++name = "lucet-wasi-wasmsbx" + version = "0.1.1" +-source = "git+https://github.com/PLSysSec/lucet_sandbox_compiler?rev=5e870faf6f95d79d11efc813e56370ad124bbed5#5e870faf6f95d79d11efc813e56370ad124bbed5" ++source = "git+https://github.com/PLSysSec/lucet_sandbox_compiler?rev=6594bb9dfab7e67eb6eb2fefbc66ab7c491ce730#6594bb9dfab7e67eb6eb2fefbc66ab7c491ce730" + dependencies = [ + "cast", + "failure", + "libc", +- "lucet-module", +- "lucet-runtime", +- "lucet-runtime-internals", ++ "lucet-module-wasmsbx", ++ "lucet-runtime-internals-wasmsbx", ++ "lucet-runtime-wasmsbx", + "mach", + "nix", + "rand", +@@ -4046,14 +4045,14 @@ dependencies = [ + [[package]] + name = "rlbox_lucet_sandbox" + version = "0.1.0" +-source = "git+https://github.com/PLSysSec/rlbox_lucet_sandbox/?rev=d510da5999a744c563b0acd18056069d1698273f#d510da5999a744c563b0acd18056069d1698273f" ++source = "git+https://github.com/PLSysSec/rlbox_lucet_sandbox/?rev=9bf4cdada11b2afd18efae5520bb8d3bb5bbc785#9bf4cdada11b2afd18efae5520bb8d3bb5bbc785" + dependencies = [ + "failure", + "goblin", +- "lucet-module", +- "lucet-runtime", +- "lucet-runtime-internals", +- "lucet-wasi", ++ "lucet-module-wasmsbx", ++ "lucet-runtime-internals-wasmsbx", ++ "lucet-runtime-wasmsbx", ++ "lucet-wasi-wasmsbx", + ] + + [[package]] +diff --git a/config/rules.mk b/config/rules.mk +index a7413bf54e05642ba2e87b28eafcb6dd7059d362..9b3084f314dbcf3f0b5c9f4e3bbe5dc59eb087f9 100644 +--- a/config/rules.mk ++++ b/config/rules.mk +@@ -567,7 +567,7 @@ $(WASM_ARCHIVE): $(CWASMOBJS) $(CPPWASMOBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(GLOB + lucet_options := \ + --target $(LUCETC_TARGET) \ + --target-cpu baseline \ +- --bindings $(topsrcdir)/third_party/rust/lucet-wasi/bindings.json \ ++ --bindings $(topsrcdir)/third_party/rust/lucet-wasi-wasmsbx/bindings.json \ + --guard-size 4GiB \ + --min-reserved-size 4GiB \ + --max-reserved-size 4GiB \ +diff --git a/third_party/rust/libc/.cargo-checksum.json b/third_party/rust/libc/.cargo-checksum.json +index 388e5f13ab75ea53bb684e3c2f85cc314fa1d9d4..48c457fccde0ee8d302ba25a2c2359e9b73e8394 100644 +--- a/third_party/rust/libc/.cargo-checksum.json ++++ b/third_party/rust/libc/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"CONTRIBUTING.md":"abc79e7f6c3eee37e21baca32847b6709c973f4995b32892e80deb56b73c9ac5","Cargo.toml":"c5ee5a1a14138046f4577bbcde920a10705af20d4a75e204fbff67c8e305c701","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"04d4132d1039c1ad753fecdadd0b863bbc4e22dd7bc896db09acd125812f8b4a","build.rs":"d76d691ecfb237401820ac429cd3d2a142cce21dbe55dcf9cfdd0ab2b4ddd675","rustfmt.toml":"8a654d5787585ca8f2c20580737336fc327f411a07b0dbd4870adf6e9bdf624f","src/cloudabi/aarch64.rs":"b8550bf1fd7344972aa4db29441486f39f31482d0327534981dbb75959c29114","src/cloudabi/arm.rs":"c197e2781c2839808bd6fcef219a29705b27b992d3ef920e9cf6ac96e2022bbf","src/cloudabi/mod.rs":"b3ca0393f66ca803246e9b2dbbf9b6caadef2b7b7135412f3d914588b0630295","src/cloudabi/x86.rs":"33eb97f272d2201f3838ae74d444583c7de8f67856852ca375293b20bbd05636","src/cloudabi/x86_64.rs":"400d85d4fe39e26cf2e6ece9ee31c75fe9e88c4bcf4d836ca9f765c05c9c5be3","src/fixed_width_ints.rs":"782b2b2aa6f471f2ebab220456ed681f76980c572f194ec3755ce76f27c8eab6","src/fuchsia/aarch64.rs":"378776a9e40766154a54c94c2a7b4675b5c302a38e6e42da99e67bfbaee60e56","src/fuchsia/align.rs":"9ca6271f2cbb0e6ca3b48ff6898ecee31c89b3c8388ae20be63e457aabad13a5","src/fuchsia/mod.rs":"ce85ffc3da5629701331791d01574fdb824d58d36399cee7bf46118d61dcf935","src/fuchsia/no_align.rs":"56868534e4ed3f94a27ed39c42f01210c8ecfdbafd4e27679860fbc65a2ae8de","src/fuchsia/x86_64.rs":"93a3632b5cf67d2a6bcb7dc0a558605252d5fe689e0f38d8aa2ec5852255ac87","src/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/hermit/mod.rs":"aeda183662787a44c4bd26645cea76f31bf5f7c63d4d59118118c360705fb9eb","src/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/lib.rs":"c3ca7ac0a280e5c64653abc9d6a3591cb6c1a72e72eca18033753ff32828da74","src/macros.rs":"2407f3a2d5e3ae6224457bc793378aa35fc8d57bdc6c3d8024ace0ecbd9782f4","src/sgx.rs":"16a95cdefc81c5ee00d8353a60db363c4cc3e0f75abcd5d0144723f2a306ed1b","src/switch.rs":"6249b9c891f89c74730f70b9f98f2b2c66676e5f2b2ffaddd13b63781f214f3e","src/unix/align.rs":"2cdc7c826ef7ae61f5171c5ae8c445a743d86f1a7f2d9d7e4ceeec56d6874f65","src/unix/bsd/apple/b32.rs":"b2bbdaed9f2006ed6a4a236d5683983307a3c1d229fc8b90dd53afb496ccf422","src/unix/bsd/apple/b64.rs":"dc895aa7d94c9bc6b01a0072708bbf23fceb212fdece0c81ddb73f985d5479e7","src/unix/bsd/apple/mod.rs":"a67aecd837bae176ada09f45b9794f8f440797ac17b5a553e87853f63fd9caa7","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"9dc8beb272712850472b976c2691221fe5ef1846fd301d54ba75f3d56bd5fcd5","src/unix/bsd/freebsdlike/freebsd/aarch64.rs":"e528191e42977fa4c226d8850c47d3e526e951cca46ea9a4a87af40221f79d63","src/unix/bsd/freebsdlike/freebsd/arm.rs":"10fe01bc6269b47da72d1e9f8bdae2fcc7d4f332540e8ce1756e1f58d506bf8c","src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs":"bc9f26d046aa8471228c376fb79afb40936eb0ccf8c5dc2111600f7392ef77b4","src/unix/bsd/freebsdlike/freebsd/freebsd11/x86_64.rs":"deb18ce1991567f02831033cd41aca532277affc2e2d14e2966a9a22eb985679","src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs":"f60c8895fb3e3d656eca41f0ed785b260f15b1c4aa8613a5c2b05e41cde27236","src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs":"06b0355363d14ce7c9e7577b1cefbc12984ca7448f712519f9a29a758934db45","src/unix/bsd/freebsdlike/freebsd/mod.rs":"898a5f20d2c69406744ca5ef73acc13af6b1a07ade8361f659a1eee57eef9442","src/unix/bsd/freebsdlike/freebsd/powerpc64.rs":"125457305b14309cbad4c46fd2fbd54e2f96d37adfec6c89ae9ed8cedfa015bc","src/unix/bsd/freebsdlike/freebsd/x86.rs":"4e0813f01a017dc148262d7c40dfadb964eb7eb6138dc2b0b83d0b51dbe4d467","src/unix/bsd/freebsdlike/freebsd/x86_64.rs":"841c64cda9601ad9b0320f01b2bafbd44cdcdd05ca5b90224f294809adb7d80f","src/unix/bsd/freebsdlike/mod.rs":"9f9262f7ce9e9964dd2cec25bfb468d49b0304c75554a6d20d421ccab7b7d626","src/unix/bsd/mod.rs":"939cd11741b845295b25c5cec3bffd321faa2ac44958a8dfdbf5d4be74331aeb","src/unix/bsd/netbsdlike/mod.rs":"6511a4d2b2a7869fdb55489db126eec89cfc0d8771cab6218319aef3e1be271e","src/unix/bsd/netbsdlike/netbsd/aarch64.rs":"b38fc046f9a40fea28bd26328b96629f4d5d63d7524936bd6af1865d401a8716","src/unix/bsd/netbsdlike/netbsd/arm.rs":"58cdbb70b0d6f536551f0f3bb3725d2d75c4690db12c26c034e7d6ec4a924452","src/unix/bsd/netbsdlike/netbsd/mod.rs":"a3540eab4dbc52e006e84e288bad17e1dae3865fea49020e0ed8b5a7724a9532","src/unix/bsd/netbsdlike/netbsd/powerpc.rs":"ee7ff5d89d0ed22f531237b5059aa669df93a3b5c489fa641465ace8d405bf41","src/unix/bsd/netbsdlike/netbsd/sparc64.rs":"9489f4b3e4566f43bb12dfb92238960613dac7f6a45cc13068a8d152b902d7d9","src/unix/bsd/netbsdlike/netbsd/x86.rs":"20692320e36bfe028d1a34d16fe12ca77aa909cb02bda167376f98f1a09aefe7","src/unix/bsd/netbsdlike/netbsd/x86_64.rs":"135509edeaf3fb3f102d89d51ff1a8f82323497336a8dc7e1f0f23b5c2434b73","src/unix/bsd/netbsdlike/openbsd/aarch64.rs":"ee0057fb97a5e16e46e0f8e4a215f6141b68ea75dd6cb5d53166bee2431082e2","src/unix/bsd/netbsdlike/openbsd/mod.rs":"87534dc98978b4abfce76d16906044d78627919acc7eb8384382828681568fd2","src/unix/bsd/netbsdlike/openbsd/x86.rs":"1201371a662cb3515ebb42676cdca9199da7bf4d7c8f90b56f00db03a9fc61f7","src/unix/bsd/netbsdlike/openbsd/x86_64.rs":"26ef6f50740fad5bb722e0f30025c369c287b2204489682319f7b24fce6de98d","src/unix/haiku/b32.rs":"69ae47fc52c6880e85416b4744500d5655c9ec6131cb737f3b649fceaadce15a","src/unix/haiku/b64.rs":"73e64db09275a8da8d50a13cce2cfa2b136036ddf3a930d2939f337fc995900b","src/unix/haiku/mod.rs":"9b99a40055c53d02c7ab1cf0312a45c246160292819fe0411255f74d048f0171","src/unix/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/unix/hermit/mod.rs":"0e17a9f2bbde2d1b4e83bde0ef39826a25ef357f78dcd7e4671079faa1204799","src/unix/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/unix/linux_like/android/b32/arm.rs":"3625a32c7e58cfe683a53486fbe3d42d4e28f00bea31e19cb46ed2bb0b6a140b","src/unix/linux_like/android/b32/mod.rs":"73c3482a4f3b200a6bc0a6562a281e4fe449488ee9bde1b430f2412ab2e32dc5","src/unix/linux_like/android/b32/x86.rs":"ae2b7f1d6278caddc007749bb1d09ca33f7593478a0fd7fe98b457dae86c7814","src/unix/linux_like/android/b64/aarch64.rs":"37a6ad89617f88f45acbd990281b7557047be9ff4b167c435e9cd5e79859e19f","src/unix/linux_like/android/b64/mod.rs":"07b24a9d22731b44459e0533e6a12ffc72c45e9caee86df5263c44bf32def5ab","src/unix/linux_like/android/b64/x86_64.rs":"a6224d4cb8029eccae1549e602c4fc9847eac09213b4300ca65c6b07e8905397","src/unix/linux_like/android/mod.rs":"c8301ac020d6f02fa797d6f8943bf2a96dc2acb294da007ad0c5ff9ebc9ce320","src/unix/linux_like/emscripten/align.rs":"dee06bccb5f1a58bd498468f204b8f1d8f2c2a536c595d31e730330a79af7ea5","src/unix/linux_like/emscripten/mod.rs":"573a180c604d95e80cc72e5bca8ab5d8bce9298951a3979e22afd7c4edd7c572","src/unix/linux_like/emscripten/no_align.rs":"f3960b1d6ede1f8f9d51407a3de5337d44dd5d954e1a4c2bf0ea11e76f2629da","src/unix/linux_like/linux/align.rs":"85acc1c7e3701d4b1cad1153798022ad8a3a5c9ae9454fb741237cc15e354ac4","src/unix/linux_like/linux/gnu/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/gnu/b32/arm.rs":"5848e7e40d63b0f3ed888e479f441a360d5d707498d08237bb2a1c19ae351c4c","src/unix/linux_like/linux/gnu/b32/mips.rs":"172811216a8f2fd0d8b4b8195dbd7f426c02939355d17c9850f592deef701df2","src/unix/linux_like/linux/gnu/b32/mod.rs":"7f358e0a62cee1d375f212db2bf4f24b6f14011d6429be2d2f5e8ca0adcff05b","src/unix/linux_like/linux/gnu/b32/powerpc.rs":"7975df6a52064979d0be2a6f5e216c411994420650972086e8ac4f5c43abdac1","src/unix/linux_like/linux/gnu/b32/x86.rs":"a24ee8115121d087f31191b77986b01c95c585e4a4ba8d934444739deaa9e3d3","src/unix/linux_like/linux/gnu/b64/aarch64.rs":"302307ed471edbf613126b2183788a8d5c5d578631c213de81862d05881e5124","src/unix/linux_like/linux/gnu/b64/mips64.rs":"39e46439f89a41b3ac58247ed5f9b0071b0556a4432b36c91390518d3624e7b5","src/unix/linux_like/linux/gnu/b64/mod.rs":"71d893473ade2c7d6336d735c573430dc53d0f855970504ca5db7b3db203be8d","src/unix/linux_like/linux/gnu/b64/powerpc64.rs":"90f12954a94f85b6f777ae295d4f81ab05627e9a9a660e019876832ee6fbd6b8","src/unix/linux_like/linux/gnu/b64/s390x.rs":"e56e3779f0903ac20e420dfbe8939a1122853fc659b778bb3b8d37842e475132","src/unix/linux_like/linux/gnu/b64/sparc64.rs":"39edd23b8dd140d953a8fb521cf6f2e5313c0fc2f565a1c207ea53ecab7c5f98","src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs":"855c1288837521b3a01b5920409e92b4e444564424f9e77fa871407bcc140fbf","src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs":"9229b6d912bd89f55b258c53ae52b33dfc263b39bfbc34a660d277be57c2c84e","src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs":"30f88d0fa9e7807ee4cbe89fd274061f810099567d5e68fa829277d7d27ba708","src/unix/linux_like/linux/gnu/mod.rs":"37f26f35cf244facdfe457c5b8d1c39de2b982b73317caab5e608faaff462ad1","src/unix/linux_like/linux/gnu/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/mod.rs":"099620d6f239f12b9824ddb23687138053cce5642fa7d63ef4bcc78b7d48fef5","src/unix/linux_like/linux/musl/b32/arm.rs":"91d26fada3f7845b1ab7e97c26dc80cffa25d3ee2be0c5bff9de1e1cd5d73366","src/unix/linux_like/linux/musl/b32/mips.rs":"916a50db36680be4a88f210d34f95ad1f510c7c9cbdaa56b9de4c49b444c5cf7","src/unix/linux_like/linux/musl/b32/mod.rs":"540928f168f145c136f9dd729ffa12b9d1838d9fe664fc642365d17d7fae648f","src/unix/linux_like/linux/musl/b32/powerpc.rs":"a8e651d67f5baa3033a0ce4d7ccf88c7f86208abd33edb57baf50d7358e2836f","src/unix/linux_like/linux/musl/b32/x86.rs":"4b289b27fa4fefe40265dddc6103c3f4eb93459440ab8058d301b3fbac8d8c17","src/unix/linux_like/linux/musl/b64/aarch64.rs":"64419a1d19338700e0f9a4cb84713a59df95a044026bbf965bb29cc48d889cdf","src/unix/linux_like/linux/musl/b64/mod.rs":"da8c3caff213c322c3aa323b9c7e1b3db1f33e1ee496e789241df6a8a90f975e","src/unix/linux_like/linux/musl/b64/powerpc64.rs":"10dc1809aebd7bde2fcf743153dcbc331257b373e659a9db4e9745cf115e4c7d","src/unix/linux_like/linux/musl/b64/x86_64.rs":"bca197efaa40ac23e7d3fd76c7d33477b70253c6bf5445de0348fd399ffa224e","src/unix/linux_like/linux/musl/mod.rs":"208d5b7183559c69cc4651f9851e993a069ffdbc293d04bc9f110a907118138c","src/unix/linux_like/linux/no_align.rs":"7a1cc536b26c22019d7dab6b6db3a8c9edbb753d3f37a7985c30d8894c2c6b06","src/unix/linux_like/mod.rs":"4a45bcaf295488b972021d91c58443a664fb00284114fc4dd8d885284b1e1faa","src/unix/mod.rs":"6b59a01adfff0f675fedf7c32e718315a67f4ccc1124a9d6a9b05b5f8805931a","src/unix/newlib/aarch64/mod.rs":"c408a990f22fb4292a824f38367e9b517e6e6f8623328397ee631cc88b3d1f7d","src/unix/newlib/align.rs":"04e9b1ac6ca4af24fe5170385249fd64039ebf7f4817c5ceed3a303f3bc8a4aa","src/unix/newlib/arm/mod.rs":"2b6dba2e697ab9b4f4bc4dd5f28057249e9b596d1cb395a9322ec87605c4a5c4","src/unix/newlib/mod.rs":"0fb07669a9bb7849850c4f6507de3b73b34131e3a1cdbac421076c8a60fd11b6","src/unix/newlib/no_align.rs":"7123dcec13604a11b7765c380ff3a4d0da19c39f4b03919de7857723c0cf1502","src/unix/no_align.rs":"c06e95373b9088266e0b14bba0954eef95f93fb2b01d951855e382d22de78e53","src/unix/redox/mod.rs":"33433b660b61979586d2741811dea00606b50bb97aa619bb388631cef1f2280e","src/unix/solarish/compat.rs":"8db2a43eafbd3504e9eb9e8f18416c57d947798871bd45be3e2fb9946e292610","src/unix/solarish/mod.rs":"b715246dd48adf4794e7b6dc2ec166c80561fcae42fa100c62ffca23b624d6fc","src/unix/uclibc/align.rs":"5607180357a9e3d87163e478116b45c7ece391d8366d65ff856cdf3e849452d7","src/unix/uclibc/arm/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/uclibc/arm/mod.rs":"617f087ce7b6244633f8f80ac61cb2f1f4d793ba77b1edb2bfa24f1af470ab94","src/unix/uclibc/arm/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/uclibc/mips/mips32/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/uclibc/mips/mips32/mod.rs":"417a5ab4f9d6fd35bd08396b6e513da7edabf87ac97381f83565bbb1a166f9f6","src/unix/uclibc/mips/mips32/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/uclibc/mips/mips64/align.rs":"a7bdcb18a37a2d91e64d5fad83ea3edc78f5412adb28f77ab077dbb26dd08b2d","src/unix/uclibc/mips/mips64/mod.rs":"03f3bad1c681e6fde4a8ed999ce1d38313166c17d35eded66bd6b4f8387efeb7","src/unix/uclibc/mips/mips64/no_align.rs":"bf11b59caa173a6d94d86f42a8de9c5682f798647fba3a17169214b59ab467fe","src/unix/uclibc/mips/mod.rs":"1054d0bfeb506b3346b9a4148564beced8a22da0d9c9a612101f6237756795fb","src/unix/uclibc/mod.rs":"c0ab7cd511311e03e73bb76245d87ff85ce47e4526d3d44c5de9b005c33d2284","src/unix/uclibc/no_align.rs":"3f28637046524618adaa1012e26cb7ffe94b9396e6b518cccdc69d59f274d709","src/unix/uclibc/x86_64/align.rs":"26e48fc79dbdeee4408ae8e071aa90e1be34ccdf0c135689b805aa4abd568e5e","src/unix/uclibc/x86_64/l4re.rs":"bb31053d6403091e11f95ac2203982f279f8b984a19adf30796878c45fdd8c25","src/unix/uclibc/x86_64/mod.rs":"df78de7e0234192c0559b9820c0034a24d72a0820d361f9aad05a9eac36e80ff","src/unix/uclibc/x86_64/no_align.rs":"b308f7b110caf7405b57186882cfc4804caae49a8287f8ab612ec8548467f2f4","src/unix/uclibc/x86_64/other.rs":"42c3f71e58cabba373f6a55a623f3c31b85049eb64824c09c2b082b3b2d6a0a8","src/wasi.rs":"b1f529dfacc16810926d144ab317634922739b1aff18b7814feba0fc5c770cd6","src/windows/gnu.rs":"4d9033162cc6f7d245256c7b165c1ec18a741771fd9b99a55b421e8d14978599","src/windows/mod.rs":"16d282c830e7ed56c2cecc6affe88ac0597a94e392f295a707fbdf7951f5a723","src/windows/msvc.rs":"8f46cf66883c794175609a3b2bafaa094d0ba63eb6720ef1b84b175603f1074f"},"package":"3262021842bf00fe07dbd6cf34ff25c99d7a7ebef8deea84db72be3ea3bb0aff"} +\ No newline at end of file ++{"files":{"CONTRIBUTING.md":"3a9f0037ad5f1198eada74a9d0363925ef09db664380b0e5a2840f03da260476","Cargo.toml":"128aa804901aaf7c386262cfbba894041bf1b109232d69c3e8b6b01df0a67dd1","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"a8d47ff51ca256f56a8932dba07660672dbfe3004257ca8de708aac1415937a1","README.md":"52f1027a072c02e6e9e1f3d9630ec24e4d57507399c6363afcbcceaa106d152b","build.rs":"ab351d7171b14f8032948e843841ebe8518ed95eb1abf0b1e689700c7cef4bf5","rustfmt.toml":"8a654d5787585ca8f2c20580737336fc327f411a07b0dbd4870adf6e9bdf624f","src/cloudabi/aarch64.rs":"b8550bf1fd7344972aa4db29441486f39f31482d0327534981dbb75959c29114","src/cloudabi/arm.rs":"c197e2781c2839808bd6fcef219a29705b27b992d3ef920e9cf6ac96e2022bbf","src/cloudabi/mod.rs":"d5d4488e8c0b8227f516fe13810f550a2a72af3bdfe769200ad8687c8755bdf6","src/cloudabi/x86.rs":"33eb97f272d2201f3838ae74d444583c7de8f67856852ca375293b20bbd05636","src/cloudabi/x86_64.rs":"400d85d4fe39e26cf2e6ece9ee31c75fe9e88c4bcf4d836ca9f765c05c9c5be3","src/fixed_width_ints.rs":"34c60f12ec5eeb90f13ec3b954427532111c2446e69617616a97aefc1086a9f1","src/fuchsia/aarch64.rs":"378776a9e40766154a54c94c2a7b4675b5c302a38e6e42da99e67bfbaee60e56","src/fuchsia/align.rs":"ae1cf8f011a99737eabeb14ffff768e60f13b13363d7646744dbb0f443dab3d6","src/fuchsia/mod.rs":"61502b3d124759c7c1bae294c1662036a96718fb3bd329cfa2f12e1c61ac10ad","src/fuchsia/no_align.rs":"303f3f1b255e0088b5715094353cf00476131d8e94e6aebb3f469557771c8b8a","src/fuchsia/x86_64.rs":"93a3632b5cf67d2a6bcb7dc0a558605252d5fe689e0f38d8aa2ec5852255ac87","src/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/hermit/mod.rs":"d3bfce41e4463d4be8020a2d063c9bfa8b665f45f1cc6cbf3163f5d01e7cb21f","src/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/lib.rs":"d80f0a2f77d485601a218e0707474245636d8b23fb3d6c65c9dbd4302ea6674b","src/macros.rs":"83aed048c5053300345fca843b148928b91ed444188c479315ff6bcabaa0c4e9","src/psp.rs":"a93741ac38660e548eb41b58df39da39944e5c04280a7b09e0be758e79942549","src/sgx.rs":"16a95cdefc81c5ee00d8353a60db363c4cc3e0f75abcd5d0144723f2a306ed1b","src/switch.rs":"9da3dd39b3de45a7928789926e8572d00e1e11a39e6f7289a1349aadce90edba","src/unix/align.rs":"2cdc7c826ef7ae61f5171c5ae8c445a743d86f1a7f2d9d7e4ceeec56d6874f65","src/unix/bsd/apple/b32/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b32/mod.rs":"6a4ce300da0d2b0db04b18548286603ffe4b47d679a41cf60f1902895894aa1f","src/unix/bsd/apple/b64/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b64/mod.rs":"81254d89be1febc5bb20e787d014a624950d56e2e14973df5bbebfdabc95ae20","src/unix/bsd/apple/mod.rs":"19c8598b72272cc61d7f6a05b7fec78958ce86b11d0f5a655e1e58da0bc2af44","src/unix/bsd/freebsdlike/dragonfly/errno.rs":"ae5e8e6b0f610ec015dfcc2928609037d7ea7b94570c72bcc5bdd588424c6259","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"0e41b6202c7670ce27201095fc1a2826c9e9ccbbc751e97ae1568871ea481a62","src/unix/bsd/freebsdlike/freebsd/aarch64.rs":"14f0bd6693967d4fedec904f7042bd51f2138cb843ec4df18c911b357417cdd2","src/unix/bsd/freebsdlike/freebsd/arm.rs":"59d6a670eea562fb87686e243e0a84603d29a2028a3d4b3f99ccc01bd04d2f47","src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs":"9808d152c1196aa647f1b0f0cf84dac8c930da7d7f897a44975545e3d9d17681","src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs":"16dd3e1a09f123d0aa544b3fd7c123654b4906cac94838fbed7f34a64413c930","src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs":"c6152ce3db241d99e350d34352f3f3d167953ef0ee08bfbe2685cb9ebde2e83b","src/unix/bsd/freebsdlike/freebsd/mod.rs":"1ed8971b7de3b0435341a9af1366493d0458e4a00507dd824c4c11f4ce2006af","src/unix/bsd/freebsdlike/freebsd/powerpc64.rs":"2dae3ecc87eac3b11657aa98915def55fc4b5c0de11fe26aae23329a54628a9a","src/unix/bsd/freebsdlike/freebsd/x86.rs":"c5005e3249eb7c93cfbac72a9e9272320d80ce7983da990ceb05a447f59a02c5","src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs":"0e1f69a88fca1c32874b1daf5db3d446fefbe518dca497f096cc9168c39dde70","src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs":"6132aa0973454379674ea6cbc77e6eace1e1032dd9f38182071388a036f1bc08","src/unix/bsd/freebsdlike/mod.rs":"0046a4083f01ad67511427f1ac37168f31bef3be10c849d304d39f98d61c1267","src/unix/bsd/mod.rs":"4acdbc0148b672fe015ddd7cae952e5d77691df6941a20f8ca40fd996e6a37dd","src/unix/bsd/netbsdlike/mod.rs":"48dd60524119c1e09b255d5472d091e7e7b2b29eab04be51b4b1e740bd022859","src/unix/bsd/netbsdlike/netbsd/aarch64.rs":"b38fc046f9a40fea28bd26328b96629f4d5d63d7524936bd6af1865d401a8716","src/unix/bsd/netbsdlike/netbsd/arm.rs":"58cdbb70b0d6f536551f0f3bb3725d2d75c4690db12c26c034e7d6ec4a924452","src/unix/bsd/netbsdlike/netbsd/mod.rs":"16a9036b6a8b373cdf0576ae99c95430f3f111b6be906a1e1ecff8047e178a86","src/unix/bsd/netbsdlike/netbsd/powerpc.rs":"ee7ff5d89d0ed22f531237b5059aa669df93a3b5c489fa641465ace8d405bf41","src/unix/bsd/netbsdlike/netbsd/sparc64.rs":"9489f4b3e4566f43bb12dfb92238960613dac7f6a45cc13068a8d152b902d7d9","src/unix/bsd/netbsdlike/netbsd/x86.rs":"20692320e36bfe028d1a34d16fe12ca77aa909cb02bda167376f98f1a09aefe7","src/unix/bsd/netbsdlike/netbsd/x86_64.rs":"135509edeaf3fb3f102d89d51ff1a8f82323497336a8dc7e1f0f23b5c2434b73","src/unix/bsd/netbsdlike/openbsd/aarch64.rs":"1dd5449dd1fd3d51e30ffdeeaece91d0aaf05c710e0ac699fecc5461cfa2c28e","src/unix/bsd/netbsdlike/openbsd/mod.rs":"a2938e72d1c6e3f32fb51e896b63abd0d79e1e360dc53f9254fdac82b21206b9","src/unix/bsd/netbsdlike/openbsd/sparc64.rs":"d04fd287afbaa2c5df9d48c94e8374a532a3ba491b424ddf018270c7312f4085","src/unix/bsd/netbsdlike/openbsd/x86.rs":"6f7f5c4fde2a2259eb547890cbd86570cea04ef85347d7569e94e679448bec87","src/unix/bsd/netbsdlike/openbsd/x86_64.rs":"e59b7fd65f68f8e857eec39e0c03bac1d3af6ddc26c9ba58494336b83659bb9b","src/unix/haiku/b32.rs":"69ae47fc52c6880e85416b4744500d5655c9ec6131cb737f3b649fceaadce15a","src/unix/haiku/b64.rs":"73e64db09275a8da8d50a13cce2cfa2b136036ddf3a930d2939f337fc995900b","src/unix/haiku/mod.rs":"29863051c296eeb22e7f00a266d6632b6a886b9a791f128e3c554e96213c3a16","src/unix/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/unix/hermit/mod.rs":"fb7e14d0f46ffaa989b5ab68c85184efe6aa04b5381e46866299b1f3258ddce3","src/unix/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/unix/linux_like/android/b32/arm.rs":"155994121906903a2e0afad895f0b3b7546f6e54d6305a3336ce2c4dfafbfdfa","src/unix/linux_like/android/b32/mod.rs":"0325adf3364fed7157fff5b24fabe1b36d806c39ee04ec82dd29a606d28f91f6","src/unix/linux_like/android/b32/x86/align.rs":"812914e4241df82e32b12375ca3374615dc3a4bdd4cf31f0423c5815320c0dab","src/unix/linux_like/android/b32/x86/mod.rs":"5b1e9fcd77ca5f939acb7fb5f5da12f305b0377698d8b8989feb236e26360aa0","src/unix/linux_like/android/b64/aarch64/align.rs":"2179c3b1608fa4bf68840482bfc2b2fa3ee2faf6fcae3770f9e505cddca35c7b","src/unix/linux_like/android/b64/aarch64/mod.rs":"655116966eb7846b933e5e28b073c329668588cd3c2120cc9ce60c697bd19978","src/unix/linux_like/android/b64/mod.rs":"6a71abfcbbcdae60c916de41cd4688d5f25bdbca83d1d9df49decd56ad726a06","src/unix/linux_like/android/b64/x86_64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/android/b64/x86_64/mod.rs":"e84176d838e663d351450bad218715db1fafbb531e47ea0e262cbb45829dae89","src/unix/linux_like/android/mod.rs":"d414f682fd0d138d440300dc53c6b8b069730e19230dabd4c01173c4578c42b5","src/unix/linux_like/emscripten/align.rs":"86c95cbed7a7161b1f23ee06843e7b0e2340ad92b2cb86fe2a8ef3e0e8c36216","src/unix/linux_like/emscripten/mod.rs":"55fb89f5a965a4ad81ee4d02498c32aaed69e6047ce708c2329a602171862a76","src/unix/linux_like/emscripten/no_align.rs":"0128e4aa721a9902754828b61b5ec7d8a86619983ed1e0544a85d35b1051fad6","src/unix/linux_like/linux/align.rs":"dde648468764a5deef5566b8016290150acf50ee6a0f8c0678cb2078658bc2fa","src/unix/linux_like/linux/gnu/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/gnu/b32/arm/align.rs":"3fed009dc9af3cc81be7087da9d2d7d1f39845e4497e290259c5cdbae25f039d","src/unix/linux_like/linux/gnu/b32/arm/mod.rs":"6d9ba242111c7be8173b7a7b8cf8c863ba23d839edc9d026c0fd37a4b64460b4","src/unix/linux_like/linux/gnu/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/gnu/b32/mips/mod.rs":"e2d2e51fea73210d9705b7eaa37de8baa7152b71ae3a10a316c277345c529b5c","src/unix/linux_like/linux/gnu/b32/mod.rs":"e224551fa50be726bc8a559da32a96294b18743fb5a5b67cdbee4bb6a9eeb796","src/unix/linux_like/linux/gnu/b32/powerpc.rs":"39aae80d2c4ffa845592e16c0a6c910017de19e2b15c1e507c4df10e79ce3e38","src/unix/linux_like/linux/gnu/b32/sparc/align.rs":"21adbed27df73e2d1ed934aaf733a643003d7baf2bde9c48ea440895bcca6d41","src/unix/linux_like/linux/gnu/b32/sparc/mod.rs":"3b4dd40b288788740d2b030171b21f9d0b076ce26d88e0ff62f5d87f09e7c787","src/unix/linux_like/linux/gnu/b32/x86/align.rs":"e4bafdc4a519a7922a81b37a62bbfd1177a2f620890eef8f1fbc47162e9eb413","src/unix/linux_like/linux/gnu/b32/x86/mod.rs":"927d1bd8cb2f053549fc5acfeb1315b7f80b35d7a1904cd76e99651ff32b141e","src/unix/linux_like/linux/gnu/b64/aarch64/align.rs":"2179c3b1608fa4bf68840482bfc2b2fa3ee2faf6fcae3770f9e505cddca35c7b","src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs":"17e9cd23a14bd19700c05a154568fff5897788c0ae151c21dd3bba67aac829d9","src/unix/linux_like/linux/gnu/b64/mips64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/gnu/b64/mips64/mod.rs":"0b5d94f3a2361742b6dd9eb3f543ddf675d3f70dab3402ad179faa6ddaae2218","src/unix/linux_like/linux/gnu/b64/mod.rs":"b90d87f76bff37707a1725551fe45d70d0c106e01b1dbbcd5f60460e0a19b4c3","src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs":"2f279eb268c0aca9a6bd9b4c84139799cd039a64ca1cd2ded68b04c63397be1b","src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs":"bb01828300f02c11c27689522454439d0d02f22d738df88a97367dc87eecf868","src/unix/linux_like/linux/gnu/b64/s390x.rs":"9c449b64b11cbf55d453b324cf9475acb3253f85cb9692f9873b777ed8978ff4","src/unix/linux_like/linux/gnu/b64/sparc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs":"a2667a09e526878683fafa02474f81fbc212d861ceeabade17b0ff4d6d49ff9d","src/unix/linux_like/linux/gnu/b64/x86_64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs":"e6197537739cb8628cad25827081c8bf6b371c02ad4b2132b30b9ae74143b1ef","src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs":"c1862036556262f076eda2008470b8a351b9c371d70664f54387c46890e8cd18","src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs":"30f88d0fa9e7807ee4cbe89fd274061f810099567d5e68fa829277d7d27ba708","src/unix/linux_like/linux/gnu/mod.rs":"c7924db757cf898c78029ad3772e6168ec99dd0dd1534df4132f8fe9717afed7","src/unix/linux_like/linux/gnu/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/mod.rs":"3dc8b1980062117edd7bdfdf2279065737f8cdcdcb883f57f23f27a1d0bbb8b2","src/unix/linux_like/linux/musl/b32/arm/align.rs":"3e8ac052c1043764776b54c93ba4260e061df998631737a897d9d47d54f7b80c","src/unix/linux_like/linux/musl/b32/arm/mod.rs":"45062a178b382ab17341a69d027b5c83325c4e79fecf45729ba9c47b1bcdc3da","src/unix/linux_like/linux/musl/b32/hexagon.rs":"7c6c481f70da1fe6ca759f363784e130041f3d87906c45910fc1142b5ef17970","src/unix/linux_like/linux/musl/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/musl/b32/mips/mod.rs":"9eb0e4953be5afaa0b9e3ac54c85ed40583cfb8cc0b03264b9bc8f763a8f3254","src/unix/linux_like/linux/musl/b32/mod.rs":"8ede3985e6243882814ce91e8ce543e7edbafc0cee5932816072b6f14207a671","src/unix/linux_like/linux/musl/b32/powerpc.rs":"cf286cbf4d2076aaa82662ace2b5c333480410fa59af5cb4542d59f04da84b31","src/unix/linux_like/linux/musl/b32/x86/align.rs":"08e77fbd7435d7dec2ff56932433bece3f02e47ce810f89004a275a86d39cbe1","src/unix/linux_like/linux/musl/b32/x86/mod.rs":"9c3b6e98e7710d6c877a4e31726d36416115a58f53fc469bb173b7fe660b39e5","src/unix/linux_like/linux/musl/b64/aarch64/align.rs":"0bf138f84e5327d8339bcd4adf071a6832b516445e597552c82bbd881095e3a8","src/unix/linux_like/linux/musl/b64/aarch64/mod.rs":"7b3fb85a869e00aae3f6af9c36f82f9c70bf8c2b9cccbd931b923602846ea42c","src/unix/linux_like/linux/musl/b64/mips64.rs":"9d0158ac7a913222d0a62239ec043aa1aee73522a7a1e0e191d0642dde35c083","src/unix/linux_like/linux/musl/b64/mod.rs":"8b76e92a1505ad785d4aa0b7739e0b93647a1e81910949b49cedb6c88468be9c","src/unix/linux_like/linux/musl/b64/powerpc64.rs":"ed9b879bb9cdc526ad83815875edeb4cad4e8829086dfba2578277c265336229","src/unix/linux_like/linux/musl/b64/x86_64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/musl/b64/x86_64/mod.rs":"cfeb109c732ac6bc7d2be44069d3652e917a0509b8b545270b756ff2d52e27e8","src/unix/linux_like/linux/musl/mod.rs":"243e32b93641df7a77f970a32c0fb8e4fd4a13720e54e0e42a9da321fd169798","src/unix/linux_like/linux/no_align.rs":"c81ccd1942295d423b43a55b4aa19633c2096fb93bb381a6a29acb93e85aab07","src/unix/linux_like/mod.rs":"e2d60b008a30f2d866be2da6372fe8390e246572d8344447615155f642016882","src/unix/mod.rs":"3196eb15b4f9fa88839f401ee5a8a06875f7da7f244e73323f3c4ca7fb5007b1","src/unix/newlib/aarch64/mod.rs":"bb269c1468a9676442554600e87417079a787fe6220dfc23b3109639259e8710","src/unix/newlib/align.rs":"28aaf87fafbc6b312622719d472d8cf65f9e5467d15339df5f73e66d8502b28a","src/unix/newlib/arm/mod.rs":"c71be856bfd7f576b2db28af9f680211cbe6c1cac7d537bbc8020b39591af07c","src/unix/newlib/mod.rs":"8ab989db6b21fee81a694c9f9f89014f8e78870d0541368527483c90f07542a7","src/unix/newlib/no_align.rs":"7123dcec13604a11b7765c380ff3a4d0da19c39f4b03919de7857723c0cf1502","src/unix/newlib/xtensa/mod.rs":"4c72003c5e692e648c7e798358c49af6901e68850dbba0624af84c40baf208f5","src/unix/no_align.rs":"c06e95373b9088266e0b14bba0954eef95f93fb2b01d951855e382d22de78e53","src/unix/redox/mod.rs":"89c31827cf348e9a7af387f9e708fc834d04da36cad415d3957d2faa70f2fcbe","src/unix/solarish/compat.rs":"d62a5d3b5bd6adc998cb9bb817a622ef9ec666235bb237bd0f13f8e6a94de576","src/unix/solarish/illumos.rs":"1088c45b238e7d398dbb140d238257d5b5f93aeded98652c3f6747f0c07b4fa7","src/unix/solarish/mod.rs":"ac1d11b1d51649ca1f156d2554951acc2204622bad1e0823cde24328c5fe60aa","src/unix/solarish/solaris.rs":"6000d322ee9f691f38a2cd89b2b8838e51f64c01584143924962b0c598e0985c","src/unix/uclibc/align.rs":"a8540e1cce5913a45bc8d7422b79e86c0b12740e8a679478e0e4d863a31f8cc1","src/unix/uclibc/arm/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/uclibc/arm/mod.rs":"d67dd46bc6f417169fc6a23832bde7ccdafc5d1bcb08b10debdd82edaf75d529","src/unix/uclibc/arm/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/uclibc/mips/mips32/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/uclibc/mips/mips32/mod.rs":"a045ebc6619f540adf670b88a987abd2d6e42e440a552e8cfe9f8c77f397e873","src/unix/uclibc/mips/mips32/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/uclibc/mips/mips64/align.rs":"a7bdcb18a37a2d91e64d5fad83ea3edc78f5412adb28f77ab077dbb26dd08b2d","src/unix/uclibc/mips/mips64/mod.rs":"e3085ba56cfbc528d7c3c55065880603238c333b6047ef51c58177508a487fcd","src/unix/uclibc/mips/mips64/no_align.rs":"4a18e3875698c85229599225ac3401a2a40da87e77b2ad4ef47c6fcd5a24ed30","src/unix/uclibc/mips/mod.rs":"1054d0bfeb506b3346b9a4148564beced8a22da0d9c9a612101f6237756795fb","src/unix/uclibc/mod.rs":"18d6c2628ca458ba75e743bce75bda6614de99606af4e2e62daf2440d2878f18","src/unix/uclibc/no_align.rs":"3f28637046524618adaa1012e26cb7ffe94b9396e6b518cccdc69d59f274d709","src/unix/uclibc/x86_64/align.rs":"4e34cebb7955e9c98ae2f310be6f8ed16a861fc3817c08543867554aeec9524e","src/unix/uclibc/x86_64/l4re.rs":"bb31053d6403091e11f95ac2203982f279f8b984a19adf30796878c45fdd8c25","src/unix/uclibc/x86_64/mod.rs":"188fbaf06a8e23cac72718b1ef7eb4bd98bdfd946aa708151f3f7e3553b65876","src/unix/uclibc/x86_64/no_align.rs":"2ccc0107a6007c70dc49e656095b64a352ca5d8f9f3e65c1dba634effbc15636","src/unix/uclibc/x86_64/other.rs":"42c3f71e58cabba373f6a55a623f3c31b85049eb64824c09c2b082b3b2d6a0a8","src/vxworks/aarch64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/arm.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/mod.rs":"79077f518d234baf6cb76cb742153d174b3ddd43c6eda9238ebb053e08f9f9c7","src/vxworks/powerpc.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/powerpc64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/x86.rs":"552f007f38317620b23889cb7c49d1d115841252439060122f52f434fbc6e5ba","src/vxworks/x86_64.rs":"018d92be3ad628a129eff9f2f5dfbc0883d8b8e5f2fa917b900a7f98ed6b514a","src/wasi.rs":"486a00bafb5b6bf0538c4d984dab021835295c431cb2ceb7a9a74b499f78ade6","src/windows/gnu/align.rs":"b2c13ec1b9f3b39a75c452c80c951dff9d0215e31d77e883b4502afb31794647","src/windows/gnu/mod.rs":"c7ab9793baaa3b6854d25fdf44266b7953533009e4fa722ca717b71d3e5d2c9d","src/windows/mod.rs":"053c4d3d99c6a8b2fba4df0f8c7266cdd9fbbaa6bddc50cd6f747bef1ff59da9","src/windows/msvc.rs":"2c2bfce66027d88021e7289139ebf5b0db258a7b6443f18872c84dbd4ef57131","tests/const_fn.rs":"cb75a1f0864f926aebe79118fc34d51a0d1ade2c20a394e7774c7e545f21f1f4","triagebot.toml":"a135e10c777cd13459559bdf74fb704c1379af7c9b0f70bc49fa6f5a837daa81"},"package":"a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10"} +\ No newline at end of file +diff --git a/third_party/rust/libc/CONTRIBUTING.md b/third_party/rust/libc/CONTRIBUTING.md +index 0e5d0c68b8a80359e3dfe4239219390941add8de..510d760ef848b53d7bcf54257ae69e5e1ac969db 100644 +--- a/third_party/rust/libc/CONTRIBUTING.md ++++ b/third_party/rust/libc/CONTRIBUTING.md +@@ -21,7 +21,7 @@ Consequently, this indicates where an API should be added! Adding an API at a + particular level in the hierarchy means that it is supported on all the child + platforms of that level. For example, when adding a Unix API it should be added + to `src/unix/mod.rs`, but when adding a Linux-only API it should be added to +-`src/unix/notbsd/linux/mod.rs`. ++`src/unix/linux_like/linux/mod.rs`. + + If you're not 100% sure at what level of the hierarchy an API should be added + at, fear not! This crate has CI support which tests any binding against all +@@ -38,9 +38,9 @@ With that in mind, the steps for adding a new API are: + + ### Test before you commit + +-We have two automated tests running on [Travis](https://travis-ci.org/rust-lang/libc): ++We have two automated tests running on [Azure Pipelines](https://dev.azure.com/rust-lang2/libc/_build?definitionId=1&_a=summary): + +-1. [`libc-test`](https://github.com/alexcrichton/ctest) ++1. [`libc-test`](https://github.com/gnzlbg/ctest) + - `cd libc-test && cargo test` + - Use the `skip_*()` functions in `build.rs` if you really need a workaround. + 2. Style checker +@@ -53,14 +53,11 @@ platform in this crate, the next step is to get that sweet, sweet usage from + crates.io! The only next step is to bump the version of libc and then publish + it. If you'd like to get a release out ASAP you can follow these steps: + +-1. Update the version number in `Cargo.toml`, you'll just be bumping the patch +- version number. +-2. Run `cargo update` to regenerate the lockfile to encode your version bump in +- the lock file. You may pull in some other updated dependencies, that's ok. +-3. Send a PR to this repository. It should [look like this][example], but it'd ++1. Increment the patch version number in `Cargo.toml`. ++1. Send a PR to this repository. It should [look like this][example], but it'd + also be nice to fill out the description with a small rationale for the + release (any rationale is ok though!) +-4. Once merged the release will be tagged and published by one of the libc crate ++1. Once merged, the release will be tagged and published by one of the libc crate + maintainers. + + [example]: https://github.com/rust-lang/libc/pull/583 +diff --git a/third_party/rust/libc/Cargo.toml b/third_party/rust/libc/Cargo.toml +index f4bdd81f09a74511b57756fcd0463f11fc25e089..bda221bb0c99b14ec3af4ac164085a0070fc21ee 100644 +--- a/third_party/rust/libc/Cargo.toml ++++ b/third_party/rust/libc/Cargo.toml +@@ -12,10 +12,10 @@ + + [package] + name = "libc" +-version = "0.2.59" ++version = "0.2.74" + authors = ["The Rust Project Developers"] + build = "build.rs" +-exclude = ["/ci/*", "/.travis.yml", "/appveyor.yml"] ++exclude = ["/ci/*", "/azure-pipelines.yml"] + description = "Raw FFI bindings to platform libraries like libc.\n" + homepage = "https://github.com/rust-lang/libc" + documentation = "http://doc.rust-lang.org/libc" +@@ -30,14 +30,16 @@ optional = true + + [features] + align = [] ++const-extern-fn = [] + default = ["std"] + extra_traits = [] + rustc-dep-of-std = ["align", "rustc-std-workspace-core"] + std = [] + use_std = ["std"] +-[badges.appveyor] +-project_name = "rust-lang-libs/libc" +-repository = "rust-lang/libc" ++[badges.azure-devops] ++pipeline = "rust-lang.libc%20(1)" ++project = "rust-lang2/libc" + +-[badges.travis-ci] ++[badges.cirrus-ci] ++branch = "master" + repository = "rust-lang/libc" +diff --git a/third_party/rust/libc/LICENSE-MIT b/third_party/rust/libc/LICENSE-MIT +index 39d4bdb5acd313c1a92dbeaa1c379aaf0596a315..78061811c33c814721530338a9099bccbdd2aaf7 100644 +--- a/third_party/rust/libc/LICENSE-MIT ++++ b/third_party/rust/libc/LICENSE-MIT +@@ -1,4 +1,4 @@ +-Copyright (c) 2014 The Rust Project Developers ++Copyright (c) 2014-2020 The Rust Project Developers + + Permission is hereby granted, free of charge, to any + person obtaining a copy of this software and associated +diff --git a/third_party/rust/libc/README.md b/third_party/rust/libc/README.md +index dc5ff04fccff7f987d0adb19ab19d1ce17c98a92..31bb4e8e18d5d498c4c4c97f79a87cae7d1869a8 100644 +--- a/third_party/rust/libc/README.md ++++ b/third_party/rust/libc/README.md +@@ -1,7 +1,6 @@ +-[![Travis-CI Status]][Travis-CI] [![Appveyor Status]][Appveyor] [![Cirrus-CI Status]][Cirrus-CI] [![Latest Version]][crates.io] [![Documentation]][docs.rs] ![License] ++# libc - Raw FFI bindings to platforms' system libraries + +-libc - Raw FFI bindings to platforms' system libraries +-==== ++[![Azure Status]][Azure] [![Cirrus CI Status]][Cirrus CI] [![Latest Version]][crates.io] [![Documentation]][docs.rs] ![License] + + `libc` provides all of the definitions necessary to easily interoperate with C + code (or "C-like" code) on each of the platforms that Rust supports. This +@@ -35,6 +34,9 @@ libc = "0.2" + * `extra_traits`: all `struct`s implemented in `libc` are `Copy` and `Clone`. + This feature derives `Debug`, `Eq`, `Hash`, and `PartialEq`. + ++* `const-extern-fn`: Changes some `extern fn`s into `const extern fn`s. ++ This features requires a nightly rustc ++ + * **deprecated**: `use_std` is deprecated, and is equivalent to `std`. + + ## Rust version support +@@ -47,9 +49,9 @@ newer Rust features are only available on newer Rust toolchains: + | `union` | 1.19.0 | + | `const mem::size_of` | 1.24.0 | + | `repr(align)` | 1.25.0 | +-| `extra_traits` | 1.25.0 | ++| `extra_traits` | 1.25.0 | + | `core::ffi::c_void` | 1.30.0 | +-| `repr(packed(N))` | 1.33.0 | ++| `repr(packed(N))` | 1.33.0 | + + ## Platform support + +@@ -58,7 +60,7 @@ newer Rust features are only available on newer Rust toolchains: + See + [`ci/build.sh`](https://github.com/rust-lang/libc/blob/master/ci/build.sh) + for the platforms on which `libc` is guaranteed to build for each Rust +-toolchain. The test-matrix at [Travis-CI], [Appveyor], and [Cirrus-CI] show the ++toolchain. The test-matrix at [Azure] and [Cirrus CI] show the + platforms in which `libc` tests are run. + +
+@@ -67,11 +69,11 @@ platforms in which `libc` tests are run. + + This project is licensed under either of + +-* [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) +- ([LICENSE-APACHE](LICENSE-APACHE)) ++* [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0) ++ ([LICENSE-APACHE](https://github.com/rust-lang/libc/blob/master/LICENSE-APACHE)) + +-* [MIT License](http://opensource.org/licenses/MIT) +- ([LICENSE-MIT](LICENSE-MIT)) ++* [MIT License](https://opensource.org/licenses/MIT) ++ ([LICENSE-MIT](https://github.com/rust-lang/libc/blob/master/LICENSE-MIT)) + + at your option. + +@@ -80,23 +82,21 @@ at your option. + We welcome all people who want to contribute. Please see the [contributing + instructions] for more information. + +-[contributing instructions]: CONTRIBUTING.md ++[contributing instructions]: https://github.com/rust-lang/libc/blob/master/CONTRIBUTING.md + + Contributions in any form (issues, pull requests, etc.) to this project + must adhere to Rust's [Code of Conduct]. + +-[Code of Conduct]: https://www.rust-lang.org/en-US/conduct.html ++[Code of Conduct]: https://www.rust-lang.org/policies/code-of-conduct + + Unless you explicitly state otherwise, any contribution intentionally submitted + for inclusion in `libc` by you, as defined in the Apache-2.0 license, shall be + dual licensed as above, without any additional terms or conditions. + +-[Travis-CI]: https://travis-ci.com/rust-lang/libc +-[Travis-CI Status]: https://travis-ci.com/rust-lang/libc.svg?branch=master +-[Appveyor]: https://ci.appveyor.com/project/rust-lang-libs/libc +-[Appveyor Status]: https://ci.appveyor.com/api/projects/status/github/rust-lang/libc?svg=true +-[Cirrus-CI]: https://cirrus-ci.com/github/rust-lang/libc +-[Cirrus-CI Status]: https://api.cirrus-ci.com/github/rust-lang/libc.svg ++[Azure Status]: https://dev.azure.com/rust-lang2/libc/_apis/build/status/rust-lang.libc%20(1)?branchName=master ++[Azure]: https://dev.azure.com/rust-lang2/libc/_build/latest?definitionId=1&branchName=master ++[Cirrus CI]: https://cirrus-ci.com/github/rust-lang/libc ++[Cirrus CI Status]: https://api.cirrus-ci.com/github/rust-lang/libc.svg + [crates.io]: https://crates.io/crates/libc + [Latest Version]: https://img.shields.io/crates/v/libc.svg + [Documentation]: https://docs.rs/libc/badge.svg +diff --git a/third_party/rust/libc/build.rs b/third_party/rust/libc/build.rs +index 845294007409dc180c4f3bcc713cea31c7534fc5..f447c0ef9cd44d542449b7387aae7466f966f11b 100644 +--- a/third_party/rust/libc/build.rs ++++ b/third_party/rust/libc/build.rs +@@ -3,23 +3,39 @@ use std::process::Command; + use std::str; + + fn main() { +- let rustc_minor_ver = +- rustc_minor_version().expect("Failed to get rustc version"); +- let rustc_dep_of_std = +- std::env::var("CARGO_FEATURE_RUSTC_DEP_OF_STD").is_ok(); +- let align_cargo_feature = std::env::var("CARGO_FEATURE_ALIGN").is_ok(); +- +- if std::env::var("CARGO_FEATURE_USE_STD").is_ok() { ++ let (rustc_minor_ver, is_nightly) = ++ rustc_minor_nightly().expect("Failed to get rustc version"); ++ let rustc_dep_of_std = env::var("CARGO_FEATURE_RUSTC_DEP_OF_STD").is_ok(); ++ let align_cargo_feature = env::var("CARGO_FEATURE_ALIGN").is_ok(); ++ let const_extern_fn_cargo_feature = ++ env::var("CARGO_FEATURE_CONST_EXTERN_FN").is_ok(); ++ let libc_ci = env::var("LIBC_CI").is_ok(); ++ ++ if env::var("CARGO_FEATURE_USE_STD").is_ok() { + println!( + "cargo:warning=\"libc's use_std cargo feature is deprecated since libc 0.2.55; \ + please consider using the `std` cargo feature instead\"" + ); + } + +- if std::env::var("LIBC_CI").is_ok() { +- if let Some(12) = which_freebsd() { +- println!("cargo:rustc-cfg=freebsd12"); ++ // The ABI of libc used by libstd is backward compatible with FreeBSD 10. ++ // The ABI of libc from crates.io is backward compatible with FreeBSD 11. ++ // ++ // On CI, we detect the actual FreeBSD version and match its ABI exactly, ++ // running tests to ensure that the ABI is correct. ++ match which_freebsd() { ++ Some(10) if libc_ci || rustc_dep_of_std => { ++ println!("cargo:rustc-cfg=freebsd10") + } ++ Some(11) if libc_ci => println!("cargo:rustc-cfg=freebsd11"), ++ Some(12) if libc_ci => println!("cargo:rustc-cfg=freebsd12"), ++ Some(13) if libc_ci => println!("cargo:rustc-cfg=freebsd13"), ++ Some(_) | None => println!("cargo:rustc-cfg=freebsd11"), ++ } ++ ++ // On CI: deny all warnings ++ if libc_ci { ++ println!("cargo:rustc-cfg=libc_deny_warnings"); + } + + // Rust >= 1.15 supports private module use: +@@ -53,9 +69,21 @@ fn main() { + if rustc_minor_ver >= 33 || rustc_dep_of_std { + println!("cargo:rustc-cfg=libc_packedN"); + } ++ ++ // #[thread_local] is currently unstable ++ if rustc_dep_of_std { ++ println!("cargo:rustc-cfg=libc_thread_local"); ++ } ++ ++ if const_extern_fn_cargo_feature { ++ if !is_nightly || rustc_minor_ver < 40 { ++ panic!("const-extern-fn requires a nightly compiler >= 1.40") ++ } ++ println!("cargo:rustc-cfg=libc_const_extern_fn"); ++ } + } + +-fn rustc_minor_version() -> Option { ++fn rustc_minor_nightly() -> Option<(u32, bool)> { + macro_rules! otry { + ($e:expr) => { + match $e { +@@ -74,7 +102,20 @@ fn rustc_minor_version() -> Option { + return None; + } + +- otry!(pieces.next()).parse().ok() ++ let minor = pieces.next(); ++ ++ // If `rustc` was built from a tarball, its version string ++ // will have neither a git hash nor a commit date ++ // (e.g. "rustc 1.39.0"). Treat this case as non-nightly, ++ // since a nightly build should either come from CI ++ // or a git checkout ++ let nightly_raw = otry!(pieces.next()).split('-').nth(1); ++ let nightly = nightly_raw ++ .map(|raw| raw.starts_with("dev") || raw.starts_with("nightly")) ++ .unwrap_or(false); ++ let minor = otry!(otry!(minor).parse().ok()); ++ ++ Some((minor, nightly)) + } + + fn which_freebsd() -> Option { +@@ -94,8 +135,10 @@ fn which_freebsd() -> Option { + let stdout = stdout.unwrap(); + + match &stdout { ++ s if s.starts_with("10") => Some(10), + s if s.starts_with("11") => Some(11), + s if s.starts_with("12") => Some(12), ++ s if s.starts_with("13") => Some(13), + _ => None, + } + } +diff --git a/third_party/rust/libc/src/cloudabi/mod.rs b/third_party/rust/libc/src/cloudabi/mod.rs +index 0d8696210947e60d7988e466ac6f785c1ac2bb56..77817121d677f72786463c2c9ed3e3943fe18f64 100644 +--- a/third_party/rust/libc/src/cloudabi/mod.rs ++++ b/third_party/rust/libc/src/cloudabi/mod.rs +@@ -115,16 +115,20 @@ pub const SOCK_STREAM: ::c_int = 130; + pub enum FILE {} + impl ::Copy for FILE {} + impl ::Clone for FILE { +- fn clone(&self) -> FILE { *self } ++ fn clone(&self) -> FILE { ++ *self ++ } + } + #[cfg_attr(feature = "extra_traits", derive(Debug))] +-pub enum fpos_t {} // TODO: fill this out with a struct ++pub enum fpos_t {} // FIXME: fill this out with a struct + impl ::Copy for fpos_t {} + impl ::Clone for fpos_t { +- fn clone(&self) -> fpos_t { *self } ++ fn clone(&self) -> fpos_t { ++ *self ++ } + } + +-extern { ++extern "C" { + pub fn isalnum(c: c_int) -> c_int; + pub fn isalpha(c: c_int) -> c_int; + pub fn iscntrl(c: c_int) -> c_int; +@@ -136,31 +140,48 @@ extern { + pub fn isspace(c: c_int) -> c_int; + pub fn isupper(c: c_int) -> c_int; + pub fn isxdigit(c: c_int) -> c_int; ++ pub fn isblank(c: c_int) -> c_int; + pub fn tolower(c: c_int) -> c_int; + pub fn toupper(c: c_int) -> c_int; + pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE; +- pub fn freopen(filename: *const c_char, mode: *const c_char, +- file: *mut FILE) -> *mut FILE; ++ pub fn freopen( ++ filename: *const c_char, ++ mode: *const c_char, ++ file: *mut FILE, ++ ) -> *mut FILE; + pub fn fflush(file: *mut FILE) -> c_int; + pub fn fclose(file: *mut FILE) -> c_int; + pub fn remove(filename: *const c_char) -> c_int; + pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int; + pub fn tmpfile() -> *mut FILE; +- pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, +- size: size_t) -> c_int; ++ pub fn setvbuf( ++ stream: *mut FILE, ++ buffer: *mut c_char, ++ mode: c_int, ++ size: size_t, ++ ) -> c_int; + pub fn setbuf(stream: *mut FILE, buf: *mut c_char); + pub fn getchar() -> c_int; + pub fn putchar(c: c_int) -> c_int; + pub fn fgetc(stream: *mut FILE) -> c_int; +- pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char; ++ pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) ++ -> *mut c_char; + pub fn fputc(c: c_int, stream: *mut FILE) -> c_int; + pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int; + pub fn puts(s: *const c_char) -> c_int; + pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int; +- pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, +- stream: *mut FILE) -> size_t; +- pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, +- stream: *mut FILE) -> size_t; ++ pub fn fread( ++ ptr: *mut c_void, ++ size: size_t, ++ nobj: size_t, ++ stream: *mut FILE, ++ ) -> size_t; ++ pub fn fwrite( ++ ptr: *const c_void, ++ size: size_t, ++ nobj: size_t, ++ stream: *mut FILE, ++ ) -> size_t; + pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int; + pub fn ftell(stream: *mut FILE) -> c_long; + pub fn rewind(stream: *mut FILE); +@@ -171,10 +192,16 @@ extern { + pub fn perror(s: *const c_char); + pub fn atoi(s: *const c_char) -> c_int; + pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double; +- pub fn strtol(s: *const c_char, endp: *mut *mut c_char, +- base: c_int) -> c_long; +- pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, +- base: c_int) -> c_ulong; ++ pub fn strtol( ++ s: *const c_char, ++ endp: *mut *mut c_char, ++ base: c_int, ++ ) -> c_long; ++ pub fn strtoul( ++ s: *const c_char, ++ endp: *mut *mut c_char, ++ base: c_int, ++ ) -> c_ulong; + pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void; + pub fn malloc(size: size_t) -> *mut c_void; + pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void; +@@ -182,17 +209,27 @@ extern { + pub fn abort() -> !; + pub fn exit(status: c_int) -> !; + pub fn _exit(status: c_int) -> !; +- pub fn atexit(cb: extern fn()) -> c_int; ++ pub fn atexit(cb: extern "C" fn()) -> c_int; + pub fn system(s: *const c_char) -> c_int; + pub fn getenv(s: *const c_char) -> *mut c_char; +- pub fn getline (lineptr: *mut *mut c_char, n: *mut size_t, +- stream: *mut FILE) -> ssize_t; ++ pub fn getline( ++ lineptr: *mut *mut c_char, ++ n: *mut size_t, ++ stream: *mut FILE, ++ ) -> ssize_t; + + pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char; +- pub fn strncpy(dst: *mut c_char, src: *const c_char, +- n: size_t) -> *mut c_char; ++ pub fn strncpy( ++ dst: *mut c_char, ++ src: *const c_char, ++ n: size_t, ++ ) -> *mut c_char; + pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char; +- pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char; ++ pub fn strncat( ++ s: *mut c_char, ++ ct: *const c_char, ++ n: size_t, ++ ) -> *mut c_char; + pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int; + pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int; + pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int; +@@ -204,23 +241,36 @@ extern { + pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int; +- pub fn strncasecmp(s1: *const c_char, s2: *const c_char, +- n: size_t) -> c_int; ++ pub fn strncasecmp( ++ s1: *const c_char, ++ s2: *const c_char, ++ n: size_t, ++ ) -> c_int; + pub fn strlen(cs: *const c_char) -> size_t; + pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t; + pub fn strerror(n: c_int) -> *mut c_char; + pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; + pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; + pub fn wcslen(buf: *const wchar_t) -> size_t; +- pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, +- n: size_t) -> ::size_t; ++ pub fn wcstombs( ++ dest: *mut c_char, ++ src: *const wchar_t, ++ n: size_t, ++ ) -> ::size_t; + + pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; ++ pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t; + pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int; +- pub fn memcpy(dest: *mut c_void, src: *const c_void, +- n: size_t) -> *mut c_void; +- pub fn memmove(dest: *mut c_void, src: *const c_void, +- n: size_t) -> *mut c_void; ++ pub fn memcpy( ++ dest: *mut c_void, ++ src: *const c_void, ++ n: size_t, ++ ) -> *mut c_void; ++ pub fn memmove( ++ dest: *mut c_void, ++ src: *const c_void, ++ n: size_t, ++ ) -> *mut c_void; + pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void; + + pub fn abs(i: c_int) -> c_int; +@@ -259,7 +309,7 @@ extern { + pub fn pthread_create( + native: *mut ::pthread_t, + attr: *const ::pthread_attr_t, +- f: extern fn(*mut ::c_void) -> *mut ::c_void, ++ f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, + value: *mut ::c_void, + ) -> ::c_int; + pub fn pthread_detach(thread: ::pthread_t) -> ::c_int; +@@ -270,7 +320,7 @@ extern { + ) -> ::c_int; + pub fn pthread_key_create( + key: *mut pthread_key_t, +- dtor: ::Option, ++ dtor: ::Option, + ) -> ::c_int; + pub fn pthread_key_delete(key: pthread_key_t) -> ::c_int; + pub fn pthread_setspecific( +diff --git a/third_party/rust/libc/src/fixed_width_ints.rs b/third_party/rust/libc/src/fixed_width_ints.rs +index 0c25d28b366f89e7c5a96a0a867108fe152b22c1..014640855fa309d78eb864d5a9755b243c3d27c5 100644 +--- a/third_party/rust/libc/src/fixed_width_ints.rs ++++ b/third_party/rust/libc/src/fixed_width_ints.rs +@@ -2,43 +2,19 @@ + //! + //! These aliases are deprecated: use the Rust types instead. + +-#[deprecated( +- since = "0.2.55", +- note = "Use i8 instead." +-)] ++#[deprecated(since = "0.2.55", note = "Use i8 instead.")] + pub type int8_t = i8; +-#[deprecated( +- since = "0.2.55", +- note = "Use i16 instead." +-)] ++#[deprecated(since = "0.2.55", note = "Use i16 instead.")] + pub type int16_t = i16; +-#[deprecated( +- since = "0.2.55", +- note = "Use i32 instead." +-)] ++#[deprecated(since = "0.2.55", note = "Use i32 instead.")] + pub type int32_t = i32; +-#[deprecated( +- since = "0.2.55", +- note = "Use i64 instead." +-)] ++#[deprecated(since = "0.2.55", note = "Use i64 instead.")] + pub type int64_t = i64; +-#[deprecated( +- since = "0.2.55", +- note = "Use u8 instead." +-)] ++#[deprecated(since = "0.2.55", note = "Use u8 instead.")] + pub type uint8_t = u8; +-#[deprecated( +- since = "0.2.55", +- note = "Use u16 instead." +-)] ++#[deprecated(since = "0.2.55", note = "Use u16 instead.")] + pub type uint16_t = u16; +-#[deprecated( +- since = "0.2.55", +- note = "Use u32 instead." +-)] ++#[deprecated(since = "0.2.55", note = "Use u32 instead.")] + pub type uint32_t = u32; +-#[deprecated( +- since = "0.2.55", +- note = "Use u64 instead." +-)] ++#[deprecated(since = "0.2.55", note = "Use u64 instead.")] + pub type uint64_t = u64; +diff --git a/third_party/rust/libc/src/fuchsia/align.rs b/third_party/rust/libc/src/fuchsia/align.rs +index bc972751926f1aeb0c0a44d1c79012dd799cf2eb..3409bf0c6195534cb6ed020153270851e32f458f 100644 +--- a/third_party/rust/libc/src/fuchsia/align.rs ++++ b/third_party/rust/libc/src/fuchsia/align.rs +@@ -138,5 +138,5 @@ macro_rules! expand_align { + } + } + } +- } ++ }; + } +diff --git a/third_party/rust/libc/src/fuchsia/mod.rs b/third_party/rust/libc/src/fuchsia/mod.rs +index f2f9844298a5a06ebd847f168c93dd90ef5c23f1..b3ff29f1e562e5de7d17050d3e188f912e71d47c 100644 +--- a/third_party/rust/libc/src/fuchsia/mod.rs ++++ b/third_party/rust/libc/src/fuchsia/mod.rs +@@ -95,20 +95,26 @@ pub type c_ulong = u64; + pub enum timezone {} + impl ::Copy for timezone {} + impl ::Clone for timezone { +- fn clone(&self) -> timezone { *self } ++ fn clone(&self) -> timezone { ++ *self ++ } + } + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub enum DIR {} + impl ::Copy for DIR {} + impl ::Clone for DIR { +- fn clone(&self) -> DIR { *self } ++ fn clone(&self) -> DIR { ++ *self ++ } + } + + #[cfg_attr(feature = "extra_traits", derive(Debug))] +-pub enum fpos64_t {} // TODO: fill this out with a struct ++pub enum fpos64_t {} // FIXME: fill this out with a struct + impl ::Copy for fpos64_t {} + impl ::Clone for fpos64_t { +- fn clone(&self) -> fpos64_t { *self } ++ fn clone(&self) -> fpos64_t { ++ *self ++ } + } + + // PUB_STRUCT +@@ -1261,7 +1267,8 @@ cfg_if! { + self.sigev_value == other.sigev_value + && self.sigev_signo == other.sigev_signo + && self.sigev_notify == other.sigev_notify +- && self.sigev_notify_function == other.sigev_notify_function ++ && self.sigev_notify_function ++ == other.sigev_notify_function + && self.sigev_notify_attributes + == other.sigev_notify_attributes + } +@@ -1409,7 +1416,7 @@ pub const F_SEAL_SHRINK: ::c_int = 0x0002; + pub const F_SEAL_GROW: ::c_int = 0x0004; + pub const F_SEAL_WRITE: ::c_int = 0x0008; + +-// TODO(#235): Include file sealing fcntls once we have a way to verify them. ++// FIXME(#235): Include file sealing fcntls once we have a way to verify them. + + pub const SIGTRAP: ::c_int = 5; + +@@ -1426,10 +1433,8 @@ pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = 6; + pub const CLOCK_BOOTTIME: ::clockid_t = 7; + pub const CLOCK_REALTIME_ALARM: ::clockid_t = 8; + pub const CLOCK_BOOTTIME_ALARM: ::clockid_t = 9; +-// TODO(#247) Someday our Travis shall have glibc 2.21 (released in Sep +-// 2014.) See also musl/mod.rs +-// pub const CLOCK_SGI_CYCLE: ::clockid_t = 10; +-// pub const CLOCK_TAI: ::clockid_t = 11; ++pub const CLOCK_SGI_CYCLE: ::clockid_t = 10; ++pub const CLOCK_TAI: ::clockid_t = 11; + pub const TIMER_ABSTIME: ::c_int = 1; + + pub const RLIMIT_CPU: ::c_int = 0; +@@ -1502,12 +1507,12 @@ pub const LC_COLLATE: ::c_int = 3; + pub const LC_MONETARY: ::c_int = 4; + pub const LC_MESSAGES: ::c_int = 5; + pub const LC_ALL: ::c_int = 6; +-pub const LC_CTYPE_MASK: ::c_int = (1 << LC_CTYPE); +-pub const LC_NUMERIC_MASK: ::c_int = (1 << LC_NUMERIC); +-pub const LC_TIME_MASK: ::c_int = (1 << LC_TIME); +-pub const LC_COLLATE_MASK: ::c_int = (1 << LC_COLLATE); +-pub const LC_MONETARY_MASK: ::c_int = (1 << LC_MONETARY); +-pub const LC_MESSAGES_MASK: ::c_int = (1 << LC_MESSAGES); ++pub const LC_CTYPE_MASK: ::c_int = 1 << LC_CTYPE; ++pub const LC_NUMERIC_MASK: ::c_int = 1 << LC_NUMERIC; ++pub const LC_TIME_MASK: ::c_int = 1 << LC_TIME; ++pub const LC_COLLATE_MASK: ::c_int = 1 << LC_COLLATE; ++pub const LC_MONETARY_MASK: ::c_int = 1 << LC_MONETARY; ++pub const LC_MESSAGES_MASK: ::c_int = 1 << LC_MESSAGES; + // LC_ALL_MASK defined per platform + + pub const MAP_FILE: ::c_int = 0x0000; +@@ -1853,13 +1858,13 @@ pub const TCOON: ::c_int = 1; + pub const TCIFLUSH: ::c_int = 0; + pub const TCOFLUSH: ::c_int = 1; + pub const TCIOFLUSH: ::c_int = 2; +-pub const NL0: ::c_int = 0x00000000; +-pub const NL1: ::c_int = 0x00000100; ++pub const NL0: ::c_int = 0x00000000; ++pub const NL1: ::c_int = 0x00000100; + pub const TAB0: ::c_int = 0x00000000; +-pub const CR0: ::c_int = 0x00000000; +-pub const FF0: ::c_int = 0x00000000; +-pub const BS0: ::c_int = 0x00000000; +-pub const VT0: ::c_int = 0x00000000; ++pub const CR0: ::c_int = 0x00000000; ++pub const FF0: ::c_int = 0x00000000; ++pub const BS0: ::c_int = 0x00000000; ++pub const VT0: ::c_int = 0x00000000; + pub const VERASE: usize = 2; + pub const VKILL: usize = 3; + pub const VINTR: usize = 0; +@@ -1880,11 +1885,11 @@ pub const OPOST: ::tcflag_t = 0x1; + pub const CS5: ::tcflag_t = 0x00000000; + pub const CRTSCTS: ::tcflag_t = 0x80000000; + pub const ECHO: ::tcflag_t = 0x00000008; +-pub const OCRNL: ::tcflag_t = 0o000010; +-pub const ONOCR: ::tcflag_t = 0o000020; ++pub const OCRNL: ::tcflag_t = 0o000010; ++pub const ONOCR: ::tcflag_t = 0o000020; + pub const ONLRET: ::tcflag_t = 0o000040; +-pub const OFILL: ::tcflag_t = 0o000100; +-pub const OFDEL: ::tcflag_t = 0o000200; ++pub const OFILL: ::tcflag_t = 0o000100; ++pub const OFDEL: ::tcflag_t = 0o000200; + + pub const CLONE_VM: ::c_int = 0x100; + pub const CLONE_FS: ::c_int = 0x200; +@@ -1961,6 +1966,7 @@ pub const POSIX_FADV_WILLNEED: ::c_int = 3; + pub const AT_FDCWD: ::c_int = -100; + pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x100; + pub const AT_REMOVEDIR: ::c_int = 0x200; ++pub const AT_EACCESS: ::c_int = 0x200; + pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400; + pub const AT_NO_AUTOMOUNT: ::c_int = 0x800; + pub const AT_EMPTY_PATH: ::c_int = 0x1000; +@@ -2649,7 +2655,7 @@ pub const SFD_CLOEXEC: ::c_int = 0x080000; + + pub const NCCS: usize = 32; + +-pub const O_TRUNC: ::c_int = 0x00040000; ++pub const O_TRUNC: ::c_int = 0x00040000; + pub const O_NOATIME: ::c_int = 0x00002000; + pub const O_CLOEXEC: ::c_int = 0x00000100; + pub const O_TMPFILE: ::c_int = 0x00004000; +@@ -2684,7 +2690,7 @@ pub const FOPEN_MAX: ::c_uint = 1000; + pub const O_PATH: ::c_int = 0x00400000; + pub const O_EXEC: ::c_int = O_PATH; + pub const O_SEARCH: ::c_int = O_PATH; +-pub const O_ACCMODE: ::c_int = (03 | O_SEARCH); ++pub const O_ACCMODE: ::c_int = 03 | O_SEARCH; + pub const O_NDELAY: ::c_int = O_NONBLOCK; + pub const NI_MAXHOST: ::socklen_t = 255; + pub const PTHREAD_STACK_MIN: ::size_t = 2048; +@@ -2766,11 +2772,6 @@ pub const TIOCINQ: ::c_int = ::FIONREAD; + pub const RTLD_GLOBAL: ::c_int = 0x100; + pub const RTLD_NOLOAD: ::c_int = 0x4; + +-// TODO(#247) Temporarily musl-specific (available since musl 0.9.12 / Linux +-// kernel 3.10). See also notbsd/mod.rs +-pub const CLOCK_SGI_CYCLE: ::clockid_t = 10; +-pub const CLOCK_TAI: ::clockid_t = 11; +- + pub const MCL_CURRENT: ::c_int = 0x0001; + pub const MCL_FUTURE: ::c_int = 0x0002; + +@@ -2778,12 +2779,12 @@ 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 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; +@@ -2817,14 +2818,14 @@ pub const NOFLSH: ::tcflag_t = 0x00000080; + pub const CIBAUD: ::tcflag_t = 0o02003600000; + pub const CBAUDEX: ::tcflag_t = 0o010000; + pub const VSWTC: usize = 7; +-pub const OLCUC: ::tcflag_t = 0o000002; +-pub const NLDLY: ::tcflag_t = 0o000400; +-pub const CRDLY: ::tcflag_t = 0o003000; ++pub const OLCUC: ::tcflag_t = 0o000002; ++pub const NLDLY: ::tcflag_t = 0o000400; ++pub const CRDLY: ::tcflag_t = 0o003000; + pub const TABDLY: ::tcflag_t = 0o014000; +-pub const BSDLY: ::tcflag_t = 0o020000; +-pub const FFDLY: ::tcflag_t = 0o100000; +-pub const VTDLY: ::tcflag_t = 0o040000; +-pub const XTABS: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const XTABS: ::tcflag_t = 0o014000; + + pub const B0: ::speed_t = 0o000000; + pub const B50: ::speed_t = 0o000001; +@@ -2882,13 +2883,13 @@ pub const RLIMIT_NPROC: ::c_int = 6; + pub const RLIMIT_MEMLOCK: ::c_int = 8; + + pub const O_APPEND: ::c_int = 0x00100000; +-pub const O_CREAT: ::c_int = 0x00010000; +-pub const O_EXCL: ::c_int = 0x00020000; ++pub const O_CREAT: ::c_int = 0x00010000; ++pub const O_EXCL: ::c_int = 0x00020000; + pub const O_NOCTTY: ::c_int = 0x00000200; + pub const O_NONBLOCK: ::c_int = 0x00000010; +-pub const O_SYNC: ::c_int = (0x00000040 | O_DSYNC); +-pub const O_RSYNC: ::c_int = O_SYNC; +-pub const O_DSYNC: ::c_int = 0x00000020; ++pub const O_SYNC: ::c_int = 0x00000040 | O_DSYNC; ++pub const O_RSYNC: ::c_int = O_SYNC; ++pub const O_DSYNC: ::c_int = 0x00000020; + + pub const SOCK_NONBLOCK: ::c_int = 2048; + +@@ -3113,9 +3114,9 @@ pub const TIOCM_CD: ::c_int = TIOCM_CAR; + pub const TIOCM_RI: ::c_int = TIOCM_RNG; + + pub const O_DIRECTORY: ::c_int = 0x00080000; +-pub const O_DIRECT: ::c_int = 0x00000800; ++pub const O_DIRECT: ::c_int = 0x00000800; + pub const O_LARGEFILE: ::c_int = 0x00001000; +-pub const O_NOFOLLOW: ::c_int = 0x00000080; ++pub const O_NOFOLLOW: ::c_int = 0x00000080; + + // intentionally not public, only used for fd_set + cfg_if! { +@@ -3249,28 +3250,87 @@ f! { + dev |= (minor & 0xffffff00) << 12; + dev + } ++ ++ pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar { ++ cmsg.offset(1) as *mut c_uchar ++ } ++ ++ pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) ++ -> *mut cmsghdr ++ { ++ if ((*cmsg).cmsg_len as ::size_t) < ::mem::size_of::() { ++ 0 as *mut cmsghdr ++ } else if __CMSG_NEXT(cmsg).add(::mem::size_of::()) ++ >= __MHDR_END(mhdr) { ++ 0 as *mut cmsghdr ++ } else { ++ __CMSG_NEXT(cmsg).cast() ++ } ++ } ++ ++ pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { ++ if (*mhdr).msg_controllen as ::size_t >= ::mem::size_of::() { ++ (*mhdr).msg_control.cast() ++ } else { ++ 0 as *mut cmsghdr ++ } ++ } ++ ++ pub fn CMSG_ALIGN(len: ::size_t) -> ::size_t { ++ (len + ::mem::size_of::<::size_t>() - 1) ++ & !(::mem::size_of::<::size_t>() - 1) ++ } ++ ++ pub fn CMSG_SPACE(len: ::c_uint) -> ::c_uint { ++ (CMSG_ALIGN(len as ::size_t) + CMSG_ALIGN(::mem::size_of::())) ++ as ::c_uint ++ } ++ ++ pub fn CMSG_LEN(len: ::c_uint) -> ::c_uint { ++ (CMSG_ALIGN(::mem::size_of::()) + len as ::size_t) as ::c_uint ++ } ++} ++ ++fn __CMSG_LEN(cmsg: *const cmsghdr) -> ::ssize_t { ++ ((unsafe { (*cmsg).cmsg_len as ::size_t } + ::mem::size_of::<::c_long>() ++ - 1) ++ & !(::mem::size_of::<::c_long>() - 1)) as ::ssize_t ++} ++ ++fn __CMSG_NEXT(cmsg: *const cmsghdr) -> *mut c_uchar { ++ (unsafe { cmsg.offset(__CMSG_LEN(cmsg)) }) as *mut c_uchar ++} ++ ++fn __MHDR_END(mhdr: *const msghdr) -> *mut c_uchar { ++ unsafe { ++ (*mhdr).msg_control.offset((*mhdr).msg_controllen as isize) ++ }.cast() + } + + // EXTERN_FN + + #[link(name = "c")] + #[link(name = "fdio")] +-extern {} ++extern "C" {} + + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub enum FILE {} + impl ::Copy for FILE {} + impl ::Clone for FILE { +- fn clone(&self) -> FILE { *self } ++ fn clone(&self) -> FILE { ++ *self ++ } + } + #[cfg_attr(feature = "extra_traits", derive(Debug))] +-pub enum fpos_t {} // TODO: fill this out with a struct ++pub enum fpos_t {} // FIXME: fill this out with a struct + impl ::Copy for fpos_t {} + impl ::Clone for fpos_t { +- fn clone(&self) -> fpos_t { *self } ++ fn clone(&self) -> fpos_t { ++ *self ++ } + } + +-extern { ++extern "C" { + pub fn isalnum(c: c_int) -> c_int; + pub fn isalpha(c: c_int) -> c_int; + pub fn iscntrl(c: c_int) -> c_int; +@@ -3282,31 +3342,48 @@ extern { + pub fn isspace(c: c_int) -> c_int; + pub fn isupper(c: c_int) -> c_int; + pub fn isxdigit(c: c_int) -> c_int; ++ pub fn isblank(c: c_int) -> c_int; + pub fn tolower(c: c_int) -> c_int; + pub fn toupper(c: c_int) -> c_int; + pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE; +- pub fn freopen(filename: *const c_char, mode: *const c_char, +- file: *mut FILE) -> *mut FILE; ++ pub fn freopen( ++ filename: *const c_char, ++ mode: *const c_char, ++ file: *mut FILE, ++ ) -> *mut FILE; + pub fn fflush(file: *mut FILE) -> c_int; + pub fn fclose(file: *mut FILE) -> c_int; + pub fn remove(filename: *const c_char) -> c_int; + pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int; + pub fn tmpfile() -> *mut FILE; +- pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, +- size: size_t) -> c_int; ++ pub fn setvbuf( ++ stream: *mut FILE, ++ buffer: *mut c_char, ++ mode: c_int, ++ size: size_t, ++ ) -> c_int; + pub fn setbuf(stream: *mut FILE, buf: *mut c_char); + pub fn getchar() -> c_int; + pub fn putchar(c: c_int) -> c_int; + pub fn fgetc(stream: *mut FILE) -> c_int; +- pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char; ++ pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) ++ -> *mut c_char; + pub fn fputc(c: c_int, stream: *mut FILE) -> c_int; + pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int; + pub fn puts(s: *const c_char) -> c_int; + pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int; +- pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, +- stream: *mut FILE) -> size_t; +- pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, +- stream: *mut FILE) -> size_t; ++ pub fn fread( ++ ptr: *mut c_void, ++ size: size_t, ++ nobj: size_t, ++ stream: *mut FILE, ++ ) -> size_t; ++ pub fn fwrite( ++ ptr: *const c_void, ++ size: size_t, ++ nobj: size_t, ++ stream: *mut FILE, ++ ) -> size_t; + pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int; + pub fn ftell(stream: *mut FILE) -> c_long; + pub fn rewind(stream: *mut FILE); +@@ -3317,10 +3394,16 @@ extern { + pub fn perror(s: *const c_char); + pub fn atoi(s: *const c_char) -> c_int; + pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double; +- pub fn strtol(s: *const c_char, endp: *mut *mut c_char, +- base: c_int) -> c_long; +- pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, +- base: c_int) -> c_ulong; ++ pub fn strtol( ++ s: *const c_char, ++ endp: *mut *mut c_char, ++ base: c_int, ++ ) -> c_long; ++ pub fn strtoul( ++ s: *const c_char, ++ endp: *mut *mut c_char, ++ base: c_int, ++ ) -> c_ulong; + pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void; + pub fn malloc(size: size_t) -> *mut c_void; + pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void; +@@ -3328,16 +3411,22 @@ extern { + pub fn abort() -> !; + pub fn exit(status: c_int) -> !; + pub fn _exit(status: c_int) -> !; +- pub fn atexit(cb: extern fn()) -> c_int; ++ pub fn atexit(cb: extern "C" fn()) -> c_int; + pub fn system(s: *const c_char) -> c_int; + pub fn getenv(s: *const c_char) -> *mut c_char; + + pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char; +- pub fn strncpy(dst: *mut c_char, src: *const c_char, +- n: size_t) -> *mut c_char; ++ pub fn strncpy( ++ dst: *mut c_char, ++ src: *const c_char, ++ n: size_t, ++ ) -> *mut c_char; + pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char; +- pub fn strncat(s: *mut c_char, ct: *const c_char, +- n: size_t) -> *mut c_char; ++ pub fn strncat( ++ s: *mut c_char, ++ ct: *const c_char, ++ n: size_t, ++ ) -> *mut c_char; + pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int; + pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int; + pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int; +@@ -3354,15 +3443,25 @@ extern { + pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; + pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; + pub fn wcslen(buf: *const wchar_t) -> size_t; +- pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, +- n: size_t) -> ::size_t; ++ pub fn wcstombs( ++ dest: *mut c_char, ++ src: *const wchar_t, ++ n: size_t, ++ ) -> ::size_t; + + pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; ++ pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t; + pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int; +- pub fn memcpy(dest: *mut c_void, src: *const c_void, +- n: size_t) -> *mut c_void; +- pub fn memmove(dest: *mut c_void, src: *const c_void, +- n: size_t) -> *mut c_void; ++ pub fn memcpy( ++ dest: *mut c_void, ++ src: *const c_void, ++ n: size_t, ++ ) -> *mut c_void; ++ pub fn memmove( ++ dest: *mut c_void, ++ src: *const c_void, ++ n: size_t, ++ ) -> *mut c_void; + pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void; + + pub fn abs(i: c_int) -> c_int; +@@ -3374,36 +3473,73 @@ extern { + pub fn getpwnam(name: *const ::c_char) -> *mut passwd; + pub fn getpwuid(uid: ::uid_t) -> *mut passwd; + +- pub fn fprintf(stream: *mut ::FILE, +- format: *const ::c_char, ...) -> ::c_int; ++ pub fn fprintf( ++ stream: *mut ::FILE, ++ 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 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 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 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; + + pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int; +- pub fn connect(socket: ::c_int, address: *const sockaddr, +- len: socklen_t) -> ::c_int; ++ pub fn connect( ++ socket: ::c_int, ++ address: *const sockaddr, ++ len: socklen_t, ++ ) -> ::c_int; + pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int; +- pub fn accept(socket: ::c_int, address: *mut sockaddr, +- address_len: *mut socklen_t) -> ::c_int; +- pub fn getpeername(socket: ::c_int, address: *mut sockaddr, +- address_len: *mut socklen_t) -> ::c_int; +- pub fn getsockname(socket: ::c_int, address: *mut sockaddr, +- address_len: *mut socklen_t) -> ::c_int; +- pub fn setsockopt(socket: ::c_int, level: ::c_int, name: ::c_int, +- value: *const ::c_void, +- option_len: socklen_t) -> ::c_int; +- pub fn socketpair(domain: ::c_int, type_: ::c_int, protocol: ::c_int, +- socket_vector: *mut ::c_int) -> ::c_int; +- pub fn sendto(socket: ::c_int, buf: *const ::c_void, len: ::size_t, +- flags: ::c_int, addr: *const sockaddr, +- addrlen: socklen_t) -> ::ssize_t; ++ pub fn accept( ++ socket: ::c_int, ++ address: *mut sockaddr, ++ address_len: *mut socklen_t, ++ ) -> ::c_int; ++ pub fn getpeername( ++ socket: ::c_int, ++ address: *mut sockaddr, ++ address_len: *mut socklen_t, ++ ) -> ::c_int; ++ pub fn getsockname( ++ socket: ::c_int, ++ address: *mut sockaddr, ++ address_len: *mut socklen_t, ++ ) -> ::c_int; ++ pub fn setsockopt( ++ socket: ::c_int, ++ level: ::c_int, ++ name: ::c_int, ++ value: *const ::c_void, ++ option_len: socklen_t, ++ ) -> ::c_int; ++ pub fn socketpair( ++ domain: ::c_int, ++ type_: ::c_int, ++ protocol: ::c_int, ++ socket_vector: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn sendto( ++ socket: ::c_int, ++ buf: *const ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ addr: *const sockaddr, ++ addrlen: socklen_t, ++ ) -> ::ssize_t; + pub fn shutdown(socket: ::c_int, how: ::c_int) -> ::c_int; + + pub fn chmod(path: *const c_char, mode: mode_t) -> ::c_int; +@@ -3425,73 +3561,114 @@ extern { + + pub fn opendir(dirname: *const c_char) -> *mut ::DIR; + pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent; +- pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent, +- result: *mut *mut ::dirent) -> ::c_int; ++ pub fn readdir_r( ++ dirp: *mut ::DIR, ++ entry: *mut ::dirent, ++ result: *mut *mut ::dirent, ++ ) -> ::c_int; + pub fn closedir(dirp: *mut ::DIR) -> ::c_int; + pub fn rewinddir(dirp: *mut ::DIR); + +- pub fn openat(dirfd: ::c_int, pathname: *const ::c_char, +- 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 fchown(fd: ::c_int, +- owner: ::uid_t, +- group: ::gid_t) -> ::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 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 openat( ++ dirfd: ::c_int, ++ pathname: *const ::c_char, ++ 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 fchown(fd: ::c_int, owner: ::uid_t, group: ::gid_t) -> ::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 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 access(path: *const c_char, amode: ::c_int) -> ::c_int; + pub fn alarm(seconds: ::c_uint) -> ::c_uint; + pub fn chdir(dir: *const c_char) -> ::c_int; +- pub fn fchdir(dirfd: ::c_int) -> ::c_int; +- pub fn chown(path: *const c_char, uid: uid_t, +- gid: gid_t) -> ::c_int; +- pub fn lchown(path: *const c_char, uid: uid_t, +- gid: gid_t) -> ::c_int; ++ pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int; ++ pub fn lchown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int; + pub fn close(fd: ::c_int) -> ::c_int; + pub fn dup(fd: ::c_int) -> ::c_int; + pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int; +- pub fn execl(path: *const c_char, +- arg0: *const c_char, ...) -> ::c_int; +- pub fn execle(path: *const ::c_char, +- arg0: *const ::c_char, ...) -> ::c_int; +- pub fn execlp(file: *const ::c_char, +- arg0: *const ::c_char, ...) -> ::c_int; +- pub fn execv(prog: *const c_char, +- argv: *const *const c_char) -> ::c_int; +- pub fn execve(prog: *const c_char, argv: *const *const c_char, +- envp: *const *const c_char) +- -> ::c_int; +- pub fn execvp(c: *const c_char, +- argv: *const *const c_char) -> ::c_int; ++ pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> ::c_int; ++ pub fn execle( ++ path: *const ::c_char, ++ arg0: *const ::c_char, ++ ... ++ ) -> ::c_int; ++ pub fn execlp( ++ file: *const ::c_char, ++ arg0: *const ::c_char, ++ ... ++ ) -> ::c_int; ++ pub fn execv(prog: *const c_char, argv: *const *const c_char) -> ::c_int; ++ pub fn execve( ++ prog: *const c_char, ++ argv: *const *const c_char, ++ envp: *const *const c_char, ++ ) -> ::c_int; ++ pub fn execvp(c: *const c_char, argv: *const *const c_char) -> ::c_int; + pub fn fork() -> pid_t; + pub fn fpathconf(filedes: ::c_int, name: ::c_int) -> c_long; + pub fn getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char; + pub fn getegid() -> gid_t; + pub fn geteuid() -> uid_t; + pub fn getgid() -> gid_t; +- pub fn getgroups(ngroups_max: ::c_int, groups: *mut gid_t) +- -> ::c_int; ++ pub fn getgroups(ngroups_max: ::c_int, groups: *mut gid_t) -> ::c_int; + pub fn getlogin() -> *mut c_char; +- pub fn getopt(argc: ::c_int, argv: *const *mut c_char, +- optstr: *const c_char) -> ::c_int; ++ pub fn getopt( ++ argc: ::c_int, ++ argv: *const *mut c_char, ++ optstr: *const c_char, ++ ) -> ::c_int; + pub fn getpgid(pid: pid_t) -> pid_t; + pub fn getpgrp() -> pid_t; + pub fn getpid() -> pid_t; +@@ -3503,11 +3680,13 @@ extern { + pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long; + pub fn pause() -> ::c_int; + pub fn pipe(fds: *mut ::c_int) -> ::c_int; +- pub fn posix_memalign(memptr: *mut *mut ::c_void, +- align: ::size_t, +- size: ::size_t) -> ::c_int; ++ pub fn posix_memalign( ++ memptr: *mut *mut ::c_void, ++ align: ::size_t, ++ size: ::size_t, ++ ) -> ::c_int; + pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) +- -> ::ssize_t; ++ -> ::ssize_t; + pub fn rmdir(path: *const c_char) -> ::c_int; + pub fn seteuid(uid: uid_t) -> ::c_int; + pub fn setegid(gid: gid_t) -> ::c_int; +@@ -3516,21 +3695,34 @@ extern { + pub fn setsid() -> pid_t; + pub fn setuid(uid: uid_t) -> ::c_int; + pub fn sleep(secs: ::c_uint) -> ::c_uint; +- pub fn nanosleep(rqtp: *const timespec, +- rmtp: *mut timespec) -> ::c_int; ++ 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; + pub fn wait(status: *mut ::c_int) -> pid_t; +- pub fn waitpid(pid: pid_t, status: *mut ::c_int, options: ::c_int) +- -> pid_t; +- pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) +- -> ::ssize_t; +- pub fn pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, +- offset: off_t) -> ::ssize_t; +- pub fn pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, +- offset: off_t) -> ::ssize_t; ++ pub fn waitpid( ++ pid: pid_t, ++ status: *mut ::c_int, ++ options: ::c_int, ++ ) -> pid_t; ++ pub fn write( ++ fd: ::c_int, ++ buf: *const ::c_void, ++ count: ::size_t, ++ ) -> ::ssize_t; ++ pub fn pread( ++ fd: ::c_int, ++ buf: *mut ::c_void, ++ count: ::size_t, ++ offset: off_t, ++ ) -> ::ssize_t; ++ pub fn pwrite( ++ fd: ::c_int, ++ buf: *const ::c_void, ++ count: ::size_t, ++ offset: off_t, ++ ) -> ::ssize_t; + pub fn umask(mask: mode_t) -> mode_t; + + pub fn utime(file: *const c_char, buf: *const utimbuf) -> ::c_int; +@@ -3542,128 +3734,167 @@ extern { + pub fn mlockall(flags: ::c_int) -> ::c_int; + pub fn munlockall() -> ::c_int; + +- pub fn mmap(addr: *mut ::c_void, +- len: ::size_t, +- prot: ::c_int, +- flags: ::c_int, +- fd: ::c_int, +- offset: off_t) +- -> *mut ::c_void; ++ pub fn mmap( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ prot: ::c_int, ++ flags: ::c_int, ++ fd: ::c_int, ++ offset: off_t, ++ ) -> *mut ::c_void; + pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int; + + pub fn if_nametoindex(ifname: *const c_char) -> ::c_uint; +- pub fn if_indextoname(ifindex: ::c_uint, +- ifname: *mut ::c_char) -> *mut ::c_char; ++ pub fn if_indextoname( ++ ifindex: ::c_uint, ++ ifname: *mut ::c_char, ++ ) -> *mut ::c_char; + + pub fn lstat(path: *const c_char, buf: *mut stat) -> ::c_int; + + pub fn fsync(fd: ::c_int) -> ::c_int; + +- pub fn setenv(name: *const c_char, val: *const c_char, +- overwrite: ::c_int) -> ::c_int; ++ pub fn setenv( ++ name: *const c_char, ++ val: *const c_char, ++ overwrite: ::c_int, ++ ) -> ::c_int; + pub fn unsetenv(name: *const c_char) -> ::c_int; + +- pub fn symlink(path1: *const c_char, +- path2: *const c_char) -> ::c_int; ++ pub fn symlink(path1: *const c_char, path2: *const c_char) -> ::c_int; + + pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int; + + pub fn signal(signum: ::c_int, handler: sighandler_t) -> sighandler_t; + +- pub fn getrlimit(resource: ::c_int, rlim: *mut rlimit) -> ::c_int; +- pub fn setrlimit(resource: ::c_int, rlim: *const rlimit) -> ::c_int; +- pub fn getrusage(resource: ::c_int, usage: *mut rusage) -> ::c_int; +- +- pub fn realpath(pathname: *const ::c_char, resolved: *mut ::c_char) +- -> *mut ::c_char; ++ pub fn realpath( ++ pathname: *const ::c_char, ++ resolved: *mut ::c_char, ++ ) -> *mut ::c_char; + + pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int; + +- pub fn gettimeofday(tp: *mut ::timeval, +- tz: *mut ::c_void) -> ::c_int; ++ pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; + pub fn times(buf: *mut ::tms) -> ::clock_t; + + pub fn pthread_self() -> ::pthread_t; +- pub fn pthread_join(native: ::pthread_t, +- value: *mut *mut ::c_void) -> ::c_int; +- pub fn pthread_exit(value: *mut ::c_void); ++ pub fn pthread_join( ++ native: ::pthread_t, ++ value: *mut *mut ::c_void, ++ ) -> ::c_int; ++ pub fn pthread_exit(value: *mut ::c_void) -> !; + pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int; + pub fn pthread_attr_destroy(attr: *mut ::pthread_attr_t) -> ::c_int; +- pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, +- stack_size: ::size_t) -> ::c_int; +- pub fn pthread_attr_setdetachstate(attr: *mut ::pthread_attr_t, +- state: ::c_int) -> ::c_int; ++ pub fn pthread_attr_setstacksize( ++ attr: *mut ::pthread_attr_t, ++ stack_size: ::size_t, ++ ) -> ::c_int; ++ pub fn pthread_attr_setdetachstate( ++ attr: *mut ::pthread_attr_t, ++ state: ::c_int, ++ ) -> ::c_int; + pub fn pthread_detach(thread: ::pthread_t) -> ::c_int; + pub fn sched_yield() -> ::c_int; +- pub fn pthread_key_create(key: *mut pthread_key_t, +- dtor: ::Option) +- -> ::c_int; ++ pub fn pthread_key_create( ++ key: *mut pthread_key_t, ++ dtor: ::Option, ++ ) -> ::c_int; + pub fn pthread_key_delete(key: pthread_key_t) -> ::c_int; + pub fn pthread_getspecific(key: pthread_key_t) -> *mut ::c_void; +- pub fn pthread_setspecific(key: pthread_key_t, value: *const ::c_void) +- -> ::c_int; +- pub fn pthread_mutex_init(lock: *mut pthread_mutex_t, +- attr: *const pthread_mutexattr_t) -> ::c_int; ++ pub fn pthread_setspecific( ++ key: pthread_key_t, ++ value: *const ::c_void, ++ ) -> ::c_int; ++ pub fn pthread_mutex_init( ++ lock: *mut pthread_mutex_t, ++ attr: *const pthread_mutexattr_t, ++ ) -> ::c_int; + pub fn pthread_mutex_destroy(lock: *mut pthread_mutex_t) -> ::c_int; + pub fn pthread_mutex_lock(lock: *mut pthread_mutex_t) -> ::c_int; + pub fn pthread_mutex_trylock(lock: *mut pthread_mutex_t) -> ::c_int; + pub fn pthread_mutex_unlock(lock: *mut pthread_mutex_t) -> ::c_int; + + pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> ::c_int; +- pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> ::c_int; +- pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, +- _type: ::c_int) -> ::c_int; +- +- pub fn pthread_cond_init(cond: *mut pthread_cond_t, +- attr: *const pthread_condattr_t) -> ::c_int; +- pub fn pthread_cond_wait(cond: *mut pthread_cond_t, +- lock: *mut pthread_mutex_t) -> ::c_int; +- pub fn pthread_cond_timedwait(cond: *mut pthread_cond_t, +- lock: *mut pthread_mutex_t, +- abstime: *const ::timespec) -> ::c_int; ++ pub fn pthread_mutexattr_destroy( ++ attr: *mut pthread_mutexattr_t, ++ ) -> ::c_int; ++ pub fn pthread_mutexattr_settype( ++ attr: *mut pthread_mutexattr_t, ++ _type: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn pthread_cond_init( ++ cond: *mut pthread_cond_t, ++ attr: *const pthread_condattr_t, ++ ) -> ::c_int; ++ pub fn pthread_cond_wait( ++ cond: *mut pthread_cond_t, ++ lock: *mut pthread_mutex_t, ++ ) -> ::c_int; ++ pub fn pthread_cond_timedwait( ++ cond: *mut pthread_cond_t, ++ lock: *mut pthread_mutex_t, ++ abstime: *const ::timespec, ++ ) -> ::c_int; + pub fn pthread_cond_signal(cond: *mut pthread_cond_t) -> ::c_int; + pub fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> ::c_int; + pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> ::c_int; + pub fn pthread_condattr_init(attr: *mut pthread_condattr_t) -> ::c_int; + pub fn pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> ::c_int; +- pub fn pthread_rwlock_init(lock: *mut pthread_rwlock_t, +- attr: *const pthread_rwlockattr_t) -> ::c_int; ++ pub fn pthread_rwlock_init( ++ lock: *mut pthread_rwlock_t, ++ attr: *const pthread_rwlockattr_t, ++ ) -> ::c_int; + pub fn pthread_rwlock_destroy(lock: *mut pthread_rwlock_t) -> ::c_int; + pub fn pthread_rwlock_rdlock(lock: *mut pthread_rwlock_t) -> ::c_int; + pub fn pthread_rwlock_tryrdlock(lock: *mut pthread_rwlock_t) -> ::c_int; + pub fn pthread_rwlock_wrlock(lock: *mut pthread_rwlock_t) -> ::c_int; + pub fn pthread_rwlock_trywrlock(lock: *mut pthread_rwlock_t) -> ::c_int; + pub fn pthread_rwlock_unlock(lock: *mut pthread_rwlock_t) -> ::c_int; +- pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) -> ::c_int; +- pub fn pthread_rwlockattr_destroy(attr: *mut pthread_rwlockattr_t) +- -> ::c_int; +- pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, +- buflen: ::size_t) -> ::c_int; +- +- pub fn getsockopt(sockfd: ::c_int, +- level: ::c_int, +- optname: ::c_int, +- optval: *mut ::c_void, +- optlen: *mut ::socklen_t) -> ::c_int; ++ pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) ++ -> ::c_int; ++ pub fn pthread_rwlockattr_destroy( ++ attr: *mut pthread_rwlockattr_t, ++ ) -> ::c_int; ++ pub fn strerror_r( ++ errnum: ::c_int, ++ buf: *mut c_char, ++ buflen: ::size_t, ++ ) -> ::c_int; ++ ++ pub fn getsockopt( ++ sockfd: ::c_int, ++ level: ::c_int, ++ optname: ::c_int, ++ optval: *mut ::c_void, ++ optlen: *mut ::socklen_t, ++ ) -> ::c_int; + pub fn raise(signum: ::c_int) -> ::c_int; +- pub fn sigaction(signum: ::c_int, +- act: *const sigaction, +- oldact: *mut sigaction) -> ::c_int; +- +- pub fn utimes(filename: *const ::c_char, +- times: *const ::timeval) -> ::c_int; +- pub fn dlopen(filename: *const ::c_char, +- flag: ::c_int) -> *mut ::c_void; ++ pub fn sigaction( ++ signum: ::c_int, ++ act: *const sigaction, ++ oldact: *mut sigaction, ++ ) -> ::c_int; ++ ++ pub fn utimes( ++ filename: *const ::c_char, ++ times: *const ::timeval, ++ ) -> ::c_int; ++ pub fn dlopen(filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void; + pub fn dlerror() -> *mut ::c_char; +- pub fn dlsym(handle: *mut ::c_void, +- symbol: *const ::c_char) -> *mut ::c_void; ++ pub fn dlsym( ++ handle: *mut ::c_void, ++ symbol: *const ::c_char, ++ ) -> *mut ::c_void; + pub fn dlclose(handle: *mut ::c_void) -> ::c_int; + pub fn dladdr(addr: *const ::c_void, info: *mut Dl_info) -> ::c_int; + +- pub fn getaddrinfo(node: *const c_char, +- service: *const c_char, +- hints: *const addrinfo, +- res: *mut *mut addrinfo) -> ::c_int; ++ pub fn getaddrinfo( ++ node: *const c_char, ++ service: *const c_char, ++ hints: *const addrinfo, ++ res: *mut *mut addrinfo, ++ ) -> ::c_int; + pub fn freeaddrinfo(res: *mut addrinfo); + pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char; + pub fn res_init() -> ::c_int; +@@ -3675,46 +3906,64 @@ extern { + pub fn gmtime(time_p: *const time_t) -> *mut tm; + pub fn localtime(time_p: *const time_t) -> *mut tm; + +- pub fn mknod(pathname: *const ::c_char, mode: ::mode_t, +- dev: ::dev_t) -> ::c_int; ++ pub fn mknod( ++ pathname: *const ::c_char, ++ mode: ::mode_t, ++ dev: ::dev_t, ++ ) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; + pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int; +- pub fn getservbyname(name: *const ::c_char, +- proto: *const ::c_char) -> *mut servent; ++ pub fn getservbyname( ++ name: *const ::c_char, ++ proto: *const ::c_char, ++ ) -> *mut servent; + pub fn getprotobyname(name: *const ::c_char) -> *mut protoent; + pub fn getprotobynumber(proto: ::c_int) -> *mut protoent; +- pub fn chroot(name: *const ::c_char) -> ::c_int; + pub fn usleep(secs: ::c_uint) -> ::c_int; +- pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, +- flags: ::c_int) -> ::ssize_t; +- pub fn recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, +- flags: ::c_int) -> ::ssize_t; ++ pub fn send( ++ socket: ::c_int, ++ buf: *const ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ pub fn recv( ++ socket: ::c_int, ++ buf: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ ) -> ::ssize_t; + pub fn putenv(string: *mut c_char) -> ::c_int; + pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int; +- pub fn select(nfds: ::c_int, +- readfs: *mut fd_set, +- writefds: *mut fd_set, +- errorfds: *mut fd_set, +- timeout: *mut timeval) -> ::c_int; +- pub fn setlocale(category: ::c_int, +- locale: *const ::c_char) -> *mut ::c_char; ++ pub fn select( ++ nfds: ::c_int, ++ readfs: *mut fd_set, ++ writefds: *mut fd_set, ++ errorfds: *mut fd_set, ++ timeout: *mut timeval, ++ ) -> ::c_int; ++ pub fn setlocale( ++ category: ::c_int, ++ locale: *const ::c_char, ++ ) -> *mut ::c_char; + pub fn localeconv() -> *mut lconv; + + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; + pub fn sem_wait(sem: *mut sem_t) -> ::c_int; + pub fn sem_trywait(sem: *mut sem_t) -> ::c_int; + pub fn sem_post(sem: *mut sem_t) -> ::c_int; +- pub fn sem_init(sem: *mut sem_t, +- pshared: ::c_int, +- value: ::c_uint) +- -> ::c_int; ++ pub fn sem_init( ++ sem: *mut sem_t, ++ pshared: ::c_int, ++ value: ::c_uint, ++ ) -> ::c_int; + pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> ::c_int; + pub fn fstatvfs(fd: ::c_int, buf: *mut statvfs) -> ::c_int; + +- pub fn readlink(path: *const c_char, +- buf: *mut c_char, +- bufsz: ::size_t) +- -> ::ssize_t; ++ pub fn readlink( ++ path: *const c_char, ++ buf: *mut c_char, ++ bufsz: ::size_t, ++ ) -> ::ssize_t; + + pub fn sigemptyset(set: *mut sigset_t) -> ::c_int; + pub fn sigaddset(set: *mut sigset_t, signum: ::c_int) -> ::c_int; +@@ -3722,10 +3971,11 @@ extern { + pub fn sigdelset(set: *mut sigset_t, signum: ::c_int) -> ::c_int; + pub fn sigismember(set: *const sigset_t, signum: ::c_int) -> ::c_int; + +- pub fn sigprocmask(how: ::c_int, +- set: *const sigset_t, +- oldset: *mut sigset_t) +- -> ::c_int; ++ pub fn sigprocmask( ++ how: ::c_int, ++ set: *const sigset_t, ++ oldset: *mut sigset_t, ++ ) -> ::c_int; + pub fn sigpending(set: *mut sigset_t) -> ::c_int; + + pub fn timegm(tm: *mut ::tm) -> time_t; +@@ -3736,15 +3986,19 @@ extern { + + pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int; + +- pub fn pselect(nfds: ::c_int, +- readfs: *mut fd_set, +- writefds: *mut fd_set, +- errorfds: *mut fd_set, +- timeout: *const timespec, +- sigmask: *const sigset_t) -> ::c_int; +- pub fn fseeko(stream: *mut ::FILE, +- offset: ::off_t, +- whence: ::c_int) -> ::c_int; ++ pub fn pselect( ++ nfds: ::c_int, ++ readfs: *mut fd_set, ++ writefds: *mut fd_set, ++ errorfds: *mut fd_set, ++ timeout: *const timespec, ++ sigmask: *const sigset_t, ++ ) -> ::c_int; ++ pub fn fseeko( ++ stream: *mut ::FILE, ++ offset: ::off_t, ++ whence: ::c_int, ++ ) -> ::c_int; + pub fn ftello(stream: *mut ::FILE) -> ::off_t; + pub fn tcdrain(fd: ::c_int) -> ::c_int; + pub fn cfgetispeed(termios: *const ::termios) -> ::speed_t; +@@ -3754,9 +4008,11 @@ extern { + pub fn cfsetospeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int; + pub fn cfsetspeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int; + pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int; +- pub fn tcsetattr(fd: ::c_int, +- optional_actions: ::c_int, +- termios: *const ::termios) -> ::c_int; ++ pub fn tcsetattr( ++ fd: ::c_int, ++ optional_actions: ::c_int, ++ termios: *const ::termios, ++ ) -> ::c_int; + pub fn tcflow(fd: ::c_int, action: ::c_int) -> ::c_int; + pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int; + pub fn tcgetsid(fd: ::c_int) -> ::pid_t; +@@ -3770,7 +4026,6 @@ extern { + pub fn closelog(); + pub fn setlogmask(maskpri: ::c_int) -> ::c_int; + pub fn syslog(priority: ::c_int, message: *const ::c_char, ...); +- 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; +@@ -3778,527 +4033,547 @@ extern { + pub fn unlockpt(fd: ::c_int) -> ::c_int; + + pub fn fdatasync(fd: ::c_int) -> ::c_int; +- pub fn mincore(addr: *mut ::c_void, len: ::size_t, +- vec: *mut ::c_uchar) -> ::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; +- pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; ++ pub fn clock_settime( ++ clk_id: ::clockid_t, ++ tp: *const ::timespec, ++ ) -> ::c_int; + pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; + +- pub fn pthread_getattr_np(native: ::pthread_t, +- attr: *mut ::pthread_attr_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_getattr_np( ++ native: ::pthread_t, ++ attr: *mut ::pthread_attr_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 memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; +- pub fn setgroups(ngroups: ::size_t, +- ptr: *const ::gid_t) -> ::c_int; ++ pub fn setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int; + pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; + pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; +- pub fn statfs64(path: *const ::c_char, buf: *mut statfs64) -> ::c_int; + pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; +- pub fn fstatfs64(fd: ::c_int, buf: *mut statfs64) -> ::c_int; +- pub fn statvfs64(path: *const ::c_char, buf: *mut statvfs64) -> ::c_int; +- pub fn fstatvfs64(fd: ::c_int, buf: *mut statvfs64) -> ::c_int; +- pub fn memrchr(cx: *const ::c_void, +- c: ::c_int, +- n: ::size_t) -> *mut ::c_void; +- +- pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, +- advise: ::c_int) -> ::c_int; ++ pub fn memrchr( ++ cx: *const ::c_void, ++ c: ::c_int, ++ n: ::size_t, ++ ) -> *mut ::c_void; ++ ++ pub fn posix_fadvise( ++ fd: ::c_int, ++ offset: ::off_t, ++ len: ::off_t, ++ advise: ::c_int, ++ ) -> ::c_int; + pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; +- pub fn utimensat(dirfd: ::c_int, path: *const ::c_char, +- times: *const ::timespec, flag: ::c_int) -> ::c_int; ++ pub fn utimensat( ++ dirfd: ::c_int, ++ path: *const ::c_char, ++ times: *const ::timespec, ++ flag: ::c_int, ++ ) -> ::c_int; + pub fn duplocale(base: ::locale_t) -> ::locale_t; + pub fn freelocale(loc: ::locale_t); +- pub fn newlocale(mask: ::c_int, +- locale: *const ::c_char, +- base: ::locale_t) -> ::locale_t; ++ 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 creat64(path: *const c_char, mode: mode_t) -> ::c_int; +- pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int; +- pub fn fstatat64(dirfd: ::c_int, pathname: *const c_char, +- buf: *mut stat64, flags: ::c_int) -> ::c_int; +- pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int; +- pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int; +- pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t; +- pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int; +- pub fn mmap64(addr: *mut ::c_void, +- len: ::size_t, +- prot: ::c_int, +- flags: ::c_int, +- fd: ::c_int, +- offset: off64_t) +- -> *mut ::c_void; +- pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int; +- pub fn openat64(fd: ::c_int, +- path: *const c_char, +- oflag: ::c_int, ...) -> ::c_int; +- pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, +- offset: off64_t) -> ::ssize_t; +- pub fn preadv64(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int, +- offset: ::off64_t) -> ::ssize_t; +- pub fn pwrite64(fd: ::c_int, buf: *const ::c_void, count: ::size_t, +- offset: off64_t) -> ::ssize_t; +- pub fn pwritev64(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int, +- offset: ::off64_t) -> ::ssize_t; +- pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64; +- pub fn readdir64_r(dirp: *mut ::DIR, entry: *mut ::dirent64, +- result: *mut *mut ::dirent64) -> ::c_int; +- pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int; +- pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int; +- pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int; + + pub fn fdopendir(fd: ::c_int) -> *mut ::DIR; + +- pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char, +- mode: ::mode_t, dev: dev_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 pthread_condattr_setpshared(attr: *mut pthread_condattr_t, +- pshared: ::c_int) -> ::c_int; +- pub fn accept4(fd: ::c_int, addr: *mut ::sockaddr, len: *mut ::socklen_t, +- flg: ::c_int) -> ::c_int; +- pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, +- pshared: ::c_int) -> ::c_int; +- pub fn pthread_rwlockattr_getpshared(attr: *const pthread_rwlockattr_t, +- val: *mut ::c_int) -> ::c_int; +- pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, +- val: ::c_int) -> ::c_int; +- pub fn ptsname_r(fd: ::c_int, +- buf: *mut ::c_char, +- buflen: ::size_t) -> ::c_int; ++ pub fn mknodat( ++ dirfd: ::c_int, ++ pathname: *const ::c_char, ++ mode: ::mode_t, ++ dev: dev_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 accept4( ++ fd: ::c_int, ++ addr: *mut ::sockaddr, ++ len: *mut ::socklen_t, ++ flg: ::c_int, ++ ) -> ::c_int; ++ pub fn ptsname_r( ++ fd: ::c_int, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ ) -> ::c_int; + pub fn clearenv() -> ::c_int; +- pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, +- options: ::c_int) -> ::c_int; ++ pub fn waitid( ++ idtype: idtype_t, ++ id: id_t, ++ infop: *mut ::siginfo_t, ++ options: ::c_int, ++ ) -> ::c_int; + pub fn setreuid(ruid: ::uid_t, euid: ::uid_t) -> ::c_int; + pub fn setregid(rgid: ::gid_t, egid: ::gid_t) -> ::c_int; +- pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, +- suid: *mut ::uid_t) -> ::c_int; +- pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, +- sgid: *mut ::gid_t) -> ::c_int; ++ pub fn getresuid( ++ ruid: *mut ::uid_t, ++ euid: *mut ::uid_t, ++ suid: *mut ::uid_t, ++ ) -> ::c_int; ++ pub fn getresgid( ++ rgid: *mut ::gid_t, ++ egid: *mut ::gid_t, ++ sgid: *mut ::gid_t, ++ ) -> ::c_int; + pub fn acct(filename: *const ::c_char) -> ::c_int; + pub fn brk(addr: *mut ::c_void) -> ::c_int; +- pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void; +- pub fn vfork() -> ::pid_t; + 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; +- pub fn wait4(pid: ::pid_t, status: *mut ::c_int, options: ::c_int, +- rusage: *mut ::rusage) -> ::pid_t; +- pub fn openpty(amaster: *mut ::c_int, +- aslave: *mut ::c_int, +- name: *mut ::c_char, +- termp: *const termios, +- winp: *const ::winsize) -> ::c_int; +- pub fn execvpe(file: *const ::c_char, argv: *const *const ::c_char, +- envp: *const *const ::c_char) -> ::c_int; +- pub fn fexecve(fd: ::c_int, argv: *const *const ::c_char, +- envp: *const *const ::c_char) +- -> ::c_int; ++ pub fn openpty( ++ amaster: *mut ::c_int, ++ aslave: *mut ::c_int, ++ name: *mut ::c_char, ++ termp: *const termios, ++ winp: *const ::winsize, ++ ) -> ::c_int; ++ pub fn execvpe( ++ file: *const ::c_char, ++ argv: *const *const ::c_char, ++ envp: *const *const ::c_char, ++ ) -> ::c_int; ++ pub fn fexecve( ++ fd: ::c_int, ++ argv: *const *const ::c_char, ++ envp: *const *const ::c_char, ++ ) -> ::c_int; + + 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; +- +- 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 endpwent(); + 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; ++ 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 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 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 semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int; +- pub fn semop(semid: ::c_int, +- sops: *mut ::sembuf, nsops: ::size_t) -> ::c_int; +- pub fn semctl(semid: ::c_int, +- semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int; +- pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int; ++ pub fn semop( ++ semid: ::c_int, ++ sops: *mut ::sembuf, ++ nsops: ::size_t, ++ ) -> ::c_int; ++ pub fn semctl( ++ semid: ::c_int, ++ semnum: ::c_int, ++ cmd: ::c_int, ++ ... ++ ) -> ::c_int; ++ 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 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 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; +- pub fn tmpfile64() -> *mut ::FILE; +- pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int; +- pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int; +- pub fn fseeko64(stream: *mut ::FILE, +- offset: ::off64_t, +- whence: ::c_int) -> ::c_int; +- pub fn ftello64(stream: *mut ::FILE) -> ::off64_t; +- pub fn fallocate(fd: ::c_int, mode: ::c_int, +- offset: ::off_t, len: ::off_t) -> ::c_int; +- pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, +- len: ::off_t) -> ::c_int; +- pub fn readahead(fd: ::c_int, offset: ::off64_t, +- count: ::size_t) -> ::ssize_t; +- pub fn getxattr(path: *const c_char, name: *const c_char, +- value: *mut ::c_void, size: ::size_t) -> ::ssize_t; +- pub fn lgetxattr(path: *const c_char, name: *const c_char, +- value: *mut ::c_void, size: ::size_t) -> ::ssize_t; +- pub fn fgetxattr(filedes: ::c_int, name: *const c_char, +- value: *mut ::c_void, size: ::size_t) -> ::ssize_t; +- pub fn setxattr(path: *const c_char, name: *const c_char, +- value: *const ::c_void, size: ::size_t, +- flags: ::c_int) -> ::c_int; +- pub fn lsetxattr(path: *const c_char, name: *const c_char, +- value: *const ::c_void, size: ::size_t, +- flags: ::c_int) -> ::c_int; +- pub fn fsetxattr(filedes: ::c_int, name: *const c_char, +- value: *const ::c_void, size: ::size_t, +- flags: ::c_int) -> ::c_int; +- pub fn listxattr(path: *const c_char, list: *mut c_char, +- size: ::size_t) -> ::ssize_t; +- pub fn llistxattr(path: *const c_char, list: *mut c_char, +- size: ::size_t) -> ::ssize_t; +- pub fn flistxattr(filedes: ::c_int, list: *mut c_char, +- size: ::size_t) -> ::ssize_t; +- pub fn removexattr(path: *const c_char, name: *const c_char) -> ::c_int; +- pub fn lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int; +- pub fn fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int; +- pub fn signalfd(fd: ::c_int, +- mask: *const ::sigset_t, +- flags: ::c_int) -> ::c_int; ++ pub fn fallocate( ++ fd: ::c_int, ++ mode: ::c_int, ++ offset: ::off_t, ++ len: ::off_t, ++ ) -> ::c_int; ++ pub fn posix_fallocate( ++ fd: ::c_int, ++ offset: ::off_t, ++ len: ::off_t, ++ ) -> ::c_int; ++ pub fn readahead( ++ fd: ::c_int, ++ offset: ::off64_t, ++ count: ::size_t, ++ ) -> ::ssize_t; ++ pub fn signalfd( ++ fd: ::c_int, ++ mask: *const ::sigset_t, ++ flags: ::c_int, ++ ) -> ::c_int; + pub fn timerfd_create(clockid: ::c_int, flags: ::c_int) -> ::c_int; +- pub fn timerfd_gettime(fd: ::c_int, +- curr_value: *mut itimerspec) -> ::c_int; +- pub fn timerfd_settime(fd: ::c_int, +- flags: ::c_int, +- new_value: *const itimerspec, +- old_value: *mut itimerspec) -> ::c_int; +- pub fn pwritev(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int, +- offset: ::off_t) -> ::ssize_t; +- pub fn preadv(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int, +- offset: ::off_t) -> ::ssize_t; +- pub fn quotactl(cmd: ::c_int, +- special: *const ::c_char, +- id: ::c_int, +- data: *mut ::c_char) -> ::c_int; +- pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t; +- pub fn mq_close(mqd: ::mqd_t) -> ::c_int; +- pub fn mq_unlink(name: *const ::c_char) -> ::c_int; +- pub fn mq_receive(mqd: ::mqd_t, +- msg_ptr: *mut ::c_char, +- msg_len: ::size_t, +- msq_prio: *mut ::c_uint) -> ::ssize_t; +- pub fn mq_send(mqd: ::mqd_t, +- msg_ptr: *const ::c_char, +- msg_len: ::size_t, +- msq_prio: ::c_uint) -> ::c_int; +- pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int; +- pub fn mq_setattr(mqd: ::mqd_t, +- newattr: *const ::mq_attr, +- oldattr: *mut ::mq_attr) -> ::c_int; +- pub fn epoll_pwait(epfd: ::c_int, +- events: *mut ::epoll_event, +- maxevents: ::c_int, +- timeout: ::c_int, +- sigmask: *const ::sigset_t) -> ::c_int; ++ pub fn timerfd_gettime( ++ fd: ::c_int, ++ curr_value: *mut itimerspec, ++ ) -> ::c_int; ++ pub fn timerfd_settime( ++ fd: ::c_int, ++ flags: ::c_int, ++ new_value: *const itimerspec, ++ old_value: *mut itimerspec, ++ ) -> ::c_int; ++ pub fn pwritev( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ offset: ::off_t, ++ ) -> ::ssize_t; ++ pub fn preadv( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ offset: ::off_t, ++ ) -> ::ssize_t; ++ pub fn quotactl( ++ cmd: ::c_int, ++ special: *const ::c_char, ++ id: ::c_int, ++ data: *mut ::c_char, ++ ) -> ::c_int; + pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int; + 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 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 nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char; +- 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 pthread_setschedprio(native: ::pthread_t, +- priority: ::c_int) -> ::c_int; +- pub fn prlimit(pid: ::pid_t, resource: ::c_int, new_limit: *const ::rlimit, +- old_limit: *mut ::rlimit) -> ::c_int; +- pub fn prlimit64(pid: ::pid_t, +- resource: ::c_int, +- new_limit: *const ::rlimit64, +- old_limit: *mut ::rlimit64) -> ::c_int; +- pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int; +- pub fn process_vm_readv(pid: ::pid_t, +- local_iov: *const ::iovec, +- liovcnt: ::c_ulong, +- remote_iov: *const ::iovec, +- riovcnt: ::c_ulong, +- 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 mkostemps( ++ template: *mut ::c_char, ++ suffixlen: ::c_int, ++ flags: ::c_int, ++ ) -> ::c_int; ++ 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 nl_langinfo_l(item: ::nl_item, locale: ::locale_t) ++ -> *mut ::c_char; ++ 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 reboot(how_to: ::c_int) -> ::c_int; + pub fn setfsgid(gid: ::gid_t) -> ::c_int; + pub fn setfsuid(uid: ::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 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 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); + +- pub fn mremap(addr: *mut ::c_void, +- len: ::size_t, +- new_len: ::size_t, +- flags: ::c_int, +- ...) -> *mut ::c_void; +- +- pub fn glob(pattern: *const c_char, +- flags: ::c_int, +- errfunc: ::Option ::c_int>, +- pglob: *mut ::glob_t) -> ::c_int; ++ pub fn glob( ++ pattern: *const c_char, ++ flags: ::c_int, ++ errfunc: ::Option< ++ extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int, ++ >, ++ pglob: *mut ::glob_t, ++ ) -> ::c_int; + pub fn globfree(pglob: *mut ::glob_t); + +- pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) +- -> ::c_int; ++ pub fn posix_madvise( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ advice: ::c_int, ++ ) -> ::c_int; + + pub fn shm_unlink(name: *const ::c_char) -> ::c_int; + + pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); + + pub fn telldir(dirp: *mut ::DIR) -> ::c_long; +- pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) +- -> ::c_int; ++ pub fn madvise( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ advice: ::c_int, ++ ) -> ::c_int; + +- pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int; ++ pub fn msync( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; + +- pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, +- flags: ::c_int, addr: *mut ::sockaddr, +- addrlen: *mut ::socklen_t) -> ::ssize_t; ++ pub fn recvfrom( ++ socket: ::c_int, ++ buf: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ addr: *mut ::sockaddr, ++ addrlen: *mut ::socklen_t, ++ ) -> ::ssize_t; + pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int; + pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int; + pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; + +- pub fn bind(socket: ::c_int, address: *const ::sockaddr, +- address_len: ::socklen_t) -> ::c_int; +- +- pub fn writev(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int) -> ::ssize_t; +- pub fn readv(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int) -> ::ssize_t; +- +- pub fn sendmsg(fd: ::c_int, +- msg: *const ::msghdr, +- flags: ::c_int) -> ::ssize_t; +- pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) +- -> ::ssize_t; ++ pub fn bind( ++ socket: ::c_int, ++ address: *const ::sockaddr, ++ address_len: ::socklen_t, ++ ) -> ::c_int; ++ ++ pub fn writev( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ ) -> ::ssize_t; ++ pub fn readv( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ ) -> ::ssize_t; ++ ++ pub fn sendmsg( ++ fd: ::c_int, ++ msg: *const ::msghdr, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ pub fn recvmsg( ++ fd: ::c_int, ++ msg: *mut ::msghdr, ++ flags: ::c_int, ++ ) -> ::ssize_t; + pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn vhangup() -> ::c_int; +- pub fn sendmmsg(sockfd: ::c_int, msgvec: *mut mmsghdr, vlen: ::c_uint, +- flags: ::c_int) -> ::c_int; +- pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut mmsghdr, vlen: ::c_uint, +- flags: ::c_int, timeout: *mut ::timespec) -> ::c_int; ++ pub fn sendmmsg( ++ sockfd: ::c_int, ++ msgvec: *mut mmsghdr, ++ vlen: ::c_uint, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn recvmmsg( ++ sockfd: ::c_int, ++ msgvec: *mut mmsghdr, ++ vlen: ::c_uint, ++ flags: ::c_int, ++ timeout: *mut ::timespec, ++ ) -> ::c_int; + pub fn sync(); + pub fn syscall(num: ::c_long, ...) -> ::c_long; +- pub fn sched_getaffinity(pid: ::pid_t, +- cpusetsize: ::size_t, +- 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 epoll_create(size: ::c_int) -> ::c_int; +- pub fn epoll_create1(flags: ::c_int) -> ::c_int; +- pub fn epoll_wait(epfd: ::c_int, +- events: *mut ::epoll_event, +- maxevents: ::c_int, +- timeout: ::c_int) -> ::c_int; +- pub fn epoll_ctl(epfd: ::c_int, +- op: ::c_int, +- fd: ::c_int, +- event: *mut ::epoll_event) -> ::c_int; +- pub fn pthread_getschedparam(native: ::pthread_t, +- policy: *mut ::c_int, +- param: *mut ::sched_param) -> ::c_int; +- pub fn unshare(flags: ::c_int) -> ::c_int; ++ pub fn sched_getaffinity( ++ pid: ::pid_t, ++ cpusetsize: ::size_t, ++ 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 umount(target: *const ::c_char) -> ::c_int; + pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int; +- pub fn tee(fd_in: ::c_int, +- fd_out: ::c_int, +- len: ::size_t, +- flags: ::c_uint) -> ::ssize_t; +- pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int; +- pub fn splice(fd_in: ::c_int, +- off_in: *mut ::loff_t, +- fd_out: ::c_int, +- off_out: *mut ::loff_t, +- len: ::size_t, +- flags: ::c_uint) -> ::ssize_t; ++ pub fn tee( ++ fd_in: ::c_int, ++ fd_out: ::c_int, ++ len: ::size_t, ++ flags: ::c_uint, ++ ) -> ::ssize_t; ++ pub fn settimeofday( ++ tv: *const ::timeval, ++ tz: *const ::timezone, ++ ) -> ::c_int; ++ pub fn splice( ++ fd_in: ::c_int, ++ off_in: *mut ::loff_t, ++ fd_out: ::c_int, ++ off_out: *mut ::loff_t, ++ len: ::size_t, ++ flags: ::c_uint, ++ ) -> ::ssize_t; + pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; +- pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int; +- pub fn sem_timedwait(sem: *mut sem_t, +- abstime: *const ::timespec) -> ::c_int; +- pub fn sem_getvalue(sem: *mut sem_t, +- sval: *mut ::c_int) -> ::c_int; +- pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int; +- pub fn setns(fd: ::c_int, nstype: ::c_int) -> ::c_int; ++ pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) ++ -> ::c_int; ++ pub fn sem_timedwait( ++ sem: *mut sem_t, ++ abstime: *const ::timespec, ++ ) -> ::c_int; ++ pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int; ++ pub fn sched_setparam( ++ pid: ::pid_t, ++ param: *const ::sched_param, ++ ) -> ::c_int; + pub fn swapoff(puath: *const ::c_char) -> ::c_int; +- pub fn vmsplice(fd: ::c_int, +- iov: *const ::iovec, +- nr_segs: ::size_t, +- flags: ::c_uint) -> ::ssize_t; +- pub fn mount(src: *const ::c_char, +- target: *const ::c_char, +- fstype: *const ::c_char, +- flags: ::c_ulong, +- data: *const ::c_void) -> ::c_int; ++ pub fn vmsplice( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ nr_segs: ::size_t, ++ flags: ::c_uint, ++ ) -> ::ssize_t; ++ pub fn mount( ++ src: *const ::c_char, ++ target: *const ::c_char, ++ fstype: *const ::c_char, ++ flags: ::c_ulong, ++ data: *const ::c_void, ++ ) -> ::c_int; + pub fn personality(persona: ::c_ulong) -> ::c_int; +- pub fn prctl(option: ::c_int, ...) -> ::c_int; + pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int; +- pub fn ppoll(fds: *mut ::pollfd, +- nfds: nfds_t, +- timeout: *const ::timespec, +- sigmask: *const sigset_t) -> ::c_int; +- pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t, +- abstime: *const ::timespec) -> ::c_int; +- pub fn clone(cb: extern fn(*mut ::c_void) -> ::c_int, +- child_stack: *mut ::c_void, +- flags: ::c_int, +- arg: *mut ::c_void, ...) -> ::c_int; ++ pub fn ppoll( ++ fds: *mut ::pollfd, ++ nfds: nfds_t, ++ timeout: *const ::timespec, ++ sigmask: *const sigset_t, ++ ) -> ::c_int; ++ pub fn pthread_mutex_timedlock( ++ lock: *mut pthread_mutex_t, ++ abstime: *const ::timespec, ++ ) -> ::c_int; ++ pub fn clone( ++ cb: extern "C" fn(*mut ::c_void) -> ::c_int, ++ child_stack: *mut ::c_void, ++ flags: ::c_int, ++ arg: *mut ::c_void, ++ ... ++ ) -> ::c_int; + pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int; +- pub fn clock_nanosleep(clk_id: ::clockid_t, +- flags: ::c_int, +- rqtp: *const ::timespec, +- rmtp: *mut ::timespec) -> ::c_int; +- pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t, +- guardsize: *mut ::size_t) -> ::c_int; ++ pub fn clock_nanosleep( ++ clk_id: ::clockid_t, ++ flags: ::c_int, ++ rqtp: *const ::timespec, ++ rmtp: *mut ::timespec, ++ ) -> ::c_int; ++ pub fn pthread_attr_getguardsize( ++ attr: *const ::pthread_attr_t, ++ guardsize: *mut ::size_t, ++ ) -> ::c_int; + pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int; +- pub fn pthread_condattr_getpshared(attr: *const pthread_condattr_t, +- pshared: *mut ::c_int) -> ::c_int; +- pub fn sysinfo(info: *mut ::sysinfo) -> ::c_int; + pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int; +- pub fn pthread_setschedparam(native: ::pthread_t, +- policy: ::c_int, +- param: *const ::sched_param) -> ::c_int; + pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int; +- pub fn sched_setscheduler(pid: ::pid_t, +- policy: ::c_int, +- param: *const ::sched_param) -> ::c_int; +- pub fn sendfile(out_fd: ::c_int, +- in_fd: ::c_int, +- offset: *mut off_t, +- count: ::size_t) -> ::ssize_t; ++ pub fn sched_setscheduler( ++ pid: ::pid_t, ++ policy: ::c_int, ++ param: *const ::sched_param, ++ ) -> ::c_int; + pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int; +- pub fn getgrgid_r(gid: ::gid_t, +- grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; +- pub fn sigaltstack(ss: *const stack_t, +- oss: *mut stack_t) -> ::c_int; ++ pub fn getgrgid_r( ++ gid: ::gid_t, ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; ++ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sem_close(sem: *mut sem_t) -> ::c_int; + pub fn getdtablesize() -> ::c_int; +- pub fn getgrnam_r(name: *const ::c_char, +- grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; ++ pub fn getgrnam_r( ++ name: *const ::c_char, ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; + pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int; +- pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, +- oldset: *mut sigset_t) -> ::c_int; ++ pub fn pthread_sigmask( ++ how: ::c_int, ++ set: *const sigset_t, ++ oldset: *mut sigset_t, ++ ) -> ::c_int; + pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; + pub fn getgrnam(name: *const ::c_char) -> *mut ::group; + pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int; + pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + pub fn sem_unlink(name: *const ::c_char) -> ::c_int; + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; +- pub fn getpwnam_r(name: *const ::c_char, +- pwd: *mut passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut passwd) -> ::c_int; +- pub fn getpwuid_r(uid: ::uid_t, +- pwd: *mut passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut passwd) -> ::c_int; +- pub fn sigwait(set: *const sigset_t, +- sig: *mut ::c_int) -> ::c_int; +- pub fn pthread_atfork(prepare: ::Option, +- parent: ::Option, +- child: ::Option) -> ::c_int; ++ pub fn getpwnam_r( ++ name: *const ::c_char, ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; ++ pub fn getpwuid_r( ++ uid: ::uid_t, ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; ++ pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; ++ pub fn pthread_atfork( ++ prepare: ::Option, ++ parent: ::Option, ++ child: ::Option, ++ ) -> ::c_int; + pub fn getgrgid(gid: ::gid_t) -> *mut ::group; +- pub fn getgrouplist(user: *const ::c_char, +- group: ::gid_t, +- groups: *mut ::gid_t, +- ngroups: *mut ::c_int) -> ::c_int; +- pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t, +- pshared: *mut ::c_int) -> ::c_int; +- pub fn popen(command: *const c_char, +- mode: *const c_char) -> *mut ::FILE; +- pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char, +- mode: ::c_int, flags: ::c_int) -> ::c_int; +- pub fn pthread_create(native: *mut ::pthread_t, +- attr: *const ::pthread_attr_t, +- f: extern fn(*mut ::c_void) -> *mut ::c_void, +- value: *mut ::c_void) -> ::c_int; ++ pub fn getgrouplist( ++ user: *const ::c_char, ++ group: ::gid_t, ++ groups: *mut ::gid_t, ++ ngroups: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; ++ pub fn faccessat( ++ dirfd: ::c_int, ++ pathname: *const ::c_char, ++ mode: ::c_int, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_create( ++ native: *mut ::pthread_t, ++ attr: *const ::pthread_attr_t, ++ f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, ++ value: *mut ::c_void, ++ ) -> ::c_int; + pub fn dl_iterate_phdr( +- callback: ::Option ::c_int>, +- data: *mut ::c_void ++ callback: ::Option< ++ unsafe extern "C" fn( ++ info: *mut ::dl_phdr_info, ++ size: ::size_t, ++ data: *mut ::c_void, ++ ) -> ::c_int, ++ >, ++ data: *mut ::c_void, + ) -> ::c_int; + } + +diff --git a/third_party/rust/libc/src/fuchsia/no_align.rs b/third_party/rust/libc/src/fuchsia/no_align.rs +index 437da97ee0626382ff5ed06322bf90b725034bd0..7ca90e0e48a39940e4222f8a65bbf969751e74b6 100644 +--- a/third_party/rust/libc/src/fuchsia/no_align.rs ++++ b/third_party/rust/libc/src/fuchsia/no_align.rs +@@ -125,5 +125,5 @@ macro_rules! expand_align { + } + } + } +- } ++ }; + } +diff --git a/third_party/rust/libc/src/hermit/mod.rs b/third_party/rust/libc/src/hermit/mod.rs +index 9880b50723e946b2b4f20d9eced17f889e3cfc3f..bffcefdd89ce405a5248f87ff1f266a18d6e759a 100644 +--- a/third_party/rust/libc/src/hermit/mod.rs ++++ b/third_party/rust/libc/src/hermit/mod.rs +@@ -1,13 +1,3 @@ +-// Copyright 2018 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 or the MIT license +-// , at your +-// option. This file may not be copied, modified, or distributed +-// except according to those terms. +- + // libc port for HermitCore (https://hermitcore.org) + // + // Ported by Colin Fink +diff --git a/third_party/rust/libc/src/lib.rs b/third_party/rust/libc/src/lib.rs +index 2dc42702fcb7d181a9b023a0918cc654c0d4194b..2be57129f0636b42ea39540d6370b6cf540a9e29 100644 +--- a/third_party/rust/libc/src/lib.rs ++++ b/third_party/rust/libc/src/lib.rs +@@ -1,12 +1,3 @@ +-// Copyright 2012-2015 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 or the MIT license +-// , at your +-// option. This file may not be copied, modified, or distributed +-// except according to those terms. + //! libc - Raw FFI bindings to platforms' system libraries + //! + //! [Documentation for other platforms][pd]. +@@ -14,19 +5,30 @@ + //! [pd]: https://rust-lang.github.io/libc/#platform-specific-documentation + #![crate_name = "libc"] + #![crate_type = "rlib"] +-#![cfg_attr(not(feature = "rustc-dep-of-std"), deny(warnings))] +-#![allow(bad_style, overflowing_literals, improper_ctypes, unknown_lints)] ++#![allow( ++ renamed_and_removed_lints, // Keep this order. ++ unknown_lints, // Keep this order. ++ bad_style, ++ overflowing_literals, ++ improper_ctypes, ++ // This lint is renamed but we run CI for old stable rustc so should be here. ++ redundant_semicolon, ++ redundant_semicolons ++)] ++#![cfg_attr(libc_deny_warnings, deny(warnings))] + // Attributes needed when building as part of the standard library + #![cfg_attr( + feature = "rustc-dep-of-std", + feature(cfg_target_vendor, link_cfg, no_core) + )] ++#![cfg_attr(libc_thread_local, feature(thread_local))] + // Enable extra lints: + #![cfg_attr(feature = "extra_traits", deny(missing_debug_implementations))] + #![deny(missing_copy_implementations, safe_packed_borrows)] + #![no_std] + #![cfg_attr(feature = "rustc-dep-of-std", no_core)] + #![cfg_attr(target_os = "redox", feature(static_nobundle))] ++#![cfg_attr(libc_const_extern_fn, feature(const_extern_fn))] + + #[macro_use] + mod macros; +@@ -37,6 +39,8 @@ cfg_if! { + #[allow(unused_imports)] + use core::iter; + #[allow(unused_imports)] ++ use core::ops; ++ #[allow(unused_imports)] + use core::option; + } + } +@@ -113,6 +117,18 @@ cfg_if! { + + mod switch; + pub use switch::*; ++ } else if #[cfg(target_os = "psp")] { ++ mod fixed_width_ints; ++ pub use fixed_width_ints::*; ++ ++ mod psp; ++ pub use psp::*; ++ } else if #[cfg(target_os = "vxworks")] { ++ mod fixed_width_ints; ++ pub use fixed_width_ints::*; ++ ++ mod vxworks; ++ pub use vxworks::*; + } else if #[cfg(unix)] { + mod fixed_width_ints; + pub use fixed_width_ints::*; +diff --git a/third_party/rust/libc/src/macros.rs b/third_party/rust/libc/src/macros.rs +index 14a28046640c6808e9a475047c91223af2f2e848..378da7ccfbafdc603ab2c6ff4ba76a3f390c07ff 100644 +--- a/third_party/rust/libc/src/macros.rs ++++ b/third_party/rust/libc/src/macros.rs +@@ -122,15 +122,125 @@ macro_rules! s_no_extra_traits { + } + + #[allow(unused_macros)] +-macro_rules! f { +- ($(pub fn $i:ident($($arg:ident: $argty:ty),*) -> $ret:ty { +- $($body:stmt);* +- })*) => ($( +- #[inline] +- pub unsafe extern fn $i($($arg: $argty),*) -> $ret { +- $($body);* ++macro_rules! e { ++ ($($(#[$attr:meta])* pub enum $i:ident { $($field:tt)* })*) => ($( ++ __item! { ++ #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] ++ $(#[$attr])* ++ pub enum $i { $($field)* } + } +- )*) ++ impl ::Copy for $i {} ++ impl ::Clone for $i { ++ fn clone(&self) -> $i { *self } ++ } ++ )*); ++} ++ ++#[allow(unused_macros)] ++macro_rules! s_paren { ++ ($($(#[$attr:meta])* pub struct $i:ident ( $($field:tt)* ); )* ) => ($( ++ __item! { ++ #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] ++ $(#[$attr])* ++ pub struct $i ( $($field)* ); ++ } ++ impl ::Copy for $i {} ++ impl ::Clone for $i { ++ fn clone(&self) -> $i { *self } ++ } ++ )*); ++} ++ ++// This is a pretty horrible hack to allow us to conditionally mark ++// some functions as 'const', without requiring users of this macro ++// to care about the "const-extern-fn" feature. ++// ++// When 'const-extern-fn' is enabled, we emit the captured 'const' keyword ++// in the expanded function. ++// ++// When 'const-extern-fn' is disabled, we always emit a plain 'pub unsafe extern fn'. ++// Note that the expression matched by the macro is exactly the same - this allows ++// users of this macro to work whether or not 'const-extern-fn' is enabled ++// ++// Unfortunately, we need to duplicate most of this macro between the 'cfg_if' blocks. ++// This is because 'const unsafe extern fn' won't even parse on older compilers, ++// so we need to avoid emitting it at all of 'const-extern-fn'. ++// ++// Specifically, moving the 'cfg_if' into the macro body will *not* work. ++// Doing so would cause the '#[cfg(feature = "const-extern-fn")]' to be emiited ++// into user code. The 'cfg' gate will not stop Rust from trying to parse the ++// 'pub const unsafe extern fn', so users would get a compiler error even when ++// the 'const-extern-fn' feature is disabled ++// ++// Note that users of this macro need to place 'const' in a weird position ++// (after the closing ')' for the arguments, but before the return type). ++// This was the only way I could satisfy the following two requirements: ++// 1. Avoid ambuguity errors from 'macro_rules!' (which happen when writing '$foo:ident fn' ++// 2. Allow users of this macro to mix 'pub fn foo' and 'pub const fn bar' within the same ++// 'f!' block ++cfg_if! { ++ if #[cfg(libc_const_extern_fn)] { ++ #[allow(unused_macros)] ++ macro_rules! f { ++ ($(pub $({$constness:ident})* fn $i:ident( ++ $($arg:ident: $argty:ty),* ++ ) -> $ret:ty { ++ $($body:stmt);* ++ })*) => ($( ++ #[inline] ++ pub $($constness)* unsafe extern fn $i($($arg: $argty),* ++ ) -> $ret { ++ $($body);* ++ } ++ )*) ++ } ++ ++ #[allow(unused_macros)] ++ macro_rules! const_fn { ++ ($($({$constness:ident})* fn $i:ident( ++ $($arg:ident: $argty:ty),* ++ ) -> $ret:ty { ++ $($body:stmt);* ++ })*) => ($( ++ #[inline] ++ $($constness)* fn $i($($arg: $argty),* ++ ) -> $ret { ++ $($body);* ++ } ++ )*) ++ } ++ ++ } else { ++ #[allow(unused_macros)] ++ macro_rules! f { ++ ($(pub $({$constness:ident})* fn $i:ident( ++ $($arg:ident: $argty:ty),* ++ ) -> $ret:ty { ++ $($body:stmt);* ++ })*) => ($( ++ #[inline] ++ pub unsafe extern fn $i($($arg: $argty),* ++ ) -> $ret { ++ $($body);* ++ } ++ )*) ++ } ++ ++ #[allow(unused_macros)] ++ macro_rules! const_fn { ++ ($($({$constness:ident})* fn $i:ident( ++ $($arg:ident: $argty:ty),* ++ ) -> $ret:ty { ++ $($body:stmt);* ++ })*) => ($( ++ #[inline] ++ fn $i($($arg: $argty),* ++ ) -> $ret { ++ $($body);* ++ } ++ )*) ++ } ++ } + } + + #[allow(unused_macros)] +diff --git a/third_party/rust/libc/src/psp.rs b/third_party/rust/libc/src/psp.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..806f0ab001950f1a1546c4facd5104aef7d1350c +--- /dev/null ++++ b/third_party/rust/libc/src/psp.rs +@@ -0,0 +1,4709 @@ ++//! PSP C type definitions ++//! ++//! These type declarations are not enough, as they must be ultimately resolved ++//! by the linker. Crates that use these definitions must, somewhere in the ++//! crate graph, include a stub provider crate such as the `psp` crate. ++ ++pub type c_schar = i8; ++pub type c_uchar = u8; ++pub type c_short = i16; ++pub type c_ushort = u16; ++pub type c_int = i32; ++pub type c_uint = u32; ++pub type c_float = f32; ++pub type c_double = f64; ++pub type c_longlong = i64; ++pub type c_ulonglong = u64; ++pub type intmax_t = i64; ++pub type uintmax_t = u64; ++ ++pub type size_t = usize; ++pub type ptrdiff_t = isize; ++pub type intptr_t = isize; ++pub type uintptr_t = usize; ++pub type ssize_t = isize; ++ ++pub type c_char = u8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++ ++cfg_if! { ++ if #[cfg(libc_core_cvoid)] { ++ pub use ::ffi::c_void; ++ } else { ++ // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help ++ // enable more optimization opportunities around it recognizing things ++ // like malloc/free. ++ #[repr(u8)] ++ #[allow(missing_copy_implementations)] ++ #[allow(missing_debug_implementations)] ++ pub enum c_void { ++ // Two dummy variants so the #[repr] attribute can be used. ++ #[doc(hidden)] ++ __variant1, ++ #[doc(hidden)] ++ __variant2, ++ } ++ } ++} ++ ++pub type SceKernelVTimerHandler = unsafe extern "C" fn( ++ uid: SceUid, ++ arg1: *mut SceKernelSysClock, ++ arg2: *mut SceKernelSysClock, ++ arg3: *mut c_void, ++) -> u32; ++ ++pub type SceKernelVTimerHandlerWide = unsafe extern "C" fn( ++ uid: SceUid, ++ arg1: i64, ++ arg2: i64, ++ arg3: *mut c_void, ++) -> u32; ++ ++pub type SceKernelThreadEventHandler = ++ unsafe extern "C" fn(mask: i32, thid: SceUid, common: *mut c_void) -> i32; ++ ++pub type SceKernelAlarmHandler = ++ unsafe extern "C" fn(common: *mut c_void) -> u32; ++ ++pub type SceKernelCallbackFunction = ++ unsafe extern "C" fn(arg1: i32, arg2: i32, arg: *mut c_void) -> i32; ++ ++pub type SceKernelThreadEntry = ++ unsafe extern "C" fn(args: usize, argp: *mut c_void) -> i32; ++ ++pub type PowerCallback = extern "C" fn(unknown: i32, power_info: i32); ++ ++pub type IoPermissions = i32; ++ ++pub type UmdCallback = fn(unknown: i32, event: i32) -> i32; ++ ++pub type SceMpegRingbufferCb = ::Option< ++ unsafe extern "C" fn( ++ data: *mut c_void, ++ num_packets: i32, ++ param: *mut c_void, ++ ) -> i32, ++>; ++ ++pub type GuCallback = ::Option; ++pub type GuSwapBuffersCallback = ::Option; ++ ++pub type SceNetAdhocctlHandler = ::Option; ++ ++pub type AdhocMatchingCallback = ::Option< ++ unsafe extern "C" fn( ++ matching_id: i32, ++ event: i32, ++ mac: *mut u8, ++ opt_len: i32, ++ opt_data: *mut c_void, ++ ), ++>; ++ ++pub type SceNetApctlHandler = ::Option< ++ unsafe extern "C" fn( ++ oldState: i32, ++ newState: i32, ++ event: i32, ++ error: i32, ++ pArg: *mut c_void, ++ ), ++>; ++ ++pub type HttpMallocFunction = ++ ::Option *mut c_void>; ++pub type HttpReallocFunction = ++ ::Option *mut c_void>; ++pub type HttpFreeFunction = ::Option; ++pub type HttpPasswordCB = ::Option< ++ unsafe extern "C" fn( ++ request: i32, ++ auth_type: HttpAuthType, ++ realm: *const u8, ++ username: *mut u8, ++ password: *mut u8, ++ need_entity: i32, ++ entity_body: *mut *mut u8, ++ entity_size: *mut usize, ++ save: *mut i32, ++ ) -> i32, ++>; ++ ++pub type socklen_t = u32; ++ ++e! { ++ #[repr(u32)] ++ pub enum AudioFormat { ++ Stereo = 0, ++ Mono = 0x10, ++ } ++ ++ #[repr(u32)] ++ pub enum DisplayMode { ++ Lcd = 0, ++ } ++ ++ #[repr(u32)] ++ pub enum DisplayPixelFormat { ++ Psm5650 = 0, ++ Psm5551 = 1, ++ Psm4444 = 2, ++ Psm8888 = 3, ++ } ++ ++ #[repr(u32)] ++ pub enum DisplaySetBufSync { ++ Immediate = 0, ++ NextFrame = 1, ++ } ++ ++ #[repr(i32)] ++ pub enum AudioOutputFrequency { ++ Khz48 = 48000, ++ Khz44_1 = 44100, ++ Khz32 = 32000, ++ Khz24 = 24000, ++ Khz22_05 = 22050, ++ Khz16 = 16000, ++ Khz12 = 12000, ++ Khz11_025 = 11025, ++ Khz8 = 8000, ++ } ++ ++ #[repr(i32)] ++ pub enum AudioInputFrequency { ++ Khz44_1 = 44100, ++ Khz22_05 = 22050, ++ Khz11_025 = 11025, ++ } ++ ++ #[repr(u32)] ++ pub enum CtrlMode { ++ Digital = 0, ++ Analog, ++ } ++ ++ #[repr(i32)] ++ pub enum GeMatrixType { ++ Bone0 = 0, ++ Bone1, ++ Bone2, ++ Bone3, ++ Bone4, ++ Bone5, ++ Bone6, ++ Bone7, ++ World, ++ View, ++ Projection, ++ TexGen, ++ } ++ ++ #[repr(i32)] ++ pub enum GeListState { ++ Done = 0, ++ Queued, ++ DrawingDone, ++ StallReached, ++ CancelDone, ++ } ++ ++ #[repr(u8)] ++ pub enum GeCommand { ++ Nop = 0, ++ Vaddr = 0x1, ++ Iaddr = 0x2, ++ Prim = 0x4, ++ Bezier = 0x5, ++ Spline = 0x6, ++ BoundingBox = 0x7, ++ Jump = 0x8, ++ BJump = 0x9, ++ Call = 0xa, ++ Ret = 0xb, ++ End = 0xc, ++ Signal = 0xe, ++ Finish = 0xf, ++ Base = 0x10, ++ VertexType = 0x12, ++ OffsetAddr = 0x13, ++ Origin = 0x14, ++ Region1 = 0x15, ++ Region2 = 0x16, ++ LightingEnable = 0x17, ++ LightEnable0 = 0x18, ++ LightEnable1 = 0x19, ++ LightEnable2 = 0x1a, ++ LightEnable3 = 0x1b, ++ DepthClampEnable = 0x1c, ++ CullFaceEnable = 0x1d, ++ TextureMapEnable = 0x1e, ++ FogEnable = 0x1f, ++ DitherEnable = 0x20, ++ AlphaBlendEnable = 0x21, ++ AlphaTestEnable = 0x22, ++ ZTestEnable = 0x23, ++ StencilTestEnable = 0x24, ++ AntiAliasEnable = 0x25, ++ PatchCullEnable = 0x26, ++ ColorTestEnable = 0x27, ++ LogicOpEnable = 0x28, ++ BoneMatrixNumber = 0x2a, ++ BoneMatrixData = 0x2b, ++ MorphWeight0 = 0x2c, ++ MorphWeight1 = 0x2d, ++ MorphWeight2 = 0x2e, ++ MorphWeight3 = 0x2f, ++ MorphWeight4 = 0x30, ++ MorphWeight5 = 0x31, ++ MorphWeight6 = 0x32, ++ MorphWeight7 = 0x33, ++ PatchDivision = 0x36, ++ PatchPrimitive = 0x37, ++ PatchFacing = 0x38, ++ WorldMatrixNumber = 0x3a, ++ WorldMatrixData = 0x3b, ++ ViewMatrixNumber = 0x3c, ++ ViewMatrixData = 0x3d, ++ ProjMatrixNumber = 0x3e, ++ ProjMatrixData = 0x3f, ++ TGenMatrixNumber = 0x40, ++ TGenMatrixData = 0x41, ++ ViewportXScale = 0x42, ++ ViewportYScale = 0x43, ++ ViewportZScale = 0x44, ++ ViewportXCenter = 0x45, ++ ViewportYCenter = 0x46, ++ ViewportZCenter = 0x47, ++ TexScaleU = 0x48, ++ TexScaleV = 0x49, ++ TexOffsetU = 0x4a, ++ TexOffsetV = 0x4b, ++ OffsetX = 0x4c, ++ OffsetY = 0x4d, ++ ShadeMode = 0x50, ++ ReverseNormal = 0x51, ++ MaterialUpdate = 0x53, ++ MaterialEmissive = 0x54, ++ MaterialAmbient = 0x55, ++ MaterialDiffuse = 0x56, ++ MaterialSpecular = 0x57, ++ MaterialAlpha = 0x58, ++ MaterialSpecularCoef = 0x5b, ++ AmbientColor = 0x5c, ++ AmbientAlpha = 0x5d, ++ LightMode = 0x5e, ++ LightType0 = 0x5f, ++ LightType1 = 0x60, ++ LightType2 = 0x61, ++ LightType3 = 0x62, ++ Light0X = 0x63, ++ Light0Y, ++ Light0Z, ++ Light1X, ++ Light1Y, ++ Light1Z, ++ Light2X, ++ Light2Y, ++ Light2Z, ++ Light3X, ++ Light3Y, ++ Light3Z, ++ Light0DirectionX = 0x6f, ++ Light0DirectionY, ++ Light0DirectionZ, ++ Light1DirectionX, ++ Light1DirectionY, ++ Light1DirectionZ, ++ Light2DirectionX, ++ Light2DirectionY, ++ Light2DirectionZ, ++ Light3DirectionX, ++ Light3DirectionY, ++ Light3DirectionZ, ++ Light0ConstantAtten = 0x7b, ++ Light0LinearAtten, ++ Light0QuadtraticAtten, ++ Light1ConstantAtten, ++ Light1LinearAtten, ++ Light1QuadtraticAtten, ++ Light2ConstantAtten, ++ Light2LinearAtten, ++ Light2QuadtraticAtten, ++ Light3ConstantAtten, ++ Light3LinearAtten, ++ Light3QuadtraticAtten, ++ Light0ExponentAtten = 0x87, ++ Light1ExponentAtten, ++ Light2ExponentAtten, ++ Light3ExponentAtten, ++ Light0CutoffAtten = 0x8b, ++ Light1CutoffAtten, ++ Light2CutoffAtten, ++ Light3CutoffAtten, ++ Light0Ambient = 0x8f, ++ Light0Diffuse, ++ Light0Specular, ++ Light1Ambient, ++ Light1Diffuse, ++ Light1Specular, ++ Light2Ambient, ++ Light2Diffuse, ++ Light2Specular, ++ Light3Ambient, ++ Light3Diffuse, ++ Light3Specular, ++ Cull = 0x9b, ++ FrameBufPtr = 0x9c, ++ FrameBufWidth = 0x9d, ++ ZBufPtr = 0x9e, ++ ZBufWidth = 0x9f, ++ TexAddr0 = 0xa0, ++ TexAddr1, ++ TexAddr2, ++ TexAddr3, ++ TexAddr4, ++ TexAddr5, ++ TexAddr6, ++ TexAddr7, ++ TexBufWidth0 = 0xa8, ++ TexBufWidth1, ++ TexBufWidth2, ++ TexBufWidth3, ++ TexBufWidth4, ++ TexBufWidth5, ++ TexBufWidth6, ++ TexBufWidth7, ++ ClutAddr = 0xb0, ++ ClutAddrUpper = 0xb1, ++ TransferSrc, ++ TransferSrcW, ++ TransferDst, ++ TransferDstW, ++ TexSize0 = 0xb8, ++ TexSize1, ++ TexSize2, ++ TexSize3, ++ TexSize4, ++ TexSize5, ++ TexSize6, ++ TexSize7, ++ TexMapMode = 0xc0, ++ TexShadeLs = 0xc1, ++ TexMode = 0xc2, ++ TexFormat = 0xc3, ++ LoadClut = 0xc4, ++ ClutFormat = 0xc5, ++ TexFilter = 0xc6, ++ TexWrap = 0xc7, ++ TexLevel = 0xc8, ++ TexFunc = 0xc9, ++ TexEnvColor = 0xca, ++ TexFlush = 0xcb, ++ TexSync = 0xcc, ++ Fog1 = 0xcd, ++ Fog2 = 0xce, ++ FogColor = 0xcf, ++ TexLodSlope = 0xd0, ++ FramebufPixFormat = 0xd2, ++ ClearMode = 0xd3, ++ Scissor1 = 0xd4, ++ Scissor2 = 0xd5, ++ MinZ = 0xd6, ++ MaxZ = 0xd7, ++ ColorTest = 0xd8, ++ ColorRef = 0xd9, ++ ColorTestmask = 0xda, ++ AlphaTest = 0xdb, ++ StencilTest = 0xdc, ++ StencilOp = 0xdd, ++ ZTest = 0xde, ++ BlendMode = 0xdf, ++ BlendFixedA = 0xe0, ++ BlendFixedB = 0xe1, ++ Dith0 = 0xe2, ++ Dith1, ++ Dith2, ++ Dith3, ++ LogicOp = 0xe6, ++ ZWriteDisable = 0xe7, ++ MaskRgb = 0xe8, ++ MaskAlpha = 0xe9, ++ TransferStart = 0xea, ++ TransferSrcPos = 0xeb, ++ TransferDstPos = 0xec, ++ TransferSize = 0xee, ++ Vscx = 0xf0, ++ Vscy = 0xf1, ++ Vscz = 0xf2, ++ Vtcs = 0xf3, ++ Vtct = 0xf4, ++ Vtcq = 0xf5, ++ Vcv = 0xf6, ++ Vap = 0xf7, ++ Vfc = 0xf8, ++ Vscv = 0xf9, ++ ++ Unknown03 = 0x03, ++ Unknown0D = 0x0d, ++ Unknown11 = 0x11, ++ Unknown29 = 0x29, ++ Unknown34 = 0x34, ++ Unknown35 = 0x35, ++ Unknown39 = 0x39, ++ Unknown4E = 0x4e, ++ Unknown4F = 0x4f, ++ Unknown52 = 0x52, ++ Unknown59 = 0x59, ++ Unknown5A = 0x5a, ++ UnknownB6 = 0xb6, ++ UnknownB7 = 0xb7, ++ UnknownD1 = 0xd1, ++ UnknownED = 0xed, ++ UnknownEF = 0xef, ++ UnknownFA = 0xfa, ++ UnknownFB = 0xfb, ++ UnknownFC = 0xfc, ++ UnknownFD = 0xfd, ++ UnknownFE = 0xfe, ++ NopFF = 0xff, ++ } ++ ++ #[repr(i32)] ++ pub enum SceSysMemPartitionId { ++ SceKernelUnknownPartition = 0, ++ SceKernelPrimaryKernelPartition = 1, ++ SceKernelPrimaryUserPartition = 2, ++ SceKernelOtherKernelPartition1 = 3, ++ SceKernelOtherKernelPartition2 = 4, ++ SceKernelVshellPARTITION = 5, ++ SceKernelScUserPartition = 6, ++ SceKernelMeUserPartition = 7, ++ SceKernelExtendedScKernelPartition = 8, ++ SceKernelExtendedSc2KernelPartition = 9, ++ SceKernelExtendedMeKernelPartition = 10, ++ SceKernelVshellKernelPartition = 11, ++ SceKernelExtendedKernelPartition = 12, ++ } ++ ++ #[repr(i32)] ++ pub enum SceSysMemBlockTypes { ++ Low = 0, ++ High, ++ Addr, ++ } ++ ++ #[repr(u32)] ++ pub enum Interrupt { ++ Gpio = 4, ++ Ata = 5, ++ Umd = 6, ++ Mscm0 = 7, ++ Wlan = 8, ++ Audio = 10, ++ I2c = 12, ++ Sircs = 14, ++ Systimer0 = 15, ++ Systimer1 = 16, ++ Systimer2 = 17, ++ Systimer3 = 18, ++ Thread0 = 19, ++ Nand = 20, ++ Dmacplus = 21, ++ Dma0 = 22, ++ Dma1 = 23, ++ Memlmd = 24, ++ Ge = 25, ++ Vblank = 30, ++ Mecodec = 31, ++ Hpremote = 36, ++ Mscm1 = 60, ++ Mscm2 = 61, ++ Thread1 = 65, ++ Interrupt = 66, ++ } ++ ++ #[repr(u32)] ++ pub enum SubInterrupt { ++ Gpio = Interrupt::Gpio as u32, ++ Ata = Interrupt::Ata as u32, ++ Umd = Interrupt::Umd as u32, ++ Dmacplus = Interrupt::Dmacplus as u32, ++ Ge = Interrupt::Ge as u32, ++ Display = Interrupt::Vblank as u32, ++ } ++ ++ #[repr(u32)] ++ pub enum SceKernelIdListType { ++ Thread = 1, ++ Semaphore = 2, ++ EventFlag = 3, ++ Mbox = 4, ++ Vpl = 5, ++ Fpl = 6, ++ Mpipe = 7, ++ Callback = 8, ++ ThreadEventHandler = 9, ++ Alarm = 10, ++ VTimer = 11, ++ SleepThread = 64, ++ DelayThread = 65, ++ SuspendThread = 66, ++ DormantThread = 67, ++ } ++ ++ #[repr(i32)] ++ pub enum UsbCamResolution { ++ Px160_120 = 0, ++ Px176_144 = 1, ++ Px320_240 = 2, ++ Px352_288 = 3, ++ Px640_480 = 4, ++ Px1024_768 = 5, ++ Px1280_960 = 6, ++ Px480_272 = 7, ++ Px360_272 = 8, ++ } ++ ++ #[repr(i32)] ++ pub enum UsbCamResolutionEx { ++ Px160_120 = 0, ++ Px176_144 = 1, ++ Px320_240 = 2, ++ Px352_288 = 3, ++ Px360_272 = 4, ++ Px480_272 = 5, ++ Px640_480 = 6, ++ Px1024_768 = 7, ++ Px1280_960 = 8, ++ } ++ ++ #[repr(i32)] ++ pub enum UsbCamDelay { ++ NoDelay = 0, ++ Delay10Sec = 1, ++ Delay20Sec = 2, ++ Delay30Sec = 3, ++ } ++ ++ #[repr(i32)] ++ pub enum UsbCamFrameRate { ++ Fps3_75 = 0, ++ Fps5 = 1, ++ Fps7_5 = 2, ++ Fps10 = 3, ++ Fps15 = 4, ++ Fps20 = 5, ++ Fps30 = 6, ++ Fps60 = 7, ++ } ++ ++ #[repr(i32)] ++ pub enum UsbCamWb { ++ Auto = 0, ++ Daylight = 1, ++ Fluorescent = 2, ++ Incadescent = 3, ++ } ++ ++ #[repr(i32)] ++ pub enum UsbCamEffectMode { ++ Normal = 0, ++ Negative = 1, ++ Blackwhite = 2, ++ Sepia = 3, ++ Blue = 4, ++ Red = 5, ++ Green = 6, ++ } ++ ++ #[repr(i32)] ++ pub enum UsbCamEvLevel { ++ Pos2_0 = 0, ++ Pos1_7 = 1, ++ Pos1_5 = 2, ++ Pos1_3 = 3, ++ Pos1_0 = 4, ++ Pos0_7 = 5, ++ Pos0_5 = 6, ++ Pos0_3 = 7, ++ Zero = 8, ++ Neg0_3, ++ Neg0_5, ++ Neg0_7, ++ Neg1_0, ++ Neg1_3, ++ Neg1_5, ++ Neg1_7, ++ Neg2_0, ++ } ++ ++ #[repr(i32)] ++ pub enum RtcCheckValidError { ++ InvalidYear = -1, ++ InvalidMonth = -2, ++ InvalidDay = -3, ++ InvalidHour = -4, ++ InvalidMinutes = -5, ++ InvalidSeconds = -6, ++ InvalidMicroseconds = -7, ++ } ++ ++ #[repr(u32)] ++ pub enum PowerTick { ++ All = 0, ++ Suspend = 1, ++ Display = 6, ++ } ++ ++ #[repr(u32)] ++ pub enum IoAssignPerms { ++ RdWr = 0, ++ RdOnly = 1, ++ } ++ ++ #[repr(u32)] ++ pub enum IoWhence { ++ Set = 0, ++ Cur = 1, ++ End = 2, ++ } ++ ++ #[repr(u32)] ++ pub enum UmdType { ++ Game = 0x10, ++ Video = 0x20, ++ Audio = 0x40, ++ } ++ ++ #[repr(u32)] ++ pub enum GuPrimitive { ++ Points = 0, ++ Lines = 1, ++ LineStrip = 2, ++ Triangles = 3, ++ TriangleStrip = 4, ++ TriangleFan = 5, ++ Sprites = 6, ++ } ++ ++ #[repr(u32)] ++ pub enum PatchPrimitive { ++ Points = 0, ++ LineStrip = 2, ++ TriangleStrip = 4, ++ } ++ ++ #[repr(u32)] ++ pub enum GuState { ++ AlphaTest = 0, ++ DepthTest = 1, ++ ScissorTest = 2, ++ StencilTest = 3, ++ Blend = 4, ++ CullFace = 5, ++ Dither = 6, ++ Fog = 7, ++ ClipPlanes = 8, ++ Texture2D = 9, ++ Lighting = 10, ++ Light0 = 11, ++ Light1 = 12, ++ Light2 = 13, ++ Light3 = 14, ++ LineSmooth = 15, ++ PatchCullFace = 16, ++ ColorTest = 17, ++ ColorLogicOp = 18, ++ FaceNormalReverse = 19, ++ PatchFace = 20, ++ Fragment2X = 21, ++ } ++ ++ #[repr(u32)] ++ pub enum MatrixMode { ++ Projection = 0, ++ View = 1, ++ Model = 2, ++ Texture = 3, ++ } ++ ++ #[repr(u32)] ++ pub enum TexturePixelFormat { ++ Psm5650 = 0, ++ Psm5551 = 1, ++ Psm4444 = 2, ++ Psm8888 = 3, ++ PsmT4 = 4, ++ PsmT8 = 5, ++ PsmT16 = 6, ++ PsmT32 = 7, ++ PsmDxt1 = 8, ++ PsmDxt3 = 9, ++ PsmDxt5 = 10, ++ } ++ ++ #[repr(u32)] ++ pub enum SplineMode { ++ FillFill = 0, ++ OpenFill = 1, ++ FillOpen = 2, ++ OpenOpen = 3, ++ } ++ ++ #[repr(u32)] ++ pub enum ShadingModel { ++ Flat = 0, ++ Smooth = 1, ++ } ++ ++ #[repr(u32)] ++ pub enum LogicalOperation { ++ Clear = 0, ++ And = 1, ++ AndReverse = 2, ++ Copy = 3, ++ AndInverted = 4, ++ Noop = 5, ++ Xor = 6, ++ Or = 7, ++ Nor = 8, ++ Equiv = 9, ++ Inverted = 10, ++ OrReverse = 11, ++ CopyInverted = 12, ++ OrInverted = 13, ++ Nand = 14, ++ Set = 15, ++ } ++ ++ #[repr(u32)] ++ pub enum TextureFilter { ++ Nearest = 0, ++ Linear = 1, ++ NearestMipmapNearest = 4, ++ LinearMipmapNearest = 5, ++ NearestMipmapLinear = 6, ++ LinearMipmapLinear = 7, ++ } ++ ++ #[repr(u32)] ++ pub enum TextureMapMode { ++ TextureCoords = 0, ++ TextureMatrix = 1, ++ EnvironmentMap = 2, ++ } ++ ++ #[repr(u32)] ++ pub enum TextureLevelMode { ++ Auto = 0, ++ Const = 1, ++ Slope = 2, ++ } ++ ++ #[repr(u32)] ++ pub enum TextureProjectionMapMode { ++ Position = 0, ++ Uv = 1, ++ NormalizedNormal = 2, ++ Normal = 3, ++ } ++ ++ #[repr(u32)] ++ pub enum GuTexWrapMode { ++ Repeat = 0, ++ Clamp = 1, ++ } ++ ++ #[repr(u32)] ++ pub enum FrontFaceDirection { ++ Clockwise = 0, ++ CounterClockwise = 1, ++ } ++ ++ #[repr(u32)] ++ pub enum AlphaFunc { ++ Never = 0, ++ Always, ++ Equal, ++ NotEqual, ++ Less, ++ LessOrEqual, ++ Greater, ++ GreaterOrEqual, ++ } ++ ++ #[repr(u32)] ++ pub enum StencilFunc { ++ Never = 0, ++ Always, ++ Equal, ++ NotEqual, ++ Less, ++ LessOrEqual, ++ Greater, ++ GreaterOrEqual, ++ } ++ ++ #[repr(u32)] ++ pub enum ColorFunc { ++ Never = 0, ++ Always, ++ Equal, ++ NotEqual, ++ } ++ ++ #[repr(u32)] ++ pub enum DepthFunc { ++ Never = 0, ++ Always, ++ Equal, ++ NotEqual, ++ Less, ++ LessOrEqual, ++ Greater, ++ GreaterOrEqual, ++ } ++ ++ #[repr(u32)] ++ pub enum TextureEffect { ++ Modulate = 0, ++ Decal = 1, ++ Blend = 2, ++ Replace = 3, ++ Add = 4, ++ } ++ ++ #[repr(u32)] ++ pub enum TextureColorComponent { ++ Rgb = 0, ++ Rgba = 1, ++ } ++ ++ #[repr(u32)] ++ pub enum MipmapLevel { ++ None = 0, ++ Level1, ++ Level2, ++ Level3, ++ Level4, ++ Level5, ++ Level6, ++ Level7, ++ } ++ ++ #[repr(u32)] ++ pub enum BlendOp { ++ Add = 0, ++ Subtract = 1, ++ ReverseSubtract = 2, ++ Min = 3, ++ Max = 4, ++ Abs = 5, ++ } ++ ++ #[repr(u32)] ++ pub enum BlendSrc { ++ SrcColor = 0, ++ OneMinusSrcColor = 1, ++ SrcAlpha = 2, ++ OneMinusSrcAlpha = 3, ++ Fix = 10, ++ } ++ ++ #[repr(u32)] ++ pub enum BlendDst { ++ DstColor = 0, ++ OneMinusDstColor = 1, ++ DstAlpha = 4, ++ OneMinusDstAlpha = 5, ++ Fix = 10, ++ } ++ ++ #[repr(u32)] ++ pub enum StencilOperation { ++ Keep = 0, ++ Zero = 1, ++ Replace = 2, ++ Invert = 3, ++ Incr = 4, ++ Decr = 5, ++ } ++ ++ #[repr(u32)] ++ pub enum LightMode { ++ SingleColor = 0, ++ SeparateSpecularColor = 1, ++ } ++ ++ #[repr(u32)] ++ pub enum LightType { ++ Directional = 0, ++ Pointlight = 1, ++ Spotlight = 2, ++ } ++ ++ #[repr(u32)] ++ pub enum GuContextType { ++ Direct = 0, ++ Call = 1, ++ Send = 2, ++ } ++ ++ #[repr(u32)] ++ pub enum GuQueueMode { ++ Tail = 0, ++ Head = 1, ++ } ++ ++ #[repr(u32)] ++ pub enum GuSyncMode { ++ Finish = 0, ++ Signal = 1, ++ Done = 2, ++ List = 3, ++ Send = 4, ++ } ++ ++ #[repr(u32)] ++ pub enum GuSyncBehavior { ++ Wait = 0, ++ NoWait = 1, ++ } ++ ++ #[repr(u32)] ++ pub enum GuCallbackId { ++ Signal = 1, ++ Finish = 4, ++ } ++ ++ #[repr(u32)] ++ pub enum SignalBehavior { ++ Suspend = 1, ++ Continue = 2, ++ } ++ ++ #[repr(u32)] ++ pub enum ClutPixelFormat { ++ Psm5650 = 0, ++ Psm5551 = 1, ++ Psm4444 = 2, ++ Psm8888 = 3, ++ } ++ ++ #[repr(C)] ++ pub enum KeyType { ++ Directory = 1, ++ Integer = 2, ++ String = 3, ++ Bytes = 4, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityMsgDialogMode { ++ Error, ++ Text, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityMsgDialogPressed { ++ Unknown1, ++ Yes, ++ No, ++ Back, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityDialogButtonAccept { ++ Circle, ++ Cross, ++ } ++ ++ #[repr(u32)] ++ pub enum SceUtilityOskInputLanguage { ++ Default, ++ Japanese, ++ English, ++ French, ++ Spanish, ++ German, ++ Italian, ++ Dutch, ++ Portugese, ++ Russian, ++ Korean, ++ } ++ ++ #[repr(u32)] ++ pub enum SceUtilityOskInputType { ++ All, ++ LatinDigit, ++ LatinSymbol, ++ LatinLowercase = 4, ++ LatinUppercase = 8, ++ JapaneseDigit = 0x100, ++ JapaneseSymbol = 0x200, ++ JapaneseLowercase = 0x400, ++ JapaneseUppercase = 0x800, ++ JapaneseHiragana = 0x1000, ++ JapaneseHalfWidthKatakana = 0x2000, ++ JapaneseKatakana = 0x4000, ++ JapaneseKanji = 0x8000, ++ RussianLowercase = 0x10000, ++ RussianUppercase = 0x20000, ++ Korean = 0x40000, ++ Url = 0x80000, ++ } ++ ++ #[repr(u32)] ++ pub enum SceUtilityOskState { ++ None, ++ Initializing, ++ Initialized, ++ Visible, ++ Quit, ++ Finished, ++ } ++ ++ #[repr(u32)] ++ pub enum SceUtilityOskResult { ++ Unchanged, ++ Cancelled, ++ Changed, ++ } ++ ++ #[repr(u32)] ++ pub enum SystemParamLanguage { ++ Japanese, ++ English, ++ French, ++ Spanish, ++ German, ++ Italian, ++ Dutch, ++ Portugese, ++ Russian, ++ Korean, ++ ChineseTraditional, ++ ChineseSimplified, ++ } ++ ++ #[repr(u32)] ++ pub enum SystemParamId { ++ StringNickname = 1, ++ AdhocChannel, ++ WlanPowerSave, ++ DateFormat, ++ TimeFormat, ++ Timezone, ++ DaylightSavings, ++ Language, ++ Unknown, ++ } ++ ++ #[repr(u32)] ++ pub enum SystemParamAdhocChannel { ++ ChannelAutomatic = 0, ++ Channel1 = 1, ++ Channel6 = 6, ++ Channel11 = 11, ++ } ++ ++ #[repr(u32)] ++ pub enum SystemParamWlanPowerSaveState { ++ Off, ++ On, ++ } ++ ++ #[repr(u32)] ++ pub enum SystemParamDateFormat { ++ YYYYMMDD, ++ MMDDYYYY, ++ DDMMYYYY, ++ } ++ ++ #[repr(u32)] ++ pub enum SystemParamTimeFormat { ++ Hour24, ++ Hour12, ++ } ++ ++ #[repr(u32)] ++ pub enum SystemParamDaylightSavings { ++ Std, ++ Dst, ++ } ++ ++ #[repr(u32)] ++ pub enum AvModule { ++ AvCodec, ++ SasCore, ++ Atrac3Plus, ++ MpegBase, ++ Mp3, ++ Vaudio, ++ Aac, ++ G729, ++ } ++ ++ #[repr(u32)] ++ pub enum Module { ++ NetCommon = 0x100, ++ NetAdhoc, ++ NetInet, ++ NetParseUri, ++ NetHttp, ++ NetSsl, ++ ++ UsbPspCm = 0x200, ++ UsbMic, ++ UsbCam, ++ UsbGps, ++ ++ AvCodec = 0x300, ++ AvSascore, ++ AvAtrac3Plus, ++ AvMpegBase, ++ AvMp3, ++ AvVaudio, ++ AvAac, ++ AvG729, ++ ++ NpCommon = 0x400, ++ NpService, ++ NpMatching2, ++ NpDrm = 0x500, ++ ++ Irda = 0x600, ++ } ++ ++ #[repr(u32)] ++ pub enum NetModule { ++ NetCommon = 1, ++ NetAdhoc, ++ NetInet, ++ NetParseUri, ++ NetHttp, ++ NetSsl, ++ } ++ ++ #[repr(u32)] ++ pub enum UsbModule { ++ UsbPspCm = 1, ++ UsbAcc, ++ UsbMic, ++ UsbCam, ++ UsbGps, ++ } ++ ++ #[repr(u32)] ++ pub enum NetParam { ++ Name, ++ Ssid, ++ Secure, ++ WepKey, ++ IsStaticIp, ++ Ip, ++ NetMask, ++ Route, ++ ManualDns, ++ PrimaryDns, ++ SecondaryDns, ++ ProxyUser, ++ ProxyPass, ++ UseProxy, ++ ProxyServer, ++ ProxyPort, ++ Unknown1, ++ Unknown2, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityNetconfAction { ++ ConnectAP, ++ DisplayStatus, ++ ConnectAdhoc, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilitySavedataMode { ++ AutoLoad, ++ AutoSave, ++ Load, ++ Save, ++ ListLoad, ++ ListSave, ++ ListDelete, ++ Delete, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilitySavedataFocus { ++ Unknown1, ++ FirstList, ++ LastList, ++ Latest, ++ Oldest, ++ Unknown2, ++ Unknown3, ++ FirstEmpty, ++ LastEmpty, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityGameSharingMode { ++ Single = 1, ++ Multiple, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityGameSharingDataType { ++ File = 1, ++ Memory, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityHtmlViewerInterfaceMode { ++ Full, ++ Limited, ++ None, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityHtmlViewerCookieMode { ++ Disabled = 0, ++ Enabled, ++ Confirm, ++ Default, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityHtmlViewerTextSize { ++ Large, ++ Normal, ++ Small, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityHtmlViewerDisplayMode { ++ Normal, ++ Fit, ++ SmartFit, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityHtmlViewerConnectMode { ++ Last, ++ ManualOnce, ++ ManualAll, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityHtmlViewerDisconnectMode { ++ Enable, ++ Disable, ++ Confirm, ++ } ++ ++ #[repr(u32)] ++ pub enum ScePspnetAdhocPtpState { ++ Closed, ++ Listen, ++ SynSent, ++ SynReceived, ++ Established, ++ } ++ ++ #[repr(u32)] ++ pub enum AdhocMatchingMode { ++ Host = 1, ++ Client, ++ Ptp, ++ } ++ ++ #[repr(u32)] ++ pub enum ApctlState { ++ Disconnected, ++ Scanning, ++ Joining, ++ GettingIp, ++ GotIp, ++ EapAuth, ++ KeyExchange, ++ } ++ ++ #[repr(u32)] ++ pub enum ApctlEvent { ++ ConnectRequest, ++ ScanRequest, ++ ScanComplete, ++ Established, ++ GetIp, ++ DisconnectRequest, ++ Error, ++ Info, ++ EapAuth, ++ KeyExchange, ++ Reconnect, ++ } ++ ++ #[repr(u32)] ++ pub enum ApctlInfo { ++ ProfileName, ++ Bssid, ++ Ssid, ++ SsidLength, ++ SecurityType, ++ Strength, ++ Channel, ++ PowerSave, ++ Ip, ++ SubnetMask, ++ Gateway, ++ PrimaryDns, ++ SecondaryDns, ++ UseProxy, ++ ProxyUrl, ++ ProxyPort, ++ EapType, ++ StartBrowser, ++ Wifisp, ++ } ++ ++ #[repr(u32)] ++ pub enum ApctlInfoSecurityType { ++ None, ++ Wep, ++ Wpa, ++ } ++ ++ #[repr(u32)] ++ pub enum HttpMethod { ++ Get, ++ Post, ++ Head, ++ } ++ ++ #[repr(u32)] ++ pub enum HttpAuthType { ++ Basic, ++ Digest, ++ } ++} ++ ++s_paren! { ++ #[repr(transparent)] ++ pub struct SceUid(pub i32); ++ ++ #[repr(transparent)] ++ pub struct SceMpeg(*mut *mut c_void); ++ ++ #[repr(transparent)] ++ pub struct SceMpegStream(*mut c_void); ++ ++ #[repr(transparent)] ++ pub struct Mp3Handle(pub i32); ++ ++ #[repr(transparent)] ++ pub struct RegHandle(u32); ++ ++ #[repr(C)] ++ pub struct sockaddr(pub u32); ++ ++ #[repr(C)] ++ pub struct in_addr(pub u32); ++} ++ ++s! { ++ pub struct AudioInputParams { ++ pub unknown1: i32, ++ pub gain: i32, ++ pub unknown2: i32, ++ pub unknown3: i32, ++ pub unknown4: i32, ++ pub unknown5: i32, ++ } ++ ++ pub struct Atrac3BufferInfo { ++ pub puc_write_position_first_buf: *mut u8, ++ pub ui_writable_byte_first_buf: u32, ++ pub ui_min_write_byte_first_buf: u32, ++ pub ui_read_position_first_buf: u32, ++ pub puc_write_position_second_buf: *mut u8, ++ pub ui_writable_byte_second_buf: u32, ++ pub ui_min_write_byte_second_buf: u32, ++ pub ui_read_position_second_buf: u32, ++ } ++ ++ pub struct SceCtrlData { ++ pub timestamp: u32, ++ pub buttons: i32, ++ pub lx: u8, ++ pub ly: u8, ++ pub rsrv: [u8; 6], ++ } ++ ++ pub struct SceCtrlLatch { ++ pub ui_make: u32, ++ pub ui_break: u32, ++ pub ui_press: u32, ++ pub ui_release: u32, ++ } ++ ++ pub struct GeStack { ++ pub stack: [u32; 8], ++ } ++ ++ pub struct GeCallbackData { ++ pub signal_func: ::Option, ++ pub signal_arg: *mut c_void, ++ pub finish_func: ::Option, ++ pub finish_arg: *mut c_void, ++ } ++ ++ pub struct GeListArgs { ++ pub size: u32, ++ pub context: *mut GeContext, ++ pub num_stacks: u32, ++ pub stacks: *mut GeStack, ++ } ++ ++ pub struct GeBreakParam { ++ pub buf: [u32; 4], ++ } ++ ++ pub struct SceKernelLoadExecParam { ++ pub size: usize, ++ pub args: usize, ++ pub argp: *mut c_void, ++ pub key: *const u8, ++ } ++ ++ pub struct timeval { ++ pub tv_sec: i32, ++ pub tv_usec: i32, ++ } ++ ++ pub struct timezone { ++ pub tz_minutes_west: i32, ++ pub tz_dst_time: i32, ++ } ++ ++ pub struct IntrHandlerOptionParam { ++ size: i32, ++ entry: u32, ++ common: u32, ++ gp: u32, ++ intr_code: u16, ++ sub_count: u16, ++ intr_level: u16, ++ enabled: u16, ++ calls: u32, ++ field_1c: u32, ++ total_clock_lo: u32, ++ total_clock_hi: u32, ++ min_clock_lo: u32, ++ min_clock_hi: u32, ++ max_clock_lo: u32, ++ max_clock_hi: u32, ++ } ++ ++ pub struct SceKernelLMOption { ++ pub size: usize, ++ pub m_pid_text: SceUid, ++ pub m_pid_data: SceUid, ++ pub flags: u32, ++ pub position: u8, ++ pub access: u8, ++ pub c_reserved: [u8; 2usize], ++ } ++ ++ pub struct SceKernelSMOption { ++ pub size: usize, ++ pub m_pid_stack: SceUid, ++ pub stack_size: usize, ++ pub priority: i32, ++ pub attribute: u32, ++ } ++ ++ pub struct SceKernelModuleInfo { ++ pub size: usize, ++ pub n_segment: u8, ++ pub reserved: [u8; 3usize], ++ pub segment_addr: [i32; 4usize], ++ pub segment_size: [i32; 4usize], ++ pub entry_addr: u32, ++ pub gp_value: u32, ++ pub text_addr: u32, ++ pub text_size: u32, ++ pub data_size: u32, ++ pub bss_size: u32, ++ pub attribute: u16, ++ pub version: [u8; 2usize], ++ pub name: [u8; 28usize], ++ } ++ ++ pub struct DebugProfilerRegs { ++ pub enable: u32, ++ pub systemck: u32, ++ pub cpuck: u32, ++ pub internal: u32, ++ pub memory: u32, ++ pub copz: u32, ++ pub vfpu: u32, ++ pub sleep: u32, ++ pub bus_access: u32, ++ pub uncached_load: u32, ++ pub uncached_store: u32, ++ pub cached_load: u32, ++ pub cached_store: u32, ++ pub i_miss: u32, ++ pub d_miss: u32, ++ pub d_writeback: u32, ++ pub cop0_inst: u32, ++ pub fpu_inst: u32, ++ pub vfpu_inst: u32, ++ pub local_bus: u32, ++ } ++ ++ pub struct SceKernelSysClock { ++ pub low: u32, ++ pub hi: u32, ++ } ++ ++ pub struct SceKernelThreadOptParam { ++ pub size: usize, ++ pub stack_mpid: SceUid, ++ } ++ ++ pub struct SceKernelThreadInfo { ++ pub size: usize, ++ pub name: [u8; 32], ++ pub attr: u32, ++ pub status: i32, ++ pub entry: SceKernelThreadEntry, ++ pub stack: *mut c_void, ++ pub stack_size: i32, ++ pub gp_reg: *mut c_void, ++ pub init_priority: i32, ++ pub current_priority: i32, ++ pub wait_type: i32, ++ pub wait_id: SceUid, ++ pub wakeup_count: i32, ++ pub exit_status: i32, ++ pub run_clocks: SceKernelSysClock, ++ pub intr_preempt_count: u32, ++ pub thread_preempt_count: u32, ++ pub release_count: u32, ++ } ++ ++ pub struct SceKernelThreadRunStatus { ++ pub size: usize, ++ pub status: i32, ++ pub current_priority: i32, ++ pub wait_type: i32, ++ pub wait_id: i32, ++ pub wakeup_count: i32, ++ pub run_clocks: SceKernelSysClock, ++ pub intr_preempt_count: u32, ++ pub thread_preempt_count: u32, ++ pub release_count: u32, ++ } ++ ++ pub struct SceKernelSemaOptParam { ++ pub size: usize, ++ } ++ ++ pub struct SceKernelSemaInfo { ++ pub size: usize, ++ pub name: [u8; 32], ++ pub attr: u32, ++ pub init_count: i32, ++ pub current_count: i32, ++ pub max_count: i32, ++ pub num_wait_threads: i32, ++ } ++ ++ pub struct SceKernelEventFlagInfo { ++ pub size: usize, ++ pub name: [u8; 32], ++ pub attr: u32, ++ pub init_pattern: u32, ++ pub current_pattern: u32, ++ pub num_wait_threads: i32, ++ } ++ ++ pub struct SceKernelEventFlagOptParam { ++ pub size: usize, ++ } ++ ++ pub struct SceKernelMbxOptParam { ++ pub size: usize, ++ } ++ ++ pub struct SceKernelMbxInfo { ++ pub size: usize, ++ pub name: [u8; 32usize], ++ pub attr: u32, ++ pub num_wait_threads: i32, ++ pub num_messages: i32, ++ pub first_message: *mut c_void, ++ } ++ ++ pub struct SceKernelVTimerInfo { ++ pub size: usize, ++ pub name: [u8; 32], ++ pub active: i32, ++ pub base: SceKernelSysClock, ++ pub current: SceKernelSysClock, ++ pub schedule: SceKernelSysClock, ++ pub handler: SceKernelVTimerHandler, ++ pub common: *mut c_void, ++ } ++ ++ pub struct SceKernelThreadEventHandlerInfo { ++ pub size: usize, ++ pub name: [u8; 32], ++ pub thread_id: SceUid, ++ pub mask: i32, ++ pub handler: SceKernelThreadEventHandler, ++ pub common: *mut c_void, ++ } ++ ++ pub struct SceKernelAlarmInfo { ++ pub size: usize, ++ pub schedule: SceKernelSysClock, ++ pub handler: SceKernelAlarmHandler, ++ pub common: *mut c_void, ++ } ++ ++ pub struct SceKernelSystemStatus { ++ pub size: usize, ++ pub status: u32, ++ pub idle_clocks: SceKernelSysClock, ++ pub comes_out_of_idle_count: u32, ++ pub thread_switch_count: u32, ++ pub vfpu_switch_count: u32, ++ } ++ ++ pub struct SceKernelMppInfo { ++ pub size: usize, ++ pub name: [u8; 32], ++ pub attr: u32, ++ pub buf_size: i32, ++ pub free_size: i32, ++ pub num_send_wait_threads: i32, ++ pub num_receive_wait_threads: i32, ++ } ++ ++ pub struct SceKernelVplOptParam { ++ pub size: usize, ++ } ++ ++ pub struct SceKernelVplInfo { ++ pub size: usize, ++ pub name: [u8; 32], ++ pub attr: u32, ++ pub pool_size: i32, ++ pub free_size: i32, ++ pub num_wait_threads: i32, ++ } ++ ++ pub struct SceKernelFplOptParam { ++ pub size: usize, ++ } ++ ++ pub struct SceKernelFplInfo { ++ pub size: usize, ++ pub name: [u8; 32usize], ++ pub attr: u32, ++ pub block_size: i32, ++ pub num_blocks: i32, ++ pub free_blocks: i32, ++ pub num_wait_threads: i32, ++ } ++ ++ pub struct SceKernelVTimerOptParam { ++ pub size: usize, ++ } ++ ++ pub struct SceKernelCallbackInfo { ++ pub size: usize, ++ pub name: [u8; 32usize], ++ pub thread_id: SceUid, ++ pub callback: SceKernelCallbackFunction, ++ pub common: *mut c_void, ++ pub notify_count: i32, ++ pub notify_arg: i32, ++ } ++ ++ pub struct UsbCamSetupStillParam { ++ pub size: i32, ++ pub resolution: UsbCamResolution, ++ pub jpeg_size: i32, ++ pub reverse_flags: i32, ++ pub delay: UsbCamDelay, ++ pub comp_level: i32, ++ } ++ ++ pub struct UsbCamSetupStillExParam { ++ pub size: i32, ++ pub unk: u32, ++ pub resolution: UsbCamResolutionEx, ++ pub jpeg_size: i32, ++ pub comp_level: i32, ++ pub unk2: u32, ++ pub unk3: u32, ++ pub flip: i32, ++ pub mirror: i32, ++ pub delay: UsbCamDelay, ++ pub unk4: [u32; 5usize], ++ } ++ ++ pub struct UsbCamSetupVideoParam { ++ pub size: i32, ++ pub resolution: UsbCamResolution, ++ pub framerate: UsbCamFrameRate, ++ pub white_balance: UsbCamWb, ++ pub saturation: i32, ++ pub brightness: i32, ++ pub contrast: i32, ++ pub sharpness: i32, ++ pub effect_mode: UsbCamEffectMode, ++ pub frame_size: i32, ++ pub unk: u32, ++ pub evl_evel: UsbCamEvLevel, ++ } ++ ++ pub struct UsbCamSetupVideoExParam { ++ pub size: i32, ++ pub unk: u32, ++ pub resolution: UsbCamResolutionEx, ++ pub framerate: UsbCamFrameRate, ++ pub unk2: u32, ++ pub unk3: u32, ++ pub white_balance: UsbCamWb, ++ pub saturation: i32, ++ pub brightness: i32, ++ pub contrast: i32, ++ pub sharpness: i32, ++ pub unk4: u32, ++ pub unk5: u32, ++ pub unk6: [u32; 3usize], ++ pub effect_mode: UsbCamEffectMode, ++ pub unk7: u32, ++ pub unk8: u32, ++ pub unk9: u32, ++ pub unk10: u32, ++ pub unk11: u32, ++ pub frame_size: i32, ++ pub unk12: u32, ++ pub ev_level: UsbCamEvLevel, ++ } ++ ++ pub struct ScePspDateTime { ++ pub year: u16, ++ pub month: u16, ++ pub day: u16, ++ pub hour: u16, ++ pub minutes: u16, ++ pub seconds: u16, ++ pub microseconds: u32, ++ } ++ ++ pub struct SceIoStat { ++ pub st_mode: i32, ++ pub st_attr: i32, ++ pub st_size: i64, ++ pub st_ctime: ScePspDateTime, ++ pub st_atime: ScePspDateTime, ++ pub st_mtime: ScePspDateTime, ++ pub st_private: [u32; 6usize], ++ } ++ ++ pub struct UmdInfo { ++ pub size: u32, ++ pub type_: UmdType, ++ } ++ ++ pub struct SceMpegRingbuffer { ++ pub packets: i32, ++ pub unk0: u32, ++ pub unk1: u32, ++ pub unk2: u32, ++ pub unk3: u32, ++ pub data: *mut c_void, ++ pub callback: SceMpegRingbufferCb, ++ pub cb_param: *mut c_void, ++ pub unk4: u32, ++ pub unk5: u32, ++ pub sce_mpeg: *mut c_void, ++ } ++ ++ pub struct SceMpegAu { ++ pub pts_msb: u32, ++ pub pts: u32, ++ pub dts_msb: u32, ++ pub dts: u32, ++ pub es_buffer: u32, ++ pub au_size: u32, ++ } ++ ++ pub struct SceMpegAvcMode { ++ pub unk0: i32, ++ pub pixel_format: super::DisplayPixelFormat, ++ } ++ ++ #[repr(align(64))] ++ pub struct SceMpegLLI { ++ pub src: *mut c_void, ++ pub dst: *mut c_void, ++ pub next: *mut c_void, ++ pub size: i32, ++ } ++ ++ #[repr(align(64))] ++ pub struct SceMpegYCrCbBuffer { ++ pub frame_buffer_height16: i32, ++ pub frame_buffer_width16: i32, ++ pub unknown: i32, ++ pub unknown2: i32, ++ pub y_buffer: *mut c_void, ++ pub y_buffer2: *mut c_void, ++ pub cr_buffer: *mut c_void, ++ pub cb_buffer: *mut c_void, ++ pub cr_buffer2: *mut c_void, ++ pub cb_buffer2: *mut c_void, ++ ++ pub frame_height: i32, ++ pub frame_width: i32, ++ pub frame_buffer_width: i32, ++ pub unknown3: [i32; 11usize], ++ } ++ ++ pub struct ScePspSRect { ++ pub x: i16, ++ pub y: i16, ++ pub w: i16, ++ pub h: i16, ++ } ++ ++ pub struct ScePspIRect { ++ pub x: i32, ++ pub y: i32, ++ pub w: i32, ++ pub h: i32, ++ } ++ ++ pub struct ScePspL64Rect { ++ pub x: u64, ++ pub y: u64, ++ pub w: u64, ++ pub h: u64, ++ } ++ ++ pub struct ScePspSVector2 { ++ pub x: i16, ++ pub y: i16, ++ } ++ ++ pub struct ScePspIVector2 { ++ pub x: i32, ++ pub y: i32, ++ } ++ ++ pub struct ScePspL64Vector2 { ++ pub x: u64, ++ pub y: u64, ++ } ++ ++ pub struct ScePspSVector3 { ++ pub x: i16, ++ pub y: i16, ++ pub z: i16, ++ } ++ ++ pub struct ScePspIVector3 { ++ pub x: i32, ++ pub y: i32, ++ pub z: i32, ++ } ++ ++ pub struct ScePspL64Vector3 { ++ pub x: u64, ++ pub y: u64, ++ pub z: u64, ++ } ++ ++ pub struct ScePspSVector4 { ++ pub x: i16, ++ pub y: i16, ++ pub z: i16, ++ pub w: i16, ++ } ++ ++ pub struct ScePspIVector4 { ++ pub x: i32, ++ pub y: i32, ++ pub z: i32, ++ pub w: i32, ++ } ++ ++ pub struct ScePspL64Vector4 { ++ pub x: u64, ++ pub y: u64, ++ pub z: u64, ++ pub w: u64, ++ } ++ ++ pub struct ScePspIMatrix2 { ++ pub x: ScePspIVector2, ++ pub y: ScePspIVector2, ++ } ++ ++ pub struct ScePspIMatrix3 { ++ pub x: ScePspIVector3, ++ pub y: ScePspIVector3, ++ pub z: ScePspIVector3, ++ } ++ ++ #[repr(align(16))] ++ pub struct ScePspIMatrix4 { ++ pub x: ScePspIVector4, ++ pub y: ScePspIVector4, ++ pub z: ScePspIVector4, ++ pub w: ScePspIVector4, ++ } ++ ++ pub struct ScePspIMatrix4Unaligned { ++ pub x: ScePspIVector4, ++ pub y: ScePspIVector4, ++ pub z: ScePspIVector4, ++ pub w: ScePspIVector4, ++ } ++ ++ pub struct SceMp3InitArg { ++ pub mp3_stream_start: u32, ++ pub unk1: u32, ++ pub mp3_stream_end: u32, ++ pub unk2: u32, ++ pub mp3_buf: *mut c_void, ++ pub mp3_buf_size: i32, ++ pub pcm_buf: *mut c_void, ++ pub pcm_buf_size: i32, ++ } ++ ++ pub struct OpenPSID { ++ pub data: [u8; 16usize], ++ } ++ ++ pub struct UtilityDialogCommon { ++ pub size: u32, ++ pub language: SystemParamLanguage, ++ pub button_accept: UtilityDialogButtonAccept, ++ pub graphics_thread: i32, ++ pub access_thread: i32, ++ pub font_thread: i32, ++ pub sound_thread: i32, ++ pub result: i32, ++ pub reserved: [i32; 4usize], ++ } ++ ++ pub struct UtilityNetconfAdhoc { ++ pub name: [u8; 8usize], ++ pub timeout: u32, ++ } ++ ++ pub struct UtilityNetconfData { ++ pub base: UtilityDialogCommon, ++ pub action: UtilityNetconfAction, ++ pub adhocparam: *mut UtilityNetconfAdhoc, ++ pub hotspot: i32, ++ pub hotspot_connected: i32, ++ pub wifisp: i32, ++ } ++ ++ pub struct UtilitySavedataFileData { ++ pub buf: *mut c_void, ++ pub buf_size: usize, ++ pub size: usize, ++ pub unknown: i32, ++ } ++ ++ pub struct UtilitySavedataListSaveNewData { ++ pub icon0: UtilitySavedataFileData, ++ pub title: *mut u8, ++ } ++ ++ pub struct UtilityGameSharingParams { ++ pub base: UtilityDialogCommon, ++ pub unknown1: i32, ++ pub unknown2: i32, ++ pub name: [u8; 8usize], ++ pub unknown3: i32, ++ pub unknown4: i32, ++ pub unknown5: i32, ++ pub result: i32, ++ pub filepath: *mut u8, ++ pub mode: UtilityGameSharingMode, ++ pub datatype: UtilityGameSharingDataType, ++ pub data: *mut c_void, ++ pub datasize: u32, ++ } ++ ++ pub struct UtilityHtmlViewerParam { ++ pub base: UtilityDialogCommon, ++ pub memaddr: *mut c_void, ++ pub memsize: u32, ++ pub unknown1: i32, ++ pub unknown2: i32, ++ pub initialurl: *mut u8, ++ pub numtabs: u32, ++ pub interfacemode: UtilityHtmlViewerInterfaceMode, ++ pub options: i32, ++ pub dldirname: *mut u8, ++ pub dlfilename: *mut u8, ++ pub uldirname: *mut u8, ++ pub ulfilename: *mut u8, ++ pub cookiemode: UtilityHtmlViewerCookieMode, ++ pub unknown3: u32, ++ pub homeurl: *mut u8, ++ pub textsize: UtilityHtmlViewerTextSize, ++ pub displaymode: UtilityHtmlViewerDisplayMode, ++ pub connectmode: UtilityHtmlViewerConnectMode, ++ pub disconnectmode: UtilityHtmlViewerDisconnectMode, ++ pub memused: u32, ++ pub unknown4: [i32; 10usize], ++ } ++ ++ pub struct SceUtilityOskData { ++ pub unk_00: i32, ++ pub unk_04: i32, ++ pub language: SceUtilityOskInputLanguage, ++ pub unk_12: i32, ++ pub inputtype: SceUtilityOskInputType, ++ pub lines: i32, ++ pub unk_24: i32, ++ pub desc: *mut u16, ++ pub intext: *mut u16, ++ pub outtextlength: i32, ++ pub outtext: *mut u16, ++ pub result: SceUtilityOskResult, ++ pub outtextlimit: i32, ++ } ++ ++ pub struct SceUtilityOskParams { ++ pub base: UtilityDialogCommon, ++ pub datacount: i32, ++ pub data: *mut SceUtilityOskData, ++ pub state: SceUtilityOskState, ++ pub unk_60: i32, ++ } ++ ++ pub struct SceNetMallocStat { ++ pub pool: i32, ++ pub maximum: i32, ++ pub free: i32, ++ } ++ ++ pub struct SceNetAdhocctlAdhocId { ++ pub unknown: i32, ++ pub adhoc_id: [u8; 9usize], ++ pub unk: [u8; 3usize], ++ } ++ ++ pub struct SceNetAdhocctlScanInfo { ++ pub next: *mut SceNetAdhocctlScanInfo, ++ pub channel: i32, ++ pub name: [u8; 8usize], ++ pub bssid: [u8; 6usize], ++ pub unknown: [u8; 2usize], ++ pub unknown2: i32, ++ } ++ ++ pub struct SceNetAdhocctlGameModeInfo { ++ pub count: i32, ++ pub macs: [[u8; 6usize]; 16usize], ++ } ++ ++ pub struct SceNetAdhocPtpStat { ++ pub next: *mut SceNetAdhocPtpStat, ++ pub ptp_id: i32, ++ pub mac: [u8; 6usize], ++ pub peermac: [u8; 6usize], ++ pub port: u16, ++ pub peerport: u16, ++ pub sent_data: u32, ++ pub rcvd_data: u32, ++ pub state: ScePspnetAdhocPtpState, ++ } ++ ++ pub struct SceNetAdhocPdpStat { ++ pub next: *mut SceNetAdhocPdpStat, ++ pub pdp_id: i32, ++ pub mac: [u8; 6usize], ++ pub port: u16, ++ pub rcvd_data: u32, ++ } ++ ++ pub struct AdhocPoolStat { ++ pub size: i32, ++ pub maxsize: i32, ++ pub freesize: i32, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ pub struct GeContext { ++ pub context: [u32; 512], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct SceKernelUtilsSha1Context { ++ pub h: [u32; 5usize], ++ pub us_remains: u16, ++ pub us_computed: u16, ++ pub ull_total_len: u64, ++ pub buf: [u8; 64usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct SceKernelUtilsMt19937Context { ++ pub count: u32, ++ pub state: [u32; 624usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct SceKernelUtilsMd5Context { ++ pub h: [u32; 4usize], ++ pub pad: u32, ++ pub us_remains: u16, ++ pub us_computed: u16, ++ pub ull_total_len: u64, ++ pub buf: [u8; 64usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct SceIoDirent { ++ pub d_stat: SceIoStat, ++ pub d_name: [u8; 256usize], ++ pub d_private: *mut c_void, ++ pub dummy: i32, ++ } ++ ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub struct ScePspFRect { ++ pub x: f32, ++ pub y: f32, ++ pub w: f32, ++ pub h: f32, ++ } ++ ++ #[repr(align(16))] ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub struct ScePspFVector3 { ++ pub x: f32, ++ pub y: f32, ++ pub z: f32, ++ } ++ ++ #[repr(align(16))] ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub struct ScePspFVector4 { ++ pub x: f32, ++ pub y: f32, ++ pub z: f32, ++ pub w: f32, ++ } ++ ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub struct ScePspFVector4Unaligned { ++ pub x: f32, ++ pub y: f32, ++ pub z: f32, ++ pub w: f32, ++ } ++ ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub struct ScePspFVector2 { ++ pub x: f32, ++ pub y: f32, ++ } ++ ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub struct ScePspFMatrix2 { ++ pub x: ScePspFVector2, ++ pub y: ScePspFVector2, ++ } ++ ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub struct ScePspFMatrix3 { ++ pub x: ScePspFVector3, ++ pub y: ScePspFVector3, ++ pub z: ScePspFVector3, ++ } ++ ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ #[repr(align(16))] ++ pub struct ScePspFMatrix4 { ++ pub x: ScePspFVector4, ++ pub y: ScePspFVector4, ++ pub z: ScePspFVector4, ++ pub w: ScePspFVector4, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct ScePspFMatrix4Unaligned { ++ pub x: ScePspFVector4, ++ pub y: ScePspFVector4, ++ pub z: ScePspFVector4, ++ pub w: ScePspFVector4, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub union ScePspVector3 { ++ pub fv: ScePspFVector3, ++ pub iv: ScePspIVector3, ++ pub f: [f32; 3usize], ++ pub i: [i32; 3usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub union ScePspVector4 { ++ pub fv: ScePspFVector4, ++ pub iv: ScePspIVector4, ++ pub qw: u128, ++ pub f: [f32; 4usize], ++ pub i: [i32; 4usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub union ScePspMatrix2 { ++ pub fm: ScePspFMatrix2, ++ pub im: ScePspIMatrix2, ++ pub fv: [ScePspFVector2; 2usize], ++ pub iv: [ScePspIVector2; 2usize], ++ pub v: [ScePspVector2; 2usize], ++ pub f: [[f32; 2usize]; 2usize], ++ pub i: [[i32; 2usize]; 2usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub union ScePspMatrix3 { ++ pub fm: ScePspFMatrix3, ++ pub im: ScePspIMatrix3, ++ pub fv: [ScePspFVector3; 3usize], ++ pub iv: [ScePspIVector3; 3usize], ++ pub v: [ScePspVector3; 3usize], ++ pub f: [[f32; 3usize]; 3usize], ++ pub i: [[i32; 3usize]; 3usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub union ScePspVector2 { ++ pub fv: ScePspFVector2, ++ pub iv: ScePspIVector2, ++ pub f: [f32; 2usize], ++ pub i: [i32; 2usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub union ScePspMatrix4 { ++ pub fm: ScePspFMatrix4, ++ pub im: ScePspIMatrix4, ++ pub fv: [ScePspFVector4; 4usize], ++ pub iv: [ScePspIVector4; 4usize], ++ pub v: [ScePspVector4; 4usize], ++ pub f: [[f32; 4usize]; 4usize], ++ pub i: [[i32; 4usize]; 4usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct Key { ++ pub key_type: KeyType, ++ pub name: [u8; 256usize], ++ pub name_len: u32, ++ pub unk2: u32, ++ pub unk3: u32, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct UtilityMsgDialogParams { ++ pub base: UtilityDialogCommon, ++ pub unknown: i32, ++ pub mode: UtilityMsgDialogMode, ++ pub error_value: u32, ++ pub message: [u8; 512usize], ++ pub options: i32, ++ pub button_pressed: UtilityMsgDialogPressed, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub union UtilityNetData { ++ pub as_uint: u32, ++ pub as_string: [u8; 128usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct UtilitySavedataSFOParam { ++ pub title: [u8; 128usize], ++ pub savedata_title: [u8; 128usize], ++ pub detail: [u8; 1024usize], ++ pub parental_level: u8, ++ pub unknown: [u8; 3usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct SceUtilitySavedataParam { ++ pub base: UtilityDialogCommon, ++ pub mode: UtilitySavedataMode, ++ pub unknown1: i32, ++ pub overwrite: i32, ++ pub game_name: [u8; 13usize], ++ pub reserved: [u8; 3usize], ++ pub save_name: [u8; 20usize], ++ pub save_name_list: *mut [u8; 20usize], ++ pub file_name: [u8; 13usize], ++ pub reserved1: [u8; 3usize], ++ pub data_buf: *mut c_void, ++ pub data_buf_size: usize, ++ pub data_size: usize, ++ pub sfo_param: UtilitySavedataSFOParam, ++ pub icon0_file_data: UtilitySavedataFileData, ++ pub icon1_file_data: UtilitySavedataFileData, ++ pub pic1_file_data: UtilitySavedataFileData, ++ pub snd0_file_data: UtilitySavedataFileData, ++ pub new_data: *mut UtilitySavedataListSaveNewData, ++ pub focus: UtilitySavedataFocus, ++ pub unknown2: [i32; 4usize], ++ pub key: [u8; 16], ++ pub unknown3: [u8; 20], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct SceNetAdhocctlPeerInfo { ++ pub next: *mut SceNetAdhocctlPeerInfo, ++ pub nickname: [u8; 128usize], ++ pub mac: [u8; 6usize], ++ pub unknown: [u8; 6usize], ++ pub timestamp: u32, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct SceNetAdhocctlParams { ++ pub channel: i32, ++ pub name: [u8; 8usize], ++ pub bssid: [u8; 6usize], ++ pub nickname: [u8; 128usize], ++ } ++ ++ #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))] ++ pub union SceNetApctlInfo { ++ pub name: [u8; 64usize], ++ pub bssid: [u8; 6usize], ++ pub ssid: [u8; 32usize], ++ pub ssid_length: u32, ++ pub security_type: u32, ++ pub strength: u8, ++ pub channel: u8, ++ pub power_save: u8, ++ pub ip: [u8; 16usize], ++ pub sub_net_mask: [u8; 16usize], ++ pub gateway: [u8; 16usize], ++ pub primary_dns: [u8; 16usize], ++ pub secondary_dns: [u8; 16usize], ++ pub use_proxy: u32, ++ pub proxy_url: [u8; 128usize], ++ pub proxy_port: u16, ++ pub eap_type: u32, ++ pub start_browser: u32, ++ pub wifisp: u32, ++ } ++} ++ ++pub const INT_MIN: c_int = -2147483648; ++pub const INT_MAX: c_int = 2147483647; ++ ++pub const AUDIO_VOLUME_MAX: u32 = 0x8000; ++pub const AUDIO_CHANNEL_MAX: u32 = 8; ++pub const AUDIO_NEXT_CHANNEL: i32 = -1; ++pub const AUDIO_SAMPLE_MIN: u32 = 64; ++pub const AUDIO_SAMPLE_MAX: u32 = 65472; ++ ++pub const PSP_CTRL_SELECT: i32 = 0x000001; ++pub const PSP_CTRL_START: i32 = 0x000008; ++pub const PSP_CTRL_UP: i32 = 0x000010; ++pub const PSP_CTRL_RIGHT: i32 = 0x000020; ++pub const PSP_CTRL_DOWN: i32 = 0x000040; ++pub const PSP_CTRL_LEFT: i32 = 0x000080; ++pub const PSP_CTRL_LTRIGGER: i32 = 0x000100; ++pub const PSP_CTRL_RTRIGGER: i32 = 0x000200; ++pub const PSP_CTRL_TRIANGLE: i32 = 0x001000; ++pub const PSP_CTRL_CIRCLE: i32 = 0x002000; ++pub const PSP_CTRL_CROSS: i32 = 0x004000; ++pub const PSP_CTRL_SQUARE: i32 = 0x008000; ++pub const PSP_CTRL_HOME: i32 = 0x010000; ++pub const PSP_CTRL_HOLD: i32 = 0x020000; ++pub const PSP_CTRL_NOTE: i32 = 0x800000; ++pub const PSP_CTRL_SCREEN: i32 = 0x400000; ++pub const PSP_CTRL_VOLUP: i32 = 0x100000; ++pub const PSP_CTRL_VOLDOWN: i32 = 0x200000; ++pub const PSP_CTRL_WLAN_UP: i32 = 0x040000; ++pub const PSP_CTRL_REMOTE: i32 = 0x080000; ++pub const PSP_CTRL_DISC: i32 = 0x1000000; ++pub const PSP_CTRL_MS: i32 = 0x2000000; ++ ++pub const USB_CAM_PID: i32 = 0x282; ++pub const USB_BUS_DRIVER_NAME: &str = "USBBusDriver"; ++pub const USB_CAM_DRIVER_NAME: &str = "USBCamDriver"; ++pub const USB_CAM_MIC_DRIVER_NAME: &str = "USBCamMicDriver"; ++pub const USB_STOR_DRIVER_NAME: &str = "USBStor_Driver"; ++ ++pub const ACTIVATED: i32 = 0x200; ++pub const CONNECTED: i32 = 0x020; ++pub const ESTABLISHED: i32 = 0x002; ++ ++pub const USB_CAM_FLIP: i32 = 1; ++pub const USB_CAM_MIRROR: i32 = 0x100; ++ ++pub const THREAD_ATTR_VFPU: i32 = 0x00004000; ++pub const THREAD_ATTR_USER: i32 = 0x80000000; ++pub const THREAD_ATTR_USBWLAN: i32 = 0xa0000000; ++pub const THREAD_ATTR_VSH: i32 = 0xc0000000; ++pub const THREAD_ATTR_SCRATCH_SRAM: i32 = 0x00008000; ++pub const THREAD_ATTR_NO_FILLSTACK: i32 = 0x00100000; ++pub const THREAD_ATTR_CLEAR_STACK: i32 = 0x00200000; ++ ++pub const EVENT_WAIT_MULTIPLE: i32 = 0x200; ++ ++pub const EVENT_WAIT_AND: i32 = 0; ++pub const EVENT_WAIT_OR: i32 = 1; ++pub const EVENT_WAIT_CLEAR: i32 = 0x20; ++ ++pub const POWER_INFO_POWER_SWITCH: i32 = 0x80000000; ++pub const POWER_INFO_HOLD_SWITCH: i32 = 0x40000000; ++pub const POWER_INFO_STANDBY: i32 = 0x00080000; ++pub const POWER_INFO_RESUME_COMPLETE: i32 = 0x00040000; ++pub const POWER_INFO_RESUMING: i32 = 0x00020000; ++pub const POWER_INFO_SUSPENDING: i32 = 0x00010000; ++pub const POWER_INFO_AC_POWER: i32 = 0x00001000; ++pub const POWER_INFO_BATTERY_LOW: i32 = 0x00000100; ++pub const POWER_INFO_BATTERY_EXIST: i32 = 0x00000080; ++pub const POWER_INFO_BATTERY_POWER: i32 = 0x0000007; ++ ++pub const FIO_S_IFLNK: i32 = 0x4000; ++pub const FIO_S_IFDIR: i32 = 0x1000; ++pub const FIO_S_IFREG: i32 = 0x2000; ++pub const FIO_S_ISUID: i32 = 0x0800; ++pub const FIO_S_ISGID: i32 = 0x0400; ++pub const FIO_S_ISVTX: i32 = 0x0200; ++pub const FIO_S_IRUSR: i32 = 0x0100; ++pub const FIO_S_IWUSR: i32 = 0x0080; ++pub const FIO_S_IXUSR: i32 = 0x0040; ++pub const FIO_S_IRGRP: i32 = 0x0020; ++pub const FIO_S_IWGRP: i32 = 0x0010; ++pub const FIO_S_IXGRP: i32 = 0x0008; ++pub const FIO_S_IROTH: i32 = 0x0004; ++pub const FIO_S_IWOTH: i32 = 0x0002; ++pub const FIO_S_IXOTH: i32 = 0x0001; ++ ++pub const FIO_SO_IFLNK: i32 = 0x0008; ++pub const FIO_SO_IFDIR: i32 = 0x0010; ++pub const FIO_SO_IFREG: i32 = 0x0020; ++pub const FIO_SO_IROTH: i32 = 0x0004; ++pub const FIO_SO_IWOTH: i32 = 0x0002; ++pub const FIO_SO_IXOTH: i32 = 0x0001; ++ ++pub const PSP_O_RD_ONLY: i32 = 0x0001; ++pub const PSP_O_WR_ONLY: i32 = 0x0002; ++pub const PSP_O_RD_WR: i32 = 0x0003; ++pub const PSP_O_NBLOCK: i32 = 0x0004; ++pub const PSP_O_DIR: i32 = 0x0008; ++pub const PSP_O_APPEND: i32 = 0x0100; ++pub const PSP_O_CREAT: i32 = 0x0200; ++pub const PSP_O_TRUNC: i32 = 0x0400; ++pub const PSP_O_EXCL: i32 = 0x0800; ++pub const PSP_O_NO_WAIT: i32 = 0x8000; ++ ++pub const UMD_NOT_PRESENT: i32 = 0x01; ++pub const UMD_PRESENT: i32 = 0x02; ++pub const UMD_CHANGED: i32 = 0x04; ++pub const UMD_INITING: i32 = 0x08; ++pub const UMD_INITED: i32 = 0x10; ++pub const UMD_READY: i32 = 0x20; ++ ++pub const PLAY_PAUSE: i32 = 0x1; ++pub const FORWARD: i32 = 0x4; ++pub const BACK: i32 = 0x8; ++pub const VOL_UP: i32 = 0x10; ++pub const VOL_DOWN: i32 = 0x20; ++pub const HOLD: i32 = 0x80; ++ ++pub const GU_PI: f32 = 3.141593; ++ ++pub const GU_TEXTURE_8BIT: i32 = 1; ++pub const GU_TEXTURE_16BIT: i32 = 2; ++pub const GU_TEXTURE_32BITF: i32 = 3; ++pub const GU_COLOR_5650: i32 = 4 << 2; ++pub const GU_COLOR_5551: i32 = 5 << 2; ++pub const GU_COLOR_4444: i32 = 6 << 2; ++pub const GU_COLOR_8888: i32 = 7 << 2; ++pub const GU_NORMAL_8BIT: i32 = 1 << 5; ++pub const GU_NORMAL_16BIT: i32 = 2 << 5; ++pub const GU_NORMAL_32BITF: i32 = 3 << 5; ++pub const GU_VERTEX_8BIT: i32 = 1 << 7; ++pub const GU_VERTEX_16BIT: i32 = 2 << 7; ++pub const GU_VERTEX_32BITF: i32 = 3 << 7; ++pub const GU_WEIGHT_8BIT: i32 = 1 << 9; ++pub const GU_WEIGHT_16BIT: i32 = 2 << 9; ++pub const GU_WEIGHT_32BITF: i32 = 3 << 9; ++pub const GU_INDEX_8BIT: i32 = 1 << 11; ++pub const GU_INDEX_16BIT: i32 = 2 << 11; ++pub const GU_WEIGHTS1: i32 = (((1 - 1) & 7) << 14) as i32; ++pub const GU_WEIGHTS2: i32 = (((2 - 1) & 7) << 14) as i32; ++pub const GU_WEIGHTS3: i32 = (((3 - 1) & 7) << 14) as i32; ++pub const GU_WEIGHTS4: i32 = (((4 - 1) & 7) << 14) as i32; ++pub const GU_WEIGHTS5: i32 = (((5 - 1) & 7) << 14) as i32; ++pub const GU_WEIGHTS6: i32 = (((6 - 1) & 7) << 14) as i32; ++pub const GU_WEIGHTS7: i32 = (((7 - 1) & 7) << 14) as i32; ++pub const GU_WEIGHTS8: i32 = (((8 - 1) & 7) << 14) as i32; ++pub const GU_VERTICES1: i32 = (((1 - 1) & 7) << 18) as i32; ++pub const GU_VERTICES2: i32 = (((2 - 1) & 7) << 18) as i32; ++pub const GU_VERTICES3: i32 = (((3 - 1) & 7) << 18) as i32; ++pub const GU_VERTICES4: i32 = (((4 - 1) & 7) << 18) as i32; ++pub const GU_VERTICES5: i32 = (((5 - 1) & 7) << 18) as i32; ++pub const GU_VERTICES6: i32 = (((6 - 1) & 7) << 18) as i32; ++pub const GU_VERTICES7: i32 = (((7 - 1) & 7) << 18) as i32; ++pub const GU_VERTICES8: i32 = (((8 - 1) & 7) << 18) as i32; ++pub const GU_TRANSFORM_2D: i32 = 1 << 23; ++pub const GU_TRANSFORM_3D: i32 = 0; ++ ++pub const GU_COLOR_BUFFER_BIT: i32 = 1; ++pub const GU_STENCIL_BUFFER_BIT: i32 = 2; ++pub const GU_DEPTH_BUFFER_BIT: i32 = 4; ++pub const GU_FAST_CLEAR_BIT: i32 = 16; ++ ++pub const GU_AMBIENT: i32 = 1; ++pub const GU_DIFFUSE: i32 = 2; ++pub const GU_SPECULAR: i32 = 4; ++pub const GU_UNKNOWN_LIGHT_COMPONENT: i32 = 8; ++ ++pub const SYSTEM_REGISTRY: [u8; 7] = *b"/system"; ++pub const REG_KEYNAME_SIZE: u32 = 27; ++ ++pub const UTILITY_MSGDIALOG_ERROR: i32 = 0; ++pub const UTILITY_MSGDIALOG_TEXT: i32 = 1; ++pub const UTILITY_MSGDIALOG_YES_NO_BUTTONS: i32 = 0x10; ++pub const UTILITY_MSGDIALOG_DEFAULT_NO: i32 = 0x100; ++ ++pub const UTILITY_HTMLVIEWER_OPEN_SCE_START_PAGE: i32 = 0x000001; ++pub const UTILITY_HTMLVIEWER_DISABLE_STARTUP_LIMITS: i32 = 0x000002; ++pub const UTILITY_HTMLVIEWER_DISABLE_EXIT_DIALOG: i32 = 0x000004; ++pub const UTILITY_HTMLVIEWER_DISABLE_CURSOR: i32 = 0x000008; ++pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_COMPLETE_DIALOG: i32 = 0x000010; ++pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_START_DIALOG: i32 = 0x000020; ++pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_DESTINATION_DIALOG: i32 = ++ 0x000040; ++pub const UTILITY_HTMLVIEWER_LOCK_DOWNLOAD_DESTINATION_DIALOG: i32 = 0x000080; ++pub const UTILITY_HTMLVIEWER_DISABLE_TAB_DISPLAY: i32 = 0x000100; ++pub const UTILITY_HTMLVIEWER_ENABLE_ANALOG_HOLD: i32 = 0x000200; ++pub const UTILITY_HTMLVIEWER_ENABLE_FLASH: i32 = 0x000400; ++pub const UTILITY_HTMLVIEWER_DISABLE_LRTRIGGER: i32 = 0x000800; ++ ++extern "C" { ++ pub fn sceAudioChReserve( ++ channel: i32, ++ sample_count: i32, ++ format: AudioFormat, ++ ) -> i32; ++ pub fn sceAudioChRelease(channel: i32) -> i32; ++ pub fn sceAudioOutput(channel: i32, vol: i32, buf: *mut c_void) -> i32; ++ pub fn sceAudioOutputBlocking( ++ channel: i32, ++ vol: i32, ++ buf: *mut c_void, ++ ) -> i32; ++ pub fn sceAudioOutputPanned( ++ channel: i32, ++ left_vol: i32, ++ right_vol: i32, ++ buf: *mut c_void, ++ ) -> i32; ++ pub fn sceAudioOutputPannedBlocking( ++ channel: i32, ++ left_vol: i32, ++ right_vol: i32, ++ buf: *mut c_void, ++ ) -> i32; ++ pub fn sceAudioGetChannelRestLen(channel: i32) -> i32; ++ pub fn sceAudioGetChannelRestLength(channel: i32) -> i32; ++ pub fn sceAudioSetChannelDataLen(channel: i32, sample_count: i32) -> i32; ++ pub fn sceAudioChangeChannelConfig( ++ channel: i32, ++ format: AudioFormat, ++ ) -> i32; ++ pub fn sceAudioChangeChannelVolume( ++ channel: i32, ++ left_vol: i32, ++ right_vol: i32, ++ ) -> i32; ++ pub fn sceAudioOutput2Reserve(sample_count: i32) -> i32; ++ pub fn sceAudioOutput2Release() -> i32; ++ pub fn sceAudioOutput2ChangeLength(sample_count: i32) -> i32; ++ pub fn sceAudioOutput2OutputBlocking(vol: i32, buf: *mut c_void) -> i32; ++ pub fn sceAudioOutput2GetRestSample() -> i32; ++ pub fn sceAudioSRCChReserve( ++ sample_count: i32, ++ freq: AudioOutputFrequency, ++ channels: i32, ++ ) -> i32; ++ pub fn sceAudioSRCChRelease() -> i32; ++ pub fn sceAudioSRCOutputBlocking(vol: i32, buf: *mut c_void) -> i32; ++ pub fn sceAudioInputInit(unknown1: i32, gain: i32, unknown2: i32) -> i32; ++ pub fn sceAudioInputInitEx(params: *mut AudioInputParams) -> i32; ++ pub fn sceAudioInputBlocking( ++ sample_count: i32, ++ freq: AudioInputFrequency, ++ buf: *mut c_void, ++ ); ++ pub fn sceAudioInput( ++ sample_count: i32, ++ freq: AudioInputFrequency, ++ buf: *mut c_void, ++ ); ++ pub fn sceAudioGetInputLength() -> i32; ++ pub fn sceAudioWaitInputEnd() -> i32; ++ pub fn sceAudioPollInputEnd() -> i32; ++ ++ pub fn sceAtracGetAtracID(ui_codec_type: u32) -> i32; ++ pub fn sceAtracSetDataAndGetID(buf: *mut c_void, bufsize: usize) -> i32; ++ pub fn sceAtracDecodeData( ++ atrac_id: i32, ++ out_samples: *mut u16, ++ out_n: *mut i32, ++ out_end: *mut i32, ++ out_remain_frame: *mut i32, ++ ) -> i32; ++ pub fn sceAtracGetRemainFrame( ++ atrac_id: i32, ++ out_remain_frame: *mut i32, ++ ) -> i32; ++ pub fn sceAtracGetStreamDataInfo( ++ atrac_id: i32, ++ write_pointer: *mut *mut u8, ++ available_bytes: *mut u32, ++ read_offset: *mut u32, ++ ) -> i32; ++ pub fn sceAtracAddStreamData(atrac_id: i32, bytes_to_add: u32) -> i32; ++ pub fn sceAtracGetBitrate(atrac_id: i32, out_bitrate: *mut i32) -> i32; ++ pub fn sceAtracSetLoopNum(atrac_id: i32, nloops: i32) -> i32; ++ pub fn sceAtracReleaseAtracID(atrac_id: i32) -> i32; ++ pub fn sceAtracGetNextSample(atrac_id: i32, out_n: *mut i32) -> i32; ++ pub fn sceAtracGetMaxSample(atrac_id: i32, out_max: *mut i32) -> i32; ++ pub fn sceAtracGetBufferInfoForReseting( ++ atrac_id: i32, ++ ui_sample: u32, ++ pbuffer_info: *mut Atrac3BufferInfo, ++ ) -> i32; ++ pub fn sceAtracGetChannel(atrac_id: i32, pui_channel: *mut u32) -> i32; ++ pub fn sceAtracGetInternalErrorInfo( ++ atrac_id: i32, ++ pi_result: *mut i32, ++ ) -> i32; ++ pub fn sceAtracGetLoopStatus( ++ atrac_id: i32, ++ pi_loop_num: *mut i32, ++ pui_loop_status: *mut u32, ++ ) -> i32; ++ pub fn sceAtracGetNextDecodePosition( ++ atrac_id: i32, ++ pui_sample_position: *mut u32, ++ ) -> i32; ++ pub fn sceAtracGetSecondBufferInfo( ++ atrac_id: i32, ++ pui_position: *mut u32, ++ pui_data_byte: *mut u32, ++ ) -> i32; ++ pub fn sceAtracGetSoundSample( ++ atrac_id: i32, ++ pi_end_sample: *mut i32, ++ pi_loop_start_sample: *mut i32, ++ pi_loop_end_sample: *mut i32, ++ ) -> i32; ++ pub fn sceAtracResetPlayPosition( ++ atrac_id: i32, ++ ui_sample: u32, ++ ui_write_byte_first_buf: u32, ++ ui_write_byte_second_buf: u32, ++ ) -> i32; ++ pub fn sceAtracSetData( ++ atrac_id: i32, ++ puc_buffer_addr: *mut u8, ++ ui_buffer_byte: u32, ++ ) -> i32; ++ pub fn sceAtracSetHalfwayBuffer( ++ atrac_id: i32, ++ puc_buffer_addr: *mut u8, ++ ui_read_byte: u32, ++ ui_buffer_byte: u32, ++ ) -> i32; ++ pub fn sceAtracSetHalfwayBufferAndGetID( ++ puc_buffer_addr: *mut u8, ++ ui_read_byte: u32, ++ ui_buffer_byte: u32, ++ ) -> i32; ++ pub fn sceAtracSetSecondBuffer( ++ atrac_id: i32, ++ puc_second_buffer_addr: *mut u8, ++ ui_second_buffer_byte: u32, ++ ) -> i32; ++ ++ pub fn sceCtrlSetSamplingCycle(cycle: i32) -> i32; ++ pub fn sceCtrlGetSamplingCycle(pcycle: *mut i32) -> i32; ++ pub fn sceCtrlSetSamplingMode(mode: CtrlMode) -> i32; ++ pub fn sceCtrlGetSamplingMode(pmode: *mut i32) -> i32; ++ pub fn sceCtrlPeekBufferPositive( ++ pad_data: *mut SceCtrlData, ++ count: i32, ++ ) -> i32; ++ pub fn sceCtrlPeekBufferNegative( ++ pad_data: *mut SceCtrlData, ++ count: i32, ++ ) -> i32; ++ pub fn sceCtrlReadBufferPositive( ++ pad_data: *mut SceCtrlData, ++ count: i32, ++ ) -> i32; ++ pub fn sceCtrlReadBufferNegative( ++ pad_data: *mut SceCtrlData, ++ count: i32, ++ ) -> i32; ++ pub fn sceCtrlPeekLatch(latch_data: *mut SceCtrlLatch) -> i32; ++ pub fn sceCtrlReadLatch(latch_data: *mut SceCtrlLatch) -> i32; ++ pub fn sceCtrlSetIdleCancelThreshold(idlereset: i32, idleback: i32) ++ -> i32; ++ pub fn sceCtrlGetIdleCancelThreshold( ++ idlereset: *mut i32, ++ idleback: *mut i32, ++ ) -> i32; ++ ++ pub fn sceDisplaySetMode( ++ mode: DisplayMode, ++ width: usize, ++ height: usize, ++ ) -> u32; ++ pub fn sceDisplayGetMode( ++ pmode: *mut i32, ++ pwidth: *mut i32, ++ pheight: *mut i32, ++ ) -> i32; ++ pub fn sceDisplaySetFrameBuf( ++ top_addr: *const u8, ++ buffer_width: usize, ++ pixel_format: DisplayPixelFormat, ++ sync: DisplaySetBufSync, ++ ) -> u32; ++ pub fn sceDisplayGetFrameBuf( ++ top_addr: *mut *mut c_void, ++ buffer_width: *mut usize, ++ pixel_format: *mut DisplayPixelFormat, ++ sync: DisplaySetBufSync, ++ ) -> i32; ++ pub fn sceDisplayGetVcount() -> u32; ++ pub fn sceDisplayWaitVblank() -> i32; ++ pub fn sceDisplayWaitVblankCB() -> i32; ++ pub fn sceDisplayWaitVblankStart() -> i32; ++ pub fn sceDisplayWaitVblankStartCB() -> i32; ++ pub fn sceDisplayGetAccumulatedHcount() -> i32; ++ pub fn sceDisplayGetCurrentHcount() -> i32; ++ pub fn sceDisplayGetFramePerSec() -> f32; ++ pub fn sceDisplayIsForeground() -> i32; ++ pub fn sceDisplayIsVblank() -> i32; ++ ++ pub fn sceGeEdramGetSize() -> u32; ++ pub fn sceGeEdramGetAddr() -> *mut u8; ++ pub fn sceGeEdramSetAddrTranslation(width: i32) -> i32; ++ pub fn sceGeGetCmd(cmd: i32) -> u32; ++ pub fn sceGeGetMtx(type_: GeMatrixType, matrix: *mut c_void) -> i32; ++ pub fn sceGeGetStack(stack_id: i32, stack: *mut GeStack) -> i32; ++ pub fn sceGeSaveContext(context: *mut GeContext) -> i32; ++ pub fn sceGeRestoreContext(context: *const GeContext) -> i32; ++ pub fn sceGeListEnQueue( ++ list: *const c_void, ++ stall: *mut c_void, ++ cbid: i32, ++ arg: *mut GeListArgs, ++ ) -> i32; ++ pub fn sceGeListEnQueueHead( ++ list: *const c_void, ++ stall: *mut c_void, ++ cbid: i32, ++ arg: *mut GeListArgs, ++ ) -> i32; ++ pub fn sceGeListDeQueue(qid: i32) -> i32; ++ pub fn sceGeListUpdateStallAddr(qid: i32, stall: *mut c_void) -> i32; ++ pub fn sceGeListSync(qid: i32, sync_type: i32) -> GeListState; ++ pub fn sceGeDrawSync(sync_type: i32) -> GeListState; ++ pub fn sceGeBreak(mode: i32, p_param: *mut GeBreakParam) -> i32; ++ pub fn sceGeContinue() -> i32; ++ pub fn sceGeSetCallback(cb: *mut GeCallbackData) -> i32; ++ pub fn sceGeUnsetCallback(cbid: i32) -> i32; ++ ++ pub fn sceKernelExitGame(); ++ pub fn sceKernelRegisterExitCallback(id: SceUid) -> i32; ++ pub fn sceKernelLoadExec( ++ file: *const u8, ++ param: *mut SceKernelLoadExecParam, ++ ) -> i32; ++ ++ pub fn sceKernelAllocPartitionMemory( ++ partition: SceSysMemPartitionId, ++ name: *const u8, ++ type_: SceSysMemBlockTypes, ++ size: u32, ++ addr: *mut c_void, ++ ) -> SceUid; ++ pub fn sceKernelGetBlockHeadAddr(blockid: SceUid) -> *mut c_void; ++ pub fn sceKernelFreePartitionMemory(blockid: SceUid) -> i32; ++ pub fn sceKernelTotalFreeMemSize() -> usize; ++ pub fn sceKernelMaxFreeMemSize() -> usize; ++ pub fn sceKernelDevkitVersion() -> u32; ++ pub fn sceKernelSetCompiledSdkVersion(version: u32) -> i32; ++ pub fn sceKernelGetCompiledSdkVersion() -> u32; ++ ++ pub fn sceKernelLibcTime(t: *mut i32) -> i32; ++ pub fn sceKernelLibcClock() -> u32; ++ pub fn sceKernelLibcGettimeofday( ++ tp: *mut timeval, ++ tzp: *mut timezone, ++ ) -> i32; ++ pub fn sceKernelDcacheWritebackAll(); ++ pub fn sceKernelDcacheWritebackInvalidateAll(); ++ pub fn sceKernelDcacheWritebackRange(p: *const c_void, size: u32); ++ pub fn sceKernelDcacheWritebackInvalidateRange( ++ p: *const c_void, ++ size: u32, ++ ); ++ pub fn sceKernelDcacheInvalidateRange(p: *const c_void, size: u32); ++ pub fn sceKernelIcacheInvalidateAll(); ++ pub fn sceKernelIcacheInvalidateRange(p: *const c_void, size: u32); ++ pub fn sceKernelUtilsMt19937Init( ++ ctx: *mut SceKernelUtilsMt19937Context, ++ seed: u32, ++ ) -> i32; ++ pub fn sceKernelUtilsMt19937UInt( ++ ctx: *mut SceKernelUtilsMt19937Context, ++ ) -> u32; ++ pub fn sceKernelUtilsMd5Digest( ++ data: *mut u8, ++ size: u32, ++ digest: *mut u8, ++ ) -> i32; ++ pub fn sceKernelUtilsMd5BlockInit( ++ ctx: *mut SceKernelUtilsMd5Context, ++ ) -> i32; ++ pub fn sceKernelUtilsMd5BlockUpdate( ++ ctx: *mut SceKernelUtilsMd5Context, ++ data: *mut u8, ++ size: u32, ++ ) -> i32; ++ pub fn sceKernelUtilsMd5BlockResult( ++ ctx: *mut SceKernelUtilsMd5Context, ++ digest: *mut u8, ++ ) -> i32; ++ pub fn sceKernelUtilsSha1Digest( ++ data: *mut u8, ++ size: u32, ++ digest: *mut u8, ++ ) -> i32; ++ pub fn sceKernelUtilsSha1BlockInit( ++ ctx: *mut SceKernelUtilsSha1Context, ++ ) -> i32; ++ pub fn sceKernelUtilsSha1BlockUpdate( ++ ctx: *mut SceKernelUtilsSha1Context, ++ data: *mut u8, ++ size: u32, ++ ) -> i32; ++ pub fn sceKernelUtilsSha1BlockResult( ++ ctx: *mut SceKernelUtilsSha1Context, ++ digest: *mut u8, ++ ) -> i32; ++ ++ pub fn sceKernelRegisterSubIntrHandler( ++ int_no: i32, ++ no: i32, ++ handler: *mut c_void, ++ arg: *mut c_void, ++ ) -> i32; ++ pub fn sceKernelReleaseSubIntrHandler(int_no: i32, no: i32) -> i32; ++ pub fn sceKernelEnableSubIntr(int_no: i32, no: i32) -> i32; ++ pub fn sceKernelDisableSubIntr(int_no: i32, no: i32) -> i32; ++ pub fn QueryIntrHandlerInfo( ++ intr_code: SceUid, ++ sub_intr_code: SceUid, ++ data: *mut IntrHandlerOptionParam, ++ ) -> i32; ++ ++ pub fn sceKernelCpuSuspendIntr() -> u32; ++ pub fn sceKernelCpuResumeIntr(flags: u32); ++ pub fn sceKernelCpuResumeIntrWithSync(flags: u32); ++ pub fn sceKernelIsCpuIntrSuspended(flags: u32) -> i32; ++ pub fn sceKernelIsCpuIntrEnable() -> i32; ++ ++ pub fn sceKernelLoadModule( ++ path: *const u8, ++ flags: i32, ++ option: *mut SceKernelLMOption, ++ ) -> SceUid; ++ pub fn sceKernelLoadModuleMs( ++ path: *const u8, ++ flags: i32, ++ option: *mut SceKernelLMOption, ++ ) -> SceUid; ++ pub fn sceKernelLoadModuleByID( ++ fid: SceUid, ++ flags: i32, ++ option: *mut SceKernelLMOption, ++ ) -> SceUid; ++ pub fn sceKernelLoadModuleBufferUsbWlan( ++ buf_size: usize, ++ buf: *mut c_void, ++ flags: i32, ++ option: *mut SceKernelLMOption, ++ ) -> SceUid; ++ pub fn sceKernelStartModule( ++ mod_id: SceUid, ++ arg_size: usize, ++ argp: *mut c_void, ++ status: *mut i32, ++ option: *mut SceKernelSMOption, ++ ) -> i32; ++ pub fn sceKernelStopModule( ++ mod_id: SceUid, ++ arg_size: usize, ++ argp: *mut c_void, ++ status: *mut i32, ++ option: *mut SceKernelSMOption, ++ ) -> i32; ++ pub fn sceKernelUnloadModule(mod_id: SceUid) -> i32; ++ pub fn sceKernelSelfStopUnloadModule( ++ unknown: i32, ++ arg_size: usize, ++ argp: *mut c_void, ++ ) -> i32; ++ pub fn sceKernelStopUnloadSelfModule( ++ arg_size: usize, ++ argp: *mut c_void, ++ status: *mut i32, ++ option: *mut SceKernelSMOption, ++ ) -> i32; ++ pub fn sceKernelQueryModuleInfo( ++ mod_id: SceUid, ++ info: *mut SceKernelModuleInfo, ++ ) -> i32; ++ pub fn sceKernelGetModuleIdList( ++ read_buf: *mut SceUid, ++ read_buf_size: i32, ++ id_count: *mut i32, ++ ) -> i32; ++ ++ pub fn sceKernelVolatileMemLock( ++ unk: i32, ++ ptr: *mut *mut c_void, ++ size: *mut i32, ++ ) -> i32; ++ pub fn sceKernelVolatileMemTryLock( ++ unk: i32, ++ ptr: *mut *mut c_void, ++ size: *mut i32, ++ ) -> i32; ++ pub fn sceKernelVolatileMemUnlock(unk: i32) -> i32; ++ ++ pub fn sceKernelStdin() -> SceUid; ++ pub fn sceKernelStdout() -> SceUid; ++ pub fn sceKernelStderr() -> SceUid; ++ ++ pub fn sceKernelGetThreadmanIdType(uid: SceUid) -> SceKernelIdListType; ++ pub fn sceKernelCreateThread( ++ name: *const u8, ++ entry: SceKernelThreadEntry, ++ init_priority: i32, ++ stack_size: i32, ++ attr: i32, ++ option: *mut SceKernelThreadOptParam, ++ ) -> SceUid; ++ pub fn sceKernelDeleteThread(thid: SceUid) -> i32; ++ pub fn sceKernelStartThread( ++ id: SceUid, ++ arg_len: usize, ++ arg_p: *mut c_void, ++ ) -> i32; ++ pub fn sceKernelExitThread(status: i32) -> i32; ++ pub fn sceKernelExitDeleteThread(status: i32) -> i32; ++ pub fn sceKernelTerminateThread(thid: SceUid) -> i32; ++ pub fn sceKernelTerminateDeleteThread(thid: SceUid) -> i32; ++ pub fn sceKernelSuspendDispatchThread() -> i32; ++ pub fn sceKernelResumeDispatchThread(state: i32) -> i32; ++ pub fn sceKernelSleepThread() -> i32; ++ pub fn sceKernelSleepThreadCB() -> i32; ++ pub fn sceKernelWakeupThread(thid: SceUid) -> i32; ++ pub fn sceKernelCancelWakeupThread(thid: SceUid) -> i32; ++ pub fn sceKernelSuspendThread(thid: SceUid) -> i32; ++ pub fn sceKernelResumeThread(thid: SceUid) -> i32; ++ pub fn sceKernelWaitThreadEnd(thid: SceUid, timeout: *mut u32) -> i32; ++ pub fn sceKernelWaitThreadEndCB(thid: SceUid, timeout: *mut u32) -> i32; ++ pub fn sceKernelDelayThread(delay: u32) -> i32; ++ pub fn sceKernelDelayThreadCB(delay: u32) -> i32; ++ pub fn sceKernelDelaySysClockThread(delay: *mut SceKernelSysClock) -> i32; ++ pub fn sceKernelDelaySysClockThreadCB( ++ delay: *mut SceKernelSysClock, ++ ) -> i32; ++ pub fn sceKernelChangeCurrentThreadAttr(unknown: i32, attr: i32) -> i32; ++ pub fn sceKernelChangeThreadPriority(thid: SceUid, priority: i32) -> i32; ++ pub fn sceKernelRotateThreadReadyQueue(priority: i32) -> i32; ++ pub fn sceKernelReleaseWaitThread(thid: SceUid) -> i32; ++ pub fn sceKernelGetThreadId() -> i32; ++ pub fn sceKernelGetThreadCurrentPriority() -> i32; ++ pub fn sceKernelGetThreadExitStatus(thid: SceUid) -> i32; ++ pub fn sceKernelCheckThreadStack() -> i32; ++ pub fn sceKernelGetThreadStackFreeSize(thid: SceUid) -> i32; ++ pub fn sceKernelReferThreadStatus( ++ thid: SceUid, ++ info: *mut SceKernelThreadInfo, ++ ) -> i32; ++ pub fn sceKernelReferThreadRunStatus( ++ thid: SceUid, ++ status: *mut SceKernelThreadRunStatus, ++ ) -> i32; ++ pub fn sceKernelCreateSema( ++ name: *const u8, ++ attr: u32, ++ init_val: i32, ++ max_val: i32, ++ option: *mut SceKernelSemaOptParam, ++ ) -> SceUid; ++ pub fn sceKernelDeleteSema(sema_id: SceUid) -> i32; ++ pub fn sceKernelSignalSema(sema_id: SceUid, signal: i32) -> i32; ++ pub fn sceKernelWaitSema( ++ sema_id: SceUid, ++ signal: i32, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelWaitSemaCB( ++ sema_id: SceUid, ++ signal: i32, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelPollSema(sema_id: SceUid, signal: i32) -> i32; ++ pub fn sceKernelReferSemaStatus( ++ sema_id: SceUid, ++ info: *mut SceKernelSemaInfo, ++ ) -> i32; ++ pub fn sceKernelCreateEventFlag( ++ name: *const u8, ++ attr: i32, ++ bits: i32, ++ opt: *mut SceKernelEventFlagOptParam, ++ ) -> SceUid; ++ pub fn sceKernelSetEventFlag(ev_id: SceUid, bits: u32) -> i32; ++ pub fn sceKernelClearEventFlag(ev_id: SceUid, bits: u32) -> i32; ++ pub fn sceKernelPollEventFlag( ++ ev_id: SceUid, ++ bits: u32, ++ wait: i32, ++ out_bits: *mut u32, ++ ) -> i32; ++ pub fn sceKernelWaitEventFlag( ++ ev_id: SceUid, ++ bits: u32, ++ wait: i32, ++ out_bits: *mut u32, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelWaitEventFlagCB( ++ ev_id: SceUid, ++ bits: u32, ++ wait: i32, ++ out_bits: *mut u32, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelDeleteEventFlag(ev_id: SceUid) -> i32; ++ pub fn sceKernelReferEventFlagStatus( ++ event: SceUid, ++ status: *mut SceKernelEventFlagInfo, ++ ) -> i32; ++ pub fn sceKernelCreateMbx( ++ name: *const u8, ++ attr: u32, ++ option: *mut SceKernelMbxOptParam, ++ ) -> SceUid; ++ pub fn sceKernelDeleteMbx(mbx_id: SceUid) -> i32; ++ pub fn sceKernelSendMbx(mbx_id: SceUid, message: *mut c_void) -> i32; ++ pub fn sceKernelReceiveMbx( ++ mbx_id: SceUid, ++ message: *mut *mut c_void, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelReceiveMbxCB( ++ mbx_id: SceUid, ++ message: *mut *mut c_void, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelPollMbx(mbx_id: SceUid, pmessage: *mut *mut c_void) ++ -> i32; ++ pub fn sceKernelCancelReceiveMbx(mbx_id: SceUid, num: *mut i32) -> i32; ++ pub fn sceKernelReferMbxStatus( ++ mbx_id: SceUid, ++ info: *mut SceKernelMbxInfo, ++ ) -> i32; ++ pub fn sceKernelSetAlarm( ++ clock: u32, ++ handler: SceKernelAlarmHandler, ++ common: *mut c_void, ++ ) -> SceUid; ++ pub fn sceKernelSetSysClockAlarm( ++ clock: *mut SceKernelSysClock, ++ handler: *mut SceKernelAlarmHandler, ++ common: *mut c_void, ++ ) -> SceUid; ++ pub fn sceKernelCancelAlarm(alarm_id: SceUid) -> i32; ++ pub fn sceKernelReferAlarmStatus( ++ alarm_id: SceUid, ++ info: *mut SceKernelAlarmInfo, ++ ) -> i32; ++ pub fn sceKernelCreateCallback( ++ name: *const u8, ++ func: SceKernelCallbackFunction, ++ arg: *mut c_void, ++ ) -> SceUid; ++ pub fn sceKernelReferCallbackStatus( ++ cb: SceUid, ++ status: *mut SceKernelCallbackInfo, ++ ) -> i32; ++ pub fn sceKernelDeleteCallback(cb: SceUid) -> i32; ++ pub fn sceKernelNotifyCallback(cb: SceUid, arg2: i32) -> i32; ++ pub fn sceKernelCancelCallback(cb: SceUid) -> i32; ++ pub fn sceKernelGetCallbackCount(cb: SceUid) -> i32; ++ pub fn sceKernelCheckCallback() -> i32; ++ pub fn sceKernelGetThreadmanIdList( ++ type_: SceKernelIdListType, ++ read_buf: *mut SceUid, ++ read_buf_size: i32, ++ id_count: *mut i32, ++ ) -> i32; ++ pub fn sceKernelReferSystemStatus( ++ status: *mut SceKernelSystemStatus, ++ ) -> i32; ++ pub fn sceKernelCreateMsgPipe( ++ name: *const u8, ++ part: i32, ++ attr: i32, ++ unk1: *mut c_void, ++ opt: *mut c_void, ++ ) -> SceUid; ++ pub fn sceKernelDeleteMsgPipe(uid: SceUid) -> i32; ++ pub fn sceKernelSendMsgPipe( ++ uid: SceUid, ++ message: *mut c_void, ++ size: u32, ++ unk1: i32, ++ unk2: *mut c_void, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelSendMsgPipeCB( ++ uid: SceUid, ++ message: *mut c_void, ++ size: u32, ++ unk1: i32, ++ unk2: *mut c_void, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelTrySendMsgPipe( ++ uid: SceUid, ++ message: *mut c_void, ++ size: u32, ++ unk1: i32, ++ unk2: *mut c_void, ++ ) -> i32; ++ pub fn sceKernelReceiveMsgPipe( ++ uid: SceUid, ++ message: *mut c_void, ++ size: u32, ++ unk1: i32, ++ unk2: *mut c_void, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelReceiveMsgPipeCB( ++ uid: SceUid, ++ message: *mut c_void, ++ size: u32, ++ unk1: i32, ++ unk2: *mut c_void, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelTryReceiveMsgPipe( ++ uid: SceUid, ++ message: *mut c_void, ++ size: u32, ++ unk1: i32, ++ unk2: *mut c_void, ++ ) -> i32; ++ pub fn sceKernelCancelMsgPipe( ++ uid: SceUid, ++ send: *mut i32, ++ recv: *mut i32, ++ ) -> i32; ++ pub fn sceKernelReferMsgPipeStatus( ++ uid: SceUid, ++ info: *mut SceKernelMppInfo, ++ ) -> i32; ++ pub fn sceKernelCreateVpl( ++ name: *const u8, ++ part: i32, ++ attr: i32, ++ size: u32, ++ opt: *mut SceKernelVplOptParam, ++ ) -> SceUid; ++ pub fn sceKernelDeleteVpl(uid: SceUid) -> i32; ++ pub fn sceKernelAllocateVpl( ++ uid: SceUid, ++ size: u32, ++ data: *mut *mut c_void, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelAllocateVplCB( ++ uid: SceUid, ++ size: u32, ++ data: *mut *mut c_void, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelTryAllocateVpl( ++ uid: SceUid, ++ size: u32, ++ data: *mut *mut c_void, ++ ) -> i32; ++ pub fn sceKernelFreeVpl(uid: SceUid, data: *mut c_void) -> i32; ++ pub fn sceKernelCancelVpl(uid: SceUid, num: *mut i32) -> i32; ++ pub fn sceKernelReferVplStatus( ++ uid: SceUid, ++ info: *mut SceKernelVplInfo, ++ ) -> i32; ++ pub fn sceKernelCreateFpl( ++ name: *const u8, ++ part: i32, ++ attr: i32, ++ size: u32, ++ blocks: u32, ++ opt: *mut SceKernelFplOptParam, ++ ) -> i32; ++ pub fn sceKernelDeleteFpl(uid: SceUid) -> i32; ++ pub fn sceKernelAllocateFpl( ++ uid: SceUid, ++ data: *mut *mut c_void, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelAllocateFplCB( ++ uid: SceUid, ++ data: *mut *mut c_void, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelTryAllocateFpl(uid: SceUid, data: *mut *mut c_void) ++ -> i32; ++ pub fn sceKernelFreeFpl(uid: SceUid, data: *mut c_void) -> i32; ++ pub fn sceKernelCancelFpl(uid: SceUid, pnum: *mut i32) -> i32; ++ pub fn sceKernelReferFplStatus( ++ uid: SceUid, ++ info: *mut SceKernelFplInfo, ++ ) -> i32; ++ pub fn sceKernelUSec2SysClock( ++ usec: u32, ++ clock: *mut SceKernelSysClock, ++ ) -> i32; ++ pub fn sceKernelUSec2SysClockWide(usec: u32) -> i64; ++ pub fn sceKernelSysClock2USec( ++ clock: *mut SceKernelSysClock, ++ low: *mut u32, ++ high: *mut u32, ++ ) -> i32; ++ pub fn sceKernelSysClock2USecWide( ++ clock: i64, ++ low: *mut u32, ++ high: *mut u32, ++ ) -> i32; ++ pub fn sceKernelGetSystemTime(time: *mut SceKernelSysClock) -> i32; ++ pub fn sceKernelGetSystemTimeWide() -> i64; ++ pub fn sceKernelGetSystemTimeLow() -> u32; ++ pub fn sceKernelCreateVTimer( ++ name: *const u8, ++ opt: *mut SceKernelVTimerOptParam, ++ ) -> SceUid; ++ pub fn sceKernelDeleteVTimer(uid: SceUid) -> i32; ++ pub fn sceKernelGetVTimerBase( ++ uid: SceUid, ++ base: *mut SceKernelSysClock, ++ ) -> i32; ++ pub fn sceKernelGetVTimerBaseWide(uid: SceUid) -> i64; ++ pub fn sceKernelGetVTimerTime( ++ uid: SceUid, ++ time: *mut SceKernelSysClock, ++ ) -> i32; ++ pub fn sceKernelGetVTimerTimeWide(uid: SceUid) -> i64; ++ pub fn sceKernelSetVTimerTime( ++ uid: SceUid, ++ time: *mut SceKernelSysClock, ++ ) -> i32; ++ pub fn sceKernelSetVTimerTimeWide(uid: SceUid, time: i64) -> i64; ++ pub fn sceKernelStartVTimer(uid: SceUid) -> i32; ++ pub fn sceKernelStopVTimer(uid: SceUid) -> i32; ++ pub fn sceKernelSetVTimerHandler( ++ uid: SceUid, ++ time: *mut SceKernelSysClock, ++ handler: SceKernelVTimerHandler, ++ common: *mut c_void, ++ ) -> i32; ++ pub fn sceKernelSetVTimerHandlerWide( ++ uid: SceUid, ++ time: i64, ++ handler: SceKernelVTimerHandlerWide, ++ common: *mut c_void, ++ ) -> i32; ++ pub fn sceKernelCancelVTimerHandler(uid: SceUid) -> i32; ++ pub fn sceKernelReferVTimerStatus( ++ uid: SceUid, ++ info: *mut SceKernelVTimerInfo, ++ ) -> i32; ++ pub fn sceKernelRegisterThreadEventHandler( ++ name: *const u8, ++ thread_id: SceUid, ++ mask: i32, ++ handler: SceKernelThreadEventHandler, ++ common: *mut c_void, ++ ) -> SceUid; ++ pub fn sceKernelReleaseThreadEventHandler(uid: SceUid) -> i32; ++ pub fn sceKernelReferThreadEventHandlerStatus( ++ uid: SceUid, ++ info: *mut SceKernelThreadEventHandlerInfo, ++ ) -> i32; ++ pub fn sceKernelReferThreadProfiler() -> *mut DebugProfilerRegs; ++ pub fn sceKernelReferGlobalProfiler() -> *mut DebugProfilerRegs; ++ ++ pub fn sceUsbStart( ++ driver_name: *const u8, ++ size: i32, ++ args: *mut c_void, ++ ) -> i32; ++ pub fn sceUsbStop( ++ driver_name: *const u8, ++ size: i32, ++ args: *mut c_void, ++ ) -> i32; ++ pub fn sceUsbActivate(pid: u32) -> i32; ++ pub fn sceUsbDeactivate(pid: u32) -> i32; ++ pub fn sceUsbGetState() -> i32; ++ pub fn sceUsbGetDrvState(driver_name: *const u8) -> i32; ++} ++ ++extern "C" { ++ pub fn sceUsbCamSetupStill(param: *mut UsbCamSetupStillParam) -> i32; ++ pub fn sceUsbCamSetupStillEx(param: *mut UsbCamSetupStillExParam) -> i32; ++ pub fn sceUsbCamStillInputBlocking(buf: *mut u8, size: usize) -> i32; ++ pub fn sceUsbCamStillInput(buf: *mut u8, size: usize) -> i32; ++ pub fn sceUsbCamStillWaitInputEnd() -> i32; ++ pub fn sceUsbCamStillPollInputEnd() -> i32; ++ pub fn sceUsbCamStillCancelInput() -> i32; ++ pub fn sceUsbCamStillGetInputLength() -> i32; ++ pub fn sceUsbCamSetupVideo( ++ param: *mut UsbCamSetupVideoParam, ++ work_area: *mut c_void, ++ work_area_size: i32, ++ ) -> i32; ++ pub fn sceUsbCamSetupVideoEx( ++ param: *mut UsbCamSetupVideoExParam, ++ work_area: *mut c_void, ++ work_area_size: i32, ++ ) -> i32; ++ pub fn sceUsbCamStartVideo() -> i32; ++ pub fn sceUsbCamStopVideo() -> i32; ++ pub fn sceUsbCamReadVideoFrameBlocking(buf: *mut u8, size: usize) -> i32; ++ pub fn sceUsbCamReadVideoFrame(buf: *mut u8, size: usize) -> i32; ++ pub fn sceUsbCamWaitReadVideoFrameEnd() -> i32; ++ pub fn sceUsbCamPollReadVideoFrameEnd() -> i32; ++ pub fn sceUsbCamGetReadVideoFrameSize() -> i32; ++ pub fn sceUsbCamSetSaturation(saturation: i32) -> i32; ++ pub fn sceUsbCamSetBrightness(brightness: i32) -> i32; ++ pub fn sceUsbCamSetContrast(contrast: i32) -> i32; ++ pub fn sceUsbCamSetSharpness(sharpness: i32) -> i32; ++ pub fn sceUsbCamSetImageEffectMode(effect_mode: UsbCamEffectMode) -> i32; ++ pub fn sceUsbCamSetEvLevel(exposure_level: UsbCamEvLevel) -> i32; ++ pub fn sceUsbCamSetReverseMode(reverse_flags: i32) -> i32; ++ pub fn sceUsbCamSetZoom(zoom: i32) -> i32; ++ pub fn sceUsbCamGetSaturation(saturation: *mut i32) -> i32; ++ pub fn sceUsbCamGetBrightness(brightness: *mut i32) -> i32; ++ pub fn sceUsbCamGetContrast(contrast: *mut i32) -> i32; ++ pub fn sceUsbCamGetSharpness(sharpness: *mut i32) -> i32; ++ pub fn sceUsbCamGetImageEffectMode( ++ effect_mode: *mut UsbCamEffectMode, ++ ) -> i32; ++ pub fn sceUsbCamGetEvLevel(exposure_level: *mut UsbCamEvLevel) -> i32; ++ pub fn sceUsbCamGetReverseMode(reverse_flags: *mut i32) -> i32; ++ pub fn sceUsbCamGetZoom(zoom: *mut i32) -> i32; ++ pub fn sceUsbCamAutoImageReverseSW(on: i32) -> i32; ++ pub fn sceUsbCamGetAutoImageReverseState() -> i32; ++ pub fn sceUsbCamGetLensDirection() -> i32; ++ ++ pub fn sceUsbstorBootRegisterNotify(event_flag: SceUid) -> i32; ++ pub fn sceUsbstorBootUnregisterNotify(event_flag: u32) -> i32; ++ pub fn sceUsbstorBootSetCapacity(size: u32) -> i32; ++ ++ pub fn scePowerRegisterCallback(slot: i32, cbid: SceUid) -> i32; ++ pub fn scePowerUnregisterCallback(slot: i32) -> i32; ++ pub fn scePowerIsPowerOnline() -> i32; ++ pub fn scePowerIsBatteryExist() -> i32; ++ pub fn scePowerIsBatteryCharging() -> i32; ++ pub fn scePowerGetBatteryChargingStatus() -> i32; ++ pub fn scePowerIsLowBattery() -> i32; ++ pub fn scePowerGetBatteryLifePercent() -> i32; ++ pub fn scePowerGetBatteryLifeTime() -> i32; ++ pub fn scePowerGetBatteryTemp() -> i32; ++ pub fn scePowerGetBatteryElec() -> i32; ++ pub fn scePowerGetBatteryVolt() -> i32; ++ pub fn scePowerSetCpuClockFrequency(cpufreq: i32) -> i32; ++ pub fn scePowerSetBusClockFrequency(busfreq: i32) -> i32; ++ pub fn scePowerGetCpuClockFrequency() -> i32; ++ pub fn scePowerGetCpuClockFrequencyInt() -> i32; ++ pub fn scePowerGetCpuClockFrequencyFloat() -> f32; ++ pub fn scePowerGetBusClockFrequency() -> i32; ++ pub fn scePowerGetBusClockFrequencyInt() -> i32; ++ pub fn scePowerGetBusClockFrequencyFloat() -> f32; ++ pub fn scePowerSetClockFrequency( ++ pllfreq: i32, ++ cpufreq: i32, ++ busfreq: i32, ++ ) -> i32; ++ pub fn scePowerLock(unknown: i32) -> i32; ++ pub fn scePowerUnlock(unknown: i32) -> i32; ++ pub fn scePowerTick(t: PowerTick) -> i32; ++ pub fn scePowerGetIdleTimer() -> i32; ++ pub fn scePowerIdleTimerEnable(unknown: i32) -> i32; ++ pub fn scePowerIdleTimerDisable(unknown: i32) -> i32; ++ pub fn scePowerRequestStandby() -> i32; ++ pub fn scePowerRequestSuspend() -> i32; ++ ++ pub fn sceWlanDevIsPowerOn() -> i32; ++ pub fn sceWlanGetSwitchState() -> i32; ++ pub fn sceWlanGetEtherAddr(ether_addr: *mut u8) -> i32; ++ ++ pub fn sceWlanDevAttach() -> i32; ++ pub fn sceWlanDevDetach() -> i32; ++ ++ pub fn sceRtcGetTickResolution() -> u32; ++ pub fn sceRtcGetCurrentTick(tick: *mut u64) -> i32; ++ pub fn sceRtcGetCurrentClock(tm: *mut ScePspDateTime, tz: i32) -> i32; ++ pub fn sceRtcGetCurrentClockLocalTime(tm: *mut ScePspDateTime) -> i32; ++ pub fn sceRtcConvertUtcToLocalTime( ++ tick_utc: *const u64, ++ tick_local: *mut u64, ++ ) -> i32; ++ pub fn sceRtcConvertLocalTimeToUTC( ++ tick_local: *const u64, ++ tick_utc: *mut u64, ++ ) -> i32; ++ pub fn sceRtcIsLeapYear(year: i32) -> i32; ++ pub fn sceRtcGetDaysInMonth(year: i32, month: i32) -> i32; ++ pub fn sceRtcGetDayOfWeek(year: i32, month: i32, day: i32) -> i32; ++ pub fn sceRtcCheckValid(date: *const ScePspDateTime) -> i32; ++ pub fn sceRtcSetTick(date: *mut ScePspDateTime, tick: *const u64) -> i32; ++ pub fn sceRtcGetTick(date: *const ScePspDateTime, tick: *mut u64) -> i32; ++ pub fn sceRtcCompareTick(tick1: *const u64, tick2: *const u64) -> i32; ++ pub fn sceRtcTickAddTicks( ++ dest_tick: *mut u64, ++ src_tick: *const u64, ++ num_ticks: u64, ++ ) -> i32; ++ pub fn sceRtcTickAddMicroseconds( ++ dest_tick: *mut u64, ++ src_tick: *const u64, ++ num_ms: u64, ++ ) -> i32; ++ pub fn sceRtcTickAddSeconds( ++ dest_tick: *mut u64, ++ src_tick: *const u64, ++ num_seconds: u64, ++ ) -> i32; ++ pub fn sceRtcTickAddMinutes( ++ dest_tick: *mut u64, ++ src_tick: *const u64, ++ num_minutes: u64, ++ ) -> i32; ++ pub fn sceRtcTickAddHours( ++ dest_tick: *mut u64, ++ src_tick: *const u64, ++ num_hours: u64, ++ ) -> i32; ++ pub fn sceRtcTickAddDays( ++ dest_tick: *mut u64, ++ src_tick: *const u64, ++ num_days: u64, ++ ) -> i32; ++ pub fn sceRtcTickAddWeeks( ++ dest_tick: *mut u64, ++ src_tick: *const u64, ++ num_weeks: u64, ++ ) -> i32; ++ pub fn sceRtcTickAddMonths( ++ dest_tick: *mut u64, ++ src_tick: *const u64, ++ num_months: u64, ++ ) -> i32; ++ pub fn sceRtcTickAddYears( ++ dest_tick: *mut u64, ++ src_tick: *const u64, ++ num_years: u64, ++ ) -> i32; ++ pub fn sceRtcSetTime_t(date: *mut ScePspDateTime, time: i64) -> i32; ++ pub fn sceRtcGetTime_t(date: *const ScePspDateTime, time: *mut i64) ++ -> i32; ++ pub fn sceRtcSetDosTime(date: *mut ScePspDateTime, dos_time: u32) -> i32; ++ pub fn sceRtcGetDosTime(date: *mut ScePspDateTime, dos_time: u32) -> i32; ++ pub fn sceRtcSetWin32FileTime( ++ date: *mut ScePspDateTime, ++ time: *mut u64, ++ ) -> i32; ++ pub fn sceRtcGetWin32FileTime( ++ date: *mut ScePspDateTime, ++ time: *mut u64, ++ ) -> i32; ++ pub fn sceRtcParseDateTime( ++ dest_tick: *mut u64, ++ date_string: *const u8, ++ ) -> i32; ++ pub fn sceRtcFormatRFC3339( ++ psz_date_time: *mut char, ++ p_utc: *const u64, ++ time_zone_minutes: i32, ++ ) -> i32; ++ pub fn sceRtcFormatRFC3339LocalTime( ++ psz_date_time: *mut char, ++ p_utc: *const u64, ++ ) -> i32; ++ pub fn sceRtcParseRFC3339( ++ p_utc: *mut u64, ++ psz_date_time: *const u8, ++ ) -> i32; ++ pub fn sceRtcFormatRFC2822( ++ psz_date_time: *mut char, ++ p_utc: *const u64, ++ time_zone_minutes: i32, ++ ) -> i32; ++ pub fn sceRtcFormatRFC2822LocalTime( ++ psz_date_time: *mut char, ++ p_utc: *const u64, ++ ) -> i32; ++ ++ pub fn sceIoOpen( ++ file: *const u8, ++ flags: i32, ++ permissions: IoPermissions, ++ ) -> SceUid; ++ pub fn sceIoOpenAsync( ++ file: *const u8, ++ flags: i32, ++ permissions: IoPermissions, ++ ) -> SceUid; ++ pub fn sceIoClose(fd: SceUid) -> i32; ++ pub fn sceIoCloseAsync(fd: SceUid) -> i32; ++ pub fn sceIoRead(fd: SceUid, data: *mut c_void, size: u32) -> i32; ++ pub fn sceIoReadAsync(fd: SceUid, data: *mut c_void, size: u32) -> i32; ++ pub fn sceIoWrite(fd: SceUid, data: *const c_void, size: usize) -> i32; ++ pub fn sceIoWriteAsync(fd: SceUid, data: *const c_void, size: u32) -> i32; ++ pub fn sceIoLseek(fd: SceUid, offset: i64, whence: IoWhence) -> i64; ++ pub fn sceIoLseekAsync(fd: SceUid, offset: i64, whence: IoWhence) -> i32; ++ pub fn sceIoLseek32(fd: SceUid, offset: i32, whence: IoWhence) -> i32; ++ pub fn sceIoLseek32Async(fd: SceUid, offset: i32, whence: IoWhence) ++ -> i32; ++ pub fn sceIoRemove(file: *const u8) -> i32; ++ pub fn sceIoMkdir(dir: *const u8, mode: IoPermissions) -> i32; ++ pub fn sceIoRmdir(path: *const u8) -> i32; ++ pub fn sceIoChdir(path: *const u8) -> i32; ++ pub fn sceIoRename(oldname: *const u8, newname: *const u8) -> i32; ++ pub fn sceIoDopen(dirname: *const u8) -> SceUid; ++ pub fn sceIoDread(fd: SceUid, dir: *mut SceIoDirent) -> i32; ++ pub fn sceIoDclose(fd: SceUid) -> i32; ++ pub fn sceIoDevctl( ++ dev: *const u8, ++ cmd: u32, ++ indata: *mut c_void, ++ inlen: i32, ++ outdata: *mut c_void, ++ outlen: i32, ++ ) -> i32; ++ pub fn sceIoAssign( ++ dev1: *const u8, ++ dev2: *const u8, ++ dev3: *const u8, ++ mode: IoAssignPerms, ++ unk1: *mut c_void, ++ unk2: i32, ++ ) -> i32; ++ pub fn sceIoUnassign(dev: *const u8) -> i32; ++ pub fn sceIoGetstat(file: *const u8, stat: *mut SceIoStat) -> i32; ++ pub fn sceIoChstat( ++ file: *const u8, ++ stat: *mut SceIoStat, ++ bits: i32, ++ ) -> i32; ++ pub fn sceIoIoctl( ++ fd: SceUid, ++ cmd: u32, ++ indata: *mut c_void, ++ inlen: i32, ++ outdata: *mut c_void, ++ outlen: i32, ++ ) -> i32; ++ pub fn sceIoIoctlAsync( ++ fd: SceUid, ++ cmd: u32, ++ indata: *mut c_void, ++ inlen: i32, ++ outdata: *mut c_void, ++ outlen: i32, ++ ) -> i32; ++ pub fn sceIoSync(device: *const u8, unk: u32) -> i32; ++ pub fn sceIoWaitAsync(fd: SceUid, res: *mut i64) -> i32; ++ pub fn sceIoWaitAsyncCB(fd: SceUid, res: *mut i64) -> i32; ++ pub fn sceIoPollAsync(fd: SceUid, res: *mut i64) -> i32; ++ pub fn sceIoGetAsyncStat(fd: SceUid, poll: i32, res: *mut i64) -> i32; ++ pub fn sceIoCancel(fd: SceUid) -> i32; ++ pub fn sceIoGetDevType(fd: SceUid) -> i32; ++ pub fn sceIoChangeAsyncPriority(fd: SceUid, pri: i32) -> i32; ++ pub fn sceIoSetAsyncCallback( ++ fd: SceUid, ++ cb: SceUid, ++ argp: *mut c_void, ++ ) -> i32; ++ ++ pub fn sceJpegInitMJpeg() -> i32; ++ pub fn sceJpegFinishMJpeg() -> i32; ++ pub fn sceJpegCreateMJpeg(width: i32, height: i32) -> i32; ++ pub fn sceJpegDeleteMJpeg() -> i32; ++ pub fn sceJpegDecodeMJpeg( ++ jpeg_buf: *mut u8, ++ size: usize, ++ rgba: *mut c_void, ++ unk: u32, ++ ) -> i32; ++ ++ pub fn sceUmdCheckMedium() -> i32; ++ pub fn sceUmdGetDiscInfo(info: *mut UmdInfo) -> i32; ++ pub fn sceUmdActivate(unit: i32, drive: *const u8) -> i32; ++ pub fn sceUmdDeactivate(unit: i32, drive: *const u8) -> i32; ++ pub fn sceUmdWaitDriveStat(state: i32) -> i32; ++ pub fn sceUmdWaitDriveStatWithTimer(state: i32, timeout: u32) -> i32; ++ pub fn sceUmdWaitDriveStatCB(state: i32, timeout: u32) -> i32; ++ pub fn sceUmdCancelWaitDriveStat() -> i32; ++ pub fn sceUmdGetDriveStat() -> i32; ++ pub fn sceUmdGetErrorStat() -> i32; ++ pub fn sceUmdRegisterUMDCallBack(cbid: i32) -> i32; ++ pub fn sceUmdUnRegisterUMDCallBack(cbid: i32) -> i32; ++ pub fn sceUmdReplacePermit() -> i32; ++ pub fn sceUmdReplaceProhibit() -> i32; ++ ++ pub fn sceMpegInit() -> i32; ++ pub fn sceMpegFinish(); ++ pub fn sceMpegRingbufferQueryMemSize(packets: i32) -> i32; ++ pub fn sceMpegRingbufferConstruct( ++ ringbuffer: *mut SceMpegRingbuffer, ++ packets: i32, ++ data: *mut c_void, ++ size: i32, ++ callback: SceMpegRingbufferCb, ++ cb_param: *mut c_void, ++ ) -> i32; ++ pub fn sceMpegRingbufferDestruct(ringbuffer: *mut SceMpegRingbuffer); ++ pub fn sceMpegRingbufferAvailableSize( ++ ringbuffer: *mut SceMpegRingbuffer, ++ ) -> i32; ++ pub fn sceMpegRingbufferPut( ++ ringbuffer: *mut SceMpegRingbuffer, ++ num_packets: i32, ++ available: i32, ++ ) -> i32; ++ pub fn sceMpegQueryMemSize(unk: i32) -> i32; ++ pub fn sceMpegCreate( ++ handle: SceMpeg, ++ data: *mut c_void, ++ size: i32, ++ ringbuffer: *mut SceMpegRingbuffer, ++ frame_width: i32, ++ unk1: i32, ++ unk2: i32, ++ ) -> i32; ++ pub fn sceMpegDelete(handle: SceMpeg); ++ pub fn sceMpegQueryStreamOffset( ++ handle: SceMpeg, ++ buffer: *mut c_void, ++ offset: *mut i32, ++ ) -> i32; ++ pub fn sceMpegQueryStreamSize(buffer: *mut c_void, size: *mut i32) -> i32; ++ pub fn sceMpegRegistStream( ++ handle: SceMpeg, ++ stream_id: i32, ++ unk: i32, ++ ) -> SceMpegStream; ++ pub fn sceMpegUnRegistStream(handle: SceMpeg, stream: SceMpegStream); ++ pub fn sceMpegFlushAllStream(handle: SceMpeg) -> i32; ++ pub fn sceMpegMallocAvcEsBuf(handle: SceMpeg) -> *mut c_void; ++ pub fn sceMpegFreeAvcEsBuf(handle: SceMpeg, buf: *mut c_void); ++ pub fn sceMpegQueryAtracEsSize( ++ handle: SceMpeg, ++ es_size: *mut i32, ++ out_size: *mut i32, ++ ) -> i32; ++ pub fn sceMpegInitAu( ++ handle: SceMpeg, ++ es_buffer: *mut c_void, ++ au: *mut SceMpegAu, ++ ) -> i32; ++ pub fn sceMpegGetAvcAu( ++ handle: SceMpeg, ++ stream: SceMpegStream, ++ au: *mut SceMpegAu, ++ unk: *mut i32, ++ ) -> i32; ++ pub fn sceMpegAvcDecodeMode( ++ handle: SceMpeg, ++ mode: *mut SceMpegAvcMode, ++ ) -> i32; ++ pub fn sceMpegAvcDecode( ++ handle: SceMpeg, ++ au: *mut SceMpegAu, ++ iframe_width: i32, ++ buffer: *mut c_void, ++ init: *mut i32, ++ ) -> i32; ++ pub fn sceMpegAvcDecodeStop( ++ handle: SceMpeg, ++ frame_width: i32, ++ buffer: *mut c_void, ++ status: *mut i32, ++ ) -> i32; ++ pub fn sceMpegGetAtracAu( ++ handle: SceMpeg, ++ stream: SceMpegStream, ++ au: *mut SceMpegAu, ++ unk: *mut c_void, ++ ) -> i32; ++ pub fn sceMpegAtracDecode( ++ handle: SceMpeg, ++ au: *mut SceMpegAu, ++ buffer: *mut c_void, ++ init: i32, ++ ) -> i32; ++ ++ pub fn sceMpegBaseYCrCbCopyVme( ++ yuv_buffer: *mut c_void, ++ buffer: *mut i32, ++ type_: i32, ++ ) -> i32; ++ pub fn sceMpegBaseCscInit(width: i32) -> i32; ++ pub fn sceMpegBaseCscVme( ++ rgb_buffer: *mut c_void, ++ rgb_buffer2: *mut c_void, ++ width: i32, ++ y_cr_cb_buffer: *mut SceMpegYCrCbBuffer, ++ ) -> i32; ++ pub fn sceMpegbase_BEA18F91(lli: *mut SceMpegLLI) -> i32; ++ ++ pub fn sceHprmPeekCurrentKey(key: *mut i32) -> i32; ++ pub fn sceHprmPeekLatch(latch: *mut [u32; 4]) -> i32; ++ pub fn sceHprmReadLatch(latch: *mut [u32; 4]) -> i32; ++ pub fn sceHprmIsHeadphoneExist() -> i32; ++ pub fn sceHprmIsRemoteExist() -> i32; ++ pub fn sceHprmIsMicrophoneExist() -> i32; ++ ++ pub fn sceGuDepthBuffer(zbp: *mut c_void, zbw: i32); ++ pub fn sceGuDispBuffer( ++ width: i32, ++ height: i32, ++ dispbp: *mut c_void, ++ dispbw: i32, ++ ); ++ pub fn sceGuDrawBuffer( ++ psm: DisplayPixelFormat, ++ fbp: *mut c_void, ++ fbw: i32, ++ ); ++ pub fn sceGuDrawBufferList( ++ psm: DisplayPixelFormat, ++ fbp: *mut c_void, ++ fbw: i32, ++ ); ++ pub fn sceGuDisplay(state: bool) -> bool; ++ pub fn sceGuDepthFunc(function: DepthFunc); ++ pub fn sceGuDepthMask(mask: i32); ++ pub fn sceGuDepthOffset(offset: i32); ++ pub fn sceGuDepthRange(near: i32, far: i32); ++ pub fn sceGuFog(near: f32, far: f32, color: u32); ++ pub fn sceGuInit(); ++ pub fn sceGuTerm(); ++ pub fn sceGuBreak(mode: i32); ++ pub fn sceGuContinue(); ++ pub fn sceGuSetCallback( ++ signal: GuCallbackId, ++ callback: GuCallback, ++ ) -> GuCallback; ++ pub fn sceGuSignal(behavior: SignalBehavior, signal: i32); ++ pub fn sceGuSendCommandf(cmd: GeCommand, argument: f32); ++ pub fn sceGuSendCommandi(cmd: GeCommand, argument: i32); ++ pub fn sceGuGetMemory(size: i32) -> *mut c_void; ++ pub fn sceGuStart(context_type: GuContextType, list: *mut c_void); ++ pub fn sceGuFinish() -> i32; ++ pub fn sceGuFinishId(id: u32) -> i32; ++ pub fn sceGuCallList(list: *const c_void); ++ pub fn sceGuCallMode(mode: i32); ++ pub fn sceGuCheckList() -> i32; ++ pub fn sceGuSendList( ++ mode: GuQueueMode, ++ list: *const c_void, ++ context: *mut GeContext, ++ ); ++ pub fn sceGuSwapBuffers() -> *mut c_void; ++ pub fn sceGuSync( ++ mode: GuSyncMode, ++ behavior: GuSyncBehavior, ++ ) -> GeListState; ++ pub fn sceGuDrawArray( ++ prim: GuPrimitive, ++ vtype: i32, ++ count: i32, ++ indices: *const c_void, ++ vertices: *const c_void, ++ ); ++ pub fn sceGuBeginObject( ++ vtype: i32, ++ count: i32, ++ indices: *const c_void, ++ vertices: *const c_void, ++ ); ++ pub fn sceGuEndObject(); ++ pub fn sceGuSetStatus(state: GuState, status: i32); ++ pub fn sceGuGetStatus(state: GuState) -> bool; ++ pub fn sceGuSetAllStatus(status: i32); ++ pub fn sceGuGetAllStatus() -> i32; ++ pub fn sceGuEnable(state: GuState); ++ pub fn sceGuDisable(state: GuState); ++ pub fn sceGuLight( ++ light: i32, ++ type_: LightType, ++ components: i32, ++ position: &ScePspFVector3, ++ ); ++ pub fn sceGuLightAtt(light: i32, atten0: f32, atten1: f32, atten2: f32); ++ pub fn sceGuLightColor(light: i32, component: i32, color: u32); ++ pub fn sceGuLightMode(mode: LightMode); ++ pub fn sceGuLightSpot( ++ light: i32, ++ direction: &ScePspFVector3, ++ exponent: f32, ++ cutoff: f32, ++ ); ++ pub fn sceGuClear(flags: i32); ++ pub fn sceGuClearColor(color: u32); ++ pub fn sceGuClearDepth(depth: u32); ++ pub fn sceGuClearStencil(stencil: u32); ++ pub fn sceGuPixelMask(mask: u32); ++ pub fn sceGuColor(color: u32); ++ pub fn sceGuColorFunc(func: ColorFunc, color: u32, mask: u32); ++ pub fn sceGuColorMaterial(components: i32); ++ pub fn sceGuAlphaFunc(func: AlphaFunc, value: i32, mask: i32); ++ pub fn sceGuAmbient(color: u32); ++ pub fn sceGuAmbientColor(color: u32); ++ pub fn sceGuBlendFunc( ++ op: BlendOp, ++ src: BlendSrc, ++ dest: BlendDst, ++ src_fix: u32, ++ dest_fix: u32, ++ ); ++ pub fn sceGuMaterial(components: i32, color: u32); ++ pub fn sceGuModelColor( ++ emissive: u32, ++ ambient: u32, ++ diffuse: u32, ++ specular: u32, ++ ); ++ pub fn sceGuStencilFunc(func: StencilFunc, ref_: i32, mask: i32); ++ pub fn sceGuStencilOp( ++ fail: StencilOperation, ++ zfail: StencilOperation, ++ zpass: StencilOperation, ++ ); ++ pub fn sceGuSpecular(power: f32); ++ pub fn sceGuFrontFace(order: FrontFaceDirection); ++ pub fn sceGuLogicalOp(op: LogicalOperation); ++ pub fn sceGuSetDither(matrix: &ScePspIMatrix4); ++ pub fn sceGuShadeModel(mode: ShadingModel); ++ pub fn sceGuCopyImage( ++ psm: DisplayPixelFormat, ++ sx: i32, ++ sy: i32, ++ width: i32, ++ height: i32, ++ srcw: i32, ++ src: *mut c_void, ++ dx: i32, ++ dy: i32, ++ destw: i32, ++ dest: *mut c_void, ++ ); ++ pub fn sceGuTexEnvColor(color: u32); ++ pub fn sceGuTexFilter(min: TextureFilter, mag: TextureFilter); ++ pub fn sceGuTexFlush(); ++ pub fn sceGuTexFunc(tfx: TextureEffect, tcc: TextureColorComponent); ++ pub fn sceGuTexImage( ++ mipmap: MipmapLevel, ++ width: i32, ++ height: i32, ++ tbw: i32, ++ tbp: *const c_void, ++ ); ++ pub fn sceGuTexLevelMode(mode: TextureLevelMode, bias: f32); ++ pub fn sceGuTexMapMode(mode: TextureMapMode, a1: u32, a2: u32); ++ pub fn sceGuTexMode( ++ tpsm: TexturePixelFormat, ++ maxmips: i32, ++ a2: i32, ++ swizzle: i32, ++ ); ++ pub fn sceGuTexOffset(u: f32, v: f32); ++ pub fn sceGuTexProjMapMode(mode: TextureProjectionMapMode); ++ pub fn sceGuTexScale(u: f32, v: f32); ++ pub fn sceGuTexSlope(slope: f32); ++ pub fn sceGuTexSync(); ++ pub fn sceGuTexWrap(u: GuTexWrapMode, v: GuTexWrapMode); ++ pub fn sceGuClutLoad(num_blocks: i32, cbp: *const c_void); ++ pub fn sceGuClutMode( ++ cpsm: ClutPixelFormat, ++ shift: u32, ++ mask: u32, ++ a3: u32, ++ ); ++ pub fn sceGuOffset(x: u32, y: u32); ++ pub fn sceGuScissor(x: i32, y: i32, w: i32, h: i32); ++ pub fn sceGuViewport(cx: i32, cy: i32, width: i32, height: i32); ++ pub fn sceGuDrawBezier( ++ v_type: i32, ++ u_count: i32, ++ v_count: i32, ++ indices: *const c_void, ++ vertices: *const c_void, ++ ); ++ pub fn sceGuPatchDivide(ulevel: u32, vlevel: u32); ++ pub fn sceGuPatchFrontFace(a0: u32); ++ pub fn sceGuPatchPrim(prim: PatchPrimitive); ++ pub fn sceGuDrawSpline( ++ v_type: i32, ++ u_count: i32, ++ v_count: i32, ++ u_edge: i32, ++ v_edge: i32, ++ indices: *const c_void, ++ vertices: *const c_void, ++ ); ++ pub fn sceGuSetMatrix(type_: MatrixMode, matrix: &ScePspFMatrix4); ++ pub fn sceGuBoneMatrix(index: u32, matrix: &ScePspFMatrix4); ++ pub fn sceGuMorphWeight(index: i32, weight: f32); ++ pub fn sceGuDrawArrayN( ++ primitive_type: GuPrimitive, ++ v_type: i32, ++ count: i32, ++ a3: i32, ++ indices: *const c_void, ++ vertices: *const c_void, ++ ); ++ ++ pub fn sceGumDrawArray( ++ prim: GuPrimitive, ++ v_type: i32, ++ count: i32, ++ indices: *const c_void, ++ vertices: *const c_void, ++ ); ++ pub fn sceGumDrawArrayN( ++ prim: GuPrimitive, ++ v_type: i32, ++ count: i32, ++ a3: i32, ++ indices: *const c_void, ++ vertices: *const c_void, ++ ); ++ pub fn sceGumDrawBezier( ++ v_type: i32, ++ u_count: i32, ++ v_count: i32, ++ indices: *const c_void, ++ vertices: *const c_void, ++ ); ++ pub fn sceGumDrawSpline( ++ v_type: i32, ++ u_count: i32, ++ v_count: i32, ++ u_edge: i32, ++ v_edge: i32, ++ indices: *const c_void, ++ vertices: *const c_void, ++ ); ++ pub fn sceGumFastInverse(); ++ pub fn sceGumFullInverse(); ++ pub fn sceGumLoadIdentity(); ++ pub fn sceGumLoadMatrix(m: &ScePspFMatrix4); ++ pub fn sceGumLookAt( ++ eye: &ScePspFVector3, ++ center: &ScePspFVector3, ++ up: &ScePspFVector3, ++ ); ++ pub fn sceGumMatrixMode(mode: MatrixMode); ++ pub fn sceGumMultMatrix(m: &ScePspFMatrix4); ++ pub fn sceGumOrtho( ++ left: f32, ++ right: f32, ++ bottom: f32, ++ top: f32, ++ near: f32, ++ far: f32, ++ ); ++ pub fn sceGumPerspective(fovy: f32, aspect: f32, near: f32, far: f32); ++ pub fn sceGumPopMatrix(); ++ pub fn sceGumPushMatrix(); ++ pub fn sceGumRotateX(angle: f32); ++ pub fn sceGumRotateY(angle: f32); ++ pub fn sceGumRotateZ(angle: f32); ++ pub fn sceGumRotateXYZ(v: &ScePspFVector3); ++ pub fn sceGumRotateZYX(v: &ScePspFVector3); ++ pub fn sceGumScale(v: &ScePspFVector3); ++ pub fn sceGumStoreMatrix(m: &mut ScePspFMatrix4); ++ pub fn sceGumTranslate(v: &ScePspFVector3); ++ pub fn sceGumUpdateMatrix(); ++ ++ pub fn sceMp3ReserveMp3Handle(args: *mut SceMp3InitArg) -> i32; ++ pub fn sceMp3ReleaseMp3Handle(handle: Mp3Handle) -> i32; ++ pub fn sceMp3InitResource() -> i32; ++ pub fn sceMp3TermResource() -> i32; ++ pub fn sceMp3Init(handle: Mp3Handle) -> i32; ++ pub fn sceMp3Decode(handle: Mp3Handle, dst: *mut *mut i16) -> i32; ++ pub fn sceMp3GetInfoToAddStreamData( ++ handle: Mp3Handle, ++ dst: *mut *mut u8, ++ to_write: *mut i32, ++ src_pos: *mut i32, ++ ) -> i32; ++ pub fn sceMp3NotifyAddStreamData(handle: Mp3Handle, size: i32) -> i32; ++ pub fn sceMp3CheckStreamDataNeeded(handle: Mp3Handle) -> i32; ++ pub fn sceMp3SetLoopNum(handle: Mp3Handle, loop_: i32) -> i32; ++ pub fn sceMp3GetLoopNum(handle: Mp3Handle) -> i32; ++ pub fn sceMp3GetSumDecodedSample(handle: Mp3Handle) -> i32; ++ pub fn sceMp3GetMaxOutputSample(handle: Mp3Handle) -> i32; ++ pub fn sceMp3GetSamplingRate(handle: Mp3Handle) -> i32; ++ pub fn sceMp3GetBitRate(handle: Mp3Handle) -> i32; ++ pub fn sceMp3GetMp3ChannelNum(handle: Mp3Handle) -> i32; ++ pub fn sceMp3ResetPlayPosition(handle: Mp3Handle) -> i32; ++ ++ pub fn sceRegOpenRegistry( ++ reg: *mut Key, ++ mode: i32, ++ handle: *mut RegHandle, ++ ) -> i32; ++ pub fn sceRegFlushRegistry(handle: RegHandle) -> i32; ++ pub fn sceRegCloseRegistry(handle: RegHandle) -> i32; ++ pub fn sceRegOpenCategory( ++ handle: RegHandle, ++ name: *const u8, ++ mode: i32, ++ dir_handle: *mut RegHandle, ++ ) -> i32; ++ pub fn sceRegRemoveCategory(handle: RegHandle, name: *const u8) -> i32; ++ pub fn sceRegCloseCategory(dir_handle: RegHandle) -> i32; ++ pub fn sceRegFlushCategory(dir_handle: RegHandle) -> i32; ++ pub fn sceRegGetKeyInfo( ++ dir_handle: RegHandle, ++ name: *const u8, ++ key_handle: *mut RegHandle, ++ type_: *mut KeyType, ++ size: *mut usize, ++ ) -> i32; ++ pub fn sceRegGetKeyInfoByName( ++ dir_handle: RegHandle, ++ name: *const u8, ++ type_: *mut KeyType, ++ size: *mut usize, ++ ) -> i32; ++ pub fn sceRegGetKeyValue( ++ dir_handle: RegHandle, ++ key_handle: RegHandle, ++ buf: *mut c_void, ++ size: usize, ++ ) -> i32; ++ pub fn sceRegGetKeyValueByName( ++ dir_handle: RegHandle, ++ name: *const u8, ++ buf: *mut c_void, ++ size: usize, ++ ) -> i32; ++ pub fn sceRegSetKeyValue( ++ dir_handle: RegHandle, ++ name: *const u8, ++ buf: *const c_void, ++ size: usize, ++ ) -> i32; ++ pub fn sceRegGetKeysNum(dir_handle: RegHandle, num: *mut i32) -> i32; ++ pub fn sceRegGetKeys(dir_handle: RegHandle, buf: *mut u8, num: i32) ++ -> i32; ++ pub fn sceRegCreateKey( ++ dir_handle: RegHandle, ++ name: *const u8, ++ type_: i32, ++ size: usize, ++ ) -> i32; ++ pub fn sceRegRemoveRegistry(key: *mut Key) -> i32; ++ ++ pub fn sceOpenPSIDGetOpenPSID(openpsid: *mut OpenPSID) -> i32; ++ ++ pub fn sceUtilityMsgDialogInitStart( ++ params: *mut UtilityMsgDialogParams, ++ ) -> i32; ++ pub fn sceUtilityMsgDialogShutdownStart(); ++ pub fn sceUtilityMsgDialogGetStatus() -> i32; ++ pub fn sceUtilityMsgDialogUpdate(n: i32); ++ pub fn sceUtilityMsgDialogAbort() -> i32; ++ pub fn sceUtilityNetconfInitStart(data: *mut UtilityNetconfData) -> i32; ++ pub fn sceUtilityNetconfShutdownStart() -> i32; ++ pub fn sceUtilityNetconfUpdate(unknown: i32) -> i32; ++ pub fn sceUtilityNetconfGetStatus() -> i32; ++ pub fn sceUtilityCheckNetParam(id: i32) -> i32; ++ pub fn sceUtilityGetNetParam( ++ conf: i32, ++ param: NetParam, ++ data: *mut UtilityNetData, ++ ) -> i32; ++ pub fn sceUtilitySavedataInitStart( ++ params: *mut SceUtilitySavedataParam, ++ ) -> i32; ++ pub fn sceUtilitySavedataGetStatus() -> i32; ++ pub fn sceUtilitySavedataShutdownStart() -> i32; ++ pub fn sceUtilitySavedataUpdate(unknown: i32); ++ pub fn sceUtilityGameSharingInitStart( ++ params: *mut UtilityGameSharingParams, ++ ) -> i32; ++ pub fn sceUtilityGameSharingShutdownStart(); ++ pub fn sceUtilityGameSharingGetStatus() -> i32; ++ pub fn sceUtilityGameSharingUpdate(n: i32); ++ pub fn sceUtilityHtmlViewerInitStart( ++ params: *mut UtilityHtmlViewerParam, ++ ) -> i32; ++ pub fn sceUtilityHtmlViewerShutdownStart() -> i32; ++ pub fn sceUtilityHtmlViewerUpdate(n: i32) -> i32; ++ pub fn sceUtilityHtmlViewerGetStatus() -> i32; ++ pub fn sceUtilitySetSystemParamInt(id: SystemParamId, value: i32) -> i32; ++ pub fn sceUtilitySetSystemParamString( ++ id: SystemParamId, ++ str: *const u8, ++ ) -> i32; ++ pub fn sceUtilityGetSystemParamInt( ++ id: SystemParamId, ++ value: *mut i32, ++ ) -> i32; ++ pub fn sceUtilityGetSystemParamString( ++ id: SystemParamId, ++ str: *mut u8, ++ len: i32, ++ ) -> i32; ++ pub fn sceUtilityOskInitStart(params: *mut SceUtilityOskParams) -> i32; ++ pub fn sceUtilityOskShutdownStart() -> i32; ++ pub fn sceUtilityOskUpdate(n: i32) -> i32; ++ pub fn sceUtilityOskGetStatus() -> i32; ++ pub fn sceUtilityLoadNetModule(module: NetModule) -> i32; ++ pub fn sceUtilityUnloadNetModule(module: NetModule) -> i32; ++ pub fn sceUtilityLoadAvModule(module: AvModule) -> i32; ++ pub fn sceUtilityUnloadAvModule(module: AvModule) -> i32; ++ pub fn sceUtilityLoadUsbModule(module: UsbModule) -> i32; ++ pub fn sceUtilityUnloadUsbModule(module: UsbModule) -> i32; ++ pub fn sceUtilityLoadModule(module: Module) -> i32; ++ pub fn sceUtilityUnloadModule(module: Module) -> i32; ++ pub fn sceUtilityCreateNetParam(conf: i32) -> i32; ++ pub fn sceUtilitySetNetParam(param: NetParam, val: *const c_void) -> i32; ++ pub fn sceUtilityCopyNetParam(src: i32, dest: i32) -> i32; ++ pub fn sceUtilityDeleteNetParam(conf: i32) -> i32; ++ ++ pub fn sceNetInit( ++ poolsize: i32, ++ calloutprio: i32, ++ calloutstack: i32, ++ netintrprio: i32, ++ netintrstack: i32, ++ ) -> i32; ++ pub fn sceNetTerm() -> i32; ++ pub fn sceNetFreeThreadinfo(thid: i32) -> i32; ++ pub fn sceNetThreadAbort(thid: i32) -> i32; ++ pub fn sceNetEtherStrton(name: *mut u8, mac: *mut u8); ++ pub fn sceNetEtherNtostr(mac: *mut u8, name: *mut u8); ++ pub fn sceNetGetLocalEtherAddr(mac: *mut u8) -> i32; ++ pub fn sceNetGetMallocStat(stat: *mut SceNetMallocStat) -> i32; ++ ++ pub fn sceNetAdhocctlInit( ++ stacksize: i32, ++ priority: i32, ++ adhoc_id: *mut SceNetAdhocctlAdhocId, ++ ) -> i32; ++ pub fn sceNetAdhocctlTerm() -> i32; ++ pub fn sceNetAdhocctlConnect(name: *const u8) -> i32; ++ pub fn sceNetAdhocctlDisconnect() -> i32; ++ pub fn sceNetAdhocctlGetState(event: *mut i32) -> i32; ++ pub fn sceNetAdhocctlCreate(name: *const u8) -> i32; ++ pub fn sceNetAdhocctlJoin(scaninfo: *mut SceNetAdhocctlScanInfo) -> i32; ++ pub fn sceNetAdhocctlGetAdhocId(id: *mut SceNetAdhocctlAdhocId) -> i32; ++ pub fn sceNetAdhocctlCreateEnterGameMode( ++ name: *const u8, ++ unknown: i32, ++ num: i32, ++ macs: *mut u8, ++ timeout: u32, ++ unknown2: i32, ++ ) -> i32; ++ pub fn sceNetAdhocctlJoinEnterGameMode( ++ name: *const u8, ++ hostmac: *mut u8, ++ timeout: u32, ++ unknown: i32, ++ ) -> i32; ++ pub fn sceNetAdhocctlGetGameModeInfo( ++ gamemodeinfo: *mut SceNetAdhocctlGameModeInfo, ++ ) -> i32; ++ pub fn sceNetAdhocctlExitGameMode() -> i32; ++ pub fn sceNetAdhocctlGetPeerList( ++ length: *mut i32, ++ buf: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocctlGetPeerInfo( ++ mac: *mut u8, ++ size: i32, ++ peerinfo: *mut SceNetAdhocctlPeerInfo, ++ ) -> i32; ++ pub fn sceNetAdhocctlScan() -> i32; ++ pub fn sceNetAdhocctlGetScanInfo( ++ length: *mut i32, ++ buf: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocctlAddHandler( ++ handler: SceNetAdhocctlHandler, ++ unknown: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocctlDelHandler(id: i32) -> i32; ++ pub fn sceNetAdhocctlGetNameByAddr(mac: *mut u8, nickname: *mut u8) ++ -> i32; ++ pub fn sceNetAdhocctlGetAddrByName( ++ nickname: *mut u8, ++ length: *mut i32, ++ buf: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocctlGetParameter( ++ params: *mut SceNetAdhocctlParams, ++ ) -> i32; ++ ++ pub fn sceNetAdhocInit() -> i32; ++ pub fn sceNetAdhocTerm() -> i32; ++ pub fn sceNetAdhocPdpCreate( ++ mac: *mut u8, ++ port: u16, ++ buf_size: u32, ++ unk1: i32, ++ ) -> i32; ++ pub fn sceNetAdhocPdpDelete(id: i32, unk1: i32) -> i32; ++ pub fn sceNetAdhocPdpSend( ++ id: i32, ++ dest_mac_addr: *mut u8, ++ port: u16, ++ data: *mut c_void, ++ len: u32, ++ timeout: u32, ++ nonblock: i32, ++ ) -> i32; ++ pub fn sceNetAdhocPdpRecv( ++ id: i32, ++ src_mac_addr: *mut u8, ++ port: *mut u16, ++ data: *mut c_void, ++ data_length: *mut c_void, ++ timeout: u32, ++ nonblock: i32, ++ ) -> i32; ++ pub fn sceNetAdhocGetPdpStat( ++ size: *mut i32, ++ stat: *mut SceNetAdhocPdpStat, ++ ) -> i32; ++ pub fn sceNetAdhocGameModeCreateMaster( ++ data: *mut c_void, ++ size: i32, ++ ) -> i32; ++ pub fn sceNetAdhocGameModeCreateReplica( ++ mac: *mut u8, ++ data: *mut c_void, ++ size: i32, ++ ) -> i32; ++ pub fn sceNetAdhocGameModeUpdateMaster() -> i32; ++ pub fn sceNetAdhocGameModeUpdateReplica(id: i32, unk1: i32) -> i32; ++ pub fn sceNetAdhocGameModeDeleteMaster() -> i32; ++ pub fn sceNetAdhocGameModeDeleteReplica(id: i32) -> i32; ++ pub fn sceNetAdhocPtpOpen( ++ srcmac: *mut u8, ++ srcport: u16, ++ destmac: *mut u8, ++ destport: u16, ++ buf_size: u32, ++ delay: u32, ++ count: i32, ++ unk1: i32, ++ ) -> i32; ++ pub fn sceNetAdhocPtpConnect(id: i32, timeout: u32, nonblock: i32) -> i32; ++ pub fn sceNetAdhocPtpListen( ++ srcmac: *mut u8, ++ srcport: u16, ++ buf_size: u32, ++ delay: u32, ++ count: i32, ++ queue: i32, ++ unk1: i32, ++ ) -> i32; ++ pub fn sceNetAdhocPtpAccept( ++ id: i32, ++ mac: *mut u8, ++ port: *mut u16, ++ timeout: u32, ++ nonblock: i32, ++ ) -> i32; ++ pub fn sceNetAdhocPtpSend( ++ id: i32, ++ data: *mut c_void, ++ data_size: *mut i32, ++ timeout: u32, ++ nonblock: i32, ++ ) -> i32; ++ pub fn sceNetAdhocPtpRecv( ++ id: i32, ++ data: *mut c_void, ++ data_size: *mut i32, ++ timeout: u32, ++ nonblock: i32, ++ ) -> i32; ++ pub fn sceNetAdhocPtpFlush(id: i32, timeout: u32, nonblock: i32) -> i32; ++ pub fn sceNetAdhocPtpClose(id: i32, unk1: i32) -> i32; ++ pub fn sceNetAdhocGetPtpStat( ++ size: *mut i32, ++ stat: *mut SceNetAdhocPtpStat, ++ ) -> i32; ++} ++ ++extern "C" { ++ pub fn sceNetAdhocMatchingInit(memsize: i32) -> i32; ++ pub fn sceNetAdhocMatchingTerm() -> i32; ++ pub fn sceNetAdhocMatchingCreate( ++ mode: AdhocMatchingMode, ++ max_peers: i32, ++ port: u16, ++ buf_size: i32, ++ hello_delay: u32, ++ ping_delay: u32, ++ init_count: i32, ++ msg_delay: u32, ++ callback: AdhocMatchingCallback, ++ ) -> i32; ++ pub fn sceNetAdhocMatchingDelete(matching_id: i32) -> i32; ++ pub fn sceNetAdhocMatchingStart( ++ matching_id: i32, ++ evth_pri: i32, ++ evth_stack: i32, ++ inth_pri: i32, ++ inth_stack: i32, ++ opt_len: i32, ++ opt_data: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocMatchingStop(matching_id: i32) -> i32; ++ pub fn sceNetAdhocMatchingSelectTarget( ++ matching_id: i32, ++ mac: *mut u8, ++ opt_len: i32, ++ opt_data: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocMatchingCancelTarget( ++ matching_id: i32, ++ mac: *mut u8, ++ ) -> i32; ++ pub fn sceNetAdhocMatchingCancelTargetWithOpt( ++ matching_id: i32, ++ mac: *mut u8, ++ opt_len: i32, ++ opt_data: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocMatchingSendData( ++ matching_id: i32, ++ mac: *mut u8, ++ data_len: i32, ++ data: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocMatchingAbortSendData( ++ matching_id: i32, ++ mac: *mut u8, ++ ) -> i32; ++ pub fn sceNetAdhocMatchingSetHelloOpt( ++ matching_id: i32, ++ opt_len: i32, ++ opt_data: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocMatchingGetHelloOpt( ++ matching_id: i32, ++ opt_len: *mut i32, ++ opt_data: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocMatchingGetMembers( ++ matching_id: i32, ++ length: *mut i32, ++ buf: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocMatchingGetPoolMaxAlloc() -> i32; ++ pub fn sceNetAdhocMatchingGetPoolStat(poolstat: *mut AdhocPoolStat) ++ -> i32; ++} ++ ++extern "C" { ++ pub fn sceNetApctlInit(stack_size: i32, init_priority: i32) -> i32; ++ pub fn sceNetApctlTerm() -> i32; ++ pub fn sceNetApctlGetInfo( ++ code: ApctlInfo, ++ pinfo: *mut SceNetApctlInfo, ++ ) -> i32; ++ pub fn sceNetApctlAddHandler( ++ handler: SceNetApctlHandler, ++ parg: *mut c_void, ++ ) -> i32; ++ pub fn sceNetApctlDelHandler(handler_id: i32) -> i32; ++ pub fn sceNetApctlConnect(conn_index: i32) -> i32; ++ pub fn sceNetApctlDisconnect() -> i32; ++ pub fn sceNetApctlGetState(pstate: *mut ApctlState) -> i32; ++ ++ pub fn sceNetInetInit() -> i32; ++ pub fn sceNetInetTerm() -> i32; ++ pub fn sceNetInetAccept( ++ s: i32, ++ addr: *mut sockaddr, ++ addr_len: *mut socklen_t, ++ ) -> i32; ++ pub fn sceNetInetBind( ++ s: i32, ++ my_addr: *const sockaddr, ++ addr_len: socklen_t, ++ ) -> i32; ++ pub fn sceNetInetConnect( ++ s: i32, ++ serv_addr: *const sockaddr, ++ addr_len: socklen_t, ++ ) -> i32; ++ pub fn sceNetInetGetsockopt( ++ s: i32, ++ level: i32, ++ opt_name: i32, ++ opt_val: *mut c_void, ++ optl_en: *mut socklen_t, ++ ) -> i32; ++ pub fn sceNetInetListen(s: i32, backlog: i32) -> i32; ++ pub fn sceNetInetRecv( ++ s: i32, ++ buf: *mut c_void, ++ len: usize, ++ flags: i32, ++ ) -> usize; ++ pub fn sceNetInetRecvfrom( ++ s: i32, ++ buf: *mut c_void, ++ flags: usize, ++ arg1: i32, ++ from: *mut sockaddr, ++ from_len: *mut socklen_t, ++ ) -> usize; ++ pub fn sceNetInetSend( ++ s: i32, ++ buf: *const c_void, ++ len: usize, ++ flags: i32, ++ ) -> usize; ++ pub fn sceNetInetSendto( ++ s: i32, ++ buf: *const c_void, ++ len: usize, ++ flags: i32, ++ to: *const sockaddr, ++ to_len: socklen_t, ++ ) -> usize; ++ pub fn sceNetInetSetsockopt( ++ s: i32, ++ level: i32, ++ opt_name: i32, ++ opt_val: *const c_void, ++ opt_len: socklen_t, ++ ) -> i32; ++ pub fn sceNetInetShutdown(s: i32, how: i32) -> i32; ++ pub fn sceNetInetSocket(domain: i32, type_: i32, protocol: i32) -> i32; ++ pub fn sceNetInetClose(s: i32) -> i32; ++ pub fn sceNetInetGetErrno() -> i32; ++ ++ pub fn sceSslInit(unknown1: i32) -> i32; ++ pub fn sceSslEnd() -> i32; ++ pub fn sceSslGetUsedMemoryMax(memory: *mut u32) -> i32; ++ pub fn sceSslGetUsedMemoryCurrent(memory: *mut u32) -> i32; ++ ++ pub fn sceHttpInit(unknown1: u32) -> i32; ++ pub fn sceHttpEnd() -> i32; ++ pub fn sceHttpCreateTemplate( ++ agent: *mut u8, ++ unknown1: i32, ++ unknown2: i32, ++ ) -> i32; ++ pub fn sceHttpDeleteTemplate(templateid: i32) -> i32; ++ pub fn sceHttpCreateConnection( ++ templateid: i32, ++ host: *mut u8, ++ unknown1: *mut u8, ++ port: u16, ++ unknown2: i32, ++ ) -> i32; ++ pub fn sceHttpCreateConnectionWithURL( ++ templateid: i32, ++ url: *const u8, ++ unknown1: i32, ++ ) -> i32; ++ pub fn sceHttpDeleteConnection(connection_id: i32) -> i32; ++ pub fn sceHttpCreateRequest( ++ connection_id: i32, ++ method: HttpMethod, ++ path: *mut u8, ++ content_length: u64, ++ ) -> i32; ++ pub fn sceHttpCreateRequestWithURL( ++ connection_id: i32, ++ method: HttpMethod, ++ url: *mut u8, ++ content_length: u64, ++ ) -> i32; ++ pub fn sceHttpDeleteRequest(request_id: i32) -> i32; ++ pub fn sceHttpSendRequest( ++ request_id: i32, ++ data: *mut c_void, ++ data_size: u32, ++ ) -> i32; ++ pub fn sceHttpAbortRequest(request_id: i32) -> i32; ++ pub fn sceHttpReadData( ++ request_id: i32, ++ data: *mut c_void, ++ data_size: u32, ++ ) -> i32; ++ pub fn sceHttpGetContentLength( ++ request_id: i32, ++ content_length: *mut u64, ++ ) -> i32; ++ pub fn sceHttpGetStatusCode(request_id: i32, status_code: *mut i32) ++ -> i32; ++ pub fn sceHttpSetResolveTimeOut(id: i32, timeout: u32) -> i32; ++ pub fn sceHttpSetResolveRetry(id: i32, count: i32) -> i32; ++ pub fn sceHttpSetConnectTimeOut(id: i32, timeout: u32) -> i32; ++ pub fn sceHttpSetSendTimeOut(id: i32, timeout: u32) -> i32; ++ pub fn sceHttpSetRecvTimeOut(id: i32, timeout: u32) -> i32; ++ pub fn sceHttpEnableKeepAlive(id: i32) -> i32; ++ pub fn sceHttpDisableKeepAlive(id: i32) -> i32; ++ pub fn sceHttpEnableRedirect(id: i32) -> i32; ++ pub fn sceHttpDisableRedirect(id: i32) -> i32; ++ pub fn sceHttpEnableCookie(id: i32) -> i32; ++ pub fn sceHttpDisableCookie(id: i32) -> i32; ++ pub fn sceHttpSaveSystemCookie() -> i32; ++ pub fn sceHttpLoadSystemCookie() -> i32; ++ pub fn sceHttpAddExtraHeader( ++ id: i32, ++ name: *mut u8, ++ value: *mut u8, ++ unknown1: i32, ++ ) -> i32; ++ pub fn sceHttpDeleteHeader(id: i32, name: *const u8) -> i32; ++ pub fn sceHttpsInit( ++ unknown1: i32, ++ unknown2: i32, ++ unknown3: i32, ++ unknown4: i32, ++ ) -> i32; ++ pub fn sceHttpsEnd() -> i32; ++ pub fn sceHttpsLoadDefaultCert(unknown1: i32, unknown2: i32) -> i32; ++ pub fn sceHttpDisableAuth(id: i32) -> i32; ++ pub fn sceHttpDisableCache(id: i32) -> i32; ++ pub fn sceHttpEnableAuth(id: i32) -> i32; ++ pub fn sceHttpEnableCache(id: i32) -> i32; ++ pub fn sceHttpEndCache() -> i32; ++ pub fn sceHttpGetAllHeader( ++ request: i32, ++ header: *mut *mut u8, ++ header_size: *mut u32, ++ ) -> i32; ++ pub fn sceHttpGetNetworkErrno(request: i32, err_num: *mut i32) -> i32; ++ pub fn sceHttpGetProxy( ++ id: i32, ++ activate_flag: *mut i32, ++ mode: *mut i32, ++ proxy_host: *mut u8, ++ len: usize, ++ proxy_port: *mut u16, ++ ) -> i32; ++ pub fn sceHttpInitCache(max_size: usize) -> i32; ++ pub fn sceHttpSetAuthInfoCB(id: i32, cbfunc: HttpPasswordCB) -> i32; ++ pub fn sceHttpSetProxy( ++ id: i32, ++ activate_flag: i32, ++ mode: i32, ++ new_proxy_host: *const u8, ++ new_proxy_port: u16, ++ ) -> i32; ++ pub fn sceHttpSetResHeaderMaxSize(id: i32, header_size: u32) -> i32; ++ pub fn sceHttpSetMallocFunction( ++ malloc_func: HttpMallocFunction, ++ free_func: HttpFreeFunction, ++ realloc_func: HttpReallocFunction, ++ ) -> i32; ++ ++ pub fn sceNetResolverInit() -> i32; ++ pub fn sceNetResolverCreate( ++ rid: *mut i32, ++ buf: *mut c_void, ++ buf_length: u32, ++ ) -> i32; ++ pub fn sceNetResolverDelete(rid: i32) -> i32; ++ pub fn sceNetResolverStartNtoA( ++ rid: i32, ++ hostname: *const u8, ++ addr: *mut in_addr, ++ timeout: u32, ++ retry: i32, ++ ) -> i32; ++ pub fn sceNetResolverStartAtoN( ++ rid: i32, ++ addr: *const in_addr, ++ hostname: *mut u8, ++ hostname_len: u32, ++ timeout: u32, ++ retry: i32, ++ ) -> i32; ++ pub fn sceNetResolverStop(rid: i32) -> i32; ++ pub fn sceNetResolverTerm() -> i32; ++} +diff --git a/third_party/rust/libc/src/switch.rs b/third_party/rust/libc/src/switch.rs +index 801b8ed56e5908dabc06a15e73b24675eb0a223c..030ab20d7bd8e7e2b3d06f76619b57145f33e860 100644 +--- a/third_party/rust/libc/src/switch.rs ++++ b/third_party/rust/libc/src/switch.rs +@@ -47,4 +47,3 @@ cfg_if! { + } + } + } +- +diff --git a/third_party/rust/libc/src/unix/bsd/apple/b32/align.rs b/third_party/rust/libc/src/unix/bsd/apple/b32/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..ca1fe1ce299442531bef79be18ad7caada5b2503 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/bsd/apple/b32/align.rs +@@ -0,0 +1,7 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 2] ++ } ++} +diff --git a/third_party/rust/libc/src/unix/bsd/apple/b32.rs b/third_party/rust/libc/src/unix/bsd/apple/b32/mod.rs +similarity index 83% +rename from third_party/rust/libc/src/unix/bsd/apple/b32.rs +rename to third_party/rust/libc/src/unix/bsd/apple/b32/mod.rs +index 859809dc863a1bea699b9a50ff790a4d4a037f40..9248e3adf2853e5012e80b31b6aee9bc8cfead91 100644 +--- a/third_party/rust/libc/src/unix/bsd/apple/b32.rs ++++ b/third_party/rust/libc/src/unix/bsd/apple/b32/mod.rs +@@ -45,7 +45,7 @@ s! { + } + } + +-s_no_extra_traits!{ ++s_no_extra_traits! { + pub struct pthread_attr_t { + __sig: c_long, + __opaque: [::c_char; 36] +@@ -81,6 +81,10 @@ cfg_if! { + } + } + ++#[doc(hidden)] ++#[deprecated(since = "0.2.55")] ++pub const NET_RT_MAXID: ::c_int = 10; ++ + pub const __PTHREAD_MUTEX_SIZE__: usize = 40; + pub const __PTHREAD_COND_SIZE__: usize = 24; + pub const __PTHREAD_CONDATTR_SIZE__: usize = 4; +@@ -90,8 +94,22 @@ pub const __PTHREAD_RWLOCKATTR_SIZE__: usize = 12; + pub const TIOCTIMESTAMP: ::c_ulong = 0x40087459; + pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40087458; + +-extern { +- pub fn exchangedata(path1: *const ::c_char, +- path2: *const ::c_char, +- options: ::c_ulong) -> ::c_int; ++pub const BIOCSETF: ::c_ulong = 0x80084267; ++pub const BIOCSRTIMEOUT: ::c_ulong = 0x8008426d; ++pub const BIOCGRTIMEOUT: ::c_ulong = 0x4008426e; ++pub const BIOCSETFNR: ::c_ulong = 0x8008427e; ++ ++extern "C" { ++ pub fn exchangedata( ++ path1: *const ::c_char, ++ path2: *const ::c_char, ++ options: ::c_ulong, ++ ) -> ::c_int; ++} ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } + } +diff --git a/third_party/rust/libc/src/unix/bsd/apple/b64.rs b/third_party/rust/libc/src/unix/bsd/apple/b64.rs +deleted file mode 100644 +index 7b89fc6ab534b745b40768deff68184f8c7f84ea..0000000000000000000000000000000000000000 +--- a/third_party/rust/libc/src/unix/bsd/apple/b64.rs ++++ /dev/null +@@ -1,102 +0,0 @@ +-//! 64-bit specific Apple (ios/darwin) definitions +- +-pub type c_long = i64; +-pub type c_ulong = u64; +-pub type boolean_t = ::c_uint; +- +-s! { +- pub struct timeval32 { +- pub tv_sec: i32, +- pub tv_usec: i32, +- } +- +- pub struct if_data { +- pub ifi_type: ::c_uchar, +- pub ifi_typelen: ::c_uchar, +- pub ifi_physical: ::c_uchar, +- pub ifi_addrlen: ::c_uchar, +- pub ifi_hdrlen: ::c_uchar, +- pub ifi_recvquota: ::c_uchar, +- pub ifi_xmitquota: ::c_uchar, +- pub ifi_unused1: ::c_uchar, +- pub ifi_mtu: u32, +- pub ifi_metric: u32, +- pub ifi_baudrate: u32, +- pub ifi_ipackets: u32, +- pub ifi_ierrors: u32, +- pub ifi_opackets: u32, +- pub ifi_oerrors: u32, +- pub ifi_collisions: u32, +- pub ifi_ibytes: u32, +- pub ifi_obytes: u32, +- pub ifi_imcasts: u32, +- pub ifi_omcasts: u32, +- pub ifi_iqdrops: u32, +- pub ifi_noproto: u32, +- pub ifi_recvtiming: u32, +- pub ifi_xmittiming: u32, +- pub ifi_lastchange: timeval32, +- pub ifi_unused2: u32, +- pub ifi_hwassist: u32, +- pub ifi_reserved1: u32, +- pub ifi_reserved2: u32, +- } +- +- pub struct bpf_hdr { +- pub bh_tstamp: ::timeval32, +- pub bh_caplen: u32, +- pub bh_datalen: u32, +- pub bh_hdrlen: ::c_ushort, +- } +-} +- +-s_no_extra_traits!{ +- pub struct pthread_attr_t { +- __sig: c_long, +- __opaque: [::c_char; 56] +- } +-} +- +-cfg_if! { +- if #[cfg(feature = "extra_traits")] { +- impl PartialEq for pthread_attr_t { +- fn eq(&self, other: &pthread_attr_t) -> bool { +- self.__sig == other.__sig +- && self.__opaque +- .iter() +- .zip(other.__opaque.iter()) +- .all(|(a,b)| a == b) +- } +- } +- impl Eq for pthread_attr_t {} +- impl ::fmt::Debug for pthread_attr_t { +- fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { +- f.debug_struct("pthread_attr_t") +- .field("__sig", &self.__sig) +- // FIXME: .field("__opaque", &self.__opaque) +- .finish() +- } +- } +- impl ::hash::Hash for pthread_attr_t { +- fn hash(&self, state: &mut H) { +- self.__sig.hash(state); +- self.__opaque.hash(state); +- } +- } +- } +-} +- +-pub const __PTHREAD_MUTEX_SIZE__: usize = 56; +-pub const __PTHREAD_COND_SIZE__: usize = 40; +-pub const __PTHREAD_CONDATTR_SIZE__: usize = 8; +-pub const __PTHREAD_RWLOCK_SIZE__: usize = 192; +-pub const __PTHREAD_RWLOCKATTR_SIZE__: usize = 16; +- +-pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459; +-pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40107458; +- +-extern { +- pub fn exchangedata(path1: *const ::c_char, +- path2: *const ::c_char, +- options: ::c_uint) -> ::c_int; +-} +diff --git a/third_party/rust/libc/src/unix/bsd/apple/b64/align.rs b/third_party/rust/libc/src/unix/bsd/apple/b64/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..ca1fe1ce299442531bef79be18ad7caada5b2503 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/bsd/apple/b64/align.rs +@@ -0,0 +1,7 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 2] ++ } ++} +diff --git a/third_party/rust/libc/src/unix/bsd/apple/b64/mod.rs b/third_party/rust/libc/src/unix/bsd/apple/b64/mod.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..0651741bb58926dee6bebdfa7dde37b9e97e2360 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/bsd/apple/b64/mod.rs +@@ -0,0 +1,222 @@ ++//! 64-bit specific Apple (ios/darwin) definitions ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type boolean_t = ::c_uint; ++pub type mcontext_t = *mut __darwin_mcontext64; ++ ++s! { ++ pub struct timeval32 { ++ pub tv_sec: i32, ++ pub tv_usec: i32, ++ } ++ ++ pub struct if_data { ++ pub ifi_type: ::c_uchar, ++ pub ifi_typelen: ::c_uchar, ++ pub ifi_physical: ::c_uchar, ++ pub ifi_addrlen: ::c_uchar, ++ pub ifi_hdrlen: ::c_uchar, ++ pub ifi_recvquota: ::c_uchar, ++ pub ifi_xmitquota: ::c_uchar, ++ pub ifi_unused1: ::c_uchar, ++ pub ifi_mtu: u32, ++ pub ifi_metric: u32, ++ pub ifi_baudrate: u32, ++ pub ifi_ipackets: u32, ++ pub ifi_ierrors: u32, ++ pub ifi_opackets: u32, ++ pub ifi_oerrors: u32, ++ pub ifi_collisions: u32, ++ pub ifi_ibytes: u32, ++ pub ifi_obytes: u32, ++ pub ifi_imcasts: u32, ++ pub ifi_omcasts: u32, ++ pub ifi_iqdrops: u32, ++ pub ifi_noproto: u32, ++ pub ifi_recvtiming: u32, ++ pub ifi_xmittiming: u32, ++ pub ifi_lastchange: timeval32, ++ pub ifi_unused2: u32, ++ pub ifi_hwassist: u32, ++ pub ifi_reserved1: u32, ++ pub ifi_reserved2: u32, ++ } ++ ++ pub struct bpf_hdr { ++ pub bh_tstamp: ::timeval32, ++ pub bh_caplen: u32, ++ pub bh_datalen: u32, ++ pub bh_hdrlen: ::c_ushort, ++ } ++ ++ pub struct ucontext_t { ++ pub uc_onstack: ::c_int, ++ pub uc_sigmask: ::sigset_t, ++ pub uc_stack: ::stack_t, ++ pub uc_link: *mut ::ucontext_t, ++ pub uc_mcsize: usize, ++ pub uc_mcontext: mcontext_t, ++ } ++ ++ pub struct __darwin_mcontext64 { ++ pub __es: __darwin_x86_exception_state64, ++ pub __ss: __darwin_x86_thread_state64, ++ pub __fs: __darwin_x86_float_state64, ++ } ++ ++ pub struct __darwin_x86_exception_state64 { ++ pub __trapno: u16, ++ pub __cpu: u16, ++ pub __err: u32, ++ pub __faultvaddr: u64, ++ } ++ ++ pub struct __darwin_x86_thread_state64 { ++ pub __rax: u64, ++ pub __rbx: u64, ++ pub __rcx: u64, ++ pub __rdx: u64, ++ pub __rdi: u64, ++ pub __rsi: u64, ++ pub __rbp: u64, ++ pub __rsp: u64, ++ pub __r8: u64, ++ pub __r9: u64, ++ pub __r10: u64, ++ pub __r11: u64, ++ pub __r12: u64, ++ pub __r13: u64, ++ pub __r14: u64, ++ pub __r15: u64, ++ pub __rip: u64, ++ pub __rflags: u64, ++ pub __cs: u64, ++ pub __fs: u64, ++ pub __gs: u64, ++ } ++ ++ pub struct __darwin_x86_float_state64 { ++ pub __fpu_reserved: [::c_int; 2], ++ __fpu_fcw: ::c_short, ++ __fpu_fsw: ::c_short, ++ pub __fpu_ftw: u8, ++ pub __fpu_rsrv1: u8, ++ pub __fpu_fop: u16, ++ pub __fpu_ip: u32, ++ pub __fpu_cs: u16, ++ pub __fpu_rsrv2: u16, ++ pub __fpu_dp: u32, ++ pub __fpu_ds: u16, ++ pub __fpu_rsrv3: u16, ++ pub __fpu_mxcsr: u32, ++ pub __fpu_mxcsrmask: u32, ++ pub __fpu_stmm0: __darwin_mmst_reg, ++ pub __fpu_stmm1: __darwin_mmst_reg, ++ pub __fpu_stmm2: __darwin_mmst_reg, ++ pub __fpu_stmm3: __darwin_mmst_reg, ++ pub __fpu_stmm4: __darwin_mmst_reg, ++ pub __fpu_stmm5: __darwin_mmst_reg, ++ pub __fpu_stmm6: __darwin_mmst_reg, ++ pub __fpu_stmm7: __darwin_mmst_reg, ++ pub __fpu_xmm0: __darwin_xmm_reg, ++ pub __fpu_xmm1: __darwin_xmm_reg, ++ pub __fpu_xmm2: __darwin_xmm_reg, ++ pub __fpu_xmm3: __darwin_xmm_reg, ++ pub __fpu_xmm4: __darwin_xmm_reg, ++ pub __fpu_xmm5: __darwin_xmm_reg, ++ pub __fpu_xmm6: __darwin_xmm_reg, ++ pub __fpu_xmm7: __darwin_xmm_reg, ++ pub __fpu_xmm8: __darwin_xmm_reg, ++ pub __fpu_xmm9: __darwin_xmm_reg, ++ pub __fpu_xmm10: __darwin_xmm_reg, ++ pub __fpu_xmm11: __darwin_xmm_reg, ++ pub __fpu_xmm12: __darwin_xmm_reg, ++ pub __fpu_xmm13: __darwin_xmm_reg, ++ pub __fpu_xmm14: __darwin_xmm_reg, ++ pub __fpu_xmm15: __darwin_xmm_reg, ++ // this field is actually [u8; 96], but defining it with a bigger type ++ // allows us to auto-implement traits for it since the length of the ++ // array is less than 32 ++ __fpu_rsrv4: [u32; 24], ++ pub __fpu_reserved1: ::c_int, ++ } ++ ++ pub struct __darwin_mmst_reg { ++ pub __mmst_reg: [::c_char; 10], ++ pub __mmst_rsrv: [::c_char; 6], ++ } ++ ++ pub struct __darwin_xmm_reg { ++ pub __xmm_reg: [::c_char; 16], ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct pthread_attr_t { ++ __sig: c_long, ++ __opaque: [::c_char; 56] ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for pthread_attr_t { ++ fn eq(&self, other: &pthread_attr_t) -> bool { ++ self.__sig == other.__sig ++ && self.__opaque ++ .iter() ++ .zip(other.__opaque.iter()) ++ .all(|(a,b)| a == b) ++ } ++ } ++ impl Eq for pthread_attr_t {} ++ impl ::fmt::Debug for pthread_attr_t { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("pthread_attr_t") ++ .field("__sig", &self.__sig) ++ // FIXME: .field("__opaque", &self.__opaque) ++ .finish() ++ } ++ } ++ impl ::hash::Hash for pthread_attr_t { ++ fn hash(&self, state: &mut H) { ++ self.__sig.hash(state); ++ self.__opaque.hash(state); ++ } ++ } ++ } ++} ++ ++#[doc(hidden)] ++#[deprecated(since = "0.2.55")] ++pub const NET_RT_MAXID: ::c_int = 11; ++ ++pub const __PTHREAD_MUTEX_SIZE__: usize = 56; ++pub const __PTHREAD_COND_SIZE__: usize = 40; ++pub const __PTHREAD_CONDATTR_SIZE__: usize = 8; ++pub const __PTHREAD_RWLOCK_SIZE__: usize = 192; ++pub const __PTHREAD_RWLOCKATTR_SIZE__: usize = 16; ++ ++pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459; ++pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40107458; ++ ++pub const BIOCSETF: ::c_ulong = 0x80104267; ++pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d; ++pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e; ++pub const BIOCSETFNR: ::c_ulong = 0x8010427e; ++ ++extern "C" { ++ pub fn exchangedata( ++ path1: *const ::c_char, ++ path2: *const ::c_char, ++ options: ::c_uint, ++ ) -> ::c_int; ++} ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } ++} +diff --git a/third_party/rust/libc/src/unix/bsd/apple/mod.rs b/third_party/rust/libc/src/unix/bsd/apple/mod.rs +index 85cbd2e1d941d3ca8a0574b7661664b69063f8fe..f130974728d15d71e2c4bd62f12cde85f315b672 100644 +--- a/third_party/rust/libc/src/unix/bsd/apple/mod.rs ++++ b/third_party/rust/libc/src/unix/bsd/apple/mod.rs +@@ -2,6 +2,7 @@ + //! + //! This covers *-apple-* triples currently + pub type c_char = i8; ++pub type wchar_t = i32; + pub type clock_t = c_ulong; + pub type time_t = c_long; + pub type suseconds_t = i32; +@@ -31,6 +32,9 @@ pub type posix_spawn_file_actions_t = *mut ::c_void; + pub type key_t = ::c_int; + pub type shmatt_t = ::c_ushort; + ++pub type sae_associd_t = u32; ++pub type sae_connid_t = u32; ++ + deprecated_mach! { + pub type vm_prot_t = ::c_int; + pub type vm_size_t = ::uintptr_t; +@@ -41,7 +45,9 @@ deprecated_mach! { + pub enum timezone {} + impl ::Copy for timezone {} + impl ::Clone for timezone { +- fn clone(&self) -> timezone { *self } ++ fn clone(&self) -> timezone { ++ *self ++ } + } + + s! { +@@ -144,6 +150,8 @@ s! { + pub si_uid: ::uid_t, + pub si_status: ::c_int, + pub si_addr: *mut ::c_void, ++ //Requires it to be union for tests ++ //pub si_value: ::sigval, + _pad: [usize; 9], + } + +@@ -489,9 +497,47 @@ s! { + pub struct in_addr { + pub s_addr: ::in_addr_t, + } ++ ++ // sys/socket.h ++ ++ pub struct sa_endpoints_t { ++ pub sae_srcif: ::c_uint, // optional source interface ++ pub sae_srcaddr: *const ::sockaddr, // optional source address ++ pub sae_srcaddrlen: ::socklen_t, // size of source address ++ pub sae_dstaddr: *const ::sockaddr, // destination address ++ pub sae_dstaddrlen: ::socklen_t, // size of destination address ++ } ++ ++ pub struct timex { ++ pub modes: ::c_uint, ++ pub offset: ::c_long, ++ pub freq: ::c_long, ++ pub maxerror: ::c_long, ++ pub esterror: ::c_long, ++ pub status: ::c_int, ++ pub constant: ::c_long, ++ pub precision: ::c_long, ++ pub tolerance: ::c_long, ++ pub ppsfreq: ::c_long, ++ pub jitter: ::c_long, ++ pub shift: ::c_int, ++ pub stabil: ::c_long, ++ pub jitcnt: ::c_long, ++ pub calcnt: ::c_long, ++ pub errcnt: ::c_long, ++ pub stbcnt: ::c_long, ++ } ++ ++ pub struct ntptimeval { ++ pub time: ::timespec, ++ pub maxerror: ::c_long, ++ pub esterror: ::c_long, ++ pub tai: ::c_long, ++ pub time_state: ::c_int, ++ } + } + +-s_no_extra_traits!{ ++s_no_extra_traits! { + #[cfg_attr(libc_packedN, repr(packed(4)))] + pub struct kevent { + pub ident: ::uintptr_t, +@@ -614,6 +660,28 @@ s_no_extra_traits!{ + } + } + ++impl siginfo_t { ++ pub unsafe fn si_addr(&self) -> *mut ::c_void { ++ self.si_addr ++ } ++ ++ pub unsafe fn si_value(&self) -> ::sigval { ++ #[repr(C)] ++ struct siginfo_timer { ++ _si_signo: ::c_int, ++ _si_errno: ::c_int, ++ _si_code: ::c_int, ++ _si_pid: ::pid_t, ++ _si_uid: ::uid_t, ++ _si_status: ::c_int, ++ _si_addr: *mut ::c_void, ++ si_value: ::sigval, ++ } ++ ++ (*(self as *const siginfo_t as *const siginfo_timer)).si_value ++ } ++} ++ + cfg_if! { + if #[cfg(libc_union)] { + s_no_extra_traits! { +@@ -1213,18 +1281,18 @@ pub const ACCOUNTING: ::c_short = 9; + pub const SIGNATURE: ::c_short = 10; + pub const SHUTDOWN_TIME: ::c_short = 11; + +-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_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; ++ | LC_CTYPE_MASK ++ | LC_MESSAGES_MASK ++ | LC_MONETARY_MASK ++ | LC_NUMERIC_MASK ++ | LC_TIME_MASK; + + pub const CODESET: ::nl_item = 0; + pub const D_T_FMT: ::nl_item = 1; +@@ -1693,8 +1761,6 @@ pub const TIOCGETD: ::c_ulong = 0x4004741a; + pub const TIOCSETD: ::c_ulong = 0x8004741b; + pub const TIOCIXON: ::c_uint = 0x20007481; + pub const TIOCIXOFF: ::c_uint = 0x20007480; +-pub const TIOCSBRK: ::c_uint = 0x2000747b; +-pub const TIOCCBRK: ::c_uint = 0x2000747a; + pub const TIOCSDTR: ::c_uint = 0x20007479; + pub const TIOCCDTR: ::c_uint = 0x20007478; + pub const TIOCGPGRP: ::c_ulong = 0x40047477; +@@ -1737,6 +1803,13 @@ pub const TIOCPTYGRANT: ::c_uint = 0x20007454; + pub const TIOCPTYGNAME: ::c_uint = 0x40807453; + pub const TIOCPTYUNLK: ::c_uint = 0x20007452; + ++pub const BIOCGRSIG: ::c_ulong = 0x40044272; ++pub const BIOCSRSIG: ::c_ulong = 0x80044273; ++pub const BIOCSDLT: ::c_ulong = 0x80044278; ++pub const BIOCGSEESENT: ::c_ulong = 0x40044276; ++pub const BIOCSSEESENT: ::c_ulong = 0x80044277; ++pub const BIOCGDLTLIST: ::c_ulong = 0xc00c4279; ++ + pub const FIODTYPE: ::c_ulong = 0x4004667a; + + pub const B0: speed_t = 0; +@@ -1767,17 +1840,17 @@ pub const EXTB: speed_t = 38400; + + 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_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 = 0x2000; + +-pub const GLOB_NOSPACE : ::c_int = -1; +-pub const GLOB_ABORTED : ::c_int = -2; +-pub const GLOB_NOMATCH : ::c_int = -3; ++pub const GLOB_NOSPACE: ::c_int = -1; ++pub const GLOB_ABORTED: ::c_int = -2; ++pub const GLOB_NOMATCH: ::c_int = -3; + + pub const POSIX_MADV_NORMAL: ::c_int = 0; + pub const POSIX_MADV_RANDOM: ::c_int = 1; +@@ -1831,6 +1904,7 @@ pub const RLIMIT_RSS: ::c_int = RLIMIT_AS; + pub const RLIMIT_MEMLOCK: ::c_int = 6; + pub const RLIMIT_NPROC: ::c_int = 7; + pub const RLIMIT_NOFILE: ::c_int = 8; ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] + pub const RLIM_NLIMITS: ::c_int = 9; + pub const _RLIMIT_POSIX_FLAG: ::c_int = 0x1000; + +@@ -1850,7 +1924,7 @@ pub const MADV_FREE_REUSABLE: ::c_int = 7; + pub const MADV_FREE_REUSE: ::c_int = 8; + pub const MADV_CAN_REUSE: ::c_int = 9; + +-pub const MINCORE_INCORE: ::c_int = 0x1; ++pub const MINCORE_INCORE: ::c_int = 0x1; + pub const MINCORE_REFERENCED: ::c_int = 0x2; + pub const MINCORE_MODIFIED: ::c_int = 0x4; + pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8; +@@ -2117,46 +2191,43 @@ pub const SYSPROTO_CONTROL: ::c_int = 2; + + pub const PF_UNSPEC: ::c_int = AF_UNSPEC; + pub const PF_LOCAL: ::c_int = AF_LOCAL; +-pub const PF_UNIX: ::c_int = PF_LOCAL; +-pub const PF_INET: ::c_int = AF_INET; ++pub const PF_UNIX: ::c_int = PF_LOCAL; ++pub const PF_INET: ::c_int = AF_INET; + pub const PF_IMPLINK: ::c_int = AF_IMPLINK; +-pub const PF_PUP: ::c_int = AF_PUP; ++pub const PF_PUP: ::c_int = AF_PUP; + pub const PF_CHAOS: ::c_int = AF_CHAOS; +-pub const PF_NS: ::c_int = AF_NS; +-pub const PF_ISO: ::c_int = AF_ISO; +-pub const PF_OSI: ::c_int = AF_ISO; +-pub const PF_ECMA: ::c_int = AF_ECMA; ++pub const PF_NS: ::c_int = AF_NS; ++pub const PF_ISO: ::c_int = AF_ISO; ++pub const PF_OSI: ::c_int = AF_ISO; ++pub const PF_ECMA: ::c_int = AF_ECMA; + pub const PF_DATAKIT: ::c_int = AF_DATAKIT; + pub const PF_CCITT: ::c_int = AF_CCITT; +-pub const PF_SNA: ::c_int = AF_SNA; ++pub const PF_SNA: ::c_int = AF_SNA; + pub const PF_DECnet: ::c_int = AF_DECnet; +-pub const PF_DLI: ::c_int = AF_DLI; +-pub const PF_LAT: ::c_int = AF_LAT; ++pub const PF_DLI: ::c_int = AF_DLI; ++pub const PF_LAT: ::c_int = AF_LAT; + pub const PF_HYLINK: ::c_int = AF_HYLINK; + pub const PF_APPLETALK: ::c_int = AF_APPLETALK; + pub const PF_ROUTE: ::c_int = AF_ROUTE; +-pub const PF_LINK: ::c_int = AF_LINK; +-pub const PF_XTP: ::c_int = pseudo_AF_XTP; +-pub const PF_COIP: ::c_int = AF_COIP; +-pub const PF_CNT: ::c_int = AF_CNT; +-pub const PF_SIP: ::c_int = AF_SIP; +-pub const PF_IPX: ::c_int = AF_IPX; +-pub const PF_RTIP: ::c_int = pseudo_AF_RTIP; +-pub const PF_PIP: ::c_int = pseudo_AF_PIP; +-pub const PF_ISDN: ::c_int = AF_ISDN; +-pub const PF_KEY: ::c_int = pseudo_AF_KEY; ++pub const PF_LINK: ::c_int = AF_LINK; ++pub const PF_XTP: ::c_int = pseudo_AF_XTP; ++pub const PF_COIP: ::c_int = AF_COIP; ++pub const PF_CNT: ::c_int = AF_CNT; ++pub const PF_SIP: ::c_int = AF_SIP; ++pub const PF_IPX: ::c_int = AF_IPX; ++pub const PF_RTIP: ::c_int = pseudo_AF_RTIP; ++pub const PF_PIP: ::c_int = pseudo_AF_PIP; ++pub const PF_ISDN: ::c_int = AF_ISDN; ++pub const PF_KEY: ::c_int = pseudo_AF_KEY; + pub const PF_INET6: ::c_int = AF_INET6; +-pub const PF_NATM: ::c_int = AF_NATM; ++pub const PF_NATM: ::c_int = AF_NATM; + pub const PF_SYSTEM: ::c_int = AF_SYSTEM; + pub const PF_NETBIOS: ::c_int = AF_NETBIOS; +-pub const PF_PPP: ::c_int = AF_PPP; ++pub const PF_PPP: ::c_int = AF_PPP; + + pub const NET_RT_DUMP: ::c_int = 1; + pub const NET_RT_FLAGS: ::c_int = 2; + pub const NET_RT_IFLIST: ::c_int = 3; +-#[doc(hidden)] +-#[deprecated(since = "0.2.55")] +-pub const NET_RT_MAXID: ::c_int = 10; + + pub const SOMAXCONN: ::c_int = 128; + +@@ -2177,14 +2248,20 @@ pub const IP_PKTINFO: ::c_int = 26; + pub const IP_RECVTOS: ::c_int = 27; + pub const IPV6_JOIN_GROUP: ::c_int = 12; + pub const IPV6_LEAVE_GROUP: ::c_int = 13; ++pub const IPV6_CHECKSUM: ::c_int = 26; + pub const IPV6_RECVTCLASS: ::c_int = 35; + pub const IPV6_TCLASS: ::c_int = 36; + pub const IPV6_PKTINFO: ::c_int = 46; ++pub const IPV6_HOPLIMIT: ::c_int = 47; + pub const IPV6_RECVPKTINFO: ::c_int = 61; + + pub const TCP_NOPUSH: ::c_int = 4; + pub const TCP_NOOPT: ::c_int = 8; + pub const TCP_KEEPALIVE: ::c_int = 0x10; ++pub const TCP_KEEPINTVL: ::c_int = 0x101; ++pub const TCP_KEEPCNT: ::c_int = 0x102; ++/// Enable/Disable TCP Fastopen on this socket ++pub const TCP_FASTOPEN: ::c_int = 0x105; + + pub const SOL_LOCAL: ::c_int = 0; + +@@ -2231,15 +2308,15 @@ pub const SO_NOTIFYCONFLICT: ::c_int = 0x1026; + pub const SO_RANDOMPORT: ::c_int = 0x1082; + pub const SO_NP_EXTENSIONS: ::c_int = 0x1083; + +-pub const MSG_OOB: ::c_int = 0x1; ++pub const MSG_OOB: ::c_int = 0x1; + pub const MSG_PEEK: ::c_int = 0x2; + pub const MSG_DONTROUTE: ::c_int = 0x4; +-pub const MSG_EOR: ::c_int = 0x8; ++pub const MSG_EOR: ::c_int = 0x8; + pub const MSG_TRUNC: ::c_int = 0x10; + pub const MSG_CTRUNC: ::c_int = 0x20; + pub const MSG_WAITALL: ::c_int = 0x40; + pub const MSG_DONTWAIT: ::c_int = 0x80; +-pub const MSG_EOF: ::c_int = 0x100; ++pub const MSG_EOF: ::c_int = 0x100; + pub const MSG_FLUSH: ::c_int = 0x400; + pub const MSG_HOLD: ::c_int = 0x800; + pub const MSG_SEND: ::c_int = 0x1000; +@@ -2251,28 +2328,45 @@ pub const SCM_TIMESTAMP: ::c_int = 0x02; + pub const SCM_CREDS: ::c_int = 0x03; + + // https://github.com/aosm/xnu/blob/master/bsd/net/if.h#L140-L156 +-pub const IFF_UP: ::c_int = 0x1; // interface is up +-pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid +-pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging +-pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net ++pub const IFF_UP: ::c_int = 0x1; // interface is up ++pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid ++pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging ++pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net + pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link +-pub const IFF_NOTRAILERS: ::c_int = 0x20; // obsolete: avoid use of trailers +-pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated +-pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol +-pub const IFF_PROMISC: ::c_int = 0x100;// receive all packets +-pub const IFF_ALLMULTI: ::c_int = 0x200;// receive all multicast packets +-pub const IFF_OACTIVE: ::c_int = 0x400;// transmission in progress +-pub const IFF_SIMPLEX: ::c_int = 0x800;// can't hear own transmissions +-pub const IFF_LINK0: ::c_int = 0x1000;// per link layer defined bit +-pub const IFF_LINK1: ::c_int = 0x2000;// per link layer defined bit +-pub const IFF_LINK2: ::c_int = 0x4000;// per link layer defined bit +-pub const IFF_ALTPHYS: ::c_int = IFF_LINK2;// use alternate physical connection +-pub const IFF_MULTICAST: ::c_int = 0x8000;// supports multicast ++pub const IFF_NOTRAILERS: ::c_int = 0x20; // obsolete: avoid use of trailers ++pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated ++pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol ++pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets ++pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets ++pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress ++pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions ++pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit ++pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit ++pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit ++pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection ++pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast + + pub const SHUT_RD: ::c_int = 0; + pub const SHUT_WR: ::c_int = 1; + pub const SHUT_RDWR: ::c_int = 2; + ++pub const SAE_ASSOCID_ANY: ::sae_associd_t = 0; ++/// ((sae_associd_t)(-1ULL)) ++pub const SAE_ASSOCID_ALL: ::sae_associd_t = 0xffffffff; ++ ++pub const SAE_CONNID_ANY: ::sae_connid_t = 0; ++/// ((sae_connid_t)(-1ULL)) ++pub const SAE_CONNID_ALL: ::sae_connid_t = 0xffffffff; ++ ++// connectx() flag parameters ++ ++/// resume connect() on read/write ++pub const CONNECT_RESUME_ON_READ_WRITE: ::c_uint = 0x1; ++/// data is idempotent ++pub const CONNECT_DATA_IDEMPOTENT: ::c_uint = 0x2; ++/// data includes security that replaces the TFO-cookie ++pub const CONNECT_DATA_AUTHENTICATED: ::c_uint = 0x4; ++ + pub const LOCK_SH: ::c_int = 1; + pub const LOCK_EX: ::c_int = 2; + pub const LOCK_NB: ::c_int = 4; +@@ -2407,6 +2501,7 @@ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { + __opaque: [0; __PTHREAD_RWLOCK_SIZE__], + }; + ++pub const MINSIGSTKSZ: ::size_t = 32768; + pub const SIGSTKSZ: ::size_t = 131072; + + pub const FD_SETSIZE: usize = 1024; +@@ -2461,7 +2556,7 @@ pub const NOTE_EXIT: u32 = 0x80000000; + pub const NOTE_FORK: u32 = 0x40000000; + pub const NOTE_EXEC: u32 = 0x20000000; + #[doc(hidden)] +-#[deprecated(since="0.2.49", note="Deprecated since MacOSX 10.9")] ++#[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")] + pub const NOTE_REAP: u32 = 0x10000000; + pub const NOTE_SIGNAL: u32 = 0x08000000; + pub const NOTE_EXITSTATUS: u32 = 0x04000000; +@@ -2469,7 +2564,7 @@ pub const NOTE_EXIT_DETAIL: u32 = 0x02000000; + pub const NOTE_PDATAMASK: u32 = 0x000fffff; + pub const NOTE_PCTRLMASK: u32 = 0xfff00000; + #[doc(hidden)] +-#[deprecated(since="0.2.49", note="Deprecated since MacOSX 10.9")] ++#[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")] + pub const NOTE_EXIT_REPARENTED: u32 = 0x00080000; + pub const NOTE_EXIT_DETAIL_MASK: u32 = 0x00070000; + pub const NOTE_EXIT_DECRYPTFAIL: u32 = 0x00010000; +@@ -2502,22 +2597,22 @@ pub const BSDLY: ::tcflag_t = 0x00008000; + pub const VTDLY: ::tcflag_t = 0x00010000; + pub const OFDEL: ::tcflag_t = 0x00020000; + +-pub const NL0: ::tcflag_t = 0x00000000; ++pub const NL0: ::tcflag_t = 0x00000000; + pub const NL1: ::tcflag_t = 0x00000100; + pub const TAB0: ::tcflag_t = 0x00000000; + pub const TAB1: ::tcflag_t = 0x00000400; + pub const TAB2: ::tcflag_t = 0x00000800; +-pub const CR0: ::tcflag_t = 0x00000000; +-pub const CR1: ::tcflag_t = 0x00001000; +-pub const CR2: ::tcflag_t = 0x00002000; +-pub const CR3: ::tcflag_t = 0x00003000; +-pub const FF0: ::tcflag_t = 0x00000000; +-pub const FF1: ::tcflag_t = 0x00004000; +-pub const BS0: ::tcflag_t = 0x00000000; +-pub const BS1: ::tcflag_t = 0x00008000; ++pub const CR0: ::tcflag_t = 0x00000000; ++pub const CR1: ::tcflag_t = 0x00001000; ++pub const CR2: ::tcflag_t = 0x00002000; ++pub const CR3: ::tcflag_t = 0x00003000; ++pub const FF0: ::tcflag_t = 0x00000000; ++pub const FF1: ::tcflag_t = 0x00004000; ++pub const BS0: ::tcflag_t = 0x00000000; ++pub const BS1: ::tcflag_t = 0x00008000; + pub const TAB3: ::tcflag_t = 0x00000004; +-pub const VT0: ::tcflag_t = 0x00000000; +-pub const VT1: ::tcflag_t = 0x00010000; ++pub const VT0: ::tcflag_t = 0x00000000; ++pub const VT1: ::tcflag_t = 0x00010000; + pub const IUTF8: ::tcflag_t = 0x00004000; + pub const CRTSCTS: ::tcflag_t = 0x00030000; + +@@ -2676,10 +2771,10 @@ pub const KERN_KDGETENTROPY: ::c_int = 16; + pub const KERN_KDWRITETR: ::c_int = 17; + pub const KERN_KDWRITEMAP: ::c_int = 18; + #[doc(hidden)] +-#[deprecated(since = "0.2.49", note ="Removed in MacOSX 10.12")] ++#[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")] + pub const KERN_KDENABLE_BG_TRACE: ::c_int = 19; + #[doc(hidden)] +-#[deprecated(since = "0.2.49", note ="Removed in MacOSX 10.12")] ++#[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")] + pub const KERN_KDDISABLE_BG_TRACE: ::c_int = 20; + pub const KERN_KDREADCURTHRMAP: ::c_int = 21; + pub const KERN_KDSET_TYPEFILTER: ::c_int = 22; +@@ -2770,8 +2865,11 @@ pub const AI_PASSIVE: ::c_int = 0x00000001; + pub const AI_CANONNAME: ::c_int = 0x00000002; + pub const AI_NUMERICHOST: ::c_int = 0x00000004; + pub const AI_NUMERICSERV: ::c_int = 0x00001000; +-pub const AI_MASK: ::c_int = AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | +- AI_NUMERICSERV | AI_ADDRCONFIG; ++pub const AI_MASK: ::c_int = AI_PASSIVE ++ | AI_CANONNAME ++ | AI_NUMERICHOST ++ | AI_NUMERICSERV ++ | AI_ADDRCONFIG; + pub const AI_ALL: ::c_int = 0x00000100; + pub const AI_V4MAPPED_CFG: ::c_int = 0x00000200; + pub const AI_ADDRCONFIG: ::c_int = 0x00000400; +@@ -2786,6 +2884,10 @@ 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; ++#[deprecated( ++ since = "0.2.64", ++ note = "Can vary at runtime. Use sysconf(3) instead" ++)] + pub const AIO_LISTIO_MAX: ::c_int = 16; + pub const LIO_NOP: ::c_int = 0; + pub const LIO_WRITE: ::c_int = 2; +@@ -2802,6 +2904,9 @@ pub const P_ALL: idtype_t = 0; + pub const P_PID: idtype_t = 1; + pub const P_PGID: idtype_t = 2; + ++pub const UTIME_OMIT: c_long = -2; ++pub const UTIME_NOW: c_long = -1; ++ + pub const XATTR_NOFOLLOW: ::c_int = 0x0001; + pub const XATTR_CREATE: ::c_int = 0x0002; + pub const XATTR_REPLACE: ::c_int = 0x0004; +@@ -2916,25 +3021,62 @@ pub const UTUN_OPT_FLAGS: ::c_int = 1; + pub const UTUN_OPT_IFNAME: ::c_int = 2; + + // net/bpf.h +-pub const DLT_NULL: ::c_uint = 0; // no link-layer encapsulation +-pub const DLT_EN10MB: ::c_uint = 1; // Ethernet (10Mb) +-pub const DLT_EN3MB: ::c_uint = 2; // Experimental Ethernet (3Mb) +-pub const DLT_AX25: ::c_uint = 3; // Amateur Radio AX.25 +-pub const DLT_PRONET: ::c_uint = 4; // Proteon ProNET Token Ring +-pub const DLT_CHAOS: ::c_uint = 5; // Chaos +-pub const DLT_IEEE802: ::c_uint = 6; // IEEE 802 Networks +-pub const DLT_ARCNET: ::c_uint = 7; // ARCNET +-pub const DLT_SLIP: ::c_uint = 8; // Serial Line IP +-pub const DLT_PPP: ::c_uint = 9; // Point-to-point Protocol +-pub const DLT_FDDI: ::c_uint = 10; // FDDI ++pub const DLT_NULL: ::c_uint = 0; // no link-layer encapsulation ++pub const DLT_EN10MB: ::c_uint = 1; // Ethernet (10Mb) ++pub const DLT_EN3MB: ::c_uint = 2; // Experimental Ethernet (3Mb) ++pub const DLT_AX25: ::c_uint = 3; // Amateur Radio AX.25 ++pub const DLT_PRONET: ::c_uint = 4; // Proteon ProNET Token Ring ++pub const DLT_CHAOS: ::c_uint = 5; // Chaos ++pub const DLT_IEEE802: ::c_uint = 6; // IEEE 802 Networks ++pub const DLT_ARCNET: ::c_uint = 7; // ARCNET ++pub const DLT_SLIP: ::c_uint = 8; // Serial Line IP ++pub const DLT_PPP: ::c_uint = 9; // Point-to-point Protocol ++pub const DLT_FDDI: ::c_uint = 10; // FDDI + pub const DLT_ATM_RFC1483: ::c_uint = 11; // LLC/SNAP encapsulated atm +-pub const DLT_RAW: ::c_uint = 12; // raw IP ++pub const DLT_RAW: ::c_uint = 12; // raw IP + pub const DLT_LOOP: ::c_uint = 108; + + // https://github.com/apple/darwin-xnu/blob/master/bsd/net/bpf.h#L100 + // sizeof(i32) + pub const BPF_ALIGNMENT: ::c_int = 4; + ++// sys/mount.h ++pub const MNT_RDONLY: ::c_int = 0x00000001; ++pub const MNT_SYNCHRONOUS: ::c_int = 0x00000002; ++pub const MNT_NOEXEC: ::c_int = 0x00000004; ++pub const MNT_NOSUID: ::c_int = 0x00000008; ++pub const MNT_NODEV: ::c_int = 0x00000010; ++pub const MNT_UNION: ::c_int = 0x00000020; ++pub const MNT_ASYNC: ::c_int = 0x00000040; ++pub const MNT_CPROTECT: ::c_int = 0x00000080; ++ ++// NFS export related mount flags. ++pub const MNT_EXPORTED: ::c_int = 0x00000100; ++ ++// MAC labeled / "quarantined" flag ++pub const MNT_QUARANTINE: ::c_int = 0x00000400; ++ ++// Flags set by internal operations. ++pub const MNT_LOCAL: ::c_int = 0x00001000; ++pub const MNT_QUOTA: ::c_int = 0x00002000; ++pub const MNT_ROOTFS: ::c_int = 0x00004000; ++pub const MNT_DOVOLFS: ::c_int = 0x00008000; ++ ++pub const MNT_DONTBROWSE: ::c_int = 0x00100000; ++pub const MNT_IGNORE_OWNERSHIP: ::c_int = 0x00200000; ++pub const MNT_AUTOMOUNTED: ::c_int = 0x00400000; ++pub const MNT_JOURNALED: ::c_int = 0x00800000; ++pub const MNT_NOUSERXATTR: ::c_int = 0x01000000; ++pub const MNT_DEFWRITE: ::c_int = 0x02000000; ++pub const MNT_MULTILABEL: ::c_int = 0x04000000; ++pub const MNT_NOATIME: ::c_int = 0x10000000; ++pub const MNT_SNAPSHOT: ::c_int = 0x40000000; ++ ++// External filesystem command modifier flags. ++pub const MNT_UPDATE: ::c_int = 0x00010000; ++pub const MNT_NOBLOCK: ::c_int = 0x00020000; ++pub const MNT_RELOAD: ::c_int = 0x00040000; ++ + // sys/spawn.h: + pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01; + pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02; +@@ -2977,18 +3119,70 @@ pub const SHM_R: ::c_int = IPC_R; + pub const SHM_W: ::c_int = IPC_W; + + // Flags for chflags(2) +-pub const UF_SETTABLE: ::c_uint = 0x0000ffff; +-pub const UF_NODUMP: ::c_uint = 0x00000001; +-pub const UF_IMMUTABLE: ::c_uint = 0x00000002; +-pub const UF_APPEND: ::c_uint = 0x00000004; +-pub const UF_OPAQUE: ::c_uint = 0x00000008; +-pub const UF_COMPRESSED: ::c_uint = 0x00000020; +-pub const UF_TRACKED: ::c_uint = 0x00000040; +-pub const SF_SETTABLE: ::c_uint = 0xffff0000; +-pub const SF_ARCHIVED: ::c_uint = 0x00010000; +-pub const SF_IMMUTABLE: ::c_uint = 0x00020000; +-pub const SF_APPEND: ::c_uint = 0x00040000; +-pub const UF_HIDDEN: ::c_uint = 0x00008000; ++pub const UF_SETTABLE: ::c_uint = 0x0000ffff; ++pub const UF_NODUMP: ::c_uint = 0x00000001; ++pub const UF_IMMUTABLE: ::c_uint = 0x00000002; ++pub const UF_APPEND: ::c_uint = 0x00000004; ++pub const UF_OPAQUE: ::c_uint = 0x00000008; ++pub const UF_COMPRESSED: ::c_uint = 0x00000020; ++pub const UF_TRACKED: ::c_uint = 0x00000040; ++pub const SF_SETTABLE: ::c_uint = 0xffff0000; ++pub const SF_ARCHIVED: ::c_uint = 0x00010000; ++pub const SF_IMMUTABLE: ::c_uint = 0x00020000; ++pub const SF_APPEND: ::c_uint = 0x00040000; ++pub const UF_HIDDEN: ::c_uint = 0x00008000; ++ ++// ++pub const NTP_API: ::c_int = 4; ++pub const MAXPHASE: ::c_long = 500000000; ++pub const MAXFREQ: ::c_long = 500000; ++pub const MINSEC: ::c_int = 256; ++pub const MAXSEC: ::c_int = 2048; ++pub const NANOSECOND: ::c_long = 1000000000; ++pub const SCALE_PPM: ::c_int = 65; ++pub const MAXTC: ::c_int = 10; ++pub const MOD_OFFSET: ::c_uint = 0x0001; ++pub const MOD_FREQUENCY: ::c_uint = 0x0002; ++pub const MOD_MAXERROR: ::c_uint = 0x0004; ++pub const MOD_ESTERROR: ::c_uint = 0x0008; ++pub const MOD_STATUS: ::c_uint = 0x0010; ++pub const MOD_TIMECONST: ::c_uint = 0x0020; ++pub const MOD_PPSMAX: ::c_uint = 0x0040; ++pub const MOD_TAI: ::c_uint = 0x0080; ++pub const MOD_MICRO: ::c_uint = 0x1000; ++pub const MOD_NANO: ::c_uint = 0x2000; ++pub const MOD_CLKB: ::c_uint = 0x4000; ++pub const MOD_CLKA: ::c_uint = 0x8000; ++pub const STA_PLL: ::c_int = 0x0001; ++pub const STA_PPSFREQ: ::c_int = 0x0002; ++pub const STA_PPSTIME: ::c_int = 0x0004; ++pub const STA_FLL: ::c_int = 0x0008; ++pub const STA_INS: ::c_int = 0x0010; ++pub const STA_DEL: ::c_int = 0x0020; ++pub const STA_UNSYNC: ::c_int = 0x0040; ++pub const STA_FREQHOLD: ::c_int = 0x0080; ++pub const STA_PPSSIGNAL: ::c_int = 0x0100; ++pub const STA_PPSJITTER: ::c_int = 0x0200; ++pub const STA_PPSWANDER: ::c_int = 0x0400; ++pub const STA_PPSERROR: ::c_int = 0x0800; ++pub const STA_CLOCKERR: ::c_int = 0x1000; ++pub const STA_NANO: ::c_int = 0x2000; ++pub const STA_MODE: ::c_int = 0x4000; ++pub const STA_CLK: ::c_int = 0x8000; ++pub const STA_RONLY: ::c_int = STA_PPSSIGNAL ++ | STA_PPSJITTER ++ | STA_PPSWANDER ++ | STA_PPSERROR ++ | STA_CLOCKERR ++ | STA_NANO ++ | STA_MODE ++ | STA_CLK; ++pub const TIME_OK: ::c_int = 0; ++pub const TIME_INS: ::c_int = 1; ++pub const TIME_DEL: ::c_int = 2; ++pub const TIME_OOP: ::c_int = 3; ++pub const TIME_WAIT: ::c_int = 4; ++pub const TIME_ERROR: ::c_int = 5; + + cfg_if! { + if #[cfg(libc_const_size_of)] { +@@ -3058,44 +3252,53 @@ f! { + } + } + +-extern { ++extern "C" { + pub fn setgrent(); + #[doc(hidden)] +- #[deprecated(since="0.2.49", note="Deprecated in MacOSX 10.5")] ++ #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.5")] + #[link_name = "daemon$1050"] + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; + #[doc(hidden)] +- #[deprecated(since="0.2.49", note="Deprecated in MacOSX 10.10")] ++ #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")] + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; + #[doc(hidden)] +- #[deprecated(since="0.2.49", note="Deprecated in MacOSX 10.10")] +- pub fn sem_init(sem: *mut sem_t, +- pshared: ::c_int, +- value: ::c_uint) +- -> ::c_int; ++ #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")] ++ pub fn sem_init( ++ sem: *mut sem_t, ++ pshared: ::c_int, ++ value: ::c_uint, ++ ) -> ::c_int; + 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; ++ #[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 chflags(path: *const ::c_char, flags: ::c_uint) -> ::c_int; + pub fn fchflags(fd: ::c_int, flags: ::c_uint) -> ::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; +- pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb, +- nitems: ::c_int, sevp: *mut sigevent) -> ::c_int; ++ pub fn lio_listio( ++ mode: ::c_int, ++ aiocb_list: *const *mut aiocb, ++ nitems: ::c_int, ++ sevp: *mut sigevent, ++ ) -> ::c_int; + + pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; + + pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; + +- pub fn gettimeofday(tp: *mut ::timeval, +- tz: *mut ::c_void) -> ::c_int; ++ pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; + pub fn getutxent() -> *mut utmpx; + pub fn getutxid(ut: *const utmpx) -> *mut utmpx; + pub fn getutxline(ut: *const utmpx) -> *mut utmpx; +@@ -3104,176 +3307,296 @@ extern { + pub fn endutxent(); + pub fn utmpxname(file: *const ::c_char) -> ::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 mincore(addr: *const ::c_void, len: ::size_t, +- vec: *mut ::c_char) -> ::c_int; +- pub fn sysctlnametomib(name: *const ::c_char, +- mibp: *mut ::c_int, +- sizep: *mut ::size_t) +- -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "mprotect$UNIX2003")] +- pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) +- -> ::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 mincore( ++ addr: *const ::c_void, ++ len: ::size_t, ++ vec: *mut ::c_char, ++ ) -> ::c_int; ++ pub fn sysctlnametomib( ++ name: *const ::c_char, ++ mibp: *mut ::c_int, ++ sizep: *mut ::size_t, ++ ) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "mprotect$UNIX2003" ++ )] ++ pub fn mprotect( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ prot: ::c_int, ++ ) -> ::c_int; + pub fn semget(key: key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "semctl$UNIX2003")] +- pub fn semctl(semid: ::c_int, +- semnum: ::c_int, +- cmd: ::c_int, ...) -> ::c_int; +- pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "semctl$UNIX2003" ++ )] ++ pub fn semctl( ++ semid: ::c_int, ++ semnum: ::c_int, ++ cmd: ::c_int, ++ ... ++ ) -> ::c_int; ++ pub fn semop( ++ semid: ::c_int, ++ sops: *mut sembuf, ++ nsops: ::size_t, ++ ) -> ::c_int; + pub fn shm_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::c_int; +- pub fn ftok(pathname : *const c_char, proj_id : ::c_int) -> key_t; +- pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, +- shmflg: ::c_int) -> *mut ::c_void; ++ pub fn ftok(pathname: *const c_char, proj_id: ::c_int) -> key_t; ++ 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; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "shmctl$UNIX2003")] +- pub fn shmctl(shmid: ::c_int, cmd: ::c_int, +- buf: *mut ::shmid_ds) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "shmctl$UNIX2003" ++ )] ++ pub fn shmctl( ++ shmid: ::c_int, ++ cmd: ::c_int, ++ buf: *mut ::shmid_ds, ++ ) -> ::c_int; + pub fn shmget(key: key_t, size: ::size_t, shmflg: ::c_int) -> ::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 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; + #[deprecated(since = "0.2.55", note = "Use the mach crate")] + pub fn mach_absolute_time() -> u64; + #[deprecated(since = "0.2.55", note = "Use the mach crate")] + #[allow(deprecated)] + pub fn mach_timebase_info(info: *mut ::mach_timebase_info) -> ::c_int; + pub fn pthread_setname_np(name: *const ::c_char) -> ::c_int; ++ pub fn pthread_getname_np( ++ thread: ::pthread_t, ++ name: *mut ::c_char, ++ len: ::size_t, ++ ) -> ::c_int; + pub fn pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void; + pub fn pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t; +- pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, +- pshared: ::c_int) -> ::c_int; +- pub fn pthread_condattr_getpshared(attr: *const pthread_condattr_t, +- pshared: *mut ::c_int) -> ::c_int; +- pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, +- pshared: ::c_int) -> ::c_int; +- pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t, +- pshared: *mut ::c_int) -> ::c_int; +- pub fn pthread_rwlockattr_getpshared(attr: *const pthread_rwlockattr_t, +- val: *mut ::c_int) -> ::c_int; +- pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, +- val: ::c_int) -> ::c_int; ++ pub fn pthread_condattr_setpshared( ++ attr: *mut pthread_condattr_t, ++ pshared: ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_condattr_getpshared( ++ attr: *const pthread_condattr_t, ++ pshared: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_mutexattr_setpshared( ++ attr: *mut pthread_mutexattr_t, ++ pshared: ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_mutexattr_getpshared( ++ attr: *const pthread_mutexattr_t, ++ pshared: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_rwlockattr_getpshared( ++ attr: *const pthread_rwlockattr_t, ++ val: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_rwlockattr_setpshared( ++ attr: *mut pthread_rwlockattr_t, ++ val: ::c_int, ++ ) -> ::c_int; + pub fn __error() -> *mut ::c_int; +- pub fn backtrace(buf: *mut *mut ::c_void, +- sz: ::c_int) -> ::c_int; ++ pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int; + #[cfg_attr(target_os = "macos", link_name = "statfs$INODE64")] + pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; + #[cfg_attr(target_os = "macos", link_name = "fstatfs$INODE64")] + pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::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 kevent64(kq: ::c_int, +- changelist: *const ::kevent64_s, +- nchanges: ::c_int, +- eventlist: *mut ::kevent64_s, +- nevents: ::c_int, +- flags: ::c_uint, +- timeout: *const ::timespec) -> ::c_int; +- pub fn mount(src: *const ::c_char, +- target: *const ::c_char, +- flags: ::c_int, +- data: *mut ::c_void) -> ::c_int; +- pub fn ptrace(request: ::c_int, +- pid: ::pid_t, +- addr: *mut ::c_char, +- data: ::c_int) -> ::c_int; +- pub fn quotactl(special: *const ::c_char, +- cmd: ::c_int, +- id: ::c_int, +- data: *mut ::c_char) -> ::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 kevent64( ++ kq: ::c_int, ++ changelist: *const ::kevent64_s, ++ nchanges: ::c_int, ++ eventlist: *mut ::kevent64_s, ++ nevents: ::c_int, ++ flags: ::c_uint, ++ timeout: *const ::timespec, ++ ) -> ::c_int; ++ pub fn mount( ++ src: *const ::c_char, ++ target: *const ::c_char, ++ flags: ::c_int, ++ data: *mut ::c_void, ++ ) -> ::c_int; ++ pub fn ptrace( ++ request: ::c_int, ++ pid: ::pid_t, ++ addr: *mut ::c_char, ++ data: ::c_int, ++ ) -> ::c_int; ++ pub fn quotactl( ++ special: *const ::c_char, ++ cmd: ::c_int, ++ id: ::c_int, ++ data: *mut ::c_char, ++ ) -> ::c_int; + pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int; +- pub fn sendfile(fd: ::c_int, +- s: ::c_int, +- offset: ::off_t, +- len: *mut ::off_t, +- hdtr: *mut ::sf_hdtr, +- flags: ::c_int) -> ::c_int; ++ pub fn sendfile( ++ fd: ::c_int, ++ s: ::c_int, ++ offset: ::off_t, ++ len: *mut ::off_t, ++ hdtr: *mut ::sf_hdtr, ++ flags: ::c_int, ++ ) -> ::c_int; + pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; +- pub fn utimensat(dirfd: ::c_int, path: *const ::c_char, +- times: *const ::timespec, flag: ::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 utimensat( ++ dirfd: ::c_int, ++ path: *const ::c_char, ++ times: *const ::timespec, ++ flag: ::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 login_tty(fd: ::c_int) -> ::c_int; + pub fn duplocale(base: ::locale_t) -> ::locale_t; + pub fn freelocale(loc: ::locale_t) -> ::c_int; + pub fn localeconv_l(loc: ::locale_t) -> *mut lconv; +- pub fn newlocale(mask: ::c_int, +- locale: *const ::c_char, +- base: ::locale_t) -> ::locale_t; ++ 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; + 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 getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int; + pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int; +- pub fn getxattr(path: *const ::c_char, name: *const ::c_char, +- value: *mut ::c_void, size: ::size_t, position: u32, +- flags: ::c_int) -> ::ssize_t; +- pub fn fgetxattr(filedes: ::c_int, name: *const ::c_char, +- value: *mut ::c_void, size: ::size_t, position: u32, +- flags: ::c_int) -> ::ssize_t; +- pub fn setxattr(path: *const ::c_char, name: *const ::c_char, +- value: *const ::c_void, size: ::size_t, position: u32, +- flags: ::c_int) -> ::c_int; +- pub fn fsetxattr(filedes: ::c_int, name: *const ::c_char, +- value: *const ::c_void, size: ::size_t, position: u32, +- flags: ::c_int) -> ::c_int; +- pub fn listxattr(path: *const ::c_char, list: *mut ::c_char, +- size: ::size_t, flags: ::c_int) -> ::ssize_t; +- pub fn flistxattr(filedes: ::c_int, list: *mut ::c_char, +- size: ::size_t, flags: ::c_int) -> ::ssize_t; +- pub fn removexattr(path: *const ::c_char, name: *const ::c_char, +- flags: ::c_int) -> ::c_int; +- pub fn renamex_np(from: *const ::c_char, to: *const ::c_char, +- flags: ::c_uint) -> ::c_int; +- pub fn renameatx_np(fromfd: ::c_int, from: *const ::c_char, +- tofd: ::c_int, to: *const ::c_char, +- flags: ::c_uint) -> ::c_int; +- pub fn fremovexattr(filedes: ::c_int, name: *const ::c_char, +- flags: ::c_int) -> ::c_int; +- +- pub fn getgrouplist(name: *const ::c_char, +- basegid: ::c_int, +- groups: *mut ::c_int, +- ngroups: *mut ::c_int) -> ::c_int; ++ pub fn getxattr( ++ path: *const ::c_char, ++ name: *const ::c_char, ++ value: *mut ::c_void, ++ size: ::size_t, ++ position: u32, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ pub fn fgetxattr( ++ filedes: ::c_int, ++ name: *const ::c_char, ++ value: *mut ::c_void, ++ size: ::size_t, ++ position: u32, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ pub fn setxattr( ++ path: *const ::c_char, ++ name: *const ::c_char, ++ value: *const ::c_void, ++ size: ::size_t, ++ position: u32, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn fsetxattr( ++ filedes: ::c_int, ++ name: *const ::c_char, ++ value: *const ::c_void, ++ size: ::size_t, ++ position: u32, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn listxattr( ++ path: *const ::c_char, ++ list: *mut ::c_char, ++ size: ::size_t, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ pub fn flistxattr( ++ filedes: ::c_int, ++ list: *mut ::c_char, ++ size: ::size_t, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ pub fn removexattr( ++ path: *const ::c_char, ++ name: *const ::c_char, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn renamex_np( ++ from: *const ::c_char, ++ to: *const ::c_char, ++ flags: ::c_uint, ++ ) -> ::c_int; ++ pub fn renameatx_np( ++ fromfd: ::c_int, ++ from: *const ::c_char, ++ tofd: ::c_int, ++ to: *const ::c_char, ++ flags: ::c_uint, ++ ) -> ::c_int; ++ pub fn fremovexattr( ++ filedes: ::c_int, ++ name: *const ::c_char, ++ flags: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn getgrouplist( ++ name: *const ::c_char, ++ basegid: ::c_int, ++ groups: *mut ::c_int, ++ ngroups: *mut ::c_int, ++ ) -> ::c_int; + pub fn initgroups(user: *const ::c_char, basegroup: ::c_int) -> ::c_int; + +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "waitid$UNIX2003")] +- pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, +- options: ::c_int) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "waitid$UNIX2003" ++ )] ++ pub fn waitid( ++ idtype: idtype_t, ++ id: id_t, ++ infop: *mut ::siginfo_t, ++ options: ::c_int, ++ ) -> ::c_int; + pub fn brk(addr: *const ::c_void) -> *mut ::c_void; + pub fn sbrk(increment: ::c_int) -> *mut ::c_void; +- pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int; ++ pub fn settimeofday( ++ tv: *const ::timeval, ++ tz: *const ::timezone, ++ ) -> ::c_int; + #[deprecated(since = "0.2.55", note = "Use the mach crate")] + pub fn _dyld_image_count() -> u32; + #[deprecated(since = "0.2.55", note = "Use the mach crate")] +@@ -3284,36 +3607,56 @@ extern { + #[deprecated(since = "0.2.55", note = "Use the mach crate")] + pub fn _dyld_get_image_name(image_index: u32) -> *const ::c_char; + +- pub fn posix_spawn(pid: *mut ::pid_t, +- path: *const ::c_char, +- file_actions: *const ::posix_spawn_file_actions_t, +- attrp: *const ::posix_spawnattr_t, +- argv: *const *mut ::c_char, +- envp: *const *mut ::c_char) -> ::c_int; +- pub fn posix_spawnp(pid: *mut ::pid_t, +- file: *const ::c_char, +- file_actions: *const ::posix_spawn_file_actions_t, +- attrp: *const ::posix_spawnattr_t, +- argv: *const *mut ::c_char, +- envp: *const *mut ::c_char) -> ::c_int; ++ pub fn posix_spawn( ++ pid: *mut ::pid_t, ++ path: *const ::c_char, ++ file_actions: *const ::posix_spawn_file_actions_t, ++ attrp: *const ::posix_spawnattr_t, ++ argv: *const *mut ::c_char, ++ envp: *const *mut ::c_char, ++ ) -> ::c_int; ++ pub fn posix_spawnp( ++ pid: *mut ::pid_t, ++ file: *const ::c_char, ++ file_actions: *const ::posix_spawn_file_actions_t, ++ attrp: *const ::posix_spawnattr_t, ++ argv: *const *mut ::c_char, ++ envp: *const *mut ::c_char, ++ ) -> ::c_int; + pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int; +- pub fn posix_spawnattr_getsigdefault(attr: *const posix_spawnattr_t, +- default: *mut ::sigset_t) -> ::c_int; +- pub fn posix_spawnattr_setsigdefault(attr: *mut posix_spawnattr_t, +- default: *const ::sigset_t) -> ::c_int; +- pub fn posix_spawnattr_getsigmask(attr: *const posix_spawnattr_t, +- default: *mut ::sigset_t) -> ::c_int; +- pub fn posix_spawnattr_setsigmask(attr: *mut posix_spawnattr_t, +- default: *const ::sigset_t) -> ::c_int; +- pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t, +- flags: *mut ::c_short) -> ::c_int; +- pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, +- flags: ::c_short) -> ::c_int; +- pub fn posix_spawnattr_getpgroup(attr: *const posix_spawnattr_t, +- flags: *mut ::pid_t) -> ::c_int; +- pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, +- flags: ::pid_t) -> ::c_int; ++ pub fn posix_spawnattr_getsigdefault( ++ attr: *const posix_spawnattr_t, ++ default: *mut ::sigset_t, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_setsigdefault( ++ attr: *mut posix_spawnattr_t, ++ default: *const ::sigset_t, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_getsigmask( ++ attr: *const posix_spawnattr_t, ++ default: *mut ::sigset_t, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_setsigmask( ++ attr: *mut posix_spawnattr_t, ++ default: *const ::sigset_t, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_getflags( ++ attr: *const posix_spawnattr_t, ++ flags: *mut ::c_short, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_setflags( ++ attr: *mut posix_spawnattr_t, ++ flags: ::c_short, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_getpgroup( ++ attr: *const posix_spawnattr_t, ++ flags: *mut ::pid_t, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_setpgroup( ++ attr: *mut posix_spawnattr_t, ++ flags: ::pid_t, ++ ) -> ::c_int; + + pub fn posix_spawn_file_actions_init( + actions: *mut posix_spawn_file_actions_t, +@@ -3338,6 +3681,25 @@ extern { + newfd: ::c_int, + ) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; ++ ++ pub fn connectx( ++ socket: ::c_int, ++ endpoints: *const sa_endpoints_t, ++ associd: sae_associd_t, ++ flags: ::c_uint, ++ iov: *const ::iovec, ++ iovcnt: ::c_uint, ++ len: *mut ::size_t, ++ connid: *mut sae_connid_t, ++ ) -> ::c_int; ++ pub fn disconnectx( ++ socket: ::c_int, ++ associd: sae_associd_t, ++ connid: sae_connid_t, ++ ) -> ::c_int; ++ ++ pub fn ntp_adjtime(buf: *mut timex) -> ::c_int; ++ pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int; + } + + cfg_if! { +diff --git a/third_party/rust/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs b/third_party/rust/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..e9ad63b86bb2d15eb96e0816de892834e4bd1487 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs +@@ -0,0 +1,12 @@ ++// DragonFlyBSD's __error function is declared with "static inline", so it must ++// be implemented in the libc crate, as a pointer to a static thread_local. ++f! { ++ pub fn __error() -> *mut ::c_int { ++ &mut errno ++ } ++} ++ ++extern "C" { ++ #[thread_local] ++ pub static mut errno: ::c_int; ++} +diff --git a/third_party/rust/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/third_party/rust/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs +index 3088b2dccd6f7672483d995665dc5a6ce872c50d..5841947f334676e6428f60e8679944e942354d67 100644 +--- a/third_party/rust/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs ++++ b/third_party/rust/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs +@@ -1,5 +1,6 @@ + pub type dev_t = u32; + pub type c_char = i8; ++pub type wchar_t = i32; + pub type clock_t = u64; + pub type ino_t = u64; + pub type lwpid_t = i32; +@@ -24,7 +25,9 @@ pub type sem_t = *mut sem; + pub enum sem {} + impl ::Copy for sem {} + impl ::Clone for sem { +- fn clone(&self) -> sem { *self } ++ fn clone(&self) -> sem { ++ *self ++ } + } + + s! { +@@ -451,6 +454,7 @@ pub const ENOMEDIUM: ::c_int = 93; + pub const EASYNC: ::c_int = 99; + pub const ELAST: ::c_int = 99; + pub const RLIMIT_POSIXLOCKS: ::c_int = 11; ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] + pub const RLIM_NLIMITS: ::rlim_t = 12; + + pub const Q_GETQUOTA: ::c_int = 0x300; +@@ -676,7 +680,7 @@ pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit + pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit + pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection + pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast +-// was interface is in polling mode ++ // was interface is in polling mode + pub const IFF_POLLING_COMPAT: ::c_int = 0x10000; + pub const IFF_PPROMISC: ::c_int = 0x20000; // user-requested promisc mode + pub const IFF_MONITOR: ::c_int = 0x40000; // user-requested monitor mode +@@ -910,9 +914,9 @@ pub const IPPROTO_DONE: ::c_int = 257; + pub const IPPROTO_UNKNOWN: ::c_int = 258; + + // sys/netinet/tcp.h +-pub const TCP_SIGNATURE_ENABLE: ::c_int = 16; +-pub const TCP_KEEPINIT: ::c_int = 32; +-pub const TCP_FASTKEEP: ::c_int = 128; ++pub const TCP_SIGNATURE_ENABLE: ::c_int = 16; ++pub const TCP_KEEPINIT: ::c_int = 32; ++pub const TCP_FASTKEEP: ::c_int = 128; + + pub const AF_BLUETOOTH: ::c_int = 33; + pub const AF_MPLS: ::c_int = 34; +@@ -935,6 +939,7 @@ pub const MSG_FBLOCKING: ::c_int = 0x00010000; + pub const MSG_FNONBLOCKING: ::c_int = 0x00020000; + pub const MSG_FMASK: ::c_int = 0xFFFF0000; + ++// utmpx entry types + pub const EMPTY: ::c_short = 0; + pub const RUN_LVL: ::c_short = 1; + pub const BOOT_TIME: ::c_short = 2; +@@ -944,19 +949,26 @@ pub const INIT_PROCESS: ::c_short = 5; + pub const LOGIN_PROCESS: ::c_short = 6; + pub const USER_PROCESS: ::c_short = 7; + pub const DEAD_PROCESS: ::c_short = 8; +- +-pub const LC_COLLATE_MASK: ::c_int = (1 << 0); +-pub const LC_CTYPE_MASK: ::c_int = (1 << 1); +-pub const LC_MONETARY_MASK: ::c_int = (1 << 2); +-pub const LC_NUMERIC_MASK: ::c_int = (1 << 3); +-pub const LC_TIME_MASK: ::c_int = (1 << 4); +-pub const LC_MESSAGES_MASK: ::c_int = (1 << 5); ++pub const ACCOUNTING: ::c_short = 9; ++pub const SIGNATURE: ::c_short = 10; ++pub const DOWNTIME: ::c_short = 11; ++// utmpx database types ++pub const UTX_DB_UTMPX: ::c_uint = 0; ++pub const UTX_DB_WTMPX: ::c_uint = 1; ++pub const UTX_DB_LASTLOG: ::c_uint = 2; ++ ++pub const LC_COLLATE_MASK: ::c_int = 1 << 0; ++pub const LC_CTYPE_MASK: ::c_int = 1 << 1; ++pub const LC_MONETARY_MASK: ::c_int = 1 << 2; ++pub const LC_NUMERIC_MASK: ::c_int = 1 << 3; ++pub const LC_TIME_MASK: ::c_int = 1 << 4; ++pub const LC_MESSAGES_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; ++ | LC_CTYPE_MASK ++ | LC_MESSAGES_MASK ++ | LC_MONETARY_MASK ++ | LC_NUMERIC_MASK ++ | LC_TIME_MASK; + + pub const TIOCSIG: ::c_uint = 0x2000745f; + pub const BTUARTDISC: ::c_int = 0x7; +@@ -967,11 +979,11 @@ pub const TIOCMODS: ::c_ulong = 0x80047404; + pub const TIOCREMOTE: ::c_ulong = 0x80047469; + + // Constants used by "at" family of system calls. +-pub const AT_FDCWD: ::c_int = 0xFFFAFDCD; // invalid file descriptor ++pub const AT_FDCWD: ::c_int = 0xFFFAFDCD; // invalid file descriptor + pub const AT_SYMLINK_NOFOLLOW: ::c_int = 1; +-pub const AT_REMOVEDIR: ::c_int = 2; +-pub const AT_EACCESS: ::c_int = 4; +-pub const AT_SYMLINK_FOLLOW: ::c_int = 8; ++pub const AT_REMOVEDIR: ::c_int = 2; ++pub const AT_EACCESS: ::c_int = 4; ++pub const AT_SYMLINK_FOLLOW: ::c_int = 8; + + pub const VCHECKPT: usize = 19; + +@@ -996,11 +1008,15 @@ pub const RTP_PRIO_THREAD: ::c_ushort = 3; + + // Flags for chflags(2) + pub const UF_NOHISTORY: ::c_ulong = 0x00000040; +-pub const UF_CACHE: ::c_ulong = 0x00000080; +-pub const UF_XLINK: ::c_ulong = 0x00000100; ++pub const UF_CACHE: ::c_ulong = 0x00000080; ++pub const UF_XLINK: ::c_ulong = 0x00000100; + pub const SF_NOHISTORY: ::c_ulong = 0x00400000; +-pub const SF_CACHE: ::c_ulong = 0x00800000; +-pub const SF_XLINK: ::c_ulong = 0x01000000; ++pub const SF_CACHE: ::c_ulong = 0x00800000; ++pub const SF_XLINK: ::c_ulong = 0x01000000; ++ ++// timespec constants ++pub const UTIME_OMIT: c_long = -2; ++pub const UTIME_NOW: c_long = -1; + + fn _CMSG_ALIGN(n: usize) -> usize { + (n + 3) & !3 +@@ -1036,27 +1052,56 @@ f! { + (_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) + + _CMSG_ALIGN(length as usize)) as ::c_uint + } ++ ++ pub fn WIFSIGNALED(status: ::c_int) -> bool { ++ (status & 0o177) != 0o177 && (status & 0o177) != 0 ++ } + } + +-extern { ++extern "C" { + pub fn setgrent(); +- pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) +- -> ::c_int; ++ 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; +- pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; ++ pub fn clock_settime( ++ clk_id: ::clockid_t, ++ tp: *const ::timespec, ++ ) -> ::c_int; + + pub fn setutxdb(_type: ::c_uint, file: *mut ::c_char) -> ::c_int; + +- pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, +- timeout: *mut ::timespec) -> ::c_int; ++ pub fn aio_waitcomplete( ++ iocbp: *mut *mut aiocb, ++ timeout: *mut ::timespec, ++ ) -> ::c_int; + + pub fn freelocale(loc: ::locale_t); + +- pub fn lwp_rtprio(function: ::c_int, pid: ::pid_t, lwpid: lwpid_t, +- rtp: *mut super::rtprio) -> ::c_int; ++ pub fn lwp_rtprio( ++ function: ::c_int, ++ pid: ::pid_t, ++ lwpid: lwpid_t, ++ rtp: *mut super::rtprio, ++ ) -> ::c_int; + + pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; + pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; ++ pub fn memmem( ++ haystack: *const ::c_void, ++ haystacklen: ::size_t, ++ needle: *const ::c_void, ++ needlelen: ::size_t, ++ ) -> *mut ::c_void; ++} ++ ++cfg_if! { ++ if #[cfg(libc_thread_local)] { ++ mod errno; ++ pub use self::errno::*; ++ } + } +diff --git a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs +index 22fd2b84f9d02dd1c8c906433e6d6296b03f9169..db0093a529df16ec1c7164dfbce105b726ab770e 100644 +--- a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs ++++ b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs +@@ -1,34 +1,10 @@ + pub type c_char = u8; + pub type c_long = i64; + pub type c_ulong = u64; ++pub type wchar_t = u32; + pub type time_t = i64; + pub type suseconds_t = i64; +- +-s! { +- 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_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: ::fflags_t, +- pub st_gen: u32, +- pub st_lspare: i32, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- } +-} ++pub type register_t = i64; + + // should be pub(crate), but that requires Rust 1.18.0 + cfg_if! { +@@ -42,3 +18,4 @@ cfg_if! { + } + + pub const MAP_32BIT: ::c_int = 0x00080000; ++pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4 +diff --git a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs +index b7480aa78b956d2e8f882159b081883c52f364ad..300b3dd45ca9d336cb721c22caa70b4255dbe0fa 100644 +--- a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs ++++ b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs +@@ -1,8 +1,10 @@ + pub type c_char = u8; + pub type c_long = i32; + pub type c_ulong = u32; ++pub type wchar_t = u32; + pub type time_t = i64; + pub type suseconds_t = i32; ++pub type register_t = i32; + + s! { + pub struct stat { +@@ -45,3 +47,4 @@ cfg_if! { + } + } + pub const MAP_32BIT: ::c_int = 0x00080000; ++pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4 +diff --git a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/x86_64.rs b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs +similarity index 93% +rename from third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/x86_64.rs +rename to third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs +index bba277e70036eef6d6ced09f8e821aeaf47243ae..f32128f7755747219a16ed8aa38bb6a2efc9e51c 100644 +--- a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/x86_64.rs ++++ b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs +@@ -26,5 +26,7 @@ pub struct stat { + + impl ::Copy for ::stat {} + impl ::Clone for ::stat { +- fn clone(&self) -> ::stat { *self } ++ fn clone(&self) -> ::stat { ++ *self ++ } + } +diff --git a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +index 7d7dc2c1d4902f39e2a23500ececd009e4aa2f08..b443da3118912ea878b7f8a5fbf05ef4a556830b 100644 +--- a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs ++++ b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +@@ -189,26 +189,37 @@ cfg_if! { + } + } + +-extern { ++pub const ELAST: ::c_int = 96; ++ ++extern "C" { + // Return type ::c_int was removed in FreeBSD 12 + pub fn setgrent() -> ::c_int; + + // Type of `addr` argument changed from `const void*` to `void*` + // in FreeBSD 12 +- pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int) +- -> ::c_int; ++ pub fn mprotect( ++ addr: *const ::c_void, ++ len: ::size_t, ++ prot: ::c_int, ++ ) -> ::c_int; + + // Return type ::c_int was removed in FreeBSD 12 + pub fn freelocale(loc: ::locale_t) -> ::c_int; + + // Return type ::c_int changed to ::ssize_t in FreeBSD 12: +- pub fn msgrcv(msqid: ::c_int, msgp: *mut ::c_void, msgsz: ::size_t, +- msgtyp: ::c_long, msgflg: ::c_int) -> ::c_int; ++ pub fn msgrcv( ++ msqid: ::c_int, ++ msgp: *mut ::c_void, ++ msgsz: ::size_t, ++ msgtyp: ::c_long, ++ msgflg: ::c_int, ++ ) -> ::c_int; + } + + cfg_if! { +- if #[cfg(target_arch = "x86_64")] { +- mod x86_64; +- pub use self::x86_64::*; ++ if #[cfg(any(target_arch = "x86_64", ++ target_arch = "aarch64"))] { ++ mod b64; ++ pub use self::b64::*; + } + } +diff --git a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs +similarity index 93% +rename from third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs +rename to third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs +index dbaa4ae2f9e3cc6656eabb87df102f872160d39d..80c6fa16845308f929843e6d493807c49754d27d 100644 +--- a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs ++++ b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs +@@ -28,5 +28,7 @@ pub struct stat { + + impl ::Copy for ::stat {} + impl ::Clone for ::stat { +- fn clone(&self) -> ::stat { *self } ++ fn clone(&self) -> ::stat { ++ *self ++ } + } +diff --git a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +index ab1b8d98357b330fb23d63f811fbcabca38fbed8..982855ee5a34e9f3af156a3d153a11c36019e9de 100644 +--- a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs ++++ b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +@@ -190,18 +190,43 @@ cfg_if! { + } + } + +-extern { ++pub const F_ADD_SEALS: ::c_int = 19; ++pub const F_GET_SEALS: ::c_int = 20; ++pub const F_SEAL_SEAL: ::c_int = 0x0001; ++pub const F_SEAL_SHRINK: ::c_int = 0x0002; ++pub const F_SEAL_GROW: ::c_int = 0x0004; ++pub const F_SEAL_WRITE: ::c_int = 0x0008; ++ ++cfg_if! { ++ if #[cfg(not(freebsd13))] { ++ pub const ELAST: ::c_int = 96; ++ } else { ++ pub const EINTEGRITY: ::c_int = 97; ++ pub const ELAST: ::c_int = 97; ++ } ++} ++ ++extern "C" { + pub fn setgrent(); +- pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) +- -> ::c_int; ++ pub fn mprotect( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ prot: ::c_int, ++ ) -> ::c_int; + pub fn freelocale(loc: ::locale_t); +- pub fn msgrcv(msqid: ::c_int, msgp: *mut ::c_void, msgsz: ::size_t, +- msgtyp: ::c_long, msgflg: ::c_int) -> ::ssize_t; ++ pub fn msgrcv( ++ msqid: ::c_int, ++ msgp: *mut ::c_void, ++ msgsz: ::size_t, ++ msgtyp: ::c_long, ++ msgflg: ::c_int, ++ ) -> ::ssize_t; + } + + cfg_if! { +- if #[cfg(target_arch = "x86_64")] { +- mod x86_64; +- pub use self::x86_64::*; ++ if #[cfg(any(target_arch = "x86_64", ++ target_arch = "aarch64"))] { ++ mod b64; ++ pub use self::b64::*; + } + } +diff --git a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs +index 9f11c202bb4eac1a6283eee61da42d4a11401799..1ca003959cb008972707dee444c87a4d7b2ceba4 100644 +--- a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs ++++ b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs +@@ -107,6 +107,28 @@ s! { + pub msg_hdr: ::msghdr, + pub msg_len: ::ssize_t, + } ++ ++ pub struct sockcred { ++ pub sc_uid: ::uid_t, ++ pub sc_euid: ::uid_t, ++ pub sc_gid: ::gid_t, ++ pub sc_egid: ::gid_t, ++ pub sc_ngroups: ::c_int, ++ pub sc_groups: [::gid_t; 1], ++ } ++ ++ pub struct ptrace_vm_entry { ++ pub pve_entry: ::c_int, ++ pub pve_timestamp: ::c_int, ++ pub pve_start: ::c_ulong, ++ pub pve_end: ::c_ulong, ++ pub pve_offset: ::c_ulong, ++ pub pve_prot: ::c_uint, ++ pub pve_pathlen: ::c_uint, ++ pub pve_fileid: ::c_long, ++ pub pve_fsid: u32, ++ pub pve_path: *mut ::c_char, ++ } + } + + s_no_extra_traits! { +@@ -313,10 +335,17 @@ pub const EXTATTR_NAMESPACE_EMPTY: ::c_int = 0; + pub const EXTATTR_NAMESPACE_USER: ::c_int = 1; + pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2; + +-pub const RAND_MAX: ::c_int = 0x7fff_fffd; +-pub const PTHREAD_STACK_MIN: ::size_t = 2048; ++cfg_if! { ++ if #[cfg(any(freebsd10, freebsd11, freebsd12))] { ++ pub const RAND_MAX: ::c_int = 0x7fff_fffd; ++ } else { ++ pub const RAND_MAX: ::c_int = 0x7fff_ffff; ++ } ++} ++ ++pub const PTHREAD_STACK_MIN: ::size_t = MINSIGSTKSZ; + pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 4; +-pub const SIGSTKSZ: ::size_t = 34816; ++pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + 32768; + pub const SF_NODISKIO: ::c_int = 0x00000001; + pub const SF_MNOWAIT: ::c_int = 0x00000002; + pub const SF_SYNC: ::c_int = 0x00000004; +@@ -333,13 +362,20 @@ pub const ENOTCAPABLE: ::c_int = 93; + pub const ECAPMODE: ::c_int = 94; + pub const ENOTRECOVERABLE: ::c_int = 95; + pub const EOWNERDEAD: ::c_int = 96; +-pub const ELAST: ::c_int = 96; + pub const RLIMIT_NPTS: ::c_int = 11; + pub const RLIMIT_SWAP: ::c_int = 12; + pub const RLIMIT_KQUEUES: ::c_int = 13; + pub const RLIMIT_UMTXP: ::c_int = 14; ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] + pub const RLIM_NLIMITS: ::rlim_t = 15; + ++pub const NI_NOFQDN: ::c_int = 0x00000001; ++pub const NI_NUMERICHOST: ::c_int = 0x00000002; ++pub const NI_NAMEREQD: ::c_int = 0x00000004; ++pub const NI_NUMERICSERV: ::c_int = 0x00000008; ++pub const NI_DGRAM: ::c_int = 0x00000010; ++pub const NI_NUMERICSCOPE: ::c_int = 0x00000020; ++ + pub const Q_GETQUOTA: ::c_int = 0x700; + pub const Q_SETQUOTA: ::c_int = 0x800; + +@@ -426,7 +462,13 @@ pub const CLOCK_SECOND: ::clockid_t = 13; + pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 14; + pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 15; + ++#[doc(hidden)] ++#[deprecated( ++ since = "0.2.72", ++ note = "CTL_UNSPEC is deprecated. Use CTL_SYSCTL instead" ++)] + pub const CTL_UNSPEC: ::c_int = 0; ++pub const CTL_SYSCTL: ::c_int = 0; + pub const CTL_KERN: ::c_int = 1; + pub const CTL_VM: ::c_int = 2; + pub const CTL_VFS: ::c_int = 3; +@@ -436,6 +478,13 @@ 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_SYSCTL_DEBUG: ::c_int = 0; ++pub const CTL_SYSCTL_NAME: ::c_int = 1; ++pub const CTL_SYSCTL_NEXT: ::c_int = 2; ++pub const CTL_SYSCTL_NAME2OID: ::c_int = 3; ++pub const CTL_SYSCTL_OIDFMT: ::c_int = 4; ++pub const CTL_SYSCTL_OIDDESCR: ::c_int = 5; ++pub const CTL_SYSCTL_OIDLABEL: ::c_int = 6; + pub const KERN_OSTYPE: ::c_int = 1; + pub const KERN_OSRELEASE: ::c_int = 2; + pub const KERN_OSREV: ::c_int = 3; +@@ -570,6 +619,8 @@ pub const TIOCSIG: ::c_uint = 0x2004745f; + pub const TIOCM_DCD: ::c_int = 0x40; + pub const H4DISC: ::c_int = 0x7; + ++pub const BIOCSETFNR: ::c_ulong = 0x80104282; ++ + pub const FIONWRITE: ::c_ulong = 0x40046677; + pub const FIONSPACE: ::c_ulong = 0x40046676; + pub const FIOSEEKDATA: ::c_ulong = 0xc0086661; +@@ -653,12 +704,12 @@ pub const IFF_BROADCAST: ::c_int = 0x2; // (i) broadcast address valid + pub const IFF_DEBUG: ::c_int = 0x4; // (n) turn on debugging + pub const IFF_LOOPBACK: ::c_int = 0x8; // (i) is a loopback net + pub const IFF_POINTOPOINT: ::c_int = 0x10; // (i) is a point-to-point link +-// 0x20 was IFF_SMART ++ // 0x20 was IFF_SMART + pub const IFF_RUNNING: ::c_int = 0x40; // (d) resources allocated + #[doc(hidden)] + #[deprecated( +- since="0.2.54", +- note="IFF_DRV_RUNNING is deprecated. Use the portable IFF_RUNNING instead" ++ since = "0.2.54", ++ note = "IFF_DRV_RUNNING is deprecated. Use the portable IFF_RUNNING instead" + )] + pub const IFF_DRV_RUNNING: ::c_int = 0x40; + pub const IFF_NOARP: ::c_int = 0x80; // (n) no address resolution protocol +@@ -668,7 +719,7 @@ pub const IFF_OACTIVE: ::c_int = 0x400; // (d) tx hardware queue is full + #[doc(hidden)] + #[deprecated( + since = "0.2.54", +- note = "Use the portable `IFF_OACTIVE` instead", ++ note = "Use the portable `IFF_OACTIVE` instead" + )] + pub const IFF_DRV_OACTIVE: ::c_int = 0x400; + pub const IFF_SIMPLEX: ::c_int = 0x800; // (i) can't hear own transmissions +@@ -677,7 +728,7 @@ pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit + pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit + pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection + pub const IFF_MULTICAST: ::c_int = 0x8000; // (i) supports multicast +-// (i) unconfigurable using ioctl(2) ++ // (i) unconfigurable using ioctl(2) + pub const IFF_CANTCONFIG: ::c_int = 0x10000; + pub const IFF_PPROMISC: ::c_int = 0x20000; // (n) user-requested promisc mode + pub const IFF_MONITOR: ::c_int = 0x40000; // (n) user-requested monitor mode +@@ -751,8 +802,14 @@ pub const IPPROTO_BLT: ::c_int = 30; + pub const IPPROTO_NSP: ::c_int = 31; + /// Merit Internodal + pub const IPPROTO_INP: ::c_int = 32; +-/// Sequential Exchange ++#[doc(hidden)] ++#[deprecated( ++ since = "0.2.72", ++ note = "IPPROTO_SEP is deprecated. Use IPPROTO_DCCP instead" ++)] + pub const IPPROTO_SEP: ::c_int = 33; ++/// Datagram Congestion Control Protocol ++pub const IPPROTO_DCCP: ::c_int = 33; + /// Third Party Connect + pub const IPPROTO_3PC: ::c_int = 34; + /// InterDomain Policy Routing +@@ -937,8 +994,8 @@ pub const TCP_PCAP_IN: ::c_int = 4096; + pub const IP_BINDANY: ::c_int = 24; + pub const IP_BINDMULTI: ::c_int = 25; + pub const IP_RSS_LISTEN_BUCKET: ::c_int = 26; +-pub const IP_ORIGDSTADDR : ::c_int = 27; +-pub const IP_RECVORIGDSTADDR : ::c_int = IP_ORIGDSTADDR; ++pub const IP_ORIGDSTADDR: ::c_int = 27; ++pub const IP_RECVORIGDSTADDR: ::c_int = IP_ORIGDSTADDR; + + pub const IP_RECVTOS: ::c_int = 68; + +@@ -968,9 +1025,9 @@ 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 IPC_R : ::c_int = 0o400; +-pub const IPC_W : ::c_int = 0o200; +-pub const IPC_M : ::c_int = 0o10000; ++pub const IPC_R: ::c_int = 0o400; ++pub const IPC_W: ::c_int = 0o200; ++pub const IPC_M: ::c_int = 0o10000; + pub const MSG_NOERROR: ::c_int = 0o10000; + pub const SHM_RDONLY: ::c_int = 0o10000; + pub const SHM_RND: ::c_int = 0o20000; +@@ -987,18 +1044,19 @@ pub const SHM_ANON: *mut ::c_char = 1 as *mut ::c_char; + // 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)] +-#[deprecated(since="0.2.54",note="Removed in FreeBSD 11")] ++#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] + pub const CTL_MAXID: ::c_int = 10; + #[doc(hidden)] +-#[deprecated(since="0.2.54",note="Removed in FreeBSD 11")] ++#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] + pub const KERN_MAXID: ::c_int = 38; + #[doc(hidden)] +-#[deprecated(since="0.2.54",note="Removed in FreeBSD 11")] ++#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] + pub const HW_MAXID: ::c_int = 13; + #[doc(hidden)] +-#[deprecated(since="0.2.54",note="Removed in FreeBSD 11")] ++#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] + pub const USER_MAXID: ::c_int = 21; + #[doc(hidden)] ++#[deprecated(since = "0.2.74", note = "Removed in FreeBSD 13")] + pub const CTL_P1003_1B_MAXID: ::c_int = 26; + + pub const MSG_NOTIFICATION: ::c_int = 0x00002000; +@@ -1007,6 +1065,7 @@ pub const MSG_COMPAT: ::c_int = 0x00008000; + pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00040000; + pub const MSG_NOSIGNAL: ::c_int = 0x20000; + ++// utmpx entry types + pub const EMPTY: ::c_short = 0; + pub const BOOT_TIME: ::c_short = 1; + pub const OLD_TIME: ::c_short = 2; +@@ -1016,19 +1075,23 @@ pub const INIT_PROCESS: ::c_short = 5; + pub const LOGIN_PROCESS: ::c_short = 6; + pub const DEAD_PROCESS: ::c_short = 7; + pub const SHUTDOWN_TIME: ::c_short = 8; +- +-pub const LC_COLLATE_MASK: ::c_int = (1 << 0); +-pub const LC_CTYPE_MASK: ::c_int = (1 << 1); +-pub const LC_MONETARY_MASK: ::c_int =(1 << 2); +-pub const LC_NUMERIC_MASK: ::c_int = (1 << 3); +-pub const LC_TIME_MASK: ::c_int = (1 << 4); +-pub const LC_MESSAGES_MASK: ::c_int = (1 << 5); ++// utmp database types ++pub const UTXDB_ACTIVE: ::c_int = 0; ++pub const UTXDB_LASTLOGIN: ::c_int = 1; ++pub const UTXDB_LOG: ::c_int = 2; ++ ++pub const LC_COLLATE_MASK: ::c_int = 1 << 0; ++pub const LC_CTYPE_MASK: ::c_int = 1 << 1; ++pub const LC_MONETARY_MASK: ::c_int = 1 << 2; ++pub const LC_NUMERIC_MASK: ::c_int = 1 << 3; ++pub const LC_TIME_MASK: ::c_int = 1 << 4; ++pub const LC_MESSAGES_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; ++ | LC_CTYPE_MASK ++ | LC_MESSAGES_MASK ++ | LC_MONETARY_MASK ++ | LC_NUMERIC_MASK ++ | LC_TIME_MASK; + + pub const WSTOPPED: ::c_int = 2; // same as WUNTRACED + pub const WCONTINUED: ::c_int = 4; +@@ -1042,6 +1105,9 @@ pub const P_PID: idtype_t = 0; + pub const P_PGID: idtype_t = 2; + pub const P_ALL: idtype_t = 7; + ++pub const UTIME_OMIT: c_long = -2; ++pub const UTIME_NOW: c_long = -1; ++ + pub const B460800: ::speed_t = 460800; + pub const B921600: ::speed_t = 921600; + +@@ -1080,14 +1146,23 @@ pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10; + pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20; + + // Flags for chflags(2) +-pub const UF_SYSTEM: ::c_ulong = 0x00000080; +-pub const UF_SPARSE: ::c_ulong = 0x00000100; +-pub const UF_OFFLINE: ::c_ulong = 0x00000200; +-pub const UF_REPARSE: ::c_ulong = 0x00000400; +-pub const UF_ARCHIVE: ::c_ulong = 0x00000800; +-pub const UF_READONLY: ::c_ulong = 0x00001000; +-pub const UF_HIDDEN: ::c_ulong = 0x00008000; +-pub const SF_SNAPSHOT: ::c_ulong = 0x00200000; ++pub const UF_SYSTEM: ::c_ulong = 0x00000080; ++pub const UF_SPARSE: ::c_ulong = 0x00000100; ++pub const UF_OFFLINE: ::c_ulong = 0x00000200; ++pub const UF_REPARSE: ::c_ulong = 0x00000400; ++pub const UF_ARCHIVE: ::c_ulong = 0x00000800; ++pub const UF_READONLY: ::c_ulong = 0x00001000; ++pub const UF_HIDDEN: ::c_ulong = 0x00008000; ++pub const SF_SNAPSHOT: ::c_ulong = 0x00200000; ++ ++pub const F_OGETLK: ::c_int = 7; ++pub const F_OSETLK: ::c_int = 8; ++pub const F_OSETLKW: ::c_int = 9; ++pub const F_DUP2FD: ::c_int = 10; ++pub const F_SETLK_REMOTE: ::c_int = 14; ++pub const F_READAHEAD: ::c_int = 15; ++pub const F_RDAHEAD: ::c_int = 16; ++pub const F_DUP2FD_CLOEXEC: ::c_int = 18; + + fn _ALIGN(p: usize) -> usize { + (p + _ALIGNBYTES) & !_ALIGNBYTES +@@ -1126,156 +1201,259 @@ f! { + as ::c_uint + } + ++ pub fn SOCKCREDSIZE(ngrps: usize) -> usize { ++ let ngrps = if ngrps > 0 { ++ ngrps - 1 ++ } else { ++ 0 ++ }; ++ ::mem::size_of::() + ::mem::size_of::<::gid_t>() * ngrps ++ } ++ ++ pub fn WIFSIGNALED(status: ::c_int) -> bool { ++ (status & 0o177) != 0o177 && (status & 0o177) != 0 && status != 0x13 ++ } ++ + pub fn uname(buf: *mut ::utsname) -> ::c_int { + __xuname(256, buf as *mut ::c_void) + } + } + +-extern { ++extern "C" { + pub fn __error() -> *mut ::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; +- pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; +- +- pub fn extattr_delete_fd(fd: ::c_int, +- attrnamespace: ::c_int, +- attrname: *const ::c_char) -> ::c_int; +- pub fn extattr_delete_file(path: *const ::c_char, +- attrnamespace: ::c_int, +- attrname: *const ::c_char) -> ::c_int; +- pub fn extattr_delete_link(path: *const ::c_char, +- attrnamespace: ::c_int, +- attrname: *const ::c_char) -> ::c_int; +- pub fn extattr_get_fd(fd: ::c_int, +- attrnamespace: ::c_int, +- attrname: *const ::c_char, +- data: *mut ::c_void, +- nbytes: ::size_t) -> ::ssize_t; +- pub fn extattr_get_file(path: *const ::c_char, +- attrnamespace: ::c_int, +- attrname: *const ::c_char, +- data: *mut ::c_void, +- nbytes: ::size_t) -> ::ssize_t; +- pub fn extattr_get_link(path: *const ::c_char, +- attrnamespace: ::c_int, +- attrname: *const ::c_char, +- data: *mut ::c_void, +- nbytes: ::size_t) -> ::ssize_t; +- pub fn extattr_list_fd(fd: ::c_int, +- attrnamespace: ::c_int, +- data: *mut ::c_void, +- nbytes: ::size_t) -> ::ssize_t; +- pub fn extattr_list_file(path: *const ::c_char, +- attrnamespace: ::c_int, +- data: *mut ::c_void, +- nbytes: ::size_t) -> ::ssize_t; +- pub fn extattr_list_link(path: *const ::c_char, +- attrnamespace: ::c_int, +- data: *mut ::c_void, +- nbytes: ::size_t) -> ::ssize_t; +- pub fn extattr_set_fd(fd: ::c_int, +- attrnamespace: ::c_int, +- attrname: *const ::c_char, +- data: *const ::c_void, +- nbytes: ::size_t) -> ::ssize_t; +- pub fn extattr_set_file(path: *const ::c_char, +- attrnamespace: ::c_int, +- attrname: *const ::c_char, +- data: *const ::c_void, +- nbytes: ::size_t) -> ::ssize_t; +- pub fn extattr_set_link(path: *const ::c_char, +- attrnamespace: ::c_int, +- attrname: *const ::c_char, +- data: *const ::c_void, +- nbytes: ::size_t) -> ::ssize_t; ++ pub fn clock_settime( ++ clk_id: ::clockid_t, ++ tp: *const ::timespec, ++ ) -> ::c_int; ++ ++ pub fn extattr_delete_fd( ++ fd: ::c_int, ++ attrnamespace: ::c_int, ++ attrname: *const ::c_char, ++ ) -> ::c_int; ++ pub fn extattr_delete_file( ++ path: *const ::c_char, ++ attrnamespace: ::c_int, ++ attrname: *const ::c_char, ++ ) -> ::c_int; ++ pub fn extattr_delete_link( ++ path: *const ::c_char, ++ attrnamespace: ::c_int, ++ attrname: *const ::c_char, ++ ) -> ::c_int; ++ pub fn extattr_get_fd( ++ fd: ::c_int, ++ attrnamespace: ::c_int, ++ attrname: *const ::c_char, ++ data: *mut ::c_void, ++ nbytes: ::size_t, ++ ) -> ::ssize_t; ++ pub fn extattr_get_file( ++ path: *const ::c_char, ++ attrnamespace: ::c_int, ++ attrname: *const ::c_char, ++ data: *mut ::c_void, ++ nbytes: ::size_t, ++ ) -> ::ssize_t; ++ pub fn extattr_get_link( ++ path: *const ::c_char, ++ attrnamespace: ::c_int, ++ attrname: *const ::c_char, ++ data: *mut ::c_void, ++ nbytes: ::size_t, ++ ) -> ::ssize_t; ++ pub fn extattr_list_fd( ++ fd: ::c_int, ++ attrnamespace: ::c_int, ++ data: *mut ::c_void, ++ nbytes: ::size_t, ++ ) -> ::ssize_t; ++ pub fn extattr_list_file( ++ path: *const ::c_char, ++ attrnamespace: ::c_int, ++ data: *mut ::c_void, ++ nbytes: ::size_t, ++ ) -> ::ssize_t; ++ pub fn extattr_list_link( ++ path: *const ::c_char, ++ attrnamespace: ::c_int, ++ data: *mut ::c_void, ++ nbytes: ::size_t, ++ ) -> ::ssize_t; ++ pub fn extattr_set_fd( ++ fd: ::c_int, ++ attrnamespace: ::c_int, ++ attrname: *const ::c_char, ++ data: *const ::c_void, ++ nbytes: ::size_t, ++ ) -> ::ssize_t; ++ pub fn extattr_set_file( ++ path: *const ::c_char, ++ attrnamespace: ::c_int, ++ attrname: *const ::c_char, ++ data: *const ::c_void, ++ nbytes: ::size_t, ++ ) -> ::ssize_t; ++ pub fn extattr_set_link( ++ path: *const ::c_char, ++ attrnamespace: ::c_int, ++ attrname: *const ::c_char, ++ data: *const ::c_void, ++ nbytes: ::size_t, ++ ) -> ::ssize_t; + + pub fn jail(jail: *mut ::jail) -> ::c_int; + pub fn jail_attach(jid: ::c_int) -> ::c_int; + pub fn jail_remove(jid: ::c_int) -> ::c_int; +- pub fn jail_get(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) +- -> ::c_int; +- pub fn jail_set(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) +- -> ::c_int; ++ pub fn jail_get( ++ iov: *mut ::iovec, ++ niov: ::c_uint, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn jail_set( ++ iov: *mut ::iovec, ++ niov: ::c_uint, ++ flags: ::c_int, ++ ) -> ::c_int; + + pub fn fdatasync(fd: ::c_int) -> ::c_int; +- pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, +- len: ::off_t) -> ::c_int; +- pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, +- advise: ::c_int) -> ::c_int; ++ pub fn posix_fallocate( ++ fd: ::c_int, ++ offset: ::off_t, ++ len: ::off_t, ++ ) -> ::c_int; ++ pub fn posix_fadvise( ++ fd: ::c_int, ++ offset: ::off_t, ++ len: ::off_t, ++ advise: ::c_int, ++ ) -> ::c_int; + 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 mkostemps( ++ template: *mut ::c_char, ++ suffixlen: ::c_int, ++ flags: ::c_int, ++ ) -> ::c_int; + + pub fn getutxuser(user: *const ::c_char) -> *mut utmpx; + pub fn setutxdb(_type: ::c_int, file: *const ::c_char) -> ::c_int; + +- pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, +- timeout: *mut ::timespec) -> ::ssize_t; ++ pub fn aio_waitcomplete( ++ iocbp: *mut *mut aiocb, ++ timeout: *mut ::timespec, ++ ) -> ::ssize_t; + pub fn mq_getfd_np(mqd: ::mqd_t) -> ::c_int; + +- pub fn waitid(idtype: idtype_t, id: ::id_t, infop: *mut ::siginfo_t, +- options: ::c_int) -> ::c_int; ++ pub fn waitid( ++ idtype: idtype_t, ++ id: ::id_t, ++ infop: *mut ::siginfo_t, ++ options: ::c_int, ++ ) -> ::c_int; + + pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t; + 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 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 msgctl(msqid: ::c_int, cmd: ::c_int, +- buf: *mut ::msqid_ds) -> ::c_int; ++ pub fn shmctl( ++ shmid: ::c_int, ++ cmd: ::c_int, ++ buf: *mut ::shmid_ds, ++ ) -> ::c_int; ++ 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 msgsnd(msqid: ::c_int, msgp: *const ::c_void, msgsz: ::size_t, +- msgflg: ::c_int) -> ::c_int; ++ pub fn msgsnd( ++ msqid: ::c_int, ++ msgp: *const ::c_void, ++ msgsz: ::size_t, ++ msgflg: ::c_int, ++ ) -> ::c_int; + pub fn cfmakesane(termios: *mut ::termios); +- pub fn fexecve(fd: ::c_int, argv: *const *const ::c_char, +- envp: *const *const ::c_char) +- -> ::c_int; ++ pub fn fexecve( ++ fd: ::c_int, ++ argv: *const *const ::c_char, ++ envp: *const *const ::c_char, ++ ) -> ::c_int; + + pub fn pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t; + pub fn pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int; + pub fn pdkill(fd: ::c_int, signum: ::c_int) -> ::c_int; + +- pub fn rtprio_thread(function: ::c_int, lwpid: ::lwpid_t, +- rtp: *mut super::rtprio) -> ::c_int; +- +- pub fn posix_spawn(pid: *mut ::pid_t, +- path: *const ::c_char, +- file_actions: *const ::posix_spawn_file_actions_t, +- attrp: *const ::posix_spawnattr_t, +- argv: *const *mut ::c_char, +- envp: *const *mut ::c_char) -> ::c_int; +- pub fn posix_spawnp(pid: *mut ::pid_t, +- file: *const ::c_char, +- file_actions: *const ::posix_spawn_file_actions_t, +- attrp: *const ::posix_spawnattr_t, +- argv: *const *mut ::c_char, +- envp: *const *mut ::c_char) -> ::c_int; ++ pub fn rtprio_thread( ++ function: ::c_int, ++ lwpid: ::lwpid_t, ++ rtp: *mut super::rtprio, ++ ) -> ::c_int; ++ ++ pub fn posix_spawn( ++ pid: *mut ::pid_t, ++ path: *const ::c_char, ++ file_actions: *const ::posix_spawn_file_actions_t, ++ attrp: *const ::posix_spawnattr_t, ++ argv: *const *mut ::c_char, ++ envp: *const *mut ::c_char, ++ ) -> ::c_int; ++ pub fn posix_spawnp( ++ pid: *mut ::pid_t, ++ file: *const ::c_char, ++ file_actions: *const ::posix_spawn_file_actions_t, ++ attrp: *const ::posix_spawnattr_t, ++ argv: *const *mut ::c_char, ++ envp: *const *mut ::c_char, ++ ) -> ::c_int; + pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int; +- pub fn posix_spawnattr_getsigdefault(attr: *const posix_spawnattr_t, +- default: *mut ::sigset_t) -> ::c_int; +- pub fn posix_spawnattr_setsigdefault(attr: *mut posix_spawnattr_t, +- default: *const ::sigset_t) -> ::c_int; +- pub fn posix_spawnattr_getsigmask(attr: *const posix_spawnattr_t, +- default: *mut ::sigset_t) -> ::c_int; +- pub fn posix_spawnattr_setsigmask(attr: *mut posix_spawnattr_t, +- default: *const ::sigset_t) -> ::c_int; +- pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t, +- flags: *mut ::c_short) -> ::c_int; +- pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, +- flags: ::c_short) -> ::c_int; +- pub fn posix_spawnattr_getpgroup(attr: *const posix_spawnattr_t, +- flags: *mut ::pid_t) -> ::c_int; +- pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, +- flags: ::pid_t) -> ::c_int; +- pub fn posix_spawnattr_getschedpolicy(attr: *const posix_spawnattr_t, +- flags: *mut ::c_int) -> ::c_int; +- pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, +- flags: ::c_int) -> ::c_int; ++ pub fn posix_spawnattr_getsigdefault( ++ attr: *const posix_spawnattr_t, ++ default: *mut ::sigset_t, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_setsigdefault( ++ attr: *mut posix_spawnattr_t, ++ default: *const ::sigset_t, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_getsigmask( ++ attr: *const posix_spawnattr_t, ++ default: *mut ::sigset_t, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_setsigmask( ++ attr: *mut posix_spawnattr_t, ++ default: *const ::sigset_t, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_getflags( ++ attr: *const posix_spawnattr_t, ++ flags: *mut ::c_short, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_setflags( ++ attr: *mut posix_spawnattr_t, ++ flags: ::c_short, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_getpgroup( ++ attr: *const posix_spawnattr_t, ++ flags: *mut ::pid_t, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_setpgroup( ++ attr: *mut posix_spawnattr_t, ++ flags: ::pid_t, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_getschedpolicy( ++ attr: *const posix_spawnattr_t, ++ flags: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_setschedpolicy( ++ attr: *mut posix_spawnattr_t, ++ flags: ::c_int, ++ ) -> ::c_int; + pub fn posix_spawnattr_getschedparam( + attr: *const posix_spawnattr_t, + param: *mut ::sched_param, +@@ -1308,33 +1486,65 @@ extern { + newfd: ::c_int, + ) -> ::c_int; + ++ #[cfg_attr( ++ all(target_os = "freebsd", freebsd11), ++ link_name = "statfs@FBSD_1.0" ++ )] + pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "freebsd", freebsd11), ++ link_name = "fstatfs@FBSD_1.0" ++ )] + pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; + + pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int; + pub fn __xuname(nmln: ::c_int, buf: *mut ::c_void) -> ::c_int; + +- pub fn sendmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::size_t, +- flags: ::c_int) -> ::ssize_t; +- pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::size_t, +- flags: ::c_int, timeout: *const ::timespec) -> ::ssize_t; ++ pub fn sendmmsg( ++ sockfd: ::c_int, ++ msgvec: *mut ::mmsghdr, ++ vlen: ::size_t, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ pub fn recvmmsg( ++ sockfd: ::c_int, ++ msgvec: *mut ::mmsghdr, ++ vlen: ::size_t, ++ flags: ::c_int, ++ timeout: *const ::timespec, ++ ) -> ::ssize_t; ++ pub fn memmem( ++ haystack: *const ::c_void, ++ haystacklen: ::size_t, ++ needle: *const ::c_void, ++ needlelen: ::size_t, ++ ) -> *mut ::c_void; + } + + #[link(name = "util")] +-extern { +- pub fn extattr_namespace_to_string(attrnamespace: ::c_int, +- string: *mut *mut ::c_char) -> ::c_int; +- pub fn extattr_string_to_namespace(string: *const ::c_char, +- attrnamespace: *mut ::c_int) -> ::c_int; ++extern "C" { ++ pub fn extattr_namespace_to_string( ++ attrnamespace: ::c_int, ++ string: *mut *mut ::c_char, ++ ) -> ::c_int; ++ pub fn extattr_string_to_namespace( ++ string: *const ::c_char, ++ attrnamespace: *mut ::c_int, ++ ) -> ::c_int; + } + + cfg_if! { + if #[cfg(freebsd12)] { + mod freebsd12; + pub use self::freebsd12::*; +- } else { ++ } else if #[cfg(freebsd13)] { ++ mod freebsd12; ++ pub use self::freebsd12::*; ++ } else if #[cfg(any(freebsd10, freebsd11))] { + mod freebsd11; + pub use self::freebsd11::*; ++ } else { ++ // Unknown freebsd version + } + } + +diff --git a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs +index 5c0c6e7f32631ef6ab6d4f94844a64f0ef391c34..7f5b9752264e3dc2fbac63ecffece8c72b2843a2 100644 +--- a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs ++++ b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs +@@ -1,8 +1,10 @@ + pub type c_char = u8; + pub type c_long = i64; + pub type c_ulong = u64; ++pub type wchar_t = i32; + pub type time_t = i64; + pub type suseconds_t = i64; ++pub type register_t = i64; + + s! { + pub struct stat { +@@ -42,3 +44,4 @@ cfg_if! { + } + + pub const MAP_32BIT: ::c_int = 0x00080000; ++pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4 +diff --git a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs +index adec88cb54639e3ec34a56293a57944f92f95529..d3a3f34b0f61f7c3fb68b6fa49ce965c53d00911 100644 +--- a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs ++++ b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs +@@ -1,8 +1,10 @@ + pub type c_char = i8; + pub type c_long = i32; + pub type c_ulong = u32; ++pub type wchar_t = i32; + pub type time_t = i32; + pub type suseconds_t = i32; ++pub type register_t = i32; + + s! { + pub struct stat { +@@ -38,6 +40,7 @@ cfg_if! { + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; + } else { + #[doc(hidden)] +- pub const _ALIGNBYTES: usize = 8 - 1; ++ pub const _ALIGNBYTES: usize = 4 - 1; + } + } ++pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4 +diff --git a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/x86_64.rs b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/x86_64.rs +deleted file mode 100644 +index 5220cde915b780246647a9d9163b286574d49cc1..0000000000000000000000000000000000000000 +--- a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/x86_64.rs ++++ /dev/null +@@ -1,17 +0,0 @@ +-pub type c_char = i8; +-pub type c_long = i64; +-pub type c_ulong = u64; +-pub type time_t = i64; +-pub type suseconds_t = i64; +- +-// should be pub(crate), but that requires Rust 1.18.0 +-cfg_if! { +- if #[cfg(libc_const_size_of)] { +- #[doc(hidden)] +- pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; +- } else { +- #[doc(hidden)] +- pub const _ALIGNBYTES: usize = 8 - 1; +- } +-} +-pub const MAP_32BIT: ::c_int = 0x00080000; +diff --git a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..3a016a05198521da7f402896f0e86de678e04036 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs +@@ -0,0 +1,197 @@ ++use {c_long, register_t}; ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 4] ++ } ++ ++ #[repr(align(16))] ++ pub struct mcontext_t { ++ pub mc_onstack: register_t, ++ pub mc_rdi: register_t, ++ pub mc_rsi: register_t, ++ pub mc_rdx: register_t, ++ pub mc_rcx: register_t, ++ pub mc_r8: register_t, ++ pub mc_r9: register_t, ++ pub mc_rax: register_t, ++ pub mc_rbx: register_t, ++ pub mc_rbp: register_t, ++ pub mc_r10: register_t, ++ pub mc_r11: register_t, ++ pub mc_r12: register_t, ++ pub mc_r13: register_t, ++ pub mc_r14: register_t, ++ pub mc_r15: register_t, ++ pub mc_trapno: u32, ++ pub mc_fs: u16, ++ pub mc_gs: u16, ++ pub mc_addr: register_t, ++ pub mc_flags: u32, ++ pub mc_es: u16, ++ pub mc_ds: u16, ++ pub mc_err: register_t, ++ pub mc_rip: register_t, ++ pub mc_cs: register_t, ++ pub mc_rflags: register_t, ++ pub mc_rsp: register_t, ++ pub mc_ss: register_t, ++ pub mc_len: c_long, ++ pub mc_fpformat: c_long, ++ pub mc_ownedfp: c_long, ++ pub mc_fpstate: [c_long; 64], ++ pub mc_fsbase: register_t, ++ pub mc_gsbase: register_t, ++ pub mc_xfpustate: register_t, ++ pub mc_xfpustate_len: register_t, ++ pub mc_spare: [c_long; 4], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for mcontext_t { ++ fn eq(&self, other: &mcontext_t) -> bool { ++ self.mc_onstack == other.mc_onstack && ++ self.mc_rdi == other.mc_rdi && ++ self.mc_rsi == other.mc_rsi && ++ self.mc_rdx == other.mc_rdx && ++ self.mc_rcx == other.mc_rcx && ++ self.mc_r8 == other.mc_r8 && ++ self.mc_r9 == other.mc_r9 && ++ self.mc_rax == other.mc_rax && ++ self.mc_rbx == other.mc_rbx && ++ self.mc_rbp == other.mc_rbp && ++ self.mc_r10 == other.mc_r10 && ++ self.mc_r11 == other.mc_r11 && ++ self.mc_r12 == other.mc_r12 && ++ self.mc_r13 == other.mc_r13 && ++ self.mc_r14 == other.mc_r14 && ++ self.mc_r15 == other.mc_r15 && ++ self.mc_trapno == other.mc_trapno && ++ self.mc_fs == other.mc_fs && ++ self.mc_gs == other.mc_gs && ++ self.mc_addr == other.mc_addr && ++ self.mc_flags == other.mc_flags && ++ self.mc_es == other.mc_es && ++ self.mc_ds == other.mc_ds && ++ self.mc_err == other.mc_err && ++ self.mc_rip == other.mc_rip && ++ self.mc_cs == other.mc_cs && ++ self.mc_rflags == other.mc_rflags && ++ self.mc_rsp == other.mc_rsp && ++ self.mc_ss == other.mc_ss && ++ self.mc_len == other.mc_len && ++ self.mc_fpformat == other.mc_fpformat && ++ self.mc_ownedfp == other.mc_ownedfp && ++ self.mc_fpstate.iter().zip(other.mc_fpstate.iter()) ++ .all(|(a, b)| a == b) && ++ self.mc_fsbase == other.mc_fsbase && ++ self.mc_gsbase == other.mc_gsbase && ++ self.mc_xfpustate == other.mc_xfpustate && ++ self.mc_xfpustate_len == other.mc_xfpustate_len && ++ self.mc_spare == other.mc_spare ++ } ++ } ++ impl Eq for mcontext_t {} ++ impl ::fmt::Debug for mcontext_t { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("mcontext_t") ++ .field("mc_onstack", &self.mc_onstack) ++ .field("mc_rdi", &self.mc_rdi) ++ .field("mc_rsi", &self.mc_rsi) ++ .field("mc_rdx", &self.mc_rdx) ++ .field("mc_rcx", &self.mc_rcx) ++ .field("mc_r8", &self.mc_r8) ++ .field("mc_r9", &self.mc_r9) ++ .field("mc_rax", &self.mc_rax) ++ .field("mc_rbx", &self.mc_rbx) ++ .field("mc_rbp", &self.mc_rbp) ++ .field("mc_r10", &self.mc_r10) ++ .field("mc_r11", &self.mc_r11) ++ .field("mc_r12", &self.mc_r12) ++ .field("mc_r13", &self.mc_r13) ++ .field("mc_r14", &self.mc_r14) ++ .field("mc_r15", &self.mc_r15) ++ .field("mc_trapno", &self.mc_trapno) ++ .field("mc_fs", &self.mc_fs) ++ .field("mc_gs", &self.mc_gs) ++ .field("mc_addr", &self.mc_addr) ++ .field("mc_flags", &self.mc_flags) ++ .field("mc_es", &self.mc_es) ++ .field("mc_ds", &self.mc_ds) ++ .field("mc_err", &self.mc_err) ++ .field("mc_rip", &self.mc_rip) ++ .field("mc_cs", &self.mc_cs) ++ .field("mc_rflags", &self.mc_rflags) ++ .field("mc_rsp", &self.mc_rsp) ++ .field("mc_ss", &self.mc_ss) ++ .field("mc_len", &self.mc_len) ++ .field("mc_fpformat", &self.mc_fpformat) ++ .field("mc_ownedfp", &self.mc_ownedfp) ++ // FIXME: .field("mc_fpstate", &self.mc_fpstate) ++ .field("mc_fsbase", &self.mc_fsbase) ++ .field("mc_gsbase", &self.mc_gsbase) ++ .field("mc_xfpustate", &self.mc_xfpustate) ++ .field("mc_xfpustate_len", &self.mc_xfpustate_len) ++ .field("mc_spare", &self.mc_spare) ++ .finish() ++ } ++ } ++ impl ::hash::Hash for mcontext_t { ++ fn hash(&self, state: &mut H) { ++ self.mc_onstack.hash(state); ++ self.mc_rdi.hash(state); ++ self.mc_rsi.hash(state); ++ self.mc_rdx.hash(state); ++ self.mc_rcx.hash(state); ++ self.mc_r8.hash(state); ++ self.mc_r9.hash(state); ++ self.mc_rax.hash(state); ++ self.mc_rbx.hash(state); ++ self.mc_rbp.hash(state); ++ self.mc_r10.hash(state); ++ self.mc_r11.hash(state); ++ self.mc_r12.hash(state); ++ self.mc_r13.hash(state); ++ self.mc_r14.hash(state); ++ self.mc_r15.hash(state); ++ self.mc_trapno.hash(state); ++ self.mc_fs.hash(state); ++ self.mc_gs.hash(state); ++ self.mc_addr.hash(state); ++ self.mc_flags.hash(state); ++ self.mc_es.hash(state); ++ self.mc_ds.hash(state); ++ self.mc_err.hash(state); ++ self.mc_rip.hash(state); ++ self.mc_cs.hash(state); ++ self.mc_rflags.hash(state); ++ self.mc_rsp.hash(state); ++ self.mc_ss.hash(state); ++ self.mc_len.hash(state); ++ self.mc_fpformat.hash(state); ++ self.mc_ownedfp.hash(state); ++ self.mc_fpstate.hash(state); ++ self.mc_fsbase.hash(state); ++ self.mc_gsbase.hash(state); ++ self.mc_xfpustate.hash(state); ++ self.mc_xfpustate_len.hash(state); ++ self.mc_spare.hash(state); ++ } ++ } ++ } ++} ++ ++s! { ++ pub struct ucontext_t { ++ pub uc_sigmask: ::sigset_t, ++ pub uc_mcontext: ::mcontext_t, ++ pub uc_link: *mut ::ucontext_t, ++ pub uc_stack: ::stack_t, ++ pub uc_flags: ::c_int, ++ __spare__: [::c_int; 4], ++ } ++} +diff --git a/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..d3333c8b11aea1d6fd6e65a3497985316e0b2c69 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs +@@ -0,0 +1,208 @@ ++pub type c_char = i8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type wchar_t = i32; ++pub type time_t = i64; ++pub type suseconds_t = i64; ++pub type register_t = i64; ++ ++s! { ++ pub struct reg32 { ++ pub r_fs: u32, ++ pub r_es: u32, ++ pub r_ds: u32, ++ pub r_edi: u32, ++ pub r_esi: u32, ++ pub r_ebp: u32, ++ pub r_isp: u32, ++ pub r_ebx: u32, ++ pub r_edx: u32, ++ pub r_ecx: u32, ++ pub r_eax: u32, ++ pub r_trapno: u32, ++ pub r_err: u32, ++ pub r_eip: u32, ++ pub r_cs: u32, ++ pub r_eflags: u32, ++ pub r_esp: u32, ++ pub r_ss: u32, ++ pub r_gs: u32, ++ } ++ ++ pub struct reg { ++ pub r_r15: i64, ++ pub r_r14: i64, ++ pub r_r13: i64, ++ pub r_r12: i64, ++ pub r_r11: i64, ++ pub r_r10: i64, ++ pub r_r9: i64, ++ pub r_r8: i64, ++ pub r_rdi: i64, ++ pub r_rsi: i64, ++ pub r_rbp: i64, ++ pub r_rbx: i64, ++ pub r_rdx: i64, ++ pub r_rcx: i64, ++ pub r_rax: i64, ++ pub r_trapno: u32, ++ pub r_fs: u16, ++ pub r_gs: u16, ++ pub r_err: u32, ++ pub r_es: u16, ++ pub r_ds: u16, ++ pub r_rip: i64, ++ pub r_cs: i64, ++ pub r_rflags: i64, ++ pub r_rsp: i64, ++ pub r_ss: i64, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct fpreg32 { ++ pub fpr_env: [u32; 7], ++ pub fpr_acc: [[u8; 10]; 8], ++ pub fpr_ex_sw: u32, ++ pub fpr_pad: [u8; 64], ++ } ++ ++ pub struct fpreg { ++ pub fpr_env: [u64; 4], ++ pub fpr_acc: [[u8; 16]; 8], ++ pub fpr_xacc: [[u8; 16]; 16], ++ pub fpr_spare: [u64; 12], ++ } ++ ++ pub struct xmmreg { ++ pub xmm_env: [u32; 8], ++ pub xmm_acc: [[u8; 16]; 8], ++ pub xmm_reg: [[u8; 16]; 8], ++ pub xmm_pad: [u8; 224], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for fpreg32 { ++ fn eq(&self, other: &fpreg32) -> bool { ++ self.fpr_env == other.fpr_env && ++ self.fpr_acc == other.fpr_acc && ++ self.fpr_ex_sw == other.fpr_ex_sw && ++ self.fpr_pad ++ .iter() ++ .zip(other.fpr_pad.iter()) ++ .all(|(a,b)| a == b) ++ } ++ } ++ impl Eq for fpreg32 {} ++ impl ::fmt::Debug for fpreg32 { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("fpreg32") ++ .field("fpr_env", &&self.fpr_env[..]) ++ .field("fpr_acc", &self.fpr_acc) ++ .field("fpr_ex_sw", &self.fpr_ex_sw) ++ .field("fpr_pad", &&self.fpr_pad[..]) ++ .finish() ++ } ++ } ++ impl ::hash::Hash for fpreg32 { ++ fn hash(&self, state: &mut H) { ++ self.fpr_env.hash(state); ++ self.fpr_acc.hash(state); ++ self.fpr_ex_sw.hash(state); ++ self.fpr_pad.hash(state); ++ } ++ } ++ ++ impl PartialEq for fpreg { ++ fn eq(&self, other: &fpreg) -> bool { ++ self.fpr_env == other.fpr_env && ++ self.fpr_acc == other.fpr_acc && ++ self.fpr_xacc == other.fpr_xacc && ++ self.fpr_spare == other.fpr_spare ++ } ++ } ++ impl Eq for fpreg {} ++ impl ::fmt::Debug for fpreg { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("fpreg") ++ .field("fpr_env", &self.fpr_env) ++ .field("fpr_acc", &self.fpr_acc) ++ .field("fpr_xacc", &self.fpr_xacc) ++ .field("fpr_spare", &self.fpr_spare) ++ .finish() ++ } ++ } ++ impl ::hash::Hash for fpreg { ++ fn hash(&self, state: &mut H) { ++ self.fpr_env.hash(state); ++ self.fpr_acc.hash(state); ++ self.fpr_xacc.hash(state); ++ self.fpr_spare.hash(state); ++ } ++ } ++ ++ impl PartialEq for xmmreg { ++ fn eq(&self, other: &xmmreg) -> bool { ++ self.xmm_env == other.xmm_env && ++ self.xmm_acc == other.xmm_acc && ++ self.xmm_reg == other.xmm_reg && ++ self.xmm_pad ++ .iter() ++ .zip(other.xmm_pad.iter()) ++ .all(|(a,b)| a == b) ++ } ++ } ++ impl Eq for xmmreg {} ++ impl ::fmt::Debug for xmmreg { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("xmmreg") ++ .field("xmm_env", &self.xmm_env) ++ .field("xmm_acc", &self.xmm_acc) ++ .field("xmm_reg", &self.xmm_reg) ++ .field("xmm_pad", &&self.xmm_pad[..]) ++ .finish() ++ } ++ } ++ impl ::hash::Hash for xmmreg { ++ fn hash(&self, state: &mut H) { ++ self.xmm_env.hash(state); ++ self.xmm_acc.hash(state); ++ self.xmm_reg.hash(state); ++ self.xmm_pad.hash(state); ++ } ++ } ++ } ++} ++ ++// should be pub(crate), but that requires Rust 1.18.0 ++cfg_if! { ++ if #[cfg(libc_const_size_of)] { ++ #[doc(hidden)] ++ pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; ++ } else { ++ #[doc(hidden)] ++ pub const _ALIGNBYTES: usize = 8 - 1; ++ } ++} ++pub const MAP_32BIT: ::c_int = 0x00080000; ++pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4 ++ ++pub const _MC_HASSEGS: u32 = 0x1; ++pub const _MC_HASBASES: u32 = 0x2; ++pub const _MC_HASFPXSTATE: u32 = 0x4; ++pub const _MC_FLAG_MASK: u32 = _MC_HASSEGS | _MC_HASBASES | _MC_HASFPXSTATE; ++ ++pub const _MC_FPFMT_NODEV: c_long = 0x10000; ++pub const _MC_FPFMT_XMM: c_long = 0x10002; ++pub const _MC_FPOWNED_NONE: c_long = 0x20000; ++pub const _MC_FPOWNED_FPU: c_long = 0x20001; ++pub const _MC_FPOWNED_PCB: c_long = 0x20002; ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } ++} +diff --git a/third_party/rust/libc/src/unix/bsd/freebsdlike/mod.rs b/third_party/rust/libc/src/unix/bsd/freebsdlike/mod.rs +index 48c790f983565884be379fb68e89c63c97bdbbdc..b75c1a8e8edbaf610c841ea20c61235ea567e3cc 100644 +--- a/third_party/rust/libc/src/unix/bsd/freebsdlike/mod.rs ++++ b/third_party/rust/libc/src/unix/bsd/freebsdlike/mod.rs +@@ -18,7 +18,19 @@ pub type vm_size_t = ::uintptr_t; + pub enum timezone {} + impl ::Copy for timezone {} + impl ::Clone for timezone { +- fn clone(&self) -> timezone { *self } ++ fn clone(&self) -> timezone { ++ *self ++ } ++} ++ ++impl siginfo_t { ++ pub unsafe fn si_addr(&self) -> *mut ::c_void { ++ self.si_addr ++ } ++ ++ pub unsafe fn si_value(&self) -> ::sigval { ++ self.si_value ++ } + } + + s! { +@@ -68,7 +80,9 @@ s! { + pub si_uid: ::uid_t, + pub si_status: ::c_int, + pub si_addr: *mut ::c_void, +- _pad: [::c_int; 12], ++ pub si_value: ::sigval, ++ _pad1: ::c_long, ++ _pad2: [::c_int; 7], + } + + pub struct sigaction { +@@ -176,6 +190,41 @@ s! { + pub ar_pln: u8, + pub ar_op: u16, + } ++ ++ pub struct timex { ++ pub modes: ::c_uint, ++ pub offset: ::c_long, ++ pub freq: ::c_long, ++ pub maxerror: ::c_long, ++ pub esterror: ::c_long, ++ pub status: ::c_int, ++ pub constant: ::c_long, ++ pub precision: ::c_long, ++ pub tolerance: ::c_long, ++ pub ppsfreq: ::c_long, ++ pub jitter: ::c_long, ++ pub shift: ::c_int, ++ pub stabil: ::c_long, ++ pub jitcnt: ::c_long, ++ pub calcnt: ::c_long, ++ pub errcnt: ::c_long, ++ pub stbcnt: ::c_long, ++ } ++ ++ pub struct ntptimeval { ++ pub time: ::timespec, ++ pub maxerror: ::c_long, ++ pub esterror: ::c_long, ++ pub tai: ::c_long, ++ pub time_state: ::c_int, ++ } ++ ++ pub struct ptrace_io_desc { ++ pub piod_op: ::c_int, ++ pub piod_offs: *mut ::c_void, ++ pub piod_addr: *mut ::c_void, ++ pub piod_len: ::size_t, ++ } + } + + s_no_extra_traits! { +@@ -227,6 +276,10 @@ cfg_if! { + } + } + ++#[deprecated( ++ since = "0.2.64", ++ note = "Can vary at runtime. Use sysconf(3) instead" ++)] + pub const AIO_LISTIO_MAX: ::c_int = 16; + pub const AIO_CANCELED: ::c_int = 1; + pub const AIO_NOTCANCELED: ::c_int = 2; +@@ -508,9 +561,15 @@ pub const EMULTIHOP: ::c_int = 90; + pub const ENOLINK: ::c_int = 91; + pub const EPROTO: ::c_int = 92; + +-pub const POLLSTANDARD: ::c_short = ::POLLIN | ::POLLPRI | ::POLLOUT | +- ::POLLRDNORM | ::POLLRDBAND | ::POLLWRBAND | ::POLLERR | +- ::POLLHUP | ::POLLNVAL; ++pub const POLLSTANDARD: ::c_short = ::POLLIN ++ | ::POLLPRI ++ | ::POLLOUT ++ | ::POLLRDNORM ++ | ::POLLRDBAND ++ | ::POLLWRBAND ++ | ::POLLERR ++ | ::POLLHUP ++ | ::POLLNVAL; + + pub const EAI_AGAIN: ::c_int = 2; + pub const EAI_BADFLAGS: ::c_int = 3; +@@ -531,17 +590,17 @@ 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_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 = 0x2000; + +-pub const GLOB_NOSPACE : ::c_int = -1; +-pub const GLOB_ABORTED : ::c_int = -2; +-pub const GLOB_NOMATCH : ::c_int = -3; ++pub const GLOB_NOSPACE: ::c_int = -1; ++pub const GLOB_ABORTED: ::c_int = -2; ++pub const GLOB_NOMATCH: ::c_int = -3; + + pub const POSIX_MADV_NORMAL: ::c_int = 0; + pub const POSIX_MADV_RANDOM: ::c_int = 1; +@@ -582,7 +641,7 @@ pub const MADV_AUTOSYNC: ::c_int = 7; + pub const MADV_NOCORE: ::c_int = 8; + pub const MADV_CORE: ::c_int = 9; + +-pub const MINCORE_INCORE: ::c_int = 0x1; ++pub const MINCORE_INCORE: ::c_int = 0x1; + pub const MINCORE_REFERENCED: ::c_int = 0x2; + pub const MINCORE_MODIFIED: ::c_int = 0x4; + pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8; +@@ -661,6 +720,11 @@ pub const PF_NATM: ::c_int = AF_NATM; + pub const PF_ATM: ::c_int = AF_ATM; + pub const PF_NETGRAPH: ::c_int = AF_NETGRAPH; + ++pub const PIOD_READ_D: ::c_int = 1; ++pub const PIOD_WRITE_D: ::c_int = 2; ++pub const PIOD_READ_I: ::c_int = 3; ++pub const PIOD_WRITE_I: ::c_int = 4; ++ + pub const PT_TRACE_ME: ::c_int = 0; + pub const PT_READ_I: ::c_int = 1; + pub const PT_READ_D: ::c_int = 2; +@@ -678,7 +742,7 @@ pub const SOMAXCONN: ::c_int = 128; + pub const MSG_OOB: ::c_int = 0x00000001; + pub const MSG_PEEK: ::c_int = 0x00000002; + pub const MSG_DONTROUTE: ::c_int = 0x00000004; +-pub const MSG_EOR: ::c_int = 0x00000008; ++pub const MSG_EOR: ::c_int = 0x00000008; + pub const MSG_TRUNC: ::c_int = 0x00000010; + pub const MSG_CTRUNC: ::c_int = 0x00000020; + pub const MSG_WAITALL: ::c_int = 0x00000040; +@@ -686,6 +750,7 @@ pub const MSG_DONTWAIT: ::c_int = 0x00000080; + pub const MSG_EOF: ::c_int = 0x00000100; + + pub const SCM_TIMESTAMP: ::c_int = 0x02; ++pub const SCM_CREDS: ::c_int = 0x03; + + pub const SOCK_STREAM: ::c_int = 1; + pub const SOCK_DGRAM: ::c_int = 2; +@@ -704,16 +769,18 @@ pub const IP_DROP_MEMBERSHIP: ::c_int = 13; + pub const IP_RECVIF: ::c_int = 20; + pub const IPV6_JOIN_GROUP: ::c_int = 12; + pub const IPV6_LEAVE_GROUP: ::c_int = 13; ++pub const IPV6_CHECKSUM: ::c_int = 26; + pub const IPV6_RECVPKTINFO: ::c_int = 36; + pub const IPV6_PKTINFO: ::c_int = 46; ++pub const IPV6_HOPLIMIT: ::c_int = 47; + pub const IPV6_RECVTCLASS: ::c_int = 57; + pub const IPV6_TCLASS: ::c_int = 61; + +-pub const TCP_NOPUSH: ::c_int = 4; +-pub const TCP_NOOPT: ::c_int = 8; +-pub const TCP_KEEPIDLE: ::c_int = 256; ++pub const TCP_NOPUSH: ::c_int = 4; ++pub const TCP_NOOPT: ::c_int = 8; ++pub const TCP_KEEPIDLE: ::c_int = 256; + pub const TCP_KEEPINTVL: ::c_int = 512; +-pub const TCP_KEEPCNT: ::c_int = 1024; ++pub const TCP_KEEPCNT: ::c_int = 1024; + + pub const SOL_SOCKET: ::c_int = 0xffff; + pub const SO_DEBUG: ::c_int = 0x01; +@@ -749,10 +816,10 @@ pub const LOCK_UN: ::c_int = 8; + + pub const MAP_COPY: ::c_int = 0x0002; + #[doc(hidden)] +-#[deprecated(since="0.2.54",note="Removed in FreeBSD 11")] ++#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] + pub const MAP_RENAME: ::c_int = 0x0020; + #[doc(hidden)] +-#[deprecated(since="0.2.54",note="Removed in FreeBSD 11")] ++#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] + pub const MAP_NORESERVE: ::c_int = 0x0040; + pub const MAP_HASSEMAPHORE: ::c_int = 0x0200; + pub const MAP_STACK: ::c_int = 0x0400; +@@ -990,13 +1057,21 @@ pub const TIOCSPGRP: ::c_ulong = 0x80047476; + pub const TIOCGPGRP: ::c_uint = 0x40047477; + pub const TIOCCDTR: ::c_uint = 0x20007478; + pub const TIOCSDTR: ::c_uint = 0x20007479; +-pub const TIOCCBRK: ::c_uint = 0x2000747a; +-pub const TIOCSBRK: ::c_uint = 0x2000747b; + pub const TTYDISC: ::c_int = 0x0; + pub const SLIPDISC: ::c_int = 0x4; + pub const PPPDISC: ::c_int = 0x5; + pub const NETGRAPHDISC: ::c_int = 0x6; + ++pub const BIOCGRSIG: ::c_ulong = 0x40044272; ++pub const BIOCSRSIG: ::c_ulong = 0x80044273; ++pub const BIOCSDLT: ::c_ulong = 0x80044278; ++pub const BIOCGSEESENT: ::c_ulong = 0x40044276; ++pub const BIOCSSEESENT: ::c_ulong = 0x80044277; ++pub const BIOCSETF: ::c_ulong = 0x80104267; ++pub const BIOCGDLTLIST: ::c_ulong = 0xc0104279; ++pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d; ++pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e; ++ + pub const FIODTYPE: ::c_ulong = 0x4004667a; + pub const FIOGETLBA: ::c_ulong = 0x40046679; + pub const FIODGNAME: ::c_ulong = 0x80106678; +@@ -1053,20 +1128,75 @@ pub const RTP_LOOKUP: ::c_int = 0; + pub const RTP_SET: ::c_int = 1; + + // Flags for chflags(2) +-pub const UF_SETTABLE: ::c_ulong = 0x0000ffff; +-pub const UF_NODUMP: ::c_ulong = 0x00000001; +-pub const UF_IMMUTABLE: ::c_ulong = 0x00000002; +-pub const UF_APPEND: ::c_ulong = 0x00000004; +-pub const UF_OPAQUE: ::c_ulong = 0x00000008; +-pub const UF_NOUNLINK: ::c_ulong = 0x00000010; +-pub const SF_SETTABLE: ::c_ulong = 0xffff0000; +-pub const SF_ARCHIVED: ::c_ulong = 0x00010000; +-pub const SF_IMMUTABLE: ::c_ulong = 0x00020000; +-pub const SF_APPEND: ::c_ulong = 0x00040000; +-pub const SF_NOUNLINK: ::c_ulong = 0x00100000; ++pub const UF_SETTABLE: ::c_ulong = 0x0000ffff; ++pub const UF_NODUMP: ::c_ulong = 0x00000001; ++pub const UF_IMMUTABLE: ::c_ulong = 0x00000002; ++pub const UF_APPEND: ::c_ulong = 0x00000004; ++pub const UF_OPAQUE: ::c_ulong = 0x00000008; ++pub const UF_NOUNLINK: ::c_ulong = 0x00000010; ++pub const SF_SETTABLE: ::c_ulong = 0xffff0000; ++pub const SF_ARCHIVED: ::c_ulong = 0x00010000; ++pub const SF_IMMUTABLE: ::c_ulong = 0x00020000; ++pub const SF_APPEND: ::c_ulong = 0x00040000; ++pub const SF_NOUNLINK: ::c_ulong = 0x00100000; + + pub const TIMER_ABSTIME: ::c_int = 1; + ++// ++pub const NTP_API: ::c_int = 4; ++pub const MAXPHASE: ::c_long = 500000000; ++pub const MAXFREQ: ::c_long = 500000; ++pub const MINSEC: ::c_int = 256; ++pub const MAXSEC: ::c_int = 2048; ++pub const NANOSECOND: ::c_long = 1000000000; ++pub const SCALE_PPM: ::c_int = 65; ++pub const MAXTC: ::c_int = 10; ++pub const MOD_OFFSET: ::c_uint = 0x0001; ++pub const MOD_FREQUENCY: ::c_uint = 0x0002; ++pub const MOD_MAXERROR: ::c_uint = 0x0004; ++pub const MOD_ESTERROR: ::c_uint = 0x0008; ++pub const MOD_STATUS: ::c_uint = 0x0010; ++pub const MOD_TIMECONST: ::c_uint = 0x0020; ++pub const MOD_PPSMAX: ::c_uint = 0x0040; ++pub const MOD_TAI: ::c_uint = 0x0080; ++pub const MOD_MICRO: ::c_uint = 0x1000; ++pub const MOD_NANO: ::c_uint = 0x2000; ++pub const MOD_CLKB: ::c_uint = 0x4000; ++pub const MOD_CLKA: ::c_uint = 0x8000; ++pub const STA_PLL: ::c_int = 0x0001; ++pub const STA_PPSFREQ: ::c_int = 0x0002; ++pub const STA_PPSTIME: ::c_int = 0x0004; ++pub const STA_FLL: ::c_int = 0x0008; ++pub const STA_INS: ::c_int = 0x0010; ++pub const STA_DEL: ::c_int = 0x0020; ++pub const STA_UNSYNC: ::c_int = 0x0040; ++pub const STA_FREQHOLD: ::c_int = 0x0080; ++pub const STA_PPSSIGNAL: ::c_int = 0x0100; ++pub const STA_PPSJITTER: ::c_int = 0x0200; ++pub const STA_PPSWANDER: ::c_int = 0x0400; ++pub const STA_PPSERROR: ::c_int = 0x0800; ++pub const STA_CLOCKERR: ::c_int = 0x1000; ++pub const STA_NANO: ::c_int = 0x2000; ++pub const STA_MODE: ::c_int = 0x4000; ++pub const STA_CLK: ::c_int = 0x8000; ++pub const STA_RONLY: ::c_int = STA_PPSSIGNAL ++ | STA_PPSJITTER ++ | STA_PPSWANDER ++ | STA_PPSERROR ++ | STA_CLOCKERR ++ | STA_NANO ++ | STA_MODE ++ | STA_CLK; ++pub const TIME_OK: ::c_int = 0; ++pub const TIME_INS: ::c_int = 1; ++pub const TIME_DEL: ::c_int = 2; ++pub const TIME_OOP: ::c_int = 3; ++pub const TIME_WAIT: ::c_int = 4; ++pub const TIME_ERROR: ::c_int = 5; ++ ++pub const REG_ENOSYS: ::c_int = -1; ++pub const REG_ILLSEQ: ::c_int = 17; ++ + f! { + pub fn WIFCONTINUED(status: ::c_int) -> bool { + status == 0x13 +@@ -1076,234 +1206,348 @@ f! { + 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 + } + } + +-extern { ++extern "C" { + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; +- pub fn sem_init(sem: *mut sem_t, +- pshared: ::c_int, +- value: ::c_uint) +- -> ::c_int; ++ pub fn sem_init( ++ sem: *mut sem_t, ++ pshared: ::c_int, ++ value: ::c_uint, ++ ) -> ::c_int; + + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; +- pub fn gettimeofday(tp: *mut ::timeval, +- tz: *mut ::timezone) -> ::c_int; +- pub fn accept4(s: ::c_int, addr: *mut ::sockaddr, +- addrlen: *mut ::socklen_t, flags: ::c_int) -> ::c_int; +- 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 gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; ++ pub fn accept4( ++ s: ::c_int, ++ addr: *mut ::sockaddr, ++ addrlen: *mut ::socklen_t, ++ flags: ::c_int, ++ ) -> ::c_int; + pub fn chflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int; +- pub fn chflagsat(fd: ::c_int, path: *const ::c_char, flags: ::c_ulong, +- atflag: ::c_int) -> ::c_int; ++ pub fn chflagsat( ++ fd: ::c_int, ++ path: *const ::c_char, ++ flags: ::c_ulong, ++ atflag: ::c_int, ++ ) -> ::c_int; + pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; + pub fn duplocale(base: ::locale_t) -> ::locale_t; + pub fn endutxent(); + pub fn fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int; + pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; + pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int; +- pub fn getgrent_r(grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; +- #[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")] +- pub fn getpwent_r(pwd: *mut ::passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::passwd) -> ::c_int; +- pub fn getgrouplist(name: *const ::c_char, +- basegid: ::gid_t, +- groups: *mut ::gid_t, +- ngroups: *mut ::c_int) -> ::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 getgrent_r( ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; ++ pub fn getpwent_r( ++ pwd: *mut ::passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::passwd, ++ ) -> ::c_int; ++ pub fn getgrouplist( ++ name: *const ::c_char, ++ basegid: ::gid_t, ++ groups: *mut ::gid_t, ++ ngroups: *mut ::c_int, ++ ) -> ::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 getpriority(which: ::c_int, who: ::c_int) -> ::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 initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int; + #[cfg_attr( +- all(target_os = "freebsd", not(freebsd12)), ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "kevent@FBSD_1.0" + )] +- 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 kevent( ++ kq: ::c_int, ++ changelist: *const ::kevent, ++ nchanges: ::c_int, ++ eventlist: *mut ::kevent, ++ nevents: ::c_int, ++ timeout: *const ::timespec, ++ ) -> ::c_int; + pub fn lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int; +- pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb, +- nitems: ::c_int, sevp: *mut sigevent) -> ::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 memrchr(cx: *const ::c_void, +- c: ::c_int, +- n: ::size_t) -> *mut ::c_void; +- pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, +- mode: ::mode_t) -> ::c_int; ++ pub fn memrchr( ++ cx: *const ::c_void, ++ c: ::c_int, ++ n: ::size_t, ++ ) -> *mut ::c_void; ++ pub fn mkfifoat( ++ dirfd: ::c_int, ++ pathname: *const ::c_char, ++ mode: ::mode_t, ++ ) -> ::c_int; + #[cfg_attr( +- all(target_os = "freebsd", not(freebsd12)), ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "mknodat@FBSD_1.1" + )] +- pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char, +- mode: ::mode_t, dev: dev_t) -> ::c_int; +- pub fn mq_close(mqd: ::mqd_t) -> ::c_int; +- pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int; +- pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int; +- pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t; +- pub fn mq_receive(mqd: ::mqd_t, +- msg_ptr: *mut ::c_char, +- msg_len: ::size_t, +- msq_prio: *mut ::c_uint) -> ::ssize_t; +- pub fn mq_send(mqd: ::mqd_t, +- msg_ptr: *const ::c_char, +- msg_len: ::size_t, +- msq_prio: ::c_uint) -> ::c_int; +- pub fn mq_setattr(mqd: ::mqd_t, +- newattr: *const ::mq_attr, +- oldattr: *mut ::mq_attr) -> ::c_int; +- pub fn mq_timedreceive(mqd: ::mqd_t, +- msg_ptr: *mut ::c_char, +- msg_len: ::size_t, +- msq_prio: *mut ::c_uint, +- abs_timeout: *const ::timespec) -> ::ssize_t; +- pub fn mq_timedsend(mqd: ::mqd_t, +- msg_ptr: *const ::c_char, +- msg_len: ::size_t, +- msq_prio: ::c_uint, +- abs_timeout: *const ::timespec) -> ::c_int; +- pub fn mq_unlink(name: *const ::c_char) -> ::c_int; +- pub fn mincore(addr: *const ::c_void, len: ::size_t, +- vec: *mut ::c_char) -> ::c_int; +- pub fn newlocale(mask: ::c_int, +- locale: *const ::c_char, +- base: ::locale_t) -> ::locale_t; +- pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char; ++ pub fn mknodat( ++ dirfd: ::c_int, ++ pathname: *const ::c_char, ++ mode: ::mode_t, ++ dev: dev_t, ++ ) -> ::c_int; ++ pub fn mincore( ++ addr: *const ::c_void, ++ len: ::size_t, ++ vec: *mut ::c_char, ++ ) -> ::c_int; ++ pub fn newlocale( ++ mask: ::c_int, ++ locale: *const ::c_char, ++ base: ::locale_t, ++ ) -> ::locale_t; ++ pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) ++ -> *mut ::c_char; + pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; +- pub fn ppoll(fds: *mut ::pollfd, +- nfds: ::nfds_t, +- timeout: *const ::timespec, +- sigmask: *const sigset_t) -> ::c_int; +- pub fn preadv(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int, +- offset: ::off_t) -> ::ssize_t; +- pub fn pthread_attr_get_np(tid: ::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; +- pub fn pthread_condattr_getclock(attr: *const pthread_condattr_t, +- clock_id: *mut clockid_t) -> ::c_int; +- pub fn pthread_condattr_getpshared(attr: *const pthread_condattr_t, +- pshared: *mut ::c_int) -> ::c_int; +- pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t, +- clock_id: ::clockid_t) -> ::c_int; +- pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, +- pshared: ::c_int) -> ::c_int; +- pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t, +- abstime: *const ::timespec) -> ::c_int; +- pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t, +- pshared: *mut ::c_int) -> ::c_int; +- pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, +- pshared: ::c_int) -> ::c_int; +- pub fn pthread_rwlockattr_getpshared(attr: *const pthread_rwlockattr_t, +- val: *mut ::c_int) -> ::c_int; +- pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, +- val: ::c_int) -> ::c_int; ++ pub fn ppoll( ++ fds: *mut ::pollfd, ++ nfds: ::nfds_t, ++ timeout: *const ::timespec, ++ sigmask: *const sigset_t, ++ ) -> ::c_int; ++ pub fn preadv( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ offset: ::off_t, ++ ) -> ::ssize_t; ++ pub fn pthread_attr_get_np( ++ tid: ::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; ++ pub fn pthread_condattr_getclock( ++ attr: *const pthread_condattr_t, ++ clock_id: *mut clockid_t, ++ ) -> ::c_int; ++ pub fn pthread_condattr_getpshared( ++ attr: *const pthread_condattr_t, ++ pshared: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_condattr_setclock( ++ attr: *mut pthread_condattr_t, ++ clock_id: ::clockid_t, ++ ) -> ::c_int; ++ pub fn pthread_condattr_setpshared( ++ attr: *mut pthread_condattr_t, ++ pshared: ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_main_np() -> ::c_int; ++ pub fn pthread_mutex_timedlock( ++ lock: *mut pthread_mutex_t, ++ abstime: *const ::timespec, ++ ) -> ::c_int; ++ pub fn pthread_mutexattr_getpshared( ++ attr: *const pthread_mutexattr_t, ++ pshared: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_mutexattr_setpshared( ++ attr: *mut pthread_mutexattr_t, ++ pshared: ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_rwlockattr_getpshared( ++ attr: *const pthread_rwlockattr_t, ++ val: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_rwlockattr_setpshared( ++ attr: *mut pthread_rwlockattr_t, ++ val: ::c_int, ++ ) -> ::c_int; + pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char); +- pub fn ptrace(request: ::c_int, +- pid: ::pid_t, +- addr: *mut ::c_char, +- data: ::c_int) -> ::c_int; ++ pub fn ptrace( ++ request: ::c_int, ++ pid: ::pid_t, ++ addr: *mut ::c_char, ++ data: ::c_int, ++ ) -> ::c_int; + pub fn pututxline(ut: *const utmpx) -> *mut utmpx; +- pub fn pwritev(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int, +- offset: ::off_t) -> ::ssize_t; ++ pub fn pwritev( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ offset: ::off_t, ++ ) -> ::ssize_t; + pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char; +- pub fn rtprio(function: ::c_int, pid: ::pid_t, rtp: *mut rtprio) -> ::c_int; ++ pub fn rtprio( ++ function: ::c_int, ++ pid: ::pid_t, ++ rtp: *mut rtprio, ++ ) -> ::c_int; + pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int; +- pub fn sched_setscheduler(pid: ::pid_t, +- policy: ::c_int, +- param: *const ::sched_param) -> ::c_int; +- pub fn sem_getvalue(sem: *mut sem_t, +- sval: *mut ::c_int) -> ::c_int; +- pub fn sem_timedwait(sem: *mut sem_t, +- abstime: *const ::timespec) -> ::c_int; +- pub fn sendfile(fd: ::c_int, +- s: ::c_int, +- offset: ::off_t, +- nbytes: ::size_t, +- hdtr: *mut ::sf_hdtr, +- sbytes: *mut ::off_t, +- flags: ::c_int) -> ::c_int; ++ pub fn sched_setscheduler( ++ pid: ::pid_t, ++ policy: ::c_int, ++ param: *const ::sched_param, ++ ) -> ::c_int; ++ pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int; ++ pub fn sem_timedwait( ++ sem: *mut sem_t, ++ abstime: *const ::timespec, ++ ) -> ::c_int; ++ pub fn sendfile( ++ fd: ::c_int, ++ s: ::c_int, ++ offset: ::off_t, ++ nbytes: ::size_t, ++ hdtr: *mut ::sf_hdtr, ++ sbytes: *mut ::off_t, ++ flags: ::c_int, ++ ) -> ::c_int; + pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int; + pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int; +- pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int; ++ pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) ++ -> ::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; +- pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int; ++ pub fn settimeofday( ++ tv: *const ::timeval, ++ tz: *const ::timezone, ++ ) -> ::c_int; + pub fn setutxent(); +- pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) +- -> ::c_int; +- 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 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; +- pub fn sysctlnametomib(name: *const ::c_char, +- mibp: *mut ::c_int, +- sizep: *mut ::size_t) +- -> ::c_int; ++ pub fn shm_open( ++ name: *const ::c_char, ++ oflag: ::c_int, ++ mode: ::mode_t, ++ ) -> ::c_int; ++ 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 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; ++ pub fn sysctlnametomib( ++ name: *const ::c_char, ++ mibp: *mut ::c_int, ++ sizep: *mut ::size_t, ++ ) -> ::c_int; + pub fn uselocale(loc: ::locale_t) -> ::locale_t; +- pub fn utimensat(dirfd: ::c_int, path: *const ::c_char, +- times: *const ::timespec, flag: ::c_int) -> ::c_int; ++ pub fn utimensat( ++ dirfd: ::c_int, ++ path: *const ::c_char, ++ times: *const ::timespec, ++ flag: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn ntp_adjtime(buf: *mut timex) -> ::c_int; ++ pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int; ++} ++ ++#[link(name = "rt")] ++extern "C" { ++ 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 mq_close(mqd: ::mqd_t) -> ::c_int; ++ pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int; ++ pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) ++ -> ::c_int; ++ pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t; ++ pub fn mq_receive( ++ mqd: ::mqd_t, ++ msg_ptr: *mut ::c_char, ++ msg_len: ::size_t, ++ msg_prio: *mut ::c_uint, ++ ) -> ::ssize_t; ++ pub fn mq_send( ++ mqd: ::mqd_t, ++ msg_ptr: *const ::c_char, ++ msg_len: ::size_t, ++ msg_prio: ::c_uint, ++ ) -> ::c_int; ++ pub fn mq_setattr( ++ mqd: ::mqd_t, ++ newattr: *const ::mq_attr, ++ oldattr: *mut ::mq_attr, ++ ) -> ::c_int; ++ pub fn mq_timedreceive( ++ mqd: ::mqd_t, ++ msg_ptr: *mut ::c_char, ++ msg_len: ::size_t, ++ msg_prio: *mut ::c_uint, ++ abs_timeout: *const ::timespec, ++ ) -> ::ssize_t; ++ pub fn mq_timedsend( ++ mqd: ::mqd_t, ++ msg_ptr: *const ::c_char, ++ msg_len: ::size_t, ++ msg_prio: ::c_uint, ++ abs_timeout: *const ::timespec, ++ ) -> ::c_int; ++ pub fn mq_unlink(name: *const ::c_char) -> ::c_int; + } + + #[link(name = "util")] +-extern { +- 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; ++extern "C" { ++ 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 login_tty(fd: ::c_int) -> ::c_int; + } + +diff --git a/third_party/rust/libc/src/unix/bsd/mod.rs b/third_party/rust/libc/src/unix/bsd/mod.rs +index 77f82b182bb572082f6f3984c0016feca34fb69b..1b55078d5af4147349931893c79a0b4195c92ed9 100644 +--- a/third_party/rust/libc/src/unix/bsd/mod.rs ++++ b/third_party/rust/libc/src/unix/bsd/mod.rs +@@ -1,4 +1,3 @@ +-pub type wchar_t = i32; + pub type off_t = i64; + pub type useconds_t = u32; + pub type blkcnt_t = i64; +@@ -6,6 +5,7 @@ pub type socklen_t = u32; + pub type sa_family_t = u8; + pub type pthread_t = ::uintptr_t; + pub type nfds_t = ::c_uint; ++pub type regoff_t = off_t; + + s! { + pub struct sockaddr { +@@ -101,9 +101,21 @@ s! { + pub if_index: ::c_uint, + pub if_name: *mut ::c_char, + } ++ ++ pub struct regex_t { ++ __re_magic: ::c_int, ++ __re_nsub: ::size_t, ++ __re_endp: *const ::c_char, ++ __re_g: *mut ::c_void, ++ } ++ ++ pub struct regmatch_t { ++ pub rm_so: regoff_t, ++ pub rm_eo: regoff_t, ++ } + } + +-s_no_extra_traits!{ ++s_no_extra_traits! { + pub struct sockaddr_un { + pub sun_len: u8, + pub sun_family: sa_family_t, +@@ -436,6 +448,62 @@ pub const POLLWRNORM: ::c_short = 0x004; + pub const POLLRDBAND: ::c_short = 0x080; + pub const POLLWRBAND: ::c_short = 0x100; + ++pub const BIOCGBLEN: ::c_ulong = 0x40044266; ++pub const BIOCSBLEN: ::c_ulong = 0xc0044266; ++pub const BIOCFLUSH: ::c_uint = 0x20004268; ++pub const BIOCPROMISC: ::c_uint = 0x20004269; ++pub const BIOCGDLT: ::c_ulong = 0x4004426a; ++pub const BIOCGETIF: ::c_ulong = 0x4020426b; ++pub const BIOCSETIF: ::c_ulong = 0x8020426c; ++pub const BIOCGSTATS: ::c_ulong = 0x4008426f; ++pub const BIOCIMMEDIATE: ::c_ulong = 0x80044270; ++pub const BIOCVERSION: ::c_ulong = 0x40044271; ++pub const BIOCGHDRCMPLT: ::c_ulong = 0x40044274; ++pub const BIOCSHDRCMPLT: ::c_ulong = 0x80044275; ++pub const SIOCGIFADDR: ::c_ulong = 0xc0206921; ++ ++pub const REG_BASIC: ::c_int = 0o0000; ++pub const REG_EXTENDED: ::c_int = 0o0001; ++pub const REG_ICASE: ::c_int = 0o0002; ++pub const REG_NOSUB: ::c_int = 0o0004; ++pub const REG_NEWLINE: ::c_int = 0o0010; ++pub const REG_NOSPEC: ::c_int = 0o0020; ++pub const REG_PEND: ::c_int = 0o0040; ++pub const REG_DUMP: ::c_int = 0o0200; ++ ++pub const REG_NOMATCH: ::c_int = 1; ++pub const REG_BADPAT: ::c_int = 2; ++pub const REG_ECOLLATE: ::c_int = 3; ++pub const REG_ECTYPE: ::c_int = 4; ++pub const REG_EESCAPE: ::c_int = 5; ++pub const REG_ESUBREG: ::c_int = 6; ++pub const REG_EBRACK: ::c_int = 7; ++pub const REG_EPAREN: ::c_int = 8; ++pub const REG_EBRACE: ::c_int = 9; ++pub const REG_BADBR: ::c_int = 10; ++pub const REG_ERANGE: ::c_int = 11; ++pub const REG_ESPACE: ::c_int = 12; ++pub const REG_BADRPT: ::c_int = 13; ++pub const REG_EMPTY: ::c_int = 14; ++pub const REG_ASSERT: ::c_int = 15; ++pub const REG_INVARG: ::c_int = 16; ++pub const REG_ATOI: ::c_int = 255; ++pub const REG_ITOA: ::c_int = 0o0400; ++ ++pub const REG_NOTBOL: ::c_int = 0o00001; ++pub const REG_NOTEOL: ::c_int = 0o00002; ++pub const REG_STARTEND: ::c_int = 0o00004; ++pub const REG_TRACE: ::c_int = 0o00400; ++pub const REG_LARGE: ::c_int = 0o01000; ++pub const REG_BACKR: ::c_int = 0o02000; ++ ++pub const TIOCCBRK: ::c_uint = 0x2000747a; ++pub const TIOCSBRK: ::c_uint = 0x2000747b; ++ ++pub const PRIO_PROCESS: ::c_int = 0; ++pub const PRIO_PGRP: ::c_int = 1; ++pub const PRIO_USER: ::c_int = 2; ++ + f! { + pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr { + if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() { +@@ -492,26 +560,40 @@ f! { + } + } + +-extern { +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "getrlimit$UNIX2003")] ++extern "C" { ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "getrlimit$UNIX2003" ++ )] + pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "setrlimit$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "setrlimit$UNIX2003" ++ )] + pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; + +- pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, +- buflen: ::size_t) -> ::c_int; ++ pub fn strerror_r( ++ errnum: ::c_int, ++ buf: *mut c_char, ++ buflen: ::size_t, ++ ) -> ::c_int; + pub fn abs(i: ::c_int) -> ::c_int; + pub fn atof(s: *const ::c_char) -> ::c_double; + pub fn labs(i: ::c_long) -> ::c_long; ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)), ++ link_name = "rand@FBSD_1.0" ++ )] + pub fn rand() -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)), ++ link_name = "srand@FBSD_1.0" ++ )] + pub fn srand(seed: ::c_uint); + + 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 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; +@@ -529,153 +611,265 @@ extern { + pub fn if_nameindex() -> *mut if_nameindex; + pub fn if_freenameindex(ptr: *mut if_nameindex); + +- pub fn getpeereid(socket: ::c_int, +- euid: *mut ::uid_t, +- egid: *mut ::gid_t) -> ::c_int; ++ pub fn getpeereid( ++ socket: ::c_int, ++ euid: *mut ::uid_t, ++ egid: *mut ::gid_t, ++ ) -> ::c_int; + + #[cfg_attr(target_os = "macos", link_name = "glob$INODE64")] + #[cfg_attr(target_os = "netbsd", link_name = "__glob30")] + #[cfg_attr( +- all(target_os = "freebsd", not(freebsd12)), ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "glob@FBSD_1.0" + )] +- pub fn glob(pattern: *const ::c_char, +- flags: ::c_int, +- errfunc: ::Option ::c_int>, +- pglob: *mut ::glob_t) -> ::c_int; ++ pub fn glob( ++ pattern: *const ::c_char, ++ flags: ::c_int, ++ errfunc: ::Option< ++ extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int, ++ >, ++ pglob: *mut ::glob_t, ++ ) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__globfree30")] + #[cfg_attr( +- all(target_os = "freebsd", not(freebsd12)), ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "globfree@FBSD_1.0" + )] + pub fn globfree(pglob: *mut ::glob_t); + +- pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) +- -> ::c_int; ++ pub fn posix_madvise( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ advice: ::c_int, ++ ) -> ::c_int; + + pub fn shm_unlink(name: *const ::c_char) -> ::c_int; + +- #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"), +- link_name = "seekdir$INODE64")] +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "seekdir$INODE64$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86_64"), ++ link_name = "seekdir$INODE64" ++ )] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "seekdir$INODE64$UNIX2003" ++ )] + pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); + +- #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"), +- link_name = "telldir$INODE64")] +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "telldir$INODE64$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86_64"), ++ link_name = "telldir$INODE64" ++ )] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "telldir$INODE64$UNIX2003" ++ )] + pub fn telldir(dirp: *mut ::DIR) -> ::c_long; +- pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) +- -> ::c_int; ++ pub fn madvise( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ advice: ::c_int, ++ ) -> ::c_int; + +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "msync$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "msync$UNIX2003" ++ )] + #[cfg_attr(target_os = "netbsd", link_name = "__msync13")] +- pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int; ++ pub fn msync( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; + +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "recvfrom$UNIX2003")] +- pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, +- flags: ::c_int, addr: *mut ::sockaddr, +- addrlen: *mut ::socklen_t) -> ::ssize_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "recvfrom$UNIX2003" ++ )] ++ pub fn recvfrom( ++ socket: ::c_int, ++ buf: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ addr: *mut ::sockaddr, ++ addrlen: *mut ::socklen_t, ++ ) -> ::ssize_t; + pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__futimes50")] + pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int; + pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; + +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "bind$UNIX2003")] +- pub fn bind(socket: ::c_int, address: *const ::sockaddr, +- address_len: ::socklen_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, +- iovcnt: ::c_int) -> ::ssize_t; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "readv$UNIX2003")] +- pub fn readv(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int) -> ::ssize_t; +- +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "sendmsg$UNIX2003")] +- pub fn sendmsg(fd: ::c_int, +- msg: *const ::msghdr, +- flags: ::c_int) -> ::ssize_t; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "recvmsg$UNIX2003")] +- pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) +- -> ::ssize_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "bind$UNIX2003" ++ )] ++ pub fn bind( ++ socket: ::c_int, ++ address: *const ::sockaddr, ++ address_len: ::socklen_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, ++ iovcnt: ::c_int, ++ ) -> ::ssize_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "readv$UNIX2003" ++ )] ++ pub fn readv( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ ) -> ::ssize_t; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "sendmsg$UNIX2003" ++ )] ++ pub fn sendmsg( ++ fd: ::c_int, ++ msg: *const ::msghdr, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "recvmsg$UNIX2003" ++ )] ++ pub fn recvmsg( ++ fd: ::c_int, ++ msg: *mut ::msghdr, ++ flags: ::c_int, ++ ) -> ::ssize_t; + + pub fn sync(); +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrgid_r")] +- pub fn getgrgid_r(gid: ::gid_t, +- grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "sigaltstack$UNIX2003")] ++ pub fn getgrgid_r( ++ gid: ::gid_t, ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "sigaltstack$UNIX2003" ++ )] + #[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")] +- pub fn sigaltstack(ss: *const stack_t, +- oss: *mut stack_t) -> ::c_int; ++ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sem_close(sem: *mut sem_t) -> ::c_int; + pub fn getdtablesize() -> ::c_int; +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrnam_r")] +- pub fn getgrnam_r(name: *const ::c_char, +- grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_sigmask$UNIX2003")] +- pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, +- oldset: *mut sigset_t) -> ::c_int; ++ pub fn getgrnam_r( ++ name: *const ::c_char, ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_sigmask$UNIX2003" ++ )] ++ pub fn pthread_sigmask( ++ how: ::c_int, ++ set: *const sigset_t, ++ oldset: *mut sigset_t, ++ ) -> ::c_int; + pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; + pub fn getgrnam(name: *const ::c_char) -> *mut ::group; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_cancel$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_cancel$UNIX2003" ++ )] + pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int; + pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + pub fn sem_unlink(name: *const ::c_char) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwnam_r")] +- pub fn getpwnam_r(name: *const ::c_char, +- pwd: *mut passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut passwd) -> ::c_int; ++ pub fn getpwnam_r( ++ name: *const ::c_char, ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwuid_r")] +- pub fn getpwuid_r(uid: ::uid_t, +- pwd: *mut passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut passwd) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch ="x86"), +- link_name = "sigwait$UNIX2003")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")] +- pub fn sigwait(set: *const sigset_t, +- sig: *mut ::c_int) -> ::c_int; +- pub fn pthread_atfork(prepare: ::Option, +- parent: ::Option, +- child: ::Option) -> ::c_int; ++ pub fn getpwuid_r( ++ uid: ::uid_t, ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "sigwait$UNIX2003" ++ )] ++ pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; ++ pub fn pthread_atfork( ++ prepare: ::Option, ++ parent: ::Option, ++ child: ::Option, ++ ) -> ::c_int; + pub fn getgrgid(gid: ::gid_t) -> *mut ::group; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "popen$UNIX2003")] +- pub fn popen(command: *const c_char, +- mode: *const c_char) -> *mut ::FILE; +- pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char, +- mode: ::c_int, flags: ::c_int) -> ::c_int; +- pub fn pthread_create(native: *mut ::pthread_t, +- attr: *const ::pthread_attr_t, +- f: extern fn(*mut ::c_void) -> *mut ::c_void, +- value: *mut ::c_void) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "popen$UNIX2003" ++ )] ++ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; ++ pub fn faccessat( ++ dirfd: ::c_int, ++ pathname: *const ::c_char, ++ mode: ::c_int, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_create( ++ native: *mut ::pthread_t, ++ attr: *const ::pthread_attr_t, ++ f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, ++ value: *mut ::c_void, ++ ) -> ::c_int; + pub fn acct(filename: *const ::c_char) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "wait4$UNIX2003" ++ )] ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)), ++ link_name = "wait4@FBSD_1.0" ++ )] ++ pub fn wait4( ++ pid: ::pid_t, ++ status: *mut ::c_int, ++ options: ::c_int, ++ rusage: *mut ::rusage, ++ ) -> ::pid_t; ++ ++ pub fn regcomp( ++ preg: *mut regex_t, ++ pattern: *const ::c_char, ++ cflags: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn regexec( ++ preg: *const regex_t, ++ input: *const ::c_char, ++ nmatch: ::size_t, ++ pmatch: *mut regmatch_t, ++ eflags: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn regerror( ++ errcode: ::c_int, ++ preg: *const regex_t, ++ errbuf: *mut ::c_char, ++ errbuf_size: ::size_t, ++ ) -> ::size_t; ++ ++ pub fn regfree(preg: *mut regex_t); + } + + cfg_if! { +diff --git a/third_party/rust/libc/src/unix/bsd/netbsdlike/mod.rs b/third_party/rust/libc/src/unix/bsd/netbsdlike/mod.rs +index 2630a2f0bc1968feb605844430ef61c44785128d..720f10be82ea31270936b8a88ac638664a4028a2 100644 +--- a/third_party/rust/libc/src/unix/bsd/netbsdlike/mod.rs ++++ b/third_party/rust/libc/src/unix/bsd/netbsdlike/mod.rs +@@ -1,3 +1,4 @@ ++pub type wchar_t = i32; + pub type time_t = i64; + pub type mode_t = u32; + pub type nlink_t = u32; +@@ -10,18 +11,23 @@ pub type nl_item = c_long; + pub type clockid_t = ::c_int; + pub type id_t = u32; + pub type sem_t = *mut sem; ++pub type key_t = c_long; + + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub enum timezone {} + impl ::Copy for timezone {} + impl ::Clone for timezone { +- fn clone(&self) -> timezone { *self } ++ fn clone(&self) -> timezone { ++ *self ++ } + } + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub enum sem {} + impl ::Copy for sem {} + impl ::Clone for sem { +- fn clone(&self) -> sem { *self } ++ fn clone(&self) -> sem { ++ *self ++ } + } + + s! { +@@ -59,6 +65,23 @@ s! { + pub l_type: ::c_short, + pub l_whence: ::c_short, + } ++ ++ pub struct ipc_perm { ++ pub cuid: ::uid_t, ++ pub cgid: ::gid_t, ++ pub uid: ::uid_t, ++ pub gid: ::gid_t, ++ pub mode: ::mode_t, ++ pub seq: ::c_ushort, ++ pub key: ::key_t, ++ } ++ ++ pub struct ptrace_io_desc { ++ pub piod_op: ::c_int, ++ pub piod_offs: *mut ::c_void, ++ pub piod_addr: *mut ::c_void, ++ pub piod_len: ::size_t, ++ } + } + + pub const D_T_FMT: ::nl_item = 0; +@@ -120,201 +143,218 @@ 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_NOCTTY : ::c_int = 32768; +-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 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_NOCTTY: ::c_int = 32768; ++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 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 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 PTHREAD_CREATE_JOINABLE : ::c_int = 0; +-pub const PTHREAD_CREATE_DETACHED : ::c_int = 1; ++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 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_ANONYMOUS: ::c_int = MAP_ANON; ++ ++pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; ++ ++pub const IPC_CREAT: ::c_int = 0o001000; ++pub const IPC_EXCL: ::c_int = 0o002000; ++pub const IPC_NOWAIT: ::c_int = 0o004000; ++ ++pub const IPC_PRIVATE: ::key_t = 0; ++ ++pub const IPC_RMID: ::c_int = 0; ++pub const IPC_SET: ::c_int = 1; ++pub const IPC_STAT: ::c_int = 2; ++ ++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 PTHREAD_CREATE_JOINABLE: ::c_int = 0; ++pub const PTHREAD_CREATE_DETACHED: ::c_int = 1; ++ ++pub const PIOD_READ_D: ::c_int = 1; ++pub const PIOD_WRITE_D: ::c_int = 2; ++pub const PIOD_READ_I: ::c_int = 3; ++pub const PIOD_WRITE_I: ::c_int = 4; ++pub const PIOD_READ_AUXV: ::c_int = 5; + + pub const PT_TRACE_ME: ::c_int = 0; + pub const PT_READ_I: ::c_int = 1; +@@ -355,12 +395,12 @@ 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 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_UNSPEC: ::c_int = 0; + pub const AF_LOCAL: ::c_int = 1; +@@ -477,38 +517,38 @@ pub const LOCK_EX: ::c_int = 2; + pub const LOCK_NB: ::c_int = 4; + pub const LOCK_UN: ::c_int = 8; + +-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 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 _SC_XOPEN_SHM : ::c_int = 30; ++pub const _SC_FSYNC: ::c_int = 29; ++pub const _SC_XOPEN_SHM: ::c_int = 30; + + pub const Q_GETQUOTA: ::c_int = 0x300; + pub const Q_SETQUOTA: ::c_int = 0x400; +@@ -583,94 +623,153 @@ pub const TIOCM_CD: ::c_int = TIOCM_CAR; + pub const TIOCM_RI: ::c_int = TIOCM_RNG; + + // Flags for chflags(2) +-pub const UF_SETTABLE: ::c_ulong = 0x0000ffff; +-pub const UF_NODUMP: ::c_ulong = 0x00000001; +-pub const UF_IMMUTABLE: ::c_ulong = 0x00000002; +-pub const UF_APPEND: ::c_ulong = 0x00000004; +-pub const UF_OPAQUE: ::c_ulong = 0x00000008; +-pub const SF_SETTABLE: ::c_ulong = 0xffff0000; +-pub const SF_ARCHIVED: ::c_ulong = 0x00010000; +-pub const SF_IMMUTABLE: ::c_ulong = 0x00020000; +-pub const SF_APPEND: ::c_ulong = 0x00040000; ++pub const UF_SETTABLE: ::c_ulong = 0x0000ffff; ++pub const UF_NODUMP: ::c_ulong = 0x00000001; ++pub const UF_IMMUTABLE: ::c_ulong = 0x00000002; ++pub const UF_APPEND: ::c_ulong = 0x00000004; ++pub const UF_OPAQUE: ::c_ulong = 0x00000008; ++pub const SF_SETTABLE: ::c_ulong = 0xffff0000; ++pub const SF_ARCHIVED: ::c_ulong = 0x00010000; ++pub const SF_IMMUTABLE: ::c_ulong = 0x00020000; ++pub const SF_APPEND: ::c_ulong = 0x00040000; + + pub const TIMER_ABSTIME: ::c_int = 1; + + #[link(name = "util")] +-extern { ++extern "C" { + pub fn setgrent(); + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; +- pub fn sem_init(sem: *mut sem_t, +- pshared: ::c_int, +- value: ::c_uint) +- -> ::c_int; ++ pub fn sem_init( ++ sem: *mut sem_t, ++ pshared: ::c_int, ++ value: ::c_uint, ++ ) -> ::c_int; + + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; +- pub fn mincore(addr: *mut ::c_void, len: ::size_t, +- vec: *mut ::c_char) -> ::c_int; ++ pub fn accept4( ++ s: ::c_int, ++ addr: *mut ::sockaddr, ++ addrlen: *mut ::socklen_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ 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; + #[cfg_attr(target_os = "netbsd", link_name = "__clock_settime50")] +- pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; ++ pub fn clock_settime( ++ clk_id: ::clockid_t, ++ tp: *const ::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 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 pwritev(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int, +- offset: ::off_t) -> ::ssize_t; +- pub fn preadv(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int, +- offset: ::off_t) -> ::ssize_t; ++ pub fn mkostemps( ++ template: *mut ::c_char, ++ suffixlen: ::c_int, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn pwritev( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ offset: ::off_t, ++ ) -> ::ssize_t; ++ pub fn preadv( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ offset: ::off_t, ++ ) -> ::ssize_t; + pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; +- pub fn utimensat(dirfd: ::c_int, path: *const ::c_char, +- times: *const ::timespec, flag: ::c_int) -> ::c_int; ++ pub fn utimensat( ++ dirfd: ::c_int, ++ path: *const ::c_char, ++ times: *const ::timespec, ++ flag: ::c_int, ++ ) -> ::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 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 login_tty(fd: ::c_int) -> ::c_int; + 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 mknodat(dirfd: ::c_int, pathname: *const ::c_char, +- mode: ::mode_t, dev: dev_t) -> ::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 sem_getvalue(sem: *mut sem_t, +- sval: *mut ::c_int) -> ::c_int; +- pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t, +- clock_id: ::clockid_t) -> ::c_int; ++ pub fn mknodat( ++ dirfd: ::c_int, ++ pathname: *const ::c_char, ++ mode: ::mode_t, ++ dev: dev_t, ++ ) -> ::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 sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::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; ++ pub fn pthread_mutex_timedlock( ++ lock: *mut pthread_mutex_t, ++ abstime: *const ::timespec, ++ ) -> ::c_int; + pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; + +- pub fn getgrouplist(name: *const ::c_char, +- basegid: ::gid_t, +- groups: *mut ::gid_t, +- ngroups: *mut ::c_int) -> ::c_int; ++ pub fn getgrouplist( ++ name: *const ::c_char, ++ basegid: ::gid_t, ++ groups: *mut ::gid_t, ++ ngroups: *mut ::c_int, ++ ) -> ::c_int; + pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int; + pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; ++ ++ 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; + } + + cfg_if! { +diff --git a/third_party/rust/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs b/third_party/rust/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs +index f936eb5196b77a5fd15837d44bbb4a753e0686ac..6ddb3257e20260e82c5f8412dbfad8bc5c69abe4 100644 +--- a/third_party/rust/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs ++++ b/third_party/rust/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs +@@ -8,6 +8,24 @@ pub type idtype_t = ::c_int; + pub type mqd_t = ::c_int; + type __pthread_spin_t = __cpu_simple_lock_nv_t; + pub type vm_size_t = ::uintptr_t; ++pub type lwpid_t = ::c_uint; ++pub type shmatt_t = ::c_uint; ++ ++impl siginfo_t { ++ pub unsafe fn si_value(&self) -> ::sigval { ++ #[repr(C)] ++ struct siginfo_timer { ++ _si_signo: ::c_int, ++ _si_errno: ::c_int, ++ _si_code: ::c_int, ++ __pad1: ::c_int, ++ _pid: ::pid_t, ++ _uid: ::uid_t, ++ value: ::sigval, ++ } ++ (*(self as *const siginfo_t as *const siginfo_timer)).value ++ } ++} + + s! { + pub struct aiocb { +@@ -74,7 +92,7 @@ s! { + pub st_spare: [u32; 2], + } + +- pub struct addrinfo { ++ pub struct addrinfo { + pub ai_flags: ::c_int, + pub ai_family: ::c_int, + pub ai_socktype: ::c_int, +@@ -264,9 +282,90 @@ s! { + pub msg_hdr: ::msghdr, + pub msg_len: ::c_uint, + } ++ ++ pub struct __exit_status { ++ pub e_termination: u16, ++ pub e_exit: u16, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: ::ipc_perm, ++ pub shm_segsz: ::size_t, ++ pub shm_lpid: ::pid_t, ++ pub shm_cpid: ::pid_t, ++ pub shm_nattch: ::shmatt_t, ++ pub shm_atime: ::time_t, ++ pub shm_dtime: ::time_t, ++ pub shm_ctime: ::time_t, ++ _shm_internal: *mut ::c_void, ++ } ++ ++ 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 struct lastlog { ++ pub ll_line: [::c_char; UT_LINESIZE], ++ pub ll_host: [::c_char; UT_HOSTSIZE], ++ pub ll_time: ::time_t ++ } ++ ++ pub struct timex { ++ pub modes: ::c_uint, ++ pub offset: ::c_long, ++ pub freq: ::c_long, ++ pub maxerror: ::c_long, ++ pub esterror: ::c_long, ++ pub status: ::c_int, ++ pub constant: ::c_long, ++ pub precision: ::c_long, ++ pub tolerance: ::c_long, ++ pub ppsfreq: ::c_long, ++ pub jitter: ::c_long, ++ pub shift: ::c_int, ++ pub stabil: ::c_long, ++ pub jitcnt: ::c_long, ++ pub calcnt: ::c_long, ++ pub errcnt: ::c_long, ++ pub stbcnt: ::c_long, ++ } ++ ++ pub struct ntptimeval { ++ pub time: ::timespec, ++ pub maxerror: ::c_long, ++ pub esterror: ::c_long, ++ pub tai: ::c_long, ++ pub time_state: ::c_int, ++ } ++ + } + + s_no_extra_traits! { ++ ++ pub struct utmpx { ++ pub ut_name: [::c_char; _UTX_USERSIZE], ++ pub ut_id: [::c_char; _UTX_IDSIZE], ++ pub ut_line: [::c_char; _UTX_LINESIZE], ++ pub ut_host: [::c_char; _UTX_HOSTSIZE], ++ pub ut_session: u16, ++ pub ut_type: u16, ++ pub ut_pid: ::pid_t, ++ pub ut_exit: __exit_status, ++ pub ut_ss: sockaddr_storage, ++ pub ut_tv: ::timeval, ++ pub ut_pad: [u8; _UTX_PADSIZE], ++ } ++ ++ pub struct lastlogx { ++ pub ll_tv: ::timeval, ++ pub ll_line: [::c_char; _UTX_LINESIZE], ++ pub ll_host: [::c_char; _UTX_HOSTSIZE], ++ pub ll_ss: sockaddr_storage, ++ } ++ + pub struct in_pktinfo { + pub ipi_addr: ::in_addr, + pub ipi_ifindex: ::c_uint, +@@ -360,6 +459,101 @@ s_no_extra_traits! { + + cfg_if! { + if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for utmpx { ++ fn eq(&self, other: &utmpx) -> bool { ++ self.ut_type == other.ut_type ++ && self.ut_pid == other.ut_pid ++ && self.ut_name == other.ut_name ++ && self.ut_line == other.ut_line ++ && self.ut_id == other.ut_id ++ && self.ut_exit == other.ut_exit ++ && self.ut_session == other.ut_session ++ && self.ut_tv == other.ut_tv ++ && self.ut_ss == other.ut_ss ++ && self ++ .ut_pad ++ .iter() ++ .zip(other.ut_pad.iter()) ++ .all(|(a,b)| a == b) ++ && self ++ .ut_host ++ .iter() ++ .zip(other.ut_host.iter()) ++ .all(|(a,b)| a == b) ++ } ++ } ++ ++ impl Eq for utmpx {} ++ ++ impl ::fmt::Debug for utmpx { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("utmpx") ++ .field("ut_name", &self.ut_name) ++ .field("ut_id", &self.ut_id) ++ .field("ut_line", &self.ut_line) ++ // FIXME .field("ut_host", &self.ut_host) ++ .field("ut_session", &self.ut_session) ++ .field("ut_type", &self.ut_type) ++ .field("ut_pid", &self.ut_pid) ++ .field("ut_exit", &self.ut_exit) ++ .field("ut_ss", &self.ut_ss) ++ .field("ut_tv", &self.ut_tv) ++ // FIXME .field("ut_pad", &self.ut_pad) ++ .finish() ++ } ++ } ++ ++ impl ::hash::Hash for utmpx { ++ fn hash(&self, state: &mut H) { ++ self.ut_name.hash(state); ++ self.ut_type.hash(state); ++ self.ut_pid.hash(state); ++ self.ut_line.hash(state); ++ self.ut_id.hash(state); ++ self.ut_host.hash(state); ++ self.ut_exit.hash(state); ++ self.ut_session.hash(state); ++ self.ut_tv.hash(state); ++ self.ut_ss.hash(state); ++ self.ut_pad.hash(state); ++ } ++ } ++ ++ impl PartialEq for lastlogx { ++ fn eq(&self, other: &lastlogx) -> bool { ++ self.ll_tv == other.ll_tv ++ && self.ll_line == other.ll_line ++ && self.ll_ss == other.ll_ss ++ && self ++ .ll_host ++ .iter() ++ .zip(other.ll_host.iter()) ++ .all(|(a,b)| a == b) ++ } ++ } ++ ++ impl Eq for lastlogx {} ++ ++ impl ::fmt::Debug for lastlogx { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("lastlogx") ++ .field("ll_tv", &self.ll_tv) ++ .field("ll_line", &self.ll_line) ++ // FIXME.field("ll_host", &self.ll_host) ++ .field("ll_ss", &self.ll_ss) ++ .finish() ++ } ++ } ++ ++ impl ::hash::Hash for lastlogx { ++ fn hash(&self, state: &mut H) { ++ self.ll_tv.hash(state); ++ self.ll_line.hash(state); ++ self.ll_host.hash(state); ++ self.ll_ss.hash(state); ++ } ++ } ++ + impl PartialEq for in_pktinfo { + fn eq(&self, other: &in_pktinfo) -> bool { + self.ipi_addr == other.ipi_addr +@@ -700,12 +894,12 @@ pub const AT_REMOVEDIR: ::c_int = 0x800; + pub const EXTATTR_NAMESPACE_USER: ::c_int = 1; + pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2; + +-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_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; +@@ -719,12 +913,13 @@ 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_DIRECTORY: ::c_int = 0x200000; +-pub const O_DIRECT : ::c_int = 0x00080000; +-pub const O_RSYNC : ::c_int = 0x00020000; ++pub const O_DIRECT: ::c_int = 0x00080000; ++pub const O_RSYNC: ::c_int = 0x00020000; + +-pub const MS_SYNC : ::c_int = 0x4; +-pub const MS_INVALIDATE : ::c_int = 0x2; ++pub const MS_SYNC: ::c_int = 0x4; ++pub const MS_INVALIDATE: ::c_int = 0x2; + ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] + pub const RLIM_NLIMITS: ::c_int = 12; + + pub const EIDRM: ::c_int = 82; +@@ -744,7 +939,7 @@ pub const ENOLINK: ::c_int = 95; + pub const EPROTO: ::c_int = 96; + pub const ELAST: ::c_int = 96; + +-pub const F_DUPFD_CLOEXEC : ::c_int = 12; ++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; +@@ -758,13 +953,13 @@ pub const IP_RECVPKTINFO: ::c_int = 26; + pub const IPV6_JOIN_GROUP: ::c_int = 12; + pub const IPV6_LEAVE_GROUP: ::c_int = 13; + +-pub const TCP_KEEPIDLE: ::c_int = 3; ++pub const TCP_KEEPIDLE: ::c_int = 3; + pub const TCP_KEEPINTVL: ::c_int = 5; +-pub const TCP_KEEPCNT: ::c_int = 6; +-pub const TCP_KEEPINIT: ::c_int = 7; +-pub const TCP_INFO: ::c_int = 9; +-pub const TCP_MD5SIG: ::c_int = 0x10; +-pub const TCP_CONGCTL: ::c_int = 0x20; ++pub const TCP_KEEPCNT: ::c_int = 6; ++pub const TCP_KEEPINIT: ::c_int = 7; ++pub const TCP_INFO: ::c_int = 9; ++pub const TCP_MD5SIG: ::c_int = 0x10; ++pub const TCP_CONGCTL: ::c_int = 0x20; + + pub const SOCK_CONN_DGRAM: ::c_int = 6; + pub const SOCK_DCCP: ::c_int = SOCK_CONN_DGRAM; +@@ -905,18 +1100,18 @@ pub const MSG_NOTIFICATION: ::c_int = 0x4000; + pub const SCM_TIMESTAMP: ::c_int = 0x08; + pub const SCM_CREDS: ::c_int = 0x10; + +-pub const O_DSYNC : ::c_int = 0x10000; ++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_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 DCCP_TYPE_REQUEST: ::c_int = 0; + pub const DCCP_TYPE_RESPONSE: ::c_int = 1; + pub const DCCP_TYPE_DATA: ::c_int = 2; + pub const DCCP_TYPE_ACK: ::c_int = 3; +-pub const DCCP_TYPE_DATAACK: ::c_int = 4; ++pub const DCCP_TYPE_DATAACK: ::c_int = 4; + pub const DCCP_TYPE_CLOSEREQ: ::c_int = 5; + pub const DCCP_TYPE_CLOSE: ::c_int = 6; + pub const DCCP_TYPE_RESET: ::c_int = 7; +@@ -924,12 +1119,12 @@ pub const DCCP_TYPE_MOVE: ::c_int = 8; + + pub const DCCP_FEATURE_CC: ::c_int = 1; + pub const DCCP_FEATURE_ECN: ::c_int = 2; +-pub const DCCP_FEATURE_ACKRATIO: ::c_int = 3; ++pub const DCCP_FEATURE_ACKRATIO: ::c_int = 3; + pub const DCCP_FEATURE_ACKVECTOR: ::c_int = 4; +-pub const DCCP_FEATURE_MOBILITY: ::c_int = 5; ++pub const DCCP_FEATURE_MOBILITY: ::c_int = 5; + pub const DCCP_FEATURE_LOSSWINDOW: ::c_int = 6; + pub const DCCP_FEATURE_CONN_NONCE: ::c_int = 8; +-pub const DCCP_FEATURE_IDENTREG: ::c_int = 7; ++pub const DCCP_FEATURE_IDENTREG: ::c_int = 7; + + pub const DCCP_OPT_PADDING: ::c_int = 0; + pub const DCCP_OPT_DATA_DISCARD: ::c_int = 1; +@@ -971,100 +1166,159 @@ pub const DCCP_SEQ_NUM_LIMIT: ::c_int = 16777216; + pub const DCCP_MAX_OPTIONS: ::c_int = 32; + pub const DCCP_MAX_PKTS: ::c_int = 100; + +-pub const _PC_LINK_MAX : ::c_int = 1; +-pub const _PC_MAX_CANON : ::c_int = 2; +-pub const _PC_MAX_INPUT : ::c_int = 3; +-pub const _PC_NAME_MAX : ::c_int = 4; +-pub const _PC_PATH_MAX : ::c_int = 5; +-pub const _PC_PIPE_BUF : ::c_int = 6; +-pub const _PC_CHOWN_RESTRICTED : ::c_int = 7; +-pub const _PC_NO_TRUNC : ::c_int = 8; +-pub const _PC_VDISABLE : ::c_int = 9; +-pub const _PC_SYNC_IO : ::c_int = 10; +-pub const _PC_FILESIZEBITS : ::c_int = 11; +-pub const _PC_SYMLINK_MAX : ::c_int = 12; +-pub const _PC_2_SYMLINKS : ::c_int = 13; +-pub const _PC_ACL_EXTENDED : ::c_int = 14; +-pub const _PC_MIN_HOLE_SIZE : ::c_int = 15; +- +-pub const _SC_SYNCHRONIZED_IO : ::c_int = 31; +-pub const _SC_IOV_MAX : ::c_int = 32; +-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_LOGIN_NAME_MAX : ::c_int = 37; +-pub const _SC_MONOTONIC_CLOCK : ::c_int = 38; +-pub const _SC_CLK_TCK : ::c_int = 39; +-pub const _SC_ATEXIT_MAX : ::c_int = 40; +-pub const _SC_THREADS : ::c_int = 41; +-pub const _SC_SEMAPHORES : ::c_int = 42; +-pub const _SC_BARRIERS : ::c_int = 43; +-pub const _SC_TIMERS : ::c_int = 44; +-pub const _SC_SPIN_LOCKS : ::c_int = 45; +-pub const _SC_READER_WRITER_LOCKS : ::c_int = 46; +-pub const _SC_GETGR_R_SIZE_MAX : ::c_int = 47; +-pub const _SC_GETPW_R_SIZE_MAX : ::c_int = 48; +-pub const _SC_CLOCK_SELECTION : ::c_int = 49; +-pub const _SC_ASYNCHRONOUS_IO : ::c_int = 50; +-pub const _SC_AIO_LISTIO_MAX : ::c_int = 51; +-pub const _SC_AIO_MAX : ::c_int = 52; +-pub const _SC_MESSAGE_PASSING : ::c_int = 53; +-pub const _SC_MQ_OPEN_MAX : ::c_int = 54; +-pub const _SC_MQ_PRIO_MAX : ::c_int = 55; +-pub const _SC_PRIORITY_SCHEDULING : ::c_int = 56; +-pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : ::c_int = 57; +-pub const _SC_THREAD_KEYS_MAX : ::c_int = 58; +-pub const _SC_THREAD_STACK_MIN : ::c_int = 59; +-pub const _SC_THREAD_THREADS_MAX : ::c_int = 60; +-pub const _SC_THREAD_ATTR_STACKADDR : ::c_int = 61; +-pub const _SC_THREAD_ATTR_STACKSIZE : ::c_int = 62; +-pub const _SC_THREAD_PRIORITY_SCHEDULING : ::c_int = 63; +-pub const _SC_THREAD_PRIO_INHERIT : ::c_int = 64; +-pub const _SC_THREAD_PRIO_PROTECT : ::c_int = 65; +-pub const _SC_THREAD_PROCESS_SHARED : ::c_int = 66; +-pub const _SC_THREAD_SAFE_FUNCTIONS : ::c_int = 67; +-pub const _SC_TTY_NAME_MAX : ::c_int = 68; +-pub const _SC_HOST_NAME_MAX : ::c_int = 69; +-pub const _SC_PASS_MAX : ::c_int = 70; +-pub const _SC_REGEXP : ::c_int = 71; +-pub const _SC_SHELL : ::c_int = 72; +-pub const _SC_SYMLOOP_MAX : ::c_int = 73; +-pub const _SC_V6_ILP32_OFF32 : ::c_int = 74; +-pub const _SC_V6_ILP32_OFFBIG : ::c_int = 75; +-pub const _SC_V6_LP64_OFF64 : ::c_int = 76; +-pub const _SC_V6_LPBIG_OFFBIG : ::c_int = 77; +-pub const _SC_2_PBS : ::c_int = 80; +-pub const _SC_2_PBS_ACCOUNTING : ::c_int = 81; +-pub const _SC_2_PBS_CHECKPOINT : ::c_int = 82; +-pub const _SC_2_PBS_LOCATE : ::c_int = 83; +-pub const _SC_2_PBS_MESSAGE : ::c_int = 84; +-pub const _SC_2_PBS_TRACK : ::c_int = 85; +-pub const _SC_SPAWN : ::c_int = 86; +-pub const _SC_SHARED_MEMORY_OBJECTS : ::c_int = 87; +-pub const _SC_TIMER_MAX : ::c_int = 88; +-pub const _SC_SEM_NSEMS_MAX : ::c_int = 89; +-pub const _SC_CPUTIME : ::c_int = 90; +-pub const _SC_THREAD_CPUTIME : ::c_int = 91; +-pub const _SC_DELAYTIMER_MAX : ::c_int = 92; ++pub const _PC_LINK_MAX: ::c_int = 1; ++pub const _PC_MAX_CANON: ::c_int = 2; ++pub const _PC_MAX_INPUT: ::c_int = 3; ++pub const _PC_NAME_MAX: ::c_int = 4; ++pub const _PC_PATH_MAX: ::c_int = 5; ++pub const _PC_PIPE_BUF: ::c_int = 6; ++pub const _PC_CHOWN_RESTRICTED: ::c_int = 7; ++pub const _PC_NO_TRUNC: ::c_int = 8; ++pub const _PC_VDISABLE: ::c_int = 9; ++pub const _PC_SYNC_IO: ::c_int = 10; ++pub const _PC_FILESIZEBITS: ::c_int = 11; ++pub const _PC_SYMLINK_MAX: ::c_int = 12; ++pub const _PC_2_SYMLINKS: ::c_int = 13; ++pub const _PC_ACL_EXTENDED: ::c_int = 14; ++pub const _PC_MIN_HOLE_SIZE: ::c_int = 15; ++ ++pub const _SC_SYNCHRONIZED_IO: ::c_int = 31; ++pub const _SC_IOV_MAX: ::c_int = 32; ++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_LOGIN_NAME_MAX: ::c_int = 37; ++pub const _SC_MONOTONIC_CLOCK: ::c_int = 38; ++pub const _SC_CLK_TCK: ::c_int = 39; ++pub const _SC_ATEXIT_MAX: ::c_int = 40; ++pub const _SC_THREADS: ::c_int = 41; ++pub const _SC_SEMAPHORES: ::c_int = 42; ++pub const _SC_BARRIERS: ::c_int = 43; ++pub const _SC_TIMERS: ::c_int = 44; ++pub const _SC_SPIN_LOCKS: ::c_int = 45; ++pub const _SC_READER_WRITER_LOCKS: ::c_int = 46; ++pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 47; ++pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 48; ++pub const _SC_CLOCK_SELECTION: ::c_int = 49; ++pub const _SC_ASYNCHRONOUS_IO: ::c_int = 50; ++pub const _SC_AIO_LISTIO_MAX: ::c_int = 51; ++pub const _SC_AIO_MAX: ::c_int = 52; ++pub const _SC_MESSAGE_PASSING: ::c_int = 53; ++pub const _SC_MQ_OPEN_MAX: ::c_int = 54; ++pub const _SC_MQ_PRIO_MAX: ::c_int = 55; ++pub const _SC_PRIORITY_SCHEDULING: ::c_int = 56; ++pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 57; ++pub const _SC_THREAD_KEYS_MAX: ::c_int = 58; ++pub const _SC_THREAD_STACK_MIN: ::c_int = 59; ++pub const _SC_THREAD_THREADS_MAX: ::c_int = 60; ++pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 61; ++pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 62; ++pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 63; ++pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 64; ++pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 65; ++pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 66; ++pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 67; ++pub const _SC_TTY_NAME_MAX: ::c_int = 68; ++pub const _SC_HOST_NAME_MAX: ::c_int = 69; ++pub const _SC_PASS_MAX: ::c_int = 70; ++pub const _SC_REGEXP: ::c_int = 71; ++pub const _SC_SHELL: ::c_int = 72; ++pub const _SC_SYMLOOP_MAX: ::c_int = 73; ++pub const _SC_V6_ILP32_OFF32: ::c_int = 74; ++pub const _SC_V6_ILP32_OFFBIG: ::c_int = 75; ++pub const _SC_V6_LP64_OFF64: ::c_int = 76; ++pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 77; ++pub const _SC_2_PBS: ::c_int = 80; ++pub const _SC_2_PBS_ACCOUNTING: ::c_int = 81; ++pub const _SC_2_PBS_CHECKPOINT: ::c_int = 82; ++pub const _SC_2_PBS_LOCATE: ::c_int = 83; ++pub const _SC_2_PBS_MESSAGE: ::c_int = 84; ++pub const _SC_2_PBS_TRACK: ::c_int = 85; ++pub const _SC_SPAWN: ::c_int = 86; ++pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 87; ++pub const _SC_TIMER_MAX: ::c_int = 88; ++pub const _SC_SEM_NSEMS_MAX: ::c_int = 89; ++pub const _SC_CPUTIME: ::c_int = 90; ++pub const _SC_THREAD_CPUTIME: ::c_int = 91; ++pub const _SC_DELAYTIMER_MAX: ::c_int = 92; + // These two variables will be supported in NetBSD 8.0 + // pub const _SC_SIGQUEUE_MAX : ::c_int = 93; + // pub const _SC_REALTIME_SIGNALS : ::c_int = 94; +-pub const _SC_PHYS_PAGES : ::c_int = 121; +-pub const _SC_NPROCESSORS_CONF : ::c_int = 1001; +-pub const _SC_NPROCESSORS_ONLN : ::c_int = 1002; +-pub const _SC_SCHED_RT_TS : ::c_int = 2001; +-pub const _SC_SCHED_PRI_MIN : ::c_int = 2002; +-pub const _SC_SCHED_PRI_MAX : ::c_int = 2003; ++pub const _SC_PHYS_PAGES: ::c_int = 121; ++pub const _SC_NPROCESSORS_CONF: ::c_int = 1001; ++pub const _SC_NPROCESSORS_ONLN: ::c_int = 1002; ++pub const _SC_SCHED_RT_TS: ::c_int = 2001; ++pub const _SC_SCHED_PRI_MIN: ::c_int = 2002; ++pub const _SC_SCHED_PRI_MAX: ::c_int = 2003; + + pub const FD_SETSIZE: usize = 0x100; + + pub const ST_NOSUID: ::c_ulong = 8; + ++pub const BIOCGRSIG: ::c_ulong = 0x40044272; ++pub const BIOCSRSIG: ::c_ulong = 0x80044273; ++pub const BIOCSDLT: ::c_ulong = 0x80044278; ++pub const BIOCGSEESENT: ::c_ulong = 0x40044276; ++pub const BIOCSSEESENT: ::c_ulong = 0x80044277; ++ ++// ++pub const NTP_API: ::c_int = 4; ++pub const MAXPHASE: ::c_long = 500000000; ++pub const MAXFREQ: ::c_long = 500000; ++pub const MINSEC: ::c_int = 256; ++pub const MAXSEC: ::c_int = 2048; ++pub const NANOSECOND: ::c_long = 1000000000; ++pub const SCALE_PPM: ::c_int = 65; ++pub const MAXTC: ::c_int = 10; ++pub const MOD_OFFSET: ::c_uint = 0x0001; ++pub const MOD_FREQUENCY: ::c_uint = 0x0002; ++pub const MOD_MAXERROR: ::c_uint = 0x0004; ++pub const MOD_ESTERROR: ::c_uint = 0x0008; ++pub const MOD_STATUS: ::c_uint = 0x0010; ++pub const MOD_TIMECONST: ::c_uint = 0x0020; ++pub const MOD_PPSMAX: ::c_uint = 0x0040; ++pub const MOD_TAI: ::c_uint = 0x0080; ++pub const MOD_MICRO: ::c_uint = 0x1000; ++pub const MOD_NANO: ::c_uint = 0x2000; ++pub const MOD_CLKB: ::c_uint = 0x4000; ++pub const MOD_CLKA: ::c_uint = 0x8000; ++pub const STA_PLL: ::c_int = 0x0001; ++pub const STA_PPSFREQ: ::c_int = 0x0002; ++pub const STA_PPSTIME: ::c_int = 0x0004; ++pub const STA_FLL: ::c_int = 0x0008; ++pub const STA_INS: ::c_int = 0x0010; ++pub const STA_DEL: ::c_int = 0x0020; ++pub const STA_UNSYNC: ::c_int = 0x0040; ++pub const STA_FREQHOLD: ::c_int = 0x0080; ++pub const STA_PPSSIGNAL: ::c_int = 0x0100; ++pub const STA_PPSJITTER: ::c_int = 0x0200; ++pub const STA_PPSWANDER: ::c_int = 0x0400; ++pub const STA_PPSERROR: ::c_int = 0x0800; ++pub const STA_CLOCKERR: ::c_int = 0x1000; ++pub const STA_NANO: ::c_int = 0x2000; ++pub const STA_MODE: ::c_int = 0x4000; ++pub const STA_CLK: ::c_int = 0x8000; ++pub const STA_RONLY: ::c_int = STA_PPSSIGNAL ++ | STA_PPSJITTER ++ | STA_PPSWANDER ++ | STA_PPSERROR ++ | STA_CLOCKERR ++ | STA_NANO ++ | STA_MODE ++ | STA_CLK; ++pub const TIME_OK: ::c_int = 0; ++pub const TIME_INS: ::c_int = 1; ++pub const TIME_DEL: ::c_int = 2; ++pub const TIME_OOP: ::c_int = 3; ++pub const TIME_WAIT: ::c_int = 4; ++pub const TIME_ERROR: ::c_int = 5; ++ + cfg_if! { + if #[cfg(any(target_arch = "sparc", target_arch = "sparc64", + target_arch = "x86", target_arch = "x86_64"))] { +- pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t ++ = pthread_mutex_t { + ptm_magic: 0x33330003, + ptm_errorcheck: 0, + ptm_pad1: [0; 3], +@@ -1076,7 +1330,8 @@ cfg_if! { + ptm_spare2: 0 as *mut _, + }; + } else { +- pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t ++ = pthread_mutex_t { + ptm_magic: 0x33330003, + ptm_errorcheck: 0, + ptm_unused: 0, +@@ -1150,7 +1405,7 @@ pub const NOTE_TRACK: u32 = 0x00000001; + pub const NOTE_TRACKERR: u32 = 0x00000002; + pub const NOTE_CHILD: u32 = 0x00000004; + +-pub const TMP_MAX : ::c_uint = 308915776; ++pub const TMP_MAX: ::c_uint = 308915776; + + pub const NI_MAXHOST: ::socklen_t = 1025; + +@@ -1341,6 +1596,9 @@ pub const P_ALL: idtype_t = 0; + pub const P_PID: idtype_t = 1; + pub const P_PGID: idtype_t = 4; + ++pub const UTIME_OMIT: c_long = 1073741822; ++pub const UTIME_NOW: c_long = 1073741823; ++ + pub const B460800: ::speed_t = 460800; + pub const B921600: ::speed_t = 921600; + +@@ -1349,6 +1607,31 @@ pub const ONLRET: ::tcflag_t = 0x40; + pub const CDTRCTS: ::tcflag_t = 0x00020000; + pub const CHWFLOW: ::tcflag_t = ::MDMBUF | ::CRTSCTS | ::CDTRCTS; + ++// pub const _PATH_UTMPX: &[::c_char; 14] = b"/var/run/utmpx"; ++// pub const _PATH_WTMPX: &[::c_char; 14] = b"/var/log/wtmpx"; ++// pub const _PATH_LASTLOGX: &[::c_char; 17] = b"/var/log/lastlogx"; ++// pub const _PATH_UTMP_UPDATE: &[::c_char; 24] = b"/usr/libexec/utmp_update"; ++pub const UT_NAMESIZE: usize = 8; ++pub const UT_LINESIZE: usize = 8; ++pub const UT_HOSTSIZE: usize = 16; ++pub const _UTX_USERSIZE: usize = 32; ++pub const _UTX_LINESIZE: usize = 32; ++pub const _UTX_PADSIZE: usize = 40; ++pub const _UTX_IDSIZE: usize = 4; ++pub const _UTX_HOSTSIZE: usize = 256; ++pub const EMPTY: u16 = 0; ++pub const RUN_LVL: u16 = 1; ++pub const BOOT_TIME: u16 = 2; ++pub const OLD_TIME: u16 = 3; ++pub const NEW_TIME: u16 = 4; ++pub const INIT_PROCESS: u16 = 5; ++pub const LOGIN_PROCESS: u16 = 6; ++pub const USER_PROCESS: u16 = 7; ++pub const DEAD_PROCESS: u16 = 8; ++pub const ACCOUNTING: u16 = 9; ++pub const SIGNATURE: u16 = 10; ++pub const DOWN_TIME: u16 = 11; ++ + pub const SOCK_CLOEXEC: ::c_int = 0x10000000; + pub const SOCK_NONBLOCK: ::c_int = 0x20000000; + +@@ -1361,7 +1644,9 @@ pub const FIONWRITE: ::c_ulong = 0x40046679; + pub const FIONSPACE: ::c_ulong = 0x40046678; + pub const FIBMAP: ::c_ulong = 0xc008667a; + +-pub const SIGSTKSZ : ::size_t = 40960; ++pub const SIGSTKSZ: ::size_t = 40960; ++ ++pub const REG_ENOSYS: ::c_int = 17; + + pub const PT_DUMPCORE: ::c_int = 12; + pub const PT_LWPINFO: ::c_int = 13; +@@ -1373,8 +1658,8 @@ pub const PT_GET_PROCESS_STATE: ::c_int = 18; + pub const PT_FIRSTMACH: ::c_int = 32; + + // Flags for chflags(2) +-pub const SF_SNAPSHOT: ::c_ulong = 0x00200000; +-pub const SF_LOG: ::c_ulong = 0x00400000; ++pub const SF_SNAPSHOT: ::c_ulong = 0x00200000; ++pub const SF_LOG: ::c_ulong = 0x00400000; + pub const SF_SNAPINVAL: ::c_ulong = 0x00800000; + + fn _ALIGN(p: usize) -> usize { +@@ -1447,186 +1732,306 @@ f! { + } + } + ++extern "C" { ++ pub fn ntp_adjtime(buf: *mut timex) -> ::c_int; ++ pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int; ++} ++ + #[link(name = "rt")] +-extern { ++extern "C" { + 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_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 lio_listio( ++ mode: ::c_int, ++ aiocb_list: *const *mut aiocb, ++ nitems: ::c_int, ++ sevp: *mut sigevent, ++ ) -> ::c_int; + } + +-extern { ++extern "C" { + pub fn chflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int; + pub fn fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int; + pub fn lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int; + +- pub fn extattr_delete_fd(fd: ::c_int, +- attrnamespace: ::c_int, +- attrname: *const ::c_char) -> ::c_int; +- pub fn extattr_delete_file(path: *const ::c_char, +- attrnamespace: ::c_int, +- attrname: *const ::c_char) -> ::c_int; +- pub fn extattr_delete_link(path: *const ::c_char, +- attrnamespace: ::c_int, +- attrname: *const ::c_char) -> ::c_int; +- pub fn extattr_get_fd(fd: ::c_int, +- attrnamespace: ::c_int, +- attrname: *const ::c_char, +- data: *mut ::c_void, +- nbytes: ::size_t) -> ::ssize_t; +- pub fn extattr_get_file(path: *const ::c_char, +- attrnamespace: ::c_int, +- attrname: *const ::c_char, +- data: *mut ::c_void, +- nbytes: ::size_t) -> ::ssize_t; +- pub fn extattr_get_link(path: *const ::c_char, +- attrnamespace: ::c_int, +- attrname: *const ::c_char, +- data: *mut ::c_void, +- nbytes: ::size_t) -> ::ssize_t; +- pub fn extattr_namespace_to_string(attrnamespace: ::c_int, +- string: *mut *mut ::c_char) -> ::c_int; +- pub fn extattr_set_fd(fd: ::c_int, +- attrnamespace: ::c_int, +- attrname: *const ::c_char, +- data: *const ::c_void, +- nbytes: ::size_t) -> ::c_int; +- pub fn extattr_set_file(path: *const ::c_char, +- attrnamespace: ::c_int, +- attrname: *const ::c_char, +- data: *const ::c_void, +- nbytes: ::size_t) -> ::c_int; +- pub fn extattr_set_link(path: *const ::c_char, +- attrnamespace: ::c_int, +- attrname: *const ::c_char, +- data: *const ::c_void, +- nbytes: ::size_t) -> ::c_int; +- pub fn extattr_string_to_namespace(string: *const ::c_char, +- attrnamespace: *mut ::c_int) -> ::c_int; ++ pub fn extattr_delete_fd( ++ fd: ::c_int, ++ attrnamespace: ::c_int, ++ attrname: *const ::c_char, ++ ) -> ::c_int; ++ pub fn extattr_delete_file( ++ path: *const ::c_char, ++ attrnamespace: ::c_int, ++ attrname: *const ::c_char, ++ ) -> ::c_int; ++ pub fn extattr_delete_link( ++ path: *const ::c_char, ++ attrnamespace: ::c_int, ++ attrname: *const ::c_char, ++ ) -> ::c_int; ++ pub fn extattr_get_fd( ++ fd: ::c_int, ++ attrnamespace: ::c_int, ++ attrname: *const ::c_char, ++ data: *mut ::c_void, ++ nbytes: ::size_t, ++ ) -> ::ssize_t; ++ pub fn extattr_get_file( ++ path: *const ::c_char, ++ attrnamespace: ::c_int, ++ attrname: *const ::c_char, ++ data: *mut ::c_void, ++ nbytes: ::size_t, ++ ) -> ::ssize_t; ++ pub fn extattr_get_link( ++ path: *const ::c_char, ++ attrnamespace: ::c_int, ++ attrname: *const ::c_char, ++ data: *mut ::c_void, ++ nbytes: ::size_t, ++ ) -> ::ssize_t; ++ pub fn extattr_namespace_to_string( ++ attrnamespace: ::c_int, ++ string: *mut *mut ::c_char, ++ ) -> ::c_int; ++ pub fn extattr_set_fd( ++ fd: ::c_int, ++ attrnamespace: ::c_int, ++ attrname: *const ::c_char, ++ data: *const ::c_void, ++ nbytes: ::size_t, ++ ) -> ::c_int; ++ pub fn extattr_set_file( ++ path: *const ::c_char, ++ attrnamespace: ::c_int, ++ attrname: *const ::c_char, ++ data: *const ::c_void, ++ nbytes: ::size_t, ++ ) -> ::c_int; ++ pub fn extattr_set_link( ++ path: *const ::c_char, ++ attrnamespace: ::c_int, ++ attrname: *const ::c_char, ++ data: *const ::c_void, ++ nbytes: ::size_t, ++ ) -> ::c_int; ++ pub fn extattr_string_to_namespace( ++ string: *const ::c_char, ++ attrnamespace: *mut ::c_int, ++ ) -> ::c_int; + + #[link_name = "__lutimes50"] + pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; + #[link_name = "__gettimeofday50"] +- pub fn gettimeofday(tp: *mut ::timeval, +- tz: *mut ::c_void) -> ::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; ++ pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::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; ++ 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 mount( ++ src: *const ::c_char, ++ target: *const ::c_char, ++ flags: ::c_int, ++ data: *mut ::c_void, ++ size: ::size_t, ++ ) -> ::c_int; + pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t; + pub fn mq_close(mqd: ::mqd_t) -> ::c_int; + pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int; +- pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int; +- pub fn mq_receive(mqd: ::mqd_t, +- msg_ptr: *mut ::c_char, +- msg_len: ::size_t, +- msq_prio: *mut ::c_uint) -> ::ssize_t; +- pub fn mq_send(mqd: ::mqd_t, +- msg_ptr: *const ::c_char, +- msg_len: ::size_t, +- msq_prio: ::c_uint) -> ::c_int; +- pub fn mq_setattr(mqd: ::mqd_t, +- newattr: *const ::mq_attr, +- oldattr: *mut ::mq_attr) -> ::c_int; ++ pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) ++ -> ::c_int; ++ pub fn mq_receive( ++ mqd: ::mqd_t, ++ msg_ptr: *mut ::c_char, ++ msg_len: ::size_t, ++ msg_prio: *mut ::c_uint, ++ ) -> ::ssize_t; ++ pub fn mq_send( ++ mqd: ::mqd_t, ++ msg_ptr: *const ::c_char, ++ msg_len: ::size_t, ++ msg_prio: ::c_uint, ++ ) -> ::c_int; ++ pub fn mq_setattr( ++ mqd: ::mqd_t, ++ newattr: *const ::mq_attr, ++ oldattr: *mut ::mq_attr, ++ ) -> ::c_int; + #[link_name = "__mq_timedreceive50"] +- pub fn mq_timedreceive(mqd: ::mqd_t, +- msg_ptr: *mut ::c_char, +- msg_len: ::size_t, +- msq_prio: *mut ::c_uint, +- abs_timeout: *const ::timespec) -> ::ssize_t; ++ pub fn mq_timedreceive( ++ mqd: ::mqd_t, ++ msg_ptr: *mut ::c_char, ++ msg_len: ::size_t, ++ msg_prio: *mut ::c_uint, ++ abs_timeout: *const ::timespec, ++ ) -> ::ssize_t; + #[link_name = "__mq_timedsend50"] +- pub fn mq_timedsend(mqd: ::mqd_t, +- msg_ptr: *const ::c_char, +- msg_len: ::size_t, +- msq_prio: ::c_uint, +- abs_timeout: *const ::timespec) -> ::c_int; ++ pub fn mq_timedsend( ++ mqd: ::mqd_t, ++ msg_ptr: *const ::c_char, ++ msg_len: ::size_t, ++ msg_prio: ::c_uint, ++ abs_timeout: *const ::timespec, ++ ) -> ::c_int; + pub fn mq_unlink(name: *const ::c_char) -> ::c_int; +- pub fn ptrace(request: ::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; ++ pub fn ptrace( ++ request: ::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: *const ::c_void, ++ ) -> ::c_int; ++ pub fn pthread_attr_get_np( ++ thread: ::pthread_t, ++ attr: *mut ::pthread_attr_t, ++ ) -> ::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 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; ++ pub fn newlocale( ++ mask: ::c_int, ++ locale: *const ::c_char, ++ base: ::locale_t, ++ ) -> ::locale_t; + #[link_name = "__settimeofday50"] + pub fn settimeofday(tv: *const ::timeval, tz: *const ::c_void) -> ::c_int; + + pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int; + +- pub fn sendmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, +- flags: ::c_int) -> ::c_int; +- pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, +- flags: ::c_int, timeout: *mut ::timespec) -> ::c_int; ++ pub fn sendmmsg( ++ sockfd: ::c_int, ++ msgvec: *mut ::mmsghdr, ++ vlen: ::c_uint, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn recvmmsg( ++ sockfd: ::c_int, ++ msgvec: *mut ::mmsghdr, ++ vlen: ::c_uint, ++ flags: ::c_int, ++ timeout: *mut ::timespec, ++ ) -> ::c_int; ++ ++ pub fn _lwp_self() -> lwpid_t; ++ pub fn memmem( ++ haystack: *const ::c_void, ++ haystacklen: ::size_t, ++ needle: *const ::c_void, ++ needlelen: ::size_t, ++ ) -> *mut ::c_void; + } + + #[link(name = "util")] +-extern { ++extern "C" { + #[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")] +- pub fn getpwent_r(pwd: *mut ::passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::passwd) -> ::c_int; +- pub fn getgrent_r(grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; ++ pub fn getpwent_r( ++ pwd: *mut ::passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::passwd, ++ ) -> ::c_int; ++ pub fn getgrent_r( ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; ++ ++ pub fn updwtmpx(file: *const ::c_char, ut: *const utmpx) -> ::c_int; ++ pub fn getlastlogx( ++ fname: *const ::c_char, ++ uid: ::uid_t, ++ ll: *mut lastlogx, ++ ) -> *mut lastlogx; ++ pub fn updlastlogx( ++ fname: *const ::c_char, ++ uid: ::uid_t, ++ ll: *mut lastlogx, ++ ) -> ::c_int; ++ 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 getutmp(ux: *const utmpx, u: *mut utmp); ++ pub fn getutmpx(u: *const utmp, ux: *mut utmpx); ++ ++ pub fn utpname(file: *const ::c_char) -> ::c_int; ++ pub fn setutent(); ++ pub fn endutent(); ++ pub fn getutent() -> *mut utmp; + } + + cfg_if! { +diff --git a/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs b/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs +index 6a8cbb5c4f7ea7ba0449a8eafa42d42b782146bc..99350ec8dc3d464e360e5b8cab37425905f88e3f 100644 +--- a/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs ++++ b/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs +@@ -12,3 +12,5 @@ cfg_if! { + pub const _ALIGNBYTES: usize = 8 - 1; + } + } ++ ++pub const _MAX_PAGE_SHIFT: u32 = 12; +diff --git a/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs b/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs +index fbb2252910f765a1b56af04172837e6a843f4e7d..02a1b05996ea8771d2161cebd604e4818697f4be 100644 +--- a/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs ++++ b/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs +@@ -306,6 +306,36 @@ s! { + pub ar_pln: u8, + pub ar_op: u16, + } ++ ++ pub struct shmid_ds { ++ pub shm_perm: ::ipc_perm, ++ pub shm_segsz: ::c_int, ++ pub shm_lpid: ::pid_t, ++ pub shm_cpid: ::pid_t, ++ pub shm_nattch: ::c_short, ++ pub shm_atime: ::time_t, ++ __shm_atimensec: c_long, ++ pub shm_dtime: ::time_t, ++ __shm_dtimensec: c_long, ++ pub shm_ctime: ::time_t, ++ __shm_ctimensec: c_long, ++ pub shm_internal: *mut ::c_void, ++ } ++} ++ ++impl siginfo_t { ++ pub unsafe fn si_value(&self) -> ::sigval { ++ #[repr(C)] ++ struct siginfo_timer { ++ _si_signo: ::c_int, ++ _si_errno: ::c_int, ++ _si_code: ::c_int, ++ _pid: ::pid_t, ++ _uid: ::uid_t, ++ value: ::sigval, ++ } ++ (*(self as *const siginfo_t as *const siginfo_timer)).value ++ } + } + + s_no_extra_traits! { +@@ -713,25 +743,28 @@ pub const O_CLOEXEC: ::c_int = 0x10000; + pub const O_DIRECTORY: ::c_int = 0x20000; + pub const O_RSYNC: ::c_int = O_SYNC; + +-pub const MS_SYNC : ::c_int = 0x0002; +-pub const MS_INVALIDATE : ::c_int = 0x0004; ++pub const MS_SYNC: ::c_int = 0x0002; ++pub const MS_INVALIDATE: ::c_int = 0x0004; + + pub const POLLNORM: ::c_short = ::POLLRDNORM; + +-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 EBADMSG : ::c_int = 92; +-pub const ENOTRECOVERABLE : ::c_int = 93; +-pub const EOWNERDEAD : ::c_int = 94; +-pub const EPROTO : ::c_int = 95; +-pub const ELAST : ::c_int = 95; +- +-pub const F_DUPFD_CLOEXEC : ::c_int = 10; ++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 EBADMSG: ::c_int = 92; ++pub const ENOTRECOVERABLE: ::c_int = 93; ++pub const EOWNERDEAD: ::c_int = 94; ++pub const EPROTO: ::c_int = 95; ++pub const ELAST: ::c_int = 95; ++ ++pub const F_DUPFD_CLOEXEC: ::c_int = 10; ++ ++pub const UTIME_OMIT: c_long = -1; ++pub const UTIME_NOW: c_long = -2; + + pub const AT_FDCWD: ::c_int = -100; + pub const AT_EACCESS: ::c_int = 0x01; +@@ -739,6 +772,7 @@ pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x02; + pub const AT_SYMLINK_FOLLOW: ::c_int = 0x04; + pub const AT_REMOVEDIR: ::c_int = 0x08; + ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] + pub const RLIM_NLIMITS: ::c_int = 9; + + pub const SO_TIMESTAMP: ::c_int = 0x0800; +@@ -812,8 +846,7 @@ pub const IPPROTO_MPLS: ::c_int = 137; + pub const IPPROTO_PFSYNC: ::c_int = 240; + pub const IPPROTO_MAX: ::c_int = 256; + +-/* Only used internally, so it can be outside the range of valid IP protocols */ +-/// Divert sockets ++// Only used internally, so it can be outside the range of valid IP protocols + pub const IPPROTO_DIVERT: ::c_int = 258; + + pub const IP_RECVDSTADDR: ::c_int = 7; +@@ -859,15 +892,15 @@ pub const PF_PIPEX: ::c_int = pseudo_AF_PIPEX; + + pub const SCM_TIMESTAMP: ::c_int = 0x04; + +-pub const O_DSYNC : ::c_int = 128; ++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 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 EIPSEC: ::c_int = 82; ++pub const ENOMEDIUM: ::c_int = 85; ++pub const EMEDIUMTYPE: ::c_int = 86; + + pub const EAI_BADFLAGS: ::c_int = -1; + pub const EAI_NONAME: ::c_int = -2; +@@ -883,131 +916,131 @@ pub const EAI_OVERFLOW: ::c_int = -14; + + pub const RUSAGE_THREAD: ::c_int = 1; + +-pub const MAP_COPY : ::c_int = 0x0002; +-pub const MAP_NOEXTEND : ::c_int = 0x0000; +- +-pub const _PC_LINK_MAX : ::c_int = 1; +-pub const _PC_MAX_CANON : ::c_int = 2; +-pub const _PC_MAX_INPUT : ::c_int = 3; +-pub const _PC_NAME_MAX : ::c_int = 4; +-pub const _PC_PATH_MAX : ::c_int = 5; +-pub const _PC_PIPE_BUF : ::c_int = 6; +-pub const _PC_CHOWN_RESTRICTED : ::c_int = 7; +-pub const _PC_NO_TRUNC : ::c_int = 8; +-pub const _PC_VDISABLE : ::c_int = 9; +-pub const _PC_2_SYMLINKS : ::c_int = 10; +-pub const _PC_ALLOC_SIZE_MIN : ::c_int = 11; +-pub const _PC_ASYNC_IO : ::c_int = 12; +-pub const _PC_FILESIZEBITS : ::c_int = 13; +-pub const _PC_PRIO_IO : ::c_int = 14; +-pub const _PC_REC_INCR_XFER_SIZE : ::c_int = 15; +-pub const _PC_REC_MAX_XFER_SIZE : ::c_int = 16; +-pub const _PC_REC_MIN_XFER_SIZE : ::c_int = 17; +-pub const _PC_REC_XFER_ALIGN : ::c_int = 18; +-pub const _PC_SYMLINK_MAX : ::c_int = 19; +-pub const _PC_SYNC_IO : ::c_int = 20; +-pub const _PC_TIMESTAMP_RESOLUTION : ::c_int = 21; +- +-pub const _SC_CLK_TCK : ::c_int = 3; +-pub const _SC_SEM_NSEMS_MAX : ::c_int = 31; +-pub const _SC_SEM_VALUE_MAX : ::c_int = 32; +-pub const _SC_HOST_NAME_MAX : ::c_int = 33; +-pub const _SC_MONOTONIC_CLOCK : ::c_int = 34; +-pub const _SC_2_PBS : ::c_int = 35; +-pub const _SC_2_PBS_ACCOUNTING : ::c_int = 36; +-pub const _SC_2_PBS_CHECKPOINT : ::c_int = 37; +-pub const _SC_2_PBS_LOCATE : ::c_int = 38; +-pub const _SC_2_PBS_MESSAGE : ::c_int = 39; +-pub const _SC_2_PBS_TRACK : ::c_int = 40; +-pub const _SC_ADVISORY_INFO : ::c_int = 41; +-pub const _SC_AIO_LISTIO_MAX : ::c_int = 42; +-pub const _SC_AIO_MAX : ::c_int = 43; +-pub const _SC_AIO_PRIO_DELTA_MAX : ::c_int = 44; +-pub const _SC_ASYNCHRONOUS_IO : ::c_int = 45; +-pub const _SC_ATEXIT_MAX : ::c_int = 46; +-pub const _SC_BARRIERS : ::c_int = 47; +-pub const _SC_CLOCK_SELECTION : ::c_int = 48; +-pub const _SC_CPUTIME : ::c_int = 49; +-pub const _SC_DELAYTIMER_MAX : ::c_int = 50; +-pub const _SC_IOV_MAX : ::c_int = 51; +-pub const _SC_IPV6 : ::c_int = 52; +-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_MQ_PRIO_MAX : ::c_int = 59; +-pub const _SC_PRIORITIZED_IO : ::c_int = 60; +-pub const _SC_PRIORITY_SCHEDULING : ::c_int = 61; +-pub const _SC_RAW_SOCKETS : ::c_int = 62; +-pub const _SC_READER_WRITER_LOCKS : ::c_int = 63; +-pub const _SC_REALTIME_SIGNALS : ::c_int = 64; +-pub const _SC_REGEXP : ::c_int = 65; +-pub const _SC_RTSIG_MAX : ::c_int = 66; +-pub const _SC_SEMAPHORES : ::c_int = 67; +-pub const _SC_SHARED_MEMORY_OBJECTS : ::c_int = 68; +-pub const _SC_SHELL : ::c_int = 69; +-pub const _SC_SIGQUEUE_MAX : ::c_int = 70; +-pub const _SC_SPAWN : ::c_int = 71; +-pub const _SC_SPIN_LOCKS : ::c_int = 72; +-pub const _SC_SPORADIC_SERVER : ::c_int = 73; +-pub const _SC_SS_REPL_MAX : ::c_int = 74; +-pub const _SC_SYNCHRONIZED_IO : ::c_int = 75; +-pub const _SC_SYMLOOP_MAX : ::c_int = 76; +-pub const _SC_THREAD_ATTR_STACKADDR : ::c_int = 77; +-pub const _SC_THREAD_ATTR_STACKSIZE : ::c_int = 78; +-pub const _SC_THREAD_CPUTIME : ::c_int = 79; +-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_ROBUST_PRIO_INHERIT : ::c_int = 86; +-pub const _SC_THREAD_ROBUST_PRIO_PROTECT : ::c_int = 87; +-pub const _SC_THREAD_SPORADIC_SERVER : ::c_int = 88; +-pub const _SC_THREAD_STACK_MIN : ::c_int = 89; +-pub const _SC_THREAD_THREADS_MAX : ::c_int = 90; +-pub const _SC_THREADS : ::c_int = 91; +-pub const _SC_TIMEOUTS : ::c_int = 92; +-pub const _SC_TIMER_MAX : ::c_int = 93; +-pub const _SC_TIMERS : ::c_int = 94; +-pub const _SC_TRACE : ::c_int = 95; +-pub const _SC_TRACE_EVENT_FILTER : ::c_int = 96; +-pub const _SC_TRACE_EVENT_NAME_MAX : ::c_int = 97; +-pub const _SC_TRACE_INHERIT : ::c_int = 98; +-pub const _SC_TRACE_LOG : ::c_int = 99; +-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_THREAD_SAFE_FUNCTIONS : ::c_int = 103; +-pub const _SC_TRACE_NAME_MAX : ::c_int = 104; +-pub const _SC_TRACE_SYS_MAX : ::c_int = 105; +-pub const _SC_TRACE_USER_EVENT_MAX : ::c_int = 106; +-pub const _SC_TTY_NAME_MAX : ::c_int = 107; +-pub const _SC_TYPED_MEMORY_OBJECTS : ::c_int = 108; +-pub const _SC_V6_ILP32_OFF32 : ::c_int = 109; +-pub const _SC_V6_ILP32_OFFBIG : ::c_int = 110; +-pub const _SC_V6_LP64_OFF64 : ::c_int = 111; +-pub const _SC_V6_LPBIG_OFFBIG : ::c_int = 112; +-pub const _SC_V7_ILP32_OFF32 : ::c_int = 113; +-pub const _SC_V7_ILP32_OFFBIG : ::c_int = 114; +-pub const _SC_V7_LP64_OFF64 : ::c_int = 115; +-pub const _SC_V7_LPBIG_OFFBIG : ::c_int = 116; +-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_STREAMS : ::c_int = 122; +-pub const _SC_XOPEN_UNIX : ::c_int = 123; +-pub const _SC_XOPEN_UUCP : ::c_int = 124; +-pub const _SC_XOPEN_VERSION : ::c_int = 125; +-pub const _SC_PHYS_PAGES : ::c_int = 500; +-pub const _SC_AVPHYS_PAGES : ::c_int = 501; +-pub const _SC_NPROCESSORS_CONF : ::c_int = 502; +-pub const _SC_NPROCESSORS_ONLN : ::c_int = 503; ++pub const MAP_COPY: ::c_int = 0x0002; ++pub const MAP_NOEXTEND: ::c_int = 0x0000; ++ ++pub const _PC_LINK_MAX: ::c_int = 1; ++pub const _PC_MAX_CANON: ::c_int = 2; ++pub const _PC_MAX_INPUT: ::c_int = 3; ++pub const _PC_NAME_MAX: ::c_int = 4; ++pub const _PC_PATH_MAX: ::c_int = 5; ++pub const _PC_PIPE_BUF: ::c_int = 6; ++pub const _PC_CHOWN_RESTRICTED: ::c_int = 7; ++pub const _PC_NO_TRUNC: ::c_int = 8; ++pub const _PC_VDISABLE: ::c_int = 9; ++pub const _PC_2_SYMLINKS: ::c_int = 10; ++pub const _PC_ALLOC_SIZE_MIN: ::c_int = 11; ++pub const _PC_ASYNC_IO: ::c_int = 12; ++pub const _PC_FILESIZEBITS: ::c_int = 13; ++pub const _PC_PRIO_IO: ::c_int = 14; ++pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 15; ++pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 16; ++pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 17; ++pub const _PC_REC_XFER_ALIGN: ::c_int = 18; ++pub const _PC_SYMLINK_MAX: ::c_int = 19; ++pub const _PC_SYNC_IO: ::c_int = 20; ++pub const _PC_TIMESTAMP_RESOLUTION: ::c_int = 21; ++ ++pub const _SC_CLK_TCK: ::c_int = 3; ++pub const _SC_SEM_NSEMS_MAX: ::c_int = 31; ++pub const _SC_SEM_VALUE_MAX: ::c_int = 32; ++pub const _SC_HOST_NAME_MAX: ::c_int = 33; ++pub const _SC_MONOTONIC_CLOCK: ::c_int = 34; ++pub const _SC_2_PBS: ::c_int = 35; ++pub const _SC_2_PBS_ACCOUNTING: ::c_int = 36; ++pub const _SC_2_PBS_CHECKPOINT: ::c_int = 37; ++pub const _SC_2_PBS_LOCATE: ::c_int = 38; ++pub const _SC_2_PBS_MESSAGE: ::c_int = 39; ++pub const _SC_2_PBS_TRACK: ::c_int = 40; ++pub const _SC_ADVISORY_INFO: ::c_int = 41; ++pub const _SC_AIO_LISTIO_MAX: ::c_int = 42; ++pub const _SC_AIO_MAX: ::c_int = 43; ++pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44; ++pub const _SC_ASYNCHRONOUS_IO: ::c_int = 45; ++pub const _SC_ATEXIT_MAX: ::c_int = 46; ++pub const _SC_BARRIERS: ::c_int = 47; ++pub const _SC_CLOCK_SELECTION: ::c_int = 48; ++pub const _SC_CPUTIME: ::c_int = 49; ++pub const _SC_DELAYTIMER_MAX: ::c_int = 50; ++pub const _SC_IOV_MAX: ::c_int = 51; ++pub const _SC_IPV6: ::c_int = 52; ++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_MQ_PRIO_MAX: ::c_int = 59; ++pub const _SC_PRIORITIZED_IO: ::c_int = 60; ++pub const _SC_PRIORITY_SCHEDULING: ::c_int = 61; ++pub const _SC_RAW_SOCKETS: ::c_int = 62; ++pub const _SC_READER_WRITER_LOCKS: ::c_int = 63; ++pub const _SC_REALTIME_SIGNALS: ::c_int = 64; ++pub const _SC_REGEXP: ::c_int = 65; ++pub const _SC_RTSIG_MAX: ::c_int = 66; ++pub const _SC_SEMAPHORES: ::c_int = 67; ++pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 68; ++pub const _SC_SHELL: ::c_int = 69; ++pub const _SC_SIGQUEUE_MAX: ::c_int = 70; ++pub const _SC_SPAWN: ::c_int = 71; ++pub const _SC_SPIN_LOCKS: ::c_int = 72; ++pub const _SC_SPORADIC_SERVER: ::c_int = 73; ++pub const _SC_SS_REPL_MAX: ::c_int = 74; ++pub const _SC_SYNCHRONIZED_IO: ::c_int = 75; ++pub const _SC_SYMLOOP_MAX: ::c_int = 76; ++pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77; ++pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78; ++pub const _SC_THREAD_CPUTIME: ::c_int = 79; ++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_ROBUST_PRIO_INHERIT: ::c_int = 86; ++pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 87; ++pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 88; ++pub const _SC_THREAD_STACK_MIN: ::c_int = 89; ++pub const _SC_THREAD_THREADS_MAX: ::c_int = 90; ++pub const _SC_THREADS: ::c_int = 91; ++pub const _SC_TIMEOUTS: ::c_int = 92; ++pub const _SC_TIMER_MAX: ::c_int = 93; ++pub const _SC_TIMERS: ::c_int = 94; ++pub const _SC_TRACE: ::c_int = 95; ++pub const _SC_TRACE_EVENT_FILTER: ::c_int = 96; ++pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 97; ++pub const _SC_TRACE_INHERIT: ::c_int = 98; ++pub const _SC_TRACE_LOG: ::c_int = 99; ++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_THREAD_SAFE_FUNCTIONS: ::c_int = 103; ++pub const _SC_TRACE_NAME_MAX: ::c_int = 104; ++pub const _SC_TRACE_SYS_MAX: ::c_int = 105; ++pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 106; ++pub const _SC_TTY_NAME_MAX: ::c_int = 107; ++pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 108; ++pub const _SC_V6_ILP32_OFF32: ::c_int = 109; ++pub const _SC_V6_ILP32_OFFBIG: ::c_int = 110; ++pub const _SC_V6_LP64_OFF64: ::c_int = 111; ++pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 112; ++pub const _SC_V7_ILP32_OFF32: ::c_int = 113; ++pub const _SC_V7_ILP32_OFFBIG: ::c_int = 114; ++pub const _SC_V7_LP64_OFF64: ::c_int = 115; ++pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 116; ++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_STREAMS: ::c_int = 122; ++pub const _SC_XOPEN_UNIX: ::c_int = 123; ++pub const _SC_XOPEN_UUCP: ::c_int = 124; ++pub const _SC_XOPEN_VERSION: ::c_int = 125; ++pub const _SC_PHYS_PAGES: ::c_int = 500; ++pub const _SC_AVPHYS_PAGES: ::c_int = 501; ++pub const _SC_NPROCESSORS_CONF: ::c_int = 502; ++pub const _SC_NPROCESSORS_ONLN: ::c_int = 503; + + pub const FD_SETSIZE: usize = 1024; + +@@ -1063,7 +1096,7 @@ pub const NOTE_TRACK: u32 = 0x00000001; + pub const NOTE_TRACKERR: u32 = 0x00000002; + pub const NOTE_CHILD: u32 = 0x00000004; + +-pub const TMP_MAX : ::c_uint = 0x7fffffff; ++pub const TMP_MAX: ::c_uint = 0x7fffffff; + + pub const NI_MAXHOST: ::size_t = 256; + +@@ -1117,12 +1150,14 @@ 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; ++#[deprecated(since = "0.2.71", note = "Removed in OpenBSD 6.0")] + 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; ++#[deprecated(since = "0.2.71", note = "Removed in OpenBSD 6.0")] + pub const KERN_ARND: ::c_int = 37; + pub const KERN_MSGBUFSIZE: ::c_int = 38; + pub const KERN_MALLOCSTATS: ::c_int = 39; +@@ -1168,7 +1203,8 @@ pub const KERN_CONSBUF: ::c_int = 83; + pub const KERN_AUDIO: ::c_int = 84; + pub const KERN_CPUSTATS: ::c_int = 85; + pub const KERN_PFSTATUS: ::c_int = 86; +-pub const KERN_MAXID: ::c_int = 87; ++pub const KERN_TIMEOUT_STATS: ::c_int = 87; ++pub const KERN_MAXID: ::c_int = 88; + + pub const KERN_PROC_ALL: ::c_int = 0; + pub const KERN_PROC_PID: ::c_int = 1; +@@ -1261,7 +1297,7 @@ pub const NTFS_MFLAG_ALLNAMES: ::c_int = 0x2; + + pub const TMPFS_ARGS_VERSION: ::c_int = 1; + +-pub const MAP_STACK : ::c_int = 0x4000; ++pub const MAP_STACK: ::c_int = 0x4000; + + // https://github.com/openbsd/src/blob/master/sys/net/if.h#L187 + pub const IFF_UP: ::c_int = 0x1; // interface is up +@@ -1281,8 +1317,9 @@ pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit + pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit + pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast + +-pub const PTHREAD_STACK_MIN : ::size_t = 4096; +-pub const SIGSTKSZ : ::size_t = 28672; ++pub const PTHREAD_STACK_MIN: ::size_t = 1_usize << _MAX_PAGE_SHIFT; ++pub const MINSIGSTKSZ: ::size_t = 3_usize << _MAX_PAGE_SHIFT; ++pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + (1_usize << _MAX_PAGE_SHIFT) * 4; + + pub const PT_FIRSTMACH: ::c_int = 32; + +@@ -1290,6 +1327,10 @@ pub const SOCK_CLOEXEC: ::c_int = 0x8000; + pub const SOCK_NONBLOCK: ::c_int = 0x4000; + pub const SOCK_DNS: ::c_int = 0x1000; + ++pub const BIOCGRSIG: ::c_ulong = 0x40044273; ++pub const BIOCSRSIG: ::c_ulong = 0x80044272; ++pub const BIOCSDLT: ::c_ulong = 0x8004427a; ++ + pub const PTRACE_FORK: ::c_int = 0x0002; + + pub const WCONTINUED: ::c_int = 8; +@@ -1344,61 +1385,101 @@ f! { + } + + pub fn WIFSTOPPED(status: ::c_int) -> bool { +- (status & 0o177) == 0o177 ++ (status & 0xff) == 0o177 + } + } + +-extern { +- pub fn gettimeofday(tp: *mut ::timeval, +- tz: *mut ::timezone) -> ::c_int; +- pub fn accept4(s: ::c_int, addr: *mut ::sockaddr, +- addrlen: *mut ::socklen_t, flags: ::c_int) -> ::c_int; +- pub fn execvpe(file: *const ::c_char, argv: *const *const ::c_char, +- envp: *const *const ::c_char) -> ::c_int; +- pub fn pledge(promises: *const ::c_char, +- execpromises: *const ::c_char) -> ::c_int; +- pub fn strtonum(nptr: *const ::c_char, minval: ::c_longlong, +- maxval: ::c_longlong, +- errstr: *mut *const ::c_char) -> ::c_longlong; ++extern "C" { ++ pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; ++ pub fn settimeofday( ++ tp: *const ::timeval, ++ tz: *const ::timezone, ++ ) -> ::c_int; ++ pub fn execvpe( ++ file: *const ::c_char, ++ argv: *const *const ::c_char, ++ envp: *const *const ::c_char, ++ ) -> ::c_int; ++ pub fn pledge( ++ promises: *const ::c_char, ++ execpromises: *const ::c_char, ++ ) -> ::c_int; ++ pub fn strtonum( ++ nptr: *const ::c_char, ++ minval: ::c_longlong, ++ maxval: ::c_longlong, ++ errstr: *mut *const ::c_char, ++ ) -> ::c_longlong; + pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int; + pub fn chflags(path: *const ::c_char, flags: ::c_uint) -> ::c_int; + pub fn fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int; +- pub fn chflagsat(fd: ::c_int, path: *const ::c_char, flags: ::c_uint, +- atflag: ::c_int) -> ::c_int; ++ pub fn chflagsat( ++ fd: ::c_int, ++ path: *const ::c_char, ++ flags: ::c_uint, ++ atflag: ::c_int, ++ ) -> ::c_int; + pub fn dirfd(dirp: *mut ::DIR) -> ::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: *mut ::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, ++ 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_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_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 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 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; +- pub fn ptrace(request: ::c_int, +- pid: ::pid_t, +- addr: caddr_t, +- data: ::c_int) -> ::c_int; ++ pub fn ptrace( ++ request: ::c_int, ++ pid: ::pid_t, ++ addr: caddr_t, ++ data: ::c_int, ++ ) -> ::c_int; ++ pub fn memmem( ++ haystack: *const ::c_void, ++ haystacklen: ::size_t, ++ needle: *const ::c_void, ++ needlelen: ::size_t, ++ ) -> *mut ::c_void; + } + + cfg_if! { +@@ -1421,6 +1502,9 @@ cfg_if! { + } else if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; ++ } else if #[cfg(target_arch = "sparc64")] { ++ mod sparc64; ++ pub use self::sparc64::*; + } else { + // Unknown target_arch + } +diff --git a/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs b/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..070fc9385f6c9fb046b4ca60102303acb3fb2153 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs +@@ -0,0 +1,8 @@ ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type c_char = i8; ++ ++#[doc(hidden)] ++pub const _ALIGNBYTES: usize = 0xf; ++ ++pub const _MAX_PAGE_SHIFT: u32 = 13; +diff --git a/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs b/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs +index 05538cd0a9e814600400ee50949da7adec8717eb..e87d0ff1e7d5d20bf8fe916ed95b68ecc221cb7d 100644 +--- a/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs ++++ b/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs +@@ -12,3 +12,5 @@ cfg_if! { + pub const _ALIGNBYTES: usize = 4 - 1; + } + } ++ ++pub const _MAX_PAGE_SHIFT: u32 = 12; +diff --git a/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs b/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs +index 7daa9d83664aae6b11fd8e6892f00e35a0cdd0ec..263b6e13a2d724866b802192e4f060184ee8ec6e 100644 +--- a/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs ++++ b/third_party/rust/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs +@@ -15,6 +15,8 @@ cfg_if! { + } + } + ++pub const _MAX_PAGE_SHIFT: u32 = 12; ++ + pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0; + pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1; + pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2; +diff --git a/third_party/rust/libc/src/unix/haiku/mod.rs b/third_party/rust/libc/src/unix/haiku/mod.rs +index 7bb3285a2e163f44460c99a559e248b8d8699625..27f88f155f103791dda0adde9634bbb08ab192f5 100644 +--- a/third_party/rust/libc/src/unix/haiku/mod.rs ++++ b/third_party/rust/libc/src/unix/haiku/mod.rs +@@ -33,7 +33,9 @@ pub type idtype_t = ::c_uint; + pub enum timezone {} + impl ::Copy for timezone {} + impl ::Clone for timezone { +- fn clone(&self) -> timezone { *self } ++ fn clone(&self) -> timezone { ++ *self ++ } + } + + s! { +@@ -568,8 +570,8 @@ 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_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; +@@ -660,7 +662,7 @@ 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 ++// FIXME: 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; +@@ -674,95 +676,95 @@ pub const MS_ASYNC: ::c_int = 0x01; + pub const MS_INVALIDATE: ::c_int = 0x04; + pub const MS_SYNC: ::c_int = 0x02; + +-pub const E2BIG : ::c_int = -2147454975; +-pub const ECHILD : ::c_int = -2147454974; +-pub const EDEADLK : ::c_int = -2147454973; +-pub const EFBIG : ::c_int = -2147454972; +-pub const EMLINK : ::c_int = -2147454971; +-pub const ENFILE : ::c_int = -2147454970; +-pub const ENODEV : ::c_int = -2147454969; +-pub const ENOLCK : ::c_int = -2147454968; +-pub const ENOSYS : ::c_int = -2147454967; +-pub const ENOTTY : ::c_int = -2147454966; +-pub const ENXIO : ::c_int = -2147454965; +-pub const ESPIPE : ::c_int = -2147454964; +-pub const ESRCH : ::c_int = -2147454963; +-pub const EFPOS : ::c_int = -2147457962; +-pub const ESIGPARM : ::c_int = -2147457961; +-pub const EDOM : ::c_int = -2147454960; +-pub const ERANGE : ::c_int = -2147454959; +-pub const EPROTOTYPE : ::c_int = -2147454958; +-pub const EPROTONOSUPPORT : ::c_int = -2147454957; +-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 = -2147454952; +-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 EISCONN : ::c_int = -2147454947; +-pub const ENOTCONN : ::c_int = -2147454946; +-pub const ESHUTDOWN : ::c_int = -2147454945; +-pub const ECONNREFUSED : ::c_int = -2147454944; +-pub const EHOSTUNREACH : ::c_int = -2147454943; +-pub const ENOPROTOOPT : ::c_int = -2147454942; +-pub const ENOBUFS : ::c_int = -2147454941; +-pub const EINPROGRESS : ::c_int = -2147454940; +-pub const EALREADY : ::c_int = -2147454939; +-pub const EILSEQ : ::c_int = -2147454938; +-pub const ENOMSG : ::c_int = -2147454937; +-pub const ESTALE : ::c_int = -2147454936; +-pub const EOVERFLOW : ::c_int = -2147454935; +-pub const EMSGSIZE : ::c_int = -2147454934; +-pub const EOPNOTSUPP : ::c_int = -2147454933; +-pub const ENOTSOCK : ::c_int = -2147454932; +-pub const EHOSTDOWN : ::c_int = -2147454931; +-pub const EBADMSG : ::c_int = -2147454930; +-pub const ECANCELED : ::c_int = -2147454929; +-pub const EDESTADDRREQ : ::c_int = -2147454928; +-pub const EDQUOT : ::c_int = -2147454927; +-pub const EIDRM : ::c_int = -2147454926; +-pub const EMULTIHOP : ::c_int = -2147454925; +-pub const ENODATA : ::c_int = -2147454924; +-pub const ENOLINK : ::c_int = -2147454923; +-pub const ENOSR : ::c_int = -2147454922; +-pub const ENOSTR : ::c_int = -2147454921; +-pub const ENOTSUP : ::c_int = -2147454920; +-pub const EPROTO : ::c_int = -2147454919; +-pub const ETIME : ::c_int = -2147454918; +-pub const ETXTBSY : ::c_int = -2147454917; +-pub const ENOATTR : ::c_int = -2147454916; ++pub const E2BIG: ::c_int = -2147454975; ++pub const ECHILD: ::c_int = -2147454974; ++pub const EDEADLK: ::c_int = -2147454973; ++pub const EFBIG: ::c_int = -2147454972; ++pub const EMLINK: ::c_int = -2147454971; ++pub const ENFILE: ::c_int = -2147454970; ++pub const ENODEV: ::c_int = -2147454969; ++pub const ENOLCK: ::c_int = -2147454968; ++pub const ENOSYS: ::c_int = -2147454967; ++pub const ENOTTY: ::c_int = -2147454966; ++pub const ENXIO: ::c_int = -2147454965; ++pub const ESPIPE: ::c_int = -2147454964; ++pub const ESRCH: ::c_int = -2147454963; ++pub const EFPOS: ::c_int = -2147457962; ++pub const ESIGPARM: ::c_int = -2147457961; ++pub const EDOM: ::c_int = -2147454960; ++pub const ERANGE: ::c_int = -2147454959; ++pub const EPROTOTYPE: ::c_int = -2147454958; ++pub const EPROTONOSUPPORT: ::c_int = -2147454957; ++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 = -2147454952; ++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 EISCONN: ::c_int = -2147454947; ++pub const ENOTCONN: ::c_int = -2147454946; ++pub const ESHUTDOWN: ::c_int = -2147454945; ++pub const ECONNREFUSED: ::c_int = -2147454944; ++pub const EHOSTUNREACH: ::c_int = -2147454943; ++pub const ENOPROTOOPT: ::c_int = -2147454942; ++pub const ENOBUFS: ::c_int = -2147454941; ++pub const EINPROGRESS: ::c_int = -2147454940; ++pub const EALREADY: ::c_int = -2147454939; ++pub const EILSEQ: ::c_int = -2147454938; ++pub const ENOMSG: ::c_int = -2147454937; ++pub const ESTALE: ::c_int = -2147454936; ++pub const EOVERFLOW: ::c_int = -2147454935; ++pub const EMSGSIZE: ::c_int = -2147454934; ++pub const EOPNOTSUPP: ::c_int = -2147454933; ++pub const ENOTSOCK: ::c_int = -2147454932; ++pub const EHOSTDOWN: ::c_int = -2147454931; ++pub const EBADMSG: ::c_int = -2147454930; ++pub const ECANCELED: ::c_int = -2147454929; ++pub const EDESTADDRREQ: ::c_int = -2147454928; ++pub const EDQUOT: ::c_int = -2147454927; ++pub const EIDRM: ::c_int = -2147454926; ++pub const EMULTIHOP: ::c_int = -2147454925; ++pub const ENODATA: ::c_int = -2147454924; ++pub const ENOLINK: ::c_int = -2147454923; ++pub const ENOSR: ::c_int = -2147454922; ++pub const ENOSTR: ::c_int = -2147454921; ++pub const ENOTSUP: ::c_int = -2147454920; ++pub const EPROTO: ::c_int = -2147454919; ++pub const ETIME: ::c_int = -2147454918; ++pub const ETXTBSY: ::c_int = -2147454917; ++pub const ENOATTR: ::c_int = -2147454916; + + // INT_MIN +-pub const ENOMEM : ::c_int = -2147454976; ++pub const ENOMEM: ::c_int = -2147454976; + + // POSIX errors that can be mapped to BeOS error codes +-pub const EACCES : ::c_int = -2147483646; +-pub const EINTR : ::c_int = -2147483638; +-pub const EIO : ::c_int = -2147483647; +-pub const EBUSY : ::c_int = -2147483634; +-pub const EFAULT : ::c_int = -2147478783; +-pub const ETIMEDOUT : ::c_int = -2147483639; +-pub const EAGAIN : ::c_int = -2147483637; +-pub const EWOULDBLOCK : ::c_int = -2147483637; +-pub const EBADF : ::c_int = -2147459072; +-pub const EEXIST : ::c_int = -2147459070; +-pub const EINVAL : ::c_int = -2147483643; +-pub const ENAMETOOLONG : ::c_int = -2147459068; +-pub const ENOENT : ::c_int = -2147459069; +-pub const EPERM : ::c_int = -2147483633; +-pub const ENOTDIR : ::c_int = -2147459067; +-pub const EISDIR : ::c_int = -2147459063; +-pub const ENOTEMPTY : ::c_int = -2147459066; +-pub const ENOSPC : ::c_int = -2147459065; +-pub const EROFS : ::c_int = -2147459064; +-pub const EMFILE : ::c_int = -2147459062; +-pub const EXDEV : ::c_int = -2147459061; +-pub const ELOOP : ::c_int = -2147459060; +-pub const ENOEXEC : ::c_int = -2147478782; +-pub const EPIPE : ::c_int = -2147459059; ++pub const EACCES: ::c_int = -2147483646; ++pub const EINTR: ::c_int = -2147483638; ++pub const EIO: ::c_int = -2147483647; ++pub const EBUSY: ::c_int = -2147483634; ++pub const EFAULT: ::c_int = -2147478783; ++pub const ETIMEDOUT: ::c_int = -2147483639; ++pub const EAGAIN: ::c_int = -2147483637; ++pub const EWOULDBLOCK: ::c_int = -2147483637; ++pub const EBADF: ::c_int = -2147459072; ++pub const EEXIST: ::c_int = -2147459070; ++pub const EINVAL: ::c_int = -2147483643; ++pub const ENAMETOOLONG: ::c_int = -2147459068; ++pub const ENOENT: ::c_int = -2147459069; ++pub const EPERM: ::c_int = -2147483633; ++pub const ENOTDIR: ::c_int = -2147459067; ++pub const EISDIR: ::c_int = -2147459063; ++pub const ENOTEMPTY: ::c_int = -2147459066; ++pub const ENOSPC: ::c_int = -2147459065; ++pub const EROFS: ::c_int = -2147459064; ++pub const EMFILE: ::c_int = -2147459062; ++pub const EXDEV: ::c_int = -2147459061; ++pub const ELOOP: ::c_int = -2147459060; ++pub const ENOEXEC: ::c_int = -2147478782; ++pub const EPIPE: ::c_int = -2147459059; + + pub const IPPROTO_RAW: ::c_int = 255; + +@@ -788,7 +790,7 @@ pub const IFF_AUTO_CONFIGURED: ::c_int = 0x2000; + pub const IFF_CONFIGURING: ::c_int = 0x4000; + pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast + +-pub const AF_UNSEC: ::c_int = 0; ++pub const AF_UNSPEC: ::c_int = 0; + pub const AF_INET: ::c_int = 1; + pub const AF_APPLETALK: ::c_int = 2; + pub const AF_ROUTE: ::c_int = 3; +@@ -915,51 +917,55 @@ pub const _PC_XATTR_ENABLED: ::c_int = 39; + + pub const FIONBIO: ::c_int = 0xbe000000; + +-pub const _SC_ARG_MAX : ::c_int = 15; +-pub const _SC_CHILD_MAX : ::c_int = 16; +-pub const _SC_CLK_TCK : ::c_int = 17; +-pub const _SC_JOB_CONTROL : ::c_int = 18; +-pub const _SC_NGROUPS_MAX : ::c_int = 19; +-pub const _SC_OPEN_MAX : ::c_int = 20; +-pub const _SC_SAVED_IDS : ::c_int = 21; +-pub const _SC_STREAM_MAX : ::c_int = 22; +-pub const _SC_TZNAME_MAX : ::c_int = 23; +-pub const _SC_VERSION : ::c_int = 24; +-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_PAGE_SIZE : ::c_int = 27; +-pub const _SC_SEM_NSEMS_MAX : ::c_int = 28; +-pub const _SC_SEM_VALUE_MAX : ::c_int = 29; +-pub const _SC_SEMAPHORES : ::c_int = 30; +-pub const _SC_THREADS : ::c_int = 31; +-pub const _SC_IOV_MAX : ::c_int = 32; +-pub const _SC_UIO_MAXIOV : ::c_int = 32; +-pub const _SC_NPROCESSORS_CONF : ::c_int = 34; +-pub const _SC_NPROCESSORS_ONLN : ::c_int = 35; +-pub const _SC_ATEXIT_MAX : ::c_int = 37; +-pub const _SC_PASS_MAX : ::c_int = 39; +-pub const _SC_PHYS_PAGES : ::c_int = 40; +-pub const _SC_AVPHYS_PAGES : ::c_int = 41; +-pub const _SC_PIPE : ::c_int = 42; +-pub const _SC_SELECT : ::c_int = 43; +-pub const _SC_POLL : ::c_int = 44; +-pub const _SC_MAPPED_FILES : ::c_int = 45; +-pub const _SC_THREAD_PROCESS_SHARED : ::c_int = 46; +-pub const _SC_THREAD_STACK_MIN : ::c_int = 47; +-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_REALTIME_SIGNALS : ::c_int = 51; +-pub const _SC_MEMORY_PROTECTION : ::c_int = 52; +-pub const _SC_SIGQUEUE_MAX : ::c_int = 53; +-pub const _SC_RTSIG_MAX : ::c_int = 54; +-pub const _SC_MONOTONIC_CLOCK : ::c_int = 55; +-pub const _SC_DELAYTIMER_MAX : ::c_int = 56; +-pub const _SC_TIMER_MAX : ::c_int = 57; +-pub const _SC_TIMERS : ::c_int = 58; +-pub const _SC_CPUTIME : ::c_int = 59; +-pub const _SC_THREAD_CPUTIME : ::c_int = 60; ++pub const _SC_ARG_MAX: ::c_int = 15; ++pub const _SC_CHILD_MAX: ::c_int = 16; ++pub const _SC_CLK_TCK: ::c_int = 17; ++pub const _SC_JOB_CONTROL: ::c_int = 18; ++pub const _SC_NGROUPS_MAX: ::c_int = 19; ++pub const _SC_OPEN_MAX: ::c_int = 20; ++pub const _SC_SAVED_IDS: ::c_int = 21; ++pub const _SC_STREAM_MAX: ::c_int = 22; ++pub const _SC_TZNAME_MAX: ::c_int = 23; ++pub const _SC_VERSION: ::c_int = 24; ++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_PAGE_SIZE: ::c_int = 27; ++pub const _SC_SEM_NSEMS_MAX: ::c_int = 28; ++pub const _SC_SEM_VALUE_MAX: ::c_int = 29; ++pub const _SC_SEMAPHORES: ::c_int = 30; ++pub const _SC_THREADS: ::c_int = 31; ++pub const _SC_IOV_MAX: ::c_int = 32; ++pub const _SC_UIO_MAXIOV: ::c_int = 32; ++pub const _SC_NPROCESSORS_CONF: ::c_int = 34; ++pub const _SC_NPROCESSORS_ONLN: ::c_int = 35; ++pub const _SC_ATEXIT_MAX: ::c_int = 37; ++pub const _SC_PASS_MAX: ::c_int = 39; ++pub const _SC_PHYS_PAGES: ::c_int = 40; ++pub const _SC_AVPHYS_PAGES: ::c_int = 41; ++pub const _SC_PIPE: ::c_int = 42; ++pub const _SC_SELECT: ::c_int = 43; ++pub const _SC_POLL: ::c_int = 44; ++pub const _SC_MAPPED_FILES: ::c_int = 45; ++pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 46; ++pub const _SC_THREAD_STACK_MIN: ::c_int = 47; ++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_REALTIME_SIGNALS: ::c_int = 51; ++pub const _SC_MEMORY_PROTECTION: ::c_int = 52; ++pub const _SC_SIGQUEUE_MAX: ::c_int = 53; ++pub const _SC_RTSIG_MAX: ::c_int = 54; ++pub const _SC_MONOTONIC_CLOCK: ::c_int = 55; ++pub const _SC_DELAYTIMER_MAX: ::c_int = 56; ++pub const _SC_TIMER_MAX: ::c_int = 57; ++pub const _SC_TIMERS: ::c_int = 58; ++pub const _SC_CPUTIME: ::c_int = 59; ++pub const _SC_THREAD_CPUTIME: ::c_int = 60; ++pub const _SC_HOST_NAME_MAX: ::c_int = 61; ++pub const _SC_REGEXP: ::c_int = 62; ++pub const _SC_SYMLOOP_MAX: ::c_int = 63; ++pub const _SC_SHELL: ::c_int = 64; + + pub const PTHREAD_STACK_MIN: ::size_t = 8192; + +@@ -992,7 +998,7 @@ 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 FIOCLEX: c_ulong = 0; // FIXME: does not exist on Haiku! + + pub const RUSAGE_CHILDREN: ::c_int = -1; + +@@ -1039,6 +1045,9 @@ pub const P_ALL: idtype_t = 0; + pub const P_PID: idtype_t = 1; + pub const P_PGID: idtype_t = 2; + ++pub const UTIME_OMIT: c_long = 1000000001; ++pub const UTIME_NOW: c_long = 1000000000; ++ + pub const VINTR: usize = 0; + pub const VQUIT: usize = 1; + pub const VERASE: usize = 2; +@@ -1067,68 +1076,68 @@ pub const IXON: ::tcflag_t = 0x400; + pub const IXANY: ::tcflag_t = 0x800; + pub const IXOFF: ::tcflag_t = 0x1000; + +-pub const OPOST: ::tcflag_t = 0x00000001; +-pub const OLCUC: ::tcflag_t = 0x00000002; +-pub const ONLCR: ::tcflag_t = 0x00000004; +-pub const OCRNL: ::tcflag_t = 0x00000008; +-pub const ONOCR: ::tcflag_t = 0x00000010; ++pub const OPOST: ::tcflag_t = 0x00000001; ++pub const OLCUC: ::tcflag_t = 0x00000002; ++pub const ONLCR: ::tcflag_t = 0x00000004; ++pub const OCRNL: ::tcflag_t = 0x00000008; ++pub const ONOCR: ::tcflag_t = 0x00000010; + pub const ONLRET: ::tcflag_t = 0x00000020; +-pub const OFILL: ::tcflag_t = 0x00000040; +-pub const OFDEL: ::tcflag_t = 0x00000080; +-pub const NLDLY: ::tcflag_t = 0x00000100; +-pub const NL0: ::tcflag_t = 0x00000000; +-pub const NL1: ::tcflag_t = 0x00000100; +-pub const CRDLY: ::tcflag_t = 0x00000600; +-pub const CR0: ::tcflag_t = 0x00000000; +-pub const CR1: ::tcflag_t = 0x00000200; +-pub const CR2: ::tcflag_t = 0x00000400; +-pub const CR3: ::tcflag_t = 0x00000600; ++pub const OFILL: ::tcflag_t = 0x00000040; ++pub const OFDEL: ::tcflag_t = 0x00000080; ++pub const NLDLY: ::tcflag_t = 0x00000100; ++pub const NL0: ::tcflag_t = 0x00000000; ++pub const NL1: ::tcflag_t = 0x00000100; ++pub const CRDLY: ::tcflag_t = 0x00000600; ++pub const CR0: ::tcflag_t = 0x00000000; ++pub const CR1: ::tcflag_t = 0x00000200; ++pub const CR2: ::tcflag_t = 0x00000400; ++pub const CR3: ::tcflag_t = 0x00000600; + pub const TABDLY: ::tcflag_t = 0x00001800; +-pub const TAB0: ::tcflag_t = 0x00000000; +-pub const TAB1: ::tcflag_t = 0x00000800; +-pub const TAB2: ::tcflag_t = 0x00001000; +-pub const TAB3: ::tcflag_t = 0x00001800; +-pub const BSDLY: ::tcflag_t = 0x00002000; +-pub const BS0: ::tcflag_t = 0x00000000; +-pub const BS1: ::tcflag_t = 0x00002000; +-pub const VTDLY: ::tcflag_t = 0x00004000; +-pub const VT0: ::tcflag_t = 0x00000000; +-pub const VT1: ::tcflag_t = 0x00004000; +-pub const FFDLY: ::tcflag_t = 0x00008000; +-pub const FF0: ::tcflag_t = 0x00000000; +-pub const FF1: ::tcflag_t = 0x00008000; +- +-pub const CSIZE: ::tcflag_t = 0x00000020; +-pub const CS5: ::tcflag_t = 0x00000000; +-pub const CS6: ::tcflag_t = 0x00000000; +-pub const CS7: ::tcflag_t = 0x00000000; +-pub const CS8: ::tcflag_t = 0x00000020; +-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 XLOBLK: ::tcflag_t = 0x00001000; +-pub const CTSFLOW: ::tcflag_t = 0x00002000; +-pub const RTSFLOW: ::tcflag_t = 0x00004000; +-pub const CRTSCTS: ::tcflag_t = RTSFLOW | CTSFLOW; +- +-pub const ISIG: ::tcflag_t = 0x00000001; +-pub const ICANON: ::tcflag_t = 0x00000002; +-pub const XCASE: ::tcflag_t = 0x00000004; +-pub const ECHO: ::tcflag_t = 0x00000008; +-pub const ECHOE: ::tcflag_t = 0x00000010; +-pub const ECHOK: ::tcflag_t = 0x00000020; +-pub const ECHONL: ::tcflag_t = 0x00000040; +-pub const NOFLSH: ::tcflag_t = 0x00000080; +-pub const TOSTOP: ::tcflag_t = 0x00000100; +-pub const IEXTEN: ::tcflag_t = 0x00000200; +-pub const ECHOCTL: ::tcflag_t = 0x00000400; +-pub const ECHOPRT: ::tcflag_t = 0x00000800; +-pub const ECHOKE: ::tcflag_t = 0x00001000; +-pub const FLUSHO: ::tcflag_t = 0x00002000; +-pub const PENDIN: ::tcflag_t = 0x00004000; ++pub const TAB0: ::tcflag_t = 0x00000000; ++pub const TAB1: ::tcflag_t = 0x00000800; ++pub const TAB2: ::tcflag_t = 0x00001000; ++pub const TAB3: ::tcflag_t = 0x00001800; ++pub const BSDLY: ::tcflag_t = 0x00002000; ++pub const BS0: ::tcflag_t = 0x00000000; ++pub const BS1: ::tcflag_t = 0x00002000; ++pub const VTDLY: ::tcflag_t = 0x00004000; ++pub const VT0: ::tcflag_t = 0x00000000; ++pub const VT1: ::tcflag_t = 0x00004000; ++pub const FFDLY: ::tcflag_t = 0x00008000; ++pub const FF0: ::tcflag_t = 0x00000000; ++pub const FF1: ::tcflag_t = 0x00008000; ++ ++pub const CSIZE: ::tcflag_t = 0x00000020; ++pub const CS5: ::tcflag_t = 0x00000000; ++pub const CS6: ::tcflag_t = 0x00000000; ++pub const CS7: ::tcflag_t = 0x00000000; ++pub const CS8: ::tcflag_t = 0x00000020; ++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 XLOBLK: ::tcflag_t = 0x00001000; ++pub const CTSFLOW: ::tcflag_t = 0x00002000; ++pub const RTSFLOW: ::tcflag_t = 0x00004000; ++pub const CRTSCTS: ::tcflag_t = RTSFLOW | CTSFLOW; ++ ++pub const ISIG: ::tcflag_t = 0x00000001; ++pub const ICANON: ::tcflag_t = 0x00000002; ++pub const XCASE: ::tcflag_t = 0x00000004; ++pub const ECHO: ::tcflag_t = 0x00000008; ++pub const ECHOE: ::tcflag_t = 0x00000010; ++pub const ECHOK: ::tcflag_t = 0x00000020; ++pub const ECHONL: ::tcflag_t = 0x00000040; ++pub const NOFLSH: ::tcflag_t = 0x00000080; ++pub const TOSTOP: ::tcflag_t = 0x00000100; ++pub const IEXTEN: ::tcflag_t = 0x00000200; ++pub const ECHOCTL: ::tcflag_t = 0x00000400; ++pub const ECHOPRT: ::tcflag_t = 0x00000800; ++pub const ECHOKE: ::tcflag_t = 0x00001000; ++pub const FLUSHO: ::tcflag_t = 0x00002000; ++pub const PENDIN: ::tcflag_t = 0x00004000; + + pub const TCGB_CTS: ::c_int = 0x01; + pub const TCGB_DSR: ::c_int = 0x02; +@@ -1142,26 +1151,26 @@ pub const TIOCM_DSR: ::c_int = TCGB_DSR; + pub const TIOCM_DTR: ::c_int = 0x10; + pub const TIOCM_RTS: ::c_int = 0x20; + +-pub const B0: speed_t = 0x00; +-pub const B50: speed_t = 0x01; +-pub const B75: speed_t = 0x02; +-pub const B110: speed_t = 0x03; +-pub const B134: speed_t = 0x04; +-pub const B150: speed_t = 0x05; +-pub const B200: speed_t = 0x06; +-pub const B300: speed_t = 0x07; +-pub const B600: speed_t = 0x08; +-pub const B1200: speed_t = 0x09; +-pub const B1800: speed_t = 0x0A; +-pub const B2400: speed_t = 0x0B; +-pub const B4800: speed_t = 0x0C; +-pub const B9600: speed_t = 0x0D; +-pub const B19200: speed_t = 0x0E; +-pub const B38400: speed_t = 0x0F; +-pub const B57600: speed_t = 0x10; ++pub const B0: speed_t = 0x00; ++pub const B50: speed_t = 0x01; ++pub const B75: speed_t = 0x02; ++pub const B110: speed_t = 0x03; ++pub const B134: speed_t = 0x04; ++pub const B150: speed_t = 0x05; ++pub const B200: speed_t = 0x06; ++pub const B300: speed_t = 0x07; ++pub const B600: speed_t = 0x08; ++pub const B1200: speed_t = 0x09; ++pub const B1800: speed_t = 0x0A; ++pub const B2400: speed_t = 0x0B; ++pub const B4800: speed_t = 0x0C; ++pub const B9600: speed_t = 0x0D; ++pub const B19200: speed_t = 0x0E; ++pub const B38400: speed_t = 0x0F; ++pub const B57600: speed_t = 0x10; + pub const B115200: speed_t = 0x11; + pub const B230400: speed_t = 0x12; +-pub const B31250: speed_t = 0x13; ++pub const B31250: speed_t = 0x13; + + pub const TCSANOW: ::c_int = 0x01; + pub const TCSADRAIN: ::c_int = 0x02; +@@ -1176,30 +1185,34 @@ pub const TCIFLUSH: ::c_int = 0x01; + pub const TCOFLUSH: ::c_int = 0x02; + pub const TCIOFLUSH: ::c_int = 0x03; + +-pub const TCGETA: ::c_int = 0x8000; +-pub const TCSETA: ::c_int = TCGETA + 1; +-pub const TCSETAF: ::c_int = TCGETA + 2; +-pub const TCSETAW: ::c_int = TCGETA + 3; ++pub const TCGETA: ::c_int = 0x8000; ++pub const TCSETA: ::c_int = TCGETA + 1; ++pub const TCSETAF: ::c_int = TCGETA + 2; ++pub const TCSETAW: ::c_int = TCGETA + 3; + pub const TCWAITEVENT: ::c_int = TCGETA + 4; +-pub const TCSBRK: ::c_int = TCGETA + 5; +-pub const TCFLSH: ::c_int = TCGETA + 6; +-pub const TCXONC: ::c_int = TCGETA + 7; ++pub const TCSBRK: ::c_int = TCGETA + 5; ++pub const TCFLSH: ::c_int = TCGETA + 6; ++pub const TCXONC: ::c_int = TCGETA + 7; + pub const TCQUERYCONNECTED: ::c_int = TCGETA + 8; +-pub const TCGETBITS: ::c_int = TCGETA + 9; +-pub const TCSETDTR: ::c_int = TCGETA + 10; +-pub const TCSETRTS: ::c_int = TCGETA + 11; +-pub const TIOCGWINSZ: ::c_int = TCGETA + 12; +-pub const TIOCSWINSZ: ::c_int = TCGETA + 13; +-pub const TCVTIME: ::c_int = TCGETA + 14; +-pub const TIOCGPGRP: ::c_int = TCGETA + 15; +-pub const TIOCSPGRP: ::c_int = TCGETA + 16; +-pub const TIOCSCTTY: ::c_int = TCGETA + 17; +-pub const TIOCMGET: ::c_int = TCGETA + 18; +-pub const TIOCMSET: ::c_int = TCGETA + 19; +-pub const TIOCSBRK: ::c_int = TCGETA + 20; +-pub const TIOCCBRK: ::c_int = TCGETA + 21; +-pub const TIOCMBIS: ::c_int = TCGETA + 22; +-pub const TIOCMBIC: ::c_int = TCGETA + 23; ++pub const TCGETBITS: ::c_int = TCGETA + 9; ++pub const TCSETDTR: ::c_int = TCGETA + 10; ++pub const TCSETRTS: ::c_int = TCGETA + 11; ++pub const TIOCGWINSZ: ::c_int = TCGETA + 12; ++pub const TIOCSWINSZ: ::c_int = TCGETA + 13; ++pub const TCVTIME: ::c_int = TCGETA + 14; ++pub const TIOCGPGRP: ::c_int = TCGETA + 15; ++pub const TIOCSPGRP: ::c_int = TCGETA + 16; ++pub const TIOCSCTTY: ::c_int = TCGETA + 17; ++pub const TIOCMGET: ::c_int = TCGETA + 18; ++pub const TIOCMSET: ::c_int = TCGETA + 19; ++pub const TIOCSBRK: ::c_int = TCGETA + 20; ++pub const TIOCCBRK: ::c_int = TCGETA + 21; ++pub const TIOCMBIS: ::c_int = TCGETA + 22; ++pub const TIOCMBIC: ::c_int = TCGETA + 23; ++ ++pub const PRIO_PROCESS: ::c_int = 0; ++pub const PRIO_PGRP: ::c_int = 1; ++pub const PRIO_USER: ::c_int = 2; + + f! { + pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { +@@ -1233,7 +1246,7 @@ f! { + } + + pub fn WEXITSTATUS(status: ::c_int) -> ::c_int { +- (status & 0xff) ++ status & 0xff + } + + pub fn WIFSIGNALED(status: ::c_int) -> bool { +@@ -1262,11 +1275,22 @@ f! { + } + } + +-extern { ++extern "C" { + pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; + pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; +- pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, +- buflen: ::size_t) -> ::c_int; ++ pub fn utimensat( ++ fd: ::c_int, ++ path: *const ::c_char, ++ times: *const ::timespec, ++ flag: ::c_int, ++ ) -> ::c_int; ++ pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; ++ pub fn strerror_r( ++ errnum: ::c_int, ++ buf: *mut c_char, ++ buflen: ::size_t, ++ ) -> ::c_int; ++ pub fn _errnop() -> *mut ::c_int; + + pub fn abs(i: ::c_int) -> ::c_int; + pub fn atof(s: *const ::c_char) -> ::c_double; +@@ -1276,159 +1300,212 @@ extern { + } + + #[link(name = "bsd")] +-extern { ++extern "C" { + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; +- pub fn sem_init(sem: *mut sem_t, +- pshared: ::c_int, +- value: ::c_uint) +- -> ::c_int; ++ pub fn sem_init( ++ sem: *mut sem_t, ++ pshared: ::c_int, ++ value: ::c_uint, ++ ) -> ::c_int; + + pub fn clock_gettime(clk_id: ::c_int, tp: *mut ::timespec) -> ::c_int; + pub fn clock_settime(clk_id: ::c_int, tp: *const ::timespec) -> ::c_int; +- pub fn pthread_create(thread: *mut ::pthread_t, +- attr: *const ::pthread_attr_t, +- f: extern fn(*mut ::c_void) -> *mut ::c_void, +- value: *mut ::c_void) -> ::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 pthread_create( ++ thread: *mut ::pthread_t, ++ attr: *const ::pthread_attr_t, ++ f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, ++ value: *mut ::c_void, ++ ) -> ::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 setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::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 mprotect( ++ addr: *const ::c_void, ++ len: ::size_t, ++ prot: ::c_int, ++ ) -> ::c_int; + pub fn dirfd(dirp: *mut ::DIR) -> ::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; +- pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, +- options: ::c_int) -> ::c_int; +- +- pub fn glob(pattern: *const ::c_char, +- flags: ::c_int, +- errfunc: ::Option ::c_int>, +- pglob: *mut ::glob_t) -> ::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; ++ pub fn waitid( ++ idtype: idtype_t, ++ id: id_t, ++ infop: *mut ::siginfo_t, ++ options: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn glob( ++ pattern: *const ::c_char, ++ flags: ::c_int, ++ errfunc: ::Option< ++ extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int, ++ >, ++ pglob: *mut ::glob_t, ++ ) -> ::c_int; + pub fn globfree(pglob: *mut ::glob_t); +- pub fn gettimeofday(tp: *mut ::timeval, +- tz: *mut ::c_void) -> ::c_int; +- pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) +- -> ::c_int; +- +- pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) +- -> ::c_int; ++ pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; ++ pub fn posix_madvise( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ advice: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn shm_open( ++ name: *const ::c_char, ++ oflag: ::c_int, ++ mode: ::mode_t, ++ ) -> ::c_int; + pub fn shm_unlink(name: *const ::c_char) -> ::c_int; + + pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); + + pub fn telldir(dirp: *mut ::DIR) -> ::c_long; +- pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) +- -> ::c_int; +- +- pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int; +- +- pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, +- flags: ::c_int, addr: *mut ::sockaddr, +- addrlen: *mut ::socklen_t) -> ::ssize_t; ++ pub fn madvise( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ advice: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn msync( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn recvfrom( ++ socket: ::c_int, ++ buf: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ addr: *mut ::sockaddr, ++ addrlen: *mut ::socklen_t, ++ ) -> ::ssize_t; + pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int; +- pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int; + pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; + pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; + +- pub fn bind(socket: ::c_int, address: *const ::sockaddr, +- address_len: ::socklen_t) -> ::c_int; +- +- pub fn writev(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int) -> ::ssize_t; +- pub fn readv(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int) -> ::ssize_t; +- +- pub fn sendmsg(fd: ::c_int, +- msg: *const ::msghdr, +- flags: ::c_int) -> ::ssize_t; +- pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) +- -> ::ssize_t; +- pub fn execvpe(file: *const ::c_char, argv: *const *const ::c_char, +- environment: *const *const ::c_char) -> ::c_int; +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrgid_r")] +- pub fn getgrgid_r(gid: ::gid_t, +- grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "sigaltstack$UNIX2003")] +- #[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")] +- pub fn sigaltstack(ss: *const stack_t, +- oss: *mut stack_t) -> ::c_int; ++ pub fn bind( ++ socket: ::c_int, ++ address: *const ::sockaddr, ++ address_len: ::socklen_t, ++ ) -> ::c_int; ++ ++ pub fn writev( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ ) -> ::ssize_t; ++ pub fn readv( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ ) -> ::ssize_t; ++ ++ pub fn sendmsg( ++ fd: ::c_int, ++ msg: *const ::msghdr, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ pub fn recvmsg( ++ fd: ::c_int, ++ msg: *mut ::msghdr, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ pub fn execvpe( ++ file: *const ::c_char, ++ argv: *const *const ::c_char, ++ environment: *const *const ::c_char, ++ ) -> ::c_int; ++ pub fn getgrgid_r( ++ gid: ::gid_t, ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; ++ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sem_close(sem: *mut sem_t) -> ::c_int; + pub fn getdtablesize() -> ::c_int; +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrnam_r")] +- pub fn getgrnam_r(name: *const ::c_char, +- grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_sigmask$UNIX2003")] +- pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, +- oldset: *mut sigset_t) -> ::c_int; ++ pub fn getgrnam_r( ++ name: *const ::c_char, ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; ++ pub fn pthread_sigmask( ++ how: ::c_int, ++ set: *const sigset_t, ++ oldset: *mut sigset_t, ++ ) -> ::c_int; + pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; + pub fn getgrnam(name: *const ::c_char) -> *mut ::group; + pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + pub fn sem_unlink(name: *const ::c_char) -> ::c_int; + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; +- #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwnam_r")] +- pub fn getpwnam_r(name: *const ::c_char, +- pwd: *mut passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut passwd) -> ::c_int; +- #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwuid_r")] +- pub fn getpwuid_r(uid: ::uid_t, +- pwd: *mut passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut passwd) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch ="x86"), +- link_name = "sigwait$UNIX2003")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")] +- pub fn sigwait(set: *const sigset_t, +- sig: *mut ::c_int) -> ::c_int; +- pub fn pthread_atfork(prepare: ::Option, +- parent: ::Option, +- child: ::Option) -> ::c_int; ++ pub fn getpwnam_r( ++ name: *const ::c_char, ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; ++ pub fn getpwuid_r( ++ uid: ::uid_t, ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; ++ pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; ++ pub fn pthread_atfork( ++ prepare: ::Option, ++ parent: ::Option, ++ child: ::Option, ++ ) -> ::c_int; + pub fn getgrgid(gid: ::gid_t) -> *mut ::group; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "popen$UNIX2003")] +- pub fn popen(command: *const c_char, +- mode: *const c_char) -> *mut ::FILE; +- 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 popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; ++ 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 sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; + } +diff --git a/third_party/rust/libc/src/unix/hermit/mod.rs b/third_party/rust/libc/src/unix/hermit/mod.rs +index 4bc03ef9baa18d04e1816f1ad6bbca444c55d6ed..ae3fa22ac5f3a4b1f8b3ba97316dc9d6494a7aea 100644 +--- a/third_party/rust/libc/src/unix/hermit/mod.rs ++++ b/third_party/rust/libc/src/unix/hermit/mod.rs +@@ -1,13 +1,3 @@ +-// Copyright 2018 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 or the MIT license +-// , at your +-// option. This file may not be copied, modified, or distributed +-// except according to those terms. +- + // liblibc port for HermitCore (https://hermitcore.org) + // HermitCore is a unikernel based on lwIP, newlib, and + // pthread-embedded. +@@ -806,7 +796,7 @@ pub const _SC_TRACE_SYS_MAX: ::c_int = 89; + pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 90; + pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 91; + pub const _SC_V7_ILP32_OFF32: ::c_int = 92; +-pub const _SC_V6_ILP32_OFF32: ::c_int =_SC_V7_ILP32_OFF32; ++pub const _SC_V6_ILP32_OFF32: ::c_int = _SC_V7_ILP32_OFF32; + pub const _SC_XBS5_ILP32_OFF32: ::c_int = _SC_V7_ILP32_OFF32; + pub const _SC_V7_ILP32_OFFBIG: ::c_int = 93; + pub const _SC_V6_ILP32_OFFBIG: ::c_int = _SC_V7_ILP32_OFFBIG; +@@ -949,6 +939,10 @@ const ULONG_SIZE: usize = 64; + + pub const WNOHANG: ::c_int = 0x00000001; + ++pub const PRIO_PROCESS: ::c_int = 0; ++pub const PRIO_PGRP: ::c_int = 1; ++pub const PRIO_USER: ::c_int = 2; ++ + f! { + pub fn WEXITSTATUS(status: ::c_int) -> ::c_int { + (status >> 8) & 0xff +@@ -963,17 +957,21 @@ f! { + } + } + +-extern { ++extern "C" { + pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; + pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; +- pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, +- buflen: ::size_t) -> ::c_int; ++ pub fn strerror_r( ++ errnum: ::c_int, ++ buf: *mut c_char, ++ buflen: ::size_t, ++ ) -> ::c_int; + + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; +- pub fn sem_init(sem: *mut sem_t, +- pshared: ::c_int, +- value: ::c_uint) +- -> ::c_int; ++ pub fn sem_init( ++ sem: *mut sem_t, ++ pshared: ::c_int, ++ value: ::c_uint, ++ ) -> ::c_int; + + pub fn abs(i: ::c_int) -> ::c_int; + pub fn atof(s: *const ::c_char) -> ::c_double; +@@ -981,31 +979,52 @@ extern { + pub fn rand() -> ::c_int; + pub fn srand(seed: ::c_uint); + +- pub fn bind(s: ::c_int, name: *const ::sockaddr, namelen: ::socklen_t) +- -> ::c_int; +- +- pub fn clock_gettime(clock_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; +- +- pub fn gettimeofday(tp: *mut ::timeval, +- tz: *mut ::c_void) -> ::c_int; +- pub fn getpwuid_r(uid: ::uid_t, pwd: *mut passwd, buf: *mut ::c_char, +- buflen: ::size_t, result: *mut *mut passwd) -> ::c_int; ++ pub fn bind( ++ s: ::c_int, ++ name: *const ::sockaddr, ++ namelen: ::socklen_t, ++ ) -> ::c_int; ++ ++ pub fn clock_gettime( ++ clock_id: ::clockid_t, ++ tp: *mut ::timespec, ++ ) -> ::c_int; ++ ++ pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; ++ pub fn getpwuid_r( ++ uid: ::uid_t, ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; + + // Dummy + pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; + + pub fn memalign(align: ::size_t, nbytes: ::size_t) -> *mut ::c_void; + +- pub fn pthread_create(tid: *mut ::pthread_t, attr: *const ::pthread_attr_t, +- start: extern fn(*mut ::c_void) -> *mut ::c_void, arg: *mut ::c_void) +- -> ::c_int; +- +- pub fn pthread_sigmask(how: ::c_int, set: *const ::sigset_t, +- oset: *mut ::sigset_t) -> ::c_int; +- +- pub fn recvfrom(s: ::c_int, mem: *mut ::c_void, len: ::size_t, +- flags: ::c_int, from: *mut ::sockaddr, fromlen: *mut ::socklen_t) +- -> ::c_int; ++ pub fn pthread_create( ++ tid: *mut ::pthread_t, ++ attr: *const ::pthread_attr_t, ++ start: extern "C" fn(*mut ::c_void) -> *mut ::c_void, ++ arg: *mut ::c_void, ++ ) -> ::c_int; ++ ++ pub fn pthread_sigmask( ++ how: ::c_int, ++ set: *const ::sigset_t, ++ oset: *mut ::sigset_t, ++ ) -> ::c_int; ++ ++ pub fn recvfrom( ++ s: ::c_int, ++ mem: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ from: *mut ::sockaddr, ++ fromlen: *mut ::socklen_t, ++ ) -> ::c_int; + + pub fn setgroups(ngroups: ::c_int, grouplist: *const ::gid_t) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; +diff --git a/third_party/rust/libc/src/unix/linux_like/android/b32/arm.rs b/third_party/rust/libc/src/unix/linux_like/android/b32/arm.rs +index 1320b16ab21c893553c642c4faadc6a33bfd235d..aa9beb765288c1db78a15eaa811c3dd3dbeb0ffb 100644 +--- a/third_party/rust/libc/src/unix/linux_like/android/b32/arm.rs ++++ b/third_party/rust/libc/src/unix/linux_like/android/b32/arm.rs +@@ -1,5 +1,151 @@ + pub type c_char = u8; + pub type wchar_t = u32; ++pub type greg_t = i32; ++pub type mcontext_t = sigcontext; ++ ++s! { ++ pub struct sigcontext { ++ pub trap_no: ::c_ulong, ++ pub error_code: ::c_ulong, ++ pub oldmask: ::c_ulong, ++ pub arm_r0: ::c_ulong, ++ pub arm_r1: ::c_ulong, ++ pub arm_r2: ::c_ulong, ++ pub arm_r3: ::c_ulong, ++ pub arm_r4: ::c_ulong, ++ pub arm_r5: ::c_ulong, ++ pub arm_r6: ::c_ulong, ++ pub arm_r7: ::c_ulong, ++ pub arm_r8: ::c_ulong, ++ pub arm_r9: ::c_ulong, ++ pub arm_r10: ::c_ulong, ++ pub arm_fp: ::c_ulong, ++ pub arm_ip: ::c_ulong, ++ pub arm_sp: ::c_ulong, ++ pub arm_lr: ::c_ulong, ++ pub arm_pc: ::c_ulong, ++ pub arm_cpsr: ::c_ulong, ++ pub fault_address: ::c_ulong, ++ } ++} ++ ++cfg_if! { ++ if #[cfg(libc_union)] { ++ s_no_extra_traits! { ++ pub struct __c_anonymous_uc_sigmask_with_padding { ++ pub uc_sigmask: ::sigset_t, ++ /* Android has a wrong (smaller) sigset_t on x86. */ ++ __padding_rt_sigset: u32, ++ } ++ ++ pub union __c_anonymous_uc_sigmask { ++ uc_sigmask: __c_anonymous_uc_sigmask_with_padding, ++ uc_sigmask64: ::sigset64_t, ++ } ++ ++ 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__c_anonymous_union: __c_anonymous_uc_sigmask, ++ /* The kernel adds extra padding after uc_sigmask to match ++ * glibc sigset_t on ARM. */ ++ __padding: [c_char; 120], ++ __align: [::c_longlong; 0], ++ uc_regspace: [::c_ulong; 128], ++ } ++ } ++ ++ cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for __c_anonymous_uc_sigmask_with_padding { ++ fn eq( ++ &self, other: &__c_anonymous_uc_sigmask_with_padding ++ ) -> bool { ++ self.uc_sigmask == other.uc_sigmask ++ // Ignore padding ++ } ++ } ++ impl Eq for __c_anonymous_uc_sigmask_with_padding {} ++ impl ::fmt::Debug for __c_anonymous_uc_sigmask_with_padding { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("uc_sigmask_with_padding") ++ .field("uc_sigmask_with_padding", &self.uc_sigmask) ++ // Ignore padding ++ .finish() ++ } ++ } ++ impl ::hash::Hash for __c_anonymous_uc_sigmask_with_padding { ++ fn hash(&self, state: &mut H) { ++ self.uc_sigmask.hash(state) ++ // Ignore padding ++ } ++ } ++ ++ impl PartialEq for __c_anonymous_uc_sigmask { ++ fn eq(&self, other: &__c_anonymous_uc_sigmask) -> bool { ++ unsafe { self.uc_sigmask == other.uc_sigmask } ++ } ++ } ++ impl Eq for __c_anonymous_uc_sigmask {} ++ impl ::fmt::Debug for __c_anonymous_uc_sigmask { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("uc_sigmask") ++ .field("uc_sigmask", unsafe { &self.uc_sigmask }) ++ .finish() ++ } ++ } ++ impl ::hash::Hash for __c_anonymous_uc_sigmask { ++ fn hash(&self, state: &mut H) { ++ unsafe { self.uc_sigmask.hash(state) } ++ } ++ } ++ ++ impl PartialEq for ucontext_t { ++ fn eq(&self, other: &Self) -> bool { ++ self.uc_flags == other.uc_flags ++ && self.uc_link == other.uc_link ++ && self.uc_stack == other.uc_stack ++ && self.uc_mcontext == other.uc_mcontext ++ && self.uc_sigmask__c_anonymous_union ++ == other.uc_sigmask__c_anonymous_union ++ && &self.uc_regspace[..] == &other.uc_regspace[..] ++ // Ignore padding field ++ } ++ } ++ impl Eq for ucontext_t {} ++ impl ::fmt::Debug for ucontext_t { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("ucontext_t") ++ .field("uc_flags", &self.uc_flags) ++ .field("uc_link", &self.uc_link) ++ .field("uc_stack", &self.uc_stack) ++ .field("uc_mcontext", &self.uc_mcontext) ++ .field( ++ "uc_sigmask__c_anonymous_union", ++ &self.uc_sigmask__c_anonymous_union ++ ) ++ .field("uc_regspace", &&self.uc_regspace[..]) ++ // Ignore padding field ++ .finish() ++ } ++ } ++ impl ::hash::Hash for ucontext_t { ++ fn hash(&self, state: &mut H) { ++ self.uc_flags.hash(state); ++ self.uc_link.hash(state); ++ self.uc_stack.hash(state); ++ self.uc_mcontext.hash(state); ++ self.uc_sigmask__c_anonymous_union.hash(state); ++ &self.uc_regspace[..].hash(state); ++ // Ignore padding field ++ } ++ } ++ } ++ } ++ } ++} + + pub const O_DIRECT: ::c_int = 0x10000; + pub const O_DIRECTORY: ::c_int = 0x4000; +@@ -355,3 +501,23 @@ pub const SYS_pwritev2: ::c_long = 393; + pub const SYS_pkey_mprotect: ::c_long = 394; + pub const SYS_pkey_alloc: ::c_long = 395; + pub const SYS_pkey_free: ::c_long = 396; ++ ++// offsets in mcontext_t.gregs from sys/ucontext.h ++pub const REG_R0: ::c_int = 0; ++pub const REG_R1: ::c_int = 1; ++pub const REG_R2: ::c_int = 2; ++pub const REG_R3: ::c_int = 3; ++pub const REG_R4: ::c_int = 4; ++pub const REG_R5: ::c_int = 5; ++pub const REG_R6: ::c_int = 6; ++pub const REG_R7: ::c_int = 7; ++pub const REG_R8: ::c_int = 8; ++pub const REG_R9: ::c_int = 9; ++pub const REG_R10: ::c_int = 10; ++pub const REG_R11: ::c_int = 11; ++pub const REG_R12: ::c_int = 12; ++pub const REG_R13: ::c_int = 13; ++pub const REG_R14: ::c_int = 14; ++pub const REG_R15: ::c_int = 15; ++ ++pub const NGREG: ::c_int = 18; +diff --git a/third_party/rust/libc/src/unix/linux_like/android/b32/mod.rs b/third_party/rust/libc/src/unix/linux_like/android/b32/mod.rs +index e8fd20e49dc69da4fecc68011b45877c6a8d64c2..5c4f03234ef18b9aae2bbcfdec589e7cb67b77f9 100644 +--- a/third_party/rust/libc/src/unix/linux_like/android/b32/mod.rs ++++ b/third_party/rust/libc/src/unix/linux_like/android/b32/mod.rs +@@ -161,6 +161,24 @@ s! { + } + } + ++s_no_extra_traits! { ++ pub struct sigset64_t { ++ __bits: [::c_ulong; 2] ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl ::fmt::Debug for sigset64_t { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("sigset64_t") ++ .field("__bits", &self.__bits) ++ .finish() ++ } ++ } ++ } ++} ++ + // These constants must be of the same type of sigaction.sa_flags + pub const SA_NOCLDSTOP: ::c_int = 0x00000001; + pub const SA_NOCLDWAIT: ::c_int = 0x00000002; +@@ -179,12 +197,10 @@ pub const PTRACE_SETFPREGS: ::c_int = 15; + pub const PTRACE_GETREGS: ::c_int = 12; + pub const PTRACE_SETREGS: ::c_int = 13; + +-pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { +- value: 0, +-}; +-pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { +- value: 0, +-}; ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = ++ pthread_mutex_t { value: 0 }; ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = ++ pthread_cond_t { value: 0 }; + pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { + lock: PTHREAD_MUTEX_INITIALIZER, + cond: PTHREAD_COND_INITIALIZER, +@@ -206,7 +222,7 @@ pub const UT_HOSTSIZE: usize = 16; + pub const SIGSTKSZ: ::size_t = 8192; + pub const MINSIGSTKSZ: ::size_t = 2048; + +-extern { ++extern "C" { + pub fn timegm64(tm: *const ::tm) -> ::time64_t; + } + +diff --git a/third_party/rust/libc/src/unix/linux_like/android/b32/x86/align.rs b/third_party/rust/libc/src/unix/linux_like/android/b32/x86/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..04df4a05d19b71c0f18360daf8b8dcd0ce5a4d41 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/android/b32/x86/align.rs +@@ -0,0 +1,7 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(8))] ++ pub struct max_align_t { ++ priv_: [f64; 2] ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/android/b32/x86.rs b/third_party/rust/libc/src/unix/linux_like/android/b32/x86/mod.rs +similarity index 72% +rename from third_party/rust/libc/src/unix/linux_like/android/b32/x86.rs +rename to third_party/rust/libc/src/unix/linux_like/android/b32/x86/mod.rs +index a56fa004542ccbfb8426dbdd0e19f771ae44e2f0..879ea1a174d3886b91828edd9cdf7b68436e7527 100644 +--- a/third_party/rust/libc/src/unix/linux_like/android/b32/x86.rs ++++ b/third_party/rust/libc/src/unix/linux_like/android/b32/x86/mod.rs +@@ -1,5 +1,144 @@ + pub type c_char = i8; + pub type wchar_t = i32; ++pub type greg_t = i32; ++ ++s! { ++ pub struct _libc_fpreg { ++ pub significand: [u16; 4], ++ pub exponent: u16, ++ } ++ ++ pub struct _libc_fpstate { ++ pub cw: ::c_ulong, ++ pub sw: ::c_ulong, ++ pub tag: ::c_ulong, ++ pub ipoff: ::c_ulong, ++ pub cssel: ::c_ulong, ++ pub dataoff: ::c_ulong, ++ pub datasel: ::c_ulong, ++ pub _st: [_libc_fpreg; 8], ++ pub status: ::c_ulong, ++ } ++ ++ pub struct mcontext_t { ++ pub gregs: [greg_t; 19], ++ pub fpregs: *mut _libc_fpstate, ++ pub oldmask: ::c_ulong, ++ pub cr2: ::c_ulong, ++ } ++} ++ ++cfg_if! { ++ if #[cfg(libc_union)] { ++ s_no_extra_traits! { ++ pub struct __c_anonymous_uc_sigmask_with_padding { ++ pub uc_sigmask: ::sigset_t, ++ /* Android has a wrong (smaller) sigset_t on x86. */ ++ __padding_rt_sigset: u32, ++ } ++ ++ pub union __c_anonymous_uc_sigmask { ++ uc_sigmask: __c_anonymous_uc_sigmask_with_padding, ++ uc_sigmask64: ::sigset64_t, ++ } ++ ++ 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__c_anonymous_union: __c_anonymous_uc_sigmask, ++ __padding_rt_sigset: u32, ++ __fpregs_mem: _libc_fpstate, ++ } ++ } ++ ++ cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for __c_anonymous_uc_sigmask_with_padding { ++ fn eq( ++ &self, other: &__c_anonymous_uc_sigmask_with_padding ++ ) -> bool { ++ self.uc_sigmask == other.uc_sigmask ++ // Ignore padding ++ } ++ } ++ impl Eq for __c_anonymous_uc_sigmask_with_padding {} ++ impl ::fmt::Debug for __c_anonymous_uc_sigmask_with_padding { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("uc_sigmask_with_padding") ++ .field("uc_sigmask_with_padding", &self.uc_sigmask) ++ // Ignore padding ++ .finish() ++ } ++ } ++ impl ::hash::Hash for __c_anonymous_uc_sigmask_with_padding { ++ fn hash(&self, state: &mut H) { ++ self.uc_sigmask.hash(state) ++ // Ignore padding ++ } ++ } ++ ++ impl PartialEq for __c_anonymous_uc_sigmask { ++ fn eq(&self, other: &__c_anonymous_uc_sigmask) -> bool { ++ unsafe { self.uc_sigmask == other.uc_sigmask } ++ } ++ } ++ impl Eq for __c_anonymous_uc_sigmask {} ++ impl ::fmt::Debug for __c_anonymous_uc_sigmask { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("uc_sigmask") ++ .field("uc_sigmask", unsafe { &self.uc_sigmask }) ++ .finish() ++ } ++ } ++ impl ::hash::Hash for __c_anonymous_uc_sigmask { ++ fn hash(&self, state: &mut H) { ++ unsafe { self.uc_sigmask.hash(state) } ++ } ++ } ++ ++ impl PartialEq for ucontext_t { ++ fn eq(&self, other: &Self) -> bool { ++ self.uc_flags == other.uc_flags ++ && self.uc_link == other.uc_link ++ && self.uc_stack == other.uc_stack ++ && self.uc_mcontext == other.uc_mcontext ++ && self.uc_sigmask__c_anonymous_union ++ == other.uc_sigmask__c_anonymous_union ++ // Ignore padding field ++ } ++ } ++ impl Eq for ucontext_t {} ++ impl ::fmt::Debug for ucontext_t { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("ucontext_t") ++ .field("uc_flags", &self.uc_flags) ++ .field("uc_link", &self.uc_link) ++ .field("uc_stack", &self.uc_stack) ++ .field("uc_mcontext", &self.uc_mcontext) ++ .field( ++ "uc_sigmask__c_anonymous_union", ++ &self.uc_sigmask__c_anonymous_union ++ ) ++ // Ignore padding field ++ .finish() ++ } ++ } ++ impl ::hash::Hash for ucontext_t { ++ fn hash(&self, state: &mut H) { ++ self.uc_flags.hash(state); ++ self.uc_link.hash(state); ++ self.uc_stack.hash(state); ++ self.uc_mcontext.hash(state); ++ self.uc_sigmask__c_anonymous_union.hash(state); ++ // Ignore padding field ++ } ++ } ++ } ++ } ++ } ++} + + pub const O_DIRECT: ::c_int = 0x4000; + pub const O_DIRECTORY: ::c_int = 0x10000; +@@ -413,3 +552,31 @@ pub const CS: ::c_int = 13; + pub const EFL: ::c_int = 14; + pub const UESP: ::c_int = 15; + pub const SS: ::c_int = 16; ++ ++// offsets in mcontext_t.gregs from sys/ucontext.h ++pub const REG_GS: ::c_int = 0; ++pub const REG_FS: ::c_int = 1; ++pub const REG_ES: ::c_int = 2; ++pub const REG_DS: ::c_int = 3; ++pub const REG_EDI: ::c_int = 4; ++pub const REG_ESI: ::c_int = 5; ++pub const REG_EBP: ::c_int = 6; ++pub const REG_ESP: ::c_int = 7; ++pub const REG_EBX: ::c_int = 8; ++pub const REG_EDX: ::c_int = 9; ++pub const REG_ECX: ::c_int = 10; ++pub const REG_EAX: ::c_int = 11; ++pub const REG_TRAPNO: ::c_int = 12; ++pub const REG_ERR: ::c_int = 13; ++pub const REG_EIP: ::c_int = 14; ++pub const REG_CS: ::c_int = 15; ++pub const REG_EFL: ::c_int = 16; ++pub const REG_UESP: ::c_int = 17; ++pub const REG_SS: ::c_int = 18; ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/android/b64/aarch64/align.rs b/third_party/rust/libc/src/unix/linux_like/android/b64/aarch64/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..154c2c54ce6deb78622883e3805113698588e374 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/android/b64/aarch64/align.rs +@@ -0,0 +1,29 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f32; 8] ++ } ++} ++ ++s! { ++ pub struct ucontext_t { ++ pub uc_flags: ::c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: ::stack_t, ++ pub uc_sigmask: ::sigset_t, ++ pub uc_mcontext: mcontext_t, ++ } ++ ++ #[repr(align(16))] ++ pub struct mcontext_t { ++ pub fault_address: ::c_ulonglong, ++ pub regs: [::c_ulonglong; 31], ++ pub sp: ::c_ulonglong, ++ pub pc: ::c_ulonglong, ++ pub pstate: ::c_ulonglong, ++ // nested arrays to get the right size/length while being able to ++ // auto-derive traits like Debug ++ __reserved: [[u64; 32]; 16], ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/android/b64/aarch64.rs b/third_party/rust/libc/src/unix/linux_like/android/b64/aarch64/mod.rs +similarity index 98% +rename from third_party/rust/libc/src/unix/linux_like/android/b64/aarch64.rs +rename to third_party/rust/libc/src/unix/linux_like/android/b64/aarch64/mod.rs +index cb1c81b26057921b99b6f3aeb221f5152a70fc17..b7a21e153923806477dfd1b4a3da6289c8e36c57 100644 +--- a/third_party/rust/libc/src/unix/linux_like/android/b64/aarch64.rs ++++ b/third_party/rust/libc/src/unix/linux_like/android/b64/aarch64/mod.rs +@@ -322,4 +322,11 @@ pub const SYS_pwritev2: ::c_long = 287; + pub const SYS_pkey_mprotect: ::c_long = 288; + pub const SYS_pkey_alloc: ::c_long = 289; + pub const SYS_pkey_free: ::c_long = 290; +-pub const SYS_syscalls: ::c_long = 292; ++pub const SYS_syscalls: ::c_long = 436; ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/android/b64/mod.rs b/third_party/rust/libc/src/unix/linux_like/android/b64/mod.rs +index d9759bda1092a07c84739453b86accd454535c84..0f9443f1073579adc9e026bc26d043da3b97c4e9 100644 +--- a/third_party/rust/libc/src/unix/linux_like/android/b64/mod.rs ++++ b/third_party/rust/libc/src/unix/linux_like/android/b64/mod.rs +@@ -107,7 +107,7 @@ s! { + } + } + +-s_no_extra_traits!{ ++s_no_extra_traits! { + pub struct pthread_mutex_t { + value: ::c_int, + __reserved: [::c_char; 36], +@@ -126,6 +126,10 @@ s_no_extra_traits!{ + attr: i32, + __reserved: [::c_char; 36], + } ++ ++ pub struct sigset64_t { ++ __bits: [::c_ulong; 1] ++ } + } + + cfg_if! { +@@ -228,6 +232,14 @@ cfg_if! { + self.__reserved.hash(state); + } + } ++ ++ impl ::fmt::Debug for sigset64_t { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("sigset64_t") ++ .field("__bits", &self.__bits) ++ .finish() ++ } ++ } + } + } + +diff --git a/third_party/rust/libc/src/unix/linux_like/android/b64/x86_64.rs b/third_party/rust/libc/src/unix/linux_like/android/b64/x86_64.rs +deleted file mode 100644 +index 2ab6080a6d63fb899c118fceca5e9ffc00702ae8..0000000000000000000000000000000000000000 +--- a/third_party/rust/libc/src/unix/linux_like/android/b64/x86_64.rs ++++ /dev/null +@@ -1,420 +0,0 @@ +-pub type c_char = i8; +-pub type wchar_t = i32; +- +-s! { +- pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_nlink: ::c_ulong, +- pub st_mode: ::c_uint, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- pub st_rdev: ::dev_t, +- pub st_size: ::off64_t, +- pub st_blksize: ::c_long, +- pub st_blocks: ::c_long, +- pub st_atime: ::c_long, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::c_long, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::c_long, +- pub st_ctime_nsec: ::c_long, +- __unused: [::c_long; 3], +- } +- +- pub struct stat64 { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_nlink: ::c_ulong, +- pub st_mode: ::c_uint, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- pub st_rdev: ::dev_t, +- pub st_size: ::off64_t, +- pub st_blksize: ::c_long, +- pub st_blocks: ::c_long, +- pub st_atime: ::c_long, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::c_long, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::c_long, +- pub st_ctime_nsec: ::c_long, +- __unused: [::c_long; 3], +- } +-} +- +-pub const O_DIRECT: ::c_int = 0x4000; +-pub const O_DIRECTORY: ::c_int = 0x10000; +-pub const O_NOFOLLOW: ::c_int = 0x20000; +-pub const O_LARGEFILE: ::c_int = 0o0100000; +- +-pub const SIGSTKSZ: ::size_t = 8192; +-pub const MINSIGSTKSZ: ::size_t = 2048; +- +-pub const MAP_32BIT: ::c_int = 0x40; +- +-// Syscall table +- +-pub const SYS_read: ::c_long = 0; +-pub const SYS_write: ::c_long = 1; +-pub const SYS_open: ::c_long = 2; +-pub const SYS_close: ::c_long = 3; +-pub const SYS_stat: ::c_long = 4; +-pub const SYS_fstat: ::c_long = 5; +-pub const SYS_lstat: ::c_long = 6; +-pub const SYS_poll: ::c_long = 7; +-pub const SYS_lseek: ::c_long = 8; +-pub const SYS_mmap: ::c_long = 9; +-pub const SYS_mprotect: ::c_long = 10; +-pub const SYS_munmap: ::c_long = 11; +-pub const SYS_brk: ::c_long = 12; +-pub const SYS_rt_sigaction: ::c_long = 13; +-pub const SYS_rt_sigprocmask: ::c_long = 14; +-pub const SYS_rt_sigreturn: ::c_long = 15; +-pub const SYS_ioctl: ::c_long = 16; +-pub const SYS_pread64: ::c_long = 17; +-pub const SYS_pwrite64: ::c_long = 18; +-pub const SYS_readv: ::c_long = 19; +-pub const SYS_writev: ::c_long = 20; +-pub const SYS_access: ::c_long = 21; +-pub const SYS_pipe: ::c_long = 22; +-pub const SYS_select: ::c_long = 23; +-pub const SYS_sched_yield: ::c_long = 24; +-pub const SYS_mremap: ::c_long = 25; +-pub const SYS_msync: ::c_long = 26; +-pub const SYS_mincore: ::c_long = 27; +-pub const SYS_madvise: ::c_long = 28; +-pub const SYS_shmget: ::c_long = 29; +-pub const SYS_shmat: ::c_long = 30; +-pub const SYS_shmctl: ::c_long = 31; +-pub const SYS_dup: ::c_long = 32; +-pub const SYS_dup2: ::c_long = 33; +-pub const SYS_pause: ::c_long = 34; +-pub const SYS_nanosleep: ::c_long = 35; +-pub const SYS_getitimer: ::c_long = 36; +-pub const SYS_alarm: ::c_long = 37; +-pub const SYS_setitimer: ::c_long = 38; +-pub const SYS_getpid: ::c_long = 39; +-pub const SYS_sendfile: ::c_long = 40; +-pub const SYS_socket: ::c_long = 41; +-pub const SYS_connect: ::c_long = 42; +-pub const SYS_accept: ::c_long = 43; +-pub const SYS_sendto: ::c_long = 44; +-pub const SYS_recvfrom: ::c_long = 45; +-pub const SYS_sendmsg: ::c_long = 46; +-pub const SYS_recvmsg: ::c_long = 47; +-pub const SYS_shutdown: ::c_long = 48; +-pub const SYS_bind: ::c_long = 49; +-pub const SYS_listen: ::c_long = 50; +-pub const SYS_getsockname: ::c_long = 51; +-pub const SYS_getpeername: ::c_long = 52; +-pub const SYS_socketpair: ::c_long = 53; +-pub const SYS_setsockopt: ::c_long = 54; +-pub const SYS_getsockopt: ::c_long = 55; +-pub const SYS_clone: ::c_long = 56; +-pub const SYS_fork: ::c_long = 57; +-pub const SYS_vfork: ::c_long = 58; +-pub const SYS_execve: ::c_long = 59; +-pub const SYS_exit: ::c_long = 60; +-pub const SYS_wait4: ::c_long = 61; +-pub const SYS_kill: ::c_long = 62; +-pub const SYS_uname: ::c_long = 63; +-pub const SYS_semget: ::c_long = 64; +-pub const SYS_semop: ::c_long = 65; +-pub const SYS_semctl: ::c_long = 66; +-pub const SYS_shmdt: ::c_long = 67; +-pub const SYS_msgget: ::c_long = 68; +-pub const SYS_msgsnd: ::c_long = 69; +-pub const SYS_msgrcv: ::c_long = 70; +-pub const SYS_msgctl: ::c_long = 71; +-pub const SYS_fcntl: ::c_long = 72; +-pub const SYS_flock: ::c_long = 73; +-pub const SYS_fsync: ::c_long = 74; +-pub const SYS_fdatasync: ::c_long = 75; +-pub const SYS_truncate: ::c_long = 76; +-pub const SYS_ftruncate: ::c_long = 77; +-pub const SYS_getdents: ::c_long = 78; +-pub const SYS_getcwd: ::c_long = 79; +-pub const SYS_chdir: ::c_long = 80; +-pub const SYS_fchdir: ::c_long = 81; +-pub const SYS_rename: ::c_long = 82; +-pub const SYS_mkdir: ::c_long = 83; +-pub const SYS_rmdir: ::c_long = 84; +-pub const SYS_creat: ::c_long = 85; +-pub const SYS_link: ::c_long = 86; +-pub const SYS_unlink: ::c_long = 87; +-pub const SYS_symlink: ::c_long = 88; +-pub const SYS_readlink: ::c_long = 89; +-pub const SYS_chmod: ::c_long = 90; +-pub const SYS_fchmod: ::c_long = 91; +-pub const SYS_chown: ::c_long = 92; +-pub const SYS_fchown: ::c_long = 93; +-pub const SYS_lchown: ::c_long = 94; +-pub const SYS_umask: ::c_long = 95; +-pub const SYS_gettimeofday: ::c_long = 96; +-pub const SYS_getrlimit: ::c_long = 97; +-pub const SYS_getrusage: ::c_long = 98; +-pub const SYS_sysinfo: ::c_long = 99; +-pub const SYS_times: ::c_long = 100; +-pub const SYS_ptrace: ::c_long = 101; +-pub const SYS_getuid: ::c_long = 102; +-pub const SYS_syslog: ::c_long = 103; +-pub const SYS_getgid: ::c_long = 104; +-pub const SYS_setuid: ::c_long = 105; +-pub const SYS_setgid: ::c_long = 106; +-pub const SYS_geteuid: ::c_long = 107; +-pub const SYS_getegid: ::c_long = 108; +-pub const SYS_setpgid: ::c_long = 109; +-pub const SYS_getppid: ::c_long = 110; +-pub const SYS_getpgrp: ::c_long = 111; +-pub const SYS_setsid: ::c_long = 112; +-pub const SYS_setreuid: ::c_long = 113; +-pub const SYS_setregid: ::c_long = 114; +-pub const SYS_getgroups: ::c_long = 115; +-pub const SYS_setgroups: ::c_long = 116; +-pub const SYS_setresuid: ::c_long = 117; +-pub const SYS_getresuid: ::c_long = 118; +-pub const SYS_setresgid: ::c_long = 119; +-pub const SYS_getresgid: ::c_long = 120; +-pub const SYS_getpgid: ::c_long = 121; +-pub const SYS_setfsuid: ::c_long = 122; +-pub const SYS_setfsgid: ::c_long = 123; +-pub const SYS_getsid: ::c_long = 124; +-pub const SYS_capget: ::c_long = 125; +-pub const SYS_capset: ::c_long = 126; +-pub const SYS_rt_sigpending: ::c_long = 127; +-pub const SYS_rt_sigtimedwait: ::c_long = 128; +-pub const SYS_rt_sigqueueinfo: ::c_long = 129; +-pub const SYS_rt_sigsuspend: ::c_long = 130; +-pub const SYS_sigaltstack: ::c_long = 131; +-pub const SYS_utime: ::c_long = 132; +-pub const SYS_mknod: ::c_long = 133; +-pub const SYS_uselib: ::c_long = 134; +-pub const SYS_personality: ::c_long = 135; +-pub const SYS_ustat: ::c_long = 136; +-pub const SYS_statfs: ::c_long = 137; +-pub const SYS_fstatfs: ::c_long = 138; +-pub const SYS_sysfs: ::c_long = 139; +-pub const SYS_getpriority: ::c_long = 140; +-pub const SYS_setpriority: ::c_long = 141; +-pub const SYS_sched_setparam: ::c_long = 142; +-pub const SYS_sched_getparam: ::c_long = 143; +-pub const SYS_sched_setscheduler: ::c_long = 144; +-pub const SYS_sched_getscheduler: ::c_long = 145; +-pub const SYS_sched_get_priority_max: ::c_long = 146; +-pub const SYS_sched_get_priority_min: ::c_long = 147; +-pub const SYS_sched_rr_get_interval: ::c_long = 148; +-pub const SYS_mlock: ::c_long = 149; +-pub const SYS_munlock: ::c_long = 150; +-pub const SYS_mlockall: ::c_long = 151; +-pub const SYS_munlockall: ::c_long = 152; +-pub const SYS_vhangup: ::c_long = 153; +-pub const SYS_modify_ldt: ::c_long = 154; +-pub const SYS_pivot_root: ::c_long = 155; +-// FIXME: SYS__sysctl is in the NDK sources but for some reason is +-// not available in the tests +-// pub const SYS__sysctl: ::c_long = 156; +-pub const SYS_prctl: ::c_long = 157; +-pub const SYS_arch_prctl: ::c_long = 158; +-pub const SYS_adjtimex: ::c_long = 159; +-pub const SYS_setrlimit: ::c_long = 160; +-pub const SYS_chroot: ::c_long = 161; +-pub const SYS_sync: ::c_long = 162; +-pub const SYS_acct: ::c_long = 163; +-pub const SYS_settimeofday: ::c_long = 164; +-pub const SYS_mount: ::c_long = 165; +-pub const SYS_umount2: ::c_long = 166; +-pub const SYS_swapon: ::c_long = 167; +-pub const SYS_swapoff: ::c_long = 168; +-pub const SYS_reboot: ::c_long = 169; +-pub const SYS_sethostname: ::c_long = 170; +-pub const SYS_setdomainname: ::c_long = 171; +-pub const SYS_iopl: ::c_long = 172; +-pub const SYS_ioperm: ::c_long = 173; +-pub const SYS_create_module: ::c_long = 174; +-pub const SYS_init_module: ::c_long = 175; +-pub const SYS_delete_module: ::c_long = 176; +-pub const SYS_get_kernel_syms: ::c_long = 177; +-pub const SYS_query_module: ::c_long = 178; +-pub const SYS_quotactl: ::c_long = 179; +-pub const SYS_nfsservctl: ::c_long = 180; +-pub const SYS_getpmsg: ::c_long = 181; +-pub const SYS_putpmsg: ::c_long = 182; +-pub const SYS_afs_syscall: ::c_long = 183; +-pub const SYS_tuxcall: ::c_long = 184; +-pub const SYS_security: ::c_long = 185; +-pub const SYS_gettid: ::c_long = 186; +-pub const SYS_readahead: ::c_long = 187; +-pub const SYS_setxattr: ::c_long = 188; +-pub const SYS_lsetxattr: ::c_long = 189; +-pub const SYS_fsetxattr: ::c_long = 190; +-pub const SYS_getxattr: ::c_long = 191; +-pub const SYS_lgetxattr: ::c_long = 192; +-pub const SYS_fgetxattr: ::c_long = 193; +-pub const SYS_listxattr: ::c_long = 194; +-pub const SYS_llistxattr: ::c_long = 195; +-pub const SYS_flistxattr: ::c_long = 196; +-pub const SYS_removexattr: ::c_long = 197; +-pub const SYS_lremovexattr: ::c_long = 198; +-pub const SYS_fremovexattr: ::c_long = 199; +-pub const SYS_tkill: ::c_long = 200; +-pub const SYS_time: ::c_long = 201; +-pub const SYS_futex: ::c_long = 202; +-pub const SYS_sched_setaffinity: ::c_long = 203; +-pub const SYS_sched_getaffinity: ::c_long = 204; +-pub const SYS_set_thread_area: ::c_long = 205; +-pub const SYS_io_setup: ::c_long = 206; +-pub const SYS_io_destroy: ::c_long = 207; +-pub const SYS_io_getevents: ::c_long = 208; +-pub const SYS_io_submit: ::c_long = 209; +-pub const SYS_io_cancel: ::c_long = 210; +-pub const SYS_get_thread_area: ::c_long = 211; +-pub const SYS_lookup_dcookie: ::c_long = 212; +-pub const SYS_epoll_create: ::c_long = 213; +-pub const SYS_epoll_ctl_old: ::c_long = 214; +-pub const SYS_epoll_wait_old: ::c_long = 215; +-pub const SYS_remap_file_pages: ::c_long = 216; +-pub const SYS_getdents64: ::c_long = 217; +-pub const SYS_set_tid_address: ::c_long = 218; +-pub const SYS_restart_syscall: ::c_long = 219; +-pub const SYS_semtimedop: ::c_long = 220; +-pub const SYS_fadvise64: ::c_long = 221; +-pub const SYS_timer_create: ::c_long = 222; +-pub const SYS_timer_settime: ::c_long = 223; +-pub const SYS_timer_gettime: ::c_long = 224; +-pub const SYS_timer_getoverrun: ::c_long = 225; +-pub const SYS_timer_delete: ::c_long = 226; +-pub const SYS_clock_settime: ::c_long = 227; +-pub const SYS_clock_gettime: ::c_long = 228; +-pub const SYS_clock_getres: ::c_long = 229; +-pub const SYS_clock_nanosleep: ::c_long = 230; +-pub const SYS_exit_group: ::c_long = 231; +-pub const SYS_epoll_wait: ::c_long = 232; +-pub const SYS_epoll_ctl: ::c_long = 233; +-pub const SYS_tgkill: ::c_long = 234; +-pub const SYS_utimes: ::c_long = 235; +-pub const SYS_vserver: ::c_long = 236; +-pub const SYS_mbind: ::c_long = 237; +-pub const SYS_set_mempolicy: ::c_long = 238; +-pub const SYS_get_mempolicy: ::c_long = 239; +-pub const SYS_mq_open: ::c_long = 240; +-pub const SYS_mq_unlink: ::c_long = 241; +-pub const SYS_mq_timedsend: ::c_long = 242; +-pub const SYS_mq_timedreceive: ::c_long = 243; +-pub const SYS_mq_notify: ::c_long = 244; +-pub const SYS_mq_getsetattr: ::c_long = 245; +-pub const SYS_kexec_load: ::c_long = 246; +-pub const SYS_waitid: ::c_long = 247; +-pub const SYS_add_key: ::c_long = 248; +-pub const SYS_request_key: ::c_long = 249; +-pub const SYS_keyctl: ::c_long = 250; +-pub const SYS_ioprio_set: ::c_long = 251; +-pub const SYS_ioprio_get: ::c_long = 252; +-pub const SYS_inotify_init: ::c_long = 253; +-pub const SYS_inotify_add_watch: ::c_long = 254; +-pub const SYS_inotify_rm_watch: ::c_long = 255; +-pub const SYS_migrate_pages: ::c_long = 256; +-pub const SYS_openat: ::c_long = 257; +-pub const SYS_mkdirat: ::c_long = 258; +-pub const SYS_mknodat: ::c_long = 259; +-pub const SYS_fchownat: ::c_long = 260; +-pub const SYS_futimesat: ::c_long = 261; +-pub const SYS_newfstatat: ::c_long = 262; +-pub const SYS_unlinkat: ::c_long = 263; +-pub const SYS_renameat: ::c_long = 264; +-pub const SYS_linkat: ::c_long = 265; +-pub const SYS_symlinkat: ::c_long = 266; +-pub const SYS_readlinkat: ::c_long = 267; +-pub const SYS_fchmodat: ::c_long = 268; +-pub const SYS_faccessat: ::c_long = 269; +-pub const SYS_pselect6: ::c_long = 270; +-pub const SYS_ppoll: ::c_long = 271; +-pub const SYS_unshare: ::c_long = 272; +-pub const SYS_set_robust_list: ::c_long = 273; +-pub const SYS_get_robust_list: ::c_long = 274; +-pub const SYS_splice: ::c_long = 275; +-pub const SYS_tee: ::c_long = 276; +-pub const SYS_sync_file_range: ::c_long = 277; +-pub const SYS_vmsplice: ::c_long = 278; +-pub const SYS_move_pages: ::c_long = 279; +-pub const SYS_utimensat: ::c_long = 280; +-pub const SYS_epoll_pwait: ::c_long = 281; +-pub const SYS_signalfd: ::c_long = 282; +-pub const SYS_timerfd_create: ::c_long = 283; +-pub const SYS_eventfd: ::c_long = 284; +-pub const SYS_fallocate: ::c_long = 285; +-pub const SYS_timerfd_settime: ::c_long = 286; +-pub const SYS_timerfd_gettime: ::c_long = 287; +-pub const SYS_accept4: ::c_long = 288; +-pub const SYS_signalfd4: ::c_long = 289; +-pub const SYS_eventfd2: ::c_long = 290; +-pub const SYS_epoll_create1: ::c_long = 291; +-pub const SYS_dup3: ::c_long = 292; +-pub const SYS_pipe2: ::c_long = 293; +-pub const SYS_inotify_init1: ::c_long = 294; +-pub const SYS_preadv: ::c_long = 295; +-pub const SYS_pwritev: ::c_long = 296; +-pub const SYS_rt_tgsigqueueinfo: ::c_long = 297; +-pub const SYS_perf_event_open: ::c_long = 298; +-pub const SYS_recvmmsg: ::c_long = 299; +-pub const SYS_fanotify_init: ::c_long = 300; +-pub const SYS_fanotify_mark: ::c_long = 301; +-pub const SYS_prlimit64: ::c_long = 302; +-pub const SYS_name_to_handle_at: ::c_long = 303; +-pub const SYS_open_by_handle_at: ::c_long = 304; +-pub const SYS_clock_adjtime: ::c_long = 305; +-pub const SYS_syncfs: ::c_long = 306; +-pub const SYS_sendmmsg: ::c_long = 307; +-pub const SYS_setns: ::c_long = 308; +-pub const SYS_getcpu: ::c_long = 309; +-pub const SYS_process_vm_readv: ::c_long = 310; +-pub const SYS_process_vm_writev: ::c_long = 311; +-pub const SYS_kcmp: ::c_long = 312; +-pub const SYS_finit_module: ::c_long = 313; +-pub const SYS_sched_setattr: ::c_long = 314; +-pub const SYS_sched_getattr: ::c_long = 315; +-pub const SYS_renameat2: ::c_long = 316; +-pub const SYS_seccomp: ::c_long = 317; +-pub const SYS_getrandom: ::c_long = 318; +-pub const SYS_memfd_create: ::c_long = 319; +-pub const SYS_kexec_file_load: ::c_long = 320; +-pub const SYS_bpf: ::c_long = 321; +-pub const SYS_execveat: ::c_long = 322; +-pub const SYS_userfaultfd: ::c_long = 323; +-pub const SYS_membarrier: ::c_long = 324; +-pub const SYS_mlock2: ::c_long = 325; +-pub const SYS_copy_file_range: ::c_long = 326; +-pub const SYS_preadv2: ::c_long = 327; +-pub const SYS_pwritev2: ::c_long = 328; +-pub const SYS_pkey_mprotect: ::c_long = 329; +-pub const SYS_pkey_alloc: ::c_long = 330; +-pub const SYS_pkey_free: ::c_long = 331; +- +-// offsets in user_regs_structs, from sys/reg.h +-pub const R15: ::c_int = 0; +-pub const R14: ::c_int = 1; +-pub const R13: ::c_int = 2; +-pub const R12: ::c_int = 3; +-pub const RBP: ::c_int = 4; +-pub const RBX: ::c_int = 5; +-pub const R11: ::c_int = 6; +-pub const R10: ::c_int = 7; +-pub const R9: ::c_int = 8; +-pub const R8: ::c_int = 9; +-pub const RAX: ::c_int = 10; +-pub const RCX: ::c_int = 11; +-pub const RDX: ::c_int = 12; +-pub const RSI: ::c_int = 13; +-pub const RDI: ::c_int = 14; +-pub const ORIG_RAX: ::c_int = 15; +-pub const RIP: ::c_int = 16; +-pub const CS: ::c_int = 17; +-pub const EFLAGS: ::c_int = 18; +-pub const RSP: ::c_int = 19; +-pub const SS: ::c_int = 20; +-pub const FS_BASE: ::c_int = 21; +-pub const GS_BASE: ::c_int = 22; +-pub const DS: ::c_int = 23; +-pub const ES: ::c_int = 24; +-pub const FS: ::c_int = 25; +-pub const GS: ::c_int = 26; +diff --git a/third_party/rust/libc/src/unix/linux_like/android/b64/x86_64/align.rs b/third_party/rust/libc/src/unix/linux_like/android/b64/x86_64/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..7ca870fd02b71e31e44439e3fabdf1386eb75bb9 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/android/b64/x86_64/align.rs +@@ -0,0 +1,7 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 4] ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/x86_64.rs b/third_party/rust/libc/src/unix/linux_like/android/b64/x86_64/mod.rs +similarity index 67% +rename from third_party/rust/libc/src/unix/linux_like/linux/musl/b64/x86_64.rs +rename to third_party/rust/libc/src/unix/linux_like/android/b64/x86_64/mod.rs +index b4023f726c293743234e815ca723c5419f7859a3..27fd17b3ffb34e4b8f08304c29c9be3baa4faaa5 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/x86_64.rs ++++ b/third_party/rust/libc/src/unix/linux_like/android/b64/x86_64/mod.rs +@@ -1,99 +1,236 @@ + pub type c_char = i8; + pub type wchar_t = i32; +-pub type nlink_t = u64; +-pub type blksize_t = ::c_long; +-pub type __u64 = ::c_ulonglong; ++pub type greg_t = i64; + + s! { + 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_nlink: ::c_ulong, ++ pub st_mode: ::c_uint, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, +- __pad0: ::c_int, + pub st_rdev: ::dev_t, +- pub st_size: ::off_t, +- pub st_blksize: ::blksize_t, +- pub st_blocks: ::blkcnt_t, +- pub st_atime: ::time_t, ++ pub st_size: ::off64_t, ++ pub st_blksize: ::c_long, ++ pub st_blocks: ::c_long, ++ pub st_atime: ::c_long, + pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, ++ pub st_mtime: ::c_long, + pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, ++ pub st_ctime: ::c_long, + pub st_ctime_nsec: ::c_long, + __unused: [::c_long; 3], + } + + pub struct stat64 { + pub st_dev: ::dev_t, +- pub st_ino: ::ino64_t, +- pub st_nlink: ::nlink_t, +- pub st_mode: ::mode_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::c_ulong, ++ pub st_mode: ::c_uint, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, +- __pad0: ::c_int, + pub st_rdev: ::dev_t, +- pub st_size: ::off_t, +- pub st_blksize: ::blksize_t, +- pub st_blocks: ::blkcnt64_t, +- pub st_atime: ::time_t, ++ pub st_size: ::off64_t, ++ pub st_blksize: ::c_long, ++ pub st_blocks: ::c_long, ++ pub st_atime: ::c_long, + pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, ++ pub st_mtime: ::c_long, + pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, ++ pub st_ctime: ::c_long, + pub st_ctime_nsec: ::c_long, +- __reserved: [::c_long; 3], ++ __unused: [::c_long; 3], + } + +- pub struct mcontext_t { +- __private: [u64; 32], ++ pub struct _libc_xmmreg { ++ pub element: [u32; 4], + } ++} + +- pub struct ipc_perm { +- pub __ipc_perm_key: ::key_t, +- pub uid: ::uid_t, +- pub gid: ::gid_t, +- pub cuid: ::uid_t, +- pub cgid: ::gid_t, +- pub mode: ::mode_t, +- pub __seq: ::c_int, +- __unused1: ::c_long, +- __unused2: ::c_long ++cfg_if! { ++ if #[cfg(libc_union)] { ++ s_no_extra_traits! { ++ pub union __c_anonymous_uc_sigmask { ++ uc_sigmask: ::sigset_t, ++ uc_sigmask64: ::sigset64_t, ++ } ++ } ++ ++ cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for __c_anonymous_uc_sigmask { ++ fn eq(&self, other: &__c_anonymous_uc_sigmask) -> bool { ++ unsafe { self.uc_sigmask == other.uc_sigmask } ++ } ++ } ++ impl Eq for __c_anonymous_uc_sigmask {} ++ impl ::fmt::Debug for __c_anonymous_uc_sigmask { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("uc_sigmask") ++ .field("uc_sigmask", unsafe { &self.uc_sigmask }) ++ .finish() ++ } ++ } ++ impl ::hash::Hash for __c_anonymous_uc_sigmask { ++ fn hash(&self, state: &mut H) { ++ unsafe { self.uc_sigmask.hash(state) } ++ } ++ } ++ } ++ } + } + } + +-s_no_extra_traits!{ ++s_no_extra_traits! { ++ pub struct _libc_fpxreg { ++ pub significand: [u16; 4], ++ pub exponent: u16, ++ __padding: [u16; 3], ++ } ++ ++ pub struct _libc_fpstate { ++ pub cwd: u16, ++ pub swd: u16, ++ pub ftw: u16, ++ pub fop: u16, ++ pub rip: u64, ++ pub rdp: u64, ++ pub mxcsr: u32, ++ pub mxcr_mask: u32, ++ pub _st: [_libc_fpxreg; 8], ++ pub _xmm: [_libc_xmmreg; 16], ++ __private: [u32; 24], ++ } ++ ++ pub struct mcontext_t { ++ pub gregs: [greg_t; 23], ++ pub fpregs: *mut _libc_fpstate, ++ __private: [u64; 8], ++ } ++ + 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, +- __private: [u8; 512], ++ pub uc_sigmask64: __c_anonymous_uc_sigmask, ++ __fpregs_mem: _libc_fpstate, + } + } + + cfg_if! { + if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for _libc_fpxreg { ++ fn eq(&self, other: &Self) -> bool { ++ self.significand == other.significand ++ && self.exponent == other.exponent ++ // Ignore padding field ++ } ++ } ++ impl Eq for _libc_fpxreg {} ++ impl ::fmt::Debug for _libc_fpxreg { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("_libc_fpxreg") ++ .field("significand", &self.significand) ++ .field("exponent", &self.exponent) ++ // Ignore padding field ++ .finish() ++ } ++ } ++ impl ::hash::Hash for _libc_fpxreg { ++ fn hash(&self, state: &mut H) { ++ self.significand.hash(state); ++ self.exponent.hash(state); ++ // Ignore padding field ++ } ++ } ++ ++ impl PartialEq for _libc_fpstate { ++ fn eq(&self, other: &Self) -> bool { ++ self.cwd == other.cwd ++ && self.swd == other.swd ++ && self.ftw == other.ftw ++ && self.fop == other.fop ++ && self.rip == other.rip ++ && self.rdp == other.rdp ++ && self.mxcsr == other.mxcsr ++ && self.mxcr_mask == other.mxcr_mask ++ && self._st == other._st ++ && self._xmm == other._xmm ++ // Ignore padding field ++ } ++ } ++ impl Eq for _libc_fpstate {} ++ impl ::fmt::Debug for _libc_fpstate { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("_libc_fpstate") ++ .field("cwd", &self.cwd) ++ .field("swd", &self.swd) ++ .field("ftw", &self.ftw) ++ .field("fop", &self.fop) ++ .field("rip", &self.rip) ++ .field("rdp", &self.rdp) ++ .field("mxcsr", &self.mxcsr) ++ .field("mxcr_mask", &self.mxcr_mask) ++ .field("_st", &self._st) ++ .field("_xmm", &self._xmm) ++ // Ignore padding field ++ .finish() ++ } ++ } ++ impl ::hash::Hash for _libc_fpstate { ++ fn hash(&self, state: &mut H) { ++ self.cwd.hash(state); ++ self.swd.hash(state); ++ self.ftw.hash(state); ++ self.fop.hash(state); ++ self.rip.hash(state); ++ self.rdp.hash(state); ++ self.mxcsr.hash(state); ++ self.mxcr_mask.hash(state); ++ self._st.hash(state); ++ self._xmm.hash(state); ++ // Ignore padding field ++ } ++ } ++ ++ impl PartialEq for mcontext_t { ++ fn eq(&self, other: &Self) -> bool { ++ self.gregs == other.gregs ++ && self.fpregs == other.fpregs ++ // Ignore padding field ++ } ++ } ++ impl Eq for mcontext_t {} ++ impl ::fmt::Debug for mcontext_t { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("mcontext_t") ++ .field("gregs", &self.gregs) ++ .field("fpregs", &self.fpregs) ++ // Ignore padding field ++ .finish() ++ } ++ } ++ impl ::hash::Hash for mcontext_t { ++ fn hash(&self, state: &mut H) { ++ self.gregs.hash(state); ++ self.fpregs.hash(state); ++ // Ignore padding field ++ } ++ } ++ + impl PartialEq for ucontext_t { +- fn eq(&self, other: &ucontext_t) -> bool { ++ fn eq(&self, other: &Self) -> bool { + self.uc_flags == other.uc_flags + && self.uc_link == other.uc_link + && self.uc_stack == other.uc_stack + && self.uc_mcontext == other.uc_mcontext +- && self.uc_sigmask == other.uc_sigmask +- && self +- .__private +- .iter() +- .zip(other.__private.iter()) +- .all(|(a,b)| a == b) ++ && self.uc_sigmask64 == other.uc_sigmask64 ++ // Ignore padding field + } + } +- + impl Eq for ucontext_t {} +- + impl ::fmt::Debug for ucontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ucontext_t") +@@ -101,25 +238,34 @@ cfg_if! { + .field("uc_link", &self.uc_link) + .field("uc_stack", &self.uc_stack) + .field("uc_mcontext", &self.uc_mcontext) +- .field("uc_sigmask", &self.uc_sigmask) +- // Ignore __private field ++ .field("uc_sigmask64", &self.uc_sigmask64) ++ // Ignore padding field + .finish() + } + } +- + impl ::hash::Hash for ucontext_t { + fn hash(&self, state: &mut H) { + self.uc_flags.hash(state); + self.uc_link.hash(state); + self.uc_stack.hash(state); + self.uc_mcontext.hash(state); +- self.uc_sigmask.hash(state); +- self.__private.hash(state); ++ self.uc_sigmask64.hash(state); ++ // Ignore padding field + } + } + } + } + ++pub const O_DIRECT: ::c_int = 0x4000; ++pub const O_DIRECTORY: ::c_int = 0x10000; ++pub const O_NOFOLLOW: ::c_int = 0x20000; ++pub const O_LARGEFILE: ::c_int = 0o0100000; ++ ++pub const SIGSTKSZ: ::size_t = 8192; ++pub const MINSIGSTKSZ: ::size_t = 2048; ++ ++pub const MAP_32BIT: ::c_int = 0x40; ++ + // Syscall table + + pub const SYS_read: ::c_long = 0; +@@ -278,7 +424,9 @@ pub const SYS_munlockall: ::c_long = 152; + pub const SYS_vhangup: ::c_long = 153; + pub const SYS_modify_ldt: ::c_long = 154; + pub const SYS_pivot_root: ::c_long = 155; +-pub const SYS__sysctl: ::c_long = 156; ++// FIXME: SYS__sysctl is in the NDK sources but for some reason is ++// not available in the tests ++// pub const SYS__sysctl: ::c_long = 156; + pub const SYS_prctl: ::c_long = 157; + pub const SYS_arch_prctl: ::c_long = 158; + pub const SYS_adjtimex: ::c_long = 159; +@@ -451,8 +599,9 @@ pub const SYS_mlock2: ::c_long = 325; + pub const SYS_copy_file_range: ::c_long = 326; + pub const SYS_preadv2: ::c_long = 327; + pub const SYS_pwritev2: ::c_long = 328; +-// FIXME syscalls 329-331 have been added in musl 1.16 +-// See discussion https://github.com/rust-lang/libc/pull/699 ++pub const SYS_pkey_mprotect: ::c_long = 329; ++pub const SYS_pkey_alloc: ::c_long = 330; ++pub const SYS_pkey_free: ::c_long = 331; + + // offsets in user_regs_structs, from sys/reg.h + pub const R15: ::c_int = 0; +@@ -483,152 +632,34 @@ pub const ES: ::c_int = 24; + pub const FS: ::c_int = 25; + pub const GS: ::c_int = 26; + +-pub const MADV_SOFT_OFFLINE: ::c_int = 101; +-pub const MAP_32BIT: ::c_int = 0x0040; +-pub const O_DIRECT: ::c_int = 0x4000; +-pub const O_DIRECTORY: ::c_int = 0x10000; +-pub const O_LARGEFILE: ::c_int = 0; +-pub const O_NOFOLLOW: ::c_int = 0x20000; ++// offsets in mcontext_t.gregs from sys/ucontext.h ++pub const REG_R8: ::c_int = 0; ++pub const REG_R9: ::c_int = 1; ++pub const REG_R10: ::c_int = 2; ++pub const REG_R11: ::c_int = 3; ++pub const REG_R12: ::c_int = 4; ++pub const REG_R13: ::c_int = 5; ++pub const REG_R14: ::c_int = 6; ++pub const REG_R15: ::c_int = 7; ++pub const REG_RDI: ::c_int = 8; ++pub const REG_RSI: ::c_int = 9; ++pub const REG_RBP: ::c_int = 10; ++pub const REG_RBX: ::c_int = 11; ++pub const REG_RDX: ::c_int = 12; ++pub const REG_RAX: ::c_int = 13; ++pub const REG_RCX: ::c_int = 14; ++pub const REG_RSP: ::c_int = 15; ++pub const REG_RIP: ::c_int = 16; ++pub const REG_EFL: ::c_int = 17; ++pub const REG_CSGSFS: ::c_int = 18; ++pub const REG_ERR: ::c_int = 19; ++pub const REG_TRAPNO: ::c_int = 20; ++pub const REG_OLDMASK: ::c_int = 21; ++pub const REG_CR2: ::c_int = 22; + +-pub const TIOCGRS485: ::c_int = 0x542E; +-pub const TIOCSRS485: ::c_int = 0x542F; +- +-pub const SIGSTKSZ: ::size_t = 8192; +-pub const MINSIGSTKSZ: ::size_t = 2048; +- +-pub const RLIMIT_NLIMITS: ::c_int = 15; +-pub const TIOCINQ: ::c_int = ::FIONREAD; +-pub const MCL_CURRENT: ::c_int = 0x0001; +-pub const MCL_FUTURE: ::c_int = 0x0002; +-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; +-pub const CIBAUD: ::tcflag_t = 0o02003600000; +-pub const CBAUDEX: ::tcflag_t = 0o010000; +-pub const VSWTC: usize = 7; +-pub const OLCUC: ::tcflag_t = 0o000002; +-pub const NLDLY: ::tcflag_t = 0o000400; +-pub const CRDLY: ::tcflag_t = 0o003000; +-pub const TABDLY: ::tcflag_t = 0o014000; +-pub const BSDLY: ::tcflag_t = 0o020000; +-pub const FFDLY: ::tcflag_t = 0o100000; +-pub const VTDLY: ::tcflag_t = 0o040000; +-pub const XTABS: ::tcflag_t = 0o014000; +-pub const B57600: ::speed_t = 0o010001; +-pub const B115200: ::speed_t = 0o010002; +-pub const B230400: ::speed_t = 0o010003; +-pub const B460800: ::speed_t = 0o010004; +-pub const B500000: ::speed_t = 0o010005; +-pub const B576000: ::speed_t = 0o010006; +-pub const B921600: ::speed_t = 0o010007; +-pub const B1000000: ::speed_t = 0o010010; +-pub const B1152000: ::speed_t = 0o010011; +-pub const B1500000: ::speed_t = 0o010012; +-pub const B2000000: ::speed_t = 0o010013; +-pub const B2500000: ::speed_t = 0o010014; +-pub const B3000000: ::speed_t = 0o010015; +-pub const B3500000: ::speed_t = 0o010016; +-pub const B4000000: ::speed_t = 0o010017; +- +-pub const FIOCLEX: ::c_int = 0x5451; +-pub const FIONCLEX: ::c_int = 0x5450; +-pub const FIONBIO: ::c_int = 0x5421; +-pub const EDEADLK: ::c_int = 35; +-pub const EDEADLOCK: ::c_int = EDEADLK; +-pub const SO_PASSCRED: ::c_int = 16; +-pub const SO_PEERCRED: ::c_int = 17; +-pub const SO_RCVLOWAT: ::c_int = 18; +-pub const SO_SNDLOWAT: ::c_int = 19; +-pub const SO_RCVTIMEO: ::c_int = 20; +-pub const SO_SNDTIMEO: ::c_int = 21; +-pub const EXTPROC: ::tcflag_t = 0x00010000; +-pub const VEOL: usize = 11; +-pub const VEOL2: usize = 16; +-pub const VMIN: usize = 6; +-pub const IEXTEN: ::tcflag_t = 0x00008000; +-pub const TOSTOP: ::tcflag_t = 0x00000100; +-pub const FLUSHO: ::tcflag_t = 0x00001000; +-pub const TCGETS: ::c_int = 0x5401; +-pub const TCSETS: ::c_int = 0x5402; +-pub const TCSETSW: ::c_int = 0x5403; +-pub const TCSETSF: ::c_int = 0x5404; +-pub const TCGETA: ::c_int = 0x5405; +-pub const TCSETA: ::c_int = 0x5406; +-pub const TCSETAW: ::c_int = 0x5407; +-pub const TCSETAF: ::c_int = 0x5408; +-pub const TCSBRK: ::c_int = 0x5409; +-pub const TCXONC: ::c_int = 0x540A; +-pub const TCFLSH: ::c_int = 0x540B; +-pub const TIOCGSOFTCAR: ::c_int = 0x5419; +-pub const TIOCSSOFTCAR: ::c_int = 0x541A; +-pub const TIOCLINUX: ::c_int = 0x541C; +-pub const TIOCGSERIAL: ::c_int = 0x541E; +-pub const TIOCEXCL: ::c_int = 0x540C; +-pub const TIOCNXCL: ::c_int = 0x540D; +-pub const TIOCSCTTY: ::c_int = 0x540E; +-pub const TIOCGPGRP: ::c_int = 0x540F; +-pub const TIOCSPGRP: ::c_int = 0x5410; +-pub const TIOCOUTQ: ::c_int = 0x5411; +-pub const TIOCSTI: ::c_int = 0x5412; +-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 TIOCM_LE: ::c_int = 0x001; +-pub const TIOCM_DTR: ::c_int = 0x002; +-pub const TIOCM_RTS: ::c_int = 0x004; +-pub const TIOCM_ST: ::c_int = 0x008; +-pub const TIOCM_SR: ::c_int = 0x010; +-pub const TIOCM_CTS: ::c_int = 0x020; +-pub const TIOCM_CAR: ::c_int = 0x040; +-pub const TIOCM_RNG: ::c_int = 0x080; +-pub const TIOCM_DSR: ::c_int = 0x100; +-pub const TIOCM_CD: ::c_int = TIOCM_CAR; +-pub const TIOCM_RI: ::c_int = TIOCM_RNG; +- +-extern { +- pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } + } +- +diff --git a/third_party/rust/libc/src/unix/linux_like/android/mod.rs b/third_party/rust/libc/src/unix/linux_like/android/mod.rs +index 7cc32b082b96c10cadf16fd042ee4a8373fbcfda..280571f8ccfbe746fdd8017ae273bb625b0def7f 100644 +--- a/third_party/rust/libc/src/unix/linux_like/android/mod.rs ++++ b/third_party/rust/libc/src/unix/linux_like/android/mod.rs +@@ -19,9 +19,12 @@ pub type nfds_t = ::c_uint; + pub type rlim_t = ::c_ulong; + pub type dev_t = ::c_ulong; + pub type ino_t = ::c_ulong; ++pub type ino64_t = u64; + pub type __CPU_BITTYPE = ::c_ulong; + pub type idtype_t = ::c_int; + pub type loff_t = ::c_longlong; ++pub type __kernel_loff_t = ::c_longlong; ++pub type __kernel_pid_t = ::c_int; + + s! { + pub struct stack_t { +@@ -78,6 +81,14 @@ s! { + pub l_pid: ::pid_t, + } + ++ pub struct flock64 { ++ pub l_type: ::c_short, ++ pub l_whence: ::c_short, ++ pub l_start: ::__kernel_loff_t, ++ pub l_len: ::__kernel_loff_t, ++ pub l_pid: ::__kernel_pid_t, ++ } ++ + pub struct cpu_set_t { + #[cfg(target_pointer_width = "64")] + __bits: [__CPU_BITTYPE; 16], +@@ -137,6 +148,11 @@ s! { + _pad: [u8; 28], + } + ++ pub struct itimerspec { ++ pub it_interval: ::timespec, ++ pub it_value: ::timespec, ++ } ++ + pub struct ucred { + pub pid: ::pid_t, + pub uid: ::uid_t, +@@ -198,9 +214,19 @@ s! { + pub cookie: u32, + pub len: u32 + } ++ ++ pub struct sock_extended_err { ++ pub ee_errno: u32, ++ pub ee_origin: u8, ++ pub ee_type: u8, ++ pub ee_code: u8, ++ pub ee_pad: u8, ++ pub ee_info: u32, ++ pub ee_data: u32, ++ } + } + +-s_no_extra_traits!{ ++s_no_extra_traits! { + pub struct sockaddr_nl { + pub nl_family: ::sa_family_t, + nl_pad: ::c_ushort, +@@ -609,11 +635,27 @@ pub const EPOLLONESHOT: ::c_int = 0x40000000; + pub const EPOLLRDHUP: ::c_int = 0x00002000; + pub const EPOLLWAKEUP: ::c_int = 0x20000000; + +-pub const EFD_CLOEXEC: ::c_int = 0x80000; ++// sys/eventfd.h ++pub const EFD_SEMAPHORE: ::c_int = 0x1; ++pub const EFD_CLOEXEC: ::c_int = O_CLOEXEC; ++pub const EFD_NONBLOCK: ::c_int = O_NONBLOCK; ++ ++// sys/timerfd.h ++pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC; ++pub const TFD_NONBLOCK: ::c_int = O_NONBLOCK; ++pub const TFD_TIMER_ABSTIME: ::c_int = 1; ++pub const TFD_TIMER_CANCEL_ON_SET: ::c_int = 2; + + pub const USER_PROCESS: ::c_short = 7; + ++// linux/falloc.h ++pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01; ++pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02; ++pub const FALLOC_FL_NO_HIDE_STALE: ::c_int = 0x04; + pub const FALLOC_FL_COLLAPSE_RANGE: ::c_int = 0x08; ++pub const FALLOC_FL_ZERO_RANGE: ::c_int = 0x10; ++pub const FALLOC_FL_INSERT_RANGE: ::c_int = 0x20; ++pub const FALLOC_FL_UNSHARE_RANGE: ::c_int = 0x40; + + pub const BUFSIZ: ::c_uint = 1024; + pub const FILENAME_MAX: ::c_uint = 4096; +@@ -784,6 +826,11 @@ pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1; + pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2; + pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL; + ++// stdio.h ++pub const RENAME_NOREPLACE: ::c_int = 1; ++pub const RENAME_EXCHANGE: ::c_int = 2; ++pub const RENAME_WHITEOUT: ::c_int = 4; ++ + pub const FIOCLEX: ::c_int = 0x5451; + pub const FIONCLEX: ::c_int = 0x5450; + +@@ -798,10 +845,7 @@ pub const SIGURG: ::c_int = 23; + pub const SIGIO: ::c_int = 29; + pub const SIGSYS: ::c_int = 31; + pub const SIGSTKFLT: ::c_int = 16; +-#[deprecated( +- since = "0.2.55", +- note = "Use SIGSYS instead" +-)] ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] + pub const SIGUNUSED: ::c_int = 31; + pub const SIGTTIN: ::c_int = 21; + pub const SIGTTOU: ::c_int = 22; +@@ -824,24 +868,24 @@ 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_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; ++ | ::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_ANON: ::c_int = 0x0020; + pub const MAP_ANONYMOUS: ::c_int = 0x0020; +@@ -1080,7 +1124,7 @@ pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201; + pub const PTRACE_GETSIGINFO: ::c_int = 0x4202; + pub const PTRACE_SETSIGINFO: ::c_int = 0x4203; + +-pub const EFD_NONBLOCK: ::c_int = 0x800; ++pub const PTRACE_EVENT_STOP: ::c_int = 128; + + pub const F_GETLK: ::c_int = 5; + pub const F_GETOWN: ::c_int = 9; +@@ -1090,18 +1134,28 @@ pub const F_SETLKW: ::c_int = 7; + pub const F_RDLCK: ::c_int = 0; + pub const F_WRLCK: ::c_int = 1; + pub const F_UNLCK: ::c_int = 2; ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; + + 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_NPROC: ::c_int = 6; ++pub const RLIMIT_NOFILE: ::c_int = 7; ++pub const RLIMIT_MEMLOCK: ::c_int = 8; ++pub const RLIMIT_AS: ::c_int = 9; + pub const RLIMIT_LOCKS: ::c_int = 10; + pub const RLIMIT_SIGPENDING: ::c_int = 11; + pub const RLIMIT_MSGQUEUE: ::c_int = 12; + pub const RLIMIT_NICE: ::c_int = 13; + pub const RLIMIT_RTPRIO: ::c_int = 14; + ++pub const RLIM_INFINITY: ::rlim_t = !0; ++ + pub const TCGETS: ::c_int = 0x5401; + pub const TCSETS: ::c_int = 0x5402; + pub const TCSETSW: ::c_int = 0x5403; +@@ -1133,6 +1187,8 @@ 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 TIOCSBRK: ::c_int = 0x5427; ++pub const TIOCCBRK: ::c_int = 0x5428; + + pub const ST_RDONLY: ::c_ulong = 1; + pub const ST_NOSUID: ::c_ulong = 2; +@@ -1148,6 +1204,21 @@ pub const RTLD_NOLOAD: ::c_int = 0x4; + + pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t; + ++pub const AI_PASSIVE: ::c_int = 0x00000001; ++pub const AI_CANONNAME: ::c_int = 0x00000002; ++pub const AI_NUMERICHOST: ::c_int = 0x00000004; ++pub const AI_NUMERICSERV: ::c_int = 0x00000008; ++pub const AI_MASK: ::c_int = AI_PASSIVE ++ | AI_CANONNAME ++ | AI_NUMERICHOST ++ | AI_NUMERICSERV ++ | AI_ADDRCONFIG; ++pub const AI_ALL: ::c_int = 0x00000100; ++pub const AI_V4MAPPED_CFG: ::c_int = 0x00000200; ++pub const AI_ADDRCONFIG: ::c_int = 0x00000400; ++pub const AI_V4MAPPED: ::c_int = 0x00000800; ++pub const AI_DEFAULT: ::c_int = AI_V4MAPPED_CFG | AI_ADDRCONFIG; ++ + pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead; + pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793; + pub const LINUX_REBOOT_MAGIC2A: ::c_int = 85072278; +@@ -1207,14 +1278,14 @@ pub const ICANON: ::tcflag_t = 0x00000002; + pub const PENDIN: ::tcflag_t = 0x00004000; + pub const NOFLSH: ::tcflag_t = 0x00000080; + pub const VSWTC: usize = 7; +-pub const OLCUC: ::tcflag_t = 0o000002; +-pub const NLDLY: ::tcflag_t = 0o000400; +-pub const CRDLY: ::tcflag_t = 0o003000; ++pub const OLCUC: ::tcflag_t = 0o000002; ++pub const NLDLY: ::tcflag_t = 0o000400; ++pub const CRDLY: ::tcflag_t = 0o003000; + pub const TABDLY: ::tcflag_t = 0o014000; +-pub const BSDLY: ::tcflag_t = 0o020000; +-pub const FFDLY: ::tcflag_t = 0o100000; +-pub const VTDLY: ::tcflag_t = 0o040000; +-pub const XTABS: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const XTABS: ::tcflag_t = 0o014000; + + pub const B0: ::speed_t = 0o000000; + pub const B50: ::speed_t = 0o000001; +@@ -1310,6 +1381,149 @@ pub const NLMSG_DONE: ::c_int = 0x3; + pub const NLMSG_OVERRUN: ::c_int = 0x4; + pub const NLMSG_MIN_TYPE: ::c_int = 0x10; + ++// linux/netfilter/nfnetlink.h ++pub const NFNLGRP_NONE: ::c_int = 0; ++pub const NFNLGRP_CONNTRACK_NEW: ::c_int = 1; ++pub const NFNLGRP_CONNTRACK_UPDATE: ::c_int = 2; ++pub const NFNLGRP_CONNTRACK_DESTROY: ::c_int = 3; ++pub const NFNLGRP_CONNTRACK_EXP_NEW: ::c_int = 4; ++pub const NFNLGRP_CONNTRACK_EXP_UPDATE: ::c_int = 5; ++pub const NFNLGRP_CONNTRACK_EXP_DESTROY: ::c_int = 6; ++pub const NFNLGRP_NFTABLES: ::c_int = 7; ++pub const NFNLGRP_ACCT_QUOTA: ::c_int = 8; ++ ++pub const NFNETLINK_V0: ::c_int = 0; ++ ++pub const NFNL_SUBSYS_NONE: ::c_int = 0; ++pub const NFNL_SUBSYS_CTNETLINK: ::c_int = 1; ++pub const NFNL_SUBSYS_CTNETLINK_EXP: ::c_int = 2; ++pub const NFNL_SUBSYS_QUEUE: ::c_int = 3; ++pub const NFNL_SUBSYS_ULOG: ::c_int = 4; ++pub const NFNL_SUBSYS_OSF: ::c_int = 5; ++pub const NFNL_SUBSYS_IPSET: ::c_int = 6; ++pub const NFNL_SUBSYS_ACCT: ::c_int = 7; ++pub const NFNL_SUBSYS_CTNETLINK_TIMEOUT: ::c_int = 8; ++pub const NFNL_SUBSYS_CTHELPER: ::c_int = 9; ++pub const NFNL_SUBSYS_NFTABLES: ::c_int = 10; ++pub const NFNL_SUBSYS_NFT_COMPAT: ::c_int = 11; ++pub const NFNL_SUBSYS_COUNT: ::c_int = 12; ++ ++pub const NFNL_MSG_BATCH_BEGIN: ::c_int = NLMSG_MIN_TYPE; ++pub const NFNL_MSG_BATCH_END: ::c_int = NLMSG_MIN_TYPE + 1; ++ ++// linux/netfilter/nfnetlink_log.h ++pub const NFULNL_MSG_PACKET: ::c_int = 0; ++pub const NFULNL_MSG_CONFIG: ::c_int = 1; ++ ++pub const NFULA_UNSPEC: ::c_int = 0; ++pub const NFULA_PACKET_HDR: ::c_int = 1; ++pub const NFULA_MARK: ::c_int = 2; ++pub const NFULA_TIMESTAMP: ::c_int = 3; ++pub const NFULA_IFINDEX_INDEV: ::c_int = 4; ++pub const NFULA_IFINDEX_OUTDEV: ::c_int = 5; ++pub const NFULA_IFINDEX_PHYSINDEV: ::c_int = 6; ++pub const NFULA_IFINDEX_PHYSOUTDEV: ::c_int = 7; ++pub const NFULA_HWADDR: ::c_int = 8; ++pub const NFULA_PAYLOAD: ::c_int = 9; ++pub const NFULA_PREFIX: ::c_int = 10; ++pub const NFULA_UID: ::c_int = 11; ++pub const NFULA_SEQ: ::c_int = 12; ++pub const NFULA_SEQ_GLOBAL: ::c_int = 13; ++pub const NFULA_GID: ::c_int = 14; ++pub const NFULA_HWTYPE: ::c_int = 15; ++pub const NFULA_HWHEADER: ::c_int = 16; ++pub const NFULA_HWLEN: ::c_int = 17; ++pub const NFULA_CT: ::c_int = 18; ++pub const NFULA_CT_INFO: ::c_int = 19; ++ ++pub const NFULNL_CFG_CMD_NONE: ::c_int = 0; ++pub const NFULNL_CFG_CMD_BIND: ::c_int = 1; ++pub const NFULNL_CFG_CMD_UNBIND: ::c_int = 2; ++pub const NFULNL_CFG_CMD_PF_BIND: ::c_int = 3; ++pub const NFULNL_CFG_CMD_PF_UNBIND: ::c_int = 4; ++ ++pub const NFULA_CFG_UNSPEC: ::c_int = 0; ++pub const NFULA_CFG_CMD: ::c_int = 1; ++pub const NFULA_CFG_MODE: ::c_int = 2; ++pub const NFULA_CFG_NLBUFSIZ: ::c_int = 3; ++pub const NFULA_CFG_TIMEOUT: ::c_int = 4; ++pub const NFULA_CFG_QTHRESH: ::c_int = 5; ++pub const NFULA_CFG_FLAGS: ::c_int = 6; ++ ++pub const NFULNL_COPY_NONE: ::c_int = 0x00; ++pub const NFULNL_COPY_META: ::c_int = 0x01; ++pub const NFULNL_COPY_PACKET: ::c_int = 0x02; ++ ++pub const NFULNL_CFG_F_SEQ: ::c_int = 0x0001; ++pub const NFULNL_CFG_F_SEQ_GLOBAL: ::c_int = 0x0002; ++pub const NFULNL_CFG_F_CONNTRACK: ::c_int = 0x0004; ++ ++// linux/netfilter/nfnetlink_log.h ++pub const NFQNL_MSG_PACKET: ::c_int = 0; ++pub const NFQNL_MSG_VERDICT: ::c_int = 1; ++pub const NFQNL_MSG_CONFIG: ::c_int = 2; ++pub const NFQNL_MSG_VERDICT_BATCH: ::c_int = 3; ++ ++pub const NFQA_UNSPEC: ::c_int = 0; ++pub const NFQA_PACKET_HDR: ::c_int = 1; ++pub const NFQA_VERDICT_HDR: ::c_int = 2; ++pub const NFQA_MARK: ::c_int = 3; ++pub const NFQA_TIMESTAMP: ::c_int = 4; ++pub const NFQA_IFINDEX_INDEV: ::c_int = 5; ++pub const NFQA_IFINDEX_OUTDEV: ::c_int = 6; ++pub const NFQA_IFINDEX_PHYSINDEV: ::c_int = 7; ++pub const NFQA_IFINDEX_PHYSOUTDEV: ::c_int = 8; ++pub const NFQA_HWADDR: ::c_int = 9; ++pub const NFQA_PAYLOAD: ::c_int = 10; ++pub const NFQA_CT: ::c_int = 11; ++pub const NFQA_CT_INFO: ::c_int = 12; ++pub const NFQA_CAP_LEN: ::c_int = 13; ++pub const NFQA_SKB_INFO: ::c_int = 14; ++pub const NFQA_EXP: ::c_int = 15; ++pub const NFQA_UID: ::c_int = 16; ++pub const NFQA_GID: ::c_int = 17; ++pub const NFQA_SECCTX: ::c_int = 18; ++/* ++ FIXME: These are not yet available in musl sanitized kernel headers and ++ make the tests fail. Enable them once musl has them. ++ ++ See https://github.com/rust-lang/libc/pull/1628 for more details. ++pub const NFQA_VLAN: ::c_int = 19; ++pub const NFQA_L2HDR: ::c_int = 20; ++ ++pub const NFQA_VLAN_UNSPEC: ::c_int = 0; ++pub const NFQA_VLAN_PROTO: ::c_int = 1; ++pub const NFQA_VLAN_TCI: ::c_int = 2; ++*/ ++ ++pub const NFQNL_CFG_CMD_NONE: ::c_int = 0; ++pub const NFQNL_CFG_CMD_BIND: ::c_int = 1; ++pub const NFQNL_CFG_CMD_UNBIND: ::c_int = 2; ++pub const NFQNL_CFG_CMD_PF_BIND: ::c_int = 3; ++pub const NFQNL_CFG_CMD_PF_UNBIND: ::c_int = 4; ++ ++pub const NFQNL_COPY_NONE: ::c_int = 0; ++pub const NFQNL_COPY_META: ::c_int = 1; ++pub const NFQNL_COPY_PACKET: ::c_int = 2; ++ ++pub const NFQA_CFG_UNSPEC: ::c_int = 0; ++pub const NFQA_CFG_CMD: ::c_int = 1; ++pub const NFQA_CFG_PARAMS: ::c_int = 2; ++pub const NFQA_CFG_QUEUE_MAXLEN: ::c_int = 3; ++pub const NFQA_CFG_MASK: ::c_int = 4; ++pub const NFQA_CFG_FLAGS: ::c_int = 5; ++ ++pub const NFQA_CFG_F_FAIL_OPEN: ::c_int = 0x0001; ++pub const NFQA_CFG_F_CONNTRACK: ::c_int = 0x0002; ++pub const NFQA_CFG_F_GSO: ::c_int = 0x0004; ++pub const NFQA_CFG_F_UID_GID: ::c_int = 0x0008; ++pub const NFQA_CFG_F_SECCTX: ::c_int = 0x0010; ++pub const NFQA_CFG_F_MAX: ::c_int = 0x0020; ++ ++pub const NFQA_SKB_CSUMNOTREADY: ::c_int = 0x0001; ++pub const NFQA_SKB_GSO: ::c_int = 0x0002; ++pub const NFQA_SKB_CSUM_NOTVERIFIED: ::c_int = 0x0004; ++ + pub const GENL_NAMSIZ: ::c_int = 16; + + pub const GENL_MIN_ID: ::c_int = NLMSG_MIN_TYPE; +@@ -1400,15 +1614,16 @@ pub const SFD_NONBLOCK: ::c_int = O_NONBLOCK; + pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK; + + pub const SO_ORIGINAL_DST: ::c_int = 80; +-pub const IP_ORIGDSTADDR : ::c_int = 20; +-pub const IP_RECVORIGDSTADDR : ::c_int = IP_ORIGDSTADDR; +-pub const IPV6_ORIGDSTADDR : ::c_int = 74; +-pub const IPV6_RECVORIGDSTADDR : ::c_int = IPV6_ORIGDSTADDR; ++pub const IP_ORIGDSTADDR: ::c_int = 20; ++pub const IP_RECVORIGDSTADDR: ::c_int = IP_ORIGDSTADDR; + pub const IPV6_FLOWINFO: ::c_int = 11; ++pub const IPV6_ORIGDSTADDR: ::c_int = 74; ++pub const IPV6_RECVORIGDSTADDR: ::c_int = IPV6_ORIGDSTADDR; + pub const IPV6_FLOWLABEL_MGR: ::c_int = 32; + pub const IPV6_FLOWINFO_SEND: ::c_int = 33; + pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 0x000fffff; + pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 0x0ff00000; ++ + pub const IUTF8: ::tcflag_t = 0x00004000; + pub const CMSPAR: ::tcflag_t = 0o10000000000; + pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY; +@@ -1419,11 +1634,11 @@ pub const MFD_HUGETLB: ::c_uint = 0x0004; + + // linux/netfilter.h + pub const NF_DROP: ::c_int = 0; +-pub const NF_ACCEPT: ::c_int = 1; +-pub const NF_STOLEN: ::c_int = 2; +-pub const NF_QUEUE: ::c_int = 3; +-pub const NF_REPEAT: ::c_int = 4; +-pub const NF_STOP: ::c_int = 5; ++pub const NF_ACCEPT: ::c_int = 1; ++pub const NF_STOLEN: ::c_int = 2; ++pub const NF_QUEUE: ::c_int = 3; ++pub const NF_REPEAT: ::c_int = 4; ++pub const NF_STOP: ::c_int = 5; + pub const NF_MAX_VERDICT: ::c_int = NF_STOP; + + pub const NF_VERDICT_MASK: ::c_int = 0x000000ff; +@@ -1499,6 +1714,9 @@ pub const NF_IP6_PRI_SELINUX_LAST: ::c_int = 225; + pub const NF_IP6_PRI_CONNTRACK_HELPER: ::c_int = 300; + pub const NF_IP6_PRI_LAST: ::c_int = ::INT_MAX; + ++// linux/netfilter_ipv6/ip6_tables.h ++pub const IP6T_SO_ORIGINAL_DST: ::c_int = 80; ++ + // linux/netfilter/nf_tables.h + pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256; + pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256; +@@ -1594,12 +1812,12 @@ pub const NFT_CMP_GTE: ::c_int = 5; + pub const NFT_RANGE_EQ: ::c_int = 0; + pub const NFT_RANGE_NEQ: ::c_int = 1; + +-pub const NFT_LOOKUP_F_INV: ::c_int = (1 << 0); ++pub const NFT_LOOKUP_F_INV: ::c_int = 1 << 0; + + pub const NFT_DYNSET_OP_ADD: ::c_int = 0; + pub const NFT_DYNSET_OP_UPDATE: ::c_int = 1; + +-pub const NFT_DYNSET_F_INV: ::c_int = (1 << 0); ++pub const NFT_DYNSET_F_INV: ::c_int = 1 << 0; + + pub const NFT_PAYLOAD_LL_HEADER: ::c_int = 0; + pub const NFT_PAYLOAD_NETWORK_HEADER: ::c_int = 1; +@@ -1654,13 +1872,13 @@ pub const NFT_CT_BYTES: ::c_int = 15; + pub const NFT_LIMIT_PKTS: ::c_int = 0; + pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1; + +-pub const NFT_LIMIT_F_INV: ::c_int = (1 << 0); ++pub const NFT_LIMIT_F_INV: ::c_int = 1 << 0; + + pub const NFT_QUEUE_FLAG_BYPASS: ::c_int = 0x01; + pub const NFT_QUEUE_FLAG_CPU_FANOUT: ::c_int = 0x02; + pub const NFT_QUEUE_FLAG_MASK: ::c_int = 0x03; + +-pub const NFT_QUOTA_F_INV: ::c_int = (1 << 0); ++pub const NFT_QUOTA_F_INV: ::c_int = 1 << 0; + + pub const NFT_REJECT_ICMP_UNREACH: ::c_int = 0; + pub const NFT_REJECT_TCP_RST: ::c_int = 1; +@@ -1847,38 +2065,44 @@ pub const ALG_OP_DECRYPT: ::c_int = 0; + pub const ALG_OP_ENCRYPT: ::c_int = 1; + + // uapi/linux/inotify.h +-pub const IN_ACCESS: u32 = 0x0000_0001; +-pub const IN_MODIFY: u32 = 0x0000_0002; +-pub const IN_ATTRIB: u32 = 0x0000_0004; +-pub const IN_CLOSE_WRITE: u32 = 0x0000_0008; ++pub const IN_ACCESS: u32 = 0x0000_0001; ++pub const IN_MODIFY: u32 = 0x0000_0002; ++pub const IN_ATTRIB: u32 = 0x0000_0004; ++pub const IN_CLOSE_WRITE: u32 = 0x0000_0008; + pub const IN_CLOSE_NOWRITE: u32 = 0x0000_0010; +-pub const IN_CLOSE: u32 = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE); +-pub const IN_OPEN: u32 = 0x0000_0020; +-pub const IN_MOVED_FROM: u32 = 0x0000_0040; +-pub const IN_MOVED_TO: u32 = 0x0000_0080; +-pub const IN_MOVE: u32 = (IN_MOVED_FROM | IN_MOVED_TO); +-pub const IN_CREATE: u32 = 0x0000_0100; +-pub const IN_DELETE: u32 = 0x0000_0200; +-pub const IN_DELETE_SELF: u32 = 0x0000_0400; +-pub const IN_MOVE_SELF: u32 = 0x0000_0800; +-pub const IN_UNMOUNT: u32 = 0x0000_2000; +-pub const IN_Q_OVERFLOW: u32 = 0x0000_4000; +-pub const IN_IGNORED: u32 = 0x0000_8000; +-pub const IN_ONLYDIR: u32 = 0x0100_0000; +-pub const IN_DONT_FOLLOW: u32 = 0x0200_0000; ++pub const IN_CLOSE: u32 = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE; ++pub const IN_OPEN: u32 = 0x0000_0020; ++pub const IN_MOVED_FROM: u32 = 0x0000_0040; ++pub const IN_MOVED_TO: u32 = 0x0000_0080; ++pub const IN_MOVE: u32 = IN_MOVED_FROM | IN_MOVED_TO; ++pub const IN_CREATE: u32 = 0x0000_0100; ++pub const IN_DELETE: u32 = 0x0000_0200; ++pub const IN_DELETE_SELF: u32 = 0x0000_0400; ++pub const IN_MOVE_SELF: u32 = 0x0000_0800; ++pub const IN_UNMOUNT: u32 = 0x0000_2000; ++pub const IN_Q_OVERFLOW: u32 = 0x0000_4000; ++pub const IN_IGNORED: u32 = 0x0000_8000; ++pub const IN_ONLYDIR: u32 = 0x0100_0000; ++pub const IN_DONT_FOLLOW: u32 = 0x0200_0000; + // pub const IN_EXCL_UNLINK: u32 = 0x0400_0000; + + // pub const IN_MASK_CREATE: u32 = 0x1000_0000; + // pub const IN_MASK_ADD: u32 = 0x2000_0000; +-pub const IN_ISDIR: u32 = 0x4000_0000; +-pub const IN_ONESHOT: u32 = 0x8000_0000; +- +-pub const IN_ALL_EVENTS: u32 = ( +- IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | +- IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | +- IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | +- IN_MOVE_SELF +-); ++pub const IN_ISDIR: u32 = 0x4000_0000; ++pub const IN_ONESHOT: u32 = 0x8000_0000; ++ ++pub const IN_ALL_EVENTS: u32 = IN_ACCESS ++ | IN_MODIFY ++ | IN_ATTRIB ++ | IN_CLOSE_WRITE ++ | IN_CLOSE_NOWRITE ++ | IN_OPEN ++ | IN_MOVED_FROM ++ | IN_MOVED_TO ++ | IN_DELETE ++ | IN_CREATE ++ | IN_DELETE_SELF ++ | IN_MOVE_SELF; + + pub const IN_CLOEXEC: ::c_int = O_CLOEXEC; + pub const IN_NONBLOCK: ::c_int = O_NONBLOCK; +@@ -1902,6 +2126,67 @@ pub const FUTEX_CLOCK_REALTIME: ::c_int = 256; + pub const FUTEX_CMD_MASK: ::c_int = + !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME); + ++// linux/errqueue.h ++pub const SO_EE_ORIGIN_NONE: u8 = 0; ++pub const SO_EE_ORIGIN_LOCAL: u8 = 1; ++pub const SO_EE_ORIGIN_ICMP: u8 = 2; ++pub const SO_EE_ORIGIN_ICMP6: u8 = 3; ++pub const SO_EE_ORIGIN_TXSTATUS: u8 = 4; ++pub const SO_EE_ORIGIN_TIMESTAMPING: u8 = SO_EE_ORIGIN_TXSTATUS; ++ ++// errno.h ++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 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 EWOULDBLOCK: ::c_int = EAGAIN; ++ ++pub const PRIO_PROCESS: ::c_int = 0; ++pub const PRIO_PGRP: ::c_int = 1; ++pub const PRIO_USER: ::c_int = 2; ++ ++// linux/sched.h ++pub const SCHED_NORMAL: ::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; ++pub const SCHED_DEADLINE: ::c_int = 6; ++ ++// bits/seek_constants.h ++pub const SEEK_DATA: ::c_int = 3; ++pub const SEEK_HOLE: ::c_int = 4; ++ + f! { + pub fn CMSG_NXTHDR(mhdr: *const msghdr, + cmsg: *const cmsghdr) -> *mut cmsghdr { +@@ -1961,224 +2246,414 @@ f! { + pub fn NLA_ALIGN(len: ::c_int) -> ::c_int { + return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1) + } ++ ++ pub fn SO_EE_OFFENDER(ee: *const ::sock_extended_err) -> *mut ::sockaddr { ++ ee.offset(1) as *mut ::sockaddr ++ } + } + +-extern { +- pub fn getrlimit64(resource: ::c_int, +- rlim: *mut rlimit64) -> ::c_int; +- pub fn setrlimit64(resource: ::c_int, +- rlim: *const rlimit64) -> ::c_int; ++extern "C" { ++ pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int; ++ pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int; + pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; + pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; +- pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, +- buflen: ::size_t) -> ::c_int; +- +- pub fn gettimeofday(tp: *mut ::timeval, +- tz: *mut ::timezone) -> ::c_int; +- pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) +- -> ::c_int; ++ pub fn prlimit( ++ pid: ::pid_t, ++ resource: ::c_int, ++ new_limit: *const ::rlimit, ++ old_limit: *mut ::rlimit, ++ ) -> ::c_int; ++ pub fn prlimit64( ++ pid: ::pid_t, ++ resource: ::c_int, ++ new_limit: *const ::rlimit64, ++ old_limit: *mut ::rlimit64, ++ ) -> ::c_int; ++ pub fn strerror_r( ++ errnum: ::c_int, ++ buf: *mut c_char, ++ buflen: ::size_t, ++ ) -> ::c_int; ++ ++ pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; ++ pub fn madvise( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ advice: ::c_int, ++ ) -> ::c_int; + pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; +- pub fn msync(addr: *mut ::c_void, len: ::size_t, +- flags: ::c_int) -> ::c_int; +- pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) +- -> ::c_int; +- pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, +- flags: ::c_int, addr: *mut ::sockaddr, +- addrlen: *mut ::socklen_t) -> ::ssize_t; +- 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 msync( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn mprotect( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ prot: ::c_int, ++ ) -> ::c_int; ++ pub fn recvfrom( ++ socket: ::c_int, ++ buf: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ addr: *mut ::sockaddr, ++ addrlen: *mut ::socklen_t, ++ ) -> ::ssize_t; ++ 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 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; + pub fn __sched_cpualloc(count: ::size_t) -> *mut ::cpu_set_t; + pub fn __sched_cpufree(set: *mut ::cpu_set_t); +- pub fn __sched_cpucount(setsize: ::size_t, +- set: *const cpu_set_t) -> ::c_int; ++ pub fn __sched_cpucount( ++ setsize: ::size_t, ++ set: *const cpu_set_t, ++ ) -> ::c_int; + pub fn sched_getcpu() -> ::c_int; + + pub fn utmpname(name: *const ::c_char) -> ::c_int; + pub fn setutent(); + pub fn getutent() -> *mut utmp; + +- pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, +- len: ::off_t) -> ::c_int; +- pub fn signalfd(fd: ::c_int, mask: *const ::sigset_t, flags: ::c_int) +- -> ::c_int; ++ pub fn fallocate( ++ fd: ::c_int, ++ mode: ::c_int, ++ offset: ::off_t, ++ len: ::off_t, ++ ) -> ::c_int; ++ pub fn fallocate64( ++ fd: ::c_int, ++ mode: ::c_int, ++ offset: ::off64_t, ++ len: ::off64_t, ++ ) -> ::c_int; ++ pub fn posix_fallocate( ++ fd: ::c_int, ++ offset: ::off_t, ++ len: ::off_t, ++ ) -> ::c_int; ++ pub fn posix_fallocate64( ++ fd: ::c_int, ++ offset: ::off64_t, ++ len: ::off64_t, ++ ) -> ::c_int; ++ pub fn getxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *mut ::c_void, ++ size: ::size_t, ++ ) -> ::ssize_t; ++ pub fn lgetxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *mut ::c_void, ++ size: ::size_t, ++ ) -> ::ssize_t; ++ pub fn fgetxattr( ++ filedes: ::c_int, ++ name: *const c_char, ++ value: *mut ::c_void, ++ size: ::size_t, ++ ) -> ::ssize_t; ++ pub fn setxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *const ::c_void, ++ size: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn lsetxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *const ::c_void, ++ size: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn fsetxattr( ++ filedes: ::c_int, ++ name: *const c_char, ++ value: *const ::c_void, ++ size: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn listxattr( ++ path: *const c_char, ++ list: *mut c_char, ++ size: ::size_t, ++ ) -> ::ssize_t; ++ pub fn llistxattr( ++ path: *const c_char, ++ list: *mut c_char, ++ size: ::size_t, ++ ) -> ::ssize_t; ++ pub fn flistxattr( ++ filedes: ::c_int, ++ list: *mut c_char, ++ size: ::size_t, ++ ) -> ::ssize_t; ++ pub fn removexattr(path: *const c_char, name: *const c_char) -> ::c_int; ++ pub fn lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int; ++ pub fn fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int; ++ pub fn signalfd( ++ fd: ::c_int, ++ mask: *const ::sigset_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn timerfd_create(clock: ::clockid_t, flags: ::c_int) -> ::c_int; ++ pub fn timerfd_gettime( ++ fd: ::c_int, ++ current_value: *mut itimerspec, ++ ) -> ::c_int; ++ pub fn timerfd_settime( ++ fd: ::c_int, ++ flags: ::c_int, ++ new_value: *const itimerspec, ++ old_value: *mut itimerspec, ++ ) -> ::c_int; + pub fn syscall(num: ::c_long, ...) -> ::c_long; +- pub fn sched_getaffinity(pid: ::pid_t, +- cpusetsize: ::size_t, +- 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 sched_getaffinity( ++ pid: ::pid_t, ++ cpusetsize: ::size_t, ++ 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 epoll_create(size: ::c_int) -> ::c_int; + pub fn epoll_create1(flags: ::c_int) -> ::c_int; +- pub fn epoll_wait(epfd: ::c_int, +- events: *mut ::epoll_event, +- maxevents: ::c_int, +- timeout: ::c_int) -> ::c_int; +- pub fn epoll_ctl(epfd: ::c_int, +- op: ::c_int, +- fd: ::c_int, +- event: *mut ::epoll_event) -> ::c_int; +- pub fn pthread_getschedparam(native: ::pthread_t, +- policy: *mut ::c_int, +- param: *mut ::sched_param) -> ::c_int; ++ pub fn epoll_wait( ++ epfd: ::c_int, ++ events: *mut ::epoll_event, ++ maxevents: ::c_int, ++ timeout: ::c_int, ++ ) -> ::c_int; ++ pub fn epoll_ctl( ++ epfd: ::c_int, ++ op: ::c_int, ++ fd: ::c_int, ++ event: *mut ::epoll_event, ++ ) -> ::c_int; ++ pub fn pthread_getschedparam( ++ native: ::pthread_t, ++ policy: *mut ::c_int, ++ param: *mut ::sched_param, ++ ) -> ::c_int; + pub fn unshare(flags: ::c_int) -> ::c_int; + pub fn umount(target: *const ::c_char) -> ::c_int; + pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int; +- pub fn tee(fd_in: ::c_int, +- fd_out: ::c_int, +- len: ::size_t, +- flags: ::c_uint) -> ::ssize_t; +- pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int; +- pub fn splice(fd_in: ::c_int, +- off_in: *mut ::loff_t, +- fd_out: ::c_int, +- off_out: *mut ::loff_t, +- len: ::size_t, +- flags: ::c_uint) -> ::ssize_t; ++ pub fn tee( ++ fd_in: ::c_int, ++ fd_out: ::c_int, ++ len: ::size_t, ++ flags: ::c_uint, ++ ) -> ::ssize_t; ++ pub fn settimeofday( ++ tv: *const ::timeval, ++ tz: *const ::timezone, ++ ) -> ::c_int; ++ pub fn splice( ++ fd_in: ::c_int, ++ off_in: *mut ::loff_t, ++ fd_out: ::c_int, ++ off_out: *mut ::loff_t, ++ len: ::size_t, ++ flags: ::c_uint, ++ ) -> ::ssize_t; + pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; +- pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int; +- pub fn sem_timedwait(sem: *mut sem_t, +- abstime: *const ::timespec) -> ::c_int; +- pub fn sem_getvalue(sem: *mut sem_t, +- sval: *mut ::c_int) -> ::c_int; +- pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int; ++ pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) ++ -> ::c_int; ++ pub fn sem_timedwait( ++ sem: *mut sem_t, ++ abstime: *const ::timespec, ++ ) -> ::c_int; ++ pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int; ++ pub fn sched_setparam( ++ pid: ::pid_t, ++ param: *const ::sched_param, ++ ) -> ::c_int; + pub fn setns(fd: ::c_int, nstype: ::c_int) -> ::c_int; + pub fn swapoff(puath: *const ::c_char) -> ::c_int; +- pub fn vmsplice(fd: ::c_int, +- iov: *const ::iovec, +- nr_segs: ::size_t, +- flags: ::c_uint) -> ::ssize_t; +- pub fn mount(src: *const ::c_char, +- target: *const ::c_char, +- fstype: *const ::c_char, +- flags: ::c_ulong, +- data: *const ::c_void) -> ::c_int; ++ pub fn vmsplice( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ nr_segs: ::size_t, ++ flags: ::c_uint, ++ ) -> ::ssize_t; ++ pub fn mount( ++ src: *const ::c_char, ++ target: *const ::c_char, ++ fstype: *const ::c_char, ++ flags: ::c_ulong, ++ data: *const ::c_void, ++ ) -> ::c_int; + pub fn personality(persona: ::c_uint) -> ::c_int; + pub fn prctl(option: ::c_int, ...) -> ::c_int; + pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int; +- pub fn ppoll(fds: *mut ::pollfd, +- nfds: nfds_t, +- timeout: *const ::timespec, +- sigmask: *const sigset_t) -> ::c_int; +- pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t, +- abstime: *const ::timespec) -> ::c_int; +- pub fn clone(cb: extern fn(*mut ::c_void) -> ::c_int, +- child_stack: *mut ::c_void, +- flags: ::c_int, +- arg: *mut ::c_void, ...) -> ::c_int; ++ pub fn ppoll( ++ fds: *mut ::pollfd, ++ nfds: nfds_t, ++ timeout: *const ::timespec, ++ sigmask: *const sigset_t, ++ ) -> ::c_int; ++ pub fn pthread_mutex_timedlock( ++ lock: *mut pthread_mutex_t, ++ abstime: *const ::timespec, ++ ) -> ::c_int; ++ pub fn clone( ++ cb: extern "C" fn(*mut ::c_void) -> ::c_int, ++ child_stack: *mut ::c_void, ++ flags: ::c_int, ++ arg: *mut ::c_void, ++ ... ++ ) -> ::c_int; + pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int; +- pub fn clock_nanosleep(clk_id: ::clockid_t, +- flags: ::c_int, +- rqtp: *const ::timespec, +- rmtp: *mut ::timespec) -> ::c_int; +- pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t, +- guardsize: *mut ::size_t) -> ::c_int; ++ pub fn clock_nanosleep( ++ clk_id: ::clockid_t, ++ flags: ::c_int, ++ rqtp: *const ::timespec, ++ rmtp: *mut ::timespec, ++ ) -> ::c_int; ++ pub fn pthread_attr_getguardsize( ++ attr: *const ::pthread_attr_t, ++ guardsize: *mut ::size_t, ++ ) -> ::c_int; + pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int; +- pub fn pthread_condattr_getpshared(attr: *const pthread_condattr_t, +- pshared: *mut ::c_int) -> ::c_int; ++ pub fn pthread_condattr_getpshared( ++ attr: *const pthread_condattr_t, ++ pshared: *mut ::c_int, ++ ) -> ::c_int; + pub fn sysinfo(info: *mut ::sysinfo) -> ::c_int; + pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int; +- pub fn pthread_setschedparam(native: ::pthread_t, +- policy: ::c_int, +- param: *const ::sched_param) -> ::c_int; ++ pub fn pthread_setschedparam( ++ native: ::pthread_t, ++ policy: ::c_int, ++ param: *const ::sched_param, ++ ) -> ::c_int; + pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int; +- pub fn sched_setscheduler(pid: ::pid_t, +- policy: ::c_int, +- param: *const ::sched_param) -> ::c_int; +- pub fn sendfile(out_fd: ::c_int, +- in_fd: ::c_int, +- offset: *mut off_t, +- count: ::size_t) -> ::ssize_t; ++ pub fn sched_setscheduler( ++ pid: ::pid_t, ++ policy: ::c_int, ++ param: *const ::sched_param, ++ ) -> ::c_int; ++ pub fn sendfile( ++ out_fd: ::c_int, ++ in_fd: ::c_int, ++ offset: *mut off_t, ++ count: ::size_t, ++ ) -> ::ssize_t; + pub fn setfsgid(gid: ::gid_t) -> ::c_int; + pub fn setfsuid(uid: ::uid_t) -> ::c_int; + pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int; +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrgid_r")] +- pub fn getgrgid_r(gid: ::gid_t, +- grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "sigaltstack$UNIX2003")] +- #[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")] +- pub fn sigaltstack(ss: *const stack_t, +- oss: *mut stack_t) -> ::c_int; ++ pub fn getgrgid_r( ++ gid: ::gid_t, ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; ++ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sem_close(sem: *mut sem_t) -> ::c_int; +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrnam_r")] +- pub fn getgrnam_r(name: *const ::c_char, +- grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_sigmask$UNIX2003")] +- pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, +- oldset: *mut sigset_t) -> ::c_int; ++ pub fn getgrnam_r( ++ name: *const ::c_char, ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; ++ pub fn pthread_sigmask( ++ how: ::c_int, ++ set: *const sigset_t, ++ oldset: *mut sigset_t, ++ ) -> ::c_int; + pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; + pub fn getgrnam(name: *const ::c_char) -> *mut ::group; + pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + pub fn sem_unlink(name: *const ::c_char) -> ::c_int; + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; +- #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwnam_r")] +- pub fn getpwnam_r(name: *const ::c_char, +- pwd: *mut passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut passwd) -> ::c_int; +- #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwuid_r")] +- pub fn getpwuid_r(uid: ::uid_t, +- pwd: *mut passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut passwd) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch ="x86"), +- link_name = "sigwait$UNIX2003")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")] +- pub fn sigwait(set: *const sigset_t, +- sig: *mut ::c_int) -> ::c_int; +- pub fn pthread_atfork(prepare: ::Option, +- parent: ::Option, +- child: ::Option) -> ::c_int; ++ pub fn getpwnam_r( ++ name: *const ::c_char, ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; ++ pub fn getpwuid_r( ++ uid: ::uid_t, ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; ++ pub fn sigtimedwait( ++ set: *const sigset_t, ++ info: *mut siginfo_t, ++ timeout: *const ::timespec, ++ ) -> ::c_int; ++ pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; ++ pub fn pthread_atfork( ++ prepare: ::Option, ++ parent: ::Option, ++ child: ::Option, ++ ) -> ::c_int; + pub fn getgrgid(gid: ::gid_t) -> *mut ::group; +- pub fn getgrouplist(user: *const ::c_char, +- group: ::gid_t, +- groups: *mut ::gid_t, +- ngroups: *mut ::c_int) -> ::c_int; ++ pub fn getgrouplist( ++ user: *const ::c_char, ++ group: ::gid_t, ++ groups: *mut ::gid_t, ++ ngroups: *mut ::c_int, ++ ) -> ::c_int; + pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int; +- pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t, +- pshared: *mut ::c_int) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "popen$UNIX2003")] +- pub fn popen(command: *const c_char, +- mode: *const c_char) -> *mut ::FILE; +- pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char, +- mode: ::c_int, flags: ::c_int) -> ::c_int; +- pub fn pthread_create(native: *mut ::pthread_t, +- attr: *const ::pthread_attr_t, +- f: extern fn(*mut ::c_void) -> *mut ::c_void, +- value: *mut ::c_void) -> ::c_int; ++ pub fn pthread_mutexattr_getpshared( ++ attr: *const pthread_mutexattr_t, ++ pshared: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; ++ pub fn faccessat( ++ dirfd: ::c_int, ++ pathname: *const ::c_char, ++ mode: ::c_int, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_create( ++ native: *mut ::pthread_t, ++ attr: *const ::pthread_attr_t, ++ f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, ++ value: *mut ::c_void, ++ ) -> ::c_int; + pub fn __errno() -> *mut ::c_int; + pub fn inotify_rm_watch(fd: ::c_int, wd: u32) -> ::c_int; +- pub fn sendmmsg(sockfd: ::c_int, msgvec: *const ::mmsghdr, vlen: ::c_uint, +- flags: ::c_int) -> ::c_int; +- pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, +- flags: ::c_int, timeout: *const ::timespec) -> ::c_int; ++ pub fn sendmmsg( ++ sockfd: ::c_int, ++ msgvec: *const ::mmsghdr, ++ vlen: ::c_uint, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn recvmmsg( ++ sockfd: ::c_int, ++ msgvec: *mut ::mmsghdr, ++ vlen: ::c_uint, ++ flags: ::c_int, ++ timeout: *const ::timespec, ++ ) -> ::c_int; + pub fn inotify_init() -> ::c_int; + pub fn inotify_init1(flags: ::c_int) -> ::c_int; +- pub fn inotify_add_watch(fd: ::c_int, +- path: *const ::c_char, +- mask: u32) -> ::c_int; ++ pub fn inotify_add_watch( ++ fd: ::c_int, ++ path: *const ::c_char, ++ mask: u32, ++ ) -> ::c_int; + } + + cfg_if! { +@@ -2192,3 +2667,18 @@ cfg_if! { + // Unknown target_pointer_width + } + } ++ ++impl siginfo_t { ++ pub unsafe fn si_value(&self) -> ::sigval { ++ #[repr(C)] ++ struct siginfo_timer { ++ _si_signo: ::c_int, ++ _si_errno: ::c_int, ++ _si_code: ::c_int, ++ _si_tid: ::c_int, ++ _si_overrun: ::c_int, ++ si_sigval: ::sigval, ++ } ++ (*(self as *const siginfo_t as *const siginfo_timer)).si_sigval ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/emscripten/align.rs b/third_party/rust/libc/src/unix/linux_like/emscripten/align.rs +index 26a49b234b99c34cdb26ffe68cc8e6db919fafc8..b9ea3f39efdf5dceabea9be62387e702b58d62d0 100644 +--- a/third_party/rust/libc/src/unix/linux_like/emscripten/align.rs ++++ b/third_party/rust/libc/src/unix/linux_like/emscripten/align.rs +@@ -1,6 +1,7 @@ + macro_rules! expand_align { + () => { + s! { ++ #[allow(missing_debug_implementations)] + #[repr(align(4))] + pub struct pthread_mutex_t { + size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], +@@ -35,6 +36,13 @@ macro_rules! expand_align { + pub struct pthread_cond_t { + size: [u8; ::__SIZEOF_PTHREAD_COND_T], + } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 4] ++ } ++ + } + + cfg_if! { +@@ -62,5 +70,5 @@ macro_rules! expand_align { + } + } + } +- } ++ }; + } +diff --git a/third_party/rust/libc/src/unix/linux_like/emscripten/mod.rs b/third_party/rust/libc/src/unix/linux_like/emscripten/mod.rs +index 67631fccf08925483077946fde9df5708075cf66..78170211a3f4cd1ff3874179e3c5c0d7bd0c14ed 100644 +--- a/third_party/rust/libc/src/unix/linux_like/emscripten/mod.rs ++++ b/third_party/rust/libc/src/unix/linux_like/emscripten/mod.rs +@@ -5,8 +5,8 @@ pub type dev_t = u32; + pub type socklen_t = u32; + pub type pthread_t = c_ulong; + pub type mode_t = u32; +-pub type ino64_t = u32; +-pub type off64_t = i32; ++pub type ino64_t = u64; ++pub type off64_t = i64; + pub type blkcnt64_t = i32; + pub type rlim64_t = u64; + pub type shmatt_t = ::c_ulong; +@@ -16,14 +16,14 @@ pub type msglen_t = ::c_ulong; + pub type nfds_t = ::c_ulong; + pub type nl_item = ::c_int; + pub type idtype_t = ::c_uint; +-pub type loff_t = i32; ++pub type loff_t = i64; + pub type pthread_key_t = ::c_uint; + + pub type clock_t = c_long; + pub type time_t = c_long; + pub type suseconds_t = c_long; +-pub type ino_t = u32; +-pub type off_t = i32; ++pub type ino_t = u64; ++pub type off_t = i64; + pub type blkcnt_t = i32; + + pub type blksize_t = c_long; +@@ -35,10 +35,12 @@ pub type c_ulong = u32; + pub type nlink_t = u32; + + #[cfg_attr(feature = "extra_traits", derive(Debug))] +-pub enum fpos64_t {} // TODO: fill this out with a struct ++pub enum fpos64_t {} // FIXME: fill this out with a struct + impl ::Copy for fpos64_t {} + impl ::Clone for fpos64_t { +- fn clone(&self) -> fpos64_t { *self } ++ fn clone(&self) -> fpos64_t { ++ *self ++ } + } + + s! { +@@ -221,6 +223,14 @@ s! { + pub l_pid: ::pid_t, + } + ++ pub struct flock64 { ++ pub l_type: ::c_short, ++ pub l_whence: ::c_short, ++ pub l_start: ::off64_t, ++ pub l_len: ::off64_t, ++ pub l_pid: ::pid_t, ++ } ++ + pub struct pthread_attr_t { + __size: [u32; 11] + } +@@ -1164,20 +1174,142 @@ pub const O_TRUNC: ::c_int = 512; + pub const O_NOATIME: ::c_int = 0o1000000; + pub const O_CLOEXEC: ::c_int = 0x80000; + +-pub const EBFONT: ::c_int = 59; +-pub const ENOSTR: ::c_int = 60; +-pub const ENODATA: ::c_int = 61; +-pub const ETIME: ::c_int = 62; +-pub const ENOSR: ::c_int = 63; +-pub const ENONET: ::c_int = 64; +-pub const ENOPKG: ::c_int = 65; +-pub const EREMOTE: ::c_int = 66; +-pub const ENOLINK: ::c_int = 67; +-pub const EADV: ::c_int = 68; +-pub const ESRMNT: ::c_int = 69; +-pub const ECOMM: ::c_int = 70; +-pub const EPROTO: ::c_int = 71; +-pub const EDOTDOT: ::c_int = 73; ++// Defined as wasi value. ++pub const EPERM: ::c_int = 63; ++pub const ENOENT: ::c_int = 44; ++pub const ESRCH: ::c_int = 71; ++pub const EINTR: ::c_int = 27; ++pub const EIO: ::c_int = 29; ++pub const ENXIO: ::c_int = 60; ++pub const E2BIG: ::c_int = 1; ++pub const ENOEXEC: ::c_int = 45; ++pub const EBADF: ::c_int = 8; ++pub const ECHILD: ::c_int = 12; ++pub const EAGAIN: ::c_int = 6; ++pub const ENOMEM: ::c_int = 48; ++pub const EACCES: ::c_int = 2; ++pub const EFAULT: ::c_int = 21; ++pub const ENOTBLK: ::c_int = 105; ++pub const EBUSY: ::c_int = 10; ++pub const EEXIST: ::c_int = 20; ++pub const EXDEV: ::c_int = 75; ++pub const ENODEV: ::c_int = 43; ++pub const ENOTDIR: ::c_int = 54; ++pub const EISDIR: ::c_int = 31; ++pub const EINVAL: ::c_int = 28; ++pub const ENFILE: ::c_int = 41; ++pub const EMFILE: ::c_int = 33; ++pub const ENOTTY: ::c_int = 59; ++pub const ETXTBSY: ::c_int = 74; ++pub const EFBIG: ::c_int = 22; ++pub const ENOSPC: ::c_int = 51; ++pub const ESPIPE: ::c_int = 70; ++pub const EROFS: ::c_int = 69; ++pub const EMLINK: ::c_int = 34; ++pub const EPIPE: ::c_int = 64; ++pub const EDOM: ::c_int = 18; ++pub const ERANGE: ::c_int = 68; ++pub const EWOULDBLOCK: ::c_int = EAGAIN; ++pub const ENOLINK: ::c_int = 47; ++pub const EPROTO: ::c_int = 65; ++pub const EDEADLK: ::c_int = 16; ++pub const EDEADLOCK: ::c_int = EDEADLK; ++pub const ENAMETOOLONG: ::c_int = 37; ++pub const ENOLCK: ::c_int = 46; ++pub const ENOSYS: ::c_int = 52; ++pub const ENOTEMPTY: ::c_int = 55; ++pub const ELOOP: ::c_int = 32; ++pub const ENOMSG: ::c_int = 49; ++pub const EIDRM: ::c_int = 24; ++pub const EMULTIHOP: ::c_int = 36; ++pub const EBADMSG: ::c_int = 9; ++pub const EOVERFLOW: ::c_int = 61; ++pub const EILSEQ: ::c_int = 25; ++pub const ENOTSOCK: ::c_int = 57; ++pub const EDESTADDRREQ: ::c_int = 17; ++pub const EMSGSIZE: ::c_int = 35; ++pub const EPROTOTYPE: ::c_int = 67; ++pub const ENOPROTOOPT: ::c_int = 50; ++pub const EPROTONOSUPPORT: ::c_int = 66; ++pub const EAFNOSUPPORT: ::c_int = 5; ++pub const EADDRINUSE: ::c_int = 3; ++pub const EADDRNOTAVAIL: ::c_int = 4; ++pub const ENETDOWN: ::c_int = 38; ++pub const ENETUNREACH: ::c_int = 40; ++pub const ENETRESET: ::c_int = 39; ++pub const ECONNABORTED: ::c_int = 13; ++pub const ECONNRESET: ::c_int = 15; ++pub const ENOBUFS: ::c_int = 42; ++pub const EISCONN: ::c_int = 30; ++pub const ENOTCONN: ::c_int = 53; ++pub const ETIMEDOUT: ::c_int = 73; ++pub const ECONNREFUSED: ::c_int = 14; ++pub const EHOSTUNREACH: ::c_int = 23; ++pub const EALREADY: ::c_int = 7; ++pub const EINPROGRESS: ::c_int = 26; ++pub const ESTALE: ::c_int = 72; ++pub const EDQUOT: ::c_int = 19; ++pub const ECANCELED: ::c_int = 11; ++pub const EOWNERDEAD: ::c_int = 62; ++pub const ENOTRECOVERABLE: ::c_int = 56; ++ ++pub const ENOSTR: ::c_int = 100; ++pub const EBFONT: ::c_int = 101; ++pub const EBADSLT: ::c_int = 102; ++pub const EBADRQC: ::c_int = 103; ++pub const ENOANO: ::c_int = 104; ++pub const ECHRNG: ::c_int = 106; ++pub const EL3HLT: ::c_int = 107; ++pub const EL3RST: ::c_int = 108; ++pub const ELNRNG: ::c_int = 109; ++pub const EUNATCH: ::c_int = 110; ++pub const ENOCSI: ::c_int = 111; ++pub const EL2HLT: ::c_int = 112; ++pub const EBADE: ::c_int = 113; ++pub const EBADR: ::c_int = 114; ++pub const EXFULL: ::c_int = 115; ++pub const ENODATA: ::c_int = 116; ++pub const ETIME: ::c_int = 117; ++pub const ENOSR: ::c_int = 118; ++pub const ENONET: ::c_int = 119; ++pub const ENOPKG: ::c_int = 120; ++pub const EREMOTE: ::c_int = 121; ++pub const EADV: ::c_int = 122; ++pub const ESRMNT: ::c_int = 123; ++pub const ECOMM: ::c_int = 124; ++pub const EDOTDOT: ::c_int = 125; ++pub const ENOTUNIQ: ::c_int = 126; ++pub const EBADFD: ::c_int = 127; ++pub const EREMCHG: ::c_int = 128; ++pub const ELIBACC: ::c_int = 129; ++pub const ELIBBAD: ::c_int = 130; ++pub const ELIBSCN: ::c_int = 131; ++pub const ELIBMAX: ::c_int = 132; ++pub const ELIBEXEC: ::c_int = 133; ++pub const ERESTART: ::c_int = 134; ++pub const ESTRPIPE: ::c_int = 135; ++pub const EUSERS: ::c_int = 136; ++pub const ESOCKTNOSUPPORT: ::c_int = 137; ++pub const EOPNOTSUPP: ::c_int = 138; ++pub const ENOTSUP: ::c_int = EOPNOTSUPP; ++pub const EPFNOSUPPORT: ::c_int = 139; ++pub const ESHUTDOWN: ::c_int = 140; ++pub const ETOOMANYREFS: ::c_int = 141; ++pub const EHOSTDOWN: ::c_int = 142; ++pub const EUCLEAN: ::c_int = 143; ++pub const ENOTNAM: ::c_int = 144; ++pub const ENAVAIL: ::c_int = 145; ++pub const EISNAM: ::c_int = 146; ++pub const EREMOTEIO: ::c_int = 147; ++pub const ENOMEDIUM: ::c_int = 148; ++pub const EMEDIUMTYPE: ::c_int = 149; ++pub const ENOKEY: ::c_int = 150; ++pub const EKEYEXPIRED: ::c_int = 151; ++pub const EKEYREVOKED: ::c_int = 152; ++pub const EKEYREJECTED: ::c_int = 153; ++pub const ERFKILL: ::c_int = 154; ++pub const EHWPOISON: ::c_int = 155; ++pub const EL2NSYNC: ::c_int = 156; + + pub const SA_NODEFER: ::c_int = 0x40000000; + pub const SA_RESETHAND: ::c_int = 0x80000000; +@@ -1219,10 +1351,7 @@ pub const TCP_FASTOPEN: ::c_int = 23; + pub const TCP_TIMESTAMP: ::c_int = 24; + + #[doc(hidden)] +-#[deprecated( +- since = "0.2.55", +- note = "Use SIGSYS instead" +-)] ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] + pub const SIGUNUSED: ::c_int = ::SIGSYS; + + pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +@@ -1279,10 +1408,7 @@ pub const TIOCINQ: ::c_int = ::FIONREAD; + pub const RTLD_GLOBAL: ::c_int = 0x100; + pub const RTLD_NOLOAD: ::c_int = 0x4; + +-// TODO(#247) Temporarily musl-specific (available since musl 0.9.12 / Linux +-// kernel 3.10). See also linux_like/mod.rs + pub const CLOCK_SGI_CYCLE: ::clockid_t = 10; +-pub const CLOCK_TAI: ::clockid_t = 11; + + pub const MCL_CURRENT: ::c_int = 0x0001; + pub const MCL_FUTURE: ::c_int = 0x0002; +@@ -1293,12 +1419,12 @@ 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 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; +@@ -1331,14 +1457,14 @@ pub const PENDIN: ::tcflag_t = 0x00004000; + pub const NOFLSH: ::tcflag_t = 0x00000080; + pub const CBAUDEX: ::tcflag_t = 0o010000; + pub const VSWTC: usize = 7; +-pub const OLCUC: ::tcflag_t = 0o000002; +-pub const NLDLY: ::tcflag_t = 0o000400; +-pub const CRDLY: ::tcflag_t = 0o003000; ++pub const OLCUC: ::tcflag_t = 0o000002; ++pub const NLDLY: ::tcflag_t = 0o000400; ++pub const CRDLY: ::tcflag_t = 0o003000; + pub const TABDLY: ::tcflag_t = 0o014000; +-pub const BSDLY: ::tcflag_t = 0o020000; +-pub const FFDLY: ::tcflag_t = 0o100000; +-pub const VTDLY: ::tcflag_t = 0o040000; +-pub const XTABS: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const XTABS: ::tcflag_t = 0o014000; + + pub const B0: ::speed_t = 0o000000; + pub const B50: ::speed_t = 0o000001; +@@ -1433,92 +1559,6 @@ pub const SOCK_SEQPACKET: ::c_int = 5; + + pub const SOL_SOCKET: ::c_int = 1; + +-pub const EDEADLK: ::c_int = 35; +-pub const ENAMETOOLONG: ::c_int = 36; +-pub const ENOLCK: ::c_int = 37; +-pub const ENOSYS: ::c_int = 38; +-pub const ENOTEMPTY: ::c_int = 39; +-pub const ELOOP: ::c_int = 40; +-pub const ENOMSG: ::c_int = 42; +-pub const EIDRM: ::c_int = 43; +-pub const ECHRNG: ::c_int = 44; +-pub const EL2NSYNC: ::c_int = 45; +-pub const EL3HLT: ::c_int = 46; +-pub const EL3RST: ::c_int = 47; +-pub const ELNRNG: ::c_int = 48; +-pub const EUNATCH: ::c_int = 49; +-pub const ENOCSI: ::c_int = 50; +-pub const EL2HLT: ::c_int = 51; +-pub const EBADE: ::c_int = 52; +-pub const EBADR: ::c_int = 53; +-pub const EXFULL: ::c_int = 54; +-pub const ENOANO: ::c_int = 55; +-pub const EBADRQC: ::c_int = 56; +-pub const EBADSLT: ::c_int = 57; +-pub const EDEADLOCK: ::c_int = EDEADLK; +-pub const EMULTIHOP: ::c_int = 72; +-pub const EBADMSG: ::c_int = 74; +-pub const EOVERFLOW: ::c_int = 75; +-pub const ENOTUNIQ: ::c_int = 76; +-pub const EBADFD: ::c_int = 77; +-pub const EREMCHG: ::c_int = 78; +-pub const ELIBACC: ::c_int = 79; +-pub const ELIBBAD: ::c_int = 80; +-pub const ELIBSCN: ::c_int = 81; +-pub const ELIBMAX: ::c_int = 82; +-pub const ELIBEXEC: ::c_int = 83; +-pub const EILSEQ: ::c_int = 84; +-pub const ERESTART: ::c_int = 85; +-pub const ESTRPIPE: ::c_int = 86; +-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; +-pub const ECONNRESET: ::c_int = 104; +-pub const ENOBUFS: ::c_int = 105; +-pub const EISCONN: ::c_int = 106; +-pub const ENOTCONN: ::c_int = 107; +-pub const ESHUTDOWN: ::c_int = 108; +-pub const ETOOMANYREFS: ::c_int = 109; +-pub const ETIMEDOUT: ::c_int = 110; +-pub const ECONNREFUSED: ::c_int = 111; +-pub const EHOSTDOWN: ::c_int = 112; +-pub const EHOSTUNREACH: ::c_int = 113; +-pub const EALREADY: ::c_int = 114; +-pub const EINPROGRESS: ::c_int = 115; +-pub const ESTALE: ::c_int = 116; +-pub const EUCLEAN: ::c_int = 117; +-pub const ENOTNAM: ::c_int = 118; +-pub const ENAVAIL: ::c_int = 119; +-pub const EISNAM: ::c_int = 120; +-pub const EREMOTEIO: ::c_int = 121; +-pub const EDQUOT: ::c_int = 122; +-pub const ENOMEDIUM: ::c_int = 123; +-pub const EMEDIUMTYPE: ::c_int = 124; +-pub const ECANCELED: ::c_int = 125; +-pub const ENOKEY: ::c_int = 126; +-pub const EKEYEXPIRED: ::c_int = 127; +-pub const EKEYREVOKED: ::c_int = 128; +-pub const EKEYREJECTED: ::c_int = 129; +-pub const EOWNERDEAD: ::c_int = 130; +-pub const ENOTRECOVERABLE: ::c_int = 131; +-pub const ERFKILL: ::c_int = 132; +-pub const EHWPOISON: ::c_int = 133; +- + pub const SO_REUSEADDR: ::c_int = 2; + pub const SO_TYPE: ::c_int = 3; + pub const SO_ERROR: ::c_int = 4; +@@ -1573,6 +1613,9 @@ pub const F_GETOWN: ::c_int = 9; + pub const F_SETLK: ::c_int = 13; + pub const F_SETLKW: ::c_int = 14; + pub const F_SETOWN: ::c_int = 8; ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; + + pub const VEOF: usize = 4; + pub const VEOL: usize = 11; +@@ -1637,6 +1680,10 @@ pub const ARPD_LOOKUP: ::c_ushort = 0x02; + pub const ARPD_FLUSH: ::c_ushort = 0x03; + pub const ATF_MAGIC: ::c_int = 0x80; + ++pub const PRIO_PROCESS: ::c_int = 0; ++pub const PRIO_PGRP: ::c_int = 1; ++pub const PRIO_USER: ::c_int = 2; ++ + f! { + pub fn CMSG_NXTHDR(mhdr: *const msghdr, + cmsg: *const cmsghdr) -> *mut cmsghdr { +@@ -1689,7 +1736,7 @@ f! { + + pub fn major(dev: ::dev_t) -> ::c_uint { + // see +- // https://github.com/kripken/emscripten/blob/ ++ // https://github.com/emscripten-core/emscripten/blob/ + // master/system/include/libc/sys/sysmacros.h + let mut major = 0; + major |= (dev & 0x00000fff) >> 8; +@@ -1699,7 +1746,7 @@ f! { + + pub fn minor(dev: ::dev_t) -> ::c_uint { + // see +- // https://github.com/kripken/emscripten/blob/ ++ // https://github.com/emscripten-core/emscripten/blob/ + // master/system/include/libc/sys/sysmacros.h + let mut minor = 0; + minor |= (dev & 0x000000ff) >> 0; +@@ -1719,15 +1766,16 @@ f! { + } + } + +-extern { +- pub fn getrlimit64(resource: ::c_int, +- rlim: *mut rlimit64) -> ::c_int; +- pub fn setrlimit64(resource: ::c_int, +- rlim: *const rlimit64) -> ::c_int; ++extern "C" { ++ pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int; ++ pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int; + pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; + pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; +- pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, +- buflen: ::size_t) -> ::c_int; ++ pub fn strerror_r( ++ errnum: ::c_int, ++ buf: *mut c_char, ++ buflen: ::size_t, ++ ) -> ::c_int; + + pub fn abs(i: ::c_int) -> ::c_int; + pub fn atof(s: *const ::c_char) -> ::c_double; +@@ -1735,108 +1783,166 @@ extern { + pub fn rand() -> ::c_int; + pub fn srand(seed: ::c_uint); + +- pub fn gettimeofday(tp: *mut ::timeval, +- tz: *mut ::c_void) -> ::c_int; ++ pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; + + pub fn setpwent(); + pub fn endpwent(); + pub fn getpwent() -> *mut passwd; + +- pub fn shm_open(name: *const c_char, oflag: ::c_int, +- mode: mode_t) -> ::c_int; +- +- pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) +- -> ::c_int; ++ pub fn shm_open( ++ name: *const c_char, ++ oflag: ::c_int, ++ mode: mode_t, ++ ) -> ::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; ++ 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; + pub fn tmpfile64() -> *mut ::FILE; + pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int; + pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int; +- pub fn fseeko64(stream: *mut ::FILE, +- offset: ::off64_t, +- whence: ::c_int) -> ::c_int; ++ pub fn fseeko64( ++ stream: *mut ::FILE, ++ offset: ::off64_t, ++ whence: ::c_int, ++ ) -> ::c_int; + pub fn ftello64(stream: *mut ::FILE) -> ::off64_t; +- pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, +- len: ::off_t) -> ::c_int; +- pub fn pwritev(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int, +- offset: ::off_t) -> ::ssize_t; +- pub fn preadv(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int, +- offset: ::off_t) -> ::ssize_t; ++ pub fn posix_fallocate( ++ fd: ::c_int, ++ offset: ::off_t, ++ len: ::off_t, ++ ) -> ::c_int; ++ pub fn pwritev( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ offset: ::off_t, ++ ) -> ::ssize_t; ++ pub fn preadv( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ offset: ::off_t, ++ ) -> ::ssize_t; + pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int; + 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 nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char; +- 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 mkostemps( ++ template: *mut ::c_char, ++ suffixlen: ::c_int, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) ++ -> *mut ::c_char; ++ 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 getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int; + + // Not available now on Android +- pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, +- mode: ::mode_t) -> ::c_int; ++ 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 mremap(addr: *mut ::c_void, +- len: ::size_t, +- new_len: ::size_t, +- flags: ::c_int, +- ...) -> *mut ::c_void; +- +- pub fn glob(pattern: *const c_char, +- flags: ::c_int, +- errfunc: ::Option ::c_int>, +- pglob: *mut ::glob_t) -> ::c_int; ++ pub fn mremap( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ new_len: ::size_t, ++ flags: ::c_int, ++ ... ++ ) -> *mut ::c_void; ++ ++ pub fn glob( ++ pattern: *const c_char, ++ flags: ::c_int, ++ errfunc: ::Option< ++ extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int, ++ >, ++ pglob: *mut ::glob_t, ++ ) -> ::c_int; + pub fn globfree(pglob: *mut ::glob_t); + +- pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) +- -> ::c_int; ++ pub fn posix_madvise( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ advice: ::c_int, ++ ) -> ::c_int; + + pub fn shm_unlink(name: *const ::c_char) -> ::c_int; + + pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); + + pub fn telldir(dirp: *mut ::DIR) -> ::c_long; +- pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) +- -> ::c_int; +- +- pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int; +- +- pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, +- flags: ::c_int, addr: *mut ::sockaddr, +- addrlen: *mut ::socklen_t) -> ::ssize_t; ++ pub fn madvise( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ advice: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn msync( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn recvfrom( ++ socket: ::c_int, ++ buf: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ addr: *mut ::sockaddr, ++ addrlen: *mut ::socklen_t, ++ ) -> ::ssize_t; + pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int; + pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; + + pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int; +- pub fn sendmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, +- flags: ::c_uint) -> ::c_int; +- pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, +- flags: ::c_uint, timeout: *mut ::timespec) -> ::c_int; ++ pub fn sendmmsg( ++ sockfd: ::c_int, ++ msgvec: *mut ::mmsghdr, ++ vlen: ::c_uint, ++ flags: ::c_uint, ++ ) -> ::c_int; ++ pub fn recvmmsg( ++ sockfd: ::c_int, ++ msgvec: *mut ::mmsghdr, ++ vlen: ::c_uint, ++ flags: ::c_uint, ++ timeout: *mut ::timespec, ++ ) -> ::c_int; + pub fn sync(); + pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; + 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 pthread_create(native: *mut ::pthread_t, +- attr: *const ::pthread_attr_t, +- f: extern fn(*mut ::c_void) -> *mut ::c_void, +- value: *mut ::c_void) -> ::c_int; ++ pub fn pthread_create( ++ native: *mut ::pthread_t, ++ attr: *const ::pthread_attr_t, ++ f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, ++ value: *mut ::c_void, ++ ) -> ::c_int; + } + + cfg_if! { +diff --git a/third_party/rust/libc/src/unix/linux_like/emscripten/no_align.rs b/third_party/rust/libc/src/unix/linux_like/emscripten/no_align.rs +index ece4dff17c665dda2aaed70bc6b5291ca56ddeeb..768dc73a434f6c5394c360c2561d41b8d5873a83 100644 +--- a/third_party/rust/libc/src/unix/linux_like/emscripten/no_align.rs ++++ b/third_party/rust/libc/src/unix/linux_like/emscripten/no_align.rs +@@ -59,5 +59,5 @@ macro_rules! expand_align { + } + } + } +- } ++ }; + } +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/align.rs b/third_party/rust/libc/src/unix/linux_like/linux/align.rs +index 0ff4649b8cfcbaaf19a0a5e0bd65945ddc7439b2..01e00839d610728ed21e2cf7a36d6db6d0489359 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/align.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/align.rs +@@ -7,7 +7,8 @@ macro_rules! expand_align { + target_arch = "mips64", + target_arch = "s390x", + target_arch = "sparc64", +- target_arch = "aarch64"), ++ target_arch = "aarch64", ++ target_arch = "riscv64"), + repr(align(4)))] + #[cfg_attr(not(any(target_pointer_width = "32", + target_arch = "x86_64", +@@ -15,7 +16,8 @@ macro_rules! expand_align { + target_arch = "mips64", + target_arch = "s390x", + target_arch = "sparc64", +- target_arch = "aarch64")), ++ target_arch = "aarch64", ++ target_arch = "riscv64")), + repr(align(8)))] + pub struct pthread_mutexattr_t { + #[doc(hidden)] +@@ -37,6 +39,17 @@ macro_rules! expand_align { + #[doc(hidden)] + size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], + } ++ ++ #[repr(align(8))] ++ pub struct fanotify_event_metadata { ++ pub event_len: __u32, ++ pub vers: __u8, ++ pub reserved: __u8, ++ pub metadata_len: __u16, ++ pub mask: __u64, ++ pub fd: ::c_int, ++ pub pid: ::c_int, ++ } + } + + s_no_extra_traits! { +@@ -60,14 +73,18 @@ macro_rules! expand_align { + #[cfg_attr(all(target_pointer_width = "32", + any(target_arch = "mips", + target_arch = "arm", ++ target_arch = "hexagon", + target_arch = "powerpc", ++ target_arch = "sparc", + target_arch = "x86_64", + target_arch = "x86")), + repr(align(4)))] + #[cfg_attr(any(target_pointer_width = "64", + not(any(target_arch = "mips", + target_arch = "arm", ++ target_arch = "hexagon", + target_arch = "powerpc", ++ target_arch = "sparc", + target_arch = "x86_64", + target_arch = "x86"))), + repr(align(8)))] +@@ -79,14 +96,18 @@ macro_rules! expand_align { + #[cfg_attr(all(target_pointer_width = "32", + any(target_arch = "mips", + target_arch = "arm", ++ target_arch = "hexagon", + target_arch = "powerpc", ++ target_arch = "sparc", + target_arch = "x86_64", + target_arch = "x86")), + repr(align(4)))] + #[cfg_attr(any(target_pointer_width = "64", + not(any(target_arch = "mips", + target_arch = "arm", ++ target_arch = "hexagon", + target_arch = "powerpc", ++ target_arch = "sparc", + target_arch = "x86_64", + target_arch = "x86"))), + repr(align(8)))] +@@ -94,5 +115,5 @@ macro_rules! expand_align { + size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], + } + } +- } ++ }; + } +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..825546be90a916c52fa04ba22cb9c7a168daa628 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs +@@ -0,0 +1,7 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(8))] ++ pub struct max_align_t { ++ priv_: [i64; 2] ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/arm.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs +similarity index 97% +rename from third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/arm.rs +rename to third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs +index e186c241d67c2dd72c781baf698a81f45e5b096a..22746ee94a037d0b558ea648cc8ecda26b2d1749 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/arm.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs +@@ -33,6 +33,14 @@ s! { + pub l_pid: ::pid_t, + } + ++ pub struct flock64 { ++ pub l_type: ::c_short, ++ pub l_whence: ::c_short, ++ pub l_start: ::off64_t, ++ pub l_len: ::off64_t, ++ pub l_pid: ::pid_t, ++ } ++ + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, +@@ -204,6 +212,7 @@ pub const MAP_NONBLOCK: ::c_int = 0x010000; + pub const MAP_STACK: ::c_int = 0x020000; + pub const MAP_HUGETLB: ::c_int = 0x040000; + pub const MAP_GROWSDOWN: ::c_int = 0x0100; ++pub const MAP_SYNC : ::c_int = 0x080000; + + pub const SOL_SOCKET: ::c_int = 1; + +@@ -349,10 +358,7 @@ pub const SIGURG: ::c_int = 23; + pub const SIGIO: ::c_int = 29; + pub const SIGSYS: ::c_int = 31; + pub const SIGSTKFLT: ::c_int = 16; +-#[deprecated( +- since = "0.2.55", +- note = "Use SIGSYS instead" +-)] ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] + pub const SIGUNUSED: ::c_int = 31; + pub const SIGPOLL: ::c_int = 29; + pub const SIGPWR: ::c_int = 30; +@@ -411,14 +417,14 @@ pub const NOFLSH: ::tcflag_t = 0x00000080; + pub const CIBAUD: ::tcflag_t = 0o02003600000; + pub const CBAUDEX: ::tcflag_t = 0o010000; + pub const VSWTC: usize = 7; +-pub const OLCUC: ::tcflag_t = 0o000002; +-pub const NLDLY: ::tcflag_t = 0o000400; +-pub const CRDLY: ::tcflag_t = 0o003000; ++pub const OLCUC: ::tcflag_t = 0o000002; ++pub const NLDLY: ::tcflag_t = 0o000400; ++pub const CRDLY: ::tcflag_t = 0o003000; + pub const TABDLY: ::tcflag_t = 0o014000; +-pub const BSDLY: ::tcflag_t = 0o020000; +-pub const FFDLY: ::tcflag_t = 0o100000; +-pub const VTDLY: ::tcflag_t = 0o040000; +-pub const XTABS: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const XTABS: ::tcflag_t = 0o014000; + + pub const B0: ::speed_t = 0o000000; + pub const B50: ::speed_t = 0o000001; +@@ -862,3 +868,10 @@ pub const SYS_pkey_mprotect: ::c_long = 394; + pub const SYS_pkey_alloc: ::c_long = 395; + pub const SYS_pkey_free: ::c_long = 396; + pub const SYS_statx: ::c_long = 397; ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..8c228ebab72cec19c6359b5b51d508c21f4f9000 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs +@@ -0,0 +1,7 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(8))] ++ pub struct max_align_t { ++ priv_: [f32; 4] ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/mips.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs +similarity index 87% +rename from third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/mips.rs +rename to third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs +index f21b8c4cae6403b3acd17b4ab10bea629e792b6f..4a3b600aaf6b4d34da2180c10bbc264eb3e1a69d 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/mips.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs +@@ -178,91 +178,91 @@ pub const SYS_close: ::c_long = 4000 + 6; + pub const SYS_waitpid: ::c_long = 4000 + 7; + pub const SYS_creat: ::c_long = 4000 + 8; + pub const SYS_link: ::c_long = 4000 + 9; +-pub const SYS_unlink: ::c_long = 4000 + 10; +-pub const SYS_execve: ::c_long = 4000 + 11; +-pub const SYS_chdir: ::c_long = 4000 + 12; +-pub const SYS_time: ::c_long = 4000 + 13; +-pub const SYS_mknod: ::c_long = 4000 + 14; +-pub const SYS_chmod: ::c_long = 4000 + 15; +-pub const SYS_lchown: ::c_long = 4000 + 16; +-pub const SYS_break: ::c_long = 4000 + 17; +-pub const SYS_lseek: ::c_long = 4000 + 19; +-pub const SYS_getpid: ::c_long = 4000 + 20; +-pub const SYS_mount: ::c_long = 4000 + 21; +-pub const SYS_umount: ::c_long = 4000 + 22; +-pub const SYS_setuid: ::c_long = 4000 + 23; +-pub const SYS_getuid: ::c_long = 4000 + 24; +-pub const SYS_stime: ::c_long = 4000 + 25; +-pub const SYS_ptrace: ::c_long = 4000 + 26; +-pub const SYS_alarm: ::c_long = 4000 + 27; +-pub const SYS_pause: ::c_long = 4000 + 29; +-pub const SYS_utime: ::c_long = 4000 + 30; +-pub const SYS_stty: ::c_long = 4000 + 31; +-pub const SYS_gtty: ::c_long = 4000 + 32; +-pub const SYS_access: ::c_long = 4000 + 33; +-pub const SYS_nice: ::c_long = 4000 + 34; +-pub const SYS_ftime: ::c_long = 4000 + 35; +-pub const SYS_sync: ::c_long = 4000 + 36; +-pub const SYS_kill: ::c_long = 4000 + 37; +-pub const SYS_rename: ::c_long = 4000 + 38; +-pub const SYS_mkdir: ::c_long = 4000 + 39; +-pub const SYS_rmdir: ::c_long = 4000 + 40; +-pub const SYS_dup: ::c_long = 4000 + 41; +-pub const SYS_pipe: ::c_long = 4000 + 42; +-pub const SYS_times: ::c_long = 4000 + 43; +-pub const SYS_prof: ::c_long = 4000 + 44; +-pub const SYS_brk: ::c_long = 4000 + 45; +-pub const SYS_setgid: ::c_long = 4000 + 46; +-pub const SYS_getgid: ::c_long = 4000 + 47; +-pub const SYS_signal: ::c_long = 4000 + 48; +-pub const SYS_geteuid: ::c_long = 4000 + 49; +-pub const SYS_getegid: ::c_long = 4000 + 50; +-pub const SYS_acct: ::c_long = 4000 + 51; +-pub const SYS_umount2: ::c_long = 4000 + 52; +-pub const SYS_lock: ::c_long = 4000 + 53; +-pub const SYS_ioctl: ::c_long = 4000 + 54; +-pub const SYS_fcntl: ::c_long = 4000 + 55; +-pub const SYS_mpx: ::c_long = 4000 + 56; +-pub const SYS_setpgid: ::c_long = 4000 + 57; +-pub const SYS_ulimit: ::c_long = 4000 + 58; +-pub const SYS_umask: ::c_long = 4000 + 60; +-pub const SYS_chroot: ::c_long = 4000 + 61; +-pub const SYS_ustat: ::c_long = 4000 + 62; +-pub const SYS_dup2: ::c_long = 4000 + 63; +-pub const SYS_getppid: ::c_long = 4000 + 64; +-pub const SYS_getpgrp: ::c_long = 4000 + 65; +-pub const SYS_setsid: ::c_long = 4000 + 66; +-pub const SYS_sigaction: ::c_long = 4000 + 67; +-pub const SYS_sgetmask: ::c_long = 4000 + 68; +-pub const SYS_ssetmask: ::c_long = 4000 + 69; +-pub const SYS_setreuid: ::c_long = 4000 + 70; +-pub const SYS_setregid: ::c_long = 4000 + 71; +-pub const SYS_sigsuspend: ::c_long = 4000 + 72; +-pub const SYS_sigpending: ::c_long = 4000 + 73; +-pub const SYS_sethostname: ::c_long = 4000 + 74; +-pub const SYS_setrlimit: ::c_long = 4000 + 75; +-pub const SYS_getrlimit: ::c_long = 4000 + 76; +-pub const SYS_getrusage: ::c_long = 4000 + 77; +-pub const SYS_gettimeofday: ::c_long = 4000 + 78; +-pub const SYS_settimeofday: ::c_long = 4000 + 79; +-pub const SYS_getgroups: ::c_long = 4000 + 80; +-pub const SYS_setgroups: ::c_long = 4000 + 81; +-pub const SYS_symlink: ::c_long = 4000 + 83; +-pub const SYS_readlink: ::c_long = 4000 + 85; +-pub const SYS_uselib: ::c_long = 4000 + 86; +-pub const SYS_swapon: ::c_long = 4000 + 87; +-pub const SYS_reboot: ::c_long = 4000 + 88; +-pub const SYS_readdir: ::c_long = 4000 + 89; +-pub const SYS_mmap: ::c_long = 4000 + 90; +-pub const SYS_munmap: ::c_long = 4000 + 91; +-pub const SYS_truncate: ::c_long = 4000 + 92; +-pub const SYS_ftruncate: ::c_long = 4000 + 93; +-pub const SYS_fchmod: ::c_long = 4000 + 94; +-pub const SYS_fchown: ::c_long = 4000 + 95; +-pub const SYS_getpriority: ::c_long = 4000 + 96; +-pub const SYS_setpriority: ::c_long = 4000 + 97; +-pub const SYS_profil: ::c_long = 4000 + 98; +-pub const SYS_statfs: ::c_long = 4000 + 99; ++pub const SYS_unlink: ::c_long = 4000 + 10; ++pub const SYS_execve: ::c_long = 4000 + 11; ++pub const SYS_chdir: ::c_long = 4000 + 12; ++pub const SYS_time: ::c_long = 4000 + 13; ++pub const SYS_mknod: ::c_long = 4000 + 14; ++pub const SYS_chmod: ::c_long = 4000 + 15; ++pub const SYS_lchown: ::c_long = 4000 + 16; ++pub const SYS_break: ::c_long = 4000 + 17; ++pub const SYS_lseek: ::c_long = 4000 + 19; ++pub const SYS_getpid: ::c_long = 4000 + 20; ++pub const SYS_mount: ::c_long = 4000 + 21; ++pub const SYS_umount: ::c_long = 4000 + 22; ++pub const SYS_setuid: ::c_long = 4000 + 23; ++pub const SYS_getuid: ::c_long = 4000 + 24; ++pub const SYS_stime: ::c_long = 4000 + 25; ++pub const SYS_ptrace: ::c_long = 4000 + 26; ++pub const SYS_alarm: ::c_long = 4000 + 27; ++pub const SYS_pause: ::c_long = 4000 + 29; ++pub const SYS_utime: ::c_long = 4000 + 30; ++pub const SYS_stty: ::c_long = 4000 + 31; ++pub const SYS_gtty: ::c_long = 4000 + 32; ++pub const SYS_access: ::c_long = 4000 + 33; ++pub const SYS_nice: ::c_long = 4000 + 34; ++pub const SYS_ftime: ::c_long = 4000 + 35; ++pub const SYS_sync: ::c_long = 4000 + 36; ++pub const SYS_kill: ::c_long = 4000 + 37; ++pub const SYS_rename: ::c_long = 4000 + 38; ++pub const SYS_mkdir: ::c_long = 4000 + 39; ++pub const SYS_rmdir: ::c_long = 4000 + 40; ++pub const SYS_dup: ::c_long = 4000 + 41; ++pub const SYS_pipe: ::c_long = 4000 + 42; ++pub const SYS_times: ::c_long = 4000 + 43; ++pub const SYS_prof: ::c_long = 4000 + 44; ++pub const SYS_brk: ::c_long = 4000 + 45; ++pub const SYS_setgid: ::c_long = 4000 + 46; ++pub const SYS_getgid: ::c_long = 4000 + 47; ++pub const SYS_signal: ::c_long = 4000 + 48; ++pub const SYS_geteuid: ::c_long = 4000 + 49; ++pub const SYS_getegid: ::c_long = 4000 + 50; ++pub const SYS_acct: ::c_long = 4000 + 51; ++pub const SYS_umount2: ::c_long = 4000 + 52; ++pub const SYS_lock: ::c_long = 4000 + 53; ++pub const SYS_ioctl: ::c_long = 4000 + 54; ++pub const SYS_fcntl: ::c_long = 4000 + 55; ++pub const SYS_mpx: ::c_long = 4000 + 56; ++pub const SYS_setpgid: ::c_long = 4000 + 57; ++pub const SYS_ulimit: ::c_long = 4000 + 58; ++pub const SYS_umask: ::c_long = 4000 + 60; ++pub const SYS_chroot: ::c_long = 4000 + 61; ++pub const SYS_ustat: ::c_long = 4000 + 62; ++pub const SYS_dup2: ::c_long = 4000 + 63; ++pub const SYS_getppid: ::c_long = 4000 + 64; ++pub const SYS_getpgrp: ::c_long = 4000 + 65; ++pub const SYS_setsid: ::c_long = 4000 + 66; ++pub const SYS_sigaction: ::c_long = 4000 + 67; ++pub const SYS_sgetmask: ::c_long = 4000 + 68; ++pub const SYS_ssetmask: ::c_long = 4000 + 69; ++pub const SYS_setreuid: ::c_long = 4000 + 70; ++pub const SYS_setregid: ::c_long = 4000 + 71; ++pub const SYS_sigsuspend: ::c_long = 4000 + 72; ++pub const SYS_sigpending: ::c_long = 4000 + 73; ++pub const SYS_sethostname: ::c_long = 4000 + 74; ++pub const SYS_setrlimit: ::c_long = 4000 + 75; ++pub const SYS_getrlimit: ::c_long = 4000 + 76; ++pub const SYS_getrusage: ::c_long = 4000 + 77; ++pub const SYS_gettimeofday: ::c_long = 4000 + 78; ++pub const SYS_settimeofday: ::c_long = 4000 + 79; ++pub const SYS_getgroups: ::c_long = 4000 + 80; ++pub const SYS_setgroups: ::c_long = 4000 + 81; ++pub const SYS_symlink: ::c_long = 4000 + 83; ++pub const SYS_readlink: ::c_long = 4000 + 85; ++pub const SYS_uselib: ::c_long = 4000 + 86; ++pub const SYS_swapon: ::c_long = 4000 + 87; ++pub const SYS_reboot: ::c_long = 4000 + 88; ++pub const SYS_readdir: ::c_long = 4000 + 89; ++pub const SYS_mmap: ::c_long = 4000 + 90; ++pub const SYS_munmap: ::c_long = 4000 + 91; ++pub const SYS_truncate: ::c_long = 4000 + 92; ++pub const SYS_ftruncate: ::c_long = 4000 + 93; ++pub const SYS_fchmod: ::c_long = 4000 + 94; ++pub const SYS_fchown: ::c_long = 4000 + 95; ++pub const SYS_getpriority: ::c_long = 4000 + 96; ++pub const SYS_setpriority: ::c_long = 4000 + 97; ++pub const SYS_profil: ::c_long = 4000 + 98; ++pub const SYS_statfs: ::c_long = 4000 + 99; + pub const SYS_fstatfs: ::c_long = 4000 + 100; + pub const SYS_ioperm: ::c_long = 4000 + 101; + pub const SYS_socketcall: ::c_long = 4000 + 102; +@@ -526,6 +526,7 @@ pub const SYS_pwritev2: ::c_long = 4000 + 362; + pub const SYS_pkey_mprotect: ::c_long = 4000 + 363; + pub const SYS_pkey_alloc: ::c_long = 4000 + 364; + pub const SYS_pkey_free: ::c_long = 4000 + 365; ++pub const SYS_statx: ::c_long = 4000 + 366; + + pub const O_DIRECT: ::c_int = 0x8000; + pub const O_DIRECTORY: ::c_int = 0x10000; +@@ -839,14 +840,14 @@ pub const NOFLSH: ::tcflag_t = 0x00000080; + pub const CIBAUD: ::tcflag_t = 0o02003600000; + pub const CBAUDEX: ::tcflag_t = 0o010000; + pub const VSWTC: usize = 7; +-pub const OLCUC: ::tcflag_t = 0o000002; +-pub const NLDLY: ::tcflag_t = 0o000400; +-pub const CRDLY: ::tcflag_t = 0o003000; ++pub const OLCUC: ::tcflag_t = 0o000002; ++pub const NLDLY: ::tcflag_t = 0o000400; ++pub const CRDLY: ::tcflag_t = 0o003000; + pub const TABDLY: ::tcflag_t = 0o014000; +-pub const BSDLY: ::tcflag_t = 0o020000; +-pub const FFDLY: ::tcflag_t = 0o100000; +-pub const VTDLY: ::tcflag_t = 0o040000; +-pub const XTABS: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const XTABS: ::tcflag_t = 0o014000; + + pub const B0: ::speed_t = 0o000000; + pub const B50: ::speed_t = 0o000001; +@@ -891,3 +892,10 @@ pub const TIOCM_RNG: ::c_int = 0x200; + pub const TIOCM_DSR: ::c_int = 0x400; + + pub const EHWPOISON: ::c_int = 168; ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/mod.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/mod.rs +index 2e584f21310ecbccd98c32a4d7191d102eedbda2..2eab8ddf61e540991834e529411f5c03d5f69101 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/mod.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/mod.rs +@@ -143,6 +143,10 @@ pub const F_RDLCK: ::c_int = 0; + pub const F_WRLCK: ::c_int = 1; + pub const F_UNLCK: ::c_int = 2; + ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; ++ + pub const SFD_CLOEXEC: ::c_int = 0x080000; + + pub const NCCS: usize = 32; +@@ -237,15 +241,19 @@ pub const PTRACE_SETFPREGS: ::c_uint = 15; + pub const PTRACE_GETREGS: ::c_uint = 12; + pub const PTRACE_SETREGS: ::c_uint = 13; + ++pub const TIOCSBRK: ::c_int = 0x5427; ++pub const TIOCCBRK: ::c_int = 0x5428; ++ + #[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; ++extern "C" { ++ 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; + } + + cfg_if! { +@@ -261,6 +269,9 @@ cfg_if! { + } else if #[cfg(target_arch = "powerpc")] { + mod powerpc; + pub use self::powerpc::*; ++ } else if #[cfg(target_arch = "sparc")] { ++ mod sparc; ++ pub use self::sparc::*; + } else { + // Unknown target_arch + } +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs +index 8f57b726399836409d17cd794ca4cb4803271358..f3f9493f7c63c8e144b1518a7edee66977fd71e2 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs +@@ -33,6 +33,14 @@ s! { + pub l_pid: ::pid_t, + } + ++ pub struct flock64 { ++ pub l_type: ::c_short, ++ pub l_whence: ::c_short, ++ pub l_start: ::off64_t, ++ pub l_len: ::off64_t, ++ pub l_pid: ::pid_t, ++ } ++ + pub struct ipc_perm { + __key: ::key_t, + pub uid: ::uid_t, +@@ -205,6 +213,7 @@ pub const MAP_NONBLOCK: ::c_int = 0x010000; + pub const MAP_STACK: ::c_int = 0x020000; + pub const MAP_HUGETLB: ::c_int = 0x040000; + pub const MAP_GROWSDOWN: ::c_int = 0x0100; ++pub const MAP_SYNC : ::c_int = 0x080000; + + pub const SOL_SOCKET: ::c_int = 1; + +@@ -363,10 +372,7 @@ pub const SIGURG: ::c_int = 23; + pub const SIGIO: ::c_int = 29; + pub const SIGSYS: ::c_int = 31; + pub const SIGSTKFLT: ::c_int = 16; +-#[deprecated( +- since = "0.2.55", +- note = "Use SIGSYS instead" +-)] ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] + pub const SIGUNUSED: ::c_int = 31; + pub const SIGPOLL: ::c_int = 29; + pub const SIGPWR: ::c_int = 30; +@@ -423,14 +429,14 @@ pub const ICANON: ::tcflag_t = 0x100; + pub const PENDIN: ::tcflag_t = 0x20000000; + pub const NOFLSH: ::tcflag_t = 0x80000000; + pub const VSWTC: usize = 9; +-pub const OLCUC: ::tcflag_t = 0o000004; +-pub const NLDLY: ::tcflag_t = 0o001400; +-pub const CRDLY: ::tcflag_t = 0o030000; ++pub const OLCUC: ::tcflag_t = 0o000004; ++pub const NLDLY: ::tcflag_t = 0o001400; ++pub const CRDLY: ::tcflag_t = 0o030000; + pub const TABDLY: ::tcflag_t = 0o006000; +-pub const BSDLY: ::tcflag_t = 0o100000; +-pub const FFDLY: ::tcflag_t = 0o040000; +-pub const VTDLY: ::tcflag_t = 0o200000; +-pub const XTABS: ::tcflag_t = 0o006000; ++pub const BSDLY: ::tcflag_t = 0o100000; ++pub const FFDLY: ::tcflag_t = 0o040000; ++pub const VTDLY: ::tcflag_t = 0o200000; ++pub const XTABS: ::tcflag_t = 0o006000; + + pub const B0: ::speed_t = 0o000000; + pub const B50: ::speed_t = 0o000001; +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..98fda883cd37419f4d297defab5d1c2c6832ae9c +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs +@@ -0,0 +1,7 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(8))] ++ pub struct max_align_t { ++ priv_: [i64; 3] ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..aaa8008701b79893ec3e52a235bde853def9abc0 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs +@@ -0,0 +1,982 @@ ++//! SPARC-specific definitions for 32-bit linux-like values ++ ++pub type c_char = u8; ++pub type wchar_t = i32; ++ ++s! { ++ pub struct sigaction { ++ pub sa_sigaction: ::sighandler_t, ++ pub sa_mask: ::sigset_t, ++ pub sa_flags: ::c_int, ++ pub sa_restorer: ::Option, ++ } ++ ++ pub struct statfs { ++ pub f_type: ::__fsword_t, ++ pub f_bsize: ::__fsword_t, ++ 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_fsid: ::fsid_t, ++ ++ pub f_namelen: ::__fsword_t, ++ pub f_frsize: ::__fsword_t, ++ f_spare: [::__fsword_t; 5], ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: ::c_int, ++ pub si_errno: ::c_int, ++ pub si_code: ::c_int, ++ _pad: [::c_int; 29], ++ _align: [usize; 0], ++ } ++ ++ 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_pid: ::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: ::c_short, ++ pub l_whence: ::c_short, ++ pub l_start: ::off64_t, ++ pub l_len: ::off64_t, ++ pub l_pid: ::pid_t, ++ __reserved: ::c_short, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut ::c_void, ++ pub ss_flags: ::c_int, ++ pub ss_size: ::size_t ++ } ++ ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ 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: ::dev_t, ++ __pad2: ::c_ushort, ++ pub st_size: ::off64_t, ++ pub st_blksize: ::blksize_t, ++ pub st_blocks: ::blkcnt64_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, ++ __unused: [::c_long; 2], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: ::dev_t, ++ 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: ::dev_t, ++ __pad2: ::c_ushort, ++ pub st_size: ::off64_t, ++ pub st_blksize: ::blksize_t, ++ pub st_blocks: ::blkcnt64_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, ++ __reserved: [::c_long; 2], ++ } ++ ++ pub struct statfs64 { ++ pub f_type: ::__fsword_t, ++ pub f_bsize: ::__fsword_t, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_fsid: ::fsid_t, ++ pub f_namelen: ::__fsword_t, ++ pub f_frsize: ::__fsword_t, ++ pub f_flags: ::__fsword_t, ++ pub f_spare: [::__fsword_t; 4], ++ } ++ ++ 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, ++ __f_spare: [::c_int; 6], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: ::c_ulong, ++ pub f_frsize: ::c_ulong, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: u64, ++ pub f_fsid: ::c_ulong, ++ pub f_flag: ::c_ulong, ++ pub f_namemax: ::c_ulong, ++ __f_spare: [::c_int; 6], ++ } ++ ++ pub struct ipc_perm { ++ pub __key: ::key_t, ++ pub uid: ::uid_t, ++ pub gid: ::gid_t, ++ pub cuid: ::uid_t, ++ pub cgid: ::gid_t, ++ __pad1: ::c_ushort, ++ pub mode: ::c_ushort, ++ __pad2: ::c_ushort, ++ pub __seq: ::c_ushort, ++ __unused1: ::c_ulonglong, ++ __unused2: ::c_ulonglong, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: ::ipc_perm, ++ __pad1: ::c_uint, ++ pub shm_atime: ::time_t, ++ __pad2: ::c_uint, ++ pub shm_dtime: ::time_t, ++ __pad3: ::c_uint, ++ pub shm_ctime: ::time_t, ++ pub shm_segsz: ::size_t, ++ pub shm_cpid: ::pid_t, ++ pub shm_lpid: ::pid_t, ++ pub shm_nattch: ::shmatt_t, ++ __reserved1: ::c_ulong, ++ __reserved2: ::c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: ::ipc_perm, ++ __pad1: ::c_uint, ++ pub msg_stime: ::time_t, ++ __pad2: ::c_uint, ++ pub msg_rtime: ::time_t, ++ __pad3: ::c_uint, ++ pub msg_ctime: ::time_t, ++ __msg_cbytes: ::c_ushort, ++ pub msg_qnum: ::msgqnum_t, ++ pub msg_qbytes: ::msglen_t, ++ pub msg_lspid: ::pid_t, ++ pub msg_lrpid: ::pid_t, ++ __glibc_reserved1: ::c_ulong, ++ __glibc_reserved2: ::c_ulong, ++ } ++ ++ pub struct termios2 { ++ 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; 19], ++ pub c_ispeed: ::speed_t, ++ pub c_ospeed: ::speed_t, ++ } ++} ++ ++pub const POSIX_FADV_DONTNEED: ::c_int = 4; ++pub const POSIX_FADV_NOREUSE: ::c_int = 5; ++ ++pub const RLIM_INFINITY: ::rlim_t = !0; ++pub const VEOF: usize = 4; ++pub const RTLD_DEEPBIND: ::c_int = 0x8; ++pub const RTLD_GLOBAL: ::c_int = 0x100; ++pub const RTLD_NOLOAD: ::c_int = 0x4; ++ ++pub const TIOCGSOFTCAR: ::c_ulong = 0x40047464; ++pub const TIOCSSOFTCAR: ::c_ulong = 0x80047465; ++ ++pub const RLIMIT_RSS: ::__rlimit_resource_t = 5; ++pub const RLIMIT_AS: ::__rlimit_resource_t = 9; ++pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8; ++pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 6; ++pub const RLIMIT_NPROC: ::__rlimit_resource_t = 7; ++ ++pub const O_APPEND: ::c_int = 0x8; ++pub const O_CREAT: ::c_int = 0x200; ++pub const O_EXCL: ::c_int = 0x800; ++pub const O_NOCTTY: ::c_int = 0x8000; ++pub const O_NONBLOCK: ::c_int = 0x4000; ++pub const O_SYNC: ::c_int = 0x802000; ++pub const O_RSYNC: ::c_int = 0x802000; ++pub const O_DSYNC: ::c_int = 0x2000; ++pub const O_FSYNC: ::c_int = 0x802000; ++pub const O_NOATIME: ::c_int = 0x200000; ++pub const O_PATH: ::c_int = 0x1000000; ++pub const O_TMPFILE: ::c_int = 0x2000000 | O_DIRECTORY; ++ ++pub const MADV_SOFT_OFFLINE: ::c_int = 101; ++pub const MAP_GROWSDOWN: ::c_int = 0x0200; ++pub const MAP_ANON: ::c_int = 0x0020; ++pub const MAP_ANONYMOUS: ::c_int = 0x0020; ++pub const MAP_DENYWRITE: ::c_int = 0x0800; ++pub const MAP_EXECUTABLE: ::c_int = 0x01000; ++pub const MAP_POPULATE: ::c_int = 0x08000; ++pub const MAP_NONBLOCK: ::c_int = 0x010000; ++pub const MAP_STACK: ::c_int = 0x020000; ++pub const MAP_HUGETLB: ::c_int = 0x040000; ++pub const MAP_SYNC : ::c_int = 0x080000; ++ ++pub const EDEADLK: ::c_int = 78; ++pub const ENAMETOOLONG: ::c_int = 63; ++pub const ENOLCK: ::c_int = 79; ++pub const ENOSYS: ::c_int = 90; ++pub const ENOTEMPTY: ::c_int = 66; ++pub const ELOOP: ::c_int = 62; ++pub const ENOMSG: ::c_int = 75; ++pub const EIDRM: ::c_int = 77; ++pub const ECHRNG: ::c_int = 94; ++pub const EL2NSYNC: ::c_int = 95; ++pub const EL3HLT: ::c_int = 96; ++pub const EL3RST: ::c_int = 97; ++pub const ELNRNG: ::c_int = 98; ++pub const EUNATCH: ::c_int = 99; ++pub const ENOCSI: ::c_int = 100; ++pub const EL2HLT: ::c_int = 101; ++pub const EBADE: ::c_int = 102; ++pub const EBADR: ::c_int = 103; ++pub const EXFULL: ::c_int = 104; ++pub const ENOANO: ::c_int = 105; ++pub const EBADRQC: ::c_int = 106; ++pub const EBADSLT: ::c_int = 107; ++pub const EMULTIHOP: ::c_int = 87; ++pub const EOVERFLOW: ::c_int = 92; ++pub const ENOTUNIQ: ::c_int = 115; ++pub const EBADFD: ::c_int = 93; ++pub const EBADMSG: ::c_int = 76; ++pub const EREMCHG: ::c_int = 89; ++pub const ELIBACC: ::c_int = 114; ++pub const ELIBBAD: ::c_int = 112; ++pub const ELIBSCN: ::c_int = 124; ++pub const ELIBMAX: ::c_int = 123; ++pub const ELIBEXEC: ::c_int = 110; ++pub const EILSEQ: ::c_int = 122; ++pub const ERESTART: ::c_int = 116; ++pub const ESTRPIPE: ::c_int = 91; ++pub const EUSERS: ::c_int = 68; ++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 EHOSTDOWN: ::c_int = 64; ++pub const EHOSTUNREACH: ::c_int = 65; ++pub const EALREADY: ::c_int = 37; ++pub const EINPROGRESS: ::c_int = 36; ++pub const ESTALE: ::c_int = 70; ++pub const EDQUOT: ::c_int = 69; ++pub const ENOMEDIUM: ::c_int = 125; ++pub const EMEDIUMTYPE: ::c_int = 126; ++pub const ECANCELED: ::c_int = 127; ++pub const ENOKEY: ::c_int = 128; ++pub const EKEYEXPIRED: ::c_int = 129; ++pub const EKEYREVOKED: ::c_int = 130; ++pub const EKEYREJECTED: ::c_int = 131; ++pub const EOWNERDEAD: ::c_int = 132; ++pub const ENOTRECOVERABLE: ::c_int = 133; ++pub const EHWPOISON: ::c_int = 135; ++pub const ERFKILL: ::c_int = 134; ++ ++pub const SOL_SOCKET: ::c_int = 0xffff; ++ ++pub const SO_PASSCRED: ::c_int = 2; ++pub const SO_REUSEADDR: ::c_int = 4; ++pub const SO_BINDTODEVICE: ::c_int = 0x000d; ++pub const SO_TIMESTAMP: ::c_int = 0x001d; ++pub const SO_MARK: ::c_int = 0x0022; ++pub const SO_RXQ_OVFL: ::c_int = 0x0024; ++pub const SO_PEEK_OFF: ::c_int = 0x0026; ++pub const SO_BUSY_POLL: ::c_int = 0x0030; ++pub const SO_TYPE: ::c_int = 0x1008; ++pub const SO_ERROR: ::c_int = 0x1007; ++pub const SO_DONTROUTE: ::c_int = 16; ++pub const SO_BROADCAST: ::c_int = 32; ++pub const SO_SNDBUF: ::c_int = 0x1001; ++pub const SO_RCVBUF: ::c_int = 0x1002; ++pub const SO_SNDBUFFORCE: ::c_int = 0x100a; ++pub const SO_RCVBUFFORCE: ::c_int = 0x100b; ++pub const SO_DOMAIN: ::c_int = 0x1029; ++pub const SO_KEEPALIVE: ::c_int = 8; ++pub const SO_OOBINLINE: ::c_int = 0x100; ++pub const SO_LINGER: ::c_int = 128; ++pub const SO_REUSEPORT: ::c_int = 0x200; ++pub const SO_ACCEPTCONN: ::c_int = 0x8000; ++ ++pub const SOCK_STREAM: ::c_int = 1; ++pub const SOCK_DGRAM: ::c_int = 2; ++ ++pub const SA_ONSTACK: ::c_int = 1; ++pub const SA_SIGINFO: ::c_int = 0x200; ++pub const SA_NOCLDWAIT: ::c_int = 0x100; ++ ++pub const SIGTTIN: ::c_int = 21; ++pub const SIGTTOU: ::c_int = 22; ++pub const SIGXCPU: ::c_int = 24; ++pub const SIGXFSZ: ::c_int = 25; ++pub const SIGVTALRM: ::c_int = 26; ++pub const SIGPROF: ::c_int = 27; ++pub const SIGWINCH: ::c_int = 28; ++pub const SIGCHLD: ::c_int = 20; ++pub const SIGBUS: ::c_int = 10; ++pub const SIGUSR1: ::c_int = 30; ++pub const SIGUSR2: ::c_int = 31; ++pub const SIGCONT: ::c_int = 19; ++pub const SIGSTOP: ::c_int = 17; ++pub const SIGTSTP: ::c_int = 18; ++pub const SIGURG: ::c_int = 16; ++pub const SIGIO: ::c_int = 23; ++pub const SIGSYS: ::c_int = 12; ++pub const SIGPOLL: ::c_int = 23; ++pub const SIGPWR: ::c_int = 29; ++pub const SIG_SETMASK: ::c_int = 4; ++pub const SIG_BLOCK: ::c_int = 1; ++pub const SIG_UNBLOCK: ::c_int = 2; ++ ++pub const POLLWRNORM: ::c_short = 4; ++pub const POLLWRBAND: ::c_short = 0x100; ++ ++pub const O_ASYNC: ::c_int = 0x40; ++pub const O_NDELAY: ::c_int = 0x4004; ++ ++pub const PTRACE_DETACH: ::c_uint = 11; ++ ++pub const EFD_NONBLOCK: ::c_int = 0x4000; ++ ++pub const F_GETLK: ::c_int = 7; ++pub const F_GETOWN: ::c_int = 5; ++pub const F_SETOWN: ::c_int = 6; ++pub const F_SETLK: ::c_int = 8; ++pub const F_SETLKW: ::c_int = 9; ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; ++ ++pub const F_RDLCK: ::c_int = 1; ++pub const F_WRLCK: ::c_int = 2; ++pub const F_UNLCK: ::c_int = 3; ++ ++pub const SFD_NONBLOCK: ::c_int = 0x4000; ++ ++pub const TCSANOW: ::c_int = 0; ++pub const TCSADRAIN: ::c_int = 1; ++pub const TCSAFLUSH: ::c_int = 2; ++ ++pub const TIOCLINUX: ::c_ulong = 0x541C; ++pub const TIOCGSERIAL: ::c_ulong = 0x541E; ++pub const TIOCEXCL: ::c_ulong = 0x2000740d; ++pub const TIOCNXCL: ::c_ulong = 0x2000740e; ++pub const TIOCSCTTY: ::c_ulong = 0x20007484; ++pub const TIOCSTI: ::c_ulong = 0x80017472; ++pub const TIOCMGET: ::c_ulong = 0x4004746a; ++pub const TIOCMBIS: ::c_ulong = 0x8004746c; ++pub const TIOCMBIC: ::c_ulong = 0x8004746b; ++pub const TIOCMSET: ::c_ulong = 0x8004746d; ++pub const TIOCCONS: ::c_ulong = 0x20007424; ++ ++pub const TIOCM_ST: ::c_int = 0x008; ++pub const TIOCM_SR: ::c_int = 0x010; ++pub const TIOCM_CTS: ::c_int = 0x020; ++pub const TIOCM_CAR: ::c_int = 0x040; ++pub const TIOCM_RNG: ::c_int = 0x080; ++pub const TIOCM_DSR: ::c_int = 0x100; ++ ++pub const SFD_CLOEXEC: ::c_int = 0x400000; ++ ++pub const NCCS: usize = 17; ++pub const O_TRUNC: ::c_int = 0x400; ++ ++pub const O_CLOEXEC: ::c_int = 0x400000; ++ ++pub const EBFONT: ::c_int = 109; ++pub const ENOSTR: ::c_int = 72; ++pub const ENODATA: ::c_int = 111; ++pub const ETIME: ::c_int = 73; ++pub const ENOSR: ::c_int = 74; ++pub const ENONET: ::c_int = 80; ++pub const ENOPKG: ::c_int = 113; ++pub const EREMOTE: ::c_int = 71; ++pub const ENOLINK: ::c_int = 82; ++pub const EADV: ::c_int = 83; ++pub const ESRMNT: ::c_int = 84; ++pub const ECOMM: ::c_int = 85; ++pub const EPROTO: ::c_int = 86; ++pub const EDOTDOT: ::c_int = 88; ++ ++pub const SA_NODEFER: ::c_int = 0x20; ++pub const SA_RESETHAND: ::c_int = 0x4; ++pub const SA_RESTART: ::c_int = 0x2; ++pub const SA_NOCLDSTOP: ::c_int = 0x00000008; ++ ++pub const EPOLL_CLOEXEC: ::c_int = 0x400000; ++ ++pub const EFD_CLOEXEC: ::c_int = 0x400000; ++ ++pub const O_DIRECTORY: ::c_int = 0o200000; ++pub const O_NOFOLLOW: ::c_int = 0o400000; ++pub const O_LARGEFILE: ::c_int = 0x40000; ++pub const O_DIRECT: ::c_int = 0x100000; ++ ++pub const MAP_LOCKED: ::c_int = 0x0100; ++pub const MAP_NORESERVE: ::c_int = 0x00040; ++ ++pub const EDEADLOCK: ::c_int = 108; ++pub const EUCLEAN: ::c_int = 117; ++pub const ENOTNAM: ::c_int = 118; ++pub const ENAVAIL: ::c_int = 119; ++pub const EISNAM: ::c_int = 120; ++pub const EREMOTEIO: ::c_int = 121; ++ ++pub const SO_PEERCRED: ::c_int = 0x40; ++pub const SO_RCVLOWAT: ::c_int = 0x800; ++pub const SO_SNDLOWAT: ::c_int = 0x1000; ++pub const SO_RCVTIMEO: ::c_int = 0x2000; ++pub const SO_SNDTIMEO: ::c_int = 0x4000; ++ ++pub const FIOCLEX: ::c_ulong = 0x20006601; ++pub const FIONCLEX: ::c_ulong = 0x20006602; ++pub const FIONBIO: ::c_ulong = 0x8004667e; ++ ++pub const MCL_CURRENT: ::c_int = 0x2000; ++pub const MCL_FUTURE: ::c_int = 0x4000; ++ ++pub const SIGSTKSZ: ::size_t = 16384; ++pub const MINSIGSTKSZ: ::size_t = 4096; ++pub const CBAUD: ::tcflag_t = 0x0000100f; ++pub const TAB1: ::tcflag_t = 0x800; ++pub const TAB2: ::tcflag_t = 0x1000; ++pub const TAB3: ::tcflag_t = 0x1800; ++pub const CR1: ::tcflag_t = 0x200; ++pub const CR2: ::tcflag_t = 0x400; ++pub const CR3: ::tcflag_t = 0x600; ++pub const FF1: ::tcflag_t = 0x8000; ++pub const BS1: ::tcflag_t = 0x2000; ++pub const VT1: ::tcflag_t = 0x4000; ++pub const VWERASE: usize = 0xe; ++pub const VREPRINT: usize = 0xc; ++pub const VSUSP: usize = 0xa; ++pub const VSTART: usize = 0x8; ++pub const VSTOP: usize = 0x9; ++pub const VDISCARD: usize = 0xd; ++pub const VTIME: usize = 0x5; ++pub const IXON: ::tcflag_t = 0x400; ++pub const IXOFF: ::tcflag_t = 0x1000; ++pub const ONLCR: ::tcflag_t = 0x4; ++pub const CSIZE: ::tcflag_t = 0x30; ++pub const CS6: ::tcflag_t = 0x10; ++pub const CS7: ::tcflag_t = 0x20; ++pub const CS8: ::tcflag_t = 0x30; ++pub const CSTOPB: ::tcflag_t = 0x40; ++pub const CREAD: ::tcflag_t = 0x80; ++pub const PARENB: ::tcflag_t = 0x100; ++pub const PARODD: ::tcflag_t = 0x200; ++pub const HUPCL: ::tcflag_t = 0x400; ++pub const CLOCAL: ::tcflag_t = 0x800; ++pub const ECHOKE: ::tcflag_t = 0x800; ++pub const ECHOE: ::tcflag_t = 0x10; ++pub const ECHOK: ::tcflag_t = 0x20; ++pub const ECHONL: ::tcflag_t = 0x40; ++pub const ECHOPRT: ::tcflag_t = 0x400; ++pub const ECHOCTL: ::tcflag_t = 0x200; ++pub const ISIG: ::tcflag_t = 0x1; ++pub const ICANON: ::tcflag_t = 0x2; ++pub const PENDIN: ::tcflag_t = 0x4000; ++pub const NOFLSH: ::tcflag_t = 0x80; ++pub const CIBAUD: ::tcflag_t = 0o02003600000; ++pub const CBAUDEX: ::tcflag_t = 0x00001000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: ::tcflag_t = 0o000002; ++pub const NLDLY: ::tcflag_t = 0o000400; ++pub const CRDLY: ::tcflag_t = 0o003000; ++pub const TABDLY: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const XTABS: ::tcflag_t = 0o014000; ++ ++pub const B0: ::speed_t = 0o000000; ++pub const B50: ::speed_t = 0o000001; ++pub const B75: ::speed_t = 0o000002; ++pub const B110: ::speed_t = 0o000003; ++pub const B134: ::speed_t = 0o000004; ++pub const B150: ::speed_t = 0o000005; ++pub const B200: ::speed_t = 0o000006; ++pub const B300: ::speed_t = 0o000007; ++pub const B600: ::speed_t = 0o000010; ++pub const B1200: ::speed_t = 0o000011; ++pub const B1800: ::speed_t = 0o000012; ++pub const B2400: ::speed_t = 0o000013; ++pub const B4800: ::speed_t = 0o000014; ++pub const B9600: ::speed_t = 0o000015; ++pub const B19200: ::speed_t = 0o000016; ++pub const B38400: ::speed_t = 0o000017; ++pub const EXTA: ::speed_t = B19200; ++pub const EXTB: ::speed_t = B38400; ++pub const BOTHER: ::speed_t = 0x1000; ++pub const B57600: ::speed_t = 0x1001; ++pub const B115200: ::speed_t = 0x1002; ++pub const B230400: ::speed_t = 0x1003; ++pub const B460800: ::speed_t = 0x1004; ++pub const B76800: ::speed_t = 0x1005; ++pub const B153600: ::speed_t = 0x1006; ++pub const B307200: ::speed_t = 0x1007; ++pub const B614400: ::speed_t = 0x1008; ++pub const B921600: ::speed_t = 0x1009; ++pub const B500000: ::speed_t = 0x100a; ++pub const B576000: ::speed_t = 0x100b; ++pub const B1000000: ::speed_t = 0x100c; ++pub const B1152000: ::speed_t = 0x100d; ++pub const B1500000: ::speed_t = 0x100e; ++pub const B2000000: ::speed_t = 0x100f; ++ ++pub const VEOL: usize = 5; ++pub const VEOL2: usize = 6; ++pub const VMIN: usize = 4; ++pub const IEXTEN: ::tcflag_t = 0x8000; ++pub const TOSTOP: ::tcflag_t = 0x100; ++pub const FLUSHO: ::tcflag_t = 0x1000; ++pub const EXTPROC: ::tcflag_t = 0x10000; ++pub const TCGETS: ::c_ulong = 0x40245408; ++pub const TCSETS: ::c_ulong = 0x80245409; ++pub const TCSETSW: ::c_ulong = 0x8024540a; ++pub const TCSETSF: ::c_ulong = 0x8024540b; ++pub const TCGETA: ::c_ulong = 0x40125401; ++pub const TCSETA: ::c_ulong = 0x80125402; ++pub const TCSETAW: ::c_ulong = 0x80125403; ++pub const TCSETAF: ::c_ulong = 0x80125404; ++pub const TCSBRK: ::c_ulong = 0x20005405; ++pub const TCXONC: ::c_ulong = 0x20005406; ++pub const TCFLSH: ::c_ulong = 0x20005407; ++pub const TIOCINQ: ::c_ulong = 0x4004667f; ++pub const TIOCGPGRP: ::c_ulong = 0x40047483; ++pub const TIOCSPGRP: ::c_ulong = 0x80047482; ++pub const TIOCOUTQ: ::c_ulong = 0x40047473; ++pub const TIOCGWINSZ: ::c_ulong = 0x40087468; ++pub const TIOCSWINSZ: ::c_ulong = 0x80087467; ++pub const FIONREAD: ::c_ulong = 0x4004667f; ++ ++pub const SYS_restart_syscall: ::c_long = 0; ++pub const SYS_exit: ::c_long = 1; ++pub const SYS_fork: ::c_long = 2; ++pub const SYS_read: ::c_long = 3; ++pub const SYS_write: ::c_long = 4; ++pub const SYS_open: ::c_long = 5; ++pub const SYS_close: ::c_long = 6; ++pub const SYS_wait4: ::c_long = 7; ++pub const SYS_creat: ::c_long = 8; ++pub const SYS_link: ::c_long = 9; ++pub const SYS_unlink: ::c_long = 10; ++pub const SYS_execv: ::c_long = 11; ++pub const SYS_chdir: ::c_long = 12; ++pub const SYS_chown: ::c_long = 13; ++pub const SYS_mknod: ::c_long = 14; ++pub const SYS_chmod: ::c_long = 15; ++pub const SYS_lchown: ::c_long = 16; ++pub const SYS_brk: ::c_long = 17; ++pub const SYS_perfctr: ::c_long = 18; ++pub const SYS_lseek: ::c_long = 19; ++pub const SYS_getpid: ::c_long = 20; ++pub const SYS_capget: ::c_long = 21; ++pub const SYS_capset: ::c_long = 22; ++pub const SYS_setuid: ::c_long = 23; ++pub const SYS_getuid: ::c_long = 24; ++pub const SYS_vmsplice: ::c_long = 25; ++pub const SYS_ptrace: ::c_long = 26; ++pub const SYS_alarm: ::c_long = 27; ++pub const SYS_sigaltstack: ::c_long = 28; ++pub const SYS_pause: ::c_long = 29; ++pub const SYS_utime: ::c_long = 30; ++pub const SYS_lchown32: ::c_long = 31; ++pub const SYS_fchown32: ::c_long = 32; ++pub const SYS_access: ::c_long = 33; ++pub const SYS_nice: ::c_long = 34; ++pub const SYS_chown32: ::c_long = 35; ++pub const SYS_sync: ::c_long = 36; ++pub const SYS_kill: ::c_long = 37; ++pub const SYS_stat: ::c_long = 38; ++pub const SYS_sendfile: ::c_long = 39; ++pub const SYS_lstat: ::c_long = 40; ++pub const SYS_dup: ::c_long = 41; ++pub const SYS_pipe: ::c_long = 42; ++pub const SYS_times: ::c_long = 43; ++pub const SYS_getuid32: ::c_long = 44; ++pub const SYS_umount2: ::c_long = 45; ++pub const SYS_setgid: ::c_long = 46; ++pub const SYS_getgid: ::c_long = 47; ++pub const SYS_signal: ::c_long = 48; ++pub const SYS_geteuid: ::c_long = 49; ++pub const SYS_getegid: ::c_long = 50; ++pub const SYS_acct: ::c_long = 51; ++pub const SYS_getgid32: ::c_long = 53; ++pub const SYS_ioctl: ::c_long = 54; ++pub const SYS_reboot: ::c_long = 55; ++pub const SYS_mmap2: ::c_long = 56; ++pub const SYS_symlink: ::c_long = 57; ++pub const SYS_readlink: ::c_long = 58; ++pub const SYS_execve: ::c_long = 59; ++pub const SYS_umask: ::c_long = 60; ++pub const SYS_chroot: ::c_long = 61; ++pub const SYS_fstat: ::c_long = 62; ++pub const SYS_fstat64: ::c_long = 63; ++pub const SYS_getpagesize: ::c_long = 64; ++pub const SYS_msync: ::c_long = 65; ++pub const SYS_vfork: ::c_long = 66; ++pub const SYS_pread64: ::c_long = 67; ++pub const SYS_pwrite64: ::c_long = 68; ++pub const SYS_geteuid32: ::c_long = 69; ++pub const SYS_getegid32: ::c_long = 70; ++pub const SYS_mmap: ::c_long = 71; ++pub const SYS_setreuid32: ::c_long = 72; ++pub const SYS_munmap: ::c_long = 73; ++pub const SYS_mprotect: ::c_long = 74; ++pub const SYS_madvise: ::c_long = 75; ++pub const SYS_vhangup: ::c_long = 76; ++pub const SYS_truncate64: ::c_long = 77; ++pub const SYS_mincore: ::c_long = 78; ++pub const SYS_getgroups: ::c_long = 79; ++pub const SYS_setgroups: ::c_long = 80; ++pub const SYS_getpgrp: ::c_long = 81; ++pub const SYS_setgroups32: ::c_long = 82; ++pub const SYS_setitimer: ::c_long = 83; ++pub const SYS_ftruncate64: ::c_long = 84; ++pub const SYS_swapon: ::c_long = 85; ++pub const SYS_getitimer: ::c_long = 86; ++pub const SYS_setuid32: ::c_long = 87; ++pub const SYS_sethostname: ::c_long = 88; ++pub const SYS_setgid32: ::c_long = 89; ++pub const SYS_dup2: ::c_long = 90; ++pub const SYS_setfsuid32: ::c_long = 91; ++pub const SYS_fcntl: ::c_long = 92; ++pub const SYS_select: ::c_long = 93; ++pub const SYS_setfsgid32: ::c_long = 94; ++pub const SYS_fsync: ::c_long = 95; ++pub const SYS_setpriority: ::c_long = 96; ++pub const SYS_socket: ::c_long = 97; ++pub const SYS_connect: ::c_long = 98; ++pub const SYS_accept: ::c_long = 99; ++pub const SYS_getpriority: ::c_long = 100; ++pub const SYS_rt_sigreturn: ::c_long = 101; ++pub const SYS_rt_sigaction: ::c_long = 102; ++pub const SYS_rt_sigprocmask: ::c_long = 103; ++pub const SYS_rt_sigpending: ::c_long = 104; ++pub const SYS_rt_sigtimedwait: ::c_long = 105; ++pub const SYS_rt_sigqueueinfo: ::c_long = 106; ++pub const SYS_rt_sigsuspend: ::c_long = 107; ++pub const SYS_setresuid32: ::c_long = 108; ++pub const SYS_getresuid32: ::c_long = 109; ++pub const SYS_setresgid32: ::c_long = 110; ++pub const SYS_getresgid32: ::c_long = 111; ++pub const SYS_setregid32: ::c_long = 112; ++pub const SYS_recvmsg: ::c_long = 113; ++pub const SYS_sendmsg: ::c_long = 114; ++pub const SYS_getgroups32: ::c_long = 115; ++pub const SYS_gettimeofday: ::c_long = 116; ++pub const SYS_getrusage: ::c_long = 117; ++pub const SYS_getsockopt: ::c_long = 118; ++pub const SYS_getcwd: ::c_long = 119; ++pub const SYS_readv: ::c_long = 120; ++pub const SYS_writev: ::c_long = 121; ++pub const SYS_settimeofday: ::c_long = 122; ++pub const SYS_fchown: ::c_long = 123; ++pub const SYS_fchmod: ::c_long = 124; ++pub const SYS_recvfrom: ::c_long = 125; ++pub const SYS_setreuid: ::c_long = 126; ++pub const SYS_setregid: ::c_long = 127; ++pub const SYS_rename: ::c_long = 128; ++pub const SYS_truncate: ::c_long = 129; ++pub const SYS_ftruncate: ::c_long = 130; ++pub const SYS_flock: ::c_long = 131; ++pub const SYS_lstat64: ::c_long = 132; ++pub const SYS_sendto: ::c_long = 133; ++pub const SYS_shutdown: ::c_long = 134; ++pub const SYS_socketpair: ::c_long = 135; ++pub const SYS_mkdir: ::c_long = 136; ++pub const SYS_rmdir: ::c_long = 137; ++pub const SYS_utimes: ::c_long = 138; ++pub const SYS_stat64: ::c_long = 139; ++pub const SYS_sendfile64: ::c_long = 140; ++pub const SYS_getpeername: ::c_long = 141; ++pub const SYS_futex: ::c_long = 142; ++pub const SYS_gettid: ::c_long = 143; ++pub const SYS_getrlimit: ::c_long = 144; ++pub const SYS_setrlimit: ::c_long = 145; ++pub const SYS_pivot_root: ::c_long = 146; ++pub const SYS_prctl: ::c_long = 147; ++pub const SYS_pciconfig_read: ::c_long = 148; ++pub const SYS_pciconfig_write: ::c_long = 149; ++pub const SYS_getsockname: ::c_long = 150; ++pub const SYS_inotify_init: ::c_long = 151; ++pub const SYS_inotify_add_watch: ::c_long = 152; ++pub const SYS_poll: ::c_long = 153; ++pub const SYS_getdents64: ::c_long = 154; ++pub const SYS_fcntl64: ::c_long = 155; ++pub const SYS_inotify_rm_watch: ::c_long = 156; ++pub const SYS_statfs: ::c_long = 157; ++pub const SYS_fstatfs: ::c_long = 158; ++pub const SYS_umount: ::c_long = 159; ++pub const SYS_sched_set_affinity: ::c_long = 160; ++pub const SYS_sched_get_affinity: ::c_long = 161; ++pub const SYS_getdomainname: ::c_long = 162; ++pub const SYS_setdomainname: ::c_long = 163; ++pub const SYS_quotactl: ::c_long = 165; ++pub const SYS_set_tid_address: ::c_long = 166; ++pub const SYS_mount: ::c_long = 167; ++pub const SYS_ustat: ::c_long = 168; ++pub const SYS_setxattr: ::c_long = 169; ++pub const SYS_lsetxattr: ::c_long = 170; ++pub const SYS_fsetxattr: ::c_long = 171; ++pub const SYS_getxattr: ::c_long = 172; ++pub const SYS_lgetxattr: ::c_long = 173; ++pub const SYS_getdents: ::c_long = 174; ++pub const SYS_setsid: ::c_long = 175; ++pub const SYS_fchdir: ::c_long = 176; ++pub const SYS_fgetxattr: ::c_long = 177; ++pub const SYS_listxattr: ::c_long = 178; ++pub const SYS_llistxattr: ::c_long = 179; ++pub const SYS_flistxattr: ::c_long = 180; ++pub const SYS_removexattr: ::c_long = 181; ++pub const SYS_lremovexattr: ::c_long = 182; ++pub const SYS_sigpending: ::c_long = 183; ++pub const SYS_query_module: ::c_long = 184; ++pub const SYS_setpgid: ::c_long = 185; ++pub const SYS_fremovexattr: ::c_long = 186; ++pub const SYS_tkill: ::c_long = 187; ++pub const SYS_exit_group: ::c_long = 188; ++pub const SYS_uname: ::c_long = 189; ++pub const SYS_init_module: ::c_long = 190; ++pub const SYS_personality: ::c_long = 191; ++pub const SYS_remap_file_pages: ::c_long = 192; ++pub const SYS_epoll_create: ::c_long = 193; ++pub const SYS_epoll_ctl: ::c_long = 194; ++pub const SYS_epoll_wait: ::c_long = 195; ++pub const SYS_ioprio_set: ::c_long = 196; ++pub const SYS_getppid: ::c_long = 197; ++pub const SYS_sigaction: ::c_long = 198; ++pub const SYS_sgetmask: ::c_long = 199; ++pub const SYS_ssetmask: ::c_long = 200; ++pub const SYS_sigsuspend: ::c_long = 201; ++pub const SYS_oldlstat: ::c_long = 202; ++pub const SYS_uselib: ::c_long = 203; ++pub const SYS_readdir: ::c_long = 204; ++pub const SYS_readahead: ::c_long = 205; ++pub const SYS_socketcall: ::c_long = 206; ++pub const SYS_syslog: ::c_long = 207; ++pub const SYS_lookup_dcookie: ::c_long = 208; ++pub const SYS_fadvise64: ::c_long = 209; ++pub const SYS_fadvise64_64: ::c_long = 210; ++pub const SYS_tgkill: ::c_long = 211; ++pub const SYS_waitpid: ::c_long = 212; ++pub const SYS_swapoff: ::c_long = 213; ++pub const SYS_sysinfo: ::c_long = 214; ++pub const SYS_ipc: ::c_long = 215; ++pub const SYS_sigreturn: ::c_long = 216; ++pub const SYS_clone: ::c_long = 217; ++pub const SYS_ioprio_get: ::c_long = 218; ++pub const SYS_adjtimex: ::c_long = 219; ++pub const SYS_sigprocmask: ::c_long = 220; ++pub const SYS_create_module: ::c_long = 221; ++pub const SYS_delete_module: ::c_long = 222; ++pub const SYS_get_kernel_syms: ::c_long = 223; ++pub const SYS_getpgid: ::c_long = 224; ++pub const SYS_bdflush: ::c_long = 225; ++pub const SYS_sysfs: ::c_long = 226; ++pub const SYS_afs_syscall: ::c_long = 227; ++pub const SYS_setfsuid: ::c_long = 228; ++pub const SYS_setfsgid: ::c_long = 229; ++pub const SYS__newselect: ::c_long = 230; ++pub const SYS_time: ::c_long = 231; ++pub const SYS_splice: ::c_long = 232; ++pub const SYS_stime: ::c_long = 233; ++pub const SYS_statfs64: ::c_long = 234; ++pub const SYS_fstatfs64: ::c_long = 235; ++pub const SYS__llseek: ::c_long = 236; ++pub const SYS_mlock: ::c_long = 237; ++pub const SYS_munlock: ::c_long = 238; ++pub const SYS_mlockall: ::c_long = 239; ++pub const SYS_munlockall: ::c_long = 240; ++pub const SYS_sched_setparam: ::c_long = 241; ++pub const SYS_sched_getparam: ::c_long = 242; ++pub const SYS_sched_setscheduler: ::c_long = 243; ++pub const SYS_sched_getscheduler: ::c_long = 244; ++pub const SYS_sched_yield: ::c_long = 245; ++pub const SYS_sched_get_priority_max: ::c_long = 246; ++pub const SYS_sched_get_priority_min: ::c_long = 247; ++pub const SYS_sched_rr_get_interval: ::c_long = 248; ++pub const SYS_nanosleep: ::c_long = 249; ++pub const SYS_mremap: ::c_long = 250; ++pub const SYS__sysctl: ::c_long = 251; ++pub const SYS_getsid: ::c_long = 252; ++pub const SYS_fdatasync: ::c_long = 253; ++pub const SYS_nfsservctl: ::c_long = 254; ++pub const SYS_sync_file_range: ::c_long = 255; ++pub const SYS_clock_settime: ::c_long = 256; ++pub const SYS_clock_gettime: ::c_long = 257; ++pub const SYS_clock_getres: ::c_long = 258; ++pub const SYS_clock_nanosleep: ::c_long = 259; ++pub const SYS_sched_getaffinity: ::c_long = 260; ++pub const SYS_sched_setaffinity: ::c_long = 261; ++pub const SYS_timer_settime: ::c_long = 262; ++pub const SYS_timer_gettime: ::c_long = 263; ++pub const SYS_timer_getoverrun: ::c_long = 264; ++pub const SYS_timer_delete: ::c_long = 265; ++pub const SYS_timer_create: ::c_long = 266; ++pub const SYS_io_setup: ::c_long = 268; ++pub const SYS_io_destroy: ::c_long = 269; ++pub const SYS_io_submit: ::c_long = 270; ++pub const SYS_io_cancel: ::c_long = 271; ++pub const SYS_io_getevents: ::c_long = 272; ++pub const SYS_mq_open: ::c_long = 273; ++pub const SYS_mq_unlink: ::c_long = 274; ++pub const SYS_mq_timedsend: ::c_long = 275; ++pub const SYS_mq_timedreceive: ::c_long = 276; ++pub const SYS_mq_notify: ::c_long = 277; ++pub const SYS_mq_getsetattr: ::c_long = 278; ++pub const SYS_waitid: ::c_long = 279; ++pub const SYS_tee: ::c_long = 280; ++pub const SYS_add_key: ::c_long = 281; ++pub const SYS_request_key: ::c_long = 282; ++pub const SYS_keyctl: ::c_long = 283; ++pub const SYS_openat: ::c_long = 284; ++pub const SYS_mkdirat: ::c_long = 285; ++pub const SYS_mknodat: ::c_long = 286; ++pub const SYS_fchownat: ::c_long = 287; ++pub const SYS_futimesat: ::c_long = 288; ++pub const SYS_fstatat64: ::c_long = 289; ++pub const SYS_unlinkat: ::c_long = 290; ++pub const SYS_renameat: ::c_long = 291; ++pub const SYS_linkat: ::c_long = 292; ++pub const SYS_symlinkat: ::c_long = 293; ++pub const SYS_readlinkat: ::c_long = 294; ++pub const SYS_fchmodat: ::c_long = 295; ++pub const SYS_faccessat: ::c_long = 296; ++pub const SYS_pselect6: ::c_long = 297; ++pub const SYS_ppoll: ::c_long = 298; ++pub const SYS_unshare: ::c_long = 299; ++pub const SYS_set_robust_list: ::c_long = 300; ++pub const SYS_get_robust_list: ::c_long = 301; ++pub const SYS_migrate_pages: ::c_long = 302; ++pub const SYS_mbind: ::c_long = 303; ++pub const SYS_get_mempolicy: ::c_long = 304; ++pub const SYS_set_mempolicy: ::c_long = 305; ++pub const SYS_kexec_load: ::c_long = 306; ++pub const SYS_move_pages: ::c_long = 307; ++pub const SYS_getcpu: ::c_long = 308; ++pub const SYS_epoll_pwait: ::c_long = 309; ++pub const SYS_utimensat: ::c_long = 310; ++pub const SYS_signalfd: ::c_long = 311; ++pub const SYS_timerfd_create: ::c_long = 312; ++pub const SYS_eventfd: ::c_long = 313; ++pub const SYS_fallocate: ::c_long = 314; ++pub const SYS_timerfd_settime: ::c_long = 315; ++pub const SYS_timerfd_gettime: ::c_long = 316; ++pub const SYS_signalfd4: ::c_long = 317; ++pub const SYS_eventfd2: ::c_long = 318; ++pub const SYS_epoll_create1: ::c_long = 319; ++pub const SYS_dup3: ::c_long = 320; ++pub const SYS_pipe2: ::c_long = 321; ++pub const SYS_inotify_init1: ::c_long = 322; ++pub const SYS_accept4: ::c_long = 323; ++pub const SYS_preadv: ::c_long = 324; ++pub const SYS_pwritev: ::c_long = 325; ++pub const SYS_rt_tgsigqueueinfo: ::c_long = 326; ++pub const SYS_perf_event_open: ::c_long = 327; ++pub const SYS_recvmmsg: ::c_long = 328; ++pub const SYS_fanotify_init: ::c_long = 329; ++pub const SYS_fanotify_mark: ::c_long = 330; ++pub const SYS_prlimit64: ::c_long = 331; ++pub const SYS_name_to_handle_at: ::c_long = 332; ++pub const SYS_open_by_handle_at: ::c_long = 333; ++pub const SYS_clock_adjtime: ::c_long = 334; ++pub const SYS_syncfs: ::c_long = 335; ++pub const SYS_sendmmsg: ::c_long = 336; ++pub const SYS_setns: ::c_long = 337; ++pub const SYS_process_vm_readv: ::c_long = 338; ++pub const SYS_process_vm_writev: ::c_long = 339; ++pub const SYS_kern_features: ::c_long = 340; ++pub const SYS_kcmp: ::c_long = 341; ++pub const SYS_finit_module: ::c_long = 342; ++pub const SYS_sched_setattr: ::c_long = 343; ++pub const SYS_sched_getattr: ::c_long = 344; ++pub const SYS_renameat2: ::c_long = 345; ++pub const SYS_seccomp: ::c_long = 346; ++pub const SYS_getrandom: ::c_long = 347; ++pub const SYS_memfd_create: ::c_long = 348; ++pub const SYS_bpf: ::c_long = 349; ++pub const SYS_execveat: ::c_long = 350; ++pub const SYS_membarrier: ::c_long = 351; ++pub const SYS_userfaultfd: ::c_long = 352; ++pub const SYS_bind: ::c_long = 353; ++pub const SYS_listen: ::c_long = 354; ++pub const SYS_setsockopt: ::c_long = 355; ++pub const SYS_mlock2: ::c_long = 356; ++pub const SYS_copy_file_range: ::c_long = 357; ++pub const SYS_preadv2: ::c_long = 358; ++pub const SYS_pwritev2: ::c_long = 359; ++pub const SYS_statx: ::c_long = 360; ++ ++#[link(name = "util")] ++extern "C" { ++ 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; ++} ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..96634749f53b2a7c2f5e21113d5dbd8a92b7f550 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs +@@ -0,0 +1,7 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 6] ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/x86.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs +similarity index 97% +rename from third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/x86.rs +rename to third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs +index 654a18d73d830b6068267ca206c4b1c9bc6f793a..b1d306c81c91b793aaaf091d9fa12833514bebe5 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/x86.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs +@@ -34,6 +34,14 @@ s! { + pub l_pid: ::pid_t, + } + ++ pub struct flock64 { ++ pub l_type: ::c_short, ++ pub l_whence: ::c_short, ++ pub l_start: ::off64_t, ++ pub l_len: ::off64_t, ++ pub l_pid: ::pid_t, ++ } ++ + pub struct _libc_fpreg { + pub significand: [u16; 4], + pub exponent: u16, +@@ -240,7 +248,7 @@ s! { + } + } + +-s_no_extra_traits!{ ++s_no_extra_traits! { + pub struct user_fpxregs_struct { + pub cwd: ::c_ushort, + pub swd: ::c_ushort, +@@ -408,6 +416,7 @@ pub const MAP_NONBLOCK: ::c_int = 0x010000; + pub const MAP_STACK: ::c_int = 0x020000; + pub const MAP_HUGETLB: ::c_int = 0x040000; + pub const MAP_GROWSDOWN: ::c_int = 0x0100; ++pub const MAP_SYNC : ::c_int = 0x080000; + + pub const EDEADLOCK: ::c_int = 35; + pub const EUCLEAN: ::c_int = 117; +@@ -534,6 +543,8 @@ pub const FIONBIO: ::c_ulong = 0x5421; + + pub const PTRACE_GETFPXREGS: ::c_uint = 18; + pub const PTRACE_SETFPXREGS: ::c_uint = 19; ++pub const PTRACE_SYSEMU: ::c_uint = 31; ++pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32; + + pub const MCL_CURRENT: ::c_int = 0x0001; + pub const MCL_FUTURE: ::c_int = 0x0002; +@@ -555,10 +566,7 @@ pub const SIGURG: ::c_int = 23; + pub const SIGIO: ::c_int = 29; + pub const SIGSYS: ::c_int = 31; + pub const SIGSTKFLT: ::c_int = 16; +-#[deprecated( +- since = "0.2.55", +- note = "Use SIGSYS instead" +-)] ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] + pub const SIGUNUSED: ::c_int = 31; + pub const SIGPOLL: ::c_int = 29; + pub const SIGPWR: ::c_int = 30; +@@ -617,14 +625,14 @@ pub const NOFLSH: ::tcflag_t = 0x00000080; + pub const CIBAUD: ::tcflag_t = 0o02003600000; + pub const CBAUDEX: ::tcflag_t = 0o010000; + pub const VSWTC: usize = 7; +-pub const OLCUC: ::tcflag_t = 0o000002; +-pub const NLDLY: ::tcflag_t = 0o000400; +-pub const CRDLY: ::tcflag_t = 0o003000; ++pub const OLCUC: ::tcflag_t = 0o000002; ++pub const NLDLY: ::tcflag_t = 0o000400; ++pub const CRDLY: ::tcflag_t = 0o003000; + pub const TABDLY: ::tcflag_t = 0o014000; +-pub const BSDLY: ::tcflag_t = 0o020000; +-pub const FFDLY: ::tcflag_t = 0o100000; +-pub const VTDLY: ::tcflag_t = 0o040000; +-pub const XTABS: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const XTABS: ::tcflag_t = 0o014000; + + pub const TIOCGSOFTCAR: ::c_ulong = 0x5419; + pub const TIOCSSOFTCAR: ::c_ulong = 0x541A; +@@ -1136,12 +1144,24 @@ pub const REG_EFL: ::c_int = 16; + pub const REG_UESP: ::c_int = 17; + pub const REG_SS: ::c_int = 18; + +-extern { ++extern "C" { + pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int; + pub fn setcontext(ucp: *const ucontext_t) -> ::c_int; +- pub fn makecontext(ucp: *mut ucontext_t, +- func: extern fn (), +- argc: ::c_int, ...); +- pub fn swapcontext(uocp: *mut ucontext_t, +- ucp: *const ucontext_t) -> ::c_int; ++ pub fn makecontext( ++ ucp: *mut ucontext_t, ++ func: extern "C" fn(), ++ argc: ::c_int, ++ ... ++ ); ++ pub fn swapcontext( ++ uocp: *mut ucontext_t, ++ ucp: *const ucontext_t, ++ ) -> ::c_int; ++} ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } + } +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..154c2c54ce6deb78622883e3805113698588e374 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs +@@ -0,0 +1,29 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f32; 8] ++ } ++} ++ ++s! { ++ pub struct ucontext_t { ++ pub uc_flags: ::c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: ::stack_t, ++ pub uc_sigmask: ::sigset_t, ++ pub uc_mcontext: mcontext_t, ++ } ++ ++ #[repr(align(16))] ++ pub struct mcontext_t { ++ pub fault_address: ::c_ulonglong, ++ pub regs: [::c_ulonglong; 31], ++ pub sp: ::c_ulonglong, ++ pub pc: ::c_ulonglong, ++ pub pstate: ::c_ulonglong, ++ // nested arrays to get the right size/length while being able to ++ // auto-derive traits like Debug ++ __reserved: [[u64; 32]; 16], ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/aarch64.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs +similarity index 90% +rename from third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/aarch64.rs +rename to third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs +index 3e1bff5a1d877bd5b1aa9bbb98b780bea232469c..a65199ab7757a4151fcca73140c07311bab2c499 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/aarch64.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs +@@ -45,6 +45,14 @@ s! { + pub l_pid: ::pid_t, + } + ++ pub struct flock64 { ++ pub l_type: ::c_short, ++ pub l_whence: ::c_short, ++ pub l_start: ::off64_t, ++ pub l_len: ::off64_t, ++ pub l_pid: ::pid_t, ++ } ++ + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, +@@ -204,11 +212,6 @@ pub const RTLD_DEEPBIND: ::c_int = 0x8; + pub const RTLD_GLOBAL: ::c_int = 0x100; + pub const RTLD_NOLOAD: ::c_int = 0x4; + +-pub const TIOCGSOFTCAR: ::c_ulong = 0x5419; +-pub const TIOCSSOFTCAR: ::c_ulong = 0x541A; +-pub const TIOCGRS485: ::c_int = 0x542E; +-pub const TIOCSRS485: ::c_int = 0x542F; +- + pub const RLIMIT_RSS: ::__rlimit_resource_t = 5; + pub const RLIMIT_AS: ::__rlimit_resource_t = 9; + pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8; +@@ -398,10 +401,7 @@ pub const SIGURG: ::c_int = 23; + pub const SIGIO: ::c_int = 29; + pub const SIGSYS: ::c_int = 31; + pub const SIGSTKFLT: ::c_int = 16; +-#[deprecated( +- since = "0.2.55", +- note = "Use SIGSYS instead" +-)] ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] + pub const SIGUNUSED: ::c_int = 31; + pub const SIGPOLL: ::c_int = 29; + pub const SIGPWR: ::c_int = 30; +@@ -424,6 +424,9 @@ pub const F_GETOWN: ::c_int = 9; + pub const F_SETOWN: ::c_int = 8; + pub const F_SETLK: ::c_int = 6; + pub const F_SETLKW: ::c_int = 7; ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; + + pub const F_RDLCK: ::c_int = 0; + pub const F_WRLCK: ::c_int = 1; +@@ -439,7 +442,13 @@ pub const TIOCMGET: ::c_ulong = 0x5415; + pub const TIOCMBIS: ::c_ulong = 0x5416; + pub const TIOCMBIC: ::c_ulong = 0x5417; + pub const TIOCMSET: ::c_ulong = 0x5418; ++pub const TIOCGSOFTCAR: ::c_ulong = 0x5419; ++pub const TIOCSSOFTCAR: ::c_ulong = 0x541A; + pub const TIOCCONS: ::c_ulong = 0x541D; ++pub const TIOCSBRK: ::c_ulong = 0x5427; ++pub const TIOCCBRK: ::c_ulong = 0x5428; ++pub const TIOCGRS485: ::c_int = 0x542E; ++pub const TIOCSRS485: ::c_int = 0x542F; + + pub const TIOCM_ST: ::c_int = 0x008; + pub const TIOCM_SR: ::c_int = 0x010; +@@ -525,6 +534,7 @@ pub const MAP_POPULATE: ::c_int = 0x08000; + pub const MAP_NONBLOCK: ::c_int = 0x010000; + pub const MAP_STACK: ::c_int = 0x020000; + pub const MAP_HUGETLB: ::c_int = 0x040000; ++pub const MAP_SYNC: ::c_int = 0x080000; + + pub const EDEADLOCK: ::c_int = 35; + +@@ -580,14 +590,14 @@ pub const NOFLSH: ::tcflag_t = 0x00000080; + pub const CIBAUD: ::tcflag_t = 0o02003600000; + pub const CBAUDEX: ::tcflag_t = 0o010000; + pub const VSWTC: usize = 7; +-pub const OLCUC: ::tcflag_t = 0o000002; +-pub const NLDLY: ::tcflag_t = 0o000400; +-pub const CRDLY: ::tcflag_t = 0o003000; ++pub const OLCUC: ::tcflag_t = 0o000002; ++pub const NLDLY: ::tcflag_t = 0o000400; ++pub const CRDLY: ::tcflag_t = 0o003000; + pub const TABDLY: ::tcflag_t = 0o014000; +-pub const BSDLY: ::tcflag_t = 0o020000; +-pub const FFDLY: ::tcflag_t = 0o100000; +-pub const VTDLY: ::tcflag_t = 0o040000; +-pub const XTABS: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const XTABS: ::tcflag_t = 0o014000; + + pub const B0: ::speed_t = 0o000000; + pub const B50: ::speed_t = 0o000001; +@@ -657,6 +667,51 @@ pub const TCSAFLUSH: ::c_int = 2; + pub const TIOCLINUX: ::c_ulong = 0x541C; + pub const TIOCGSERIAL: ::c_ulong = 0x541E; + ++// sys/auxv.h ++pub const HWCAP_FP: ::c_ulong = 1 << 0; ++pub const HWCAP_ASIMD: ::c_ulong = 1 << 1; ++pub const HWCAP_EVTSTRM: ::c_ulong = 1 << 2; ++pub const HWCAP_AES: ::c_ulong = 1 << 3; ++pub const HWCAP_PMULL: ::c_ulong = 1 << 4; ++pub const HWCAP_SHA1: ::c_ulong = 1 << 5; ++pub const HWCAP_SHA2: ::c_ulong = 1 << 6; ++pub const HWCAP_CRC32: ::c_ulong = 1 << 7; ++pub const HWCAP_ATOMICS: ::c_ulong = 1 << 8; ++pub const HWCAP_FPHP: ::c_ulong = 1 << 9; ++pub const HWCAP_ASIMDHP: ::c_ulong = 1 << 10; ++pub const HWCAP_CPUID: ::c_ulong = 1 << 11; ++pub const HWCAP_ASIMDRDM: ::c_ulong = 1 << 12; ++pub const HWCAP_JSCVT: ::c_ulong = 1 << 13; ++pub const HWCAP_FCMA: ::c_ulong = 1 << 14; ++pub const HWCAP_LRCPC: ::c_ulong = 1 << 15; ++pub const HWCAP_DCPOP: ::c_ulong = 1 << 16; ++pub const HWCAP_SHA3: ::c_ulong = 1 << 17; ++pub const HWCAP_SM3: ::c_ulong = 1 << 18; ++pub const HWCAP_SM4: ::c_ulong = 1 << 19; ++pub const HWCAP_ASIMDDP: ::c_ulong = 1 << 20; ++pub const HWCAP_SHA512: ::c_ulong = 1 << 21; ++pub const HWCAP_SVE: ::c_ulong = 1 << 22; ++pub const HWCAP_ASIMDFHM: ::c_ulong = 1 << 23; ++pub const HWCAP_DIT: ::c_ulong = 1 << 24; ++pub const HWCAP_USCAT: ::c_ulong = 1 << 25; ++pub const HWCAP_ILRCPC: ::c_ulong = 1 << 26; ++pub const HWCAP_FLAGM: ::c_ulong = 1 << 27; ++pub const HWCAP_SSBS: ::c_ulong = 1 << 28; ++pub const HWCAP_SB: ::c_ulong = 1 << 29; ++pub const HWCAP_PACA: ::c_ulong = 1 << 30; ++pub const HWCAP_PACG: ::c_ulong = 1 << 31; ++// FIXME: enable these again once linux-api-headers are up to date enough on CI. ++// See discussion in https://github.com/rust-lang/libc/pull/1638 ++//pub const HWCAP2_DCPODP: ::c_ulong = 1 << 0; ++//pub const HWCAP2_SVE2: ::c_ulong = 1 << 1; ++//pub const HWCAP2_SVEAES: ::c_ulong = 1 << 2; ++//pub const HWCAP2_SVEPMULL: ::c_ulong = 1 << 3; ++//pub const HWCAP2_SVEBITPERM: ::c_ulong = 1 << 4; ++//pub const HWCAP2_SVESHA3: ::c_ulong = 1 << 5; ++//pub const HWCAP2_SVESM4: ::c_ulong = 1 << 6; ++//pub const HWCAP2_FLAGM2: ::c_ulong = 1 << 7; ++//pub const HWCAP2_FRINT: ::c_ulong = 1 << 8; ++ + // Syscall table + pub const SYS_io_setup: ::c_long = 0; + pub const SYS_io_destroy: ::c_long = 1; +@@ -701,6 +756,10 @@ pub const SYS_umount2: ::c_long = 39; + pub const SYS_mount: ::c_long = 40; + pub const SYS_pivot_root: ::c_long = 41; + pub const SYS_nfsservctl: ::c_long = 42; ++pub const SYS_statfs: ::c_long = 43; ++pub const SYS_fstatfs: ::c_long = 44; ++pub const SYS_truncate: ::c_long = 45; ++pub const SYS_ftruncate: ::c_long = 46; + pub const SYS_fallocate: ::c_long = 47; + pub const SYS_faccessat: ::c_long = 48; + pub const SYS_chdir: ::c_long = 49; +@@ -927,14 +986,23 @@ pub const SYS_pwritev2: ::c_long = 287; + pub const SYS_pkey_mprotect: ::c_long = 288; + pub const SYS_pkey_alloc: ::c_long = 289; + pub const SYS_pkey_free: ::c_long = 290; ++pub const SYS_statx: ::c_long = 291; + + #[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; ++extern "C" { ++ 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; ++} ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } + } +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..7ca870fd02b71e31e44439e3fabdf1386eb75bb9 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs +@@ -0,0 +1,7 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 4] ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/mips64.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs +similarity index 86% +rename from third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/mips64.rs +rename to third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs +index baaa330028fe1efec0bc8b46ccebd7f9ccddf804..2e0d78eb81539760e2238287cc0f16f8680203a5 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/mips64.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs +@@ -57,6 +57,14 @@ s! { + pub l_pid: ::pid_t, + } + ++ pub struct flock64 { ++ pub l_type: ::c_short, ++ pub l_whence: ::c_short, ++ pub l_start: ::off64_t, ++ pub l_len: ::off64_t, ++ pub l_pid: ::pid_t, ++ } ++ + pub struct stat64 { + pub st_dev: ::c_ulong, + st_pad1: [::c_long; 2], +@@ -254,96 +262,96 @@ pub const SYS_lstat: ::c_long = 5000 + 6; + pub const SYS_poll: ::c_long = 5000 + 7; + pub const SYS_lseek: ::c_long = 5000 + 8; + pub const SYS_mmap: ::c_long = 5000 + 9; +-pub const SYS_mprotect: ::c_long = 5000 + 10; +-pub const SYS_munmap: ::c_long = 5000 + 11; +-pub const SYS_brk: ::c_long = 5000 + 12; +-pub const SYS_rt_sigaction: ::c_long = 5000 + 13; +-pub const SYS_rt_sigprocmask: ::c_long = 5000 + 14; +-pub const SYS_ioctl: ::c_long = 5000 + 15; +-pub const SYS_pread64: ::c_long = 5000 + 16; +-pub const SYS_pwrite64: ::c_long = 5000 + 17; +-pub const SYS_readv: ::c_long = 5000 + 18; +-pub const SYS_writev: ::c_long = 5000 + 19; +-pub const SYS_access: ::c_long = 5000 + 20; +-pub const SYS_pipe: ::c_long = 5000 + 21; +-pub const SYS__newselect: ::c_long = 5000 + 22; +-pub const SYS_sched_yield: ::c_long = 5000 + 23; +-pub const SYS_mremap: ::c_long = 5000 + 24; +-pub const SYS_msync: ::c_long = 5000 + 25; +-pub const SYS_mincore: ::c_long = 5000 + 26; +-pub const SYS_madvise: ::c_long = 5000 + 27; +-pub const SYS_shmget: ::c_long = 5000 + 28; +-pub const SYS_shmat: ::c_long = 5000 + 29; +-pub const SYS_shmctl: ::c_long = 5000 + 30; +-pub const SYS_dup: ::c_long = 5000 + 31; +-pub const SYS_dup2: ::c_long = 5000 + 32; +-pub const SYS_pause: ::c_long = 5000 + 33; +-pub const SYS_nanosleep: ::c_long = 5000 + 34; +-pub const SYS_getitimer: ::c_long = 5000 + 35; +-pub const SYS_setitimer: ::c_long = 5000 + 36; +-pub const SYS_alarm: ::c_long = 5000 + 37; +-pub const SYS_getpid: ::c_long = 5000 + 38; +-pub const SYS_sendfile: ::c_long = 5000 + 39; +-pub const SYS_socket: ::c_long = 5000 + 40; +-pub const SYS_connect: ::c_long = 5000 + 41; +-pub const SYS_accept: ::c_long = 5000 + 42; +-pub const SYS_sendto: ::c_long = 5000 + 43; +-pub const SYS_recvfrom: ::c_long = 5000 + 44; +-pub const SYS_sendmsg: ::c_long = 5000 + 45; +-pub const SYS_recvmsg: ::c_long = 5000 + 46; +-pub const SYS_shutdown: ::c_long = 5000 + 47; +-pub const SYS_bind: ::c_long = 5000 + 48; +-pub const SYS_listen: ::c_long = 5000 + 49; +-pub const SYS_getsockname: ::c_long = 5000 + 50; +-pub const SYS_getpeername: ::c_long = 5000 + 51; +-pub const SYS_socketpair: ::c_long = 5000 + 52; +-pub const SYS_setsockopt: ::c_long = 5000 + 53; +-pub const SYS_getsockopt: ::c_long = 5000 + 54; +-pub const SYS_clone: ::c_long = 5000 + 55; +-pub const SYS_fork: ::c_long = 5000 + 56; +-pub const SYS_execve: ::c_long = 5000 + 57; +-pub const SYS_exit: ::c_long = 5000 + 58; +-pub const SYS_wait4: ::c_long = 5000 + 59; +-pub const SYS_kill: ::c_long = 5000 + 60; +-pub const SYS_uname: ::c_long = 5000 + 61; +-pub const SYS_semget: ::c_long = 5000 + 62; +-pub const SYS_semop: ::c_long = 5000 + 63; +-pub const SYS_semctl: ::c_long = 5000 + 64; +-pub const SYS_shmdt: ::c_long = 5000 + 65; +-pub const SYS_msgget: ::c_long = 5000 + 66; +-pub const SYS_msgsnd: ::c_long = 5000 + 67; +-pub const SYS_msgrcv: ::c_long = 5000 + 68; +-pub const SYS_msgctl: ::c_long = 5000 + 69; +-pub const SYS_fcntl: ::c_long = 5000 + 70; +-pub const SYS_flock: ::c_long = 5000 + 71; +-pub const SYS_fsync: ::c_long = 5000 + 72; +-pub const SYS_fdatasync: ::c_long = 5000 + 73; +-pub const SYS_truncate: ::c_long = 5000 + 74; +-pub const SYS_ftruncate: ::c_long = 5000 + 75; +-pub const SYS_getdents: ::c_long = 5000 + 76; +-pub const SYS_getcwd: ::c_long = 5000 + 77; +-pub const SYS_chdir: ::c_long = 5000 + 78; +-pub const SYS_fchdir: ::c_long = 5000 + 79; +-pub const SYS_rename: ::c_long = 5000 + 80; +-pub const SYS_mkdir: ::c_long = 5000 + 81; +-pub const SYS_rmdir: ::c_long = 5000 + 82; +-pub const SYS_creat: ::c_long = 5000 + 83; +-pub const SYS_link: ::c_long = 5000 + 84; +-pub const SYS_unlink: ::c_long = 5000 + 85; +-pub const SYS_symlink: ::c_long = 5000 + 86; +-pub const SYS_readlink: ::c_long = 5000 + 87; +-pub const SYS_chmod: ::c_long = 5000 + 88; +-pub const SYS_fchmod: ::c_long = 5000 + 89; +-pub const SYS_chown: ::c_long = 5000 + 90; +-pub const SYS_fchown: ::c_long = 5000 + 91; +-pub const SYS_lchown: ::c_long = 5000 + 92; +-pub const SYS_umask: ::c_long = 5000 + 93; +-pub const SYS_gettimeofday: ::c_long = 5000 + 94; +-pub const SYS_getrlimit: ::c_long = 5000 + 95; +-pub const SYS_getrusage: ::c_long = 5000 + 96; +-pub const SYS_sysinfo: ::c_long = 5000 + 97; +-pub const SYS_times: ::c_long = 5000 + 98; +-pub const SYS_ptrace: ::c_long = 5000 + 99; ++pub const SYS_mprotect: ::c_long = 5000 + 10; ++pub const SYS_munmap: ::c_long = 5000 + 11; ++pub const SYS_brk: ::c_long = 5000 + 12; ++pub const SYS_rt_sigaction: ::c_long = 5000 + 13; ++pub const SYS_rt_sigprocmask: ::c_long = 5000 + 14; ++pub const SYS_ioctl: ::c_long = 5000 + 15; ++pub const SYS_pread64: ::c_long = 5000 + 16; ++pub const SYS_pwrite64: ::c_long = 5000 + 17; ++pub const SYS_readv: ::c_long = 5000 + 18; ++pub const SYS_writev: ::c_long = 5000 + 19; ++pub const SYS_access: ::c_long = 5000 + 20; ++pub const SYS_pipe: ::c_long = 5000 + 21; ++pub const SYS__newselect: ::c_long = 5000 + 22; ++pub const SYS_sched_yield: ::c_long = 5000 + 23; ++pub const SYS_mremap: ::c_long = 5000 + 24; ++pub const SYS_msync: ::c_long = 5000 + 25; ++pub const SYS_mincore: ::c_long = 5000 + 26; ++pub const SYS_madvise: ::c_long = 5000 + 27; ++pub const SYS_shmget: ::c_long = 5000 + 28; ++pub const SYS_shmat: ::c_long = 5000 + 29; ++pub const SYS_shmctl: ::c_long = 5000 + 30; ++pub const SYS_dup: ::c_long = 5000 + 31; ++pub const SYS_dup2: ::c_long = 5000 + 32; ++pub const SYS_pause: ::c_long = 5000 + 33; ++pub const SYS_nanosleep: ::c_long = 5000 + 34; ++pub const SYS_getitimer: ::c_long = 5000 + 35; ++pub const SYS_setitimer: ::c_long = 5000 + 36; ++pub const SYS_alarm: ::c_long = 5000 + 37; ++pub const SYS_getpid: ::c_long = 5000 + 38; ++pub const SYS_sendfile: ::c_long = 5000 + 39; ++pub const SYS_socket: ::c_long = 5000 + 40; ++pub const SYS_connect: ::c_long = 5000 + 41; ++pub const SYS_accept: ::c_long = 5000 + 42; ++pub const SYS_sendto: ::c_long = 5000 + 43; ++pub const SYS_recvfrom: ::c_long = 5000 + 44; ++pub const SYS_sendmsg: ::c_long = 5000 + 45; ++pub const SYS_recvmsg: ::c_long = 5000 + 46; ++pub const SYS_shutdown: ::c_long = 5000 + 47; ++pub const SYS_bind: ::c_long = 5000 + 48; ++pub const SYS_listen: ::c_long = 5000 + 49; ++pub const SYS_getsockname: ::c_long = 5000 + 50; ++pub const SYS_getpeername: ::c_long = 5000 + 51; ++pub const SYS_socketpair: ::c_long = 5000 + 52; ++pub const SYS_setsockopt: ::c_long = 5000 + 53; ++pub const SYS_getsockopt: ::c_long = 5000 + 54; ++pub const SYS_clone: ::c_long = 5000 + 55; ++pub const SYS_fork: ::c_long = 5000 + 56; ++pub const SYS_execve: ::c_long = 5000 + 57; ++pub const SYS_exit: ::c_long = 5000 + 58; ++pub const SYS_wait4: ::c_long = 5000 + 59; ++pub const SYS_kill: ::c_long = 5000 + 60; ++pub const SYS_uname: ::c_long = 5000 + 61; ++pub const SYS_semget: ::c_long = 5000 + 62; ++pub const SYS_semop: ::c_long = 5000 + 63; ++pub const SYS_semctl: ::c_long = 5000 + 64; ++pub const SYS_shmdt: ::c_long = 5000 + 65; ++pub const SYS_msgget: ::c_long = 5000 + 66; ++pub const SYS_msgsnd: ::c_long = 5000 + 67; ++pub const SYS_msgrcv: ::c_long = 5000 + 68; ++pub const SYS_msgctl: ::c_long = 5000 + 69; ++pub const SYS_fcntl: ::c_long = 5000 + 70; ++pub const SYS_flock: ::c_long = 5000 + 71; ++pub const SYS_fsync: ::c_long = 5000 + 72; ++pub const SYS_fdatasync: ::c_long = 5000 + 73; ++pub const SYS_truncate: ::c_long = 5000 + 74; ++pub const SYS_ftruncate: ::c_long = 5000 + 75; ++pub const SYS_getdents: ::c_long = 5000 + 76; ++pub const SYS_getcwd: ::c_long = 5000 + 77; ++pub const SYS_chdir: ::c_long = 5000 + 78; ++pub const SYS_fchdir: ::c_long = 5000 + 79; ++pub const SYS_rename: ::c_long = 5000 + 80; ++pub const SYS_mkdir: ::c_long = 5000 + 81; ++pub const SYS_rmdir: ::c_long = 5000 + 82; ++pub const SYS_creat: ::c_long = 5000 + 83; ++pub const SYS_link: ::c_long = 5000 + 84; ++pub const SYS_unlink: ::c_long = 5000 + 85; ++pub const SYS_symlink: ::c_long = 5000 + 86; ++pub const SYS_readlink: ::c_long = 5000 + 87; ++pub const SYS_chmod: ::c_long = 5000 + 88; ++pub const SYS_fchmod: ::c_long = 5000 + 89; ++pub const SYS_chown: ::c_long = 5000 + 90; ++pub const SYS_fchown: ::c_long = 5000 + 91; ++pub const SYS_lchown: ::c_long = 5000 + 92; ++pub const SYS_umask: ::c_long = 5000 + 93; ++pub const SYS_gettimeofday: ::c_long = 5000 + 94; ++pub const SYS_getrlimit: ::c_long = 5000 + 95; ++pub const SYS_getrusage: ::c_long = 5000 + 96; ++pub const SYS_sysinfo: ::c_long = 5000 + 97; ++pub const SYS_times: ::c_long = 5000 + 98; ++pub const SYS_ptrace: ::c_long = 5000 + 99; + pub const SYS_getuid: ::c_long = 5000 + 100; + pub const SYS_syslog: ::c_long = 5000 + 101; + pub const SYS_getgid: ::c_long = 5000 + 102; +@@ -568,6 +576,7 @@ pub const SYS_pwritev2: ::c_long = 5000 + 322; + pub const SYS_pkey_mprotect: ::c_long = 5000 + 323; + pub const SYS_pkey_alloc: ::c_long = 5000 + 324; + pub const SYS_pkey_free: ::c_long = 5000 + 325; ++pub const SYS_statx: ::c_long = 5000 + 326; + + pub const SFD_CLOEXEC: ::c_int = 0x080000; + +@@ -848,6 +857,9 @@ 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 F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; + + pub const SFD_NONBLOCK: ::c_int = 0x80; + +@@ -862,6 +874,8 @@ 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 TIOCSBRK: ::c_ulong = 0x5427; ++pub const TIOCCBRK: ::c_ulong = 0x5428; + pub const TIOCGSOFTCAR: ::c_ulong = 0x5481; + pub const TIOCSSOFTCAR: ::c_ulong = 0x5482; + pub const TIOCINQ: ::c_ulong = 0x467f; +@@ -935,14 +949,14 @@ pub const NOFLSH: ::tcflag_t = 0x00000080; + pub const CIBAUD: ::tcflag_t = 0o02003600000; + pub const CBAUDEX: ::tcflag_t = 0o010000; + pub const VSWTC: usize = 7; +-pub const OLCUC: ::tcflag_t = 0o000002; +-pub const NLDLY: ::tcflag_t = 0o000400; +-pub const CRDLY: ::tcflag_t = 0o003000; ++pub const OLCUC: ::tcflag_t = 0o000002; ++pub const NLDLY: ::tcflag_t = 0o000400; ++pub const CRDLY: ::tcflag_t = 0o003000; + pub const TABDLY: ::tcflag_t = 0o014000; +-pub const BSDLY: ::tcflag_t = 0o020000; +-pub const FFDLY: ::tcflag_t = 0o100000; +-pub const VTDLY: ::tcflag_t = 0o040000; +-pub const XTABS: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const XTABS: ::tcflag_t = 0o014000; + + pub const B0: ::speed_t = 0o000000; + pub const B50: ::speed_t = 0o000001; +@@ -989,12 +1003,20 @@ pub const TIOCM_DSR: ::c_int = 0x400; + pub const EHWPOISON: ::c_int = 168; + + #[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; ++extern "C" { ++ 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; ++} ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } + } +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/mod.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/mod.rs +index c91da0d98d1caf01731e1448f82654d6ab7f630b..40ce8441a9663076ce65f78af947759020c4a6ac 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/mod.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/mod.rs +@@ -78,6 +78,9 @@ cfg_if! { + } else if #[cfg(any(target_arch = "x86_64"))] { + mod x86_64; + pub use self::x86_64::*; ++ } else if #[cfg(any(target_arch = "riscv64"))] { ++ mod riscv64; ++ pub use self::riscv64::*; + } else { + // Unknown target_arch + } +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..29d1e1c7b8a5558fcfa3b8ac333cee3fa9784163 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs +@@ -0,0 +1,7 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [i64; 4] ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/powerpc64.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs +similarity index 97% +rename from third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/powerpc64.rs +rename to third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs +index 432495983fb37e31f5d05149a1e0b9c4bf966dbe..9cf0b2170701b5ef790569d7d29202a631a07042 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/powerpc64.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs +@@ -45,6 +45,14 @@ s! { + pub l_pid: ::pid_t, + } + ++ pub struct flock64 { ++ pub l_type: ::c_short, ++ pub l_whence: ::c_short, ++ pub l_start: ::off64_t, ++ pub l_len: ::off64_t, ++ pub l_pid: ::pid_t, ++ } ++ + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, +@@ -385,10 +393,7 @@ pub const SIGURG: ::c_int = 23; + pub const SIGIO: ::c_int = 29; + pub const SIGSYS: ::c_int = 31; + pub const SIGSTKFLT: ::c_int = 16; +-#[deprecated( +- since = "0.2.55", +- note = "Use SIGSYS instead" +-)] ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] + pub const SIGUNUSED: ::c_int = 31; + pub const SIGPOLL: ::c_int = 29; + pub const SIGPWR: ::c_int = 30; +@@ -411,6 +416,9 @@ pub const F_GETOWN: ::c_int = 9; + pub const F_SETOWN: ::c_int = 8; + pub const F_SETLK: ::c_int = 6; + pub const F_SETLKW: ::c_int = 7; ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; + + pub const F_RDLCK: ::c_int = 0; + pub const F_WRLCK: ::c_int = 1; +@@ -433,6 +441,8 @@ pub const TIOCMBIS: ::c_ulong = 0x5416; + pub const TIOCMBIC: ::c_ulong = 0x5417; + pub const TIOCMSET: ::c_ulong = 0x5418; + pub const TIOCCONS: ::c_ulong = 0x541D; ++pub const TIOCSBRK: ::c_ulong = 0x5427; ++pub const TIOCCBRK: ::c_ulong = 0x5428; + pub const TIOCGRS485: ::c_int = 0x542E; + pub const TIOCSRS485: ::c_int = 0x542F; + +@@ -536,6 +546,7 @@ pub const O_DIRECT: ::c_int = 0x20000; + + pub const MAP_LOCKED: ::c_int = 0x00080; + pub const MAP_NORESERVE: ::c_int = 0x00040; ++pub const MAP_SYNC : ::c_int = 0x080000; + + pub const EDEADLOCK: ::c_int = 58; + pub const EUCLEAN: ::c_int = 117; +@@ -594,14 +605,14 @@ pub const ICANON: ::tcflag_t = 0x100; + pub const PENDIN: ::tcflag_t = 0x20000000; + pub const NOFLSH: ::tcflag_t = 0x80000000; + pub const VSWTC: usize = 9; +-pub const OLCUC: ::tcflag_t = 0o000004; +-pub const NLDLY: ::tcflag_t = 0o001400; +-pub const CRDLY: ::tcflag_t = 0o030000; ++pub const OLCUC: ::tcflag_t = 0o000004; ++pub const NLDLY: ::tcflag_t = 0o001400; ++pub const CRDLY: ::tcflag_t = 0o030000; + pub const TABDLY: ::tcflag_t = 0o006000; +-pub const BSDLY: ::tcflag_t = 0o100000; +-pub const FFDLY: ::tcflag_t = 0o040000; +-pub const VTDLY: ::tcflag_t = 0o200000; +-pub const XTABS: ::tcflag_t = 0o006000; ++pub const BSDLY: ::tcflag_t = 0o100000; ++pub const FFDLY: ::tcflag_t = 0o040000; ++pub const VTDLY: ::tcflag_t = 0o200000; ++pub const XTABS: ::tcflag_t = 0o006000; + + pub const B0: ::speed_t = 0o000000; + pub const B50: ::speed_t = 0o000001; +@@ -1028,12 +1039,20 @@ pub const SYS_kexec_file_load: ::c_long = 382; + pub const SYS_statx: ::c_long = 383; + + #[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; ++extern "C" { ++ 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; ++} ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } + } +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..9fa0f0a963d765ceea7867f3fb1ceb938d9b6836 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs +@@ -0,0 +1,859 @@ ++//! RISC-V-specific definitions for 64-bit linux-like values ++ ++pub type c_char = u8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type wchar_t = ::c_int; ++ ++pub type nlink_t = ::c_uint; ++pub type blksize_t = ::c_int; ++pub type fsblkcnt64_t = ::c_ulong; ++pub type fsfilcnt64_t = ::c_ulong; ++pub type suseconds_t = i64; ++pub type __u64 = ::c_ulonglong; ++ ++s! { ++ pub struct pthread_attr_t { ++ __size: [::c_ulong; 7], ++ } ++ ++ 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_rdev: ::dev_t, ++ pub __pad1: ::dev_t, ++ pub st_size: ::off_t, ++ pub st_blksize: ::blksize_t, ++ pub __pad2: ::c_int, ++ pub st_blocks: ::blkcnt_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, ++ __unused: [::c_int; 2usize], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: ::dev_t, ++ 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: ::dev_t, ++ pub __pad1: ::dev_t, ++ pub st_size: ::off64_t, ++ pub st_blksize: ::blksize_t, ++ pub __pad2: ::c_int, ++ pub st_blocks: ::blkcnt_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, ++ __unused: [::c_int; 2], ++ } ++ ++ pub struct statfs { ++ pub f_type: ::c_long, ++ pub f_bsize: ::c_long, ++ 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_fsid: ::fsid_t, ++ pub f_namelen: ::c_long, ++ pub f_frsize: ::c_long, ++ pub f_flags: ::c_long, ++ pub f_spare: [::c_long; 4], ++ } ++ ++ pub struct statfs64 { ++ pub f_type: ::c_long, ++ pub f_bsize: ::c_long, ++ pub f_blocks: ::fsblkcnt64_t, ++ pub f_bfree: ::fsblkcnt64_t, ++ pub f_bavail: ::fsblkcnt64_t, ++ pub f_files: ::fsfilcnt64_t, ++ pub f_ffree: ::fsfilcnt64_t, ++ pub f_fsid: ::fsid_t, ++ pub f_namelen: ::c_long, ++ pub f_frsize: ::c_long, ++ pub f_flags: ::c_long, ++ pub f_spare: [::c_long; 4], ++ } ++ ++ 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 __f_spare: [::c_int; 6], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: ::c_ulong, ++ pub f_frsize: ::c_ulong, ++ pub f_blocks: ::fsblkcnt64_t, ++ pub f_bfree: ::fsblkcnt64_t, ++ pub f_bavail: ::fsblkcnt64_t, ++ pub f_files: ::fsfilcnt64_t, ++ pub f_ffree: ::fsfilcnt64_t, ++ pub f_favail: ::fsfilcnt64_t, ++ pub f_fsid: ::c_ulong, ++ pub f_flag: ::c_ulong, ++ pub f_namemax: ::c_ulong, ++ pub __f_spare: [::c_int; 6], ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: ::c_int, ++ pub si_errno: ::c_int, ++ pub si_code: ::c_int, ++ #[doc(hidden)] ++ #[deprecated( ++ since="0.2.54", ++ note="Please leave a comment on \ ++ https://github.com/rust-lang/libc/pull/1316 if you're using \ ++ this field" ++ )] ++ pub _pad: [::c_int; 29], ++ _align: [u64; 0], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut ::c_void, ++ pub ss_flags: ::c_int, ++ pub ss_size: ::size_t, ++ } ++ ++ pub struct sigaction { ++ pub sa_sigaction: ::sighandler_t, ++ pub sa_mask: ::sigset_t, ++ pub sa_flags: ::c_int, ++ pub sa_restorer: ::Option, ++ } ++ ++ 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, ++ __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, ++ 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, ++ __unused5: ::c_ulong, ++ __unused6: ::c_ulong, ++ } ++ ++ 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_pid: ::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: ::c_short, ++ pub l_whence: ::c_short, ++ pub l_start: ::off64_t, ++ pub l_len: ::off64_t, ++ pub l_pid: ::pid_t, ++ } ++} ++ ++pub const POSIX_FADV_DONTNEED: ::c_int = 4; ++pub const POSIX_FADV_NOREUSE: ::c_int = 5; ++pub const VEOF: usize = 4; ++pub const RTLD_DEEPBIND: ::c_int = 0x8; ++pub const RTLD_GLOBAL: ::c_int = 0x100; ++pub const RTLD_NOLOAD: ::c_int = 0x4; ++pub const TIOCGSOFTCAR: ::c_ulong = 21529; ++pub const TIOCSSOFTCAR: ::c_ulong = 21530; ++pub const TIOCGRS485: ::c_int = 21550; ++pub const TIOCSRS485: ::c_int = 21551; ++pub const RLIMIT_RSS: ::__rlimit_resource_t = 5; ++pub const RLIMIT_AS: ::__rlimit_resource_t = 9; ++pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8; ++pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7; ++pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6; ++pub const O_APPEND: ::c_int = 1024; ++pub const O_CREAT: ::c_int = 64; ++pub const O_EXCL: ::c_int = 128; ++pub const O_NOCTTY: ::c_int = 256; ++pub const O_NONBLOCK: ::c_int = 2048; ++pub const O_SYNC: ::c_int = 1052672; ++pub const O_RSYNC: ::c_int = 1052672; ++pub const O_DSYNC: ::c_int = 4096; ++pub const O_FSYNC: ::c_int = 1052672; ++pub const O_NOATIME: ::c_int = 262144; ++pub const O_PATH: ::c_int = 2097152; ++pub const O_TMPFILE: ::c_int = 4259840; ++pub const MAP_GROWSDOWN: ::c_int = 256; ++pub const EDEADLK: ::c_int = 35; ++pub const ENAMETOOLONG: ::c_int = 36; ++pub const ENOLCK: ::c_int = 37; ++pub const ENOSYS: ::c_int = 38; ++pub const ENOTEMPTY: ::c_int = 39; ++pub const ELOOP: ::c_int = 40; ++pub const ENOMSG: ::c_int = 42; ++pub const EIDRM: ::c_int = 43; ++pub const ECHRNG: ::c_int = 44; ++pub const EL2NSYNC: ::c_int = 45; ++pub const EL3HLT: ::c_int = 46; ++pub const EL3RST: ::c_int = 47; ++pub const ELNRNG: ::c_int = 48; ++pub const EUNATCH: ::c_int = 49; ++pub const ENOCSI: ::c_int = 50; ++pub const EL2HLT: ::c_int = 51; ++pub const EBADE: ::c_int = 52; ++pub const EBADR: ::c_int = 53; ++pub const EXFULL: ::c_int = 54; ++pub const ENOANO: ::c_int = 55; ++pub const EBADRQC: ::c_int = 56; ++pub const EBADSLT: ::c_int = 57; ++pub const EMULTIHOP: ::c_int = 72; ++pub const EOVERFLOW: ::c_int = 75; ++pub const ENOTUNIQ: ::c_int = 76; ++pub const EBADFD: ::c_int = 77; ++pub const EBADMSG: ::c_int = 74; ++pub const EREMCHG: ::c_int = 78; ++pub const ELIBACC: ::c_int = 79; ++pub const ELIBBAD: ::c_int = 80; ++pub const ELIBSCN: ::c_int = 81; ++pub const ELIBMAX: ::c_int = 82; ++pub const ELIBEXEC: ::c_int = 83; ++pub const EILSEQ: ::c_int = 84; ++pub const ERESTART: ::c_int = 85; ++pub const ESTRPIPE: ::c_int = 86; ++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 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; ++pub const ECONNRESET: ::c_int = 104; ++pub const ENOBUFS: ::c_int = 105; ++pub const EISCONN: ::c_int = 106; ++pub const ENOTCONN: ::c_int = 107; ++pub const ESHUTDOWN: ::c_int = 108; ++pub const ETOOMANYREFS: ::c_int = 109; ++pub const ETIMEDOUT: ::c_int = 110; ++pub const ECONNREFUSED: ::c_int = 111; ++pub const EHOSTDOWN: ::c_int = 112; ++pub const EHOSTUNREACH: ::c_int = 113; ++pub const EALREADY: ::c_int = 114; ++pub const EINPROGRESS: ::c_int = 115; ++pub const ESTALE: ::c_int = 116; ++pub const EDQUOT: ::c_int = 122; ++pub const ENOMEDIUM: ::c_int = 123; ++pub const EMEDIUMTYPE: ::c_int = 124; ++pub const ECANCELED: ::c_int = 125; ++pub const ENOKEY: ::c_int = 126; ++pub const EKEYEXPIRED: ::c_int = 127; ++pub const EKEYREVOKED: ::c_int = 128; ++pub const EKEYREJECTED: ::c_int = 129; ++pub const EOWNERDEAD: ::c_int = 130; ++pub const ENOTRECOVERABLE: ::c_int = 131; ++pub const EHWPOISON: ::c_int = 133; ++pub const ERFKILL: ::c_int = 132; ++pub const SOL_SOCKET: ::c_int = 1; ++pub const SO_REUSEADDR: ::c_int = 2; ++pub const SO_TYPE: ::c_int = 3; ++pub const SO_ERROR: ::c_int = 4; ++pub const SO_DONTROUTE: ::c_int = 5; ++pub const SO_BROADCAST: ::c_int = 6; ++pub const SO_SNDBUF: ::c_int = 7; ++pub const SO_RCVBUF: ::c_int = 8; ++pub const SO_SNDBUFFORCE: ::c_int = 32; ++pub const SO_RCVBUFFORCE: ::c_int = 33; ++pub const SO_KEEPALIVE: ::c_int = 9; ++pub const SO_OOBINLINE: ::c_int = 10; ++pub const SO_NO_CHECK: ::c_int = 11; ++pub const SO_PRIORITY: ::c_int = 12; ++pub const SO_LINGER: ::c_int = 13; ++pub const SO_BSDCOMPAT: ::c_int = 14; ++pub const SO_REUSEPORT: ::c_int = 15; ++pub const SO_PASSCRED: ::c_int = 16; ++pub const SO_PEERCRED: ::c_int = 17; ++pub const SO_RCVLOWAT: ::c_int = 18; ++pub const SO_SNDLOWAT: ::c_int = 19; ++pub const SO_RCVTIMEO: ::c_int = 20; ++pub const SO_SNDTIMEO: ::c_int = 21; ++pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22; ++pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23; ++pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24; ++pub const SO_BINDTODEVICE: ::c_int = 25; ++pub const SO_ATTACH_FILTER: ::c_int = 26; ++pub const SO_DETACH_FILTER: ::c_int = 27; ++pub const SO_GET_FILTER: ::c_int = 26; ++pub const SO_PEERNAME: ::c_int = 28; ++pub const SO_TIMESTAMP: ::c_int = 29; ++pub const SO_ACCEPTCONN: ::c_int = 30; ++pub const SO_PEERSEC: ::c_int = 31; ++pub const SO_PASSSEC: ::c_int = 34; ++pub const SO_TIMESTAMPNS: ::c_int = 35; ++pub const SCM_TIMESTAMPNS: ::c_int = 35; ++pub const SO_MARK: ::c_int = 36; ++pub const SO_PROTOCOL: ::c_int = 38; ++pub const SO_DOMAIN: ::c_int = 39; ++pub const SO_RXQ_OVFL: ::c_int = 40; ++pub const SO_WIFI_STATUS: ::c_int = 41; ++pub const SCM_WIFI_STATUS: ::c_int = 41; ++pub const SO_PEEK_OFF: ::c_int = 42; ++pub const SO_NOFCS: ::c_int = 43; ++pub const SO_LOCK_FILTER: ::c_int = 44; ++pub const SO_SELECT_ERR_QUEUE: ::c_int = 45; ++pub const SO_BUSY_POLL: ::c_int = 46; ++pub const SO_MAX_PACING_RATE: ::c_int = 47; ++pub const SO_BPF_EXTENSIONS: ::c_int = 48; ++pub const SO_INCOMING_CPU: ::c_int = 49; ++pub const SO_ATTACH_BPF: ::c_int = 50; ++pub const SO_DETACH_BPF: ::c_int = 27; ++pub const SOCK_STREAM: ::c_int = 1; ++pub const SOCK_DGRAM: ::c_int = 2; ++pub const SA_ONSTACK: ::c_int = 134217728; ++pub const SA_SIGINFO: ::c_int = 4; ++pub const SA_NOCLDWAIT: ::c_int = 2; ++pub const SIGTTIN: ::c_int = 21; ++pub const SIGTTOU: ::c_int = 22; ++pub const SIGXCPU: ::c_int = 24; ++pub const SIGXFSZ: ::c_int = 25; ++pub const SIGVTALRM: ::c_int = 26; ++pub const SIGPROF: ::c_int = 27; ++pub const SIGWINCH: ::c_int = 28; ++pub const SIGCHLD: ::c_int = 17; ++pub const SIGBUS: ::c_int = 7; ++pub const SIGUSR1: ::c_int = 10; ++pub const SIGUSR2: ::c_int = 12; ++pub const SIGCONT: ::c_int = 18; ++pub const SIGSTOP: ::c_int = 19; ++pub const SIGTSTP: ::c_int = 20; ++pub const SIGURG: ::c_int = 23; ++pub const SIGIO: ::c_int = 29; ++pub const SIGSYS: ::c_int = 31; ++pub const SIGSTKFLT: ::c_int = 16; ++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 = 0; ++pub const SIG_UNBLOCK: ::c_int = 1; ++pub const POLLWRNORM: ::c_short = 256; ++pub const POLLWRBAND: ::c_short = 512; ++pub const O_ASYNC: ::c_int = 8192; ++pub const O_NDELAY: ::c_int = 2048; ++pub const PTRACE_DETACH: ::c_uint = 17; ++pub const EFD_NONBLOCK: ::c_int = 2048; ++pub const F_GETLK: ::c_int = 5; ++pub const F_GETOWN: ::c_int = 9; ++pub const F_SETOWN: ::c_int = 8; ++pub const F_SETLK: ::c_int = 6; ++pub const F_SETLKW: ::c_int = 7; ++pub const F_RDLCK: ::c_int = 0; ++pub const F_WRLCK: ::c_int = 1; ++pub const F_UNLCK: ::c_int = 2; ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; ++pub const SFD_NONBLOCK: ::c_int = 2048; ++pub const TCSANOW: ::c_int = 0; ++pub const TCSADRAIN: ::c_int = 1; ++pub const TCSAFLUSH: ::c_int = 2; ++pub const TIOCLINUX: ::c_ulong = 21532; ++pub const TIOCGSERIAL: ::c_ulong = 21534; ++pub const TIOCEXCL: ::c_ulong = 21516; ++pub const TIOCNXCL: ::c_ulong = 21517; ++pub const TIOCSCTTY: ::c_ulong = 21518; ++pub const TIOCSTI: ::c_ulong = 21522; ++pub const TIOCMGET: ::c_ulong = 21525; ++pub const TIOCMBIS: ::c_ulong = 21526; ++pub const TIOCMBIC: ::c_ulong = 21527; ++pub const TIOCMSET: ::c_ulong = 21528; ++pub const TIOCCONS: ::c_ulong = 21533; ++pub const TIOCM_ST: ::c_int = 8; ++pub const TIOCM_SR: ::c_int = 16; ++pub const TIOCM_CTS: ::c_int = 32; ++pub const TIOCM_CAR: ::c_int = 64; ++pub const TIOCM_RNG: ::c_int = 128; ++pub const TIOCM_DSR: ::c_int = 256; ++pub const SFD_CLOEXEC: ::c_int = 524288; ++pub const NCCS: usize = 32; ++pub const O_TRUNC: ::c_int = 512; ++pub const O_CLOEXEC: ::c_int = 524288; ++pub const EBFONT: ::c_int = 59; ++pub const ENOSTR: ::c_int = 60; ++pub const ENODATA: ::c_int = 61; ++pub const ETIME: ::c_int = 62; ++pub const ENOSR: ::c_int = 63; ++pub const ENONET: ::c_int = 64; ++pub const ENOPKG: ::c_int = 65; ++pub const EREMOTE: ::c_int = 66; ++pub const ENOLINK: ::c_int = 67; ++pub const EADV: ::c_int = 68; ++pub const ESRMNT: ::c_int = 69; ++pub const ECOMM: ::c_int = 70; ++pub const EPROTO: ::c_int = 71; ++pub const EDOTDOT: ::c_int = 73; ++pub const SA_NODEFER: ::c_int = 1073741824; ++pub const SA_RESETHAND: ::c_int = -2147483648; ++pub const SA_RESTART: ::c_int = 268435456; ++pub const SA_NOCLDSTOP: ::c_int = 1; ++pub const EPOLL_CLOEXEC: ::c_int = 524288; ++pub const EFD_CLOEXEC: ::c_int = 524288; ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const O_DIRECT: ::c_int = 16384; ++pub const O_DIRECTORY: ::c_int = 65536; ++pub const O_NOFOLLOW: ::c_int = 131072; ++pub const MAP_HUGETLB: ::c_int = 262144; ++pub const MAP_LOCKED: ::c_int = 8192; ++pub const MAP_NORESERVE: ::c_int = 16384; ++pub const MAP_ANON: ::c_int = 32; ++pub const MAP_ANONYMOUS: ::c_int = 32; ++pub const MAP_DENYWRITE: ::c_int = 2048; ++pub const MAP_EXECUTABLE: ::c_int = 4096; ++pub const MAP_POPULATE: ::c_int = 32768; ++pub const MAP_NONBLOCK: ::c_int = 65536; ++pub const MAP_STACK: ::c_int = 131072; ++pub const MAP_SYNC : ::c_int = 0x080000; ++pub const EDEADLOCK: ::c_int = 35; ++pub const EUCLEAN: ::c_int = 117; ++pub const ENOTNAM: ::c_int = 118; ++pub const ENAVAIL: ::c_int = 119; ++pub const EISNAM: ::c_int = 120; ++pub const EREMOTEIO: ::c_int = 121; ++pub const FIOCLEX: ::c_ulong = 21585; ++pub const FIONCLEX: ::c_ulong = 21584; ++pub const FIONBIO: ::c_ulong = 21537; ++pub const MCL_CURRENT: ::c_int = 1; ++pub const MCL_FUTURE: ::c_int = 2; ++pub const SIGSTKSZ: ::size_t = 8192; ++pub const MINSIGSTKSZ: ::size_t = 2048; ++pub const CBAUD: ::tcflag_t = 4111; ++pub const TAB1: ::tcflag_t = 2048; ++pub const TAB2: ::tcflag_t = 4096; ++pub const TAB3: ::tcflag_t = 6144; ++pub const CR1: ::tcflag_t = 512; ++pub const CR2: ::tcflag_t = 1024; ++pub const CR3: ::tcflag_t = 1536; ++pub const FF1: ::tcflag_t = 32768; ++pub const BS1: ::tcflag_t = 8192; ++pub const VT1: ::tcflag_t = 16384; ++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 = 1024; ++pub const IXOFF: ::tcflag_t = 4096; ++pub const ONLCR: ::tcflag_t = 4; ++pub const CSIZE: ::tcflag_t = 48; ++pub const CS6: ::tcflag_t = 16; ++pub const CS7: ::tcflag_t = 32; ++pub const CS8: ::tcflag_t = 48; ++pub const CSTOPB: ::tcflag_t = 64; ++pub const CREAD: ::tcflag_t = 128; ++pub const PARENB: ::tcflag_t = 256; ++pub const PARODD: ::tcflag_t = 512; ++pub const HUPCL: ::tcflag_t = 1024; ++pub const CLOCAL: ::tcflag_t = 2048; ++pub const ECHOKE: ::tcflag_t = 2048; ++pub const ECHOE: ::tcflag_t = 16; ++pub const ECHOK: ::tcflag_t = 32; ++pub const ECHONL: ::tcflag_t = 64; ++pub const ECHOPRT: ::tcflag_t = 1024; ++pub const ECHOCTL: ::tcflag_t = 512; ++pub const ISIG: ::tcflag_t = 1; ++pub const ICANON: ::tcflag_t = 2; ++pub const PENDIN: ::tcflag_t = 16384; ++pub const NOFLSH: ::tcflag_t = 128; ++pub const CIBAUD: ::tcflag_t = 269418496; ++pub const CBAUDEX: ::tcflag_t = 4096; ++pub const VSWTC: usize = 7; ++pub const OLCUC: ::tcflag_t = 2; ++pub const NLDLY: ::tcflag_t = 256; ++pub const CRDLY: ::tcflag_t = 1536; ++pub const TABDLY: ::tcflag_t = 6144; ++pub const BSDLY: ::tcflag_t = 8192; ++pub const FFDLY: ::tcflag_t = 32768; ++pub const VTDLY: ::tcflag_t = 16384; ++pub const XTABS: ::tcflag_t = 6144; ++pub const B0: ::speed_t = 0; ++pub const B50: ::speed_t = 1; ++pub const B75: ::speed_t = 2; ++pub const B110: ::speed_t = 3; ++pub const B134: ::speed_t = 4; ++pub const B150: ::speed_t = 5; ++pub const B200: ::speed_t = 6; ++pub const B300: ::speed_t = 7; ++pub const B600: ::speed_t = 8; ++pub const B1200: ::speed_t = 9; ++pub const B1800: ::speed_t = 10; ++pub const B2400: ::speed_t = 11; ++pub const B4800: ::speed_t = 12; ++pub const B9600: ::speed_t = 13; ++pub const B19200: ::speed_t = 14; ++pub const B38400: ::speed_t = 15; ++pub const EXTA: ::speed_t = 14; ++pub const EXTB: ::speed_t = 15; ++pub const B57600: ::speed_t = 4097; ++pub const B115200: ::speed_t = 4098; ++pub const B230400: ::speed_t = 4099; ++pub const B460800: ::speed_t = 4100; ++pub const B500000: ::speed_t = 4101; ++pub const B576000: ::speed_t = 4102; ++pub const B921600: ::speed_t = 4103; ++pub const B1000000: ::speed_t = 4104; ++pub const B1152000: ::speed_t = 4105; ++pub const B1500000: ::speed_t = 4106; ++pub const B2000000: ::speed_t = 4107; ++pub const B2500000: ::speed_t = 4108; ++pub const B3000000: ::speed_t = 4109; ++pub const B3500000: ::speed_t = 4110; ++pub const B4000000: ::speed_t = 4111; ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: ::tcflag_t = 32768; ++pub const TOSTOP: ::tcflag_t = 256; ++pub const FLUSHO: ::tcflag_t = 4096; ++pub const EXTPROC: ::tcflag_t = 65536; ++pub const TCGETS: ::c_ulong = 21505; ++pub const TCSETS: ::c_ulong = 21506; ++pub const TCSETSW: ::c_ulong = 21507; ++pub const TCSETSF: ::c_ulong = 21508; ++pub const TCGETA: ::c_ulong = 21509; ++pub const TCSETA: ::c_ulong = 21510; ++pub const TCSETAW: ::c_ulong = 21511; ++pub const TCSETAF: ::c_ulong = 21512; ++pub const TCSBRK: ::c_ulong = 21513; ++pub const TCXONC: ::c_ulong = 21514; ++pub const TCFLSH: ::c_ulong = 21515; ++pub const TIOCINQ: ::c_ulong = 21531; ++pub const TIOCGPGRP: ::c_ulong = 21519; ++pub const TIOCSPGRP: ::c_ulong = 21520; ++pub const TIOCOUTQ: ::c_ulong = 21521; ++pub const TIOCGWINSZ: ::c_ulong = 21523; ++pub const TIOCSWINSZ: ::c_ulong = 21524; ++pub const FIONREAD: ::c_ulong = 21531; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; ++pub const SYS_read: ::c_long = 63; ++pub const SYS_write: ::c_long = 64; ++pub const SYS_close: ::c_long = 57; ++pub const SYS_fstat: ::c_long = 80; ++pub const SYS_lseek: ::c_long = 62; ++pub const SYS_mmap: ::c_long = 222; ++pub const SYS_mprotect: ::c_long = 226; ++pub const SYS_munmap: ::c_long = 215; ++pub const SYS_brk: ::c_long = 214; ++pub const SYS_rt_sigaction: ::c_long = 134; ++pub const SYS_rt_sigprocmask: ::c_long = 135; ++pub const SYS_rt_sigreturn: ::c_long = 139; ++pub const SYS_ioctl: ::c_long = 29; ++pub const SYS_pread64: ::c_long = 67; ++pub const SYS_pwrite64: ::c_long = 68; ++pub const SYS_readv: ::c_long = 65; ++pub const SYS_writev: ::c_long = 66; ++pub const SYS_sched_yield: ::c_long = 124; ++pub const SYS_mremap: ::c_long = 216; ++pub const SYS_msync: ::c_long = 227; ++pub const SYS_mincore: ::c_long = 232; ++pub const SYS_madvise: ::c_long = 233; ++pub const SYS_shmget: ::c_long = 194; ++pub const SYS_shmat: ::c_long = 196; ++pub const SYS_shmctl: ::c_long = 195; ++pub const SYS_dup: ::c_long = 23; ++pub const SYS_nanosleep: ::c_long = 101; ++pub const SYS_getitimer: ::c_long = 102; ++pub const SYS_setitimer: ::c_long = 103; ++pub const SYS_getpid: ::c_long = 172; ++pub const SYS_sendfile: ::c_long = 71; ++pub const SYS_socket: ::c_long = 198; ++pub const SYS_connect: ::c_long = 203; ++pub const SYS_accept: ::c_long = 202; ++pub const SYS_sendto: ::c_long = 206; ++pub const SYS_recvfrom: ::c_long = 207; ++pub const SYS_sendmsg: ::c_long = 211; ++pub const SYS_recvmsg: ::c_long = 212; ++pub const SYS_shutdown: ::c_long = 210; ++pub const SYS_bind: ::c_long = 200; ++pub const SYS_listen: ::c_long = 201; ++pub const SYS_getsockname: ::c_long = 204; ++pub const SYS_getpeername: ::c_long = 205; ++pub const SYS_socketpair: ::c_long = 199; ++pub const SYS_setsockopt: ::c_long = 208; ++pub const SYS_getsockopt: ::c_long = 209; ++pub const SYS_clone: ::c_long = 220; ++pub const SYS_execve: ::c_long = 221; ++pub const SYS_exit: ::c_long = 93; ++pub const SYS_wait4: ::c_long = 260; ++pub const SYS_kill: ::c_long = 129; ++pub const SYS_uname: ::c_long = 160; ++pub const SYS_semget: ::c_long = 190; ++pub const SYS_semop: ::c_long = 193; ++pub const SYS_semctl: ::c_long = 191; ++pub const SYS_shmdt: ::c_long = 197; ++pub const SYS_msgget: ::c_long = 186; ++pub const SYS_msgsnd: ::c_long = 189; ++pub const SYS_msgrcv: ::c_long = 188; ++pub const SYS_msgctl: ::c_long = 187; ++pub const SYS_fcntl: ::c_long = 25; ++pub const SYS_flock: ::c_long = 32; ++pub const SYS_fsync: ::c_long = 82; ++pub const SYS_fdatasync: ::c_long = 83; ++pub const SYS_truncate: ::c_long = 45; ++pub const SYS_ftruncate: ::c_long = 46; ++pub const SYS_getcwd: ::c_long = 17; ++pub const SYS_chdir: ::c_long = 49; ++pub const SYS_fchdir: ::c_long = 50; ++pub const SYS_fchmod: ::c_long = 52; ++pub const SYS_fchown: ::c_long = 55; ++pub const SYS_umask: ::c_long = 166; ++pub const SYS_gettimeofday: ::c_long = 169; ++pub const SYS_getrlimit: ::c_long = 163; ++pub const SYS_getrusage: ::c_long = 165; ++pub const SYS_sysinfo: ::c_long = 179; ++pub const SYS_times: ::c_long = 153; ++pub const SYS_ptrace: ::c_long = 117; ++pub const SYS_getuid: ::c_long = 174; ++pub const SYS_syslog: ::c_long = 116; ++pub const SYS_getgid: ::c_long = 176; ++pub const SYS_setuid: ::c_long = 146; ++pub const SYS_setgid: ::c_long = 144; ++pub const SYS_geteuid: ::c_long = 175; ++pub const SYS_getegid: ::c_long = 177; ++pub const SYS_setpgid: ::c_long = 154; ++pub const SYS_getppid: ::c_long = 173; ++pub const SYS_setsid: ::c_long = 157; ++pub const SYS_setreuid: ::c_long = 145; ++pub const SYS_setregid: ::c_long = 143; ++pub const SYS_getgroups: ::c_long = 158; ++pub const SYS_setgroups: ::c_long = 159; ++pub const SYS_setresuid: ::c_long = 147; ++pub const SYS_getresuid: ::c_long = 148; ++pub const SYS_setresgid: ::c_long = 149; ++pub const SYS_getresgid: ::c_long = 150; ++pub const SYS_getpgid: ::c_long = 155; ++pub const SYS_setfsuid: ::c_long = 151; ++pub const SYS_setfsgid: ::c_long = 152; ++pub const SYS_getsid: ::c_long = 156; ++pub const SYS_capget: ::c_long = 90; ++pub const SYS_capset: ::c_long = 91; ++pub const SYS_rt_sigpending: ::c_long = 136; ++pub const SYS_rt_sigtimedwait: ::c_long = 137; ++pub const SYS_rt_sigqueueinfo: ::c_long = 138; ++pub const SYS_rt_sigsuspend: ::c_long = 133; ++pub const SYS_sigaltstack: ::c_long = 132; ++pub const SYS_personality: ::c_long = 92; ++pub const SYS_statfs: ::c_long = 43; ++pub const SYS_fstatfs: ::c_long = 44; ++pub const SYS_getpriority: ::c_long = 141; ++pub const SYS_setpriority: ::c_long = 140; ++pub const SYS_sched_setparam: ::c_long = 118; ++pub const SYS_sched_getparam: ::c_long = 121; ++pub const SYS_sched_setscheduler: ::c_long = 119; ++pub const SYS_sched_getscheduler: ::c_long = 120; ++pub const SYS_sched_get_priority_max: ::c_long = 125; ++pub const SYS_sched_get_priority_min: ::c_long = 126; ++pub const SYS_sched_rr_get_interval: ::c_long = 127; ++pub const SYS_mlock: ::c_long = 228; ++pub const SYS_munlock: ::c_long = 229; ++pub const SYS_mlockall: ::c_long = 230; ++pub const SYS_munlockall: ::c_long = 231; ++pub const SYS_vhangup: ::c_long = 58; ++pub const SYS_pivot_root: ::c_long = 41; ++pub const SYS_prctl: ::c_long = 167; ++pub const SYS_adjtimex: ::c_long = 171; ++pub const SYS_setrlimit: ::c_long = 164; ++pub const SYS_chroot: ::c_long = 51; ++pub const SYS_sync: ::c_long = 81; ++pub const SYS_acct: ::c_long = 89; ++pub const SYS_settimeofday: ::c_long = 170; ++pub const SYS_mount: ::c_long = 40; ++pub const SYS_umount2: ::c_long = 39; ++pub const SYS_swapon: ::c_long = 224; ++pub const SYS_swapoff: ::c_long = 225; ++pub const SYS_reboot: ::c_long = 142; ++pub const SYS_sethostname: ::c_long = 161; ++pub const SYS_setdomainname: ::c_long = 162; ++pub const SYS_init_module: ::c_long = 105; ++pub const SYS_delete_module: ::c_long = 106; ++pub const SYS_quotactl: ::c_long = 60; ++pub const SYS_nfsservctl: ::c_long = 42; ++pub const SYS_gettid: ::c_long = 178; ++pub const SYS_readahead: ::c_long = 213; ++pub const SYS_setxattr: ::c_long = 5; ++pub const SYS_lsetxattr: ::c_long = 6; ++pub const SYS_fsetxattr: ::c_long = 7; ++pub const SYS_getxattr: ::c_long = 8; ++pub const SYS_lgetxattr: ::c_long = 9; ++pub const SYS_fgetxattr: ::c_long = 10; ++pub const SYS_listxattr: ::c_long = 11; ++pub const SYS_llistxattr: ::c_long = 12; ++pub const SYS_flistxattr: ::c_long = 13; ++pub const SYS_removexattr: ::c_long = 14; ++pub const SYS_lremovexattr: ::c_long = 15; ++pub const SYS_fremovexattr: ::c_long = 16; ++pub const SYS_tkill: ::c_long = 130; ++pub const SYS_futex: ::c_long = 98; ++pub const SYS_sched_setaffinity: ::c_long = 122; ++pub const SYS_sched_getaffinity: ::c_long = 123; ++pub const SYS_io_setup: ::c_long = 0; ++pub const SYS_io_destroy: ::c_long = 1; ++pub const SYS_io_getevents: ::c_long = 4; ++pub const SYS_io_submit: ::c_long = 2; ++pub const SYS_io_cancel: ::c_long = 3; ++pub const SYS_lookup_dcookie: ::c_long = 18; ++pub const SYS_remap_file_pages: ::c_long = 234; ++pub const SYS_getdents64: ::c_long = 61; ++pub const SYS_set_tid_address: ::c_long = 96; ++pub const SYS_restart_syscall: ::c_long = 128; ++pub const SYS_semtimedop: ::c_long = 192; ++pub const SYS_fadvise64: ::c_long = 223; ++pub const SYS_timer_create: ::c_long = 107; ++pub const SYS_timer_settime: ::c_long = 110; ++pub const SYS_timer_gettime: ::c_long = 108; ++pub const SYS_timer_getoverrun: ::c_long = 109; ++pub const SYS_timer_delete: ::c_long = 111; ++pub const SYS_clock_settime: ::c_long = 112; ++pub const SYS_clock_gettime: ::c_long = 113; ++pub const SYS_clock_getres: ::c_long = 114; ++pub const SYS_clock_nanosleep: ::c_long = 115; ++pub const SYS_exit_group: ::c_long = 94; ++pub const SYS_epoll_ctl: ::c_long = 21; ++pub const SYS_tgkill: ::c_long = 131; ++pub const SYS_mbind: ::c_long = 235; ++pub const SYS_set_mempolicy: ::c_long = 237; ++pub const SYS_get_mempolicy: ::c_long = 236; ++pub const SYS_mq_open: ::c_long = 180; ++pub const SYS_mq_unlink: ::c_long = 181; ++pub const SYS_mq_timedsend: ::c_long = 182; ++pub const SYS_mq_timedreceive: ::c_long = 183; ++pub const SYS_mq_notify: ::c_long = 184; ++pub const SYS_mq_getsetattr: ::c_long = 185; ++pub const SYS_kexec_load: ::c_long = 104; ++pub const SYS_waitid: ::c_long = 95; ++pub const SYS_add_key: ::c_long = 217; ++pub const SYS_request_key: ::c_long = 218; ++pub const SYS_keyctl: ::c_long = 219; ++pub const SYS_ioprio_set: ::c_long = 30; ++pub const SYS_ioprio_get: ::c_long = 31; ++pub const SYS_inotify_add_watch: ::c_long = 27; ++pub const SYS_inotify_rm_watch: ::c_long = 28; ++pub const SYS_migrate_pages: ::c_long = 238; ++pub const SYS_openat: ::c_long = 56; ++pub const SYS_mkdirat: ::c_long = 34; ++pub const SYS_mknodat: ::c_long = 33; ++pub const SYS_fchownat: ::c_long = 54; ++pub const SYS_newfstatat: ::c_long = 79; ++pub const SYS_unlinkat: ::c_long = 35; ++pub const SYS_linkat: ::c_long = 37; ++pub const SYS_symlinkat: ::c_long = 36; ++pub const SYS_readlinkat: ::c_long = 78; ++pub const SYS_fchmodat: ::c_long = 53; ++pub const SYS_faccessat: ::c_long = 48; ++pub const SYS_pselect6: ::c_long = 72; ++pub const SYS_ppoll: ::c_long = 73; ++pub const SYS_unshare: ::c_long = 97; ++pub const SYS_set_robust_list: ::c_long = 99; ++pub const SYS_get_robust_list: ::c_long = 100; ++pub const SYS_splice: ::c_long = 76; ++pub const SYS_tee: ::c_long = 77; ++pub const SYS_sync_file_range: ::c_long = 84; ++pub const SYS_vmsplice: ::c_long = 75; ++pub const SYS_move_pages: ::c_long = 239; ++pub const SYS_utimensat: ::c_long = 88; ++pub const SYS_epoll_pwait: ::c_long = 22; ++pub const SYS_timerfd_create: ::c_long = 85; ++pub const SYS_fallocate: ::c_long = 47; ++pub const SYS_timerfd_settime: ::c_long = 86; ++pub const SYS_timerfd_gettime: ::c_long = 87; ++pub const SYS_accept4: ::c_long = 242; ++pub const SYS_signalfd4: ::c_long = 74; ++pub const SYS_eventfd2: ::c_long = 19; ++pub const SYS_epoll_create1: ::c_long = 20; ++pub const SYS_dup3: ::c_long = 24; ++pub const SYS_pipe2: ::c_long = 59; ++pub const SYS_inotify_init1: ::c_long = 26; ++pub const SYS_preadv: ::c_long = 69; ++pub const SYS_pwritev: ::c_long = 70; ++pub const SYS_rt_tgsigqueueinfo: ::c_long = 240; ++pub const SYS_perf_event_open: ::c_long = 241; ++pub const SYS_recvmmsg: ::c_long = 243; ++pub const SYS_fanotify_init: ::c_long = 262; ++pub const SYS_fanotify_mark: ::c_long = 263; ++pub const SYS_prlimit64: ::c_long = 261; ++pub const SYS_name_to_handle_at: ::c_long = 264; ++pub const SYS_open_by_handle_at: ::c_long = 265; ++pub const SYS_clock_adjtime: ::c_long = 266; ++pub const SYS_syncfs: ::c_long = 267; ++pub const SYS_sendmmsg: ::c_long = 269; ++pub const SYS_setns: ::c_long = 268; ++pub const SYS_getcpu: ::c_long = 168; ++pub const SYS_process_vm_readv: ::c_long = 270; ++pub const SYS_process_vm_writev: ::c_long = 271; ++pub const SYS_kcmp: ::c_long = 272; ++pub const SYS_finit_module: ::c_long = 273; ++pub const SYS_sched_setattr: ::c_long = 274; ++pub const SYS_sched_getattr: ::c_long = 275; ++pub const SYS_renameat2: ::c_long = 276; ++pub const SYS_seccomp: ::c_long = 277; ++pub const SYS_getrandom: ::c_long = 278; ++pub const SYS_memfd_create: ::c_long = 279; ++pub const SYS_bpf: ::c_long = 280; ++pub const SYS_execveat: ::c_long = 281; ++pub const SYS_userfaultfd: ::c_long = 282; ++pub const SYS_membarrier: ::c_long = 283; ++pub const SYS_mlock2: ::c_long = 284; ++pub const SYS_copy_file_range: ::c_long = 285; ++pub const SYS_preadv2: ::c_long = 286; ++pub const SYS_pwritev2: ::c_long = 287; ++pub const SYS_pkey_mprotect: ::c_long = 288; ++pub const SYS_pkey_alloc: ::c_long = 289; ++pub const SYS_pkey_free: ::c_long = 290; ++pub const SYS_statx: ::c_long = 291; +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs +index b8fda7aeeeacbf10982bbe208ae0eb124f704856..906a44a3645cad3685c9bc8e012b418a860379d8 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs +@@ -44,6 +44,14 @@ s! { + pub l_pid: ::pid_t, + } + ++ pub struct flock64 { ++ pub l_type: ::c_short, ++ pub l_whence: ::c_short, ++ pub l_start: ::off64_t, ++ pub l_len: ::off64_t, ++ pub l_pid: ::pid_t, ++ } ++ + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, +@@ -213,7 +221,7 @@ s! { + } + } + +-s_no_extra_traits!{ ++s_no_extra_traits! { + // FIXME: This is actually a union. + pub struct fpreg_t { + pub d: ::c_double, +@@ -498,10 +506,7 @@ pub const SIGURG: ::c_int = 23; + pub const SIGIO: ::c_int = 29; + pub const SIGSYS: ::c_int = 31; + pub const SIGSTKFLT: ::c_int = 16; +-#[deprecated( +- since = "0.2.55", +- note = "Use SIGSYS instead" +-)] ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] + pub const SIGUNUSED: ::c_int = 31; + pub const SIGPOLL: ::c_int = 29; + pub const SIGPWR: ::c_int = 30; +@@ -535,6 +540,9 @@ pub const F_GETOWN: ::c_int = 9; + pub const F_SETOWN: ::c_int = 8; + pub const F_SETLK: ::c_int = 6; + pub const F_SETLKW: ::c_int = 7; ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; + + pub const SFD_NONBLOCK: ::c_int = 0x0800; + +@@ -567,6 +575,8 @@ pub const TIOCMBIC: ::c_ulong = 0x5417; + pub const TIOCMSET: ::c_ulong = 0x5418; + pub const FIONREAD: ::c_ulong = 0x541B; + pub const TIOCCONS: ::c_ulong = 0x541D; ++pub const TIOCSBRK: ::c_ulong = 0x5427; ++pub const TIOCCBRK: ::c_ulong = 0x5428; + + pub const TCSANOW: ::c_int = 0; + pub const TCSADRAIN: ::c_int = 1; +@@ -593,20 +603,20 @@ pub const OLCUC: ::tcflag_t = 0o000002; + pub const ONLCR: ::tcflag_t = 0o000004; + pub const NLDLY: ::tcflag_t = 0o000400; + pub const CRDLY: ::tcflag_t = 0o003000; +-pub const CR1: ::tcflag_t = 0x00000200; +-pub const CR2: ::tcflag_t = 0x00000400; +-pub const CR3: ::tcflag_t = 0x00000600; ++pub const CR1: ::tcflag_t = 0x00000200; ++pub const CR2: ::tcflag_t = 0x00000400; ++pub const CR3: ::tcflag_t = 0x00000600; + pub const TABDLY: ::tcflag_t = 0o014000; + pub const TAB1: ::tcflag_t = 0x00000800; + pub const TAB2: ::tcflag_t = 0x00001000; + pub const TAB3: ::tcflag_t = 0x00001800; +-pub const BSDLY: ::tcflag_t = 0o020000; +-pub const BS1: ::tcflag_t = 0x00002000; +-pub const FFDLY: ::tcflag_t = 0o100000; +-pub const FF1: ::tcflag_t = 0x00008000; +-pub const VTDLY: ::tcflag_t = 0o040000; +-pub const VT1: ::tcflag_t = 0x00004000; +-pub const XTABS: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const BS1: ::tcflag_t = 0x00002000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const FF1: ::tcflag_t = 0x00008000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const VT1: ::tcflag_t = 0x00004000; ++pub const XTABS: ::tcflag_t = 0o014000; + + pub const CBAUD: ::speed_t = 0o010017; + pub const B0: ::speed_t = 0o000000; +@@ -996,23 +1006,29 @@ pub const SYS_chown: ::c_long = 212; + pub const SYS_setfsuid: ::c_long = 215; + pub const SYS_setfsgid: ::c_long = 216; + pub const SYS_newfstatat: ::c_long = 293; ++pub const SYS_statx: ::c_long = 379; + + #[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; ++extern "C" { ++ ++ 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 getcontext(ucp: *mut ::ucontext_t) -> ::c_int; + pub fn setcontext(ucp: *const ::ucontext_t) -> ::c_int; +- pub fn makecontext(ucp: *mut ::ucontext_t, +- func: extern fn (), +- argc: ::c_int, ...); +- pub fn swapcontext(uocp: *mut ::ucontext_t, +- ucp: *const ::ucontext_t) -> ::c_int; ++ pub fn makecontext( ++ ucp: *mut ::ucontext_t, ++ func: extern "C" fn(), ++ argc: ::c_int, ++ ... ++ ); ++ pub fn swapcontext( ++ uocp: *mut ::ucontext_t, ++ ucp: *const ::ucontext_t, ++ ) -> ::c_int; + } +- +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..29d1e1c7b8a5558fcfa3b8ac333cee3fa9784163 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs +@@ -0,0 +1,7 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [i64; 4] ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/sparc64.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs +similarity index 96% +rename from third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/sparc64.rs +rename to third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs +index d3f854e5dd65087173e1a014cf67278a6d3ec1da..e7d6239e1a994b10a8174eab4c5f00cf6ab71cb4 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/sparc64.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs +@@ -60,6 +60,15 @@ s! { + pub l_pid: ::pid_t, + } + ++ pub struct flock64 { ++ pub l_type: ::c_short, ++ pub l_whence: ::c_short, ++ pub l_start: ::off64_t, ++ pub l_len: ::off64_t, ++ pub l_pid: ::pid_t, ++ __reserved: ::c_short, ++ } ++ + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, +@@ -238,6 +247,7 @@ pub const MAP_POPULATE: ::c_int = 0x08000; + pub const MAP_NONBLOCK: ::c_int = 0x010000; + pub const MAP_STACK: ::c_int = 0x020000; + pub const MAP_HUGETLB: ::c_int = 0x040000; ++pub const MAP_SYNC : ::c_int = 0x080000; + + pub const EDEADLK: ::c_int = 78; + pub const ENAMETOOLONG: ::c_int = 63; +@@ -388,6 +398,9 @@ pub const F_GETOWN: ::c_int = 5; + pub const F_SETOWN: ::c_int = 6; + pub const F_SETLK: ::c_int = 8; + pub const F_SETLKW: ::c_int = 9; ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; + + pub const F_RDLCK: ::c_int = 1; + pub const F_WRLCK: ::c_int = 2; +@@ -403,13 +416,15 @@ pub const TIOCLINUX: ::c_ulong = 0x541C; + pub const TIOCGSERIAL: ::c_ulong = 0x541E; + pub const TIOCEXCL: ::c_ulong = 0x2000740d; + pub const TIOCNXCL: ::c_ulong = 0x2000740e; +-pub const TIOCSCTTY: ::c_ulong = 0x20007484; +-pub const TIOCSTI: ::c_ulong = 0x80017472; ++pub const TIOCCONS: ::c_ulong = 0x20007424; + pub const TIOCMGET: ::c_ulong = 0x4004746a; +-pub const TIOCMBIS: ::c_ulong = 0x8004746c; + pub const TIOCMBIC: ::c_ulong = 0x8004746b; ++pub const TIOCMBIS: ::c_ulong = 0x8004746c; + pub const TIOCMSET: ::c_ulong = 0x8004746d; +-pub const TIOCCONS: ::c_ulong = 0x20007424; ++pub const TIOCSTI: ::c_ulong = 0x80017472; ++pub const TIOCCBRK: ::c_ulong = 0x2000747a; ++pub const TIOCSBRK: ::c_ulong = 0x2000747b; ++pub const TIOCSCTTY: ::c_ulong = 0x20007484; + + pub const TIOCM_ST: ::c_int = 0x008; + pub const TIOCM_SR: ::c_int = 0x010; +@@ -548,14 +563,14 @@ pub const NOFLSH: ::tcflag_t = 0x80; + pub const CIBAUD: ::tcflag_t = 0o02003600000; + pub const CBAUDEX: ::tcflag_t = 0x00001000; + pub const VSWTC: usize = 7; +-pub const OLCUC: ::tcflag_t = 0o000002; +-pub const NLDLY: ::tcflag_t = 0o000400; +-pub const CRDLY: ::tcflag_t = 0o003000; ++pub const OLCUC: ::tcflag_t = 0o000002; ++pub const NLDLY: ::tcflag_t = 0o000400; ++pub const CRDLY: ::tcflag_t = 0o003000; + pub const TABDLY: ::tcflag_t = 0o014000; +-pub const BSDLY: ::tcflag_t = 0o020000; +-pub const FFDLY: ::tcflag_t = 0o100000; +-pub const VTDLY: ::tcflag_t = 0o040000; +-pub const XTABS: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const XTABS: ::tcflag_t = 0o014000; + + pub const B0: ::speed_t = 0o000000; + pub const B50: ::speed_t = 0o000001; +@@ -841,11 +856,11 @@ pub const SYS_mlockall: ::c_long = 239; + pub const SYS_munlockall: ::c_long = 240; + pub const SYS_sched_setparam: ::c_long = 241; + pub const SYS_sched_getparam: ::c_long = 242; +-pub const SYS_sched_setscheduler: ::c_long =243; +-pub const SYS_sched_getscheduler: ::c_long =244; ++pub const SYS_sched_setscheduler: ::c_long = 243; ++pub const SYS_sched_getscheduler: ::c_long = 244; + pub const SYS_sched_yield: ::c_long = 245; +-pub const SYS_sched_get_priority_max: ::c_long =246; +-pub const SYS_sched_get_priority_min: ::c_long =247; ++pub const SYS_sched_get_priority_max: ::c_long = 246; ++pub const SYS_sched_get_priority_min: ::c_long = 247; + pub const SYS_sched_rr_get_interval: ::c_long = 248; + pub const SYS_nanosleep: ::c_long = 249; + pub const SYS_mremap: ::c_long = 250; +@@ -899,7 +914,7 @@ pub const SYS_ppoll: ::c_long = 298; + pub const SYS_unshare: ::c_long = 299; + pub const SYS_set_robust_list: ::c_long = 300; + pub const SYS_get_robust_list: ::c_long = 301; +-pub const SYS_migrate_pages: ::c_long =302; ++pub const SYS_migrate_pages: ::c_long = 302; + pub const SYS_mbind: ::c_long = 303; + pub const SYS_get_mempolicy: ::c_long = 304; + pub const SYS_set_mempolicy: ::c_long = 305; +@@ -960,12 +975,20 @@ pub const SYS_pwritev2: ::c_long = 359; + pub const SYS_statx: ::c_long = 360; + + #[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; ++extern "C" { ++ 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; ++} ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } + } +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..7ca870fd02b71e31e44439e3fabdf1386eb75bb9 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs +@@ -0,0 +1,7 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 4] ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs +index f3b10084fdecd89ec9348733e401b5c6279beaa6..f48d659f584affbe66394b7772c7be1fc78b94af 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs +@@ -42,6 +42,14 @@ s! { + pub l_pid: ::pid_t, + } + ++ pub struct flock64 { ++ pub l_type: ::c_short, ++ pub l_whence: ::c_short, ++ pub l_start: ::off64_t, ++ pub l_len: ::off64_t, ++ pub l_pid: ::pid_t, ++ } ++ + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, +@@ -261,6 +269,12 @@ s! { + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } ++ ++ pub struct ip_mreqn { ++ pub imr_multiaddr: ::in_addr, ++ pub imr_address: ::in_addr, ++ pub imr_ifindex: ::c_int, ++ } + } + + s_no_extra_traits! { +@@ -581,10 +595,7 @@ pub const SIGURG: ::c_int = 23; + pub const SIGIO: ::c_int = 29; + pub const SIGSYS: ::c_int = 31; + pub const SIGSTKFLT: ::c_int = 16; +-#[deprecated( +- since = "0.2.55", +- note = "Use SIGSYS instead" +-)] ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] + pub const SIGUNUSED: ::c_int = 31; + pub const SIGPOLL: ::c_int = 29; + pub const SIGPWR: ::c_int = 30; +@@ -607,6 +618,9 @@ pub const F_GETOWN: ::c_int = 9; + pub const F_SETOWN: ::c_int = 8; + pub const F_SETLK: ::c_int = 6; + pub const F_SETLKW: ::c_int = 7; ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; + + pub const F_RDLCK: ::c_int = 0; + pub const F_WRLCK: ::c_int = 1; +@@ -687,6 +701,7 @@ pub const MAP_EXECUTABLE: ::c_int = 0x01000; + pub const MAP_POPULATE: ::c_int = 0x08000; + pub const MAP_NONBLOCK: ::c_int = 0x010000; + pub const MAP_STACK: ::c_int = 0x020000; ++pub const MAP_SYNC : ::c_int = 0x080000; + + pub const EDEADLOCK: ::c_int = 35; + pub const EUCLEAN: ::c_int = 117; +@@ -706,6 +721,8 @@ pub const PTRACE_SETFPXREGS: ::c_uint = 19; + pub const PTRACE_GETREGS: ::c_uint = 12; + pub const PTRACE_SETREGS: ::c_uint = 13; + pub const PTRACE_PEEKSIGINFO_SHARED: ::c_uint = 1; ++pub const PTRACE_SYSEMU: ::c_uint = 31; ++pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32; + + pub const MCL_CURRENT: ::c_int = 0x0001; + pub const MCL_FUTURE: ::c_int = 0x0002; +@@ -755,14 +772,14 @@ pub const NOFLSH: ::tcflag_t = 0x00000080; + pub const CIBAUD: ::tcflag_t = 0o02003600000; + pub const CBAUDEX: ::tcflag_t = 0o010000; + pub const VSWTC: usize = 7; +-pub const OLCUC: ::tcflag_t = 0o000002; +-pub const NLDLY: ::tcflag_t = 0o000400; +-pub const CRDLY: ::tcflag_t = 0o003000; ++pub const OLCUC: ::tcflag_t = 0o000002; ++pub const NLDLY: ::tcflag_t = 0o000400; ++pub const CRDLY: ::tcflag_t = 0o003000; + pub const TABDLY: ::tcflag_t = 0o014000; +-pub const BSDLY: ::tcflag_t = 0o020000; +-pub const FFDLY: ::tcflag_t = 0o100000; +-pub const VTDLY: ::tcflag_t = 0o040000; +-pub const XTABS: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const XTABS: ::tcflag_t = 0o014000; + + pub const B0: ::speed_t = 0o000000; + pub const B50: ::speed_t = 0o000001; +@@ -824,6 +841,8 @@ pub const TIOCOUTQ: ::c_ulong = 0x5411; + pub const TIOCGWINSZ: ::c_ulong = 0x5413; + pub const TIOCSWINSZ: ::c_ulong = 0x5414; + pub const FIONREAD: ::c_ulong = 0x541B; ++pub const TIOCSBRK: ::c_ulong = 0x5427; ++pub const TIOCCBRK: ::c_ulong = 0x5428; + + // offsets in user_regs_structs, from sys/reg.h + pub const R15: ::c_int = 0; +@@ -879,17 +898,25 @@ pub const REG_TRAPNO: ::c_int = 20; + pub const REG_OLDMASK: ::c_int = 21; + pub const REG_CR2: ::c_int = 22; + +-extern { ++extern "C" { + pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int; + pub fn setcontext(ucp: *const ucontext_t) -> ::c_int; +- pub fn makecontext(ucp: *mut ucontext_t, +- func: extern fn (), +- argc: ::c_int, ...); +- pub fn swapcontext(uocp: *mut ucontext_t, +- ucp: *const ucontext_t) -> ::c_int; ++ pub fn makecontext( ++ ucp: *mut ucontext_t, ++ func: extern "C" fn(), ++ argc: ::c_int, ++ ... ++ ); ++ pub fn swapcontext( ++ uocp: *mut ucontext_t, ++ ucp: *const ucontext_t, ++ ) -> ::c_int; + pub fn iopl(level: ::c_int) -> ::c_int; +- pub fn ioperm(from: ::c_ulong, num: ::c_ulong, +- turn_on: ::c_int) -> ::c_int; ++ pub fn ioperm( ++ from: ::c_ulong, ++ num: ::c_ulong, ++ turn_on: ::c_int, ++ ) -> ::c_int; + } + + cfg_if! { +@@ -901,3 +928,10 @@ cfg_if! { + pub use self::not_x32::*; + } + } ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs +index 97e21f279df2a8bc68f39e32ddd0dc66ca501a52..64a6de9c67098562fcb73ca37a9c1547d15cecc9 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs +@@ -411,12 +411,13 @@ pub const SYS_pkey_free: ::c_long = 331; + pub const SYS_statx: ::c_long = 332; + + #[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; ++extern "C" { ++ 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; + } +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/gnu/mod.rs b/third_party/rust/libc/src/unix/linux_like/linux/gnu/mod.rs +index 0814abf5e8e4599994713d8f97cdcedc7c17e2d4..aa3e1b35e54434112588ec19009c114c82ca7954 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/gnu/mod.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/gnu/mod.rs +@@ -1,6 +1,8 @@ + pub type pthread_t = c_ulong; + pub type __priority_which_t = ::c_uint; + pub type __rlimit_resource_t = ::c_uint; ++pub type Lmid_t = ::c_long; ++pub type regoff_t = ::c_int; + + s! { + pub struct statx { +@@ -98,11 +100,13 @@ s! { + pub c_line: ::cc_t, + pub c_cc: [::cc_t; ::NCCS], + #[cfg(not(any( ++ target_arch = "sparc", + target_arch = "sparc64", + target_arch = "mips", + target_arch = "mips64")))] + pub c_ispeed: ::speed_t, + #[cfg(not(any( ++ target_arch = "sparc", + target_arch = "sparc64", + target_arch = "mips", + target_arch = "mips64")))] +@@ -180,6 +184,107 @@ s! { + pub rt_window: ::c_ulong, + pub rt_irtt: ::c_ushort, + } ++ ++ pub struct timex { ++ pub modes: ::c_uint, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub offset: i64, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub offset: ::c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub freq: i64, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub freq: ::c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub maxerror: i64, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub maxerror: ::c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub esterror: i64, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub esterror: ::c_long, ++ pub status: ::c_int, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub constant: i64, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub constant: ::c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub precision: i64, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub precision: ::c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub tolerance: i64, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub tolerance: ::c_long, ++ pub time: ::timeval, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub tick: i64, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub tick: ::c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub ppsfreq: i64, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub ppsfreq: ::c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub jitter: i64, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub jitter: ::c_long, ++ pub shift: ::c_int, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub stabil: i64, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub stabil: ::c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub jitcnt: i64, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub jitcnt: ::c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub calcnt: i64, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub calcnt: ::c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub errcnt: i64, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub errcnt: ::c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub stbcnt: i64, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub stbcnt: ::c_long, ++ pub tai: ::c_int, ++ pub __unused1: i32, ++ pub __unused2: i32, ++ pub __unused3: i32, ++ pub __unused4: i32, ++ pub __unused5: i32, ++ pub __unused6: i32, ++ pub __unused7: i32, ++ pub __unused8: i32, ++ pub __unused9: i32, ++ pub __unused10: i32, ++ pub __unused11: i32, ++ } ++ ++ pub struct ntptimeval { ++ pub time: ::timeval, ++ pub maxerror: ::c_long, ++ pub esterror: ::c_long, ++ pub tai: ::c_long, ++ pub __glibc_reserved1: ::c_long, ++ pub __glibc_reserved2: ::c_long, ++ pub __glibc_reserved3: ::c_long, ++ pub __glibc_reserved4: ::c_long, ++ } ++ ++ pub struct regex_t { ++ __buffer: *mut ::c_void, ++ __allocated: ::size_t, ++ __used: ::size_t, ++ __syntax: ::c_ulong, ++ __fastmap: *mut ::c_char, ++ __translate: *mut ::c_char, ++ __re_nsub: ::size_t, ++ __bitfield: u8, ++ } + } + + impl siginfo_t { +@@ -189,10 +294,23 @@ impl siginfo_t { + _si_signo: ::c_int, + _si_errno: ::c_int, + _si_code: ::c_int, +- si_addr: *mut ::c_void ++ si_addr: *mut ::c_void, + } + (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr + } ++ ++ pub unsafe fn si_value(&self) -> ::sigval { ++ #[repr(C)] ++ struct siginfo_timer { ++ _si_signo: ::c_int, ++ _si_errno: ::c_int, ++ _si_code: ::c_int, ++ _si_tid: ::c_int, ++ _si_overrun: ::c_int, ++ si_sigval: ::sigval, ++ } ++ (*(self as *const siginfo_t as *const siginfo_timer)).si_sigval ++ } + } + + s_no_extra_traits! { +@@ -293,6 +411,47 @@ cfg_if! { + } + } + ++// include/uapi/asm-generic/hugetlb_encode.h ++pub const HUGETLB_FLAG_ENCODE_SHIFT: ::c_int = 26; ++pub const HUGETLB_FLAG_ENCODE_MASK: ::c_int = 0x3f; ++ ++pub const HUGETLB_FLAG_ENCODE_64KB: ::c_int = 16 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_512KB: ::c_int = 19 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_1MB: ::c_int = 20 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_2MB: ::c_int = 21 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_8MB: ::c_int = 23 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_16MB: ::c_int = 24 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_32MB: ::c_int = 25 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_256MB: ::c_int = 28 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_512MB: ::c_int = 29 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_1GB: ::c_int = 30 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_2GB: ::c_int = 31 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_16GB: ::c_int = 34 << HUGETLB_FLAG_ENCODE_SHIFT; ++ ++// include/uapi/linux/mman.h ++/* ++ * Huge page size encoding when MAP_HUGETLB is specified, and a huge page ++ * size other than the default is desired. See hugetlb_encode.h. ++ * All known huge page size encodings are provided here. It is the ++ * responsibility of the application to know which sizes are supported on ++ * the running system. See mmap(2) man page for details. ++ */ ++pub const MAP_HUGE_SHIFT: ::c_int = HUGETLB_FLAG_ENCODE_SHIFT; ++pub const MAP_HUGE_MASK: ::c_int = HUGETLB_FLAG_ENCODE_MASK; ++ ++pub const MAP_HUGE_64KB: ::c_int = HUGETLB_FLAG_ENCODE_64KB; ++pub const MAP_HUGE_512KB: ::c_int = HUGETLB_FLAG_ENCODE_512KB; ++pub const MAP_HUGE_1MB: ::c_int = HUGETLB_FLAG_ENCODE_1MB; ++pub const MAP_HUGE_2MB: ::c_int = HUGETLB_FLAG_ENCODE_2MB; ++pub const MAP_HUGE_8MB: ::c_int = HUGETLB_FLAG_ENCODE_8MB; ++pub const MAP_HUGE_16MB: ::c_int = HUGETLB_FLAG_ENCODE_16MB; ++pub const MAP_HUGE_32MB: ::c_int = HUGETLB_FLAG_ENCODE_32MB; ++pub const MAP_HUGE_256MB: ::c_int = HUGETLB_FLAG_ENCODE_256MB; ++pub const MAP_HUGE_512MB: ::c_int = HUGETLB_FLAG_ENCODE_512MB; ++pub const MAP_HUGE_1GB: ::c_int = HUGETLB_FLAG_ENCODE_1GB; ++pub const MAP_HUGE_2GB: ::c_int = HUGETLB_FLAG_ENCODE_2GB; ++pub const MAP_HUGE_16GB: ::c_int = HUGETLB_FLAG_ENCODE_16GB; ++ + pub const RLIMIT_CPU: ::__rlimit_resource_t = 0; + pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1; + pub const RLIMIT_DATA: ::__rlimit_resource_t = 2; +@@ -306,6 +465,10 @@ pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14; + pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15; + pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = 16; + ++pub const PRIO_PROCESS: ::__priority_which_t = 0; ++pub const PRIO_PGRP: ::__priority_which_t = 1; ++pub const PRIO_USER: ::__priority_which_t = 2; ++ + pub const MS_RMT_MASK: ::c_ulong = 0x02800051; + + pub const __UT_LINESIZE: usize = 32; +@@ -322,6 +485,21 @@ pub const USER_PROCESS: ::c_short = 7; + pub const DEAD_PROCESS: ::c_short = 8; + pub const ACCOUNTING: ::c_short = 9; + ++// dlfcn.h ++pub const LM_ID_BASE: ::c_long = 0; ++pub const LM_ID_NEWLM: ::c_long = -1; ++ ++pub const RTLD_DI_LMID: ::c_int = 1; ++pub const RTLD_DI_LINKMAP: ::c_int = 2; ++pub const RTLD_DI_CONFIGADDR: ::c_int = 3; ++pub const RTLD_DI_SERINFO: ::c_int = 4; ++pub const RTLD_DI_SERINFOSIZE: ::c_int = 5; ++pub const RTLD_DI_ORIGIN: ::c_int = 6; ++pub const RTLD_DI_PROFILENAME: ::c_int = 7; ++pub const RTLD_DI_PROFILEOUT: ::c_int = 8; ++pub const RTLD_DI_TLS_MODID: ::c_int = 9; ++pub const RTLD_DI_TLS_DATA: ::c_int = 10; ++ + pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK; + + pub const SOL_RXRPC: ::c_int = 272; +@@ -341,27 +519,24 @@ 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_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_SHARED_VALIDATE: ::c_int = 0x3; +-pub const MAP_FIXED_NOREPLACE: ::c_int = 0x100000; ++ | ::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 ENOTSUP: ::c_int = EOPNOTSUPP; + +@@ -379,6 +554,7 @@ pub const TCP_QUEUE_SEQ: ::c_int = 21; + pub const TCP_REPAIR_OPTIONS: ::c_int = 22; + pub const TCP_FASTOPEN: ::c_int = 23; + pub const TCP_TIMESTAMP: ::c_int = 24; ++pub const TCP_FASTOPEN_CONNECT: ::c_int = 30; + + /* DCCP socket options */ + pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1; +@@ -488,30 +664,50 @@ 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 AFS_SUPER_MAGIC: ::c_long = 0x5346414f; ++pub const AUTOFS_SUPER_MAGIC: ::c_long = 0x0187; ++pub const BINDERFS_SUPER_MAGIC: ::c_long = 0x6c6f6f70; ++pub const BTRFS_SUPER_MAGIC: ::c_long = 0x9123683e; ++pub const CGROUP2_SUPER_MAGIC: ::c_long = 0x63677270; ++pub const CGROUP_SUPER_MAGIC: ::c_long = 0x27e0eb; + pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245; + pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45; ++pub const DEVPTS_SUPER_MAGIC: ::c_long = 0x1cd1; ++pub const ECRYPTFS_SUPER_MAGIC: ::c_long = 0xf15f; + 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 F2FS_SUPER_MAGIC: ::c_long = 0xf2f52010; ++pub const FUTEXFS_SUPER_MAGIC: ::c_long = 0xbad1dea; ++pub const HOSTFS_SUPER_MAGIC: ::c_long = 0x00c0ffee; + 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 MINIX2_SUPER_MAGIC: ::c_long = 0x00002468; ++pub const MINIX3_SUPER_MAGIC: ::c_long = 0x4d5a; ++pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f; ++pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f; + 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 NILFS_SUPER_MAGIC: ::c_long = 0x3434; ++pub const OCFS2_SUPER_MAGIC: ::c_long = 0x7461636f; + pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1; ++pub const OVERLAYFS_SUPER_MAGIC: ::c_long = 0x794c7630; + pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0; + pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f; ++pub const QNX6_SUPER_MAGIC: ::c_long = 0x68191122; ++pub const RDTGROUP_SUPER_MAGIC: ::c_long = 0x7655821; + 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 UDF_SUPER_MAGIC: ::c_long = 0x15013346; + pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2; ++pub const XENFS_SUPER_MAGIC: ::c_long = 0xabba1974; ++pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342; + + pub const CPU_SETSIZE: ::c_int = 0x400; + +@@ -543,21 +739,6 @@ pub const EPOLLWAKEUP: ::c_int = 0x20000000; + pub const SEEK_DATA: ::c_int = 3; + pub const SEEK_HOLE: ::c_int = 4; + +-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; +- + // linux/rtnetlink.h + pub const TCA_PAD: ::c_ushort = 9; + pub const TCA_DUMP_INVISIBLE: ::c_ushort = 10; +@@ -598,65 +779,8 @@ pub const IFA_F_NOPREFIXROUTE: u32 = 0x200; + pub const IFA_F_MCAUTOJOIN: u32 = 0x400; + pub const IFA_F_STABLE_PRIVACY: u32 = 0x800; + +-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 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); +- +-pub const NLA_ALIGNTO: ::c_int = 4; +- + pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10; + + pub const GENL_ID_VFS_DQUOT: ::c_int = ::NLMSG_MIN_TYPE + 1; +@@ -674,6 +798,37 @@ pub const NF_NETDEV_NUMHOOKS: ::c_int = 1; + pub const NFPROTO_INET: ::c_int = 1; + pub const NFPROTO_NETDEV: ::c_int = 5; + ++// linux/keyctl.h ++pub const KEYCTL_DH_COMPUTE: u32 = 23; ++pub const KEYCTL_PKEY_QUERY: u32 = 24; ++pub const KEYCTL_PKEY_ENCRYPT: u32 = 25; ++pub const KEYCTL_PKEY_DECRYPT: u32 = 26; ++pub const KEYCTL_PKEY_SIGN: u32 = 27; ++pub const KEYCTL_PKEY_VERIFY: u32 = 28; ++pub const KEYCTL_RESTRICT_KEYRING: u32 = 29; ++ ++pub const KEYCTL_SUPPORTS_ENCRYPT: u32 = 0x01; ++pub const KEYCTL_SUPPORTS_DECRYPT: u32 = 0x02; ++pub const KEYCTL_SUPPORTS_SIGN: u32 = 0x04; ++pub const KEYCTL_SUPPORTS_VERIFY: u32 = 0x08; ++cfg_if! { ++ if #[cfg(not(any(target_arch="mips", target_arch="mips64")))] { ++ pub const KEYCTL_MOVE: u32 = 30; ++ pub const KEYCTL_CAPABILITIES: u32 = 31; ++ ++ pub const KEYCTL_CAPS0_CAPABILITIES: u32 = 0x01; ++ pub const KEYCTL_CAPS0_PERSISTENT_KEYRINGS: u32 = 0x02; ++ pub const KEYCTL_CAPS0_DIFFIE_HELLMAN: u32 = 0x04; ++ pub const KEYCTL_CAPS0_PUBLIC_KEY: u32 = 0x08; ++ pub const KEYCTL_CAPS0_BIG_KEY: u32 = 0x10; ++ pub const KEYCTL_CAPS0_INVALIDATE: u32 = 0x20; ++ pub const KEYCTL_CAPS0_RESTRICT_KEYRING: u32 = 0x40; ++ pub const KEYCTL_CAPS0_MOVE: u32 = 0x80; ++ pub const KEYCTL_CAPS1_NS_KEYRING_NAME: u32 = 0x01; ++ pub const KEYCTL_CAPS1_NS_KEY_TAG: u32 = 0x02; ++ } ++} ++ + // linux/netfilter/nf_tables.h + pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256; + pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256; +@@ -773,12 +928,12 @@ pub const NFT_CMP_GTE: ::c_int = 5; + pub const NFT_RANGE_EQ: ::c_int = 0; + pub const NFT_RANGE_NEQ: ::c_int = 1; + +-pub const NFT_LOOKUP_F_INV: ::c_int = (1 << 0); ++pub const NFT_LOOKUP_F_INV: ::c_int = 1 << 0; + + pub const NFT_DYNSET_OP_ADD: ::c_int = 0; + pub const NFT_DYNSET_OP_UPDATE: ::c_int = 1; + +-pub const NFT_DYNSET_F_INV: ::c_int = (1 << 0); ++pub const NFT_DYNSET_F_INV: ::c_int = 1 << 0; + + pub const NFT_PAYLOAD_LL_HEADER: ::c_int = 0; + pub const NFT_PAYLOAD_NETWORK_HEADER: ::c_int = 1; +@@ -833,13 +988,13 @@ pub const NFT_CT_BYTES: ::c_int = 15; + pub const NFT_LIMIT_PKTS: ::c_int = 0; + pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1; + +-pub const NFT_LIMIT_F_INV: ::c_int = (1 << 0); ++pub const NFT_LIMIT_F_INV: ::c_int = 1 << 0; + + pub const NFT_QUEUE_FLAG_BYPASS: ::c_int = 0x01; + pub const NFT_QUEUE_FLAG_CPU_FANOUT: ::c_int = 0x02; + pub const NFT_QUEUE_FLAG_MASK: ::c_int = 0x03; + +-pub const NFT_QUOTA_F_INV: ::c_int = (1 << 0); ++pub const NFT_QUOTA_F_INV: ::c_int = 1 << 0; + + pub const NFT_REJECT_ICMP_UNREACH: ::c_int = 0; + pub const NFT_REJECT_TCP_RST: ::c_int = 1; +@@ -900,15 +1055,105 @@ pub const STATX_ATTR_NODUMP: ::c_int = 0x0040; + pub const STATX_ATTR_ENCRYPTED: ::c_int = 0x0800; + pub const STATX_ATTR_AUTOMOUNT: ::c_int = 0x1000; + ++// sys/auxv.h ++pub const AT_NULL: ::c_ulong = 0; ++pub const AT_IGNORE: ::c_ulong = 1; ++pub const AT_EXECFD: ::c_ulong = 2; ++pub const AT_PHDR: ::c_ulong = 3; ++pub const AT_PHENT: ::c_ulong = 4; ++pub const AT_PHNUM: ::c_ulong = 5; ++pub const AT_PAGESZ: ::c_ulong = 6; ++pub const AT_BASE: ::c_ulong = 7; ++pub const AT_FLAGS: ::c_ulong = 8; ++pub const AT_ENTRY: ::c_ulong = 9; ++pub const AT_NOTELF: ::c_ulong = 10; ++pub const AT_UID: ::c_ulong = 11; ++pub const AT_EUID: ::c_ulong = 12; ++pub const AT_GID: ::c_ulong = 13; ++pub const AT_EGID: ::c_ulong = 14; ++pub const AT_PLATFORM: ::c_ulong = 15; ++pub const AT_HWCAP: ::c_ulong = 16; ++pub const AT_CLKTCK: ::c_ulong = 17; ++// AT_* values 18 through 22 are reserved ++pub const AT_SECURE: ::c_ulong = 23; ++pub const AT_BASE_PLATFORM: ::c_ulong = 24; ++pub const AT_RANDOM: ::c_ulong = 25; ++pub const AT_HWCAP2: ::c_ulong = 26; ++ ++pub const AT_EXECFN: ::c_ulong = 31; ++ ++//sys/timex.h ++pub const ADJ_OFFSET: ::c_uint = 0x0001; ++pub const ADJ_FREQUENCY: ::c_uint = 0x0002; ++pub const ADJ_MAXERROR: ::c_uint = 0x0004; ++pub const ADJ_ESTERROR: ::c_uint = 0x0008; ++pub const ADJ_STATUS: ::c_uint = 0x0010; ++pub const ADJ_TIMECONST: ::c_uint = 0x0020; ++pub const ADJ_TAI: ::c_uint = 0x0080; ++pub const ADJ_SETOFFSET: ::c_uint = 0x0100; ++pub const ADJ_MICRO: ::c_uint = 0x1000; ++pub const ADJ_NANO: ::c_uint = 0x2000; ++pub const ADJ_TICK: ::c_uint = 0x4000; ++pub const ADJ_OFFSET_SINGLESHOT: ::c_uint = 0x8001; ++pub const ADJ_OFFSET_SS_READ: ::c_uint = 0xa001; ++pub const MOD_OFFSET: ::c_uint = ADJ_OFFSET; ++pub const MOD_FREQUENCY: ::c_uint = ADJ_FREQUENCY; ++pub const MOD_MAXERROR: ::c_uint = ADJ_MAXERROR; ++pub const MOD_ESTERROR: ::c_uint = ADJ_ESTERROR; ++pub const MOD_STATUS: ::c_uint = ADJ_STATUS; ++pub const MOD_TIMECONST: ::c_uint = ADJ_TIMECONST; ++pub const MOD_CLKB: ::c_uint = ADJ_TICK; ++pub const MOD_CLKA: ::c_uint = ADJ_OFFSET_SINGLESHOT; ++pub const MOD_TAI: ::c_uint = ADJ_TAI; ++pub const MOD_MICRO: ::c_uint = ADJ_MICRO; ++pub const MOD_NANO: ::c_uint = ADJ_NANO; ++pub const STA_PLL: ::c_int = 0x0001; ++pub const STA_PPSFREQ: ::c_int = 0x0002; ++pub const STA_PPSTIME: ::c_int = 0x0004; ++pub const STA_FLL: ::c_int = 0x0008; ++pub const STA_INS: ::c_int = 0x0010; ++pub const STA_DEL: ::c_int = 0x0020; ++pub const STA_UNSYNC: ::c_int = 0x0040; ++pub const STA_FREQHOLD: ::c_int = 0x0080; ++pub const STA_PPSSIGNAL: ::c_int = 0x0100; ++pub const STA_PPSJITTER: ::c_int = 0x0200; ++pub const STA_PPSWANDER: ::c_int = 0x0400; ++pub const STA_PPSERROR: ::c_int = 0x0800; ++pub const STA_CLOCKERR: ::c_int = 0x1000; ++pub const STA_NANO: ::c_int = 0x2000; ++pub const STA_MODE: ::c_int = 0x4000; ++pub const STA_CLK: ::c_int = 0x8000; ++pub const STA_RONLY: ::c_int = STA_PPSSIGNAL ++ | STA_PPSJITTER ++ | STA_PPSWANDER ++ | STA_PPSERROR ++ | STA_CLOCKERR ++ | STA_NANO ++ | STA_MODE ++ | STA_CLK; ++pub const NTP_API: ::c_int = 4; ++pub const TIME_OK: ::c_int = 0; ++pub const TIME_INS: ::c_int = 1; ++pub const TIME_DEL: ::c_int = 2; ++pub const TIME_OOP: ::c_int = 3; ++pub const TIME_WAIT: ::c_int = 4; ++pub const TIME_ERROR: ::c_int = 5; ++pub const TIME_BAD: ::c_int = TIME_ERROR; ++pub const MAXTC: ::c_long = 6; ++ + cfg_if! { + if #[cfg(any( + target_arch = "arm", + target_arch = "x86", + target_arch = "x86_64", +- target_arch = "s390x" ++ target_arch = "s390x", ++ target_arch = "riscv64" + ))] { + pub const PTHREAD_STACK_MIN: ::size_t = 16384; +- } else if #[cfg(target_arch = "sparc64")] { ++ } else if #[cfg(any( ++ target_arch = "sparc", ++ target_arch = "sparc64" ++ ))] { + pub const PTHREAD_STACK_MIN: ::size_t = 0x6000; + } else { + pub const PTHREAD_STACK_MIN: ::size_t = 131072; +@@ -916,33 +1161,89 @@ cfg_if! { + } + pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 3; + +-f! { +- pub fn NLA_ALIGN(len: ::c_int) -> ::c_int { +- return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1) +- } +-} ++pub const REG_STARTEND: ::c_int = 4; ++ ++pub const REG_EEND: ::c_int = 14; ++pub const REG_ESIZE: ::c_int = 15; ++pub const REG_ERPAREN: ::c_int = 16; + +-extern { +- pub fn sendmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, +- flags: ::c_int) -> ::c_int; +- pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, +- flags: ::c_int, timeout: *mut ::timespec) -> ::c_int; +- +- pub fn getrlimit64(resource: ::__rlimit_resource_t, +- rlim: *mut ::rlimit64) -> ::c_int; +- pub fn setrlimit64(resource: ::__rlimit_resource_t, +- rlim: *const ::rlimit64) -> ::c_int; +- pub fn getrlimit(resource: ::__rlimit_resource_t, +- rlim: *mut ::rlimit) -> ::c_int; +- pub fn setrlimit(resource: ::__rlimit_resource_t, +- rlim: *const ::rlimit) -> ::c_int; +- pub fn prlimit(pid: ::pid_t, +- resource: ::__rlimit_resource_t, new_limit: *const ::rlimit, +- old_limit: *mut ::rlimit) -> ::c_int; +- pub fn prlimit64(pid: ::pid_t, +- resource: ::__rlimit_resource_t, +- new_limit: *const ::rlimit64, +- old_limit: *mut ::rlimit64) -> ::c_int; ++extern "C" { ++ pub fn fgetspent_r( ++ fp: *mut ::FILE, ++ spbuf: *mut ::spwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ spbufp: *mut *mut ::spwd, ++ ) -> ::c_int; ++ pub fn sgetspent_r( ++ s: *const ::c_char, ++ spbuf: *mut ::spwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ spbufp: *mut *mut ::spwd, ++ ) -> ::c_int; ++ pub fn getspent_r( ++ spbuf: *mut ::spwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ spbufp: *mut *mut ::spwd, ++ ) -> ::c_int; ++ pub fn qsort_r( ++ base: *mut ::c_void, ++ num: ::size_t, ++ size: ::size_t, ++ compar: ::Option< ++ unsafe extern "C" fn( ++ *const ::c_void, ++ *const ::c_void, ++ *mut ::c_void, ++ ) -> ::c_int, ++ >, ++ arg: *mut ::c_void, ++ ); ++ pub fn sendmmsg( ++ sockfd: ::c_int, ++ msgvec: *mut ::mmsghdr, ++ vlen: ::c_uint, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn recvmmsg( ++ sockfd: ::c_int, ++ msgvec: *mut ::mmsghdr, ++ vlen: ::c_uint, ++ flags: ::c_int, ++ timeout: *mut ::timespec, ++ ) -> ::c_int; ++ ++ pub fn getrlimit64( ++ resource: ::__rlimit_resource_t, ++ rlim: *mut ::rlimit64, ++ ) -> ::c_int; ++ pub fn setrlimit64( ++ resource: ::__rlimit_resource_t, ++ rlim: *const ::rlimit64, ++ ) -> ::c_int; ++ pub fn getrlimit( ++ resource: ::__rlimit_resource_t, ++ rlim: *mut ::rlimit, ++ ) -> ::c_int; ++ pub fn setrlimit( ++ resource: ::__rlimit_resource_t, ++ rlim: *const ::rlimit, ++ ) -> ::c_int; ++ pub fn prlimit( ++ pid: ::pid_t, ++ resource: ::__rlimit_resource_t, ++ new_limit: *const ::rlimit, ++ old_limit: *mut ::rlimit, ++ ) -> ::c_int; ++ pub fn prlimit64( ++ pid: ::pid_t, ++ resource: ::__rlimit_resource_t, ++ new_limit: *const ::rlimit64, ++ old_limit: *mut ::rlimit64, ++ ) -> ::c_int; ++ pub fn utmpname(file: *const ::c_char) -> ::c_int; + pub fn utmpxname(file: *const ::c_char) -> ::c_int; + pub fn getutxent() -> *mut utmpx; + pub fn getutxid(ut: *const utmpx) -> *mut utmpx; +@@ -952,72 +1253,143 @@ extern { + pub fn endutxent(); + pub fn getpt() -> ::c_int; + pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int; +- pub fn gettimeofday(tp: *mut ::timeval, +- tz: *mut ::timezone) -> ::c_int; +- pub fn statx(dirfd: ::c_int, pathname: *const c_char, flags: ::c_int, +- mask: ::c_uint, statxbuf: *mut statx) -> ::c_int; ++ pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; ++ pub fn statx( ++ dirfd: ::c_int, ++ pathname: *const c_char, ++ flags: ::c_int, ++ mask: ::c_uint, ++ statxbuf: *mut statx, ++ ) -> ::c_int; + pub fn getrandom( + buf: *mut ::c_void, + buflen: ::size_t, + flags: ::c_uint, + ) -> ::ssize_t; ++ ++ pub fn memmem( ++ haystack: *const ::c_void, ++ haystacklen: ::size_t, ++ needle: *const ::c_void, ++ needlelen: ::size_t, ++ ) -> *mut ::c_void; ++ pub fn getauxval(type_: ::c_ulong) -> ::c_ulong; ++ ++ pub fn adjtimex(buf: *mut timex) -> ::c_int; ++ pub fn ntp_adjtime(buf: *mut timex) -> ::c_int; ++ #[link_name = "ntp_gettimex"] ++ pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int; ++ pub fn copy_file_range( ++ fd_in: ::c_int, ++ off_in: *mut ::off64_t, ++ fd_out: ::c_int, ++ off_out: *mut ::off64_t, ++ len: ::size_t, ++ flags: ::c_uint, ++ ) -> ::ssize_t; ++ pub fn fanotify_mark( ++ fd: ::c_int, ++ flags: ::c_uint, ++ mask: u64, ++ dirfd: ::c_int, ++ path: *const ::c_char, ++ ) -> ::c_int; + } + + #[link(name = "util")] +-extern { ++extern "C" { + 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: ::Option ::c_int>, +- pglob: *mut glob64_t) -> ::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: ::Option< ++ extern "C" 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; ++ 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; + pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int; +- pub fn setpriority(which: ::__priority_which_t, who: ::id_t, +- prio: ::c_int) -> ::c_int; +- pub fn pthread_getaffinity_np(thread: ::pthread_t, +- cpusetsize: ::size_t, +- cpuset: *mut ::cpu_set_t) -> ::c_int; +- pub fn pthread_setaffinity_np(thread: ::pthread_t, +- cpusetsize: ::size_t, +- cpuset: *const ::cpu_set_t) -> ::c_int; +- pub fn pthread_rwlockattr_getkind_np(attr: *const ::pthread_rwlockattr_t, +- val: *mut ::c_int) -> ::c_int; +- pub fn pthread_rwlockattr_setkind_np(attr: *mut ::pthread_rwlockattr_t, +- val: ::c_int) -> ::c_int; ++ pub fn setpriority( ++ which: ::__priority_which_t, ++ who: ::id_t, ++ prio: ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_getaffinity_np( ++ thread: ::pthread_t, ++ cpusetsize: ::size_t, ++ cpuset: *mut ::cpu_set_t, ++ ) -> ::c_int; ++ pub fn pthread_setaffinity_np( ++ thread: ::pthread_t, ++ cpusetsize: ::size_t, ++ cpuset: *const ::cpu_set_t, ++ ) -> ::c_int; ++ pub fn pthread_rwlockattr_getkind_np( ++ attr: *const ::pthread_rwlockattr_t, ++ val: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_rwlockattr_setkind_np( ++ attr: *mut ::pthread_rwlockattr_t, ++ val: ::c_int, ++ ) -> ::c_int; + pub fn sched_getcpu() -> ::c_int; + pub fn mallinfo() -> ::mallinfo; + pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t; +- pub fn getauxval(type_: ::c_ulong) -> ::c_ulong; +- #[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwent_r")] +- pub fn getpwent_r(pwd: *mut ::passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::passwd) -> ::c_int; +- #[cfg_attr(target_os = "netbsd", link_name = "__getgrent_r50")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrent_r")] +- pub fn getgrent_r(grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; ++ pub fn getpwent_r( ++ pwd: *mut ::passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::passwd, ++ ) -> ::c_int; ++ pub fn getgrent_r( ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; ++ pub fn pthread_getname_np( ++ thread: ::pthread_t, ++ name: *mut ::c_char, ++ len: ::size_t, ++ ) -> ::c_int; ++ pub fn pthread_setname_np( ++ thread: ::pthread_t, ++ name: *const ::c_char, ++ ) -> ::c_int; ++} ++ ++#[link(name = "dl")] ++extern "C" { ++ pub fn dlmopen( ++ lmid: Lmid_t, ++ filename: *const ::c_char, ++ flag: ::c_int, ++ ) -> *mut ::c_void; ++ pub fn dlinfo( ++ handle: *mut ::c_void, ++ request: ::c_int, ++ info: *mut ::c_void, ++ ) -> ::c_int; + } + + cfg_if! { + if #[cfg(any(target_arch = "x86", + target_arch = "arm", + target_arch = "mips", +- target_arch = "powerpc"))] { ++ target_arch = "powerpc", ++ target_arch = "sparc"))] { + mod b32; + pub use self::b32::*; + } else if #[cfg(any(target_arch = "x86_64", +@@ -1025,7 +1397,8 @@ cfg_if! { + target_arch = "powerpc64", + target_arch = "mips64", + target_arch = "s390x", +- target_arch = "sparc64"))] { ++ target_arch = "sparc64", ++ target_arch = "riscv64"))] { + mod b64; + pub use self::b64::*; + } else { +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/mod.rs b/third_party/rust/libc/src/unix/linux_like/linux/mod.rs +index 80053958715b9cb4a7995f80abca2709ff284466..dc6512df1fe8dc6407eb8a1005103430fbbdd20c 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/mod.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/mod.rs +@@ -37,10 +37,12 @@ pub type Elf32_Section = u16; + pub type Elf64_Section = u16; + + #[cfg_attr(feature = "extra_traits", derive(Debug))] +-pub enum fpos64_t {} // TODO: fill this out with a struct ++pub enum fpos64_t {} // FIXME: fill this out with a struct + impl ::Copy for fpos64_t {} + impl ::Clone for fpos64_t { +- fn clone(&self) -> fpos64_t { *self } ++ fn clone(&self) -> fpos64_t { ++ *self ++ } + } + + s! { +@@ -475,6 +477,11 @@ s! { + pub len: u32 + } + ++ pub struct fanotify_response { ++ pub fd: ::c_int, ++ pub response: __u32, ++ } ++ + pub struct sockaddr_vm { + pub svm_family: ::sa_family_t, + pub svm_reserved1: ::c_ushort, +@@ -482,9 +489,24 @@ s! { + pub svm_cid: ::c_uint, + pub svm_zero: [u8; 4] + } ++ ++ pub struct regmatch_t { ++ pub rm_so: regoff_t, ++ pub rm_eo: regoff_t, ++ } ++ ++ pub struct sock_extended_err { ++ pub ee_errno: u32, ++ pub ee_origin: u8, ++ pub ee_type: u8, ++ pub ee_code: u8, ++ pub ee_pad: u8, ++ pub ee_info: u32, ++ pub ee_data: u32, ++ } + } + +-s_no_extra_traits!{ ++s_no_extra_traits! { + pub struct sockaddr_nl { + pub nl_family: ::sa_family_t, + nl_pad: ::c_ushort, +@@ -1125,6 +1147,45 @@ pub const IFLA_MTU: ::c_ushort = 4; + pub const IFLA_LINK: ::c_ushort = 5; + pub const IFLA_QDISC: ::c_ushort = 6; + pub const IFLA_STATS: ::c_ushort = 7; ++pub const IFLA_COST: ::c_ushort = 8; ++pub const IFLA_PRIORITY: ::c_ushort = 9; ++pub const IFLA_MASTER: ::c_ushort = 10; ++pub const IFLA_WIRELESS: ::c_ushort = 11; ++pub const IFLA_PROTINFO: ::c_ushort = 12; ++pub const IFLA_TXQLEN: ::c_ushort = 13; ++pub const IFLA_MAP: ::c_ushort = 14; ++pub const IFLA_WEIGHT: ::c_ushort = 15; ++pub const IFLA_OPERSTATE: ::c_ushort = 16; ++pub const IFLA_LINKMODE: ::c_ushort = 17; ++pub const IFLA_LINKINFO: ::c_ushort = 18; ++pub const IFLA_NET_NS_PID: ::c_ushort = 19; ++pub const IFLA_IFALIAS: ::c_ushort = 20; ++pub const IFLA_NUM_VF: ::c_ushort = 21; ++pub const IFLA_VFINFO_LIST: ::c_ushort = 22; ++pub const IFLA_STATS64: ::c_ushort = 23; ++pub const IFLA_VF_PORTS: ::c_ushort = 24; ++pub const IFLA_PORT_SELF: ::c_ushort = 25; ++pub const IFLA_AF_SPEC: ::c_ushort = 26; ++pub const IFLA_GROUP: ::c_ushort = 27; ++pub const IFLA_NET_NS_FD: ::c_ushort = 28; ++pub const IFLA_EXT_MASK: ::c_ushort = 29; ++pub const IFLA_PROMISCUITY: ::c_ushort = 30; ++pub const IFLA_NUM_TX_QUEUES: ::c_ushort = 31; ++pub const IFLA_NUM_RX_QUEUES: ::c_ushort = 32; ++pub const IFLA_CARRIER: ::c_ushort = 33; ++pub const IFLA_PHYS_PORT_ID: ::c_ushort = 34; ++pub const IFLA_CARRIER_CHANGES: ::c_ushort = 35; ++pub const IFLA_PHYS_SWITCH_ID: ::c_ushort = 36; ++pub const IFLA_LINK_NETNSID: ::c_ushort = 37; ++pub const IFLA_PHYS_PORT_NAME: ::c_ushort = 38; ++pub const IFLA_PROTO_DOWN: ::c_ushort = 39; ++ ++pub const IFLA_INFO_UNSPEC: ::c_ushort = 0; ++pub const IFLA_INFO_KIND: ::c_ushort = 1; ++pub const IFLA_INFO_DATA: ::c_ushort = 2; ++pub const IFLA_INFO_XSTATS: ::c_ushort = 3; ++pub const IFLA_INFO_SLAVE_KIND: ::c_ushort = 4; ++pub const IFLA_INFO_SLAVE_DATA: ::c_ushort = 5; + + // linux/if_tun.h + pub const IFF_TUN: ::c_int = 0x0001; +@@ -1133,18 +1194,18 @@ pub const IFF_NO_PI: ::c_int = 0x1000; + // Read queue size + pub const TUN_READQ_SIZE: ::c_short = 500; + // TUN device type flags: deprecated. Use IFF_TUN/IFF_TAP instead. +-pub const TUN_TUN_DEV: ::c_short = ::IFF_TUN as ::c_short; +-pub const TUN_TAP_DEV: ::c_short = ::IFF_TAP as ::c_short; ++pub const TUN_TUN_DEV: ::c_short = ::IFF_TUN as ::c_short; ++pub const TUN_TAP_DEV: ::c_short = ::IFF_TAP as ::c_short; + pub const TUN_TYPE_MASK: ::c_short = 0x000f; + // This flag has no real effect +-pub const IFF_ONE_QUEUE: ::c_int = 0x2000; +-pub const IFF_VNET_HDR: ::c_int = 0x4000; +-pub const IFF_TUN_EXCL: ::c_int = 0x8000; +-pub const IFF_MULTI_QUEUE: ::c_int = 0x0100; ++pub const IFF_ONE_QUEUE: ::c_int = 0x2000; ++pub const IFF_VNET_HDR: ::c_int = 0x4000; ++pub const IFF_TUN_EXCL: ::c_int = 0x8000; ++pub const IFF_MULTI_QUEUE: ::c_int = 0x0100; + pub const IFF_ATTACH_QUEUE: ::c_int = 0x0200; + pub const IFF_DETACH_QUEUE: ::c_int = 0x0400; + // read-only flag +-pub const IFF_PERSIST: ::c_int = 0x0800; ++pub const IFF_PERSIST: ::c_int = 0x0800; + pub const IFF_NOFILTER: ::c_int = 0x1000; + + pub const ST_RDONLY: ::c_ulong = 1; +@@ -1164,6 +1225,8 @@ pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void; + pub const RTLD_NODELETE: ::c_int = 0x1000; + pub const RTLD_NOW: ::c_int = 0x2; + ++pub const AT_EACCESS: ::c_int = 0x200; ++ + pub const TCP_MD5SIG: ::c_int = 14; + + align_const! { +@@ -1195,6 +1258,8 @@ pub const SCHED_RR: ::c_int = 2; + pub const SCHED_BATCH: ::c_int = 3; + pub const SCHED_IDLE: ::c_int = 5; + ++pub const SCHED_RESET_ON_FORK: ::c_int = 0x40000000; ++ + // netinet/in.h + // NOTE: These are in addition to the constants defined in src/unix/mod.rs + +@@ -1253,6 +1318,17 @@ pub const IPPROTO_MPLS: ::c_int = 137; + pub const IPPROTO_RAW: ::c_int = 255; + pub const IPPROTO_MAX: ::c_int = 256; + ++pub const IP_MSFILTER: ::c_int = 41; ++pub const MCAST_JOIN_GROUP: ::c_int = 42; ++pub const MCAST_BLOCK_SOURCE: ::c_int = 43; ++pub const MCAST_UNBLOCK_SOURCE: ::c_int = 44; ++pub const MCAST_LEAVE_GROUP: ::c_int = 45; ++pub const MCAST_JOIN_SOURCE_GROUP: ::c_int = 46; ++pub const MCAST_LEAVE_SOURCE_GROUP: ::c_int = 47; ++pub const MCAST_MSFILTER: ::c_int = 48; ++pub const IP_MULTICAST_ALL: ::c_int = 49; ++pub const IP_UNICAST_IF: ::c_int = 50; ++ + pub const AF_IB: ::c_int = 27; + pub const AF_MPLS: ::c_int = 28; + pub const AF_NFC: ::c_int = 39; +@@ -1515,15 +1591,16 @@ pub const FALLOC_FL_UNSHARE_RANGE: ::c_int = 0x40; + pub const ENOATTR: ::c_int = ::ENODATA; + + pub const SO_ORIGINAL_DST: ::c_int = 80; +-pub const IP_ORIGDSTADDR : ::c_int = 20; +-pub const IP_RECVORIGDSTADDR : ::c_int = IP_ORIGDSTADDR; +-pub const IPV6_ORIGDSTADDR : ::c_int = 74; +-pub const IPV6_RECVORIGDSTADDR : ::c_int = IPV6_ORIGDSTADDR; ++pub const IP_ORIGDSTADDR: ::c_int = 20; ++pub const IP_RECVORIGDSTADDR: ::c_int = IP_ORIGDSTADDR; + pub const IPV6_FLOWINFO: ::c_int = 11; ++pub const IPV6_ORIGDSTADDR: ::c_int = 74; ++pub const IPV6_RECVORIGDSTADDR: ::c_int = IPV6_ORIGDSTADDR; + pub const IPV6_FLOWLABEL_MGR: ::c_int = 32; + pub const IPV6_FLOWINFO_SEND: ::c_int = 33; + pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 0x000fffff; + pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 0x0ff00000; ++ + pub const IUTF8: ::tcflag_t = 0x00004000; + pub const CMSPAR: ::tcflag_t = 0o10000000000; + +@@ -1653,6 +1730,149 @@ pub const NLMSG_DONE: ::c_int = 0x3; + pub const NLMSG_OVERRUN: ::c_int = 0x4; + pub const NLMSG_MIN_TYPE: ::c_int = 0x10; + ++// linux/netfilter/nfnetlink.h ++pub const NFNLGRP_NONE: ::c_int = 0; ++pub const NFNLGRP_CONNTRACK_NEW: ::c_int = 1; ++pub const NFNLGRP_CONNTRACK_UPDATE: ::c_int = 2; ++pub const NFNLGRP_CONNTRACK_DESTROY: ::c_int = 3; ++pub const NFNLGRP_CONNTRACK_EXP_NEW: ::c_int = 4; ++pub const NFNLGRP_CONNTRACK_EXP_UPDATE: ::c_int = 5; ++pub const NFNLGRP_CONNTRACK_EXP_DESTROY: ::c_int = 6; ++pub const NFNLGRP_NFTABLES: ::c_int = 7; ++pub const NFNLGRP_ACCT_QUOTA: ::c_int = 8; ++ ++pub const NFNETLINK_V0: ::c_int = 0; ++ ++pub const NFNL_SUBSYS_NONE: ::c_int = 0; ++pub const NFNL_SUBSYS_CTNETLINK: ::c_int = 1; ++pub const NFNL_SUBSYS_CTNETLINK_EXP: ::c_int = 2; ++pub const NFNL_SUBSYS_QUEUE: ::c_int = 3; ++pub const NFNL_SUBSYS_ULOG: ::c_int = 4; ++pub const NFNL_SUBSYS_OSF: ::c_int = 5; ++pub const NFNL_SUBSYS_IPSET: ::c_int = 6; ++pub const NFNL_SUBSYS_ACCT: ::c_int = 7; ++pub const NFNL_SUBSYS_CTNETLINK_TIMEOUT: ::c_int = 8; ++pub const NFNL_SUBSYS_CTHELPER: ::c_int = 9; ++pub const NFNL_SUBSYS_NFTABLES: ::c_int = 10; ++pub const NFNL_SUBSYS_NFT_COMPAT: ::c_int = 11; ++pub const NFNL_SUBSYS_COUNT: ::c_int = 12; ++ ++pub const NFNL_MSG_BATCH_BEGIN: ::c_int = NLMSG_MIN_TYPE; ++pub const NFNL_MSG_BATCH_END: ::c_int = NLMSG_MIN_TYPE + 1; ++ ++// linux/netfilter/nfnetlink_log.h ++pub const NFULNL_MSG_PACKET: ::c_int = 0; ++pub const NFULNL_MSG_CONFIG: ::c_int = 1; ++ ++pub const NFULA_UNSPEC: ::c_int = 0; ++pub const NFULA_PACKET_HDR: ::c_int = 1; ++pub const NFULA_MARK: ::c_int = 2; ++pub const NFULA_TIMESTAMP: ::c_int = 3; ++pub const NFULA_IFINDEX_INDEV: ::c_int = 4; ++pub const NFULA_IFINDEX_OUTDEV: ::c_int = 5; ++pub const NFULA_IFINDEX_PHYSINDEV: ::c_int = 6; ++pub const NFULA_IFINDEX_PHYSOUTDEV: ::c_int = 7; ++pub const NFULA_HWADDR: ::c_int = 8; ++pub const NFULA_PAYLOAD: ::c_int = 9; ++pub const NFULA_PREFIX: ::c_int = 10; ++pub const NFULA_UID: ::c_int = 11; ++pub const NFULA_SEQ: ::c_int = 12; ++pub const NFULA_SEQ_GLOBAL: ::c_int = 13; ++pub const NFULA_GID: ::c_int = 14; ++pub const NFULA_HWTYPE: ::c_int = 15; ++pub const NFULA_HWHEADER: ::c_int = 16; ++pub const NFULA_HWLEN: ::c_int = 17; ++pub const NFULA_CT: ::c_int = 18; ++pub const NFULA_CT_INFO: ::c_int = 19; ++ ++pub const NFULNL_CFG_CMD_NONE: ::c_int = 0; ++pub const NFULNL_CFG_CMD_BIND: ::c_int = 1; ++pub const NFULNL_CFG_CMD_UNBIND: ::c_int = 2; ++pub const NFULNL_CFG_CMD_PF_BIND: ::c_int = 3; ++pub const NFULNL_CFG_CMD_PF_UNBIND: ::c_int = 4; ++ ++pub const NFULA_CFG_UNSPEC: ::c_int = 0; ++pub const NFULA_CFG_CMD: ::c_int = 1; ++pub const NFULA_CFG_MODE: ::c_int = 2; ++pub const NFULA_CFG_NLBUFSIZ: ::c_int = 3; ++pub const NFULA_CFG_TIMEOUT: ::c_int = 4; ++pub const NFULA_CFG_QTHRESH: ::c_int = 5; ++pub const NFULA_CFG_FLAGS: ::c_int = 6; ++ ++pub const NFULNL_COPY_NONE: ::c_int = 0x00; ++pub const NFULNL_COPY_META: ::c_int = 0x01; ++pub const NFULNL_COPY_PACKET: ::c_int = 0x02; ++ ++pub const NFULNL_CFG_F_SEQ: ::c_int = 0x0001; ++pub const NFULNL_CFG_F_SEQ_GLOBAL: ::c_int = 0x0002; ++pub const NFULNL_CFG_F_CONNTRACK: ::c_int = 0x0004; ++ ++// linux/netfilter/nfnetlink_log.h ++pub const NFQNL_MSG_PACKET: ::c_int = 0; ++pub const NFQNL_MSG_VERDICT: ::c_int = 1; ++pub const NFQNL_MSG_CONFIG: ::c_int = 2; ++pub const NFQNL_MSG_VERDICT_BATCH: ::c_int = 3; ++ ++pub const NFQA_UNSPEC: ::c_int = 0; ++pub const NFQA_PACKET_HDR: ::c_int = 1; ++pub const NFQA_VERDICT_HDR: ::c_int = 2; ++pub const NFQA_MARK: ::c_int = 3; ++pub const NFQA_TIMESTAMP: ::c_int = 4; ++pub const NFQA_IFINDEX_INDEV: ::c_int = 5; ++pub const NFQA_IFINDEX_OUTDEV: ::c_int = 6; ++pub const NFQA_IFINDEX_PHYSINDEV: ::c_int = 7; ++pub const NFQA_IFINDEX_PHYSOUTDEV: ::c_int = 8; ++pub const NFQA_HWADDR: ::c_int = 9; ++pub const NFQA_PAYLOAD: ::c_int = 10; ++pub const NFQA_CT: ::c_int = 11; ++pub const NFQA_CT_INFO: ::c_int = 12; ++pub const NFQA_CAP_LEN: ::c_int = 13; ++pub const NFQA_SKB_INFO: ::c_int = 14; ++pub const NFQA_EXP: ::c_int = 15; ++pub const NFQA_UID: ::c_int = 16; ++pub const NFQA_GID: ::c_int = 17; ++pub const NFQA_SECCTX: ::c_int = 18; ++/* ++ FIXME: These are not yet available in musl sanitized kernel headers and ++ make the tests fail. Enable them once musl has them. ++ ++ See https://github.com/rust-lang/libc/pull/1628 for more details. ++pub const NFQA_VLAN: ::c_int = 19; ++pub const NFQA_L2HDR: ::c_int = 20; ++ ++pub const NFQA_VLAN_UNSPEC: ::c_int = 0; ++pub const NFQA_VLAN_PROTO: ::c_int = 1; ++pub const NFQA_VLAN_TCI: ::c_int = 2; ++*/ ++ ++pub const NFQNL_CFG_CMD_NONE: ::c_int = 0; ++pub const NFQNL_CFG_CMD_BIND: ::c_int = 1; ++pub const NFQNL_CFG_CMD_UNBIND: ::c_int = 2; ++pub const NFQNL_CFG_CMD_PF_BIND: ::c_int = 3; ++pub const NFQNL_CFG_CMD_PF_UNBIND: ::c_int = 4; ++ ++pub const NFQNL_COPY_NONE: ::c_int = 0; ++pub const NFQNL_COPY_META: ::c_int = 1; ++pub const NFQNL_COPY_PACKET: ::c_int = 2; ++ ++pub const NFQA_CFG_UNSPEC: ::c_int = 0; ++pub const NFQA_CFG_CMD: ::c_int = 1; ++pub const NFQA_CFG_PARAMS: ::c_int = 2; ++pub const NFQA_CFG_QUEUE_MAXLEN: ::c_int = 3; ++pub const NFQA_CFG_MASK: ::c_int = 4; ++pub const NFQA_CFG_FLAGS: ::c_int = 5; ++ ++pub const NFQA_CFG_F_FAIL_OPEN: ::c_int = 0x0001; ++pub const NFQA_CFG_F_CONNTRACK: ::c_int = 0x0002; ++pub const NFQA_CFG_F_GSO: ::c_int = 0x0004; ++pub const NFQA_CFG_F_UID_GID: ::c_int = 0x0008; ++pub const NFQA_CFG_F_SECCTX: ::c_int = 0x0010; ++pub const NFQA_CFG_F_MAX: ::c_int = 0x0020; ++ ++pub const NFQA_SKB_CSUMNOTREADY: ::c_int = 0x0001; ++pub const NFQA_SKB_GSO: ::c_int = 0x0002; ++pub const NFQA_SKB_CSUM_NOTVERIFIED: ::c_int = 0x0004; ++ + pub const GENL_NAMSIZ: ::c_int = 16; + + pub const GENL_MIN_ID: ::c_int = NLMSG_MIN_TYPE; +@@ -1704,11 +1924,11 @@ pub const PACKET_MR_UNICAST: ::c_int = 3; + + // linux/netfilter.h + pub const NF_DROP: ::c_int = 0; +-pub const NF_ACCEPT: ::c_int = 1; +-pub const NF_STOLEN: ::c_int = 2; +-pub const NF_QUEUE: ::c_int = 3; +-pub const NF_REPEAT: ::c_int = 4; +-pub const NF_STOP: ::c_int = 5; ++pub const NF_ACCEPT: ::c_int = 1; ++pub const NF_STOLEN: ::c_int = 2; ++pub const NF_QUEUE: ::c_int = 3; ++pub const NF_REPEAT: ::c_int = 4; ++pub const NF_STOP: ::c_int = 5; + pub const NF_MAX_VERDICT: ::c_int = NF_STOP; + + pub const NF_VERDICT_MASK: ::c_int = 0x000000ff; +@@ -1780,6 +2000,9 @@ pub const NF_IP6_PRI_SELINUX_LAST: ::c_int = 225; + pub const NF_IP6_PRI_CONNTRACK_HELPER: ::c_int = 300; + pub const NF_IP6_PRI_LAST: ::c_int = ::INT_MAX; + ++// linux/netfilter_ipv6/ip6_tables.h ++pub const IP6T_SO_ORIGINAL_DST: ::c_int = 80; ++ + pub const SIOCADDRT: ::c_ulong = 0x0000890B; + pub const SIOCDELRT: ::c_ulong = 0x0000890C; + pub const SIOCGIFNAME: ::c_ulong = 0x00008910; +@@ -1818,6 +2041,8 @@ pub const SIOCSRARP: ::c_ulong = 0x00008962; + pub const SIOCGIFMAP: ::c_ulong = 0x00008970; + pub const SIOCSIFMAP: ::c_ulong = 0x00008971; + ++pub const PTRACE_EVENT_STOP: ::c_int = 128; ++ + pub const IPTOS_TOS_MASK: u8 = 0x1E; + pub const IPTOS_PREC_MASK: u8 = 0xE0; + +@@ -1897,6 +2122,64 @@ pub const NDA_PORT: ::c_ushort = 6; + pub const NDA_VNI: ::c_ushort = 7; + pub const NDA_IFINDEX: ::c_ushort = 8; + ++// linux/netlink.h ++pub const NLA_ALIGNTO: ::c_int = 4; ++ ++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 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 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); ++ + // linux/rtnetlink.h + pub const TCA_UNSPEC: ::c_ushort = 0; + pub const TCA_KIND: ::c_ushort = 1; +@@ -2057,50 +2340,167 @@ pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5; + pub const ALG_OP_DECRYPT: ::c_int = 0; + pub const ALG_OP_ENCRYPT: ::c_int = 1; + ++// include/uapi/linux/udp.h ++pub const UDP_CORK: ::c_int = 1; ++pub const UDP_ENCAP: ::c_int = 100; ++pub const UDP_NO_CHECK6_TX: ::c_int = 101; ++pub const UDP_NO_CHECK6_RX: ::c_int = 102; ++pub const UDP_SEGMENT: ::c_int = 103; ++pub const UDP_GRO: ::c_int = 104; ++ ++// include/uapi/linux/mman.h ++pub const MAP_SHARED_VALIDATE: ::c_int = 0x3; ++ ++// include/uapi/asm-generic/mman-common.h ++pub const MAP_FIXED_NOREPLACE: ::c_int = 0x100000; ++ + // uapi/linux/vm_sockets.h + pub const VMADDR_CID_ANY: ::c_uint = 0xFFFFFFFF; + pub const VMADDR_CID_HYPERVISOR: ::c_uint = 0; ++#[deprecated( ++ since = "0.2.74", ++ note = "VMADDR_CID_RESERVED is removed since Linux v5.6 and \ ++ replaced with VMADDR_CID_LOCAL" ++)] + pub const VMADDR_CID_RESERVED: ::c_uint = 1; ++pub const VMADDR_CID_LOCAL: ::c_uint = 1; + pub const VMADDR_CID_HOST: ::c_uint = 2; + pub const VMADDR_PORT_ANY: ::c_uint = 0xFFFFFFFF; + + // uapi/linux/inotify.h +-pub const IN_ACCESS: u32 = 0x0000_0001; +-pub const IN_MODIFY: u32 = 0x0000_0002; +-pub const IN_ATTRIB: u32 = 0x0000_0004; +-pub const IN_CLOSE_WRITE: u32 = 0x0000_0008; ++pub const IN_ACCESS: u32 = 0x0000_0001; ++pub const IN_MODIFY: u32 = 0x0000_0002; ++pub const IN_ATTRIB: u32 = 0x0000_0004; ++pub const IN_CLOSE_WRITE: u32 = 0x0000_0008; + pub const IN_CLOSE_NOWRITE: u32 = 0x0000_0010; +-pub const IN_CLOSE: u32 = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE); +-pub const IN_OPEN: u32 = 0x0000_0020; +-pub const IN_MOVED_FROM: u32 = 0x0000_0040; +-pub const IN_MOVED_TO: u32 = 0x0000_0080; +-pub const IN_MOVE: u32 = (IN_MOVED_FROM | IN_MOVED_TO); +-pub const IN_CREATE: u32 = 0x0000_0100; +-pub const IN_DELETE: u32 = 0x0000_0200; +-pub const IN_DELETE_SELF: u32 = 0x0000_0400; +-pub const IN_MOVE_SELF: u32 = 0x0000_0800; +-pub const IN_UNMOUNT: u32 = 0x0000_2000; +-pub const IN_Q_OVERFLOW: u32 = 0x0000_4000; +-pub const IN_IGNORED: u32 = 0x0000_8000; +-pub const IN_ONLYDIR: u32 = 0x0100_0000; +-pub const IN_DONT_FOLLOW: u32 = 0x0200_0000; ++pub const IN_CLOSE: u32 = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE; ++pub const IN_OPEN: u32 = 0x0000_0020; ++pub const IN_MOVED_FROM: u32 = 0x0000_0040; ++pub const IN_MOVED_TO: u32 = 0x0000_0080; ++pub const IN_MOVE: u32 = IN_MOVED_FROM | IN_MOVED_TO; ++pub const IN_CREATE: u32 = 0x0000_0100; ++pub const IN_DELETE: u32 = 0x0000_0200; ++pub const IN_DELETE_SELF: u32 = 0x0000_0400; ++pub const IN_MOVE_SELF: u32 = 0x0000_0800; ++pub const IN_UNMOUNT: u32 = 0x0000_2000; ++pub const IN_Q_OVERFLOW: u32 = 0x0000_4000; ++pub const IN_IGNORED: u32 = 0x0000_8000; ++pub const IN_ONLYDIR: u32 = 0x0100_0000; ++pub const IN_DONT_FOLLOW: u32 = 0x0200_0000; + // pub const IN_EXCL_UNLINK: u32 = 0x0400_0000; + ++// linux/keyctl.h ++pub const KEY_SPEC_THREAD_KEYRING: i32 = -1; ++pub const KEY_SPEC_PROCESS_KEYRING: i32 = -2; ++pub const KEY_SPEC_SESSION_KEYRING: i32 = -3; ++pub const KEY_SPEC_USER_KEYRING: i32 = -4; ++pub const KEY_SPEC_USER_SESSION_KEYRING: i32 = -5; ++pub const KEY_SPEC_GROUP_KEYRING: i32 = -6; ++pub const KEY_SPEC_REQKEY_AUTH_KEY: i32 = -7; ++pub const KEY_SPEC_REQUESTOR_KEYRING: i32 = -8; ++ ++pub const KEY_REQKEY_DEFL_NO_CHANGE: i32 = -1; ++pub const KEY_REQKEY_DEFL_DEFAULT: i32 = 0; ++pub const KEY_REQKEY_DEFL_THREAD_KEYRING: i32 = 1; ++pub const KEY_REQKEY_DEFL_PROCESS_KEYRING: i32 = 2; ++pub const KEY_REQKEY_DEFL_SESSION_KEYRING: i32 = 3; ++pub const KEY_REQKEY_DEFL_USER_KEYRING: i32 = 4; ++pub const KEY_REQKEY_DEFL_USER_SESSION_KEYRING: i32 = 5; ++pub const KEY_REQKEY_DEFL_GROUP_KEYRING: i32 = 6; ++pub const KEY_REQKEY_DEFL_REQUESTOR_KEYRING: i32 = 7; ++ ++pub const KEYCTL_GET_KEYRING_ID: u32 = 0; ++pub const KEYCTL_JOIN_SESSION_KEYRING: u32 = 1; ++pub const KEYCTL_UPDATE: u32 = 2; ++pub const KEYCTL_REVOKE: u32 = 3; ++pub const KEYCTL_CHOWN: u32 = 4; ++pub const KEYCTL_SETPERM: u32 = 5; ++pub const KEYCTL_DESCRIBE: u32 = 6; ++pub const KEYCTL_CLEAR: u32 = 7; ++pub const KEYCTL_LINK: u32 = 8; ++pub const KEYCTL_UNLINK: u32 = 9; ++pub const KEYCTL_SEARCH: u32 = 10; ++pub const KEYCTL_READ: u32 = 11; ++pub const KEYCTL_INSTANTIATE: u32 = 12; ++pub const KEYCTL_NEGATE: u32 = 13; ++pub const KEYCTL_SET_REQKEY_KEYRING: u32 = 14; ++pub const KEYCTL_SET_TIMEOUT: u32 = 15; ++pub const KEYCTL_ASSUME_AUTHORITY: u32 = 16; ++pub const KEYCTL_GET_SECURITY: u32 = 17; ++pub const KEYCTL_SESSION_TO_PARENT: u32 = 18; ++pub const KEYCTL_REJECT: u32 = 19; ++pub const KEYCTL_INSTANTIATE_IOV: u32 = 20; ++pub const KEYCTL_INVALIDATE: u32 = 21; ++pub const KEYCTL_GET_PERSISTENT: u32 = 22; ++ + // pub const IN_MASK_CREATE: u32 = 0x1000_0000; + // pub const IN_MASK_ADD: u32 = 0x2000_0000; +-pub const IN_ISDIR: u32 = 0x4000_0000; +-pub const IN_ONESHOT: u32 = 0x8000_0000; +- +-pub const IN_ALL_EVENTS: u32 = ( +- IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | +- IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | +- IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | +- IN_MOVE_SELF +-); ++pub const IN_ISDIR: u32 = 0x4000_0000; ++pub const IN_ONESHOT: u32 = 0x8000_0000; ++ ++pub const IN_ALL_EVENTS: u32 = IN_ACCESS ++ | IN_MODIFY ++ | IN_ATTRIB ++ | IN_CLOSE_WRITE ++ | IN_CLOSE_NOWRITE ++ | IN_OPEN ++ | IN_MOVED_FROM ++ | IN_MOVED_TO ++ | IN_DELETE ++ | IN_CREATE ++ | IN_DELETE_SELF ++ | IN_MOVE_SELF; + + pub const IN_CLOEXEC: ::c_int = O_CLOEXEC; + pub const IN_NONBLOCK: ::c_int = O_NONBLOCK; + ++// uapi/linux/fanotify.h ++pub const FAN_ACCESS: u64 = 0x0000_0001; ++pub const FAN_MODIFY: u64 = 0x0000_0002; ++pub const FAN_CLOSE_WRITE: u64 = 0x0000_0008; ++pub const FAN_CLOSE_NOWRITE: u64 = 0x0000_0010; ++pub const FAN_OPEN: u64 = 0x0000_0020; ++ ++pub const FAN_Q_OVERFLOW: u64 = 0x0000_4000; ++ ++pub const FAN_OPEN_PERM: u64 = 0x0001_0000; ++pub const FAN_ACCESS_PERM: u64 = 0x0002_0000; ++ ++pub const FAN_ONDIR: u64 = 0x4000_0000; ++ ++pub const FAN_EVENT_ON_CHILD: u64 = 0x0800_0000; ++ ++pub const FAN_CLOSE: u64 = FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE; ++ ++pub const FAN_CLOEXEC: ::c_uint = 0x0000_0001; ++pub const FAN_NONBLOCK: ::c_uint = 0x0000_0002; ++ ++pub const FAN_CLASS_NOTIF: ::c_uint = 0x0000_0000; ++pub const FAN_CLASS_CONTENT: ::c_uint = 0x0000_0004; ++pub const FAN_CLASS_PRE_CONTENT: ::c_uint = 0x0000_0008; ++ ++pub const FAN_UNLIMITED_QUEUE: ::c_uint = 0x0000_0010; ++pub const FAN_UNLIMITED_MARKS: ::c_uint = 0x0000_0020; ++ ++pub const FAN_MARK_ADD: ::c_uint = 0x0000_0001; ++pub const FAN_MARK_REMOVE: ::c_uint = 0x0000_0002; ++pub const FAN_MARK_DONT_FOLLOW: ::c_uint = 0x0000_0004; ++pub const FAN_MARK_ONLYDIR: ::c_uint = 0x0000_0008; ++pub const FAN_MARK_INODE: ::c_uint = 0x0000_0000; ++pub const FAN_MARK_MOUNT: ::c_uint = 0x0000_0010; ++// NOTE: FAN_MARK_FILESYSTEM requires Linux Kernel >= 4.20.0 ++pub const FAN_MARK_FILESYSTEM: ::c_uint = 0x0000_0100; ++pub const FAN_MARK_IGNORED_MASK: ::c_uint = 0x0000_0020; ++pub const FAN_MARK_IGNORED_SURV_MODIFY: ::c_uint = 0x0000_0040; ++pub const FAN_MARK_FLUSH: ::c_uint = 0x0000_0080; ++ ++pub const FANOTIFY_METADATA_VERSION: u8 = 3; ++ ++pub const FAN_ALLOW: u32 = 0x01; ++pub const FAN_DENY: u32 = 0x02; ++ ++pub const FAN_NOFD: ::c_int = -1; ++ + pub const FUTEX_WAIT: ::c_int = 0; + pub const FUTEX_WAKE: ::c_int = 1; + pub const FUTEX_FD: ::c_int = 2; +@@ -2120,7 +2520,95 @@ pub const FUTEX_CLOCK_REALTIME: ::c_int = 256; + pub const FUTEX_CMD_MASK: ::c_int = + !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME); + ++// linux/reboot.h ++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 REG_EXTENDED: ::c_int = 1; ++pub const REG_ICASE: ::c_int = 2; ++pub const REG_NEWLINE: ::c_int = 4; ++pub const REG_NOSUB: ::c_int = 8; ++ ++pub const REG_NOTBOL: ::c_int = 1; ++pub const REG_NOTEOL: ::c_int = 2; ++ ++pub const REG_ENOSYS: ::c_int = -1; ++pub const REG_NOMATCH: ::c_int = 1; ++pub const REG_BADPAT: ::c_int = 2; ++pub const REG_ECOLLATE: ::c_int = 3; ++pub const REG_ECTYPE: ::c_int = 4; ++pub const REG_EESCAPE: ::c_int = 5; ++pub const REG_ESUBREG: ::c_int = 6; ++pub const REG_EBRACK: ::c_int = 7; ++pub const REG_EPAREN: ::c_int = 8; ++pub const REG_EBRACE: ::c_int = 9; ++pub const REG_BADBR: ::c_int = 10; ++pub const REG_ERANGE: ::c_int = 11; ++pub const REG_ESPACE: ::c_int = 12; ++pub const REG_BADRPT: ::c_int = 13; ++ ++// linux/errqueue.h ++pub const SO_EE_ORIGIN_NONE: u8 = 0; ++pub const SO_EE_ORIGIN_LOCAL: u8 = 1; ++pub const SO_EE_ORIGIN_ICMP: u8 = 2; ++pub const SO_EE_ORIGIN_ICMP6: u8 = 3; ++pub const SO_EE_ORIGIN_TXSTATUS: u8 = 4; ++pub const SO_EE_ORIGIN_TIMESTAMPING: u8 = SO_EE_ORIGIN_TXSTATUS; ++ ++// errno.h ++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 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 EWOULDBLOCK: ::c_int = EAGAIN; ++ + f! { ++ pub fn NLA_ALIGN(len: ::c_int) -> ::c_int { ++ return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1) ++ } ++ + pub fn CMSG_NXTHDR(mhdr: *const msghdr, + cmsg: *const cmsghdr) -> *mut cmsghdr { + if ((*cmsg).cmsg_len as usize) < ::mem::size_of::() { +@@ -2140,6 +2628,12 @@ f! { + } + } + ++ pub fn CPU_ALLOC_SIZE(count: ::c_int) -> ::size_t { ++ let _dummy: cpu_set_t = ::mem::zeroed(); ++ let size_in_bits = 8 * ::mem::size_of_val(&_dummy.bits[0]); ++ ((count as ::size_t + size_in_bits - 1) / 8) as ::size_t ++ } ++ + pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { + for slot in cpuset.bits.iter_mut() { + *slot = 0; +@@ -2168,6 +2662,19 @@ f! { + 0 != (cpuset.bits[idx] & (1 << offset)) + } + ++ pub fn CPU_COUNT_S(size: usize, cpuset: &cpu_set_t) -> ::c_int { ++ let mut s: u32 = 0; ++ let size_of_mask = ::mem::size_of_val(&cpuset.bits[0]); ++ for i in cpuset.bits[..(size / size_of_mask)].iter() { ++ s += i.count_ones(); ++ }; ++ s as ::c_int ++ } ++ ++ pub fn CPU_COUNT(cpuset: &cpu_set_t) -> ::c_int { ++ CPU_COUNT_S(::mem::size_of::(), cpuset) ++ } ++ + pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool { + set1.bits == set2.bits + } +@@ -2216,13 +2723,19 @@ f! { + pub fn RT_LOCALADDR(flags: u32) -> bool { + (flags & RTF_ADDRCLASSMASK) == (RTF_LOCAL | RTF_INTERFACE) + } ++ ++ pub fn SO_EE_OFFENDER(ee: *const ::sock_extended_err) -> *mut ::sockaddr { ++ ee.offset(1) as *mut ::sockaddr ++ } + } + +-extern { +- #[cfg_attr(not(target_env = "musl"), +- link_name = "__xpg_strerror_r")] +- pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, +- buflen: ::size_t) -> ::c_int; ++extern "C" { ++ #[cfg_attr(not(target_env = "musl"), link_name = "__xpg_strerror_r")] ++ pub fn strerror_r( ++ errnum: ::c_int, ++ buf: *mut c_char, ++ buflen: ::size_t, ++ ) -> ::c_int; + + pub fn abs(i: ::c_int) -> ::c_int; + pub fn atof(s: *const ::c_char) -> ::c_double; +@@ -2235,11 +2748,23 @@ extern { + 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_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 lio_listio( ++ mode: ::c_int, ++ aiocb_list: *const *mut aiocb, ++ nitems: ::c_int, ++ sevp: *mut ::sigevent, ++ ) -> ::c_int; ++ ++ pub fn clock_getcpuclockid( ++ pid: ::pid_t, ++ clk_id: *mut ::clockid_t, ++ ) -> ::c_int; + + pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; + +@@ -2253,208 +2778,370 @@ extern { + pub fn endspent(); + pub fn getspent() -> *mut spwd; + +- pub fn getspnam(__name: *const ::c_char) -> *mut spwd; ++ pub fn getspnam(name: *const ::c_char) -> *mut spwd; ++ // Only `getspnam_r` is implemented for musl, out of all of the reenterant ++ // functions from `shadow.h`. ++ // https://git.musl-libc.org/cgit/musl/tree/include/shadow.h ++ pub fn getspnam_r( ++ name: *const ::c_char, ++ spbuf: *mut spwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ spbufp: *mut *mut spwd, ++ ) -> ::c_int; + +- pub fn shm_open(name: *const c_char, oflag: ::c_int, +- mode: mode_t) -> ::c_int; ++ 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 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 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 semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int; +- pub fn semop(semid: ::c_int, +- sops: *mut ::sembuf, nsops: ::size_t) -> ::c_int; +- pub fn semctl(semid: ::c_int, +- semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int; +- pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int; ++ pub fn semop( ++ semid: ::c_int, ++ sops: *mut ::sembuf, ++ nsops: ::size_t, ++ ) -> ::c_int; ++ pub fn semctl( ++ semid: ::c_int, ++ semnum: ::c_int, ++ cmd: ::c_int, ++ ... ++ ) -> ::c_int; ++ 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 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 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; ++ 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; + pub fn tmpfile64() -> *mut ::FILE; + pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int; + pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int; +- pub fn fseeko64(stream: *mut ::FILE, +- offset: ::off64_t, +- whence: ::c_int) -> ::c_int; ++ pub fn fseeko64( ++ stream: *mut ::FILE, ++ offset: ::off64_t, ++ whence: ::c_int, ++ ) -> ::c_int; + pub fn ftello64(stream: *mut ::FILE) -> ::off64_t; +- pub fn fallocate(fd: ::c_int, mode: ::c_int, +- offset: ::off_t, len: ::off_t) -> ::c_int; +- pub fn fallocate64(fd: ::c_int, mode: ::c_int, +- offset: ::off64_t, len: ::off64_t) -> ::c_int; +- pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, +- len: ::off_t) -> ::c_int; +- pub fn posix_fallocate64(fd: ::c_int, offset: ::off64_t, +- len: ::off64_t) -> ::c_int; +- pub fn readahead(fd: ::c_int, offset: ::off64_t, +- count: ::size_t) -> ::ssize_t; +- pub fn getxattr(path: *const c_char, name: *const c_char, +- value: *mut ::c_void, size: ::size_t) -> ::ssize_t; +- pub fn lgetxattr(path: *const c_char, name: *const c_char, +- value: *mut ::c_void, size: ::size_t) -> ::ssize_t; +- pub fn fgetxattr(filedes: ::c_int, name: *const c_char, +- value: *mut ::c_void, size: ::size_t) -> ::ssize_t; +- pub fn setxattr(path: *const c_char, name: *const c_char, +- value: *const ::c_void, size: ::size_t, +- flags: ::c_int) -> ::c_int; +- pub fn lsetxattr(path: *const c_char, name: *const c_char, +- value: *const ::c_void, size: ::size_t, +- flags: ::c_int) -> ::c_int; +- pub fn fsetxattr(filedes: ::c_int, name: *const c_char, +- value: *const ::c_void, size: ::size_t, +- flags: ::c_int) -> ::c_int; +- pub fn listxattr(path: *const c_char, list: *mut c_char, +- size: ::size_t) -> ::ssize_t; +- pub fn llistxattr(path: *const c_char, list: *mut c_char, +- size: ::size_t) -> ::ssize_t; +- pub fn flistxattr(filedes: ::c_int, list: *mut c_char, +- size: ::size_t) -> ::ssize_t; ++ pub fn fallocate( ++ fd: ::c_int, ++ mode: ::c_int, ++ offset: ::off_t, ++ len: ::off_t, ++ ) -> ::c_int; ++ pub fn fallocate64( ++ fd: ::c_int, ++ mode: ::c_int, ++ offset: ::off64_t, ++ len: ::off64_t, ++ ) -> ::c_int; ++ pub fn posix_fallocate( ++ fd: ::c_int, ++ offset: ::off_t, ++ len: ::off_t, ++ ) -> ::c_int; ++ pub fn posix_fallocate64( ++ fd: ::c_int, ++ offset: ::off64_t, ++ len: ::off64_t, ++ ) -> ::c_int; ++ pub fn readahead( ++ fd: ::c_int, ++ offset: ::off64_t, ++ count: ::size_t, ++ ) -> ::ssize_t; ++ pub fn getxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *mut ::c_void, ++ size: ::size_t, ++ ) -> ::ssize_t; ++ pub fn lgetxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *mut ::c_void, ++ size: ::size_t, ++ ) -> ::ssize_t; ++ pub fn fgetxattr( ++ filedes: ::c_int, ++ name: *const c_char, ++ value: *mut ::c_void, ++ size: ::size_t, ++ ) -> ::ssize_t; ++ pub fn setxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *const ::c_void, ++ size: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn lsetxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *const ::c_void, ++ size: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn fsetxattr( ++ filedes: ::c_int, ++ name: *const c_char, ++ value: *const ::c_void, ++ size: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn listxattr( ++ path: *const c_char, ++ list: *mut c_char, ++ size: ::size_t, ++ ) -> ::ssize_t; ++ pub fn llistxattr( ++ path: *const c_char, ++ list: *mut c_char, ++ size: ::size_t, ++ ) -> ::ssize_t; ++ pub fn flistxattr( ++ filedes: ::c_int, ++ list: *mut c_char, ++ size: ::size_t, ++ ) -> ::ssize_t; + pub fn removexattr(path: *const c_char, name: *const c_char) -> ::c_int; + pub fn lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int; + pub fn fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int; +- pub fn signalfd(fd: ::c_int, +- mask: *const ::sigset_t, +- flags: ::c_int) -> ::c_int; ++ pub fn signalfd( ++ fd: ::c_int, ++ mask: *const ::sigset_t, ++ flags: ::c_int, ++ ) -> ::c_int; + pub fn timerfd_create(clockid: ::c_int, flags: ::c_int) -> ::c_int; +- pub fn timerfd_gettime(fd: ::c_int, +- curr_value: *mut itimerspec) -> ::c_int; +- pub fn timerfd_settime(fd: ::c_int, +- flags: ::c_int, +- new_value: *const itimerspec, +- old_value: *mut itimerspec) -> ::c_int; +- pub fn pwritev(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int, +- offset: ::off_t) -> ::ssize_t; +- pub fn preadv(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int, +- offset: ::off_t) -> ::ssize_t; +- pub fn quotactl(cmd: ::c_int, +- special: *const ::c_char, +- id: ::c_int, +- data: *mut ::c_char) -> ::c_int; ++ pub fn timerfd_gettime( ++ fd: ::c_int, ++ curr_value: *mut itimerspec, ++ ) -> ::c_int; ++ pub fn timerfd_settime( ++ fd: ::c_int, ++ flags: ::c_int, ++ new_value: *const itimerspec, ++ old_value: *mut itimerspec, ++ ) -> ::c_int; ++ pub fn pwritev( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ offset: ::off_t, ++ ) -> ::ssize_t; ++ pub fn preadv( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ offset: ::off_t, ++ ) -> ::ssize_t; ++ pub fn quotactl( ++ cmd: ::c_int, ++ special: *const ::c_char, ++ id: ::c_int, ++ data: *mut ::c_char, ++ ) -> ::c_int; + pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t; + pub fn mq_close(mqd: ::mqd_t) -> ::c_int; + pub fn mq_unlink(name: *const ::c_char) -> ::c_int; +- pub fn mq_receive(mqd: ::mqd_t, +- msg_ptr: *mut ::c_char, +- msg_len: ::size_t, +- msq_prio: *mut ::c_uint) -> ::ssize_t; +- pub fn mq_timedreceive(mqd: ::mqd_t, +- msg_ptr: *mut ::c_char, +- msg_len: ::size_t, +- msq_prio: *mut ::c_uint, +- abs_timeout: *const ::timespec) -> ::ssize_t; +- pub fn mq_send(mqd: ::mqd_t, +- msg_ptr: *const ::c_char, +- msg_len: ::size_t, +- msq_prio: ::c_uint) -> ::c_int; +- pub fn mq_timedsend(mqd: ::mqd_t, +- msg_ptr: *const ::c_char, +- msg_len: ::size_t, +- msq_prio: ::c_uint, +- abs_timeout: *const ::timespec) -> ::c_int; ++ pub fn mq_receive( ++ mqd: ::mqd_t, ++ msg_ptr: *mut ::c_char, ++ msg_len: ::size_t, ++ msg_prio: *mut ::c_uint, ++ ) -> ::ssize_t; ++ pub fn mq_timedreceive( ++ mqd: ::mqd_t, ++ msg_ptr: *mut ::c_char, ++ msg_len: ::size_t, ++ msg_prio: *mut ::c_uint, ++ abs_timeout: *const ::timespec, ++ ) -> ::ssize_t; ++ pub fn mq_send( ++ mqd: ::mqd_t, ++ msg_ptr: *const ::c_char, ++ msg_len: ::size_t, ++ msg_prio: ::c_uint, ++ ) -> ::c_int; ++ pub fn mq_timedsend( ++ mqd: ::mqd_t, ++ msg_ptr: *const ::c_char, ++ msg_len: ::size_t, ++ msg_prio: ::c_uint, ++ abs_timeout: *const ::timespec, ++ ) -> ::c_int; + pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int; +- pub fn mq_setattr(mqd: ::mqd_t, +- newattr: *const ::mq_attr, +- oldattr: *mut ::mq_attr) -> ::c_int; +- pub fn epoll_pwait(epfd: ::c_int, +- events: *mut ::epoll_event, +- maxevents: ::c_int, +- timeout: ::c_int, +- sigmask: *const ::sigset_t) -> ::c_int; ++ pub fn mq_setattr( ++ mqd: ::mqd_t, ++ newattr: *const ::mq_attr, ++ oldattr: *mut ::mq_attr, ++ ) -> ::c_int; ++ pub fn epoll_pwait( ++ epfd: ::c_int, ++ events: *mut ::epoll_event, ++ maxevents: ::c_int, ++ timeout: ::c_int, ++ sigmask: *const ::sigset_t, ++ ) -> ::c_int; + pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int; + 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 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 nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char; +- 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 pthread_setschedprio(native: ::pthread_t, +- priority: ::c_int) -> ::c_int; ++ pub fn mkostemps( ++ template: *mut ::c_char, ++ suffixlen: ::c_int, ++ flags: ::c_int, ++ ) -> ::c_int; ++ 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 nl_langinfo_l(item: ::nl_item, locale: ::locale_t) ++ -> *mut ::c_char; ++ 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 pthread_setschedprio( ++ native: ::pthread_t, ++ priority: ::c_int, ++ ) -> ::c_int; + pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int; +- pub fn process_vm_readv(pid: ::pid_t, +- local_iov: *const ::iovec, +- liovcnt: ::c_ulong, +- remote_iov: *const ::iovec, +- riovcnt: ::c_ulong, +- 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 process_vm_readv( ++ pid: ::pid_t, ++ local_iov: *const ::iovec, ++ liovcnt: ::c_ulong, ++ remote_iov: *const ::iovec, ++ riovcnt: ::c_ulong, ++ 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; + + // Not available now on Android +- pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, +- mode: ::mode_t) -> ::c_int; ++ 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 mremap(addr: *mut ::c_void, +- len: ::size_t, +- new_len: ::size_t, +- flags: ::c_int, +- ...) -> *mut ::c_void; +- +- pub fn glob(pattern: *const c_char, +- flags: ::c_int, +- errfunc: ::Option ::c_int>, +- pglob: *mut ::glob_t) -> ::c_int; ++ pub fn sync_file_range( ++ fd: ::c_int, ++ offset: ::off64_t, ++ nbytes: ::off64_t, ++ flags: ::c_uint, ++ ) -> ::c_int; ++ pub fn mremap( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ new_len: ::size_t, ++ flags: ::c_int, ++ ... ++ ) -> *mut ::c_void; ++ ++ pub fn glob( ++ pattern: *const c_char, ++ flags: ::c_int, ++ errfunc: ::Option< ++ extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int, ++ >, ++ pglob: *mut ::glob_t, ++ ) -> ::c_int; + pub fn globfree(pglob: *mut ::glob_t); + +- pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) +- -> ::c_int; ++ pub fn posix_madvise( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ advice: ::c_int, ++ ) -> ::c_int; + + pub fn shm_unlink(name: *const ::c_char) -> ::c_int; + + pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); + + pub fn telldir(dirp: *mut ::DIR) -> ::c_long; +- pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) +- -> ::c_int; +- +- pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int; +- pub fn remap_file_pages(addr: *mut ::c_void, size: ::size_t, prot: ::c_int, +- pgoff: ::size_t, flags: ::c_int) -> ::c_int; +- pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, +- flags: ::c_int, addr: *mut ::sockaddr, +- addrlen: *mut ::socklen_t) -> ::ssize_t; ++ pub fn madvise( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ advice: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn msync( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn remap_file_pages( ++ addr: *mut ::c_void, ++ size: ::size_t, ++ prot: ::c_int, ++ pgoff: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn recvfrom( ++ socket: ::c_int, ++ buf: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ addr: *mut ::sockaddr, ++ addrlen: *mut ::socklen_t, ++ ) -> ::ssize_t; + pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int; + pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int; + pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; +@@ -2464,215 +3151,294 @@ extern { + pub fn vhangup() -> ::c_int; + pub fn sync(); + pub fn syscall(num: ::c_long, ...) -> ::c_long; +- pub fn sched_getaffinity(pid: ::pid_t, +- cpusetsize: ::size_t, +- 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 sched_getaffinity( ++ pid: ::pid_t, ++ cpusetsize: ::size_t, ++ 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 epoll_create(size: ::c_int) -> ::c_int; + pub fn epoll_create1(flags: ::c_int) -> ::c_int; +- pub fn epoll_wait(epfd: ::c_int, +- events: *mut ::epoll_event, +- maxevents: ::c_int, +- timeout: ::c_int) -> ::c_int; +- pub fn epoll_ctl(epfd: ::c_int, +- op: ::c_int, +- fd: ::c_int, +- event: *mut ::epoll_event) -> ::c_int; +- pub fn pthread_getschedparam(native: ::pthread_t, +- policy: *mut ::c_int, +- param: *mut ::sched_param) -> ::c_int; ++ pub fn epoll_wait( ++ epfd: ::c_int, ++ events: *mut ::epoll_event, ++ maxevents: ::c_int, ++ timeout: ::c_int, ++ ) -> ::c_int; ++ pub fn epoll_ctl( ++ epfd: ::c_int, ++ op: ::c_int, ++ fd: ::c_int, ++ event: *mut ::epoll_event, ++ ) -> ::c_int; ++ pub fn pthread_getschedparam( ++ native: ::pthread_t, ++ policy: *mut ::c_int, ++ param: *mut ::sched_param, ++ ) -> ::c_int; + pub fn unshare(flags: ::c_int) -> ::c_int; + pub fn umount(target: *const ::c_char) -> ::c_int; + pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int; +- pub fn tee(fd_in: ::c_int, +- fd_out: ::c_int, +- len: ::size_t, +- flags: ::c_uint) -> ::ssize_t; +- pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int; +- pub fn splice(fd_in: ::c_int, +- off_in: *mut ::loff_t, +- fd_out: ::c_int, +- off_out: *mut ::loff_t, +- len: ::size_t, +- flags: ::c_uint) -> ::ssize_t; ++ pub fn tee( ++ fd_in: ::c_int, ++ fd_out: ::c_int, ++ len: ::size_t, ++ flags: ::c_uint, ++ ) -> ::ssize_t; ++ pub fn settimeofday( ++ tv: *const ::timeval, ++ tz: *const ::timezone, ++ ) -> ::c_int; ++ pub fn splice( ++ fd_in: ::c_int, ++ off_in: *mut ::loff_t, ++ fd_out: ::c_int, ++ off_out: *mut ::loff_t, ++ len: ::size_t, ++ flags: ::c_uint, ++ ) -> ::ssize_t; + pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; +- pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int; +- pub fn sem_timedwait(sem: *mut sem_t, +- abstime: *const ::timespec) -> ::c_int; +- pub fn sem_getvalue(sem: *mut sem_t, +- sval: *mut ::c_int) -> ::c_int; +- pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int; ++ pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) ++ -> ::c_int; ++ pub fn sem_timedwait( ++ sem: *mut sem_t, ++ abstime: *const ::timespec, ++ ) -> ::c_int; ++ pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int; ++ pub fn sched_setparam( ++ pid: ::pid_t, ++ param: *const ::sched_param, ++ ) -> ::c_int; + pub fn setns(fd: ::c_int, nstype: ::c_int) -> ::c_int; + pub fn swapoff(puath: *const ::c_char) -> ::c_int; +- pub fn vmsplice(fd: ::c_int, +- iov: *const ::iovec, +- nr_segs: ::size_t, +- flags: ::c_uint) -> ::ssize_t; +- pub fn mount(src: *const ::c_char, +- target: *const ::c_char, +- fstype: *const ::c_char, +- flags: ::c_ulong, +- data: *const ::c_void) -> ::c_int; ++ pub fn vmsplice( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ nr_segs: ::size_t, ++ flags: ::c_uint, ++ ) -> ::ssize_t; ++ pub fn mount( ++ src: *const ::c_char, ++ target: *const ::c_char, ++ fstype: *const ::c_char, ++ flags: ::c_ulong, ++ data: *const ::c_void, ++ ) -> ::c_int; + pub fn personality(persona: ::c_ulong) -> ::c_int; + pub fn prctl(option: ::c_int, ...) -> ::c_int; + pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int; +- pub fn ppoll(fds: *mut ::pollfd, +- nfds: nfds_t, +- timeout: *const ::timespec, +- sigmask: *const sigset_t) -> ::c_int; +- pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t, +- abstime: *const ::timespec) -> ::c_int; +- pub fn clone(cb: extern fn(*mut ::c_void) -> ::c_int, +- child_stack: *mut ::c_void, +- flags: ::c_int, +- arg: *mut ::c_void, ...) -> ::c_int; ++ pub fn ppoll( ++ fds: *mut ::pollfd, ++ nfds: nfds_t, ++ timeout: *const ::timespec, ++ sigmask: *const sigset_t, ++ ) -> ::c_int; ++ pub fn pthread_mutex_timedlock( ++ lock: *mut pthread_mutex_t, ++ abstime: *const ::timespec, ++ ) -> ::c_int; ++ pub fn clone( ++ cb: extern "C" fn(*mut ::c_void) -> ::c_int, ++ child_stack: *mut ::c_void, ++ flags: ::c_int, ++ arg: *mut ::c_void, ++ ... ++ ) -> ::c_int; + pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int; +- pub fn clock_nanosleep(clk_id: ::clockid_t, +- flags: ::c_int, +- rqtp: *const ::timespec, +- rmtp: *mut ::timespec) -> ::c_int; +- pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t, +- guardsize: *mut ::size_t) -> ::c_int; ++ pub fn clock_nanosleep( ++ clk_id: ::clockid_t, ++ flags: ::c_int, ++ rqtp: *const ::timespec, ++ rmtp: *mut ::timespec, ++ ) -> ::c_int; ++ pub fn pthread_attr_getguardsize( ++ attr: *const ::pthread_attr_t, ++ guardsize: *mut ::size_t, ++ ) -> ::c_int; + pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int; +- pub fn pthread_condattr_getpshared(attr: *const pthread_condattr_t, +- pshared: *mut ::c_int) -> ::c_int; ++ pub fn pthread_condattr_getpshared( ++ attr: *const pthread_condattr_t, ++ pshared: *mut ::c_int, ++ ) -> ::c_int; + pub fn sysinfo(info: *mut ::sysinfo) -> ::c_int; + pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int; +- pub fn pthread_setschedparam(native: ::pthread_t, +- policy: ::c_int, +- param: *const ::sched_param) -> ::c_int; ++ pub fn pthread_setschedparam( ++ native: ::pthread_t, ++ policy: ::c_int, ++ param: *const ::sched_param, ++ ) -> ::c_int; + pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int; +- pub fn sched_setscheduler(pid: ::pid_t, +- policy: ::c_int, +- param: *const ::sched_param) -> ::c_int; +- pub fn sendfile(out_fd: ::c_int, +- in_fd: ::c_int, +- offset: *mut off_t, +- count: ::size_t) -> ::ssize_t; ++ pub fn sched_setscheduler( ++ pid: ::pid_t, ++ policy: ::c_int, ++ param: *const ::sched_param, ++ ) -> ::c_int; ++ pub fn sendfile( ++ out_fd: ::c_int, ++ in_fd: ::c_int, ++ offset: *mut off_t, ++ count: ::size_t, ++ ) -> ::ssize_t; + pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int; +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrgid_r")] +- pub fn getgrgid_r(gid: ::gid_t, +- grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "sigaltstack$UNIX2003")] +- #[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")] +- pub fn sigaltstack(ss: *const stack_t, +- oss: *mut stack_t) -> ::c_int; ++ pub fn getgrgid_r( ++ gid: ::gid_t, ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; ++ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sem_close(sem: *mut sem_t) -> ::c_int; + pub fn getdtablesize() -> ::c_int; +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrnam_r")] +- pub fn getgrnam_r(name: *const ::c_char, +- grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; ++ pub fn getgrnam_r( ++ name: *const ::c_char, ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; + pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_sigmask$UNIX2003")] +- pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, +- oldset: *mut sigset_t) -> ::c_int; ++ pub fn pthread_sigmask( ++ how: ::c_int, ++ set: *const sigset_t, ++ oldset: *mut sigset_t, ++ ) -> ::c_int; + pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; + pub fn getgrnam(name: *const ::c_char) -> *mut ::group; + pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int; + pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + pub fn sem_unlink(name: *const ::c_char) -> ::c_int; + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; +- #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwnam_r")] +- pub fn getpwnam_r(name: *const ::c_char, +- pwd: *mut passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut passwd) -> ::c_int; +- #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwuid_r")] +- pub fn getpwuid_r(uid: ::uid_t, +- pwd: *mut passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut passwd) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch ="x86"), +- link_name = "sigwait$UNIX2003")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")] +- pub fn sigwait(set: *const sigset_t, +- sig: *mut ::c_int) -> ::c_int; +- pub fn pthread_atfork(prepare: ::Option, +- parent: ::Option, +- child: ::Option) -> ::c_int; ++ pub fn getpwnam_r( ++ name: *const ::c_char, ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; ++ pub fn getpwuid_r( ++ uid: ::uid_t, ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; ++ pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; ++ pub fn pthread_atfork( ++ prepare: ::Option, ++ parent: ::Option, ++ child: ::Option, ++ ) -> ::c_int; + pub fn getgrgid(gid: ::gid_t) -> *mut ::group; +- pub fn getgrouplist(user: *const ::c_char, +- group: ::gid_t, +- groups: *mut ::gid_t, +- ngroups: *mut ::c_int) -> ::c_int; +- pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t, +- pshared: *mut ::c_int) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "popen$UNIX2003")] +- pub fn popen(command: *const c_char, +- mode: *const c_char) -> *mut ::FILE; +- pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char, +- mode: ::c_int, flags: ::c_int) -> ::c_int; +- pub fn pthread_create(native: *mut ::pthread_t, +- attr: *const ::pthread_attr_t, +- f: extern fn(*mut ::c_void) -> *mut ::c_void, +- value: *mut ::c_void) -> ::c_int; ++ pub fn getgrouplist( ++ user: *const ::c_char, ++ group: ::gid_t, ++ groups: *mut ::gid_t, ++ ngroups: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_mutexattr_getpshared( ++ attr: *const pthread_mutexattr_t, ++ pshared: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; ++ pub fn faccessat( ++ dirfd: ::c_int, ++ pathname: *const ::c_char, ++ mode: ::c_int, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_create( ++ native: *mut ::pthread_t, ++ attr: *const ::pthread_attr_t, ++ f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, ++ value: *mut ::c_void, ++ ) -> ::c_int; + pub fn dl_iterate_phdr( +- callback: ::Option ::c_int>, +- data: *mut ::c_void ++ callback: ::Option< ++ unsafe extern "C" fn( ++ info: *mut ::dl_phdr_info, ++ size: ::size_t, ++ data: *mut ::c_void, ++ ) -> ::c_int, ++ >, ++ data: *mut ::c_void, + ) -> ::c_int; + +- pub fn setmntent(filename: *const ::c_char, +- ty: *const ::c_char) -> *mut ::FILE; ++ pub fn setmntent( ++ filename: *const ::c_char, ++ ty: *const ::c_char, ++ ) -> *mut ::FILE; + pub fn getmntent(stream: *mut ::FILE) -> *mut ::mntent; + pub fn addmntent(stream: *mut ::FILE, mnt: *const ::mntent) -> ::c_int; + pub fn endmntent(streamp: *mut ::FILE) -> ::c_int; +- pub fn hasmntopt(mnt: *const ::mntent, +- opt: *const ::c_char) -> *mut ::c_char; +- +- pub fn posix_spawn(pid: *mut ::pid_t, +- path: *const ::c_char, +- file_actions: *const ::posix_spawn_file_actions_t, +- attrp: *const ::posix_spawnattr_t, +- argv: *const *mut ::c_char, +- envp: *const *mut ::c_char) -> ::c_int; +- pub fn posix_spawnp(pid: *mut ::pid_t, +- file: *const ::c_char, +- file_actions: *const ::posix_spawn_file_actions_t, +- attrp: *const ::posix_spawnattr_t, +- argv: *const *mut ::c_char, +- envp: *const *mut ::c_char) -> ::c_int; ++ pub fn hasmntopt( ++ mnt: *const ::mntent, ++ opt: *const ::c_char, ++ ) -> *mut ::c_char; ++ ++ pub fn posix_spawn( ++ pid: *mut ::pid_t, ++ path: *const ::c_char, ++ file_actions: *const ::posix_spawn_file_actions_t, ++ attrp: *const ::posix_spawnattr_t, ++ argv: *const *mut ::c_char, ++ envp: *const *mut ::c_char, ++ ) -> ::c_int; ++ pub fn posix_spawnp( ++ pid: *mut ::pid_t, ++ file: *const ::c_char, ++ file_actions: *const ::posix_spawn_file_actions_t, ++ attrp: *const ::posix_spawnattr_t, ++ argv: *const *mut ::c_char, ++ envp: *const *mut ::c_char, ++ ) -> ::c_int; + pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int; +- pub fn posix_spawnattr_getsigdefault(attr: *const posix_spawnattr_t, +- default: *mut ::sigset_t) -> ::c_int; +- pub fn posix_spawnattr_setsigdefault(attr: *mut posix_spawnattr_t, +- default: *const ::sigset_t) -> ::c_int; +- pub fn posix_spawnattr_getsigmask(attr: *const posix_spawnattr_t, +- default: *mut ::sigset_t) -> ::c_int; +- pub fn posix_spawnattr_setsigmask(attr: *mut posix_spawnattr_t, +- default: *const ::sigset_t) -> ::c_int; +- pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t, +- flags: *mut ::c_short) -> ::c_int; +- pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, +- flags: ::c_short) -> ::c_int; +- pub fn posix_spawnattr_getpgroup(attr: *const posix_spawnattr_t, +- flags: *mut ::pid_t) -> ::c_int; +- pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, +- flags: ::pid_t) -> ::c_int; +- pub fn posix_spawnattr_getschedpolicy(attr: *const posix_spawnattr_t, +- flags: *mut ::c_int) -> ::c_int; +- pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, +- flags: ::c_int) -> ::c_int; ++ pub fn posix_spawnattr_getsigdefault( ++ attr: *const posix_spawnattr_t, ++ default: *mut ::sigset_t, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_setsigdefault( ++ attr: *mut posix_spawnattr_t, ++ default: *const ::sigset_t, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_getsigmask( ++ attr: *const posix_spawnattr_t, ++ default: *mut ::sigset_t, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_setsigmask( ++ attr: *mut posix_spawnattr_t, ++ default: *const ::sigset_t, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_getflags( ++ attr: *const posix_spawnattr_t, ++ flags: *mut ::c_short, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_setflags( ++ attr: *mut posix_spawnattr_t, ++ flags: ::c_short, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_getpgroup( ++ attr: *const posix_spawnattr_t, ++ flags: *mut ::pid_t, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_setpgroup( ++ attr: *mut posix_spawnattr_t, ++ flags: ::pid_t, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_getschedpolicy( ++ attr: *const posix_spawnattr_t, ++ flags: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn posix_spawnattr_setschedpolicy( ++ attr: *mut posix_spawnattr_t, ++ flags: ::c_int, ++ ) -> ::c_int; + pub fn posix_spawnattr_getschedparam( + attr: *const posix_spawnattr_t, + param: *mut ::sched_param, +@@ -2704,17 +3470,44 @@ extern { + fd: ::c_int, + newfd: ::c_int, + ) -> ::c_int; +- pub fn fread_unlocked(ptr: *mut ::c_void, ++ pub fn fread_unlocked( ++ ptr: *mut ::c_void, + size: ::size_t, + nobj: ::size_t, +- stream: *mut ::FILE ++ stream: *mut ::FILE, + ) -> ::size_t; + pub fn inotify_rm_watch(fd: ::c_int, wd: ::c_int) -> ::c_int; + pub fn inotify_init() -> ::c_int; + pub fn inotify_init1(flags: ::c_int) -> ::c_int; +- pub fn inotify_add_watch(fd: ::c_int, +- path: *const ::c_char, +- mask: u32) -> ::c_int; ++ pub fn inotify_add_watch( ++ fd: ::c_int, ++ path: *const ::c_char, ++ mask: u32, ++ ) -> ::c_int; ++ pub fn fanotify_init(flags: ::c_uint, event_f_flags: ::c_uint) -> ::c_int; ++ ++ pub fn regcomp( ++ preg: *mut ::regex_t, ++ pattern: *const ::c_char, ++ cflags: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn regexec( ++ preg: *const ::regex_t, ++ input: *const ::c_char, ++ nmatch: ::size_t, ++ pmatch: *mut regmatch_t, ++ eflags: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn regerror( ++ errcode: ::c_int, ++ preg: *const ::regex_t, ++ errbuf: *mut ::c_char, ++ errbuf_size: ::size_t, ++ ) -> ::size_t; ++ ++ pub fn regfree(preg: *mut ::regex_t); + } + + cfg_if! { +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs b/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..aedbf7a99eb1b18a3f99ffb1746228f2c8d36179 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs +@@ -0,0 +1,7 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(8))] ++ pub struct max_align_t { ++ priv_: (i64, i64) ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/arm.rs b/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/arm/mod.rs +similarity index 96% +rename from third_party/rust/libc/src/unix/linux_like/linux/musl/b32/arm.rs +rename to third_party/rust/libc/src/unix/linux_like/linux/musl/b32/arm/mod.rs +index 3d6e0013d90834b40343a8ad07751a7538a75a8c..51237a2cb671ed7ffe848a445155fd73545746e5 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/arm.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/arm/mod.rs +@@ -150,6 +150,24 @@ s! { + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } ++ ++ pub struct nlmsghdr { ++ pub nlmsg_len: u32, ++ pub nlmsg_type: u16, ++ pub nlmsg_flags: u16, ++ pub nlmsg_seq: u32, ++ pub nlmsg_pid: u32, ++ } ++ ++ pub struct nlmsgerr { ++ pub error: ::c_int, ++ pub msg: nlmsghdr, ++ } ++ ++ pub struct nlattr { ++ pub nla_len: u16, ++ pub nla_type: u16, ++ } + } + + pub const SIGSTKSZ: ::size_t = 8192; +@@ -179,12 +197,12 @@ 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 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; +@@ -218,14 +236,14 @@ pub const NOFLSH: ::tcflag_t = 0x00000080; + pub const CIBAUD: ::tcflag_t = 0o02003600000; + pub const CBAUDEX: ::tcflag_t = 0o010000; + pub const VSWTC: usize = 7; +-pub const OLCUC: ::tcflag_t = 0o000002; +-pub const NLDLY: ::tcflag_t = 0o000400; +-pub const CRDLY: ::tcflag_t = 0o003000; ++pub const OLCUC: ::tcflag_t = 0o000002; ++pub const NLDLY: ::tcflag_t = 0o000400; ++pub const CRDLY: ::tcflag_t = 0o003000; + pub const TABDLY: ::tcflag_t = 0o014000; +-pub const BSDLY: ::tcflag_t = 0o020000; +-pub const FFDLY: ::tcflag_t = 0o100000; +-pub const VTDLY: ::tcflag_t = 0o040000; +-pub const XTABS: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const XTABS: ::tcflag_t = 0o014000; + pub const B57600: ::speed_t = 0o010001; + pub const B115200: ::speed_t = 0o010002; + pub const B230400: ::speed_t = 0o010003; +@@ -262,6 +280,7 @@ pub const MAP_NORESERVE: ::c_int = 0x04000; + pub const MAP_POPULATE: ::c_int = 0x08000; + pub const MAP_NONBLOCK: ::c_int = 0x010000; + pub const MAP_STACK: ::c_int = 0x020000; ++pub const MAP_SYNC : ::c_int = 0x080000; + + pub const SOCK_STREAM: ::c_int = 1; + pub const SOCK_DGRAM: ::c_int = 2; +@@ -418,6 +437,9 @@ pub const F_GETOWN: ::c_int = 9; + pub const F_SETLK: ::c_int = 13; + pub const F_SETLKW: ::c_int = 14; + pub const F_SETOWN: ::c_int = 8; ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; + + pub const VEOF: usize = 4; + pub const VEOL: usize = 11; +@@ -827,11 +849,19 @@ pub const SYS_pwritev2: ::c_long = 393; + pub const SYS_pkey_mprotect: ::c_long = 394; + pub const SYS_pkey_alloc: ::c_long = 395; + pub const SYS_pkey_free: ::c_long = 396; ++pub const SYS_statx: ::c_long = 397; + +-extern { ++extern "C" { + pub fn getrandom( + buf: *mut ::c_void, + buflen: ::size_t, + flags: ::c_uint, + ) -> ::ssize_t; + } ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/hexagon.rs b/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/hexagon.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..00061976250949c6b1651fc4fe3a364620627163 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/hexagon.rs +@@ -0,0 +1,796 @@ ++pub type c_char = u8; ++pub type wchar_t = u32; ++pub type stat64 = ::stat; ++ ++s! { ++ ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::c_ulonglong, ++ pub st_mode: ::c_uint, ++ pub st_nlink: ::c_uint, ++ pub st_uid: ::c_uint, ++ pub st_gid: ::c_uint, ++ pub st_rdev: ::c_ulonglong, ++ __st_rdev_padding: ::c_ulong, ++ pub st_size: ::c_longlong, ++ pub st_blksize: ::blksize_t, ++ __st_blksize_padding: ::c_int, ++ pub st_blocks: ::blkcnt_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, ++ ++ __unused: [::c_int;2], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut ::c_void, ++ pub ss_flags: ::c_int, ++ pub ss_size: ::size_t ++ } ++ ++ pub struct ipc_perm { ++ pub __ipc_perm_key: ::key_t, ++ pub uid: ::uid_t, ++ pub gid: ::gid_t, ++ pub cuid: ::uid_t, ++ pub cgid: ::gid_t, ++ pub mode: ::mode_t, ++ pub __seq: ::c_ushort, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: ::ipc_perm, ++ pub shm_segsz: ::size_t, ++ pub shm_atime: ::time_t, ++ __unused1: ::c_int, ++ pub shm_dtime: ::time_t, ++ __unused2: ::c_int, ++ pub shm_ctime: ::time_t, ++ __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, ++ pub f_fsid: ::fsid_t, ++ pub f_namelen: ::c_ulong, ++ pub f_frsize: ::c_ulong, ++ pub f_flags: ::c_ulong, ++ pub f_spare: [::c_ulong; 4], ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: ::c_int, ++ pub si_errno: ::c_int, ++ pub si_code: ::c_int, ++ pub _pad: [::c_int; 29], ++ _align: [usize; 0], ++ } ++ ++ pub struct statfs64 { ++ 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, ++ pub f_fsid: ::fsid_t, ++ pub f_namelen: ::c_ulong, ++ pub f_frsize: ::c_ulong, ++ pub f_flags: ::c_ulong, ++ pub f_spare: [::c_ulong; 4], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: ::c_ulong, ++ pub f_frsize: ::c_ulong, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: u64, ++ pub f_fsid: ::c_ulong, ++ __f_unused: ::c_int, ++ pub f_flag: ::c_ulong, ++ pub f_namemax: ::c_ulong, ++ __f_spare: [::c_int; 6], ++ } ++ ++ pub struct termios2 { ++ 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; 19], ++ pub c_ispeed: ::speed_t, ++ pub c_ospeed: ::speed_t, ++ } ++} ++ ++pub const AF_FILE: ::c_int = 1; ++pub const AF_KCM: ::c_int = 41; ++pub const AF_MAX: ::c_int = 43; ++pub const AF_QIPCRTR: ::c_int = 42; ++pub const EADDRINUSE: ::c_int = 98; ++pub const EADDRNOTAVAIL: ::c_int = 99; ++pub const EAFNOSUPPORT: ::c_int = 97; ++pub const EALREADY: ::c_int = 114; ++pub const EBADE: ::c_int = 52; ++pub const EBADMSG: ::c_int = 74; ++pub const EBADR: ::c_int = 53; ++pub const EBADRQC: ::c_int = 56; ++pub const EBADSLT: ::c_int = 57; ++pub const ECANCELED: ::c_int = 125; ++pub const ECHRNG: ::c_int = 44; ++pub const ECONNABORTED: ::c_int = 103; ++pub const ECONNREFUSED: ::c_int = 111; ++pub const ECONNRESET: ::c_int = 104; ++pub const EDEADLK: ::c_int = 35; ++pub const EDEADLOCK: ::c_int = 35; ++pub const EDESTADDRREQ: ::c_int = 89; ++pub const EDQUOT: ::c_int = 122; ++pub const EHOSTDOWN: ::c_int = 112; ++pub const EHOSTUNREACH: ::c_int = 113; ++pub const EHWPOISON: ::c_int = 133; ++pub const EIDRM: ::c_int = 43; ++pub const EILSEQ: ::c_int = 84; ++pub const EINPROGRESS: ::c_int = 115; ++pub const EISCONN: ::c_int = 106; ++pub const EISNAM: ::c_int = 120; ++pub const EKEYEXPIRED: ::c_int = 127; ++pub const EKEYREJECTED: ::c_int = 129; ++pub const EKEYREVOKED: ::c_int = 128; ++pub const EL2HLT: ::c_int = 51; ++pub const EL2NSYNC: ::c_int = 45; ++pub const EL3HLT: ::c_int = 46; ++pub const EL3RST: ::c_int = 47; ++pub const ELIBACC: ::c_int = 79; ++pub const ELIBBAD: ::c_int = 80; ++pub const ELIBEXEC: ::c_int = 83; ++pub const ELIBMAX: ::c_int = 82; ++pub const ELIBSCN: ::c_int = 81; ++pub const ELNRNG: ::c_int = 48; ++pub const ELOOP: ::c_int = 40; ++pub const EMEDIUMTYPE: ::c_int = 124; ++pub const EMSGSIZE: ::c_int = 90; ++pub const EMULTIHOP: ::c_int = 72; ++pub const ENAMETOOLONG: ::c_int = 36; ++pub const ENAVAIL: ::c_int = 119; ++pub const ENETDOWN: ::c_int = 100; ++pub const ENETRESET: ::c_int = 102; ++pub const ENETUNREACH: ::c_int = 101; ++pub const ENOANO: ::c_int = 55; ++pub const ENOBUFS: ::c_int = 105; ++pub const ENOCSI: ::c_int = 50; ++pub const ENOKEY: ::c_int = 126; ++pub const ENOLCK: ::c_int = 37; ++pub const ENOMEDIUM: ::c_int = 123; ++pub const ENOMSG: ::c_int = 42; ++pub const ENOPROTOOPT: ::c_int = 92; ++pub const ENOSYS: ::c_int = 38; ++pub const ENOTCONN: ::c_int = 107; ++pub const ENOTEMPTY: ::c_int = 39; ++pub const ENOTNAM: ::c_int = 118; ++pub const ENOTRECOVERABLE: ::c_int = 131; ++pub const ENOTSOCK: ::c_int = 88; ++pub const ENOTSUP: ::c_int = 95; ++pub const ENOTUNIQ: ::c_int = 76; ++pub const EOPNOTSUPP: ::c_int = 95; ++pub const EOVERFLOW: ::c_int = 75; ++pub const EOWNERDEAD: ::c_int = 130; ++pub const EPFNOSUPPORT: ::c_int = 96; ++pub const EREMCHG: ::c_int = 78; ++pub const ERESTART: ::c_int = 85; ++pub const ERFKILL: ::c_int = 132; ++pub const ESHUTDOWN: ::c_int = 108; ++pub const ESOCKTNOSUPPORT: ::c_int = 94; ++pub const ESTALE: ::c_int = 116; ++pub const ESTRPIPE: ::c_int = 86; ++pub const ETOOMANYREFS: ::c_int = 109; ++pub const ETIMEDOUT: ::c_int = 110; ++pub const EUCLEAN: ::c_int = 117; ++pub const EUNATCH: ::c_int = 49; ++pub const EUSERS: ::c_int = 87; ++pub const EXFULL: ::c_int = 54; ++pub const EXTPROC: ::c_int = 65536; ++pub const F_EXLCK: ::c_int = 4; ++pub const F_GETLK: ::c_int = 12; ++pub const F_GETOWN: ::c_int = 9; ++pub const F_GETOWNER_UIDS: ::c_int = 17; ++pub const F_GETOWN_EX: ::c_int = 16; ++pub const F_GETSIG: ::c_int = 11; ++pub const FIOASYNC: ::c_int = 21586; ++pub const FIOCLEX: ::c_int = 21585; ++pub const FIONBIO: ::c_int = 21537; ++pub const FIONCLEX: ::c_int = 21584; ++pub const FIONREAD: ::c_int = 21531; ++pub const FIOQSIZE: ::c_int = 21600; ++pub const F_LINUX_SPECIFIC_BASE: ::c_int = 1024; ++pub const FLUSHO: ::c_int = 4096; ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; ++pub const F_OWNER_PGRP: ::c_int = 2; ++pub const F_OWNER_PID: ::c_int = 1; ++pub const F_OWNER_TID: ::c_int = 0; ++pub const F_SETLK: ::c_int = 13; ++pub const F_SETLKW: ::c_int = 14; ++pub const F_SETOWN: ::c_int = 8; ++pub const F_SETOWN_EX: ::c_int = 15; ++pub const F_SETSIG: ::c_int = 10; ++pub const F_SHLCK: ::c_int = 8; ++pub const IEXTEN: ::c_int = 32768; ++pub const MAP_ANON: ::c_int = 32; ++pub const MAP_DENYWRITE: ::c_int = 2048; ++pub const MAP_EXECUTABLE: ::c_int = 4096; ++pub const MAP_GROWSDOWN: ::c_int = 256; ++pub const MAP_HUGETLB: ::c_int = 262144; ++pub const MAP_LOCKED: ::c_int = 8192; ++pub const MAP_NONBLOCK: ::c_int = 65536; ++pub const MAP_NORESERVE: ::c_int = 16384; ++pub const MAP_POPULATE: ::c_int = 32768; ++pub const MAP_STACK: ::c_int = 131072; ++pub const MAP_UNINITIALIZED: ::c_int = 0; ++pub const O_APPEND: ::c_int = 1024; ++pub const O_ASYNC: ::c_int = 8192; ++pub const O_CREAT: ::c_int = 64; ++pub const O_DIRECT: ::c_int = 16384; ++pub const O_DIRECTORY: ::c_int = 65536; ++pub const O_DSYNC: ::c_int = 4096; ++pub const O_EXCL: ::c_int = 128; ++pub const O_LARGEFILE: ::c_int = 32768; ++pub const O_NOCTTY: ::c_int = 256; ++pub const O_NOFOLLOW: ::c_int = 131072; ++pub const O_NONBLOCK: ::c_int = 2048; ++pub const O_SYNC: ::c_int = 1052672; ++pub const PF_FILE: ::c_int = 1; ++pub const PF_KCM: ::c_int = 41; ++pub const PF_MAX: ::c_int = 43; ++pub const PF_QIPCRTR: ::c_int = 42; ++pub const RLIMIT_AS: ::c_int = 9; ++pub const RLIMIT_MEMLOCK: ::c_int = 8; ++pub const RLIMIT_NOFILE: ::c_int = 7; ++pub const RLIMIT_NPROC: ::c_int = 6; ++pub const RLIMIT_RSS: ::c_int = 5; ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++pub const RLIM_NLIMITS: ::c_int = 16; ++pub const SA_ONSTACK: ::c_int = 0x08000000; ++pub const SA_SIGINFO: ::c_int = 0x00000004; ++pub const SA_NOCLDWAIT: ::c_int = 0x00000002; ++pub const SIGBUS: ::c_int = 7; ++pub const SIGCHLD: ::c_int = 17; ++pub const SIGCONT: ::c_int = 18; ++pub const SIGIO: ::c_int = 29; ++pub const SIGPOLL: ::c_int = 29; ++pub const SIGPROF: ::c_int = 27; ++pub const SIGPWR: ::c_int = 30; ++pub const SIGSTKFLT: ::c_int = 16; ++pub const SIGSTKSZ: ::size_t = 8192; ++pub const MINSIGSTKSZ: ::size_t = 2048; ++pub const SIGSTOP: ::c_int = 19; ++pub const SIGSYS: ::c_int = 31; ++pub const SIGTSTP: ::c_int = 20; ++pub const SIGTTIN: ::c_int = 21; ++pub const SIGTTOU: ::c_int = 22; ++pub const SIGURG: ::c_int = 23; ++pub const SIGUSR1: ::c_int = 10; ++pub const SIGUSR2: ::c_int = 12; ++pub const SIGVTALRM: ::c_int = 26; ++pub const SIGWINCH: ::c_int = 28; ++pub const SIGXCPU: ::c_int = 24; ++pub const SIGXFSZ: ::c_int = 25; ++pub const SIG_SETMASK: ::c_int = 2; // FIXME check these ++pub const SIG_BLOCK: ::c_int = 0x000000; ++pub const SIG_UNBLOCK: ::c_int = 0x01; ++pub const SO_ACCEPTCONN: ::c_int = 30; ++pub const SO_ATTACH_BPF: ::c_int = 50; ++pub const SO_ATTACH_FILTER: ::c_int = 26; ++pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 51; ++pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 52; ++pub const SO_BPF_EXTENSIONS: ::c_int = 48; ++pub const SO_BROADCAST: ::c_int = 6; ++pub const SO_BSDCOMPAT: ::c_int = 14; ++pub const SOCK_DGRAM: ::c_int = 2; ++pub const SOCK_NONBLOCK: ::c_int = 2048; ++pub const SOCK_SEQPACKET: ::c_int = 5; ++pub const SOCK_STREAM: ::c_int = 1; ++pub const SO_CNX_ADVICE: ::c_int = 53; ++pub const SO_DETACH_BPF: ::c_int = 27; ++pub const SO_DETACH_FILTER: ::c_int = 27; ++pub const SO_DOMAIN: ::c_int = 39; ++pub const SO_DONTROUTE: ::c_int = 5; ++pub const SO_ERROR: ::c_int = 4; ++pub const SO_GET_FILTER: ::c_int = 26; ++pub const SO_INCOMING_CPU: ::c_int = 49; ++pub const SO_KEEPALIVE: ::c_int = 9; ++pub const SOL_CAIF: ::c_int = 278; ++pub const SO_LINGER: ::c_int = 13; ++pub const SOL_IUCV: ::c_int = 277; ++pub const SOL_KCM: ::c_int = 281; ++pub const SOL_NFC: ::c_int = 280; ++pub const SO_LOCK_FILTER: ::c_int = 44; ++pub const SOL_PNPIPE: ::c_int = 275; ++pub const SOL_PPPOL2TP: ::c_int = 273; ++pub const SOL_RDS: ::c_int = 276; ++pub const SOL_RXRPC: ::c_int = 272; ++pub const SOL_SOCKET: ::c_int = 1; ++pub const SO_MAX_PACING_RATE: ::c_int = 47; ++pub const SO_NO_CHECK: ::c_int = 11; ++pub const SO_NOFCS: ::c_int = 43; ++pub const SO_OOBINLINE: ::c_int = 10; ++pub const SO_PASSCRED: ::c_int = 16; ++pub const SO_PASSSEC: ::c_int = 34; ++pub const SO_PEERCRED: ::c_int = 17; ++pub const SO_PEERNAME: ::c_int = 28; ++pub const SO_PEERSEC: ::c_int = 31; ++pub const SO_PRIORITY: ::c_int = 12; ++pub const SO_PROTOCOL: ::c_int = 38; ++pub const SO_RCVBUF: ::c_int = 8; ++pub const SO_RCVBUFFORCE: ::c_int = 33; ++pub const SO_RCVLOWAT: ::c_int = 18; ++pub const SO_RCVTIMEO: ::c_int = 20; ++pub const SO_REUSEADDR: ::c_int = 2; ++pub const SO_REUSEPORT: ::c_int = 15; ++pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22; ++pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24; ++pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23; ++pub const SO_SELECT_ERR_QUEUE: ::c_int = 45; ++pub const SO_SNDBUF: ::c_int = 7; ++pub const SO_SNDBUFFORCE: ::c_int = 32; ++pub const SO_SNDLOWAT: ::c_int = 19; ++pub const SO_SNDTIMEO: ::c_int = 21; ++pub const SO_TYPE: ::c_int = 3; ++pub const SO_WIFI_STATUS: ::c_int = 41; ++pub const SYS3264_fadvise64: ::c_int = 223; ++pub const SYS3264_fcntl: ::c_int = 25; ++pub const SYS3264_fstatat: ::c_int = 79; ++pub const SYS3264_fstat: ::c_int = 80; ++pub const SYS3264_fstatfs: ::c_int = 44; ++pub const SYS3264_ftruncate: ::c_int = 46; ++pub const SYS3264_lseek: ::c_int = 62; ++pub const SYS3264_lstat: ::c_int = 1039; ++pub const SYS3264_mmap: ::c_int = 222; ++pub const SYS3264_sendfile: ::c_int = 71; ++pub const SYS3264_stat: ::c_int = 1038; ++pub const SYS3264_statfs: ::c_int = 43; ++pub const SYS3264_truncate: ::c_int = 45; ++pub const SYS_accept4: ::c_int = 242; ++pub const SYS_accept: ::c_int = 202; ++pub const SYS_access: ::c_int = 1033; ++pub const SYS_acct: ::c_int = 89; ++pub const SYS_add_key: ::c_int = 217; ++pub const SYS_adjtimex: ::c_int = 171; ++pub const SYS_alarm: ::c_int = 1059; ++pub const SYS_arch_specific_syscall: ::c_int = 244; ++pub const SYS_bdflush: ::c_int = 1075; ++pub const SYS_bind: ::c_int = 200; ++pub const SYS_bpf: ::c_int = 280; ++pub const SYS_brk: ::c_int = 214; ++pub const SYS_capget: ::c_int = 90; ++pub const SYS_capset: ::c_int = 91; ++pub const SYS_chdir: ::c_int = 49; ++pub const SYS_chmod: ::c_int = 1028; ++pub const SYS_chown: ::c_int = 1029; ++pub const SYS_chroot: ::c_int = 51; ++pub const SYS_clock_adjtime: ::c_int = 266; ++pub const SYS_clock_getres: ::c_int = 114; ++pub const SYS_clock_gettime: ::c_int = 113; ++pub const SYS_clock_nanosleep: ::c_int = 115; ++pub const SYS_clock_settime: ::c_int = 112; ++pub const SYS_clone: ::c_int = 220; ++pub const SYS_close: ::c_int = 57; ++pub const SYS_connect: ::c_int = 203; ++pub const SYS_copy_file_range: ::c_int = -1; // FIXME ++pub const SYS_creat: ::c_int = 1064; ++pub const SYS_delete_module: ::c_int = 106; ++pub const SYS_dup2: ::c_int = 1041; ++pub const SYS_dup3: ::c_int = 24; ++pub const SYS_dup: ::c_int = 23; ++pub const SYS_epoll_create1: ::c_int = 20; ++pub const SYS_epoll_create: ::c_int = 1042; ++pub const SYS_epoll_ctl: ::c_int = 21; ++pub const SYS_epoll_pwait: ::c_int = 22; ++pub const SYS_epoll_wait: ::c_int = 1069; ++pub const SYS_eventfd2: ::c_int = 19; ++pub const SYS_eventfd: ::c_int = 1044; ++pub const SYS_execveat: ::c_int = 281; ++pub const SYS_execve: ::c_int = 221; ++pub const SYS_exit: ::c_int = 93; ++pub const SYS_exit_group: ::c_int = 94; ++pub const SYS_faccessat: ::c_int = 48; ++pub const SYS_fadvise64_64: ::c_int = 223; ++pub const SYS_fallocate: ::c_int = 47; ++pub const SYS_fanotify_init: ::c_int = 262; ++pub const SYS_fanotify_mark: ::c_int = 263; ++pub const SYS_fchdir: ::c_int = 50; ++pub const SYS_fchmodat: ::c_int = 53; ++pub const SYS_fchmod: ::c_int = 52; ++pub const SYS_fchownat: ::c_int = 54; ++pub const SYS_fchown: ::c_int = 55; ++pub const SYS_fcntl64: ::c_int = 25; ++pub const SYS_fcntl: ::c_int = 25; ++pub const SYS_fdatasync: ::c_int = 83; ++pub const SYS_fgetxattr: ::c_int = 10; ++pub const SYS_finit_module: ::c_int = 273; ++pub const SYS_flistxattr: ::c_int = 13; ++pub const SYS_flock: ::c_int = 32; ++pub const SYS_fork: ::c_int = 1079; ++pub const SYS_fremovexattr: ::c_int = 16; ++pub const SYS_fsetxattr: ::c_int = 7; ++pub const SYS_fstat64: ::c_int = 80; ++pub const SYS_fstatat64: ::c_int = 79; ++pub const SYS_fstatfs64: ::c_int = 44; ++pub const SYS_fstatfs: ::c_int = 44; ++pub const SYS_fsync: ::c_int = 82; ++pub const SYS_ftruncate64: ::c_int = 46; ++pub const SYS_ftruncate: ::c_int = 46; ++pub const SYS_futex: ::c_int = 98; ++pub const SYS_futimesat: ::c_int = 1066; ++pub const SYS_getcpu: ::c_int = 168; ++pub const SYS_getcwd: ::c_int = 17; ++pub const SYS_getdents64: ::c_int = 61; ++pub const SYS_getdents: ::c_int = 1065; ++pub const SYS_getegid: ::c_int = 177; ++pub const SYS_geteuid: ::c_int = 175; ++pub const SYS_getgid: ::c_int = 176; ++pub const SYS_getgroups: ::c_int = 158; ++pub const SYS_getitimer: ::c_int = 102; ++pub const SYS_get_mempolicy: ::c_int = 236; ++pub const SYS_getpeername: ::c_int = 205; ++pub const SYS_getpgid: ::c_int = 155; ++pub const SYS_getpgrp: ::c_int = 1060; ++pub const SYS_getpid: ::c_int = 172; ++pub const SYS_getppid: ::c_int = 173; ++pub const SYS_getpriority: ::c_int = 141; ++pub const SYS_getrandom: ::c_int = 278; ++pub const SYS_getresgid: ::c_int = 150; ++pub const SYS_getresuid: ::c_int = 148; ++pub const SYS_getrlimit: ::c_int = 163; ++pub const SYS_get_robust_list: ::c_int = 100; ++pub const SYS_getrusage: ::c_int = 165; ++pub const SYS_getsid: ::c_int = 156; ++pub const SYS_getsockname: ::c_int = 204; ++pub const SYS_getsockopt: ::c_int = 209; ++pub const SYS_gettid: ::c_int = 178; ++pub const SYS_gettimeofday: ::c_int = 169; ++pub const SYS_getuid: ::c_int = 174; ++pub const SYS_getxattr: ::c_int = 8; ++pub const SYS_init_module: ::c_int = 105; ++pub const SYS_inotify_add_watch: ::c_int = 27; ++pub const SYS_inotify_init1: ::c_int = 26; ++pub const SYS_inotify_init: ::c_int = 1043; ++pub const SYS_inotify_rm_watch: ::c_int = 28; ++pub const SYS_io_cancel: ::c_int = 3; ++pub const SYS_ioctl: ::c_int = 29; ++pub const SYS_io_destroy: ::c_int = 1; ++pub const SYS_io_getevents: ::c_int = 4; ++pub const SYS_ioprio_get: ::c_int = 31; ++pub const SYS_ioprio_set: ::c_int = 30; ++pub const SYS_io_setup: ::c_int = 0; ++pub const SYS_io_submit: ::c_int = 2; ++pub const SYS_kcmp: ::c_int = 272; ++pub const SYS_kexec_load: ::c_int = 104; ++pub const SYS_keyctl: ::c_int = 219; ++pub const SYS_kill: ::c_int = 129; ++pub const SYS_lchown: ::c_int = 1032; ++pub const SYS_lgetxattr: ::c_int = 9; ++pub const SYS_linkat: ::c_int = 37; ++pub const SYS_link: ::c_int = 1025; ++pub const SYS_listen: ::c_int = 201; ++pub const SYS_listxattr: ::c_int = 11; ++pub const SYS_llistxattr: ::c_int = 12; ++pub const SYS__llseek: ::c_int = 62; ++pub const SYS_lookup_dcookie: ::c_int = 18; ++pub const SYS_lremovexattr: ::c_int = 15; ++pub const SYS_lseek: ::c_int = 62; ++pub const SYS_lsetxattr: ::c_int = 6; ++pub const SYS_lstat64: ::c_int = 1039; ++pub const SYS_lstat: ::c_int = 1039; ++pub const SYS_madvise: ::c_int = 233; ++pub const SYS_mbind: ::c_int = 235; ++pub const SYS_memfd_create: ::c_int = 279; ++pub const SYS_migrate_pages: ::c_int = 238; ++pub const SYS_mincore: ::c_int = 232; ++pub const SYS_mkdirat: ::c_int = 34; ++pub const SYS_mkdir: ::c_int = 1030; ++pub const SYS_mknodat: ::c_int = 33; ++pub const SYS_mknod: ::c_int = 1027; ++pub const SYS_mlockall: ::c_int = 230; ++pub const SYS_mlock: ::c_int = 228; ++pub const SYS_mmap2: ::c_int = 222; ++pub const SYS_mount: ::c_int = 40; ++pub const SYS_move_pages: ::c_int = 239; ++pub const SYS_mprotect: ::c_int = 226; ++pub const SYS_mq_getsetattr: ::c_int = 185; ++pub const SYS_mq_notify: ::c_int = 184; ++pub const SYS_mq_open: ::c_int = 180; ++pub const SYS_mq_timedreceive: ::c_int = 183; ++pub const SYS_mq_timedsend: ::c_int = 182; ++pub const SYS_mq_unlink: ::c_int = 181; ++pub const SYS_mremap: ::c_int = 216; ++pub const SYS_msgctl: ::c_int = 187; ++pub const SYS_msgget: ::c_int = 186; ++pub const SYS_msgrcv: ::c_int = 188; ++pub const SYS_msgsnd: ::c_int = 189; ++pub const SYS_msync: ::c_int = 227; ++pub const SYS_munlockall: ::c_int = 231; ++pub const SYS_munlock: ::c_int = 229; ++pub const SYS_munmap: ::c_int = 215; ++pub const SYS_name_to_handle_at: ::c_int = 264; ++pub const SYS_nanosleep: ::c_int = 101; ++pub const SYS_newfstatat: ::c_int = 79; ++pub const SYS_nfsservctl: ::c_int = 42; ++pub const SYS_oldwait4: ::c_int = 1072; ++pub const SYS_openat: ::c_int = 56; ++pub const SYS_open_by_handle_at: ::c_int = 265; ++pub const SYS_open: ::c_int = 1024; ++pub const SYS_pause: ::c_int = 1061; ++pub const SYS_perf_event_open: ::c_int = 241; ++pub const SYS_personality: ::c_int = 92; ++pub const SYS_pipe2: ::c_int = 59; ++pub const SYS_pipe: ::c_int = 1040; ++pub const SYS_pivot_root: ::c_int = 41; ++pub const SYS_poll: ::c_int = 1068; ++pub const SYS_ppoll: ::c_int = 73; ++pub const SYS_prctl: ::c_int = 167; ++pub const SYS_pread64: ::c_int = 67; ++pub const SYS_preadv: ::c_int = 69; ++pub const SYS_prlimit64: ::c_int = 261; ++pub const SYS_process_vm_readv: ::c_int = 270; ++pub const SYS_process_vm_writev: ::c_int = 271; ++pub const SYS_pselect6: ::c_int = 72; ++pub const SYS_ptrace: ::c_int = 117; ++pub const SYS_pwrite64: ::c_int = 68; ++pub const SYS_pwritev: ::c_int = 70; ++pub const SYS_quotactl: ::c_int = 60; ++pub const SYS_readahead: ::c_int = 213; ++pub const SYS_read: ::c_int = 63; ++pub const SYS_readlinkat: ::c_int = 78; ++pub const SYS_readlink: ::c_int = 1035; ++pub const SYS_readv: ::c_int = 65; ++pub const SYS_reboot: ::c_int = 142; ++pub const SYS_recv: ::c_int = 1073; ++pub const SYS_recvfrom: ::c_int = 207; ++pub const SYS_recvmmsg: ::c_int = 243; ++pub const SYS_recvmsg: ::c_int = 212; ++pub const SYS_remap_file_pages: ::c_int = 234; ++pub const SYS_removexattr: ::c_int = 14; ++pub const SYS_renameat2: ::c_int = 276; ++pub const SYS_renameat: ::c_int = 38; ++pub const SYS_rename: ::c_int = 1034; ++pub const SYS_request_key: ::c_int = 218; ++pub const SYS_restart_syscall: ::c_int = 128; ++pub const SYS_rmdir: ::c_int = 1031; ++pub const SYS_rt_sigaction: ::c_int = 134; ++pub const SYS_rt_sigpending: ::c_int = 136; ++pub const SYS_rt_sigprocmask: ::c_int = 135; ++pub const SYS_rt_sigqueueinfo: ::c_int = 138; ++pub const SYS_rt_sigreturn: ::c_int = 139; ++pub const SYS_rt_sigsuspend: ::c_int = 133; ++pub const SYS_rt_sigtimedwait: ::c_int = 137; ++pub const SYS_rt_tgsigqueueinfo: ::c_int = 240; ++pub const SYS_sched_getaffinity: ::c_int = 123; ++pub const SYS_sched_getattr: ::c_int = 275; ++pub const SYS_sched_getparam: ::c_int = 121; ++pub const SYS_sched_get_priority_max: ::c_int = 125; ++pub const SYS_sched_get_priority_min: ::c_int = 126; ++pub const SYS_sched_getscheduler: ::c_int = 120; ++pub const SYS_sched_rr_get_interval: ::c_int = 127; ++pub const SYS_sched_setaffinity: ::c_int = 122; ++pub const SYS_sched_setattr: ::c_int = 274; ++pub const SYS_sched_setparam: ::c_int = 118; ++pub const SYS_sched_setscheduler: ::c_int = 119; ++pub const SYS_sched_yield: ::c_int = 124; ++pub const SYS_seccomp: ::c_int = 277; ++pub const SYS_select: ::c_int = 1067; ++pub const SYS_semctl: ::c_int = 191; ++pub const SYS_semget: ::c_int = 190; ++pub const SYS_semop: ::c_int = 193; ++pub const SYS_semtimedop: ::c_int = 192; ++pub const SYS_send: ::c_int = 1074; ++pub const SYS_sendfile64: ::c_int = 71; ++pub const SYS_sendfile: ::c_int = 71; ++pub const SYS_sendmmsg: ::c_int = 269; ++pub const SYS_sendmsg: ::c_int = 211; ++pub const SYS_sendto: ::c_int = 206; ++pub const SYS_setdomainname: ::c_int = 162; ++pub const SYS_setfsgid: ::c_int = 152; ++pub const SYS_setfsuid: ::c_int = 151; ++pub const SYS_setgid: ::c_int = 144; ++pub const SYS_setgroups: ::c_int = 159; ++pub const SYS_sethostname: ::c_int = 161; ++pub const SYS_setitimer: ::c_int = 103; ++pub const SYS_set_mempolicy: ::c_int = 237; ++pub const SYS_setns: ::c_int = 268; ++pub const SYS_setpgid: ::c_int = 154; ++pub const SYS_setpriority: ::c_int = 140; ++pub const SYS_setregid: ::c_int = 143; ++pub const SYS_setresgid: ::c_int = 149; ++pub const SYS_setresuid: ::c_int = 147; ++pub const SYS_setreuid: ::c_int = 145; ++pub const SYS_setrlimit: ::c_int = 164; ++pub const SYS_set_robust_list: ::c_int = 99; ++pub const SYS_setsid: ::c_int = 157; ++pub const SYS_setsockopt: ::c_int = 208; ++pub const SYS_set_tid_address: ::c_int = 96; ++pub const SYS_settimeofday: ::c_int = 170; ++pub const SYS_setuid: ::c_int = 146; ++pub const SYS_setxattr: ::c_int = 5; ++pub const SYS_shmat: ::c_int = 196; ++pub const SYS_shmctl: ::c_int = 195; ++pub const SYS_shmdt: ::c_int = 197; ++pub const SYS_shmget: ::c_int = 194; ++pub const SYS_shutdown: ::c_int = 210; ++pub const SYS_sigaltstack: ::c_int = 132; ++pub const SYS_signalfd4: ::c_int = 74; ++pub const SYS_signalfd: ::c_int = 1045; ++pub const SYS_socket: ::c_int = 198; ++pub const SYS_socketpair: ::c_int = 199; ++pub const SYS_splice: ::c_int = 76; ++pub const SYS_stat64: ::c_int = 1038; ++pub const SYS_stat: ::c_int = 1038; ++pub const SYS_statfs64: ::c_int = 43; ++pub const SYS_swapoff: ::c_int = 225; ++pub const SYS_swapon: ::c_int = 224; ++pub const SYS_symlinkat: ::c_int = 36; ++pub const SYS_symlink: ::c_int = 1036; ++pub const SYS_sync: ::c_int = 81; ++pub const SYS_sync_file_range2: ::c_int = 84; ++pub const SYS_sync_file_range: ::c_int = 84; ++pub const SYS_syncfs: ::c_int = 267; ++pub const SYS_syscalls: ::c_int = 1080; ++pub const SYS__sysctl: ::c_int = 1078; ++pub const SYS_sysinfo: ::c_int = 179; ++pub const SYS_syslog: ::c_int = 116; ++pub const SYS_tee: ::c_int = 77; ++pub const SYS_tgkill: ::c_int = 131; ++pub const SYS_time: ::c_int = 1062; ++pub const SYS_timer_create: ::c_int = 107; ++pub const SYS_timer_delete: ::c_int = 111; ++pub const SYS_timerfd_create: ::c_int = 85; ++pub const SYS_timerfd_gettime: ::c_int = 87; ++pub const SYS_timerfd_settime: ::c_int = 86; ++pub const SYS_timer_getoverrun: ::c_int = 109; ++pub const SYS_timer_gettime: ::c_int = 108; ++pub const SYS_timer_settime: ::c_int = 110; ++pub const SYS_times: ::c_int = 153; ++pub const SYS_tkill: ::c_int = 130; ++pub const SYS_truncate64: ::c_int = 45; ++pub const SYS_truncate: ::c_int = 45; ++pub const SYS_umask: ::c_int = 166; ++pub const SYS_umount2: ::c_int = 39; ++pub const SYS_umount: ::c_int = 1076; ++pub const SYS_uname: ::c_int = 160; ++pub const SYS_unlinkat: ::c_int = 35; ++pub const SYS_unlink: ::c_int = 1026; ++pub const SYS_unshare: ::c_int = 97; ++pub const SYS_uselib: ::c_int = 1077; ++pub const SYS_ustat: ::c_int = 1070; ++pub const SYS_utime: ::c_int = 1063; ++pub const SYS_utimensat: ::c_int = 88; ++pub const SYS_utimes: ::c_int = 1037; ++pub const SYS_vfork: ::c_int = 1071; ++pub const SYS_vhangup: ::c_int = 58; ++pub const SYS_vmsplice: ::c_int = 75; ++pub const SYS_wait4: ::c_int = 260; ++pub const SYS_waitid: ::c_int = 95; ++pub const SYS_write: ::c_int = 64; ++pub const SYS_writev: ::c_int = 66; ++pub const SYS_statx: ::c_int = 291; ++pub const TCFLSH: ::c_int = 21515; ++pub const TCGETA: ::c_int = 21509; ++pub const TCGETS: ::c_int = 21505; ++pub const TCGETX: ::c_int = 21554; ++pub const TCSBRK: ::c_int = 21513; ++pub const TCSBRKP: ::c_int = 21541; ++pub const TCSETA: ::c_int = 21510; ++pub const TCSETAF: ::c_int = 21512; ++pub const TCSETAW: ::c_int = 21511; ++pub const TCSETS: ::c_int = 21506; ++pub const TCSETSF: ::c_int = 21508; ++pub const TCSETSW: ::c_int = 21507; ++pub const TCSETX: ::c_int = 21555; ++pub const TCSETXF: ::c_int = 21556; ++pub const TCSETXW: ::c_int = 21557; ++pub const TCXONC: ::c_int = 21514; ++pub const TIOCCONS: ::c_int = 21533; ++pub const TIOCEXCL: ::c_int = 21516; ++pub const TIOCGETD: ::c_int = 21540; ++pub const TIOCGICOUNT: ::c_int = 21597; ++pub const TIOCGLCKTRMIOS: ::c_int = 21590; ++pub const TIOCGPGRP: ::c_int = 21519; ++pub const TIOCGRS485: ::c_int = 21550; ++pub const TIOCGSERIAL: ::c_int = 21534; ++pub const TIOCGSID: ::c_int = 21545; ++pub const TIOCGSOFTCAR: ::c_int = 21529; ++pub const TIOCGWINSZ: ::c_int = 21523; ++pub const TIOCLINUX: ::c_int = 21532; ++pub const TIOCMBIC: ::c_int = 21527; ++pub const TIOCMBIS: ::c_int = 21526; ++pub const TIOCM_CAR: ::c_int = 64; ++pub const TIOCM_CD: ::c_int = 64; ++pub const TIOCM_CTS: ::c_int = 32; ++pub const TIOCM_DSR: ::c_int = 256; ++pub const TIOCM_DTR: ::c_int = 2; ++pub const TIOCMGET: ::c_int = 21525; ++pub const TIOCMIWAIT: ::c_int = 21596; ++pub const TIOCM_LE: ::c_int = 1; ++pub const TIOCM_LOOP: ::c_int = 32768; ++pub const TIOCM_OUT1: ::c_int = 8192; ++pub const TIOCM_OUT2: ::c_int = 16384; ++pub const TIOCM_RI: ::c_int = 128; ++pub const TIOCM_RNG: ::c_int = 128; ++pub const TIOCM_RTS: ::c_int = 4; ++pub const TIOCMSET: ::c_int = 21528; ++pub const TIOCM_SR: ::c_int = 16; ++pub const TIOCM_ST: ::c_int = 8; ++pub const TIOCNOTTY: ::c_int = 21538; ++pub const TIOCNXCL: ::c_int = 21517; ++pub const TIOCOUTQ: ::c_int = 21521; ++pub const TIOCPKT: ::c_int = 21536; ++pub const TIOCPKT_DATA: ::c_int = 0; ++pub const TIOCPKT_DOSTOP: ::c_int = 32; ++pub const TIOCPKT_FLUSHREAD: ::c_int = 1; ++pub const TIOCPKT_FLUSHWRITE: ::c_int = 2; ++pub const TIOCPKT_IOCTL: ::c_int = 64; ++pub const TIOCPKT_NOSTOP: ::c_int = 16; ++pub const TIOCPKT_START: ::c_int = 8; ++pub const TIOCPKT_STOP: ::c_int = 4; ++pub const TIOCSCTTY: ::c_int = 21518; ++pub const TIOCSERCONFIG: ::c_int = 21587; ++pub const TIOCSERGETLSR: ::c_int = 21593; ++pub const TIOCSERGETMULTI: ::c_int = 21594; ++pub const TIOCSERGSTRUCT: ::c_int = 21592; ++pub const TIOCSERGWILD: ::c_int = 21588; ++pub const TIOCSERSETMULTI: ::c_int = 21595; ++pub const TIOCSERSWILD: ::c_int = 21589; ++pub const TIOCSER_TEMT: ::c_int = 1; ++pub const TIOCSETD: ::c_int = 21539; ++pub const TIOCSLCKTRMIOS: ::c_int = 21591; ++pub const TIOCSPGRP: ::c_int = 21520; ++pub const TIOCSRS485: ::c_int = 21551; ++pub const TIOCSSERIAL: ::c_int = 21535; ++pub const TIOCSSOFTCAR: ::c_int = 21530; ++pub const TIOCSTI: ::c_int = 21522; ++pub const TIOCSWINSZ: ::c_int = 21524; ++pub const TIOCVHANGUP: ::c_int = 21559; ++pub const TOSTOP: ::c_int = 256; ++pub const VEOF: ::c_int = 4; ++pub const VEOL2: ::c_int = 16; ++pub const VEOL: ::c_int = 11; ++pub const VMIN: ::c_int = 6; +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs b/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..8c228ebab72cec19c6359b5b51d508c21f4f9000 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs +@@ -0,0 +1,7 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(8))] ++ pub struct max_align_t { ++ priv_: [f32; 4] ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/mips.rs b/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/mips/mod.rs +similarity index 84% +rename from third_party/rust/libc/src/unix/linux_like/linux/musl/b32/mips.rs +rename to third_party/rust/libc/src/unix/linux_like/linux/musl/b32/mips/mod.rs +index 8da21cac51a8158dede64acaadf65b63343f5108..7dfac784d9b29057e9f1527de87e7002ace61615 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/mips.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/mips/mod.rs +@@ -161,6 +161,24 @@ s! { + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } ++ ++ pub struct nlmsghdr { ++ pub nlmsg_len: u32, ++ pub nlmsg_type: u16, ++ pub nlmsg_flags: u16, ++ pub nlmsg_seq: u32, ++ pub nlmsg_pid: u32, ++ } ++ ++ pub struct nlmsgerr { ++ pub error: ::c_int, ++ pub msg: nlmsghdr, ++ } ++ ++ pub struct nlattr { ++ pub nla_len: u16, ++ pub nla_type: u16, ++ } + } + + pub const SIGSTKSZ: ::size_t = 8192; +@@ -189,12 +207,12 @@ 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 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; +@@ -228,14 +246,14 @@ pub const NOFLSH: ::tcflag_t = 0x00000080; + pub const CIBAUD: ::tcflag_t = 0o02003600000; + pub const CBAUDEX: ::tcflag_t = 0o010000; + pub const VSWTC: usize = 7; +-pub const OLCUC: ::tcflag_t = 0o000002; +-pub const NLDLY: ::tcflag_t = 0o000400; +-pub const CRDLY: ::tcflag_t = 0o003000; ++pub const OLCUC: ::tcflag_t = 0o000002; ++pub const NLDLY: ::tcflag_t = 0o000400; ++pub const CRDLY: ::tcflag_t = 0o003000; + pub const TABDLY: ::tcflag_t = 0o014000; +-pub const BSDLY: ::tcflag_t = 0o020000; +-pub const FFDLY: ::tcflag_t = 0o100000; +-pub const VTDLY: ::tcflag_t = 0o040000; +-pub const XTABS: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const XTABS: ::tcflag_t = 0o014000; + pub const B57600: ::speed_t = 0o010001; + pub const B115200: ::speed_t = 0o010002; + pub const B230400: ::speed_t = 0o010003; +@@ -428,6 +446,9 @@ pub const F_GETOWN: ::c_int = 23; + pub const F_SETLK: ::c_int = 34; + pub const F_SETLKW: ::c_int = 35; + pub const F_SETOWN: ::c_int = 24; ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; + + pub const VEOF: usize = 16; + pub const VEOL: usize = 17; +@@ -496,91 +517,91 @@ pub const SYS_close: ::c_long = 4000 + 6; + pub const SYS_waitpid: ::c_long = 4000 + 7; + pub const SYS_creat: ::c_long = 4000 + 8; + pub const SYS_link: ::c_long = 4000 + 9; +-pub const SYS_unlink: ::c_long = 4000 + 10; +-pub const SYS_execve: ::c_long = 4000 + 11; +-pub const SYS_chdir: ::c_long = 4000 + 12; +-pub const SYS_time: ::c_long = 4000 + 13; +-pub const SYS_mknod: ::c_long = 4000 + 14; +-pub const SYS_chmod: ::c_long = 4000 + 15; +-pub const SYS_lchown: ::c_long = 4000 + 16; +-pub const SYS_break: ::c_long = 4000 + 17; +-pub const SYS_lseek: ::c_long = 4000 + 19; +-pub const SYS_getpid: ::c_long = 4000 + 20; +-pub const SYS_mount: ::c_long = 4000 + 21; +-pub const SYS_umount: ::c_long = 4000 + 22; +-pub const SYS_setuid: ::c_long = 4000 + 23; +-pub const SYS_getuid: ::c_long = 4000 + 24; +-pub const SYS_stime: ::c_long = 4000 + 25; +-pub const SYS_ptrace: ::c_long = 4000 + 26; +-pub const SYS_alarm: ::c_long = 4000 + 27; +-pub const SYS_pause: ::c_long = 4000 + 29; +-pub const SYS_utime: ::c_long = 4000 + 30; +-pub const SYS_stty: ::c_long = 4000 + 31; +-pub const SYS_gtty: ::c_long = 4000 + 32; +-pub const SYS_access: ::c_long = 4000 + 33; +-pub const SYS_nice: ::c_long = 4000 + 34; +-pub const SYS_ftime: ::c_long = 4000 + 35; +-pub const SYS_sync: ::c_long = 4000 + 36; +-pub const SYS_kill: ::c_long = 4000 + 37; +-pub const SYS_rename: ::c_long = 4000 + 38; +-pub const SYS_mkdir: ::c_long = 4000 + 39; +-pub const SYS_rmdir: ::c_long = 4000 + 40; +-pub const SYS_dup: ::c_long = 4000 + 41; +-pub const SYS_pipe: ::c_long = 4000 + 42; +-pub const SYS_times: ::c_long = 4000 + 43; +-pub const SYS_prof: ::c_long = 4000 + 44; +-pub const SYS_brk: ::c_long = 4000 + 45; +-pub const SYS_setgid: ::c_long = 4000 + 46; +-pub const SYS_getgid: ::c_long = 4000 + 47; +-pub const SYS_signal: ::c_long = 4000 + 48; +-pub const SYS_geteuid: ::c_long = 4000 + 49; +-pub const SYS_getegid: ::c_long = 4000 + 50; +-pub const SYS_acct: ::c_long = 4000 + 51; +-pub const SYS_umount2: ::c_long = 4000 + 52; +-pub const SYS_lock: ::c_long = 4000 + 53; +-pub const SYS_ioctl: ::c_long = 4000 + 54; +-pub const SYS_fcntl: ::c_long = 4000 + 55; +-pub const SYS_mpx: ::c_long = 4000 + 56; +-pub const SYS_setpgid: ::c_long = 4000 + 57; +-pub const SYS_ulimit: ::c_long = 4000 + 58; +-pub const SYS_umask: ::c_long = 4000 + 60; +-pub const SYS_chroot: ::c_long = 4000 + 61; +-pub const SYS_ustat: ::c_long = 4000 + 62; +-pub const SYS_dup2: ::c_long = 4000 + 63; +-pub const SYS_getppid: ::c_long = 4000 + 64; +-pub const SYS_getpgrp: ::c_long = 4000 + 65; +-pub const SYS_setsid: ::c_long = 4000 + 66; +-pub const SYS_sigaction: ::c_long = 4000 + 67; +-pub const SYS_sgetmask: ::c_long = 4000 + 68; +-pub const SYS_ssetmask: ::c_long = 4000 + 69; +-pub const SYS_setreuid: ::c_long = 4000 + 70; +-pub const SYS_setregid: ::c_long = 4000 + 71; +-pub const SYS_sigsuspend: ::c_long = 4000 + 72; +-pub const SYS_sigpending: ::c_long = 4000 + 73; +-pub const SYS_sethostname: ::c_long = 4000 + 74; +-pub const SYS_setrlimit: ::c_long = 4000 + 75; +-pub const SYS_getrlimit: ::c_long = 4000 + 76; +-pub const SYS_getrusage: ::c_long = 4000 + 77; +-pub const SYS_gettimeofday: ::c_long = 4000 + 78; +-pub const SYS_settimeofday: ::c_long = 4000 + 79; +-pub const SYS_getgroups: ::c_long = 4000 + 80; +-pub const SYS_setgroups: ::c_long = 4000 + 81; +-pub const SYS_symlink: ::c_long = 4000 + 83; +-pub const SYS_readlink: ::c_long = 4000 + 85; +-pub const SYS_uselib: ::c_long = 4000 + 86; +-pub const SYS_swapon: ::c_long = 4000 + 87; +-pub const SYS_reboot: ::c_long = 4000 + 88; +-pub const SYS_readdir: ::c_long = 4000 + 89; +-pub const SYS_mmap: ::c_long = 4000 + 90; +-pub const SYS_munmap: ::c_long = 4000 + 91; +-pub const SYS_truncate: ::c_long = 4000 + 92; +-pub const SYS_ftruncate: ::c_long = 4000 + 93; +-pub const SYS_fchmod: ::c_long = 4000 + 94; +-pub const SYS_fchown: ::c_long = 4000 + 95; +-pub const SYS_getpriority: ::c_long = 4000 + 96; +-pub const SYS_setpriority: ::c_long = 4000 + 97; +-pub const SYS_profil: ::c_long = 4000 + 98; +-pub const SYS_statfs: ::c_long = 4000 + 99; ++pub const SYS_unlink: ::c_long = 4000 + 10; ++pub const SYS_execve: ::c_long = 4000 + 11; ++pub const SYS_chdir: ::c_long = 4000 + 12; ++pub const SYS_time: ::c_long = 4000 + 13; ++pub const SYS_mknod: ::c_long = 4000 + 14; ++pub const SYS_chmod: ::c_long = 4000 + 15; ++pub const SYS_lchown: ::c_long = 4000 + 16; ++pub const SYS_break: ::c_long = 4000 + 17; ++pub const SYS_lseek: ::c_long = 4000 + 19; ++pub const SYS_getpid: ::c_long = 4000 + 20; ++pub const SYS_mount: ::c_long = 4000 + 21; ++pub const SYS_umount: ::c_long = 4000 + 22; ++pub const SYS_setuid: ::c_long = 4000 + 23; ++pub const SYS_getuid: ::c_long = 4000 + 24; ++pub const SYS_stime: ::c_long = 4000 + 25; ++pub const SYS_ptrace: ::c_long = 4000 + 26; ++pub const SYS_alarm: ::c_long = 4000 + 27; ++pub const SYS_pause: ::c_long = 4000 + 29; ++pub const SYS_utime: ::c_long = 4000 + 30; ++pub const SYS_stty: ::c_long = 4000 + 31; ++pub const SYS_gtty: ::c_long = 4000 + 32; ++pub const SYS_access: ::c_long = 4000 + 33; ++pub const SYS_nice: ::c_long = 4000 + 34; ++pub const SYS_ftime: ::c_long = 4000 + 35; ++pub const SYS_sync: ::c_long = 4000 + 36; ++pub const SYS_kill: ::c_long = 4000 + 37; ++pub const SYS_rename: ::c_long = 4000 + 38; ++pub const SYS_mkdir: ::c_long = 4000 + 39; ++pub const SYS_rmdir: ::c_long = 4000 + 40; ++pub const SYS_dup: ::c_long = 4000 + 41; ++pub const SYS_pipe: ::c_long = 4000 + 42; ++pub const SYS_times: ::c_long = 4000 + 43; ++pub const SYS_prof: ::c_long = 4000 + 44; ++pub const SYS_brk: ::c_long = 4000 + 45; ++pub const SYS_setgid: ::c_long = 4000 + 46; ++pub const SYS_getgid: ::c_long = 4000 + 47; ++pub const SYS_signal: ::c_long = 4000 + 48; ++pub const SYS_geteuid: ::c_long = 4000 + 49; ++pub const SYS_getegid: ::c_long = 4000 + 50; ++pub const SYS_acct: ::c_long = 4000 + 51; ++pub const SYS_umount2: ::c_long = 4000 + 52; ++pub const SYS_lock: ::c_long = 4000 + 53; ++pub const SYS_ioctl: ::c_long = 4000 + 54; ++pub const SYS_fcntl: ::c_long = 4000 + 55; ++pub const SYS_mpx: ::c_long = 4000 + 56; ++pub const SYS_setpgid: ::c_long = 4000 + 57; ++pub const SYS_ulimit: ::c_long = 4000 + 58; ++pub const SYS_umask: ::c_long = 4000 + 60; ++pub const SYS_chroot: ::c_long = 4000 + 61; ++pub const SYS_ustat: ::c_long = 4000 + 62; ++pub const SYS_dup2: ::c_long = 4000 + 63; ++pub const SYS_getppid: ::c_long = 4000 + 64; ++pub const SYS_getpgrp: ::c_long = 4000 + 65; ++pub const SYS_setsid: ::c_long = 4000 + 66; ++pub const SYS_sigaction: ::c_long = 4000 + 67; ++pub const SYS_sgetmask: ::c_long = 4000 + 68; ++pub const SYS_ssetmask: ::c_long = 4000 + 69; ++pub const SYS_setreuid: ::c_long = 4000 + 70; ++pub const SYS_setregid: ::c_long = 4000 + 71; ++pub const SYS_sigsuspend: ::c_long = 4000 + 72; ++pub const SYS_sigpending: ::c_long = 4000 + 73; ++pub const SYS_sethostname: ::c_long = 4000 + 74; ++pub const SYS_setrlimit: ::c_long = 4000 + 75; ++pub const SYS_getrlimit: ::c_long = 4000 + 76; ++pub const SYS_getrusage: ::c_long = 4000 + 77; ++pub const SYS_gettimeofday: ::c_long = 4000 + 78; ++pub const SYS_settimeofday: ::c_long = 4000 + 79; ++pub const SYS_getgroups: ::c_long = 4000 + 80; ++pub const SYS_setgroups: ::c_long = 4000 + 81; ++pub const SYS_symlink: ::c_long = 4000 + 83; ++pub const SYS_readlink: ::c_long = 4000 + 85; ++pub const SYS_uselib: ::c_long = 4000 + 86; ++pub const SYS_swapon: ::c_long = 4000 + 87; ++pub const SYS_reboot: ::c_long = 4000 + 88; ++pub const SYS_readdir: ::c_long = 4000 + 89; ++pub const SYS_mmap: ::c_long = 4000 + 90; ++pub const SYS_munmap: ::c_long = 4000 + 91; ++pub const SYS_truncate: ::c_long = 4000 + 92; ++pub const SYS_ftruncate: ::c_long = 4000 + 93; ++pub const SYS_fchmod: ::c_long = 4000 + 94; ++pub const SYS_fchown: ::c_long = 4000 + 95; ++pub const SYS_getpriority: ::c_long = 4000 + 96; ++pub const SYS_setpriority: ::c_long = 4000 + 97; ++pub const SYS_profil: ::c_long = 4000 + 98; ++pub const SYS_statfs: ::c_long = 4000 + 99; + pub const SYS_fstatfs: ::c_long = 4000 + 100; + pub const SYS_ioperm: ::c_long = 4000 + 101; + pub const SYS_socketcall: ::c_long = 4000 + 102; +@@ -836,3 +857,14 @@ pub const SYS_mlock2: ::c_long = 4000 + 359; + pub const SYS_copy_file_range: ::c_long = 4000 + 360; + pub const SYS_preadv2: ::c_long = 4000 + 361; + pub const SYS_pwritev2: ::c_long = 4000 + 362; ++pub const SYS_pkey_mprotect: ::c_long = 4000 + 363; ++pub const SYS_pkey_alloc: ::c_long = 4000 + 364; ++pub const SYS_pkey_free: ::c_long = 4000 + 365; ++pub const SYS_statx: ::c_long = 4000 + 366; ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/mod.rs b/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/mod.rs +index 4128a8e4da6d083375a0dbce3d3383a360f471c7..f54e5d9c8cae9cff742929c2891cfe46d13b4cfe 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/mod.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/mod.rs +@@ -3,6 +3,7 @@ pub type c_ulong = u32; + pub type nlink_t = u32; + pub type blksize_t = ::c_long; + pub type __u64 = ::c_ulonglong; ++pub type regoff_t = ::c_int; + + s! { + pub struct pthread_attr_t { +@@ -39,7 +40,7 @@ pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; + + pub const TIOCINQ: ::c_int = ::FIONREAD; + +-extern { ++extern "C" { + pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; + } + +@@ -56,6 +57,9 @@ cfg_if! { + } else if #[cfg(any(target_arch = "powerpc"))] { + mod powerpc; + pub use self::powerpc::*; ++ } else if #[cfg(any(target_arch = "hexagon"))] { ++ mod hexagon; ++ pub use self::hexagon::*; + } else { + // Unknown target_arch + } +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs b/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs +index 76f23dd318af10f9797cc12b67eefca98bc7adfd..b94bb7b15ee5a6eecf6cfe2b5926399f5e296d61 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs +@@ -182,12 +182,12 @@ pub const CBAUD: ::tcflag_t = 0o0000377; + pub const TAB1: ::c_int = 0x00000400; + pub const TAB2: ::c_int = 0x00000800; + pub const TAB3: ::c_int = 0x00000C00; +-pub const CR1: ::c_int = 0x00001000; +-pub const CR2: ::c_int = 0x00002000; +-pub const CR3: ::c_int = 0x00003000; +-pub const FF1: ::c_int = 0x00004000; +-pub const BS1: ::c_int = 0x00008000; +-pub const VT1: ::c_int = 0x00010000; ++pub const CR1: ::c_int = 0x00001000; ++pub const CR2: ::c_int = 0x00002000; ++pub const CR3: ::c_int = 0x00003000; ++pub const FF1: ::c_int = 0x00004000; ++pub const BS1: ::c_int = 0x00008000; ++pub const VT1: ::c_int = 0x00010000; + pub const VWERASE: usize = 10; + pub const VREPRINT: usize = 11; + pub const VSUSP: usize = 12; +@@ -221,14 +221,14 @@ pub const NOFLSH: ::tcflag_t = 0x80000000; + pub const CIBAUD: ::tcflag_t = 0o00077600000; + pub const CBAUDEX: ::tcflag_t = 0o000020; + pub const VSWTC: usize = 9; +-pub const OLCUC: ::tcflag_t = 0o000004; +-pub const NLDLY: ::tcflag_t = 0o001400; +-pub const CRDLY: ::tcflag_t = 0o030000; ++pub const OLCUC: ::tcflag_t = 0o000004; ++pub const NLDLY: ::tcflag_t = 0o001400; ++pub const CRDLY: ::tcflag_t = 0o030000; + pub const TABDLY: ::tcflag_t = 0o006000; +-pub const BSDLY: ::tcflag_t = 0o100000; +-pub const FFDLY: ::tcflag_t = 0o040000; +-pub const VTDLY: ::tcflag_t = 0o200000; +-pub const XTABS: ::tcflag_t = 0o006000; ++pub const BSDLY: ::tcflag_t = 0o100000; ++pub const FFDLY: ::tcflag_t = 0o040000; ++pub const VTDLY: ::tcflag_t = 0o200000; ++pub const XTABS: ::tcflag_t = 0o006000; + pub const B57600: ::speed_t = 0o000020; + pub const B115200: ::speed_t = 0o000021; + pub const B230400: ::speed_t = 0o000022; +@@ -421,6 +421,9 @@ pub const F_GETOWN: ::c_int = 9; + pub const F_SETLK: ::c_int = 13; + pub const F_SETLKW: ::c_int = 14; + pub const F_SETOWN: ::c_int = 8; ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; + + pub const VEOF: usize = 4; + pub const VEOL: usize = 6; +@@ -854,7 +857,7 @@ pub const SYS_pkey_alloc: ::c_long = 384; + pub const SYS_pkey_free: ::c_long = 385; + pub const SYS_pkey_mprotect: ::c_long = 386; + +-extern { ++extern "C" { + pub fn getrandom( + buf: *mut ::c_void, + buflen: ::size_t, +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs b/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..79544176a88c92012772362fd005c65a954e7369 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs +@@ -0,0 +1,7 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(8))] ++ pub struct max_align_t { ++ priv_: [f64; 3] ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/x86.rs b/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs +similarity index 96% +rename from third_party/rust/libc/src/unix/linux_like/linux/musl/b32/x86.rs +rename to third_party/rust/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs +index 91c5945ac287e79ef799c7cd8c8fd11c0eb6c202..9d00b5253bef06d4922fc9ffaf814c50ad3a62d8 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/x86.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs +@@ -154,9 +154,27 @@ s! { + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } ++ ++ pub struct nlmsghdr { ++ pub nlmsg_len: u32, ++ pub nlmsg_type: u16, ++ pub nlmsg_flags: u16, ++ pub nlmsg_seq: u32, ++ pub nlmsg_pid: u32, ++ } ++ ++ pub struct nlmsgerr { ++ pub error: ::c_int, ++ pub msg: nlmsghdr, ++ } ++ ++ pub struct nlattr { ++ pub nla_len: u16, ++ pub nla_type: u16, ++ } + } + +-s_no_extra_traits!{ ++s_no_extra_traits! { + pub struct ucontext_t { + pub uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, +@@ -239,12 +257,12 @@ 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 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; +@@ -278,14 +296,14 @@ pub const NOFLSH: ::tcflag_t = 0x00000080; + pub const CIBAUD: ::tcflag_t = 0o02003600000; + pub const CBAUDEX: ::tcflag_t = 0o010000; + pub const VSWTC: usize = 7; +-pub const OLCUC: ::tcflag_t = 0o000002; +-pub const NLDLY: ::tcflag_t = 0o000400; +-pub const CRDLY: ::tcflag_t = 0o003000; ++pub const OLCUC: ::tcflag_t = 0o000002; ++pub const NLDLY: ::tcflag_t = 0o000400; ++pub const CRDLY: ::tcflag_t = 0o003000; + pub const TABDLY: ::tcflag_t = 0o014000; +-pub const BSDLY: ::tcflag_t = 0o020000; +-pub const FFDLY: ::tcflag_t = 0o100000; +-pub const VTDLY: ::tcflag_t = 0o040000; +-pub const XTABS: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const XTABS: ::tcflag_t = 0o014000; + pub const B57600: ::speed_t = 0o010001; + pub const B115200: ::speed_t = 0o010002; + pub const B230400: ::speed_t = 0o010003; +@@ -322,6 +340,7 @@ pub const MAP_NORESERVE: ::c_int = 0x04000; + pub const MAP_POPULATE: ::c_int = 0x08000; + pub const MAP_NONBLOCK: ::c_int = 0x010000; + pub const MAP_STACK: ::c_int = 0x020000; ++pub const MAP_SYNC : ::c_int = 0x080000; + + pub const SOCK_STREAM: ::c_int = 1; + pub const SOCK_DGRAM: ::c_int = 2; +@@ -479,6 +498,9 @@ pub const F_GETOWN: ::c_int = 9; + pub const F_SETLK: ::c_int = 13; + pub const F_SETLKW: ::c_int = 14; + pub const F_SETOWN: ::c_int = 8; ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; + + pub const VEOF: usize = 4; + pub const VEOL: usize = 11; +@@ -914,8 +936,10 @@ pub const SYS_mlock2: ::c_long = 376; + pub const SYS_copy_file_range: ::c_long = 377; + pub const SYS_preadv2: ::c_long = 378; + pub const SYS_pwritev2: ::c_long = 379; +-// FIXME syscalls 380-382 have been added in musl 1.16 +-// See discussion https://github.com/rust-lang/libc/pull/699 ++pub const SYS_pkey_mprotect: ::c_long = 380; ++pub const SYS_pkey_alloc: ::c_long = 381; ++pub const SYS_pkey_free: ::c_long = 382; ++pub const SYS_statx: ::c_long = 383; + + // offsets in user_regs_structs, from sys/reg.h + pub const EBX: ::c_int = 0; +@@ -936,10 +960,17 @@ pub const EFL: ::c_int = 14; + pub const UESP: ::c_int = 15; + pub const SS: ::c_int = 16; + +-extern { ++extern "C" { + pub fn getrandom( + buf: *mut ::c_void, + buflen: ::size_t, + flags: ::c_uint, + ) -> ::ssize_t; + } ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs b/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..8e949963a637fb4b171c1a3649cf6c2ef8d30a1d +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs +@@ -0,0 +1,7 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f32; 8] ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/aarch64.rs b/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs +similarity index 72% +rename from third_party/rust/libc/src/unix/linux_like/linux/musl/b64/aarch64.rs +rename to third_party/rust/libc/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs +index 9b2a7c3e67a3f23975ecfe9c4294836a6b7a78da..d7e06cd21c91a6ccae647f4735e41ac9bfa20387 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/aarch64.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs +@@ -62,10 +62,180 @@ s! { + } + } + ++pub const O_APPEND: ::c_int = 1024; + pub const O_DIRECT: ::c_int = 0x10000; + pub const O_DIRECTORY: ::c_int = 0x4000; + pub const O_LARGEFILE: ::c_int = 0x20000; + pub const O_NOFOLLOW: ::c_int = 0x8000; ++pub const O_CREAT: ::c_int = 64; ++pub const O_EXCL: ::c_int = 128; ++pub const O_NOCTTY: ::c_int = 256; ++pub const O_NONBLOCK: ::c_int = 2048; ++pub const O_SYNC: ::c_int = 1052672; ++pub const O_RSYNC: ::c_int = 1052672; ++pub const O_DSYNC: ::c_int = 4096; ++pub const O_ASYNC: ::c_int = 0x2000; ++ ++pub const ENAMETOOLONG: ::c_int = 36; ++pub const ENOLCK: ::c_int = 37; ++pub const ENOSYS: ::c_int = 38; ++pub const ENOTEMPTY: ::c_int = 39; ++pub const ELOOP: ::c_int = 40; ++pub const ENOMSG: ::c_int = 42; ++pub const EIDRM: ::c_int = 43; ++pub const ECHRNG: ::c_int = 44; ++pub const EL2NSYNC: ::c_int = 45; ++pub const EL3HLT: ::c_int = 46; ++pub const EL3RST: ::c_int = 47; ++pub const ELNRNG: ::c_int = 48; ++pub const EUNATCH: ::c_int = 49; ++pub const ENOCSI: ::c_int = 50; ++pub const EL2HLT: ::c_int = 51; ++pub const EBADE: ::c_int = 52; ++pub const EBADR: ::c_int = 53; ++pub const EXFULL: ::c_int = 54; ++pub const ENOANO: ::c_int = 55; ++pub const EBADRQC: ::c_int = 56; ++pub const EBADSLT: ::c_int = 57; ++pub const EMULTIHOP: ::c_int = 72; ++pub const EBADMSG: ::c_int = 74; ++pub const EOVERFLOW: ::c_int = 75; ++pub const ENOTUNIQ: ::c_int = 76; ++pub const EBADFD: ::c_int = 77; ++pub const EREMCHG: ::c_int = 78; ++pub const ELIBACC: ::c_int = 79; ++pub const ELIBBAD: ::c_int = 80; ++pub const ELIBSCN: ::c_int = 81; ++pub const ELIBMAX: ::c_int = 82; ++pub const ELIBEXEC: ::c_int = 83; ++pub const EILSEQ: ::c_int = 84; ++pub const ERESTART: ::c_int = 85; ++pub const ESTRPIPE: ::c_int = 86; ++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; ++pub const ECONNRESET: ::c_int = 104; ++pub const ENOBUFS: ::c_int = 105; ++pub const EISCONN: ::c_int = 106; ++pub const ENOTCONN: ::c_int = 107; ++pub const ESHUTDOWN: ::c_int = 108; ++pub const ETOOMANYREFS: ::c_int = 109; ++pub const ETIMEDOUT: ::c_int = 110; ++pub const ECONNREFUSED: ::c_int = 111; ++pub const EHOSTDOWN: ::c_int = 112; ++pub const EHOSTUNREACH: ::c_int = 113; ++pub const EALREADY: ::c_int = 114; ++pub const EINPROGRESS: ::c_int = 115; ++pub const ESTALE: ::c_int = 116; ++pub const EUCLEAN: ::c_int = 117; ++pub const ENOTNAM: ::c_int = 118; ++pub const ENAVAIL: ::c_int = 119; ++pub const EISNAM: ::c_int = 120; ++pub const EREMOTEIO: ::c_int = 121; ++pub const EDQUOT: ::c_int = 122; ++pub const ENOMEDIUM: ::c_int = 123; ++pub const EMEDIUMTYPE: ::c_int = 124; ++pub const ECANCELED: ::c_int = 125; ++pub const ENOKEY: ::c_int = 126; ++pub const EKEYEXPIRED: ::c_int = 127; ++pub const EKEYREVOKED: ::c_int = 128; ++pub const EKEYREJECTED: ::c_int = 129; ++pub const EOWNERDEAD: ::c_int = 130; ++pub const ENOTRECOVERABLE: ::c_int = 131; ++pub const ERFKILL: ::c_int = 132; ++pub const EHWPOISON: ::c_int = 133; ++ ++pub const MAP_ANON: ::c_int = 0x0020; ++pub const MAP_GROWSDOWN: ::c_int = 0x0100; ++pub const MAP_DENYWRITE: ::c_int = 0x0800; ++pub const MAP_EXECUTABLE: ::c_int = 0x01000; ++pub const MAP_LOCKED: ::c_int = 0x02000; ++pub const MAP_NORESERVE: ::c_int = 0x04000; ++pub const MAP_POPULATE: ::c_int = 0x08000; ++pub const MAP_NONBLOCK: ::c_int = 0x010000; ++pub const MAP_STACK: ::c_int = 0x020000; ++pub const MAP_HUGETLB: ::c_int = 0x040000; ++pub const MAP_SYNC : ::c_int = 0x080000; ++ ++pub const SOCK_STREAM: ::c_int = 1; ++pub const SOCK_DGRAM: ::c_int = 2; ++pub const SOL_SOCKET: ::c_int = 1; ++pub const SO_REUSEADDR: ::c_int = 2; ++pub const SO_TYPE: ::c_int = 3; ++pub const SO_ERROR: ::c_int = 4; ++pub const SO_DONTROUTE: ::c_int = 5; ++pub const SO_BROADCAST: ::c_int = 6; ++pub const SO_SNDBUF: ::c_int = 7; ++pub const SO_RCVBUF: ::c_int = 8; ++pub const SO_KEEPALIVE: ::c_int = 9; ++pub const SO_OOBINLINE: ::c_int = 10; ++pub const SO_NO_CHECK: ::c_int = 11; ++pub const SO_PRIORITY: ::c_int = 12; ++pub const SO_LINGER: ::c_int = 13; ++pub const SO_BSDCOMPAT: ::c_int = 14; ++pub const SO_REUSEPORT: ::c_int = 15; ++pub const SO_ACCEPTCONN: ::c_int = 30; ++pub const SO_SNDBUFFORCE: ::c_int = 32; ++pub const SO_RCVBUFFORCE: ::c_int = 33; ++pub const SO_PROTOCOL: ::c_int = 38; ++pub const SO_DOMAIN: ::c_int = 39; ++ ++pub const SA_ONSTACK: ::c_int = 0x08000000; ++pub const SA_SIGINFO: ::c_int = 0x00000004; ++pub const SA_NOCLDWAIT: ::c_int = 0x00000002; ++ ++pub const SIGCHLD: ::c_int = 17; ++pub const SIGBUS: ::c_int = 7; ++pub const SIGTTIN: ::c_int = 21; ++pub const SIGTTOU: ::c_int = 22; ++pub const SIGXCPU: ::c_int = 24; ++pub const SIGXFSZ: ::c_int = 25; ++pub const SIGVTALRM: ::c_int = 26; ++pub const SIGPROF: ::c_int = 27; ++pub const SIGWINCH: ::c_int = 28; ++pub const SIGUSR1: ::c_int = 10; ++pub const SIGUSR2: ::c_int = 12; ++pub const SIGCONT: ::c_int = 18; ++pub const SIGSTOP: ::c_int = 19; ++pub const SIGTSTP: ::c_int = 20; ++pub const SIGURG: ::c_int = 23; ++pub const SIGIO: ::c_int = 29; ++pub const SIGSYS: ::c_int = 31; ++pub const SIGSTKFLT: ::c_int = 16; ++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 F_GETLK: ::c_int = 5; ++pub const F_GETOWN: ::c_int = 9; ++pub const F_SETLK: ::c_int = 6; ++pub const F_SETLKW: ::c_int = 7; ++pub const F_SETOWN: ::c_int = 8; ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; ++ ++pub const VEOF: usize = 4; ++ ++pub const POLLWRNORM: ::c_short = 0x100; ++pub const POLLWRBAND: ::c_short = 0x200; + + pub const MINSIGSTKSZ: ::size_t = 6144; + pub const SIGSTKSZ: ::size_t = 12288; +@@ -96,6 +266,7 @@ pub const SYS_epoll_ctl: ::c_long = 21; + pub const SYS_epoll_pwait: ::c_long = 22; + pub const SYS_dup: ::c_long = 23; + pub const SYS_dup3: ::c_long = 24; ++pub const SYS_fcntl: ::c_long = 25; + pub const SYS_inotify_init1: ::c_long = 26; + pub const SYS_inotify_add_watch: ::c_long = 27; + pub const SYS_inotify_rm_watch: ::c_long = 28; +@@ -128,6 +299,7 @@ pub const SYS_vhangup: ::c_long = 58; + pub const SYS_pipe2: ::c_long = 59; + pub const SYS_quotactl: ::c_long = 60; + pub const SYS_getdents64: ::c_long = 61; ++pub const SYS_lseek: ::c_long = 62; + pub const SYS_read: ::c_long = 63; + pub const SYS_write: ::c_long = 64; + pub const SYS_readv: ::c_long = 65; +@@ -143,6 +315,8 @@ pub const SYS_vmsplice: ::c_long = 75; + pub const SYS_splice: ::c_long = 76; + pub const SYS_tee: ::c_long = 77; + pub const SYS_readlinkat: ::c_long = 78; ++pub const SYS_newfstatat: ::c_long = 79; ++pub const SYS_fstat: ::c_long = 80; + pub const SYS_sync: ::c_long = 81; + pub const SYS_fsync: ::c_long = 82; + pub const SYS_fdatasync: ::c_long = 83; +@@ -284,6 +458,7 @@ pub const SYS_request_key: ::c_long = 218; + pub const SYS_keyctl: ::c_long = 219; + pub const SYS_clone: ::c_long = 220; + pub const SYS_execve: ::c_long = 221; ++pub const SYS_mmap: ::c_long = 222; + pub const SYS_swapon: ::c_long = 224; + pub const SYS_swapoff: ::c_long = 225; + pub const SYS_mprotect: ::c_long = 226; +@@ -335,6 +510,7 @@ pub const SYS_pwritev2: ::c_long = 287; + pub const SYS_pkey_mprotect: ::c_long = 288; + pub const SYS_pkey_alloc: ::c_long = 289; + pub const SYS_pkey_free: ::c_long = 290; ++pub const SYS_statx: ::c_long = 291; + + pub const RLIMIT_NLIMITS: ::c_int = 15; + pub const TIOCINQ: ::c_int = ::FIONREAD; +@@ -344,12 +520,12 @@ 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 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; +@@ -383,14 +559,14 @@ pub const NOFLSH: ::tcflag_t = 0x00000080; + pub const CIBAUD: ::tcflag_t = 0o02003600000; + pub const CBAUDEX: ::tcflag_t = 0o010000; + pub const VSWTC: usize = 7; +-pub const OLCUC: ::tcflag_t = 0o000002; +-pub const NLDLY: ::tcflag_t = 0o000400; +-pub const CRDLY: ::tcflag_t = 0o003000; ++pub const OLCUC: ::tcflag_t = 0o000002; ++pub const NLDLY: ::tcflag_t = 0o000400; ++pub const CRDLY: ::tcflag_t = 0o003000; + pub const TABDLY: ::tcflag_t = 0o014000; +-pub const BSDLY: ::tcflag_t = 0o020000; +-pub const FFDLY: ::tcflag_t = 0o100000; +-pub const VTDLY: ::tcflag_t = 0o040000; +-pub const XTABS: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const XTABS: ::tcflag_t = 0o014000; + pub const B57600: ::speed_t = 0o010001; + pub const B115200: ::speed_t = 0o010002; + pub const B230400: ::speed_t = 0o010003; +@@ -471,6 +647,13 @@ pub const TIOCM_DSR: ::c_int = 0x100; + pub const TIOCM_CD: ::c_int = TIOCM_CAR; + pub const TIOCM_RI: ::c_int = TIOCM_RNG; + +-extern { ++extern "C" { + pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; + } ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/mips64.rs b/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/mips64.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..7c6f96390591713a1237a820d4cd16b9929268e5 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/mips64.rs +@@ -0,0 +1,775 @@ ++pub type c_char = i8; ++pub type wchar_t = i32; ++pub type __u64 = ::c_ulong; ++pub type nlink_t = u64; ++pub type blksize_t = i64; ++ ++s! { ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ __pad1: [::c_int; 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: ::dev_t, ++ __pad2: [::c_uint; 2], ++ pub st_size: ::off_t, ++ __pad3: ::c_int, ++ 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, ++ __pad4: ::c_uint, ++ pub st_blocks: ::blkcnt_t, ++ __pad5: [::c_int; 14], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: ::dev_t, ++ __pad1: [::c_int; 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: ::dev_t, ++ __pad2: [::c_uint; 2], ++ pub st_size: ::off_t, ++ __pad3: ::c_int, ++ 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, ++ __pad4: ::c_uint, ++ pub st_blocks: ::blkcnt_t, ++ __pad5: [::c_int; 14], ++ } ++ ++ 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, ++ pub f_fsid: ::fsid_t, ++ pub f_namelen: ::c_ulong, ++ pub f_frsize: ::c_ulong, ++ pub f_flags: ::c_ulong, ++ pub f_spare: [::c_ulong; 5], ++ } ++ ++ pub struct statfs64 { ++ 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, ++ pub f_fsid: ::fsid_t, ++ pub f_namelen: ::c_ulong, ++ pub f_frsize: ::c_ulong, ++ pub f_flags: ::c_ulong, ++ pub f_spare: [::c_ulong; 5], ++ } ++ ++ pub struct nlmsghdr { ++ pub nlmsg_len: u32, ++ pub nlmsg_type: u16, ++ pub nlmsg_flags: u16, ++ pub nlmsg_seq: u32, ++ pub nlmsg_pid: u32, ++ } ++ ++ pub struct nlmsgerr { ++ pub error: ::c_int, ++ pub msg: nlmsghdr, ++ } ++ ++ pub struct nlattr { ++ pub nla_len: u16, ++ pub nla_type: u16, ++ } ++ ++ pub struct ipc_perm { ++ pub __ipc_perm_key: ::key_t, ++ pub uid: ::uid_t, ++ pub gid: ::gid_t, ++ pub cuid: ::uid_t, ++ pub cgid: ::gid_t, ++ pub mode: ::mode_t, ++ pub __seq: ::c_int, ++ __pad1: ::c_int, ++ __unused1: ::c_ulong, ++ __unused2: ::c_ulong ++ } ++} ++ ++pub const SIGSTKSZ: ::size_t = 8192; ++pub const MINSIGSTKSZ: ::size_t = 2048; ++ ++pub const SYS_read: ::c_long = 5000 + 0; ++pub const SYS_write: ::c_long = 5000 + 1; ++pub const SYS_open: ::c_long = 5000 + 2; ++pub const SYS_close: ::c_long = 5000 + 3; ++pub const SYS_stat: ::c_long = 5000 + 4; ++pub const SYS_fstat: ::c_long = 5000 + 5; ++pub const SYS_lstat: ::c_long = 5000 + 6; ++pub const SYS_poll: ::c_long = 5000 + 7; ++pub const SYS_lseek: ::c_long = 5000 + 8; ++pub const SYS_mmap: ::c_long = 5000 + 9; ++pub const SYS_mprotect: ::c_long = 5000 + 10; ++pub const SYS_munmap: ::c_long = 5000 + 11; ++pub const SYS_brk: ::c_long = 5000 + 12; ++pub const SYS_rt_sigaction: ::c_long = 5000 + 13; ++pub const SYS_rt_sigprocmask: ::c_long = 5000 + 14; ++pub const SYS_ioctl: ::c_long = 5000 + 15; ++pub const SYS_pread64: ::c_long = 5000 + 16; ++pub const SYS_pwrite64: ::c_long = 5000 + 17; ++pub const SYS_readv: ::c_long = 5000 + 18; ++pub const SYS_writev: ::c_long = 5000 + 19; ++pub const SYS_access: ::c_long = 5000 + 20; ++pub const SYS_pipe: ::c_long = 5000 + 21; ++pub const SYS__newselect: ::c_long = 5000 + 22; ++pub const SYS_sched_yield: ::c_long = 5000 + 23; ++pub const SYS_mremap: ::c_long = 5000 + 24; ++pub const SYS_msync: ::c_long = 5000 + 25; ++pub const SYS_mincore: ::c_long = 5000 + 26; ++pub const SYS_madvise: ::c_long = 5000 + 27; ++pub const SYS_shmget: ::c_long = 5000 + 28; ++pub const SYS_shmat: ::c_long = 5000 + 29; ++pub const SYS_shmctl: ::c_long = 5000 + 30; ++pub const SYS_dup: ::c_long = 5000 + 31; ++pub const SYS_dup2: ::c_long = 5000 + 32; ++pub const SYS_pause: ::c_long = 5000 + 33; ++pub const SYS_nanosleep: ::c_long = 5000 + 34; ++pub const SYS_getitimer: ::c_long = 5000 + 35; ++pub const SYS_setitimer: ::c_long = 5000 + 36; ++pub const SYS_alarm: ::c_long = 5000 + 37; ++pub const SYS_getpid: ::c_long = 5000 + 38; ++pub const SYS_sendfile: ::c_long = 5000 + 39; ++pub const SYS_socket: ::c_long = 5000 + 40; ++pub const SYS_connect: ::c_long = 5000 + 41; ++pub const SYS_accept: ::c_long = 5000 + 42; ++pub const SYS_sendto: ::c_long = 5000 + 43; ++pub const SYS_recvfrom: ::c_long = 5000 + 44; ++pub const SYS_sendmsg: ::c_long = 5000 + 45; ++pub const SYS_recvmsg: ::c_long = 5000 + 46; ++pub const SYS_shutdown: ::c_long = 5000 + 47; ++pub const SYS_bind: ::c_long = 5000 + 48; ++pub const SYS_listen: ::c_long = 5000 + 49; ++pub const SYS_getsockname: ::c_long = 5000 + 50; ++pub const SYS_getpeername: ::c_long = 5000 + 51; ++pub const SYS_socketpair: ::c_long = 5000 + 52; ++pub const SYS_setsockopt: ::c_long = 5000 + 53; ++pub const SYS_getsockopt: ::c_long = 5000 + 54; ++pub const SYS_clone: ::c_long = 5000 + 55; ++pub const SYS_fork: ::c_long = 5000 + 56; ++pub const SYS_execve: ::c_long = 5000 + 57; ++pub const SYS_exit: ::c_long = 5000 + 58; ++pub const SYS_wait4: ::c_long = 5000 + 59; ++pub const SYS_kill: ::c_long = 5000 + 60; ++pub const SYS_uname: ::c_long = 5000 + 61; ++pub const SYS_semget: ::c_long = 5000 + 62; ++pub const SYS_semop: ::c_long = 5000 + 63; ++pub const SYS_semctl: ::c_long = 5000 + 64; ++pub const SYS_shmdt: ::c_long = 5000 + 65; ++pub const SYS_msgget: ::c_long = 5000 + 66; ++pub const SYS_msgsnd: ::c_long = 5000 + 67; ++pub const SYS_msgrcv: ::c_long = 5000 + 68; ++pub const SYS_msgctl: ::c_long = 5000 + 69; ++pub const SYS_fcntl: ::c_long = 5000 + 70; ++pub const SYS_flock: ::c_long = 5000 + 71; ++pub const SYS_fsync: ::c_long = 5000 + 72; ++pub const SYS_fdatasync: ::c_long = 5000 + 73; ++pub const SYS_truncate: ::c_long = 5000 + 74; ++pub const SYS_ftruncate: ::c_long = 5000 + 75; ++pub const SYS_getdents: ::c_long = 5000 + 76; ++pub const SYS_getcwd: ::c_long = 5000 + 77; ++pub const SYS_chdir: ::c_long = 5000 + 78; ++pub const SYS_fchdir: ::c_long = 5000 + 79; ++pub const SYS_rename: ::c_long = 5000 + 80; ++pub const SYS_mkdir: ::c_long = 5000 + 81; ++pub const SYS_rmdir: ::c_long = 5000 + 82; ++pub const SYS_creat: ::c_long = 5000 + 83; ++pub const SYS_link: ::c_long = 5000 + 84; ++pub const SYS_unlink: ::c_long = 5000 + 85; ++pub const SYS_symlink: ::c_long = 5000 + 86; ++pub const SYS_readlink: ::c_long = 5000 + 87; ++pub const SYS_chmod: ::c_long = 5000 + 88; ++pub const SYS_fchmod: ::c_long = 5000 + 89; ++pub const SYS_chown: ::c_long = 5000 + 90; ++pub const SYS_fchown: ::c_long = 5000 + 91; ++pub const SYS_lchown: ::c_long = 5000 + 92; ++pub const SYS_umask: ::c_long = 5000 + 93; ++pub const SYS_gettimeofday: ::c_long = 5000 + 94; ++pub const SYS_getrlimit: ::c_long = 5000 + 95; ++pub const SYS_getrusage: ::c_long = 5000 + 96; ++pub const SYS_sysinfo: ::c_long = 5000 + 97; ++pub const SYS_times: ::c_long = 5000 + 98; ++pub const SYS_ptrace: ::c_long = 5000 + 99; ++pub const SYS_getuid: ::c_long = 5000 + 100; ++pub const SYS_syslog: ::c_long = 5000 + 101; ++pub const SYS_getgid: ::c_long = 5000 + 102; ++pub const SYS_setuid: ::c_long = 5000 + 103; ++pub const SYS_setgid: ::c_long = 5000 + 104; ++pub const SYS_geteuid: ::c_long = 5000 + 105; ++pub const SYS_getegid: ::c_long = 5000 + 106; ++pub const SYS_setpgid: ::c_long = 5000 + 107; ++pub const SYS_getppid: ::c_long = 5000 + 108; ++pub const SYS_getpgrp: ::c_long = 5000 + 109; ++pub const SYS_setsid: ::c_long = 5000 + 110; ++pub const SYS_setreuid: ::c_long = 5000 + 111; ++pub const SYS_setregid: ::c_long = 5000 + 112; ++pub const SYS_getgroups: ::c_long = 5000 + 113; ++pub const SYS_setgroups: ::c_long = 5000 + 114; ++pub const SYS_setresuid: ::c_long = 5000 + 115; ++pub const SYS_getresuid: ::c_long = 5000 + 116; ++pub const SYS_setresgid: ::c_long = 5000 + 117; ++pub const SYS_getresgid: ::c_long = 5000 + 118; ++pub const SYS_getpgid: ::c_long = 5000 + 119; ++pub const SYS_setfsuid: ::c_long = 5000 + 120; ++pub const SYS_setfsgid: ::c_long = 5000 + 121; ++pub const SYS_getsid: ::c_long = 5000 + 122; ++pub const SYS_capget: ::c_long = 5000 + 123; ++pub const SYS_capset: ::c_long = 5000 + 124; ++pub const SYS_rt_sigpending: ::c_long = 5000 + 125; ++pub const SYS_rt_sigtimedwait: ::c_long = 5000 + 126; ++pub const SYS_rt_sigqueueinfo: ::c_long = 5000 + 127; ++pub const SYS_rt_sigsuspend: ::c_long = 5000 + 128; ++pub const SYS_sigaltstack: ::c_long = 5000 + 129; ++pub const SYS_utime: ::c_long = 5000 + 130; ++pub const SYS_mknod: ::c_long = 5000 + 131; ++pub const SYS_personality: ::c_long = 5000 + 132; ++pub const SYS_ustat: ::c_long = 5000 + 133; ++pub const SYS_statfs: ::c_long = 5000 + 134; ++pub const SYS_fstatfs: ::c_long = 5000 + 135; ++pub const SYS_sysfs: ::c_long = 5000 + 136; ++pub const SYS_getpriority: ::c_long = 5000 + 137; ++pub const SYS_setpriority: ::c_long = 5000 + 138; ++pub const SYS_sched_setparam: ::c_long = 5000 + 139; ++pub const SYS_sched_getparam: ::c_long = 5000 + 140; ++pub const SYS_sched_setscheduler: ::c_long = 5000 + 141; ++pub const SYS_sched_getscheduler: ::c_long = 5000 + 142; ++pub const SYS_sched_get_priority_max: ::c_long = 5000 + 143; ++pub const SYS_sched_get_priority_min: ::c_long = 5000 + 144; ++pub const SYS_sched_rr_get_interval: ::c_long = 5000 + 145; ++pub const SYS_mlock: ::c_long = 5000 + 146; ++pub const SYS_munlock: ::c_long = 5000 + 147; ++pub const SYS_mlockall: ::c_long = 5000 + 148; ++pub const SYS_munlockall: ::c_long = 5000 + 149; ++pub const SYS_vhangup: ::c_long = 5000 + 150; ++pub const SYS_pivot_root: ::c_long = 5000 + 151; ++pub const SYS__sysctl: ::c_long = 5000 + 152; ++pub const SYS_prctl: ::c_long = 5000 + 153; ++pub const SYS_adjtimex: ::c_long = 5000 + 154; ++pub const SYS_setrlimit: ::c_long = 5000 + 155; ++pub const SYS_chroot: ::c_long = 5000 + 156; ++pub const SYS_sync: ::c_long = 5000 + 157; ++pub const SYS_acct: ::c_long = 5000 + 158; ++pub const SYS_settimeofday: ::c_long = 5000 + 159; ++pub const SYS_mount: ::c_long = 5000 + 160; ++pub const SYS_umount2: ::c_long = 5000 + 161; ++pub const SYS_swapon: ::c_long = 5000 + 162; ++pub const SYS_swapoff: ::c_long = 5000 + 163; ++pub const SYS_reboot: ::c_long = 5000 + 164; ++pub const SYS_sethostname: ::c_long = 5000 + 165; ++pub const SYS_setdomainname: ::c_long = 5000 + 166; ++pub const SYS_create_module: ::c_long = 5000 + 167; ++pub const SYS_init_module: ::c_long = 5000 + 168; ++pub const SYS_delete_module: ::c_long = 5000 + 169; ++pub const SYS_get_kernel_syms: ::c_long = 5000 + 170; ++pub const SYS_query_module: ::c_long = 5000 + 171; ++pub const SYS_quotactl: ::c_long = 5000 + 172; ++pub const SYS_nfsservctl: ::c_long = 5000 + 173; ++pub const SYS_getpmsg: ::c_long = 5000 + 174; ++pub const SYS_putpmsg: ::c_long = 5000 + 175; ++pub const SYS_afs_syscall: ::c_long = 5000 + 176; ++pub const SYS_gettid: ::c_long = 5000 + 178; ++pub const SYS_readahead: ::c_long = 5000 + 179; ++pub const SYS_setxattr: ::c_long = 5000 + 180; ++pub const SYS_lsetxattr: ::c_long = 5000 + 181; ++pub const SYS_fsetxattr: ::c_long = 5000 + 182; ++pub const SYS_getxattr: ::c_long = 5000 + 183; ++pub const SYS_lgetxattr: ::c_long = 5000 + 184; ++pub const SYS_fgetxattr: ::c_long = 5000 + 185; ++pub const SYS_listxattr: ::c_long = 5000 + 186; ++pub const SYS_llistxattr: ::c_long = 5000 + 187; ++pub const SYS_flistxattr: ::c_long = 5000 + 188; ++pub const SYS_removexattr: ::c_long = 5000 + 189; ++pub const SYS_lremovexattr: ::c_long = 5000 + 190; ++pub const SYS_fremovexattr: ::c_long = 5000 + 191; ++pub const SYS_tkill: ::c_long = 5000 + 192; ++pub const SYS_futex: ::c_long = 5000 + 194; ++pub const SYS_sched_setaffinity: ::c_long = 5000 + 195; ++pub const SYS_sched_getaffinity: ::c_long = 5000 + 196; ++pub const SYS_cacheflush: ::c_long = 5000 + 197; ++pub const SYS_cachectl: ::c_long = 5000 + 198; ++pub const SYS_sysmips: ::c_long = 5000 + 199; ++pub const SYS_io_setup: ::c_long = 5000 + 200; ++pub const SYS_io_destroy: ::c_long = 5000 + 201; ++pub const SYS_io_getevents: ::c_long = 5000 + 202; ++pub const SYS_io_submit: ::c_long = 5000 + 203; ++pub const SYS_io_cancel: ::c_long = 5000 + 204; ++pub const SYS_exit_group: ::c_long = 5000 + 205; ++pub const SYS_lookup_dcookie: ::c_long = 5000 + 206; ++pub const SYS_epoll_create: ::c_long = 5000 + 207; ++pub const SYS_epoll_ctl: ::c_long = 5000 + 208; ++pub const SYS_epoll_wait: ::c_long = 5000 + 209; ++pub const SYS_remap_file_pages: ::c_long = 5000 + 210; ++pub const SYS_rt_sigreturn: ::c_long = 5000 + 211; ++pub const SYS_set_tid_address: ::c_long = 5000 + 212; ++pub const SYS_restart_syscall: ::c_long = 5000 + 213; ++pub const SYS_semtimedop: ::c_long = 5000 + 214; ++pub const SYS_fadvise64: ::c_long = 5000 + 215; ++pub const SYS_timer_create: ::c_long = 5000 + 216; ++pub const SYS_timer_settime: ::c_long = 5000 + 217; ++pub const SYS_timer_gettime: ::c_long = 5000 + 218; ++pub const SYS_timer_getoverrun: ::c_long = 5000 + 219; ++pub const SYS_timer_delete: ::c_long = 5000 + 220; ++pub const SYS_clock_settime: ::c_long = 5000 + 221; ++pub const SYS_clock_gettime: ::c_long = 5000 + 222; ++pub const SYS_clock_getres: ::c_long = 5000 + 223; ++pub const SYS_clock_nanosleep: ::c_long = 5000 + 224; ++pub const SYS_tgkill: ::c_long = 5000 + 225; ++pub const SYS_utimes: ::c_long = 5000 + 226; ++pub const SYS_mbind: ::c_long = 5000 + 227; ++pub const SYS_get_mempolicy: ::c_long = 5000 + 228; ++pub const SYS_set_mempolicy: ::c_long = 5000 + 229; ++pub const SYS_mq_open: ::c_long = 5000 + 230; ++pub const SYS_mq_unlink: ::c_long = 5000 + 231; ++pub const SYS_mq_timedsend: ::c_long = 5000 + 232; ++pub const SYS_mq_timedreceive: ::c_long = 5000 + 233; ++pub const SYS_mq_notify: ::c_long = 5000 + 234; ++pub const SYS_mq_getsetattr: ::c_long = 5000 + 235; ++pub const SYS_vserver: ::c_long = 5000 + 236; ++pub const SYS_waitid: ::c_long = 5000 + 237; ++/* pub const SYS_sys_setaltroot: ::c_long = 5000 + 238; */ ++pub const SYS_add_key: ::c_long = 5000 + 239; ++pub const SYS_request_key: ::c_long = 5000 + 240; ++pub const SYS_keyctl: ::c_long = 5000 + 241; ++pub const SYS_set_thread_area: ::c_long = 5000 + 242; ++pub const SYS_inotify_init: ::c_long = 5000 + 243; ++pub const SYS_inotify_add_watch: ::c_long = 5000 + 244; ++pub const SYS_inotify_rm_watch: ::c_long = 5000 + 245; ++pub const SYS_migrate_pages: ::c_long = 5000 + 246; ++pub const SYS_openat: ::c_long = 5000 + 247; ++pub const SYS_mkdirat: ::c_long = 5000 + 248; ++pub const SYS_mknodat: ::c_long = 5000 + 249; ++pub const SYS_fchownat: ::c_long = 5000 + 250; ++pub const SYS_futimesat: ::c_long = 5000 + 251; ++pub const SYS_newfstatat: ::c_long = 5000 + 252; ++pub const SYS_unlinkat: ::c_long = 5000 + 253; ++pub const SYS_renameat: ::c_long = 5000 + 254; ++pub const SYS_linkat: ::c_long = 5000 + 255; ++pub const SYS_symlinkat: ::c_long = 5000 + 256; ++pub const SYS_readlinkat: ::c_long = 5000 + 257; ++pub const SYS_fchmodat: ::c_long = 5000 + 258; ++pub const SYS_faccessat: ::c_long = 5000 + 259; ++pub const SYS_pselect6: ::c_long = 5000 + 260; ++pub const SYS_ppoll: ::c_long = 5000 + 261; ++pub const SYS_unshare: ::c_long = 5000 + 262; ++pub const SYS_splice: ::c_long = 5000 + 263; ++pub const SYS_sync_file_range: ::c_long = 5000 + 264; ++pub const SYS_tee: ::c_long = 5000 + 265; ++pub const SYS_vmsplice: ::c_long = 5000 + 266; ++pub const SYS_move_pages: ::c_long = 5000 + 267; ++pub const SYS_set_robust_list: ::c_long = 5000 + 268; ++pub const SYS_get_robust_list: ::c_long = 5000 + 269; ++pub const SYS_kexec_load: ::c_long = 5000 + 270; ++pub const SYS_getcpu: ::c_long = 5000 + 271; ++pub const SYS_epoll_pwait: ::c_long = 5000 + 272; ++pub const SYS_ioprio_set: ::c_long = 5000 + 273; ++pub const SYS_ioprio_get: ::c_long = 5000 + 274; ++pub const SYS_utimensat: ::c_long = 5000 + 275; ++pub const SYS_signalfd: ::c_long = 5000 + 276; ++pub const SYS_timerfd: ::c_long = 5000 + 277; ++pub const SYS_eventfd: ::c_long = 5000 + 278; ++pub const SYS_fallocate: ::c_long = 5000 + 279; ++pub const SYS_timerfd_create: ::c_long = 5000 + 280; ++pub const SYS_timerfd_gettime: ::c_long = 5000 + 281; ++pub const SYS_timerfd_settime: ::c_long = 5000 + 282; ++pub const SYS_signalfd4: ::c_long = 5000 + 283; ++pub const SYS_eventfd2: ::c_long = 5000 + 284; ++pub const SYS_epoll_create1: ::c_long = 5000 + 285; ++pub const SYS_dup3: ::c_long = 5000 + 286; ++pub const SYS_pipe2: ::c_long = 5000 + 287; ++pub const SYS_inotify_init1: ::c_long = 5000 + 288; ++pub const SYS_preadv: ::c_long = 5000 + 289; ++pub const SYS_pwritev: ::c_long = 5000 + 290; ++pub const SYS_rt_tgsigqueueinfo: ::c_long = 5000 + 291; ++pub const SYS_perf_event_open: ::c_long = 5000 + 292; ++pub const SYS_accept4: ::c_long = 5000 + 293; ++pub const SYS_recvmmsg: ::c_long = 5000 + 294; ++pub const SYS_fanotify_init: ::c_long = 5000 + 295; ++pub const SYS_fanotify_mark: ::c_long = 5000 + 296; ++pub const SYS_prlimit64: ::c_long = 5000 + 297; ++pub const SYS_name_to_handle_at: ::c_long = 5000 + 298; ++pub const SYS_open_by_handle_at: ::c_long = 5000 + 299; ++pub const SYS_clock_adjtime: ::c_long = 5000 + 300; ++pub const SYS_syncfs: ::c_long = 5000 + 301; ++pub const SYS_sendmmsg: ::c_long = 5000 + 302; ++pub const SYS_setns: ::c_long = 5000 + 303; ++pub const SYS_process_vm_readv: ::c_long = 5000 + 304; ++pub const SYS_process_vm_writev: ::c_long = 5000 + 305; ++pub const SYS_kcmp: ::c_long = 5000 + 306; ++pub const SYS_finit_module: ::c_long = 5000 + 307; ++pub const SYS_getdents64: ::c_long = 5000 + 308; ++pub const SYS_sched_setattr: ::c_long = 5000 + 309; ++pub const SYS_sched_getattr: ::c_long = 5000 + 310; ++pub const SYS_renameat2: ::c_long = 5000 + 311; ++pub const SYS_seccomp: ::c_long = 5000 + 312; ++pub const SYS_getrandom: ::c_long = 5000 + 313; ++pub const SYS_memfd_create: ::c_long = 5000 + 314; ++pub const SYS_bpf: ::c_long = 5000 + 315; ++pub const SYS_execveat: ::c_long = 5000 + 316; ++pub const SYS_userfaultfd: ::c_long = 5000 + 317; ++pub const SYS_membarrier: ::c_long = 5000 + 318; ++pub const SYS_mlock2: ::c_long = 5000 + 319; ++pub const SYS_copy_file_range: ::c_long = 5000 + 320; ++pub const SYS_preadv2: ::c_long = 5000 + 321; ++pub const SYS_pwritev2: ::c_long = 5000 + 322; ++pub const SYS_pkey_mprotect: ::c_long = 5000 + 323; ++pub const SYS_pkey_alloc: ::c_long = 5000 + 324; ++pub const SYS_pkey_free: ::c_long = 5000 + 325; ++pub const SYS_statx: ::c_long = 5000 + 326; ++ ++pub const O_DIRECT: ::c_int = 0x8000; ++pub const O_DIRECTORY: ::c_int = 0x10000; ++pub const O_NOFOLLOW: ::c_int = 0x20000; ++ ++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_ASYNC: ::c_int = 0x1000; ++ ++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 MAP_ANON: ::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_NORESERVE: ::c_int = 0x400; ++pub const MAP_POPULATE: ::c_int = 0x10000; ++pub const MAP_NONBLOCK: ::c_int = 0x20000; ++pub const MAP_STACK: ::c_int = 0x40000; ++pub const MAP_HUGETLB: ::c_int = 0x080000; ++ ++pub const SOCK_STREAM: ::c_int = 2; ++pub const SOCK_DGRAM: ::c_int = 1; ++ ++pub const SOL_SOCKET: ::c_int = 0xffff; ++ ++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_LINGER: ::c_int = 0x0080; ++pub const SO_OOBINLINE: ::c_int = 0x0100; ++pub const SO_REUSEPORT: ::c_int = 0x0200; ++pub const SO_TYPE: ::c_int = 0x1008; ++pub const SO_ERROR: ::c_int = 0x1007; ++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_SNDTIMEO: ::c_int = 0x1005; ++pub const SO_RCVTIMEO: ::c_int = 0x1006; ++pub const SO_ACCEPTCONN: ::c_int = 0x1009; ++pub const SO_PROTOCOL: ::c_int = 0x1028; ++pub const SO_DOMAIN: ::c_int = 0x1029; ++pub const SO_NO_CHECK: ::c_int = 11; ++pub const SO_PRIORITY: ::c_int = 12; ++pub const SO_BSDCOMPAT: ::c_int = 14; ++pub const SO_PASSCRED: ::c_int = 17; ++pub const SO_PEERCRED: ::c_int = 18; ++pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22; ++pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23; ++pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24; ++pub const SO_ATTACH_FILTER: ::c_int = 26; ++pub const SO_DETACH_FILTER: ::c_int = 27; ++pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER; ++pub const SO_PEERNAME: ::c_int = 28; ++pub const SO_PEERSEC: ::c_int = 30; ++pub const SO_SNDBUFFORCE: ::c_int = 31; ++pub const SO_RCVBUFFORCE: ::c_int = 33; ++pub const SO_PASSSEC: ::c_int = 34; ++pub const SO_TIMESTAMPNS: ::c_int = 35; ++pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS; ++pub const SO_WIFI_STATUS: ::c_int = 41; ++pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS; ++pub const SO_NOFCS: ::c_int = 43; ++pub const SO_LOCK_FILTER: ::c_int = 44; ++pub const SO_SELECT_ERR_QUEUE: ::c_int = 45; ++pub const SO_MAX_PACING_RATE: ::c_int = 47; ++pub const SO_BPF_EXTENSIONS: ::c_int = 48; ++pub const SO_INCOMING_CPU: ::c_int = 49; ++pub const SO_ATTACH_BPF: ::c_int = 50; ++pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER; ++ ++pub const FIOCLEX: ::c_int = 0x6601; ++pub const FIONCLEX: ::c_int = 0x6602; ++pub const FIONBIO: ::c_int = 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 POLLWRNORM: ::c_short = 0x004; ++pub const POLLWRBAND: ::c_short = 0x100; ++ ++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 EXTPROC: ::tcflag_t = 0o200000; ++ ++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 F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; ++ ++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 MCL_CURRENT: ::c_int = 0x0001; ++pub const MCL_FUTURE: ::c_int = 0x0002; ++ ++pub const CBAUD: ::tcflag_t = 0o0010017; ++pub const TAB1: ::tcflag_t = 0x00000800; ++pub const TAB2: ::tcflag_t = 0x00001000; ++pub const TAB3: ::tcflag_t = 0x00001800; ++pub const CR1: ::tcflag_t = 0x00000200; ++pub const CR2: ::tcflag_t = 0x00000400; ++pub const CR3: ::tcflag_t = 0x00000600; ++pub const FF1: ::tcflag_t = 0x00008000; ++pub const BS1: ::tcflag_t = 0x00002000; ++pub const VT1: ::tcflag_t = 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; ++pub const CIBAUD: ::tcflag_t = 0o02003600000; ++pub const CBAUDEX: ::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: ::tcflag_t = 0o000002; ++pub const NLDLY: ::tcflag_t = 0o000400; ++pub const CRDLY: ::tcflag_t = 0o003000; ++pub const TABDLY: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const XTABS: ::tcflag_t = 0o014000; ++ ++pub const BOTHER: ::speed_t = 0o010000; ++pub const B57600: ::speed_t = 0o010001; ++pub const B115200: ::speed_t = 0o010002; ++pub const B230400: ::speed_t = 0o010003; ++pub const B460800: ::speed_t = 0o010004; ++pub const B500000: ::speed_t = 0o010005; ++pub const B576000: ::speed_t = 0o010006; ++pub const B921600: ::speed_t = 0o010007; ++pub const B1000000: ::speed_t = 0o010010; ++pub const B1152000: ::speed_t = 0o010011; ++pub const B1500000: ::speed_t = 0o010012; ++pub const B2000000: ::speed_t = 0o010013; ++pub const B2500000: ::speed_t = 0o010014; ++pub const B3000000: ::speed_t = 0o010015; ++pub const B3500000: ::speed_t = 0o010016; ++pub const B4000000: ::speed_t = 0o010017; ++ ++pub const TIOCM_ST: ::c_int = 0x010; ++pub const TIOCM_SR: ::c_int = 0x020; ++pub const TIOCM_CTS: ::c_int = 0x040; ++pub const TIOCM_CAR: ::c_int = 0x100; ++pub const TIOCM_RNG: ::c_int = 0x200; ++pub const TIOCM_DSR: ::c_int = 0x400; ++ ++pub const EHWPOISON: ::c_int = 168; ++ ++extern "C" { ++ pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/mod.rs b/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/mod.rs +index 12d5c849f6dc42c406f561af6f9f46a636c72175..62abee00d882724e4ec11be9ad0b377bbd1137bb 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/mod.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/mod.rs +@@ -1,5 +1,6 @@ + pub type c_long = i64; + pub type c_ulong = u64; ++pub type regoff_t = ::c_long; + + s! { + pub struct statfs64 { +@@ -132,187 +133,17 @@ s! { + pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; + pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; + +-pub const O_ASYNC: ::c_int = 0x2000; +- + pub const RLIMIT_RSS: ::c_int = 5; + pub const RLIMIT_NOFILE: ::c_int = 7; + pub const RLIMIT_AS: ::c_int = 9; + pub const RLIMIT_NPROC: ::c_int = 6; + pub const RLIMIT_MEMLOCK: ::c_int = 8; + +-pub const O_APPEND: ::c_int = 1024; +-pub const O_CREAT: ::c_int = 64; +-pub const O_EXCL: ::c_int = 128; +-pub const O_NOCTTY: ::c_int = 256; +-pub const O_NONBLOCK: ::c_int = 2048; +-pub const O_SYNC: ::c_int = 1052672; +-pub const O_RSYNC: ::c_int = 1052672; +-pub const O_DSYNC: ::c_int = 4096; +- + pub const SOCK_NONBLOCK: ::c_int = 2048; + +-pub const MAP_ANON: ::c_int = 0x0020; +-pub const MAP_GROWSDOWN: ::c_int = 0x0100; +-pub const MAP_DENYWRITE: ::c_int = 0x0800; +-pub const MAP_EXECUTABLE: ::c_int = 0x01000; +-pub const MAP_LOCKED: ::c_int = 0x02000; +-pub const MAP_NORESERVE: ::c_int = 0x04000; +-pub const MAP_POPULATE: ::c_int = 0x08000; +-pub const MAP_NONBLOCK: ::c_int = 0x010000; +-pub const MAP_STACK: ::c_int = 0x020000; +- +-pub const SOCK_STREAM: ::c_int = 1; +-pub const SOCK_DGRAM: ::c_int = 2; + pub const SOCK_SEQPACKET: ::c_int = 5; + +-pub const SOL_SOCKET: ::c_int = 1; +- +-pub const ENAMETOOLONG: ::c_int = 36; +-pub const ENOLCK: ::c_int = 37; +-pub const ENOSYS: ::c_int = 38; +-pub const ENOTEMPTY: ::c_int = 39; +-pub const ELOOP: ::c_int = 40; +-pub const ENOMSG: ::c_int = 42; +-pub const EIDRM: ::c_int = 43; +-pub const ECHRNG: ::c_int = 44; +-pub const EL2NSYNC: ::c_int = 45; +-pub const EL3HLT: ::c_int = 46; +-pub const EL3RST: ::c_int = 47; +-pub const ELNRNG: ::c_int = 48; +-pub const EUNATCH: ::c_int = 49; +-pub const ENOCSI: ::c_int = 50; +-pub const EL2HLT: ::c_int = 51; +-pub const EBADE: ::c_int = 52; +-pub const EBADR: ::c_int = 53; +-pub const EXFULL: ::c_int = 54; +-pub const ENOANO: ::c_int = 55; +-pub const EBADRQC: ::c_int = 56; +-pub const EBADSLT: ::c_int = 57; +-pub const EMULTIHOP: ::c_int = 72; +-pub const EBADMSG: ::c_int = 74; +-pub const EOVERFLOW: ::c_int = 75; +-pub const ENOTUNIQ: ::c_int = 76; +-pub const EBADFD: ::c_int = 77; +-pub const EREMCHG: ::c_int = 78; +-pub const ELIBACC: ::c_int = 79; +-pub const ELIBBAD: ::c_int = 80; +-pub const ELIBSCN: ::c_int = 81; +-pub const ELIBMAX: ::c_int = 82; +-pub const ELIBEXEC: ::c_int = 83; +-pub const EILSEQ: ::c_int = 84; +-pub const ERESTART: ::c_int = 85; +-pub const ESTRPIPE: ::c_int = 86; +-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; +-pub const ECONNRESET: ::c_int = 104; +-pub const ENOBUFS: ::c_int = 105; +-pub const EISCONN: ::c_int = 106; +-pub const ENOTCONN: ::c_int = 107; +-pub const ESHUTDOWN: ::c_int = 108; +-pub const ETOOMANYREFS: ::c_int = 109; +-pub const ETIMEDOUT: ::c_int = 110; +-pub const ECONNREFUSED: ::c_int = 111; +-pub const EHOSTDOWN: ::c_int = 112; +-pub const EHOSTUNREACH: ::c_int = 113; +-pub const EALREADY: ::c_int = 114; +-pub const EINPROGRESS: ::c_int = 115; +-pub const ESTALE: ::c_int = 116; +-pub const EUCLEAN: ::c_int = 117; +-pub const ENOTNAM: ::c_int = 118; +-pub const ENAVAIL: ::c_int = 119; +-pub const EISNAM: ::c_int = 120; +-pub const EREMOTEIO: ::c_int = 121; +-pub const EDQUOT: ::c_int = 122; +-pub const ENOMEDIUM: ::c_int = 123; +-pub const EMEDIUMTYPE: ::c_int = 124; +-pub const ECANCELED: ::c_int = 125; +-pub const ENOKEY: ::c_int = 126; +-pub const EKEYEXPIRED: ::c_int = 127; +-pub const EKEYREVOKED: ::c_int = 128; +-pub const EKEYREJECTED: ::c_int = 129; +-pub const EOWNERDEAD: ::c_int = 130; +-pub const ENOTRECOVERABLE: ::c_int = 131; +-pub const ERFKILL: ::c_int = 132; +-pub const EHWPOISON: ::c_int = 133; +- +-pub const SO_REUSEADDR: ::c_int = 2; +-pub const SO_TYPE: ::c_int = 3; +-pub const SO_ERROR: ::c_int = 4; +-pub const SO_DONTROUTE: ::c_int = 5; +-pub const SO_BROADCAST: ::c_int = 6; +-pub const SO_SNDBUF: ::c_int = 7; +-pub const SO_RCVBUF: ::c_int = 8; +-pub const SO_KEEPALIVE: ::c_int = 9; +-pub const SO_OOBINLINE: ::c_int = 10; +-pub const SO_NO_CHECK: ::c_int = 11; +-pub const SO_PRIORITY: ::c_int = 12; +-pub const SO_LINGER: ::c_int = 13; +-pub const SO_BSDCOMPAT: ::c_int = 14; +-pub const SO_REUSEPORT: ::c_int = 15; +-pub const SO_ACCEPTCONN: ::c_int = 30; +-pub const SO_SNDBUFFORCE: ::c_int = 32; +-pub const SO_RCVBUFFORCE: ::c_int = 33; +-pub const SO_PROTOCOL: ::c_int = 38; +-pub const SO_DOMAIN: ::c_int = 39; +- +-pub const SA_ONSTACK: ::c_int = 0x08000000; +-pub const SA_SIGINFO: ::c_int = 0x00000004; +-pub const SA_NOCLDWAIT: ::c_int = 0x00000002; +- +-pub const SIGCHLD: ::c_int = 17; +-pub const SIGBUS: ::c_int = 7; +-pub const SIGTTIN: ::c_int = 21; +-pub const SIGTTOU: ::c_int = 22; +-pub const SIGXCPU: ::c_int = 24; +-pub const SIGXFSZ: ::c_int = 25; +-pub const SIGVTALRM: ::c_int = 26; +-pub const SIGPROF: ::c_int = 27; +-pub const SIGWINCH: ::c_int = 28; +-pub const SIGUSR1: ::c_int = 10; +-pub const SIGUSR2: ::c_int = 12; +-pub const SIGCONT: ::c_int = 18; +-pub const SIGSTOP: ::c_int = 19; +-pub const SIGTSTP: ::c_int = 20; +-pub const SIGURG: ::c_int = 23; +-pub const SIGIO: ::c_int = 29; +-pub const SIGSYS: ::c_int = 31; +-pub const SIGSTKFLT: ::c_int = 16; +-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 MAP_HUGETLB: ::c_int = 0x040000; +- +-pub const F_GETLK: ::c_int = 5; +-pub const F_GETOWN: ::c_int = 9; +-pub const F_SETLK: ::c_int = 6; +-pub const F_SETLKW: ::c_int = 7; +-pub const F_SETOWN: ::c_int = 8; +- +-pub const VEOF: usize = 4; +- +-pub const POLLWRNORM: ::c_short = 0x100; +-pub const POLLWRBAND: ::c_short = 0x200; +- +-extern { ++extern "C" { + pub fn getrandom( + buf: *mut ::c_void, + buflen: ::size_t, +@@ -324,6 +155,9 @@ cfg_if! { + if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; ++ } else if #[cfg(target_arch = "mips64")] { ++ mod mips64; ++ pub use self::mips64::*; + } else if #[cfg(any(target_arch = "powerpc64"))] { + mod powerpc64; + pub use self::powerpc64::*; +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs b/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs +index 04ceb79a45d916d5d369e20e1e5c5625967db958..18fcd5c33ffdf2fb1e9fe78c7f7998f61891e07d 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs +@@ -62,10 +62,180 @@ s! { + + pub const MADV_SOFT_OFFLINE: ::c_int = 101; + pub const MAP_32BIT: ::c_int = 0x0040; ++pub const O_APPEND: ::c_int = 1024; + pub const O_DIRECT: ::c_int = 0x20000; + pub const O_DIRECTORY: ::c_int = 0x4000; + pub const O_LARGEFILE: ::c_int = 0x10000; + pub const O_NOFOLLOW: ::c_int = 0x8000; ++pub const O_CREAT: ::c_int = 64; ++pub const O_EXCL: ::c_int = 128; ++pub const O_NOCTTY: ::c_int = 256; ++pub const O_NONBLOCK: ::c_int = 2048; ++pub const O_SYNC: ::c_int = 1052672; ++pub const O_RSYNC: ::c_int = 1052672; ++pub const O_DSYNC: ::c_int = 4096; ++pub const O_ASYNC: ::c_int = 0x2000; ++ ++pub const ENAMETOOLONG: ::c_int = 36; ++pub const ENOLCK: ::c_int = 37; ++pub const ENOSYS: ::c_int = 38; ++pub const ENOTEMPTY: ::c_int = 39; ++pub const ELOOP: ::c_int = 40; ++pub const ENOMSG: ::c_int = 42; ++pub const EIDRM: ::c_int = 43; ++pub const ECHRNG: ::c_int = 44; ++pub const EL2NSYNC: ::c_int = 45; ++pub const EL3HLT: ::c_int = 46; ++pub const EL3RST: ::c_int = 47; ++pub const ELNRNG: ::c_int = 48; ++pub const EUNATCH: ::c_int = 49; ++pub const ENOCSI: ::c_int = 50; ++pub const EL2HLT: ::c_int = 51; ++pub const EBADE: ::c_int = 52; ++pub const EBADR: ::c_int = 53; ++pub const EXFULL: ::c_int = 54; ++pub const ENOANO: ::c_int = 55; ++pub const EBADRQC: ::c_int = 56; ++pub const EBADSLT: ::c_int = 57; ++pub const EMULTIHOP: ::c_int = 72; ++pub const EBADMSG: ::c_int = 74; ++pub const EOVERFLOW: ::c_int = 75; ++pub const ENOTUNIQ: ::c_int = 76; ++pub const EBADFD: ::c_int = 77; ++pub const EREMCHG: ::c_int = 78; ++pub const ELIBACC: ::c_int = 79; ++pub const ELIBBAD: ::c_int = 80; ++pub const ELIBSCN: ::c_int = 81; ++pub const ELIBMAX: ::c_int = 82; ++pub const ELIBEXEC: ::c_int = 83; ++pub const EILSEQ: ::c_int = 84; ++pub const ERESTART: ::c_int = 85; ++pub const ESTRPIPE: ::c_int = 86; ++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; ++pub const ECONNRESET: ::c_int = 104; ++pub const ENOBUFS: ::c_int = 105; ++pub const EISCONN: ::c_int = 106; ++pub const ENOTCONN: ::c_int = 107; ++pub const ESHUTDOWN: ::c_int = 108; ++pub const ETOOMANYREFS: ::c_int = 109; ++pub const ETIMEDOUT: ::c_int = 110; ++pub const ECONNREFUSED: ::c_int = 111; ++pub const EHOSTDOWN: ::c_int = 112; ++pub const EHOSTUNREACH: ::c_int = 113; ++pub const EALREADY: ::c_int = 114; ++pub const EINPROGRESS: ::c_int = 115; ++pub const ESTALE: ::c_int = 116; ++pub const EUCLEAN: ::c_int = 117; ++pub const ENOTNAM: ::c_int = 118; ++pub const ENAVAIL: ::c_int = 119; ++pub const EISNAM: ::c_int = 120; ++pub const EREMOTEIO: ::c_int = 121; ++pub const EDQUOT: ::c_int = 122; ++pub const ENOMEDIUM: ::c_int = 123; ++pub const EMEDIUMTYPE: ::c_int = 124; ++pub const ECANCELED: ::c_int = 125; ++pub const ENOKEY: ::c_int = 126; ++pub const EKEYEXPIRED: ::c_int = 127; ++pub const EKEYREVOKED: ::c_int = 128; ++pub const EKEYREJECTED: ::c_int = 129; ++pub const EOWNERDEAD: ::c_int = 130; ++pub const ENOTRECOVERABLE: ::c_int = 131; ++pub const ERFKILL: ::c_int = 132; ++pub const EHWPOISON: ::c_int = 133; ++ ++pub const MAP_ANON: ::c_int = 0x0020; ++pub const MAP_GROWSDOWN: ::c_int = 0x0100; ++pub const MAP_DENYWRITE: ::c_int = 0x0800; ++pub const MAP_EXECUTABLE: ::c_int = 0x01000; ++pub const MAP_LOCKED: ::c_int = 0x02000; ++pub const MAP_NORESERVE: ::c_int = 0x04000; ++pub const MAP_POPULATE: ::c_int = 0x08000; ++pub const MAP_NONBLOCK: ::c_int = 0x010000; ++pub const MAP_STACK: ::c_int = 0x020000; ++pub const MAP_HUGETLB: ::c_int = 0x040000; ++pub const MAP_SYNC : ::c_int = 0x080000; ++ ++pub const SOCK_STREAM: ::c_int = 1; ++pub const SOCK_DGRAM: ::c_int = 2; ++pub const SOL_SOCKET: ::c_int = 1; ++pub const SO_REUSEADDR: ::c_int = 2; ++pub const SO_TYPE: ::c_int = 3; ++pub const SO_ERROR: ::c_int = 4; ++pub const SO_DONTROUTE: ::c_int = 5; ++pub const SO_BROADCAST: ::c_int = 6; ++pub const SO_SNDBUF: ::c_int = 7; ++pub const SO_RCVBUF: ::c_int = 8; ++pub const SO_KEEPALIVE: ::c_int = 9; ++pub const SO_OOBINLINE: ::c_int = 10; ++pub const SO_NO_CHECK: ::c_int = 11; ++pub const SO_PRIORITY: ::c_int = 12; ++pub const SO_LINGER: ::c_int = 13; ++pub const SO_BSDCOMPAT: ::c_int = 14; ++pub const SO_REUSEPORT: ::c_int = 15; ++pub const SO_ACCEPTCONN: ::c_int = 30; ++pub const SO_SNDBUFFORCE: ::c_int = 32; ++pub const SO_RCVBUFFORCE: ::c_int = 33; ++pub const SO_PROTOCOL: ::c_int = 38; ++pub const SO_DOMAIN: ::c_int = 39; ++ ++pub const SA_ONSTACK: ::c_int = 0x08000000; ++pub const SA_SIGINFO: ::c_int = 0x00000004; ++pub const SA_NOCLDWAIT: ::c_int = 0x00000002; ++ ++pub const SIGCHLD: ::c_int = 17; ++pub const SIGBUS: ::c_int = 7; ++pub const SIGTTIN: ::c_int = 21; ++pub const SIGTTOU: ::c_int = 22; ++pub const SIGXCPU: ::c_int = 24; ++pub const SIGXFSZ: ::c_int = 25; ++pub const SIGVTALRM: ::c_int = 26; ++pub const SIGPROF: ::c_int = 27; ++pub const SIGWINCH: ::c_int = 28; ++pub const SIGUSR1: ::c_int = 10; ++pub const SIGUSR2: ::c_int = 12; ++pub const SIGCONT: ::c_int = 18; ++pub const SIGSTOP: ::c_int = 19; ++pub const SIGTSTP: ::c_int = 20; ++pub const SIGURG: ::c_int = 23; ++pub const SIGIO: ::c_int = 29; ++pub const SIGSYS: ::c_int = 31; ++pub const SIGSTKFLT: ::c_int = 16; ++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 F_GETLK: ::c_int = 5; ++pub const F_GETOWN: ::c_int = 9; ++pub const F_SETLK: ::c_int = 6; ++pub const F_SETLKW: ::c_int = 7; ++pub const F_SETOWN: ::c_int = 8; ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; ++ ++pub const VEOF: usize = 4; ++ ++pub const POLLWRNORM: ::c_short = 0x100; ++pub const POLLWRBAND: ::c_short = 0x200; + + pub const SIGSTKSZ: ::size_t = 10240; + pub const MINSIGSTKSZ: ::size_t = 4096; +@@ -430,6 +600,7 @@ pub const SYS_copy_file_range: ::c_long = 379; + pub const SYS_preadv2: ::c_long = 380; + pub const SYS_pwritev2: ::c_long = 381; + pub const SYS_kexec_file_load: ::c_long = 382; ++pub const SYS_statx: ::c_long = 383; + + pub const FIOCLEX: ::c_int = 0x20006601; + pub const FIONCLEX: ::c_int = 0x20006602; +@@ -501,12 +672,12 @@ pub const CBAUD: ::tcflag_t = 0xff; + pub const TAB1: ::c_int = 0x400; + pub const TAB2: ::c_int = 0x800; + pub const TAB3: ::c_int = 0xc00; +-pub const CR1: ::c_int = 0x1000; +-pub const CR2: ::c_int = 0x2000; +-pub const CR3: ::c_int = 0x3000; +-pub const FF1: ::c_int = 0x4000; +-pub const BS1: ::c_int = 0x8000; +-pub const VT1: ::c_int = 0x10000; ++pub const CR1: ::c_int = 0x1000; ++pub const CR2: ::c_int = 0x2000; ++pub const CR3: ::c_int = 0x3000; ++pub const FF1: ::c_int = 0x4000; ++pub const BS1: ::c_int = 0x8000; ++pub const VT1: ::c_int = 0x10000; + pub const VWERASE: usize = 10; + pub const VREPRINT: usize = 11; + pub const VSUSP: usize = 12; +@@ -542,14 +713,14 @@ pub const NOFLSH: ::tcflag_t = 0x80000000; + pub const CIBAUD: ::tcflag_t = 0o77600000; + pub const CBAUDEX: ::tcflag_t = 0o0000020; + pub const VSWTC: usize = 9; +-pub const OLCUC: ::tcflag_t = 0o000004; +-pub const NLDLY: ::tcflag_t = 0o0001400; +-pub const CRDLY: ::tcflag_t = 0o0030000; ++pub const OLCUC: ::tcflag_t = 0o000004; ++pub const NLDLY: ::tcflag_t = 0o0001400; ++pub const CRDLY: ::tcflag_t = 0o0030000; + pub const TABDLY: ::tcflag_t = 0o0006000; +-pub const BSDLY: ::tcflag_t = 0o0100000; +-pub const FFDLY: ::tcflag_t = 0o0040000; +-pub const VTDLY: ::tcflag_t = 0o0200000; +-pub const XTABS: ::tcflag_t = 0o00006000; ++pub const BSDLY: ::tcflag_t = 0o0100000; ++pub const FFDLY: ::tcflag_t = 0o0040000; ++pub const VTDLY: ::tcflag_t = 0o0200000; ++pub const XTABS: ::tcflag_t = 0o00006000; + + pub const B57600: ::speed_t = 0o00020; + pub const B115200: ::speed_t = 0o00021; +@@ -567,6 +738,6 @@ pub const B3000000: ::speed_t = 0o00034; + pub const B3500000: ::speed_t = 0o00035; + pub const B4000000: ::speed_t = 0o00036; + +-extern { ++extern "C" { + pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; + } +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs b/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..7ca870fd02b71e31e44439e3fabdf1386eb75bb9 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs +@@ -0,0 +1,7 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 4] ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs b/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..59afe8e016b0a19fa6579d6b8ea77f05b9c36419 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs +@@ -0,0 +1,983 @@ ++pub type c_char = i8; ++pub type wchar_t = i32; ++pub type nlink_t = u64; ++pub type blksize_t = ::c_long; ++pub type __u64 = ::c_ulonglong; ++pub type greg_t = i64; ++ ++s! { ++ 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, ++ __pad0: ::c_int, ++ pub st_rdev: ::dev_t, ++ pub st_size: ::off_t, ++ pub st_blksize: ::blksize_t, ++ pub st_blocks: ::blkcnt_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, ++ __unused: [::c_long; 3], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino64_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ __pad0: ::c_int, ++ pub st_rdev: ::dev_t, ++ pub st_size: ::off_t, ++ pub st_blksize: ::blksize_t, ++ pub st_blocks: ::blkcnt64_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, ++ __reserved: [::c_long; 3], ++ } ++ ++ pub struct nlmsghdr { ++ pub nlmsg_len: u32, ++ pub nlmsg_type: u16, ++ pub nlmsg_flags: u16, ++ pub nlmsg_seq: u32, ++ pub nlmsg_pid: u32, ++ } ++ ++ pub struct nlmsgerr { ++ pub error: ::c_int, ++ pub msg: nlmsghdr, ++ } ++ ++ pub struct nlattr { ++ pub nla_len: u16, ++ pub nla_type: u16, ++ } ++ ++ pub struct user_regs_struct { ++ pub r15: ::c_ulong, ++ pub r14: ::c_ulong, ++ pub r13: ::c_ulong, ++ pub r12: ::c_ulong, ++ pub rbp: ::c_ulong, ++ pub rbx: ::c_ulong, ++ pub r11: ::c_ulong, ++ pub r10: ::c_ulong, ++ pub r9: ::c_ulong, ++ pub r8: ::c_ulong, ++ pub rax: ::c_ulong, ++ pub rcx: ::c_ulong, ++ pub rdx: ::c_ulong, ++ pub rsi: ::c_ulong, ++ pub rdi: ::c_ulong, ++ pub orig_rax: ::c_ulong, ++ pub rip: ::c_ulong, ++ pub cs: ::c_ulong, ++ pub eflags: ::c_ulong, ++ pub rsp: ::c_ulong, ++ pub ss: ::c_ulong, ++ pub fs_base: ::c_ulong, ++ pub gs_base: ::c_ulong, ++ pub ds: ::c_ulong, ++ pub es: ::c_ulong, ++ pub fs: ::c_ulong, ++ pub gs: ::c_ulong, ++ } ++ ++ pub struct user { ++ pub regs: user_regs_struct, ++ pub u_fpvalid: ::c_int, ++ pub i387: user_fpregs_struct, ++ pub u_tsize: ::c_ulong, ++ pub u_dsize: ::c_ulong, ++ pub u_ssize: ::c_ulong, ++ pub start_code: ::c_ulong, ++ pub start_stack: ::c_ulong, ++ pub signal: ::c_long, ++ __reserved: ::c_int, ++ #[cfg(target_pointer_width = "32")] ++ __pad1: u32, ++ pub u_ar0: *mut user_regs_struct, ++ #[cfg(target_pointer_width = "32")] ++ __pad2: u32, ++ pub u_fpstate: *mut user_fpregs_struct, ++ pub magic: ::c_ulong, ++ pub u_comm: [::c_char; 32], ++ pub u_debugreg: [::c_ulong; 8], ++ } ++ ++ // GitHub repo: ifduyue/musl/ ++ // commit: b4b1e10364c8737a632be61582e05a8d3acf5690 ++ // file: arch/x86_64/bits/signal.h#L80-L84 ++ pub struct mcontext_t { ++ pub gregs: [greg_t; 23], ++ __private: [u64; 9], ++ } ++ ++ pub struct ipc_perm { ++ pub __ipc_perm_key: ::key_t, ++ pub uid: ::uid_t, ++ pub gid: ::gid_t, ++ pub cuid: ::uid_t, ++ pub cgid: ::gid_t, ++ pub mode: ::mode_t, ++ pub __seq: ::c_int, ++ __unused1: ::c_long, ++ __unused2: ::c_long ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct user_fpregs_struct { ++ pub cwd: ::c_ushort, ++ pub swd: ::c_ushort, ++ pub ftw: ::c_ushort, ++ pub fop: ::c_ushort, ++ pub rip: ::c_ulong, ++ pub rdp: ::c_ulong, ++ pub mxcsr: ::c_uint, ++ pub mxcr_mask: ::c_uint, ++ pub st_space: [::c_uint; 32], ++ pub xmm_space: [::c_uint; 64], ++ padding: [::c_uint; 24], ++ } ++ ++ 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, ++ __private: [u8; 512], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for user_fpregs_struct { ++ fn eq(&self, other: &user_fpregs_struct) -> bool { ++ self.cwd == other.cwd ++ && self.swd == other.swd ++ && self.ftw == other.ftw ++ && self.fop == other.fop ++ && self.rip == other.rip ++ && self.rdp == other.rdp ++ && self.mxcsr == other.mxcsr ++ && self.mxcr_mask == other.mxcr_mask ++ && self.st_space == other.st_space ++ && self ++ .xmm_space ++ .iter() ++ .zip(other.xmm_space.iter()) ++ .all(|(a,b)| a == b) ++ // Ignore padding field ++ } ++ } ++ ++ impl Eq for user_fpregs_struct {} ++ ++ impl ::fmt::Debug for user_fpregs_struct { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("user_fpregs_struct") ++ .field("cwd", &self.cwd) ++ .field("ftw", &self.ftw) ++ .field("fop", &self.fop) ++ .field("rip", &self.rip) ++ .field("rdp", &self.rdp) ++ .field("mxcsr", &self.mxcsr) ++ .field("mxcr_mask", &self.mxcr_mask) ++ .field("st_space", &self.st_space) ++ // FIXME: .field("xmm_space", &self.xmm_space) ++ // Ignore padding field ++ .finish() ++ } ++ } ++ ++ impl ::hash::Hash for user_fpregs_struct { ++ fn hash(&self, state: &mut H) { ++ self.cwd.hash(state); ++ self.ftw.hash(state); ++ self.fop.hash(state); ++ self.rip.hash(state); ++ self.rdp.hash(state); ++ self.mxcsr.hash(state); ++ self.mxcr_mask.hash(state); ++ self.st_space.hash(state); ++ self.xmm_space.hash(state); ++ // Ignore padding field ++ } ++ } ++ ++ impl PartialEq for ucontext_t { ++ fn eq(&self, other: &ucontext_t) -> bool { ++ self.uc_flags == other.uc_flags ++ && self.uc_link == other.uc_link ++ && self.uc_stack == other.uc_stack ++ && self.uc_mcontext == other.uc_mcontext ++ && self.uc_sigmask == other.uc_sigmask ++ && self ++ .__private ++ .iter() ++ .zip(other.__private.iter()) ++ .all(|(a,b)| a == b) ++ } ++ } ++ ++ impl Eq for ucontext_t {} ++ ++ impl ::fmt::Debug for ucontext_t { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("ucontext_t") ++ .field("uc_flags", &self.uc_flags) ++ .field("uc_link", &self.uc_link) ++ .field("uc_stack", &self.uc_stack) ++ .field("uc_mcontext", &self.uc_mcontext) ++ .field("uc_sigmask", &self.uc_sigmask) ++ // Ignore __private field ++ .finish() ++ } ++ } ++ ++ impl ::hash::Hash for ucontext_t { ++ fn hash(&self, state: &mut H) { ++ self.uc_flags.hash(state); ++ self.uc_link.hash(state); ++ self.uc_stack.hash(state); ++ self.uc_mcontext.hash(state); ++ self.uc_sigmask.hash(state); ++ self.__private.hash(state); ++ } ++ } ++ } ++} ++ ++// Syscall table ++ ++pub const SYS_read: ::c_long = 0; ++pub const SYS_write: ::c_long = 1; ++pub const SYS_open: ::c_long = 2; ++pub const SYS_close: ::c_long = 3; ++pub const SYS_stat: ::c_long = 4; ++pub const SYS_fstat: ::c_long = 5; ++pub const SYS_lstat: ::c_long = 6; ++pub const SYS_poll: ::c_long = 7; ++pub const SYS_lseek: ::c_long = 8; ++pub const SYS_mmap: ::c_long = 9; ++pub const SYS_mprotect: ::c_long = 10; ++pub const SYS_munmap: ::c_long = 11; ++pub const SYS_brk: ::c_long = 12; ++pub const SYS_rt_sigaction: ::c_long = 13; ++pub const SYS_rt_sigprocmask: ::c_long = 14; ++pub const SYS_rt_sigreturn: ::c_long = 15; ++pub const SYS_ioctl: ::c_long = 16; ++pub const SYS_pread64: ::c_long = 17; ++pub const SYS_pwrite64: ::c_long = 18; ++pub const SYS_readv: ::c_long = 19; ++pub const SYS_writev: ::c_long = 20; ++pub const SYS_access: ::c_long = 21; ++pub const SYS_pipe: ::c_long = 22; ++pub const SYS_select: ::c_long = 23; ++pub const SYS_sched_yield: ::c_long = 24; ++pub const SYS_mremap: ::c_long = 25; ++pub const SYS_msync: ::c_long = 26; ++pub const SYS_mincore: ::c_long = 27; ++pub const SYS_madvise: ::c_long = 28; ++pub const SYS_shmget: ::c_long = 29; ++pub const SYS_shmat: ::c_long = 30; ++pub const SYS_shmctl: ::c_long = 31; ++pub const SYS_dup: ::c_long = 32; ++pub const SYS_dup2: ::c_long = 33; ++pub const SYS_pause: ::c_long = 34; ++pub const SYS_nanosleep: ::c_long = 35; ++pub const SYS_getitimer: ::c_long = 36; ++pub const SYS_alarm: ::c_long = 37; ++pub const SYS_setitimer: ::c_long = 38; ++pub const SYS_getpid: ::c_long = 39; ++pub const SYS_sendfile: ::c_long = 40; ++pub const SYS_socket: ::c_long = 41; ++pub const SYS_connect: ::c_long = 42; ++pub const SYS_accept: ::c_long = 43; ++pub const SYS_sendto: ::c_long = 44; ++pub const SYS_recvfrom: ::c_long = 45; ++pub const SYS_sendmsg: ::c_long = 46; ++pub const SYS_recvmsg: ::c_long = 47; ++pub const SYS_shutdown: ::c_long = 48; ++pub const SYS_bind: ::c_long = 49; ++pub const SYS_listen: ::c_long = 50; ++pub const SYS_getsockname: ::c_long = 51; ++pub const SYS_getpeername: ::c_long = 52; ++pub const SYS_socketpair: ::c_long = 53; ++pub const SYS_setsockopt: ::c_long = 54; ++pub const SYS_getsockopt: ::c_long = 55; ++pub const SYS_clone: ::c_long = 56; ++pub const SYS_fork: ::c_long = 57; ++pub const SYS_vfork: ::c_long = 58; ++pub const SYS_execve: ::c_long = 59; ++pub const SYS_exit: ::c_long = 60; ++pub const SYS_wait4: ::c_long = 61; ++pub const SYS_kill: ::c_long = 62; ++pub const SYS_uname: ::c_long = 63; ++pub const SYS_semget: ::c_long = 64; ++pub const SYS_semop: ::c_long = 65; ++pub const SYS_semctl: ::c_long = 66; ++pub const SYS_shmdt: ::c_long = 67; ++pub const SYS_msgget: ::c_long = 68; ++pub const SYS_msgsnd: ::c_long = 69; ++pub const SYS_msgrcv: ::c_long = 70; ++pub const SYS_msgctl: ::c_long = 71; ++pub const SYS_fcntl: ::c_long = 72; ++pub const SYS_flock: ::c_long = 73; ++pub const SYS_fsync: ::c_long = 74; ++pub const SYS_fdatasync: ::c_long = 75; ++pub const SYS_truncate: ::c_long = 76; ++pub const SYS_ftruncate: ::c_long = 77; ++pub const SYS_getdents: ::c_long = 78; ++pub const SYS_getcwd: ::c_long = 79; ++pub const SYS_chdir: ::c_long = 80; ++pub const SYS_fchdir: ::c_long = 81; ++pub const SYS_rename: ::c_long = 82; ++pub const SYS_mkdir: ::c_long = 83; ++pub const SYS_rmdir: ::c_long = 84; ++pub const SYS_creat: ::c_long = 85; ++pub const SYS_link: ::c_long = 86; ++pub const SYS_unlink: ::c_long = 87; ++pub const SYS_symlink: ::c_long = 88; ++pub const SYS_readlink: ::c_long = 89; ++pub const SYS_chmod: ::c_long = 90; ++pub const SYS_fchmod: ::c_long = 91; ++pub const SYS_chown: ::c_long = 92; ++pub const SYS_fchown: ::c_long = 93; ++pub const SYS_lchown: ::c_long = 94; ++pub const SYS_umask: ::c_long = 95; ++pub const SYS_gettimeofday: ::c_long = 96; ++pub const SYS_getrlimit: ::c_long = 97; ++pub const SYS_getrusage: ::c_long = 98; ++pub const SYS_sysinfo: ::c_long = 99; ++pub const SYS_times: ::c_long = 100; ++pub const SYS_ptrace: ::c_long = 101; ++pub const SYS_getuid: ::c_long = 102; ++pub const SYS_syslog: ::c_long = 103; ++pub const SYS_getgid: ::c_long = 104; ++pub const SYS_setuid: ::c_long = 105; ++pub const SYS_setgid: ::c_long = 106; ++pub const SYS_geteuid: ::c_long = 107; ++pub const SYS_getegid: ::c_long = 108; ++pub const SYS_setpgid: ::c_long = 109; ++pub const SYS_getppid: ::c_long = 110; ++pub const SYS_getpgrp: ::c_long = 111; ++pub const SYS_setsid: ::c_long = 112; ++pub const SYS_setreuid: ::c_long = 113; ++pub const SYS_setregid: ::c_long = 114; ++pub const SYS_getgroups: ::c_long = 115; ++pub const SYS_setgroups: ::c_long = 116; ++pub const SYS_setresuid: ::c_long = 117; ++pub const SYS_getresuid: ::c_long = 118; ++pub const SYS_setresgid: ::c_long = 119; ++pub const SYS_getresgid: ::c_long = 120; ++pub const SYS_getpgid: ::c_long = 121; ++pub const SYS_setfsuid: ::c_long = 122; ++pub const SYS_setfsgid: ::c_long = 123; ++pub const SYS_getsid: ::c_long = 124; ++pub const SYS_capget: ::c_long = 125; ++pub const SYS_capset: ::c_long = 126; ++pub const SYS_rt_sigpending: ::c_long = 127; ++pub const SYS_rt_sigtimedwait: ::c_long = 128; ++pub const SYS_rt_sigqueueinfo: ::c_long = 129; ++pub const SYS_rt_sigsuspend: ::c_long = 130; ++pub const SYS_sigaltstack: ::c_long = 131; ++pub const SYS_utime: ::c_long = 132; ++pub const SYS_mknod: ::c_long = 133; ++pub const SYS_uselib: ::c_long = 134; ++pub const SYS_personality: ::c_long = 135; ++pub const SYS_ustat: ::c_long = 136; ++pub const SYS_statfs: ::c_long = 137; ++pub const SYS_fstatfs: ::c_long = 138; ++pub const SYS_sysfs: ::c_long = 139; ++pub const SYS_getpriority: ::c_long = 140; ++pub const SYS_setpriority: ::c_long = 141; ++pub const SYS_sched_setparam: ::c_long = 142; ++pub const SYS_sched_getparam: ::c_long = 143; ++pub const SYS_sched_setscheduler: ::c_long = 144; ++pub const SYS_sched_getscheduler: ::c_long = 145; ++pub const SYS_sched_get_priority_max: ::c_long = 146; ++pub const SYS_sched_get_priority_min: ::c_long = 147; ++pub const SYS_sched_rr_get_interval: ::c_long = 148; ++pub const SYS_mlock: ::c_long = 149; ++pub const SYS_munlock: ::c_long = 150; ++pub const SYS_mlockall: ::c_long = 151; ++pub const SYS_munlockall: ::c_long = 152; ++pub const SYS_vhangup: ::c_long = 153; ++pub const SYS_modify_ldt: ::c_long = 154; ++pub const SYS_pivot_root: ::c_long = 155; ++pub const SYS__sysctl: ::c_long = 156; ++pub const SYS_prctl: ::c_long = 157; ++pub const SYS_arch_prctl: ::c_long = 158; ++pub const SYS_adjtimex: ::c_long = 159; ++pub const SYS_setrlimit: ::c_long = 160; ++pub const SYS_chroot: ::c_long = 161; ++pub const SYS_sync: ::c_long = 162; ++pub const SYS_acct: ::c_long = 163; ++pub const SYS_settimeofday: ::c_long = 164; ++pub const SYS_mount: ::c_long = 165; ++pub const SYS_umount2: ::c_long = 166; ++pub const SYS_swapon: ::c_long = 167; ++pub const SYS_swapoff: ::c_long = 168; ++pub const SYS_reboot: ::c_long = 169; ++pub const SYS_sethostname: ::c_long = 170; ++pub const SYS_setdomainname: ::c_long = 171; ++pub const SYS_iopl: ::c_long = 172; ++pub const SYS_ioperm: ::c_long = 173; ++pub const SYS_create_module: ::c_long = 174; ++pub const SYS_init_module: ::c_long = 175; ++pub const SYS_delete_module: ::c_long = 176; ++pub const SYS_get_kernel_syms: ::c_long = 177; ++pub const SYS_query_module: ::c_long = 178; ++pub const SYS_quotactl: ::c_long = 179; ++pub const SYS_nfsservctl: ::c_long = 180; ++pub const SYS_getpmsg: ::c_long = 181; ++pub const SYS_putpmsg: ::c_long = 182; ++pub const SYS_afs_syscall: ::c_long = 183; ++pub const SYS_tuxcall: ::c_long = 184; ++pub const SYS_security: ::c_long = 185; ++pub const SYS_gettid: ::c_long = 186; ++pub const SYS_readahead: ::c_long = 187; ++pub const SYS_setxattr: ::c_long = 188; ++pub const SYS_lsetxattr: ::c_long = 189; ++pub const SYS_fsetxattr: ::c_long = 190; ++pub const SYS_getxattr: ::c_long = 191; ++pub const SYS_lgetxattr: ::c_long = 192; ++pub const SYS_fgetxattr: ::c_long = 193; ++pub const SYS_listxattr: ::c_long = 194; ++pub const SYS_llistxattr: ::c_long = 195; ++pub const SYS_flistxattr: ::c_long = 196; ++pub const SYS_removexattr: ::c_long = 197; ++pub const SYS_lremovexattr: ::c_long = 198; ++pub const SYS_fremovexattr: ::c_long = 199; ++pub const SYS_tkill: ::c_long = 200; ++pub const SYS_time: ::c_long = 201; ++pub const SYS_futex: ::c_long = 202; ++pub const SYS_sched_setaffinity: ::c_long = 203; ++pub const SYS_sched_getaffinity: ::c_long = 204; ++pub const SYS_set_thread_area: ::c_long = 205; ++pub const SYS_io_setup: ::c_long = 206; ++pub const SYS_io_destroy: ::c_long = 207; ++pub const SYS_io_getevents: ::c_long = 208; ++pub const SYS_io_submit: ::c_long = 209; ++pub const SYS_io_cancel: ::c_long = 210; ++pub const SYS_get_thread_area: ::c_long = 211; ++pub const SYS_lookup_dcookie: ::c_long = 212; ++pub const SYS_epoll_create: ::c_long = 213; ++pub const SYS_epoll_ctl_old: ::c_long = 214; ++pub const SYS_epoll_wait_old: ::c_long = 215; ++pub const SYS_remap_file_pages: ::c_long = 216; ++pub const SYS_getdents64: ::c_long = 217; ++pub const SYS_set_tid_address: ::c_long = 218; ++pub const SYS_restart_syscall: ::c_long = 219; ++pub const SYS_semtimedop: ::c_long = 220; ++pub const SYS_fadvise64: ::c_long = 221; ++pub const SYS_timer_create: ::c_long = 222; ++pub const SYS_timer_settime: ::c_long = 223; ++pub const SYS_timer_gettime: ::c_long = 224; ++pub const SYS_timer_getoverrun: ::c_long = 225; ++pub const SYS_timer_delete: ::c_long = 226; ++pub const SYS_clock_settime: ::c_long = 227; ++pub const SYS_clock_gettime: ::c_long = 228; ++pub const SYS_clock_getres: ::c_long = 229; ++pub const SYS_clock_nanosleep: ::c_long = 230; ++pub const SYS_exit_group: ::c_long = 231; ++pub const SYS_epoll_wait: ::c_long = 232; ++pub const SYS_epoll_ctl: ::c_long = 233; ++pub const SYS_tgkill: ::c_long = 234; ++pub const SYS_utimes: ::c_long = 235; ++pub const SYS_vserver: ::c_long = 236; ++pub const SYS_mbind: ::c_long = 237; ++pub const SYS_set_mempolicy: ::c_long = 238; ++pub const SYS_get_mempolicy: ::c_long = 239; ++pub const SYS_mq_open: ::c_long = 240; ++pub const SYS_mq_unlink: ::c_long = 241; ++pub const SYS_mq_timedsend: ::c_long = 242; ++pub const SYS_mq_timedreceive: ::c_long = 243; ++pub const SYS_mq_notify: ::c_long = 244; ++pub const SYS_mq_getsetattr: ::c_long = 245; ++pub const SYS_kexec_load: ::c_long = 246; ++pub const SYS_waitid: ::c_long = 247; ++pub const SYS_add_key: ::c_long = 248; ++pub const SYS_request_key: ::c_long = 249; ++pub const SYS_keyctl: ::c_long = 250; ++pub const SYS_ioprio_set: ::c_long = 251; ++pub const SYS_ioprio_get: ::c_long = 252; ++pub const SYS_inotify_init: ::c_long = 253; ++pub const SYS_inotify_add_watch: ::c_long = 254; ++pub const SYS_inotify_rm_watch: ::c_long = 255; ++pub const SYS_migrate_pages: ::c_long = 256; ++pub const SYS_openat: ::c_long = 257; ++pub const SYS_mkdirat: ::c_long = 258; ++pub const SYS_mknodat: ::c_long = 259; ++pub const SYS_fchownat: ::c_long = 260; ++pub const SYS_futimesat: ::c_long = 261; ++pub const SYS_newfstatat: ::c_long = 262; ++pub const SYS_unlinkat: ::c_long = 263; ++pub const SYS_renameat: ::c_long = 264; ++pub const SYS_linkat: ::c_long = 265; ++pub const SYS_symlinkat: ::c_long = 266; ++pub const SYS_readlinkat: ::c_long = 267; ++pub const SYS_fchmodat: ::c_long = 268; ++pub const SYS_faccessat: ::c_long = 269; ++pub const SYS_pselect6: ::c_long = 270; ++pub const SYS_ppoll: ::c_long = 271; ++pub const SYS_unshare: ::c_long = 272; ++pub const SYS_set_robust_list: ::c_long = 273; ++pub const SYS_get_robust_list: ::c_long = 274; ++pub const SYS_splice: ::c_long = 275; ++pub const SYS_tee: ::c_long = 276; ++pub const SYS_sync_file_range: ::c_long = 277; ++pub const SYS_vmsplice: ::c_long = 278; ++pub const SYS_move_pages: ::c_long = 279; ++pub const SYS_utimensat: ::c_long = 280; ++pub const SYS_epoll_pwait: ::c_long = 281; ++pub const SYS_signalfd: ::c_long = 282; ++pub const SYS_timerfd_create: ::c_long = 283; ++pub const SYS_eventfd: ::c_long = 284; ++pub const SYS_fallocate: ::c_long = 285; ++pub const SYS_timerfd_settime: ::c_long = 286; ++pub const SYS_timerfd_gettime: ::c_long = 287; ++pub const SYS_accept4: ::c_long = 288; ++pub const SYS_signalfd4: ::c_long = 289; ++pub const SYS_eventfd2: ::c_long = 290; ++pub const SYS_epoll_create1: ::c_long = 291; ++pub const SYS_dup3: ::c_long = 292; ++pub const SYS_pipe2: ::c_long = 293; ++pub const SYS_inotify_init1: ::c_long = 294; ++pub const SYS_preadv: ::c_long = 295; ++pub const SYS_pwritev: ::c_long = 296; ++pub const SYS_rt_tgsigqueueinfo: ::c_long = 297; ++pub const SYS_perf_event_open: ::c_long = 298; ++pub const SYS_recvmmsg: ::c_long = 299; ++pub const SYS_fanotify_init: ::c_long = 300; ++pub const SYS_fanotify_mark: ::c_long = 301; ++pub const SYS_prlimit64: ::c_long = 302; ++pub const SYS_name_to_handle_at: ::c_long = 303; ++pub const SYS_open_by_handle_at: ::c_long = 304; ++pub const SYS_clock_adjtime: ::c_long = 305; ++pub const SYS_syncfs: ::c_long = 306; ++pub const SYS_sendmmsg: ::c_long = 307; ++pub const SYS_setns: ::c_long = 308; ++pub const SYS_getcpu: ::c_long = 309; ++pub const SYS_process_vm_readv: ::c_long = 310; ++pub const SYS_process_vm_writev: ::c_long = 311; ++pub const SYS_kcmp: ::c_long = 312; ++pub const SYS_finit_module: ::c_long = 313; ++pub const SYS_sched_setattr: ::c_long = 314; ++pub const SYS_sched_getattr: ::c_long = 315; ++pub const SYS_renameat2: ::c_long = 316; ++pub const SYS_seccomp: ::c_long = 317; ++pub const SYS_getrandom: ::c_long = 318; ++pub const SYS_memfd_create: ::c_long = 319; ++pub const SYS_kexec_file_load: ::c_long = 320; ++pub const SYS_bpf: ::c_long = 321; ++pub const SYS_execveat: ::c_long = 322; ++pub const SYS_userfaultfd: ::c_long = 323; ++pub const SYS_membarrier: ::c_long = 324; ++pub const SYS_mlock2: ::c_long = 325; ++pub const SYS_copy_file_range: ::c_long = 326; ++pub const SYS_preadv2: ::c_long = 327; ++pub const SYS_pwritev2: ::c_long = 328; ++pub const SYS_pkey_mprotect: ::c_long = 329; ++pub const SYS_pkey_alloc: ::c_long = 330; ++pub const SYS_pkey_free: ::c_long = 331; ++pub const SYS_statx: ::c_long = 332; ++ ++// offsets in user_regs_structs, from sys/reg.h ++pub const R15: ::c_int = 0; ++pub const R14: ::c_int = 1; ++pub const R13: ::c_int = 2; ++pub const R12: ::c_int = 3; ++pub const RBP: ::c_int = 4; ++pub const RBX: ::c_int = 5; ++pub const R11: ::c_int = 6; ++pub const R10: ::c_int = 7; ++pub const R9: ::c_int = 8; ++pub const R8: ::c_int = 9; ++pub const RAX: ::c_int = 10; ++pub const RCX: ::c_int = 11; ++pub const RDX: ::c_int = 12; ++pub const RSI: ::c_int = 13; ++pub const RDI: ::c_int = 14; ++pub const ORIG_RAX: ::c_int = 15; ++pub const RIP: ::c_int = 16; ++pub const CS: ::c_int = 17; ++pub const EFLAGS: ::c_int = 18; ++pub const RSP: ::c_int = 19; ++pub const SS: ::c_int = 20; ++pub const FS_BASE: ::c_int = 21; ++pub const GS_BASE: ::c_int = 22; ++pub const DS: ::c_int = 23; ++pub const ES: ::c_int = 24; ++pub const FS: ::c_int = 25; ++pub const GS: ::c_int = 26; ++ ++// offsets in mcontext_t.gregs from bits/signal.h ++// GitHub repo: ifduyue/musl/ ++// commit: b4b1e10364c8737a632be61582e05a8d3acf5690 ++// file: arch/x86_64/bits/signal.h#L9-L56 ++pub const REG_R8: ::c_int = 0; ++pub const REG_R9: ::c_int = 1; ++pub const REG_R10: ::c_int = 2; ++pub const REG_R11: ::c_int = 3; ++pub const REG_R12: ::c_int = 4; ++pub const REG_R13: ::c_int = 5; ++pub const REG_R14: ::c_int = 6; ++pub const REG_R15: ::c_int = 7; ++pub const REG_RDI: ::c_int = 8; ++pub const REG_RSI: ::c_int = 9; ++pub const REG_RBP: ::c_int = 10; ++pub const REG_RBX: ::c_int = 11; ++pub const REG_RDX: ::c_int = 12; ++pub const REG_RAX: ::c_int = 13; ++pub const REG_RCX: ::c_int = 14; ++pub const REG_RSP: ::c_int = 15; ++pub const REG_RIP: ::c_int = 16; ++pub const REG_EFL: ::c_int = 17; ++pub const REG_CSGSFS: ::c_int = 18; ++pub const REG_ERR: ::c_int = 19; ++pub const REG_TRAPNO: ::c_int = 20; ++pub const REG_OLDMASK: ::c_int = 21; ++pub const REG_CR2: ::c_int = 22; ++ ++pub const MADV_SOFT_OFFLINE: ::c_int = 101; ++pub const MAP_32BIT: ::c_int = 0x0040; ++pub const O_APPEND: ::c_int = 1024; ++pub const O_DIRECT: ::c_int = 0x4000; ++pub const O_DIRECTORY: ::c_int = 0x10000; ++pub const O_LARGEFILE: ::c_int = 0; ++pub const O_NOFOLLOW: ::c_int = 0x20000; ++pub const O_CREAT: ::c_int = 64; ++pub const O_EXCL: ::c_int = 128; ++pub const O_NOCTTY: ::c_int = 256; ++pub const O_NONBLOCK: ::c_int = 2048; ++pub const O_SYNC: ::c_int = 1052672; ++pub const O_RSYNC: ::c_int = 1052672; ++pub const O_DSYNC: ::c_int = 4096; ++pub const O_ASYNC: ::c_int = 0x2000; ++ ++pub const TIOCGRS485: ::c_int = 0x542E; ++pub const TIOCSRS485: ::c_int = 0x542F; ++ ++pub const SIGSTKSZ: ::size_t = 8192; ++pub const MINSIGSTKSZ: ::size_t = 2048; ++ ++pub const ENAMETOOLONG: ::c_int = 36; ++pub const ENOLCK: ::c_int = 37; ++pub const ENOSYS: ::c_int = 38; ++pub const ENOTEMPTY: ::c_int = 39; ++pub const ELOOP: ::c_int = 40; ++pub const ENOMSG: ::c_int = 42; ++pub const EIDRM: ::c_int = 43; ++pub const ECHRNG: ::c_int = 44; ++pub const EL2NSYNC: ::c_int = 45; ++pub const EL3HLT: ::c_int = 46; ++pub const EL3RST: ::c_int = 47; ++pub const ELNRNG: ::c_int = 48; ++pub const EUNATCH: ::c_int = 49; ++pub const ENOCSI: ::c_int = 50; ++pub const EL2HLT: ::c_int = 51; ++pub const EBADE: ::c_int = 52; ++pub const EBADR: ::c_int = 53; ++pub const EXFULL: ::c_int = 54; ++pub const ENOANO: ::c_int = 55; ++pub const EBADRQC: ::c_int = 56; ++pub const EBADSLT: ::c_int = 57; ++pub const EMULTIHOP: ::c_int = 72; ++pub const EBADMSG: ::c_int = 74; ++pub const EOVERFLOW: ::c_int = 75; ++pub const ENOTUNIQ: ::c_int = 76; ++pub const EBADFD: ::c_int = 77; ++pub const EREMCHG: ::c_int = 78; ++pub const ELIBACC: ::c_int = 79; ++pub const ELIBBAD: ::c_int = 80; ++pub const ELIBSCN: ::c_int = 81; ++pub const ELIBMAX: ::c_int = 82; ++pub const ELIBEXEC: ::c_int = 83; ++pub const EILSEQ: ::c_int = 84; ++pub const ERESTART: ::c_int = 85; ++pub const ESTRPIPE: ::c_int = 86; ++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; ++pub const ECONNRESET: ::c_int = 104; ++pub const ENOBUFS: ::c_int = 105; ++pub const EISCONN: ::c_int = 106; ++pub const ENOTCONN: ::c_int = 107; ++pub const ESHUTDOWN: ::c_int = 108; ++pub const ETOOMANYREFS: ::c_int = 109; ++pub const ETIMEDOUT: ::c_int = 110; ++pub const ECONNREFUSED: ::c_int = 111; ++pub const EHOSTDOWN: ::c_int = 112; ++pub const EHOSTUNREACH: ::c_int = 113; ++pub const EALREADY: ::c_int = 114; ++pub const EINPROGRESS: ::c_int = 115; ++pub const ESTALE: ::c_int = 116; ++pub const EUCLEAN: ::c_int = 117; ++pub const ENOTNAM: ::c_int = 118; ++pub const ENAVAIL: ::c_int = 119; ++pub const EISNAM: ::c_int = 120; ++pub const EREMOTEIO: ::c_int = 121; ++pub const EDQUOT: ::c_int = 122; ++pub const ENOMEDIUM: ::c_int = 123; ++pub const EMEDIUMTYPE: ::c_int = 124; ++pub const ECANCELED: ::c_int = 125; ++pub const ENOKEY: ::c_int = 126; ++pub const EKEYEXPIRED: ::c_int = 127; ++pub const EKEYREVOKED: ::c_int = 128; ++pub const EKEYREJECTED: ::c_int = 129; ++pub const EOWNERDEAD: ::c_int = 130; ++pub const ENOTRECOVERABLE: ::c_int = 131; ++pub const ERFKILL: ::c_int = 132; ++pub const EHWPOISON: ::c_int = 133; ++ ++pub const SA_ONSTACK: ::c_int = 0x08000000; ++pub const SA_SIGINFO: ::c_int = 0x00000004; ++pub const SA_NOCLDWAIT: ::c_int = 0x00000002; ++ ++pub const SIGCHLD: ::c_int = 17; ++pub const SIGBUS: ::c_int = 7; ++pub const SIGTTIN: ::c_int = 21; ++pub const SIGTTOU: ::c_int = 22; ++pub const SIGXCPU: ::c_int = 24; ++pub const SIGXFSZ: ::c_int = 25; ++pub const SIGVTALRM: ::c_int = 26; ++pub const SIGPROF: ::c_int = 27; ++pub const SIGWINCH: ::c_int = 28; ++pub const SIGUSR1: ::c_int = 10; ++pub const SIGUSR2: ::c_int = 12; ++pub const SIGCONT: ::c_int = 18; ++pub const SIGSTOP: ::c_int = 19; ++pub const SIGTSTP: ::c_int = 20; ++pub const SIGURG: ::c_int = 23; ++pub const SIGIO: ::c_int = 29; ++pub const SIGSYS: ::c_int = 31; ++pub const SIGSTKFLT: ::c_int = 16; ++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 F_GETLK: ::c_int = 5; ++pub const F_GETOWN: ::c_int = 9; ++pub const F_SETLK: ::c_int = 6; ++pub const F_SETLKW: ::c_int = 7; ++pub const F_SETOWN: ::c_int = 8; ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; ++ ++pub const VEOF: usize = 4; ++ ++pub const POLLWRNORM: ::c_short = 0x100; ++pub const POLLWRBAND: ::c_short = 0x200; ++ ++pub const SOCK_STREAM: ::c_int = 1; ++pub const SOCK_DGRAM: ::c_int = 2; ++pub const SOL_SOCKET: ::c_int = 1; ++pub const SO_REUSEADDR: ::c_int = 2; ++pub const SO_TYPE: ::c_int = 3; ++pub const SO_ERROR: ::c_int = 4; ++pub const SO_DONTROUTE: ::c_int = 5; ++pub const SO_BROADCAST: ::c_int = 6; ++pub const SO_SNDBUF: ::c_int = 7; ++pub const SO_RCVBUF: ::c_int = 8; ++pub const SO_KEEPALIVE: ::c_int = 9; ++pub const SO_OOBINLINE: ::c_int = 10; ++pub const SO_NO_CHECK: ::c_int = 11; ++pub const SO_PRIORITY: ::c_int = 12; ++pub const SO_LINGER: ::c_int = 13; ++pub const SO_BSDCOMPAT: ::c_int = 14; ++pub const SO_REUSEPORT: ::c_int = 15; ++pub const SO_ACCEPTCONN: ::c_int = 30; ++pub const SO_SNDBUFFORCE: ::c_int = 32; ++pub const SO_RCVBUFFORCE: ::c_int = 33; ++pub const SO_PROTOCOL: ::c_int = 38; ++pub const SO_DOMAIN: ::c_int = 39; ++ ++pub const MAP_ANON: ::c_int = 0x0020; ++pub const MAP_GROWSDOWN: ::c_int = 0x0100; ++pub const MAP_DENYWRITE: ::c_int = 0x0800; ++pub const MAP_EXECUTABLE: ::c_int = 0x01000; ++pub const MAP_LOCKED: ::c_int = 0x02000; ++pub const MAP_NORESERVE: ::c_int = 0x04000; ++pub const MAP_POPULATE: ::c_int = 0x08000; ++pub const MAP_NONBLOCK: ::c_int = 0x010000; ++pub const MAP_STACK: ::c_int = 0x020000; ++pub const MAP_HUGETLB: ::c_int = 0x040000; ++pub const MAP_SYNC : ::c_int = 0x080000; ++ ++pub const RLIMIT_NLIMITS: ::c_int = 15; ++pub const TIOCINQ: ::c_int = ::FIONREAD; ++pub const MCL_CURRENT: ::c_int = 0x0001; ++pub const MCL_FUTURE: ::c_int = 0x0002; ++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; ++pub const CIBAUD: ::tcflag_t = 0o02003600000; ++pub const CBAUDEX: ::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: ::tcflag_t = 0o000002; ++pub const NLDLY: ::tcflag_t = 0o000400; ++pub const CRDLY: ::tcflag_t = 0o003000; ++pub const TABDLY: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const XTABS: ::tcflag_t = 0o014000; ++pub const B57600: ::speed_t = 0o010001; ++pub const B115200: ::speed_t = 0o010002; ++pub const B230400: ::speed_t = 0o010003; ++pub const B460800: ::speed_t = 0o010004; ++pub const B500000: ::speed_t = 0o010005; ++pub const B576000: ::speed_t = 0o010006; ++pub const B921600: ::speed_t = 0o010007; ++pub const B1000000: ::speed_t = 0o010010; ++pub const B1152000: ::speed_t = 0o010011; ++pub const B1500000: ::speed_t = 0o010012; ++pub const B2000000: ::speed_t = 0o010013; ++pub const B2500000: ::speed_t = 0o010014; ++pub const B3000000: ::speed_t = 0o010015; ++pub const B3500000: ::speed_t = 0o010016; ++pub const B4000000: ::speed_t = 0o010017; ++ ++pub const FIOCLEX: ::c_int = 0x5451; ++pub const FIONCLEX: ::c_int = 0x5450; ++pub const FIONBIO: ::c_int = 0x5421; ++pub const EDEADLK: ::c_int = 35; ++pub const EDEADLOCK: ::c_int = EDEADLK; ++pub const SO_PASSCRED: ::c_int = 16; ++pub const SO_PEERCRED: ::c_int = 17; ++pub const SO_RCVLOWAT: ::c_int = 18; ++pub const SO_SNDLOWAT: ::c_int = 19; ++pub const SO_RCVTIMEO: ::c_int = 20; ++pub const SO_SNDTIMEO: ::c_int = 21; ++pub const EXTPROC: ::tcflag_t = 0x00010000; ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: ::tcflag_t = 0x00008000; ++pub const TOSTOP: ::tcflag_t = 0x00000100; ++pub const FLUSHO: ::tcflag_t = 0x00001000; ++pub const TCGETS: ::c_int = 0x5401; ++pub const TCSETS: ::c_int = 0x5402; ++pub const TCSETSW: ::c_int = 0x5403; ++pub const TCSETSF: ::c_int = 0x5404; ++pub const TCGETA: ::c_int = 0x5405; ++pub const TCSETA: ::c_int = 0x5406; ++pub const TCSETAW: ::c_int = 0x5407; ++pub const TCSETAF: ::c_int = 0x5408; ++pub const TCSBRK: ::c_int = 0x5409; ++pub const TCXONC: ::c_int = 0x540A; ++pub const TCFLSH: ::c_int = 0x540B; ++pub const TIOCGSOFTCAR: ::c_int = 0x5419; ++pub const TIOCSSOFTCAR: ::c_int = 0x541A; ++pub const TIOCLINUX: ::c_int = 0x541C; ++pub const TIOCGSERIAL: ::c_int = 0x541E; ++pub const TIOCEXCL: ::c_int = 0x540C; ++pub const TIOCNXCL: ::c_int = 0x540D; ++pub const TIOCSCTTY: ::c_int = 0x540E; ++pub const TIOCGPGRP: ::c_int = 0x540F; ++pub const TIOCSPGRP: ::c_int = 0x5410; ++pub const TIOCOUTQ: ::c_int = 0x5411; ++pub const TIOCSTI: ::c_int = 0x5412; ++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 TIOCM_LE: ::c_int = 0x001; ++pub const TIOCM_DTR: ::c_int = 0x002; ++pub const TIOCM_RTS: ::c_int = 0x004; ++pub const TIOCM_ST: ::c_int = 0x008; ++pub const TIOCM_SR: ::c_int = 0x010; ++pub const TIOCM_CTS: ::c_int = 0x020; ++pub const TIOCM_CAR: ::c_int = 0x040; ++pub const TIOCM_RNG: ::c_int = 0x080; ++pub const TIOCM_DSR: ::c_int = 0x100; ++pub const TIOCM_CD: ::c_int = TIOCM_CAR; ++pub const TIOCM_RI: ::c_int = TIOCM_RNG; ++ ++extern "C" { ++ pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; ++} ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } ++} +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/musl/mod.rs b/third_party/rust/libc/src/unix/linux_like/linux/musl/mod.rs +index 5dea49b92b90572ad9c161436b174fcaace9334e..0d427ae3894f15384f4fc9cab711ec22cdb5ebbc 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/musl/mod.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/musl/mod.rs +@@ -13,6 +13,36 @@ pub type fsblkcnt_t = ::c_ulonglong; + pub type fsfilcnt_t = ::c_ulonglong; + pub type rlim_t = ::c_ulonglong; + ++pub type flock64 = flock; ++ ++impl siginfo_t { ++ pub unsafe fn si_addr(&self) -> *mut ::c_void { ++ #[repr(C)] ++ struct siginfo_sigfault { ++ _si_signo: ::c_int, ++ _si_errno: ::c_int, ++ _si_code: ::c_int, ++ si_addr: *mut ::c_void, ++ } ++ ++ (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr ++ } ++ ++ pub unsafe fn si_value(&self) -> ::sigval { ++ #[repr(C)] ++ struct siginfo_si_value { ++ _si_signo: ::c_int, ++ _si_errno: ::c_int, ++ _si_code: ::c_int, ++ _si_timerid: ::c_int, ++ _si_overrun: ::c_int, ++ si_value: ::sigval, ++ } ++ ++ (*(self as *const siginfo_t as *const siginfo_si_value)).si_value ++ } ++} ++ + s! { + pub struct aiocb { + pub aio_fildes: ::c_int, +@@ -79,9 +109,49 @@ s! { + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } ++ ++ pub struct regex_t { ++ __re_nsub: ::size_t, ++ __opaque: *mut ::c_void, ++ __padding: [*mut ::c_void; 4usize], ++ __nsub2: ::size_t, ++ __padding2: ::c_char, ++ } ++ ++ pub struct rtentry { ++ pub rt_pad1: ::c_ulong, ++ pub rt_dst: ::sockaddr, ++ pub rt_gateway: ::sockaddr, ++ pub rt_genmask: ::sockaddr, ++ pub rt_flags: ::c_ushort, ++ pub rt_pad2: ::c_short, ++ pub rt_pad3: ::c_ulong, ++ pub rt_tos: ::c_uchar, ++ pub rt_class: ::c_uchar, ++ #[cfg(target_pointer_width = "64")] ++ pub rt_pad4: [::c_short; 3usize], ++ #[cfg(not(target_pointer_width = "64"))] ++ pub rt_pad4: [::c_short; 1usize], ++ pub rt_metric: ::c_short, ++ pub rt_dev: *mut ::c_char, ++ pub rt_mtu: ::c_ulong, ++ pub rt_window: ::c_ulong, ++ pub rt_irtt: ::c_ushort, ++ } ++ ++ pub struct ip_mreqn { ++ pub imr_multiaddr: ::in_addr, ++ pub imr_address: ::in_addr, ++ pub imr_ifindex: ::c_int, ++ } ++ ++ pub struct __exit_status { ++ pub e_termination: ::c_short, ++ pub e_exit: ::c_short, ++ } + } + +-s_no_extra_traits!{ ++s_no_extra_traits! { + pub struct sysinfo { + pub uptime: ::c_ulong, + pub loads: [::c_ulong; 3], +@@ -98,6 +168,36 @@ s_no_extra_traits!{ + pub mem_unit: ::c_uint, + pub __reserved: [::c_char; 256], + } ++ ++ // FIXME: musl added paddings and adjusted ++ // layout in 1.2.0 but our CI is still 1.1.24. ++ // So, I'm leaving some fields as comments for now. ++ // ref. https://github.com/bminor/musl/commit/ ++ // 1e7f0fcd7ff2096904fd93a2ee6d12a2392be392 ++ pub struct utmpx { ++ pub ut_type: ::c_short, ++ //__ut_pad1: ::c_short, ++ pub ut_pid: ::pid_t, ++ pub ut_line: [::c_char; 32], ++ pub ut_id: [::c_char; 4], ++ pub ut_user: [::c_char; 32], ++ pub ut_host: [::c_char; 256], ++ pub ut_exit: __exit_status, ++ ++ //#[cfg(target_endian = "little")] ++ pub ut_session: ::c_long, ++ //#[cfg(target_endian = "little")] ++ //__ut_pad2: ::c_long, ++ ++ //#[cfg(not(target_endian = "little"))] ++ //__ut_pad2: ::c_int, ++ //#[cfg(not(target_endian = "little"))] ++ //pub ut_session: ::c_int, ++ ++ pub ut_tv: ::timeval, ++ pub ut_addr_v6: [::c_uint; 4], ++ __unused: [::c_char; 20], ++ } + } + + cfg_if! { +@@ -166,9 +266,95 @@ cfg_if! { + self.__reserved.hash(state); + } + } ++ ++ impl PartialEq for utmpx { ++ fn eq(&self, other: &utmpx) -> bool { ++ self.ut_type == other.ut_type ++ //&& self.__ut_pad1 == other.__ut_pad1 ++ && self.ut_pid == other.ut_pid ++ && self.ut_line == other.ut_line ++ && self.ut_id == other.ut_id ++ && self.ut_user == other.ut_user ++ && self ++ .ut_host ++ .iter() ++ .zip(other.ut_host.iter()) ++ .all(|(a,b)| a == b) ++ && self.ut_exit == other.ut_exit ++ && self.ut_session == other.ut_session ++ //&& self.__ut_pad2 == other.__ut_pad2 ++ && self.ut_tv == other.ut_tv ++ && self.ut_addr_v6 == other.ut_addr_v6 ++ && self.__unused == other.__unused ++ } ++ } ++ ++ impl Eq for utmpx {} ++ ++ impl ::fmt::Debug for utmpx { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("utmpx") ++ .field("ut_type", &self.ut_type) ++ //.field("__ut_pad1", &self.__ut_pad1) ++ .field("ut_pid", &self.ut_pid) ++ .field("ut_line", &self.ut_line) ++ .field("ut_id", &self.ut_id) ++ .field("ut_user", &self.ut_user) ++ //FIXME: .field("ut_host", &self.ut_host) ++ .field("ut_exit", &self.ut_exit) ++ .field("ut_session", &self.ut_session) ++ //.field("__ut_pad2", &self.__ut_pad2) ++ .field("ut_tv", &self.ut_tv) ++ .field("ut_addr_v6", &self.ut_addr_v6) ++ .field("__unused", &self.__unused) ++ .finish() ++ } ++ } ++ ++ impl ::hash::Hash for utmpx { ++ fn hash(&self, state: &mut H) { ++ self.ut_type.hash(state); ++ //self.__ut_pad1.hash(state); ++ self.ut_pid.hash(state); ++ self.ut_line.hash(state); ++ self.ut_id.hash(state); ++ self.ut_user.hash(state); ++ self.ut_host.hash(state); ++ self.ut_exit.hash(state); ++ self.ut_session.hash(state); ++ //self.__ut_pad2.hash(state); ++ self.ut_tv.hash(state); ++ self.ut_addr_v6.hash(state); ++ self.__unused.hash(state); ++ } ++ } + } + } + ++// include/sys/mman.h ++/* ++ * Huge page size encoding when MAP_HUGETLB is specified, and a huge page ++ * size other than the default is desired. See hugetlb_encode.h. ++ * All known huge page size encodings are provided here. It is the ++ * responsibility of the application to know which sizes are supported on ++ * the running system. See mmap(2) man page for details. ++ */ ++pub const MAP_HUGE_SHIFT: ::c_int = 26; ++pub const MAP_HUGE_MASK: ::c_int = 0x3f; ++ ++pub const MAP_HUGE_64KB: ::c_int = 16 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_512KB: ::c_int = 19 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_1MB: ::c_int = 20 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_2MB: ::c_int = 21 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_8MB: ::c_int = 23 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_16MB: ::c_int = 24 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_32MB: ::c_int = 25 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_256MB: ::c_int = 28 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_512MB: ::c_int = 29 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_1GB: ::c_int = 30 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_2GB: ::c_int = 31 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_16GB: ::c_int = 34 << MAP_HUGE_SHIFT; ++ + pub const MS_RMT_MASK: ::c_ulong = 0x02800051; + + pub const SFD_CLOEXEC: ::c_int = 0x080000; +@@ -241,11 +427,9 @@ pub const TCP_QUEUE_SEQ: ::c_int = 21; + pub const TCP_REPAIR_OPTIONS: ::c_int = 22; + pub const TCP_FASTOPEN: ::c_int = 23; + pub const TCP_TIMESTAMP: ::c_int = 24; ++pub const TCP_FASTOPEN_CONNECT: ::c_int = 30; + +-#[deprecated( +- since = "0.2.55", +- note = "Use SIGSYS instead" +-)] ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] + pub const SIGUNUSED: ::c_int = ::SIGSYS; + + pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +@@ -300,10 +484,7 @@ pub const TCSAFLUSH: ::c_int = 2; + pub const RTLD_GLOBAL: ::c_int = 0x100; + pub const RTLD_NOLOAD: ::c_int = 0x4; + +-// TODO(#247) Temporarily musl-specific (available since musl 0.9.12 / Linux +-// kernel 3.10). See also linux_like/mod.rs + pub const CLOCK_SGI_CYCLE: ::clockid_t = 10; +-pub const CLOCK_TAI: ::clockid_t = 11; + + pub const B0: ::speed_t = 0o000000; + pub const B50: ::speed_t = 0o000001; +@@ -342,52 +523,92 @@ pub const RLIMIT_MSGQUEUE: ::c_int = 12; + pub const RLIMIT_NICE: ::c_int = 13; + pub const RLIMIT_RTPRIO: ::c_int = 14; + +-extern { +- pub fn sendmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, +- flags: ::c_uint) -> ::c_int; +- pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, +- flags: ::c_uint, timeout: *mut ::timespec) -> ::c_int; +- +- pub fn getrlimit64(resource: ::c_int, +- rlim: *mut ::rlimit64) -> ::c_int; +- pub fn setrlimit64(resource: ::c_int, +- rlim: *const ::rlimit64) -> ::c_int; +- pub fn getrlimit(resource: ::c_int, +- rlim: *mut ::rlimit) -> ::c_int; +- pub fn setrlimit(resource: ::c_int, +- rlim: *const ::rlimit) -> ::c_int; +- pub fn prlimit(pid: ::pid_t, +- resource: ::c_int, new_limit: *const ::rlimit, +- old_limit: *mut ::rlimit) -> ::c_int; +- pub fn prlimit64(pid: ::pid_t, +- resource: ::c_int, +- new_limit: *const ::rlimit64, +- old_limit: *mut ::rlimit64) -> ::c_int; +- +- pub fn gettimeofday(tp: *mut ::timeval, +- tz: *mut ::c_void) -> ::c_int; ++pub const REG_OK: ::c_int = 0; ++ ++pub const TIOCSBRK: ::c_int = 0x5427; ++pub const TIOCCBRK: ::c_int = 0x5428; ++ ++pub const PRIO_PROCESS: ::c_int = 0; ++pub const PRIO_PGRP: ::c_int = 1; ++pub const PRIO_USER: ::c_int = 2; ++ ++extern "C" { ++ pub fn sendmmsg( ++ sockfd: ::c_int, ++ msgvec: *mut ::mmsghdr, ++ vlen: ::c_uint, ++ flags: ::c_uint, ++ ) -> ::c_int; ++ pub fn recvmmsg( ++ sockfd: ::c_int, ++ msgvec: *mut ::mmsghdr, ++ vlen: ::c_uint, ++ flags: ::c_uint, ++ timeout: *mut ::timespec, ++ ) -> ::c_int; ++ ++ pub fn getrlimit64(resource: ::c_int, rlim: *mut ::rlimit64) -> ::c_int; ++ pub fn setrlimit64(resource: ::c_int, rlim: *const ::rlimit64) -> ::c_int; ++ pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; ++ pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; ++ pub fn prlimit( ++ pid: ::pid_t, ++ resource: ::c_int, ++ new_limit: *const ::rlimit, ++ old_limit: *mut ::rlimit, ++ ) -> ::c_int; ++ pub fn prlimit64( ++ pid: ::pid_t, ++ resource: ::c_int, ++ new_limit: *const ::rlimit64, ++ old_limit: *mut ::rlimit64, ++ ) -> ::c_int; ++ ++ pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::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; +- pub fn pthread_getaffinity_np(thread: ::pthread_t, +- cpusetsize: ::size_t, +- cpuset: *mut ::cpu_set_t) -> ::c_int; +- pub fn pthread_setaffinity_np(thread: ::pthread_t, +- cpusetsize: ::size_t, +- cpuset: *const ::cpu_set_t) -> ::c_int; ++ pub fn pthread_getaffinity_np( ++ thread: ::pthread_t, ++ cpusetsize: ::size_t, ++ cpuset: *mut ::cpu_set_t, ++ ) -> ::c_int; ++ pub fn pthread_setaffinity_np( ++ thread: ::pthread_t, ++ cpusetsize: ::size_t, ++ cpuset: *const ::cpu_set_t, ++ ) -> ::c_int; + pub fn sched_getcpu() -> ::c_int; ++ pub fn memmem( ++ haystack: *const ::c_void, ++ haystacklen: ::size_t, ++ needle: *const ::c_void, ++ needlelen: ::size_t, ++ ) -> *mut ::c_void; ++ // Musl targets need the `mask` argument of `fanotify_mark` be specified ++ // `::c_ulonglong` instead of `u64` or there will be a type mismatch between ++ // `long long unsigned int` and the expected `uint64_t`. ++ pub fn fanotify_mark( ++ fd: ::c_int, ++ flags: ::c_uint, ++ mask: ::c_ulonglong, ++ dirfd: ::c_int, ++ path: *const ::c_char, ++ ) -> ::c_int; + } + + cfg_if! { + if #[cfg(any(target_arch = "x86_64", + target_arch = "aarch64", ++ target_arch = "mips64", + target_arch = "powerpc64"))] { + mod b64; + pub use self::b64::*; + } else if #[cfg(any(target_arch = "x86", + target_arch = "mips", +- target_arch = "arm", +- target_arch = "powerpc"))] { ++ target_arch = "powerpc", ++ target_arch = "hexagon", ++ target_arch = "arm"))] { + mod b32; + pub use self::b32::*; + } else { } +diff --git a/third_party/rust/libc/src/unix/linux_like/linux/no_align.rs b/third_party/rust/libc/src/unix/linux_like/linux/no_align.rs +index 1f5f2eea5706d5718634df3f8ca1b792f617b579..7393d70a0974984d50d9e9385709cb90218c2a81 100644 +--- a/third_party/rust/libc/src/unix/linux_like/linux/no_align.rs ++++ b/third_party/rust/libc/src/unix/linux_like/linux/no_align.rs +@@ -7,6 +7,7 @@ macro_rules! expand_align { + target_arch = "mips64", + target_arch = "s390x", + target_arch = "sparc64", ++ target_arch = "riscv64", + all(target_arch = "aarch64", + target_env = "musl")))] + __align: [::c_int; 0], +@@ -15,6 +16,7 @@ macro_rules! expand_align { + target_arch = "mips64", + target_arch = "s390x", + target_arch = "sparc64", ++ target_arch = "riscv64", + all(target_arch = "aarch64", + target_env = "musl"))))] + __align: [::c_long; 0], +@@ -33,6 +35,17 @@ macro_rules! expand_align { + __align: [::c_int; 0], + size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], + } ++ ++ pub struct fanotify_event_metadata { ++ __align: [::c_long; 0], ++ pub event_len: __u32, ++ pub vers: __u8, ++ pub reserved: __u8, ++ pub metadata_len: __u16, ++ pub mask: __u64, ++ pub fd: ::c_int, ++ pub pid: ::c_int, ++ } + } + + s_no_extra_traits! { +@@ -48,12 +61,14 @@ macro_rules! expand_align { + #[cfg(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc", ++ target_arch = "sparc", + all(target_arch = "x86_64", + target_pointer_width = "32")))] + __align: [::c_long; 0], + #[cfg(not(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc", ++ target_arch = "sparc", + all(target_arch = "x86_64", + target_pointer_width = "32"))))] + __align: [::c_longlong; 0], +@@ -64,17 +79,19 @@ macro_rules! expand_align { + #[cfg(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc", ++ target_arch = "sparc", + all(target_arch = "x86_64", + target_pointer_width = "32")))] + __align: [::c_long; 0], + #[cfg(not(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc", ++ target_arch = "sparc", + all(target_arch = "x86_64", + target_pointer_width = "32"))))] + __align: [::c_longlong; 0], + size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], + } + } +- } ++ }; + } +diff --git a/third_party/rust/libc/src/unix/linux_like/mod.rs b/third_party/rust/libc/src/unix/linux_like/mod.rs +index ad20dbeee86f40965cebba43fc8199b44389d302..3f7da48b53a2c5dc380d08aed9bb6a4d27d7c4a4 100644 +--- a/third_party/rust/libc/src/unix/linux_like/mod.rs ++++ b/third_party/rust/libc/src/unix/linux_like/mod.rs +@@ -9,7 +9,9 @@ pub type id_t = ::c_uint; + pub enum timezone {} + impl ::Copy for timezone {} + impl ::Clone for timezone { +- fn clone(&self) -> timezone { *self } ++ fn clone(&self) -> timezone { ++ *self ++ } + } + + s! { +@@ -22,6 +24,12 @@ s! { + pub imr_interface: in_addr, + } + ++ pub struct ip_mreq_source { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ pub imr_sourceaddr: in_addr, ++ } ++ + pub struct sockaddr { + pub sa_family: sa_family_t, + pub sa_data: [::c_char; 14], +@@ -42,6 +50,8 @@ s! { + pub sin6_scope_id: u32, + } + ++ // The order of the `ai_addr` field in this struct is crucial ++ // for converting between the Rust and C types. + pub struct addrinfo { + pub ai_flags: ::c_int, + pub ai_family: ::c_int, +@@ -193,7 +203,7 @@ s! { + } + } + +-s_no_extra_traits!{ ++s_no_extra_traits! { + #[cfg_attr( + any( + all( +@@ -464,7 +474,7 @@ pub const F_SEAL_SHRINK: ::c_int = 0x0002; + pub const F_SEAL_GROW: ::c_int = 0x0004; + pub const F_SEAL_WRITE: ::c_int = 0x0008; + +-// TODO(#235): Include file sealing fcntls once we have a way to verify them. ++// FIXME(#235): Include file sealing fcntls once we have a way to verify them. + + pub const SIGTRAP: ::c_int = 5; + +@@ -481,10 +491,7 @@ pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = 6; + pub const CLOCK_BOOTTIME: ::clockid_t = 7; + pub const CLOCK_REALTIME_ALARM: ::clockid_t = 8; + pub const CLOCK_BOOTTIME_ALARM: ::clockid_t = 9; +-// TODO(#247) Someday our Travis shall have glibc 2.21 (released in Sep +-// 2014.) See also musl/mod.rs +-// pub const CLOCK_SGI_CYCLE: ::clockid_t = 10; +-// pub const CLOCK_TAI: ::clockid_t = 11; ++pub const CLOCK_TAI: ::clockid_t = 11; + pub const TIMER_ABSTIME: ::c_int = 1; + + pub const RUSAGE_SELF: ::c_int = 0; +@@ -546,12 +553,12 @@ pub const LC_COLLATE: ::c_int = 3; + pub const LC_MONETARY: ::c_int = 4; + pub const LC_MESSAGES: ::c_int = 5; + pub const LC_ALL: ::c_int = 6; +-pub const LC_CTYPE_MASK: ::c_int = (1 << LC_CTYPE); +-pub const LC_NUMERIC_MASK: ::c_int = (1 << LC_NUMERIC); +-pub const LC_TIME_MASK: ::c_int = (1 << LC_TIME); +-pub const LC_COLLATE_MASK: ::c_int = (1 << LC_COLLATE); +-pub const LC_MONETARY_MASK: ::c_int = (1 << LC_MONETARY); +-pub const LC_MESSAGES_MASK: ::c_int = (1 << LC_MESSAGES); ++pub const LC_CTYPE_MASK: ::c_int = 1 << LC_CTYPE; ++pub const LC_NUMERIC_MASK: ::c_int = 1 << LC_NUMERIC; ++pub const LC_TIME_MASK: ::c_int = 1 << LC_TIME; ++pub const LC_COLLATE_MASK: ::c_int = 1 << LC_COLLATE; ++pub const LC_MONETARY_MASK: ::c_int = 1 << LC_MONETARY; ++pub const LC_MESSAGES_MASK: ::c_int = 1 << LC_MESSAGES; + // LC_ALL_MASK defined per platform + + pub const MAP_FILE: ::c_int = 0x0000; +@@ -594,42 +601,6 @@ pub const MS_ACTIVE: ::c_ulong = 0x40000000; + pub const MS_MGC_VAL: ::c_ulong = 0xc0ed0000; + pub const MS_MGC_MSK: ::c_ulong = 0xffff0000; + +-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 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 EWOULDBLOCK: ::c_int = EAGAIN; +- + pub const SCM_RIGHTS: ::c_int = 0x01; + pub const SCM_CREDENTIALS: ::c_int = 0x02; + +@@ -804,22 +775,48 @@ pub const IP_TOS: ::c_int = 1; + pub const IP_TTL: ::c_int = 2; + pub const IP_HDRINCL: ::c_int = 3; + pub const IP_PKTINFO: ::c_int = 8; ++pub const IP_MTU_DISCOVER: ::c_int = 10; + pub const IP_RECVTOS: ::c_int = 13; ++pub const IP_RECVERR: ::c_int = 11; ++pub const IP_FREEBIND: ::c_int = 15; + pub const IP_ADD_MEMBERSHIP: ::c_int = 35; + pub const IP_DROP_MEMBERSHIP: ::c_int = 36; ++pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 39; ++pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 40; + pub const IP_TRANSPARENT: ::c_int = 19; ++pub const IPV6_ADDRFORM: ::c_int = 1; ++pub const IPV6_2292PKTINFO: ::c_int = 2; ++pub const IPV6_2292HOPOPTS: ::c_int = 3; ++pub const IPV6_2292DSTOPTS: ::c_int = 4; ++pub const IPV6_2292RTHDR: ::c_int = 5; ++pub const IPV6_2292PKTOPTIONS: ::c_int = 6; ++pub const IPV6_CHECKSUM: ::c_int = 7; ++pub const IPV6_2292HOPLIMIT: ::c_int = 8; ++pub const IPV6_NEXTHOP: ::c_int = 9; + pub const IPV6_UNICAST_HOPS: ::c_int = 16; + pub const IPV6_MULTICAST_IF: ::c_int = 17; + pub const IPV6_MULTICAST_HOPS: ::c_int = 18; + pub const IPV6_MULTICAST_LOOP: ::c_int = 19; + pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20; + pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21; ++pub const IPV6_ROUTER_ALERT: ::c_int = 22; ++pub const IPV6_MTU_DISCOVER: ::c_int = 23; ++pub const IPV6_MTU: ::c_int = 24; ++pub const IPV6_RECVERR: ::c_int = 25; + pub const IPV6_V6ONLY: ::c_int = 26; ++pub const IPV6_JOIN_ANYCAST: ::c_int = 27; ++pub const IPV6_LEAVE_ANYCAST: ::c_int = 28; + pub const IPV6_RECVPKTINFO: ::c_int = 49; + pub const IPV6_PKTINFO: ::c_int = 50; ++pub const IPV6_HOPLIMIT: ::c_int = 52; + pub const IPV6_RECVTCLASS: ::c_int = 66; + pub const IPV6_TCLASS: ::c_int = 67; + ++pub const IP_PMTUDISC_DONT: ::c_int = 0; ++pub const IP_PMTUDISC_WANT: ::c_int = 1; ++pub const IP_PMTUDISC_DO: ::c_int = 2; ++pub const IP_PMTUDISC_PROBE: ::c_int = 3; ++ + pub const TCP_NODELAY: ::c_int = 1; + pub const TCP_MAXSEG: ::c_int = 2; + pub const TCP_CORK: ::c_int = 3; +@@ -927,11 +924,11 @@ pub const OPOST: ::tcflag_t = 0x1; + pub const CS5: ::tcflag_t = 0x00000000; + pub const CRTSCTS: ::tcflag_t = 0x80000000; + pub const ECHO: ::tcflag_t = 0x00000008; +-pub const OCRNL: ::tcflag_t = 0o000010; +-pub const ONOCR: ::tcflag_t = 0o000020; ++pub const OCRNL: ::tcflag_t = 0o000010; ++pub const ONOCR: ::tcflag_t = 0o000020; + pub const ONLRET: ::tcflag_t = 0o000040; +-pub const OFILL: ::tcflag_t = 0o000100; +-pub const OFDEL: ::tcflag_t = 0o000200; ++pub const OFILL: ::tcflag_t = 0o000100; ++pub const OFDEL: ::tcflag_t = 0o000200; + + pub const CLONE_VM: ::c_int = 0x100; + pub const CLONE_FS: ::c_int = 0x200; +@@ -985,8 +982,6 @@ pub const PTRACE_EVENT_EXEC: ::c_int = 4; + pub const PTRACE_EVENT_VFORK_DONE: ::c_int = 5; + pub const PTRACE_EVENT_EXIT: ::c_int = 6; + pub const PTRACE_EVENT_SECCOMP: ::c_int = 7; +-// PTRACE_EVENT_STOP was added to glibc in 2.26 +-// pub const PTRACE_EVENT_STOP: ::c_int = 128; + + pub const __WNOTHREAD: ::c_int = 0x20000000; + pub const __WALL: ::c_int = 0x40000000; +@@ -1068,15 +1063,15 @@ pub const IPOPT_CONTROL: u8 = 0x00; + pub const IPOPT_RESERVED1: u8 = 0x20; + pub const IPOPT_MEASUREMENT: u8 = 0x40; + pub const IPOPT_RESERVED2: u8 = 0x60; +-pub const IPOPT_END: u8 = (0 |IPOPT_CONTROL); +-pub const IPOPT_NOOP: u8 = (1 |IPOPT_CONTROL); +-pub const IPOPT_SEC: u8 = (2 |IPOPT_CONTROL|IPOPT_COPY); +-pub const IPOPT_LSRR: u8 = (3 |IPOPT_CONTROL|IPOPT_COPY); +-pub const IPOPT_TIMESTAMP: u8 = (4 |IPOPT_MEASUREMENT); +-pub const IPOPT_RR: u8 = (7 |IPOPT_CONTROL); +-pub const IPOPT_SID: u8 = (8 |IPOPT_CONTROL|IPOPT_COPY); +-pub const IPOPT_SSRR: u8 = (9 |IPOPT_CONTROL|IPOPT_COPY); +-pub const IPOPT_RA: u8 = (20|IPOPT_CONTROL|IPOPT_COPY); ++pub const IPOPT_END: u8 = 0 | IPOPT_CONTROL; ++pub const IPOPT_NOOP: u8 = 1 | IPOPT_CONTROL; ++pub const IPOPT_SEC: u8 = 2 | IPOPT_CONTROL | IPOPT_COPY; ++pub const IPOPT_LSRR: u8 = 3 | IPOPT_CONTROL | IPOPT_COPY; ++pub const IPOPT_TIMESTAMP: u8 = 4 | IPOPT_MEASUREMENT; ++pub const IPOPT_RR: u8 = 7 | IPOPT_CONTROL; ++pub const IPOPT_SID: u8 = 8 | IPOPT_CONTROL | IPOPT_COPY; ++pub const IPOPT_SSRR: u8 = 9 | IPOPT_CONTROL | IPOPT_COPY; ++pub const IPOPT_RA: u8 = 20 | IPOPT_CONTROL | IPOPT_COPY; + pub const IPVERSION: u8 = 4; + pub const MAXTTL: u8 = 255; + pub const IPDEFTTL: u8 = 64; +@@ -1162,8 +1157,10 @@ pub const ARPHRD_IEEE802154: u16 = 804; + pub const ARPHRD_VOID: u16 = 0xFFFF; + pub const ARPHRD_NONE: u16 = 0xFFFE; + +-fn CMSG_ALIGN(len: usize) -> usize { +- len + ::mem::size_of::() - 1 & !(::mem::size_of::() - 1) ++const_fn! { ++ {const} fn CMSG_ALIGN(len: usize) -> usize { ++ len + ::mem::size_of::() - 1 & !(::mem::size_of::() - 1) ++ } + } + + f! { +@@ -1179,7 +1176,7 @@ f! { + cmsg.offset(1) as *mut ::c_uchar + } + +- pub fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { ++ pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + (CMSG_ALIGN(length as usize) + CMSG_ALIGN(::mem::size_of::())) + as ::c_uint + } +@@ -1267,28 +1264,38 @@ f! { + } + } + +-extern { ++extern "C" { + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; +- pub fn sem_init(sem: *mut sem_t, +- pshared: ::c_int, +- value: ::c_uint) +- -> ::c_int; ++ pub fn sem_init( ++ sem: *mut sem_t, ++ pshared: ::c_int, ++ value: ::c_uint, ++ ) -> ::c_int; + pub fn fdatasync(fd: ::c_int) -> ::c_int; +- pub fn mincore(addr: *mut ::c_void, len: ::size_t, +- vec: *mut ::c_uchar) -> ::c_int; ++ pub fn mincore( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ vec: *mut ::c_uchar, ++ ) -> ::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; +- pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; ++ pub fn clock_settime( ++ clk_id: ::clockid_t, ++ tp: *const ::timespec, ++ ) -> ::c_int; + pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; + +- pub fn pthread_getattr_np(native: ::pthread_t, +- attr: *mut ::pthread_attr_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_getattr_np( ++ native: ::pthread_t, ++ attr: *mut ::pthread_attr_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 memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; +- pub fn setgroups(ngroups: ::size_t, +- ptr: *const ::gid_t) -> ::c_int; ++ pub fn setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int; + pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; + pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; + pub fn statfs64(path: *const ::c_char, buf: *mut statfs64) -> ::c_int; +@@ -1296,125 +1303,227 @@ extern { + pub fn fstatfs64(fd: ::c_int, buf: *mut statfs64) -> ::c_int; + pub fn statvfs64(path: *const ::c_char, buf: *mut statvfs64) -> ::c_int; + pub fn fstatvfs64(fd: ::c_int, buf: *mut statvfs64) -> ::c_int; +- pub fn memrchr(cx: *const ::c_void, +- c: ::c_int, +- n: ::size_t) -> *mut ::c_void; +- +- pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, +- advise: ::c_int) -> ::c_int; ++ pub fn memrchr( ++ cx: *const ::c_void, ++ c: ::c_int, ++ n: ::size_t, ++ ) -> *mut ::c_void; ++ ++ pub fn posix_fadvise( ++ fd: ::c_int, ++ offset: ::off_t, ++ len: ::off_t, ++ advise: ::c_int, ++ ) -> ::c_int; ++ pub fn posix_fadvise64( ++ fd: ::c_int, ++ offset: ::off64_t, ++ len: ::off64_t, ++ advise: ::c_int, ++ ) -> ::c_int; + pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; +- pub fn utimensat(dirfd: ::c_int, path: *const ::c_char, +- times: *const ::timespec, flag: ::c_int) -> ::c_int; ++ pub fn utimensat( ++ dirfd: ::c_int, ++ path: *const ::c_char, ++ times: *const ::timespec, ++ flag: ::c_int, ++ ) -> ::c_int; + pub fn duplocale(base: ::locale_t) -> ::locale_t; + pub fn freelocale(loc: ::locale_t); +- pub fn newlocale(mask: ::c_int, +- locale: *const ::c_char, +- base: ::locale_t) -> ::locale_t; ++ 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 creat64(path: *const c_char, mode: mode_t) -> ::c_int; + pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int; +- pub fn fstatat64(dirfd: ::c_int, pathname: *const c_char, +- buf: *mut stat64, flags: ::c_int) -> ::c_int; ++ pub fn fstatat64( ++ dirfd: ::c_int, ++ pathname: *const c_char, ++ buf: *mut stat64, ++ flags: ::c_int, ++ ) -> ::c_int; + pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int; + pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t; + pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int; +- pub fn mmap64(addr: *mut ::c_void, +- len: ::size_t, +- prot: ::c_int, +- flags: ::c_int, +- fd: ::c_int, +- offset: off64_t) +- -> *mut ::c_void; ++ pub fn mmap64( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ prot: ::c_int, ++ flags: ::c_int, ++ fd: ::c_int, ++ offset: off64_t, ++ ) -> *mut ::c_void; + pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int; +- pub fn openat64(fd: ::c_int, +- path: *const c_char, +- oflag: ::c_int, ...) -> ::c_int; +- pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, +- offset: off64_t) -> ::ssize_t; +- pub fn preadv64(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int, +- offset: ::off64_t) -> ::ssize_t; +- pub fn pwrite64(fd: ::c_int, buf: *const ::c_void, count: ::size_t, +- offset: off64_t) -> ::ssize_t; +- pub fn pwritev64(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int, +- offset: ::off64_t) -> ::ssize_t; ++ pub fn openat64( ++ fd: ::c_int, ++ path: *const c_char, ++ oflag: ::c_int, ++ ... ++ ) -> ::c_int; ++ pub fn pread64( ++ fd: ::c_int, ++ buf: *mut ::c_void, ++ count: ::size_t, ++ offset: off64_t, ++ ) -> ::ssize_t; ++ pub fn preadv64( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ offset: ::off64_t, ++ ) -> ::ssize_t; ++ pub fn pwrite64( ++ fd: ::c_int, ++ buf: *const ::c_void, ++ count: ::size_t, ++ offset: off64_t, ++ ) -> ::ssize_t; ++ pub fn pwritev64( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ offset: ::off64_t, ++ ) -> ::ssize_t; + pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64; +- pub fn readdir64_r(dirp: *mut ::DIR, entry: *mut ::dirent64, +- result: *mut *mut ::dirent64) -> ::c_int; ++ pub fn readdir64_r( ++ dirp: *mut ::DIR, ++ entry: *mut ::dirent64, ++ result: *mut *mut ::dirent64, ++ ) -> ::c_int; + pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int; + pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int; + +- pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char, +- mode: ::mode_t, dev: dev_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 pthread_condattr_setpshared(attr: *mut pthread_condattr_t, +- pshared: ::c_int) -> ::c_int; +- pub fn accept4(fd: ::c_int, addr: *mut ::sockaddr, len: *mut ::socklen_t, +- flg: ::c_int) -> ::c_int; +- pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, +- pshared: ::c_int) -> ::c_int; +- pub fn pthread_rwlockattr_getpshared(attr: *const pthread_rwlockattr_t, +- val: *mut ::c_int) -> ::c_int; +- pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, +- val: ::c_int) -> ::c_int; +- pub fn ptsname_r(fd: ::c_int, +- buf: *mut ::c_char, +- buflen: ::size_t) -> ::c_int; ++ pub fn mknodat( ++ dirfd: ::c_int, ++ pathname: *const ::c_char, ++ mode: ::mode_t, ++ dev: dev_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 pthread_condattr_setpshared( ++ attr: *mut pthread_condattr_t, ++ pshared: ::c_int, ++ ) -> ::c_int; ++ pub fn accept4( ++ fd: ::c_int, ++ addr: *mut ::sockaddr, ++ len: *mut ::socklen_t, ++ flg: ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_mutexattr_setpshared( ++ attr: *mut pthread_mutexattr_t, ++ pshared: ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_rwlockattr_getpshared( ++ attr: *const pthread_rwlockattr_t, ++ val: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_rwlockattr_setpshared( ++ attr: *mut pthread_rwlockattr_t, ++ val: ::c_int, ++ ) -> ::c_int; ++ pub fn ptsname_r( ++ fd: ::c_int, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ ) -> ::c_int; + pub fn clearenv() -> ::c_int; +- pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, +- options: ::c_int) -> ::c_int; ++ pub fn waitid( ++ idtype: idtype_t, ++ id: id_t, ++ infop: *mut ::siginfo_t, ++ options: ::c_int, ++ ) -> ::c_int; + pub fn setreuid(ruid: ::uid_t, euid: ::uid_t) -> ::c_int; + pub fn setregid(rgid: ::gid_t, egid: ::gid_t) -> ::c_int; +- pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, +- suid: *mut ::uid_t) -> ::c_int; +- pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, +- sgid: *mut ::gid_t) -> ::c_int; ++ pub fn getresuid( ++ ruid: *mut ::uid_t, ++ euid: *mut ::uid_t, ++ suid: *mut ::uid_t, ++ ) -> ::c_int; ++ pub fn getresgid( ++ rgid: *mut ::gid_t, ++ egid: *mut ::gid_t, ++ sgid: *mut ::gid_t, ++ ) -> ::c_int; + pub fn acct(filename: *const ::c_char) -> ::c_int; + pub fn brk(addr: *mut ::c_void) -> ::c_int; + pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void; ++ #[deprecated( ++ since = "0.2.66", ++ note = "causes memory corruption, see rust-lang/libc#1596" ++ )] + pub fn vfork() -> ::pid_t; + 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; +- pub fn wait4(pid: ::pid_t, status: *mut ::c_int, options: ::c_int, +- rusage: *mut ::rusage) -> ::pid_t; +- pub fn openpty(amaster: *mut ::c_int, +- aslave: *mut ::c_int, +- name: *mut ::c_char, +- termp: *const termios, +- winp: *const ::winsize) -> ::c_int; +- pub fn forkpty(amaster: *mut ::c_int, +- name: *mut ::c_char, +- termp: *const termios, +- winp: *const ::winsize) -> ::pid_t; ++ pub fn wait4( ++ pid: ::pid_t, ++ status: *mut ::c_int, ++ options: ::c_int, ++ rusage: *mut ::rusage, ++ ) -> ::pid_t; ++ pub fn openpty( ++ amaster: *mut ::c_int, ++ aslave: *mut ::c_int, ++ name: *mut ::c_char, ++ termp: *const termios, ++ winp: *const ::winsize, ++ ) -> ::c_int; ++ pub fn forkpty( ++ amaster: *mut ::c_int, ++ name: *mut ::c_char, ++ termp: *const termios, ++ winp: *const ::winsize, ++ ) -> ::pid_t; + pub fn login_tty(fd: ::c_int) -> ::c_int; +- pub fn execvpe(file: *const ::c_char, argv: *const *const ::c_char, +- envp: *const *const ::c_char) -> ::c_int; +- pub fn fexecve(fd: ::c_int, argv: *const *const ::c_char, +- envp: *const *const ::c_char) +- -> ::c_int; ++ pub fn execvpe( ++ file: *const ::c_char, ++ argv: *const *const ::c_char, ++ envp: *const *const ::c_char, ++ ) -> ::c_int; ++ pub fn fexecve( ++ fd: ::c_int, ++ argv: *const *const ::c_char, ++ envp: *const *const ::c_char, ++ ) -> ::c_int; + pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int; + pub fn freeifaddrs(ifa: *mut ::ifaddrs); +- pub fn bind(socket: ::c_int, address: *const ::sockaddr, +- address_len: ::socklen_t) -> ::c_int; +- +- pub fn writev(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int) -> ::ssize_t; +- pub fn readv(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int) -> ::ssize_t; +- +- pub fn sendmsg(fd: ::c_int, +- msg: *const ::msghdr, +- flags: ::c_int) -> ::ssize_t; +- pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) +- -> ::ssize_t; ++ pub fn bind( ++ socket: ::c_int, ++ address: *const ::sockaddr, ++ address_len: ::socklen_t, ++ ) -> ::c_int; ++ ++ pub fn writev( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ ) -> ::ssize_t; ++ pub fn readv( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ ) -> ::ssize_t; ++ ++ pub fn sendmsg( ++ fd: ::c_int, ++ msg: *const ::msghdr, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ pub fn recvmsg( ++ fd: ::c_int, ++ msg: *mut ::msghdr, ++ flags: ::c_int, ++ ) -> ::ssize_t; + pub fn uname(buf: *mut ::utsname) -> ::c_int; + } + +diff --git a/third_party/rust/libc/src/unix/mod.rs b/third_party/rust/libc/src/unix/mod.rs +index 8295dfc020c9c664b761eb1c83a8492179395de0..237a0fb21a8e0311c702aaabbf472c90173a4368 100644 +--- a/third_party/rust/libc/src/unix/mod.rs ++++ b/third_party/rust/libc/src/unix/mod.rs +@@ -34,9 +34,11 @@ pub type cc_t = ::c_uchar; + pub enum DIR {} + impl ::Copy for DIR {} + impl ::Clone for DIR { +- fn clone(&self) -> DIR { *self } ++ fn clone(&self) -> DIR { ++ *self ++ } + } +-pub type locale_t = *mut :: c_void; ++pub type locale_t = *mut ::c_void; + + s! { + pub struct group { +@@ -224,8 +226,12 @@ pub const S_ISUID: ::mode_t = 0x800; + pub const S_ISGID: ::mode_t = 0x400; + pub const S_ISVTX: ::mode_t = 0x200; + +-pub const IF_NAMESIZE: ::size_t = 16; +-pub const IFNAMSIZ: ::size_t = IF_NAMESIZE; ++cfg_if! { ++ if #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] { ++ pub const IF_NAMESIZE: ::size_t = 16; ++ pub const IFNAMSIZ: ::size_t = IF_NAMESIZE; ++ } ++} + + pub const LOG_EMERG: ::c_int = 0; + pub const LOG_ALERT: ::c_int = 1; +@@ -263,10 +269,6 @@ pub const LOG_NOWAIT: ::c_int = 0x10; + pub const LOG_PRIMASK: ::c_int = 7; + pub const LOG_FACMASK: ::c_int = 0x3f8; + +-pub const PRIO_PROCESS: ::c_int = 0; +-pub const PRIO_PGRP: ::c_int = 1; +-pub const PRIO_USER: ::c_int = 2; +- + pub const PRIO_MIN: ::c_int = -20; + pub const PRIO_MAX: ::c_int = 20; + +@@ -358,16 +360,20 @@ cfg_if! { + pub enum FILE {} + impl ::Copy for FILE {} + impl ::Clone for FILE { +- fn clone(&self) -> FILE { *self } ++ fn clone(&self) -> FILE { ++ *self ++ } + } + #[cfg_attr(feature = "extra_traits", derive(Debug))] +-pub enum fpos_t {} // TODO: fill this out with a struct ++pub enum fpos_t {} // FIXME: fill this out with a struct + impl ::Copy for fpos_t {} + impl ::Clone for fpos_t { +- fn clone(&self) -> fpos_t { *self } ++ fn clone(&self) -> fpos_t { ++ *self ++ } + } + +-extern { ++extern "C" { + pub fn isalnum(c: c_int) -> c_int; + pub fn isalpha(c: c_int) -> c_int; + pub fn iscntrl(c: c_int) -> c_int; +@@ -379,8 +385,26 @@ extern { + pub fn isspace(c: c_int) -> c_int; + pub fn isupper(c: c_int) -> c_int; + pub fn isxdigit(c: c_int) -> c_int; ++ pub fn isblank(c: c_int) -> c_int; + pub fn tolower(c: c_int) -> c_int; + pub fn toupper(c: c_int) -> c_int; ++ pub fn qsort( ++ base: *mut c_void, ++ num: size_t, ++ size: size_t, ++ compar: ::Option< ++ unsafe extern "C" fn(*const c_void, *const c_void) -> c_int, ++ >, ++ ); ++ pub fn bsearch( ++ key: *const c_void, ++ base: *const c_void, ++ num: size_t, ++ size: size_t, ++ compar: ::Option< ++ unsafe extern "C" fn(*const c_void, *const c_void) -> c_int, ++ >, ++ ) -> *mut c_void; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "fopen$UNIX2003" +@@ -390,20 +414,28 @@ extern { + all(target_os = "macos", target_arch = "x86"), + link_name = "freopen$UNIX2003" + )] +- pub fn freopen(filename: *const c_char, mode: *const c_char, +- file: *mut FILE) -> *mut FILE; ++ pub fn freopen( ++ filename: *const c_char, ++ mode: *const c_char, ++ file: *mut FILE, ++ ) -> *mut FILE; + pub fn fflush(file: *mut FILE) -> c_int; + pub fn fclose(file: *mut FILE) -> c_int; + pub fn remove(filename: *const c_char) -> c_int; + pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int; + pub fn tmpfile() -> *mut FILE; +- pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, +- size: size_t) -> c_int; ++ pub fn setvbuf( ++ stream: *mut FILE, ++ buffer: *mut c_char, ++ mode: c_int, ++ size: size_t, ++ ) -> c_int; + pub fn setbuf(stream: *mut FILE, buf: *mut c_char); + pub fn getchar() -> c_int; + pub fn putchar(c: c_int) -> c_int; + pub fn fgetc(stream: *mut FILE) -> c_int; +- pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char; ++ pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) ++ -> *mut c_char; + pub fn fputc(c: c_int, stream: *mut FILE) -> c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), +@@ -412,14 +444,22 @@ extern { + pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int; + pub fn puts(s: *const c_char) -> c_int; + pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int; +- pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, +- stream: *mut FILE) -> size_t; ++ pub fn fread( ++ ptr: *mut c_void, ++ size: size_t, ++ nobj: size_t, ++ stream: *mut FILE, ++ ) -> size_t; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "fwrite$UNIX2003" + )] +- pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, +- stream: *mut FILE) -> size_t; ++ pub fn fwrite( ++ ptr: *const c_void, ++ size: size_t, ++ nobj: size_t, ++ stream: *mut FILE, ++ ) -> size_t; + pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int; + pub fn ftell(stream: *mut FILE) -> c_long; + pub fn rewind(stream: *mut FILE); +@@ -436,10 +476,16 @@ extern { + link_name = "strtod$UNIX2003" + )] + pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double; +- pub fn strtol(s: *const c_char, endp: *mut *mut c_char, +- base: c_int) -> c_long; +- pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, +- base: c_int) -> c_ulong; ++ pub fn strtol( ++ s: *const c_char, ++ endp: *mut *mut c_char, ++ base: c_int, ++ ) -> c_long; ++ pub fn strtoul( ++ s: *const c_char, ++ endp: *mut *mut c_char, ++ base: c_int, ++ ) -> c_ulong; + pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void; + pub fn malloc(size: size_t) -> *mut c_void; + pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void; +@@ -447,7 +493,7 @@ extern { + pub fn abort() -> !; + pub fn exit(status: c_int) -> !; + pub fn _exit(status: c_int) -> !; +- pub fn atexit(cb: extern fn()) -> c_int; ++ pub fn atexit(cb: extern "C" fn()) -> c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "system$UNIX2003" +@@ -456,11 +502,17 @@ extern { + pub fn getenv(s: *const c_char) -> *mut c_char; + + pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char; +- pub fn strncpy(dst: *mut c_char, src: *const c_char, +- n: size_t) -> *mut c_char; ++ pub fn strncpy( ++ dst: *mut c_char, ++ src: *const c_char, ++ n: size_t, ++ ) -> *mut c_char; + pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char; +- pub fn strncat(s: *mut c_char, ct: *const c_char, +- n: size_t) -> *mut c_char; ++ pub fn strncat( ++ s: *mut c_char, ++ ct: *const c_char, ++ n: size_t, ++ ) -> *mut c_char; + pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int; + pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int; + pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int; +@@ -469,11 +521,15 @@ extern { + pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t; + pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t; + pub fn strdup(cs: *const c_char) -> *mut c_char; ++ pub fn strndup(cs: *const c_char, n: size_t) -> *mut c_char; + pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int; +- pub fn strncasecmp(s1: *const c_char, s2: *const c_char, +- n: size_t) -> c_int; ++ pub fn strncasecmp( ++ s1: *const c_char, ++ s2: *const c_char, ++ n: size_t, ++ ) -> c_int; + pub fn strlen(cs: *const c_char) -> size_t; + pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t; + #[cfg_attr( +@@ -483,239 +539,345 @@ extern { + pub fn strerror(n: c_int) -> *mut c_char; + pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; + pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; ++ pub fn strsignal(sig: c_int) -> *mut c_char; + pub fn wcslen(buf: *const wchar_t) -> size_t; +- pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, +- n: size_t) -> ::size_t; ++ pub fn wcstombs( ++ dest: *mut c_char, ++ src: *const wchar_t, ++ n: size_t, ++ ) -> ::size_t; + + pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; ++ pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t; + pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int; +- pub fn memcpy(dest: *mut c_void, src: *const c_void, +- n: size_t) -> *mut c_void; +- pub fn memmove(dest: *mut c_void, src: *const c_void, +- n: size_t) -> *mut c_void; ++ pub fn memcpy( ++ dest: *mut c_void, ++ src: *const c_void, ++ n: size_t, ++ ) -> *mut c_void; ++ pub fn memmove( ++ dest: *mut c_void, ++ src: *const c_void, ++ n: size_t, ++ ) -> *mut c_void; + pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void; + } + +-extern { ++extern "C" { + #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam50")] + pub fn getpwnam(name: *const ::c_char) -> *mut passwd; + #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid50")] + pub fn getpwuid(uid: ::uid_t) -> *mut passwd; + +- pub fn fprintf(stream: *mut ::FILE, +- format: *const ::c_char, ...) -> ::c_int; ++ pub fn fprintf( ++ stream: *mut ::FILE, ++ 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 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; + #[cfg_attr(target_os = "linux", link_name = "__isoc99_fscanf")] +- pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int; ++ pub fn fscanf( ++ stream: *mut ::FILE, ++ format: *const ::c_char, ++ ... ++ ) -> ::c_int; + #[cfg_attr(target_os = "linux", link_name = "__isoc99_scanf")] + pub fn scanf(format: *const ::c_char, ...) -> ::c_int; + #[cfg_attr(target_os = "linux", link_name = "__isoc99_sscanf")] +- pub fn sscanf(s: *const ::c_char, 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")] + #[cfg_attr(target_os = "illumos", link_name = "__xnet_socket")] + 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")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "connect$UNIX2003" ++ )] + #[cfg_attr(target_os = "illumos", link_name = "__xnet_connect")] +- pub fn connect(socket: ::c_int, address: *const sockaddr, +- len: socklen_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "listen$UNIX2003")] +- #[cfg_attr(target_os = "illumos", link_name = "__xnet_listen")] ++ pub fn connect( ++ socket: ::c_int, ++ address: *const sockaddr, ++ len: socklen_t, ++ ) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "listen$UNIX2003" ++ )] + pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "accept$UNIX2003")] +- pub fn accept(socket: ::c_int, address: *mut sockaddr, +- address_len: *mut socklen_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "getpeername$UNIX2003")] +- pub fn getpeername(socket: ::c_int, address: *mut sockaddr, +- address_len: *mut socklen_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "getsockname$UNIX2003")] +- pub fn getsockname(socket: ::c_int, address: *mut sockaddr, +- address_len: *mut socklen_t) -> ::c_int; +- pub fn setsockopt(socket: ::c_int, level: ::c_int, name: ::c_int, +- value: *const ::c_void, +- option_len: socklen_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "socketpair$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "accept$UNIX2003" ++ )] ++ pub fn accept( ++ socket: ::c_int, ++ address: *mut sockaddr, ++ address_len: *mut socklen_t, ++ ) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "getpeername$UNIX2003" ++ )] ++ pub fn getpeername( ++ socket: ::c_int, ++ address: *mut sockaddr, ++ address_len: *mut socklen_t, ++ ) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "getsockname$UNIX2003" ++ )] ++ pub fn getsockname( ++ socket: ::c_int, ++ address: *mut sockaddr, ++ address_len: *mut socklen_t, ++ ) -> ::c_int; ++ pub fn setsockopt( ++ socket: ::c_int, ++ level: ::c_int, ++ name: ::c_int, ++ value: *const ::c_void, ++ option_len: socklen_t, ++ ) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "socketpair$UNIX2003" ++ )] + #[cfg_attr(target_os = "illumos", link_name = "__xnet_socketpair")] +- pub fn socketpair(domain: ::c_int, type_: ::c_int, protocol: ::c_int, +- socket_vector: *mut ::c_int) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "sendto$UNIX2003")] ++ pub fn socketpair( ++ domain: ::c_int, ++ type_: ::c_int, ++ protocol: ::c_int, ++ socket_vector: *mut ::c_int, ++ ) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "sendto$UNIX2003" ++ )] + #[cfg_attr(target_os = "illumos", link_name = "__xnet_sendto")] +- pub fn sendto(socket: ::c_int, buf: *const ::c_void, len: ::size_t, +- flags: ::c_int, addr: *const sockaddr, +- addrlen: socklen_t) -> ::ssize_t; ++ pub fn sendto( ++ socket: ::c_int, ++ buf: *const ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ addr: *const sockaddr, ++ addrlen: socklen_t, ++ ) -> ::ssize_t; + pub fn shutdown(socket: ::c_int, how: ::c_int) -> ::c_int; + +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "chmod$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "chmod$UNIX2003" ++ )] + pub fn chmod(path: *const c_char, mode: mode_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "fchmod$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "fchmod$UNIX2003" ++ )] + pub fn fchmod(fd: ::c_int, mode: mode_t) -> ::c_int; + +- #[cfg_attr(target_os = "macos", link_name = "fstat$INODE64")] ++ #[cfg_attr( ++ all(target_os = "macos", not(target_arch = "aarch64")), ++ link_name = "fstat$INODE64" ++ )] + #[cfg_attr(target_os = "netbsd", link_name = "__fstat50")] + #[cfg_attr( +- all(target_os = "freebsd", not(freebsd12)), ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "fstat@FBSD_1.0" + )] + pub fn fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int; + + pub fn mkdir(path: *const c_char, mode: mode_t) -> ::c_int; + +- #[cfg_attr(target_os = "macos", link_name = "stat$INODE64")] ++ #[cfg_attr( ++ all(target_os = "macos", not(target_arch = "aarch64")), ++ link_name = "stat$INODE64" ++ )] + #[cfg_attr(target_os = "netbsd", link_name = "__stat50")] + #[cfg_attr( +- all(target_os = "freebsd", not(freebsd12)), ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "stat@FBSD_1.0" + )] + pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int; + + pub fn pclose(stream: *mut ::FILE) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "fdopen$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "fdopen$UNIX2003" ++ )] + pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE; + pub fn fileno(stream: *mut ::FILE) -> ::c_int; + +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "open$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "open$UNIX2003" ++ )] + pub fn open(path: *const c_char, oflag: ::c_int, ...) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "creat$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "creat$UNIX2003" ++ )] + pub fn creat(path: *const c_char, mode: mode_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "fcntl$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "fcntl$UNIX2003" ++ )] + pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int; + +- #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"), +- link_name = "opendir$INODE64")] +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "opendir$INODE64$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86_64"), ++ link_name = "opendir$INODE64" ++ )] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "opendir$INODE64$UNIX2003" ++ )] + #[cfg_attr(target_os = "netbsd", link_name = "__opendir30")] + pub fn opendir(dirname: *const c_char) -> *mut ::DIR; + +- #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"), +- link_name = "fdopendir$INODE64")] +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "fdopendir$INODE64$UNIX2003")] +- pub fn fdopendir(fd: ::c_int) -> *mut ::DIR; +- +- #[cfg_attr(target_os = "macos", link_name = "readdir$INODE64")] ++ #[cfg_attr( ++ all(target_os = "macos", not(target_arch = "aarch64")), ++ link_name = "readdir$INODE64" ++ )] + #[cfg_attr(target_os = "netbsd", link_name = "__readdir30")] + #[cfg_attr( +- all(target_os = "freebsd", not(freebsd12)), ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "readdir@FBSD_1.0" + )] + pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent; +- #[cfg_attr(target_os = "macos", link_name = "readdir_r$INODE64")] +- #[cfg_attr(target_os = "netbsd", link_name = "__readdir_r30")] +- #[cfg_attr( +- all(target_os = "freebsd", not(freebsd12)), +- link_name = "readdir_r@FBSD_1.0" +- )] +- /// The 64-bit libc on Solaris and illumos only has readdir_r. If a +- /// 32-bit Solaris or illumos target is ever created, it should use +- /// __posix_readdir_r. See libc(3LIB) on Solaris or illumos: +- /// https://illumos.org/man/3lib/libc +- /// https://docs.oracle.com/cd/E36784_01/html/E36873/libc-3lib.html +- /// https://www.unix.com/man-page/opensolaris/3LIB/libc/ +- pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent, +- result: *mut *mut ::dirent) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "closedir$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "closedir$UNIX2003" ++ )] + pub fn closedir(dirp: *mut ::DIR) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"), +- link_name = "rewinddir$INODE64")] +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "rewinddir$INODE64$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86_64"), ++ link_name = "rewinddir$INODE64" ++ )] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "rewinddir$INODE64$UNIX2003" ++ )] + pub fn rewinddir(dirp: *mut ::DIR); + +- pub fn openat(dirfd: ::c_int, pathname: *const ::c_char, +- 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 fchown(fd: ::c_int, +- owner: ::uid_t, +- group: ::gid_t) -> ::c_int; +- pub fn fchownat(dirfd: ::c_int, pathname: *const ::c_char, +- owner: ::uid_t, group: ::gid_t, +- flags: ::c_int) -> ::c_int; +- #[cfg_attr(target_os = "macos", link_name = "fstatat$INODE64")] +- #[cfg_attr( +- all(target_os = "freebsd", not(freebsd12)), ++ pub fn fchmodat( ++ dirfd: ::c_int, ++ pathname: *const ::c_char, ++ mode: ::mode_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn fchown(fd: ::c_int, owner: ::uid_t, group: ::gid_t) -> ::c_int; ++ pub fn fchownat( ++ dirfd: ::c_int, ++ pathname: *const ::c_char, ++ owner: ::uid_t, ++ group: ::gid_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", not(target_arch = "aarch64")), ++ link_name = "fstatat$INODE64" ++ )] ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "fstatat@FBSD_1.1" + )] +- 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 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 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 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 access(path: *const c_char, amode: ::c_int) -> ::c_int; + pub fn alarm(seconds: ::c_uint) -> ::c_uint; + pub fn chdir(dir: *const c_char) -> ::c_int; + pub fn fchdir(dirfd: ::c_int) -> ::c_int; +- pub fn chown(path: *const c_char, uid: uid_t, +- gid: gid_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "lchown$UNIX2003")] +- pub fn lchown(path: *const c_char, uid: uid_t, +- gid: gid_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "close$NOCANCEL$UNIX2003")] +- #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"), +- link_name = "close$NOCANCEL")] ++ pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "lchown$UNIX2003" ++ )] ++ pub fn lchown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "close$NOCANCEL$UNIX2003" ++ )] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86_64"), ++ link_name = "close$NOCANCEL" ++ )] + pub fn close(fd: ::c_int) -> ::c_int; + pub fn dup(fd: ::c_int) -> ::c_int; + pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int; +- pub fn execl(path: *const c_char, +- arg0: *const c_char, ...) -> ::c_int; +- pub fn execle(path: *const ::c_char, +- arg0: *const ::c_char, ...) -> ::c_int; +- pub fn execlp(file: *const ::c_char, +- arg0: *const ::c_char, ...) -> ::c_int; +- pub fn execv(prog: *const c_char, +- argv: *const *const c_char) -> ::c_int; +- pub fn execve(prog: *const c_char, argv: *const *const c_char, +- envp: *const *const c_char) +- -> ::c_int; +- pub fn execvp(c: *const c_char, +- argv: *const *const c_char) -> ::c_int; ++ pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> ::c_int; ++ pub fn execle( ++ path: *const ::c_char, ++ arg0: *const ::c_char, ++ ... ++ ) -> ::c_int; ++ pub fn execlp( ++ file: *const ::c_char, ++ arg0: *const ::c_char, ++ ... ++ ) -> ::c_int; ++ pub fn execv(prog: *const c_char, argv: *const *const c_char) -> ::c_int; ++ pub fn execve( ++ prog: *const c_char, ++ argv: *const *const c_char, ++ envp: *const *const c_char, ++ ) -> ::c_int; ++ pub fn execvp(c: *const c_char, argv: *const *const c_char) -> ::c_int; + pub fn fork() -> pid_t; + pub fn fpathconf(filedes: ::c_int, name: ::c_int) -> c_long; + pub fn getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char; + pub fn getegid() -> gid_t; + pub fn geteuid() -> uid_t; + pub fn getgid() -> gid_t; +- pub fn getgroups(ngroups_max: ::c_int, groups: *mut gid_t) +- -> ::c_int; ++ pub fn getgroups(ngroups_max: ::c_int, groups: *mut gid_t) -> ::c_int; ++ #[cfg_attr(target_os = "illumos", link_name = "getloginx")] + pub fn getlogin() -> *mut c_char; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "getopt$UNIX2003")] +- pub fn getopt(argc: ::c_int, argv: *const *mut c_char, +- optstr: *const c_char) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "getopt$UNIX2003" ++ )] ++ pub fn getopt( ++ argc: ::c_int, ++ argv: *const *mut c_char, ++ optstr: *const c_char, ++ ) -> ::c_int; + pub fn getpgid(pid: pid_t) -> pid_t; + pub fn getpgrp() -> pid_t; + pub fn getpid() -> pid_t; +@@ -725,17 +887,18 @@ extern { + pub fn link(src: *const c_char, dst: *const c_char) -> ::c_int; + pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t; + pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pause$UNIX2003")] +- pub fn pause() -> ::c_int; + pub fn pipe(fds: *mut ::c_int) -> ::c_int; +- pub fn posix_memalign(memptr: *mut *mut ::c_void, +- align: ::size_t, +- size: ::size_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "read$UNIX2003")] ++ pub fn posix_memalign( ++ memptr: *mut *mut ::c_void, ++ align: ::size_t, ++ size: ::size_t, ++ ) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "read$UNIX2003" ++ )] + pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) +- -> ::ssize_t; ++ -> ::ssize_t; + pub fn rmdir(path: *const c_char) -> ::c_int; + pub fn seteuid(uid: uid_t) -> ::c_int; + pub fn setegid(gid: gid_t) -> ::c_int; +@@ -743,51 +906,88 @@ extern { + pub fn setpgid(pid: pid_t, pgid: pid_t) -> ::c_int; + pub fn setsid() -> pid_t; + pub fn setuid(uid: uid_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "sleep$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ 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( ++ 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 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; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "ttyname_r$UNIX2003")] +- pub fn ttyname_r(fd: ::c_int, +- buf: *mut c_char, buflen: ::size_t) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "ttyname_r$UNIX2003" ++ )] ++ #[cfg_attr(target_os = "illumos", link_name = "__posix_ttyname_r")] ++ pub fn ttyname_r( ++ fd: ::c_int, ++ buf: *mut c_char, ++ buflen: ::size_t, ++ ) -> ::c_int; + pub fn unlink(c: *const c_char) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "wait$UNIX2003")] ++ #[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) +- -> pid_t; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "write$UNIX2003")] +- pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) +- -> ::ssize_t; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pread$UNIX2003")] +- pub fn pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, +- offset: off_t) -> ::ssize_t; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pwrite$UNIX2003")] +- pub fn pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, +- offset: off_t) -> ::ssize_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, ++ ) -> pid_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "write$UNIX2003" ++ )] ++ pub fn write( ++ fd: ::c_int, ++ buf: *const ::c_void, ++ count: ::size_t, ++ ) -> ::ssize_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pread$UNIX2003" ++ )] ++ pub fn pread( ++ fd: ::c_int, ++ buf: *mut ::c_void, ++ count: ::size_t, ++ offset: off_t, ++ ) -> ::ssize_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pwrite$UNIX2003" ++ )] ++ pub fn pwrite( ++ fd: ::c_int, ++ buf: *const ::c_void, ++ count: ::size_t, ++ offset: off_t, ++ ) -> ::ssize_t; + pub fn umask(mask: mode_t) -> mode_t; + + #[cfg_attr(target_os = "netbsd", link_name = "__utime50")] + pub fn utime(file: *const c_char, buf: *const utimbuf) -> ::c_int; + +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "kill$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "kill$UNIX2003" ++ )] + pub fn kill(pid: pid_t, sig: ::c_int) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "killpg$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "killpg$UNIX2003" ++ )] + pub fn killpg(pgrp: pid_t, sig: ::c_int) -> ::c_int; + + pub fn mlock(addr: *const ::c_void, len: ::size_t) -> ::c_int; +@@ -795,48 +995,65 @@ extern { + pub fn mlockall(flags: ::c_int) -> ::c_int; + pub fn munlockall() -> ::c_int; + +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "mmap$UNIX2003")] +- pub fn mmap(addr: *mut ::c_void, +- len: ::size_t, +- prot: ::c_int, +- flags: ::c_int, +- fd: ::c_int, +- offset: off_t) +- -> *mut ::c_void; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "munmap$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "mmap$UNIX2003" ++ )] ++ pub fn mmap( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ prot: ::c_int, ++ flags: ::c_int, ++ fd: ::c_int, ++ offset: off_t, ++ ) -> *mut ::c_void; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "munmap$UNIX2003" ++ )] + pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int; + + pub fn if_nametoindex(ifname: *const c_char) -> ::c_uint; +- pub fn if_indextoname(ifindex: ::c_uint, +- ifname: *mut ::c_char) -> *mut ::c_char; ++ pub fn if_indextoname( ++ ifindex: ::c_uint, ++ ifname: *mut ::c_char, ++ ) -> *mut ::c_char; + +- #[cfg_attr(target_os = "macos", link_name = "lstat$INODE64")] ++ #[cfg_attr( ++ all(target_os = "macos", not(target_arch = "aarch64")), ++ link_name = "lstat$INODE64" ++ )] + #[cfg_attr(target_os = "netbsd", link_name = "__lstat50")] + #[cfg_attr( +- all(target_os = "freebsd", not(freebsd12)), ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "lstat@FBSD_1.0" + )] + pub fn lstat(path: *const c_char, buf: *mut stat) -> ::c_int; + +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "fsync$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "fsync$UNIX2003" ++ )] + pub fn fsync(fd: ::c_int) -> ::c_int; + +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "setenv$UNIX2003")] +- pub fn setenv(name: *const c_char, val: *const c_char, +- overwrite: ::c_int) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "unsetenv$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "setenv$UNIX2003" ++ )] ++ pub fn setenv( ++ name: *const c_char, ++ val: *const c_char, ++ overwrite: ::c_int, ++ ) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "unsetenv$UNIX2003" ++ )] + #[cfg_attr(target_os = "netbsd", link_name = "__unsetenv13")] + pub fn unsetenv(name: *const c_char) -> ::c_int; + +- pub fn symlink(path1: *const c_char, +- path2: *const c_char) -> ::c_int; ++ pub fn symlink(path1: *const c_char, path2: *const c_char) -> ::c_int; + +- pub fn truncate(path: *const c_char, length: off_t) -> ::c_int; + pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int; + + pub fn signal(signum: ::c_int, handler: sighandler_t) -> sighandler_t; +@@ -844,10 +1061,14 @@ extern { + #[cfg_attr(target_os = "netbsd", link_name = "__getrusage50")] + pub fn getrusage(resource: ::c_int, usage: *mut rusage) -> ::c_int; + +- #[cfg_attr(any(target_os = "macos", target_os = "ios"), +- link_name = "realpath$DARWIN_EXTSN")] +- pub fn realpath(pathname: *const ::c_char, resolved: *mut ::c_char) +- -> *mut ::c_char; ++ #[cfg_attr( ++ any(target_os = "macos", target_os = "ios"), ++ link_name = "realpath$DARWIN_EXTSN" ++ )] ++ pub fn realpath( ++ pathname: *const ::c_char, ++ resolved: *mut ::c_char, ++ ) -> *mut ::c_char; + + pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int; + +@@ -855,130 +1076,196 @@ extern { + pub fn times(buf: *mut ::tms) -> ::clock_t; + + pub fn pthread_self() -> ::pthread_t; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_join$UNIX2003")] +- pub fn pthread_join(native: ::pthread_t, +- value: *mut *mut ::c_void) -> ::c_int; +- pub fn pthread_exit(value: *mut ::c_void); ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_join$UNIX2003" ++ )] ++ pub fn pthread_join( ++ native: ::pthread_t, ++ value: *mut *mut ::c_void, ++ ) -> ::c_int; ++ pub fn pthread_exit(value: *mut ::c_void) -> !; + pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int; + pub fn pthread_attr_destroy(attr: *mut ::pthread_attr_t) -> ::c_int; +- pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, +- stack_size: ::size_t) -> ::c_int; +- pub fn pthread_attr_setdetachstate(attr: *mut ::pthread_attr_t, +- state: ::c_int) -> ::c_int; ++ pub fn pthread_attr_setstacksize( ++ attr: *mut ::pthread_attr_t, ++ stack_size: ::size_t, ++ ) -> ::c_int; ++ pub fn pthread_attr_setdetachstate( ++ attr: *mut ::pthread_attr_t, ++ state: ::c_int, ++ ) -> ::c_int; + pub fn pthread_detach(thread: ::pthread_t) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__libc_thr_yield")] + pub fn sched_yield() -> ::c_int; +- pub fn pthread_key_create(key: *mut pthread_key_t, +- dtor: ::Option) +- -> ::c_int; ++ pub fn pthread_key_create( ++ key: *mut pthread_key_t, ++ dtor: ::Option, ++ ) -> ::c_int; + pub fn pthread_key_delete(key: pthread_key_t) -> ::c_int; + pub fn pthread_getspecific(key: pthread_key_t) -> *mut ::c_void; +- pub fn pthread_setspecific(key: pthread_key_t, value: *const ::c_void) +- -> ::c_int; +- pub fn pthread_mutex_init(lock: *mut pthread_mutex_t, +- attr: *const pthread_mutexattr_t) -> ::c_int; ++ pub fn pthread_setspecific( ++ key: pthread_key_t, ++ value: *const ::c_void, ++ ) -> ::c_int; ++ pub fn pthread_mutex_init( ++ lock: *mut pthread_mutex_t, ++ attr: *const pthread_mutexattr_t, ++ ) -> ::c_int; + pub fn pthread_mutex_destroy(lock: *mut pthread_mutex_t) -> ::c_int; + pub fn pthread_mutex_lock(lock: *mut pthread_mutex_t) -> ::c_int; + pub fn pthread_mutex_trylock(lock: *mut pthread_mutex_t) -> ::c_int; + pub fn pthread_mutex_unlock(lock: *mut pthread_mutex_t) -> ::c_int; + + pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_mutexattr_destroy$UNIX2003")] +- pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> ::c_int; +- pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, +- _type: ::c_int) -> ::c_int; +- +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_cond_init$UNIX2003")] +- pub fn pthread_cond_init(cond: *mut pthread_cond_t, +- attr: *const pthread_condattr_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_cond_wait$UNIX2003")] +- pub fn pthread_cond_wait(cond: *mut pthread_cond_t, +- lock: *mut pthread_mutex_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_cond_timedwait$UNIX2003")] +- pub fn pthread_cond_timedwait(cond: *mut pthread_cond_t, +- lock: *mut pthread_mutex_t, +- abstime: *const ::timespec) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_mutexattr_destroy$UNIX2003" ++ )] ++ pub fn pthread_mutexattr_destroy( ++ attr: *mut pthread_mutexattr_t, ++ ) -> ::c_int; ++ pub fn pthread_mutexattr_settype( ++ attr: *mut pthread_mutexattr_t, ++ _type: ::c_int, ++ ) -> ::c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_cond_init$UNIX2003" ++ )] ++ pub fn pthread_cond_init( ++ cond: *mut pthread_cond_t, ++ attr: *const pthread_condattr_t, ++ ) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_cond_wait$UNIX2003" ++ )] ++ pub fn pthread_cond_wait( ++ cond: *mut pthread_cond_t, ++ lock: *mut pthread_mutex_t, ++ ) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_cond_timedwait$UNIX2003" ++ )] ++ pub fn pthread_cond_timedwait( ++ cond: *mut pthread_cond_t, ++ lock: *mut pthread_mutex_t, ++ abstime: *const ::timespec, ++ ) -> ::c_int; + pub fn pthread_cond_signal(cond: *mut pthread_cond_t) -> ::c_int; + pub fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> ::c_int; + pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> ::c_int; + pub fn pthread_condattr_init(attr: *mut pthread_condattr_t) -> ::c_int; + pub fn pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_rwlock_init$UNIX2003")] +- pub fn pthread_rwlock_init(lock: *mut pthread_rwlock_t, +- attr: *const pthread_rwlockattr_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_rwlock_destroy$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_rwlock_init$UNIX2003" ++ )] ++ pub fn pthread_rwlock_init( ++ lock: *mut pthread_rwlock_t, ++ attr: *const pthread_rwlockattr_t, ++ ) -> ::c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_rwlock_destroy$UNIX2003" ++ )] + pub fn pthread_rwlock_destroy(lock: *mut pthread_rwlock_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_rwlock_rdlock$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_rwlock_rdlock$UNIX2003" ++ )] + pub fn pthread_rwlock_rdlock(lock: *mut pthread_rwlock_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_rwlock_tryrdlock$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_rwlock_tryrdlock$UNIX2003" ++ )] + pub fn pthread_rwlock_tryrdlock(lock: *mut pthread_rwlock_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_rwlock_wrlock$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_rwlock_wrlock$UNIX2003" ++ )] + pub fn pthread_rwlock_wrlock(lock: *mut pthread_rwlock_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_rwlock_trywrlock$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_rwlock_trywrlock$UNIX2003" ++ )] + pub fn pthread_rwlock_trywrlock(lock: *mut pthread_rwlock_t) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_rwlock_unlock$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_rwlock_unlock$UNIX2003" ++ )] + pub fn pthread_rwlock_unlock(lock: *mut pthread_rwlock_t) -> ::c_int; +- pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) -> ::c_int; +- pub fn pthread_rwlockattr_destroy(attr: *mut pthread_rwlockattr_t) +- -> ::c_int; ++ pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) ++ -> ::c_int; ++ pub fn pthread_rwlockattr_destroy( ++ attr: *mut pthread_rwlockattr_t, ++ ) -> ::c_int; + + #[cfg_attr(target_os = "illumos", link_name = "__xnet_getsockopt")] +- pub fn getsockopt(sockfd: ::c_int, +- level: ::c_int, +- optname: ::c_int, +- optval: *mut ::c_void, +- optlen: *mut ::socklen_t) -> ::c_int; ++ pub fn getsockopt( ++ sockfd: ::c_int, ++ level: ::c_int, ++ optname: ::c_int, ++ optval: *mut ::c_void, ++ optlen: *mut ::socklen_t, ++ ) -> ::c_int; + pub fn raise(signum: ::c_int) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__sigaction14")] +- pub fn sigaction(signum: ::c_int, +- act: *const sigaction, +- oldact: *mut sigaction) -> ::c_int; ++ pub fn sigaction( ++ signum: ::c_int, ++ act: *const sigaction, ++ oldact: *mut sigaction, ++ ) -> ::c_int; + + #[cfg_attr(target_os = "netbsd", link_name = "__utimes50")] +- pub fn utimes(filename: *const ::c_char, +- times: *const ::timeval) -> ::c_int; +- pub fn dlopen(filename: *const ::c_char, +- flag: ::c_int) -> *mut ::c_void; ++ pub fn utimes( ++ filename: *const ::c_char, ++ times: *const ::timeval, ++ ) -> ::c_int; ++ pub fn dlopen(filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void; + pub fn dlerror() -> *mut ::c_char; +- pub fn dlsym(handle: *mut ::c_void, +- symbol: *const ::c_char) -> *mut ::c_void; ++ pub fn dlsym( ++ handle: *mut ::c_void, ++ symbol: *const ::c_char, ++ ) -> *mut ::c_void; + pub fn dlclose(handle: *mut ::c_void) -> ::c_int; + pub fn dladdr(addr: *const ::c_void, info: *mut Dl_info) -> ::c_int; + +- pub fn getaddrinfo(node: *const c_char, +- service: *const c_char, +- hints: *const addrinfo, +- res: *mut *mut addrinfo) -> ::c_int; ++ #[cfg_attr(target_os = "illumos", link_name = "__xnet_getaddrinfo")] ++ pub fn getaddrinfo( ++ node: *const c_char, ++ service: *const c_char, ++ hints: *const addrinfo, ++ res: *mut *mut addrinfo, ++ ) -> ::c_int; + pub fn freeaddrinfo(res: *mut addrinfo); + pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char; +- #[cfg_attr(any( +- all(target_os = "linux", not(target_env = "musl")), +- target_os = "freebsd", +- target_os = "dragonfly", +- target_os = "haiku"), +- link_name = "__res_init")] +- #[cfg_attr(any(target_os = "macos", target_os = "ios"), +- link_name = "res_9_init")] ++ #[cfg_attr( ++ any( ++ all(target_os = "linux", not(target_env = "musl")), ++ target_os = "freebsd", ++ target_os = "dragonfly", ++ target_os = "haiku" ++ ), ++ link_name = "__res_init" ++ )] ++ #[cfg_attr( ++ any(target_os = "macos", target_os = "ios"), ++ link_name = "res_9_init" ++ )] + pub fn res_init() -> ::c_int; + + #[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( ++ 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")] +@@ -992,62 +1279,96 @@ extern { + + #[cfg_attr(target_os = "netbsd", link_name = "__mknod50")] + #[cfg_attr( +- all(target_os = "freebsd", not(freebsd12)), ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "mknod@FBSD_1.0" + )] +- pub fn mknod(pathname: *const ::c_char, mode: ::mode_t, +- dev: ::dev_t) -> ::c_int; ++ pub fn mknod( ++ pathname: *const ::c_char, ++ mode: ::mode_t, ++ dev: ::dev_t, ++ ) -> ::c_int; + pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int; +- pub fn getservbyname(name: *const ::c_char, +- proto: *const ::c_char) -> *mut servent; ++ pub fn getservbyname( ++ name: *const ::c_char, ++ proto: *const ::c_char, ++ ) -> *mut servent; + pub fn getprotobyname(name: *const ::c_char) -> *mut protoent; + pub fn getprotobynumber(proto: ::c_int) -> *mut protoent; + pub fn chroot(name: *const ::c_char) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "usleep$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "usleep$UNIX2003" ++ )] + pub fn usleep(secs: ::c_uint) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "send$UNIX2003")] +- pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, +- flags: ::c_int) -> ::ssize_t; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "recv$UNIX2003")] +- pub fn recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, +- flags: ::c_int) -> ::ssize_t; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "putenv$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "send$UNIX2003" ++ )] ++ pub fn send( ++ socket: ::c_int, ++ buf: *const ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "recv$UNIX2003" ++ )] ++ pub fn recv( ++ socket: ::c_int, ++ buf: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "putenv$UNIX2003" ++ )] + #[cfg_attr(target_os = "netbsd", link_name = "__putenv50")] + pub fn putenv(string: *mut c_char) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "poll$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "poll$UNIX2003" ++ )] + pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"), +- link_name = "select$1050")] +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "select$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86_64"), ++ link_name = "select$1050" ++ )] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "select$UNIX2003" ++ )] + #[cfg_attr(target_os = "netbsd", link_name = "__select50")] +- pub fn select(nfds: ::c_int, +- readfs: *mut fd_set, +- writefds: *mut fd_set, +- errorfds: *mut fd_set, +- timeout: *mut timeval) -> ::c_int; ++ pub fn select( ++ nfds: ::c_int, ++ readfs: *mut fd_set, ++ writefds: *mut fd_set, ++ errorfds: *mut fd_set, ++ timeout: *mut timeval, ++ ) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__setlocale50")] +- pub fn setlocale(category: ::c_int, +- locale: *const ::c_char) -> *mut ::c_char; ++ pub fn setlocale( ++ category: ::c_int, ++ locale: *const ::c_char, ++ ) -> *mut ::c_char; + pub fn localeconv() -> *mut lconv; + +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "sem_wait$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "sem_wait$UNIX2003" ++ )] + pub fn sem_wait(sem: *mut sem_t) -> ::c_int; + pub fn sem_trywait(sem: *mut sem_t) -> ::c_int; + pub fn sem_post(sem: *mut sem_t) -> ::c_int; + pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> ::c_int; + pub fn fstatvfs(fd: ::c_int, buf: *mut statvfs) -> ::c_int; + +- pub fn readlink(path: *const c_char, +- buf: *mut c_char, +- bufsz: ::size_t) +- -> ::ssize_t; ++ pub fn readlink( ++ path: *const c_char, ++ buf: *mut c_char, ++ bufsz: ::size_t, ++ ) -> ::ssize_t; + + #[cfg_attr(target_os = "netbsd", link_name = "__sigemptyset14")] + pub fn sigemptyset(set: *mut sigset_t) -> ::c_int; +@@ -1061,48 +1382,59 @@ extern { + pub fn sigismember(set: *const sigset_t, signum: ::c_int) -> ::c_int; + + #[cfg_attr(target_os = "netbsd", link_name = "__sigprocmask14")] +- pub fn sigprocmask(how: ::c_int, +- set: *const sigset_t, +- oldset: *mut sigset_t) +- -> ::c_int; ++ pub fn sigprocmask( ++ how: ::c_int, ++ set: *const sigset_t, ++ oldset: *mut sigset_t, ++ ) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__sigpending14")] + pub fn sigpending(set: *mut sigset_t) -> ::c_int; + + #[cfg_attr(target_os = "netbsd", link_name = "__timegm50")] + pub fn timegm(tm: *mut ::tm) -> time_t; + +- pub fn getsid(pid: pid_t) -> pid_t; +- + pub fn sysconf(name: ::c_int) -> ::c_long; + + pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int; + +- #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"), +- link_name = "pselect$1050")] +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pselect$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86_64"), ++ link_name = "pselect$1050" ++ )] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pselect$UNIX2003" ++ )] + #[cfg_attr(target_os = "netbsd", link_name = "__pselect50")] +- pub fn pselect(nfds: ::c_int, +- readfs: *mut fd_set, +- writefds: *mut fd_set, +- errorfds: *mut fd_set, +- timeout: *const timespec, +- sigmask: *const sigset_t) -> ::c_int; +- pub fn fseeko(stream: *mut ::FILE, +- offset: ::off_t, +- whence: ::c_int) -> ::c_int; ++ pub fn pselect( ++ nfds: ::c_int, ++ readfs: *mut fd_set, ++ writefds: *mut fd_set, ++ errorfds: *mut fd_set, ++ timeout: *const timespec, ++ sigmask: *const sigset_t, ++ ) -> ::c_int; ++ pub fn fseeko( ++ stream: *mut ::FILE, ++ offset: ::off_t, ++ whence: ::c_int, ++ ) -> ::c_int; + pub fn ftello(stream: *mut ::FILE) -> ::off_t; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "tcdrain$UNIX2003")] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "tcdrain$UNIX2003" ++ )] + pub fn tcdrain(fd: ::c_int) -> ::c_int; + pub fn cfgetispeed(termios: *const ::termios) -> ::speed_t; + pub fn cfgetospeed(termios: *const ::termios) -> ::speed_t; + pub fn cfsetispeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int; + pub fn cfsetospeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int; + pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int; +- pub fn tcsetattr(fd: ::c_int, +- optional_actions: ::c_int, +- termios: *const ::termios) -> ::c_int; ++ pub fn tcsetattr( ++ fd: ::c_int, ++ optional_actions: ::c_int, ++ termios: *const ::termios, ++ ) -> ::c_int; + pub fn tcflow(fd: ::c_int, action: ::c_int) -> ::c_int; + pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int; + pub fn tcgetsid(fd: ::c_int) -> ::pid_t; +@@ -1117,8 +1449,10 @@ extern { + pub fn setlogmask(maskpri: ::c_int) -> ::c_int; + #[cfg_attr(target_os = "macos", link_name = "syslog$DARWIN_EXTSN")] + pub fn syslog(priority: ::c_int, message: *const ::c_char, ...); +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "nice$UNIX2003")] ++ #[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; +@@ -1127,8 +1461,60 @@ extern { + pub fn unlockpt(fd: ::c_int) -> ::c_int; + + pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char; +- pub fn getline (lineptr: *mut *mut c_char, n: *mut size_t, +- stream: *mut FILE) -> ssize_t; ++ pub fn getline( ++ lineptr: *mut *mut c_char, ++ n: *mut size_t, ++ stream: *mut FILE, ++ ) -> ssize_t; ++ ++ pub fn lockf( ++ fd: ::c_int, ++ cmd: ::c_int, ++ len: ::off_t, ++ ) -> ::c_int; ++} ++ ++cfg_if! { ++ if #[cfg(not(target_os = "redox"))] { ++ extern { ++ pub fn getsid(pid: pid_t) -> pid_t; ++ pub fn truncate(path: *const c_char, length: off_t) -> ::c_int; ++ #[cfg_attr(all(target_os = "macos", target_arch = "x86"), ++ link_name = "pause$UNIX2003")] ++ pub fn pause() -> ::c_int; ++ ++ pub fn readlinkat(dirfd: ::c_int, ++ pathname: *const ::c_char, ++ buf: *mut ::c_char, ++ bufsiz: ::size_t) -> ::ssize_t; ++ pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char, ++ mode: ::mode_t) -> ::c_int; ++ pub fn openat(dirfd: ::c_int, pathname: *const ::c_char, ++ flags: ::c_int, ...) -> ::c_int; ++ ++ #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"), ++ link_name = "fdopendir$INODE64")] ++ #[cfg_attr(all(target_os = "macos", target_arch = "x86"), ++ link_name = "fdopendir$INODE64$UNIX2003")] ++ pub fn fdopendir(fd: ::c_int) -> *mut ::DIR; ++ ++ #[cfg_attr(all(target_os = "macos", not(target_arch = "aarch64")), ++ link_name = "readdir_r$INODE64")] ++ #[cfg_attr(target_os = "netbsd", link_name = "__readdir_r30")] ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), ++ link_name = "readdir_r@FBSD_1.0" ++ )] ++ /// The 64-bit libc on Solaris and illumos only has readdir_r. If a ++ /// 32-bit Solaris or illumos target is ever created, it should use ++ /// __posix_readdir_r. See libc(3LIB) on Solaris or illumos: ++ /// https://illumos.org/man/3lib/libc ++ /// https://docs.oracle.com/cd/E36784_01/html/E36873/libc-3lib.html ++ /// https://www.unix.com/man-page/opensolaris/3LIB/libc/ ++ pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent, ++ result: *mut *mut ::dirent) -> ::c_int; ++ } ++ } + } + + cfg_if! { +diff --git a/third_party/rust/libc/src/unix/newlib/aarch64/mod.rs b/third_party/rust/libc/src/unix/newlib/aarch64/mod.rs +index 96f381a39113fb8f53ff49b9e2b078d00ad860db..71aa894922bbe0ac366268c534346aab4d85d26d 100644 +--- a/third_party/rust/libc/src/unix/newlib/aarch64/mod.rs ++++ b/third_party/rust/libc/src/unix/newlib/aarch64/mod.rs +@@ -1,5 +1,52 @@ ++pub type clock_t = ::c_long; + pub type c_char = u8; + pub type wchar_t = u32; + + pub type c_long = i64; + pub type c_ulong = u64; ++ ++s! { ++ pub struct sockaddr { ++ pub sa_len: u8, ++ pub sa_family: ::sa_family_t, ++ pub sa_data: [::c_char; 14], ++ } ++ ++ 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_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: [::c_char; 8], ++ } ++} ++ ++pub const AF_INET6: ::c_int = 23; ++ ++pub const FIONBIO: ::c_ulong = 1; ++ ++pub const POLLIN: ::c_short = 0x1; ++pub const POLLPRI: ::c_short = 0x2; ++pub const POLLOUT: ::c_short = 0x4; ++pub const POLLERR: ::c_short = 0x8; ++pub const POLLHUP: ::c_short = 0x10; ++pub const POLLNVAL: ::c_short = 0x20; ++ ++pub const SOL_SOCKET: ::c_int = 65535; ++ ++pub const MSG_OOB: ::c_int = 1; ++pub const MSG_PEEK: ::c_int = 2; ++pub const MSG_DONTWAIT: ::c_int = 4; ++pub const MSG_DONTROUTE: ::c_int = 0; ++pub const MSG_WAITALL: ::c_int = 0; ++pub const MSG_MORE: ::c_int = 0; ++pub const MSG_NOSIGNAL: ::c_int = 0; +diff --git a/third_party/rust/libc/src/unix/newlib/align.rs b/third_party/rust/libc/src/unix/newlib/align.rs +index c018fbcbb09d0f6a70ef895a4c2467f2b3de4f75..db9beb83523c24bdfc693ac3fb187db9c02234bf 100644 +--- a/third_party/rust/libc/src/unix/newlib/align.rs ++++ b/third_party/rust/libc/src/unix/newlib/align.rs +@@ -57,5 +57,5 @@ macro_rules! expand_align { + size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], + } + } +- } ++ }; + } +diff --git a/third_party/rust/libc/src/unix/newlib/arm/mod.rs b/third_party/rust/libc/src/unix/newlib/arm/mod.rs +index 372a48c4b4aed5ce9d030c672df29804f6a36d22..78bea276533d51f444b7edc7c03ffb4b0cb6dada 100644 +--- a/third_party/rust/libc/src/unix/newlib/arm/mod.rs ++++ b/third_party/rust/libc/src/unix/newlib/arm/mod.rs +@@ -1,5 +1,54 @@ ++pub type clock_t = ::c_long; + pub type c_char = u8; + pub type wchar_t = u32; + + pub type c_long = i32; + pub type c_ulong = u32; ++ ++s! { ++ pub struct sockaddr { ++ pub sa_family: ::sa_family_t, ++ pub sa_data: [::c_char; 14], ++ } ++ ++ 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, ++ } ++ ++ 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_storage { ++ pub ss_family: ::sa_family_t, ++ pub __ss_padding: [u8; 26], ++ } ++} ++ ++pub const AF_INET6: ::c_int = 23; ++ ++pub const FIONBIO: ::c_ulong = 1; ++ ++pub const POLLIN: ::c_short = 0x1; ++pub const POLLPRI: ::c_short = 0x2; ++pub const POLLHUP: ::c_short = 0x4; ++pub const POLLERR: ::c_short = 0x8; ++pub const POLLOUT: ::c_short = 0x10; ++pub const POLLNVAL: ::c_short = 0x20; ++ ++pub const SOL_SOCKET: ::c_int = 65535; ++ ++pub const MSG_OOB: ::c_int = 1; ++pub const MSG_PEEK: ::c_int = 2; ++pub const MSG_DONTWAIT: ::c_int = 4; ++pub const MSG_DONTROUTE: ::c_int = 0; ++pub const MSG_WAITALL: ::c_int = 0; ++pub const MSG_MORE: ::c_int = 0; ++pub const MSG_NOSIGNAL: ::c_int = 0; +diff --git a/third_party/rust/libc/src/unix/newlib/mod.rs b/third_party/rust/libc/src/unix/newlib/mod.rs +index 7e7310965d9133f57e7098448342c0ee89a7e608..55cb889aabe4243c4e1bfa1c160f0dcf92a2178e 100644 +--- a/third_party/rust/libc/src/unix/newlib/mod.rs ++++ b/third_party/rust/libc/src/unix/newlib/mod.rs +@@ -1,6 +1,5 @@ + pub type blkcnt_t = i32; + pub type blksize_t = i32; +-pub type clock_t = i32; + pub type clockid_t = ::c_ulong; + pub type dev_t = u32; + pub type fsblkcnt_t = u64; +@@ -25,39 +24,23 @@ pub type time_t = i32; + pub type useconds_t = u32; + + s! { +- 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 { // Unverified +- 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_storage { +- pub ss_family: sa_family_t, +- pub __ss_padding: [u8; 26], +- } +- ++ // The order of the `ai_addr` field in this struct is crucial ++ // for converting between the Rust and C types. + 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(target_arch = "xtensa")] ++ pub ai_addr: *mut sockaddr, ++ + pub ai_canonname: *mut ::c_char, ++ ++ #[cfg(not(target_arch = "xtensa"))] + pub ai_addr: *mut sockaddr, ++ + pub ai_next: *mut addrinfo, + } + +@@ -389,13 +372,6 @@ pub const O_NONBLOCK: ::c_int = 16384; + pub const O_ACCMODE: ::c_int = 3; + pub const O_CLOEXEC: ::c_int = 0x80000; + +-pub const POLLIN: ::c_short = 0x1; +-pub const POLLPRI: ::c_short = 0x2; +-pub const POLLOUT: ::c_short = 0x4; +-pub const POLLERR: ::c_short = 0x8; +-pub const POLLHUP: ::c_short = 0x10; +-pub const POLLNVAL: ::c_short = 0x20; +- + pub const RTLD_LAZY: ::c_int = 0x1; + + pub const STDIN_FILENO: ::c_int = 0; +@@ -406,7 +382,6 @@ pub const SEEK_SET: ::c_int = 0; + pub const SEEK_CUR: ::c_int = 1; + pub const SEEK_END: ::c_int = 2; + +-pub const FIONBIO: ::c_ulong = 1; + pub const FIOCLEX: ::c_ulong = 0x20006601; + pub const FIONCLEX: ::c_ulong = 0x20006602; + +@@ -433,7 +408,6 @@ pub const S_IROTH: ::mode_t = 4; + pub const S_IWOTH: ::mode_t = 2; + pub const S_IXOTH: ::mode_t = 1; + +-pub const SOL_SOCKET: ::c_int = 65535; + pub const SOL_TCP: ::c_int = 6; + + pub const PF_UNSPEC: ::c_int = 0; +@@ -442,19 +416,14 @@ pub const PF_INET6: ::c_int = 23; + + pub const AF_UNSPEC: ::c_int = 0; + pub const AF_INET: ::c_int = 2; +-pub const AF_INET6: ::c_int = 23; ++ ++pub const CLOCK_REALTIME: ::clockid_t = 1; ++pub const CLOCK_MONOTONIC: ::clockid_t = 4; ++pub const CLOCK_BOOTTIME: ::clockid_t = 4; + + pub const SOCK_STREAM: ::c_int = 1; + pub const SOCK_DGRAM: ::c_int = 2; + +-pub const MSG_OOB: ::c_int = 1; +-pub const MSG_PEEK: ::c_int = 2; +-pub const MSG_DONTWAIT: ::c_int = 4; +-pub const MSG_DONTROUTE: ::c_int = 0; +-pub const MSG_WAITALL: ::c_int = 0; +-pub const MSG_MORE: ::c_int = 0; +-pub const MSG_NOSIGNAL: ::c_int = 0; +- + pub const SHUT_RD: ::c_int = 0; + pub const SHUT_WR: ::c_int = 1; + pub const SHUT_RDWR: ::c_int = 2; +@@ -570,6 +539,13 @@ pub const EAI_MEMORY: ::c_int = -304; + pub const EAI_NONAME: ::c_int = -305; + pub const EAI_SOCKTYPE: ::c_int = -307; + ++pub const EXIT_SUCCESS: ::c_int = 0; ++pub const EXIT_FAILURE: ::c_int = 1; ++ ++pub const PRIO_PROCESS: ::c_int = 0; ++pub const PRIO_PGRP: ::c_int = 1; ++pub const PRIO_USER: ::c_int = 2; ++ + f! { + pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { + let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; +@@ -598,20 +574,23 @@ f! { + } + } + +-extern { ++extern "C" { + pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; + pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; + +- #[cfg_attr(target_os = "linux", +- link_name = "__xpg_strerror_r")] +- pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, +- buflen: ::size_t) -> ::c_int; ++ #[cfg_attr(target_os = "linux", link_name = "__xpg_strerror_r")] ++ pub fn strerror_r( ++ errnum: ::c_int, ++ buf: *mut c_char, ++ buflen: ::size_t, ++ ) -> ::c_int; + + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; +- pub fn sem_init(sem: *mut sem_t, +- pshared: ::c_int, +- value: ::c_uint) +- -> ::c_int; ++ pub fn sem_init( ++ sem: *mut sem_t, ++ pshared: ::c_int, ++ value: ::c_uint, ++ ) -> ::c_int; + + pub fn abs(i: ::c_int) -> ::c_int; + pub fn atof(s: *const ::c_char) -> ::c_double; +@@ -619,76 +598,95 @@ extern { + pub fn rand() -> ::c_int; + pub fn srand(seed: ::c_uint); + +- pub fn bind(fd: ::c_int, addr: *const sockaddr, len: socklen_t) -> ::c_int; ++ pub fn bind(fd: ::c_int, addr: *const sockaddr, len: socklen_t) ++ -> ::c_int; ++ pub fn clock_settime( ++ clock_id: ::clockid_t, ++ tp: *const ::timespec, ++ ) -> ::c_int; ++ pub fn clock_gettime( ++ clock_id: ::clockid_t, ++ tp: *mut ::timespec, ++ ) -> ::c_int; ++ pub fn clock_getres( ++ clock_id: ::clockid_t, ++ res: *mut ::timespec, ++ ) -> ::c_int; + pub fn closesocket(sockfd: ::c_int) -> ::c_int; + pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; +- pub fn recvfrom(fd: ::c_int, buf: *mut ::c_void, n: usize, flags: ::c_int, +- addr: *mut sockaddr, addr_len: *mut socklen_t) -> isize; +- pub fn getnameinfo(sa: *const sockaddr, salen: socklen_t, +- host: *mut ::c_char, hostlen: socklen_t, +- serv: *mut ::c_char, servlen: socklen_t, +- flags: ::c_int) -> ::c_int; ++ pub fn recvfrom( ++ fd: ::c_int, ++ buf: *mut ::c_void, ++ n: usize, ++ flags: ::c_int, ++ addr: *mut sockaddr, ++ addr_len: *mut socklen_t, ++ ) -> isize; ++ pub fn getnameinfo( ++ sa: *const sockaddr, ++ salen: socklen_t, ++ host: *mut ::c_char, ++ hostlen: socklen_t, ++ serv: *mut ::c_char, ++ servlen: socklen_t, ++ flags: ::c_int, ++ ) -> ::c_int; + pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; +- pub fn fexecve(fd: ::c_int, argv: *const *const ::c_char, +- envp: *const *const ::c_char) +- -> ::c_int; +- pub fn gettimeofday(tp: *mut ::timeval, +- tz: *mut ::c_void) -> ::c_int; +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrgid_r")] +- pub fn getgrgid_r(gid: ::gid_t, +- grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "sigaltstack$UNIX2003")] +- #[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")] +- pub fn sigaltstack(ss: *const stack_t, +- oss: *mut stack_t) -> ::c_int; ++ pub fn fexecve( ++ fd: ::c_int, ++ argv: *const *const ::c_char, ++ envp: *const *const ::c_char, ++ ) -> ::c_int; ++ pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; ++ pub fn getgrgid_r( ++ gid: ::gid_t, ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; ++ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sem_close(sem: *mut sem_t) -> ::c_int; + pub fn getdtablesize() -> ::c_int; +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrnam_r")] +- pub fn getgrnam_r(name: *const ::c_char, +- grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_sigmask$UNIX2003")] +- pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, +- oldset: *mut sigset_t) -> ::c_int; ++ pub fn getgrnam_r( ++ name: *const ::c_char, ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; ++ pub fn pthread_sigmask( ++ how: ::c_int, ++ set: *const sigset_t, ++ oldset: *mut sigset_t, ++ ) -> ::c_int; + pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; + pub fn getgrnam(name: *const ::c_char) -> *mut ::group; + pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + pub fn sem_unlink(name: *const ::c_char) -> ::c_int; + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; +- #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwnam_r")] +- pub fn getpwnam_r(name: *const ::c_char, +- pwd: *mut passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut passwd) -> ::c_int; +- #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwuid_r")] +- pub fn getpwuid_r(uid: ::uid_t, +- pwd: *mut passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut passwd) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch ="x86"), +- link_name = "sigwait$UNIX2003")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")] +- pub fn sigwait(set: *const sigset_t, +- sig: *mut ::c_int) -> ::c_int; +- pub fn pthread_atfork(prepare: ::Option, +- parent: ::Option, +- child: ::Option) -> ::c_int; ++ pub fn getpwnam_r( ++ name: *const ::c_char, ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; ++ pub fn getpwuid_r( ++ uid: ::uid_t, ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; ++ pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; ++ pub fn pthread_atfork( ++ prepare: ::Option, ++ parent: ::Option, ++ child: ::Option, ++ ) -> ::c_int; + pub fn getgrgid(gid: ::gid_t) -> *mut ::group; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "popen$UNIX2003")] +- pub fn popen(command: *const c_char, +- mode: *const c_char) -> *mut ::FILE; ++ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; + pub fn uname(buf: *mut ::utsname) -> ::c_int; + } + +@@ -699,6 +697,9 @@ cfg_if! { + } else if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; ++ } else if #[cfg(target_arch = "xtensa")] { ++ mod xtensa; ++ pub use self::xtensa::*; + } else { + // Only tested on ARM so far. Other platforms might have different + // definitions for types and constants. +diff --git a/third_party/rust/libc/src/unix/newlib/xtensa/mod.rs b/third_party/rust/libc/src/unix/newlib/xtensa/mod.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..bc31506b5d574508de6b2d517d45f3e3ad50349f +--- /dev/null ++++ b/third_party/rust/libc/src/unix/newlib/xtensa/mod.rs +@@ -0,0 +1,106 @@ ++pub type clock_t = ::c_ulong; ++pub type c_char = i8; ++pub type wchar_t = u32; ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++ ++s! { ++ pub struct cmsghdr { ++ pub cmsg_len: ::socklen_t, ++ pub cmsg_level: ::c_int, ++ pub cmsg_type: ::c_int, ++ } ++ ++ 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 sockaddr_un { ++ pub sun_family: ::sa_family_t, ++ pub sun_path: [::c_char; 108], ++ } ++ ++ pub struct sockaddr { ++ pub sa_len: u8, ++ pub sa_family: ::sa_family_t, ++ pub sa_data: [::c_char; 14], ++ } ++ ++ 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_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: [::c_char; 8], ++ } ++ ++ pub struct sockaddr_storage { ++ pub s2_len: u8, ++ pub ss_family: ::sa_family_t, ++ pub s2_data1: [::c_char; 2], ++ pub s2_data2: [u32; 3], ++ pub s2_data3: [u32; 3], ++ } ++} ++ ++pub const AF_UNIX: ::c_int = 1; ++pub const AF_INET6: ::c_int = 10; ++ ++pub const FIONBIO: ::c_ulong = 2147772030; ++ ++pub const POLLIN: ::c_short = 1 << 0; ++pub const POLLRDNORM: ::c_short = 1 << 1; ++pub const POLLRDBAND: ::c_short = 1 << 2; ++pub const POLLPRI: ::c_short = POLLRDBAND; ++pub const POLLOUT: ::c_short = 1 << 3; ++pub const POLLWRNORM: ::c_short = POLLOUT; ++pub const POLLWRBAND: ::c_short = 1 << 4; ++pub const POLLERR: ::c_short = 1 << 5; ++pub const POLLHUP: ::c_short = 1 << 6; ++ ++pub const SOL_SOCKET: ::c_int = 0xfff; ++ ++pub const MSG_OOB: ::c_int = 0x04; ++pub const MSG_PEEK: ::c_int = 0x01; ++pub const MSG_DONTWAIT: ::c_int = 0x08; ++pub const MSG_DONTROUTE: ::c_int = 0x4; ++pub const MSG_WAITALL: ::c_int = 0x02; ++pub const MSG_MORE: ::c_int = 0x10; ++pub const MSG_NOSIGNAL: ::c_int = 0x20; ++ ++extern "C" { ++ pub fn sendmsg( ++ s: ::c_int, ++ msg: *const ::msghdr, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ pub fn recvmsg( ++ s: ::c_int, ++ msg: *mut ::msghdr, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ ++ pub fn writev(s: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) ++ -> ::c_int; ++ pub fn readv( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ ) -> ::ssize_t; ++} +diff --git a/third_party/rust/libc/src/unix/redox/mod.rs b/third_party/rust/libc/src/unix/redox/mod.rs +index 388918eb9b5dcf7efa6f8468feb7fc0ca842b04e..55f64ee54fea06f270e3c031a8e6b975568f22a3 100644 +--- a/third_party/rust/libc/src/unix/redox/mod.rs ++++ b/third_party/rust/libc/src/unix/redox/mod.rs +@@ -36,6 +36,51 @@ pub type suseconds_t = ::c_int; + pub type tcflag_t = u32; + pub type time_t = ::c_long; + ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum timezone {} ++impl ::Copy for timezone {} ++impl ::Clone for timezone { ++ fn clone(&self) -> timezone { ++ *self ++ } ++} ++ ++s_no_extra_traits! { ++ #[repr(C)] ++ pub struct utsname { ++ pub sysname: [::c_char; UTSLENGTH], ++ pub nodename: [::c_char; UTSLENGTH], ++ pub release: [::c_char; UTSLENGTH], ++ pub version: [::c_char; UTSLENGTH], ++ pub machine: [::c_char; UTSLENGTH], ++ pub domainname: [::c_char; UTSLENGTH], ++ } ++ ++ pub struct dirent { ++ pub d_ino: ::ino_t, ++ pub d_off: ::off_t, ++ pub d_reclen: ::c_ushort, ++ pub d_type: ::c_uchar, ++ pub d_name: [::c_char; 256], ++ } ++ ++ pub struct sockaddr_un { ++ pub sun_family: ::sa_family_t, ++ pub sun_path: [::c_char; 108] ++ } ++ ++ pub struct sockaddr_storage { ++ pub ss_family: ::sa_family_t, ++ __ss_padding: [ ++ u8; ++ 128 - ++ ::core::mem::size_of::() - ++ ::core::mem::size_of::() ++ ], ++ __ss_align: ::c_ulong, ++ } ++} ++ + s! { + pub struct addrinfo { + pub ai_flags: ::c_int, +@@ -48,14 +93,6 @@ s! { + pub ai_next: *mut ::addrinfo, + } + +- pub struct dirent { +- pub d_ino: ::ino_t, +- pub d_off: ::off_t, +- pub d_reclen: ::c_ushort, +- pub d_type: ::c_uchar, +- pub d_name: [::c_char; 256], +- } +- + pub struct Dl_info { + pub dli_fname: *const ::c_char, + pub dli_fbase: *mut ::c_void, +@@ -140,22 +177,6 @@ s! { + pub sin6_scope_id: u32, + } + +- pub struct sockaddr_storage { +- pub ss_family: ::sa_family_t, +- __ss_padding: [ +- u8; +- 128 - +- ::core::mem::size_of::() - +- ::core::mem::size_of::() +- ], +- __ss_align: ::c_ulong, +- } +- +- pub struct sockaddr_un { +- pub sun_family: ::sa_family_t, +- pub sun_path: [::c_char; 108] +- } +- + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, +@@ -216,63 +237,175 @@ s! { + } + } + +-// TODO: relibc { +- pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void; ++pub const UTSLENGTH: usize = 65; ++ ++// 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 ++ } ++} ++ ++// limits.h ++pub const PATH_MAX: ::c_int = 4096; ++ ++// fcntl.h ++pub const F_GETLK: ::c_int = 5; ++pub const F_SETLK: ::c_int = 6; ++pub const F_SETLKW: ::c_int = 7; ++ ++// FIXME: relibc { ++pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void; + // } + + // dlfcn.h +- + pub const RTLD_LAZY: ::c_int = 0x0001; + pub const RTLD_NOW: ::c_int = 0x0002; + pub const RTLD_GLOBAL: ::c_int = 0x0100; + pub const RTLD_LOCAL: ::c_int = 0x0000; + + // errno.h +-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 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 EDEADLK: ::c_int = 35; +-pub const ENOSYS: ::c_int = 38; +-pub const EWOULDBLOCK: ::c_int = 41; +-pub const EADDRINUSE: ::c_int = 98; +-pub const EADDRNOTAVAIL: ::c_int = 99; +-pub const ECONNABORTED: ::c_int = 103; +-pub const ECONNRESET: ::c_int = 104; +-pub const ENOTCONN: ::c_int = 107; +-pub const ETIMEDOUT: ::c_int = 110; +-pub const ECONNREFUSED: ::c_int = 111; +-pub const EINPROGRESS: ::c_int = 115; ++pub const EPERM: ::c_int = 1; /* Operation not permitted */ ++pub const ENOENT: ::c_int = 2; /* No such file or directory */ ++pub const ESRCH: ::c_int = 3; /* No such process */ ++pub const EINTR: ::c_int = 4; /* Interrupted system call */ ++pub const EIO: ::c_int = 5; /* I/O error */ ++pub const ENXIO: ::c_int = 6; /* No such device or address */ ++pub const E2BIG: ::c_int = 7; /* Argument list too long */ ++pub const ENOEXEC: ::c_int = 8; /* Exec format error */ ++pub const EBADF: ::c_int = 9; /* Bad file number */ ++pub const ECHILD: ::c_int = 10; /* No child processes */ ++pub const EAGAIN: ::c_int = 11; /* Try again */ ++pub const ENOMEM: ::c_int = 12; /* Out of memory */ ++pub const EACCES: ::c_int = 13; /* Permission denied */ ++pub const EFAULT: ::c_int = 14; /* Bad address */ ++pub const ENOTBLK: ::c_int = 15; /* Block device required */ ++pub const EBUSY: ::c_int = 16; /* Device or resource busy */ ++pub const EEXIST: ::c_int = 17; /* File exists */ ++pub const EXDEV: ::c_int = 18; /* Cross-device link */ ++pub const ENODEV: ::c_int = 19; /* No such device */ ++pub const ENOTDIR: ::c_int = 20; /* Not a directory */ ++pub const EISDIR: ::c_int = 21; /* Is a directory */ ++pub const EINVAL: ::c_int = 22; /* Invalid argument */ ++pub const ENFILE: ::c_int = 23; /* File table overflow */ ++pub const EMFILE: ::c_int = 24; /* Too many open files */ ++pub const ENOTTY: ::c_int = 25; /* Not a typewriter */ ++pub const ETXTBSY: ::c_int = 26; /* Text file busy */ ++pub const EFBIG: ::c_int = 27; /* File too large */ ++pub const ENOSPC: ::c_int = 28; /* No space left on device */ ++pub const ESPIPE: ::c_int = 29; /* Illegal seek */ ++pub const EROFS: ::c_int = 30; /* Read-only file system */ ++pub const EMLINK: ::c_int = 31; /* Too many links */ ++pub const EPIPE: ::c_int = 32; /* Broken pipe */ ++pub const EDOM: ::c_int = 33; /* Math argument out of domain of func */ ++pub const ERANGE: ::c_int = 34; /* Math result not representable */ ++pub const EDEADLK: ::c_int = 35; /* Resource deadlock would occur */ ++pub const ENAMETOOLONG: ::c_int = 36; /* File name too long */ ++pub const ENOLCK: ::c_int = 37; /* No record locks available */ ++pub const ENOSYS: ::c_int = 38; /* Function not implemented */ ++pub const ENOTEMPTY: ::c_int = 39; /* Directory not empty */ ++pub const ELOOP: ::c_int = 40; /* Too many symbolic links encountered */ ++pub const EWOULDBLOCK: ::c_int = 41; /* Operation would block */ ++pub const ENOMSG: ::c_int = 42; /* No message of desired type */ ++pub const EIDRM: ::c_int = 43; /* Identifier removed */ ++pub const ECHRNG: ::c_int = 44; /* Channel number out of range */ ++pub const EL2NSYNC: ::c_int = 45; /* Level 2 not synchronized */ ++pub const EL3HLT: ::c_int = 46; /* Level 3 halted */ ++pub const EL3RST: ::c_int = 47; /* Level 3 reset */ ++pub const ELNRNG: ::c_int = 48; /* Link number out of range */ ++pub const EUNATCH: ::c_int = 49; /* Protocol driver not attached */ ++pub const ENOCSI: ::c_int = 50; /* No CSI structure available */ ++pub const EL2HLT: ::c_int = 51; /* Level 2 halted */ ++pub const EBADE: ::c_int = 52; /* Invalid exchange */ ++pub const EBADR: ::c_int = 53; /* Invalid request descriptor */ ++pub const EXFULL: ::c_int = 54; /* Exchange full */ ++pub const ENOANO: ::c_int = 55; /* No anode */ ++pub const EBADRQC: ::c_int = 56; /* Invalid request code */ ++pub const EBADSLT: ::c_int = 57; /* Invalid slot */ ++pub const EDEADLOCK: ::c_int = 58; /* Resource deadlock would occur */ ++pub const EBFONT: ::c_int = 59; /* Bad font file format */ ++pub const ENOSTR: ::c_int = 60; /* Device not a stream */ ++pub const ENODATA: ::c_int = 61; /* No data available */ ++pub const ETIME: ::c_int = 62; /* Timer expired */ ++pub const ENOSR: ::c_int = 63; /* Out of streams resources */ ++pub const ENONET: ::c_int = 64; /* Machine is not on the network */ ++pub const ENOPKG: ::c_int = 65; /* Package not installed */ ++pub const EREMOTE: ::c_int = 66; /* Object is remote */ ++pub const ENOLINK: ::c_int = 67; /* Link has been severed */ ++pub const EADV: ::c_int = 68; /* Advertise error */ ++pub const ESRMNT: ::c_int = 69; /* Srmount error */ ++pub const ECOMM: ::c_int = 70; /* Communication error on send */ ++pub const EPROTO: ::c_int = 71; /* Protocol error */ ++pub const EMULTIHOP: ::c_int = 72; /* Multihop attempted */ ++pub const EDOTDOT: ::c_int = 73; /* RFS specific error */ ++pub const EBADMSG: ::c_int = 74; /* Not a data message */ ++pub const EOVERFLOW: ::c_int = 75; /* Value too large for defined data type */ ++pub const ENOTUNIQ: ::c_int = 76; /* Name not unique on network */ ++pub const EBADFD: ::c_int = 77; /* File descriptor in bad state */ ++pub const EREMCHG: ::c_int = 78; /* Remote address changed */ ++pub const ELIBACC: ::c_int = 79; /* Can not access a needed shared library */ ++pub const ELIBBAD: ::c_int = 80; /* Accessing a corrupted shared library */ ++pub const ELIBSCN: ::c_int = 81; /* .lib section in a.out corrupted */ ++/* Attempting to link in too many shared libraries */ ++pub const ELIBMAX: ::c_int = 82; ++pub const ELIBEXEC: ::c_int = 83; /* Cannot exec a shared library directly */ ++pub const EILSEQ: ::c_int = 84; /* Illegal byte sequence */ ++/* Interrupted system call should be restarted */ ++pub const ERESTART: ::c_int = 85; ++pub const ESTRPIPE: ::c_int = 86; /* Streams pipe error */ ++pub const EUSERS: ::c_int = 87; /* Too many users */ ++pub const ENOTSOCK: ::c_int = 88; /* Socket operation on non-socket */ ++pub const EDESTADDRREQ: ::c_int = 89; /* Destination address required */ ++pub const EMSGSIZE: ::c_int = 90; /* Message too long */ ++pub const EPROTOTYPE: ::c_int = 91; /* Protocol wrong type for socket */ ++pub const ENOPROTOOPT: ::c_int = 92; /* Protocol not available */ ++pub const EPROTONOSUPPORT: ::c_int = 93; /* Protocol not supported */ ++pub const ESOCKTNOSUPPORT: ::c_int = 94; /* Socket type not supported */ ++/* Operation not supported on transport endpoint */ ++pub const EOPNOTSUPP: ::c_int = 95; ++pub const EPFNOSUPPORT: ::c_int = 96; /* Protocol family not supported */ ++/* Address family not supported by protocol */ ++pub const EAFNOSUPPORT: ::c_int = 97; ++pub const EADDRINUSE: ::c_int = 98; /* Address already in use */ ++pub const EADDRNOTAVAIL: ::c_int = 99; /* Cannot assign requested address */ ++pub const ENETDOWN: ::c_int = 100; /* Network is down */ ++pub const ENETUNREACH: ::c_int = 101; /* Network is unreachable */ ++/* Network dropped connection because of reset */ ++pub const ENETRESET: ::c_int = 102; ++pub const ECONNABORTED: ::c_int = 103; /* Software caused connection abort */ ++pub const ECONNRESET: ::c_int = 104; /* Connection reset by peer */ ++pub const ENOBUFS: ::c_int = 105; /* No buffer space available */ ++pub const EISCONN: ::c_int = 106; /* Transport endpoint is already connected */ ++pub const ENOTCONN: ::c_int = 107; /* Transport endpoint is not connected */ ++/* Cannot send after transport endpoint shutdown */ ++pub const ESHUTDOWN: ::c_int = 108; ++pub const ETOOMANYREFS: ::c_int = 109; /* Too many references: cannot splice */ ++pub const ETIMEDOUT: ::c_int = 110; /* Connection timed out */ ++pub const ECONNREFUSED: ::c_int = 111; /* Connection refused */ ++pub const EHOSTDOWN: ::c_int = 112; /* Host is down */ ++pub const EHOSTUNREACH: ::c_int = 113; /* No route to host */ ++pub const EALREADY: ::c_int = 114; /* Operation already in progress */ ++pub const EINPROGRESS: ::c_int = 115; /* Operation now in progress */ ++pub const ESTALE: ::c_int = 116; /* Stale NFS file handle */ ++pub const EUCLEAN: ::c_int = 117; /* Structure needs cleaning */ ++pub const ENOTNAM: ::c_int = 118; /* Not a XENIX named type file */ ++pub const ENAVAIL: ::c_int = 119; /* No XENIX semaphores available */ ++pub const EISNAM: ::c_int = 120; /* Is a named type file */ ++pub const EREMOTEIO: ::c_int = 121; /* Remote I/O error */ ++pub const EDQUOT: ::c_int = 122; /* Quota exceeded */ ++pub const ENOMEDIUM: ::c_int = 123; /* No medium found */ ++pub const EMEDIUMTYPE: ::c_int = 124; /* Wrong medium type */ ++pub const ECANCELED: ::c_int = 125; /* Operation Canceled */ ++pub const ENOKEY: ::c_int = 126; /* Required key not available */ ++pub const EKEYEXPIRED: ::c_int = 127; /* Key has expired */ ++pub const EKEYREVOKED: ::c_int = 128; /* Key has been revoked */ ++pub const EKEYREJECTED: ::c_int = 129; /* Key was rejected by service */ ++pub const EOWNERDEAD: ::c_int = 130; /* Owner died */ ++pub const ENOTRECOVERABLE: ::c_int = 131; /* State not recoverable */ + + // fcntl.h + pub const F_DUPFD: ::c_int = 0; +@@ -280,8 +413,8 @@ 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; +-// TODO: relibc { +- pub const F_DUPFD_CLOEXEC: ::c_int = ::F_DUPFD; ++// FIXME: relibc { ++pub const F_DUPFD_CLOEXEC: ::c_int = ::F_DUPFD; + // } + pub const FD_CLOEXEC: ::c_int = 0x0100_0000; + pub const O_RDONLY: ::c_int = 0x0001_0000; +@@ -302,33 +435,33 @@ pub const O_DIRECTORY: ::c_int = 0x1000_0000; + pub const O_PATH: ::c_int = 0x2000_0000; + pub const O_SYMLINK: ::c_int = 0x4000_0000; + // Negative to allow it to be used as int +-// TODO: Fix negative values missing from includes ++// FIXME: Fix negative values missing from includes + pub const O_NOFOLLOW: ::c_int = -0x8000_0000; + + // netdb.h + pub const EAI_SYSTEM: ::c_int = -11; + + // netinet/in.h +-// TODO: relibc { +- pub const IP_TTL: ::c_int = 2; +- pub const IPV6_UNICAST_HOPS: ::c_int = 16; +- pub const IPV6_MULTICAST_IF: ::c_int = 17; +- pub const IPV6_MULTICAST_HOPS: ::c_int = 18; +- pub const IPV6_MULTICAST_LOOP: ::c_int = 19; +- pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20; +- pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21; +- pub const IPV6_V6ONLY: ::c_int = 26; +- pub const IP_MULTICAST_IF: ::c_int = 32; +- pub const IP_MULTICAST_TTL: ::c_int = 33; +- pub const IP_MULTICAST_LOOP: ::c_int = 34; +- pub const IP_ADD_MEMBERSHIP: ::c_int = 35; +- pub const IP_DROP_MEMBERSHIP: ::c_int = 36; ++// FIXME: relibc { ++pub const IP_TTL: ::c_int = 2; ++pub const IPV6_UNICAST_HOPS: ::c_int = 16; ++pub const IPV6_MULTICAST_IF: ::c_int = 17; ++pub const IPV6_MULTICAST_HOPS: ::c_int = 18; ++pub const IPV6_MULTICAST_LOOP: ::c_int = 19; ++pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20; ++pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21; ++pub const IPV6_V6ONLY: ::c_int = 26; ++pub const IP_MULTICAST_IF: ::c_int = 32; ++pub const IP_MULTICAST_TTL: ::c_int = 33; ++pub const IP_MULTICAST_LOOP: ::c_int = 34; ++pub const IP_ADD_MEMBERSHIP: ::c_int = 35; ++pub const IP_DROP_MEMBERSHIP: ::c_int = 36; + // } + + // netinet/tcp.h + pub const TCP_NODELAY: ::c_int = 1; +-// TODO: relibc { +- pub const TCP_KEEPIDLE: ::c_int = 1; ++// FIXME: relibc { ++pub const TCP_KEEPIDLE: ::c_int = 1; + // } + + // poll.h +@@ -345,7 +478,7 @@ pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1; + pub const PTHREAD_MUTEX_INITIALIZER: ::pthread_mutex_t = -1isize as *mut _; + pub const PTHREAD_COND_INITIALIZER: ::pthread_cond_t = -1isize as *mut _; + pub const PTHREAD_RWLOCK_INITIALIZER: ::pthread_rwlock_t = -1isize as *mut _; +-pub const PTHREAD_STACK_MIN : ::size_t = 4096; ++pub const PTHREAD_STACK_MIN: ::size_t = 4096; + + // signal.h + pub const SIG_BLOCK: ::c_int = 0; +@@ -384,6 +517,15 @@ pub const SIGPWR: ::c_int = 30; + pub const SIGSYS: ::c_int = 31; + pub const NSIG: ::c_int = 32; + ++pub const SA_NOCLDSTOP: ::c_ulong = 0x00000001; ++pub const SA_NOCLDWAIT: ::c_ulong = 0x00000002; ++pub const SA_SIGINFO: ::c_ulong = 0x00000004; ++pub const SA_RESTORER: ::c_ulong = 0x04000000; ++pub const SA_ONSTACK: ::c_ulong = 0x08000000; ++pub const SA_RESTART: ::c_ulong = 0x10000000; ++pub const SA_NODEFER: ::c_ulong = 0x40000000; ++pub const SA_RESETHAND: ::c_ulong = 0x80000000; ++ + // sys/epoll.h + pub const EPOLL_CLOEXEC: ::c_int = 0x0100_0000; + pub const EPOLL_CTL_ADD: ::c_int = 1; +@@ -433,9 +575,9 @@ pub const EXIT_SUCCESS: ::c_int = 0; + pub const EXIT_FAILURE: ::c_int = 1; + + // sys/ioctl.h +-// TODO: relibc { +- pub const FIONBIO: ::c_ulong = 0x5421; +- pub const FIOCLEX: ::c_ulong = 0x5451; ++// FIXME: relibc { ++pub const FIONBIO: ::c_ulong = 0x5421; ++pub const FIOCLEX: ::c_ulong = 0x5451; + // } + pub const TCGETS: ::c_ulong = 0x5401; + pub const TCSETS: ::c_ulong = 0x5402; +@@ -445,6 +587,23 @@ pub const TIOCSPGRP: ::c_ulong = 0x5410; + pub const TIOCGWINSZ: ::c_ulong = 0x5413; + pub const TIOCSWINSZ: ::c_ulong = 0x5414; + ++// sys/mman.h ++pub const PROT_NONE: ::c_int = 0x0000; ++pub const PROT_READ: ::c_int = 0x0004; ++pub const PROT_WRITE: ::c_int = 0x0002; ++pub const PROT_EXEC: ::c_int = 0x0001; ++ ++pub const MAP_SHARED: ::c_int = 0x0001; ++pub const MAP_PRIVATE: ::c_int = 0x0002; ++pub const MAP_ANON: ::c_int = 0x0020; ++pub const MAP_ANONYMOUS: ::c_int = MAP_ANON; ++pub const MAP_FIXED: ::c_int = 0x0010; ++pub const MAP_FAILED: *mut ::c_void = !0 as _; ++ ++pub const MS_ASYNC: ::c_int = 0x0001; ++pub const MS_INVALIDATE: ::c_int = 0x0002; ++pub const MS_SYNC: ::c_int = 0x0004; ++ + // sys/select.h + pub const FD_SETSIZE: usize = 1024; + +@@ -470,18 +629,171 @@ pub const SOCK_STREAM: ::c_int = 1; + pub const SOCK_DGRAM: ::c_int = 2; + pub const SOL_SOCKET: ::c_int = 1; + ++// sys/termios.h ++pub const NCCS: usize = 32; ++ ++pub const VINTR: usize = 0; ++pub const VQUIT: usize = 1; ++pub const VERASE: usize = 2; ++pub const VKILL: usize = 3; ++pub const VEOF: usize = 4; ++pub const VTIME: usize = 5; ++pub const VMIN: usize = 6; ++pub const VSWTC: usize = 7; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VSUSP: usize = 10; ++pub const VEOL: usize = 11; ++pub const VREPRINT: usize = 12; ++pub const VDISCARD: usize = 13; ++pub const VWERASE: usize = 14; ++pub const VLNEXT: usize = 15; ++pub const VEOL2: usize = 16; ++ ++pub const IGNBRK: ::tcflag_t = 0o000_001; ++pub const BRKINT: ::tcflag_t = 0o000_002; ++pub const IGNPAR: ::tcflag_t = 0o000_004; ++pub const PARMRK: ::tcflag_t = 0o000_010; ++pub const INPCK: ::tcflag_t = 0o000_020; ++pub const ISTRIP: ::tcflag_t = 0o000_040; ++pub const INLCR: ::tcflag_t = 0o000_100; ++pub const IGNCR: ::tcflag_t = 0o000_200; ++pub const ICRNL: ::tcflag_t = 0o000_400; ++pub const IUCLC: ::tcflag_t = 0o001_000; ++pub const IXON: ::tcflag_t = 0o002_000; ++pub const IXANY: ::tcflag_t = 0o004_000; ++pub const IXOFF: ::tcflag_t = 0o010_000; ++pub const IMAXBEL: ::tcflag_t = 0o020_000; ++pub const IUTF8: ::tcflag_t = 0o040_000; ++ ++pub const OPOST: ::tcflag_t = 0o000_001; ++pub const OLCUC: ::tcflag_t = 0o000_002; ++pub const ONLCR: ::tcflag_t = 0o000_004; ++pub const OCRNL: ::tcflag_t = 0o000_010; ++pub const ONOCR: ::tcflag_t = 0o000_020; ++pub const ONLRET: ::tcflag_t = 0o00_0040; ++pub const OFILL: ::tcflag_t = 0o000_100; ++pub const OFDEL: ::tcflag_t = 0o000_200; ++ ++pub const VTDLY: usize = 0o040_000; ++pub const VT0: usize = 0o000_000; ++pub const VT1: usize = 0o040_000; ++ ++pub const B0: speed_t = 0o000_000; ++pub const B50: speed_t = 0o000_001; ++pub const B75: speed_t = 0o000_002; ++pub const B110: speed_t = 0o000_003; ++pub const B134: speed_t = 0o000_004; ++pub const B150: speed_t = 0o000_005; ++pub const B200: speed_t = 0o000_006; ++pub const B300: speed_t = 0o000_007; ++pub const B600: speed_t = 0o000_010; ++pub const B1200: speed_t = 0o000_011; ++pub const B1800: speed_t = 0o000_012; ++pub const B2400: speed_t = 0o000_013; ++pub const B4800: speed_t = 0o000_014; ++pub const B9600: speed_t = 0o000_015; ++pub const B19200: speed_t = 0o000_016; ++pub const B38400: speed_t = 0o000_017; ++ ++pub const B57600: speed_t = 0o010_001; ++pub const B115200: speed_t = 0o010_002; ++pub const B230400: speed_t = 0o010_003; ++pub const B460800: speed_t = 0o010_004; ++pub const B500000: speed_t = 0o010_005; ++pub const B576000: speed_t = 0o010_006; ++pub const B921600: speed_t = 0o010_007; ++pub const B1000000: speed_t = 0o010_010; ++pub const B1152000: speed_t = 0o010_011; ++pub const B1500000: speed_t = 0o010_012; ++pub const B2000000: speed_t = 0o010_013; ++pub const B2500000: speed_t = 0o010_014; ++pub const B3000000: speed_t = 0o010_015; ++pub const B3500000: speed_t = 0o010_016; ++pub const B4000000: speed_t = 0o010_017; ++ ++pub const CSIZE: ::tcflag_t = 0o000_060; ++pub const CS5: ::tcflag_t = 0o000_000; ++pub const CS6: ::tcflag_t = 0o000_020; ++pub const CS7: ::tcflag_t = 0o000_040; ++pub const CS8: ::tcflag_t = 0o000_060; ++pub const CSTOPB: ::tcflag_t = 0o000_100; ++pub const CREAD: ::tcflag_t = 0o000_200; ++pub const PARENB: ::tcflag_t = 0o000_400; ++pub const PARODD: ::tcflag_t = 0o001_000; ++pub const HUPCL: ::tcflag_t = 0o002_000; ++pub const CLOCAL: ::tcflag_t = 0o004_000; ++ ++pub const ISIG: ::tcflag_t = 0o000_001; ++pub const ICANON: ::tcflag_t = 0o000_002; ++pub const ECHO: ::tcflag_t = 0o000_010; ++pub const ECHOE: ::tcflag_t = 0o000_020; ++pub const ECHOK: ::tcflag_t = 0o000_040; ++pub const ECHONL: ::tcflag_t = 0o000_100; ++pub const NOFLSH: ::tcflag_t = 0o000_200; ++pub const TOSTOP: ::tcflag_t = 0o000_400; ++pub const IEXTEN: ::tcflag_t = 0o100_000; ++ ++pub const TCOOFF: ::c_int = 0; ++pub const TCOON: ::c_int = 1; ++pub const TCIOFF: ::c_int = 2; ++pub const TCION: ::c_int = 3; ++ ++pub const TCIFLUSH: ::c_int = 0; ++pub const TCOFLUSH: ::c_int = 1; ++pub const TCIOFLUSH: ::c_int = 2; ++ ++pub const TCSANOW: ::c_int = 0; ++pub const TCSADRAIN: ::c_int = 1; ++pub const TCSAFLUSH: ::c_int = 2; ++ + // sys/wait.h + pub const WNOHANG: ::c_int = 1; ++pub const WUNTRACED: ::c_int = 2; + +-// termios.h +-pub const NCCS: usize = 32; ++pub const WSTOPPED: ::c_int = 2; ++pub const WEXITED: ::c_int = 4; ++pub const WCONTINUED: ::c_int = 8; ++pub const WNOWAIT: ::c_int = 0x0100_0000; ++ ++pub const __WNOTHREAD: ::c_int = 0x2000_0000; ++pub const __WALL: ::c_int = 0x4000_0000; ++#[allow(overflowing_literals)] ++pub const __WCLONE: ::c_int = 0x8000_0000; + + // time.h + pub const CLOCK_REALTIME: ::c_int = 1; + pub const CLOCK_MONOTONIC: ::c_int = 4; + + // unistd.h ++// POSIX.1 { ++pub const _SC_ARG_MAX: ::c_int = 0; ++pub const _SC_CHILD_MAX: ::c_int = 1; ++pub const _SC_CLK_TCK: ::c_int = 2; ++pub const _SC_NGROUPS_MAX: ::c_int = 3; ++pub const _SC_OPEN_MAX: ::c_int = 4; ++pub const _SC_STREAM_MAX: ::c_int = 5; ++pub const _SC_TZNAME_MAX: ::c_int = 6; ++// ... ++pub const _SC_VERSION: ::c_int = 29; + pub const _SC_PAGESIZE: ::c_int = 30; ++pub const _SC_PAGE_SIZE: ::c_int = 30; ++// ... ++pub const _SC_RE_DUP_MAX: ::c_int = 44; ++// ... ++pub const _SC_LOGIN_NAME_MAX: ::c_int = 71; ++pub const _SC_TTY_NAME_MAX: ::c_int = 72; ++// ... ++pub const _SC_SYMLOOP_MAX: ::c_int = 173; ++// ... ++pub const _SC_HOST_NAME_MAX: ::c_int = 180; ++// } POSIX.1 ++ ++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 SEEK_SET: ::c_int = 0; + pub const SEEK_CUR: ::c_int = 1; + pub const SEEK_END: ::c_int = 2; +@@ -489,108 +801,379 @@ pub const STDIN_FILENO: ::c_int = 0; + pub const STDOUT_FILENO: ::c_int = 1; + pub const STDERR_FILENO: ::c_int = 2; + ++pub const _PC_LINK_MAX: ::c_int = 0; ++pub const _PC_MAX_CANON: ::c_int = 1; ++pub const _PC_MAX_INPUT: ::c_int = 2; ++pub const _PC_NAME_MAX: ::c_int = 3; ++pub const _PC_PATH_MAX: ::c_int = 4; ++pub const _PC_PIPE_BUF: ::c_int = 5; ++pub const _PC_CHOWN_RESTRICTED: ::c_int = 6; ++pub const _PC_NO_TRUNC: ::c_int = 7; ++pub const _PC_VDISABLE: ::c_int = 8; ++pub const _PC_SYNC_IO: ::c_int = 9; ++pub const _PC_ASYNC_IO: ::c_int = 10; ++pub const _PC_PRIO_IO: ::c_int = 11; ++pub const _PC_SOCK_MAXBUF: ::c_int = 12; ++pub const _PC_FILESIZEBITS: ::c_int = 13; ++pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14; ++pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15; ++pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16; ++pub const _PC_REC_XFER_ALIGN: ::c_int = 17; ++pub const _PC_ALLOC_SIZE_MIN: ::c_int = 18; ++pub const _PC_SYMLINK_MAX: ::c_int = 19; ++pub const _PC_2_SYMLINKS: ::c_int = 20; ++ ++pub const PRIO_PROCESS: ::c_int = 0; ++pub const PRIO_PGRP: ::c_int = 1; ++pub const PRIO_USER: ::c_int = 2; ++ + // wait.h +-pub fn WIFSTOPPED(status: ::c_int) -> bool { +- (status & 0xff) == 0x7f +-} ++f! { ++ pub fn WIFSTOPPED(status: ::c_int) -> bool { ++ (status & 0xff) == 0x7f ++ } + +-pub fn WSTOPSIG(status: ::c_int) -> ::c_int { +- (status >> 8) & 0xff +-} ++ pub fn WSTOPSIG(status: ::c_int) -> ::c_int { ++ (status >> 8) & 0xff ++ } + +-pub fn WIFCONTINUED(status: ::c_int) -> bool { +- status == 0xffff +-} ++ pub fn WIFCONTINUED(status: ::c_int) -> bool { ++ status == 0xffff ++ } + +-pub fn WIFSIGNALED(status: ::c_int) -> bool { +- ((status & 0x7f) + 1) as i8 >= 2 +-} ++ pub fn WIFSIGNALED(status: ::c_int) -> bool { ++ ((status & 0x7f) + 1) as i8 >= 2 ++ } + +-pub fn WTERMSIG(status: ::c_int) -> ::c_int { +- status & 0x7f +-} ++ pub fn WTERMSIG(status: ::c_int) -> ::c_int { ++ status & 0x7f ++ } + +-pub fn WIFEXITED(status: ::c_int) -> bool { +- (status & 0x7f) == 0 +-} ++ pub fn WIFEXITED(status: ::c_int) -> bool { ++ (status & 0x7f) == 0 ++ } + +-pub fn WEXITSTATUS(status: ::c_int) -> ::c_int { +- (status >> 8) & 0xff +-} ++ pub fn WEXITSTATUS(status: ::c_int) -> ::c_int { ++ (status >> 8) & 0xff ++ } + +-pub fn WCOREDUMP(status: ::c_int) -> bool { +- (status & 0x80) != 0 +-} ++ pub fn WCOREDUMP(status: ::c_int) -> bool { ++ (status & 0x80) != 0 ++ } + +-// 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 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; ++ } + } + } + +-extern { +- pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; +- pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; ++extern "C" { ++ // errno.h ++ pub fn __errno_location() -> *mut ::c_int; ++ pub fn strerror_r( ++ errnum: ::c_int, ++ buf: *mut c_char, ++ buflen: ::size_t, ++ ) -> ::c_int; + +- pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, +- buflen: ::size_t) -> ::c_int; ++ // unistd.h ++ pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; + + // malloc.h + pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; + + // pthread.h +- pub fn pthread_atfork(prepare: ::Option, +- parent: ::Option, +- child: ::Option) -> ::c_int; +- pub fn pthread_create(tid: *mut ::pthread_t, +- attr: *const ::pthread_attr_t, +- start: extern fn(*mut ::c_void) -> *mut ::c_void, +- arg: *mut ::c_void) -> ::c_int; +- pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t, +- clock_id: ::clockid_t) -> ::c_int; ++ pub fn pthread_atfork( ++ prepare: ::Option, ++ parent: ::Option, ++ child: ::Option, ++ ) -> ::c_int; ++ pub fn pthread_create( ++ tid: *mut ::pthread_t, ++ attr: *const ::pthread_attr_t, ++ start: extern "C" fn(*mut ::c_void) -> *mut ::c_void, ++ arg: *mut ::c_void, ++ ) -> ::c_int; ++ pub fn pthread_condattr_setclock( ++ attr: *mut pthread_condattr_t, ++ clock_id: ::clockid_t, ++ ) -> ::c_int; ++ ++ // pwd.h ++ pub fn getpwuid_r( ++ uid: ::uid_t, ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; + + // signal.h +- pub fn pthread_sigmask(how: ::c_int, +- set: *const ::sigset_t, +- oldset: *mut ::sigset_t) -> ::c_int; ++ pub fn pthread_sigmask( ++ how: ::c_int, ++ set: *const ::sigset_t, ++ oldset: *mut ::sigset_t, ++ ) -> ::c_int; + + // sys/epoll.h + pub fn epoll_create(size: ::c_int) -> ::c_int; + pub fn epoll_create1(flags: ::c_int) -> ::c_int; +- pub fn epoll_wait(epfd: ::c_int, +- events: *mut ::epoll_event, +- maxevents: ::c_int, +- timeout: ::c_int) -> ::c_int; +- pub fn epoll_ctl(epfd: ::c_int, +- op: ::c_int, +- fd: ::c_int, +- event: *mut ::epoll_event) -> ::c_int; ++ pub fn epoll_wait( ++ epfd: ::c_int, ++ events: *mut ::epoll_event, ++ maxevents: ::c_int, ++ timeout: ::c_int, ++ ) -> ::c_int; ++ pub fn epoll_ctl( ++ epfd: ::c_int, ++ op: ::c_int, ++ fd: ::c_int, ++ event: *mut ::epoll_event, ++ ) -> ::c_int; + + // sys/ioctl.h + pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; + ++ // sys/mman.h ++ pub fn msync( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn mprotect( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ prot: ::c_int, ++ ) -> ::c_int; ++ pub fn shm_open( ++ name: *const c_char, ++ oflag: ::c_int, ++ mode: mode_t, ++ ) -> ::c_int; ++ pub fn shm_unlink(name: *const ::c_char) -> ::c_int; ++ ++ // sys/resource.h ++ pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; ++ pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; ++ + // sys/socket.h +- pub fn bind(socket: ::c_int, address: *const ::sockaddr, +- address_len: ::socklen_t) -> ::c_int; +- pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, +- flags: ::c_int, addr: *mut ::sockaddr, +- addrlen: *mut ::socklen_t) -> ::ssize_t; ++ pub fn bind( ++ socket: ::c_int, ++ address: *const ::sockaddr, ++ address_len: ::socklen_t, ++ ) -> ::c_int; ++ pub fn recvfrom( ++ socket: ::c_int, ++ buf: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ addr: *mut ::sockaddr, ++ addrlen: *mut ::socklen_t, ++ ) -> ::ssize_t; ++ ++ // sys/stat.h ++ pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; + + // sys/uio.h +- pub fn readv(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int) -> ::ssize_t; +- pub fn writev(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int) -> ::ssize_t; ++ pub fn readv( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ ) -> ::ssize_t; ++ pub fn writev( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ ) -> ::ssize_t; ++ ++ // sys/utsname.h ++ pub fn uname(utsname: *mut utsname) -> ::c_int; + + // time.h +- pub fn gettimeofday(tp: *mut ::timeval, +- tz: *mut ::timezone) -> ::c_int; ++ pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; + pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + } ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for dirent { ++ fn eq(&self, other: &dirent) -> bool { ++ self.d_ino == other.d_ino ++ && self.d_off == other.d_off ++ && self.d_reclen == other.d_reclen ++ && self.d_type == other.d_type ++ && self ++ .d_name ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a,b)| a == b) ++ } ++ } ++ ++ impl Eq for dirent {} ++ ++ impl ::fmt::Debug for dirent { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_ino", &self.d_ino) ++ .field("d_off", &self.d_off) ++ .field("d_reclen", &self.d_reclen) ++ .field("d_type", &self.d_type) ++ // FIXME: .field("d_name", &self.d_name) ++ .finish() ++ } ++ } ++ ++ impl ::hash::Hash for dirent { ++ fn hash(&self, state: &mut H) { ++ self.d_ino.hash(state); ++ self.d_off.hash(state); ++ self.d_reclen.hash(state); ++ self.d_type.hash(state); ++ self.d_name.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_un { ++ fn eq(&self, other: &sockaddr_un) -> bool { ++ self.sun_family == other.sun_family ++ && self ++ .sun_path ++ .iter() ++ .zip(other.sun_path.iter()) ++ .all(|(a,b)| a == b) ++ } ++ } ++ ++ impl Eq for sockaddr_un {} ++ ++ impl ::fmt::Debug for sockaddr_un { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("sockaddr_un") ++ .field("sun_family", &self.sun_family) ++ // FIXME: .field("sun_path", &self.sun_path) ++ .finish() ++ } ++ } ++ ++ impl ::hash::Hash for sockaddr_un { ++ fn hash(&self, state: &mut H) { ++ self.sun_family.hash(state); ++ self.sun_path.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_storage { ++ fn eq(&self, other: &sockaddr_storage) -> bool { ++ self.ss_family == other.ss_family ++ && self.__ss_align == self.__ss_align ++ && self ++ .__ss_padding ++ .iter() ++ .zip(other.__ss_padding.iter()) ++ .all(|(a,b)| a == b) ++ } ++ } ++ ++ impl Eq for sockaddr_storage {} ++ ++ impl ::fmt::Debug for sockaddr_storage { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("sockaddr_storage") ++ .field("ss_family", &self.ss_family) ++ .field("__ss_align", &self.__ss_align) ++ // FIXME: .field("__ss_padding", &self.__ss_padding) ++ .finish() ++ } ++ } ++ ++ impl ::hash::Hash for sockaddr_storage { ++ fn hash(&self, state: &mut H) { ++ self.ss_family.hash(state); ++ self.__ss_padding.hash(state); ++ self.__ss_align.hash(state); ++ } ++ } ++ ++ impl PartialEq for utsname { ++ fn eq(&self, other: &utsname) -> bool { ++ self.sysname ++ .iter() ++ .zip(other.sysname.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .nodename ++ .iter() ++ .zip(other.nodename.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .release ++ .iter() ++ .zip(other.release.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .version ++ .iter() ++ .zip(other.version.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .machine ++ .iter() ++ .zip(other.machine.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .domainname ++ .iter() ++ .zip(other.domainname.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for utsname {} ++ ++ impl ::fmt::Debug for utsname { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("utsname") ++ // FIXME: .field("sysname", &self.sysname) ++ // FIXME: .field("nodename", &self.nodename) ++ // FIXME: .field("release", &self.release) ++ // FIXME: .field("version", &self.version) ++ // FIXME: .field("machine", &self.machine) ++ // FIXME: .field("domainname", &self.domainname) ++ .finish() ++ } ++ } ++ ++ impl ::hash::Hash for utsname { ++ fn hash(&self, state: &mut H) { ++ self.sysname.hash(state); ++ self.nodename.hash(state); ++ self.release.hash(state); ++ self.version.hash(state); ++ self.machine.hash(state); ++ self.domainname.hash(state); ++ } ++ } ++ } ++} +diff --git a/third_party/rust/libc/src/unix/solarish/compat.rs b/third_party/rust/libc/src/unix/solarish/compat.rs +index 8631d6018920cb48b9d5b193c2bac4953d7f22ba..610dd109735a6fc700cded355190e5f927bc3908 100644 +--- a/third_party/rust/libc/src/unix/solarish/compat.rs ++++ b/third_party/rust/libc/src/unix/solarish/compat.rs +@@ -4,15 +4,41 @@ + use unix::solarish::*; + + pub unsafe fn cfmakeraw(termios: *mut ::termios) { +- let mut t = *termios as ::termios; +- t.c_iflag &= !(IMAXBEL|IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); +- t.c_oflag &= !OPOST; +- t.c_lflag &= !(ECHO|ECHONL|ICANON|ISIG|IEXTEN); +- t.c_cflag &= !(CSIZE|PARENB); +- t.c_cflag |= CS8; ++ (*termios).c_iflag &= !(IMAXBEL ++ | IGNBRK ++ | BRKINT ++ | PARMRK ++ | ISTRIP ++ | INLCR ++ | IGNCR ++ | ICRNL ++ | IXON); ++ (*termios).c_oflag &= !OPOST; ++ (*termios).c_lflag &= !(ECHO | ECHONL | ICANON | ISIG | IEXTEN); ++ (*termios).c_cflag &= !(CSIZE | PARENB); ++ (*termios).c_cflag |= CS8; ++ ++ // By default, most software expects a pending read to block until at ++ // least one byte becomes available. As per termio(7I), this requires ++ // setting the MIN and TIME parameters appropriately. ++ // ++ // As a somewhat unfortunate artefact of history, the MIN and TIME slots ++ // in the control character array overlap with the EOF and EOL slots used ++ // for canonical mode processing. Because the EOF character needs to be ++ // the ASCII EOT value (aka Control-D), it has the byte value 4. When ++ // switching to raw mode, this is interpreted as a MIN value of 4; i.e., ++ // reads will block until at least four bytes have been input. ++ // ++ // Other platforms with a distinct MIN slot like Linux and FreeBSD appear ++ // to default to a MIN value of 1, so we'll force that value here: ++ (*termios).c_cc[VMIN] = 1; ++ (*termios).c_cc[VTIME] = 0; + } + +-pub unsafe fn cfsetspeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int { ++pub unsafe fn cfsetspeed( ++ termios: *mut ::termios, ++ speed: ::speed_t, ++) -> ::c_int { + // Neither of these functions on illumos or Solaris actually ever + // return an error + ::cfsetispeed(termios, speed); +diff --git a/third_party/rust/libc/src/unix/solarish/illumos.rs b/third_party/rust/libc/src/unix/solarish/illumos.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..b52a5f08954b1932aa0b25c4790d833a5be61ea9 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/solarish/illumos.rs +@@ -0,0 +1,33 @@ ++s! { ++ pub struct shmid_ds { ++ pub shm_perm: ::ipc_perm, ++ pub shm_segsz: ::size_t, ++ pub shm_amp: *mut ::c_void, ++ pub shm_lkcnt: ::c_ushort, ++ pub shm_lpid: ::pid_t, ++ pub shm_cpid: ::pid_t, ++ pub shm_nattch: ::shmatt_t, ++ pub shm_cnattch: ::c_ulong, ++ pub shm_atime: ::time_t, ++ pub shm_dtime: ::time_t, ++ pub shm_ctime: ::time_t, ++ pub shm_pad4: [i64; 4], ++ } ++} ++ ++pub const AF_LOCAL: ::c_int = 1; // AF_UNIX ++pub const AF_FILE: ::c_int = 1; // AF_UNIX ++ ++pub const EFD_SEMAPHORE: ::c_int = 0x1; ++pub const EFD_NONBLOCK: ::c_int = 0x800; ++pub const EFD_CLOEXEC: ::c_int = 0x80000; ++ ++extern "C" { ++ pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; ++ ++ pub fn mincore( ++ addr: ::caddr_t, ++ len: ::size_t, ++ vec: *mut ::c_char, ++ ) -> ::c_int; ++} +diff --git a/third_party/rust/libc/src/unix/solarish/mod.rs b/third_party/rust/libc/src/unix/solarish/mod.rs +index 78956146adea623e0e7051d4be86596640ccbcac..98e2dc7837726bc40e849b7fe9d3105d3d104fb3 100644 +--- a/third_party/rust/libc/src/unix/solarish/mod.rs ++++ b/third_party/rust/libc/src/unix/solarish/mod.rs +@@ -1,6 +1,7 @@ + pub type c_char = i8; + pub type c_long = i64; + pub type c_ulong = u64; ++pub type caddr_t = *mut ::c_char; + + pub type clockid_t = ::c_int; + pub type blkcnt_t = ::c_long; +@@ -34,15 +35,15 @@ pub type nl_item = ::c_int; + pub type mqd_t = *mut ::c_void; + pub type id_t = ::c_int; + pub type idtype_t = ::c_uint; +- +-pub type door_attr_t = ::c_uint; +-pub type door_id_t = ::c_ulonglong; ++pub type shmatt_t = ::c_ulong; + + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub enum timezone {} + impl ::Copy for timezone {} + impl ::Clone for timezone { +- fn clone(&self) -> timezone { *self } ++ fn clone(&self) -> timezone { ++ *self ++ } + } + + s! { +@@ -55,6 +56,16 @@ s! { + pub imr_interface: in_addr, + } + ++ pub struct ipc_perm { ++ pub uid: ::uid_t, ++ pub gid: ::gid_t, ++ pub cuid: ::uid_t, ++ pub cgid: ::gid_t, ++ pub mode: ::mode_t, ++ pub seq: ::c_uint, ++ pub key: ::key_t, ++ } ++ + pub struct sockaddr { + pub sa_family: sa_family_t, + pub sa_data: [::c_char; 14], +@@ -331,7 +342,7 @@ s! { + pub mq_maxmsg: ::c_long, + pub mq_msgsize: ::c_long, + pub mq_curmsgs: ::c_long, +- _pad: [::c_int; 4] ++ _pad: [::c_int; 12] + } + + pub struct port_event { +@@ -342,19 +353,77 @@ s! { + pub portev_user: *mut ::c_void, + } + +- pub struct door_desc_t__d_data__d_desc { +- pub d_descriptor: ::c_int, +- pub d_id: ::door_id_t ++ pub struct exit_status { ++ e_termination: ::c_short, ++ e_exit: ::c_short, ++ } ++ ++ pub struct utmp { ++ pub ut_user: [::c_char; 8], ++ pub ut_id: [::c_char; 4], ++ pub ut_line: [::c_char; 12], ++ pub ut_pid: ::c_short, ++ pub ut_type: ::c_short, ++ pub ut_exit: exit_status, ++ pub ut_time: ::time_t, ++ } ++ ++ pub struct timex { ++ pub modes: u32, ++ pub offset: i32, ++ pub freq: i32, ++ pub maxerror: i32, ++ pub esterror: i32, ++ pub status: i32, ++ pub constant: i32, ++ pub precision: i32, ++ pub tolerance: i32, ++ pub ppsfreq: i32, ++ pub jitter: i32, ++ pub shift: i32, ++ pub stabil: i32, ++ pub jitcnt: i32, ++ pub calcnt: i32, ++ pub errcnt: i32, ++ pub stbcnt: i32, ++ } ++ ++ pub struct ntptimeval { ++ pub time: ::timeval, ++ pub maxerror: i32, ++ pub esterror: i32, + } ++ + } + + s_no_extra_traits! { +- #[cfg_attr(any(target_arch = "x86", target_arch = "x86_64"), repr(packed))] ++ #[cfg_attr(all( ++ any(target_arch = "x86", target_arch = "x86_64"), ++ libc_packedN ++ ), repr(packed(4)))] ++ #[cfg_attr(all( ++ any(target_arch = "x86", target_arch = "x86_64"), ++ not(libc_packedN) ++ ), repr(packed))] + pub struct epoll_event { + pub events: u32, + pub u64: u64, + } + ++ 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_exit: exit_status, ++ pub ut_tv: ::timeval, ++ pub ut_session: ::c_int, ++ pub ut_pad: [::c_int; _UTX_PADSIZE], ++ pub ut_syslen: ::c_short, ++ pub ut_host: [::c_char; _UTX_HOSTSIZE], ++ } ++ + pub struct sockaddr_un { + pub sun_family: sa_family_t, + pub sun_path: [c_char; 108] +@@ -409,29 +478,66 @@ s_no_extra_traits! { + pub sigev_notify_attributes: *const ::pthread_attr_t, + __sigev_pad2: ::c_int, + } +- +- pub union door_desc_t__d_data { +- pub d_desc: door_desc_t__d_data__d_desc, +- d_resv: [::c_int; 5], /* Check out /usr/include/sys/door.h */ +- } +- +- pub struct door_desc_t { +- pub d_attributes: door_attr_t, +- pub d_data: door_desc_t__d_data, +- } +- +- pub struct door_arg_t { +- pub data_ptr: *const ::c_char, +- pub data_size: ::size_t, +- pub desc_ptr: *const door_desc_t, +- pub dec_num: ::c_uint, +- pub rbuf: *const ::c_char, +- pub rsize: ::size_t, +- } + } + + cfg_if! { + if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for utmpx { ++ fn eq(&self, other: &utmpx) -> bool { ++ self.ut_type == other.ut_type ++ && self.ut_pid == other.ut_pid ++ && self.ut_user == other.ut_user ++ && self.ut_line == other.ut_line ++ && self.ut_id == other.ut_id ++ && self.ut_exit == other.ut_exit ++ && self.ut_session == other.ut_session ++ && self.ut_tv == other.ut_tv ++ && self.ut_syslen == other.ut_syslen ++ && self.ut_pad == other.ut_pad ++ && self ++ .ut_host ++ .iter() ++ .zip(other.ut_host.iter()) ++ .all(|(a,b)| a == b) ++ } ++ } ++ ++ impl Eq for utmpx {} ++ ++ impl ::fmt::Debug for utmpx { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("utmpx") ++ .field("ut_user", &self.ut_user) ++ .field("ut_id", &self.ut_id) ++ .field("ut_line", &self.ut_line) ++ .field("ut_pid", &self.ut_pid) ++ .field("ut_type", &self.ut_type) ++ .field("ut_exit", &self.ut_exit) ++ .field("ut_tv", &self.ut_tv) ++ .field("ut_session", &self.ut_session) ++ .field("ut_pad", &self.ut_pad) ++ .field("ut_syslen", &self.ut_syslen) ++ .field("ut_host", &&self.ut_host[..]) ++ .finish() ++ } ++ } ++ ++ impl ::hash::Hash for utmpx { ++ fn hash(&self, state: &mut H) { ++ self.ut_user.hash(state); ++ self.ut_type.hash(state); ++ self.ut_pid.hash(state); ++ self.ut_line.hash(state); ++ self.ut_id.hash(state); ++ self.ut_host.hash(state); ++ self.ut_exit.hash(state); ++ self.ut_session.hash(state); ++ self.ut_tv.hash(state); ++ self.ut_syslen.hash(state); ++ self.ut_pad.hash(state); ++ } ++ } ++ + impl PartialEq for epoll_event { + fn eq(&self, other: &epoll_event) -> bool { + self.events == other.events +@@ -707,18 +813,18 @@ pub const LC_COLLATE: ::c_int = 3; + pub const LC_MONETARY: ::c_int = 4; + pub const LC_MESSAGES: ::c_int = 5; + pub const LC_ALL: ::c_int = 6; +-pub const LC_CTYPE_MASK: ::c_int = (1 << LC_CTYPE); +-pub const LC_NUMERIC_MASK: ::c_int = (1 << LC_NUMERIC); +-pub const LC_TIME_MASK: ::c_int = (1 << LC_TIME); +-pub const LC_COLLATE_MASK: ::c_int = (1 << LC_COLLATE); +-pub const LC_MONETARY_MASK: ::c_int = (1 << LC_MONETARY); +-pub const LC_MESSAGES_MASK: ::c_int = (1 << LC_MESSAGES); ++pub const LC_CTYPE_MASK: ::c_int = 1 << LC_CTYPE; ++pub const LC_NUMERIC_MASK: ::c_int = 1 << LC_NUMERIC; ++pub const LC_TIME_MASK: ::c_int = 1 << LC_TIME; ++pub const LC_COLLATE_MASK: ::c_int = 1 << LC_COLLATE; ++pub const LC_MONETARY_MASK: ::c_int = 1 << LC_MONETARY; ++pub const LC_MESSAGES_MASK: ::c_int = 1 << LC_MESSAGES; + 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_NUMERIC_MASK ++ | LC_TIME_MASK ++ | LC_COLLATE_MASK ++ | LC_MONETARY_MASK ++ | LC_MESSAGES_MASK; + + pub const DAY_1: ::nl_item = 1; + pub const DAY_2: ::nl_item = 2; +@@ -815,7 +921,7 @@ pub const SIG_UNBLOCK: ::c_int = 2; + pub const SIG_SETMASK: ::c_int = 3; + + pub const SIGEV_NONE: ::c_int = 1; +-pub const SIGEV_SIGNAL: ::c_int =2; ++pub const SIGEV_SIGNAL: ::c_int = 2; + pub const SIGEV_THREAD: ::c_int = 3; + + pub const IPV6_UNICAST_HOPS: ::c_int = 0x5; +@@ -844,6 +950,8 @@ 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 SEEK_DATA: ::c_int = 3; ++pub const SEEK_HOLE: ::c_int = 4; + pub const _IOFBF: ::c_int = 0; + pub const _IONBF: ::c_int = 4; + pub const _IOLBF: ::c_int = 64; +@@ -863,7 +971,7 @@ pub const O_CREAT: ::c_int = 256; + pub const O_EXCL: ::c_int = 1024; + pub const O_NOCTTY: ::c_int = 2048; + pub const O_TRUNC: ::c_int = 512; +-pub const O_NOFOLLOW: ::c_int = 0x200000; ++pub const O_NOFOLLOW: ::c_int = 0x20000; + pub const O_SEARCH: ::c_int = 0x200000; + pub const O_EXEC: ::c_int = 0x400000; + pub const O_CLOEXEC: ::c_int = 0x800000; +@@ -947,6 +1055,10 @@ pub const WNOWAIT: ::c_int = 0x80; + + pub const AT_FDCWD: ::c_int = 0xffd19553; + pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x1000; ++pub const AT_SYMLINK_FOLLOW: ::c_int = 0x2000; ++pub const AT_REMOVEDIR: ::c_int = 0x1; ++pub const _AT_TRIGGER: ::c_int = 0x2; ++pub const AT_EACCESS: ::c_int = 0x4; + + pub const P_PID: idtype_t = 0; + pub const P_PPID: idtype_t = 1; +@@ -965,6 +1077,9 @@ pub const P_CTID: idtype_t = 13; + pub const P_CPUID: idtype_t = 14; + pub const P_PSETID: idtype_t = 15; + ++pub const UTIME_OMIT: c_long = -2; ++pub const UTIME_NOW: c_long = -1; ++ + pub const PROT_NONE: ::c_int = 0; + pub const PROT_READ: ::c_int = 1; + pub const PROT_WRITE: ::c_int = 2; +@@ -976,6 +1091,7 @@ pub const MAP_PRIVATE: ::c_int = 0x0002; + pub const MAP_FIXED: ::c_int = 0x0010; + pub const MAP_NORESERVE: ::c_int = 0x40; + pub const MAP_ANON: ::c_int = 0x0100; ++pub const MAP_ANONYMOUS: ::c_int = 0x0100; + pub const MAP_RENAME: ::c_int = 0x20; + pub const MAP_ALIGN: ::c_int = 0x200; + pub const MAP_TEXT: ::c_int = 0x400; +@@ -988,7 +1104,6 @@ pub const MCL_FUTURE: ::c_int = 0x0002; + pub const MS_SYNC: ::c_int = 0x0004; + pub const MS_ASYNC: ::c_int = 0x0001; + pub const MS_INVALIDATE: ::c_int = 0x0002; +-pub const MS_INVALCURPROC: ::c_int = 0x0008; + + pub const EPERM: ::c_int = 1; + pub const ENOENT: ::c_int = 2; +@@ -1134,17 +1249,17 @@ pub const F_SETFL: ::c_int = 4; + + pub const SIGTRAP: ::c_int = 5; + +-pub const GLOB_APPEND : ::c_int = 32; +-pub const GLOB_DOOFFS : ::c_int = 16; +-pub const GLOB_ERR : ::c_int = 1; +-pub const GLOB_MARK : ::c_int = 2; +-pub const GLOB_NOCHECK : ::c_int = 8; +-pub const GLOB_NOSORT : ::c_int = 4; ++pub const GLOB_APPEND: ::c_int = 32; ++pub const GLOB_DOOFFS: ::c_int = 16; ++pub const GLOB_ERR: ::c_int = 1; ++pub const GLOB_MARK: ::c_int = 2; ++pub const GLOB_NOCHECK: ::c_int = 8; ++pub const GLOB_NOSORT: ::c_int = 4; + pub const GLOB_NOESCAPE: ::c_int = 64; + +-pub const GLOB_NOSPACE : ::c_int = -2; +-pub const GLOB_ABORTED : ::c_int = -1; +-pub const GLOB_NOMATCH : ::c_int = -3; ++pub const GLOB_NOSPACE: ::c_int = -2; ++pub const GLOB_ABORTED: ::c_int = -1; ++pub const GLOB_NOMATCH: ::c_int = -3; + + pub const POLLIN: ::c_short = 0x1; + pub const POLLPRI: ::c_short = 0x2; +@@ -1196,8 +1311,9 @@ pub const RLIMIT_NOFILE: ::c_int = 5; + pub const RLIMIT_VMEM: ::c_int = 6; + pub const RLIMIT_AS: ::c_int = RLIMIT_VMEM; + ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] + pub const RLIM_NLIMITS: rlim_t = 7; +-pub const RLIM_INFINITY: rlim_t = 0x7fffffff; ++pub const RLIM_INFINITY: rlim_t = 0xfffffffffffffffd; + + pub const RUSAGE_SELF: ::c_int = 0; + pub const RUSAGE_CHILDREN: ::c_int = -1; +@@ -1211,8 +1327,6 @@ pub const MADV_FREE: ::c_int = 5; + + pub const AF_UNSPEC: ::c_int = 0; + pub const AF_UNIX: ::c_int = 1; +-pub const AF_LOCAL: ::c_int = 0; +-pub const AF_FILE: ::c_int = 0; + pub const AF_INET: ::c_int = 2; + pub const AF_IMPLINK: ::c_int = 3; + pub const AF_PUP: ::c_int = 4; +@@ -1244,7 +1358,6 @@ pub const AF_POLICY: ::c_int = 29; + pub const AF_INET_OFFLOAD: ::c_int = 30; + pub const AF_TRILL: ::c_int = 31; + pub const AF_PACKET: ::c_int = 32; +-pub const AF_LX_NETLINK: ::c_int = 33; + + pub const SOCK_DGRAM: ::c_int = 1; + pub const SOCK_STREAM: ::c_int = 2; +@@ -1301,6 +1414,9 @@ pub const MSG_DUPCTRL: ::c_int = 0x800; + pub const MSG_XPG4_2: ::c_int = 0x8000; + pub const MSG_MAXIOVLEN: ::c_int = 16; + ++pub const IF_NAMESIZE: ::size_t = 32; ++pub const IFNAMSIZ: ::size_t = 16; ++ + // https://docs.oracle.com/cd/E23824_01/html/821-1475/if-7p.html + pub const IFF_UP: ::c_int = 0x0000000001; // Address is up + pub const IFF_BROADCAST: ::c_int = 0x0000000002; // Broadcast address valid +@@ -1314,12 +1430,14 @@ pub const IFF_PROMISC: ::c_int = 0x0000000100; // Receive all packets + pub const IFF_ALLMULTI: ::c_int = 0x0000000200; // Receive all multicast pkts + pub const IFF_INTELLIGENT: ::c_int = 0x0000000400; // Protocol code on board + pub const IFF_MULTICAST: ::c_int = 0x0000000800; // Supports multicast ++ + // Multicast using broadcst. add. + pub const IFF_MULTI_BCAST: ::c_int = 0x0000001000; + pub const IFF_UNNUMBERED: ::c_int = 0x0000002000; // Non-unique address + pub const IFF_DHCPRUNNING: ::c_int = 0x0000004000; // DHCP controls interface + pub const IFF_PRIVATE: ::c_int = 0x0000008000; // Do not advertise + pub const IFF_NOXMIT: ::c_int = 0x0000010000; // Do not transmit pkts ++ + // No address - just on-link subnet + pub const IFF_NOLOCAL: ::c_int = 0x0000020000; + pub const IFF_DEPRECATED: ::c_int = 0x0000040000; // Address is deprecated +@@ -1335,7 +1453,7 @@ pub const IFF_FAILED: ::c_int = 0x0010000000; // Interface has failed + pub const IFF_STANDBY: ::c_int = 0x0020000000; // Interface is a hot-spare + pub const IFF_INACTIVE: ::c_int = 0x0040000000; // Functioning but not used + pub const IFF_OFFLINE: ::c_int = 0x0080000000; // Interface is offline +-// If CoS marking is supported ++ // If CoS marking is supported + pub const IFF_COS_ENABLED: ::c_longlong = 0x0200000000; + pub const IFF_PREFERRED: ::c_longlong = 0x0400000000; // Prefer as source addr. + pub const IFF_TEMPORARY: ::c_longlong = 0x0800000000; // RFC3041 +@@ -1344,6 +1462,16 @@ pub const IFF_VIRTUAL: ::c_longlong = 0x2000000000; // Cannot send/receive pkts + pub const IFF_DUPLICATE: ::c_longlong = 0x4000000000; // Local address in use + pub const IFF_IPMP: ::c_longlong = 0x8000000000; // IPMP IP interface + ++// sys/ipc.h: ++pub const IPC_ALLOC: ::c_int = 0x8000; ++pub const IPC_CREAT: ::c_int = 0x200; ++pub const IPC_EXCL: ::c_int = 0x400; ++pub const IPC_NOWAIT: ::c_int = 0x800; ++pub const IPC_PRIVATE: key_t = 0; ++pub const IPC_RMID: ::c_int = 10; ++pub const IPC_SET: ::c_int = 11; ++pub const IPC_SEAT: ::c_int = 12; ++ + pub const SHUT_RD: ::c_int = 0; + pub const SHUT_WR: ::c_int = 1; + pub const SHUT_RDWR: ::c_int = 2; +@@ -1545,8 +1673,8 @@ pub const _SC_IPV6: ::c_int = 762; + pub const _SC_RAW_SOCKETS: ::c_int = 763; + + pub const _MUTEX_MAGIC: u16 = 0x4d58; // MX +-pub const _COND_MAGIC: u16 = 0x4356; // CV +-pub const _RWL_MAGIC: u16 = 0x5257; // RW ++pub const _COND_MAGIC: u16 = 0x4356; // CV ++pub const _RWL_MAGIC: u16 = 0x5257; // RW + + pub const NCCS: usize = 19; + +@@ -1559,13 +1687,13 @@ pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { + __pthread_mutex_type: PTHREAD_PROCESS_PRIVATE, + __pthread_mutex_magic: _MUTEX_MAGIC, + __pthread_mutex_lock: 0, +- __pthread_mutex_data: 0 ++ __pthread_mutex_data: 0, + }; + pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { + __pthread_cond_flag: [0; 4], + __pthread_cond_type: PTHREAD_PROCESS_PRIVATE, + __pthread_cond_magic: _COND_MAGIC, +- __pthread_cond_data: 0 ++ __pthread_cond_data: 0, + }; + pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { + __pthread_rwlock_readers: 0, +@@ -1573,7 +1701,7 @@ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { + __pthread_rwlock_magic: _RWL_MAGIC, + __pthread_rwlock_mutex: PTHREAD_MUTEX_INITIALIZER, + __pthread_rwlock_readercv: PTHREAD_COND_INITIALIZER, +- __pthread_rwlock_writercv: PTHREAD_COND_INITIALIZER ++ __pthread_rwlock_writercv: PTHREAD_COND_INITIALIZER, + }; + pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; + pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2; +@@ -1604,26 +1732,42 @@ pub const PORT_SOURCE_FD: ::c_int = 4; + pub const PORT_SOURCE_ALERT: ::c_int = 5; + pub const PORT_SOURCE_MQ: ::c_int = 6; + pub const PORT_SOURCE_FILE: ::c_int = 7; +-pub const PORT_SOURCE_POSTWAIT: ::c_int = 8; +-pub const PORT_SOURCE_SIGNAL: ::c_int = 9; ++ ++pub const NONROOT_USR: ::c_short = 2; ++pub const _UTX_USERSIZE: usize = 32; ++pub const _UTX_LINESIZE: usize = 32; ++pub const _UTX_PADSIZE: usize = 5; ++pub const _UTX_IDSIZE: usize = 4; ++pub const _UTX_HOSTSIZE: usize = 257; ++pub const EMPTY: ::c_short = 0; ++pub const RUN_LVL: ::c_short = 1; ++pub const BOOT_TIME: ::c_short = 2; ++pub const OLD_TIME: ::c_short = 3; ++pub const NEW_TIME: ::c_short = 4; ++pub const INIT_PROCESS: ::c_short = 5; ++pub const LOGIN_PROCESS: ::c_short = 6; ++pub const USER_PROCESS: ::c_short = 7; ++pub const DEAD_PROCESS: ::c_short = 8; ++pub const ACCOUNTING: ::c_short = 9; ++pub const DOWN_TIME: ::c_short = 10; + + const _TIOC: ::c_int = ('T' as i32) << 8; + const tIOC: ::c_int = ('t' as i32) << 8; +-pub const TCGETA: ::c_int = (_TIOC|1); +-pub const TCSETA: ::c_int = (_TIOC|2); +-pub const TCSETAW: ::c_int = (_TIOC|3); +-pub const TCSETAF: ::c_int = (_TIOC|4); +-pub const TCSBRK: ::c_int = (_TIOC|5); +-pub const TCXONC: ::c_int = (_TIOC|6); +-pub const TCFLSH: ::c_int = (_TIOC|7); +-pub const TCDSET: ::c_int = (_TIOC|32); +-pub const TCGETS: ::c_int = (_TIOC|13); +-pub const TCSETS: ::c_int = (_TIOC|14); +-pub const TCSANOW: ::c_int = (_TIOC|14); +-pub const TCSETSW: ::c_int = (_TIOC|15); +-pub const TCSADRAIN: ::c_int = (_TIOC|15); +-pub const TCSETSF: ::c_int = (_TIOC|16); +-pub const TCSAFLUSH: ::c_int = (_TIOC|16); ++pub const TCGETA: ::c_int = _TIOC | 1; ++pub const TCSETA: ::c_int = _TIOC | 2; ++pub const TCSETAW: ::c_int = _TIOC | 3; ++pub const TCSETAF: ::c_int = _TIOC | 4; ++pub const TCSBRK: ::c_int = _TIOC | 5; ++pub const TCXONC: ::c_int = _TIOC | 6; ++pub const TCFLSH: ::c_int = _TIOC | 7; ++pub const TCDSET: ::c_int = _TIOC | 32; ++pub const TCGETS: ::c_int = _TIOC | 13; ++pub const TCSETS: ::c_int = _TIOC | 14; ++pub const TCSANOW: ::c_int = _TIOC | 14; ++pub const TCSETSW: ::c_int = _TIOC | 15; ++pub const TCSADRAIN: ::c_int = _TIOC | 15; ++pub const TCSETSF: ::c_int = _TIOC | 16; ++pub const TCSAFLUSH: ::c_int = _TIOC | 16; + pub const TCIFLUSH: ::c_int = 0; + pub const TCOFLUSH: ::c_int = 1; + pub const TCIOFLUSH: ::c_int = 2; +@@ -1632,55 +1776,53 @@ pub const TCOON: ::c_int = 1; + pub const TCIOFF: ::c_int = 2; + pub const TCION: ::c_int = 3; + pub const TIOC: ::c_int = _TIOC; +-pub const TIOCKBON: ::c_int = (_TIOC|8); +-pub const TIOCKBOF: ::c_int = (_TIOC|9); +-pub const TIOCGWINSZ: ::c_int = (_TIOC|104); +-pub const TIOCSWINSZ: ::c_int = (_TIOC|103); +-pub const TIOCGSOFTCAR: ::c_int = (_TIOC|105); +-pub const TIOCSSOFTCAR: ::c_int = (_TIOC|106); +-pub const TIOCSETLD: ::c_int = (_TIOC|123); +-pub const TIOCGETLD: ::c_int = (_TIOC|124); +-pub const TIOCGPPS: ::c_int = (_TIOC|125); +-pub const TIOCSPPS: ::c_int = (_TIOC|126); +-pub const TIOCGPPSEV: ::c_int = (_TIOC|127); +-pub const TIOCGETD: ::c_int = (tIOC|0); +-pub const TIOCSETD: ::c_int = (tIOC|1); +-pub const TIOCHPCL: ::c_int = (tIOC|2); +-pub const TIOCGETP: ::c_int = (tIOC|8); +-pub const TIOCSETP: ::c_int = (tIOC|9); +-pub const TIOCSETN: ::c_int = (tIOC|10); +-pub const TIOCEXCL: ::c_int = (tIOC|13); +-pub const TIOCNXCL: ::c_int = (tIOC|14); +-pub const TIOCFLUSH: ::c_int = (tIOC|16); +-pub const TIOCSETC: ::c_int = (tIOC|17); +-pub const TIOCGETC: ::c_int = (tIOC|18); +-pub const TIOCLBIS: ::c_int = (tIOC|127); +-pub const TIOCLBIC: ::c_int = (tIOC|126); +-pub const TIOCLSET: ::c_int = (tIOC|125); +-pub const TIOCLGET: ::c_int = (tIOC|124); +-pub const TIOCSBRK: ::c_int = (tIOC|123); +-pub const TIOCCBRK: ::c_int = (tIOC|122); +-pub const TIOCSDTR: ::c_int = (tIOC|121); +-pub const TIOCCDTR: ::c_int = (tIOC|120); +-pub const TIOCSLTC: ::c_int = (tIOC|117); +-pub const TIOCGLTC: ::c_int = (tIOC|116); +-pub const TIOCOUTQ: ::c_int = (tIOC|115); +-pub const TIOCNOTTY: ::c_int = (tIOC|113); +-pub const TIOCSCTTY: ::c_int = (tIOC|132); +-pub const TIOCSTOP: ::c_int = (tIOC|111); +-pub const TIOCSTART: ::c_int = (tIOC|110); +-pub const TIOCSILOOP: ::c_int = (tIOC|109); +-pub const TIOCCILOOP: ::c_int = (tIOC|108); +-pub const TIOCGPGRP: ::c_int = (tIOC|20); +-pub const TIOCSPGRP: ::c_int = (tIOC|21); +-pub const TIOCGSID: ::c_int = (tIOC|22); +-pub const TIOCSTI: ::c_int = (tIOC|23); +-pub const TIOCMSET: ::c_int = (tIOC|26); +-pub const TIOCMBIS: ::c_int = (tIOC|27); +-pub const TIOCMBIC: ::c_int = (tIOC|28); +-pub const TIOCMGET: ::c_int = (tIOC|29); +-pub const TIOCREMOTE: ::c_int = (tIOC|30); +-pub const TIOCSIGNAL: ::c_int = (tIOC|31); ++pub const TIOCKBON: ::c_int = _TIOC | 8; ++pub const TIOCKBOF: ::c_int = _TIOC | 9; ++pub const TIOCGWINSZ: ::c_int = _TIOC | 104; ++pub const TIOCSWINSZ: ::c_int = _TIOC | 103; ++pub const TIOCGSOFTCAR: ::c_int = _TIOC | 105; ++pub const TIOCSSOFTCAR: ::c_int = _TIOC | 106; ++pub const TIOCGPPS: ::c_int = _TIOC | 125; ++pub const TIOCSPPS: ::c_int = _TIOC | 126; ++pub const TIOCGPPSEV: ::c_int = _TIOC | 127; ++pub const TIOCGETD: ::c_int = tIOC | 0; ++pub const TIOCSETD: ::c_int = tIOC | 1; ++pub const TIOCHPCL: ::c_int = tIOC | 2; ++pub const TIOCGETP: ::c_int = tIOC | 8; ++pub const TIOCSETP: ::c_int = tIOC | 9; ++pub const TIOCSETN: ::c_int = tIOC | 10; ++pub const TIOCEXCL: ::c_int = tIOC | 13; ++pub const TIOCNXCL: ::c_int = tIOC | 14; ++pub const TIOCFLUSH: ::c_int = tIOC | 16; ++pub const TIOCSETC: ::c_int = tIOC | 17; ++pub const TIOCGETC: ::c_int = tIOC | 18; ++pub const TIOCLBIS: ::c_int = tIOC | 127; ++pub const TIOCLBIC: ::c_int = tIOC | 126; ++pub const TIOCLSET: ::c_int = tIOC | 125; ++pub const TIOCLGET: ::c_int = tIOC | 124; ++pub const TIOCSBRK: ::c_int = tIOC | 123; ++pub const TIOCCBRK: ::c_int = tIOC | 122; ++pub const TIOCSDTR: ::c_int = tIOC | 121; ++pub const TIOCCDTR: ::c_int = tIOC | 120; ++pub const TIOCSLTC: ::c_int = tIOC | 117; ++pub const TIOCGLTC: ::c_int = tIOC | 116; ++pub const TIOCOUTQ: ::c_int = tIOC | 115; ++pub const TIOCNOTTY: ::c_int = tIOC | 113; ++pub const TIOCSCTTY: ::c_int = tIOC | 132; ++pub const TIOCSTOP: ::c_int = tIOC | 111; ++pub const TIOCSTART: ::c_int = tIOC | 110; ++pub const TIOCSILOOP: ::c_int = tIOC | 109; ++pub const TIOCCILOOP: ::c_int = tIOC | 108; ++pub const TIOCGPGRP: ::c_int = tIOC | 20; ++pub const TIOCSPGRP: ::c_int = tIOC | 21; ++pub const TIOCGSID: ::c_int = tIOC | 22; ++pub const TIOCSTI: ::c_int = tIOC | 23; ++pub const TIOCMSET: ::c_int = tIOC | 26; ++pub const TIOCMBIS: ::c_int = tIOC | 27; ++pub const TIOCMBIC: ::c_int = tIOC | 28; ++pub const TIOCMGET: ::c_int = tIOC | 29; ++pub const TIOCREMOTE: ::c_int = tIOC | 30; ++pub const TIOCSIGNAL: ::c_int = tIOC | 31; + + pub const EPOLLIN: ::c_int = 0x1; + pub const EPOLLPRI: ::c_int = 0x2; +@@ -1694,8 +1836,9 @@ pub const EPOLLERR: ::c_int = 0x8; + pub const EPOLLHUP: ::c_int = 0x10; + pub const EPOLLET: ::c_int = 0x80000000; + pub const EPOLLRDHUP: ::c_int = 0x2000; +-pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000; + pub const EPOLLONESHOT: ::c_int = 0x40000000; ++pub const EPOLLWAKEUP: ::c_int = 0x20000000; ++pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000; + pub const EPOLL_CLOEXEC: ::c_int = 0x80000; + pub const EPOLL_CTL_ADD: ::c_int = 1; + pub const EPOLL_CTL_MOD: ::c_int = 3; +@@ -1726,9 +1869,9 @@ pub const B230400: speed_t = 20; + pub const B307200: speed_t = 21; + pub const B460800: speed_t = 22; + pub const B921600: speed_t = 23; +-pub const CSTART: ::tcflag_t = 021; +-pub const CSTOP: ::tcflag_t = 023; +-pub const CSWTCH: ::tcflag_t = 032; ++pub const CSTART: ::tcflag_t = 0o21; ++pub const CSTOP: ::tcflag_t = 0o23; ++pub const CSWTCH: ::tcflag_t = 0o32; + pub const CSIZE: ::tcflag_t = 0o000060; + pub const CS5: ::tcflag_t = 0; + pub const CS6: ::tcflag_t = 0o000020; +@@ -1795,7 +1938,124 @@ pub const VLNEXT: usize = 15; + pub const VSTATUS: usize = 16; + pub const VERASE2: usize = 17; + ++// 3SOCKET flags ++pub const SOCK_CLOEXEC: ::c_int = 0x080000; ++pub const SOCK_NONBLOCK: ::c_int = 0x100000; ++pub const SOCK_NDELAY: ::c_int = 0x200000; ++ ++// ++pub const SCALE_KG: ::c_int = 1 << 6; ++pub const SCALE_KF: ::c_int = 1 << 16; ++pub const SCALE_KH: ::c_int = 1 << 2; ++pub const MAXTC: ::c_int = 1 << 6; ++pub const SCALE_PHASE: ::c_int = 1 << 22; ++pub const SCALE_USEC: ::c_int = 1 << 16; ++pub const SCALE_UPDATE: ::c_int = SCALE_KG * MAXTC; ++pub const FINEUSEC: ::c_int = 1 << 22; ++pub const MAXPHASE: ::c_int = 512000; ++pub const MAXFREQ: ::c_int = 512 * SCALE_USEC; ++pub const MAXTIME: ::c_int = 200 << PPS_AVG; ++pub const MINSEC: ::c_int = 16; ++pub const MAXSEC: ::c_int = 1200; ++pub const PPS_AVG: ::c_int = 2; ++pub const PPS_SHIFT: ::c_int = 2; ++pub const PPS_SHIFTMAX: ::c_int = 8; ++pub const PPS_VALID: ::c_int = 120; ++pub const MAXGLITCH: ::c_int = 30; ++pub const MOD_OFFSET: u32 = 0x0001; ++pub const MOD_FREQUENCY: u32 = 0x0002; ++pub const MOD_MAXERROR: u32 = 0x0004; ++pub const MOD_ESTERROR: u32 = 0x0008; ++pub const MOD_STATUS: u32 = 0x0010; ++pub const MOD_TIMECONST: u32 = 0x0020; ++pub const MOD_CLKB: u32 = 0x4000; ++pub const MOD_CLKA: u32 = 0x8000; ++pub const STA_PLL: u32 = 0x0001; ++pub const STA_PPSFREQ: i32 = 0x0002; ++pub const STA_PPSTIME: i32 = 0x0004; ++pub const STA_FLL: i32 = 0x0008; ++pub const STA_INS: i32 = 0x0010; ++pub const STA_DEL: i32 = 0x0020; ++pub const STA_UNSYNC: i32 = 0x0040; ++pub const STA_FREQHOLD: i32 = 0x0080; ++pub const STA_PPSSIGNAL: i32 = 0x0100; ++pub const STA_PPSJITTER: i32 = 0x0200; ++pub const STA_PPSWANDER: i32 = 0x0400; ++pub const STA_PPSERROR: i32 = 0x0800; ++pub const STA_CLOCKERR: i32 = 0x1000; ++pub const STA_RONLY: i32 = STA_PPSSIGNAL ++ | STA_PPSJITTER ++ | STA_PPSWANDER ++ | STA_PPSERROR ++ | STA_CLOCKERR; ++pub const TIME_OK: i32 = 0; ++pub const TIME_INS: i32 = 1; ++pub const TIME_DEL: i32 = 2; ++pub const TIME_OOP: i32 = 3; ++pub const TIME_WAIT: i32 = 4; ++pub const TIME_ERROR: i32 = 5; ++ ++pub const PRIO_PROCESS: ::c_int = 0; ++pub const PRIO_PGRP: ::c_int = 1; ++pub const PRIO_USER: ::c_int = 2; ++ ++// As per sys/socket.h, header alignment must be 8 bytes on SPARC ++// and 4 bytes everywhere else: ++#[cfg(target_arch = "sparc64")] ++const _CMSG_HDR_ALIGNMENT: usize = 8; ++#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] ++const _CMSG_HDR_ALIGNMENT: usize = 4; ++ ++const _CMSG_DATA_ALIGNMENT: usize = ::mem::size_of::<::c_int>(); ++ ++fn _CMSG_HDR_ALIGN(p: usize) -> usize { ++ (p + _CMSG_HDR_ALIGNMENT - 1) & !(_CMSG_HDR_ALIGNMENT - 1) ++} ++ ++fn _CMSG_DATA_ALIGN(p: usize) -> usize { ++ (p + _CMSG_DATA_ALIGNMENT - 1) & !(_CMSG_DATA_ALIGNMENT - 1) ++} ++ + f! { ++ pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar { ++ _CMSG_DATA_ALIGN(cmsg.offset(1) as usize) as *mut ::c_uchar ++ } ++ ++ pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { ++ _CMSG_DATA_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length ++ } ++ ++ pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr { ++ if ((*mhdr).msg_controllen as usize) < ::mem::size_of::<::cmsghdr>() { ++ 0 as *mut ::cmsghdr ++ } else { ++ (*mhdr).msg_control as *mut ::cmsghdr ++ } ++ } ++ ++ pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr) ++ -> *mut ::cmsghdr ++ { ++ if cmsg.is_null() { ++ return ::CMSG_FIRSTHDR(mhdr); ++ }; ++ let next = _CMSG_HDR_ALIGN(cmsg as usize + (*cmsg).cmsg_len as usize ++ + ::mem::size_of::<::cmsghdr>()); ++ let max = (*mhdr).msg_control as usize ++ + (*mhdr).msg_controllen as usize; ++ if next > max { ++ 0 as *mut ::cmsghdr ++ } else { ++ _CMSG_HDR_ALIGN(cmsg as usize + (*cmsg).cmsg_len as usize) ++ as *mut ::cmsghdr ++ } ++ } ++ ++ pub fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { ++ _CMSG_HDR_ALIGN(::mem::size_of::<::cmsghdr>() as usize ++ + length as usize) as ::c_uint ++ } ++ + pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { + let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + let fd = fd as usize; +@@ -1855,18 +2115,22 @@ f! { + } + } + +-extern { ++extern "C" { + pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; + pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; + +- pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, +- buflen: ::size_t) -> ::c_int; ++ pub fn strerror_r( ++ errnum: ::c_int, ++ buf: *mut c_char, ++ buflen: ::size_t, ++ ) -> ::c_int; + + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; +- pub fn sem_init(sem: *mut sem_t, +- pshared: ::c_int, +- value: ::c_uint) +- -> ::c_int; ++ pub fn sem_init( ++ sem: *mut sem_t, ++ pshared: ::c_int, ++ value: ::c_uint, ++ ) -> ::c_int; + + pub fn abs(i: ::c_int) -> ::c_int; + pub fn acct(filename: *const ::c_char) -> ::c_int; +@@ -1876,177 +2140,310 @@ extern { + pub fn rand() -> ::c_int; + pub fn srand(seed: ::c_uint); + +- pub fn gettimeofday(tp: *mut ::timeval, +- tz: *mut ::c_void) -> ::c_int; ++ pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; ++ pub fn settimeofday(tp: *const ::timeval, tz: *const ::c_void) -> ::c_int; + 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 initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int; +- pub fn setgroups(ngroups: ::c_int, +- ptr: *const ::gid_t) -> ::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; ++ pub fn mprotect( ++ addr: *const ::c_void, ++ len: ::size_t, ++ prot: ::c_int, ++ ) -> ::c_int; + pub fn ___errno() -> *mut ::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; +- pub fn clock_nanosleep(clk_id: ::clockid_t, +- flags: ::c_int, +- rqtp: *const ::timespec, +- rmtp: *mut ::timespec) -> ::c_int; +- pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::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 clock_nanosleep( ++ clk_id: ::clockid_t, ++ flags: ::c_int, ++ rqtp: *const ::timespec, ++ rmtp: *mut ::timespec, ++ ) -> ::c_int; ++ pub fn clock_settime( ++ clk_id: ::clockid_t, ++ tp: *const ::timespec, ++ ) -> ::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 setpwent(); + pub fn endpwent(); + pub fn getpwent() -> *mut passwd; + pub fn fdatasync(fd: ::c_int) -> ::c_int; +- pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char; ++ 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); +- pub fn newlocale(mask: ::c_int, +- locale: *const ::c_char, +- base: ::locale_t) -> ::locale_t; ++ 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 getprogname() -> *const ::c_char; + pub fn setprogname(name: *const ::c_char); + pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int; + pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int; +- pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int; +- +- pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char, +- mode: ::mode_t, dev: dev_t) -> ::c_int; +- pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, +- mode: ::mode_t) -> ::c_int; ++ pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) ++ -> ::c_int; ++ ++ pub fn mknodat( ++ dirfd: ::c_int, ++ pathname: *const ::c_char, ++ mode: ::mode_t, ++ dev: dev_t, ++ ) -> ::c_int; ++ pub fn mkfifoat( ++ dirfd: ::c_int, ++ pathname: *const ::c_char, ++ mode: ::mode_t, ++ ) -> ::c_int; + pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int; + pub fn if_nameindex() -> *mut if_nameindex; + pub fn if_freenameindex(ptr: *mut if_nameindex); +- pub fn pthread_create(native: *mut ::pthread_t, +- attr: *const ::pthread_attr_t, +- f: extern fn(*mut ::c_void) -> *mut ::c_void, +- value: *mut ::c_void) -> ::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 sem_timedwait(sem: *mut sem_t, +- abstime: *const ::timespec) -> ::c_int; +- pub fn sem_getvalue(sem: *mut sem_t, +- sval: *mut ::c_int) -> ::c_int; +- pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t, +- abstime: *const ::timespec) -> ::c_int; +- pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, +- options: ::c_int) -> ::c_int; +- +- pub fn glob(pattern: *const ::c_char, +- flags: ::c_int, +- errfunc: ::Option ::c_int>, +- pglob: *mut ::glob_t) -> ::c_int; +- ++ pub fn pthread_create( ++ native: *mut ::pthread_t, ++ attr: *const ::pthread_attr_t, ++ f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, ++ value: *mut ::c_void, ++ ) -> ::c_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 sem_timedwait( ++ sem: *mut sem_t, ++ abstime: *const ::timespec, ++ ) -> ::c_int; ++ pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int; ++ pub fn pthread_mutex_timedlock( ++ lock: *mut pthread_mutex_t, ++ abstime: *const ::timespec, ++ ) -> ::c_int; ++ pub fn waitid( ++ idtype: idtype_t, ++ id: id_t, ++ infop: *mut ::siginfo_t, ++ options: ::c_int, ++ ) -> ::c_int; ++ ++ #[cfg_attr(target_os = "illumos", link_name = "_glob_ext")] ++ pub fn glob( ++ pattern: *const ::c_char, ++ flags: ::c_int, ++ errfunc: ::Option< ++ extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int, ++ >, ++ pglob: *mut ::glob_t, ++ ) -> ::c_int; ++ ++ #[cfg_attr(target_os = "illumos", link_name = "_globfree_ext")] + pub fn globfree(pglob: *mut ::glob_t); + +- pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) +- -> ::c_int; +- +- pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) +- -> ::c_int; ++ pub fn posix_madvise( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ advice: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn shmat( ++ shmid: ::c_int, ++ shmaddr: *const ::c_void, ++ shmflg: ::c_int, ++ ) -> *mut ::c_void; ++ ++ pub fn shmctl( ++ shmid: ::c_int, ++ cmd: ::c_int, ++ buf: *mut ::shmid_ds, ++ ) -> ::c_int; ++ ++ pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int; ++ ++ pub fn shmget(key: key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int; ++ ++ pub fn shm_open( ++ name: *const ::c_char, ++ oflag: ::c_int, ++ mode: ::mode_t, ++ ) -> ::c_int; + pub fn shm_unlink(name: *const ::c_char) -> ::c_int; + + pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); + + pub fn telldir(dirp: *mut ::DIR) -> ::c_long; +- pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) +- -> ::c_int; +- +- pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int; ++ pub fn madvise( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ advice: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn msync( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; + + pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; + +- pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, +- flags: ::c_int, addr: *mut ::sockaddr, +- addrlen: *mut ::socklen_t) -> ::ssize_t; ++ pub fn recvfrom( ++ socket: ::c_int, ++ buf: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ addr: *mut ::sockaddr, ++ addrlen: *mut ::socklen_t, ++ ) -> ::ssize_t; + pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int; +- pub fn futimesat(fd: ::c_int, path: *const ::c_char, +- times: *const ::timeval) -> ::c_int; +- pub fn utimensat(dirfd: ::c_int, path: *const ::c_char, +- times: *const ::timespec, flag: ::c_int) -> ::c_int; ++ pub fn futimesat( ++ fd: ::c_int, ++ path: *const ::c_char, ++ times: *const ::timeval, ++ ) -> ::c_int; ++ pub fn futimens(dirfd: ::c_int, times: *const ::timespec) -> ::c_int; ++ pub fn utimensat( ++ dirfd: ::c_int, ++ path: *const ::c_char, ++ times: *const ::timespec, ++ flag: ::c_int, ++ ) -> ::c_int; + pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; + + #[cfg_attr(target_os = "illumos", link_name = "__xnet_bind")] +- pub fn bind(socket: ::c_int, address: *const ::sockaddr, +- address_len: ::socklen_t) -> ::c_int; +- +- pub fn writev(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int) -> ::ssize_t; +- pub fn readv(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int) -> ::ssize_t; ++ pub fn bind( ++ socket: ::c_int, ++ address: *const ::sockaddr, ++ address_len: ::socklen_t, ++ ) -> ::c_int; ++ ++ pub fn writev( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ ) -> ::ssize_t; ++ pub fn readv( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ ) -> ::ssize_t; + + #[cfg_attr(target_os = "illumos", link_name = "__xnet_sendmsg")] +- pub fn sendmsg(fd: ::c_int, +- msg: *const ::msghdr, +- flags: ::c_int) -> ::ssize_t; ++ pub fn sendmsg( ++ fd: ::c_int, ++ msg: *const ::msghdr, ++ flags: ::c_int, ++ ) -> ::ssize_t; + #[cfg_attr(target_os = "illumos", link_name = "__xnet_recvmsg")] +- pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) +- -> ::ssize_t; ++ pub fn recvmsg( ++ fd: ::c_int, ++ msg: *mut ::msghdr, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ pub fn accept4( ++ fd: ::c_int, ++ address: *mut sockaddr, ++ address_len: *mut socklen_t, ++ flags: ::c_int ++ ) -> ::c_int; + + pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t; + pub fn mq_close(mqd: ::mqd_t) -> ::c_int; + pub fn mq_unlink(name: *const ::c_char) -> ::c_int; +- pub fn mq_receive(mqd: ::mqd_t, +- msg_ptr: *mut ::c_char, +- msg_len: ::size_t, +- msq_prio: *mut ::c_uint) -> ::ssize_t; +- pub fn mq_timedreceive(mqd: ::mqd_t, +- msg_ptr: *mut ::c_char, +- msg_len: ::size_t, +- msq_prio: *mut ::c_uint, +- abs_timeout: *const ::timespec) -> ::ssize_t; +- pub fn mq_send(mqd: ::mqd_t, +- msg_ptr: *const ::c_char, +- msg_len: ::size_t, +- msq_prio: ::c_uint) -> ::c_int; +- pub fn mq_timedsend(mqd: ::mqd_t, +- msg_ptr: *const ::c_char, +- msg_len: ::size_t, +- msq_prio: ::c_uint, +- abs_timeout: *const ::timespec) -> ::c_int; ++ pub fn mq_receive( ++ mqd: ::mqd_t, ++ msg_ptr: *mut ::c_char, ++ msg_len: ::size_t, ++ msg_prio: *mut ::c_uint, ++ ) -> ::ssize_t; ++ pub fn mq_timedreceive( ++ mqd: ::mqd_t, ++ msg_ptr: *mut ::c_char, ++ msg_len: ::size_t, ++ msg_prio: *mut ::c_uint, ++ abs_timeout: *const ::timespec, ++ ) -> ::ssize_t; ++ pub fn mq_send( ++ mqd: ::mqd_t, ++ msg_ptr: *const ::c_char, ++ msg_len: ::size_t, ++ msg_prio: ::c_uint, ++ ) -> ::c_int; ++ pub fn mq_timedsend( ++ mqd: ::mqd_t, ++ msg_ptr: *const ::c_char, ++ msg_len: ::size_t, ++ msg_prio: ::c_uint, ++ abs_timeout: *const ::timespec, ++ ) -> ::c_int; + pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int; +- pub fn mq_setattr(mqd: ::mqd_t, +- newattr: *const ::mq_attr, +- oldattr: *mut ::mq_attr) -> ::c_int; ++ pub fn mq_setattr( ++ mqd: ::mqd_t, ++ newattr: *const ::mq_attr, ++ oldattr: *mut ::mq_attr, ++ ) -> ::c_int; + pub fn port_create() -> ::c_int; +- pub fn port_associate(port: ::c_int, source: ::c_int, object: ::uintptr_t, +- events: ::c_int, user: *mut ::c_void) -> ::c_int; +- pub fn port_dissociate(port: ::c_int, source: ::c_int, object: ::uintptr_t) +- -> ::c_int; +- pub fn port_get(port: ::c_int, pe: *mut port_event, +- timeout: *mut ::timespec) -> ::c_int; +- pub fn port_getn(port: ::c_int, pe_list: *mut port_event, max: ::c_uint, +- nget: *mut ::c_uint, timeout: *mut ::timespec) +- -> ::c_int; +- pub fn fexecve(fd: ::c_int, argv: *const *const ::c_char, +- envp: *const *const ::c_char) +- -> ::c_int; +- #[cfg_attr(any(target_os = "solaris", target_os = "illumos"), +- link_name = "__posix_getgrgid_r")] +- pub fn getgrgid_r(gid: ::gid_t, +- grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; +- pub fn sigaltstack(ss: *const stack_t, +- oss: *mut stack_t) -> ::c_int; ++ pub fn port_associate( ++ port: ::c_int, ++ source: ::c_int, ++ object: ::uintptr_t, ++ events: ::c_int, ++ user: *mut ::c_void, ++ ) -> ::c_int; ++ pub fn port_dissociate( ++ port: ::c_int, ++ source: ::c_int, ++ object: ::uintptr_t, ++ ) -> ::c_int; ++ pub fn port_get( ++ port: ::c_int, ++ pe: *mut port_event, ++ timeout: *mut ::timespec, ++ ) -> ::c_int; ++ pub fn port_getn( ++ port: ::c_int, ++ pe_list: *mut port_event, ++ max: ::c_uint, ++ nget: *mut ::c_uint, ++ timeout: *mut ::timespec, ++ ) -> ::c_int; ++ pub fn port_send( ++ port: ::c_int, ++ events: ::c_int, ++ user: *mut ::c_void, ++ ) -> ::c_int; ++ pub fn port_sendn( ++ port_list: *mut ::c_int, ++ error_list: *mut ::c_int, ++ nent: ::c_uint, ++ events: ::c_int, ++ user: *mut ::c_void, ++ ) -> ::c_int; ++ #[cfg_attr( ++ any(target_os = "solaris", target_os = "illumos"), ++ link_name = "__posix_getgrgid_r" ++ )] ++ pub fn getgrgid_r( ++ gid: ::gid_t, ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; ++ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sem_close(sem: *mut sem_t) -> ::c_int; + pub fn getdtablesize() -> ::c_int; + +@@ -2054,94 +2451,150 @@ extern { + // there are things using epoll on illumos (built using the + // x86_64-sun-solaris target) which would break until the illumos target is + // present in rustc. +- pub fn epoll_pwait(epfd: ::c_int, +- events: *mut ::epoll_event, +- maxevents: ::c_int, +- timeout: ::c_int, +- sigmask: *const ::sigset_t) -> ::c_int; ++ pub fn epoll_pwait( ++ epfd: ::c_int, ++ events: *mut ::epoll_event, ++ maxevents: ::c_int, ++ timeout: ::c_int, ++ sigmask: *const ::sigset_t, ++ ) -> ::c_int; + + pub fn epoll_create(size: ::c_int) -> ::c_int; + pub fn epoll_create1(flags: ::c_int) -> ::c_int; +- pub fn epoll_wait(epfd: ::c_int, +- events: *mut ::epoll_event, +- maxevents: ::c_int, +- timeout: ::c_int) -> ::c_int; +- pub fn epoll_ctl(epfd: ::c_int, +- op: ::c_int, +- fd: ::c_int, +- event: *mut ::epoll_event) -> ::c_int; +- +- #[cfg_attr(any(target_os = "solaris", target_os = "illumos"), +- link_name = "__posix_getgrnam_r")] +- pub fn getgrnam_r(name: *const ::c_char, +- grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; +- pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, +- oldset: *mut sigset_t) -> ::c_int; ++ pub fn epoll_wait( ++ epfd: ::c_int, ++ events: *mut ::epoll_event, ++ maxevents: ::c_int, ++ timeout: ::c_int, ++ ) -> ::c_int; ++ pub fn epoll_ctl( ++ epfd: ::c_int, ++ op: ::c_int, ++ fd: ::c_int, ++ event: *mut ::epoll_event, ++ ) -> ::c_int; ++ ++ #[cfg_attr( ++ any(target_os = "solaris", target_os = "illumos"), ++ link_name = "__posix_getgrnam_r" ++ )] ++ pub fn getgrnam_r( ++ name: *const ::c_char, ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; ++ pub fn pthread_sigmask( ++ how: ::c_int, ++ set: *const sigset_t, ++ oldset: *mut sigset_t, ++ ) -> ::c_int; + pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; + pub fn getgrnam(name: *const ::c_char) -> *mut ::group; + pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + pub fn sem_unlink(name: *const ::c_char) -> ::c_int; + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; +- #[cfg_attr(any(target_os = "solaris", target_os = "illumos"), +- link_name = "__posix_getpwnam_r")] +- pub fn getpwnam_r(name: *const ::c_char, +- pwd: *mut passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut passwd) -> ::c_int; +- #[cfg_attr(any(target_os = "solaris", target_os = "illumos"), +- link_name = "__posix_getpwuid_r")] +- pub fn getpwuid_r(uid: ::uid_t, +- pwd: *mut passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut passwd) -> ::c_int; +- #[cfg_attr(any(target_os = "solaris", target_os = "illumos"), +- link_name = "__posix_getpwent_r")] +- pub fn getpwent_r(pwd: *mut passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut passwd) -> ::c_int; +- #[cfg_attr(any(target_os = "solaris", target_os = "illumos"), +- link_name = "__posix_getgrent_r")] +- pub fn getgrent_r(grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; +- #[cfg_attr(any(target_os = "solaris", target_os = "illumos"), +- link_name = "__posix_sigwait")] +- pub fn sigwait(set: *const sigset_t, +- sig: *mut ::c_int) -> ::c_int; +- pub fn pthread_atfork(prepare: ::Option, +- parent: ::Option, +- child: ::Option) -> ::c_int; ++ #[cfg_attr( ++ any(target_os = "solaris", target_os = "illumos"), ++ link_name = "__posix_getpwnam_r" ++ )] ++ pub fn getpwnam_r( ++ name: *const ::c_char, ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; ++ #[cfg_attr( ++ any(target_os = "solaris", target_os = "illumos"), ++ link_name = "__posix_getpwuid_r" ++ )] ++ pub fn getpwuid_r( ++ uid: ::uid_t, ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; ++ #[cfg_attr( ++ any(target_os = "solaris", target_os = "illumos"), ++ link_name = "__posix_getpwent_r" ++ )] ++ pub fn getpwent_r( ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; ++ #[cfg_attr( ++ any(target_os = "solaris", target_os = "illumos"), ++ link_name = "__posix_getgrent_r" ++ )] ++ pub fn getgrent_r( ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; ++ #[cfg_attr( ++ any(target_os = "solaris", target_os = "illumos"), ++ link_name = "__posix_sigwait" ++ )] ++ pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; ++ pub fn pthread_atfork( ++ prepare: ::Option, ++ parent: ::Option, ++ child: ::Option, ++ ) -> ::c_int; + pub fn getgrgid(gid: ::gid_t) -> *mut ::group; + pub fn setgrent(); + pub fn endgrent(); + pub fn getgrent() -> *mut ::group; +- pub fn popen(command: *const c_char, +- mode: *const c_char) -> *mut ::FILE; ++ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; + + pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; + pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; +- pub fn door_call(d: ::c_int, params: *const door_arg_t) -> ::c_int; +- pub fn door_return(data_ptr: *const ::c_char, +- data_size: ::size_t, +- desc_ptr: *const door_desc_t, +- num_desc: ::c_uint); +- pub fn door_create(server_procedure: extern fn(cookie: *const ::c_void, +- argp: *const ::c_char, +- arg_size: ::size_t, +- dp: *const door_desc_t, +- n_desc: ::c_uint), +- cookie: *const ::c_void, +- attributes: door_attr_t) -> ::c_int; +- pub fn fattach(fildes: ::c_int, path: *const ::c_char) -> ::c_int; ++ ++ pub fn makeutx(ux: *const utmpx) -> *mut utmpx; ++ pub fn modutx(ux: *const utmpx) -> *mut utmpx; ++ pub fn updwtmpx(file: *const ::c_char, ut: *const utmpx) -> ::c_int; ++ 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 endutent(); ++ pub fn getutent() -> *mut utmp; ++ pub fn getutid(u: *const utmp) -> *mut utmp; ++ pub fn getutline(u: *const utmp) -> *mut utmp; ++ pub fn pututline(u: *const utmp) -> *mut utmp; ++ pub fn setutent(); ++ pub fn utmpname(file: *const ::c_char) -> ::c_int; ++ ++ pub fn getutmp(ux: *const utmpx, u: *mut utmp); ++ pub fn getutmpx(u: *const utmp, ux: *mut utmpx); ++ pub fn updwtmp(file: *const ::c_char, u: *mut utmp); ++ ++ pub fn ntp_adjtime(buf: *mut timex) -> ::c_int; ++ pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int; + } + + mod compat; + pub use self::compat::*; ++ ++cfg_if! { ++ if #[cfg(target_os = "illumos")] { ++ mod illumos; ++ pub use self::illumos::*; ++ } else if #[cfg(target_os = "solaris")] { ++ mod solaris; ++ pub use self::solaris::*; ++ } else { ++ // Unknown target_os ++ } ++} +diff --git a/third_party/rust/libc/src/unix/solarish/solaris.rs b/third_party/rust/libc/src/unix/solarish/solaris.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..596029d1bc4d23418f57763abbc513c17691db60 +--- /dev/null ++++ b/third_party/rust/libc/src/unix/solarish/solaris.rs +@@ -0,0 +1,92 @@ ++pub type door_attr_t = ::c_uint; ++pub type door_id_t = ::c_ulonglong; ++ ++s! { ++ pub struct shmid_ds { ++ pub shm_perm: ::ipc_perm, ++ pub shm_segsz: ::size_t, ++ pub shm_flags: ::uintptr_t, ++ pub shm_lkcnt: ::c_ushort, ++ pub shm_lpid: ::pid_t, ++ pub shm_cpid: ::pid_t, ++ pub shm_nattch: ::shmatt_t, ++ pub shm_cnattch: ::c_ulong, ++ pub shm_atime: ::time_t, ++ pub shm_dtime: ::time_t, ++ pub shm_ctime: ::time_t, ++ pub shm_amp: *mut ::c_void, ++ pub shm_gransize: u64, ++ pub shm_allocated: u64, ++ pub shm_pad4: [i64; 1], ++ } ++ ++ pub struct door_desc_t__d_data__d_desc { ++ pub d_descriptor: ::c_int, ++ pub d_id: ::door_id_t ++ } ++} ++ ++pub const PORT_SOURCE_POSTWAIT: ::c_int = 8; ++pub const PORT_SOURCE_SIGNAL: ::c_int = 9; ++ ++pub const AF_LOCAL: ::c_int = 0; ++pub const AF_FILE: ::c_int = 0; ++ ++extern "C" { ++ pub fn fexecve( ++ fd: ::c_int, ++ argv: *const *const ::c_char, ++ envp: *const *const ::c_char, ++ ) -> ::c_int; ++ ++ pub fn mincore( ++ addr: *const ::c_void, ++ len: ::size_t, ++ vec: *mut ::c_char, ++ ) -> ::c_int; ++ ++ pub fn door_call(d: ::c_int, params: *const door_arg_t) -> ::c_int; ++ pub fn door_return( ++ data_ptr: *const ::c_char, ++ data_size: ::size_t, ++ desc_ptr: *const door_desc_t, ++ num_desc: ::c_uint, ++ ); ++ pub fn door_create( ++ server_procedure: extern "C" fn( ++ cookie: *const ::c_void, ++ argp: *const ::c_char, ++ arg_size: ::size_t, ++ dp: *const door_desc_t, ++ n_desc: ::c_uint, ++ ), ++ cookie: *const ::c_void, ++ attributes: door_attr_t, ++ ) -> ::c_int; ++ ++ pub fn fattach(fildes: ::c_int, path: *const ::c_char) -> ::c_int; ++} ++ ++s_no_extra_traits! { ++ #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))] ++ pub union door_desc_t__d_data { ++ pub d_desc: door_desc_t__d_data__d_desc, ++ d_resv: [::c_int; 5], /* Check out /usr/include/sys/door.h */ ++ } ++ ++ #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))] ++ pub struct door_desc_t { ++ pub d_attributes: door_attr_t, ++ pub d_data: door_desc_t__d_data, ++ } ++ ++ #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))] ++ pub struct door_arg_t { ++ pub data_ptr: *const ::c_char, ++ pub data_size: ::size_t, ++ pub desc_ptr: *const door_desc_t, ++ pub dec_num: ::c_uint, ++ pub rbuf: *const ::c_char, ++ pub rsize: ::size_t, ++ } ++} +diff --git a/third_party/rust/libc/src/unix/uclibc/align.rs b/third_party/rust/libc/src/unix/uclibc/align.rs +index 3307c9d169456a12c795e9232910c7fe94d1d205..76b524d0c08294d66675d1d541ddaa18d62803a4 100644 +--- a/third_party/rust/libc/src/unix/uclibc/align.rs ++++ b/third_party/rust/libc/src/unix/uclibc/align.rs +@@ -62,5 +62,5 @@ macro_rules! expand_align { + size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], + } + } +- } ++ }; + } +diff --git a/third_party/rust/libc/src/unix/uclibc/arm/mod.rs b/third_party/rust/libc/src/unix/uclibc/arm/mod.rs +index 7680dcf0071ccfe50a54bda2cbd3c5f073b8b598..613a11fbab79dbdd22a170b5b31d508d4d690134 100644 +--- a/third_party/rust/libc/src/unix/uclibc/arm/mod.rs ++++ b/third_party/rust/libc/src/unix/uclibc/arm/mod.rs +@@ -408,10 +408,6 @@ pub const F_SETLKW: ::c_int = 0x7; + pub const HUPCL: ::tcflag_t = 0x400; + pub const ICANON: ::tcflag_t = 0x2; + pub const IEXTEN: ::tcflag_t = 0x8000; +-pub const IPV6_MULTICAST_HOPS: ::c_int = 0x12; +-pub const IPV6_MULTICAST_IF: ::c_int = 0x11; +-pub const IPV6_UNICAST_HOPS: ::c_int = 0x10; +-pub const IP_MULTICAST_IF: ::c_int = 0x20; + pub const ISIG: ::tcflag_t = 0x1; + pub const IUTF8: ::tcflag_t = 0x4000; + pub const IXOFF: ::tcflag_t = 0x1000; +@@ -1018,22 +1014,28 @@ f! { + + } + +-extern { ++extern "C" { + pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::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 openpty( ++ amaster: *mut ::c_int, ++ aslave: *mut ::c_int, ++ name: *mut ::c_char, ++ termp: *mut termios, ++ winp: *mut ::winsize, ++ ) -> ::c_int; + pub fn setns(fd: ::c_int, nstype: ::c_int) -> ::c_int; +- pub fn pwritev(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int, +- offset: ::off_t) -> ::ssize_t; +- pub fn preadv(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int, +- offset: ::off_t) -> ::ssize_t; ++ pub fn pwritev( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ offset: ::off_t, ++ ) -> ::ssize_t; ++ pub fn preadv( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ offset: ::off_t, ++ ) -> ::ssize_t; + } + + cfg_if! { +diff --git a/third_party/rust/libc/src/unix/uclibc/mips/mips32/mod.rs b/third_party/rust/libc/src/unix/uclibc/mips/mips32/mod.rs +index 410ab70c440a1e278ff81070cbba7740535e5d00..31bca589ef2be35b2e3d09efb733af15451b0222 100644 +--- a/third_party/rust/libc/src/unix/uclibc/mips/mips32/mod.rs ++++ b/third_party/rust/libc/src/unix/uclibc/mips/mips32/mod.rs +@@ -239,91 +239,91 @@ pub const SYS_close: ::c_long = 4000 + 6; + pub const SYS_waitpid: ::c_long = 4000 + 7; + pub const SYS_creat: ::c_long = 4000 + 8; + pub const SYS_link: ::c_long = 4000 + 9; +-pub const SYS_unlink: ::c_long = 4000 + 10; +-pub const SYS_execve: ::c_long = 4000 + 11; +-pub const SYS_chdir: ::c_long = 4000 + 12; +-pub const SYS_time: ::c_long = 4000 + 13; +-pub const SYS_mknod: ::c_long = 4000 + 14; +-pub const SYS_chmod: ::c_long = 4000 + 15; +-pub const SYS_lchown: ::c_long = 4000 + 16; +-pub const SYS_break: ::c_long = 4000 + 17; +-pub const SYS_lseek: ::c_long = 4000 + 19; +-pub const SYS_getpid: ::c_long = 4000 + 20; +-pub const SYS_mount: ::c_long = 4000 + 21; +-pub const SYS_umount: ::c_long = 4000 + 22; +-pub const SYS_setuid: ::c_long = 4000 + 23; +-pub const SYS_getuid: ::c_long = 4000 + 24; +-pub const SYS_stime: ::c_long = 4000 + 25; +-pub const SYS_ptrace: ::c_long = 4000 + 26; +-pub const SYS_alarm: ::c_long = 4000 + 27; +-pub const SYS_pause: ::c_long = 4000 + 29; +-pub const SYS_utime: ::c_long = 4000 + 30; +-pub const SYS_stty: ::c_long = 4000 + 31; +-pub const SYS_gtty: ::c_long = 4000 + 32; +-pub const SYS_access: ::c_long = 4000 + 33; +-pub const SYS_nice: ::c_long = 4000 + 34; +-pub const SYS_ftime: ::c_long = 4000 + 35; +-pub const SYS_sync: ::c_long = 4000 + 36; +-pub const SYS_kill: ::c_long = 4000 + 37; +-pub const SYS_rename: ::c_long = 4000 + 38; +-pub const SYS_mkdir: ::c_long = 4000 + 39; +-pub const SYS_rmdir: ::c_long = 4000 + 40; +-pub const SYS_dup: ::c_long = 4000 + 41; +-pub const SYS_pipe: ::c_long = 4000 + 42; +-pub const SYS_times: ::c_long = 4000 + 43; +-pub const SYS_prof: ::c_long = 4000 + 44; +-pub const SYS_brk: ::c_long = 4000 + 45; +-pub const SYS_setgid: ::c_long = 4000 + 46; +-pub const SYS_getgid: ::c_long = 4000 + 47; +-pub const SYS_signal: ::c_long = 4000 + 48; +-pub const SYS_geteuid: ::c_long = 4000 + 49; +-pub const SYS_getegid: ::c_long = 4000 + 50; +-pub const SYS_acct: ::c_long = 4000 + 51; +-pub const SYS_umount2: ::c_long = 4000 + 52; +-pub const SYS_lock: ::c_long = 4000 + 53; +-pub const SYS_ioctl: ::c_long = 4000 + 54; +-pub const SYS_fcntl: ::c_long = 4000 + 55; +-pub const SYS_mpx: ::c_long = 4000 + 56; +-pub const SYS_setpgid: ::c_long = 4000 + 57; +-pub const SYS_ulimit: ::c_long = 4000 + 58; +-pub const SYS_umask: ::c_long = 4000 + 60; +-pub const SYS_chroot: ::c_long = 4000 + 61; +-pub const SYS_ustat: ::c_long = 4000 + 62; +-pub const SYS_dup2: ::c_long = 4000 + 63; +-pub const SYS_getppid: ::c_long = 4000 + 64; +-pub const SYS_getpgrp: ::c_long = 4000 + 65; +-pub const SYS_setsid: ::c_long = 4000 + 66; +-pub const SYS_sigaction: ::c_long = 4000 + 67; +-pub const SYS_sgetmask: ::c_long = 4000 + 68; +-pub const SYS_ssetmask: ::c_long = 4000 + 69; +-pub const SYS_setreuid: ::c_long = 4000 + 70; +-pub const SYS_setregid: ::c_long = 4000 + 71; +-pub const SYS_sigsuspend: ::c_long = 4000 + 72; +-pub const SYS_sigpending: ::c_long = 4000 + 73; +-pub const SYS_sethostname: ::c_long = 4000 + 74; +-pub const SYS_setrlimit: ::c_long = 4000 + 75; +-pub const SYS_getrlimit: ::c_long = 4000 + 76; +-pub const SYS_getrusage: ::c_long = 4000 + 77; +-pub const SYS_gettimeofday: ::c_long = 4000 + 78; +-pub const SYS_settimeofday: ::c_long = 4000 + 79; +-pub const SYS_getgroups: ::c_long = 4000 + 80; +-pub const SYS_setgroups: ::c_long = 4000 + 81; +-pub const SYS_symlink: ::c_long = 4000 + 83; +-pub const SYS_readlink: ::c_long = 4000 + 85; +-pub const SYS_uselib: ::c_long = 4000 + 86; +-pub const SYS_swapon: ::c_long = 4000 + 87; +-pub const SYS_reboot: ::c_long = 4000 + 88; +-pub const SYS_readdir: ::c_long = 4000 + 89; +-pub const SYS_mmap: ::c_long = 4000 + 90; +-pub const SYS_munmap: ::c_long = 4000 + 91; +-pub const SYS_truncate: ::c_long = 4000 + 92; +-pub const SYS_ftruncate: ::c_long = 4000 + 93; +-pub const SYS_fchmod: ::c_long = 4000 + 94; +-pub const SYS_fchown: ::c_long = 4000 + 95; +-pub const SYS_getpriority: ::c_long = 4000 + 96; +-pub const SYS_setpriority: ::c_long = 4000 + 97; +-pub const SYS_profil: ::c_long = 4000 + 98; +-pub const SYS_statfs: ::c_long = 4000 + 99; ++pub const SYS_unlink: ::c_long = 4000 + 10; ++pub const SYS_execve: ::c_long = 4000 + 11; ++pub const SYS_chdir: ::c_long = 4000 + 12; ++pub const SYS_time: ::c_long = 4000 + 13; ++pub const SYS_mknod: ::c_long = 4000 + 14; ++pub const SYS_chmod: ::c_long = 4000 + 15; ++pub const SYS_lchown: ::c_long = 4000 + 16; ++pub const SYS_break: ::c_long = 4000 + 17; ++pub const SYS_lseek: ::c_long = 4000 + 19; ++pub const SYS_getpid: ::c_long = 4000 + 20; ++pub const SYS_mount: ::c_long = 4000 + 21; ++pub const SYS_umount: ::c_long = 4000 + 22; ++pub const SYS_setuid: ::c_long = 4000 + 23; ++pub const SYS_getuid: ::c_long = 4000 + 24; ++pub const SYS_stime: ::c_long = 4000 + 25; ++pub const SYS_ptrace: ::c_long = 4000 + 26; ++pub const SYS_alarm: ::c_long = 4000 + 27; ++pub const SYS_pause: ::c_long = 4000 + 29; ++pub const SYS_utime: ::c_long = 4000 + 30; ++pub const SYS_stty: ::c_long = 4000 + 31; ++pub const SYS_gtty: ::c_long = 4000 + 32; ++pub const SYS_access: ::c_long = 4000 + 33; ++pub const SYS_nice: ::c_long = 4000 + 34; ++pub const SYS_ftime: ::c_long = 4000 + 35; ++pub const SYS_sync: ::c_long = 4000 + 36; ++pub const SYS_kill: ::c_long = 4000 + 37; ++pub const SYS_rename: ::c_long = 4000 + 38; ++pub const SYS_mkdir: ::c_long = 4000 + 39; ++pub const SYS_rmdir: ::c_long = 4000 + 40; ++pub const SYS_dup: ::c_long = 4000 + 41; ++pub const SYS_pipe: ::c_long = 4000 + 42; ++pub const SYS_times: ::c_long = 4000 + 43; ++pub const SYS_prof: ::c_long = 4000 + 44; ++pub const SYS_brk: ::c_long = 4000 + 45; ++pub const SYS_setgid: ::c_long = 4000 + 46; ++pub const SYS_getgid: ::c_long = 4000 + 47; ++pub const SYS_signal: ::c_long = 4000 + 48; ++pub const SYS_geteuid: ::c_long = 4000 + 49; ++pub const SYS_getegid: ::c_long = 4000 + 50; ++pub const SYS_acct: ::c_long = 4000 + 51; ++pub const SYS_umount2: ::c_long = 4000 + 52; ++pub const SYS_lock: ::c_long = 4000 + 53; ++pub const SYS_ioctl: ::c_long = 4000 + 54; ++pub const SYS_fcntl: ::c_long = 4000 + 55; ++pub const SYS_mpx: ::c_long = 4000 + 56; ++pub const SYS_setpgid: ::c_long = 4000 + 57; ++pub const SYS_ulimit: ::c_long = 4000 + 58; ++pub const SYS_umask: ::c_long = 4000 + 60; ++pub const SYS_chroot: ::c_long = 4000 + 61; ++pub const SYS_ustat: ::c_long = 4000 + 62; ++pub const SYS_dup2: ::c_long = 4000 + 63; ++pub const SYS_getppid: ::c_long = 4000 + 64; ++pub const SYS_getpgrp: ::c_long = 4000 + 65; ++pub const SYS_setsid: ::c_long = 4000 + 66; ++pub const SYS_sigaction: ::c_long = 4000 + 67; ++pub const SYS_sgetmask: ::c_long = 4000 + 68; ++pub const SYS_ssetmask: ::c_long = 4000 + 69; ++pub const SYS_setreuid: ::c_long = 4000 + 70; ++pub const SYS_setregid: ::c_long = 4000 + 71; ++pub const SYS_sigsuspend: ::c_long = 4000 + 72; ++pub const SYS_sigpending: ::c_long = 4000 + 73; ++pub const SYS_sethostname: ::c_long = 4000 + 74; ++pub const SYS_setrlimit: ::c_long = 4000 + 75; ++pub const SYS_getrlimit: ::c_long = 4000 + 76; ++pub const SYS_getrusage: ::c_long = 4000 + 77; ++pub const SYS_gettimeofday: ::c_long = 4000 + 78; ++pub const SYS_settimeofday: ::c_long = 4000 + 79; ++pub const SYS_getgroups: ::c_long = 4000 + 80; ++pub const SYS_setgroups: ::c_long = 4000 + 81; ++pub const SYS_symlink: ::c_long = 4000 + 83; ++pub const SYS_readlink: ::c_long = 4000 + 85; ++pub const SYS_uselib: ::c_long = 4000 + 86; ++pub const SYS_swapon: ::c_long = 4000 + 87; ++pub const SYS_reboot: ::c_long = 4000 + 88; ++pub const SYS_readdir: ::c_long = 4000 + 89; ++pub const SYS_mmap: ::c_long = 4000 + 90; ++pub const SYS_munmap: ::c_long = 4000 + 91; ++pub const SYS_truncate: ::c_long = 4000 + 92; ++pub const SYS_ftruncate: ::c_long = 4000 + 93; ++pub const SYS_fchmod: ::c_long = 4000 + 94; ++pub const SYS_fchown: ::c_long = 4000 + 95; ++pub const SYS_getpriority: ::c_long = 4000 + 96; ++pub const SYS_setpriority: ::c_long = 4000 + 97; ++pub const SYS_profil: ::c_long = 4000 + 98; ++pub const SYS_statfs: ::c_long = 4000 + 99; + pub const SYS_fstatfs: ::c_long = 4000 + 100; + pub const SYS_ioperm: ::c_long = 4000 + 101; + pub const SYS_socketcall: ::c_long = 4000 + 102; +@@ -589,31 +589,37 @@ pub const SYS_pkey_alloc: ::c_long = 4000 + 364; + pub const SYS_pkey_free: ::c_long = 4000 + 365; + + #[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; ++extern "C" { ++ 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: ::Option ::c_int>, +- pglob: *mut glob64_t) -> ::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: ::Option< ++ extern "C" 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; ++ 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; + } + + cfg_if! { +diff --git a/third_party/rust/libc/src/unix/uclibc/mips/mips64/mod.rs b/third_party/rust/libc/src/unix/uclibc/mips/mips64/mod.rs +index d80762e6c0acb71b9bb26a9ac5a2c69012205d04..735eb851ef7d45435fe4da79d7f5248379a30ef1 100644 +--- a/third_party/rust/libc/src/unix/uclibc/mips/mips64/mod.rs ++++ b/third_party/rust/libc/src/unix/uclibc/mips/mips64/mod.rs +@@ -195,10 +195,10 @@ 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 ++pub const SYS_gettid: ::c_long = 5178; // Valid for n64 + + #[link(name = "util")] +-extern { ++extern "C" { + pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; + } + +diff --git a/third_party/rust/libc/src/unix/uclibc/mips/mips64/no_align.rs b/third_party/rust/libc/src/unix/uclibc/mips/mips64/no_align.rs +index ee57ea88643db9981092a2b90d2246d440b9a3ec..8909114cdfa42f6063b2423ce0d7a53d0a943c29 100644 +--- a/third_party/rust/libc/src/unix/uclibc/mips/mips64/no_align.rs ++++ b/third_party/rust/libc/src/unix/uclibc/mips/mips64/no_align.rs +@@ -5,4 +5,3 @@ s! { + __align: [::c_long; 0], + } + } +- +diff --git a/third_party/rust/libc/src/unix/uclibc/mod.rs b/third_party/rust/libc/src/unix/uclibc/mod.rs +index e1eda9b84ee8b15e16cbf2ec000332d4dffd3646..de09587983409700a4c1f3cf654164fb215b4f9c 100644 +--- a/third_party/rust/libc/src/unix/uclibc/mod.rs ++++ b/third_party/rust/libc/src/unix/uclibc/mod.rs +@@ -23,17 +23,21 @@ pub type nl_item = ::c_int; + pub type idtype_t = ::c_uint; + + #[cfg_attr(feature = "extra_traits", derive(Debug))] +-pub enum fpos64_t {} // TODO: fill this out with a struct ++pub enum fpos64_t {} // FIXME: fill this out with a struct + impl ::Copy for fpos64_t {} + impl ::Clone for fpos64_t { +- fn clone(&self) -> fpos64_t { *self } ++ fn clone(&self) -> fpos64_t { ++ *self ++ } + } + + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub enum timezone {} + impl ::Copy for timezone {} + impl ::Clone for timezone { +- fn clone(&self) -> timezone { *self } ++ fn clone(&self) -> timezone { ++ *self ++ } + } + + s! { +@@ -284,6 +288,12 @@ s! { + pub msgtql: ::c_int, + pub msgseg: ::c_ushort, + } ++ ++ pub struct ucred { ++ pub pid: ::pid_t, ++ pub uid: ::uid_t, ++ pub gid: ::gid_t, ++ } + } + + s_no_extra_traits! { +@@ -491,7 +501,7 @@ pub const F_GETLEASE: ::c_int = 1025; + pub const F_NOTIFY: ::c_int = 1026; + pub const F_DUPFD_CLOEXEC: ::c_int = 1030; + +-// TODO(#235): Include file sealing fcntls once we have a way to verify them. ++// FIXME(#235): Include file sealing fcntls once we have a way to verify them. + + pub const SIGTRAP: ::c_int = 5; + +@@ -502,8 +512,7 @@ pub const CLOCK_REALTIME: ::clockid_t = 0; + pub const CLOCK_MONOTONIC: ::clockid_t = 1; + pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2; + pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 3; +-// TODO(#247) Someday our Travis shall have glibc 2.21 (released in Sep +-// 2014.) See also musl/mod.rs ++// FIXME: Add these constants once uclibc gets them. + // pub const CLOCK_SGI_CYCLE: ::clockid_t = 10; + // pub const CLOCK_TAI: ::clockid_t = 11; + pub const TIMER_ABSTIME: ::c_int = 1; +@@ -578,12 +587,12 @@ pub const LC_TIME: ::c_int = 3; + pub const LC_COLLATE: ::c_int = 4; + pub const LC_MESSAGES: ::c_int = 5; + pub const LC_ALL: ::c_int = 6; +-pub const LC_CTYPE_MASK: ::c_int = (1 << LC_CTYPE); +-pub const LC_NUMERIC_MASK: ::c_int = (1 << LC_NUMERIC); +-pub const LC_TIME_MASK: ::c_int = (1 << LC_TIME); +-pub const LC_COLLATE_MASK: ::c_int = (1 << LC_COLLATE); +-pub const LC_MONETARY_MASK: ::c_int = (1 << LC_MONETARY); +-pub const LC_MESSAGES_MASK: ::c_int = (1 << LC_MESSAGES); ++pub const LC_CTYPE_MASK: ::c_int = 1 << LC_CTYPE; ++pub const LC_NUMERIC_MASK: ::c_int = 1 << LC_NUMERIC; ++pub const LC_TIME_MASK: ::c_int = 1 << LC_TIME; ++pub const LC_COLLATE_MASK: ::c_int = 1 << LC_COLLATE; ++pub const LC_MONETARY_MASK: ::c_int = 1 << LC_MONETARY; ++pub const LC_MESSAGES_MASK: ::c_int = 1 << LC_MESSAGES; + // LC_ALL_MASK defined per platform + + pub const MAP_FILE: ::c_int = 0x0000; +@@ -738,6 +747,7 @@ pub const IFF_NOTRAILERS: ::c_int = 0x20; // Avoid use of trailers. + pub const IFF_RUNNING: ::c_int = 0x40; // Resources allocated. + pub const IFF_NOARP: ::c_int = 0x80; // No address resolution protocol. + pub const IFF_PROMISC: ::c_int = 0x100; // Receive all packets. ++ + // Not supported + pub const IFF_ALLMULTI: ::c_int = 0x200; // Receive all multicast packets. + pub const IFF_MASTER: ::c_int = 0x400; // Master of a load balancer. +@@ -745,6 +755,7 @@ pub const IFF_SLAVE: ::c_int = 0x800; // Slave of a load balancer. + pub const IFF_MULTICAST: ::c_int = 0x1000; // Supports multicast. + pub const IFF_PORTSEL: ::c_int = 0x2000; // Can set media type. + pub const IFF_AUTOMEDIA: ::c_int = 0x4000; // Auto media select active. ++ + // Dialup device with changing addresses. + pub const IFF_DYNAMIC: ::c_int = 0x8000; + +@@ -859,6 +870,7 @@ pub const MSG_WAITFORONE: ::c_int = 0x10000; + pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000; + + pub const SOCK_RAW: ::c_int = 3; ++pub const SOCK_RDM: ::c_int = 4; + pub const IP_MULTICAST_TTL: ::c_int = 33; + pub const IP_MULTICAST_LOOP: ::c_int = 34; + pub const IP_TTL: ::c_int = 2; +@@ -885,6 +897,22 @@ pub const TCP_INFO: ::c_int = 11; + pub const TCP_QUICKACK: ::c_int = 12; + pub const TCP_CONGESTION: ::c_int = 13; + ++// Source: ++// https://github.com/kraj/uClibc/blob/ca1c74d67dd115d059a875150e10b8560a9c35a8 ++// /libc/sysdeps/linux/common/bits/in.h ++// Same for all architectures ++pub const IPV6_MULTICAST_HOPS: ::c_int = 18; ++pub const IP_MULTICAST_IF: ::c_int = 32; ++pub const IPV6_MULTICAST_IF: ::c_int = 17; ++pub const IPV6_UNICAST_HOPS: ::c_int = 16; ++ ++// Source: ++// https://github.com/kraj/uClibc/tree/ca1c74d67dd115d059a875150e10b8560a9c35a8 ++// Same for all architectures ++pub const FUTEX_WAIT: ::c_int = 0; ++pub const FUTEX_PRIVATE_FLAG: ::c_int = 128; ++pub const FUTEX_WAKE: ::c_int = 1; ++ + pub const IPV6_MULTICAST_LOOP: ::c_int = 19; + pub const IPV6_V6ONLY: ::c_int = 26; + +@@ -940,13 +968,13 @@ pub const TCOON: ::c_int = 1; + pub const TCIFLUSH: ::c_int = 0; + pub const TCOFLUSH: ::c_int = 1; + pub const TCIOFLUSH: ::c_int = 2; +-pub const NL0: ::tcflag_t = 0x00000000; +-pub const NL1: ::tcflag_t = 0x00000100; ++pub const NL0: ::tcflag_t = 0x00000000; ++pub const NL1: ::tcflag_t = 0x00000100; + pub const TAB0: ::tcflag_t = 0x00000000; +-pub const CR0: ::tcflag_t = 0x00000000; +-pub const FF0: ::tcflag_t = 0x00000000; +-pub const BS0: ::tcflag_t = 0x00000000; +-pub const VT0: ::tcflag_t = 0x00000000; ++pub const CR0: ::tcflag_t = 0x00000000; ++pub const FF0: ::tcflag_t = 0x00000000; ++pub const BS0: ::tcflag_t = 0x00000000; ++pub const VT0: ::tcflag_t = 0x00000000; + pub const VERASE: usize = 2; + pub const VKILL: usize = 3; + pub const VINTR: usize = 0; +@@ -1018,6 +1046,7 @@ pub const POSIX_FADV_WILLNEED: ::c_int = 3; + pub const AT_FDCWD: ::c_int = -100; + pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x100; + pub const AT_REMOVEDIR: ::c_int = 0x200; ++pub const AT_EACCESS: ::c_int = 0x200; + pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400; + + pub const LOG_CRON: ::c_int = 9 << 3; +@@ -1475,6 +1504,10 @@ pub const NOSTR: ::nl_item = 0x503; + + pub const FILENAME_MAX: ::c_uint = 4095; + ++pub const PRIO_PROCESS: ::c_int = 0; ++pub const PRIO_PGRP: ::c_int = 1; ++pub const PRIO_USER: ::c_int = 2; ++ + f! { + pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { + let fd = fd as usize; +@@ -1571,17 +1604,20 @@ f! { + } + } + +-extern { +- #[cfg_attr(target_os = "linux", +- link_name = "__xpg_strerror_r")] +- pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, +- buflen: ::size_t) -> ::c_int; ++extern "C" { ++ #[cfg_attr(target_os = "linux", link_name = "__xpg_strerror_r")] ++ pub fn strerror_r( ++ errnum: ::c_int, ++ buf: *mut c_char, ++ buflen: ::size_t, ++ ) -> ::c_int; + + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; +- pub fn sem_init(sem: *mut sem_t, +- pshared: ::c_int, +- value: ::c_uint) +- -> ::c_int; ++ pub fn sem_init( ++ sem: *mut sem_t, ++ pshared: ::c_int, ++ value: ::c_uint, ++ ) -> ::c_int; + + pub fn abs(i: ::c_int) -> ::c_int; + pub fn atof(s: *const ::c_char) -> ::c_double; +@@ -1590,173 +1626,278 @@ extern { + pub fn srand(seed: ::c_uint); + + pub fn fdatasync(fd: ::c_int) -> ::c_int; +- pub fn gettimeofday(tp: *mut ::timeval, +- tz: *mut ::timezone) -> ::c_int; +- pub fn mincore(addr: *mut ::c_void, len: ::size_t, +- vec: *mut ::c_uchar) -> ::c_int; ++ pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; ++ pub fn mincore( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ vec: *mut ::c_uchar, ++ ) -> ::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; +- pub fn clock_nanosleep(clk_id: ::clockid_t, +- flags: ::c_int, +- rqtp: *const ::timespec, +- rmtp: *mut ::timespec) -> ::c_int; +- pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; ++ pub fn clock_nanosleep( ++ clk_id: ::clockid_t, ++ flags: ::c_int, ++ rqtp: *const ::timespec, ++ rmtp: *mut ::timespec, ++ ) -> ::c_int; ++ pub fn clock_settime( ++ clk_id: ::clockid_t, ++ tp: *const ::timespec, ++ ) -> ::c_int; + pub fn prctl(option: ::c_int, ...) -> ::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; ++ 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; + 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 setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int; + pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int; +- pub fn sched_setscheduler(pid: ::pid_t, +- policy: ::c_int, +- param: *const ::sched_param) -> ::c_int; ++ pub fn sched_setscheduler( ++ pid: ::pid_t, ++ policy: ::c_int, ++ param: *const ::sched_param, ++ ) -> ::c_int; + pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int; + pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int; + pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int; + pub fn epoll_create(size: ::c_int) -> ::c_int; + pub fn epoll_create1(flags: ::c_int) -> ::c_int; +- pub fn epoll_ctl(epfd: ::c_int, +- op: ::c_int, +- fd: ::c_int, +- event: *mut ::epoll_event) -> ::c_int; +- pub fn epoll_wait(epfd: ::c_int, +- events: *mut ::epoll_event, +- maxevents: ::c_int, +- timeout: ::c_int) -> ::c_int; ++ pub fn epoll_ctl( ++ epfd: ::c_int, ++ op: ::c_int, ++ fd: ::c_int, ++ event: *mut ::epoll_event, ++ ) -> ::c_int; ++ pub fn epoll_wait( ++ epfd: ::c_int, ++ events: *mut ::epoll_event, ++ maxevents: ::c_int, ++ timeout: ::c_int, ++ ) -> ::c_int; + pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; +- pub fn mount(src: *const ::c_char, +- target: *const ::c_char, +- fstype: *const ::c_char, +- flags: ::c_ulong, +- data: *const ::c_void) -> ::c_int; ++ pub fn mount( ++ src: *const ::c_char, ++ target: *const ::c_char, ++ fstype: *const ::c_char, ++ flags: ::c_ulong, ++ data: *const ::c_void, ++ ) -> ::c_int; + pub fn umount(target: *const ::c_char) -> ::c_int; + pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int; +- pub fn clone(cb: extern fn(*mut ::c_void) -> ::c_int, +- child_stack: *mut ::c_void, +- flags: ::c_int, +- arg: *mut ::c_void, ...) -> ::c_int; ++ pub fn clone( ++ cb: extern "C" fn(*mut ::c_void) -> ::c_int, ++ child_stack: *mut ::c_void, ++ flags: ::c_int, ++ arg: *mut ::c_void, ++ ... ++ ) -> ::c_int; + pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; + pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; +- pub fn memrchr(cx: *const ::c_void, +- c: ::c_int, +- n: ::size_t) -> *mut ::c_void; ++ pub fn memrchr( ++ cx: *const ::c_void, ++ c: ::c_int, ++ n: ::size_t, ++ ) -> *mut ::c_void; + pub fn syscall(num: ::c_long, ...) -> ::c_long; +- pub fn sendfile(out_fd: ::c_int, +- in_fd: ::c_int, +- offset: *mut off_t, +- count: ::size_t) -> ::ssize_t; +- pub fn splice(fd_in: ::c_int, +- off_in: *mut ::loff_t, +- fd_out: ::c_int, +- off_out: *mut ::loff_t, +- len: ::size_t, +- flags: ::c_uint) -> ::ssize_t; +- pub fn tee(fd_in: ::c_int, +- fd_out: ::c_int, +- len: ::size_t, +- flags: ::c_uint) -> ::ssize_t; +- pub fn vmsplice(fd: ::c_int, +- iov: *const ::iovec, +- nr_segs: ::size_t, +- flags: ::c_uint) -> ::ssize_t; +- +- pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, +- advise: ::c_int) -> ::c_int; ++ pub fn sendfile( ++ out_fd: ::c_int, ++ in_fd: ::c_int, ++ offset: *mut off_t, ++ count: ::size_t, ++ ) -> ::ssize_t; ++ pub fn splice( ++ fd_in: ::c_int, ++ off_in: *mut ::loff_t, ++ fd_out: ::c_int, ++ off_out: *mut ::loff_t, ++ len: ::size_t, ++ flags: ::c_uint, ++ ) -> ::ssize_t; ++ pub fn tee( ++ fd_in: ::c_int, ++ fd_out: ::c_int, ++ len: ::size_t, ++ flags: ::c_uint, ++ ) -> ::ssize_t; ++ pub fn vmsplice( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ nr_segs: ::size_t, ++ flags: ::c_uint, ++ ) -> ::ssize_t; ++ ++ pub fn posix_fadvise( ++ fd: ::c_int, ++ offset: ::off_t, ++ len: ::off_t, ++ advise: ::c_int, ++ ) -> ::c_int; + pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; + pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; + pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; +- pub fn utimensat(dirfd: ::c_int, path: *const ::c_char, +- times: *const ::timespec, flag: ::c_int) -> ::c_int; ++ pub fn utimensat( ++ dirfd: ::c_int, ++ path: *const ::c_char, ++ times: *const ::timespec, ++ flag: ::c_int, ++ ) -> ::c_int; + pub fn duplocale(base: ::locale_t) -> ::locale_t; + pub fn freelocale(loc: ::locale_t); +- pub fn newlocale(mask: ::c_int, +- locale: *const ::c_char, +- base: ::locale_t) -> ::locale_t; ++ 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 creat64(path: *const c_char, mode: mode_t) -> ::c_int; + pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int; +- pub fn fstatat64(fildes: ::c_int, path: *const ::c_char, +- buf: *mut stat64, flag: ::c_int) -> ::c_int; ++ pub fn fstatat64( ++ fildes: ::c_int, ++ path: *const ::c_char, ++ buf: *mut stat64, ++ flag: ::c_int, ++ ) -> ::c_int; + pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int; + pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int; + pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t; + pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int; +- pub fn mmap64(addr: *mut ::c_void, +- len: ::size_t, +- prot: ::c_int, +- flags: ::c_int, +- fd: ::c_int, +- offset: off64_t) +- -> *mut ::c_void; ++ pub fn mmap64( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ prot: ::c_int, ++ flags: ::c_int, ++ fd: ::c_int, ++ offset: off64_t, ++ ) -> *mut ::c_void; + pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int; +- pub fn openat64(fd: ::c_int, +- path: *const c_char, +- oflag: ::c_int, ...) -> ::c_int; +- pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, +- offset: off64_t) -> ::ssize_t; +- pub fn pwrite64(fd: ::c_int, buf: *const ::c_void, count: ::size_t, +- offset: off64_t) -> ::ssize_t; ++ pub fn openat64( ++ fd: ::c_int, ++ path: *const c_char, ++ oflag: ::c_int, ++ ... ++ ) -> ::c_int; ++ pub fn pread64( ++ fd: ::c_int, ++ buf: *mut ::c_void, ++ count: ::size_t, ++ offset: off64_t, ++ ) -> ::ssize_t; ++ pub fn pwrite64( ++ fd: ::c_int, ++ buf: *const ::c_void, ++ count: ::size_t, ++ offset: off64_t, ++ ) -> ::ssize_t; + pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64; +- pub fn readdir64_r(dirp: *mut ::DIR, entry: *mut ::dirent64, +- result: *mut *mut ::dirent64) -> ::c_int; ++ pub fn readdir64_r( ++ dirp: *mut ::DIR, ++ entry: *mut ::dirent64, ++ result: *mut *mut ::dirent64, ++ ) -> ::c_int; + pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int; + pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int; + pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int; + pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; + +- pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char, +- mode: ::mode_t, dev: dev_t) -> ::c_int; +- pub fn ppoll(fds: *mut ::pollfd, +- nfds: nfds_t, +- timeout: *const ::timespec, +- sigmask: *const sigset_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 pthread_condattr_setpshared(attr: *mut pthread_condattr_t, +- pshared: ::c_int) -> ::c_int; +- pub fn pthread_condattr_getpshared(attr: *const pthread_condattr_t, +- pshared: *mut ::c_int) -> ::c_int; +- pub fn sched_getaffinity(pid: ::pid_t, +- cpusetsize: ::size_t, +- 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 mknodat( ++ dirfd: ::c_int, ++ pathname: *const ::c_char, ++ mode: ::mode_t, ++ dev: dev_t, ++ ) -> ::c_int; ++ pub fn ppoll( ++ fds: *mut ::pollfd, ++ nfds: nfds_t, ++ timeout: *const ::timespec, ++ sigmask: *const sigset_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 pthread_condattr_setpshared( ++ attr: *mut pthread_condattr_t, ++ pshared: ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_condattr_getpshared( ++ attr: *const pthread_condattr_t, ++ pshared: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn sched_getaffinity( ++ pid: ::pid_t, ++ cpusetsize: ::size_t, ++ 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 sem_timedwait(sem: *mut sem_t, +- abstime: *const ::timespec) -> ::c_int; +- pub fn sem_getvalue(sem: *mut sem_t, +- sval: *mut ::c_int) -> ::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 pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, +- pshared: ::c_int) -> ::c_int; +- pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t, +- pshared: *mut ::c_int) -> ::c_int; +- pub fn pthread_rwlockattr_getkind_np(attr: *const pthread_rwlockattr_t, +- val: *mut ::c_int) -> ::c_int; +- pub fn pthread_rwlockattr_setkind_np(attr: *mut pthread_rwlockattr_t, +- val: ::c_int) -> ::c_int; +- pub fn pthread_rwlockattr_getpshared(attr: *const pthread_rwlockattr_t, +- val: *mut ::c_int) -> ::c_int; +- pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, +- val: ::c_int) -> ::c_int; +- pub fn ptsname_r(fd: ::c_int, +- buf: *mut ::c_char, +- buflen: ::size_t) -> ::c_int; ++ pub fn sem_timedwait( ++ sem: *mut sem_t, ++ abstime: *const ::timespec, ++ ) -> ::c_int; ++ pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::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 pthread_mutexattr_setpshared( ++ attr: *mut pthread_mutexattr_t, ++ pshared: ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_mutexattr_getpshared( ++ attr: *const pthread_mutexattr_t, ++ pshared: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_rwlockattr_getkind_np( ++ attr: *const pthread_rwlockattr_t, ++ val: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_rwlockattr_setkind_np( ++ attr: *mut pthread_rwlockattr_t, ++ val: ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_rwlockattr_getpshared( ++ attr: *const pthread_rwlockattr_t, ++ val: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn pthread_rwlockattr_setpshared( ++ attr: *mut pthread_rwlockattr_t, ++ val: ::c_int, ++ ) -> ::c_int; ++ pub fn ptsname_r( ++ fd: ::c_int, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ ) -> ::c_int; + pub fn clearenv() -> ::c_int; +- pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, +- options: ::c_int) -> ::c_int; ++ pub fn waitid( ++ idtype: idtype_t, ++ id: id_t, ++ infop: *mut ::siginfo_t, ++ options: ::c_int, ++ ) -> ::c_int; + + pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; + +@@ -1768,107 +1909,190 @@ extern { + 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; ++ 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 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 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 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 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; ++ 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; + pub fn tmpfile64() -> *mut ::FILE; + pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int; + pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int; +- pub fn fseeko64(stream: *mut ::FILE, +- offset: ::off64_t, +- whence: ::c_int) -> ::c_int; ++ pub fn fseeko64( ++ stream: *mut ::FILE, ++ offset: ::off64_t, ++ whence: ::c_int, ++ ) -> ::c_int; + pub fn ftello64(stream: *mut ::FILE) -> ::off64_t; +- pub fn readahead(fd: ::c_int, offset: ::off64_t, +- count: ::size_t) -> ::ssize_t; +- pub fn getxattr(path: *const c_char, name: *const c_char, +- value: *mut ::c_void, size: ::size_t) -> ::ssize_t; +- pub fn lgetxattr(path: *const c_char, name: *const c_char, +- value: *mut ::c_void, size: ::size_t) -> ::ssize_t; +- pub fn fgetxattr(filedes: ::c_int, name: *const c_char, +- value: *mut ::c_void, size: ::size_t) -> ::ssize_t; +- pub fn setxattr(path: *const c_char, name: *const c_char, +- value: *const ::c_void, size: ::size_t, +- flags: ::c_int) -> ::c_int; +- pub fn lsetxattr(path: *const c_char, name: *const c_char, +- value: *const ::c_void, size: ::size_t, +- flags: ::c_int) -> ::c_int; +- pub fn fsetxattr(filedes: ::c_int, name: *const c_char, +- value: *const ::c_void, size: ::size_t, +- flags: ::c_int) -> ::c_int; +- pub fn listxattr(path: *const c_char, list: *mut c_char, +- size: ::size_t) -> ::ssize_t; +- pub fn llistxattr(path: *const c_char, list: *mut c_char, +- size: ::size_t) -> ::ssize_t; +- pub fn flistxattr(filedes: ::c_int, list: *mut c_char, +- size: ::size_t) -> ::ssize_t; ++ pub fn readahead( ++ fd: ::c_int, ++ offset: ::off64_t, ++ count: ::size_t, ++ ) -> ::ssize_t; ++ pub fn getxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *mut ::c_void, ++ size: ::size_t, ++ ) -> ::ssize_t; ++ pub fn lgetxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *mut ::c_void, ++ size: ::size_t, ++ ) -> ::ssize_t; ++ pub fn fgetxattr( ++ filedes: ::c_int, ++ name: *const c_char, ++ value: *mut ::c_void, ++ size: ::size_t, ++ ) -> ::ssize_t; ++ pub fn setxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *const ::c_void, ++ size: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn lsetxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *const ::c_void, ++ size: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn fsetxattr( ++ filedes: ::c_int, ++ name: *const c_char, ++ value: *const ::c_void, ++ size: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn listxattr( ++ path: *const c_char, ++ list: *mut c_char, ++ size: ::size_t, ++ ) -> ::ssize_t; ++ pub fn llistxattr( ++ path: *const c_char, ++ list: *mut c_char, ++ size: ::size_t, ++ ) -> ::ssize_t; ++ pub fn flistxattr( ++ filedes: ::c_int, ++ list: *mut c_char, ++ size: ::size_t, ++ ) -> ::ssize_t; + pub fn removexattr(path: *const c_char, name: *const c_char) -> ::c_int; + pub fn lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int; + pub fn fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int; +- pub fn signalfd(fd: ::c_int, +- mask: *const ::sigset_t, +- flags: ::c_int) -> ::c_int; +- pub fn quotactl(cmd: ::c_int, +- special: *const ::c_char, +- id: ::c_int, +- data: *mut ::c_char) -> ::c_int; ++ pub fn signalfd( ++ fd: ::c_int, ++ mask: *const ::sigset_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ pub fn quotactl( ++ cmd: ::c_int, ++ special: *const ::c_char, ++ id: ::c_int, ++ data: *mut ::c_char, ++ ) -> ::c_int; + pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t; + pub fn mq_close(mqd: ::mqd_t) -> ::c_int; + pub fn mq_unlink(name: *const ::c_char) -> ::c_int; +- pub fn mq_receive(mqd: ::mqd_t, +- msg_ptr: *mut ::c_char, +- msg_len: ::size_t, +- msq_prio: *mut ::c_uint) -> ::ssize_t; +- pub fn mq_send(mqd: ::mqd_t, +- msg_ptr: *const ::c_char, +- msg_len: ::size_t, +- msq_prio: ::c_uint) -> ::c_int; ++ pub fn mq_receive( ++ mqd: ::mqd_t, ++ msg_ptr: *mut ::c_char, ++ msg_len: ::size_t, ++ msg_prio: *mut ::c_uint, ++ ) -> ::ssize_t; ++ pub fn mq_send( ++ mqd: ::mqd_t, ++ msg_ptr: *const ::c_char, ++ msg_len: ::size_t, ++ msg_prio: ::c_uint, ++ ) -> ::c_int; + pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int; +- pub fn mq_setattr(mqd: ::mqd_t, +- newattr: *const ::mq_attr, +- oldattr: *mut ::mq_attr) -> ::c_int; +- pub fn epoll_pwait(epfd: ::c_int, +- events: *mut ::epoll_event, +- maxevents: ::c_int, +- timeout: ::c_int, +- sigmask: *const ::sigset_t) -> ::c_int; ++ pub fn mq_setattr( ++ mqd: ::mqd_t, ++ newattr: *const ::mq_attr, ++ oldattr: *mut ::mq_attr, ++ ) -> ::c_int; ++ pub fn epoll_pwait( ++ epfd: ::c_int, ++ events: *mut ::epoll_event, ++ maxevents: ::c_int, ++ timeout: ::c_int, ++ sigmask: *const ::sigset_t, ++ ) -> ::c_int; + pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int; +- 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 nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char; +- pub fn prlimit(pid: ::pid_t, resource: ::c_int, new_limit: *const ::rlimit, +- old_limit: *mut ::rlimit) -> ::c_int; +- pub fn prlimit64(pid: ::pid_t, +- resource: ::c_int, +- new_limit: *const ::rlimit64, +- old_limit: *mut ::rlimit64) -> ::c_int; ++ 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 nl_langinfo_l(item: ::nl_item, locale: ::locale_t) ++ -> *mut ::c_char; ++ pub fn prlimit( ++ pid: ::pid_t, ++ resource: ::c_int, ++ new_limit: *const ::rlimit, ++ old_limit: *mut ::rlimit, ++ ) -> ::c_int; ++ pub fn prlimit64( ++ pid: ::pid_t, ++ resource: ::c_int, ++ new_limit: *const ::rlimit64, ++ old_limit: *mut ::rlimit64, ++ ) -> ::c_int; + 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; +@@ -1876,26 +2100,38 @@ extern { + 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 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 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); + +- pub fn mremap(addr: *mut ::c_void, +- len: ::size_t, +- new_len: ::size_t, +- flags: ::c_int, +- ...) -> *mut ::c_void; +- +- pub fn glob(pattern: *const c_char, +- flags: ::c_int, +- errfunc: ::Option ::c_int>, +- pglob: *mut ::glob_t) -> ::c_int; ++ pub fn mremap( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ new_len: ::size_t, ++ flags: ::c_int, ++ ... ++ ) -> *mut ::c_void; ++ ++ pub fn glob( ++ pattern: *const c_char, ++ flags: ::c_int, ++ errfunc: ::Option< ++ extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int, ++ >, ++ pglob: *mut ::glob_t, ++ ) -> ::c_int; + pub fn globfree(pglob: *mut ::glob_t); + + pub fn shm_unlink(name: *const ::c_char) -> ::c_int; +@@ -1905,90 +2141,110 @@ extern { + pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; + + pub fn telldir(dirp: *mut ::DIR) -> ::c_long; +- pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) +- -> ::c_int; +- +- pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int; +- +- pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, +- flags: ::c_int, addr: *mut ::sockaddr, +- addrlen: *mut ::socklen_t) -> ::ssize_t; ++ pub fn madvise( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ advice: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn msync( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn recvfrom( ++ socket: ::c_int, ++ buf: *mut ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ addr: *mut ::sockaddr, ++ addrlen: *mut ::socklen_t, ++ ) -> ::ssize_t; + pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; + +- pub fn bind(socket: ::c_int, address: *const ::sockaddr, +- address_len: ::socklen_t) -> ::c_int; +- +- pub fn writev(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int) -> ::ssize_t; +- pub fn readv(fd: ::c_int, +- iov: *const ::iovec, +- iovcnt: ::c_int) -> ::ssize_t; +- +- pub fn sendmsg(fd: ::c_int, +- msg: *const ::msghdr, +- flags: ::c_int) -> ::ssize_t; +- pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) +- -> ::ssize_t; +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrgid_r")] +- pub fn getgrgid_r(gid: ::gid_t, +- grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "sigaltstack$UNIX2003")] +- #[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")] +- pub fn sigaltstack(ss: *const stack_t, +- oss: *mut stack_t) -> ::c_int; ++ pub fn bind( ++ socket: ::c_int, ++ address: *const ::sockaddr, ++ address_len: ::socklen_t, ++ ) -> ::c_int; ++ ++ pub fn writev( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ ) -> ::ssize_t; ++ pub fn readv( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ ) -> ::ssize_t; ++ ++ pub fn sendmsg( ++ fd: ::c_int, ++ msg: *const ::msghdr, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ pub fn recvmsg( ++ fd: ::c_int, ++ msg: *mut ::msghdr, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ pub fn getgrgid_r( ++ gid: ::gid_t, ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; ++ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sem_close(sem: *mut sem_t) -> ::c_int; + pub fn getdtablesize() -> ::c_int; +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrnam_r")] +- pub fn getgrnam_r(name: *const ::c_char, +- grp: *mut ::group, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut ::group) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "pthread_sigmask$UNIX2003")] +- pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, +- oldset: *mut sigset_t) -> ::c_int; ++ pub fn getgrnam_r( ++ name: *const ::c_char, ++ grp: *mut ::group, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut ::group, ++ ) -> ::c_int; ++ pub fn pthread_sigmask( ++ how: ::c_int, ++ set: *const sigset_t, ++ oldset: *mut sigset_t, ++ ) -> ::c_int; + pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; + pub fn getgrnam(name: *const ::c_char) -> *mut ::group; + pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + pub fn sem_unlink(name: *const ::c_char) -> ::c_int; + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; +- #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwnam_r")] +- pub fn getpwnam_r(name: *const ::c_char, +- pwd: *mut passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut passwd) -> ::c_int; +- #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwuid_r")] +- pub fn getpwuid_r(uid: ::uid_t, +- pwd: *mut passwd, +- buf: *mut ::c_char, +- buflen: ::size_t, +- result: *mut *mut passwd) -> ::c_int; +- #[cfg_attr(all(target_os = "macos", target_arch ="x86"), +- link_name = "sigwait$UNIX2003")] +- #[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")] +- pub fn sigwait(set: *const sigset_t, +- sig: *mut ::c_int) -> ::c_int; +- pub fn pthread_atfork(prepare: ::Option, +- parent: ::Option, +- child: ::Option) -> ::c_int; +- pub fn pthread_create(native: *mut ::pthread_t, +- attr: *const ::pthread_attr_t, +- f: extern fn(*mut ::c_void) -> *mut ::c_void, +- value: *mut ::c_void) -> ::c_int; ++ pub fn getpwnam_r( ++ name: *const ::c_char, ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; ++ pub fn getpwuid_r( ++ uid: ::uid_t, ++ pwd: *mut passwd, ++ buf: *mut ::c_char, ++ buflen: ::size_t, ++ result: *mut *mut passwd, ++ ) -> ::c_int; ++ pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; ++ pub fn pthread_atfork( ++ prepare: ::Option, ++ parent: ::Option, ++ child: ::Option, ++ ) -> ::c_int; ++ pub fn pthread_create( ++ native: *mut ::pthread_t, ++ attr: *const ::pthread_attr_t, ++ f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, ++ value: *mut ::c_void, ++ ) -> ::c_int; + pub fn getgrgid(gid: ::gid_t) -> *mut ::group; +- #[cfg_attr(all(target_os = "macos", target_arch = "x86"), +- link_name = "popen$UNIX2003")] +- pub fn popen(command: *const c_char, +- mode: *const c_char) -> *mut ::FILE; ++ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; + pub fn uname(buf: *mut ::utsname) -> ::c_int; + } + +diff --git a/third_party/rust/libc/src/unix/uclibc/x86_64/align.rs b/third_party/rust/libc/src/unix/uclibc/x86_64/align.rs +index 8d4bbd59b093d3d38a5a99f747ed096247b18d59..e2d829b507735d6575ef5ee58eeb4d8645a83398 100644 +--- a/third_party/rust/libc/src/unix/uclibc/x86_64/align.rs ++++ b/third_party/rust/libc/src/unix/uclibc/x86_64/align.rs +@@ -5,7 +5,7 @@ macro_rules! expand_align { + repr(align(4)))] + #[cfg_attr(target_pointer_width = "64", + repr(align(8)))] +- pub struct sem_t { // ToDo ++ pub struct sem_t { // FIXME + #[cfg(target_pointer_width = "32")] + __size: [::c_char; 16], + #[cfg(target_pointer_width = "64")] +@@ -26,12 +26,12 @@ macro_rules! expand_align { + target_arch = "s390x", + target_arch = "sparc64")), + repr(align(8)))] +- pub struct pthread_mutexattr_t { // ToDo ++ pub struct pthread_mutexattr_t { // FIXME + size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], + } + + #[repr(align(4))] +- pub struct pthread_condattr_t { // ToDo ++ pub struct pthread_condattr_t { // FIXME + size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], + } + } +@@ -48,13 +48,13 @@ macro_rules! expand_align { + target_arch = "powerpc")))), + repr(align(8)))] + #[allow(missing_debug_implementations)] +- pub struct pthread_mutex_t { // ToDo ++ pub struct pthread_mutex_t { // FIXME + size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], + } + + #[repr(align(8))] + #[allow(missing_debug_implementations)] +- pub struct pthread_cond_t { // ToDo ++ pub struct pthread_cond_t { // FIXME + size: [u8; ::__SIZEOF_PTHREAD_COND_T], + } + +@@ -69,9 +69,9 @@ macro_rules! expand_align { + target_arch = "powerpc"))), + repr(align(8)))] + #[allow(missing_debug_implementations)] +- pub struct pthread_rwlock_t { // ToDo ++ pub struct pthread_rwlock_t { // FIXME + size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], + } + } +- } ++ }; + } +diff --git a/third_party/rust/libc/src/unix/uclibc/x86_64/mod.rs b/third_party/rust/libc/src/unix/uclibc/x86_64/mod.rs +index a8bb0794aa1de40e8b2c603f17f095675f457419..26eca9e7ea09dd48ef666432a7059957255bc447 100644 +--- a/third_party/rust/libc/src/unix/uclibc/x86_64/mod.rs ++++ b/third_party/rust/libc/src/unix/uclibc/x86_64/mod.rs +@@ -147,13 +147,13 @@ s! { + pub sa_mask: ::sigset_t, + } + +- pub struct stack_t { // ToDo ++ pub struct stack_t { // FIXME + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } + +- pub struct statfs { // ToDo ++ pub struct statfs { // FIXME + pub f_type: fsword_t, + pub f_bsize: fsword_t, + pub f_blocks: ::fsblkcnt_t, +@@ -167,7 +167,7 @@ s! { + f_spare: [fsword_t; 5], + } + +- pub struct msghdr { // ToDo ++ pub struct msghdr { // FIXME + pub msg_name: *mut ::c_void, + pub msg_namelen: ::socklen_t, + pub msg_iov: *mut ::iovec, +@@ -177,7 +177,7 @@ s! { + pub msg_flags: ::c_int, + } + +- pub struct termios { // ToDo ++ pub struct termios { // FIXME + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, +@@ -186,11 +186,11 @@ s! { + pub c_cc: [::cc_t; ::NCCS], + } + +- pub struct sigset_t { // ToDo ++ pub struct sigset_t { // FIXME + __val: [::c_ulong; 16], + } + +- pub struct sysinfo { // ToDo ++ pub struct sysinfo { // FIXME + pub uptime: ::c_long, + pub loads: [::c_ulong; 3], + pub totalram: ::c_ulong, +@@ -207,7 +207,7 @@ s! { + pub _f: [::c_char; 0], + } + +- pub struct glob_t { // ToDo ++ pub struct glob_t { // FIXME + pub gl_pathc: ::size_t, + pub gl_pathv: *mut *mut c_char, + pub gl_offs: ::size_t, +@@ -219,19 +219,19 @@ s! { + __unused5: *mut ::c_void, + } + +- pub struct rlimit64 { // ToDo ++ pub struct rlimit64 { // FIXME + pub rlim_cur: rlim64_t, + pub rlim_max: rlim64_t, + } + +- pub struct cpu_set_t { // ToDo ++ pub struct cpu_set_t { // FIXME + #[cfg(target_pointer_width = "32")] + bits: [u32; 32], + #[cfg(target_pointer_width = "64")] + bits: [u64; 16], + } + +- pub struct fsid_t { // ToDo ++ pub struct fsid_t { // FIXME + __val: [::c_int; 2], + } + } +diff --git a/third_party/rust/libc/src/unix/uclibc/x86_64/no_align.rs b/third_party/rust/libc/src/unix/uclibc/x86_64/no_align.rs +index 422d78fac25caec31a84677e36839c8b749cffbc..ffa4e523f215b3bbf5844aec85f8c199145d0ff2 100644 +--- a/third_party/rust/libc/src/unix/uclibc/x86_64/no_align.rs ++++ b/third_party/rust/libc/src/unix/uclibc/x86_64/no_align.rs +@@ -1,7 +1,7 @@ + macro_rules! expand_align { + () => { + s! { +- pub struct sem_t { // ToDo ++ pub struct sem_t { // FIXME + #[cfg(target_pointer_width = "32")] + __size: [::c_char; 16], + #[cfg(target_pointer_width = "64")] +@@ -9,7 +9,7 @@ macro_rules! expand_align { + __align: [::c_long; 0], + } + +- pub struct pthread_mutex_t { // ToDo ++ pub struct pthread_mutex_t { // FIXME + #[cfg(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc"))] +@@ -21,7 +21,7 @@ macro_rules! expand_align { + size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], + } + +- pub struct pthread_mutexattr_t { // ToDo ++ pub struct pthread_mutexattr_t { // FIXME + #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64", + target_arch = "mips64", target_arch = "s390x", + target_arch = "sparc64"))] +@@ -33,17 +33,17 @@ macro_rules! expand_align { + size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], + } + +- pub struct pthread_cond_t { // ToDo ++ pub struct pthread_cond_t { // FIXME + __align: [::c_longlong; 0], + size: [u8; ::__SIZEOF_PTHREAD_COND_T], + } + +- pub struct pthread_condattr_t { // ToDo ++ pub struct pthread_condattr_t { // FIXME + __align: [::c_int; 0], + size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], + } + +- pub struct pthread_rwlock_t { // ToDo ++ pub struct pthread_rwlock_t { // FIXME + #[cfg(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc"))] +diff --git a/third_party/rust/libc/src/vxworks/aarch64.rs b/third_party/rust/libc/src/vxworks/aarch64.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..4032488b6c0d5b1128fad52fabe5faaf80add3c4 +--- /dev/null ++++ b/third_party/rust/libc/src/vxworks/aarch64.rs +@@ -0,0 +1,4 @@ ++pub type c_char = u8; ++pub type wchar_t = u32; ++pub type c_long = i64; ++pub type c_ulong = u64; +diff --git a/third_party/rust/libc/src/vxworks/arm.rs b/third_party/rust/libc/src/vxworks/arm.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..55240068aa08eb7992d9adc49739f44679207b8b +--- /dev/null ++++ b/third_party/rust/libc/src/vxworks/arm.rs +@@ -0,0 +1,4 @@ ++pub type c_char = u8; ++pub type wchar_t = u32; ++pub type c_long = i32; ++pub type c_ulong = u32; +diff --git a/third_party/rust/libc/src/vxworks/mod.rs b/third_party/rust/libc/src/vxworks/mod.rs +new file mode 100755 +index 0000000000000000000000000000000000000000..2ca38d5e2413ba844ced9e32b319769cd494f98a +--- /dev/null ++++ b/third_party/rust/libc/src/vxworks/mod.rs +@@ -0,0 +1,2134 @@ ++//! Interface to VxWorks C library ++ ++use core::mem::size_of; ++use core::ptr::null_mut; ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum DIR {} ++impl ::Copy for DIR {} ++impl ::Clone for DIR { ++ fn clone(&self) -> DIR { ++ *self ++ } ++} ++ ++pub type c_schar = i8; ++pub type c_uchar = u8; ++pub type c_short = i16; ++pub type c_ushort = u16; ++pub type c_int = i32; ++pub type c_uint = u32; ++pub type c_float = f32; ++pub type c_double = f64; ++pub type c_longlong = i64; ++pub type c_ulonglong = u64; ++pub type intmax_t = i64; ++pub type uintmax_t = u64; ++ ++pub type uintptr_t = usize; ++pub type intptr_t = isize; ++pub type ptrdiff_t = isize; ++pub type size_t = ::uintptr_t; ++pub type ssize_t = ::intptr_t; ++ ++pub type pid_t = ::c_int; ++pub type in_addr_t = u32; ++pub type sighandler_t = ::size_t; ++pub type cpuset_t = u32; ++ ++pub type blkcnt_t = ::c_long; ++pub type blksize_t = ::c_long; ++pub type ino_t = ::c_ulong; ++ ++pub type rlim_t = ::c_ulong; ++pub type suseconds_t = ::c_long; ++pub type time_t = ::c_long; ++ ++pub type errno_t = ::c_int; ++ ++pub type useconds_t = ::c_ulong; ++ ++pub type socklen_t = ::c_uint; ++ ++pub type pthread_t = ::c_ulong; ++ ++pub type clockid_t = ::c_int; ++ ++//defined for the structs ++pub type dev_t = ::c_ulong; ++pub type mode_t = ::c_int; ++pub type nlink_t = ::c_ulong; ++pub type uid_t = ::c_ushort; ++pub type gid_t = ::c_ushort; ++pub type sigset_t = ::c_ulonglong; ++pub type key_t = ::c_long; ++ ++pub type nfds_t = ::c_uint; ++pub type stat64 = ::stat; ++ ++pub type pthread_key_t = ::c_ulong; ++ ++// From b_off_t.h ++pub type off_t = ::c_longlong; ++pub type off64_t = off_t; ++ ++// From b_BOOL.h ++pub type BOOL = ::c_int; ++ ++// From vxWind.h .. ++pub type _Vx_OBJ_HANDLE = ::c_int; ++pub type _Vx_TASK_ID = ::_Vx_OBJ_HANDLE; ++pub type _Vx_MSG_Q_ID = ::_Vx_OBJ_HANDLE; ++pub type _Vx_SEM_ID_KERNEL = ::_Vx_OBJ_HANDLE; ++pub type _Vx_RTP_ID = ::_Vx_OBJ_HANDLE; ++pub type _Vx_SD_ID = ::_Vx_OBJ_HANDLE; ++pub type _Vx_CONDVAR_ID = ::_Vx_OBJ_HANDLE; ++pub type _Vx_SEM_ID = *mut ::_Vx_semaphore; ++pub type OBJ_HANDLE = ::_Vx_OBJ_HANDLE; ++pub type TASK_ID = ::OBJ_HANDLE; ++pub type MSG_Q_ID = ::OBJ_HANDLE; ++pub type SEM_ID_KERNEL = ::OBJ_HANDLE; ++pub type RTP_ID = ::OBJ_HANDLE; ++pub type SD_ID = ::OBJ_HANDLE; ++pub type CONDVAR_ID = ::OBJ_HANDLE; ++ ++// From vxTypes.h ++pub type _Vx_usr_arg_t = isize; ++pub type _Vx_exit_code_t = isize; ++pub type _Vx_ticks_t = ::c_uint; ++pub type _Vx_ticks64_t = ::c_ulonglong; ++ ++pub type sa_family_t = ::c_uchar; ++ ++// mqueue.h ++pub type mqd_t = ::c_int; ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum _Vx_semaphore {} ++impl ::Copy for _Vx_semaphore {} ++impl ::Clone for _Vx_semaphore { ++ fn clone(&self) -> _Vx_semaphore { ++ *self ++ } ++} ++ ++s! { ++ // b_pthread_condattr_t.h ++ pub struct pthread_condattr_t { ++ pub condAttrStatus: ::c_int, ++ pub condAttrPshared: ::c_int, ++ pub condAttrClockId: ::clockid_t, ++ } ++ ++ // b_pthread_cond_t.h ++ pub struct pthread_cond_t{ ++ pub condSemId: ::_Vx_SEM_ID, ++ pub condValid: ::c_int, ++ pub condInitted: ::c_int, ++ pub condRefCount: ::c_int, ++ pub condMutex: *mut ::pthread_mutex_t, ++ pub condAttr: ::pthread_condattr_t, ++ pub condSemName: [::c_char; _PTHREAD_SHARED_SEM_NAME_MAX] ++ } ++ ++ // b_pthread_rwlockattr_t.h ++ pub struct pthread_rwlockattr_t { ++ pub rwlockAttrStatus: ::c_int, ++ pub rwlockAttrPshared: ::c_int, ++ pub rwlockAttrMaxReaders: ::c_uint, ++ pub rwlockAttrConformOpt: ::c_uint, ++ } ++ ++ // b_pthread_rwlock_t.h ++ pub struct pthread_rwlock_t { ++ pub rwlockSemId: :: _Vx_SEM_ID, ++ pub rwlockReadersRefCount: ::c_uint, ++ pub rwlockValid: ::c_int, ++ pub rwlockInitted: ::c_int, ++ pub rwlockAttr: ::pthread_rwlockattr_t, ++ pub rwlockSemName: [::c_char; _PTHREAD_SHARED_SEM_NAME_MAX] ++ } ++ ++ // b_struct_timeval.h ++ pub struct timeval { ++ pub tv_sec: ::time_t, ++ pub tv_usec: ::suseconds_t, ++ } ++ ++ // socket.h ++ pub struct linger { ++ pub l_onoff: ::c_int, ++ pub l_linger: ::c_int, ++ } ++ ++ pub struct sockaddr { ++ pub sa_len : ::c_uchar, ++ pub sa_family : sa_family_t, ++ pub sa_data : [::c_char; 14], ++ } ++ ++ pub struct iovec { ++ pub iov_base: *mut ::c_void, ++ pub iov_len: ::size_t, ++ } ++ ++ 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 cmsghdr { ++ pub cmsg_len: socklen_t, ++ pub cmsg_level: ::c_int, ++ pub cmsg_type: ::c_int, ++ } ++ ++ // poll.h ++ pub struct pollfd { ++ pub fd : ::c_int, ++ pub events : ::c_short, ++ pub revents : ::c_short, ++ } ++ ++ // resource.h ++ pub struct rlimit { ++ pub rlim_cur : ::rlim_t, ++ pub rlim_max : ::rlim_t, ++ } ++ ++ // stat.h ++ 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_rdev : ::dev_t, ++ pub st_size : ::off_t, ++ pub st_atime : ::time_t, ++ pub st_mtime : ::time_t, ++ pub st_ctime : ::time_t, ++ pub st_blksize : ::blksize_t, ++ pub st_blocks : ::blkcnt_t, ++ pub st_attrib : ::c_uchar, ++ pub st_reserved1 : ::c_int, ++ pub st_reserved2 : ::c_int, ++ pub st_reserved3 : ::c_int, ++ pub st_reserved4 : ::c_int, ++ } ++ ++ //b_struct__Timespec.h ++ pub struct _Timespec { ++ pub tv_sec : ::time_t, ++ pub tv_nsec : ::c_long, ++ } ++ ++ // b_struct__Sched_param.h ++ pub struct _Sched_param { ++ pub sched_priority: ::c_int, /* scheduling priority */ ++ pub sched_ss_low_priority: ::c_int, /* low scheduling priority */ ++ pub sched_ss_repl_period: ::_Timespec, /* replenishment period */ ++ pub sched_ss_init_budget: ::_Timespec, /* initial budget */ ++ pub sched_ss_max_repl: ::c_int, /* max pending replenishment */ ++ ++ } ++ ++ // b_pthread_attr_t.h ++ pub struct pthread_attr_t { ++ pub threadAttrStatus : ::c_int, ++ pub threadAttrStacksize : ::size_t, ++ pub threadAttrStackaddr : *mut ::c_void, ++ pub threadAttrGuardsize : ::size_t, ++ pub threadAttrDetachstate : ::c_int, ++ pub threadAttrContentionscope : ::c_int, ++ pub threadAttrInheritsched : ::c_int, ++ pub threadAttrSchedpolicy : ::c_int, ++ pub threadAttrName : *mut ::c_char, ++ pub threadAttrOptions : ::c_int, ++ pub threadAttrSchedparam : ::_Sched_param, ++ } ++ ++ // signal.h ++ ++ pub struct sigaction { ++ pub sa_u : ::sa_u_t, ++ pub sa_mask : ::sigset_t, ++ pub sa_flags : ::c_int, ++ } ++ ++ // b_stack_t.h ++ pub struct stack_t { ++ pub ss_sp : *mut ::c_void, ++ pub ss_size : ::size_t, ++ pub ss_flags : ::c_int, ++ } ++ ++ // signal.h ++ pub struct siginfo_t { ++ pub si_signo : ::c_int, ++ pub si_code : ::c_int, ++ pub si_value : ::sigval, ++ pub si_errno : ::c_int, ++ pub si_status: ::c_int, ++ pub si_addr: *mut ::c_void, ++ pub si_uid: ::uid_t, ++ pub si_pid: ::pid_t, ++ } ++ ++ // pthread.h (krnl) ++ // b_pthread_mutexattr_t.h (usr) ++ pub struct pthread_mutexattr_t { ++ mutexAttrStatus : ::c_int, ++ mutexAttrPshared : ::c_int, ++ mutexAttrProtocol : ::c_int, ++ mutexAttrPrioceiling : ::c_int, ++ mutexAttrType : ::c_int, ++ } ++ ++ // pthread.h (krnl) ++ // b_pthread_mutex_t.h (usr) ++ pub struct pthread_mutex_t { ++ pub mutexSemId: ::_Vx_SEM_ID, /*_Vx_SEM_ID ..*/ ++ pub mutexValid: ::c_int, ++ pub mutexInitted: ::c_int, ++ pub mutexCondRefCount: ::c_int, ++ pub mutexSavPriority: ::c_int, ++ pub mutexAttr: ::pthread_mutexattr_t, ++ pub mutexSemName: [::c_char; _PTHREAD_SHARED_SEM_NAME_MAX], ++ } ++ ++ // b_struct_timespec.h ++ pub struct timespec { ++ pub tv_sec: ::time_t, ++ pub tv_nsec: ::c_long, ++ } ++ ++ // time.h ++ 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, ++ } ++ ++ // in.h ++ pub struct in_addr { ++ pub s_addr: in_addr_t, ++ } ++ ++ // in.h ++ pub struct ip_mreq { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ // in6.h ++ #[repr(align(4))] ++ pub struct in6_addr { ++ pub s6_addr: [u8; 16], ++ } ++ ++ // in6.h ++ pub struct ipv6_mreq { ++ pub ipv6mr_multiaddr: in6_addr, ++ pub ipv6mr_interface: ::c_uint, ++ } ++ ++ // netdb.h ++ 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 : ::size_t, ++ pub ai_canonname: *mut ::c_char, ++ pub ai_addr : *mut ::sockaddr, ++ pub ai_next : *mut ::addrinfo, ++ } ++ ++ // in.h ++ pub struct sockaddr_in { ++ pub sin_len : u8, ++ pub sin_family: u8, ++ pub sin_port : u16, ++ pub sin_addr : ::in_addr, ++ pub sin_zero : [::c_char; 8], ++ } ++ ++ // in6.h ++ pub struct sockaddr_in6 { ++ pub sin6_len : u8, ++ pub sin6_family : u8, ++ pub sin6_port : u16, ++ pub sin6_flowinfo: u32, ++ pub sin6_addr : ::in6_addr, ++ pub sin6_scope_id: u32, ++ } ++ ++ 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 mq_attr { ++ pub mq_maxmsg: ::c_long, ++ pub mq_msgsize: ::c_long, ++ pub mq_flags: ::c_long, ++ pub mq_curmsgs: ::c_long, ++ } ++} ++ ++s_no_extra_traits! { ++ // dirent.h ++ pub struct dirent { ++ pub d_ino : ::ino_t, ++ pub d_name : [::c_char; _PARM_NAME_MAX as usize + 1], ++ } ++ ++ pub struct sockaddr_un { ++ pub sun_len: u8, ++ pub sun_family: sa_family_t, ++ pub sun_path: [::c_char; 104] ++ } ++ ++ // rtpLibCommon.h ++ pub struct RTP_DESC { ++ pub status : ::c_int, ++ pub options : u32, ++ pub entrAddr : *mut ::c_void, ++ pub initTaskId: ::TASK_ID, ++ pub parentId : ::RTP_ID, ++ pub pathName : [::c_char; VX_RTP_NAME_LENGTH as usize + 1], ++ pub taskCnt : ::c_int, ++ pub textStart : *mut ::c_void, ++ pub textEnd : *mut ::c_void, ++ } ++ // socket.h ++ pub struct sockaddr_storage { ++ pub ss_len : ::c_uchar, ++ pub ss_family : ::sa_family_t, ++ pub __ss_pad1 : [::c_char; _SS_PAD1SIZE], ++ pub __ss_align : i32, ++ pub __ss_pad2 : [::c_char; _SS_PAD2SIZE], ++ } ++ ++ pub union sa_u_t { ++ pub sa_handler : ::Option !>, ++ pub sa_sigaction: ::Option !>, ++ } ++ ++ pub union sigval { ++ pub sival_int : ::c_int, ++ pub sival_ptr : *mut ::c_void, ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl ::fmt::Debug for dirent { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_ino", &self.d_ino) ++ .field("d_name", &&self.d_name[..]) ++ .finish() ++ } ++ } ++ ++ impl ::fmt::Debug for sockaddr_un { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("sockaddr_un") ++ .field("sun_len", &self.sun_len) ++ .field("sun_family", &self.sun_family) ++ .field("sun_path", &&self.sun_path[..]) ++ .finish() ++ } ++ } ++ ++ impl ::fmt::Debug for RTP_DESC { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("RTP_DESC") ++ .field("status", &self.status) ++ .field("options", &self.options) ++ .field("entrAddr", &self.entrAddr) ++ .field("initTaskId", &self.initTaskId) ++ .field("parentId", &self.parentId) ++ .field("pathName", &&self.pathName[..]) ++ .field("taskCnt", &self.taskCnt) ++ .field("textStart", &self.textStart) ++ .field("textEnd", &self.textEnd) ++ .finish() ++ } ++ } ++ impl ::fmt::Debug for sockaddr_storage { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("sockaddr_storage") ++ .field("ss_len", &self.ss_len) ++ .field("ss_family", &self.ss_family) ++ .field("__ss_pad1", &&self.__ss_pad1[..]) ++ .field("__ss_align", &self.__ss_align) ++ .field("__ss_pad2", &&self.__ss_pad2[..]) ++ .finish() ++ } ++ } ++ ++ impl PartialEq for sa_u_t { ++ fn eq(&self, other: &sa_u_t) -> bool { ++ unsafe { ++ let h1 = match self.sa_handler { ++ Some(handler) => handler as usize, ++ None => 0 as usize, ++ }; ++ let h2 = match other.sa_handler { ++ Some(handler) => handler as usize, ++ None => 0 as usize, ++ }; ++ h1 == h2 ++ } ++ } ++ } ++ impl Eq for sa_u_t {} ++ impl ::fmt::Debug for sa_u_t { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ unsafe { ++ let h = match self.sa_handler { ++ Some(handler) => handler as usize, ++ None => 0 as usize, ++ }; ++ ++ f.debug_struct("sa_u_t") ++ .field("sa_handler", &h) ++ .finish() ++ } ++ } ++ } ++ impl ::hash::Hash for sa_u_t { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ let h = match self.sa_handler { ++ Some(handler) => handler as usize, ++ None => 0 as usize, ++ }; ++ h.hash(state) ++ } ++ } ++ } ++ ++ impl PartialEq for sigval { ++ fn eq(&self, other: &sigval) -> bool { ++ unsafe { self.sival_ptr as usize == other.sival_ptr as usize } ++ } ++ } ++ impl Eq for sigval {} ++ impl ::fmt::Debug for sigval { ++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { ++ f.debug_struct("sigval") ++ .field("sival_ptr", unsafe { &(self.sival_ptr as usize) }) ++ .finish() ++ } ++ } ++ impl ::hash::Hash for sigval { ++ fn hash(&self, state: &mut H) { ++ unsafe { (self.sival_ptr as usize).hash(state) }; ++ } ++ } ++ } ++} ++ ++pub const STDIN_FILENO: ::c_int = 0; ++pub const STDOUT_FILENO: ::c_int = 1; ++pub const STDERR_FILENO: ::c_int = 2; ++ ++pub const EXIT_SUCCESS: ::c_int = 0; ++pub const EXIT_FAILURE: ::c_int = 1; ++ ++pub const EAI_SERVICE: ::c_int = 9; ++pub const EAI_SOCKTYPE: ::c_int = 10; ++pub const EAI_SYSTEM: ::c_int = 11; ++ ++// This is not defined in vxWorks, but we have to define it here ++// to make the building pass for getrandom and libstd, FIXME ++pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void; ++ ++//Clock Lib Stuff ++pub const CLOCK_REALTIME: ::c_int = 0x0; ++pub const CLOCK_MONOTONIC: ::c_int = 0x1; ++pub const CLOCK_PROCESS_CPUTIME_ID: ::c_int = 0x2; ++pub const CLOCK_THREAD_CPUTIME_ID: ::c_int = 0x3; ++pub const TIMER_ABSTIME: ::c_int = 0x1; ++pub const TIMER_RELTIME: ::c_int = 0x0; ++ ++// PTHREAD STUFF ++pub const PTHREAD_INITIALIZED_OBJ: ::c_int = 0xF70990EF; ++pub const PTHREAD_DESTROYED_OBJ: ::c_int = -1; ++pub const PTHREAD_VALID_OBJ: ::c_int = 0xEC542A37; ++pub const PTHREAD_INVALID_OBJ: ::c_int = -1; ++pub const PTHREAD_UNUSED_YET_OBJ: ::c_int = -1; ++ ++pub const PTHREAD_PRIO_NONE: ::c_int = 0; ++pub const PTHREAD_PRIO_INHERIT: ::c_int = 1; ++pub const PTHREAD_PRIO_PROTECT: ::c_int = 2; ++ ++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 PTHREAD_STACK_MIN: usize = 4096; ++pub const _PTHREAD_SHARED_SEM_NAME_MAX: usize = 30; ++ ++// ERRNO STUFF ++pub const OK: ::c_int = 0; ++pub const EPERM: ::c_int = 1; /* Not owner */ ++pub const ENOENT: ::c_int = 2; /* No such file or directory */ ++pub const ESRCH: ::c_int = 3; /* No such process */ ++pub const EINTR: ::c_int = 4; /* Interrupted system call */ ++pub const EIO: ::c_int = 5; /* I/O error */ ++pub const ENXIO: ::c_int = 6; /* No such device or address */ ++pub const E2BIG: ::c_int = 7; /* Arg list too long */ ++pub const ENOEXEC: ::c_int = 8; /* Exec format error */ ++pub const EBADF: ::c_int = 9; /* Bad file number */ ++pub const ECHILD: ::c_int = 10; /* No children */ ++pub const EAGAIN: ::c_int = 11; /* No more processes */ ++pub const ENOMEM: ::c_int = 12; /* Not enough core */ ++pub const EACCES: ::c_int = 13; /* Permission denied */ ++pub const EFAULT: ::c_int = 14; ++pub const ENOTEMPTY: ::c_int = 15; ++pub const EBUSY: ::c_int = 16; ++pub const EEXIST: ::c_int = 17; ++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 ENAMETOOLONG: ::c_int = 26; ++pub const EFBIG: ::c_int = 27; ++pub const ENOSPC: ::c_int = 28; ++pub const EROFS: ::c_int = 30; ++pub const EPIPE: ::c_int = 32; ++pub const EDEADLK: ::c_int = 33; ++pub const ERANGE: ::c_int = 38; ++pub const EDESTADDRREQ: ::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 ENOTSOCK: ::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 EINPROGRESS: ::c_int = 68; ++pub const EALREADY: ::c_int = 69; ++pub const EWOULDBLOCK: ::c_int = 70; ++pub const ENOSYS: ::c_int = 71; ++pub const EDQUOT: ::c_int = 83; ++pub const ESTALE: ::c_int = 88; ++ ++// NFS errnos: Refer to pkgs_v2/storage/fs/nfs/h/nfs/nfsCommon.h ++const M_nfsStat: ::c_int = 48 << 16; ++enum nfsstat { ++ NFSERR_REMOTE = 71, ++ NFSERR_WFLUSH = 99, ++ NFSERR_BADHANDLE = 10001, ++ NFSERR_NOT_SYNC = 10002, ++ NFSERR_BAD_COOKIE = 10003, ++ NFSERR_TOOSMALL = 10005, ++ NFSERR_BADTYPE = 10007, ++ NFSERR_JUKEBOX = 10008, ++} ++ ++pub const S_nfsLib_NFS_OK: ::c_int = OK; ++pub const S_nfsLib_NFSERR_PERM: ::c_int = EPERM; ++pub const S_nfsLib_NFSERR_NOENT: ::c_int = ENOENT; ++pub const S_nfsLib_NFSERR_IO: ::c_int = EIO; ++pub const S_nfsLib_NFSERR_NXIO: ::c_int = ENXIO; ++pub const S_nfsLib_NFSERR_ACCESS: ::c_int = EACCES; ++pub const S_nfsLib_NFSERR_EXIST: ::c_int = EEXIST; ++pub const S_nfsLib_NFSERR_ENODEV: ::c_int = ENODEV; ++pub const S_nfsLib_NFSERR_NOTDIR: ::c_int = ENOTDIR; ++pub const S_nfsLib_NFSERR_ISDIR: ::c_int = EISDIR; ++pub const S_nfsLib_NFSERR_INVAL: ::c_int = EINVAL; ++pub const S_nfsLib_NFSERR_FBIG: ::c_int = EFBIG; ++pub const S_nfsLib_NFSERR_NOSPC: ::c_int = ENOSPC; ++pub const S_nfsLib_NFSERR_ROFS: ::c_int = EROFS; ++pub const S_nfsLib_NFSERR_NAMETOOLONG: ::c_int = ENAMETOOLONG; ++pub const S_nfsLib_NFSERR_NOTEMPTY: ::c_int = ENOTEMPTY; ++pub const S_nfsLib_NFSERR_DQUOT: ::c_int = EDQUOT; ++pub const S_nfsLib_NFSERR_STALE: ::c_int = ESTALE; ++pub const S_nfsLib_NFSERR_WFLUSH: ::c_int = ++ M_nfsStat | nfsstat::NFSERR_WFLUSH as ::c_int; ++pub const S_nfsLib_NFSERR_REMOTE: ::c_int = ++ M_nfsStat | nfsstat::NFSERR_REMOTE as ::c_int; ++pub const S_nfsLib_NFSERR_BADHANDLE: ::c_int = ++ M_nfsStat | nfsstat::NFSERR_BADHANDLE as ::c_int; ++pub const S_nfsLib_NFSERR_NOT_SYNC: ::c_int = ++ M_nfsStat | nfsstat::NFSERR_NOT_SYNC as ::c_int; ++pub const S_nfsLib_NFSERR_BAD_COOKIE: ::c_int = ++ M_nfsStat | nfsstat::NFSERR_BAD_COOKIE as ::c_int; ++pub const S_nfsLib_NFSERR_NOTSUPP: ::c_int = EOPNOTSUPP; ++pub const S_nfsLib_NFSERR_TOOSMALL: ::c_int = ++ M_nfsStat | nfsstat::NFSERR_TOOSMALL as ::c_int; ++pub const S_nfsLib_NFSERR_SERVERFAULT: ::c_int = EIO; ++pub const S_nfsLib_NFSERR_BADTYPE: ::c_int = ++ M_nfsStat | nfsstat::NFSERR_BADTYPE as ::c_int; ++pub const S_nfsLib_NFSERR_JUKEBOX: ::c_int = ++ M_nfsStat | nfsstat::NFSERR_JUKEBOX as ::c_int; ++ ++// in.h ++pub const IPPROTO_IP: ::c_int = 0; ++pub const IPPROTO_IPV6: ::c_int = 41; ++ ++pub const IP_TTL: ::c_int = 4; ++pub const IP_MULTICAST_IF: ::c_int = 9; ++pub const IP_MULTICAST_TTL: ::c_int = 10; ++pub const IP_MULTICAST_LOOP: ::c_int = 11; ++pub const IP_ADD_MEMBERSHIP: ::c_int = 12; ++pub const IP_DROP_MEMBERSHIP: ::c_int = 13; ++ ++// in6.h ++pub const IPV6_V6ONLY: ::c_int = 1; ++pub const IPV6_UNICAST_HOPS: ::c_int = 4; ++pub const IPV6_MULTICAST_IF: ::c_int = 9; ++pub const IPV6_MULTICAST_HOPS: ::c_int = 10; ++pub const IPV6_MULTICAST_LOOP: ::c_int = 11; ++pub const IPV6_ADD_MEMBERSHIP: ::c_int = 12; ++pub const IPV6_DROP_MEMBERSHIP: ::c_int = 13; ++ ++// STAT Stuff ++pub const S_IFMT: ::c_int = 0xf000; ++pub const S_IFIFO: ::c_int = 0x1000; ++pub const S_IFCHR: ::c_int = 0x2000; ++pub const S_IFDIR: ::c_int = 0x4000; ++pub const S_IFBLK: ::c_int = 0x6000; ++pub const S_IFREG: ::c_int = 0x8000; ++pub const S_IFLNK: ::c_int = 0xa000; ++pub const S_IFSHM: ::c_int = 0xb000; ++pub const S_IFSOCK: ::c_int = 0xc000; ++pub const S_ISUID: ::c_int = 0x0800; ++pub const S_ISGID: ::c_int = 0x0400; ++pub const S_ISTXT: ::c_int = 0x0200; ++pub const S_IRUSR: ::c_int = 0x0100; ++pub const S_IWUSR: ::c_int = 0x0080; ++pub const S_IXUSR: ::c_int = 0x0040; ++pub const S_IRWXU: ::c_int = 0x01c0; ++pub const S_IRGRP: ::c_int = 0x0020; ++pub const S_IWGRP: ::c_int = 0x0010; ++pub const S_IXGRP: ::c_int = 0x0008; ++pub const S_IRWXG: ::c_int = 0x0038; ++pub const S_IROTH: ::c_int = 0x0004; ++pub const S_IWOTH: ::c_int = 0x0002; ++pub const S_IXOTH: ::c_int = 0x0001; ++pub const S_IRWXO: ::c_int = 0x0007; ++ ++// socket.h ++pub const SOL_SOCKET: ::c_int = 0xffff; ++ ++pub const SO_DEBUG: ::c_int = 0x0001; ++pub const SO_REUSEADDR: ::c_int = 0x0004; ++pub const SO_KEEPALIVE: ::c_int = 0x0008; ++pub const SO_DONTROUTE: ::c_int = 0x0010; ++pub const SO_RCVLOWAT: ::c_int = 0x0012; ++pub const SO_SNDLOWAT: ::c_int = 0x0013; ++pub const SO_SNDTIMEO: ::c_int = 0x1005; ++pub const SO_ACCEPTCONN: ::c_int = 0x001e; ++pub const SO_BROADCAST: ::c_int = 0x0020; ++pub const SO_USELOOPBACK: ::c_int = 0x0040; ++pub const SO_LINGER: ::c_int = 0x0080; ++pub const SO_REUSEPORT: ::c_int = 0x0200; ++ ++pub const SO_VLAN: ::c_int = 0x8000; ++ ++pub const SO_SNDBUF: ::c_int = 0x1001; ++pub const SO_RCVBUF: ::c_int = 0x1002; ++pub const SO_RCVTIMEO: ::c_int = 0x1006; ++pub const SO_ERROR: ::c_int = 0x1007; ++pub const SO_TYPE: ::c_int = 0x1008; ++pub const SO_BINDTODEVICE: ::c_int = 0x1010; ++pub const SO_OOBINLINE: ::c_int = 0x1011; ++pub const SO_CONNTIMEO: ::c_int = 0x100a; ++ ++pub const SOCK_STREAM: ::c_int = 1; ++pub const SOCK_DGRAM: ::c_int = 2; ++pub const SOCK_RAW: ::c_int = 3; ++pub const SOCK_RDM: ::c_int = 4; ++pub const SOCK_SEQPACKET: ::c_int = 5; ++pub const SOCK_PACKET: ::c_int = 10; ++ ++pub const _SS_MAXSIZE: usize = 128; ++pub const _SS_ALIGNSIZE: usize = size_of::(); ++pub const _SS_PAD1SIZE: usize = ++ _SS_ALIGNSIZE - size_of::<::c_uchar>() - size_of::<::sa_family_t>(); ++pub const _SS_PAD2SIZE: usize = _SS_MAXSIZE ++ - size_of::<::c_uchar>() ++ - size_of::<::sa_family_t>() ++ - _SS_PAD1SIZE ++ - _SS_ALIGNSIZE; ++ ++pub const MSG_OOB: ::c_int = 0x0001; ++pub const MSG_PEEK: ::c_int = 0x0002; ++pub const MSG_DONTROUTE: ::c_int = 0x0004; ++pub const MSG_EOR: ::c_int = 0x0008; ++pub const MSG_TRUNC: ::c_int = 0x0010; ++pub const MSG_CTRUNC: ::c_int = 0x0020; ++pub const MSG_WAITALL: ::c_int = 0x0040; ++pub const MSG_DONTWAIT: ::c_int = 0x0080; ++pub const MSG_EOF: ::c_int = 0x0100; ++pub const MSG_EXP: ::c_int = 0x0200; ++pub const MSG_MBUF: ::c_int = 0x0400; ++pub const MSG_NOTIFICATION: ::c_int = 0x0800; ++pub const MSG_COMPAT: ::c_int = 0x8000; ++ ++pub const AF_UNSPEC: ::c_int = 0; ++pub const AF_LOCAL: ::c_int = 1; ++pub const AF_UNIX: ::c_int = AF_LOCAL; ++pub const AF_INET: ::c_int = 2; ++pub const AF_NETLINK: ::c_int = 16; ++pub const AF_ROUTE: ::c_int = 17; ++pub const AF_LINK: ::c_int = 18; ++pub const AF_PACKET: ::c_int = 19; ++pub const pseudo_AF_KEY: ::c_int = 27; ++pub const AF_KEY: ::c_int = pseudo_AF_KEY; ++pub const AF_INET6: ::c_int = 28; ++pub const AF_SOCKDEV: ::c_int = 31; ++pub const AF_TIPC: ::c_int = 33; ++pub const AF_MIPC: ::c_int = 34; ++pub const AF_MIPC_SAFE: ::c_int = 35; ++pub const AF_MAX: ::c_int = 37; ++ ++pub const SHUT_RD: ::c_int = 0; ++pub const SHUT_WR: ::c_int = 1; ++pub const SHUT_RDWR: ::c_int = 2; ++ ++pub const IPPROTO_TCP: ::c_int = 6; ++pub const TCP_NODELAY: ::c_int = 1; ++pub const TCP_MAXSEG: ::c_int = 2; ++pub const TCP_NOPUSH: ::c_int = 3; ++pub const TCP_KEEPIDLE: ::c_int = 4; ++pub const TCP_KEEPINTVL: ::c_int = 5; ++pub const TCP_KEEPCNT: ::c_int = 6; ++ ++// ioLib.h ++pub const FIONREAD: ::c_int = 0x40040001; ++pub const FIOFLUSH: ::c_int = 2; ++pub const FIOOPTIONS: ::c_int = 3; ++pub const FIOBAUDRATE: ::c_int = 4; ++pub const FIODISKFORMAT: ::c_int = 5; ++pub const FIODISKINIT: ::c_int = 6; ++pub const FIOSEEK: ::c_int = 7; ++pub const FIOWHERE: ::c_int = 8; ++pub const FIODIRENTRY: ::c_int = 9; ++pub const FIORENAME: ::c_int = 10; ++pub const FIOREADYCHANGE: ::c_int = 11; ++pub const FIODISKCHANGE: ::c_int = 13; ++pub const FIOCANCEL: ::c_int = 14; ++pub const FIOSQUEEZE: ::c_int = 15; ++pub const FIOGETNAME: ::c_int = 18; ++pub const FIONBIO: ::c_int = 0x90040010; ++ ++// limits.h ++pub const PATH_MAX: ::c_int = _PARM_PATH_MAX; ++pub const _POSIX_PATH_MAX: ::c_int = 256; ++ ++// Some poll stuff ++pub const POLLIN: ::c_short = 0x0001; ++pub const POLLPRI: ::c_short = 0x0002; ++pub const POLLOUT: ::c_short = 0x0004; ++pub const POLLRDNORM: ::c_short = 0x0040; ++pub const POLLWRNORM: ::c_short = POLLOUT; ++pub const POLLRDBAND: ::c_short = 0x0080; ++pub const POLLWRBAND: ::c_short = 0x0100; ++pub const POLLERR: ::c_short = 0x0008; ++pub const POLLHUP: ::c_short = 0x0010; ++pub const POLLNVAL: ::c_short = 0x0020; ++ ++// fnctlcom.h ++pub const FD_CLOEXEC: ::c_int = 1; ++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 F_GETOWN: ::c_int = 5; ++pub const F_SETOWN: ::c_int = 6; ++pub const F_GETLK: ::c_int = 7; ++pub const F_SETLK: ::c_int = 8; ++pub const F_SETLKW: ::c_int = 9; ++pub const F_DUPFD_CLOEXEC: ::c_int = 14; ++ ++// signal.h ++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 = -1 as isize as sighandler_t; ++ ++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 SIGTRAP: ::c_int = 5; ++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 SIGBUS: ::c_int = 10; ++pub const SIGSEGV: ::c_int = 11; ++pub const SIGFMT: ::c_int = 12; ++pub const SIGPIPE: ::c_int = 13; ++pub const SIGALRM: ::c_int = 14; ++pub const SIGTERM: ::c_int = 15; ++pub const SIGCNCL: ::c_int = 16; ++pub const SIGSTOP: ::c_int = 17; ++pub const SIGTSTP: ::c_int = 18; ++pub const SIGCONT: ::c_int = 19; ++pub const SIGCHLD: ::c_int = 20; ++pub const SIGTTIN: ::c_int = 21; ++pub const SIGTTOU: ::c_int = 22; ++ ++pub const SIG_BLOCK: ::c_int = 1; ++pub const SIG_UNBLOCK: ::c_int = 2; ++pub const SIG_SETMASK: ::c_int = 3; ++ ++pub const SI_SYNC: ::c_int = 0; ++pub const SI_USER: ::c_int = -1; ++pub const SI_QUEUE: ::c_int = -2; ++pub const SI_TIMER: ::c_int = -3; ++pub const SI_ASYNCIO: ::c_int = -4; ++pub const SI_MESGQ: ::c_int = -5; ++pub const SI_CHILD: ::c_int = -6; ++pub const SI_KILL: ::c_int = SI_USER; ++ ++// vxParams.h definitions ++pub const _PARM_NAME_MAX: ::c_int = 255; ++pub const _PARM_PATH_MAX: ::c_int = 1024; ++ ++// WAIT STUFF ++pub const WNOHANG: ::c_int = 0x01; ++pub const WUNTRACED: ::c_int = 0x02; ++ ++const PTHREAD_MUTEXATTR_INITIALIZER: pthread_mutexattr_t = ++ pthread_mutexattr_t { ++ mutexAttrStatus: PTHREAD_INITIALIZED_OBJ, ++ mutexAttrProtocol: PTHREAD_PRIO_NONE, ++ mutexAttrPrioceiling: 0, ++ mutexAttrType: PTHREAD_MUTEX_DEFAULT, ++ mutexAttrPshared: 1, ++ }; ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ mutexSemId: null_mut(), ++ mutexValid: PTHREAD_VALID_OBJ, ++ mutexInitted: PTHREAD_UNUSED_YET_OBJ, ++ mutexCondRefCount: 0, ++ mutexSavPriority: -1, ++ mutexAttr: PTHREAD_MUTEXATTR_INITIALIZER, ++ mutexSemName: [0; _PTHREAD_SHARED_SEM_NAME_MAX], ++}; ++ ++const PTHREAD_CONDATTR_INITIALIZER: pthread_condattr_t = pthread_condattr_t { ++ condAttrStatus: 0xf70990ef, ++ condAttrPshared: 1, ++ condAttrClockId: CLOCK_REALTIME, ++}; ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { ++ condSemId: null_mut(), ++ condValid: PTHREAD_VALID_OBJ, ++ condInitted: PTHREAD_UNUSED_YET_OBJ, ++ condRefCount: 0, ++ condMutex: null_mut(), ++ condAttr: PTHREAD_CONDATTR_INITIALIZER, ++ condSemName: [0; _PTHREAD_SHARED_SEM_NAME_MAX], ++}; ++ ++const PTHREAD_RWLOCKATTR_INITIALIZER: pthread_rwlockattr_t = ++ pthread_rwlockattr_t { ++ rwlockAttrStatus: PTHREAD_INITIALIZED_OBJ, ++ rwlockAttrPshared: 1, ++ rwlockAttrMaxReaders: 0, ++ rwlockAttrConformOpt: 1, ++ }; ++pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { ++ rwlockSemId: null_mut(), ++ rwlockReadersRefCount: 0, ++ rwlockValid: PTHREAD_VALID_OBJ, ++ rwlockInitted: PTHREAD_UNUSED_YET_OBJ, ++ rwlockAttr: PTHREAD_RWLOCKATTR_INITIALIZER, ++ rwlockSemName: [0; _PTHREAD_SHARED_SEM_NAME_MAX], ++}; ++ ++pub const SEEK_SET: ::c_int = 0; ++pub const SEEK_CUR: ::c_int = 1; ++pub const SEEK_END: ::c_int = 2; ++ ++// rtpLibCommon.h ++pub const VX_RTP_NAME_LENGTH: ::c_int = 255; ++pub const RTP_ID_ERROR: ::RTP_ID = -1; ++ ++// h/public/unistd.h ++pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 21; // Via unistd.h ++pub const _SC_PAGESIZE: ::c_int = 39; ++pub const O_ACCMODE: ::c_int = 3; ++pub const O_CLOEXEC: ::c_int = 0x100000; // fcntlcom ++pub const O_EXCL: ::c_int = 0x0800; ++pub const O_CREAT: ::c_int = 0x0200; ++pub const O_TRUNC: ::c_int = 0x0400; ++pub const O_APPEND: ::c_int = 0x0008; ++pub const O_RDWR: ::c_int = 0x0002; ++pub const O_WRONLY: ::c_int = 0x0001; ++pub const O_RDONLY: ::c_int = 0; ++pub const O_NONBLOCK: ::c_int = 0x4000; ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum FILE {} ++impl ::Copy for FILE {} ++impl ::Clone for FILE { ++ fn clone(&self) -> FILE { ++ *self ++ } ++} ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum fpos_t {} // FIXME: fill this out with a struct ++impl ::Copy for fpos_t {} ++impl ::Clone for fpos_t { ++ fn clone(&self) -> fpos_t { ++ *self ++ } ++} ++ ++f! { ++ pub fn CMSG_ALIGN(len: usize) -> usize { ++ len + ::mem::size_of::() - 1 & !(::mem::size_of::() - 1) ++ } ++ ++ pub fn CMSG_NXTHDR(mhdr: *const msghdr, ++ cmsg: *const cmsghdr) -> *mut cmsghdr { ++ let next = cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize) ++ + CMSG_ALIGN(::mem::size_of::<::cmsghdr>()); ++ let max = (*mhdr).msg_control as usize ++ + (*mhdr).msg_controllen as usize; ++ if next <= max { ++ (cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize)) ++ as *mut ::cmsghdr ++ } else { ++ 0 as *mut ::cmsghdr ++ } ++ } ++ ++ pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { ++ if (*mhdr).msg_controllen as usize > 0 { ++ (*mhdr).msg_control as *mut cmsghdr ++ } else { ++ 0 as *mut cmsghdr ++ } ++ } ++ ++ pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut ::c_uchar { ++ (cmsg as *mut ::c_uchar) ++ .offset(CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize) ++ } ++ ++ pub fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { ++ (CMSG_ALIGN(length as usize) + CMSG_ALIGN(::mem::size_of::())) ++ as ::c_uint ++ } ++ ++ pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { ++ CMSG_ALIGN(::mem::size_of::()) as ::c_uint + length ++ } ++} ++ ++extern "C" { ++ pub fn isalnum(c: c_int) -> c_int; ++ pub fn isalpha(c: c_int) -> c_int; ++ pub fn iscntrl(c: c_int) -> c_int; ++ pub fn isdigit(c: c_int) -> c_int; ++ pub fn isgraph(c: c_int) -> c_int; ++ pub fn islower(c: c_int) -> c_int; ++ pub fn isprint(c: c_int) -> c_int; ++ pub fn ispunct(c: c_int) -> c_int; ++ pub fn isspace(c: c_int) -> c_int; ++ pub fn isupper(c: c_int) -> c_int; ++ pub fn isxdigit(c: c_int) -> c_int; ++ pub fn isblank(c: c_int) -> c_int; ++ pub fn tolower(c: c_int) -> c_int; ++ pub fn toupper(c: c_int) -> c_int; ++ pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE; ++ pub fn freopen( ++ filename: *const c_char, ++ mode: *const c_char, ++ file: *mut FILE, ++ ) -> *mut FILE; ++ pub fn fflush(file: *mut FILE) -> c_int; ++ pub fn fclose(file: *mut FILE) -> c_int; ++ pub fn remove(filename: *const c_char) -> c_int; ++ pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int; ++ pub fn tmpfile() -> *mut FILE; ++ pub fn setvbuf( ++ stream: *mut FILE, ++ buffer: *mut c_char, ++ mode: c_int, ++ size: size_t, ++ ) -> c_int; ++ pub fn setbuf(stream: *mut FILE, buf: *mut c_char); ++ pub fn getchar() -> c_int; ++ pub fn putchar(c: c_int) -> c_int; ++ pub fn fgetc(stream: *mut FILE) -> c_int; ++ pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) ++ -> *mut c_char; ++ pub fn fputc(c: c_int, stream: *mut FILE) -> c_int; ++ pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int; ++ pub fn puts(s: *const c_char) -> c_int; ++ pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int; ++ pub fn fread( ++ ptr: *mut c_void, ++ size: size_t, ++ nobj: size_t, ++ stream: *mut FILE, ++ ) -> size_t; ++ pub fn fwrite( ++ ptr: *const c_void, ++ size: size_t, ++ nobj: size_t, ++ stream: *mut FILE, ++ ) -> size_t; ++ pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int; ++ pub fn ftell(stream: *mut FILE) -> c_long; ++ pub fn rewind(stream: *mut FILE); ++ pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int; ++ pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int; ++ pub fn feof(stream: *mut FILE) -> c_int; ++ pub fn ferror(stream: *mut FILE) -> c_int; ++ pub fn perror(s: *const c_char); ++ pub fn atoi(s: *const c_char) -> c_int; ++ pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double; ++ pub fn strtol( ++ s: *const c_char, ++ endp: *mut *mut c_char, ++ base: c_int, ++ ) -> c_long; ++ pub fn strtoul( ++ s: *const c_char, ++ endp: *mut *mut c_char, ++ base: c_int, ++ ) -> c_ulong; ++ pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void; ++ pub fn malloc(size: size_t) -> *mut c_void; ++ pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void; ++ pub fn free(p: *mut c_void); ++ pub fn abort() -> !; ++ pub fn exit(status: c_int) -> !; ++ pub fn atexit(cb: extern "C" fn()) -> c_int; ++ pub fn system(s: *const c_char) -> c_int; ++ pub fn getenv(s: *const c_char) -> *mut c_char; ++ ++ pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char; ++ pub fn strncpy( ++ dst: *mut c_char, ++ src: *const c_char, ++ n: size_t, ++ ) -> *mut c_char; ++ pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char; ++ pub fn strncat( ++ s: *mut c_char, ++ ct: *const c_char, ++ n: size_t, ++ ) -> *mut c_char; ++ pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int; ++ pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int; ++ pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int; ++ pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char; ++ pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char; ++ pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t; ++ pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t; ++ pub fn strdup(cs: *const c_char) -> *mut c_char; ++ pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char; ++ pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char; ++ pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int; ++ pub fn strncasecmp( ++ s1: *const c_char, ++ s2: *const c_char, ++ n: size_t, ++ ) -> c_int; ++ pub fn strlen(cs: *const c_char) -> size_t; ++ pub fn strerror(n: c_int) -> *mut c_char; ++ pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; ++ pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; ++ pub fn wcslen(buf: *const wchar_t) -> size_t; ++ pub fn wcstombs( ++ dest: *mut c_char, ++ src: *const wchar_t, ++ n: size_t, ++ ) -> ::size_t; ++ ++ pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; ++ pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t; ++ pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int; ++ pub fn memcpy( ++ dest: *mut c_void, ++ src: *const c_void, ++ n: size_t, ++ ) -> *mut c_void; ++ pub fn memmove( ++ dest: *mut c_void, ++ src: *const c_void, ++ n: size_t, ++ ) -> *mut c_void; ++ pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void; ++} ++ ++extern "C" { ++ pub fn fprintf( ++ stream: *mut ::FILE, ++ 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; ++ pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int; ++ pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE; ++ pub fn fileno(stream: *mut ::FILE) -> ::c_int; ++ pub fn creat(path: *const c_char, mode: mode_t) -> ::c_int; ++ pub fn rewinddir(dirp: *mut ::DIR); ++ pub fn fchown(fd: ::c_int, owner: ::uid_t, group: ::gid_t) -> ::c_int; ++ pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int; ++ pub fn alarm(seconds: ::c_uint) -> ::c_uint; ++ pub fn fchdir(dirfd: ::c_int) -> ::c_int; ++ pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int; ++ pub fn fpathconf(filedes: ::c_int, name: ::c_int) -> c_long; ++ pub fn getegid() -> gid_t; ++ pub fn geteuid() -> uid_t; ++ pub fn getgroups(ngroups_max: ::c_int, groups: *mut gid_t) -> ::c_int; ++ pub fn getlogin() -> *mut c_char; ++ pub fn getopt( ++ argc: ::c_int, ++ argv: *const *mut c_char, ++ optstr: *const c_char, ++ ) -> ::c_int; ++ pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long; ++ pub fn pause() -> ::c_int; ++ pub fn seteuid(uid: uid_t) -> ::c_int; ++ pub fn setegid(gid: gid_t) -> ::c_int; ++ pub fn sleep(secs: ::c_uint) -> ::c_uint; ++ pub fn ttyname(fd: ::c_int) -> *mut c_char; ++ pub fn wait(status: *mut ::c_int) -> pid_t; ++ pub fn umask(mask: mode_t) -> mode_t; ++ pub fn mlock(addr: *const ::c_void, len: ::size_t) -> ::c_int; ++ pub fn mlockall(flags: ::c_int) -> ::c_int; ++ pub fn munlockall() -> ::c_int; ++ ++ pub fn mmap( ++ addr: *mut ::c_void, ++ len: ::size_t, ++ prot: ::c_int, ++ flags: ::c_int, ++ fd: ::c_int, ++ offset: off_t, ++ ) -> *mut ::c_void; ++ pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int; ++ pub fn truncate(path: *const c_char, length: off_t) -> ::c_int; ++ ++ pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; ++ pub fn pthread_exit(value: *mut ::c_void) -> !; ++ pub fn pthread_attr_setdetachstate( ++ attr: *mut ::pthread_attr_t, ++ state: ::c_int, ++ ) -> ::c_int; ++ ++ pub fn strerror_r( ++ errnum: ::c_int, ++ buf: *mut c_char, ++ buflen: ::size_t, ++ ) -> ::c_int; ++ ++ pub fn sigaction( ++ signum: ::c_int, ++ act: *const sigaction, ++ oldact: *mut sigaction, ++ ) -> ::c_int; ++ ++ pub fn utimes( ++ filename: *const ::c_char, ++ times: *const ::timeval, ++ ) -> ::c_int; ++ ++ #[link_name = "_rtld_dlopen"] ++ pub fn dlopen(filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void; ++ ++ #[link_name = "_rtld_dlerror"] ++ pub fn dlerror() -> *mut ::c_char; ++ ++ #[link_name = "_rtld_dlsym"] ++ pub fn dlsym( ++ handle: *mut ::c_void, ++ symbol: *const ::c_char, ++ ) -> *mut ::c_void; ++ ++ #[link_name = "_rtld_dlclose"] ++ pub fn dlclose(handle: *mut ::c_void) -> ::c_int; ++ ++ #[link_name = "_rtld_dladdr"] ++ pub fn dladdr(addr: *mut ::c_void, info: *mut Dl_info) -> ::c_int; ++ ++ // time.h ++ pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; ++ pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; ++ pub fn mktime(tm: *mut tm) -> time_t; ++ pub fn time(time: *mut time_t) -> time_t; ++ pub fn gmtime(time_p: *const time_t) -> *mut tm; ++ pub fn localtime(time_p: *const time_t) -> *mut tm; ++ pub fn timegm(tm: *mut tm) -> time_t; ++ pub fn difftime(time1: time_t, time0: time_t) -> ::c_double; ++ pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int; ++ pub fn usleep(secs: ::useconds_t) -> ::c_int; ++ pub fn putenv(string: *mut c_char) -> ::c_int; ++ pub fn setlocale( ++ category: ::c_int, ++ locale: *const ::c_char, ++ ) -> *mut ::c_char; ++ ++ pub fn sigprocmask( ++ how: ::c_int, ++ set: *const sigset_t, ++ oldset: *mut sigset_t, ++ ) -> ::c_int; ++ pub fn sigpending(set: *mut sigset_t) -> ::c_int; ++ ++ pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int; ++ ++ pub fn fseeko( ++ stream: *mut ::FILE, ++ offset: ::off_t, ++ whence: ::c_int, ++ ) -> ::c_int; ++ pub fn ftello(stream: *mut ::FILE) -> ::off_t; ++ pub fn mkstemp(template: *mut ::c_char) -> ::c_int; ++ ++ pub fn tmpnam(ptr: *mut ::c_char) -> *mut ::c_char; ++ ++ 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, ...); ++ pub fn getline( ++ lineptr: *mut *mut c_char, ++ n: *mut size_t, ++ stream: *mut FILE, ++ ) -> ssize_t; ++ ++} ++ ++extern "C" { ++ // stdlib.h ++ pub fn memalign(block_size: ::size_t, size_arg: ::size_t) ++ -> *mut ::c_void; ++ ++ // ioLib.h ++ pub fn getcwd(buf: *mut ::c_char, size: ::size_t) -> *mut ::c_char; ++ ++ // ioLib.h ++ pub fn chdir(attr: *const ::c_char) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_mutexattr_destroy( ++ attr: *mut pthread_mutexattr_t, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_mutexattr_settype( ++ pAttr: *mut ::pthread_mutexattr_t, ++ pType: ::c_int, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_mutex_init( ++ mutex: *mut pthread_mutex_t, ++ attr: *const pthread_mutexattr_t, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_mutex_destroy(mutex: *mut pthread_mutex_t) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_mutex_lock(mutex: *mut pthread_mutex_t) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_mutex_trylock(mutex: *mut pthread_mutex_t) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_mutex_timedlock( ++ attr: *mut pthread_mutex_t, ++ spec: *const timespec, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_mutex_unlock(mutex: *mut pthread_mutex_t) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_attr_setname( ++ pAttr: *mut ::pthread_attr_t, ++ name: *mut ::c_char, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_attr_setstacksize( ++ attr: *mut ::pthread_attr_t, ++ stacksize: ::size_t, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_attr_getstacksize( ++ attr: *const ::pthread_attr_t, ++ size: *mut ::size_t, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_create( ++ pThread: *mut ::pthread_t, ++ pAttr: *const ::pthread_attr_t, ++ start_routine: extern "C" fn(*mut ::c_void) -> *mut ::c_void, ++ value: *mut ::c_void, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_attr_destroy(thread: *mut ::pthread_attr_t) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_detach(thread: ::pthread_t) -> ::c_int; ++ ++ // int pthread_atfork (void (*)(void), void (*)(void), void (*)(void)); ++ pub fn pthread_atfork( ++ prepare: ::Option, ++ parent: ::Option, ++ child: ::Option, ++ ) -> ::c_int; ++ // stat.h ++ pub fn fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int; ++ ++ // stat.h ++ pub fn lstat(path: *const ::c_char, buf: *mut stat) -> ::c_int; ++ ++ // unistd.h ++ pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int; ++ ++ // dirent.h ++ pub fn readdir_r( ++ pDir: *mut ::DIR, ++ entry: *mut ::dirent, ++ result: *mut *mut ::dirent, ++ ) -> ::c_int; ++ ++ // dirent.h ++ pub fn readdir(pDir: *mut ::DIR) -> *mut ::dirent; ++ ++ // fcntl.h or ++ // ioLib.h ++ pub fn open(path: *const ::c_char, oflag: ::c_int, ...) -> ::c_int; ++ ++ // poll.h ++ pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_condattr_init(attr: *mut ::pthread_condattr_t) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_condattr_destroy( ++ attr: *mut ::pthread_condattr_t, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_condattr_getclock( ++ pAttr: *const ::pthread_condattr_t, ++ pClockId: *mut ::clockid_t, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_condattr_setclock( ++ pAttr: *mut ::pthread_condattr_t, ++ clockId: ::clockid_t, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_cond_init( ++ cond: *mut ::pthread_cond_t, ++ attr: *const ::pthread_condattr_t, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_cond_signal(cond: *mut ::pthread_cond_t) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_cond_broadcast(cond: *mut ::pthread_cond_t) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_cond_wait( ++ cond: *mut ::pthread_cond_t, ++ mutex: *mut ::pthread_mutex_t, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlockattr_init( ++ attr: *mut ::pthread_rwlockattr_t, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlockattr_destroy( ++ attr: *mut ::pthread_rwlockattr_t, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlockattr_setmaxreaders( ++ attr: *mut ::pthread_rwlockattr_t, ++ attr2: ::c_uint, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlock_init( ++ attr: *mut ::pthread_rwlock_t, ++ host: *const ::pthread_rwlockattr_t, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlock_destroy(attr: *mut ::pthread_rwlock_t) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlock_rdlock(attr: *mut ::pthread_rwlock_t) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlock_tryrdlock(attr: *mut ::pthread_rwlock_t) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlock_timedrdlock( ++ attr: *mut ::pthread_rwlock_t, ++ host: *const ::timespec, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlock_wrlock(attr: *mut ::pthread_rwlock_t) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlock_trywrlock(attr: *mut ::pthread_rwlock_t) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlock_timedwrlock( ++ attr: *mut ::pthread_rwlock_t, ++ host: *const ::timespec, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlock_unlock(attr: *mut ::pthread_rwlock_t) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_key_create( ++ key: *mut ::pthread_key_t, ++ dtor: ::Option, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_key_delete(key: ::pthread_key_t) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_setspecific( ++ key: ::pthread_key_t, ++ value: *const ::c_void, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_getspecific(key: ::pthread_key_t) -> *mut ::c_void; ++ ++ // pthread.h ++ pub fn pthread_cond_timedwait( ++ cond: *mut ::pthread_cond_t, ++ mutex: *mut ::pthread_mutex_t, ++ abstime: *const ::timespec, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_attr_getname( ++ attr: *mut ::pthread_attr_t, ++ name: *mut *mut ::c_char, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_join( ++ thread: ::pthread_t, ++ status: *mut *mut ::c_void, ++ ) -> ::c_int; ++ ++ // pthread.h ++ pub fn pthread_self() -> ::pthread_t; ++ ++ // clockLib.h ++ pub fn clock_gettime( ++ clock_id: ::clockid_t, ++ tp: *mut ::timespec, ++ ) -> ::c_int; ++ ++ // clockLib.h ++ pub fn clock_settime( ++ clock_id: ::clockid_t, ++ tp: *const ::timespec, ++ ) -> ::c_int; ++ ++ // clockLib.h ++ pub fn clock_getres( ++ clock_id: ::clockid_t, ++ res: *mut ::timespec, ++ ) -> ::c_int; ++ ++ // clockLib.h ++ pub fn clock_nanosleep( ++ clock_id: ::clockid_t, ++ flags: ::c_int, ++ rqtp: *const ::timespec, ++ rmtp: *mut ::timespec, ++ ) -> ::c_int; ++ ++ // timerLib.h ++ pub fn nanosleep( ++ rqtp: *const ::timespec, ++ rmtp: *mut ::timespec, ++ ) -> ::c_int; ++ ++ // socket.h ++ pub fn accept( ++ s: ::c_int, ++ addr: *mut ::sockaddr, ++ addrlen: *mut ::socklen_t, ++ ) -> ::c_int; ++ ++ // socket.h ++ pub fn bind(fd: ::c_int, addr: *const sockaddr, len: socklen_t) ++ -> ::c_int; ++ ++ // socket.h ++ pub fn connect( ++ s: ::c_int, ++ name: *const ::sockaddr, ++ namelen: ::socklen_t, ++ ) -> ::c_int; ++ ++ // socket.h ++ pub fn getpeername( ++ s: ::c_int, ++ name: *mut ::sockaddr, ++ namelen: *mut ::socklen_t, ++ ) -> ::c_int; ++ ++ // socket.h ++ pub fn getsockname( ++ socket: ::c_int, ++ address: *mut sockaddr, ++ address_len: *mut socklen_t, ++ ) -> ::c_int; ++ ++ // socket.h ++ pub fn getsockopt( ++ sockfd: ::c_int, ++ level: ::c_int, ++ optname: ::c_int, ++ optval: *mut ::c_void, ++ optlen: *mut ::socklen_t, ++ ) -> ::c_int; ++ ++ // socket.h ++ pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int; ++ ++ // socket.h ++ pub fn recv( ++ s: ::c_int, ++ buf: *mut ::c_void, ++ bufLen: ::size_t, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ ++ // socket.h ++ pub fn recvfrom( ++ s: ::c_int, ++ buf: *mut ::c_void, ++ bufLen: ::size_t, ++ flags: ::c_int, ++ from: *mut ::sockaddr, ++ pFromLen: *mut ::socklen_t, ++ ) -> ::ssize_t; ++ ++ pub fn recvmsg( ++ socket: ::c_int, ++ mp: *mut ::msghdr, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ ++ // socket.h ++ pub fn send( ++ socket: ::c_int, ++ buf: *const ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ ++ pub fn sendmsg( ++ socket: ::c_int, ++ mp: *const ::msghdr, ++ flags: ::c_int, ++ ) -> ::ssize_t; ++ ++ // socket.h ++ pub fn sendto( ++ socket: ::c_int, ++ buf: *const ::c_void, ++ len: ::size_t, ++ flags: ::c_int, ++ addr: *const sockaddr, ++ addrlen: socklen_t, ++ ) -> ::ssize_t; ++ ++ // socket.h ++ pub fn setsockopt( ++ socket: ::c_int, ++ level: ::c_int, ++ name: ::c_int, ++ value: *const ::c_void, ++ option_len: socklen_t, ++ ) -> ::c_int; ++ ++ // socket.h ++ pub fn shutdown(s: ::c_int, how: ::c_int) -> ::c_int; ++ ++ // socket.h ++ pub fn socket( ++ domain: ::c_int, ++ _type: ::c_int, ++ protocol: ::c_int, ++ ) -> ::c_int; ++ ++ // icotl.h ++ pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; ++ ++ // fcntl.h ++ pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int; ++ ++ // ntp_rfc2553.h for kernel ++ // netdb.h for user ++ pub fn gai_strerror(errcode: ::c_int) -> *mut ::c_char; ++ ++ // ioLib.h or ++ // unistd.h ++ pub fn close(fd: ::c_int) -> ::c_int; ++ ++ // ioLib.h or ++ // unistd.h ++ pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) ++ -> ::ssize_t; ++ ++ // ioLib.h or ++ // unistd.h ++ pub fn write( ++ fd: ::c_int, ++ buf: *const ::c_void, ++ count: ::size_t, ++ ) -> ::ssize_t; ++ ++ // ioLib.h or ++ // unistd.h ++ pub fn isatty(fd: ::c_int) -> ::c_int; ++ ++ // ioLib.h or ++ // unistd.h ++ pub fn dup(src: ::c_int) -> ::c_int; ++ ++ // ioLib.h or ++ // unistd.h ++ pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int; ++ ++ // ioLib.h or ++ // unistd.h ++ pub fn pipe(fds: *mut ::c_int) -> ::c_int; ++ ++ // ioLib.h or ++ // unistd.h ++ pub fn unlink(pathname: *const ::c_char) -> ::c_int; ++ ++ // unistd.h and ++ // ioLib.h ++ pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t; ++ ++ // netdb.h ++ pub fn getaddrinfo( ++ node: *const ::c_char, ++ service: *const ::c_char, ++ hints: *const addrinfo, ++ res: *mut *mut addrinfo, ++ ) -> ::c_int; ++ ++ // netdb.h ++ pub fn freeaddrinfo(res: *mut addrinfo); ++ ++ // signal.h ++ pub fn signal(signum: ::c_int, handler: sighandler_t) -> sighandler_t; ++ ++ // unistd.h ++ pub fn getpid() -> pid_t; ++ ++ // unistd.h ++ pub fn getppid() -> pid_t; ++ ++ // wait.h ++ pub fn waitpid(pid: pid_t, status: *mut ::c_int, optons: ::c_int) ++ -> pid_t; ++ ++ // unistd.h ++ pub fn sysconf(attr: ::c_int) -> ::c_long; ++ ++ // stdlib.h ++ pub fn setenv( ++ // setenv.c ++ envVarName: *const ::c_char, ++ envVarValue: *const ::c_char, ++ overwrite: ::c_int, ++ ) -> ::c_int; ++ ++ // stdlib.h ++ pub fn unsetenv( ++ // setenv.c ++ envVarName: *const ::c_char, ++ ) -> ::c_int; ++ ++ // stdlib.h ++ pub fn realpath( ++ fileName: *const ::c_char, ++ resolvedName: *mut ::c_char, ++ ) -> *mut ::c_char; ++ ++ // unistd.h ++ pub fn link(src: *const ::c_char, dst: *const ::c_char) -> ::c_int; ++ ++ // unistd.h ++ pub fn readlink( ++ path: *const ::c_char, ++ buf: *mut ::c_char, ++ bufsize: ::size_t, ++ ) -> ::ssize_t; ++ ++ // unistd.h ++ pub fn symlink(path1: *const ::c_char, path2: *const ::c_char) -> ::c_int; ++ ++ // dirent.h ++ pub fn opendir(name: *const ::c_char) -> *mut ::DIR; ++ ++ // unistd.h ++ pub fn rmdir(path: *const ::c_char) -> ::c_int; ++ ++ // stat.h ++ pub fn mkdir(dirName: *const ::c_char, mode: ::mode_t) -> ::c_int; ++ ++ // stat.h ++ pub fn chmod(path: *const ::c_char, mode: ::mode_t) -> ::c_int; ++ ++ // stat.h ++ pub fn fchmod(attr1: ::c_int, attr2: ::mode_t) -> ::c_int; ++ ++ // unistd.h ++ pub fn fsync(fd: ::c_int) -> ::c_int; ++ ++ // dirent.h ++ pub fn closedir(ptr: *mut ::DIR) -> ::c_int; ++ ++ // sched.h ++ pub fn sched_yield() -> ::c_int; ++ ++ // errnoLib.h ++ pub fn errnoSet(err: ::c_int) -> ::c_int; ++ ++ // errnoLib.h ++ pub fn errnoGet() -> ::c_int; ++ ++ // unistd.h ++ pub fn _exit(status: ::c_int) -> !; ++ ++ // unistd.h ++ pub fn setgid(gid: ::gid_t) -> ::c_int; ++ ++ // unistd.h ++ pub fn getgid() -> ::gid_t; ++ ++ // unistd.h ++ pub fn setuid(uid: ::uid_t) -> ::c_int; ++ ++ // unistd.h ++ pub fn getuid() -> ::uid_t; ++ ++ // signal.h ++ pub fn sigemptyset(__set: *mut sigset_t) -> ::c_int; ++ ++ // pthread.h for kernel ++ // signal.h for user ++ pub fn pthread_sigmask( ++ __how: ::c_int, ++ __set: *const sigset_t, ++ __oset: *mut sigset_t, ++ ) -> ::c_int; ++ ++ // signal.h for user ++ pub fn kill(__pid: pid_t, __signo: ::c_int) -> ::c_int; ++ ++ // signal.h for user ++ pub fn sigqueue( ++ __pid: pid_t, ++ __signo: ::c_int, ++ __value: ::sigval, ++ ) -> ::c_int; ++ ++ // signal.h for user ++ pub fn _sigqueue( ++ rtpId: ::RTP_ID, ++ signo: ::c_int, ++ pValue: *const ::sigval, ++ sigCode: ::c_int, ++ ) -> ::c_int; ++ ++ // signal.h ++ pub fn taskKill(taskId: ::TASK_ID, signo: ::c_int) -> ::c_int; ++ ++ // signal.h ++ pub fn raise(__signo: ::c_int) -> ::c_int; ++ ++ // taskLibCommon.h ++ pub fn taskIdSelf() -> ::TASK_ID; ++ pub fn taskDelay(ticks: ::_Vx_ticks_t) -> ::c_int; ++ ++ // rtpLibCommon.h ++ pub fn rtpInfoGet(rtpId: ::RTP_ID, rtpStruct: *mut ::RTP_DESC) -> ::c_int; ++ pub fn rtpSpawn( ++ pubrtpFileName: *const ::c_char, ++ argv: *mut *const ::c_char, ++ envp: *mut *const ::c_char, ++ priority: ::c_int, ++ uStackSize: ::size_t, ++ options: ::c_int, ++ taskOptions: ::c_int, ++ ) -> RTP_ID; ++ ++ // ioLib.h ++ pub fn _realpath( ++ fileName: *const ::c_char, ++ resolvedName: *mut ::c_char, ++ ) -> *mut ::c_char; ++ ++ // pathLib.h ++ pub fn _pathIsAbsolute( ++ filepath: *const ::c_char, ++ pNameTail: *mut *const ::c_char, ++ ) -> BOOL; ++ ++ pub fn writev( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ ) -> ::ssize_t; ++ pub fn readv( ++ fd: ::c_int, ++ iov: *const ::iovec, ++ iovcnt: ::c_int, ++ ) -> ::ssize_t; ++ ++ // randomNumGen.h ++ pub fn randBytes(buf: *mut c_uchar, length: c_int) -> c_int; ++ pub fn randABytes(buf: *mut c_uchar, length: c_int) -> c_int; ++ pub fn randUBytes(buf: *mut c_uchar, length: c_int) -> c_int; ++ pub fn randSecure() -> c_int; ++ ++ // mqueue.h ++ pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t; ++ pub fn mq_close(mqd: ::mqd_t) -> ::c_int; ++ pub fn mq_unlink(name: *const ::c_char) -> ::c_int; ++ pub fn mq_receive( ++ mqd: ::mqd_t, ++ msg_ptr: *mut ::c_char, ++ msg_len: ::size_t, ++ msg_prio: *mut ::c_uint, ++ ) -> ::ssize_t; ++ pub fn mq_timedreceive( ++ mqd: ::mqd_t, ++ msg_ptr: *mut ::c_char, ++ msg_len: ::size_t, ++ msg_prio: *mut ::c_uint, ++ abs_timeout: *const ::timespec, ++ ) -> ::ssize_t; ++ pub fn mq_send( ++ mqd: ::mqd_t, ++ msg_ptr: *const ::c_char, ++ msg_len: ::size_t, ++ msg_prio: ::c_uint, ++ ) -> ::c_int; ++ pub fn mq_timedsend( ++ mqd: ::mqd_t, ++ msg_ptr: *const ::c_char, ++ msg_len: ::size_t, ++ msg_prio: ::c_uint, ++ abs_timeout: *const ::timespec, ++ ) -> ::c_int; ++ pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int; ++ pub fn mq_setattr( ++ mqd: ::mqd_t, ++ newattr: *const ::mq_attr, ++ oldattr: *mut ::mq_attr, ++ ) -> ::c_int; ++} ++ ++//Dummy functions, these don't really exist in VxWorks. ++ ++// wait.h macros ++pub fn WIFEXITED(status: ::c_int) -> bool { ++ (status & 0xFF00) == 0 ++} ++pub fn WIFSIGNALED(status: ::c_int) -> bool { ++ (status & 0xFF00) != 0 ++} ++pub fn WIFSTOPPED(status: ::c_int) -> bool { ++ (status & 0xFF0000) != 0 ++} ++pub fn WEXITSTATUS(status: ::c_int) -> ::c_int { ++ status & 0xFF ++} ++pub fn WTERMSIG(status: ::c_int) -> ::c_int { ++ (status >> 8) & 0xFF ++} ++pub fn WSTOPSIG(status: ::c_int) -> ::c_int { ++ (status >> 16) & 0xFF ++} ++ ++pub fn pread( ++ _fd: ::c_int, ++ _buf: *mut ::c_void, ++ _count: ::size_t, ++ _offset: off64_t, ++) -> ::ssize_t { ++ -1 ++} ++ ++pub fn pwrite( ++ _fd: ::c_int, ++ _buf: *const ::c_void, ++ _count: ::size_t, ++ _offset: off64_t, ++) -> ::ssize_t { ++ -1 ++} ++pub fn posix_memalign( ++ memptr: *mut *mut ::c_void, ++ align: ::size_t, ++ size: ::size_t, ++) -> ::c_int { ++ // check to see if align is a power of 2 and if align is a multiple ++ // of sizeof(void *) ++ if (align & align - 1 != 0) ++ || (align as usize % size_of::<::size_t>() != 0) ++ { ++ return ::EINVAL; ++ } ++ ++ unsafe { ++ // posix_memalign should not set errno ++ let e = ::errnoGet(); ++ ++ let temp = memalign(align, size); ++ ::errnoSet(e as ::c_int); ++ ++ if temp.is_null() { ++ ::ENOMEM ++ } else { ++ *memptr = temp; ++ 0 ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(libc_core_cvoid)] { ++ pub use ::ffi::c_void; ++ } else { ++ // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help ++ // enable more optimization opportunities around it recognizing things ++ // like malloc/free. ++ #[repr(u8)] ++ #[allow(missing_copy_implementations)] ++ #[allow(missing_debug_implementations)] ++ pub enum c_void { ++ // Two dummy variants so the #[repr] attribute can be used. ++ #[doc(hidden)] ++ __variant1, ++ #[doc(hidden)] ++ __variant2, ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "aarch64")] { ++ mod aarch64; ++ pub use self::aarch64::*; ++ } else if #[cfg(any(target_arch = "arm"))] { ++ mod arm; ++ pub use self::arm::*; ++ } else if #[cfg(any(target_arch = "x86"))] { ++ mod x86; ++ pub use self::x86::*; ++ } else if #[cfg(any(target_arch = "x86_64"))] { ++ mod x86_64; ++ pub use self::x86_64::*; ++ } else if #[cfg(any(target_arch = "powerpc"))] { ++ mod powerpc; ++ pub use self::powerpc::*; ++ } else if #[cfg(any(target_arch = "powerpc64"))] { ++ mod powerpc64; ++ pub use self::powerpc64::*; ++ } else { ++ // Unknown target_arch ++ } ++} +diff --git a/third_party/rust/libc/src/vxworks/powerpc.rs b/third_party/rust/libc/src/vxworks/powerpc.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..55240068aa08eb7992d9adc49739f44679207b8b +--- /dev/null ++++ b/third_party/rust/libc/src/vxworks/powerpc.rs +@@ -0,0 +1,4 @@ ++pub type c_char = u8; ++pub type wchar_t = u32; ++pub type c_long = i32; ++pub type c_ulong = u32; +diff --git a/third_party/rust/libc/src/vxworks/powerpc64.rs b/third_party/rust/libc/src/vxworks/powerpc64.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..4032488b6c0d5b1128fad52fabe5faaf80add3c4 +--- /dev/null ++++ b/third_party/rust/libc/src/vxworks/powerpc64.rs +@@ -0,0 +1,4 @@ ++pub type c_char = u8; ++pub type wchar_t = u32; ++pub type c_long = i64; ++pub type c_ulong = u64; +diff --git a/third_party/rust/libc/src/vxworks/x86.rs b/third_party/rust/libc/src/vxworks/x86.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..e617bb83c6ce342761d36dade9d591486f264521 +--- /dev/null ++++ b/third_party/rust/libc/src/vxworks/x86.rs +@@ -0,0 +1,4 @@ ++pub type c_char = i8; ++pub type wchar_t = i32; ++pub type c_long = i32; ++pub type c_ulong = u32; +diff --git a/third_party/rust/libc/src/vxworks/x86_64.rs b/third_party/rust/libc/src/vxworks/x86_64.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..5e95ea2567ddfe80fd88feb2aaecf70697f06d99 +--- /dev/null ++++ b/third_party/rust/libc/src/vxworks/x86_64.rs +@@ -0,0 +1,4 @@ ++pub type c_char = i8; ++pub type wchar_t = i32; ++pub type c_long = i64; ++pub type c_ulong = u64; +diff --git a/third_party/rust/libc/src/wasi.rs b/third_party/rust/libc/src/wasi.rs +index e1ffeded9f6d6f4f90ae05b6b0c7072ad8e8543c..6a268586947137fecc7de58036bd912fe9faece1 100644 +--- a/third_party/rust/libc/src/wasi.rs ++++ b/third_party/rust/libc/src/wasi.rs +@@ -36,35 +36,7 @@ pub type blksize_t = c_long; + pub type blkcnt_t = i64; + pub type nfds_t = c_ulong; + +-pub type __wasi_advice_t = u8; +-pub type __wasi_clockid_t = u32; +-pub type __wasi_device_t = u64; +-pub type __wasi_dircookie_t = u64; +-pub type __wasi_errno_t = u16; +-pub type __wasi_eventrwflags_t = u16; +-pub type __wasi_eventtype_t = u8; +-pub type __wasi_exitcode_t = u32; +-pub type __wasi_fd_t = u32; +-pub type __wasi_fdflags_t = u16; +-pub type __wasi_filedelta_t = i64; +-pub type __wasi_filesize_t = u64; +-pub type __wasi_filetype_t = u8; +-pub type __wasi_fstflags_t = u16; +-pub type __wasi_inode_t = u64; +-pub type __wasi_linkcount_t = u32; +-pub type __wasi_lookupflags_t = u32; +-pub type __wasi_oflags_t = u16; +-pub type __wasi_riflags_t = u16; + pub type __wasi_rights_t = u64; +-pub type __wasi_roflags_t = u16; +-pub type __wasi_sdflags_t = u8; +-pub type __wasi_siflags_t = u16; +-pub type __wasi_signal_t = u8; +-pub type __wasi_subclockflags_t = u16; +-pub type __wasi_timestamp_t = u64; +-pub type __wasi_userdata_t = u64; +-pub type __wasi_whence_t = u8; +-pub type __wasi_preopentype_t = u8; + + #[allow(missing_copy_implementations)] + #[cfg_attr(feature = "extra_traits", derive(Debug))] +@@ -181,105 +153,6 @@ s! { + pub st_ctim: timespec, + __reserved: [c_longlong; 3], + } +- +- pub struct __wasi_dirent_t { +- pub d_next: __wasi_dircookie_t, +- pub d_ino: __wasi_inode_t, +- pub d_namlen: u32, +- pub d_type: __wasi_filetype_t, +- } +- +- pub struct __wasi_event_u_fd_readwrite_t { +- pub nbytes: __wasi_filesize_t, +- pub flags: __wasi_eventrwflags_t, +- } +- +- pub struct __wasi_fdstat_t { +- pub fs_filetype: __wasi_filetype_t, +- pub fs_flags: __wasi_fdflags_t, +- pub fs_rights_base: __wasi_rights_t, +- pub fs_rights_inheriting: __wasi_rights_t, +- } +- +- pub struct __wasi_filestat_t { +- pub st_dev: __wasi_device_t, +- pub st_ino: __wasi_inode_t, +- pub st_filetype: __wasi_filetype_t, +- pub st_nlink: __wasi_linkcount_t, +- pub st_size: __wasi_filesize_t, +- pub st_atim: __wasi_timestamp_t, +- pub st_mtim: __wasi_timestamp_t, +- pub st_ctim: __wasi_timestamp_t, +- } +- +- pub struct __wasi_ciovec_t { +- pub buf: *const ::c_void, +- pub buf_len: size_t, +- } +- +- pub struct __wasi_iovec_t { +- pub buf: *mut ::c_void, +- pub buf_len: size_t, +- } +- +- pub struct __wasi_subscription_u_clock_t { +- pub identifier: __wasi_userdata_t, +- pub clock_id: __wasi_clockid_t, +- pub timeout: __wasi_timestamp_t, +- pub precision: __wasi_timestamp_t, +- pub flags: __wasi_subclockflags_t, +- } +- +- pub struct __wasi_subscription_u_fd_readwrite_t { +- pub fd: __wasi_fd_t, +- } +- +- pub struct __wasi_prestat_u_dir_t { +- pub pr_name_len: size_t, +- } +-} +- +-s_no_extra_traits! { +- #[allow(missing_debug_implementations)] +- pub struct __wasi_subscription_t { +- pub userdata: __wasi_userdata_t, +- pub type_: __wasi_eventtype_t, +- pub u: __wasi_subscription_u, +- } +- +- #[allow(missing_debug_implementations)] +- pub struct __wasi_event_t { +- pub userdata: __wasi_userdata_t, +- pub error: __wasi_errno_t, +- pub type_: __wasi_eventtype_t, +- pub u: __wasi_event_u, +- } +- +- #[allow(missing_debug_implementations)] +- pub union __wasi_event_u { +- pub fd_readwrite: __wasi_event_u_fd_readwrite_t, +- _bindgen_union_align: [u64; 2], +- } +- +- #[allow(missing_debug_implementations)] +- pub union __wasi_subscription_u { +- pub clock: __wasi_subscription_u_clock_t, +- pub fd_readwrite: +- __wasi_subscription_u_fd_readwrite_t, +- _bindgen_union_align: [u64; 5], +- } +- +- #[allow(missing_debug_implementations)] +- pub struct __wasi_prestat_t { +- pub pr_type: __wasi_preopentype_t, +- pub u: __wasi_prestat_u, +- } +- +- #[allow(missing_debug_implementations)] +- pub union __wasi_prestat_u { +- pub dir: __wasi_prestat_u_dir_t, +- } +- + } + + // Declare dirent outside of s! so that it doesn't implement Copy, Eq, Hash, +@@ -301,22 +174,27 @@ pub const EXIT_FAILURE: 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 SEEK_SET: c_int = 2; +-pub const SEEK_CUR: c_int = 0; +-pub const SEEK_END: 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_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 FD_CLOEXEC: c_int = 1; + pub const FD_SETSIZE: size_t = 1024; +-pub const O_APPEND: c_int = __WASI_FDFLAG_APPEND as c_int; +-pub const O_DSYNC: c_int = __WASI_FDFLAG_DSYNC as c_int; +-pub const O_NONBLOCK: c_int = __WASI_FDFLAG_NONBLOCK as c_int; +-pub const O_RSYNC: c_int = __WASI_FDFLAG_RSYNC as c_int; +-pub const O_SYNC: c_int = __WASI_FDFLAG_SYNC as c_int; +-pub const O_CREAT: c_int = (__WASI_O_CREAT as c_int) << 12; +-pub const O_DIRECTORY: c_int = (__WASI_O_DIRECTORY as c_int) << 12; +-pub const O_EXCL: c_int = (__WASI_O_EXCL as c_int) << 12; +-pub const O_TRUNC: c_int = (__WASI_O_TRUNC as c_int) << 12; ++pub const O_APPEND: c_int = 0x0001; ++pub const O_DSYNC: c_int = 0x0002; ++pub const O_NONBLOCK: c_int = 0x0004; ++pub const O_RSYNC: c_int = 0x0008; ++pub const O_SYNC: c_int = 0x0010; ++pub const O_CREAT: c_int = 0x0001 << 12; ++pub const O_DIRECTORY: c_int = 0x0002 << 12; ++pub const O_EXCL: c_int = 0x0004 << 12; ++pub const O_TRUNC: c_int = 0x0008 << 12; + pub const O_NOFOLLOW: c_int = 0x01000000; + pub const O_EXEC: c_int = 0x02000000; + pub const O_RDONLY: c_int = 0x04000000; +@@ -324,280 +202,114 @@ pub const O_SEARCH: c_int = 0x08000000; + pub const O_WRONLY: c_int = 0x10000000; + pub const O_RDWR: c_int = O_WRONLY | O_RDONLY; + pub const O_ACCMODE: c_int = O_EXEC | O_RDWR | O_SEARCH; +-pub const POSIX_FADV_DONTNEED: c_int = __WASI_ADVICE_DONTNEED as c_int; +-pub const POSIX_FADV_NOREUSE: c_int = __WASI_ADVICE_NOREUSE as c_int; +-pub const POSIX_FADV_NORMAL: c_int = __WASI_ADVICE_NORMAL as c_int; +-pub const POSIX_FADV_RANDOM: c_int = __WASI_ADVICE_RANDOM as c_int; +-pub const POSIX_FADV_SEQUENTIAL: c_int = __WASI_ADVICE_SEQUENTIAL as c_int; +-pub const POSIX_FADV_WILLNEED: c_int = __WASI_ADVICE_WILLNEED as c_int; ++pub const POSIX_FADV_DONTNEED: c_int = 4; ++pub const POSIX_FADV_NOREUSE: c_int = 5; ++pub const POSIX_FADV_NORMAL: c_int = 0; ++pub const POSIX_FADV_RANDOM: c_int = 2; ++pub const POSIX_FADV_SEQUENTIAL: c_int = 1; ++pub const POSIX_FADV_WILLNEED: c_int = 3; + pub const AT_EACCESS: c_int = 0x0; + pub const AT_SYMLINK_NOFOLLOW: c_int = 0x1; + pub const AT_SYMLINK_FOLLOW: c_int = 0x2; + pub const AT_REMOVEDIR: c_int = 0x4; +- +-pub const E2BIG: c_int = __WASI_E2BIG as c_int; +-pub const EACCES: c_int = __WASI_EACCES as c_int; +-pub const EADDRINUSE: c_int = __WASI_EADDRINUSE as c_int; +-pub const EADDRNOTAVAIL: c_int = __WASI_EADDRNOTAVAIL as c_int; +-pub const EAFNOSUPPORT: c_int = __WASI_EAFNOSUPPORT as c_int; +-pub const EAGAIN: c_int = __WASI_EAGAIN as c_int; +-pub const EALREADY: c_int = __WASI_EALREADY as c_int; +-pub const EBADF: c_int = __WASI_EBADF as c_int; +-pub const EBADMSG: c_int = __WASI_EBADMSG as c_int; +-pub const EBUSY: c_int = __WASI_EBUSY as c_int; +-pub const ECANCELED: c_int = __WASI_ECANCELED as c_int; +-pub const ECHILD: c_int = __WASI_ECHILD as c_int; +-pub const ECONNABORTED: c_int = __WASI_ECONNABORTED as c_int; +-pub const ECONNREFUSED: c_int = __WASI_ECONNREFUSED as c_int; +-pub const ECONNRESET: c_int = __WASI_ECONNRESET as c_int; +-pub const EDEADLK: c_int = __WASI_EDEADLK as c_int; +-pub const EDESTADDRREQ: c_int = __WASI_EDESTADDRREQ as c_int; +-pub const EDOM: c_int = __WASI_EDOM as c_int; +-pub const EDQUOT: c_int = __WASI_EDQUOT as c_int; +-pub const EEXIST: c_int = __WASI_EEXIST as c_int; +-pub const EFAULT: c_int = __WASI_EFAULT as c_int; +-pub const EFBIG: c_int = __WASI_EFBIG as c_int; +-pub const EHOSTUNREACH: c_int = __WASI_EHOSTUNREACH as c_int; +-pub const EIDRM: c_int = __WASI_EIDRM as c_int; +-pub const EILSEQ: c_int = __WASI_EILSEQ as c_int; +-pub const EINPROGRESS: c_int = __WASI_EINPROGRESS as c_int; +-pub const EINTR: c_int = __WASI_EINTR as c_int; +-pub const EINVAL: c_int = __WASI_EINVAL as c_int; +-pub const EIO: c_int = __WASI_EIO as c_int; +-pub const EISCONN: c_int = __WASI_EISCONN as c_int; +-pub const EISDIR: c_int = __WASI_EISDIR as c_int; +-pub const ELOOP: c_int = __WASI_ELOOP as c_int; +-pub const EMFILE: c_int = __WASI_EMFILE as c_int; +-pub const EMLINK: c_int = __WASI_EMLINK as c_int; +-pub const EMSGSIZE: c_int = __WASI_EMSGSIZE as c_int; +-pub const EMULTIHOP: c_int = __WASI_EMULTIHOP as c_int; +-pub const ENAMETOOLONG: c_int = __WASI_ENAMETOOLONG as c_int; +-pub const ENETDOWN: c_int = __WASI_ENETDOWN as c_int; +-pub const ENETRESET: c_int = __WASI_ENETRESET as c_int; +-pub const ENETUNREACH: c_int = __WASI_ENETUNREACH as c_int; +-pub const ENFILE: c_int = __WASI_ENFILE as c_int; +-pub const ENOBUFS: c_int = __WASI_ENOBUFS as c_int; +-pub const ENODEV: c_int = __WASI_ENODEV as c_int; +-pub const ENOENT: c_int = __WASI_ENOENT as c_int; +-pub const ENOEXEC: c_int = __WASI_ENOEXEC as c_int; +-pub const ENOLCK: c_int = __WASI_ENOLCK as c_int; +-pub const ENOLINK: c_int = __WASI_ENOLINK as c_int; +-pub const ENOMEM: c_int = __WASI_ENOMEM as c_int; +-pub const ENOMSG: c_int = __WASI_ENOMSG as c_int; +-pub const ENOPROTOOPT: c_int = __WASI_ENOPROTOOPT as c_int; +-pub const ENOSPC: c_int = __WASI_ENOSPC as c_int; +-pub const ENOSYS: c_int = __WASI_ENOSYS as c_int; +-pub const ENOTCONN: c_int = __WASI_ENOTCONN as c_int; +-pub const ENOTDIR: c_int = __WASI_ENOTDIR as c_int; +-pub const ENOTEMPTY: c_int = __WASI_ENOTEMPTY as c_int; +-pub const ENOTRECOVERABLE: c_int = __WASI_ENOTRECOVERABLE as c_int; +-pub const ENOTSOCK: c_int = __WASI_ENOTSOCK as c_int; +-pub const ENOTSUP: c_int = __WASI_ENOTSUP as c_int; +-pub const ENOTTY: c_int = __WASI_ENOTTY as c_int; +-pub const ENXIO: c_int = __WASI_ENXIO as c_int; +-pub const EOVERFLOW: c_int = __WASI_EOVERFLOW as c_int; +-pub const EOWNERDEAD: c_int = __WASI_EOWNERDEAD as c_int; +-pub const EPERM: c_int = __WASI_EPERM as c_int; +-pub const EPIPE: c_int = __WASI_EPIPE as c_int; +-pub const EPROTO: c_int = __WASI_EPROTO as c_int; +-pub const EPROTONOSUPPORT: c_int = __WASI_EPROTONOSUPPORT as c_int; +-pub const EPROTOTYPE: c_int = __WASI_EPROTOTYPE as c_int; +-pub const ERANGE: c_int = __WASI_ERANGE as c_int; +-pub const EROFS: c_int = __WASI_EROFS as c_int; +-pub const ESPIPE: c_int = __WASI_ESPIPE as c_int; +-pub const ESRCH: c_int = __WASI_ESRCH as c_int; +-pub const ESTALE: c_int = __WASI_ESTALE as c_int; +-pub const ETIMEDOUT: c_int = __WASI_ETIMEDOUT as c_int; +-pub const ETXTBSY: c_int = __WASI_ETXTBSY as c_int; +-pub const EXDEV: c_int = __WASI_EXDEV as c_int; +-pub const ENOTCAPABLE: c_int = __WASI_ENOTCAPABLE as c_int; ++pub const UTIME_OMIT: c_long = 0xfffffffe; ++pub const UTIME_NOW: c_long = 0xffffffff; ++pub const S_IFIFO: mode_t = 49152; ++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 = 57344; ++pub const DT_UNKNOWN: u8 = 0; ++pub const DT_BLK: u8 = 1; ++pub const DT_CHR: u8 = 2; ++pub const DT_DIR: u8 = 3; ++pub const DT_REG: u8 = 4; ++pub const DT_LNK: u8 = 7; ++pub const FIONREAD: c_int = 1; ++pub const FIONBIO: c_int = 2; ++ ++pub const E2BIG: c_int = 1; ++pub const EACCES: c_int = 2; ++pub const EADDRINUSE: c_int = 3; ++pub const EADDRNOTAVAIL: c_int = 4; ++pub const EAFNOSUPPORT: c_int = 5; ++pub const EAGAIN: c_int = 6; ++pub const EALREADY: c_int = 7; ++pub const EBADF: c_int = 8; ++pub const EBADMSG: c_int = 9; ++pub const EBUSY: c_int = 10; ++pub const ECANCELED: c_int = 11; ++pub const ECHILD: c_int = 12; ++pub const ECONNABORTED: c_int = 13; ++pub const ECONNREFUSED: c_int = 14; ++pub const ECONNRESET: c_int = 15; ++pub const EDEADLK: c_int = 16; ++pub const EDESTADDRREQ: c_int = 17; ++pub const EDOM: c_int = 18; ++pub const EDQUOT: c_int = 19; ++pub const EEXIST: c_int = 20; ++pub const EFAULT: c_int = 21; ++pub const EFBIG: c_int = 22; ++pub const EHOSTUNREACH: c_int = 23; ++pub const EIDRM: c_int = 24; ++pub const EILSEQ: c_int = 25; ++pub const EINPROGRESS: c_int = 26; ++pub const EINTR: c_int = 27; ++pub const EINVAL: c_int = 28; ++pub const EIO: c_int = 29; ++pub const EISCONN: c_int = 30; ++pub const EISDIR: c_int = 31; ++pub const ELOOP: c_int = 32; ++pub const EMFILE: c_int = 33; ++pub const EMLINK: c_int = 34; ++pub const EMSGSIZE: c_int = 35; ++pub const EMULTIHOP: c_int = 36; ++pub const ENAMETOOLONG: c_int = 37; ++pub const ENETDOWN: c_int = 38; ++pub const ENETRESET: c_int = 39; ++pub const ENETUNREACH: c_int = 40; ++pub const ENFILE: c_int = 41; ++pub const ENOBUFS: c_int = 42; ++pub const ENODEV: c_int = 43; ++pub const ENOENT: c_int = 44; ++pub const ENOEXEC: c_int = 45; ++pub const ENOLCK: c_int = 46; ++pub const ENOLINK: c_int = 47; ++pub const ENOMEM: c_int = 48; ++pub const ENOMSG: c_int = 49; ++pub const ENOPROTOOPT: c_int = 50; ++pub const ENOSPC: c_int = 51; ++pub const ENOSYS: c_int = 52; ++pub const ENOTCONN: c_int = 53; ++pub const ENOTDIR: c_int = 54; ++pub const ENOTEMPTY: c_int = 55; ++pub const ENOTRECOVERABLE: c_int = 56; ++pub const ENOTSOCK: c_int = 57; ++pub const ENOTSUP: c_int = 58; ++pub const ENOTTY: c_int = 59; ++pub const ENXIO: c_int = 60; ++pub const EOVERFLOW: c_int = 61; ++pub const EOWNERDEAD: c_int = 62; ++pub const EPERM: c_int = 63; ++pub const EPIPE: c_int = 64; ++pub const EPROTO: c_int = 65; ++pub const EPROTONOSUPPORT: c_int = 66; ++pub const EPROTOTYPE: c_int = 67; ++pub const ERANGE: c_int = 68; ++pub const EROFS: c_int = 69; ++pub const ESPIPE: c_int = 70; ++pub const ESRCH: c_int = 71; ++pub const ESTALE: c_int = 72; ++pub const ETIMEDOUT: c_int = 73; ++pub const ETXTBSY: c_int = 74; ++pub const EXDEV: c_int = 75; ++pub const ENOTCAPABLE: c_int = 76; + pub const EOPNOTSUPP: c_int = ENOTSUP; + pub const EWOULDBLOCK: c_int = EAGAIN; + +-pub const __WASI_ADVICE_NORMAL: u8 = 0; +-pub const __WASI_ADVICE_SEQUENTIAL: u8 = 1; +-pub const __WASI_ADVICE_RANDOM: u8 = 2; +-pub const __WASI_ADVICE_WILLNEED: u8 = 3; +-pub const __WASI_ADVICE_DONTNEED: u8 = 4; +-pub const __WASI_ADVICE_NOREUSE: u8 = 5; +-pub const __WASI_CLOCK_REALTIME: u32 = 0; +-pub const __WASI_CLOCK_MONOTONIC: u32 = 1; +-pub const __WASI_CLOCK_PROCESS_CPUTIME_ID: u32 = 2; +-pub const __WASI_CLOCK_THREAD_CPUTIME_ID: u32 = 3; +-pub const __WASI_DIRCOOKIE_START: u64 = 0; +-pub const __WASI_ESUCCESS: u16 = 0; +-pub const __WASI_E2BIG: u16 = 1; +-pub const __WASI_EACCES: u16 = 2; +-pub const __WASI_EADDRINUSE: u16 = 3; +-pub const __WASI_EADDRNOTAVAIL: u16 = 4; +-pub const __WASI_EAFNOSUPPORT: u16 = 5; +-pub const __WASI_EAGAIN: u16 = 6; +-pub const __WASI_EALREADY: u16 = 7; +-pub const __WASI_EBADF: u16 = 8; +-pub const __WASI_EBADMSG: u16 = 9; +-pub const __WASI_EBUSY: u16 = 10; +-pub const __WASI_ECANCELED: u16 = 11; +-pub const __WASI_ECHILD: u16 = 12; +-pub const __WASI_ECONNABORTED: u16 = 13; +-pub const __WASI_ECONNREFUSED: u16 = 14; +-pub const __WASI_ECONNRESET: u16 = 15; +-pub const __WASI_EDEADLK: u16 = 16; +-pub const __WASI_EDESTADDRREQ: u16 = 17; +-pub const __WASI_EDOM: u16 = 18; +-pub const __WASI_EDQUOT: u16 = 19; +-pub const __WASI_EEXIST: u16 = 20; +-pub const __WASI_EFAULT: u16 = 21; +-pub const __WASI_EFBIG: u16 = 22; +-pub const __WASI_EHOSTUNREACH: u16 = 23; +-pub const __WASI_EIDRM: u16 = 24; +-pub const __WASI_EILSEQ: u16 = 25; +-pub const __WASI_EINPROGRESS: u16 = 26; +-pub const __WASI_EINTR: u16 = 27; +-pub const __WASI_EINVAL: u16 = 28; +-pub const __WASI_EIO: u16 = 29; +-pub const __WASI_EISCONN: u16 = 30; +-pub const __WASI_EISDIR: u16 = 31; +-pub const __WASI_ELOOP: u16 = 32; +-pub const __WASI_EMFILE: u16 = 33; +-pub const __WASI_EMLINK: u16 = 34; +-pub const __WASI_EMSGSIZE: u16 = 35; +-pub const __WASI_EMULTIHOP: u16 = 36; +-pub const __WASI_ENAMETOOLONG: u16 = 37; +-pub const __WASI_ENETDOWN: u16 = 38; +-pub const __WASI_ENETRESET: u16 = 39; +-pub const __WASI_ENETUNREACH: u16 = 40; +-pub const __WASI_ENFILE: u16 = 41; +-pub const __WASI_ENOBUFS: u16 = 42; +-pub const __WASI_ENODEV: u16 = 43; +-pub const __WASI_ENOENT: u16 = 44; +-pub const __WASI_ENOEXEC: u16 = 45; +-pub const __WASI_ENOLCK: u16 = 46; +-pub const __WASI_ENOLINK: u16 = 47; +-pub const __WASI_ENOMEM: u16 = 48; +-pub const __WASI_ENOMSG: u16 = 49; +-pub const __WASI_ENOPROTOOPT: u16 = 50; +-pub const __WASI_ENOSPC: u16 = 51; +-pub const __WASI_ENOSYS: u16 = 52; +-pub const __WASI_ENOTCONN: u16 = 53; +-pub const __WASI_ENOTDIR: u16 = 54; +-pub const __WASI_ENOTEMPTY: u16 = 55; +-pub const __WASI_ENOTRECOVERABLE: u16 = 56; +-pub const __WASI_ENOTSOCK: u16 = 57; +-pub const __WASI_ENOTSUP: u16 = 58; +-pub const __WASI_ENOTTY: u16 = 59; +-pub const __WASI_ENXIO: u16 = 60; +-pub const __WASI_EOVERFLOW: u16 = 61; +-pub const __WASI_EOWNERDEAD: u16 = 62; +-pub const __WASI_EPERM: u16 = 63; +-pub const __WASI_EPIPE: u16 = 64; +-pub const __WASI_EPROTO: u16 = 65; +-pub const __WASI_EPROTONOSUPPORT: u16 = 66; +-pub const __WASI_EPROTOTYPE: u16 = 67; +-pub const __WASI_ERANGE: u16 = 68; +-pub const __WASI_EROFS: u16 = 69; +-pub const __WASI_ESPIPE: u16 = 70; +-pub const __WASI_ESRCH: u16 = 71; +-pub const __WASI_ESTALE: u16 = 72; +-pub const __WASI_ETIMEDOUT: u16 = 73; +-pub const __WASI_ETXTBSY: u16 = 74; +-pub const __WASI_EXDEV: u16 = 75; +-pub const __WASI_ENOTCAPABLE: u16 = 76; +-pub const __WASI_EVENT_FD_READWRITE_HANGUP: u16 = 0x0001; +-pub const __WASI_EVENTTYPE_CLOCK: u8 = 0; +-pub const __WASI_EVENTTYPE_FD_READ: u8 = 1; +-pub const __WASI_EVENTTYPE_FD_WRITE: u8 = 2; +-pub const __WASI_FDFLAG_APPEND: u16 = 0x0001; +-pub const __WASI_FDFLAG_DSYNC: u16 = 0x0002; +-pub const __WASI_FDFLAG_NONBLOCK: u16 = 0x0004; +-pub const __WASI_FDFLAG_RSYNC: u16 = 0x0008; +-pub const __WASI_FDFLAG_SYNC: u16 = 0x0010; +-pub const __WASI_FILETYPE_UNKNOWN: u8 = 0; +-pub const __WASI_FILETYPE_BLOCK_DEVICE: u8 = 1; +-pub const __WASI_FILETYPE_CHARACTER_DEVICE: u8 = 2; +-pub const __WASI_FILETYPE_DIRECTORY: u8 = 3; +-pub const __WASI_FILETYPE_REGULAR_FILE: u8 = 4; +-pub const __WASI_FILETYPE_SOCKET_DGRAM: u8 = 5; +-pub const __WASI_FILETYPE_SOCKET_STREAM: u8 = 6; +-pub const __WASI_FILETYPE_SYMBOLIC_LINK: u8 = 7; +-pub const __WASI_FILESTAT_SET_ATIM: u16 = 0x0001; +-pub const __WASI_FILESTAT_SET_ATIM_NOW: u16 = 0x0002; +-pub const __WASI_FILESTAT_SET_MTIM: u16 = 0x0004; +-pub const __WASI_FILESTAT_SET_MTIM_NOW: u16 = 0x0008; +-pub const __WASI_LOOKUP_SYMLINK_FOLLOW: u32 = 0x00000001; +-pub const __WASI_O_CREAT: u16 = 0x0001; +-pub const __WASI_O_DIRECTORY: u16 = 0x0002; +-pub const __WASI_O_EXCL: u16 = 0x0004; +-pub const __WASI_O_TRUNC: u16 = 0x0008; +-pub const __WASI_PREOPENTYPE_DIR: u8 = 0; +-pub const __WASI_SOCK_RECV_PEEK: u16 = 0x0001; +-pub const __WASI_SOCK_RECV_WAITALL: u16 = 0x0002; +-pub const __WASI_RIGHT_FD_DATASYNC: u64 = 0x0000000000000001; +-pub const __WASI_RIGHT_FD_READ: u64 = 0x0000000000000002; +-pub const __WASI_RIGHT_FD_SEEK: u64 = 0x0000000000000004; +-pub const __WASI_RIGHT_FD_FDSTAT_SET_FLAGS: u64 = 0x0000000000000008; +-pub const __WASI_RIGHT_FD_SYNC: u64 = 0x0000000000000010; +-pub const __WASI_RIGHT_FD_TELL: u64 = 0x0000000000000020; +-pub const __WASI_RIGHT_FD_WRITE: u64 = 0x0000000000000040; +-pub const __WASI_RIGHT_FD_ADVISE: u64 = 0x0000000000000080; +-pub const __WASI_RIGHT_FD_ALLOCATE: u64 = 0x0000000000000100; +-pub const __WASI_RIGHT_PATH_CREATE_DIRECTORY: u64 = 0x0000000000000200; +-pub const __WASI_RIGHT_PATH_CREATE_FILE: u64 = 0x0000000000000400; +-pub const __WASI_RIGHT_PATH_LINK_SOURCE: u64 = 0x0000000000000800; +-pub const __WASI_RIGHT_PATH_LINK_TARGET: u64 = 0x0000000000001000; +-pub const __WASI_RIGHT_PATH_OPEN: u64 = 0x0000000000002000; +-pub const __WASI_RIGHT_FD_READDIR: u64 = 0x0000000000004000; +-pub const __WASI_RIGHT_PATH_READLINK: u64 = 0x0000000000008000; +-pub const __WASI_RIGHT_PATH_RENAME_SOURCE: u64 = 0x0000000000010000; +-pub const __WASI_RIGHT_PATH_RENAME_TARGET: u64 = 0x0000000000020000; +-pub const __WASI_RIGHT_PATH_FILESTAT_GET: u64 = 0x0000000000040000; +-pub const __WASI_RIGHT_PATH_FILESTAT_SET_SIZE: u64 = 0x0000000000080000; +-pub const __WASI_RIGHT_PATH_FILESTAT_SET_TIMES: u64 = 0x0000000000100000; +-pub const __WASI_RIGHT_FD_FILESTAT_GET: u64 = 0x0000000000200000; +-pub const __WASI_RIGHT_FD_FILESTAT_SET_SIZE: u64 = 0x0000000000400000; +-pub const __WASI_RIGHT_FD_FILESTAT_SET_TIMES: u64 = 0x0000000000800000; +-pub const __WASI_RIGHT_PATH_SYMLINK: u64 = 0x0000000001000000; +-pub const __WASI_RIGHT_PATH_REMOVE_DIRECTORY: u64 = 0x0000000002000000; +-pub const __WASI_RIGHT_PATH_UNLINK_FILE: u64 = 0x0000000004000000; +-pub const __WASI_RIGHT_POLL_FD_READWRITE: u64 = 0x0000000008000000; +-pub const __WASI_RIGHT_SOCK_SHUTDOWN: u64 = 0x0000000010000000; +-pub const __WASI_SOCK_RECV_DATA_TRUNCATED: u16 = 0x0001; +-pub const __WASI_SHUT_RD: u8 = 0x01; +-pub const __WASI_SHUT_WR: u8 = 0x02; +-pub const __WASI_SIGHUP: u8 = 1; +-pub const __WASI_SIGINT: u8 = 2; +-pub const __WASI_SIGQUIT: u8 = 3; +-pub const __WASI_SIGILL: u8 = 4; +-pub const __WASI_SIGTRAP: u8 = 5; +-pub const __WASI_SIGABRT: u8 = 6; +-pub const __WASI_SIGBUS: u8 = 7; +-pub const __WASI_SIGFPE: u8 = 8; +-pub const __WASI_SIGKILL: u8 = 9; +-pub const __WASI_SIGUSR1: u8 = 10; +-pub const __WASI_SIGSEGV: u8 = 11; +-pub const __WASI_SIGUSR2: u8 = 12; +-pub const __WASI_SIGPIPE: u8 = 13; +-pub const __WASI_SIGALRM: u8 = 14; +-pub const __WASI_SIGTERM: u8 = 15; +-pub const __WASI_SIGCHLD: u8 = 16; +-pub const __WASI_SIGCONT: u8 = 17; +-pub const __WASI_SIGSTOP: u8 = 18; +-pub const __WASI_SIGTSTP: u8 = 19; +-pub const __WASI_SIGTTIN: u8 = 20; +-pub const __WASI_SIGTTOU: u8 = 21; +-pub const __WASI_SIGURG: u8 = 22; +-pub const __WASI_SIGXCPU: u8 = 23; +-pub const __WASI_SIGXFSZ: u8 = 24; +-pub const __WASI_SIGVTALRM: u8 = 25; +-pub const __WASI_SIGPROF: u8 = 26; +-pub const __WASI_SIGWINCH: u8 = 27; +-pub const __WASI_SIGPOLL: u8 = 28; +-pub const __WASI_SIGPWR: u8 = 29; +-pub const __WASI_SIGSYS: u8 = 30; +-pub const __WASI_SUBSCRIPTION_CLOCK_ABSTIME: u16 = 0x0001; +-pub const __WASI_WHENCE_CUR: u8 = 0; +-pub const __WASI_WHENCE_END: u8 = 1; +-pub const __WASI_WHENCE_SET: u8 = 2; +- + #[cfg_attr( + feature = "rustc-dep-of-std", + link(name = "c", kind = "static", cfg(target_feature = "crt-static")) +@@ -606,7 +318,7 @@ pub const __WASI_WHENCE_SET: u8 = 2; + feature = "rustc-dep-of-std", + link(name = "c", cfg(not(target_feature = "crt-static"))) + )] +-extern { ++extern "C" { + pub fn _Exit(code: c_int) -> !; + pub fn _exit(code: c_int) -> !; + pub fn abort() -> !; +@@ -667,8 +379,8 @@ extern { + pub fn puts(a: *const c_char) -> c_int; + pub fn perror(a: *const c_char); + pub fn srand(a: c_uint); +- pub fn atexit(a: extern fn()) -> c_int; +- pub fn at_quick_exit(a: extern fn()) -> c_int; ++ pub fn atexit(a: extern "C" fn()) -> c_int; ++ pub fn at_quick_exit(a: extern "C" fn()) -> c_int; + pub fn quick_exit(a: c_int) -> !; + pub fn posix_memalign(a: *mut *mut c_void, b: size_t, c: size_t) -> c_int; + pub fn rand_r(a: *mut c_uint) -> c_int; +@@ -687,6 +399,7 @@ extern { + ) -> size_t; + pub fn gmtime(a: *const time_t) -> *mut tm; + pub fn gmtime_r(a: *const time_t, b: *mut tm) -> *mut tm; ++ pub fn localtime(a: *const time_t) -> *mut tm; + pub fn localtime_r(a: *const time_t, b: *mut tm) -> *mut tm; + pub fn asctime_r(a: *const tm, b: *mut c_char) -> *mut c_char; + pub fn ctime_r(a: *const time_t, b: *mut c_char) -> *mut c_char; +@@ -712,6 +425,7 @@ extern { + pub fn isspace(c: c_int) -> c_int; + pub fn isupper(c: c_int) -> c_int; + pub fn isxdigit(c: c_int) -> c_int; ++ pub fn isblank(c: c_int) -> c_int; + pub fn tolower(c: c_int) -> c_int; + pub fn toupper(c: c_int) -> c_int; + pub fn setvbuf( +@@ -757,6 +471,7 @@ extern { + pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t; + pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t; + pub fn strdup(cs: *const c_char) -> *mut c_char; ++ pub fn strndup(cs: *const c_char, n: size_t) -> *mut c_char; + pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int; +@@ -824,6 +539,8 @@ extern { + pub fn closedir(dirp: *mut ::DIR) -> ::c_int; + pub fn rewinddir(dirp: *mut ::DIR); + pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; ++ pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); ++ pub fn telldir(dirp: *mut ::DIR) -> ::c_long; + + pub fn openat( + dirfd: ::c_int, +@@ -884,7 +601,6 @@ extern { + pub fn link(src: *const c_char, dst: *const c_char) -> ::c_int; + pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t; + pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long; +- pub fn pause() -> ::c_int; + pub fn rmdir(path: *const c_char) -> ::c_int; + pub fn sleep(secs: ::c_uint) -> ::c_uint; + pub fn unlink(c: *const c_char) -> ::c_int; +@@ -952,6 +668,8 @@ extern { + + pub fn sysconf(name: ::c_int) -> ::c_long; + ++ pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; ++ + pub fn fseeko( + stream: *mut ::FILE, + offset: ::off_t, +@@ -1037,11 +755,8 @@ extern { + pub fn __wasilibc_fd_renumber(fd: c_int, newfd: c_int) -> c_int; + pub fn __wasilibc_unlinkat(fd: c_int, path: *const c_char) -> c_int; + pub fn __wasilibc_rmdirat(fd: c_int, path: *const c_char) -> c_int; +- pub fn __wasilibc_init_preopen(); + pub fn __wasilibc_find_relpath( + path: *const c_char, +- rights_base: __wasi_rights_t, +- rights_inheriting: __wasi_rights_t, + relative_path: *mut *const c_char, + ) -> c_int; + pub fn __wasilibc_tell(fd: c_int) -> ::off_t; +@@ -1050,280 +765,3 @@ extern { + pub fn arc4random_buf(a: *mut c_void, b: size_t); + pub fn arc4random_uniform(a: u32) -> u32; + } +- +-#[link(wasm_import_module = "wasi_unstable")] +-extern { +- #[link_name = "clock_res_get"] +- pub fn __wasi_clock_res_get( +- clock_id: __wasi_clockid_t, +- resolution: *mut __wasi_timestamp_t, +- ) -> __wasi_errno_t; +- #[link_name = "clock_time_get"] +- pub fn __wasi_clock_time_get( +- clock_id: __wasi_clockid_t, +- precision: __wasi_timestamp_t, +- time: *mut __wasi_timestamp_t, +- ) -> __wasi_errno_t; +- #[link_name = "fd_close"] +- pub fn __wasi_fd_close(fd: __wasi_fd_t) -> __wasi_errno_t; +- #[link_name = "fd_datasync"] +- pub fn __wasi_fd_datasync(fd: __wasi_fd_t) -> __wasi_errno_t; +- #[link_name = "fd_pread"] +- pub fn __wasi_fd_pread( +- fd: __wasi_fd_t, +- iovs: *const __wasi_iovec_t, +- iovs_len: size_t, +- offset: __wasi_filesize_t, +- nread: *mut size_t, +- ) -> __wasi_errno_t; +- #[link_name = "fd_pwrite"] +- pub fn __wasi_fd_pwrite( +- fd: __wasi_fd_t, +- iovs: *const __wasi_ciovec_t, +- iovs_len: size_t, +- offset: __wasi_filesize_t, +- nwritten: *mut size_t, +- ) -> __wasi_errno_t; +- #[link_name = "fd_read"] +- pub fn __wasi_fd_read( +- fd: __wasi_fd_t, +- iovs: *const __wasi_iovec_t, +- iovs_len: size_t, +- nread: *mut size_t, +- ) -> __wasi_errno_t; +- #[link_name = "fd_renumber"] +- pub fn __wasi_fd_renumber( +- from: __wasi_fd_t, +- to: __wasi_fd_t, +- ) -> __wasi_errno_t; +- #[link_name = "fd_seek"] +- pub fn __wasi_fd_seek( +- fd: __wasi_fd_t, +- offset: __wasi_filedelta_t, +- whence: __wasi_whence_t, +- newoffset: *mut __wasi_filesize_t, +- ) -> __wasi_errno_t; +- #[link_name = "fd_tell"] +- pub fn __wasi_fd_tell( +- fd: __wasi_fd_t, +- newoffset: *mut __wasi_filesize_t, +- ) -> __wasi_errno_t; +- #[link_name = "fd_fdstat_get"] +- pub fn __wasi_fd_fdstat_get( +- fd: __wasi_fd_t, +- buf: *mut __wasi_fdstat_t, +- ) -> __wasi_errno_t; +- #[link_name = "fd_fdstat_set_flags"] +- pub fn __wasi_fd_fdstat_set_flags( +- fd: __wasi_fd_t, +- flags: __wasi_fdflags_t, +- ) -> __wasi_errno_t; +- #[link_name = "fd_fdstat_set_rights"] +- pub fn __wasi_fd_fdstat_set_rights( +- fd: __wasi_fd_t, +- fs_rights_base: __wasi_rights_t, +- fs_rights_inheriting: __wasi_rights_t, +- ) -> __wasi_errno_t; +- #[link_name = "fd_sync"] +- pub fn __wasi_fd_sync(fd: __wasi_fd_t) -> __wasi_errno_t; +- #[link_name = "fd_write"] +- pub fn __wasi_fd_write( +- fd: __wasi_fd_t, +- iovs: *const __wasi_ciovec_t, +- iovs_len: size_t, +- nwritten: *mut size_t, +- ) -> __wasi_errno_t; +- #[link_name = "fd_advise"] +- pub fn __wasi_fd_advise( +- fd: __wasi_fd_t, +- offset: __wasi_filesize_t, +- len: __wasi_filesize_t, +- advice: __wasi_advice_t, +- ) -> __wasi_errno_t; +- #[link_name = "fd_allocate"] +- pub fn __wasi_fd_allocate( +- fd: __wasi_fd_t, +- offset: __wasi_filesize_t, +- len: __wasi_filesize_t, +- ) -> __wasi_errno_t; +- #[link_name = "path_create_directory"] +- pub fn __wasi_path_create_directory( +- fd: __wasi_fd_t, +- path: *const ::c_char, +- path_len: size_t, +- ) -> __wasi_errno_t; +- #[link_name = "path_link"] +- pub fn __wasi_path_link( +- old_fd: __wasi_fd_t, +- old_flags: __wasi_lookupflags_t, +- old_path: *const ::c_char, +- old_path_len: size_t, +- new_fd: __wasi_fd_t, +- new_path: *const ::c_char, +- new_path_len: size_t, +- ) -> __wasi_errno_t; +- #[link_name = "path_open"] +- pub fn __wasi_path_open( +- dirfd: __wasi_fd_t, +- dirflags: __wasi_lookupflags_t, +- path: *const ::c_char, +- path_len: size_t, +- oflags: __wasi_oflags_t, +- fs_rights_base: __wasi_rights_t, +- fs_rights_inheriting: __wasi_rights_t, +- fs_flags: __wasi_fdflags_t, +- fd: *mut __wasi_fd_t, +- ) -> __wasi_errno_t; +- #[link_name = "fd_readdir"] +- pub fn __wasi_fd_readdir( +- fd: __wasi_fd_t, +- buf: *mut ::c_void, +- buf_len: size_t, +- cookie: __wasi_dircookie_t, +- bufused: *mut size_t, +- ) -> __wasi_errno_t; +- #[link_name = "path_readlink"] +- pub fn __wasi_path_readlink( +- fd: __wasi_fd_t, +- path: *const ::c_char, +- path_len: size_t, +- buf: *mut ::c_char, +- buf_len: size_t, +- bufused: *mut size_t, +- ) -> __wasi_errno_t; +- #[link_name = "path_rename"] +- pub fn __wasi_path_rename( +- old_fd: __wasi_fd_t, +- old_path: *const ::c_char, +- old_path_len: size_t, +- new_fd: __wasi_fd_t, +- new_path: *const ::c_char, +- new_path_len: size_t, +- ) -> __wasi_errno_t; +- #[link_name = "fd_filestat_get"] +- pub fn __wasi_fd_filestat_get( +- fd: __wasi_fd_t, +- buf: *mut __wasi_filestat_t, +- ) -> __wasi_errno_t; +- #[link_name = "fd_filestat_set_times"] +- pub fn __wasi_fd_filestat_set_times( +- fd: __wasi_fd_t, +- st_atim: __wasi_timestamp_t, +- st_mtim: __wasi_timestamp_t, +- fstflags: __wasi_fstflags_t, +- ) -> __wasi_errno_t; +- #[link_name = "fd_filestat_set_size"] +- pub fn __wasi_fd_filestat_set_size( +- fd: __wasi_fd_t, +- st_size: __wasi_filesize_t, +- ) -> __wasi_errno_t; +- #[link_name = "path_filestat_get"] +- pub fn __wasi_path_filestat_get( +- fd: __wasi_fd_t, +- flags: __wasi_lookupflags_t, +- path: *const ::c_char, +- path_len: size_t, +- buf: *mut __wasi_filestat_t, +- ) -> __wasi_errno_t; +- #[link_name = "path_filestat_set_times"] +- pub fn __wasi_path_filestat_set_times( +- fd: __wasi_fd_t, +- flags: __wasi_lookupflags_t, +- path: *const ::c_char, +- path_len: size_t, +- st_atim: __wasi_timestamp_t, +- st_mtim: __wasi_timestamp_t, +- fstflags: __wasi_fstflags_t, +- ) -> __wasi_errno_t; +- #[link_name = "path_symlink"] +- pub fn __wasi_path_symlink( +- old_path: *const ::c_char, +- old_path_len: size_t, +- fd: __wasi_fd_t, +- new_path: *const ::c_char, +- new_path_len: size_t, +- ) -> __wasi_errno_t; +- #[link_name = "path_unlink_file"] +- pub fn __wasi_path_unlink_file( +- fd: __wasi_fd_t, +- path: *const ::c_char, +- path_len: size_t, +- ) -> __wasi_errno_t; +- #[link_name = "path_remove_directory"] +- pub fn __wasi_path_remove_directory( +- fd: __wasi_fd_t, +- path: *const ::c_char, +- path_len: size_t, +- ) -> __wasi_errno_t; +- #[link_name = "poll_oneoff"] +- pub fn __wasi_poll_oneoff( +- in_: *const __wasi_subscription_t, +- out: *mut __wasi_event_t, +- nsubscriptions: size_t, +- nevents: *mut size_t, +- ) -> __wasi_errno_t; +- #[link_name = "proc_exit"] +- pub fn __wasi_proc_exit(rval: __wasi_exitcode_t); +- #[link_name = "proc_raise"] +- pub fn __wasi_proc_raise(sig: __wasi_signal_t) -> __wasi_errno_t; +- #[link_name = "random_get"] +- pub fn __wasi_random_get( +- buf: *mut ::c_void, +- buf_len: size_t, +- ) -> __wasi_errno_t; +- #[link_name = "sock_recv"] +- pub fn __wasi_sock_recv( +- sock: __wasi_fd_t, +- ri_data: *const __wasi_iovec_t, +- ri_data_len: size_t, +- ri_flags: __wasi_riflags_t, +- ro_datalen: *mut size_t, +- ro_flags: *mut __wasi_roflags_t, +- ) -> __wasi_errno_t; +- #[link_name = "sock_send"] +- pub fn __wasi_sock_send( +- sock: __wasi_fd_t, +- si_data: *const __wasi_ciovec_t, +- si_data_len: size_t, +- si_flags: __wasi_siflags_t, +- so_datalen: *mut size_t, +- ) -> __wasi_errno_t; +- #[link_name = "sock_shutdown"] +- pub fn __wasi_sock_shutdown( +- sock: __wasi_fd_t, +- how: __wasi_sdflags_t, +- ) -> __wasi_errno_t; +- #[link_name = "sched_yield"] +- pub fn __wasi_sched_yield() -> __wasi_errno_t; +- #[link_name = "args_get"] +- pub fn __wasi_args_get( +- argv: *mut *mut c_char, +- argv_buf: *mut c_char, +- ) -> __wasi_errno_t; +- #[link_name = "args_sizes_get"] +- pub fn __wasi_args_sizes_get( +- argc: *mut size_t, +- argv_buf_size: *mut size_t, +- ) -> __wasi_errno_t; +- #[link_name = "environ_get"] +- pub fn __wasi_environ_get( +- environ: *mut *mut c_char, +- environ_buf: *mut c_char, +- ) -> __wasi_errno_t; +- #[link_name = "environ_sizes_get"] +- pub fn __wasi_environ_sizes_get( +- environ_count: *mut size_t, +- environ_buf_size: *mut size_t, +- ) -> __wasi_errno_t; +- #[link_name = "fd_prestat_get"] +- pub fn __wasi_fd_prestat_get( +- fd: __wasi_fd_t, +- buf: *mut __wasi_prestat_t, +- ) -> __wasi_errno_t; +- #[link_name = "fd_prestat_dir_name"] +- pub fn __wasi_fd_prestat_dir_name( +- fd: __wasi_fd_t, +- path: *mut c_char, +- path_len: size_t, +- ) -> __wasi_errno_t; +-} +diff --git a/third_party/rust/libc/src/windows/gnu.rs b/third_party/rust/libc/src/windows/gnu.rs +deleted file mode 100644 +index 45e7ddaea415576b1fe3d3f72198c0b0eedc8d1e..0000000000000000000000000000000000000000 +--- a/third_party/rust/libc/src/windows/gnu.rs ++++ /dev/null +@@ -1,13 +0,0 @@ +-pub const L_tmpnam: ::c_uint = 14; +-pub const TMP_MAX: ::c_uint = 0x7fff; +- +-// stdio file descriptor numbers +-pub const STDIN_FILENO: ::c_int = 0; +-pub const STDOUT_FILENO: ::c_int = 1; +-pub const STDERR_FILENO: ::c_int = 2; +- +-extern { +- pub fn strcasecmp(s1: *const ::c_char, s2: *const ::c_char) -> ::c_int; +- pub fn strncasecmp(s1: *const ::c_char, s2: *const ::c_char, +- n: ::size_t) -> ::c_int; +-} +diff --git a/third_party/rust/libc/src/windows/gnu/align.rs b/third_party/rust/libc/src/windows/gnu/align.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..3af99e3ca149bf53fa803e05bb15f02f6f60a6e1 +--- /dev/null ++++ b/third_party/rust/libc/src/windows/gnu/align.rs +@@ -0,0 +1,19 @@ ++cfg_if! { ++ if #[cfg(target_pointer_width = "64")] { ++ s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 4] ++ } ++ } ++ } else if #[cfg(target_pointer_width = "32")] { ++ s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [i64; 6] ++ } ++ } ++ } ++} +diff --git a/third_party/rust/libc/src/windows/gnu/mod.rs b/third_party/rust/libc/src/windows/gnu/mod.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..3e906967f60dc39ebfeb9cd9cf117f0e0a630928 +--- /dev/null ++++ b/third_party/rust/libc/src/windows/gnu/mod.rs +@@ -0,0 +1,31 @@ ++pub const L_tmpnam: ::c_uint = 14; ++pub const TMP_MAX: ::c_uint = 0x7fff; ++ ++// stdio file descriptor numbers ++pub const STDIN_FILENO: ::c_int = 0; ++pub const STDOUT_FILENO: ::c_int = 1; ++pub const STDERR_FILENO: ::c_int = 2; ++ ++extern "C" { ++ pub fn strcasecmp(s1: *const ::c_char, s2: *const ::c_char) -> ::c_int; ++ pub fn strncasecmp( ++ s1: *const ::c_char, ++ s2: *const ::c_char, ++ n: ::size_t, ++ ) -> ::c_int; ++ ++ // NOTE: For MSVC target, `wmemchr` is only a inline function in `` ++ // header file. We cannot find a way to link to that symbol from Rust. ++ pub fn wmemchr( ++ cx: *const ::wchar_t, ++ c: ::wchar_t, ++ n: ::size_t, ++ ) -> *mut ::wchar_t; ++} ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } ++} +diff --git a/third_party/rust/libc/src/windows/mod.rs b/third_party/rust/libc/src/windows/mod.rs +index be28b70f5664f65a868fc6d4cd414f3528a8988e..971cd11bca6b78971e4d09c47f056d9a3be6eb51 100644 +--- a/third_party/rust/libc/src/windows/mod.rs ++++ b/third_party/rust/libc/src/windows/mod.rs +@@ -42,7 +42,9 @@ pub type ino_t = u16; + pub enum timezone {} + impl ::Copy for timezone {} + impl ::Clone for timezone { +- fn clone(&self) -> timezone { *self } ++ fn clone(&self) -> timezone { ++ *self ++ } + } + pub type time64_t = i64; + +@@ -181,6 +183,48 @@ pub const ENOTEMPTY: ::c_int = 41; + pub const EILSEQ: ::c_int = 42; + pub const STRUNCATE: ::c_int = 80; + ++// POSIX Supplement (from errno.h) ++pub const EADDRINUSE: ::c_int = 100; ++pub const EADDRNOTAVAIL: ::c_int = 101; ++pub const EAFNOSUPPORT: ::c_int = 102; ++pub const EALREADY: ::c_int = 103; ++pub const EBADMSG: ::c_int = 104; ++pub const ECANCELED: ::c_int = 105; ++pub const ECONNABORTED: ::c_int = 106; ++pub const ECONNREFUSED: ::c_int = 107; ++pub const ECONNRESET: ::c_int = 108; ++pub const EDESTADDRREQ: ::c_int = 109; ++pub const EHOSTUNREACH: ::c_int = 110; ++pub const EIDRM: ::c_int = 111; ++pub const EINPROGRESS: ::c_int = 112; ++pub const EISCONN: ::c_int = 113; ++pub const ELOOP: ::c_int = 114; ++pub const EMSGSIZE: ::c_int = 115; ++pub const ENETDOWN: ::c_int = 116; ++pub const ENETRESET: ::c_int = 117; ++pub const ENETUNREACH: ::c_int = 118; ++pub const ENOBUFS: ::c_int = 119; ++pub const ENODATA: ::c_int = 120; ++pub const ENOLINK: ::c_int = 121; ++pub const ENOMSG: ::c_int = 122; ++pub const ENOPROTOOPT: ::c_int = 123; ++pub const ENOSR: ::c_int = 124; ++pub const ENOSTR: ::c_int = 125; ++pub const ENOTCONN: ::c_int = 126; ++pub const ENOTRECOVERABLE: ::c_int = 127; ++pub const ENOTSOCK: ::c_int = 128; ++pub const ENOTSUP: ::c_int = 129; ++pub const EOPNOTSUPP: ::c_int = 130; ++pub const EOVERFLOW: ::c_int = 132; ++pub const EOWNERDEAD: ::c_int = 133; ++pub const EPROTO: ::c_int = 134; ++pub const EPROTONOSUPPORT: ::c_int = 135; ++pub const EPROTOTYPE: ::c_int = 136; ++pub const ETIME: ::c_int = 137; ++pub const ETIMEDOUT: ::c_int = 138; ++pub const ETXTBSY: ::c_int = 139; ++pub const EWOULDBLOCK: ::c_int = 140; ++ + // signal codes + pub const SIGINT: ::c_int = 2; + pub const SIGILL: ::c_int = 4; +@@ -195,22 +239,26 @@ pub const SIG_ERR: ::c_int = -1; + #[cfg(all(target_env = "msvc", feature = "rustc-dep-of-std"))] // " if " + #[link(name = "msvcrt", cfg(not(target_feature = "crt-static")))] + #[link(name = "libcmt", cfg(target_feature = "crt-static"))] +-extern {} ++extern "C" {} + + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub enum FILE {} + impl ::Copy for FILE {} + impl ::Clone for FILE { +- fn clone(&self) -> FILE { *self } ++ fn clone(&self) -> FILE { ++ *self ++ } + } + #[cfg_attr(feature = "extra_traits", derive(Debug))] +-pub enum fpos_t {} // TODO: fill this out with a struct ++pub enum fpos_t {} // FIXME: fill this out with a struct + impl ::Copy for fpos_t {} + impl ::Clone for fpos_t { +- fn clone(&self) -> fpos_t { *self } ++ fn clone(&self) -> fpos_t { ++ *self ++ } + } + +-extern { ++extern "C" { + pub fn isalnum(c: c_int) -> c_int; + pub fn isalpha(c: c_int) -> c_int; + pub fn iscntrl(c: c_int) -> c_int; +@@ -222,31 +270,48 @@ extern { + pub fn isspace(c: c_int) -> c_int; + pub fn isupper(c: c_int) -> c_int; + pub fn isxdigit(c: c_int) -> c_int; ++ pub fn isblank(c: c_int) -> c_int; + pub fn tolower(c: c_int) -> c_int; + pub fn toupper(c: c_int) -> c_int; + pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE; +- pub fn freopen(filename: *const c_char, mode: *const c_char, +- file: *mut FILE) -> *mut FILE; ++ pub fn freopen( ++ filename: *const c_char, ++ mode: *const c_char, ++ file: *mut FILE, ++ ) -> *mut FILE; + pub fn fflush(file: *mut FILE) -> c_int; + pub fn fclose(file: *mut FILE) -> c_int; + pub fn remove(filename: *const c_char) -> c_int; + pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int; + pub fn tmpfile() -> *mut FILE; +- pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, +- size: size_t) -> c_int; ++ pub fn setvbuf( ++ stream: *mut FILE, ++ buffer: *mut c_char, ++ mode: c_int, ++ size: size_t, ++ ) -> c_int; + pub fn setbuf(stream: *mut FILE, buf: *mut c_char); + pub fn getchar() -> c_int; + pub fn putchar(c: c_int) -> c_int; + pub fn fgetc(stream: *mut FILE) -> c_int; +- pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char; ++ pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) ++ -> *mut c_char; + pub fn fputc(c: c_int, stream: *mut FILE) -> c_int; + pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int; + pub fn puts(s: *const c_char) -> c_int; + pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int; +- pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, +- stream: *mut FILE) -> size_t; +- pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, +- stream: *mut FILE) -> size_t; ++ pub fn fread( ++ ptr: *mut c_void, ++ size: size_t, ++ nobj: size_t, ++ stream: *mut FILE, ++ ) -> size_t; ++ pub fn fwrite( ++ ptr: *const c_void, ++ size: size_t, ++ nobj: size_t, ++ stream: *mut FILE, ++ ) -> size_t; + pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int; + pub fn ftell(stream: *mut FILE) -> c_long; + pub fn rewind(stream: *mut FILE); +@@ -257,10 +322,16 @@ extern { + pub fn perror(s: *const c_char); + pub fn atoi(s: *const c_char) -> c_int; + pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double; +- pub fn strtol(s: *const c_char, endp: *mut *mut c_char, +- base: c_int) -> c_long; +- pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, +- base: c_int) -> c_ulong; ++ pub fn strtol( ++ s: *const c_char, ++ endp: *mut *mut c_char, ++ base: c_int, ++ ) -> c_long; ++ pub fn strtoul( ++ s: *const c_char, ++ endp: *mut *mut c_char, ++ base: c_int, ++ ) -> c_ulong; + pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void; + pub fn malloc(size: size_t) -> *mut c_void; + pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void; +@@ -268,16 +339,22 @@ extern { + pub fn abort() -> !; + pub fn exit(status: c_int) -> !; + pub fn _exit(status: c_int) -> !; +- pub fn atexit(cb: extern fn()) -> c_int; ++ pub fn atexit(cb: extern "C" fn()) -> c_int; + pub fn system(s: *const c_char) -> c_int; + pub fn getenv(s: *const c_char) -> *mut c_char; + + pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char; +- pub fn strncpy(dst: *mut c_char, src: *const c_char, +- n: size_t) -> *mut c_char; ++ pub fn strncpy( ++ dst: *mut c_char, ++ src: *const c_char, ++ n: size_t, ++ ) -> *mut c_char; + pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char; +- pub fn strncat(s: *mut c_char, ct: *const c_char, +- n: size_t) -> *mut c_char; ++ pub fn strncat( ++ s: *mut c_char, ++ ct: *const c_char, ++ n: size_t, ++ ) -> *mut c_char; + pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int; + pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int; + pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int; +@@ -294,15 +371,24 @@ extern { + pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; + pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; + pub fn wcslen(buf: *const wchar_t) -> size_t; +- pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, +- n: size_t) -> ::size_t; ++ pub fn wcstombs( ++ dest: *mut c_char, ++ src: *const wchar_t, ++ n: size_t, ++ ) -> ::size_t; + + pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; + pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int; +- pub fn memcpy(dest: *mut c_void, src: *const c_void, +- n: size_t) -> *mut c_void; +- pub fn memmove(dest: *mut c_void, src: *const c_void, +- n: size_t) -> *mut c_void; ++ pub fn memcpy( ++ dest: *mut c_void, ++ src: *const c_void, ++ n: size_t, ++ ) -> *mut c_void; ++ pub fn memmove( ++ dest: *mut c_void, ++ src: *const c_void, ++ n: size_t, ++ ) -> *mut c_void; + pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void; + + pub fn abs(i: c_int) -> c_int; +@@ -314,6 +400,10 @@ extern { + pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t; + pub fn raise(signum: c_int) -> c_int; + ++ #[link_name = "_gmtime64_s"] ++ pub fn gmtime_s(destTime: *mut tm, srcTime: *const time_t) -> ::c_int; ++ #[link_name = "_time64"] ++ pub fn time(destTime: *mut time_t) -> time_t; + #[link_name = "_chmod"] + pub fn chmod(path: *const c_char, mode: ::c_int) -> ::c_int; + #[link_name = "_wchmod"] +@@ -355,15 +445,46 @@ extern { + #[link_name = "_dup2"] + pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int; + #[link_name = "_execv"] +- pub fn execv(prog: *const c_char, argv: *const *const c_char) -> ::intptr_t; ++ pub fn execv( ++ prog: *const c_char, ++ argv: *const *const c_char, ++ ) -> ::intptr_t; + #[link_name = "_execve"] +- pub fn execve(prog: *const c_char, argv: *const *const c_char, +- envp: *const *const c_char) -> ::c_int; ++ pub fn execve( ++ prog: *const c_char, ++ argv: *const *const c_char, ++ envp: *const *const c_char, ++ ) -> ::c_int; + #[link_name = "_execvp"] + pub fn execvp(c: *const c_char, argv: *const *const c_char) -> ::c_int; + #[link_name = "_execvpe"] +- pub fn execvpe(c: *const c_char, argv: *const *const c_char, +- envp: *const *const c_char) -> ::c_int; ++ pub fn execvpe( ++ c: *const c_char, ++ argv: *const *const c_char, ++ envp: *const *const c_char, ++ ) -> ::c_int; ++ #[link_name = "_wexecv"] ++ pub fn wexecv( ++ prog: *const wchar_t, ++ argv: *const *const wchar_t, ++ ) -> ::intptr_t; ++ #[link_name = "_wexecve"] ++ pub fn wexecve( ++ prog: *const wchar_t, ++ argv: *const *const wchar_t, ++ envp: *const *const wchar_t, ++ ) -> ::intptr_t; ++ #[link_name = "_wexecvp"] ++ pub fn wexecvp( ++ c: *const wchar_t, ++ argv: *const *const wchar_t, ++ ) -> ::intptr_t; ++ #[link_name = "_wexecvpe"] ++ pub fn wexecvpe( ++ c: *const wchar_t, ++ argv: *const *const wchar_t, ++ envp: *const *const wchar_t, ++ ) -> ::intptr_t; + #[link_name = "_getcwd"] + pub fn getcwd(buf: *mut c_char, size: ::c_int) -> *mut c_char; + #[link_name = "_getpid"] +@@ -372,10 +493,18 @@ extern { + pub fn isatty(fd: ::c_int) -> ::c_int; + #[link_name = "_lseek"] + pub fn lseek(fd: ::c_int, offset: c_long, origin: ::c_int) -> c_long; ++ #[link_name = "_lseeki64"] ++ pub fn lseek64( ++ fd: ::c_int, ++ offset: c_longlong, ++ origin: ::c_int, ++ ) -> c_longlong; + #[link_name = "_pipe"] +- pub fn pipe(fds: *mut ::c_int, +- psize: ::c_uint, +- textmode: ::c_int) -> ::c_int; ++ pub fn pipe( ++ fds: *mut ::c_int, ++ psize: ::c_uint, ++ textmode: ::c_int, ++ ) -> ::c_int; + #[link_name = "_read"] + pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::c_uint) -> ::c_int; + #[link_name = "_rmdir"] +@@ -383,7 +512,11 @@ extern { + #[link_name = "_unlink"] + pub fn unlink(c: *const c_char) -> ::c_int; + #[link_name = "_write"] +- pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::c_uint) -> ::c_int; ++ pub fn write( ++ fd: ::c_int, ++ buf: *const ::c_void, ++ count: ::c_uint, ++ ) -> ::c_int; + #[link_name = "_commit"] + pub fn commit(fd: ::c_int) -> ::c_int; + #[link_name = "_get_osfhandle"] +@@ -392,36 +525,76 @@ extern { + pub fn open_osfhandle(osfhandle: ::intptr_t, flags: ::c_int) -> ::c_int; + pub fn setlocale(category: ::c_int, locale: *const c_char) -> *mut c_char; + #[link_name = "_wsetlocale"] +- pub fn wsetlocale(category: ::c_int, +- locale: *const wchar_t) -> *mut wchar_t; ++ pub fn wsetlocale( ++ category: ::c_int, ++ locale: *const wchar_t, ++ ) -> *mut wchar_t; ++ #[link_name = "_aligned_malloc"] ++ pub fn aligned_malloc(size: size_t, alignment: size_t) -> *mut c_void; + } + + extern "system" { + pub fn listen(s: SOCKET, backlog: ::c_int) -> ::c_int; +- pub fn accept(s: SOCKET, addr: *mut ::sockaddr, +- addrlen: *mut ::c_int) -> SOCKET; +- pub fn bind(s: SOCKET, name: *const ::sockaddr, +- namelen: ::c_int) -> ::c_int; +- pub fn connect(s: SOCKET, name: *const ::sockaddr, +- namelen: ::c_int) -> ::c_int; +- pub fn getpeername(s: SOCKET, name: *mut ::sockaddr, +- nameln: *mut ::c_int) -> ::c_int; +- pub fn getsockname(s: SOCKET, name: *mut ::sockaddr, +- nameln: *mut ::c_int) -> ::c_int; +- pub fn getsockopt(s: SOCKET, level: ::c_int, optname: ::c_int, +- optval: *mut ::c_char, +- optlen: *mut ::c_int) -> ::c_int; +- pub fn recvfrom(s: SOCKET, buf: *mut ::c_char, len: ::c_int, +- flags: ::c_int, from: *mut ::sockaddr, +- fromlen: *mut ::c_int) -> ::c_int; +- pub fn sendto(s: SOCKET, buf: *const ::c_char, len: ::c_int, +- flags: ::c_int, to: *const ::sockaddr, +- tolen: ::c_int) -> ::c_int; +- pub fn setsockopt(s: SOCKET, level: ::c_int, optname: ::c_int, +- optval: *const ::c_char, +- optlen: ::c_int) -> ::c_int; +- pub fn socket(af: ::c_int, socket_type: ::c_int, +- protocol: ::c_int) -> SOCKET; ++ pub fn accept( ++ s: SOCKET, ++ addr: *mut ::sockaddr, ++ addrlen: *mut ::c_int, ++ ) -> SOCKET; ++ pub fn bind( ++ s: SOCKET, ++ name: *const ::sockaddr, ++ namelen: ::c_int, ++ ) -> ::c_int; ++ pub fn connect( ++ s: SOCKET, ++ name: *const ::sockaddr, ++ namelen: ::c_int, ++ ) -> ::c_int; ++ pub fn getpeername( ++ s: SOCKET, ++ name: *mut ::sockaddr, ++ nameln: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn getsockname( ++ s: SOCKET, ++ name: *mut ::sockaddr, ++ nameln: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn getsockopt( ++ s: SOCKET, ++ level: ::c_int, ++ optname: ::c_int, ++ optval: *mut ::c_char, ++ optlen: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn recvfrom( ++ s: SOCKET, ++ buf: *mut ::c_char, ++ len: ::c_int, ++ flags: ::c_int, ++ from: *mut ::sockaddr, ++ fromlen: *mut ::c_int, ++ ) -> ::c_int; ++ pub fn sendto( ++ s: SOCKET, ++ buf: *const ::c_char, ++ len: ::c_int, ++ flags: ::c_int, ++ to: *const ::sockaddr, ++ tolen: ::c_int, ++ ) -> ::c_int; ++ pub fn setsockopt( ++ s: SOCKET, ++ level: ::c_int, ++ optname: ::c_int, ++ optval: *const ::c_char, ++ optlen: ::c_int, ++ ) -> ::c_int; ++ pub fn socket( ++ af: ::c_int, ++ socket_type: ::c_int, ++ protocol: ::c_int, ++ ) -> SOCKET; + } + + cfg_if! { +diff --git a/third_party/rust/libc/src/windows/msvc.rs b/third_party/rust/libc/src/windows/msvc.rs +index 1ebfcadd16444f06f9d49c06efe0b25329fa90ab..8f20deb5dfb555efad2be98ba4b8da679aefb070 100644 +--- a/third_party/rust/libc/src/windows/msvc.rs ++++ b/third_party/rust/libc/src/windows/msvc.rs +@@ -1,10 +1,17 @@ + pub const L_tmpnam: ::c_uint = 260; + pub const TMP_MAX: ::c_uint = 0x7fff_ffff; + +-extern { ++// POSIX Supplement (from errno.h) ++// This particular error code is only currently available in msvc toolchain ++pub const EOTHER: ::c_int = 131; ++ ++extern "C" { + #[link_name = "_stricmp"] + pub fn stricmp(s1: *const ::c_char, s2: *const ::c_char) -> ::c_int; + #[link_name = "_strnicmp"] +- pub fn strnicmp(s1: *const ::c_char, s2: *const ::c_char, +- n: ::size_t) -> ::c_int; ++ pub fn strnicmp( ++ s1: *const ::c_char, ++ s2: *const ::c_char, ++ n: ::size_t, ++ ) -> ::c_int; + } +diff --git a/third_party/rust/libc/tests/const_fn.rs b/third_party/rust/libc/tests/const_fn.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..0e7e1864b9f85233669f98fe99c78f71a755b2e8 +--- /dev/null ++++ b/third_party/rust/libc/tests/const_fn.rs +@@ -0,0 +1,5 @@ ++#![cfg(libc_const_extern_fn)] // If this does not hold, the file is empty ++ ++#[cfg(target_os = "linux")] ++const _FOO: libc::c_uint = unsafe { libc::CMSG_SPACE(1) }; ++//^ if CMSG_SPACE is not const, this will fail to compile +diff --git a/third_party/rust/libc/triagebot.toml b/third_party/rust/libc/triagebot.toml +new file mode 100644 +index 0000000000000000000000000000000000000000..fa0824ac53c0a9c130636512c0271fc3f0e9c0e6 +--- /dev/null ++++ b/third_party/rust/libc/triagebot.toml +@@ -0,0 +1 @@ ++[assign] +diff --git a/third_party/rust/lucet-module/.cargo-checksum.json b/third_party/rust/lucet-module-wasmsbx/.cargo-checksum.json +similarity index 89% +rename from third_party/rust/lucet-module/.cargo-checksum.json +rename to third_party/rust/lucet-module-wasmsbx/.cargo-checksum.json +index 5e3b0f3dde4b98a76677c311a98fb30946d8af4a..b5656b73bfd73105a526719327bdb403cc03b720 100644 +--- a/third_party/rust/lucet-module/.cargo-checksum.json ++++ b/third_party/rust/lucet-module-wasmsbx/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"541f0b13e6f51d7ce1e61275aaaeeaabd38ae9f3e5b6bb1d5b543be416449546","src/bindings.rs":"bb0bcfb2e328f139d7d34b95d91ac64008c54fbf2748caf818b4a6af6c3bec14","src/error.rs":"1c938dfd33b790eb97e920785aadc7b4a2796d8e2e806b6083593ccf173d43d1","src/functions.rs":"29f4e4bd91986680d7d06ed6f5ccbb8bc734b52316e5bf9ac40ced45cbc8b149","src/globals.rs":"18841f6f5d6163673de5e9dfd641b1c558e9ad984418cbf94691059a1c4ed2a2","src/lib.rs":"759adce1db8c138294edcc47610f905e89da2e3ba5e62e3cef769ba1556ae174","src/linear_memory.rs":"aa62a57ad0783508465dc43bd22167c33d15efb32e44b9aeba6ff86ea72051ef","src/module.rs":"56f37d2892fe91d19afc49d2f62b562f0f71a21f21aec205b5368c733329d629","src/module_data.rs":"9e08e44ce8aaa90ae60240eb8feb693d5ca36dc42df55147617f5c3b636b9b8b","src/runtime.rs":"0532a55d2649eb6ea486a70c278ccbc243255cdbf5462739c0db6a2e73cb4d1a","src/signature.rs":"c1606419111edec1895762c212c7116a0d39670c8d303b5af0f58295ba15cfc4","src/tables.rs":"efe9aa8ae3602cce8aa093e220d63490b17907be8ed192024939445ff8b8922b","src/traps.rs":"2ff45ff2438f18ca1740182cf9735cbb789125bd57214e5a140b3bcd5295a433","src/types.rs":"d354b3a9f96b768dc7a8885b9fefa2efc1e01bcb66e5028e5f787247d1b2abb2","tests/bindings/bad_bindings.json":"7c5ad85eb0a222985857b6ff35246dccfa2a35de415d57fd712264ca7e078934","tests/bindings/bindings_test.json":"2e3ed6ff5d18da665d5c2fb24e279f009092f21bba6deff221db7a5770a6a3d4","tests/bindings/garbage.json":"f956f64c8c23ecf2aa6226fa7abc5f52eee2fa861e12ceac3bddbdf0602a174b"},"package":null} +\ No newline at end of file ++{"files":{"Cargo.toml":"9049dc7763fd6af5c4d4f9e924f61dfe99e63c03f627c4dc2880b01cc1dfa3fd","src/bindings.rs":"bb0bcfb2e328f139d7d34b95d91ac64008c54fbf2748caf818b4a6af6c3bec14","src/error.rs":"1c938dfd33b790eb97e920785aadc7b4a2796d8e2e806b6083593ccf173d43d1","src/functions.rs":"29f4e4bd91986680d7d06ed6f5ccbb8bc734b52316e5bf9ac40ced45cbc8b149","src/globals.rs":"18841f6f5d6163673de5e9dfd641b1c558e9ad984418cbf94691059a1c4ed2a2","src/lib.rs":"759adce1db8c138294edcc47610f905e89da2e3ba5e62e3cef769ba1556ae174","src/linear_memory.rs":"aa62a57ad0783508465dc43bd22167c33d15efb32e44b9aeba6ff86ea72051ef","src/module.rs":"56f37d2892fe91d19afc49d2f62b562f0f71a21f21aec205b5368c733329d629","src/module_data.rs":"9e08e44ce8aaa90ae60240eb8feb693d5ca36dc42df55147617f5c3b636b9b8b","src/runtime.rs":"0532a55d2649eb6ea486a70c278ccbc243255cdbf5462739c0db6a2e73cb4d1a","src/signature.rs":"c1606419111edec1895762c212c7116a0d39670c8d303b5af0f58295ba15cfc4","src/tables.rs":"efe9aa8ae3602cce8aa093e220d63490b17907be8ed192024939445ff8b8922b","src/traps.rs":"2ff45ff2438f18ca1740182cf9735cbb789125bd57214e5a140b3bcd5295a433","src/types.rs":"d354b3a9f96b768dc7a8885b9fefa2efc1e01bcb66e5028e5f787247d1b2abb2","tests/bindings/bad_bindings.json":"7c5ad85eb0a222985857b6ff35246dccfa2a35de415d57fd712264ca7e078934","tests/bindings/bindings_test.json":"2e3ed6ff5d18da665d5c2fb24e279f009092f21bba6deff221db7a5770a6a3d4","tests/bindings/garbage.json":"f956f64c8c23ecf2aa6226fa7abc5f52eee2fa861e12ceac3bddbdf0602a174b"},"package":null} +\ No newline at end of file +diff --git a/third_party/rust/lucet-module/Cargo.toml b/third_party/rust/lucet-module-wasmsbx/Cargo.toml +similarity index 92% +rename from third_party/rust/lucet-module/Cargo.toml +rename to third_party/rust/lucet-module-wasmsbx/Cargo.toml +index 6d3d862c141ec200c58703460ed5355a5f753fad..5dd20ba20af27e4e1cb1ed2f0153ffbf62de4211 100644 +--- a/third_party/rust/lucet-module/Cargo.toml ++++ b/third_party/rust/lucet-module-wasmsbx/Cargo.toml +@@ -1,5 +1,5 @@ + [package] +-name = "lucet-module" ++name = "lucet-module-wasmsbx" + version = "0.1.1" + description = "A structured interface for Lucet modules" + homepage = "https://github.com/fastly/lucet" +@@ -18,7 +18,7 @@ bincode = "1.1.4" + num-derive = "0.3" + num-traits = "0.2" + # minisign = { version = "0.5.11", optional = true } +-object = ">=0.12" ++object = ">=0.12, <0.18" + byteorder = "1.3" + + [features] +diff --git a/third_party/rust/lucet-module/src/bindings.rs b/third_party/rust/lucet-module-wasmsbx/src/bindings.rs +similarity index 100% +rename from third_party/rust/lucet-module/src/bindings.rs +rename to third_party/rust/lucet-module-wasmsbx/src/bindings.rs +diff --git a/third_party/rust/lucet-module/src/error.rs b/third_party/rust/lucet-module-wasmsbx/src/error.rs +similarity index 100% +rename from third_party/rust/lucet-module/src/error.rs +rename to third_party/rust/lucet-module-wasmsbx/src/error.rs +diff --git a/third_party/rust/lucet-module/src/functions.rs b/third_party/rust/lucet-module-wasmsbx/src/functions.rs +similarity index 100% +rename from third_party/rust/lucet-module/src/functions.rs +rename to third_party/rust/lucet-module-wasmsbx/src/functions.rs +diff --git a/third_party/rust/lucet-module/src/globals.rs b/third_party/rust/lucet-module-wasmsbx/src/globals.rs +similarity index 100% +rename from third_party/rust/lucet-module/src/globals.rs +rename to third_party/rust/lucet-module-wasmsbx/src/globals.rs +diff --git a/third_party/rust/lucet-module/src/lib.rs b/third_party/rust/lucet-module-wasmsbx/src/lib.rs +similarity index 100% +rename from third_party/rust/lucet-module/src/lib.rs +rename to third_party/rust/lucet-module-wasmsbx/src/lib.rs +diff --git a/third_party/rust/lucet-module/src/linear_memory.rs b/third_party/rust/lucet-module-wasmsbx/src/linear_memory.rs +similarity index 100% +rename from third_party/rust/lucet-module/src/linear_memory.rs +rename to third_party/rust/lucet-module-wasmsbx/src/linear_memory.rs +diff --git a/third_party/rust/lucet-module/src/module.rs b/third_party/rust/lucet-module-wasmsbx/src/module.rs +similarity index 100% +rename from third_party/rust/lucet-module/src/module.rs +rename to third_party/rust/lucet-module-wasmsbx/src/module.rs +diff --git a/third_party/rust/lucet-module/src/module_data.rs b/third_party/rust/lucet-module-wasmsbx/src/module_data.rs +similarity index 100% +rename from third_party/rust/lucet-module/src/module_data.rs +rename to third_party/rust/lucet-module-wasmsbx/src/module_data.rs +diff --git a/third_party/rust/lucet-module/src/runtime.rs b/third_party/rust/lucet-module-wasmsbx/src/runtime.rs +similarity index 100% +rename from third_party/rust/lucet-module/src/runtime.rs +rename to third_party/rust/lucet-module-wasmsbx/src/runtime.rs +diff --git a/third_party/rust/lucet-module/src/signature.rs b/third_party/rust/lucet-module-wasmsbx/src/signature.rs +similarity index 100% +rename from third_party/rust/lucet-module/src/signature.rs +rename to third_party/rust/lucet-module-wasmsbx/src/signature.rs +diff --git a/third_party/rust/lucet-module/src/tables.rs b/third_party/rust/lucet-module-wasmsbx/src/tables.rs +similarity index 100% +rename from third_party/rust/lucet-module/src/tables.rs +rename to third_party/rust/lucet-module-wasmsbx/src/tables.rs +diff --git a/third_party/rust/lucet-module/src/traps.rs b/third_party/rust/lucet-module-wasmsbx/src/traps.rs +similarity index 100% +rename from third_party/rust/lucet-module/src/traps.rs +rename to third_party/rust/lucet-module-wasmsbx/src/traps.rs +diff --git a/third_party/rust/lucet-module/src/types.rs b/third_party/rust/lucet-module-wasmsbx/src/types.rs +similarity index 100% +rename from third_party/rust/lucet-module/src/types.rs +rename to third_party/rust/lucet-module-wasmsbx/src/types.rs +diff --git a/third_party/rust/lucet-module/tests/bindings/bad_bindings.json b/third_party/rust/lucet-module-wasmsbx/tests/bindings/bad_bindings.json +similarity index 100% +rename from third_party/rust/lucet-module/tests/bindings/bad_bindings.json +rename to third_party/rust/lucet-module-wasmsbx/tests/bindings/bad_bindings.json +diff --git a/third_party/rust/lucet-module/tests/bindings/bindings_test.json b/third_party/rust/lucet-module-wasmsbx/tests/bindings/bindings_test.json +similarity index 100% +rename from third_party/rust/lucet-module/tests/bindings/bindings_test.json +rename to third_party/rust/lucet-module-wasmsbx/tests/bindings/bindings_test.json +diff --git a/third_party/rust/lucet-module/tests/bindings/garbage.json b/third_party/rust/lucet-module-wasmsbx/tests/bindings/garbage.json +similarity index 100% +rename from third_party/rust/lucet-module/tests/bindings/garbage.json +rename to third_party/rust/lucet-module-wasmsbx/tests/bindings/garbage.json +diff --git a/third_party/rust/lucet-runtime-internals/.cargo-checksum.json b/third_party/rust/lucet-runtime-internals-wasmsbx/.cargo-checksum.json +similarity index 93% +rename from third_party/rust/lucet-runtime-internals/.cargo-checksum.json +rename to third_party/rust/lucet-runtime-internals-wasmsbx/.cargo-checksum.json +index 57dc0da558ce33641fbade0b4b216c3dfe42a30f..1e062a7a7e3503a707c7de541bbdbedd8038db67 100644 +--- a/third_party/rust/lucet-runtime-internals/.cargo-checksum.json ++++ b/third_party/rust/lucet-runtime-internals-wasmsbx/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"60850f9a0002833508a6c2ecfa7ec8e11c3b5708934a7b74faa93246cd9b75ee","build.rs":"ae539feaad828d15cbe4924e8de5ae38c7d0086200a5c4d494edf8e8e28c074e","src/alloc/mod.rs":"6aac9fa3fd238de17d6270fab6e9677ade40dbbff9d700494f9a78084da1ccd3","src/alloc/tests.rs":"3aada1196dae1b03106e63f6892b9fc019cf9627b99b278765668c56df82bc79","src/c_api.rs":"cb42793d891597ac903636d4726d64a94507a583d44bd350571ce104db4fcc0a","src/context/context_asm.S":"6b0fe86e5e7f3699482d94819f67ead933aaf91da89f79da0d8a75fa71ba4380","src/context/mod.rs":"98452bfad053d4cd4143afed620233538688cf2bac857b0c4569f42ee8d6d844","src/context/tests/c_child.c":"a9ad91367ac37e7406a587f971858aa7758913f634ea7ae88fccc7f487a3c4fc","src/context/tests/c_child.rs":"33c0472401795d61af2a706cc69d62b69225159a10cfc55e4b0c6e15321f0964","src/context/tests/mod.rs":"5d1bc979aaea2870a8c3a3db66cde21d16d9aab20b898da2c67d6aa1f1f5c292","src/context/tests/rust_child.rs":"ed69940a0b426eef5f9524f06ca215d0952cf4b00d8ebcf8837077849502d075","src/embed_ctx.rs":"57ae60c1a50cf84af23dc529a154db21cbb58c52c8067b9f87069dd600b99473","src/error.rs":"fd09389d5112b04ea76ffed0a7b2a8180c524cded90e33e36399a690c5714e2e","src/hostcall_macros.rs":"b4a2fdd876eee50bec4188f7d9f7c708d71600974cc2b52ff38c7daaa63cb225","src/instance.rs":"04bf1dddd9a980579b3baef77b83f19e8187a085aee6276a0fd4e60af7918e7a","src/instance/siginfo_ext.c":"8ee3a54ef2b93041ca07ecce70ebeb8d421c8ad1257122d9e8ef064d2d45a4a4","src/instance/siginfo_ext.rs":"529b4cc7ce6eea140c17a97477cc862f9d224e40cc24687223a478696d27b971","src/instance/signals.rs":"37d7cff815169fdab680d2931f6236d4e912c34621b9c99192b0147450bb6bc1","src/instance/state.rs":"490278c7222fc22248c8f545364a5d522da721c35f5b5e814658dc90e8ed77bd","src/lib.rs":"0c97e40191f17826feccff762898a0f4cafd1ed45cc3e81c07f9f446e263a422","src/module.rs":"29b54cc59cf308d712d9ecf4d595ef10645213e8ea62ec7f3a12adb27089fb47","src/module/dl.rs":"828838d35596e9c4399a5cfc857d680484b953f6ebed17b5dfd8ddf3e77adf82","src/module/mock.rs":"bf397a32bc1f567a5597f92d017a04f5c480e1b07f21b8843b49b49f6dde111a","src/module/sparse_page_data.rs":"84ef79aa4707e5c84d72a38c5ead18156b16ab29c617540e652e851c744449dc","src/region/mmap.rs":"fd41806035e26320136eb770960d514770eab8a4c933b8f17b4c605d02cf421f","src/region/mod.rs":"d2bf8b8c769542299bae9e5ed5d334ca7b431dfd52619ae1487d1494653dfc82","src/sysdeps/linux.rs":"124cc2f0fb0856e23274facdab8ca4631f04cdf8e494d9a4531979efe4ba4ad9","src/sysdeps/macos.rs":"8dc632a9aab98993140a6faefb7c2e313d80e6b9db2e45f54e8d6604cd752a6f","src/sysdeps/mod.rs":"9caed471a08f5f7d39c836a649d0f61d7a84095cee7589cdfc1eafe10eaa866c","src/test_helpers.rs":"72d1aeb9ca9c512aadcecac7ad0869c883c13134fced9f625075dc5e2741c55d","src/val.rs":"503891cd17892349b931d49ed3cdc0c9fc572da47d4c8f8f94fee30f5f4543a6","src/vmctx.rs":"b401df03b483c827d694f5f9024cf54b40987cff025dd8f292137e8396f56e6e"},"package":null} +\ No newline at end of file ++{"files":{"Cargo.toml":"6f7c26dba788329c4d904bf2dce313de7626f18fc99088984068901ce87936d2","build.rs":"ae539feaad828d15cbe4924e8de5ae38c7d0086200a5c4d494edf8e8e28c074e","src/alloc/mod.rs":"6aac9fa3fd238de17d6270fab6e9677ade40dbbff9d700494f9a78084da1ccd3","src/alloc/tests.rs":"3aada1196dae1b03106e63f6892b9fc019cf9627b99b278765668c56df82bc79","src/c_api.rs":"cb42793d891597ac903636d4726d64a94507a583d44bd350571ce104db4fcc0a","src/context/context_asm.S":"6b0fe86e5e7f3699482d94819f67ead933aaf91da89f79da0d8a75fa71ba4380","src/context/mod.rs":"98452bfad053d4cd4143afed620233538688cf2bac857b0c4569f42ee8d6d844","src/context/tests/c_child.c":"a9ad91367ac37e7406a587f971858aa7758913f634ea7ae88fccc7f487a3c4fc","src/context/tests/c_child.rs":"33c0472401795d61af2a706cc69d62b69225159a10cfc55e4b0c6e15321f0964","src/context/tests/mod.rs":"5d1bc979aaea2870a8c3a3db66cde21d16d9aab20b898da2c67d6aa1f1f5c292","src/context/tests/rust_child.rs":"ed69940a0b426eef5f9524f06ca215d0952cf4b00d8ebcf8837077849502d075","src/embed_ctx.rs":"57ae60c1a50cf84af23dc529a154db21cbb58c52c8067b9f87069dd600b99473","src/error.rs":"fd09389d5112b04ea76ffed0a7b2a8180c524cded90e33e36399a690c5714e2e","src/hostcall_macros.rs":"b4a2fdd876eee50bec4188f7d9f7c708d71600974cc2b52ff38c7daaa63cb225","src/instance.rs":"04bf1dddd9a980579b3baef77b83f19e8187a085aee6276a0fd4e60af7918e7a","src/instance/siginfo_ext.c":"8ee3a54ef2b93041ca07ecce70ebeb8d421c8ad1257122d9e8ef064d2d45a4a4","src/instance/siginfo_ext.rs":"529b4cc7ce6eea140c17a97477cc862f9d224e40cc24687223a478696d27b971","src/instance/signals.rs":"37d7cff815169fdab680d2931f6236d4e912c34621b9c99192b0147450bb6bc1","src/instance/state.rs":"490278c7222fc22248c8f545364a5d522da721c35f5b5e814658dc90e8ed77bd","src/lib.rs":"0c97e40191f17826feccff762898a0f4cafd1ed45cc3e81c07f9f446e263a422","src/module.rs":"29b54cc59cf308d712d9ecf4d595ef10645213e8ea62ec7f3a12adb27089fb47","src/module/dl.rs":"828838d35596e9c4399a5cfc857d680484b953f6ebed17b5dfd8ddf3e77adf82","src/module/mock.rs":"bf397a32bc1f567a5597f92d017a04f5c480e1b07f21b8843b49b49f6dde111a","src/module/sparse_page_data.rs":"84ef79aa4707e5c84d72a38c5ead18156b16ab29c617540e652e851c744449dc","src/region/mmap.rs":"fd41806035e26320136eb770960d514770eab8a4c933b8f17b4c605d02cf421f","src/region/mod.rs":"d2bf8b8c769542299bae9e5ed5d334ca7b431dfd52619ae1487d1494653dfc82","src/sysdeps/linux.rs":"124cc2f0fb0856e23274facdab8ca4631f04cdf8e494d9a4531979efe4ba4ad9","src/sysdeps/macos.rs":"8dc632a9aab98993140a6faefb7c2e313d80e6b9db2e45f54e8d6604cd752a6f","src/sysdeps/mod.rs":"9caed471a08f5f7d39c836a649d0f61d7a84095cee7589cdfc1eafe10eaa866c","src/test_helpers.rs":"72d1aeb9ca9c512aadcecac7ad0869c883c13134fced9f625075dc5e2741c55d","src/val.rs":"503891cd17892349b931d49ed3cdc0c9fc572da47d4c8f8f94fee30f5f4543a6","src/vmctx.rs":"b401df03b483c827d694f5f9024cf54b40987cff025dd8f292137e8396f56e6e"},"package":null} +\ No newline at end of file +diff --git a/third_party/rust/lucet-runtime-internals/Cargo.toml b/third_party/rust/lucet-runtime-internals-wasmsbx/Cargo.toml +similarity index 53% +rename from third_party/rust/lucet-runtime-internals/Cargo.toml +rename to third_party/rust/lucet-runtime-internals-wasmsbx/Cargo.toml +index bcac1f88e593baba21e5a3ff17e033686e48aacb..b48540fdf68e8a175df249ce6ab29f7c51f396bd 100644 +--- a/third_party/rust/lucet-runtime-internals/Cargo.toml ++++ b/third_party/rust/lucet-runtime-internals-wasmsbx/Cargo.toml +@@ -1,5 +1,5 @@ + [package] +-name = "lucet-runtime-internals" ++name = "lucet-runtime-internals-wasmsbx" + version = "0.1.1" + description = "Pure Rust runtime for Lucet WebAssembly toolchain (internals)" + homepage = "https://github.com/fastly/lucet" +@@ -10,14 +10,14 @@ authors = ["Lucet team "] + edition = "2018" + + [dependencies] +-lucet-module = { path = "../../lucet-module", version = "0.1.1" } ++lucet-module = { path = "../../lucet-module", version = "0.1.1", package="lucet-module-wasmsbx" } + + bitflags = "1.0" + bincode = "1.1.4" + byteorder = "1.3" + failure = "0.1" + lazy_static = "1.1" +-libc = "=0.2.59" ++libc = "0.2.65" + libloading = "0.5" + memoffset = "0.5.1" + nix = "0.13" +@@ -26,13 +26,6 @@ num-traits = "0.2" + xfailure = "0.1" + raw-cpuid = "7.0.3" + +-# This is only a dependency to ensure that other crates don't pick a newer version as a transitive +-# dependency. `0.1.3 < getrandom <= 0.1.6` cause `lazy_static` to pull in spinlock implementations +-# of concurrency primitives, which for unknown reasons cause our signal handling code to +-# nondeterministically segfault. The maintainers have since removed the `lazy_static` dependency +-# from `getrandom`, but until a new release is cut, this keeps it on a safe version. +-getrandom = "=0.1.3" +- + [dev-dependencies] + byteorder = "1.2" + +diff --git a/third_party/rust/lucet-runtime-internals/build.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/build.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/build.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/build.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/alloc/mod.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/alloc/mod.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/alloc/mod.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/alloc/mod.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/alloc/tests.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/alloc/tests.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/alloc/tests.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/alloc/tests.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/c_api.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/c_api.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/c_api.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/c_api.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/context/context_asm.S b/third_party/rust/lucet-runtime-internals-wasmsbx/src/context/context_asm.S +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/context/context_asm.S +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/context/context_asm.S +diff --git a/third_party/rust/lucet-runtime-internals/src/context/mod.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/context/mod.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/context/mod.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/context/mod.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/context/tests/c_child.c b/third_party/rust/lucet-runtime-internals-wasmsbx/src/context/tests/c_child.c +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/context/tests/c_child.c +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/context/tests/c_child.c +diff --git a/third_party/rust/lucet-runtime-internals/src/context/tests/c_child.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/context/tests/c_child.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/context/tests/c_child.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/context/tests/c_child.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/context/tests/mod.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/context/tests/mod.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/context/tests/mod.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/context/tests/mod.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/context/tests/rust_child.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/context/tests/rust_child.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/context/tests/rust_child.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/context/tests/rust_child.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/embed_ctx.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/embed_ctx.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/embed_ctx.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/embed_ctx.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/error.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/error.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/error.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/error.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/hostcall_macros.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/hostcall_macros.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/hostcall_macros.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/hostcall_macros.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/instance.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/instance.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/instance.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/instance.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/instance/siginfo_ext.c b/third_party/rust/lucet-runtime-internals-wasmsbx/src/instance/siginfo_ext.c +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/instance/siginfo_ext.c +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/instance/siginfo_ext.c +diff --git a/third_party/rust/lucet-runtime-internals/src/instance/siginfo_ext.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/instance/siginfo_ext.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/instance/siginfo_ext.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/instance/siginfo_ext.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/instance/signals.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/instance/signals.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/instance/signals.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/instance/signals.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/instance/state.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/instance/state.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/instance/state.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/instance/state.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/lib.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/lib.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/lib.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/lib.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/module.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/module.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/module.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/module.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/module/dl.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/module/dl.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/module/dl.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/module/dl.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/module/mock.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/module/mock.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/module/mock.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/module/mock.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/module/sparse_page_data.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/module/sparse_page_data.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/module/sparse_page_data.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/module/sparse_page_data.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/region/mmap.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/region/mmap.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/region/mmap.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/region/mmap.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/region/mod.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/region/mod.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/region/mod.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/region/mod.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/sysdeps/linux.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/sysdeps/linux.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/sysdeps/linux.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/sysdeps/linux.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/sysdeps/macos.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/sysdeps/macos.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/sysdeps/macos.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/sysdeps/macos.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/sysdeps/mod.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/sysdeps/mod.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/sysdeps/mod.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/sysdeps/mod.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/test_helpers.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/test_helpers.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/test_helpers.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/test_helpers.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/val.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/val.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/val.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/val.rs +diff --git a/third_party/rust/lucet-runtime-internals/src/vmctx.rs b/third_party/rust/lucet-runtime-internals-wasmsbx/src/vmctx.rs +similarity index 100% +rename from third_party/rust/lucet-runtime-internals/src/vmctx.rs +rename to third_party/rust/lucet-runtime-internals-wasmsbx/src/vmctx.rs +diff --git a/third_party/rust/lucet-runtime/.cargo-checksum.json b/third_party/rust/lucet-runtime-wasmsbx/.cargo-checksum.json +similarity index 95% +rename from third_party/rust/lucet-runtime/.cargo-checksum.json +rename to third_party/rust/lucet-runtime-wasmsbx/.cargo-checksum.json +index b10686c3456042e15ec939caff516b2d56848004..1c9f594bc334019c57dd67de54c993981d18d95b 100644 +--- a/third_party/rust/lucet-runtime/.cargo-checksum.json ++++ b/third_party/rust/lucet-runtime-wasmsbx/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"d5bb2276a7550ff7863e938a82168d721f2eabb917599e953e556f645fe1b6e1","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","build.rs":"d56fd4e2fe9d0830aee061be443ef0b541ed98dd6a4233220a51745478b3fb77","include/lucet.h":"89ff353483287040e07e3f6eaeed4286cb06f541fb67057f9fdbbf844a7ec928","include/lucet_types.h":"95c7793034c71e123fac04ce61dc89f4930360b6d4af0f40582c84357fd6877d","include/lucet_val.h":"220b862b0280ac4f7962d44520f6cc34a47f3b3a34b8ecf389e6111cd95b8bf0","include/lucet_vmctx.h":"044ca80cf8cca51620de3f113a1c07c00ebecea108a45288f9b87e5e2fbb820c","src/c_api.rs":"97e28537fffeac5d21f09911a3474114997ce0268492edb8010ce8ca178a6c64","src/lib.rs":"48f0ba473b4da3616bddfce3cda00cf836eca3c9e7b055855156c1c167a6f908","tests/c_api.c":"772716a14ceed6913a3670d8ca3fcf0cb0c376493cabae4c8b527fb694554b7b","tests/entrypoint.rs":"1d0080e9f71a16f61e69c21922ac1c2207b2003fb13d3bacafb681be5cceb8b9","tests/globals.rs":"56248c5cefbaad546b08964d9193e5c16a461e974d1c9c520ebba3f1cf32af66","tests/guest_fault.rs":"cb4728d0851148f992c944199f4fc98595070d0879e1ddf5361419e4fc330ad3","tests/guests/null.c":"de2bf0dc98ac1acaef8cb856a300119aa1300d228a1dceb0b7e06b63d3ac712a","tests/guests/yield_resume.c":"b9c19d9c2d540e042d3488f2cea04a7a98cc75910c68faad738ad835b04dde9d","tests/guests/yield_resume_bindings.json":"e124e940038a552d08495d6f99b7dd8495a011e4a082b32ab8d035e40169d663","tests/host.rs":"0cd5f40ed9725c7ef2f497a4e31f09e88833841240dfbfe971d60724075eac00","tests/instruction_counting.rs":"6aa8c2cf4c32adbbb5bf74e8449dd29d4deff77dcb55947a2d15c4eccbb89d6e","tests/instruction_counting/arithmetic_count.wat":"c347c7a78e4159e45aa5ba299f1d03e1efbb7c635f13dd23053907de7f57193b","tests/instruction_counting/br_table_count.wat":"66cdac7595bd69103f5d1b825a58f09a5624db4e35c91e11ae7b30cc2f53eb0c","tests/instruction_counting/calls.wat":"8212736a55a897937c712bab33c22c62ab96f1b32eef44eab1cbee77f34ba641","tests/instruction_counting/count_after_br.wat":"12df2019f3b0c518bd747e485b423f73a82c91571e834bdeed5d7bd6455f84c0","tests/instruction_counting/empty_loop.wat":"3dfa9ab297a7f8fd21bd22db8ded37de0545ac741be132fdcdf1a61c50cf455a","tests/instruction_counting/empty_loop_2.wat":"c65b4516a1a26f9b8b0117bb1f4fe9282e3bc79052b89f834cad6c202a51f68e","tests/instruction_counting/if_count.wat":"620330be046a3b3890646e8fdbbde6d4a8c4763b450d818ee549e103a1c3e3aa","tests/instruction_counting/if_not_taken_count.wat":"12bdc1f0512016e549bd7656386274c7b7b92d32b5d3eeb73b93d6ef18cc4ff2","tests/instruction_counting/indirect_calls.wat":"f56f6a715a733176168a81ca6cbfd22333ab9755029174a3f7950da9b401320e","tests/instruction_counting/loops.wat":"0cd765b1cf694a2c35df69547b30303731512c937cad05e1c052ebcd7840e3b1","tests/instruction_counting/unreachable_call.wat":"c15653c3ff198f321f8b892c363ec7badad75ec703c5b3a215a6dbfb059a15b7","tests/memory.rs":"73b65dc44978181a5d2a3b39a6d0fc60fd6637e16387c2a7b025baedb16a004f","tests/stack.rs":"5e5939991a55c8ecd579d8c509226ed3ac7bae5a847bdcdac4d285df28d54d6b","tests/start.rs":"7b31f8c289c1ad52d05f17c0c46b0856382b0ff85d6e5579c4346c443eb93fb3","tests/strcmp.rs":"7420aa723630af51360a9e9a3763c2fd8d7c57aa8d4011cfd8ca452376036efb","tests/val.rs":"2e38a7aa10bde34d5cf580a958c07eff8593662a86678427a79d8a5f5bc2efac"},"package":null} +\ No newline at end of file ++{"files":{"Cargo.toml":"60d8bd19066dc4253baa44d665a750a4b831b62f7938b63c0e0d88d439ced9b6","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","build.rs":"d56fd4e2fe9d0830aee061be443ef0b541ed98dd6a4233220a51745478b3fb77","include/lucet.h":"89ff353483287040e07e3f6eaeed4286cb06f541fb67057f9fdbbf844a7ec928","include/lucet_types.h":"95c7793034c71e123fac04ce61dc89f4930360b6d4af0f40582c84357fd6877d","include/lucet_val.h":"220b862b0280ac4f7962d44520f6cc34a47f3b3a34b8ecf389e6111cd95b8bf0","include/lucet_vmctx.h":"044ca80cf8cca51620de3f113a1c07c00ebecea108a45288f9b87e5e2fbb820c","src/c_api.rs":"97e28537fffeac5d21f09911a3474114997ce0268492edb8010ce8ca178a6c64","src/lib.rs":"48f0ba473b4da3616bddfce3cda00cf836eca3c9e7b055855156c1c167a6f908","tests/c_api.c":"772716a14ceed6913a3670d8ca3fcf0cb0c376493cabae4c8b527fb694554b7b","tests/entrypoint.rs":"1d0080e9f71a16f61e69c21922ac1c2207b2003fb13d3bacafb681be5cceb8b9","tests/globals.rs":"56248c5cefbaad546b08964d9193e5c16a461e974d1c9c520ebba3f1cf32af66","tests/guest_fault.rs":"cb4728d0851148f992c944199f4fc98595070d0879e1ddf5361419e4fc330ad3","tests/guests/null.c":"de2bf0dc98ac1acaef8cb856a300119aa1300d228a1dceb0b7e06b63d3ac712a","tests/guests/yield_resume.c":"b9c19d9c2d540e042d3488f2cea04a7a98cc75910c68faad738ad835b04dde9d","tests/guests/yield_resume_bindings.json":"e124e940038a552d08495d6f99b7dd8495a011e4a082b32ab8d035e40169d663","tests/host.rs":"0cd5f40ed9725c7ef2f497a4e31f09e88833841240dfbfe971d60724075eac00","tests/instruction_counting.rs":"6aa8c2cf4c32adbbb5bf74e8449dd29d4deff77dcb55947a2d15c4eccbb89d6e","tests/instruction_counting/arithmetic_count.wat":"c347c7a78e4159e45aa5ba299f1d03e1efbb7c635f13dd23053907de7f57193b","tests/instruction_counting/br_table_count.wat":"66cdac7595bd69103f5d1b825a58f09a5624db4e35c91e11ae7b30cc2f53eb0c","tests/instruction_counting/calls.wat":"8212736a55a897937c712bab33c22c62ab96f1b32eef44eab1cbee77f34ba641","tests/instruction_counting/count_after_br.wat":"12df2019f3b0c518bd747e485b423f73a82c91571e834bdeed5d7bd6455f84c0","tests/instruction_counting/empty_loop.wat":"3dfa9ab297a7f8fd21bd22db8ded37de0545ac741be132fdcdf1a61c50cf455a","tests/instruction_counting/empty_loop_2.wat":"c65b4516a1a26f9b8b0117bb1f4fe9282e3bc79052b89f834cad6c202a51f68e","tests/instruction_counting/if_count.wat":"620330be046a3b3890646e8fdbbde6d4a8c4763b450d818ee549e103a1c3e3aa","tests/instruction_counting/if_not_taken_count.wat":"12bdc1f0512016e549bd7656386274c7b7b92d32b5d3eeb73b93d6ef18cc4ff2","tests/instruction_counting/indirect_calls.wat":"f56f6a715a733176168a81ca6cbfd22333ab9755029174a3f7950da9b401320e","tests/instruction_counting/loops.wat":"0cd765b1cf694a2c35df69547b30303731512c937cad05e1c052ebcd7840e3b1","tests/instruction_counting/unreachable_call.wat":"c15653c3ff198f321f8b892c363ec7badad75ec703c5b3a215a6dbfb059a15b7","tests/memory.rs":"73b65dc44978181a5d2a3b39a6d0fc60fd6637e16387c2a7b025baedb16a004f","tests/stack.rs":"5e5939991a55c8ecd579d8c509226ed3ac7bae5a847bdcdac4d285df28d54d6b","tests/start.rs":"7b31f8c289c1ad52d05f17c0c46b0856382b0ff85d6e5579c4346c443eb93fb3","tests/strcmp.rs":"7420aa723630af51360a9e9a3763c2fd8d7c57aa8d4011cfd8ca452376036efb","tests/val.rs":"2e38a7aa10bde34d5cf580a958c07eff8593662a86678427a79d8a5f5bc2efac"},"package":null} +\ No newline at end of file +diff --git a/third_party/rust/lucet-runtime/Cargo.toml b/third_party/rust/lucet-runtime-wasmsbx/Cargo.toml +similarity index 86% +rename from third_party/rust/lucet-runtime/Cargo.toml +rename to third_party/rust/lucet-runtime-wasmsbx/Cargo.toml +index cb38fd5f93cdcc5f70c49a9be7fc6543bc8d4b5c..4c114da7d6febf8e0ccbd31924d6637ffff75af1 100644 +--- a/third_party/rust/lucet-runtime/Cargo.toml ++++ b/third_party/rust/lucet-runtime-wasmsbx/Cargo.toml +@@ -1,5 +1,5 @@ + [package] +-name = "lucet-runtime" ++name = "lucet-runtime-wasmsbx" + version = "0.1.1" + description = "Pure Rust runtime for Lucet WebAssembly toolchain" + homepage = "https://github.com/fastly/lucet" +@@ -10,9 +10,9 @@ authors = ["Lucet team "] + edition = "2018" + + [dependencies] +-libc = "=0.2.59" +-lucet-runtime-internals = { path = "lucet-runtime-internals", version = "0.1.1" } +-lucet-module = { path = "../lucet-module", version = "0.1.1" } ++libc = "0.2.65" ++lucet-runtime-internals = { path = "lucet-runtime-internals", version = "0.1.1", package = "lucet-runtime-internals-wasmsbx" } ++lucet-module = { path = "../lucet-module", version = "0.1.1", package="lucet-module-wasmsbx" } + num-traits = "0.2" + num-derive = "0.3" + +diff --git a/third_party/rust/lucet-runtime/LICENSE b/third_party/rust/lucet-runtime-wasmsbx/LICENSE +similarity index 100% +rename from third_party/rust/lucet-runtime/LICENSE +rename to third_party/rust/lucet-runtime-wasmsbx/LICENSE +diff --git a/third_party/rust/lucet-runtime/build.rs b/third_party/rust/lucet-runtime-wasmsbx/build.rs +similarity index 100% +rename from third_party/rust/lucet-runtime/build.rs +rename to third_party/rust/lucet-runtime-wasmsbx/build.rs +diff --git a/third_party/rust/lucet-runtime/include/lucet.h b/third_party/rust/lucet-runtime-wasmsbx/include/lucet.h +similarity index 100% +rename from third_party/rust/lucet-runtime/include/lucet.h +rename to third_party/rust/lucet-runtime-wasmsbx/include/lucet.h +diff --git a/third_party/rust/lucet-runtime/include/lucet_types.h b/third_party/rust/lucet-runtime-wasmsbx/include/lucet_types.h +similarity index 100% +rename from third_party/rust/lucet-runtime/include/lucet_types.h +rename to third_party/rust/lucet-runtime-wasmsbx/include/lucet_types.h +diff --git a/third_party/rust/lucet-runtime/include/lucet_val.h b/third_party/rust/lucet-runtime-wasmsbx/include/lucet_val.h +similarity index 100% +rename from third_party/rust/lucet-runtime/include/lucet_val.h +rename to third_party/rust/lucet-runtime-wasmsbx/include/lucet_val.h +diff --git a/third_party/rust/lucet-runtime/include/lucet_vmctx.h b/third_party/rust/lucet-runtime-wasmsbx/include/lucet_vmctx.h +similarity index 100% +rename from third_party/rust/lucet-runtime/include/lucet_vmctx.h +rename to third_party/rust/lucet-runtime-wasmsbx/include/lucet_vmctx.h +diff --git a/third_party/rust/lucet-runtime/src/c_api.rs b/third_party/rust/lucet-runtime-wasmsbx/src/c_api.rs +similarity index 100% +rename from third_party/rust/lucet-runtime/src/c_api.rs +rename to third_party/rust/lucet-runtime-wasmsbx/src/c_api.rs +diff --git a/third_party/rust/lucet-runtime/src/lib.rs b/third_party/rust/lucet-runtime-wasmsbx/src/lib.rs +similarity index 100% +rename from third_party/rust/lucet-runtime/src/lib.rs +rename to third_party/rust/lucet-runtime-wasmsbx/src/lib.rs +diff --git a/third_party/rust/lucet-runtime/tests/c_api.c b/third_party/rust/lucet-runtime-wasmsbx/tests/c_api.c +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/c_api.c +rename to third_party/rust/lucet-runtime-wasmsbx/tests/c_api.c +diff --git a/third_party/rust/lucet-runtime/tests/entrypoint.rs b/third_party/rust/lucet-runtime-wasmsbx/tests/entrypoint.rs +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/entrypoint.rs +rename to third_party/rust/lucet-runtime-wasmsbx/tests/entrypoint.rs +diff --git a/third_party/rust/lucet-runtime/tests/globals.rs b/third_party/rust/lucet-runtime-wasmsbx/tests/globals.rs +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/globals.rs +rename to third_party/rust/lucet-runtime-wasmsbx/tests/globals.rs +diff --git a/third_party/rust/lucet-runtime/tests/guest_fault.rs b/third_party/rust/lucet-runtime-wasmsbx/tests/guest_fault.rs +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/guest_fault.rs +rename to third_party/rust/lucet-runtime-wasmsbx/tests/guest_fault.rs +diff --git a/third_party/rust/lucet-runtime/tests/guests/null.c b/third_party/rust/lucet-runtime-wasmsbx/tests/guests/null.c +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/guests/null.c +rename to third_party/rust/lucet-runtime-wasmsbx/tests/guests/null.c +diff --git a/third_party/rust/lucet-runtime/tests/guests/yield_resume.c b/third_party/rust/lucet-runtime-wasmsbx/tests/guests/yield_resume.c +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/guests/yield_resume.c +rename to third_party/rust/lucet-runtime-wasmsbx/tests/guests/yield_resume.c +diff --git a/third_party/rust/lucet-runtime/tests/guests/yield_resume_bindings.json b/third_party/rust/lucet-runtime-wasmsbx/tests/guests/yield_resume_bindings.json +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/guests/yield_resume_bindings.json +rename to third_party/rust/lucet-runtime-wasmsbx/tests/guests/yield_resume_bindings.json +diff --git a/third_party/rust/lucet-runtime/tests/host.rs b/third_party/rust/lucet-runtime-wasmsbx/tests/host.rs +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/host.rs +rename to third_party/rust/lucet-runtime-wasmsbx/tests/host.rs +diff --git a/third_party/rust/lucet-runtime/tests/instruction_counting.rs b/third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting.rs +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/instruction_counting.rs +rename to third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting.rs +diff --git a/third_party/rust/lucet-runtime/tests/instruction_counting/arithmetic_count.wat b/third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/arithmetic_count.wat +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/instruction_counting/arithmetic_count.wat +rename to third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/arithmetic_count.wat +diff --git a/third_party/rust/lucet-runtime/tests/instruction_counting/br_table_count.wat b/third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/br_table_count.wat +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/instruction_counting/br_table_count.wat +rename to third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/br_table_count.wat +diff --git a/third_party/rust/lucet-runtime/tests/instruction_counting/calls.wat b/third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/calls.wat +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/instruction_counting/calls.wat +rename to third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/calls.wat +diff --git a/third_party/rust/lucet-runtime/tests/instruction_counting/count_after_br.wat b/third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/count_after_br.wat +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/instruction_counting/count_after_br.wat +rename to third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/count_after_br.wat +diff --git a/third_party/rust/lucet-runtime/tests/instruction_counting/empty_loop.wat b/third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/empty_loop.wat +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/instruction_counting/empty_loop.wat +rename to third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/empty_loop.wat +diff --git a/third_party/rust/lucet-runtime/tests/instruction_counting/empty_loop_2.wat b/third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/empty_loop_2.wat +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/instruction_counting/empty_loop_2.wat +rename to third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/empty_loop_2.wat +diff --git a/third_party/rust/lucet-runtime/tests/instruction_counting/if_count.wat b/third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/if_count.wat +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/instruction_counting/if_count.wat +rename to third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/if_count.wat +diff --git a/third_party/rust/lucet-runtime/tests/instruction_counting/if_not_taken_count.wat b/third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/if_not_taken_count.wat +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/instruction_counting/if_not_taken_count.wat +rename to third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/if_not_taken_count.wat +diff --git a/third_party/rust/lucet-runtime/tests/instruction_counting/indirect_calls.wat b/third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/indirect_calls.wat +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/instruction_counting/indirect_calls.wat +rename to third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/indirect_calls.wat +diff --git a/third_party/rust/lucet-runtime/tests/instruction_counting/loops.wat b/third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/loops.wat +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/instruction_counting/loops.wat +rename to third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/loops.wat +diff --git a/third_party/rust/lucet-runtime/tests/instruction_counting/unreachable_call.wat b/third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/unreachable_call.wat +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/instruction_counting/unreachable_call.wat +rename to third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/unreachable_call.wat +diff --git a/third_party/rust/lucet-runtime/tests/memory.rs b/third_party/rust/lucet-runtime-wasmsbx/tests/memory.rs +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/memory.rs +rename to third_party/rust/lucet-runtime-wasmsbx/tests/memory.rs +diff --git a/third_party/rust/lucet-runtime/tests/stack.rs b/third_party/rust/lucet-runtime-wasmsbx/tests/stack.rs +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/stack.rs +rename to third_party/rust/lucet-runtime-wasmsbx/tests/stack.rs +diff --git a/third_party/rust/lucet-runtime/tests/start.rs b/third_party/rust/lucet-runtime-wasmsbx/tests/start.rs +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/start.rs +rename to third_party/rust/lucet-runtime-wasmsbx/tests/start.rs +diff --git a/third_party/rust/lucet-runtime/tests/strcmp.rs b/third_party/rust/lucet-runtime-wasmsbx/tests/strcmp.rs +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/strcmp.rs +rename to third_party/rust/lucet-runtime-wasmsbx/tests/strcmp.rs +diff --git a/third_party/rust/lucet-runtime/tests/val.rs b/third_party/rust/lucet-runtime-wasmsbx/tests/val.rs +similarity index 100% +rename from third_party/rust/lucet-runtime/tests/val.rs +rename to third_party/rust/lucet-runtime-wasmsbx/tests/val.rs +diff --git a/third_party/rust/lucet-wasi/.cargo-checksum.json b/third_party/rust/lucet-wasi-wasmsbx/.cargo-checksum.json +similarity index 96% +rename from third_party/rust/lucet-wasi/.cargo-checksum.json +rename to third_party/rust/lucet-wasi-wasmsbx/.cargo-checksum.json +index 229fc9978c8518d43f11ec8a50a0aacd6a351b1a..41e9cfd063a037f46b1ae43c52db572a9c86a30b 100644 +--- a/third_party/rust/lucet-wasi/.cargo-checksum.json ++++ b/third_party/rust/lucet-wasi-wasmsbx/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"fea1408a1c1b1e84b06044a0b12cb26c8fd3253ca124debb6cd3e4faab48fcbd","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","LICENSE.cloudabi-utils":"86a34251f0aab76b7dc3daf8d252afbdf481ea94aa5b46d020205178b7e2eac1","LICENSE.wasmtime":"a6c48161a09acc75a0e25503bab66a731eb5fba5392ed4bb4743e4ba5085327a","bindings.json":"fad8362f845e6f7a2af1d7547cee5730894e7b96804f338181fc070ffdcfae1e","build.rs":"593173ad03963afcbef43f1843be6f04cde1df3eae0298ca20bf881019dd350a","examples/.gitignore":"44575cf5b28512d75644bf54a517dcef304ff809fd511747621b4d64f19aac66","examples/Makefile":"d2d2ceeb1bc4435189ea9a2710b6f5f5331ce6aa73ae8a4f4edcca215058a9b4","examples/README.md":"f2a5be6cc88d511c9f4d3bfefdd42dcb2ace813bc23f6a4430b6b543f7373341","examples/hello.c":"9cbc0d3173e02309e15372835fa849d196b2a202d81806fea60378e1878d0c53","examples/pseudoquine.c":"8fd696f8e1b8fb86188564a05f4776875ead31d785a12e3aa4af9d9c1b46d5b5","include/lucet_wasi.h":"497f712c64f753ebdf73ab05b0b340d50094f9c59bb8637ccbf99d895cd20966","src/bindings.rs":"edbeb51d1a93fd31039ee1f1dc7c1b6c0bded2cf5dad10039e8b7da81a4d4a12","src/c_api.rs":"a9c73070a88a461882a28e3e2adfd773f569b964c7ffabde39a3cef907782f71","src/ctx.rs":"578f87c35cce12eaebec95d03e31954c3e6cd0afa214a0fec068f03814eb0cc7","src/fdentry.rs":"94a8480fa587e5586327dfd6b66d8a6a3ef1f8091ba8deb335bf45642f4f98e6","src/host.rs":"6f05f8fea2afed827abfc3c008a5854a8023d91d066580ecfb49e5c8036ef3a3","src/hostcalls/fs.rs":"4726e6f695f7d1d4e371ec52c57f4e36b0ba0d2302fc008b21a301f5fd7a5c97","src/hostcalls/fs_helpers.rs":"474bce0a1f15fa23b0b0b8aa83143d993dd2cbd7cdfc38c118d452d04e80caea","src/hostcalls/misc.rs":"83d087891d92af08cfa2d2e0c5f41cc47cb8219460f6dbcc8666b418dfef206e","src/hostcalls/mod.rs":"4c5d3f65c69503e11e647770879026c37c0e5e01a99b7116c8fb9411b4797187","src/hostcalls/timers.rs":"e65d6a491256b5d6051b6816f6c5049ba3cdc6142651bac81f34d659c1c2a104","src/lib.rs":"5554e1a3f0cd3756173ece6435a0d01b2f520b3401cd5fc33180a04fb9f69bbe","src/memory.rs":"0a09026b15d27f99d74e560cd94795f645cba414a8491bc961987fab9d9da69b","src/wasi_host.rs":"cacbdac28304a837b11e5ad400ae9de3ee79c0284be335e64606ecdfe426ad6e","src/wasm32.rs":"13a5dc6e59784662f1e55eccb457cbbae241a96f70cfa72c41d55858ca05b980","tests/guests/cant_dotdot.c":"609b8cece9443e375a0b38a7e43651b179f66ee9c686edba6696fe1bcd45b111","tests/guests/clock_getres.c":"f5e41c0a2b05a8d7cdb5b4da6c8b6778b858004c1e9d115503c45a1d976be33b","tests/guests/duplicate_import.wat":"4bd8d7a5c1d1597dbe7648300e94e3fab84d7ab068d56cfb656aa1a208026cee","tests/guests/exitcode.c":"b7c5cec3ead0ed82326c568287a1f3398e71ae7e447ce49a3c4c7114c82495af","tests/guests/follow_symlink.c":"de3143ad2bbbfe834c0c32b54c9fcf144ca4eba5cdcf7588929e5f47225ab616","tests/guests/fs.c":"0dca5232ff5da1b7745e3b44bca39333c01a20ba4eae1a6a0a1c492c71ca1efa","tests/guests/getentropy.c":"5d80bcc68dcf3ba91576969055099d61635ae713c057b3cb36afb122a5f26347","tests/guests/getrusage.c":"8114c103b85eb564d9ab43684958bc1939de3794d314b7c121762f3a2f0434a6","tests/guests/gettimeofday.c":"4a57f376b06f4228017b82695448a0bd213fb91455f5301d689cd87fcff01f06","tests/guests/notdir.c":"bd8f8b24360b7cf8d5dced9d9ba4c15843fcbbae89fecc13e3a457c33a275e28","tests/guests/poll.c":"aefaa9b58ce9906dc379e0bd25fa68dfbf8cdffb48cd5ecde1d67708b83b366d","tests/guests/preopen_populates.c":"f186e4eb4aab6a1d9ec7bc5c49eaea6d9d162e0159dfe8f953bb48ade9b58d43","tests/guests/read_file.c":"1aab9393f005f05b69592826d7c4d384a115d5bca42c66f10a901811b4b1dcac","tests/guests/read_file_twice.c":"04a3dad7a43b93e36efd4e2c822c11b3f129429ec799af304d82b358686c578a","tests/guests/stat.c":"02756933ea7d4337b4fa04344b32968851b02f9d0bd5ea1cb0e2f022e8c65ab0","tests/guests/stdin.c":"66efc4b54f68d1138046f1afefae15f7d4555b2904b4a988818e61e67fe8fefb","tests/guests/symlink_escape.c":"686e047b5c986e29c854bcd93996d027dcdc8721219fa9fa532efc98d2798f5c","tests/guests/symlink_loop.c":"2bbddf3a5edfc6e5f3c0fa82cee4ac92b18804810509e263abd17f5240cd37e5","tests/guests/write_file.c":"9e9b14552c2445cfa6d0aa26b334081a59e6e3428dbb17ceca005a9ba59d3220","tests/test_helpers/mod.rs":"bc18194317611fe1be5c439a7a9e0de75399555c3b6de4275af149fb180456c8","tests/tests.rs":"173a7e0f086f6ed46474686cc3413ee68bbd2ff67004f7790e963a1392c7c46e"},"package":null} +\ No newline at end of file ++{"files":{"Cargo.toml":"5b15219ca238492bc5c6d3a7333ddd6697c40a929254aec62252b8a1ab50b630","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","LICENSE.cloudabi-utils":"86a34251f0aab76b7dc3daf8d252afbdf481ea94aa5b46d020205178b7e2eac1","LICENSE.wasmtime":"a6c48161a09acc75a0e25503bab66a731eb5fba5392ed4bb4743e4ba5085327a","bindings.json":"fad8362f845e6f7a2af1d7547cee5730894e7b96804f338181fc070ffdcfae1e","build.rs":"593173ad03963afcbef43f1843be6f04cde1df3eae0298ca20bf881019dd350a","examples/.gitignore":"44575cf5b28512d75644bf54a517dcef304ff809fd511747621b4d64f19aac66","examples/Makefile":"d2d2ceeb1bc4435189ea9a2710b6f5f5331ce6aa73ae8a4f4edcca215058a9b4","examples/README.md":"f2a5be6cc88d511c9f4d3bfefdd42dcb2ace813bc23f6a4430b6b543f7373341","examples/hello.c":"9cbc0d3173e02309e15372835fa849d196b2a202d81806fea60378e1878d0c53","examples/pseudoquine.c":"8fd696f8e1b8fb86188564a05f4776875ead31d785a12e3aa4af9d9c1b46d5b5","include/lucet_wasi.h":"497f712c64f753ebdf73ab05b0b340d50094f9c59bb8637ccbf99d895cd20966","src/bindings.rs":"edbeb51d1a93fd31039ee1f1dc7c1b6c0bded2cf5dad10039e8b7da81a4d4a12","src/c_api.rs":"a9c73070a88a461882a28e3e2adfd773f569b964c7ffabde39a3cef907782f71","src/ctx.rs":"578f87c35cce12eaebec95d03e31954c3e6cd0afa214a0fec068f03814eb0cc7","src/fdentry.rs":"94a8480fa587e5586327dfd6b66d8a6a3ef1f8091ba8deb335bf45642f4f98e6","src/host.rs":"6f05f8fea2afed827abfc3c008a5854a8023d91d066580ecfb49e5c8036ef3a3","src/hostcalls/fs.rs":"4726e6f695f7d1d4e371ec52c57f4e36b0ba0d2302fc008b21a301f5fd7a5c97","src/hostcalls/fs_helpers.rs":"474bce0a1f15fa23b0b0b8aa83143d993dd2cbd7cdfc38c118d452d04e80caea","src/hostcalls/misc.rs":"83d087891d92af08cfa2d2e0c5f41cc47cb8219460f6dbcc8666b418dfef206e","src/hostcalls/mod.rs":"4c5d3f65c69503e11e647770879026c37c0e5e01a99b7116c8fb9411b4797187","src/hostcalls/timers.rs":"e65d6a491256b5d6051b6816f6c5049ba3cdc6142651bac81f34d659c1c2a104","src/lib.rs":"5554e1a3f0cd3756173ece6435a0d01b2f520b3401cd5fc33180a04fb9f69bbe","src/memory.rs":"0a09026b15d27f99d74e560cd94795f645cba414a8491bc961987fab9d9da69b","src/wasi_host.rs":"cacbdac28304a837b11e5ad400ae9de3ee79c0284be335e64606ecdfe426ad6e","src/wasm32.rs":"13a5dc6e59784662f1e55eccb457cbbae241a96f70cfa72c41d55858ca05b980","tests/guests/cant_dotdot.c":"609b8cece9443e375a0b38a7e43651b179f66ee9c686edba6696fe1bcd45b111","tests/guests/clock_getres.c":"f5e41c0a2b05a8d7cdb5b4da6c8b6778b858004c1e9d115503c45a1d976be33b","tests/guests/duplicate_import.wat":"4bd8d7a5c1d1597dbe7648300e94e3fab84d7ab068d56cfb656aa1a208026cee","tests/guests/exitcode.c":"b7c5cec3ead0ed82326c568287a1f3398e71ae7e447ce49a3c4c7114c82495af","tests/guests/follow_symlink.c":"de3143ad2bbbfe834c0c32b54c9fcf144ca4eba5cdcf7588929e5f47225ab616","tests/guests/fs.c":"0dca5232ff5da1b7745e3b44bca39333c01a20ba4eae1a6a0a1c492c71ca1efa","tests/guests/getentropy.c":"5d80bcc68dcf3ba91576969055099d61635ae713c057b3cb36afb122a5f26347","tests/guests/getrusage.c":"8114c103b85eb564d9ab43684958bc1939de3794d314b7c121762f3a2f0434a6","tests/guests/gettimeofday.c":"4a57f376b06f4228017b82695448a0bd213fb91455f5301d689cd87fcff01f06","tests/guests/notdir.c":"bd8f8b24360b7cf8d5dced9d9ba4c15843fcbbae89fecc13e3a457c33a275e28","tests/guests/poll.c":"aefaa9b58ce9906dc379e0bd25fa68dfbf8cdffb48cd5ecde1d67708b83b366d","tests/guests/preopen_populates.c":"f186e4eb4aab6a1d9ec7bc5c49eaea6d9d162e0159dfe8f953bb48ade9b58d43","tests/guests/read_file.c":"1aab9393f005f05b69592826d7c4d384a115d5bca42c66f10a901811b4b1dcac","tests/guests/read_file_twice.c":"04a3dad7a43b93e36efd4e2c822c11b3f129429ec799af304d82b358686c578a","tests/guests/stat.c":"02756933ea7d4337b4fa04344b32968851b02f9d0bd5ea1cb0e2f022e8c65ab0","tests/guests/stdin.c":"66efc4b54f68d1138046f1afefae15f7d4555b2904b4a988818e61e67fe8fefb","tests/guests/symlink_escape.c":"686e047b5c986e29c854bcd93996d027dcdc8721219fa9fa532efc98d2798f5c","tests/guests/symlink_loop.c":"2bbddf3a5edfc6e5f3c0fa82cee4ac92b18804810509e263abd17f5240cd37e5","tests/guests/write_file.c":"9e9b14552c2445cfa6d0aa26b334081a59e6e3428dbb17ceca005a9ba59d3220","tests/test_helpers/mod.rs":"bc18194317611fe1be5c439a7a9e0de75399555c3b6de4275af149fb180456c8","tests/tests.rs":"173a7e0f086f6ed46474686cc3413ee68bbd2ff67004f7790e963a1392c7c46e"},"package":null} +\ No newline at end of file +diff --git a/third_party/rust/lucet-wasi/Cargo.toml b/third_party/rust/lucet-wasi-wasmsbx/Cargo.toml +similarity index 87% +rename from third_party/rust/lucet-wasi/Cargo.toml +rename to third_party/rust/lucet-wasi-wasmsbx/Cargo.toml +index 4800ae3ae0a9ef0bccc2ee2bd37b1993542412f4..0e0131f6e3a3b1023d6d245315c14cb400bf77b8 100644 +--- a/third_party/rust/lucet-wasi/Cargo.toml ++++ b/third_party/rust/lucet-wasi-wasmsbx/Cargo.toml +@@ -1,5 +1,5 @@ + [package] +-name = "lucet-wasi" ++name = "lucet-wasi-wasmsbx" + version = "0.1.1" + description = "Fastly's runtime for the WebAssembly System Interface (WASI)" + homepage = "https://github.com/fastly/lucet" +@@ -26,10 +26,10 @@ update-bindings = ["bindgen"] + [dependencies] + cast = "0.2" + failure = "0.1" +-libc = "=0.2.59" +-lucet-runtime = { path = "../lucet-runtime", version = "0.1.1" } +-lucet-runtime-internals = { path = "../lucet-runtime/lucet-runtime-internals", version = "0.1.1" } +-lucet-module = { path = "../lucet-module", version = "0.1.1" } ++libc = "0.2.65" ++lucet-runtime = { path = "../lucet-runtime", version = "0.1.1", package = "lucet-runtime-wasmsbx" } ++lucet-runtime-internals = { path = "../lucet-runtime/lucet-runtime-internals", version = "0.1.1", package = "lucet-runtime-internals-wasmsbx" } ++lucet-module = { path = "../lucet-module", version = "0.1.1", package="lucet-module-wasmsbx" } + nix = "0.13" + rand = "0.7" + +diff --git a/third_party/rust/lucet-wasi/LICENSE b/third_party/rust/lucet-wasi-wasmsbx/LICENSE +similarity index 100% +rename from third_party/rust/lucet-wasi/LICENSE +rename to third_party/rust/lucet-wasi-wasmsbx/LICENSE +diff --git a/third_party/rust/lucet-wasi/LICENSE.cloudabi-utils b/third_party/rust/lucet-wasi-wasmsbx/LICENSE.cloudabi-utils +similarity index 100% +rename from third_party/rust/lucet-wasi/LICENSE.cloudabi-utils +rename to third_party/rust/lucet-wasi-wasmsbx/LICENSE.cloudabi-utils +diff --git a/third_party/rust/lucet-wasi/LICENSE.wasmtime b/third_party/rust/lucet-wasi-wasmsbx/LICENSE.wasmtime +similarity index 100% +rename from third_party/rust/lucet-wasi/LICENSE.wasmtime +rename to third_party/rust/lucet-wasi-wasmsbx/LICENSE.wasmtime +diff --git a/third_party/rust/lucet-wasi/bindings.json b/third_party/rust/lucet-wasi-wasmsbx/bindings.json +similarity index 100% +rename from third_party/rust/lucet-wasi/bindings.json +rename to third_party/rust/lucet-wasi-wasmsbx/bindings.json +diff --git a/third_party/rust/lucet-wasi/build.rs b/third_party/rust/lucet-wasi-wasmsbx/build.rs +similarity index 100% +rename from third_party/rust/lucet-wasi/build.rs +rename to third_party/rust/lucet-wasi-wasmsbx/build.rs +diff --git a/third_party/rust/lucet-wasi/examples/.gitignore b/third_party/rust/lucet-wasi-wasmsbx/examples/.gitignore +similarity index 100% +rename from third_party/rust/lucet-wasi/examples/.gitignore +rename to third_party/rust/lucet-wasi-wasmsbx/examples/.gitignore +diff --git a/third_party/rust/lucet-wasi/examples/Makefile b/third_party/rust/lucet-wasi-wasmsbx/examples/Makefile +similarity index 100% +rename from third_party/rust/lucet-wasi/examples/Makefile +rename to third_party/rust/lucet-wasi-wasmsbx/examples/Makefile +diff --git a/third_party/rust/lucet-wasi/examples/README.md b/third_party/rust/lucet-wasi-wasmsbx/examples/README.md +similarity index 100% +rename from third_party/rust/lucet-wasi/examples/README.md +rename to third_party/rust/lucet-wasi-wasmsbx/examples/README.md +diff --git a/third_party/rust/lucet-wasi/examples/hello.c b/third_party/rust/lucet-wasi-wasmsbx/examples/hello.c +similarity index 100% +rename from third_party/rust/lucet-wasi/examples/hello.c +rename to third_party/rust/lucet-wasi-wasmsbx/examples/hello.c +diff --git a/third_party/rust/lucet-wasi/examples/pseudoquine.c b/third_party/rust/lucet-wasi-wasmsbx/examples/pseudoquine.c +similarity index 100% +rename from third_party/rust/lucet-wasi/examples/pseudoquine.c +rename to third_party/rust/lucet-wasi-wasmsbx/examples/pseudoquine.c +diff --git a/third_party/rust/lucet-wasi/include/lucet_wasi.h b/third_party/rust/lucet-wasi-wasmsbx/include/lucet_wasi.h +similarity index 100% +rename from third_party/rust/lucet-wasi/include/lucet_wasi.h +rename to third_party/rust/lucet-wasi-wasmsbx/include/lucet_wasi.h +diff --git a/third_party/rust/lucet-wasi/src/bindings.rs b/third_party/rust/lucet-wasi-wasmsbx/src/bindings.rs +similarity index 100% +rename from third_party/rust/lucet-wasi/src/bindings.rs +rename to third_party/rust/lucet-wasi-wasmsbx/src/bindings.rs +diff --git a/third_party/rust/lucet-wasi/src/c_api.rs b/third_party/rust/lucet-wasi-wasmsbx/src/c_api.rs +similarity index 100% +rename from third_party/rust/lucet-wasi/src/c_api.rs +rename to third_party/rust/lucet-wasi-wasmsbx/src/c_api.rs +diff --git a/third_party/rust/lucet-wasi/src/ctx.rs b/third_party/rust/lucet-wasi-wasmsbx/src/ctx.rs +similarity index 100% +rename from third_party/rust/lucet-wasi/src/ctx.rs +rename to third_party/rust/lucet-wasi-wasmsbx/src/ctx.rs +diff --git a/third_party/rust/lucet-wasi/src/fdentry.rs b/third_party/rust/lucet-wasi-wasmsbx/src/fdentry.rs +similarity index 100% +rename from third_party/rust/lucet-wasi/src/fdentry.rs +rename to third_party/rust/lucet-wasi-wasmsbx/src/fdentry.rs +diff --git a/third_party/rust/lucet-wasi/src/host.rs b/third_party/rust/lucet-wasi-wasmsbx/src/host.rs +similarity index 100% +rename from third_party/rust/lucet-wasi/src/host.rs +rename to third_party/rust/lucet-wasi-wasmsbx/src/host.rs +diff --git a/third_party/rust/lucet-wasi/src/hostcalls/fs.rs b/third_party/rust/lucet-wasi-wasmsbx/src/hostcalls/fs.rs +similarity index 100% +rename from third_party/rust/lucet-wasi/src/hostcalls/fs.rs +rename to third_party/rust/lucet-wasi-wasmsbx/src/hostcalls/fs.rs +diff --git a/third_party/rust/lucet-wasi/src/hostcalls/fs_helpers.rs b/third_party/rust/lucet-wasi-wasmsbx/src/hostcalls/fs_helpers.rs +similarity index 100% +rename from third_party/rust/lucet-wasi/src/hostcalls/fs_helpers.rs +rename to third_party/rust/lucet-wasi-wasmsbx/src/hostcalls/fs_helpers.rs +diff --git a/third_party/rust/lucet-wasi/src/hostcalls/misc.rs b/third_party/rust/lucet-wasi-wasmsbx/src/hostcalls/misc.rs +similarity index 100% +rename from third_party/rust/lucet-wasi/src/hostcalls/misc.rs +rename to third_party/rust/lucet-wasi-wasmsbx/src/hostcalls/misc.rs +diff --git a/third_party/rust/lucet-wasi/src/hostcalls/mod.rs b/third_party/rust/lucet-wasi-wasmsbx/src/hostcalls/mod.rs +similarity index 100% +rename from third_party/rust/lucet-wasi/src/hostcalls/mod.rs +rename to third_party/rust/lucet-wasi-wasmsbx/src/hostcalls/mod.rs +diff --git a/third_party/rust/lucet-wasi/src/hostcalls/timers.rs b/third_party/rust/lucet-wasi-wasmsbx/src/hostcalls/timers.rs +similarity index 100% +rename from third_party/rust/lucet-wasi/src/hostcalls/timers.rs +rename to third_party/rust/lucet-wasi-wasmsbx/src/hostcalls/timers.rs +diff --git a/third_party/rust/lucet-wasi/src/lib.rs b/third_party/rust/lucet-wasi-wasmsbx/src/lib.rs +similarity index 100% +rename from third_party/rust/lucet-wasi/src/lib.rs +rename to third_party/rust/lucet-wasi-wasmsbx/src/lib.rs +diff --git a/third_party/rust/lucet-wasi/src/memory.rs b/third_party/rust/lucet-wasi-wasmsbx/src/memory.rs +similarity index 100% +rename from third_party/rust/lucet-wasi/src/memory.rs +rename to third_party/rust/lucet-wasi-wasmsbx/src/memory.rs +diff --git a/third_party/rust/lucet-wasi/src/wasi_host.rs b/third_party/rust/lucet-wasi-wasmsbx/src/wasi_host.rs +similarity index 100% +rename from third_party/rust/lucet-wasi/src/wasi_host.rs +rename to third_party/rust/lucet-wasi-wasmsbx/src/wasi_host.rs +diff --git a/third_party/rust/lucet-wasi/src/wasm32.rs b/third_party/rust/lucet-wasi-wasmsbx/src/wasm32.rs +similarity index 100% +rename from third_party/rust/lucet-wasi/src/wasm32.rs +rename to third_party/rust/lucet-wasi-wasmsbx/src/wasm32.rs +diff --git a/third_party/rust/lucet-wasi/tests/guests/cant_dotdot.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/cant_dotdot.c +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/cant_dotdot.c +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/cant_dotdot.c +diff --git a/third_party/rust/lucet-wasi/tests/guests/clock_getres.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/clock_getres.c +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/clock_getres.c +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/clock_getres.c +diff --git a/third_party/rust/lucet-wasi/tests/guests/duplicate_import.wat b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/duplicate_import.wat +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/duplicate_import.wat +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/duplicate_import.wat +diff --git a/third_party/rust/lucet-wasi/tests/guests/exitcode.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/exitcode.c +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/exitcode.c +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/exitcode.c +diff --git a/third_party/rust/lucet-wasi/tests/guests/follow_symlink.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/follow_symlink.c +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/follow_symlink.c +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/follow_symlink.c +diff --git a/third_party/rust/lucet-wasi/tests/guests/fs.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/fs.c +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/fs.c +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/fs.c +diff --git a/third_party/rust/lucet-wasi/tests/guests/getentropy.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/getentropy.c +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/getentropy.c +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/getentropy.c +diff --git a/third_party/rust/lucet-wasi/tests/guests/getrusage.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/getrusage.c +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/getrusage.c +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/getrusage.c +diff --git a/third_party/rust/lucet-wasi/tests/guests/gettimeofday.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/gettimeofday.c +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/gettimeofday.c +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/gettimeofday.c +diff --git a/third_party/rust/lucet-wasi/tests/guests/notdir.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/notdir.c +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/notdir.c +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/notdir.c +diff --git a/third_party/rust/lucet-wasi/tests/guests/poll.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/poll.c +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/poll.c +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/poll.c +diff --git a/third_party/rust/lucet-wasi/tests/guests/preopen_populates.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/preopen_populates.c +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/preopen_populates.c +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/preopen_populates.c +diff --git a/third_party/rust/lucet-wasi/tests/guests/read_file.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/read_file.c +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/read_file.c +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/read_file.c +diff --git a/third_party/rust/lucet-wasi/tests/guests/read_file_twice.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/read_file_twice.c +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/read_file_twice.c +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/read_file_twice.c +diff --git a/third_party/rust/lucet-wasi/tests/guests/stat.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/stat.c +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/stat.c +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/stat.c +diff --git a/third_party/rust/lucet-wasi/tests/guests/stdin.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/stdin.c +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/stdin.c +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/stdin.c +diff --git a/third_party/rust/lucet-wasi/tests/guests/symlink_escape.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/symlink_escape.c +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/symlink_escape.c +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/symlink_escape.c +diff --git a/third_party/rust/lucet-wasi/tests/guests/symlink_loop.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/symlink_loop.c +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/symlink_loop.c +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/symlink_loop.c +diff --git a/third_party/rust/lucet-wasi/tests/guests/write_file.c b/third_party/rust/lucet-wasi-wasmsbx/tests/guests/write_file.c +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/guests/write_file.c +rename to third_party/rust/lucet-wasi-wasmsbx/tests/guests/write_file.c +diff --git a/third_party/rust/lucet-wasi/tests/test_helpers/mod.rs b/third_party/rust/lucet-wasi-wasmsbx/tests/test_helpers/mod.rs +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/test_helpers/mod.rs +rename to third_party/rust/lucet-wasi-wasmsbx/tests/test_helpers/mod.rs +diff --git a/third_party/rust/lucet-wasi/tests/tests.rs b/third_party/rust/lucet-wasi-wasmsbx/tests/tests.rs +similarity index 100% +rename from third_party/rust/lucet-wasi/tests/tests.rs +rename to third_party/rust/lucet-wasi-wasmsbx/tests/tests.rs +diff --git a/third_party/rust/rlbox_lucet_sandbox/.cargo-checksum.json b/third_party/rust/rlbox_lucet_sandbox/.cargo-checksum.json +index 764ab0a3055fc0be2c704082fb7443b4f0565205..f9e42044e211eb5590d8e048d3a8f6bad1175ef8 100644 +--- a/third_party/rust/rlbox_lucet_sandbox/.cargo-checksum.json ++++ b/third_party/rust/rlbox_lucet_sandbox/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{".clang-format":"ff4e345608f7674dd1ee1f37b24d4030b260d82516a747093af141b3076a4164",".clang-tidy":"861bc5b367dc85f5fa103f2de9460e158de97f48c59c51a26784b7c2c481e3b7",".travis.yml":"a49b61a394520c39bb20c420b587e92ea9c8008764fef0368c4747b71b8f1561","CMakeLists.txt":"be1746d5161db062c96ec2f2060a514229498c0fa7cf20d5ae01e81736320681","Cargo.toml":"242bf8b59ba672cb9888ece9f676d263224fe1836ce486dda02a0e28b5afd187","LICENSE":"891d419ba95ab39090775820f4178421dbdcd241c080003aa44f62445a48615a","README.md":"53315d2de00f7a8e932af5ad3267bf56027d22790bb09182e250b9b35fbe0758","c_src/CMakeLists.txt":"41f6338bb8aef5c0a7a6db53f3ed699ae027f0c008e67c9bb344fe0b75513d3f","c_src/lucet_sandbox_wrapper.c":"08b2ab265127aca42b02c8a36e5450284d6794d86867a5808f854588183ab9d9","include/lucet_sandbox.h":"8d24bd5fbd4f717f0bb90b238a7b7fbdd212207297ddf1a723cc98ee13180c5b","include/rlbox_lucet_sandbox.hpp":"b8a4b86460e9b666ec92bf23db37578639a368005ccf4aa722032aaca8ae59db","src/callback.rs":"c40f92e017bc8f2f3136304c1f2d3ca683fe80a1bb505c0fa750cc372305020d","src/create.rs":"5d620a050c1990e7215346fe144a7be7c0e4bb396068ac81ae8b21fb1fdb3dca","src/invoke.rs":"d47b167c6048a3221f5e66a4acb5154bc5306bd1053acee56bfb87bb66c78879","src/lib.rs":"677f45b275101c116ea7acf2dafa77f9f1c5e3f379d4da3a9512c71a71878595","src/memory.rs":"8b27396ec4ddba18ac760052e9d11564fdc8c4e68271b817dfd13cefc97cf1a3","src/types.rs":"85907840c233aae0e234bcb5c1e107e76231b6518cc70a1c18be73edc2720742","test/test_lucet_sandbox_glue.cpp":"ea4eb3ace8e9a87550db44f61d065b45f31f1f5b774b4a3e0383e62962c0abf2","test/test_lucet_sandbox_glue_embedder_vars.cpp":"be6abfae367719b12edc5fd8f1de840abed9bb4a2efdebb19ed59e8796fb47b8","test/test_lucet_sandbox_glue_main.cpp":"fde2081cd8b0df3fd73fee1e36dfa5eccfb5bc825072c55a57fcf3048858dbd9","test/test_lucet_sandbox_glue_preload.cpp":"c986ac617327305fcc3ea33114667d4c833ee685c740e482ffde97de4f203e35"},"package":null} +\ No newline at end of file ++{"files":{".clang-format":"ff4e345608f7674dd1ee1f37b24d4030b260d82516a747093af141b3076a4164",".clang-tidy":"861bc5b367dc85f5fa103f2de9460e158de97f48c59c51a26784b7c2c481e3b7",".travis.yml":"a49b61a394520c39bb20c420b587e92ea9c8008764fef0368c4747b71b8f1561","CMakeLists.txt":"360dea06e042bef85fe2f91690816057ced85d061700ede713359018d7ef5a73","Cargo.toml":"ee8f7e4687ebda950d2c3ac816db3de15649c3b4a7cb8c599a80698cd1347b7f","LICENSE":"891d419ba95ab39090775820f4178421dbdcd241c080003aa44f62445a48615a","README.md":"4134bf685210fea56eb502124013f9b51121635f5269e7f3dbc4450322aaf8c1","c_src/CMakeLists.txt":"41f6338bb8aef5c0a7a6db53f3ed699ae027f0c008e67c9bb344fe0b75513d3f","c_src/lucet_sandbox_wrapper.c":"08b2ab265127aca42b02c8a36e5450284d6794d86867a5808f854588183ab9d9","include/lucet_sandbox.h":"8d24bd5fbd4f717f0bb90b238a7b7fbdd212207297ddf1a723cc98ee13180c5b","include/rlbox_lucet_sandbox.hpp":"b8a4b86460e9b666ec92bf23db37578639a368005ccf4aa722032aaca8ae59db","src/callback.rs":"c40f92e017bc8f2f3136304c1f2d3ca683fe80a1bb505c0fa750cc372305020d","src/create.rs":"5d620a050c1990e7215346fe144a7be7c0e4bb396068ac81ae8b21fb1fdb3dca","src/invoke.rs":"d47b167c6048a3221f5e66a4acb5154bc5306bd1053acee56bfb87bb66c78879","src/lib.rs":"677f45b275101c116ea7acf2dafa77f9f1c5e3f379d4da3a9512c71a71878595","src/memory.rs":"8b27396ec4ddba18ac760052e9d11564fdc8c4e68271b817dfd13cefc97cf1a3","src/types.rs":"85907840c233aae0e234bcb5c1e107e76231b6518cc70a1c18be73edc2720742","test/test_lucet_sandbox_glue.cpp":"ea4eb3ace8e9a87550db44f61d065b45f31f1f5b774b4a3e0383e62962c0abf2","test/test_lucet_sandbox_glue_embedder_vars.cpp":"be6abfae367719b12edc5fd8f1de840abed9bb4a2efdebb19ed59e8796fb47b8","test/test_lucet_sandbox_glue_main.cpp":"fde2081cd8b0df3fd73fee1e36dfa5eccfb5bc825072c55a57fcf3048858dbd9","test/test_lucet_sandbox_glue_preload.cpp":"c986ac617327305fcc3ea33114667d4c833ee685c740e482ffde97de4f203e35"},"package":null} +\ No newline at end of file +diff --git a/third_party/rust/rlbox_lucet_sandbox/CMakeLists.txt b/third_party/rust/rlbox_lucet_sandbox/CMakeLists.txt +index 781dc8cfe202ec134421b646a520c4c40a869b58..0b68a12312b864803ff44dcd5e219c0d01f59c53 100644 +--- a/third_party/rust/rlbox_lucet_sandbox/CMakeLists.txt ++++ b/third_party/rust/rlbox_lucet_sandbox/CMakeLists.txt +@@ -15,24 +15,24 @@ option(DEV "Use settings suitable for dev contributions to rlbox" OFF) + + file(GLOB_RECURSE + ALL_CXX_SOURCE_FILES +- include/*.[chi]pp +- include/*.[chi]xx +- include/*.cc +- include/*.hh +- include/*.ii +- include/*.[CHI] +- test/*.[chi]pp +- test/*.[chi]xx +- test/*.cc +- test/*.hh +- test/*.ii +- test/*.[CHI] +- c_src/*.[chi]pp +- c_src/*.[chi]xx +- c_src/*.cc +- c_src/*.hh +- c_src/*.ii +- c_src/*.[CHI]) ++ ${CMAKE_SOURCE_DIR}/include/*.[chi]pp ++ ${CMAKE_SOURCE_DIR}/include/*.[chi]xx ++ ${CMAKE_SOURCE_DIR}/include/*.cc ++ ${CMAKE_SOURCE_DIR}/include/*.hh ++ ${CMAKE_SOURCE_DIR}/include/*.ii ++ ${CMAKE_SOURCE_DIR}/include/*.[CHI] ++ ${CMAKE_SOURCE_DIR}/test/*.[chi]pp ++ ${CMAKE_SOURCE_DIR}/test/*.[chi]xx ++ ${CMAKE_SOURCE_DIR}/test/*.cc ++ ${CMAKE_SOURCE_DIR}/test/*.hh ++ ${CMAKE_SOURCE_DIR}/test/*.ii ++ ${CMAKE_SOURCE_DIR}/test/*.[CHI] ++ ${CMAKE_SOURCE_DIR}/c_src/*.[chi]pp ++ ${CMAKE_SOURCE_DIR}/c_src/*.[chi]xx ++ ${CMAKE_SOURCE_DIR}/c_src/*.cc ++ ${CMAKE_SOURCE_DIR}/c_src/*.hh ++ ${CMAKE_SOURCE_DIR}/c_src/*.ii ++ ${CMAKE_SOURCE_DIR}/c_src/*.[CHI]) + + # Dev Tools ################### + +@@ -150,7 +150,7 @@ add_custom_target(lucet_release ALL DEPENDS ${LUCET_PATH}) + # set(LUCET_DIR "${mod_lucet_SOURCE_DIR}/target/debug/") + # set(LUCET_PATH "${LUCET_DIR}/lucetc") + +-file(GLOB_RECURSE RUST_SOURCE_FILES src/*.rs) ++file(GLOB_RECURSE RUST_SOURCE_FILES ${CMAKE_SOURCE_DIR}/src/*.rs) + + set(RUST_LIB_DEBUG_PATH + "${CMAKE_BINARY_DIR}/cargo/debug/librlbox_lucet_sandbox.a") +@@ -204,7 +204,7 @@ if(!WASMCLANG) + ) + endif() + +-file(GLOB_RECURSE C_SOURCE_FILES c_src/*) ++file(GLOB_RECURSE C_SOURCE_FILES ${CMAKE_SOURCE_DIR}/c_src/*) + set(GLUE_LIB_WASM "${CMAKE_BINARY_DIR}/wasm/glue_lib_lucet.wasm") + set(GLUE_LIB_SO "${CMAKE_BINARY_DIR}/wasm/glue_lib_lucet.${DYLIB_EXT}") + +@@ -249,9 +249,15 @@ target_compile_definitions(test_rlbox_glue PUBLIC + + add_dependencies(test_rlbox_glue lucet_sandbox_rustlib_debug lucet_sandbox_rustlib_release) + ++if(MSVC) ++ set(LINK_LUCET_LIB -WHOLEARCHIVE lucet_sandbox_rustlib) ++else() ++ set(LINK_LUCET_LIB -Wl,--whole-archive lucet_sandbox_rustlib -Wl,--no-whole-archive) ++endif() ++ + target_link_libraries(test_rlbox_glue + Catch2::Catch2 +- lucet_sandbox_rustlib ++ ${LINK_LUCET_LIB} + ${CMAKE_THREAD_LIBS_INIT} + ${CMAKE_DL_LIBS} + # glue_lib_lucet +diff --git a/third_party/rust/rlbox_lucet_sandbox/Cargo.toml b/third_party/rust/rlbox_lucet_sandbox/Cargo.toml +index 64d8d288d6d86130c779ffb07d2a3308b5694a73..88713569748ac3678bfbb5c1269915893567cecb 100644 +--- a/third_party/rust/rlbox_lucet_sandbox/Cargo.toml ++++ b/third_party/rust/rlbox_lucet_sandbox/Cargo.toml +@@ -8,10 +8,10 @@ license = "MIT" + [dependencies] + failure = ">=0.1.3" # Experimental error handling abstraction. + goblin = ">=0.0.17" # An impish, cross-platform, ELF, Mach-o, and PE binary parsing and loading crate +-lucet-wasi = { git = "https://github.com/PLSysSec/lucet_sandbox_compiler", rev="5e870faf6f95d79d11efc813e56370ad124bbed5" } +-lucet-runtime = { git = "https://github.com/PLSysSec/lucet_sandbox_compiler", rev="5e870faf6f95d79d11efc813e56370ad124bbed5" } +-lucet-runtime-internals = { git = "https://github.com/PLSysSec/lucet_sandbox_compiler", rev="5e870faf6f95d79d11efc813e56370ad124bbed5" } +-lucet-module = { git = "https://github.com/PLSysSec/lucet_sandbox_compiler", rev="5e870faf6f95d79d11efc813e56370ad124bbed5" } ++lucet-wasi = { git = "https://github.com/PLSysSec/lucet_sandbox_compiler", rev="6594bb9dfab7e67eb6eb2fefbc66ab7c491ce730", package = "lucet-wasi-wasmsbx" } ++lucet-runtime = { git = "https://github.com/PLSysSec/lucet_sandbox_compiler", rev="6594bb9dfab7e67eb6eb2fefbc66ab7c491ce730", package = "lucet-runtime-wasmsbx" } ++lucet-runtime-internals = { git = "https://github.com/PLSysSec/lucet_sandbox_compiler", rev="6594bb9dfab7e67eb6eb2fefbc66ab7c491ce730", package = "lucet-runtime-internals-wasmsbx" } ++lucet-module = { git = "https://github.com/PLSysSec/lucet_sandbox_compiler", rev="6594bb9dfab7e67eb6eb2fefbc66ab7c491ce730", package = "lucet-module-wasmsbx" } + # lucet-wasi = { path = "../lucet_sandbox_compiler/lucet-wasi" } + # lucet-runtime = { path = "../lucet_sandbox_compiler/lucet-runtime" } + # lucet-runtime-internals = { path = "../lucet_sandbox_compiler/lucet-runtime/lucet-runtime-internals" } +diff --git a/third_party/rust/rlbox_lucet_sandbox/README.md b/third_party/rust/rlbox_lucet_sandbox/README.md +index 3927c7d52f90e67a219fa7e32a30d313476ea1d6..bc6e062a963a6053f3c10af3eaf8027b414abd5c 100644 +--- a/third_party/rust/rlbox_lucet_sandbox/README.md ++++ b/third_party/rust/rlbox_lucet_sandbox/README.md +@@ -48,11 +48,11 @@ In order to sandbox a library of your choice. + For instance, to edit an existing `make` based build system, you can run the commmand. + + ```bash +-build/_deps/wasiclang-src/opt/wasi-sdk/bin/clang c_src/lucet_sandbox_wrapper.c -c c_src/lucet_sandbox_wrapper.o ++build/_deps/wasiclang-src/opt/wasi-sdk/bin/clang --sysroot build/_deps/wasiclang-src/opt/wasi-sdk/share/wasi-sysroot/ c_src/lucet_sandbox_wrapper.c -c -o c_src/lucet_sandbox_wrapper.o + + CC=build/_deps/wasiclang-src/opt/wasi-sdk/bin/clang \ + CXX=build/_deps/wasiclang-src/opt/wasi-sdk/bin/clang++ \ +-C_FLAGS="--sysroot build/_deps/wasiclang-src/opt/wasi-sdk/share/wasi-sysroot/" \ ++CFLAGS="--sysroot build/_deps/wasiclang-src/opt/wasi-sdk/share/wasi-sysroot/" \ + LD=build/_deps/wasiclang-src/opt/wasi-sdk/bin/wasm-ld \ + LDLIBS=lucet_sandbox_wrapper.o \ + LDFLAGS=-Wl,--export-all \ +@@ -62,12 +62,12 @@ make + - Assuming the above command produced the wasm module `libFoo`, compile this to an ELF shared library using the modified lucetc compiler as shown below. + + ```bash +-build/_deps/lucet/target/release/lucetc \ +- --bindings build/_deps/lucet/lucet-wasi/bindings.json \ +- --guard-size "4GiB" \ +- --min-reserved-size "4GiB" \ +- --max-reserved-size "4GiB" \ +- libFoo \ ++build/cargo/release/lucetc \ ++ --bindings build/_deps/mod_lucet-src/lucet-wasi/bindings.json \ ++ --guard-size "4GiB" \ ++ --min-reserved-size "4GiB" \ ++ --max-reserved-size "4GiB" \ ++ libFoo \ + -o libWasmFoo.so + ``` + - Finally you can write sandboxed code, just as you would with any other RLBox sandbox, such as in the short example below. For more detailed examples, please refer to the tutorial in the [RLBox Repo]((https://github.com/PLSysSec/rlbox_api_cpp17)). +@@ -88,10 +88,10 @@ int main() + } + ``` + +-- To compile the above example, you must include the rlbox header files in `build/_deps/rlbox-src/code/include`, the integration header files in `include/` and the lucet_sandbox library in `build/cargo/{debug or release}/librlbox_lucet_sandbox.so`. For instance, you can compile the above with ++- To compile the above example, you must include the rlbox header files in `build/_deps/rlbox-src/code/include`, the integration header files in `include/` and the lucet_sandbox library in `build/cargo/{debug or release}/librlbox_lucet_sandbox.a` (make sure to use the whole archive linker option). For instance, you can compile the above with + + ```bash +-g++ -std=c++17 example.cpp -o example -I build/_deps/rlbox-src/code/include -I include -l:build/cargo/release/librlbox_lucet_sandbox.so ++g++ -std=c++17 example.cpp -o example -I build/_deps/rlbox-src/code/include -I include -Wl,--whole-archive -l:build/cargo/debug/librlbox_lucet_sandbox.a -Wl,--no-whole-archive + ``` + + ## Contributing Code diff --git a/rpm/0106-Bug-1655929-bump-upstream-versions-of-rlbox-lucet-r-.patch b/rpm/0106-Bug-1655929-bump-upstream-versions-of-rlbox-lucet-r-.patch new file mode 100644 index 0000000000000..14f7ea26e684c --- /dev/null +++ b/rpm/0106-Bug-1655929-bump-upstream-versions-of-rlbox-lucet-r-.patch @@ -0,0 +1,69 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nathan Froyd +Date: Thu, 30 Jul 2020 15:55:30 +0000 +Subject: [PATCH] Bug 1655929 - bump upstream versions of rlbox + lucet; + r=firefox-build-system-reviewers,rstewart + +We need this bump for a couple of reasons: + +1. It enables floating the libc crate version, which makes keeping up-to-date + with upstream changes easier. +2. It enables floating the getrandom crate version, which enables updating + getrandom to a version with less buggy behavior around the Linux + `getrandom` syscall on some architectures. + +We also take this opportunity to sync up our vendored lucet with the lucet +that we use to build things in taskcluster. + +Differential Revision: https://phabricator.services.mozilla.com/D85408 +--- + .cargo/config.in | 4 ++-- + Cargo.toml | 2 +- + taskcluster/ci/fetch/toolchains.yml | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/.cargo/config.in b/.cargo/config.in +index 37fac6a1008a83849771ee5f970df9ef776ae187..b5e11750783e00d274f99cd782e2c05191d34d99 100644 +--- a/.cargo/config.in ++++ b/.cargo/config.in +@@ -70,12 +70,12 @@ rev = "64af847bc5fdcb6d2438bec8a6030812a80519a5" + [source."https://github.com/PLSysSec/rlbox_lucet_sandbox/"] + git = "https://github.com/PLSysSec/rlbox_lucet_sandbox/" + replace-with = "vendored-sources" +-rev = "d510da5999a744c563b0acd18056069d1698273f" ++rev = "9bf4cdada11b2afd18efae5520bb8d3bb5bbc785" + + [source."https://github.com/PLSysSec/lucet_sandbox_compiler"] + git = "https://github.com/PLSysSec/lucet_sandbox_compiler" + replace-with = "vendored-sources" +-rev = "5e870faf6f95d79d11efc813e56370ad124bbed5" ++rev = "6594bb9dfab7e67eb6eb2fefbc66ab7c491ce730" + + [source."https://github.com/ChunMinChang/cubeb-coreaudio-rs"] + git = "https://github.com/ChunMinChang/cubeb-coreaudio-rs" +diff --git a/Cargo.toml b/Cargo.toml +index 897daad41bed7b3ca6589a696b5cf7085556b438..568ea00e2f2949583ebca7d23b690cab5461407b 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -67,7 +67,7 @@ panic = "abort" + [patch.crates-io] + libudev-sys = { path = "dom/webauthn/libudev-sys" } + packed_simd = { git = "https://github.com/hsivonen/packed_simd", rev="07d285ba65d9a4e3b9d76eacbf4c6489e125127d" } +-rlbox_lucet_sandbox = { git = "https://github.com/PLSysSec/rlbox_lucet_sandbox/", rev="d510da5999a744c563b0acd18056069d1698273f" } ++rlbox_lucet_sandbox = { git = "https://github.com/PLSysSec/rlbox_lucet_sandbox/", rev="9bf4cdada11b2afd18efae5520bb8d3bb5bbc785" } + nix = { git = "https://github.com/shravanrn/nix/", rev="4af6c367603869a30fddb5ffb0aba2b9477ba92e" } + spirv_cross = { git = "https://github.com/kvark/spirv_cross", branch = "wgpu3" } + # failure's backtrace feature might break our builds, see bug 1608157. +diff --git a/taskcluster/ci/fetch/toolchains.yml b/taskcluster/ci/fetch/toolchains.yml +index 316fa9639edc0c4a4f606722003795e2f3d65f28..71c558516e71adfb32aff4f04e48f475841ddc08 100755 +--- a/taskcluster/ci/fetch/toolchains.yml ++++ b/taskcluster/ci/fetch/toolchains.yml +@@ -463,7 +463,7 @@ lucetc-source: + fetch: + type: git + repo: https://github.com/PLSysSec/lucet_sandbox_compiler/ +- revision: a0a1ce981638109f1f76cd1eecf17a0436a20055 ++ revision: 6594bb9dfab7e67eb6eb2fefbc66ab7c491ce730 + + dump-syms: + description: dump_syms source code diff --git a/rpm/0107-Add-cfg-if-1.0.0.patch b/rpm/0107-Add-cfg-if-1.0.0.patch new file mode 100644 index 0000000000000..38fb3245bcd65 --- /dev/null +++ b/rpm/0107-Add-cfg-if-1.0.0.patch @@ -0,0 +1,845 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dzmitry Malyshau +Date: Mon, 2 Nov 2020 22:56:40 +0000 +Subject: [PATCH] Add cfg-if 1.0.0 + +Needed by socket2 update. +Rename current cfg-if to cfg-if-0.1.10. + +Picked from commit: +Bug 1674917 - Update parking_lot to 0.11 r=nika + +Differential Revision: https://phabricator.services.mozilla.com/D95610 +--- + Cargo.lock | 48 +++-- + .../rust/cfg-if-0.1.10/.cargo-checksum.json | 1 + + third_party/rust/cfg-if-0.1.10/Cargo.toml | 36 ++++ + third_party/rust/cfg-if-0.1.10/LICENSE-APACHE | 201 ++++++++++++++++++ + third_party/rust/cfg-if-0.1.10/LICENSE-MIT | 25 +++ + third_party/rust/cfg-if-0.1.10/README.md | 47 ++++ + third_party/rust/cfg-if-0.1.10/src/lib.rs | 176 +++++++++++++++ + .../rust/cfg-if-0.1.10/tests/xcrate.rs | 14 ++ + third_party/rust/cfg-if/.cargo-checksum.json | 2 +- + third_party/rust/cfg-if/Cargo.toml | 2 +- + third_party/rust/cfg-if/src/lib.rs | 12 +- + 11 files changed, 535 insertions(+), 29 deletions(-) + create mode 100644 third_party/rust/cfg-if-0.1.10/.cargo-checksum.json + create mode 100644 third_party/rust/cfg-if-0.1.10/Cargo.toml + create mode 100644 third_party/rust/cfg-if-0.1.10/LICENSE-APACHE + create mode 100644 third_party/rust/cfg-if-0.1.10/LICENSE-MIT + create mode 100644 third_party/rust/cfg-if-0.1.10/README.md + create mode 100644 third_party/rust/cfg-if-0.1.10/src/lib.rs + create mode 100644 third_party/rust/cfg-if-0.1.10/tests/xcrate.rs + +diff --git a/Cargo.lock b/Cargo.lock +index dd840a7706b077cf81257d1b0eba57a4da36503c..1ae61d591d2e349642acfc1d22575b4664a554d9 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -117,7 +117,7 @@ version = "0.22.1" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "f8fba1500e466a39dd3faa5aed20a50dfe0aa1b905264a453bbe9f49508994cc" + dependencies = [ +- "cfg-if", ++ "cfg-if 0.1.10", + "dbus", + "libc", + "log", +@@ -288,7 +288,7 @@ checksum = "6bb26d6a69a335b8cb0e7c7e9775cd5666611dc50a37177c3f2cedcfc040e8c8" + dependencies = [ + "bitflags", + "cexpr", +- "cfg-if", ++ "cfg-if 0.1.10", + "clang-sys", + "lazy_static", + "lazycell", +@@ -324,7 +324,7 @@ version = "0.3.2" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "5fa7f0adf37cd5472c978a1ff4be89c1880a923d10df4cfef6a10855a666e09b" + dependencies = [ +- "cfg-if", ++ "cfg-if 0.1.10", + ] + + [[package]] +@@ -560,6 +560,12 @@ version = "0.1.10" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + ++[[package]] ++name = "cfg-if" ++version = "1.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" ++ + [[package]] + name = "chardetng" + version = "0.1.9" +@@ -839,7 +845,7 @@ version = "1.2.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" + dependencies = [ +- "cfg-if", ++ "cfg-if 0.1.10", + ] + + [[package]] +@@ -859,7 +865,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac" + dependencies = [ + "autocfg 0.1.6", +- "cfg-if", ++ "cfg-if 0.1.10", + "crossbeam-utils 0.7.0", + "lazy_static", + "memoffset", +@@ -881,7 +887,7 @@ version = "0.6.5" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "f8306fcef4a7b563b76b7dd949ca48f52bc1141aa067d2ea09565f3e2652aa5c" + dependencies = [ +- "cfg-if", ++ "cfg-if 0.1.10", + "lazy_static", + ] + +@@ -892,7 +898,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" + dependencies = [ + "autocfg 0.1.6", +- "cfg-if", ++ "cfg-if 0.1.10", + "lazy_static", + ] + +@@ -1112,7 +1118,7 @@ version = "2.0.2" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" + dependencies = [ +- "cfg-if", ++ "cfg-if 0.1.10", + "dirs-sys", + ] + +@@ -1122,7 +1128,7 @@ version = "0.3.4" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" + dependencies = [ +- "cfg-if", ++ "cfg-if 0.1.10", + "libc", + "redox_users", + "winapi 0.3.7", +@@ -1237,7 +1243,7 @@ version = "0.8.22" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" + dependencies = [ +- "cfg-if", ++ "cfg-if 0.1.10", + "packed_simd", + ] + +@@ -1370,7 +1376,7 @@ version = "1.0.12" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "ad3c5233c9a940c8719031b423d7e6c16af66e031cb0420b0896f5245bf181d3" + dependencies = [ +- "cfg-if", ++ "cfg-if 0.1.10", + "crc32fast", + "libc", + "miniz_oxide", +@@ -2642,7 +2648,7 @@ version = "0.4.8" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" + dependencies = [ +- "cfg-if", ++ "cfg-if 0.1.10", + ] + + [[package]] +@@ -2872,7 +2878,7 @@ version = "0.6.21" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" + dependencies = [ +- "cfg-if", ++ "cfg-if 0.1.10", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", +@@ -3164,7 +3170,7 @@ version = "0.2.33" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" + dependencies = [ +- "cfg-if", ++ "cfg-if 0.1.10", + "libc", + "winapi 0.3.7", + ] +@@ -3193,7 +3199,7 @@ source = "git+https://github.com/shravanrn/nix/?rev=4af6c367603869a30fddb5ffb0ab + dependencies = [ + "bitflags", + "cc", +- "cfg-if", ++ "cfg-if 0.1.10", + "libc", + "void", + ] +@@ -3417,7 +3423,7 @@ name = "packed_simd" + version = "0.3.4" + source = "git+https://github.com/hsivonen/packed_simd?rev=07d285ba65d9a4e3b9d76eacbf4c6489e125127d#07d285ba65d9a4e3b9d76eacbf4c6489e125127d" + dependencies = [ +- "cfg-if", ++ "cfg-if 0.1.10", + "rustc_version", + ] + +@@ -3443,7 +3449,7 @@ version = "0.7.1" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "0e136c1904604defe99ce5fd71a28d473fa60a12255d511aa78a9ddf11237aeb" + dependencies = [ +- "cfg-if", ++ "cfg-if 0.1.10", + "cloudabi", + "libc", + "redox_syscall", +@@ -4420,7 +4426,7 @@ version = "0.3.10" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "df028e0e632c2a1823d920ad74895e7f9128e6438cbc4bc6fd1f180e644767b9" + dependencies = [ +- "cfg-if", ++ "cfg-if 0.1.10", + "libc", + "redox_syscall", + "winapi 0.3.7", +@@ -4719,7 +4725,7 @@ version = "3.1.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" + dependencies = [ +- "cfg-if", ++ "cfg-if 0.1.10", + "libc", + "rand", + "redox_syscall", +@@ -5228,7 +5234,7 @@ name = "updateagent" + version = "0.1.0" + dependencies = [ + "bits_client", +- "cfg-if", ++ "cfg-if 0.1.10", + "chrono", + "comedy", + "failure", +@@ -5453,7 +5459,7 @@ dependencies = [ + "bitflags", + "build-parallel", + "byteorder", +- "cfg-if", ++ "cfg-if 0.1.10", + "core-foundation", + "core-graphics", + "core-text", +diff --git a/third_party/rust/cfg-if-0.1.10/.cargo-checksum.json b/third_party/rust/cfg-if-0.1.10/.cargo-checksum.json +new file mode 100644 +index 0000000000000000000000000000000000000000..c0c9f9d0437a457fb1446e02589421f1d0594479 +--- /dev/null ++++ b/third_party/rust/cfg-if-0.1.10/.cargo-checksum.json +@@ -0,0 +1 @@ ++{"files":{"Cargo.toml":"2cb2370b62c56a7d51b51f9e405b2f377b3ad6f7f8d33bc69e20eb819ad66012","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"2406e83ee174e30aa67f8ab266836fa78545012b196395aff37c152321e2c713","src/lib.rs":"8dfd667d32d8b06e529643c975dfa14c29ce9a894a80e381a1bd867252e65e56","tests/xcrate.rs":"c0734dae6e63beafcd60bf53546115a2320735b51035c9e2387fdf9301580934"},"package":"4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"} +\ No newline at end of file +diff --git a/third_party/rust/cfg-if-0.1.10/Cargo.toml b/third_party/rust/cfg-if-0.1.10/Cargo.toml +new file mode 100644 +index 0000000000000000000000000000000000000000..5da1d1b4bf378a466dd02d517a8d3763298eb6d1 +--- /dev/null ++++ b/third_party/rust/cfg-if-0.1.10/Cargo.toml +@@ -0,0 +1,36 @@ ++# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO ++# ++# When uploading crates to the registry Cargo will automatically ++# "normalize" Cargo.toml files for maximal compatibility ++# with all versions of Cargo and also rewrite `path` dependencies ++# to registry (e.g., crates.io) dependencies ++# ++# If you believe there's an error in this file please file an ++# issue against the rust-lang/cargo repository. If you're ++# editing this file be aware that the upstream Cargo.toml ++# will likely look very different (and much more reasonable) ++ ++[package] ++edition = "2018" ++name = "cfg-if" ++version = "0.1.10" ++authors = ["Alex Crichton "] ++description = "A macro to ergonomically define an item depending on a large number of #[cfg]\nparameters. Structured like an if-else chain, the first matching branch is the\nitem that gets emitted.\n" ++homepage = "https://github.com/alexcrichton/cfg-if" ++documentation = "https://docs.rs/cfg-if" ++readme = "README.md" ++license = "MIT/Apache-2.0" ++repository = "https://github.com/alexcrichton/cfg-if" ++[dependencies.compiler_builtins] ++version = "0.1.2" ++optional = true ++ ++[dependencies.core] ++version = "1.0.0" ++optional = true ++package = "rustc-std-workspace-core" ++ ++[features] ++rustc-dep-of-std = ["core", "compiler_builtins"] ++[badges.travis-ci] ++repository = "alexcrichton/cfg-if" +diff --git a/third_party/rust/cfg-if-0.1.10/LICENSE-APACHE b/third_party/rust/cfg-if-0.1.10/LICENSE-APACHE +new file mode 100644 +index 0000000000000000000000000000000000000000..16fe87b06e802f094b3fbb0894b137bca2b16ef1 +--- /dev/null ++++ b/third_party/rust/cfg-if-0.1.10/LICENSE-APACHE +@@ -0,0 +1,201 @@ ++ Apache License ++ Version 2.0, January 2004 ++ http://www.apache.org/licenses/ ++ ++TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ++ ++1. Definitions. ++ ++ "License" shall mean the terms and conditions for use, reproduction, ++ and distribution as defined by Sections 1 through 9 of this document. ++ ++ "Licensor" shall mean the copyright owner or entity authorized by ++ the copyright owner that is granting the License. ++ ++ "Legal Entity" shall mean the union of the acting entity and all ++ other entities that control, are controlled by, or are under common ++ control with that entity. For the purposes of this definition, ++ "control" means (i) the power, direct or indirect, to cause the ++ direction or management of such entity, whether by contract or ++ otherwise, or (ii) ownership of fifty percent (50%) or more of the ++ outstanding shares, or (iii) beneficial ownership of such entity. ++ ++ "You" (or "Your") shall mean an individual or Legal Entity ++ exercising permissions granted by this License. ++ ++ "Source" form shall mean the preferred form for making modifications, ++ including but not limited to software source code, documentation ++ source, and configuration files. ++ ++ "Object" form shall mean any form resulting from mechanical ++ transformation or translation of a Source form, including but ++ not limited to compiled object code, generated documentation, ++ and conversions to other media types. ++ ++ "Work" shall mean the work of authorship, whether in Source or ++ Object form, made available under the License, as indicated by a ++ copyright notice that is included in or attached to the work ++ (an example is provided in the Appendix below). ++ ++ "Derivative Works" shall mean any work, whether in Source or Object ++ form, that is based on (or derived from) the Work and for which the ++ editorial revisions, annotations, elaborations, or other modifications ++ represent, as a whole, an original work of authorship. For the purposes ++ of this License, Derivative Works shall not include works that remain ++ separable from, or merely link (or bind by name) to the interfaces of, ++ the Work and Derivative Works thereof. ++ ++ "Contribution" shall mean any work of authorship, including ++ the original version of the Work and any modifications or additions ++ to that Work or Derivative Works thereof, that is intentionally ++ submitted to Licensor for inclusion in the Work by the copyright owner ++ or by an individual or Legal Entity authorized to submit on behalf of ++ the copyright owner. For the purposes of this definition, "submitted" ++ means any form of electronic, verbal, or written communication sent ++ to the Licensor or its representatives, including but not limited to ++ communication on electronic mailing lists, source code control systems, ++ and issue tracking systems that are managed by, or on behalf of, the ++ Licensor for the purpose of discussing and improving the Work, but ++ excluding communication that is conspicuously marked or otherwise ++ designated in writing by the copyright owner as "Not a Contribution." ++ ++ "Contributor" shall mean Licensor and any individual or Legal Entity ++ on behalf of whom a Contribution has been received by Licensor and ++ subsequently incorporated within the Work. ++ ++2. Grant of Copyright License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ copyright license to reproduce, prepare Derivative Works of, ++ publicly display, publicly perform, sublicense, and distribute the ++ Work and such Derivative Works in Source or Object form. ++ ++3. Grant of Patent License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ (except as stated in this section) patent license to make, have made, ++ use, offer to sell, sell, import, and otherwise transfer the Work, ++ where such license applies only to those patent claims licensable ++ by such Contributor that are necessarily infringed by their ++ Contribution(s) alone or by combination of their Contribution(s) ++ with the Work to which such Contribution(s) was submitted. If You ++ institute patent litigation against any entity (including a ++ cross-claim or counterclaim in a lawsuit) alleging that the Work ++ or a Contribution incorporated within the Work constitutes direct ++ or contributory patent infringement, then any patent licenses ++ granted to You under this License for that Work shall terminate ++ as of the date such litigation is filed. ++ ++4. Redistribution. You may reproduce and distribute copies of the ++ Work or Derivative Works thereof in any medium, with or without ++ modifications, and in Source or Object form, provided that You ++ meet the following conditions: ++ ++ (a) You must give any other recipients of the Work or ++ Derivative Works a copy of this License; and ++ ++ (b) You must cause any modified files to carry prominent notices ++ stating that You changed the files; and ++ ++ (c) You must retain, in the Source form of any Derivative Works ++ that You distribute, all copyright, patent, trademark, and ++ attribution notices from the Source form of the Work, ++ excluding those notices that do not pertain to any part of ++ the Derivative Works; and ++ ++ (d) If the Work includes a "NOTICE" text file as part of its ++ distribution, then any Derivative Works that You distribute must ++ include a readable copy of the attribution notices contained ++ within such NOTICE file, excluding those notices that do not ++ pertain to any part of the Derivative Works, in at least one ++ of the following places: within a NOTICE text file distributed ++ as part of the Derivative Works; within the Source form or ++ documentation, if provided along with the Derivative Works; or, ++ within a display generated by the Derivative Works, if and ++ wherever such third-party notices normally appear. The contents ++ of the NOTICE file are for informational purposes only and ++ do not modify the License. You may add Your own attribution ++ notices within Derivative Works that You distribute, alongside ++ or as an addendum to the NOTICE text from the Work, provided ++ that such additional attribution notices cannot be construed ++ as modifying the License. ++ ++ You may add Your own copyright statement to Your modifications and ++ may provide additional or different license terms and conditions ++ for use, reproduction, or distribution of Your modifications, or ++ for any such Derivative Works as a whole, provided Your use, ++ reproduction, and distribution of the Work otherwise complies with ++ the conditions stated in this License. ++ ++5. Submission of Contributions. Unless You explicitly state otherwise, ++ any Contribution intentionally submitted for inclusion in the Work ++ by You to the Licensor shall be under the terms and conditions of ++ this License, without any additional terms or conditions. ++ Notwithstanding the above, nothing herein shall supersede or modify ++ the terms of any separate license agreement you may have executed ++ with Licensor regarding such Contributions. ++ ++6. Trademarks. This License does not grant permission to use the trade ++ names, trademarks, service marks, or product names of the Licensor, ++ except as required for reasonable and customary use in describing the ++ origin of the Work and reproducing the content of the NOTICE file. ++ ++7. Disclaimer of Warranty. Unless required by applicable law or ++ agreed to in writing, Licensor provides the Work (and each ++ Contributor provides its Contributions) on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ++ implied, including, without limitation, any warranties or conditions ++ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A ++ PARTICULAR PURPOSE. You are solely responsible for determining the ++ appropriateness of using or redistributing the Work and assume any ++ risks associated with Your exercise of permissions under this License. ++ ++8. Limitation of Liability. In no event and under no legal theory, ++ whether in tort (including negligence), contract, or otherwise, ++ unless required by applicable law (such as deliberate and grossly ++ negligent acts) or agreed to in writing, shall any Contributor be ++ liable to You for damages, including any direct, indirect, special, ++ incidental, or consequential damages of any character arising as a ++ result of this License or out of the use or inability to use the ++ Work (including but not limited to damages for loss of goodwill, ++ work stoppage, computer failure or malfunction, or any and all ++ other commercial damages or losses), even if such Contributor ++ has been advised of the possibility of such damages. ++ ++9. Accepting Warranty or Additional Liability. While redistributing ++ the Work or Derivative Works thereof, You may choose to offer, ++ and charge a fee for, acceptance of support, warranty, indemnity, ++ or other liability obligations and/or rights consistent with this ++ License. However, in accepting such obligations, You may act only ++ on Your own behalf and on Your sole responsibility, not on behalf ++ of any other Contributor, and only if You agree to indemnify, ++ defend, and hold each Contributor harmless for any liability ++ incurred by, or claims asserted against, such Contributor by reason ++ of your accepting any such warranty or additional liability. ++ ++END OF TERMS AND CONDITIONS ++ ++APPENDIX: How to apply the Apache License to your work. ++ ++ To apply the Apache License to your work, attach the following ++ boilerplate notice, with the fields enclosed by brackets "[]" ++ replaced with your own identifying information. (Don't include ++ the brackets!) The text should be enclosed in the appropriate ++ comment syntax for the file format. We also recommend that a ++ file or class name and description of purpose be included on the ++ same "printed page" as the copyright notice for easier ++ identification within third-party archives. ++ ++Copyright [yyyy] [name of copyright owner] ++ ++Licensed under the Apache License, Version 2.0 (the "License"); ++you may not use this file except in compliance with the License. ++You may obtain a copy of the License at ++ ++ http://www.apache.org/licenses/LICENSE-2.0 ++ ++Unless required by applicable law or agreed to in writing, software ++distributed under the License is distributed on an "AS IS" BASIS, ++WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++See the License for the specific language governing permissions and ++limitations under the License. +diff --git a/third_party/rust/cfg-if-0.1.10/LICENSE-MIT b/third_party/rust/cfg-if-0.1.10/LICENSE-MIT +new file mode 100644 +index 0000000000000000000000000000000000000000..39e0ed6602151f235148e6c08413aa7eda5b9038 +--- /dev/null ++++ b/third_party/rust/cfg-if-0.1.10/LICENSE-MIT +@@ -0,0 +1,25 @@ ++Copyright (c) 2014 Alex Crichton ++ ++Permission is hereby granted, free of charge, to any ++person obtaining a copy of this software and associated ++documentation files (the "Software"), to deal in the ++Software without restriction, including without ++limitation the rights to use, copy, modify, merge, ++publish, distribute, sublicense, and/or sell copies of ++the Software, and to permit persons to whom the Software ++is furnished to do so, subject to the following ++conditions: ++ ++The above copyright notice and this permission notice ++shall be included in all copies or substantial portions ++of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ++ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ++TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT ++SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR ++IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++DEALINGS IN THE SOFTWARE. +diff --git a/third_party/rust/cfg-if-0.1.10/README.md b/third_party/rust/cfg-if-0.1.10/README.md +new file mode 100644 +index 0000000000000000000000000000000000000000..50b5e3b2dc00fa2224dae2cf1a88ce61546173ff +--- /dev/null ++++ b/third_party/rust/cfg-if-0.1.10/README.md +@@ -0,0 +1,47 @@ ++# cfg-if ++ ++[Documentation](https://docs.rs/cfg-if) ++ ++A macro to ergonomically define an item depending on a large number of #[cfg] ++parameters. Structured like an if-else chain, the first matching branch is the ++item that gets emitted. ++ ++```toml ++[dependencies] ++cfg-if = "0.1" ++``` ++ ++## Example ++ ++```rust ++cfg_if::cfg_if! { ++ if #[cfg(unix)] { ++ fn foo() { /* unix specific functionality */ } ++ } else if #[cfg(target_pointer_width = "32")] { ++ fn foo() { /* non-unix, 32-bit functionality */ } ++ } else { ++ fn foo() { /* fallback implementation */ } ++ } ++} ++ ++fn main() { ++ foo(); ++} ++``` ++ ++# License ++ ++This project is licensed under either of ++ ++ * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or ++ http://www.apache.org/licenses/LICENSE-2.0) ++ * MIT license ([LICENSE-MIT](LICENSE-MIT) or ++ http://opensource.org/licenses/MIT) ++ ++at your option. ++ ++### Contribution ++ ++Unless you explicitly state otherwise, any contribution intentionally submitted ++for inclusion in `cfg-if` by you, as defined in the Apache-2.0 license, shall be ++dual licensed as above, without any additional terms or conditions. +diff --git a/third_party/rust/cfg-if-0.1.10/src/lib.rs b/third_party/rust/cfg-if-0.1.10/src/lib.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..6c5058dadfbab7730f5c29265241dc78a10c47df +--- /dev/null ++++ b/third_party/rust/cfg-if-0.1.10/src/lib.rs +@@ -0,0 +1,176 @@ ++//! A macro for defining `#[cfg]` if-else statements. ++//! ++//! The macro provided by this crate, `cfg_if`, is similar to the `if/elif` C ++//! preprocessor macro by allowing definition of a cascade of `#[cfg]` cases, ++//! emitting the implementation which matches first. ++//! ++//! This allows you to conveniently provide a long list `#[cfg]`'d blocks of code ++//! without having to rewrite each clause multiple times. ++//! ++//! # Example ++//! ++//! ``` ++//! cfg_if::cfg_if! { ++//! if #[cfg(unix)] { ++//! fn foo() { /* unix specific functionality */ } ++//! } else if #[cfg(target_pointer_width = "32")] { ++//! fn foo() { /* non-unix, 32-bit functionality */ } ++//! } else { ++//! fn foo() { /* fallback implementation */ } ++//! } ++//! } ++//! ++//! # fn main() {} ++//! ``` ++ ++#![no_std] ++#![doc(html_root_url = "https://docs.rs/cfg-if")] ++#![deny(missing_docs)] ++#![cfg_attr(test, deny(warnings))] ++ ++/// The main macro provided by this crate. See crate documentation for more ++/// information. ++#[macro_export] ++macro_rules! cfg_if { ++ // match if/else chains with a final `else` ++ ($( ++ if #[cfg($($meta:meta),*)] { $($tokens:tt)* } ++ ) else * else { ++ $($tokens2:tt)* ++ }) => { ++ $crate::cfg_if! { ++ @__items ++ () ; ++ $( ( ($($meta),*) ($($tokens)*) ), )* ++ ( () ($($tokens2)*) ), ++ } ++ }; ++ ++ // match if/else chains lacking a final `else` ++ ( ++ if #[cfg($($i_met:meta),*)] { $($i_tokens:tt)* } ++ $( ++ else if #[cfg($($e_met:meta),*)] { $($e_tokens:tt)* } ++ )* ++ ) => { ++ $crate::cfg_if! { ++ @__items ++ () ; ++ ( ($($i_met),*) ($($i_tokens)*) ), ++ $( ( ($($e_met),*) ($($e_tokens)*) ), )* ++ ( () () ), ++ } ++ }; ++ ++ // Internal and recursive macro to emit all the items ++ // ++ // Collects all the negated cfgs in a list at the beginning and after the ++ // semicolon is all the remaining items ++ (@__items ($($not:meta,)*) ; ) => {}; ++ (@__items ($($not:meta,)*) ; ( ($($m:meta),*) ($($tokens:tt)*) ), $($rest:tt)*) => { ++ // Emit all items within one block, applying an appropriate #[cfg]. The ++ // #[cfg] will require all `$m` matchers specified and must also negate ++ // all previous matchers. ++ #[cfg(all($($m,)* not(any($($not),*))))] $crate::cfg_if! { @__identity $($tokens)* } ++ ++ // Recurse to emit all other items in `$rest`, and when we do so add all ++ // our `$m` matchers to the list of `$not` matchers as future emissions ++ // will have to negate everything we just matched as well. ++ $crate::cfg_if! { @__items ($($not,)* $($m,)*) ; $($rest)* } ++ }; ++ ++ // Internal macro to make __apply work out right for different match types, ++ // because of how macros matching/expand stuff. ++ (@__identity $($tokens:tt)*) => { ++ $($tokens)* ++ }; ++} ++ ++#[cfg(test)] ++mod tests { ++ cfg_if! { ++ if #[cfg(test)] { ++ use core::option::Option as Option2; ++ fn works1() -> Option2 { Some(1) } ++ } else { ++ fn works1() -> Option { None } ++ } ++ } ++ ++ cfg_if! { ++ if #[cfg(foo)] { ++ fn works2() -> bool { false } ++ } else if #[cfg(test)] { ++ fn works2() -> bool { true } ++ } else { ++ fn works2() -> bool { false } ++ } ++ } ++ ++ cfg_if! { ++ if #[cfg(foo)] { ++ fn works3() -> bool { false } ++ } else { ++ fn works3() -> bool { true } ++ } ++ } ++ ++ cfg_if! { ++ if #[cfg(test)] { ++ use core::option::Option as Option3; ++ fn works4() -> Option3 { Some(1) } ++ } ++ } ++ ++ cfg_if! { ++ if #[cfg(foo)] { ++ fn works5() -> bool { false } ++ } else if #[cfg(test)] { ++ fn works5() -> bool { true } ++ } ++ } ++ ++ #[test] ++ fn it_works() { ++ assert!(works1().is_some()); ++ assert!(works2()); ++ assert!(works3()); ++ assert!(works4().is_some()); ++ assert!(works5()); ++ } ++ ++ #[test] ++ #[allow(clippy::assertions_on_constants)] ++ fn test_usage_within_a_function() { ++ cfg_if! {if #[cfg(debug_assertions)] { ++ // we want to put more than one thing here to make sure that they ++ // all get configured properly. ++ assert!(cfg!(debug_assertions)); ++ assert_eq!(4, 2+2); ++ } else { ++ assert!(works1().is_some()); ++ assert_eq!(10, 5+5); ++ }} ++ } ++ ++ trait Trait { ++ fn blah(&self); ++ } ++ ++ #[allow(dead_code)] ++ struct Struct; ++ ++ impl Trait for Struct { ++ cfg_if! { ++ if #[cfg(feature = "blah")] { ++ fn blah(&self) { ++ unimplemented!(); ++ } ++ } else { ++ fn blah(&self) { ++ unimplemented!(); ++ } ++ } ++ } ++ } ++} +diff --git a/third_party/rust/cfg-if-0.1.10/tests/xcrate.rs b/third_party/rust/cfg-if-0.1.10/tests/xcrate.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..e7b4a362adf91e7bc6faa8887ba4474637fc4e8f +--- /dev/null ++++ b/third_party/rust/cfg-if-0.1.10/tests/xcrate.rs +@@ -0,0 +1,14 @@ ++cfg_if::cfg_if! { ++ if #[cfg(foo)] { ++ fn works() -> bool { false } ++ } else if #[cfg(test)] { ++ fn works() -> bool { true } ++ } else { ++ fn works() -> bool { false } ++ } ++} ++ ++#[test] ++fn smoke() { ++ assert!(works()); ++} +diff --git a/third_party/rust/cfg-if/.cargo-checksum.json b/third_party/rust/cfg-if/.cargo-checksum.json +index c0c9f9d0437a457fb1446e02589421f1d0594479..93e07c191ba289b4cd0514755a47171bdefe3cf7 100644 +--- a/third_party/rust/cfg-if/.cargo-checksum.json ++++ b/third_party/rust/cfg-if/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"2cb2370b62c56a7d51b51f9e405b2f377b3ad6f7f8d33bc69e20eb819ad66012","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"2406e83ee174e30aa67f8ab266836fa78545012b196395aff37c152321e2c713","src/lib.rs":"8dfd667d32d8b06e529643c975dfa14c29ce9a894a80e381a1bd867252e65e56","tests/xcrate.rs":"c0734dae6e63beafcd60bf53546115a2320735b51035c9e2387fdf9301580934"},"package":"4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"} +\ No newline at end of file ++{"files":{"Cargo.toml":"5b2a8f6e5256957c029cf3a8912d51438e7faa5891c5c102c312f6d4599c1f00","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"2406e83ee174e30aa67f8ab266836fa78545012b196395aff37c152321e2c713","src/lib.rs":"54b0f108b0dc48a077c52c0bcd22b64ef4de083e5e2b7d405e50ae4d78224f1b","tests/xcrate.rs":"c0734dae6e63beafcd60bf53546115a2320735b51035c9e2387fdf9301580934"},"package":"baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"} +\ No newline at end of file +diff --git a/third_party/rust/cfg-if/Cargo.toml b/third_party/rust/cfg-if/Cargo.toml +index 5da1d1b4bf378a466dd02d517a8d3763298eb6d1..13a32ba2048d4d34ccadf98e3c7e69c7661ce679 100644 +--- a/third_party/rust/cfg-if/Cargo.toml ++++ b/third_party/rust/cfg-if/Cargo.toml +@@ -13,7 +13,7 @@ + [package] + edition = "2018" + name = "cfg-if" +-version = "0.1.10" ++version = "1.0.0" + authors = ["Alex Crichton "] + description = "A macro to ergonomically define an item depending on a large number of #[cfg]\nparameters. Structured like an if-else chain, the first matching branch is the\nitem that gets emitted.\n" + homepage = "https://github.com/alexcrichton/cfg-if" +diff --git a/third_party/rust/cfg-if/src/lib.rs b/third_party/rust/cfg-if/src/lib.rs +index 6c5058dadfbab7730f5c29265241dc78a10c47df..52bbbe0f375c75acd7d73724cac500a7f5c32106 100644 +--- a/third_party/rust/cfg-if/src/lib.rs ++++ b/third_party/rust/cfg-if/src/lib.rs +@@ -34,30 +34,30 @@ + macro_rules! cfg_if { + // match if/else chains with a final `else` + ($( +- if #[cfg($($meta:meta),*)] { $($tokens:tt)* } ++ if #[cfg($meta:meta)] { $($tokens:tt)* } + ) else * else { + $($tokens2:tt)* + }) => { + $crate::cfg_if! { + @__items + () ; +- $( ( ($($meta),*) ($($tokens)*) ), )* ++ $( ( ($meta) ($($tokens)*) ), )* + ( () ($($tokens2)*) ), + } + }; + + // match if/else chains lacking a final `else` + ( +- if #[cfg($($i_met:meta),*)] { $($i_tokens:tt)* } ++ if #[cfg($i_met:meta)] { $($i_tokens:tt)* } + $( +- else if #[cfg($($e_met:meta),*)] { $($e_tokens:tt)* } ++ else if #[cfg($e_met:meta)] { $($e_tokens:tt)* } + )* + ) => { + $crate::cfg_if! { + @__items + () ; +- ( ($($i_met),*) ($($i_tokens)*) ), +- $( ( ($($e_met),*) ($($e_tokens)*) ), )* ++ ( ($i_met) ($($i_tokens)*) ), ++ $( ( ($e_met) ($($e_tokens)*) ), )* + ( () () ), + } + }; diff --git a/rpm/0108-Bug-1716518-Upgrade-socket2-to-v0.3.19.patch b/rpm/0108-Bug-1716518-Upgrade-socket2-to-v0.3.19.patch new file mode 100644 index 0000000000000..3f27229122bda --- /dev/null +++ b/rpm/0108-Bug-1716518-Upgrade-socket2-to-v0.3.19.patch @@ -0,0 +1,2887 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mike Hommey +Date: Tue, 15 Jun 2021 09:25:26 +0000 +Subject: [PATCH] Bug 1716518 - Upgrade socket2 to v0.3.19. + +Differential Revision: https://phabricator.services.mozilla.com/D117862 + +Depends on D117861 +--- + Cargo.lock | 7 +- + third_party/rust/socket2/.cargo-checksum.json | 2 +- + third_party/rust/socket2/Cargo.toml | 13 +- + third_party/rust/socket2/README.md | 3 - + third_party/rust/socket2/SO_ACCEPTCONN.patch | 96 ++ + third_party/rust/socket2/TODO | 20 + + third_party/rust/socket2/check_targets.bash | 15 + + third_party/rust/socket2/diff.patch | 134 +++ + third_party/rust/socket2/src/lib.rs | 192 ++-- + third_party/rust/socket2/src/sockaddr.rs | 189 +++- + third_party/rust/socket2/src/socket.rs | 361 +++++--- + third_party/rust/socket2/src/sys/redox/mod.rs | 828 ------------------ + third_party/rust/socket2/src/sys/unix.rs | 288 +++++- + third_party/rust/socket2/src/sys/windows.rs | 95 +- + third_party/rust/socket2/src/tests.rs | 62 ++ + 15 files changed, 1193 insertions(+), 1112 deletions(-) + create mode 100644 third_party/rust/socket2/SO_ACCEPTCONN.patch + create mode 100644 third_party/rust/socket2/TODO + create mode 100755 third_party/rust/socket2/check_targets.bash + create mode 100644 third_party/rust/socket2/diff.patch + delete mode 100644 third_party/rust/socket2/src/sys/redox/mod.rs + create mode 100644 third_party/rust/socket2/src/tests.rs + +diff --git a/Cargo.lock b/Cargo.lock +index 1ae61d591d2e349642acfc1d22575b4664a554d9..cd496dd941cf2883f748588875a6edfcb4d9349c 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -4422,13 +4422,12 @@ dependencies = [ + + [[package]] + name = "socket2" +-version = "0.3.10" ++version = "0.3.19" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "df028e0e632c2a1823d920ad74895e7f9128e6438cbc4bc6fd1f180e644767b9" ++checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" + dependencies = [ +- "cfg-if 0.1.10", ++ "cfg-if 1.0.0", + "libc", +- "redox_syscall", + "winapi 0.3.7", + ] + +diff --git a/third_party/rust/socket2/.cargo-checksum.json b/third_party/rust/socket2/.cargo-checksum.json +index ead8f765101aefb3bcaeee297d4c3545225bbf84..d395b486a4c7f8c0e7fd942b9292d6a70602b822 100644 +--- a/third_party/rust/socket2/.cargo-checksum.json ++++ b/third_party/rust/socket2/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"183f6012d61dc2388de7c5d5453c03a3f9971c00203ec95b17d11a463fc7a44f","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"76b59d53338de3386da807f4d5028cb2a73d027e5d7747e2ad04e2ef113c41dc","src/lib.rs":"4c2966cd283751a96f1769fbe529fd1105bc2a8ac15dc2148b6cfc4cca24cd38","src/sockaddr.rs":"66a14de3a133fb81cefb30737a4470de38c12cd04b115fdd98b1ef7870c22e19","src/socket.rs":"674a1ecb5a7caa256533e85d075afe43c6e97eaf9b68fcaacaaaeb29eb338040","src/sys/redox/mod.rs":"a6ba2a38a7af83a3c85cee892f2a2dc7c66aba267e50f02f682eee938f067e95","src/sys/unix.rs":"8fadee55eb4ed7d6c18700b3e673667b1a4f29ec3a3280194a60c0fe6a7fbad1","src/sys/windows.rs":"2e914bf3aa08452ebf3358f941f93469b7eb2982909d620139f263c3bb82f28a","src/utils.rs":"53968de8c8e078a650fa316438622be9bb78bca95ed07c4f8da2c940ae27e0ae"},"package":"df028e0e632c2a1823d920ad74895e7f9128e6438cbc4bc6fd1f180e644767b9"} +\ No newline at end of file ++{"files":{"Cargo.toml":"54fecae223099432de172b711c6f23f4bb46d99e8fcb3f63f52ae1960c23b8c6","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"9c3d94f57a3464986df30edf46250fa70200b40b9c70d8cac6b2fc3a76d24631","SO_ACCEPTCONN.patch":"e942fd2208a41d2b895354a6d80bc0c4aed875d48e6f5a66fa94cf193233c5c2","TODO":"4d0c6a6a858204015a6eac72f2e6d6fc8638ee78595c5600a07a8015975fdaf2","check_targets.bash":"dd9de020e3991988c8183327ab1d1b7c0cfbb21364676a6c4b8a4a0f8fafd6ef","diff.patch":"acb27c495149dab10f9436efcca5f5637d2f4a1527028eeeb58858a3e1ad13e0","src/lib.rs":"1f2159502b551883652e32a02a6f4d60b284ad916cd970994c8beb40b4cc9118","src/sockaddr.rs":"109824754ba77687a47e51a3ed5f8b0abecbe397a633a99fc94cc637bc698d76","src/socket.rs":"6aeb83003381e4a4424c2c7b08bd01bbd837fd4edcec156983df07316e1dca57","src/sys/unix.rs":"10e3d4d2e4e460f45acc670c7fb9ad24f3f60cdf0971bf4ed6f94e158e0551a8","src/sys/windows.rs":"5180e6fbe029fcfc710e1d3498646f4a13b39a7eb62a2b3b0b01c29a7e9dc411","src/tests.rs":"d17e44cc61c646f41b4a18a7f7cb4e632ea34dc1c7d347928e0ed6295840a0ae","src/utils.rs":"53968de8c8e078a650fa316438622be9bb78bca95ed07c4f8da2c940ae27e0ae"},"package":"122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e"} +\ No newline at end of file +diff --git a/third_party/rust/socket2/Cargo.toml b/third_party/rust/socket2/Cargo.toml +index 41be0c309324421f2922b311875a564ebd08bf02..7894d061e3f6fc59dbc369065cb1ea1519f55e64 100644 +--- a/third_party/rust/socket2/Cargo.toml ++++ b/third_party/rust/socket2/Cargo.toml +@@ -13,7 +13,7 @@ + [package] + edition = "2018" + name = "socket2" +-version = "0.3.10" ++version = "0.3.19" + authors = ["Alex Crichton "] + description = "Utilities for handling networking sockets with a maximal amount of configuration\npossible intended.\n" + homepage = "https://github.com/alexcrichton/socket2-rs" +@@ -29,13 +29,12 @@ version = "0.3" + pair = [] + reuseport = [] + unix = [] +-[target."cfg(any(unix, target_os = \"redox\"))".dependencies.cfg-if] +-version = "0.1" ++[target."cfg(unix)".dependencies.cfg-if] ++version = "1.0" + +-[target."cfg(any(unix, target_os = \"redox\"))".dependencies.libc] +-version = "0.2.42" +-[target."cfg(target_os = \"redox\")".dependencies.redox_syscall] +-version = "0.1.38" ++[target."cfg(unix)".dependencies.libc] ++version = "0.2.66" ++features = ["align"] + [target."cfg(windows)".dependencies.winapi] + version = "0.3.3" + features = ["handleapi", "ws2def", "ws2ipdef", "ws2tcpip", "minwindef"] +diff --git a/third_party/rust/socket2/README.md b/third_party/rust/socket2/README.md +index 0e9e9148185f1c6f7de2504c0fc2f4929e7a7ecb..10d9b1c81ea78f188cdca655b143cb7931139d03 100644 +--- a/third_party/rust/socket2/README.md ++++ b/third_party/rust/socket2/README.md +@@ -1,8 +1,5 @@ + # socket2-rs + +-[![Build Status](https://travis-ci.com/alexcrichton/socket2-rs.svg?branch=master)](https://travis-ci.com/alexcrichton/socket2-rs) +-[![Build status](https://ci.appveyor.com/api/projects/status/hovebj1gr4bgm3d9?svg=true)](https://ci.appveyor.com/project/alexcrichton/socket2-rs) +- + [Documentation](https://docs.rs/socket2) + + # License +diff --git a/third_party/rust/socket2/SO_ACCEPTCONN.patch b/third_party/rust/socket2/SO_ACCEPTCONN.patch +new file mode 100644 +index 0000000000000000000000000000000000000000..116951af0d8dbd27864192812c1c30f62b9d869f +--- /dev/null ++++ b/third_party/rust/socket2/SO_ACCEPTCONN.patch +@@ -0,0 +1,96 @@ ++diff --git a/src/socket.rs b/src/socket.rs ++index 725ad2a..3f7b499 100644 ++--- a/src/socket.rs +++++ b/src/socket.rs ++@@ -963,6 +963,26 @@ fn inner(&self) -> &sys::Socket { ++ } ++ } ++ +++/// Socket options get/set using `SOL_SOCKET`. +++/// +++/// Additional documentation can be found in documentation of the OS. +++/// * Linux: +++/// * Windows: +++impl Socket { +++ /// Gets the value of the `SO_ACCEPTCONN` option on this socket. +++ /// +++ /// Returns `true` if this socket has been marked to accept connections with +++ /// [`listen`]. +++ /// +++ /// [`listen`]: Socket::listen +++ pub fn is_listener(&self) -> io::Result { +++ unsafe { +++ getsockopt::(self.inner, sys::SOL_SOCKET, sys::SO_ACCEPTCONN) +++ .map(|is_listener| is_listener != 0) +++ } +++ } +++} +++ ++ /// Socket options for TCP socket, get/set using `IPPROTO_TCP`. ++ /// ++ /// Additional documentation can be found in documentation of the OS. ++diff --git a/src/sys/unix.rs b/src/sys/unix.rs ++index 60593a1..51b916a 100644 ++--- a/src/sys/unix.rs +++++ b/src/sys/unix.rs ++@@ -54,8 +54,8 @@ ++ pub(crate) use libc::MSG_OOB; ++ pub(crate) use libc::{ ++ IPPROTO_IP, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, IPV6_MULTICAST_LOOP, IPV6_UNICAST_HOPS, ++- IPV6_V6ONLY, IP_MULTICAST_LOOP, IP_MULTICAST_TTL, IP_TTL, MSG_PEEK, SOL_SOCKET, SO_BROADCAST, ++- SO_ERROR, TCP_NODELAY, +++ IPV6_V6ONLY, IP_MULTICAST_LOOP, IP_MULTICAST_TTL, IP_TTL, MSG_PEEK, SOL_SOCKET, SO_ACCEPTCONN, +++ SO_BROADCAST, SO_ERROR, TCP_NODELAY, ++ }; ++ ++ // See this type in the Windows file. ++diff --git a/src/sys/windows.rs b/src/sys/windows.rs ++index 663b63f..a212525 100644 ++--- a/src/sys/windows.rs +++++ b/src/sys/windows.rs ++@@ -60,7 +60,7 @@ ++ pub(crate) use winapi::um::ws2tcpip::socklen_t; ++ // Used in `Socket`. ++ pub(crate) use winapi::shared::ws2def::{ ++- IPPROTO_IP, SOL_SOCKET, SO_BROADCAST, SO_ERROR, TCP_NODELAY, +++ IPPROTO_IP, SOL_SOCKET, SO_ACCEPTCONN, SO_BROADCAST, SO_ERROR, TCP_NODELAY, ++ }; ++ pub(crate) use winapi::shared::ws2ipdef::{ ++ IPV6_MULTICAST_HOPS, IPV6_MULTICAST_LOOP, IPV6_UNICAST_HOPS, IPV6_V6ONLY, IP_MULTICAST_LOOP, ++diff --git a/tests/options.rs b/tests/options.rs ++index 9c3d1c2..2d256a7 100644 ++--- a/tests/options.rs +++++ b/tests/options.rs ++@@ -1,6 +1,8 @@ ++ //! Tests for getting and setting socket options. ++ ++-use socket2::{Domain, Socket, Type}; +++use std::net::SocketAddr; +++ +++use socket2::{Domain, Protocol, Socket, Type}; ++ ++ /// Macro to create a simple test to set and get a socket option. ++ macro_rules! test { ++@@ -86,6 +88,22 @@ fn $get_fn() { ++ set_mark(123) ++ ); ++ +++#[test] +++fn is_listener() { +++ // TODO: IPv6. +++ +++ let socket = Socket::new(Domain::IPV4, Type::STREAM, Some(Protocol::TCP)) +++ .expect("failed to create `Socket`"); +++ //assert_eq!(socket.is_listener().unwrap(), false); +++ +++ let addr: SocketAddr = "127.0.0.1:0".parse().unwrap(); +++ let addr = addr.into(); +++ socket.bind(&addr).unwrap(); +++ socket.listen(1).unwrap(); +++ dbg!(socket.is_listener()); +++ assert_eq!(socket.is_listener().unwrap(), true); +++} +++ ++ test!(IPv4 ttl, set_ttl(40)); ++ #[cfg(not(windows))] // TODO: returns `WSAENOPROTOOPT` (10042) on Windows. ++ test!(IPv4 broadcast, set_broadcast(true)); +diff --git a/third_party/rust/socket2/TODO b/third_party/rust/socket2/TODO +new file mode 100644 +index 0000000000000000000000000000000000000000..ce1f1fa5ba571e69fb8ec18f9c0197608c20df5a +--- /dev/null ++++ b/third_party/rust/socket2/TODO +@@ -0,0 +1,20 @@ ++# Refactor ++ ++* [ ] CONTRIBUTING.md ++* [ ] Move tests from src/*.rs to tests dir. ++* [ ] Tracking issue for tests. Check all functions/coverage (with `rustcov`). ++* [ ] Look at `SockAddr`. ++ * [ ] Add docs about its size. ++ ++## Maybe add socket options ++ ++# SOL_SOCKET ++SO_ACCEPTCONN ++SO_DOMAIN ++SO_TYPE ++SO_INCOMING_CPU // Linux only? ++SO_INCOMING_NAPI_ID // Linux only? ++ ++# No-op/error returned on Windows: ++SO_RCVLOWAT ++SO_SNDLOWAT +diff --git a/third_party/rust/socket2/check_targets.bash b/third_party/rust/socket2/check_targets.bash +new file mode 100755 +index 0000000000000000000000000000000000000000..343b42a25f9876a10fb44f14710e8a73fdd19c07 +--- /dev/null ++++ b/third_party/rust/socket2/check_targets.bash +@@ -0,0 +1,15 @@ ++#!/usr/bin/env bash ++ ++set -eu ++ ++declare -a targets=( ++ "x86_64-apple-darwin" ++ "x86_64-unknown-freebsd" ++ "x86_64-unknown-linux-gnu" ++ "x86_64-pc-windows-gnu" ++) ++ ++for target in "${targets[@]}"; do ++ cargo check --target "$target" --all-targets --examples --bins --tests --no-default-features ++ cargo check --target "$target" --all-targets --examples --bins --tests --all-features ++done +diff --git a/third_party/rust/socket2/diff.patch b/third_party/rust/socket2/diff.patch +new file mode 100644 +index 0000000000000000000000000000000000000000..7c4badacdfecd3b50557eab118135fc7f9836618 +--- /dev/null ++++ b/third_party/rust/socket2/diff.patch +@@ -0,0 +1,134 @@ ++commit 3851430dec41c204d6219a84c47ca6885622a98e ++Author: kolapapa ++Date: Sun Dec 20 14:02:52 2020 +0100 ++ ++ Add Socket::(bind_)device ++ ++ Co-authored-by: Thomas de Zeeuw ++ ++diff --git a/src/sys/unix.rs b/src/sys/unix.rs ++index 72097ae..1a0f24e 100644 ++--- a/src/sys/unix.rs +++++ b/src/sys/unix.rs ++@@ -7,6 +7,8 @@ ++ // except according to those terms. ++ ++ use std::cmp::min; +++#[cfg(all(feature = "all", target_os = "linux"))] +++use std::ffi::{CStr, CString}; ++ #[cfg(not(target_os = "redox"))] ++ use std::io::{IoSlice, IoSliceMut}; ++ use std::mem::{self, size_of, MaybeUninit}; ++@@ -19,6 +21,8 @@ ++ use std::os::unix::net::{UnixDatagram, UnixListener, UnixStream}; ++ #[cfg(feature = "all")] ++ use std::path::Path; +++#[cfg(all(feature = "all", target_os = "linux"))] +++use std::slice; ++ use std::time::Duration; ++ use std::{io, ptr}; ++ ++@@ -867,6 +871,73 @@ pub fn set_mark(&self, mark: u32) -> io::Result<()> { ++ unsafe { setsockopt::(self.inner, libc::SOL_SOCKET, libc::SO_MARK, mark as c_int) } ++ } ++ +++ /// Gets the value for the `SO_BINDTODEVICE` option on this socket. +++ /// +++ /// This value gets the socket binded device's interface name. +++ /// +++ /// This function is only available on Linux. +++ #[cfg(all(feature = "all", target_os = "linux"))] +++ pub fn device(&self) -> io::Result> { +++ // TODO: replace with `MaybeUninit::uninit_array` once stable. +++ let mut buf: [MaybeUninit; libc::IFNAMSIZ] = +++ unsafe { MaybeUninit::<[MaybeUninit; libc::IFNAMSIZ]>::uninit().assume_init() }; +++ let mut len = buf.len() as libc::socklen_t; +++ unsafe { +++ syscall!(getsockopt( +++ self.inner, +++ libc::SOL_SOCKET, +++ libc::SO_BINDTODEVICE, +++ buf.as_mut_ptr().cast(), +++ &mut len, +++ ))?; +++ } +++ if len == 0 { +++ Ok(None) +++ } else { +++ // Allocate a buffer for `CString` with the length including the +++ // null terminator. +++ let len = len as usize; +++ let mut name = Vec::with_capacity(len); +++ +++ // TODO: use `MaybeUninit::slice_assume_init_ref` once stable. +++ // Safety: `len` bytes are writen by the OS, this includes a null +++ // terminator. However we don't copy the null terminator because +++ // `CString::from_vec_unchecked` adds its own null terminator. +++ let buf = unsafe { slice::from_raw_parts(buf.as_ptr().cast(), len - 1) }; +++ name.extend_from_slice(buf); +++ +++ // Safety: the OS initialised the string for us, which shouldn't +++ // include any null bytes. +++ Ok(Some(unsafe { CString::from_vec_unchecked(name) })) +++ } +++ } +++ +++ /// Sets the value for the `SO_BINDTODEVICE` option on this socket. +++ /// +++ /// If a socket is bound to an interface, only packets received from that +++ /// particular interface are processed by the socket. Note that this only +++ /// works for some socket types, particularly `AF_INET` sockets. +++ /// +++ /// If `interface` is `None` or an empty string it removes the binding. +++ /// +++ /// This function is only available on Linux. +++ #[cfg(all(feature = "all", target_os = "linux"))] +++ pub fn bind_device(&self, interface: Option<&CStr>) -> io::Result<()> { +++ let (value, len) = if let Some(interface) = interface { +++ (interface.as_ptr(), interface.to_bytes_with_nul().len()) +++ } else { +++ (ptr::null(), 0) +++ }; +++ syscall!(setsockopt( +++ self.inner, +++ libc::SOL_SOCKET, +++ libc::SO_BINDTODEVICE, +++ value.cast(), +++ len as libc::socklen_t, +++ )) +++ .map(|_| ()) +++ } +++ ++ /// Get the value of the `SO_REUSEPORT` option on this socket. ++ /// ++ /// For more information about this option, see [`set_reuse_port`]. ++diff --git a/tests/socket.rs b/tests/socket.rs ++index 11a3d9c..75890af 100644 ++--- a/tests/socket.rs +++++ b/tests/socket.rs ++@@ -1,3 +1,5 @@ +++#[cfg(all(feature = "all", target_os = "linux"))] +++use std::ffi::CStr; ++ #[cfg(any(windows, target_vendor = "apple"))] ++ use std::io; ++ #[cfg(unix)] ++@@ -271,3 +273,19 @@ fn keepalive() { ++ ))] ++ assert_eq!(socket.keepalive_retries().unwrap(), 10); ++ } +++ +++#[cfg(all(feature = "all", target_os = "linux"))] +++#[test] +++fn device() { +++ const INTERFACE: &str = "lo0\0"; +++ let interface = CStr::from_bytes_with_nul(INTERFACE.as_bytes()).unwrap(); +++ let socket = Socket::new(Domain::IPV4, Type::STREAM, None).unwrap(); +++ +++ assert_eq!(socket.device().unwrap(), None); +++ +++ socket.bind_device(Some(interface)).unwrap(); +++ assert_eq!(socket.device().unwrap().as_deref(), Some(interface)); +++ +++ socket.bind_device(None).unwrap(); +++ assert_eq!(socket.device().unwrap(), None); +++} +diff --git a/third_party/rust/socket2/src/lib.rs b/third_party/rust/socket2/src/lib.rs +index cf599c8ed3b9f2018e2e54963d84a3329dc11a09..c0354f1251256715882c07aaa3eb2d6a46ad2b00 100644 +--- a/third_party/rust/socket2/src/lib.rs ++++ b/third_party/rust/socket2/src/lib.rs +@@ -39,64 +39,56 @@ + + use crate::utils::NetInt; + +-#[cfg(any(unix, target_os = "redox"))] +-use libc::{sockaddr_storage, socklen_t}; +-#[cfg(windows)] +-use winapi::shared::ws2def::SOCKADDR_STORAGE as sockaddr_storage; +-#[cfg(windows)] +-use winapi::um::ws2tcpip::socklen_t; ++/// Macro to implement `fmt::Debug` for a type, printing the constant names ++/// rather than a number. ++/// ++/// Note this is used in the `sys` module and thus must be defined before ++/// defining the modules. ++macro_rules! impl_debug { ++ ( ++ // Type name for which to implement `fmt::Debug`. ++ $type: path, ++ $( ++ $(#[$target: meta])* ++ // The flag(s) to check. ++ // Need to specific the libc crate because Windows doesn't use ++ // `libc` but `winapi`. ++ $libc: ident :: $flag: ident ++ ),+ $(,)* ++ ) => { ++ impl std::fmt::Debug for $type { ++ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { ++ let string = match self.0 { ++ $( ++ $(#[$target])* ++ $libc :: $flag => stringify!($flag), ++ )+ ++ n => return write!(f, "{}", n), ++ }; ++ f.write_str(string) ++ } ++ } ++ }; ++} + + mod sockaddr; + mod socket; + mod utils; + ++#[cfg(test)] ++mod tests; ++ + #[cfg(unix)] + #[path = "sys/unix.rs"] + mod sys; + #[cfg(windows)] + #[path = "sys/windows.rs"] + mod sys; +-#[cfg(target_os = "redox")] +-#[path = "sys/redox/mod.rs"] +-mod sys; + +-/// Newtype, owned, wrapper around a system socket. +-/// +-/// This type simply wraps an instance of a file descriptor (`c_int`) on Unix +-/// and an instance of `SOCKET` on Windows. This is the main type exported by +-/// this crate and is intended to mirror the raw semantics of sockets on +-/// platforms as closely as possible. Almost all methods correspond to +-/// precisely one libc or OS API call which is essentially just a "Rustic +-/// translation" of what's below. +-/// +-/// # Examples +-/// +-/// ```no_run +-/// use std::net::SocketAddr; +-/// use socket2::{Socket, Domain, Type, SockAddr}; +-/// +-/// // create a TCP listener bound to two addresses +-/// let socket = Socket::new(Domain::ipv4(), Type::stream(), None).unwrap(); +-/// +-/// socket.bind(&"127.0.0.1:12345".parse::().unwrap().into()).unwrap(); +-/// socket.bind(&"127.0.0.1:12346".parse::().unwrap().into()).unwrap(); +-/// socket.listen(128).unwrap(); +-/// +-/// let listener = socket.into_tcp_listener(); +-/// // ... +-/// ``` +-pub struct Socket { +- inner: sys::Socket, +-} ++use sys::c_int; + +-/// The address of a socket. +-/// +-/// `SockAddr`s may be constructed directly to and from the standard library +-/// `SocketAddr`, `SocketAddrV4`, and `SocketAddrV6` types. +-pub struct SockAddr { +- storage: sockaddr_storage, +- len: socklen_t, +-} ++pub use sockaddr::SockAddr; ++pub use socket::Socket; + + /// Specification of the communication domain for a socket. + /// +@@ -105,10 +97,34 @@ pub struct SockAddr { + /// such as `Domain::ipv4`, `Domain::ipv6`, etc, are provided to avoid reaching + /// into libc for various constants. + /// +-/// This type is freely interconvertible with the `i32` type, however, if a raw ++/// This type is freely interconvertible with C's `int` type, however, if a raw + /// value needs to be provided. + #[derive(Copy, Clone)] +-pub struct Domain(i32); ++pub struct Domain(c_int); ++ ++impl Domain { ++ /// Domain for IPv4 communication, corresponding to `AF_INET`. ++ pub fn ipv4() -> Domain { ++ Domain(sys::AF_INET) ++ } ++ ++ /// Domain for IPv6 communication, corresponding to `AF_INET6`. ++ pub fn ipv6() -> Domain { ++ Domain(sys::AF_INET6) ++ } ++} ++ ++impl From for Domain { ++ fn from(d: c_int) -> Domain { ++ Domain(d) ++ } ++} ++ ++impl From for c_int { ++ fn from(d: Domain) -> c_int { ++ d.0 ++ } ++} + + /// Specification of communication semantics on a socket. + /// +@@ -117,26 +133,98 @@ pub struct Domain(i32); + /// such as `Type::stream`, `Type::dgram`, etc, are provided to avoid reaching + /// into libc for various constants. + /// +-/// This type is freely interconvertible with the `i32` type, however, if a raw ++/// This type is freely interconvertible with C's `int` type, however, if a raw + /// value needs to be provided. + #[derive(Copy, Clone)] +-pub struct Type(i32); ++pub struct Type(c_int); ++ ++impl Type { ++ /// Type corresponding to `SOCK_STREAM`. ++ /// ++ /// Used for protocols such as TCP. ++ pub fn stream() -> Type { ++ Type(sys::SOCK_STREAM) ++ } ++ ++ /// Type corresponding to `SOCK_DGRAM`. ++ /// ++ /// Used for protocols such as UDP. ++ pub fn dgram() -> Type { ++ Type(sys::SOCK_DGRAM) ++ } ++ ++ /// Type corresponding to `SOCK_SEQPACKET`. ++ pub fn seqpacket() -> Type { ++ Type(sys::SOCK_SEQPACKET) ++ } ++ ++ /// Type corresponding to `SOCK_RAW`. ++ #[cfg(not(target_os = "redox"))] ++ pub fn raw() -> Type { ++ Type(sys::SOCK_RAW) ++ } ++} ++ ++impl From for Type { ++ fn from(t: c_int) -> Type { ++ Type(t) ++ } ++} ++ ++impl From for c_int { ++ fn from(t: Type) -> c_int { ++ t.0 ++ } ++} + + /// Protocol specification used for creating sockets via `Socket::new`. + /// + /// This is a newtype wrapper around an integer which provides a nicer API in + /// addition to an injection point for documentation. + /// +-/// This type is freely interconvertible with the `i32` type, however, if a raw ++/// This type is freely interconvertible with C's `int` type, however, if a raw + /// value needs to be provided. + #[derive(Copy, Clone)] +-pub struct Protocol(i32); ++pub struct Protocol(c_int); ++ ++impl Protocol { ++ /// Protocol corresponding to `ICMPv4`. ++ pub fn icmpv4() -> Self { ++ Protocol(sys::IPPROTO_ICMP) ++ } ++ ++ /// Protocol corresponding to `ICMPv6`. ++ pub fn icmpv6() -> Self { ++ Protocol(sys::IPPROTO_ICMPV6) ++ } ++ ++ /// Protocol corresponding to `TCP`. ++ pub fn tcp() -> Self { ++ Protocol(sys::IPPROTO_TCP) ++ } ++ ++ /// Protocol corresponding to `UDP`. ++ pub fn udp() -> Self { ++ Protocol(sys::IPPROTO_UDP) ++ } ++} ++ ++impl From for Protocol { ++ fn from(p: c_int) -> Protocol { ++ Protocol(p) ++ } ++} ++ ++impl From for c_int { ++ fn from(p: Protocol) -> c_int { ++ p.0 ++ } ++} + + fn hton(i: I) -> I { + i.to_be() + } + +-#[cfg(not(target_os = "redox"))] + fn ntoh(i: I) -> I { + I::from_be(i) + } +diff --git a/third_party/rust/socket2/src/sockaddr.rs b/third_party/rust/socket2/src/sockaddr.rs +index c6c9ef1d44c5cb67ab4293760c010f47a8cca147..dd8ffc016890234eebfa5ef58e5303677bd103ee 100644 +--- a/third_party/rust/socket2/src/sockaddr.rs ++++ b/third_party/rust/socket2/src/sockaddr.rs +@@ -1,24 +1,35 @@ + use std::fmt; +-use std::mem; +-use std::net::{SocketAddr, SocketAddrV4, SocketAddrV6}; ++use std::mem::{self, MaybeUninit}; ++use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6}; + use std::ptr; + + #[cfg(any(unix, target_os = "redox"))] + use libc::{ +- sa_family_t, sockaddr, sockaddr_in, sockaddr_in6, sockaddr_storage, socklen_t, AF_INET, +- AF_INET6, ++ in6_addr, in_addr, sa_family_t, sockaddr, sockaddr_in, sockaddr_in6, sockaddr_storage, ++ socklen_t, AF_INET, AF_INET6, + }; + #[cfg(windows)] ++use winapi::shared::in6addr::{in6_addr_u, IN6_ADDR as in6_addr}; ++#[cfg(windows)] ++use winapi::shared::inaddr::{in_addr_S_un, IN_ADDR as in_addr}; ++#[cfg(windows)] + use winapi::shared::ws2def::{ + ADDRESS_FAMILY as sa_family_t, AF_INET, AF_INET6, SOCKADDR as sockaddr, + SOCKADDR_IN as sockaddr_in, SOCKADDR_STORAGE as sockaddr_storage, + }; + #[cfg(windows)] +-use winapi::shared::ws2ipdef::SOCKADDR_IN6_LH as sockaddr_in6; ++use winapi::shared::ws2ipdef::{SOCKADDR_IN6_LH_u, SOCKADDR_IN6_LH as sockaddr_in6}; + #[cfg(windows)] + use winapi::um::ws2tcpip::socklen_t; + +-use crate::SockAddr; ++/// The address of a socket. ++/// ++/// `SockAddr`s may be constructed directly to and from the standard library ++/// `SocketAddr`, `SocketAddrV4`, and `SocketAddrV6` types. ++pub struct SockAddr { ++ storage: sockaddr_storage, ++ len: socklen_t, ++} + + impl fmt::Debug for SockAddr { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { +@@ -36,16 +47,17 @@ impl fmt::Debug for SockAddr { + impl SockAddr { + /// Constructs a `SockAddr` from its raw components. + pub unsafe fn from_raw_parts(addr: *const sockaddr, len: socklen_t) -> SockAddr { +- let mut storage = mem::uninitialized::(); ++ let mut storage = MaybeUninit::::zeroed(); + ptr::copy_nonoverlapping( + addr as *const _ as *const u8, +- &mut storage as *mut _ as *mut u8, ++ storage.as_mut_ptr() as *mut u8, + len as usize, + ); + + SockAddr { +- storage: storage, +- len: len, ++ // This is safe as we written the address to `storage` above. ++ storage: storage.assume_init(), ++ len, + } + } + +@@ -112,24 +124,63 @@ impl SockAddr { + } + } + +- unsafe fn as_(&self, family: sa_family_t) -> Option { +- if self.storage.ss_family != family { +- return None; +- } +- +- Some(mem::transmute_copy(&self.storage)) +- } +- + /// Returns this address as a `SocketAddrV4` if it is in the `AF_INET` + /// family. + pub fn as_inet(&self) -> Option { +- unsafe { self.as_(AF_INET as sa_family_t) } ++ match self.as_std() { ++ Some(SocketAddr::V4(addr)) => Some(addr), ++ _ => None, ++ } + } + + /// Returns this address as a `SocketAddrV6` if it is in the `AF_INET6` + /// family. + pub fn as_inet6(&self) -> Option { +- unsafe { self.as_(AF_INET6 as sa_family_t) } ++ match self.as_std() { ++ Some(SocketAddr::V6(addr)) => Some(addr), ++ _ => None, ++ } ++ } ++ ++ /// Returns this address as a `SocketAddr` if it is in the `AF_INET` ++ /// or `AF_INET6` family, otherwise returns `None`. ++ pub fn as_std(&self) -> Option { ++ if self.storage.ss_family == AF_INET as sa_family_t { ++ // Safety: if the ss_family field is AF_INET then storage must be a sockaddr_in. ++ let addr = unsafe { &*(&self.storage as *const _ as *const sockaddr_in) }; ++ ++ #[cfg(unix)] ++ let ip = Ipv4Addr::from(addr.sin_addr.s_addr.to_ne_bytes()); ++ #[cfg(windows)] ++ let ip = { ++ let ip_bytes = unsafe { addr.sin_addr.S_un.S_un_b() }; ++ Ipv4Addr::from([ip_bytes.s_b1, ip_bytes.s_b2, ip_bytes.s_b3, ip_bytes.s_b4]) ++ }; ++ let port = u16::from_be(addr.sin_port); ++ Some(SocketAddr::V4(SocketAddrV4::new(ip, port))) ++ } else if self.storage.ss_family == AF_INET6 as sa_family_t { ++ // Safety: if the ss_family field is AF_INET6 then storage must be a sockaddr_in6. ++ let addr = unsafe { &*(&self.storage as *const _ as *const sockaddr_in6) }; ++ ++ #[cfg(unix)] ++ let ip = Ipv6Addr::from(addr.sin6_addr.s6_addr); ++ #[cfg(windows)] ++ let ip = Ipv6Addr::from(*unsafe { addr.sin6_addr.u.Byte() }); ++ let port = u16::from_be(addr.sin6_port); ++ Some(SocketAddr::V6(SocketAddrV6::new( ++ ip, ++ port, ++ addr.sin6_flowinfo, ++ #[cfg(unix)] ++ addr.sin6_scope_id, ++ #[cfg(windows)] ++ unsafe { ++ *addr.u.sin6_scope_id() ++ }, ++ ))) ++ } else { ++ None ++ } + } + + /// Returns this address's family. +@@ -148,34 +199,92 @@ impl SockAddr { + } + } + +-// SocketAddrV4 and SocketAddrV6 are just wrappers around sockaddr_in and sockaddr_in6 +- +-// check to make sure that the sizes at least match up +-fn _size_checks(v4: SocketAddrV4, v6: SocketAddrV6) { +- unsafe { +- mem::transmute::(v4); +- mem::transmute::(v6); +- } +-} +- + impl From for SockAddr { + fn from(addr: SocketAddrV4) -> SockAddr { +- unsafe { +- SockAddr::from_raw_parts( +- &addr as *const _ as *const _, +- mem::size_of::() as socklen_t, +- ) ++ #[cfg(unix)] ++ let sin_addr = in_addr { ++ s_addr: u32::from_ne_bytes(addr.ip().octets()), ++ }; ++ #[cfg(windows)] ++ let sin_addr = unsafe { ++ let mut s_un = mem::zeroed::(); ++ *s_un.S_addr_mut() = u32::from_ne_bytes(addr.ip().octets()); ++ in_addr { S_un: s_un } ++ }; ++ ++ let sockaddr_in = sockaddr_in { ++ sin_family: AF_INET as sa_family_t, ++ sin_port: addr.port().to_be(), ++ sin_addr, ++ sin_zero: Default::default(), ++ #[cfg(any( ++ target_os = "dragonfly", ++ target_os = "freebsd", ++ target_os = "haiku", ++ target_os = "ios", ++ target_os = "macos", ++ target_os = "netbsd", ++ target_os = "openbsd" ++ ))] ++ sin_len: 0, ++ }; ++ let mut storage = MaybeUninit::::zeroed(); ++ // Safety: A `sockaddr_in` is memory compatible with a `sockaddr_storage` ++ unsafe { (storage.as_mut_ptr() as *mut sockaddr_in).write(sockaddr_in) }; ++ SockAddr { ++ storage: unsafe { storage.assume_init() }, ++ len: mem::size_of::() as socklen_t, + } + } + } + + impl From for SockAddr { + fn from(addr: SocketAddrV6) -> SockAddr { +- unsafe { +- SockAddr::from_raw_parts( +- &addr as *const _ as *const _, +- mem::size_of::() as socklen_t, +- ) ++ #[cfg(unix)] ++ let sin6_addr = in6_addr { ++ s6_addr: addr.ip().octets(), ++ }; ++ #[cfg(windows)] ++ let sin6_addr = unsafe { ++ let mut u = mem::zeroed::(); ++ *u.Byte_mut() = addr.ip().octets(); ++ in6_addr { u } ++ }; ++ #[cfg(windows)] ++ let u = unsafe { ++ let mut u = mem::zeroed::(); ++ *u.sin6_scope_id_mut() = addr.scope_id(); ++ u ++ }; ++ ++ let sockaddr_in6 = sockaddr_in6 { ++ sin6_family: AF_INET6 as sa_family_t, ++ sin6_port: addr.port().to_be(), ++ sin6_addr, ++ sin6_flowinfo: addr.flowinfo(), ++ #[cfg(unix)] ++ sin6_scope_id: addr.scope_id(), ++ #[cfg(windows)] ++ u, ++ #[cfg(any( ++ target_os = "dragonfly", ++ target_os = "freebsd", ++ target_os = "haiku", ++ target_os = "ios", ++ target_os = "macos", ++ target_os = "netbsd", ++ target_os = "openbsd" ++ ))] ++ sin6_len: 0, ++ #[cfg(any(target_os = "solaris", target_os = "illumos"))] ++ __sin6_src_id: 0, ++ }; ++ let mut storage = MaybeUninit::::zeroed(); ++ // Safety: A `sockaddr_in6` is memory compatible with a `sockaddr_storage` ++ unsafe { (storage.as_mut_ptr() as *mut sockaddr_in6).write(sockaddr_in6) }; ++ SockAddr { ++ storage: unsafe { storage.assume_init() }, ++ len: mem::size_of::() as socklen_t, + } + } + } +diff --git a/third_party/rust/socket2/src/socket.rs b/third_party/rust/socket2/src/socket.rs +index 190a0d11d9f78dce4eea9756a889f23e58d4fc9a..1f1fcc92b258425e8e582bd552b9eb9aad3ab2c6 100644 +--- a/third_party/rust/socket2/src/socket.rs ++++ b/third_party/rust/socket2/src/socket.rs +@@ -8,6 +8,8 @@ + // option. This file may not be copied, modified, or distributed + // except according to those terms. + ++#[cfg(target_os = "linux")] ++use std::ffi::{CStr, CString}; + use std::fmt; + use std::io::{self, Read, Write}; + use std::net::{self, Ipv4Addr, Ipv6Addr, Shutdown}; +@@ -16,12 +18,42 @@ use std::os::unix::net::{UnixDatagram, UnixListener, UnixStream}; + use std::time::Duration; + + #[cfg(any(unix, target_os = "redox"))] +-use libc as c; ++use libc::MSG_OOB; + #[cfg(windows)] +-use winapi::shared::ws2def as c; ++use winapi::um::winsock2::MSG_OOB; + + use crate::sys; +-use crate::{Domain, Protocol, SockAddr, Socket, Type}; ++use crate::{Domain, Protocol, SockAddr, Type}; ++ ++/// Newtype, owned, wrapper around a system socket. ++/// ++/// This type simply wraps an instance of a file descriptor (`c_int`) on Unix ++/// and an instance of `SOCKET` on Windows. This is the main type exported by ++/// this crate and is intended to mirror the raw semantics of sockets on ++/// platforms as closely as possible. Almost all methods correspond to ++/// precisely one libc or OS API call which is essentially just a "Rustic ++/// translation" of what's below. ++/// ++/// # Examples ++/// ++/// ```no_run ++/// use std::net::SocketAddr; ++/// use socket2::{Socket, Domain, Type, SockAddr}; ++/// ++/// // create a TCP listener bound to two addresses ++/// let socket = Socket::new(Domain::ipv4(), Type::stream(), None).unwrap(); ++/// ++/// socket.bind(&"127.0.0.1:12345".parse::().unwrap().into()).unwrap(); ++/// socket.bind(&"127.0.0.1:12346".parse::().unwrap().into()).unwrap(); ++/// socket.listen(128).unwrap(); ++/// ++/// let listener = socket.into_tcp_listener(); ++/// // ... ++/// ``` ++pub struct Socket { ++ // The `sys` module most have access to the socket. ++ pub(crate) inner: sys::Socket, ++} + + impl Socket { + /// Creates a new socket ready to be configured. +@@ -213,7 +245,26 @@ impl Socket { + /// + /// [`connect`]: #method.connect + pub fn recv(&self, buf: &mut [u8]) -> io::Result { +- self.inner.recv(buf) ++ self.inner.recv(buf, 0) ++ } ++ ++ /// Identical to [`recv`] but allows for specification of arbitrary flags to the underlying ++ /// `recv` call. ++ /// ++ /// [`recv`]: #method.recv ++ pub fn recv_with_flags(&self, buf: &mut [u8], flags: i32) -> io::Result { ++ self.inner.recv(buf, flags) ++ } ++ ++ /// Receives out-of-band (OOB) data on the socket from the remote address to ++ /// which it is connected by setting the `MSG_OOB` flag for this call. ++ /// ++ /// For more information, see [`recv`], [`out_of_band_inline`]. ++ /// ++ /// [`recv`]: #method.recv ++ /// [`out_of_band_inline`]: #method.out_of_band_inline ++ pub fn recv_out_of_band(&self, buf: &mut [u8]) -> io::Result { ++ self.inner.recv(buf, MSG_OOB) + } + + /// Receives data on the socket from the remote adress to which it is +@@ -229,7 +280,19 @@ impl Socket { + /// Receives data from the socket. On success, returns the number of bytes + /// read and the address from whence the data came. + pub fn recv_from(&self, buf: &mut [u8]) -> io::Result<(usize, SockAddr)> { +- self.inner.recv_from(buf) ++ self.inner.recv_from(buf, 0) ++ } ++ ++ /// Identical to [`recv_from`] but allows for specification of arbitrary flags to the underlying ++ /// `recvfrom` call. ++ /// ++ /// [`recv_from`]: #method.recv_from ++ pub fn recv_from_with_flags( ++ &self, ++ buf: &mut [u8], ++ flags: i32, ++ ) -> io::Result<(usize, SockAddr)> { ++ self.inner.recv_from(buf, flags) + } + + /// Receives data from the socket, without removing it from the queue. +@@ -250,7 +313,26 @@ impl Socket { + /// + /// On success returns the number of bytes that were sent. + pub fn send(&self, buf: &[u8]) -> io::Result { +- self.inner.send(buf) ++ self.inner.send(buf, 0) ++ } ++ ++ /// Identical to [`send`] but allows for specification of arbitrary flags to the underlying ++ /// `send` call. ++ /// ++ /// [`send`]: #method.send ++ pub fn send_with_flags(&self, buf: &[u8], flags: i32) -> io::Result { ++ self.inner.send(buf, flags) ++ } ++ ++ /// Sends out-of-band (OOB) data on the socket to connected peer ++ /// by setting the `MSG_OOB` flag for this call. ++ /// ++ /// For more information, see [`send`], [`out_of_band_inline`]. ++ /// ++ /// [`send`]: #method.send ++ /// [`out_of_band_inline`]: #method.out_of_band_inline ++ pub fn send_out_of_band(&self, buf: &[u8]) -> io::Result { ++ self.inner.send(buf, MSG_OOB) + } + + /// Sends data on the socket to the given address. On success, returns the +@@ -259,7 +341,15 @@ impl Socket { + /// This is typically used on UDP or datagram-oriented sockets. On success + /// returns the number of bytes that were sent. + pub fn send_to(&self, buf: &[u8], addr: &SockAddr) -> io::Result { +- self.inner.send_to(buf, addr) ++ self.inner.send_to(buf, 0, addr) ++ } ++ ++ /// Identical to [`send_to`] but allows for specification of arbitrary flags to the underlying ++ /// `sendto` call. ++ /// ++ /// [`send_to`]: #method.send_to ++ pub fn send_to_with_flags(&self, buf: &[u8], addr: &SockAddr, flags: i32) -> io::Result { ++ self.inner.send_to(buf, flags, addr) + } + + // ================================================ +@@ -281,6 +371,73 @@ impl Socket { + self.inner.set_ttl(ttl) + } + ++ /// Gets the value of the `TCP_MAXSEG` option on this socket. ++ /// ++ /// The `TCP_MAXSEG` option denotes the TCP Maximum Segment ++ /// Size and is only available on TCP sockets. ++ #[cfg(all(unix, not(target_os = "redox")))] ++ pub fn mss(&self) -> io::Result { ++ self.inner.mss() ++ } ++ ++ /// Sets the value of the `TCP_MAXSEG` option on this socket. ++ /// ++ /// The `TCP_MAXSEG` option denotes the TCP Maximum Segment ++ /// Size and is only available on TCP sockets. ++ #[cfg(all(unix, not(target_os = "redox")))] ++ pub fn set_mss(&self, mss: u32) -> io::Result<()> { ++ self.inner.set_mss(mss) ++ } ++ ++ /// Gets the value for the `SO_MARK` option on this socket. ++ /// ++ /// This value gets the socket mark field for each packet sent through ++ /// this socket. ++ /// ++ /// This function is only available on Linux and requires the ++ /// `CAP_NET_ADMIN` capability. ++ #[cfg(target_os = "linux")] ++ pub fn mark(&self) -> io::Result { ++ self.inner.mark() ++ } ++ ++ /// Sets the value for the `SO_MARK` option on this socket. ++ /// ++ /// This value sets the socket mark field for each packet sent through ++ /// this socket. Changing the mark can be used for mark-based routing ++ /// without netfilter or for packet filtering. ++ /// ++ /// This function is only available on Linux and requires the ++ /// `CAP_NET_ADMIN` capability. ++ #[cfg(target_os = "linux")] ++ pub fn set_mark(&self, mark: u32) -> io::Result<()> { ++ self.inner.set_mark(mark) ++ } ++ ++ /// Gets the value for the `SO_BINDTODEVICE` option on this socket. ++ /// ++ /// This value gets the socket binded device's interface name. ++ /// ++ /// This function is only available on Linux. ++ #[cfg(target_os = "linux")] ++ pub fn device(&self) -> io::Result> { ++ self.inner.device() ++ } ++ ++ /// Sets the value for the `SO_BINDTODEVICE` option on this socket. ++ /// ++ /// If a socket is bound to an interface, only packets received from that ++ /// particular interface are processed by the socket. Note that this only ++ /// works for some socket types, particularly `AF_INET` sockets. ++ /// ++ /// If `interface` is `None` or an empty string it removes the binding. ++ /// ++ /// This function is only available on Linux. ++ #[cfg(target_os = "linux")] ++ pub fn bind_device(&self, interface: Option<&CStr>) -> io::Result<()> { ++ self.inner.bind_device(interface) ++ } ++ + /// Gets the value of the `IPV6_UNICAST_HOPS` option for this socket. + /// + /// Specifies the hop limit for ipv6 unicast packets +@@ -628,24 +785,50 @@ impl Socket { + self.inner.set_keepalive(keepalive) + } + ++ /// Returns the value of the `SO_OOBINLINE` flag of the underlying socket. ++ /// For more information about this option, see [`set_out_of_band_inline`][link]. ++ /// ++ /// [link]: #method.set_out_of_band_inline ++ pub fn out_of_band_inline(&self) -> io::Result { ++ self.inner.out_of_band_inline() ++ } ++ ++ /// Sets the `SO_OOBINLINE` flag of the underlying socket. ++ /// as per RFC6093, TCP sockets using the Urgent mechanism ++ /// are encouraged to set this flag. ++ /// ++ /// If this flag is not set, the `MSG_OOB` flag is needed ++ /// while `recv`ing to aquire the out-of-band data. ++ pub fn set_out_of_band_inline(&self, oob_inline: bool) -> io::Result<()> { ++ self.inner.set_out_of_band_inline(oob_inline) ++ } ++ + /// Check the value of the `SO_REUSEPORT` option on this socket. + /// + /// This function is only available on Unix when the `reuseport` feature is + /// enabled. +- #[cfg(all(unix, feature = "reuseport"))] ++ #[cfg(all( ++ unix, ++ not(any(target_os = "solaris", target_os = "illumos")), ++ feature = "reuseport" ++ ))] + pub fn reuse_port(&self) -> io::Result { + self.inner.reuse_port() + } + + /// Set value for the `SO_REUSEPORT` option on this socket. + /// +- /// This indicates that futher calls to `bind` may allow reuse of local ++ /// This indicates that further calls to `bind` may allow reuse of local + /// addresses. For IPv4 sockets this means that a socket may bind even when + /// there's a socket already listening on this port. + /// + /// This function is only available on Unix when the `reuseport` feature is + /// enabled. +- #[cfg(all(unix, feature = "reuseport"))] ++ #[cfg(all( ++ unix, ++ not(any(target_os = "solaris", target_os = "illumos")), ++ feature = "reuseport" ++ ))] + pub fn set_reuse_port(&self, reuse: bool) -> io::Result<()> { + self.inner.set_reuse_port(reuse) + } +@@ -779,111 +962,6 @@ impl From for UnixDatagram { + } + } + +-impl Domain { +- /// Domain for IPv4 communication, corresponding to `AF_INET`. +- pub fn ipv4() -> Domain { +- Domain(c::AF_INET) +- } +- +- /// Domain for IPv6 communication, corresponding to `AF_INET6`. +- pub fn ipv6() -> Domain { +- Domain(c::AF_INET6) +- } +- +- /// Domain for Unix socket communication, corresponding to `AF_UNIX`. +- /// +- /// This function is only available on Unix when the `unix` feature is +- /// activated. +- #[cfg(all(unix, feature = "unix"))] +- pub fn unix() -> Domain { +- Domain(c::AF_UNIX) +- } +-} +- +-impl From for Domain { +- fn from(a: i32) -> Domain { +- Domain(a) +- } +-} +- +-impl From for i32 { +- fn from(a: Domain) -> i32 { +- a.0 +- } +-} +- +-impl Type { +- /// Type corresponding to `SOCK_STREAM` +- /// +- /// Used for protocols such as TCP. +- pub fn stream() -> Type { +- Type(c::SOCK_STREAM) +- } +- +- /// Type corresponding to `SOCK_DGRAM` +- /// +- /// Used for protocols such as UDP. +- pub fn dgram() -> Type { +- Type(c::SOCK_DGRAM) +- } +- +- /// Type corresponding to `SOCK_SEQPACKET` +- pub fn seqpacket() -> Type { +- Type(sys::SOCK_SEQPACKET) +- } +- +- /// Type corresponding to `SOCK_RAW` +- pub fn raw() -> Type { +- Type(sys::SOCK_RAW) +- } +-} +- +-impl crate::Protocol { +- /// Protocol corresponding to `ICMPv4` +- pub fn icmpv4() -> Self { +- crate::Protocol(sys::IPPROTO_ICMP) +- } +- +- /// Protocol corresponding to `ICMPv6` +- pub fn icmpv6() -> Self { +- crate::Protocol(sys::IPPROTO_ICMPV6) +- } +- +- /// Protocol corresponding to `TCP` +- pub fn tcp() -> Self { +- crate::Protocol(sys::IPPROTO_TCP) +- } +- +- /// Protocol corresponding to `UDP` +- pub fn udp() -> Self { +- crate::Protocol(sys::IPPROTO_UDP) +- } +-} +- +-impl From for Type { +- fn from(a: i32) -> Type { +- Type(a) +- } +-} +- +-impl From for i32 { +- fn from(a: Type) -> i32 { +- a.0 +- } +-} +- +-impl From for Protocol { +- fn from(a: i32) -> Protocol { +- Protocol(a) +- } +-} +- +-impl From for i32 { +- fn from(a: Protocol) -> i32 { +- a.0 +- } +-} +- + #[cfg(test)] + mod test { + use std::net::SocketAddr; +@@ -994,4 +1072,57 @@ mod test { + assert!(result.is_ok()); + assert!(result.unwrap()); + } ++ ++ #[test] ++ fn out_of_band_inline() { ++ let socket = Socket::new(Domain::ipv4(), Type::stream(), None).unwrap(); ++ ++ assert_eq!(socket.out_of_band_inline().unwrap(), false); ++ ++ socket.set_out_of_band_inline(true).unwrap(); ++ assert_eq!(socket.out_of_band_inline().unwrap(), true); ++ } ++ ++ #[test] ++ #[cfg(any(target_os = "windows", target_os = "linux"))] ++ fn out_of_band_send_recv() { ++ let s1 = Socket::new(Domain::ipv4(), Type::stream(), None).unwrap(); ++ s1.bind(&"127.0.0.1:0".parse::().unwrap().into()) ++ .unwrap(); ++ let s1_addr = s1.local_addr().unwrap(); ++ s1.listen(1).unwrap(); ++ ++ let s2 = Socket::new(Domain::ipv4(), Type::stream(), None).unwrap(); ++ s2.connect(&s1_addr).unwrap(); ++ ++ let (s3, _) = s1.accept().unwrap(); ++ ++ let mut buf = [0; 10]; ++ // send some plain inband data ++ s2.send(&mut buf).unwrap(); ++ // send a single out of band byte ++ assert_eq!(s2.send_out_of_band(&mut [b"!"[0]]).unwrap(), 1); ++ // recv the OOB data first ++ assert_eq!(s3.recv_out_of_band(&mut buf).unwrap(), 1); ++ assert_eq!(buf[0], b"!"[0]); ++ assert_eq!(s3.recv(&mut buf).unwrap(), 10); ++ } ++ ++ #[test] ++ fn tcp() { ++ let s1 = Socket::new(Domain::ipv4(), Type::stream(), None).unwrap(); ++ s1.bind(&"127.0.0.1:0".parse::().unwrap().into()) ++ .unwrap(); ++ let s1_addr = s1.local_addr().unwrap(); ++ s1.listen(1).unwrap(); ++ ++ let s2 = Socket::new(Domain::ipv4(), Type::stream(), None).unwrap(); ++ s2.connect(&s1_addr).unwrap(); ++ ++ let (s3, _) = s1.accept().unwrap(); ++ ++ let mut buf = [0; 11]; ++ assert_eq!(s2.send(&mut buf).unwrap(), 11); ++ assert_eq!(s3.recv(&mut buf).unwrap(), 11); ++ } + } +diff --git a/third_party/rust/socket2/src/sys/redox/mod.rs b/third_party/rust/socket2/src/sys/redox/mod.rs +deleted file mode 100644 +index bd1ebfcb0214bbb8351a2fe65b83ba583cdf0348..0000000000000000000000000000000000000000 +--- a/third_party/rust/socket2/src/sys/redox/mod.rs ++++ /dev/null +@@ -1,828 +0,0 @@ +-// Copyright 2015 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 or the MIT license +-// , at your +-// option. This file may not be copied, modified, or distributed +-// except according to those terms. +- +-use std::cmp; +-use std::fmt; +-use std::fs::File; +-use std::io; +-use std::io::{ErrorKind, Read, Write}; +-use std::mem; +-use std::net::Shutdown; +-use std::net::{self, Ipv4Addr, Ipv6Addr}; +-use std::ops::Neg; +-use std::os::unix::prelude::*; +-use std::time::Duration; +-use syscall; +- +-use libc::{self, c_int, c_uint, c_void, socklen_t, ssize_t}; +- +-use libc::IPV6_ADD_MEMBERSHIP; +-use libc::IPV6_DROP_MEMBERSHIP; +- +-const MSG_NOSIGNAL: c_int = 0x0; +- +-use libc::TCP_KEEPIDLE as KEEPALIVE_OPTION; +- +-use crate::utils::One; +-use crate::SockAddr; +- +-pub const IPPROTO_TCP: i32 = libc::IPPROTO_TCP; +- +-pub const IPPROTO_ICMP: i32 = -1; +-pub const IPPROTO_ICMPV6: i32 = -1; +-pub const IPPROTO_UDP: i32 = -1; +-pub const SOCK_RAW: i32 = -1; +-pub const SOCK_SEQPACKET: i32 = -1; +- +-pub struct Socket { +- fd: c_int, +-} +- +-impl Socket { +- pub fn new(family: c_int, ty: c_int, protocol: c_int) -> io::Result { +- if ty == -1 { +- return Err(io::Error::new(ErrorKind::Other, "Type not implemented yet")); +- } +- if protocol == -1 { +- return Err(io::Error::new( +- ErrorKind::Other, +- "Protocol not implemented yet", +- )); +- } +- unsafe { +- let fd = cvt(libc::socket(family, ty, protocol))?; +- let fd = Socket::from_raw_fd(fd as RawFd); +- set_cloexec(fd.as_raw_fd() as c_int)?; +- Ok(fd) +- } +- } +- +- pub fn pair(_family: c_int, _ty: c_int, _protocol: c_int) -> io::Result<(Socket, Socket)> { +- return Err(io::Error::new(ErrorKind::Other, "Not implemented yet")); +- } +- +- pub fn bind(&self, addr: &SockAddr) -> io::Result<()> { +- unsafe { cvt(libc::bind(self.fd, addr.as_ptr(), addr.len() as _)).map(|_| ()) } +- } +- +- pub fn listen(&self, backlog: i32) -> io::Result<()> { +- unsafe { cvt(libc::listen(self.fd, backlog)).map(|_| ()) } +- } +- +- pub fn connect(&self, addr: &SockAddr) -> io::Result<()> { +- unsafe { cvt(libc::connect(self.fd, addr.as_ptr(), addr.len())).map(|_| ()) } +- } +- +- pub fn connect_timeout(&self, addr: &SockAddr, timeout: Duration) -> io::Result<()> { +- if timeout.as_secs() == 0 && timeout.subsec_nanos() == 0 { +- return Err(io::Error::new( +- ErrorKind::InvalidInput, +- "cannot set a 0 duration timeout", +- )); +- } +- if timeout.as_secs() > ::std::i64::MAX as u64 { +- return Err(io::Error::new( +- ErrorKind::InvalidInput, +- "too large duration", +- )); +- } +- +- self.connect(addr)?; +- +- let mut event = File::open("event:")?; +- let mut time = File::open("time:")?; +- +- event.write(&syscall::Event { +- id: self.fd as usize, +- flags: syscall::EVENT_WRITE, +- data: 0, +- })?; +- +- event.write(&syscall::Event { +- id: time.as_raw_fd(), +- flags: syscall::EVENT_WRITE, +- data: 1, +- })?; +- +- let mut current = syscall::TimeSpec::default(); +- time.read(&mut current)?; +- current.tv_sec += timeout.as_secs() as i64; +- current.tv_nsec += timeout.subsec_nanos() as i32; +- time.write(¤t)?; +- +- let mut out = syscall::Event::default(); +- event.read(&mut out)?; +- +- if out.data == 1 { +- // the timeout we registered +- return Err(io::Error::new(ErrorKind::TimedOut, "connection timed out")); +- } +- +- Ok(()) +- } +- +- pub fn local_addr(&self) -> io::Result { +- unsafe { +- let mut storage: libc::sockaddr_storage = mem::zeroed(); +- let mut len = mem::size_of_val(&storage) as libc::socklen_t; +- cvt(libc::getsockname( +- self.fd, +- &mut storage as *mut _ as *mut _, +- &mut len, +- ))?; +- Ok(SockAddr::from_raw_parts( +- &storage as *const _ as *const _, +- len, +- )) +- } +- } +- +- pub fn peer_addr(&self) -> io::Result { +- unsafe { +- let mut storage: libc::sockaddr_storage = mem::zeroed(); +- let mut len = mem::size_of_val(&storage) as libc::socklen_t; +- cvt(libc::getpeername( +- self.fd, +- &mut storage as *mut _ as *mut _, +- &mut len, +- ))?; +- Ok(SockAddr::from_raw_parts( +- &storage as *const _ as *const _, +- len as c_uint, +- )) +- } +- } +- +- pub fn try_clone(&self) -> io::Result { +- return Err(io::Error::new(ErrorKind::Other, "Not implemented yet")); +- } +- +- #[allow(unused_mut)] +- pub fn accept(&self) -> io::Result<(Socket, SockAddr)> { +- return Err(io::Error::new(ErrorKind::Other, "Not implemented yet")); +- } +- +- pub fn take_error(&self) -> io::Result> { +- unsafe { +- let raw: c_int = self.getsockopt(libc::SOL_SOCKET, libc::SO_ERROR)?; +- if raw == 0 { +- Ok(None) +- } else { +- Ok(Some(io::Error::from_raw_os_error(raw as i32))) +- } +- } +- } +- +- pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { +- unsafe { +- let previous = cvt(libc::fcntl(self.fd, libc::F_GETFL))?; +- let new = if nonblocking { +- previous | libc::O_NONBLOCK +- } else { +- previous & !libc::O_NONBLOCK +- }; +- if new != previous { +- cvt(libc::fcntl(self.fd, libc::F_SETFL, new))?; +- } +- Ok(()) +- } +- } +- +- pub fn shutdown(&self, _how: Shutdown) -> io::Result<()> { +- return Err(io::Error::new(ErrorKind::Other, "Not implemented yet")); +- } +- +- pub fn recv(&self, buf: &mut [u8]) -> io::Result { +- unsafe { +- let n = cvt({ +- libc::recv( +- self.fd, +- buf.as_mut_ptr() as *mut c_void, +- cmp::min(buf.len(), max_len()), +- 0, +- ) +- })?; +- Ok(n as usize) +- } +- } +- +- pub fn peek(&self, _buf: &mut [u8]) -> io::Result { +- return Err(io::Error::new(ErrorKind::Other, "Not implemented yet")); +- } +- +- pub fn recv_from(&self, buf: &mut [u8]) -> io::Result<(usize, SockAddr)> { +- self.recvfrom(buf, 0) +- } +- +- pub fn peek_from(&self, _buf: &mut [u8]) -> io::Result<(usize, SockAddr)> { +- return Err(io::Error::new(ErrorKind::Other, "Not implemented yet")); +- } +- +- fn recvfrom(&self, buf: &mut [u8], flags: c_int) -> io::Result<(usize, SockAddr)> { +- unsafe { +- let mut storage: libc::sockaddr_storage = mem::zeroed(); +- let mut addrlen = mem::size_of_val(&storage) as socklen_t; +- +- let n = cvt({ +- libc::recvfrom( +- self.fd, +- buf.as_mut_ptr() as *mut c_void, +- cmp::min(buf.len(), max_len()), +- flags, +- &mut storage as *mut _ as *mut _, +- &mut addrlen, +- ) +- })?; +- let addr = SockAddr::from_raw_parts(&storage as *const _ as *const _, addrlen); +- Ok((n as usize, addr)) +- } +- } +- +- pub fn send(&self, buf: &[u8]) -> io::Result { +- unsafe { +- let n = cvt({ +- libc::send( +- self.fd, +- buf.as_ptr() as *const c_void, +- cmp::min(buf.len(), max_len()), +- MSG_NOSIGNAL, +- ) +- })?; +- Ok(n as usize) +- } +- } +- +- pub fn send_to(&self, buf: &[u8], addr: &SockAddr) -> io::Result { +- unsafe { +- let n = cvt({ +- libc::sendto( +- self.fd, +- buf.as_ptr() as *const c_void, +- cmp::min(buf.len(), max_len()), +- MSG_NOSIGNAL, +- addr.as_ptr(), +- addr.len(), +- ) +- })?; +- Ok(n as usize) +- } +- } +- +- // ================================================ +- +- pub fn ttl(&self) -> io::Result { +- unsafe { +- let raw: c_int = self.getsockopt(libc::IPPROTO_IP, libc::IP_TTL)?; +- Ok(raw as u32) +- } +- } +- +- pub fn set_ttl(&self, ttl: u32) -> io::Result<()> { +- unsafe { self.setsockopt(libc::IPPROTO_IP, libc::IP_TTL, ttl as c_int) } +- } +- +- pub fn unicast_hops_v6(&self) -> io::Result { +- return Err(io::Error::new(ErrorKind::Other, "Not implemented yet")); +- } +- +- pub fn set_unicast_hops_v6(&self, _hops: u32) -> io::Result<()> { +- return Err(io::Error::new(ErrorKind::Other, "Not implemented yet")); +- } +- +- pub fn only_v6(&self) -> io::Result { +- unsafe { +- let raw: c_int = self.getsockopt(libc::IPPROTO_IPV6, libc::IPV6_V6ONLY)?; +- Ok(raw != 0) +- } +- } +- +- pub fn set_only_v6(&self, only_v6: bool) -> io::Result<()> { +- unsafe { self.setsockopt(libc::IPPROTO_IPV6, libc::IPV6_V6ONLY, only_v6 as c_int) } +- } +- +- pub fn read_timeout(&self) -> io::Result> { +- unsafe { +- Ok(timeval2dur( +- self.getsockopt(libc::SOL_SOCKET, libc::SO_RCVTIMEO)?, +- )) +- } +- } +- +- pub fn set_read_timeout(&self, dur: Option) -> io::Result<()> { +- unsafe { self.setsockopt(libc::SOL_SOCKET, libc::SO_RCVTIMEO, dur2timeval(dur)?) } +- } +- +- pub fn write_timeout(&self) -> io::Result> { +- unsafe { +- Ok(timeval2dur( +- self.getsockopt(libc::SOL_SOCKET, libc::SO_SNDTIMEO)?, +- )) +- } +- } +- +- pub fn set_write_timeout(&self, dur: Option) -> io::Result<()> { +- unsafe { self.setsockopt(libc::SOL_SOCKET, libc::SO_SNDTIMEO, dur2timeval(dur)?) } +- } +- +- pub fn nodelay(&self) -> io::Result { +- unsafe { +- let raw: c_int = self.getsockopt(libc::IPPROTO_TCP, libc::TCP_NODELAY)?; +- Ok(raw != 0) +- } +- } +- +- pub fn set_nodelay(&self, nodelay: bool) -> io::Result<()> { +- unsafe { self.setsockopt(libc::IPPROTO_TCP, libc::TCP_NODELAY, nodelay as c_int) } +- } +- +- pub fn broadcast(&self) -> io::Result { +- unsafe { +- let raw: c_int = self.getsockopt(libc::SOL_SOCKET, libc::SO_BROADCAST)?; +- Ok(raw != 0) +- } +- } +- +- pub fn set_broadcast(&self, broadcast: bool) -> io::Result<()> { +- unsafe { self.setsockopt(libc::SOL_SOCKET, libc::SO_BROADCAST, broadcast as c_int) } +- } +- +- pub fn multicast_loop_v4(&self) -> io::Result { +- unsafe { +- let raw: c_int = self.getsockopt(libc::IPPROTO_IP, libc::IP_MULTICAST_LOOP)?; +- Ok(raw != 0) +- } +- } +- +- pub fn set_multicast_loop_v4(&self, multicast_loop_v4: bool) -> io::Result<()> { +- unsafe { +- self.setsockopt( +- libc::IPPROTO_IP, +- libc::IP_MULTICAST_LOOP, +- multicast_loop_v4 as c_int, +- ) +- } +- } +- +- pub fn multicast_ttl_v4(&self) -> io::Result { +- unsafe { +- let raw: c_int = self.getsockopt(libc::IPPROTO_IP, libc::IP_MULTICAST_TTL)?; +- Ok(raw as u32) +- } +- } +- +- pub fn set_multicast_ttl_v4(&self, multicast_ttl_v4: u32) -> io::Result<()> { +- unsafe { +- self.setsockopt( +- libc::IPPROTO_IP, +- libc::IP_MULTICAST_TTL, +- multicast_ttl_v4 as c_int, +- ) +- } +- } +- +- pub fn multicast_hops_v6(&self) -> io::Result { +- return Err(io::Error::new(ErrorKind::Other, "Not implemented yet")); +- } +- +- pub fn set_multicast_hops_v6(&self, _hops: u32) -> io::Result<()> { +- return Err(io::Error::new(ErrorKind::Other, "Not implemented yet")); +- } +- +- pub fn multicast_if_v4(&self) -> io::Result { +- return Err(io::Error::new(ErrorKind::Other, "Not implemented yet")); +- } +- +- pub fn set_multicast_if_v4(&self, _interface: &Ipv4Addr) -> io::Result<()> { +- return Err(io::Error::new(ErrorKind::Other, "Not implemented yet")); +- } +- +- pub fn multicast_if_v6(&self) -> io::Result { +- return Err(io::Error::new(ErrorKind::Other, "Not implemented yet")); +- } +- +- pub fn set_multicast_if_v6(&self, _interface: u32) -> io::Result<()> { +- return Err(io::Error::new(ErrorKind::Other, "Not implemented yet")); +- } +- +- pub fn multicast_loop_v6(&self) -> io::Result { +- unsafe { +- let raw: c_int = self.getsockopt(libc::IPPROTO_IPV6, libc::IPV6_MULTICAST_LOOP)?; +- Ok(raw != 0) +- } +- } +- +- pub fn set_multicast_loop_v6(&self, multicast_loop_v6: bool) -> io::Result<()> { +- unsafe { +- self.setsockopt( +- libc::IPPROTO_IPV6, +- libc::IPV6_MULTICAST_LOOP, +- multicast_loop_v6 as c_int, +- ) +- } +- } +- +- pub fn join_multicast_v4(&self, multiaddr: &Ipv4Addr, interface: &Ipv4Addr) -> io::Result<()> { +- let multiaddr = to_s_addr(multiaddr); +- let interface = to_s_addr(interface); +- let mreq = libc::ip_mreq { +- imr_multiaddr: libc::in_addr { s_addr: multiaddr }, +- imr_interface: libc::in_addr { s_addr: interface }, +- }; +- unsafe { self.setsockopt(libc::IPPROTO_IP, libc::IP_ADD_MEMBERSHIP, mreq) } +- } +- +- pub fn join_multicast_v6(&self, multiaddr: &Ipv6Addr, interface: u32) -> io::Result<()> { +- let multiaddr = to_in6_addr(multiaddr); +- let mreq = libc::ipv6_mreq { +- ipv6mr_multiaddr: multiaddr, +- ipv6mr_interface: to_ipv6mr_interface(interface), +- }; +- unsafe { self.setsockopt(libc::IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, mreq) } +- } +- +- pub fn leave_multicast_v4(&self, multiaddr: &Ipv4Addr, interface: &Ipv4Addr) -> io::Result<()> { +- let multiaddr = to_s_addr(multiaddr); +- let interface = to_s_addr(interface); +- let mreq = libc::ip_mreq { +- imr_multiaddr: libc::in_addr { s_addr: multiaddr }, +- imr_interface: libc::in_addr { s_addr: interface }, +- }; +- unsafe { self.setsockopt(libc::IPPROTO_IP, libc::IP_DROP_MEMBERSHIP, mreq) } +- } +- +- pub fn leave_multicast_v6(&self, multiaddr: &Ipv6Addr, interface: u32) -> io::Result<()> { +- let multiaddr = to_in6_addr(multiaddr); +- let mreq = libc::ipv6_mreq { +- ipv6mr_multiaddr: multiaddr, +- ipv6mr_interface: to_ipv6mr_interface(interface), +- }; +- unsafe { self.setsockopt(libc::IPPROTO_IPV6, IPV6_DROP_MEMBERSHIP, mreq) } +- } +- +- pub fn linger(&self) -> io::Result> { +- unsafe { +- Ok(linger2dur( +- self.getsockopt(libc::SOL_SOCKET, libc::SO_LINGER)?, +- )) +- } +- } +- +- pub fn set_linger(&self, dur: Option) -> io::Result<()> { +- unsafe { self.setsockopt(libc::SOL_SOCKET, libc::SO_LINGER, dur2linger(dur)) } +- } +- +- pub fn set_reuse_address(&self, reuse: bool) -> io::Result<()> { +- unsafe { self.setsockopt(libc::SOL_SOCKET, libc::SO_REUSEADDR, reuse as c_int) } +- } +- +- pub fn reuse_address(&self) -> io::Result { +- unsafe { +- let raw: c_int = self.getsockopt(libc::SOL_SOCKET, libc::SO_REUSEADDR)?; +- Ok(raw != 0) +- } +- } +- +- pub fn recv_buffer_size(&self) -> io::Result { +- unsafe { +- let raw: c_int = self.getsockopt(libc::SOL_SOCKET, libc::SO_RCVBUF)?; +- Ok(raw as usize) +- } +- } +- +- pub fn set_recv_buffer_size(&self, size: usize) -> io::Result<()> { +- unsafe { +- // TODO: casting usize to a c_int should be a checked cast +- self.setsockopt(libc::SOL_SOCKET, libc::SO_RCVBUF, size as c_int) +- } +- } +- +- pub fn send_buffer_size(&self) -> io::Result { +- unsafe { +- let raw: c_int = self.getsockopt(libc::SOL_SOCKET, libc::SO_SNDBUF)?; +- Ok(raw as usize) +- } +- } +- +- pub fn set_send_buffer_size(&self, size: usize) -> io::Result<()> { +- unsafe { +- // TODO: casting usize to a c_int should be a checked cast +- self.setsockopt(libc::SOL_SOCKET, libc::SO_SNDBUF, size as c_int) +- } +- } +- +- pub fn keepalive(&self) -> io::Result> { +- unsafe { +- let raw: c_int = self.getsockopt(libc::SOL_SOCKET, libc::SO_KEEPALIVE)?; +- if raw == 0 { +- return Ok(None); +- } +- let secs: c_int = self.getsockopt(libc::IPPROTO_TCP, KEEPALIVE_OPTION)?; +- Ok(Some(Duration::new(secs as u64, 0))) +- } +- } +- +- pub fn set_keepalive(&self, keepalive: Option) -> io::Result<()> { +- unsafe { +- self.setsockopt( +- libc::SOL_SOCKET, +- libc::SO_KEEPALIVE, +- keepalive.is_some() as c_int, +- )?; +- if let Some(dur) = keepalive { +- // TODO: checked cast here +- self.setsockopt(libc::IPPROTO_TCP, KEEPALIVE_OPTION, dur.as_secs() as c_int)?; +- } +- Ok(()) +- } +- } +- +- unsafe fn setsockopt(&self, opt: c_int, val: c_int, payload: T) -> io::Result<()> +- where +- T: Copy, +- { +- let payload = &payload as *const T as *const c_void; +- cvt(libc::setsockopt( +- self.fd, +- opt, +- val, +- payload, +- mem::size_of::() as libc::socklen_t, +- ))?; +- Ok(()) +- } +- +- unsafe fn getsockopt(&self, opt: c_int, val: c_int) -> io::Result { +- let mut slot: T = mem::zeroed(); +- let mut len = mem::size_of::() as libc::socklen_t; +- cvt(libc::getsockopt( +- self.fd, +- opt, +- val, +- &mut slot as *mut _ as *mut _, +- &mut len, +- ))?; +- assert_eq!(len as usize, mem::size_of::()); +- Ok(slot) +- } +-} +- +-impl Read for Socket { +- fn read(&mut self, buf: &mut [u8]) -> io::Result { +- <&Socket>::read(&mut &*self, buf) +- } +-} +- +-impl<'a> Read for &'a Socket { +- fn read(&mut self, buf: &mut [u8]) -> io::Result { +- unsafe { +- let n = cvt({ +- libc::read( +- self.fd, +- buf.as_mut_ptr() as *mut c_void, +- cmp::min(buf.len(), max_len()), +- ) +- })?; +- Ok(n as usize) +- } +- } +-} +- +-impl Write for Socket { +- fn write(&mut self, buf: &[u8]) -> io::Result { +- <&Socket>::write(&mut &*self, buf) +- } +- +- fn flush(&mut self) -> io::Result<()> { +- <&Socket>::flush(&mut &*self) +- } +-} +- +-impl<'a> Write for &'a Socket { +- fn write(&mut self, buf: &[u8]) -> io::Result { +- self.send(buf) +- } +- +- fn flush(&mut self) -> io::Result<()> { +- Ok(()) +- } +-} +- +-impl fmt::Debug for Socket { +- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { +- let mut f = f.debug_struct("Socket"); +- f.field("fd", &self.fd); +- if let Ok(addr) = self.local_addr() { +- f.field("local_addr", &addr); +- } +- if let Ok(addr) = self.peer_addr() { +- f.field("peer_addr", &addr); +- } +- f.finish() +- } +-} +- +-impl AsRawFd for Socket { +- fn as_raw_fd(&self) -> RawFd { +- self.fd as RawFd +- } +-} +- +-impl IntoRawFd for Socket { +- fn into_raw_fd(self) -> RawFd { +- let fd = self.fd as RawFd; +- mem::forget(self); +- return fd; +- } +-} +- +-impl FromRawFd for Socket { +- unsafe fn from_raw_fd(fd: RawFd) -> Socket { +- Socket { fd: fd as c_int } +- } +-} +- +-impl AsRawFd for crate::Socket { +- fn as_raw_fd(&self) -> RawFd { +- self.inner.as_raw_fd() +- } +-} +- +-impl IntoRawFd for crate::Socket { +- fn into_raw_fd(self) -> RawFd { +- self.inner.into_raw_fd() +- } +-} +- +-impl FromRawFd for crate::Socket { +- unsafe fn from_raw_fd(fd: RawFd) -> crate::Socket { +- crate::Socket { +- inner: Socket::from_raw_fd(fd), +- } +- } +-} +- +-impl Drop for Socket { +- fn drop(&mut self) { +- unsafe { +- let _ = libc::close(self.fd); +- } +- } +-} +- +-impl From for net::TcpStream { +- fn from(socket: Socket) -> net::TcpStream { +- unsafe { net::TcpStream::from_raw_fd(socket.into_raw_fd()) } +- } +-} +- +-impl From for net::TcpListener { +- fn from(socket: Socket) -> net::TcpListener { +- unsafe { net::TcpListener::from_raw_fd(socket.into_raw_fd()) } +- } +-} +- +-impl From for net::UdpSocket { +- fn from(socket: Socket) -> net::UdpSocket { +- unsafe { net::UdpSocket::from_raw_fd(socket.into_raw_fd()) } +- } +-} +- +-impl From for Socket { +- fn from(socket: net::TcpStream) -> Socket { +- unsafe { Socket::from_raw_fd(socket.into_raw_fd()) } +- } +-} +- +-impl From for Socket { +- fn from(socket: net::TcpListener) -> Socket { +- unsafe { Socket::from_raw_fd(socket.into_raw_fd()) } +- } +-} +- +-impl From for Socket { +- fn from(socket: net::UdpSocket) -> Socket { +- unsafe { Socket::from_raw_fd(socket.into_raw_fd()) } +- } +-} +- +-fn max_len() -> usize { +- // The maximum read limit on most posix-like systems is `SSIZE_MAX`, +- // with the man page quoting that if the count of bytes to read is +- // greater than `SSIZE_MAX` the result is "unspecified". +- ::max_value() as usize +-} +- +-fn cvt>(t: T) -> io::Result { +- let one: T = T::one(); +- if t == -one { +- Err(io::Error::last_os_error()) +- } else { +- Ok(t) +- } +-} +- +-fn set_cloexec(fd: c_int) -> io::Result<()> { +- unsafe { +- let previous = cvt(libc::fcntl(fd, libc::F_GETFD))?; +- let new = previous | syscall::O_CLOEXEC as i32; +- if new != previous { +- cvt(libc::fcntl(fd, libc::F_SETFD, new))?; +- } +- Ok(()) +- } +-} +- +-fn dur2timeval(dur: Option) -> io::Result { +- match dur { +- Some(dur) => { +- if dur.as_secs() == 0 && dur.subsec_nanos() == 0 { +- return Err(io::Error::new( +- ErrorKind::InvalidInput, +- "cannot set a 0 duration timeout", +- )); +- } +- +- let secs = if dur.as_secs() > libc::time_t::max_value() as u64 { +- libc::time_t::max_value() +- } else { +- dur.as_secs() as libc::time_t +- }; +- let mut timeout = libc::timeval { +- tv_sec: secs, +- tv_usec: (dur.subsec_nanos() / 1000) as libc::suseconds_t, +- }; +- if timeout.tv_sec == 0 && timeout.tv_usec == 0 { +- timeout.tv_usec = 1; +- } +- Ok(timeout) +- } +- None => Ok(libc::timeval { +- tv_sec: 0, +- tv_usec: 0, +- }), +- } +-} +- +-fn timeval2dur(raw: libc::timeval) -> Option { +- if raw.tv_sec == 0 && raw.tv_usec == 0 { +- None +- } else { +- let sec = raw.tv_sec as u64; +- let nsec = (raw.tv_usec as u32) * 1000; +- Some(Duration::new(sec, nsec)) +- } +-} +- +-fn to_s_addr(addr: &Ipv4Addr) -> libc::in_addr_t { +- let octets = addr.octets(); +- crate::hton( +- ((octets[0] as libc::in_addr_t) << 24) +- | ((octets[1] as libc::in_addr_t) << 16) +- | ((octets[2] as libc::in_addr_t) << 8) +- | ((octets[3] as libc::in_addr_t) << 0), +- ) +-} +- +-fn to_in6_addr(addr: &Ipv6Addr) -> libc::in6_addr { +- let mut ret: libc::in6_addr = unsafe { mem::zeroed() }; +- ret.s6_addr = addr.octets(); +- return ret; +-} +- +-fn to_ipv6mr_interface(value: u32) -> libc::c_uint { +- value as libc::c_uint +-} +- +-fn linger2dur(linger_opt: libc::linger) -> Option { +- if linger_opt.l_onoff == 0 { +- None +- } else { +- Some(Duration::from_secs(linger_opt.l_linger as u64)) +- } +-} +- +-fn dur2linger(dur: Option) -> libc::linger { +- match dur { +- Some(d) => libc::linger { +- l_onoff: 1, +- l_linger: d.as_secs() as c_int, +- }, +- None => libc::linger { +- l_onoff: 0, +- l_linger: 0, +- }, +- } +-} +- +-#[test] +-fn test_ip() { +- let ip = Ipv4Addr::new(127, 0, 0, 1); +- assert_eq!(ip, from_s_addr(to_s_addr(&ip))); +-} +diff --git a/third_party/rust/socket2/src/sys/unix.rs b/third_party/rust/socket2/src/sys/unix.rs +index cacbcb5fb37ad696f577618d501dc6ba5eb29839..87794002e27a2648e6c1d68ebb12833d26550bef 100644 +--- a/third_party/rust/socket2/src/sys/unix.rs ++++ b/third_party/rust/socket2/src/sys/unix.rs +@@ -9,26 +9,48 @@ + // except according to those terms. + + use std::cmp; ++#[cfg(target_os = "linux")] ++use std::ffi::{CStr, CString}; + use std::fmt; + use std::io; + use std::io::{ErrorKind, Read, Write}; + use std::mem; ++#[cfg(target_os = "linux")] ++use std::mem::MaybeUninit; + use std::net::Shutdown; + use std::net::{self, Ipv4Addr, Ipv6Addr}; + use std::ops::Neg; + #[cfg(feature = "unix")] + use std::os::unix::net::{UnixDatagram, UnixListener, UnixStream}; + use std::os::unix::prelude::*; ++#[cfg(target_os = "linux")] ++use std::ptr; ++#[cfg(target_os = "linux")] ++use std::slice; + use std::sync::atomic::{AtomicBool, Ordering}; + use std::time::{Duration, Instant}; + +-use libc::{self, c_int, c_void, socklen_t, ssize_t}; ++use libc::{self, c_void, socklen_t, ssize_t}; ++ ++use crate::{Domain, Type}; ++ ++pub use libc::c_int; ++ ++// Used in `Domain`. ++pub(crate) use libc::{AF_INET, AF_INET6}; ++// Used in `Type`. ++#[cfg(not(target_os = "redox"))] ++pub(crate) use libc::SOCK_RAW; ++pub(crate) use libc::{SOCK_DGRAM, SOCK_SEQPACKET, SOCK_STREAM}; ++// Used in `Protocol`. ++pub(crate) use libc::{IPPROTO_ICMP, IPPROTO_ICMPV6, IPPROTO_TCP, IPPROTO_UDP}; + + cfg_if::cfg_if! { + if #[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "ios", target_os = "macos", + target_os = "openbsd", target_os = "netbsd", +- target_os = "solaris", target_os = "haiku"))] { ++ target_os = "solaris", target_os = "illumos", ++ target_os = "haiku"))] { + use libc::IPV6_JOIN_GROUP as IPV6_ADD_MEMBERSHIP; + use libc::IPV6_LEAVE_GROUP as IPV6_DROP_MEMBERSHIP; + } else { +@@ -37,17 +59,6 @@ cfg_if::cfg_if! { + } + } + +-cfg_if::cfg_if! { +- if #[cfg(any(target_os = "linux", target_os = "android", +- target_os = "dragonfly", target_os = "freebsd", +- target_os = "openbsd", target_os = "netbsd", +- target_os = "haiku", target_os = "bitrig"))] { +- use libc::MSG_NOSIGNAL; +- } else { +- const MSG_NOSIGNAL: c_int = 0x0; +- } +-} +- + cfg_if::cfg_if! { + if #[cfg(any(target_os = "macos", target_os = "ios"))] { + use libc::TCP_KEEPALIVE as KEEPALIVE_OPTION; +@@ -61,12 +72,109 @@ cfg_if::cfg_if! { + use crate::utils::One; + use crate::SockAddr; + +-pub const IPPROTO_ICMP: i32 = libc::IPPROTO_ICMP; +-pub const IPPROTO_ICMPV6: i32 = libc::IPPROTO_ICMPV6; +-pub const IPPROTO_TCP: i32 = libc::IPPROTO_TCP; +-pub const IPPROTO_UDP: i32 = libc::IPPROTO_UDP; +-pub const SOCK_SEQPACKET: i32 = libc::SOCK_SEQPACKET; +-pub const SOCK_RAW: i32 = libc::SOCK_RAW; ++/// Unix only API. ++impl Domain { ++ /// Domain for Unix socket communication, corresponding to `AF_UNIX`. ++ pub fn unix() -> Domain { ++ Domain(libc::AF_UNIX) ++ } ++ ++ /// Domain for low-level packet interface, corresponding to `AF_PACKET`. ++ /// ++ /// # Notes ++ /// ++ /// This function is only available on Linux. ++ #[cfg(target_os = "linux")] ++ pub fn packet() -> Domain { ++ Domain(libc::AF_PACKET) ++ } ++} ++ ++impl_debug!( ++ Domain, ++ libc::AF_INET, ++ libc::AF_INET6, ++ libc::AF_UNIX, ++ libc::AF_UNSPEC, // = 0. ++); ++ ++/// Unix only API. ++impl Type { ++ /// Set `SOCK_NONBLOCK` on the `Type`. ++ /// ++ /// # Notes ++ /// ++ /// This function is only available on Android, DragonFlyBSD, FreeBSD, ++ /// Linux, NetBSD and OpenBSD. ++ #[cfg(any( ++ target_os = "android", ++ target_os = "dragonfly", ++ target_os = "freebsd", ++ target_os = "linux", ++ target_os = "netbsd", ++ target_os = "openbsd" ++ ))] ++ pub fn non_blocking(self) -> Type { ++ Type(self.0 | libc::SOCK_NONBLOCK) ++ } ++ ++ /// Set `SOCK_CLOEXEC` on the `Type`. ++ /// ++ /// # Notes ++ /// ++ /// This function is only available on Android, DragonFlyBSD, FreeBSD, ++ /// Linux, NetBSD and OpenBSD. ++ #[cfg(any( ++ target_os = "android", ++ target_os = "dragonfly", ++ target_os = "freebsd", ++ target_os = "linux", ++ target_os = "netbsd", ++ target_os = "openbsd" ++ ))] ++ pub fn cloexec(self) -> Type { ++ Type(self.0 | libc::SOCK_CLOEXEC) ++ } ++} ++ ++impl_debug!( ++ crate::Type, ++ libc::SOCK_STREAM, ++ libc::SOCK_DGRAM, ++ #[cfg(not(target_os = "redox"))] ++ libc::SOCK_RAW, ++ #[cfg(not(any(target_os = "haiku", target_os = "redox")))] ++ libc::SOCK_RDM, ++ libc::SOCK_SEQPACKET, ++ /* TODO: add these optional bit OR-ed flags: ++ #[cfg(any( ++ target_os = "android", ++ target_os = "dragonfly", ++ target_os = "freebsd", ++ target_os = "linux", ++ target_os = "netbsd", ++ target_os = "openbsd" ++ ))] ++ libc::SOCK_NONBLOCK, ++ #[cfg(any( ++ target_os = "android", ++ target_os = "dragonfly", ++ target_os = "freebsd", ++ target_os = "linux", ++ target_os = "netbsd", ++ target_os = "openbsd" ++ ))] ++ libc::SOCK_CLOEXEC, ++ */ ++); ++ ++impl_debug!( ++ crate::Protocol, ++ libc::IPPROTO_ICMP, ++ libc::IPPROTO_ICMPV6, ++ libc::IPPROTO_TCP, ++ libc::IPPROTO_UDP, ++); + + pub struct Socket { + fd: c_int, +@@ -92,7 +200,7 @@ impl Socket { + let fd = cvt(libc::socket(family, ty, protocol))?; + let fd = Socket::from_raw_fd(fd); + set_cloexec(fd.as_raw_fd())?; +- #[cfg(target_os = "macos")] ++ #[cfg(any(target_os = "macos", target_os = "ios"))] + { + fd.setsockopt(libc::SOL_SOCKET, libc::SO_NOSIGPIPE, 1i32)?; + } +@@ -107,7 +215,7 @@ impl Socket { + let fds = (Socket::from_raw_fd(fds[0]), Socket::from_raw_fd(fds[1])); + set_cloexec(fds.0.as_raw_fd())?; + set_cloexec(fds.1.as_raw_fd())?; +- #[cfg(target_os = "macos")] ++ #[cfg(any(target_os = "macos", target_os = "ios"))] + { + fds.0 + .setsockopt(libc::SOL_SOCKET, libc::SO_NOSIGPIPE, 1i32)?; +@@ -281,7 +389,7 @@ impl Socket { + libc::SYS_accept4, + self.fd as libc::c_long, + &mut storage as *mut _ as libc::c_long, +- len as libc::c_long, ++ &mut len, + libc::SOCK_CLOEXEC as libc::c_long, + ) as libc::c_int + }); +@@ -342,14 +450,14 @@ impl Socket { + Ok(()) + } + +- pub fn recv(&self, buf: &mut [u8]) -> io::Result { ++ pub fn recv(&self, buf: &mut [u8], flags: c_int) -> io::Result { + unsafe { + let n = cvt({ + libc::recv( + self.fd, + buf.as_mut_ptr() as *mut c_void, + cmp::min(buf.len(), max_len()), +- 0, ++ flags, + ) + })?; + Ok(n as usize) +@@ -370,15 +478,11 @@ impl Socket { + } + } + +- pub fn recv_from(&self, buf: &mut [u8]) -> io::Result<(usize, SockAddr)> { +- self.recvfrom(buf, 0) +- } +- + pub fn peek_from(&self, buf: &mut [u8]) -> io::Result<(usize, SockAddr)> { +- self.recvfrom(buf, libc::MSG_PEEK) ++ self.recv_from(buf, libc::MSG_PEEK) + } + +- fn recvfrom(&self, buf: &mut [u8], flags: c_int) -> io::Result<(usize, SockAddr)> { ++ pub fn recv_from(&self, buf: &mut [u8], flags: c_int) -> io::Result<(usize, SockAddr)> { + unsafe { + let mut storage: libc::sockaddr_storage = mem::zeroed(); + let mut addrlen = mem::size_of_val(&storage) as socklen_t; +@@ -398,28 +502,28 @@ impl Socket { + } + } + +- pub fn send(&self, buf: &[u8]) -> io::Result { ++ pub fn send(&self, buf: &[u8], flags: c_int) -> io::Result { + unsafe { + let n = cvt({ + libc::send( + self.fd, + buf.as_ptr() as *const c_void, + cmp::min(buf.len(), max_len()), +- MSG_NOSIGNAL, ++ flags, + ) + })?; + Ok(n as usize) + } + } + +- pub fn send_to(&self, buf: &[u8], addr: &SockAddr) -> io::Result { ++ pub fn send_to(&self, buf: &[u8], flags: c_int, addr: &SockAddr) -> io::Result { + unsafe { + let n = cvt({ + libc::sendto( + self.fd, + buf.as_ptr() as *const c_void, + cmp::min(buf.len(), max_len()), +- MSG_NOSIGNAL, ++ flags, + addr.as_ptr(), + addr.len(), + ) +@@ -441,6 +545,88 @@ impl Socket { + unsafe { self.setsockopt(libc::IPPROTO_IP, libc::IP_TTL, ttl as c_int) } + } + ++ #[cfg(not(target_os = "redox"))] ++ pub fn mss(&self) -> io::Result { ++ unsafe { ++ let raw: c_int = self.getsockopt(libc::IPPROTO_TCP, libc::TCP_MAXSEG)?; ++ Ok(raw as u32) ++ } ++ } ++ ++ #[cfg(not(target_os = "redox"))] ++ pub fn set_mss(&self, mss: u32) -> io::Result<()> { ++ unsafe { self.setsockopt(libc::IPPROTO_TCP, libc::TCP_MAXSEG, mss as c_int) } ++ } ++ ++ #[cfg(target_os = "linux")] ++ pub fn mark(&self) -> io::Result { ++ unsafe { ++ let raw: c_int = self.getsockopt(libc::SOL_SOCKET, libc::SO_MARK)?; ++ Ok(raw as u32) ++ } ++ } ++ ++ #[cfg(target_os = "linux")] ++ pub fn set_mark(&self, mark: u32) -> io::Result<()> { ++ unsafe { self.setsockopt(libc::SOL_SOCKET, libc::SO_MARK, mark as c_int) } ++ } ++ ++ #[cfg(target_os = "linux")] ++ pub fn device(&self) -> io::Result> { ++ // TODO: replace with `MaybeUninit::uninit_array` once stable. ++ let mut buf: [MaybeUninit; libc::IFNAMSIZ] = ++ unsafe { MaybeUninit::<[MaybeUninit; libc::IFNAMSIZ]>::uninit().assume_init() }; ++ let mut len = buf.len() as libc::socklen_t; ++ let len = unsafe { ++ cvt(libc::getsockopt( ++ self.fd, ++ libc::SOL_SOCKET, ++ libc::SO_BINDTODEVICE, ++ buf.as_mut_ptr().cast(), ++ &mut len, ++ ))? ++ }; ++ if len == 0 { ++ Ok(None) ++ } else { ++ // Allocate a buffer for `CString` with the length including the ++ // null terminator. ++ let len = len as usize; ++ let mut name = Vec::with_capacity(len); ++ ++ // TODO: use `MaybeUninit::slice_assume_init_ref` once stable. ++ // Safety: `len` bytes are writen by the OS, this includes a null ++ // terminator. However we don't copy the null terminator because ++ // `CString::from_vec_unchecked` adds its own null terminator. ++ let buf = unsafe { slice::from_raw_parts(buf.as_ptr().cast(), len - 1) }; ++ name.extend_from_slice(buf); ++ ++ // Safety: the OS initialised the string for us, which shouldn't ++ // include any null bytes. ++ Ok(Some(unsafe { CString::from_vec_unchecked(name) })) ++ } ++ } ++ ++ #[cfg(target_os = "linux")] ++ pub fn bind_device(&self, interface: Option<&CStr>) -> io::Result<()> { ++ let (value, len) = if let Some(interface) = interface { ++ (interface.as_ptr(), interface.to_bytes_with_nul().len()) ++ } else { ++ (ptr::null(), 0) ++ }; ++ ++ unsafe { ++ cvt(libc::setsockopt( ++ self.fd, ++ libc::SOL_SOCKET, ++ libc::SO_BINDTODEVICE, ++ value.cast(), ++ len as libc::socklen_t, ++ )) ++ .map(|_| ()) ++ } ++ } ++ + pub fn unicast_hops_v6(&self) -> io::Result { + unsafe { + let raw: c_int = self.getsockopt(libc::IPPROTO_IPV6, libc::IPV6_UNICAST_HOPS)?; +@@ -724,7 +910,11 @@ impl Socket { + } + } + +- #[cfg(all(unix, feature = "reuseport"))] ++ #[cfg(all( ++ unix, ++ not(any(target_os = "solaris", target_os = "illumos")), ++ feature = "reuseport" ++ ))] + pub fn reuse_port(&self) -> io::Result { + unsafe { + let raw: c_int = self.getsockopt(libc::SOL_SOCKET, libc::SO_REUSEPORT)?; +@@ -732,11 +922,26 @@ impl Socket { + } + } + +- #[cfg(all(unix, feature = "reuseport"))] ++ #[cfg(all( ++ unix, ++ not(any(target_os = "solaris", target_os = "illumos")), ++ feature = "reuseport" ++ ))] + pub fn set_reuse_port(&self, reuse: bool) -> io::Result<()> { + unsafe { self.setsockopt(libc::SOL_SOCKET, libc::SO_REUSEPORT, reuse as c_int) } + } + ++ pub fn out_of_band_inline(&self) -> io::Result { ++ unsafe { ++ let raw: c_int = self.getsockopt(libc::SOL_SOCKET, libc::SO_OOBINLINE)?; ++ Ok(raw != 0) ++ } ++ } ++ ++ pub fn set_out_of_band_inline(&self, oob_inline: bool) -> io::Result<()> { ++ unsafe { self.setsockopt(libc::SOL_SOCKET, libc::SO_OOBINLINE, oob_inline as c_int) } ++ } ++ + unsafe fn setsockopt(&self, opt: c_int, val: c_int, payload: T) -> io::Result<()> + where + T: Copy, +@@ -800,7 +1005,7 @@ impl Write for Socket { + + impl<'a> Write for &'a Socket { + fn write(&mut self, buf: &[u8]) -> io::Result { +- self.send(buf) ++ self.send(buf, 0) + } + + fn flush(&mut self) -> io::Result<()> { +@@ -1101,3 +1306,12 @@ fn test_ip() { + let ip = Ipv4Addr::new(127, 0, 0, 1); + assert_eq!(ip, from_s_addr(to_s_addr(&ip))); + } ++ ++#[test] ++fn test_out_of_band_inline() { ++ let tcp = Socket::new(libc::AF_INET, libc::SOCK_STREAM, 0).unwrap(); ++ assert_eq!(tcp.out_of_band_inline().unwrap(), false); ++ ++ tcp.set_out_of_band_inline(true).unwrap(); ++ assert_eq!(tcp.out_of_band_inline().unwrap(), true); ++} +diff --git a/third_party/rust/socket2/src/sys/windows.rs b/third_party/rust/socket2/src/sys/windows.rs +index d2c5a882e74751b2cdc52e16deca02efeeb27b9f..443ef265e2a76e1dc7d0760f9513e293f0fa51aa 100644 +--- a/third_party/rust/socket2/src/sys/windows.rs ++++ b/third_party/rust/socket2/src/sys/windows.rs +@@ -17,16 +17,15 @@ use std::net::Shutdown; + use std::net::{self, Ipv4Addr, Ipv6Addr}; + use std::os::windows::prelude::*; + use std::ptr; +-use std::sync::{Once, ONCE_INIT}; ++use std::sync::Once; + use std::time::Duration; + +-use winapi::ctypes::{c_char, c_int, c_long, c_ulong}; ++use winapi::ctypes::{c_char, c_long, c_ulong}; + use winapi::shared::in6addr::*; + use winapi::shared::inaddr::*; + use winapi::shared::minwindef::DWORD; + use winapi::shared::ntdef::{HANDLE, ULONG}; +-use winapi::shared::ws2def; +-use winapi::shared::ws2def::*; ++use winapi::shared::ws2def::{self, *}; + use winapi::shared::ws2ipdef::*; + use winapi::um::handleapi::SetHandleInformation; + use winapi::um::processthreadsapi::GetCurrentProcessId; +@@ -43,12 +42,42 @@ const SD_SEND: c_int = 1; + const SIO_KEEPALIVE_VALS: DWORD = 0x98000004; + const WSA_FLAG_OVERLAPPED: DWORD = 0x01; + +-pub const IPPROTO_ICMP: i32 = ws2def::IPPROTO_ICMP as i32; +-pub const IPPROTO_ICMPV6: i32 = ws2def::IPPROTO_ICMPV6 as i32; +-pub const IPPROTO_TCP: i32 = ws2def::IPPROTO_TCP as i32; +-pub const IPPROTO_UDP: i32 = ws2def::IPPROTO_UDP as i32; +-pub const SOCK_SEQPACKET: i32 = ws2def::SOCK_SEQPACKET as i32; +-pub const SOCK_RAW: i32 = ws2def::SOCK_RAW as i32; ++pub use winapi::ctypes::c_int; ++ ++// Used in `Domain`. ++pub(crate) use winapi::shared::ws2def::{AF_INET, AF_INET6}; ++// Used in `Type`. ++pub(crate) use winapi::shared::ws2def::{SOCK_DGRAM, SOCK_RAW, SOCK_SEQPACKET, SOCK_STREAM}; ++// Used in `Protocol`. ++pub(crate) const IPPROTO_ICMP: c_int = winapi::shared::ws2def::IPPROTO_ICMP as c_int; ++pub(crate) const IPPROTO_ICMPV6: c_int = winapi::shared::ws2def::IPPROTO_ICMPV6 as c_int; ++pub(crate) const IPPROTO_TCP: c_int = winapi::shared::ws2def::IPPROTO_TCP as c_int; ++pub(crate) const IPPROTO_UDP: c_int = winapi::shared::ws2def::IPPROTO_UDP as c_int; ++ ++impl_debug!( ++ crate::Domain, ++ ws2def::AF_INET, ++ ws2def::AF_INET6, ++ ws2def::AF_UNIX, ++ ws2def::AF_UNSPEC, // = 0. ++); ++ ++impl_debug!( ++ crate::Type, ++ ws2def::SOCK_STREAM, ++ ws2def::SOCK_DGRAM, ++ ws2def::SOCK_RAW, ++ ws2def::SOCK_RDM, ++ ws2def::SOCK_SEQPACKET, ++); ++ ++impl_debug!( ++ crate::Protocol, ++ self::IPPROTO_ICMP, ++ self::IPPROTO_ICMPV6, ++ self::IPPROTO_TCP, ++ self::IPPROTO_UDP, ++); + + #[repr(C)] + struct tcp_keepalive { +@@ -58,7 +87,7 @@ struct tcp_keepalive { + } + + fn init() { +- static INIT: Once = ONCE_INIT; ++ static INIT: Once = Once::new(); + + INIT.call_once(|| { + // Initialize winsock through the standard library by just creating a +@@ -285,14 +314,14 @@ impl Socket { + } + } + +- pub fn recv(&self, buf: &mut [u8]) -> io::Result { ++ pub fn recv(&self, buf: &mut [u8], flags: c_int) -> io::Result { + unsafe { + let n = { + sock::recv( + self.socket, + buf.as_mut_ptr() as *mut c_char, + clamp(buf.len()), +- 0, ++ flags, + ) + }; + match n { +@@ -321,15 +350,11 @@ impl Socket { + } + } + +- pub fn recv_from(&self, buf: &mut [u8]) -> io::Result<(usize, SockAddr)> { +- self.recvfrom(buf, 0) +- } +- + pub fn peek_from(&self, buf: &mut [u8]) -> io::Result<(usize, SockAddr)> { +- self.recvfrom(buf, MSG_PEEK) ++ self.recv_from(buf, MSG_PEEK) + } + +- fn recvfrom(&self, buf: &mut [u8], flags: c_int) -> io::Result<(usize, SockAddr)> { ++ pub fn recv_from(&self, buf: &mut [u8], flags: c_int) -> io::Result<(usize, SockAddr)> { + unsafe { + let mut storage: SOCKADDR_STORAGE = mem::zeroed(); + let mut addrlen = mem::size_of_val(&storage) as c_int; +@@ -354,14 +379,14 @@ impl Socket { + } + } + +- pub fn send(&self, buf: &[u8]) -> io::Result { ++ pub fn send(&self, buf: &[u8], flags: c_int) -> io::Result { + unsafe { + let n = { + sock::send( + self.socket, + buf.as_ptr() as *const c_char, + clamp(buf.len()), +- 0, ++ flags, + ) + }; + if n == sock::SOCKET_ERROR { +@@ -372,14 +397,14 @@ impl Socket { + } + } + +- pub fn send_to(&self, buf: &[u8], addr: &SockAddr) -> io::Result { ++ pub fn send_to(&self, buf: &[u8], flags: c_int, addr: &SockAddr) -> io::Result { + unsafe { + let n = { + sock::sendto( + self.socket, + buf.as_ptr() as *const c_char, + clamp(buf.len()), +- 0, ++ flags, + addr.as_ptr(), + addr.len(), + ) +@@ -688,6 +713,17 @@ impl Socket { + } + } + ++ pub fn out_of_band_inline(&self) -> io::Result { ++ unsafe { ++ let raw: c_int = self.getsockopt(SOL_SOCKET, SO_OOBINLINE)?; ++ Ok(raw != 0) ++ } ++ } ++ ++ pub fn set_out_of_band_inline(&self, oob_inline: bool) -> io::Result<()> { ++ unsafe { self.setsockopt(SOL_SOCKET, SO_OOBINLINE, oob_inline as c_int) } ++ } ++ + unsafe fn setsockopt(&self, opt: c_int, val: c_int, payload: T) -> io::Result<()> + where + T: Copy, +@@ -738,7 +774,7 @@ impl Read for Socket { + + impl<'a> Read for &'a Socket { + fn read(&mut self, buf: &mut [u8]) -> io::Result { +- self.recv(buf) ++ self.recv(buf, 0) + } + } + +@@ -754,7 +790,7 @@ impl Write for Socket { + + impl<'a> Write for &'a Socket { + fn write(&mut self, buf: &[u8]) -> io::Result { +- self.send(buf) ++ self.send(buf, 0) + } + + fn flush(&mut self) -> io::Result<()> { +@@ -975,3 +1011,12 @@ fn test_ip() { + let ip = Ipv4Addr::new(127, 0, 0, 1); + assert_eq!(ip, from_s_addr(to_s_addr(&ip))); + } ++ ++#[test] ++fn test_out_of_band_inline() { ++ let tcp = Socket::new(AF_INET, SOCK_STREAM, 0).unwrap(); ++ assert_eq!(tcp.out_of_band_inline().unwrap(), false); ++ ++ tcp.set_out_of_band_inline(true).unwrap(); ++ assert_eq!(tcp.out_of_band_inline().unwrap(), true); ++} +diff --git a/third_party/rust/socket2/src/tests.rs b/third_party/rust/socket2/src/tests.rs +new file mode 100644 +index 0000000000000000000000000000000000000000..4a2f1f8ee452cc40d2cdc8cfa89ef2cc40b9a7c6 +--- /dev/null ++++ b/third_party/rust/socket2/src/tests.rs +@@ -0,0 +1,62 @@ ++use std::io::Write; ++use std::str; ++ ++use crate::{Domain, Protocol, Type}; ++ ++#[test] ++fn domain_fmt_debug() { ++ let tests = &[ ++ (Domain::ipv4(), "AF_INET"), ++ (Domain::ipv6(), "AF_INET6"), ++ #[cfg(unix)] ++ (Domain::unix(), "AF_UNIX"), ++ (0.into(), "AF_UNSPEC"), ++ (500.into(), "500"), ++ ]; ++ ++ let mut buf = Vec::new(); ++ for (input, want) in tests { ++ buf.clear(); ++ write!(buf, "{:?}", input).unwrap(); ++ let got = str::from_utf8(&buf).unwrap(); ++ assert_eq!(got, *want); ++ } ++} ++ ++#[test] ++fn type_fmt_debug() { ++ let tests = &[ ++ (Type::stream(), "SOCK_STREAM"), ++ (Type::dgram(), "SOCK_DGRAM"), ++ (Type::seqpacket(), "SOCK_SEQPACKET"), ++ (Type::raw(), "SOCK_RAW"), ++ (500.into(), "500"), ++ ]; ++ ++ let mut buf = Vec::new(); ++ for (input, want) in tests { ++ buf.clear(); ++ write!(buf, "{:?}", input).unwrap(); ++ let got = str::from_utf8(&buf).unwrap(); ++ assert_eq!(got, *want); ++ } ++} ++ ++#[test] ++fn protocol_fmt_debug() { ++ let tests = &[ ++ (Protocol::icmpv4(), "IPPROTO_ICMP"), ++ (Protocol::icmpv6(), "IPPROTO_ICMPV6"), ++ (Protocol::tcp(), "IPPROTO_TCP"), ++ (Protocol::udp(), "IPPROTO_UDP"), ++ (500.into(), "500"), ++ ]; ++ ++ let mut buf = Vec::new(); ++ for (input, want) in tests { ++ buf.clear(); ++ write!(buf, "{:?}", input).unwrap(); ++ let got = str::from_utf8(&buf).unwrap(); ++ assert_eq!(got, *want); ++ } ++} diff --git a/rpm/xulrunner-qt5.spec b/rpm/xulrunner-qt5.spec index ccb25d5b2ec24..5c29d5be09918 100644 --- a/rpm/xulrunner-qt5.spec +++ b/rpm/xulrunner-qt5.spec @@ -157,6 +157,12 @@ Patch99: 0099-Bug-1710603-Allow-stat-on-from-socket-process-for-gl.patch Patch100: 0100-Bug-1721326-Allow-dynamic-PTHREAD_STACK_MIN.-r-gland.patch Patch101: 0101-Bug-1782988-Avoid-build-bustage-when-building-agains.patch Patch102: 0102-Bug-1782988-Fix-use-of-arc4random_buf-use-in-ping.cp.patch +Patch103: 0103-Bug-1716518-Upgrade-rental-to-v0.5.6.-r-emilio.patch +Patch104: 0104-Bug-1661961-Upgrade-cstr-to-0.2.x.-r-emilio.patch +Patch105: 0105-Bug-1655929-run-cargo-update-and-mach-vendor-rust-fo.patch +Patch106: 0106-Bug-1655929-bump-upstream-versions-of-rlbox-lucet-r-.patch +Patch107: 0107-Add-cfg-if-1.0.0.patch +Patch108: 0108-Bug-1716518-Upgrade-socket2-to-v0.3.19.patch #Patch20: 0020-sailfishos-loginmanager-Adapt-LoginManager-to-EmbedL.patch #Patch51: 0051-sailfishos-gecko-Remove-android-define-from-logging.patch @@ -366,9 +372,9 @@ ln -sf "%BUILD_DIR"/config.status $PWD/build/config.status # Make stdc++ headers available on a fresh path to work around include_next bug JB#55058 if [ ! -L "%BUILD_DIR"/include ] ; then ln -s /usr/include/c++/*/ "%BUILD_DIR"/include; fi -# Expose the elf32-i386 libclang.so.13 for use inside the arm target, JB#55042 +# Expose the elf32-i386 libclang.so.15 for use inside the arm target, JB#55042 mkdir -p "%BUILD_DIR"/lib -SBOX_DISABLE_MAPPING=1 cp /usr/lib/libclang.so.13 "%BUILD_DIR"/lib/ +SBOX_DISABLE_MAPPING=1 cp /usr/lib/libclang.so.15 "%BUILD_DIR"/lib/ echo "ac_add_options --with-libclang-path='"%BUILD_DIR"/lib/'" >> "$MOZCONFIG" # Do not build as thumb since it breaks video decoding.