io/FileDescriptor: pass std::span to ReadAt()

This commit is contained in:
Max Kellermann 2024-08-26 13:27:50 +02:00 committed by Max Kellermann
parent ebfc83dac5
commit 59199b5620
1 changed files with 2 additions and 3 deletions

View File

@ -236,9 +236,8 @@ public:
#ifndef _WIN32 #ifndef _WIN32
[[nodiscard]] [[nodiscard]]
ssize_t ReadAt(off_t offset, ssize_t ReadAt(off_t offset, std::span<std::byte> dest) const noexcept {
void *buffer, std::size_t length) const noexcept { return ::pread(fd, dest.data(), dest.size(), offset);
return ::pread(fd, buffer, length, offset);
} }
#endif #endif