about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-02-22 03:08:39 +0000
committerbors <bors@rust-lang.org>2016-02-22 03:08:39 +0000
commit19437bd452208899a611fa48f5157d2ee9820c35 (patch)
treec71442c70f138b7e06537a21df0cf4306bf2b1d9 /src/libstd/sys
parent24bb648d8442a636bbe2cb6f06bb2b43d2e14bab (diff)
parent7e962166dfa1c55489d9637d829cb8e16f6de32a (diff)
Auto merge of #31805 - cuviper:android-lfs, r=alexcrichton
Android should use 64-bit LFS symbols for `lseek` and `ftruncate`, lest
those offset parameters suffer a lossy cast down to a 32-bit `off_t`.

Unlike GNU/Linux, Android's `stat`, `dirent`, and related functions are
always 64-bit LFS compatible, and `open` already implies `O_LARGEFILE`,
so all those don't need to follow Linux.  It might be nice to unify them
anyway, but those other LFS symbols aren't present in API 18 bionic.

r? @alexcrichton
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/unix/fs.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs
index 74393696e5e..250b1b015a0 100644
--- a/src/libstd/sys/unix/fs.rs
+++ b/src/libstd/sys/unix/fs.rs
@@ -27,7 +27,10 @@ use sys_common::{AsInner, FromInner};
 
 #[cfg(target_os = "linux")]
 use libc::{stat64, fstat64, lstat64, off64_t, ftruncate64, lseek64, dirent64, readdir64_r, open64};
-#[cfg(not(target_os = "linux"))]
+#[cfg(target_os = "android")]
+use libc::{stat as stat64, fstat as fstat64, lstat as lstat64, off64_t, ftruncate64, lseek64,
+           dirent as dirent64, open as open64};
+#[cfg(not(any(target_os = "linux", target_os = "android")))]
 use libc::{stat as stat64, fstat as fstat64, lstat as lstat64, off_t as off64_t,
            ftruncate as ftruncate64, lseek as lseek64, dirent as dirent64, open as open64};
 #[cfg(not(any(target_os = "linux", target_os = "solaris")))]