getpwent_r() and getgrent_r() exists in NetBSD, but not in OpenBSD and Bitrig.

This commit is contained in:
Wictor Lund 2018-03-07 18:11:42 +02:00
parent 659de79564
commit 6b20b3761c
2 changed files with 13 additions and 9 deletions

View File

@ -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;

View File

@ -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::*;