| 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 // There is no difference between binary and text translation modes on this |
| 116 // platform, so this operation is a no-op. |
| 117 void File::SetTranslation(DartFileTranslation translation) {} |
| 118 |
| 119 |
| 115 bool File::Truncate(int64_t length) { | 120 bool File::Truncate(int64_t length) { |
| 116 ASSERT(handle_->fd() >= 0); | 121 ASSERT(handle_->fd() >= 0); |
| 117 return NO_RETRY_EXPECTED(ftruncate(handle_->fd(), length) != -1); | 122 return NO_RETRY_EXPECTED(ftruncate(handle_->fd(), length) != -1); |
| 118 } | 123 } |
| 119 | 124 |
| 120 | 125 |
| 121 bool File::Flush() { | 126 bool File::Flush() { |
| 122 ASSERT(handle_->fd() >= 0); | 127 ASSERT(handle_->fd() >= 0); |
| 123 return NO_RETRY_EXPECTED(fsync(handle_->fd())) != -1; | 128 return NO_RETRY_EXPECTED(fsync(handle_->fd())) != -1; |
| 124 } | 129 } |
| (...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) && | 556 return ((file_1_info.st_ino == file_2_info.st_ino) && |
| 552 (file_1_info.st_dev == file_2_info.st_dev)) | 557 (file_1_info.st_dev == file_2_info.st_dev)) |
| 553 ? File::kIdentical | 558 ? File::kIdentical |
| 554 : File::kDifferent; | 559 : File::kDifferent; |
| 555 } | 560 } |
| 556 | 561 |
| 557 } // namespace bin | 562 } // namespace bin |
| 558 } // namespace dart | 563 } // namespace dart |
| 559 | 564 |
| 560 #endif // defined(TARGET_OS_FUCHSIA) | 565 #endif // defined(TARGET_OS_FUCHSIA) |
| OLD | NEW |