OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
6 #if defined(HOST_OS_ANDROID) | 6 #if defined(HOST_OS_ANDROID) |
7 | 7 |
8 #include "bin/file.h" | 8 #include "bin/file.h" |
9 | 9 |
10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 return NO_RETRY_EXPECTED(lseek64(handle_->fd(), 0, SEEK_CUR)); | 146 return NO_RETRY_EXPECTED(lseek64(handle_->fd(), 0, SEEK_CUR)); |
147 } | 147 } |
148 | 148 |
149 | 149 |
150 bool File::SetPosition(int64_t position) { | 150 bool File::SetPosition(int64_t position) { |
151 ASSERT(handle_->fd() >= 0); | 151 ASSERT(handle_->fd() >= 0); |
152 return NO_RETRY_EXPECTED(lseek64(handle_->fd(), position, SEEK_SET)) >= 0; | 152 return NO_RETRY_EXPECTED(lseek64(handle_->fd(), position, SEEK_SET)) >= 0; |
153 } | 153 } |
154 | 154 |
155 | 155 |
156 // There is no difference between binary and text translation modes on this | |
157 // platform, so this operation is a no-op. | |
158 void File::SetTranslation(DartFileTranslation translation) {} | |
159 | |
160 | |
161 bool File::Truncate(int64_t length) { | 156 bool File::Truncate(int64_t length) { |
162 ASSERT(handle_->fd() >= 0); | 157 ASSERT(handle_->fd() >= 0); |
163 return TEMP_FAILURE_RETRY(ftruncate(handle_->fd(), length) != -1); | 158 return TEMP_FAILURE_RETRY(ftruncate(handle_->fd(), length) != -1); |
164 } | 159 } |
165 | 160 |
166 | 161 |
167 bool File::Flush() { | 162 bool File::Flush() { |
168 ASSERT(handle_->fd() >= 0); | 163 ASSERT(handle_->fd() >= 0); |
169 return NO_RETRY_EXPECTED(fsync(handle_->fd()) != -1); | 164 return NO_RETRY_EXPECTED(fsync(handle_->fd()) != -1); |
170 } | 165 } |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 return ((file_1_info.st_ino == file_2_info.st_ino) && | 597 return ((file_1_info.st_ino == file_2_info.st_ino) && |
603 (file_1_info.st_dev == file_2_info.st_dev)) | 598 (file_1_info.st_dev == file_2_info.st_dev)) |
604 ? File::kIdentical | 599 ? File::kIdentical |
605 : File::kDifferent; | 600 : File::kDifferent; |
606 } | 601 } |
607 | 602 |
608 } // namespace bin | 603 } // namespace bin |
609 } // namespace dart | 604 } // namespace dart |
610 | 605 |
611 #endif // defined(HOST_OS_ANDROID) | 606 #endif // defined(HOST_OS_ANDROID) |
OLD | NEW |