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(HOST_OS_FUCHSIA) | 6 #if defined(HOST_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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 return NO_RETRY_EXPECTED(lseek(handle_->fd(), 0, SEEK_CUR)); | 126 return NO_RETRY_EXPECTED(lseek(handle_->fd(), 0, SEEK_CUR)); |
127 } | 127 } |
128 | 128 |
129 | 129 |
130 bool File::SetPosition(int64_t position) { | 130 bool File::SetPosition(int64_t position) { |
131 ASSERT(handle_->fd() >= 0); | 131 ASSERT(handle_->fd() >= 0); |
132 return NO_RETRY_EXPECTED(lseek(handle_->fd(), position, SEEK_SET)) >= 0; | 132 return NO_RETRY_EXPECTED(lseek(handle_->fd(), position, SEEK_SET)) >= 0; |
133 } | 133 } |
134 | 134 |
135 | 135 |
136 // There is no difference between binary and text translation modes on this | |
137 // platform, so this operation is a no-op. | |
138 void File::SetTranslation(DartFileTranslation translation) {} | |
139 | |
140 | |
141 bool File::Truncate(int64_t length) { | 136 bool File::Truncate(int64_t length) { |
142 ASSERT(handle_->fd() >= 0); | 137 ASSERT(handle_->fd() >= 0); |
143 return NO_RETRY_EXPECTED(ftruncate(handle_->fd(), length) != -1); | 138 return NO_RETRY_EXPECTED(ftruncate(handle_->fd(), length) != -1); |
144 } | 139 } |
145 | 140 |
146 | 141 |
147 bool File::Flush() { | 142 bool File::Flush() { |
148 ASSERT(handle_->fd() >= 0); | 143 ASSERT(handle_->fd() >= 0); |
149 return NO_RETRY_EXPECTED(fsync(handle_->fd())) != -1; | 144 return NO_RETRY_EXPECTED(fsync(handle_->fd())) != -1; |
150 } | 145 } |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 return ((file_1_info.st_ino == file_2_info.st_ino) && | 572 return ((file_1_info.st_ino == file_2_info.st_ino) && |
578 (file_1_info.st_dev == file_2_info.st_dev)) | 573 (file_1_info.st_dev == file_2_info.st_dev)) |
579 ? File::kIdentical | 574 ? File::kIdentical |
580 : File::kDifferent; | 575 : File::kDifferent; |
581 } | 576 } |
582 | 577 |
583 } // namespace bin | 578 } // namespace bin |
584 } // namespace dart | 579 } // namespace dart |
585 | 580 |
586 #endif // defined(HOST_OS_FUCHSIA) | 581 #endif // defined(HOST_OS_FUCHSIA) |
OLD | NEW |