aboutsummaryrefslogtreecommitdiff
path: root/src/posix_extras.cc
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@mit.edu>2016-02-21 23:05:22 -0500
committerGravatar Benjamin Barenblat <bbaren@mit.edu>2016-02-21 23:05:22 -0500
commitbdab511d954a849d06e34f6d801cc374f867213b (patch)
tree92df0982596d1957232ccde6722504f3f24c84c5 /src/posix_extras.cc
parent13643137642c5000924e20de56856c909b05769e (diff)
Implement statfs
Diffstat (limited to 'src/posix_extras.cc')
-rw-r--r--src/posix_extras.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/posix_extras.cc b/src/posix_extras.cc
index c0a5234..3e916ad 100644
--- a/src/posix_extras.cc
+++ b/src/posix_extras.cc
@@ -27,6 +27,7 @@
#include <glog/logging.h>
#include <stdio.h>
#include <sys/stat.h>
+#include <sys/statvfs.h>
#include <sys/types.h>
#include <unistd.h>
@@ -149,6 +150,12 @@ void File::RmDirAt(const char* const path) const {
CheckSyscall(unlinkat(fd_, path, AT_REMOVEDIR));
}
+struct statvfs File::StatVFs() const {
+ struct statvfs result;
+ CheckSyscall(fstatvfs(fd_, &result));
+ return result;
+}
+
void File::SymLinkAt(const char* const target, const char* const source) const {
ValidatePath(source);
CheckSyscall(symlinkat(target, fd_, source));