diff options
Diffstat (limited to 'src/posix_extras.cc')
-rw-r--r-- | src/posix_extras.cc | 7 |
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)); |