io/FileDescriptor: add pread() wrapper
This commit is contained in:
parent
6913148d99
commit
69596106d3
|
@ -244,6 +244,12 @@ public:
|
|||
[[gnu::pure]]
|
||||
off_t GetSize() const noexcept;
|
||||
|
||||
#ifndef _WIN32
|
||||
ssize_t ReadAt(off_t offset, void *buffer, std::size_t length) noexcept {
|
||||
return ::pread(fd, buffer, length, offset);
|
||||
}
|
||||
#endif
|
||||
|
||||
ssize_t Read(void *buffer, std::size_t length) noexcept {
|
||||
return ::read(fd, buffer, length);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue