io/FileDescriptor: add method WriteAt()
This commit is contained in:
parent
59199b5620
commit
c7b80b0828
|
@ -257,6 +257,13 @@ public:
|
||||||
*/
|
*/
|
||||||
void FullRead(std::span<std::byte> dest) const;
|
void FullRead(std::span<std::byte> dest) const;
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
[[nodiscard]]
|
||||||
|
ssize_t WriteAt(off_t offset, std::span<const std::byte> src) const noexcept {
|
||||||
|
return ::pwrite(fd, src.data(), src.size(), offset);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
ssize_t Write(std::span<const std::byte> src) const noexcept {
|
ssize_t Write(std::span<const std::byte> src) const noexcept {
|
||||||
return ::write(fd, src.data(), src.size());
|
return ::write(fd, src.data(), src.size());
|
||||||
|
|
Loading…
Reference in New Issue