Index: runtime/bin/file_android.cc |
diff --git a/runtime/bin/file_android.cc b/runtime/bin/file_android.cc |
index 75d40026cfea8c76bf926d9fb86da22457a0a4ba..917e83e01bc8b51d099bd8f67daaebfd3eb85e73 100644 |
--- a/runtime/bin/file_android.cc |
+++ b/runtime/bin/file_android.cc |
@@ -88,7 +88,7 @@ bool File::SetPosition(off64_t position) { |
bool File::Truncate(off64_t length) { |
ASSERT(handle_->fd() >= 0); |
- return TEMP_FAILURE_RETRY(ftruncate64(handle_->fd(), length) != -1); |
+ return TEMP_FAILURE_RETRY(ftruncate(handle_->fd(), length) != -1); |
} |
@@ -100,8 +100,8 @@ bool File::Flush() { |
off64_t File::Length() { |
ASSERT(handle_->fd() >= 0); |
- struct stat64 st; |
- if (TEMP_FAILURE_RETRY(fstat64(handle_->fd(), &st)) == 0) { |
+ struct stat st; |
+ if (TEMP_FAILURE_RETRY(fstat(handle_->fd(), &st)) == 0) { |
return st.st_size; |
} |
return -1; |
@@ -110,8 +110,8 @@ off64_t File::Length() { |
File* File::Open(const char* name, FileOpenMode mode) { |
// Report errors for non-regular files. |
- struct stat64 st; |
- if (TEMP_FAILURE_RETRY(stat64(name, &st)) == 0) { |
+ struct stat st; |
+ if (TEMP_FAILURE_RETRY(stat(name, &st)) == 0) { |
if (!S_ISREG(st.st_mode)) { |
errno = (S_ISDIR(st.st_mode)) ? EISDIR : ENOENT; |
return NULL; |
@@ -125,7 +125,7 @@ File* File::Open(const char* name, FileOpenMode mode) { |
flags = flags | O_TRUNC; |
} |
flags |= O_CLOEXEC; |
- int fd = TEMP_FAILURE_RETRY(open64(name, flags, 0666)); |
+ int fd = TEMP_FAILURE_RETRY(open(name, flags, 0666)); |
if (fd < 0) { |
return NULL; |
} |
@@ -146,8 +146,8 @@ File* File::OpenStdio(int fd) { |
bool File::Exists(const char* name) { |
- struct stat64 st; |
- if (TEMP_FAILURE_RETRY(stat64(name, &st)) == 0) { |
+ struct stat st; |
+ if (TEMP_FAILURE_RETRY(stat(name, &st)) == 0) { |
return S_ISREG(st.st_mode); |
} else { |
return false; |
@@ -156,8 +156,7 @@ bool File::Exists(const char* name) { |
bool File::Create(const char* name) { |
- int fd = TEMP_FAILURE_RETRY( |
- open64(name, O_RDONLY | O_CREAT | O_CLOEXEC, 0666)); |
+ int fd = TEMP_FAILURE_RETRY(open(name, O_RDONLY | O_CREAT | O_CLOEXEC, 0666)); |
if (fd < 0) { |
return false; |
} |
@@ -221,8 +220,8 @@ bool File::RenameLink(const char* old_path, const char* new_path) { |
off64_t File::LengthFromPath(const char* name) { |
- struct stat64 st; |
- if (TEMP_FAILURE_RETRY(stat64(name, &st)) == 0) { |
+ struct stat st; |
+ if (TEMP_FAILURE_RETRY(stat(name, &st)) == 0) { |
return st.st_size; |
} |
return -1; |
@@ -230,8 +229,8 @@ off64_t File::LengthFromPath(const char* name) { |
void File::Stat(const char* name, int64_t* data) { |
- struct stat64 st; |
- if (TEMP_FAILURE_RETRY(stat64(name, &st)) == 0) { |
+ struct stat st; |
+ if (TEMP_FAILURE_RETRY(stat(name, &st)) == 0) { |
if (S_ISREG(st.st_mode)) { |
data[kType] = kIsFile; |
} else if (S_ISDIR(st.st_mode)) { |
@@ -253,8 +252,8 @@ void File::Stat(const char* name, int64_t* data) { |
time_t File::LastModified(const char* name) { |
- struct stat64 st; |
- if (TEMP_FAILURE_RETRY(stat64(name, &st)) == 0) { |
+ struct stat st; |
+ if (TEMP_FAILURE_RETRY(stat(name, &st)) == 0) { |
return st.st_mtime; |
} |
return -1; |
@@ -262,8 +261,8 @@ time_t File::LastModified(const char* name) { |
char* File::LinkTarget(const char* pathname) { |
- struct stat64 link_stats; |
- if (lstat64(pathname, &link_stats) != 0) return NULL; |
+ struct stat link_stats; |
+ if (lstat(pathname, &link_stats) != 0) return NULL; |
if (!S_ISLNK(link_stats.st_mode)) { |
errno = ENOENT; |
return NULL; |
@@ -316,8 +315,8 @@ const char* File::StringEscapedPathSeparator() { |
File::StdioHandleType File::GetStdioHandleType(int fd) { |
ASSERT(0 <= fd && fd <= 2); |
- struct stat64 buf; |
- int result = fstat64(fd, &buf); |
+ struct stat buf; |
+ int result = fstat(fd, &buf); |
if (result == -1) { |
const int kBufferSize = 1024; |
char error_message[kBufferSize]; |
@@ -333,12 +332,12 @@ File::StdioHandleType File::GetStdioHandleType(int fd) { |
File::Type File::GetType(const char* pathname, bool follow_links) { |
- struct stat64 entry_info; |
+ struct stat entry_info; |
int stat_success; |
if (follow_links) { |
- stat_success = TEMP_FAILURE_RETRY(stat64(pathname, &entry_info)); |
+ stat_success = TEMP_FAILURE_RETRY(stat(pathname, &entry_info)); |
} else { |
- stat_success = TEMP_FAILURE_RETRY(lstat64(pathname, &entry_info)); |
+ stat_success = TEMP_FAILURE_RETRY(lstat(pathname, &entry_info)); |
} |
if (stat_success == -1) return File::kDoesNotExist; |
if (S_ISDIR(entry_info.st_mode)) return File::kIsDirectory; |
@@ -349,10 +348,10 @@ File::Type File::GetType(const char* pathname, bool follow_links) { |
File::Identical File::AreIdentical(const char* file_1, const char* file_2) { |
- struct stat64 file_1_info; |
- struct stat64 file_2_info; |
- if (TEMP_FAILURE_RETRY(lstat64(file_1, &file_1_info)) == -1 || |
- TEMP_FAILURE_RETRY(lstat64(file_2, &file_2_info)) == -1) { |
+ struct stat file_1_info; |
+ struct stat file_2_info; |
+ if (TEMP_FAILURE_RETRY(lstat(file_1, &file_1_info)) == -1 || |
+ TEMP_FAILURE_RETRY(lstat(file_2, &file_2_info)) == -1) { |
return File::kError; |
} |
return (file_1_info.st_ino == file_2_info.st_ino && |