about summary refs log tree commit homepage
path: root/fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs.c')
-rw-r--r--fs.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/fs.c b/fs.c
index 1c51977..a0f1147 100644
--- a/fs.c
+++ b/fs.c
@@ -126,3 +126,16 @@ int mog_mkdir(struct mog_svc *svc, const char *path, mode_t mode)
         return mkdir(fspath, mode);
 }
 #endif /* !HAVE_MKDIRAT */
+
+int mog_statvfs(struct mog_svc *svc, struct mog_dev *dev, struct statvfs *v)
+{
+        char fspath[MY_PATHMAX];
+        int rc = snprintf(fspath, sizeof(fspath), "%s/dev%u",
+                          svc->docroot, dev->devid);
+
+        if (rc <= 0) {
+                errno = ENAMETOOLONG;
+                return -1;
+        }
+        return statvfs(fspath, v);
+}