| 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_MACOS) | 6 #if defined(TARGET_OS_MACOS) |
| 7 | 7 |
| 8 #include "bin/file.h" | 8 #include "bin/file.h" |
| 9 | 9 |
| 10 #include <copyfile.h> // NOLINT | 10 #include <copyfile.h> // NOLINT |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 return lseek(handle_->fd(), 0, SEEK_CUR); | 127 return lseek(handle_->fd(), 0, SEEK_CUR); |
| 128 } | 128 } |
| 129 | 129 |
| 130 | 130 |
| 131 bool File::SetPosition(int64_t position) { | 131 bool File::SetPosition(int64_t position) { |
| 132 ASSERT(handle_->fd() >= 0); | 132 ASSERT(handle_->fd() >= 0); |
| 133 return lseek(handle_->fd(), position, SEEK_SET) >= 0; | 133 return lseek(handle_->fd(), position, SEEK_SET) >= 0; |
| 134 } | 134 } |
| 135 | 135 |
| 136 | 136 |
| 137 void File::SetTranslation(DartFileTranslation translation) {} |
| 138 |
| 139 |
| 137 bool File::Truncate(int64_t length) { | 140 bool File::Truncate(int64_t length) { |
| 138 ASSERT(handle_->fd() >= 0); | 141 ASSERT(handle_->fd() >= 0); |
| 139 return TEMP_FAILURE_RETRY(ftruncate(handle_->fd(), length)) != -1; | 142 return TEMP_FAILURE_RETRY(ftruncate(handle_->fd(), length)) != -1; |
| 140 } | 143 } |
| 141 | 144 |
| 142 | 145 |
| 143 bool File::Flush() { | 146 bool File::Flush() { |
| 144 ASSERT(handle_->fd() >= 0); | 147 ASSERT(handle_->fd() >= 0); |
| 145 return NO_RETRY_EXPECTED(fsync(handle_->fd())) != -1; | 148 return NO_RETRY_EXPECTED(fsync(handle_->fd())) != -1; |
| 146 } | 149 } |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 return ((file_1_info.st_ino == file_2_info.st_ino) && | 554 return ((file_1_info.st_ino == file_2_info.st_ino) && |
| 552 (file_1_info.st_dev == file_2_info.st_dev)) | 555 (file_1_info.st_dev == file_2_info.st_dev)) |
| 553 ? File::kIdentical | 556 ? File::kIdentical |
| 554 : File::kDifferent; | 557 : File::kDifferent; |
| 555 } | 558 } |
| 556 | 559 |
| 557 } // namespace bin | 560 } // namespace bin |
| 558 } // namespace dart | 561 } // namespace dart |
| 559 | 562 |
| 560 #endif // defined(TARGET_OS_MACOS) | 563 #endif // defined(TARGET_OS_MACOS) |
| OLD | NEW |