diff options
author | Nikita Baksalyar <nikita.baksalyar@gmail.com> | 2016-01-17 22:17:20 +0300 |
---|---|---|
committer | Nikita Baksalyar <nikita.baksalyar@gmail.com> | 2016-01-17 22:17:20 +0300 |
commit | bff38929aff779a3fd02645cdd19bb34ba8cf89b (patch) | |
tree | f3c6846c6785733260b50ee75a62af60ff2990fc /src | |
parent | 7fa6dea8211d2006e5185909d34c6f7e7eff1f7b (diff) | |
download | rust-libc-bff38929aff779a3fd02645cdd19bb34ba8cf89b.tar.gz |
Move getpwuid_r definition to platform-specific modules
Diffstat (limited to 'src')
-rw-r--r-- | src/unix/bsd/mod.rs | 6 | ||||
-rw-r--r-- | src/unix/mod.rs | 7 | ||||
-rw-r--r-- | src/unix/notbsd/mod.rs | 5 |
3 files changed, 11 insertions, 7 deletions
diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index 175267ceaf..704a7bdb62 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -326,6 +326,12 @@ extern { pub fn kqueue() -> ::c_int; pub fn unmount(target: *const ::c_char, arg: ::c_int) -> ::c_int; pub fn syscall(num: ::c_int, ...) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")] + pub fn getpwuid_r(uid: ::uid_t, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd) -> ::c_int; } cfg_if! { diff --git a/src/unix/mod.rs b/src/unix/mod.rs index c819d0745d..f5ae3519aa 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -620,13 +620,6 @@ extern { addrlen: *mut socklen_t) -> ::ssize_t; pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int; - #[cfg(not(target_os = "sunos"))] - #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")] - pub fn getpwuid_r(uid: ::uid_t, - pwd: *mut passwd, - buf: *mut ::c_char, - buflen: ::size_t, - result: *mut *mut passwd) -> ::c_int; #[cfg_attr(target_os = "netbsd", link_name = "__sigemptyset14")] pub fn sigemptyset(set: *mut sigset_t) -> ::c_int; #[cfg_attr(target_os = "netbsd", link_name = "__sigaddset14")] diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs index 7306a3eb18..5920c4b61b 100644 --- a/src/unix/notbsd/mod.rs +++ b/src/unix/notbsd/mod.rs @@ -566,6 +566,11 @@ f! { } extern { + pub fn getpwuid_r(uid: ::uid_t, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd) -> ::c_int; pub fn fdatasync(fd: ::c_int) -> ::c_int; pub fn mincore(addr: *mut ::c_void, len: ::size_t, vec: *mut ::c_uchar) -> ::c_int; |