summaryrefslogtreecommitdiff
path: root/libc/misc/statfs/internal_statvfs.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2013-01-17 22:44:00 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2013-01-17 22:44:00 +0100
commitbcf1bfabdef4481d4748e6c4a82b579af628fd75 (patch)
tree8da8ac1bd99cc996fb3ab725405a7bb06bdca776 /libc/misc/statfs/internal_statvfs.c
parent1e2e4ac6193ffe0900bd392fa3c596883771eb34 (diff)
statfs: support f_frsize
closes bugzilla #5834 Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/misc/statfs/internal_statvfs.c')
-rw-r--r--libc/misc/statfs/internal_statvfs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libc/misc/statfs/internal_statvfs.c b/libc/misc/statfs/internal_statvfs.c
index 6eb4afe5a..29890d490 100644
--- a/libc/misc/statfs/internal_statvfs.c
+++ b/libc/misc/statfs/internal_statvfs.c
@@ -18,8 +18,12 @@
/* Now fill in the fields we have information for. */
buf->f_bsize = fsbuf.f_bsize;
- /* Linux does not support f_frsize, so set it to the full block size. */
+#ifdef _STATFS_F_FRSIZE
+ buf->f_frsize = fsbuf.f_frsize;
+#else
+ /* No support for f_frsize so set it to the full block size. */
buf->f_frsize = fsbuf.f_bsize;
+#endif
buf->f_blocks = fsbuf.f_blocks;
buf->f_bfree = fsbuf.f_bfree;
buf->f_bavail = fsbuf.f_bavail;
@@ -38,7 +42,7 @@
buf->__f_unused = 0;
#endif
buf->f_namemax = fsbuf.f_namelen;
- memset (buf->__f_spare, '\0', 6 * sizeof (int));
+ memset (buf->__f_spare, '\0', sizeof(fsbuf.f_spare));
/* What remains to do is to fill the fields f_favail and f_flag. */