parent
62eb6056d3
commit
ebf70a9a20
1 changed files with 0 additions and 11 deletions
|
|
@ -483,7 +483,6 @@ pub fn home_dir() -> Option<PathBuf> {
|
|||
target_os = "nacl",
|
||||
target_os = "emscripten")))]
|
||||
unsafe fn fallback() -> Option<OsString> {
|
||||
#[cfg(not(target_os = "solaris"))]
|
||||
unsafe fn getpwduid_r(me: libc::uid_t, passwd: &mut libc::passwd,
|
||||
buf: &mut Vec<c_char>) -> Option<()> {
|
||||
let mut result = ptr::null_mut();
|
||||
|
|
@ -495,16 +494,6 @@ pub fn home_dir() -> Option<PathBuf> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "solaris")]
|
||||
unsafe fn getpwduid_r(me: libc::uid_t, passwd: &mut libc::passwd,
|
||||
buf: &mut Vec<c_char>) -> Option<()> {
|
||||
// getpwuid_r semantics is different on Illumos/Solaris:
|
||||
// http://illumos.org/man/3c/getpwuid_r
|
||||
let result = libc::getpwuid_r(me, passwd, buf.as_mut_ptr(),
|
||||
buf.capacity());
|
||||
if result.is_null() { None } else { Some(()) }
|
||||
}
|
||||
|
||||
let amt = match libc::sysconf(libc::_SC_GETPW_R_SIZE_MAX) {
|
||||
n if n < 0 => 512 as usize,
|
||||
n => n as usize,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue