diff options
| author | bors <bors@rust-lang.org> | 2018-06-25 19:40:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-06-25 19:40:56 +0000 |
| commit | 2a1c4eec40527de45b9d9b81672c8b9220d554fc (patch) | |
| tree | 19044326985ca36bd51708cd52316962b9195f34 /src | |
| parent | b7c6e8f1805cd8a4b0a1c1f22f17a89e9e2cea23 (diff) | |
| parent | 65d31d726940fe87f95f497323de7473da51f229 (diff) | |
| download | rust-2a1c4eec40527de45b9d9b81672c8b9220d554fc.tar.gz rust-2a1c4eec40527de45b9d9b81672c8b9220d554fc.zip | |
Auto merge of #51785 - cuviper:fstatat64, r=Mark-Simulacrum
Use fstatat64 where available None
Diffstat (limited to 'src')
| -rw-r--r-- | src/libstd/sys/unix/fs.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index 774340388e1..6949e22c58f 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -25,10 +25,12 @@ use sys_common::{AsInner, FromInner}; #[cfg(any(target_os = "linux", target_os = "emscripten", target_os = "l4re"))] use libc::{stat64, fstat64, lstat64, off64_t, ftruncate64, lseek64, dirent64, readdir64_r, open64}; +#[cfg(any(target_os = "linux", target_os = "emscripten"))] +use libc::fstatat64; #[cfg(any(target_os = "linux", target_os = "emscripten", target_os = "android"))] -use libc::{fstatat, dirfd}; +use libc::dirfd; #[cfg(target_os = "android")] -use libc::{stat as stat64, fstat as fstat64, lstat as lstat64, lseek64, +use libc::{stat as stat64, fstat as fstat64, fstatat as fstatat64, lstat as lstat64, lseek64, dirent as dirent64, open as open64}; #[cfg(not(any(target_os = "linux", target_os = "emscripten", @@ -299,10 +301,7 @@ impl DirEntry { let fd = cvt(unsafe {dirfd(self.dir.0.dirp.0)})?; let mut stat: stat64 = unsafe { mem::zeroed() }; cvt(unsafe { - fstatat(fd, - self.entry.d_name.as_ptr(), - &mut stat as *mut _ as *mut _, - libc::AT_SYMLINK_NOFOLLOW) + fstatat64(fd, self.entry.d_name.as_ptr(), &mut stat, libc::AT_SYMLINK_NOFOLLOW) })?; Ok(FileAttr { stat: stat }) } |
