| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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_FUCHSIA) | 6 #if defined(TARGET_OS_FUCHSIA) |
| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 return NO_RETRY_EXPECTED(lseek(handle_->fd(), 0, SEEK_CUR)); | 105 return NO_RETRY_EXPECTED(lseek(handle_->fd(), 0, SEEK_CUR)); |
| 106 } | 106 } |
| 107 | 107 |
| 108 | 108 |
| 109 bool File::SetPosition(int64_t position) { | 109 bool File::SetPosition(int64_t position) { |
| 110 ASSERT(handle_->fd() >= 0); | 110 ASSERT(handle_->fd() >= 0); |
| 111 return NO_RETRY_EXPECTED(lseek(handle_->fd(), position, SEEK_SET)) >= 0; | 111 return NO_RETRY_EXPECTED(lseek(handle_->fd(), position, SEEK_SET)) >= 0; |
| 112 } | 112 } |
| 113 | 113 |
| 114 | 114 |
| 115 void File::SetTranslation(DartFileTranslation translation) {} |
| 116 |
| 117 |
| 115 bool File::Truncate(int64_t length) { | 118 bool File::Truncate(int64_t length) { |
| 116 ASSERT(handle_->fd() >= 0); | 119 ASSERT(handle_->fd() >= 0); |
| 117 return NO_RETRY_EXPECTED(ftruncate(handle_->fd(), length) != -1); | 120 return NO_RETRY_EXPECTED(ftruncate(handle_->fd(), length) != -1); |
| 118 } | 121 } |
| 119 | 122 |
| 120 | 123 |
| 121 bool File::Flush() { | 124 bool File::Flush() { |
| 122 ASSERT(handle_->fd() >= 0); | 125 ASSERT(handle_->fd() >= 0); |
| 123 return NO_RETRY_EXPECTED(fsync(handle_->fd())) != -1; | 126 return NO_RETRY_EXPECTED(fsync(handle_->fd())) != -1; |
| 124 } | 127 } |
| (...skipping 426 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_FUCHSIA) | 563 #endif // defined(TARGET_OS_FUCHSIA) |
| OLD | NEW |