From 59199b562083b30cd546066fb138799d48a226bd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 26 Aug 2024 13:27:50 +0200 Subject: [PATCH] io/FileDescriptor: pass std::span to ReadAt() --- src/io/FileDescriptor.hxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/io/FileDescriptor.hxx b/src/io/FileDescriptor.hxx index a77488a4d..e31217e9a 100644 --- a/src/io/FileDescriptor.hxx +++ b/src/io/FileDescriptor.hxx @@ -236,9 +236,8 @@ public: #ifndef _WIN32 [[nodiscard]] - ssize_t ReadAt(off_t offset, - void *buffer, std::size_t length) const noexcept { - return ::pread(fd, buffer, length, offset); + ssize_t ReadAt(off_t offset, std::span dest) const noexcept { + return ::pread(fd, dest.data(), dest.size(), offset); } #endif