diff options
Diffstat (limited to 'fs.c')
-rw-r--r-- | fs.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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); +} |