From 6aa9095865017c06a61f0cb10c1f1231a89b761c Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Sun, 21 Feb 2016 19:23:11 -0500 Subject: Implement fgetattr and read --- src/posix_extras.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/posix_extras.h') diff --git a/src/posix_extras.h b/src/posix_extras.h index a73f9fe..5571da6 100644 --- a/src/posix_extras.h +++ b/src/posix_extras.h @@ -15,8 +15,10 @@ #ifndef POSIX_EXTRAS_H_ #define POSIX_EXTRAS_H_ +#include #include #include +#include #include #include @@ -78,6 +80,11 @@ class File { } File OpenAt(const char* path, int flags, mode_t mode) const; + // Reads exactly the specified number of bytes from the file at the given + // offset, unless doing so would run past the end of the file, in which case + // fewer bytes are returned. + std::vector Read(off_t, size_t) const; + // Removes the file at the path relative to the file descriptor. The path // must indeed be relative (i.e., it must not start with '/'). void UnlinkAt(const char* path) const; -- cgit v1.2.3