diff options
author | Fredrick Brennan <copypaste@kittens.ph> | 2018-03-04 10:09:43 +0000 |
---|---|---|
committer | Fredrick Brennan <copypaste@kittens.ph> | 2018-03-04 10:09:43 +0000 |
commit | 6228556cfaed9768a764f1909c30b817cf0e145e (patch) | |
tree | 7a7a1bca05148217bffa6e5d61951d5a36923882 | |
parent | f59c095c5c891f1a4407c37521163a27e3902d44 (diff) | |
download | rust-libc-6228556cfaed9768a764f1909c30b817cf0e145e.tar.gz |
Fix issues raised by @gnzlbg
-rw-r--r-- | src/unix/bsd/mod.rs | 15 | ||||
-rw-r--r-- | src/unix/bsd/netbsdlike/mod.rs | 10 | ||||
-rw-r--r-- | src/unix/notbsd/linux/mod.rs | 15 | ||||
-rw-r--r-- | src/unix/notbsd/linux/other/mod.rs | 12 | ||||
-rw-r--r-- | 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 c7f670aa58..4d0539e7e0 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 647e25dc0f..866374374b 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 ff659fadc9..e495dc2d18 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 252e149b31..88e0287121 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 7b1850bccb..29edbcc682 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; |