summaryrefslogtreecommitdiff
path: root/test/misc/tst-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 /test/misc/tst-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 'test/misc/tst-statvfs.c')
-rw-r--r--test/misc/tst-statvfs.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/misc/tst-statvfs.c b/test/misc/tst-statvfs.c
new file mode 100644
index 000000000..c1e8fde4e
--- /dev/null
+++ b/test/misc/tst-statvfs.c
@@ -0,0 +1,28 @@
+#define _FILE_OFFSET_BITS 64
+
+#include <sys/statvfs.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main(int argc, char* argv[])
+{
+ struct statvfs s;
+ int i;
+
+ for (i = 1; i < argc; i++) {
+ if (statvfs(argv[i], &s) != 0) {
+ fprintf(stderr, "%s: %s: statvfs failed. %s\n",
+ *argv, argv[i], strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+ printf("statvfs %s:\n\tblocks=%lld\n\tblkfree=%lld\n\tbsize=%d\n",
+ argv[i], s.f_blocks, s.f_bfree, s.f_bsize);
+#if 1 // def _STATFS_F_FRSIZE
+ printf("\tfrsize=%lld\n", s.f_frsize);
+#endif
+ }
+ exit(EXIT_SUCCESS);
+}