Skip to content

Commit 6b20b37

Browse files
committed
getpwent_r() and getgrent_r() exists in NetBSD, but not in OpenBSD and Bitrig.
1 parent 659de79 commit 6b20b37

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

src/unix/bsd/netbsdlike/mod.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -637,15 +637,6 @@ extern {
637637
groups: *mut ::gid_t,
638638
ngroups: *mut ::c_int) -> ::c_int;
639639
pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
640-
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
641-
pub fn getpwent_r(pwd: *mut ::passwd,
642-
buf: *mut ::c_char,
643-
buflen: ::size_t,
644-
result: *mut *mut ::passwd) -> ::c_int;
645-
pub fn getgrent_r(grp: *mut ::group,
646-
buf: *mut ::c_char,
647-
buflen: ::size_t,
648-
result: *mut *mut ::group) -> ::c_int;
649640
pub fn fexecve(fd: ::c_int, argv: *const *const ::c_char,
650641
envp: *const *const ::c_char)
651642
-> ::c_int;

src/unix/bsd/netbsdlike/netbsd/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,5 +1074,18 @@ extern {
10741074
pub fn settimeofday(tv: *const ::timeval, tz: *const ::c_void) -> ::c_int;
10751075
}
10761076

1077+
#[link(name = "util")]
1078+
extern {
1079+
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
1080+
pub fn getpwent_r(pwd: *mut ::passwd,
1081+
buf: *mut ::c_char,
1082+
buflen: ::size_t,
1083+
result: *mut *mut ::passwd) -> ::c_int;
1084+
pub fn getgrent_r(grp: *mut ::group,
1085+
buf: *mut ::c_char,
1086+
buflen: ::size_t,
1087+
result: *mut *mut ::group) -> ::c_int;
1088+
}
1089+
10771090
mod other;
10781091
pub use self::other::*;

0 commit comments

Comments
 (0)