| 737 | bool MemoryMappedFile::supports_zero_copy() const { return true; } |
| 738 | |
| 739 | Status MemoryMappedFile::WriteAt(int64_t position, const void* data, int64_t nbytes) { |
| 740 | RETURN_NOT_OK(memory_map_->CheckClosed()); |
| 741 | std::lock_guard<std::mutex> guard(memory_map_->write_lock()); |
| 742 | |
| 743 | if (!memory_map_->opened() || !memory_map_->writable()) { |
| 744 | return Status::IOError("Unable to write"); |
| 745 | } |
| 746 | RETURN_NOT_OK(internal::ValidateWriteRange(position, nbytes, memory_map_->size())); |
| 747 | |
| 748 | RETURN_NOT_OK(memory_map_->Seek(position)); |
| 749 | return WriteInternal(data, nbytes); |
| 750 | } |
| 751 | |
| 752 | Status MemoryMappedFile::Write(const void* data, int64_t nbytes) { |
| 753 | RETURN_NOT_OK(memory_map_->CheckClosed()); |