diff options
author | bors <bors@rust-lang.org> | 2018-03-07 16:27:40 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2018-03-07 16:27:40 +0000 |
commit | 30c205c7b1d4ec8d53c16331fe5c90c188301484 (patch) | |
tree | 22e8e60fa1e49e7aefb3e64f2e41e81cd3563217 | |
parent | 659de79564b32dedfbcef47f0779372402738885 (diff) | |
parent | 6b20b3761cbe4ce3e0a38ba94f7a4382e484516b (diff) | |
download | rust-libc-30c205c7b1d4ec8d53c16331fe5c90c188301484.tar.gz |
Auto merge of #944 - wictory:invalid_functions_in_openbsd, r=alexcrichton
getpwent_r() and getgrent_r() doesn't exist in OpenBSD and Bitrig
-rw-r--r-- | src/unix/bsd/netbsdlike/mod.rs | 9 | ||||
-rw-r--r-- | src/unix/bsd/netbsdlike/netbsd/mod.rs | 13 |
2 files changed, 13 insertions, 9 deletions
diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs index 397fce7ddd..647e25dc0f 100644 --- a/src/unix/bsd/netbsdlike/mod.rs +++ b/src/unix/bsd/netbsdlike/mod.rs @@ -637,15 +637,6 @@ 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; - 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/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index 4c528b568e..e4c4ea1d14 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -1074,5 +1074,18 @@ extern { pub fn settimeofday(tv: *const ::timeval, tz: *const ::c_void) -> ::c_int; } +#[link(name = "util")] +extern { + #[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; +} + mod other; pub use self::other::*; |