summaryrefslogtreecommitdiffstats
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/sys.cpp11
-rw-r--r--internal/sys.hpp8
2 files changed, 19 insertions, 0 deletions
diff --git a/internal/sys.cpp b/internal/sys.cpp
index 2e040ae..db843ac 100644
--- a/internal/sys.cpp
+++ b/internal/sys.cpp
@@ -50,6 +50,17 @@ int SysImpl::read(int fd, void* buf, std::size_t count) const
return static_cast<int>(::read(fd, buf, count));
}
+int SysImpl::pread(int fd, void* buf, std::size_t count, off_t offset) const
+{
+ return static_cast<int>(::pread(fd, buf, count, offset));
+}
+
+int SysImpl::pwrite(int fd, const void* buf, std::size_t count,
+ off_t offset) const
+{
+ return static_cast<int>(::pwrite(fd, buf, count, offset));
+}
+
int SysImpl::close(int fd) const
{
return ::close(fd);
diff --git a/internal/sys.hpp b/internal/sys.hpp
index 265d251..41fb46b 100644
--- a/internal/sys.hpp
+++ b/internal/sys.hpp
@@ -28,6 +28,10 @@ class Sys
virtual int open(const char* pathname, int flags) const = 0;
virtual int read(int fd, void* buf, std::size_t count) const = 0;
+ virtual int pread(int fd, void* buf, std::size_t count,
+ off_t offset) const = 0;
+ virtual int pwrite(int fd, const void* buf, std::size_t count,
+ off_t offset) const = 0;
virtual int close(int fd) const = 0;
virtual void* mmap(void* addr, std::size_t length, int prot, int flags,
int fd, off_t offset) const = 0;
@@ -48,6 +52,10 @@ class SysImpl : public Sys
public:
int open(const char* pathname, int flags) const override;
int read(int fd, void* buf, std::size_t count) const override;
+ int pread(int fd, void* buf, std::size_t count,
+ off_t offset) const override;
+ int pwrite(int fd, const void* buf, std::size_t count,
+ off_t offset) const override;
int close(int fd) const override;
void* mmap(void* addr, std::size_t length, int prot, int flags, int fd,
off_t offset) const override;
OpenPOWER on IntegriCloud