summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWictor Lund <wlund@abo.fi>2018-03-07 18:11:42 +0200
committerWictor Lund <wlund@abo.fi>2018-03-07 18:16:37 +0200
commit6b20b3761cbe4ce3e0a38ba94f7a4382e484516b (patch)
tree22e8e60fa1e49e7aefb3e64f2e41e81cd3563217
parent659de79564b32dedfbcef47f0779372402738885 (diff)
downloadrust-libc-6b20b3761cbe4ce3e0a38ba94f7a4382e484516b.tar.gz
getpwent_r() and getgrent_r() exists in NetBSD, but not in OpenBSD and Bitrig.
-rw-r--r--src/unix/bsd/netbsdlike/mod.rs9
-rw-r--r--src/unix/bsd/netbsdlike/netbsd/mod.rs13
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::*;