| 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(TARGET_OS_LINUX) | 6 #if defined(TARGET_OS_LINUX) |
| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 return NO_RETRY_EXPECTED(lseek64(handle_->fd(), 0, SEEK_CUR)); | 125 return NO_RETRY_EXPECTED(lseek64(handle_->fd(), 0, SEEK_CUR)); |
| 126 } | 126 } |
| 127 | 127 |
| 128 | 128 |
| 129 bool File::SetPosition(int64_t position) { | 129 bool File::SetPosition(int64_t position) { |
| 130 ASSERT(handle_->fd() >= 0); | 130 ASSERT(handle_->fd() >= 0); |
| 131 return NO_RETRY_EXPECTED(lseek64(handle_->fd(), position, SEEK_SET)) >= 0; | 131 return NO_RETRY_EXPECTED(lseek64(handle_->fd(), position, SEEK_SET)) >= 0; |
| 132 } | 132 } |
| 133 | 133 |
| 134 | 134 |
| 135 // There is no difference between binary and text translation modes on this |
| 136 // platform, so this operation is a no-op. |
| 137 void File::SetTranslation(DartFileTranslation translation) {} |
| 138 |
| 139 |
| 135 bool File::Truncate(int64_t length) { | 140 bool File::Truncate(int64_t length) { |
| 136 ASSERT(handle_->fd() >= 0); | 141 ASSERT(handle_->fd() >= 0); |
| 137 return TEMP_FAILURE_RETRY(ftruncate64(handle_->fd(), length) != -1); | 142 return TEMP_FAILURE_RETRY(ftruncate64(handle_->fd(), length) != -1); |
| 138 } | 143 } |
| 139 | 144 |
| 140 | 145 |
| 141 bool File::Flush() { | 146 bool File::Flush() { |
| 142 ASSERT(handle_->fd() >= 0); | 147 ASSERT(handle_->fd() >= 0); |
| 143 return NO_RETRY_EXPECTED(fsync(handle_->fd())) != -1; | 148 return NO_RETRY_EXPECTED(fsync(handle_->fd())) != -1; |
| 144 } | 149 } |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 return ((file_1_info.st_ino == file_2_info.st_ino) && | 594 return ((file_1_info.st_ino == file_2_info.st_ino) && |
| 590 (file_1_info.st_dev == file_2_info.st_dev)) | 595 (file_1_info.st_dev == file_2_info.st_dev)) |
| 591 ? File::kIdentical | 596 ? File::kIdentical |
| 592 : File::kDifferent; | 597 : File::kDifferent; |
| 593 } | 598 } |
| 594 | 599 |
| 595 } // namespace bin | 600 } // namespace bin |
| 596 } // namespace dart | 601 } // namespace dart |
| 597 | 602 |
| 598 #endif // defined(TARGET_OS_LINUX) | 603 #endif // defined(TARGET_OS_LINUX) |
| OLD | NEW |