From 5f9538d1e2af29901c5e498b6ef408163b5816e8 Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Sat, 3 Mar 2018 11:13:02 +0000 Subject: [PATCH 1/8] Add passwd/group APIs needed for nix-rust/nix#864 --- Cargo.lock | 20 ++++++++++---------- Cargo.toml | 2 +- src/unix/bsd/mod.rs | 23 +++++++++++++++++++++++ src/unix/notbsd/linux/mod.rs | 24 ++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f83f830f8d37b..f4d76699f0be6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -73,19 +73,19 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.36" +version = "0.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.37" +version = "0.2.38" [[package]] name = "libc-test" version = "0.1.0" dependencies = [ "ctest 0.1.7 (git+https://github.com/alexcrichton/ctest)", - "libc 0.2.37", + "libc 0.2.38", ] [[package]] @@ -128,7 +128,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -182,12 +182,12 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -214,7 +214,7 @@ name = "syntex_errors" version = "0.59.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_pos 0.59.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -241,7 +241,7 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_errors 0.59.1 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_pos 0.59.1 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -307,7 +307,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" "checksum itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8324a32baf01e2ae060e9de58ed0bc2320c9a2833491ee36cd3b4c414de4db8c" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "1e5d97d6708edaa407429faa671b942dc0f2727222fb6b6539bf1db936e4b121" +"checksum libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)" = "56aebce561378d99a0bb578f8cb15b6114d2a1814a6c7949bbe646d968bb4fa9" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2" "checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" @@ -320,7 +320,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)" = "db99f3919e20faa51bb2996057f5031d8685019b5a06139b1ce761da671b8526" "checksum serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)" = "f4ba7591cfe93755e89eeecdbcc668885624829b020050e6aec99c2a03bd3fd0" "checksum serde_derive_internals 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6e03f1c9530c3fb0a0a5c9b826bdd9246a5921ae995d75f512ac917fc4dd55b5" -"checksum serde_json 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c9db7266c7d63a4c4b7fe8719656ccdd51acf1bed6124b174f933b009fb10bcb" +"checksum serde_json 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "57781ed845b8e742fc2bf306aba8e3b408fe8c366b900e3769fbc39f49eb8b39" "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" "checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" "checksum syntex_errors 0.59.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3133289179676c9f5c5b2845bf5a2e127769f4889fcbada43035ef6bd662605e" diff --git a/Cargo.toml b/Cargo.toml index ab5415ebe66fe..0e8eb360f5ef7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libc" -version = "0.2.37" +version = "0.2.38" authors = ["The Rust Project Developers"] license = "MIT/Apache-2.0" readme = "README.md" diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index bacfb41189bc8..592e0643a93b0 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -50,6 +50,13 @@ s! { pub pw_fields: ::c_int, } + pub struct group { + pub gr_name: *mut ::c_char, + pub gr_passwd: *mut ::c_char, + pub gr_gid: ::gid_t, + pub gr_mem: *mut *mut ::c_char + } + pub struct ifaddrs { pub ifa_next: *mut ifaddrs, pub ifa_name: *mut ::c_char, @@ -388,6 +395,10 @@ extern { pub fn getpwent() -> *mut passwd; pub fn setpwent(); pub fn endpwent(); + pub fn setgrent(); + pub fn endgrent(); + pub fn getgrent() -> *mut group; + 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; @@ -513,6 +524,18 @@ extern { buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut passwd) -> ::c_int; + #[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; #[cfg_attr(all(target_os = "macos", target_arch ="x86"), link_name = "sigwait$UNIX2003")] #[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")] diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index 33c397626b4d4..729eb312b48ca 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -160,6 +160,13 @@ s! { pub pw_shell: *mut ::c_char, } + pub struct group { + pub gr_name: *mut ::c_char, + pub gr_passwd: *mut ::c_char, + pub gr_gid: ::gid_t, + pub gr_mem: *mut *mut ::c_char + } + pub struct spwd { pub sp_namp: *mut ::c_char, pub sp_pwdp: *mut ::c_char, @@ -1468,9 +1475,14 @@ extern { pub fn setpwent(); pub fn endpwent(); pub fn getpwent() -> *mut passwd; + pub fn setgrent(); + pub fn endgrent(); + pub fn getgrent() -> *mut group; 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, @@ -1826,6 +1838,18 @@ extern { buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut passwd) -> ::c_int; + #[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; #[cfg_attr(all(target_os = "macos", target_arch ="x86"), link_name = "sigwait$UNIX2003")] #[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")] From 74c554c39545ed4642a1e93a0bb9ee7d7ee3883a Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Sat, 3 Mar 2018 11:26:40 +0000 Subject: [PATCH 2/8] Fix build error on stable Rust --- src/unix/bsd/mod.rs | 8 +------- src/unix/notbsd/linux/mod.rs | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index 592e0643a93b0..c7f670aa586a1 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -1,4 +1,5 @@ use dox::{mem, Option}; +use unix::group; pub type wchar_t = i32; pub type off_t = i64; @@ -50,13 +51,6 @@ s! { pub pw_fields: ::c_int, } - pub struct group { - pub gr_name: *mut ::c_char, - pub gr_passwd: *mut ::c_char, - pub gr_gid: ::gid_t, - pub gr_mem: *mut *mut ::c_char - } - pub struct ifaddrs { pub ifa_next: *mut ifaddrs, pub ifa_name: *mut ::c_char, diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index 729eb312b48ca..9f4307d8140e0 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -1,6 +1,7 @@ //! Linux-specific definitions for linux-like values use dox::{mem, Option}; +use unix::group; pub type useconds_t = u32; pub type dev_t = u64; @@ -160,13 +161,6 @@ s! { pub pw_shell: *mut ::c_char, } - pub struct group { - pub gr_name: *mut ::c_char, - pub gr_passwd: *mut ::c_char, - pub gr_gid: ::gid_t, - pub gr_mem: *mut *mut ::c_char - } - pub struct spwd { pub sp_namp: *mut ::c_char, pub sp_pwdp: *mut ::c_char, From f59c095c5c891f1a4407c37521163a27e3902d44 Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Sat, 3 Mar 2018 11:53:39 +0000 Subject: [PATCH 3/8] Remove "double blank line" --- src/unix/notbsd/linux/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index 9f4307d8140e0..ff659fadc963f 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -1476,7 +1476,6 @@ extern { 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, From 6228556cfaed9768a764f1909c30b817cf0e145e Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Sun, 4 Mar 2018 10:09:43 +0000 Subject: [PATCH 4/8] Fix issues raised by @gnzlbg --- src/unix/bsd/mod.rs | 15 +-------------- src/unix/bsd/netbsdlike/mod.rs | 10 ++++++++++ src/unix/notbsd/linux/mod.rs | 15 +-------------- src/unix/notbsd/linux/other/mod.rs | 12 ++++++++++++ src/unix/solaris/mod.rs | 10 ++++++++++ 5 files changed, 34 insertions(+), 28 deletions(-) diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index c7f670aa586a1..4d0539e7e0d22 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -1,5 +1,4 @@ use dox::{mem, Option}; -use unix::group; pub type wchar_t = i32; pub type off_t = i64; @@ -391,7 +390,7 @@ extern { pub fn endpwent(); pub fn setgrent(); pub fn endgrent(); - pub fn getgrent() -> *mut group; + pub fn getgrent() -> *mut ::group; pub fn getprogname() -> *const ::c_char; pub fn setprogname(name: *const ::c_char); @@ -518,18 +517,6 @@ extern { buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut passwd) -> ::c_int; - #[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; #[cfg_attr(all(target_os = "macos", target_arch ="x86"), link_name = "sigwait$UNIX2003")] #[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")] diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs index 647e25dc0f4d9..866374374b70b 100644 --- a/src/unix/bsd/netbsdlike/mod.rs +++ b/src/unix/bsd/netbsdlike/mod.rs @@ -637,6 +637,16 @@ extern { groups: *mut ::gid_t, ngroups: *mut ::c_int) -> ::c_int; pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::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; + #[cfg_attr(target_os = "netbsd", link_name = "__getgrent_r50")] + pub fn getgrent_r(grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group) -> ::c_int; pub fn fexecve(fd: ::c_int, argv: *const *const ::c_char, envp: *const *const ::c_char) -> ::c_int; diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index ff659fadc963f..e495dc2d18f45 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -1,7 +1,6 @@ //! Linux-specific definitions for linux-like values use dox::{mem, Option}; -use unix::group; pub type useconds_t = u32; pub type dev_t = u64; @@ -1471,7 +1470,7 @@ extern { pub fn getpwent() -> *mut passwd; pub fn setgrent(); pub fn endgrent(); - pub fn getgrent() -> *mut group; + pub fn getgrent() -> *mut ::group; pub fn setspent(); pub fn endspent(); pub fn getspent() -> *mut spwd; @@ -1831,18 +1830,6 @@ extern { buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut passwd) -> ::c_int; - #[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; #[cfg_attr(all(target_os = "macos", target_arch ="x86"), link_name = "sigwait$UNIX2003")] #[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")] diff --git a/src/unix/notbsd/linux/other/mod.rs b/src/unix/notbsd/linux/other/mod.rs index 252e149b315aa..88e0287121d94 100644 --- a/src/unix/notbsd/linux/other/mod.rs +++ b/src/unix/notbsd/linux/other/mod.rs @@ -867,6 +867,18 @@ extern { 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 ::unix::notbsd::linux::passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::unix::notbsd::linux::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; } cfg_if! { diff --git a/src/unix/solaris/mod.rs b/src/unix/solaris/mod.rs index 7b1850bccb61e..29edbcc68252d 100644 --- a/src/unix/solaris/mod.rs +++ b/src/unix/solaris/mod.rs @@ -1430,6 +1430,16 @@ extern { buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut passwd) -> ::c_int; + #[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 = "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; #[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")] pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; From 0f24a662b0a4df7c00599d9988c764614a56e686 Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Sun, 4 Mar 2018 10:41:02 +0000 Subject: [PATCH 5/8] Fix long line --- src/unix/notbsd/linux/other/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/unix/notbsd/linux/other/mod.rs b/src/unix/notbsd/linux/other/mod.rs index 88e0287121d94..b566a95577bd1 100644 --- a/src/unix/notbsd/linux/other/mod.rs +++ b/src/unix/notbsd/linux/other/mod.rs @@ -872,7 +872,8 @@ extern { pub fn getpwent_r(pwd: *mut ::unix::notbsd::linux::passwd, buf: *mut ::c_char, buflen: ::size_t, - result: *mut *mut ::unix::notbsd::linux::passwd) -> ::c_int; + result: *mut *mut ::unix::notbsd + ::linux::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, From 99869e02ec25d3ae5b9021586a30b837b383607c Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Sun, 4 Mar 2018 10:48:39 +0000 Subject: [PATCH 6/8] Fix failure to document for Open/NetBSD --- src/unix/bsd/netbsdlike/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs index 866374374b70b..95393eac47a0d 100644 --- a/src/unix/bsd/netbsdlike/mod.rs +++ b/src/unix/bsd/netbsdlike/mod.rs @@ -638,10 +638,10 @@ extern { ngroups: *mut ::c_int) -> ::c_int; pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int; #[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")] - pub fn getpwent_r(pwd: *mut passwd, + pub fn getpwent_r(pwd: *mut ::passwd, buf: *mut ::c_char, buflen: ::size_t, - result: *mut *mut passwd) -> ::c_int; + result: *mut *mut ::passwd) -> ::c_int; #[cfg_attr(target_os = "netbsd", link_name = "__getgrent_r50")] pub fn getgrent_r(grp: *mut ::group, buf: *mut ::c_char, From 6d959f1a53d7a99e55252d81b71cc8948439e023 Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Sun, 4 Mar 2018 13:11:04 +0000 Subject: [PATCH 7/8] Fix BSD errors (hopefully) --- libc-test/build.rs | 3 +++ src/unix/bsd/netbsdlike/mod.rs | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index 755fa5509e73f..c2394c75559a8 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -664,6 +664,9 @@ fn main() { // the symbol. "uname" if freebsd => true, + // FIXME: need to upgrade FreeBSD version; see https://github.com/rust-lang/libc/issues/938 + "setgrent" if freebsd => true, + // aio_waitcomplete's return type changed between FreeBSD 10 and 11. "aio_waitcomplete" if freebsd => true, diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs index 95393eac47a0d..397fce7ddd6b2 100644 --- a/src/unix/bsd/netbsdlike/mod.rs +++ b/src/unix/bsd/netbsdlike/mod.rs @@ -642,7 +642,6 @@ extern { buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut ::passwd) -> ::c_int; - #[cfg_attr(target_os = "netbsd", link_name = "__getgrent_r50")] pub fn getgrent_r(grp: *mut ::group, buf: *mut ::c_char, buflen: ::size_t, From d058e0c87a67fd7ecd07d5791a93ad0bb05c4aff Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Mon, 5 Mar 2018 02:52:46 +0000 Subject: [PATCH 8/8] Refresh Cargo.lock --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f4d76699f0be6..df8cb99ed8565 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -109,12 +109,12 @@ name = "num-traits" version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-traits" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -187,7 +187,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -311,7 +311,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2" "checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" -"checksum num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e7de20f146db9d920c45ee8ed8f71681fd9ade71909b48c3acbd766aa504cf10" +"checksum num-traits 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3c2bd9b9d21e48e956b763c9f37134dc62d9e95da6edb3f672cacb6caf3cd3" "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" "checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" "checksum rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a54aa04a10c68c1c4eacb4337fd883b435997ede17a9385784b990777686b09a"