]>
Commit | Line | Data |
---|---|---|
a14f121d | 1 | #include <stdio.h> |
92861d93 | 2 | #include <sys/statfs.h> |
a14f121d | 3 | #include <sys/statvfs.h> |
92861d93 | 4 | #include <support/check.h> |
a14f121d UD |
5 | |
6 | ||
7 | /* This test cannot detect many errors. But it will fail if the | |
8 | statvfs is completely hosed and it'll detect a missing export. So | |
9 | it is better than nothing. */ | |
10 | static int | |
11 | do_test (int argc, char *argv[]) | |
12 | { | |
13 | for (int i = 1; i < argc; ++i) | |
14 | { | |
15 | struct statvfs st; | |
92861d93 | 16 | struct statfs stf; |
17 | TEST_COMPARE (statvfs (argv[i], &st), 0); | |
18 | TEST_COMPARE (statfs (argv[i], &stf), 0); | |
8c4e4633 | 19 | TEST_COMPARE (st.f_type, (unsigned int) stf.f_type); |
92861d93 | 20 | printf ("%s: free: %llu, mandatory: %s, tp=%x\n", argv[i], |
21 | (unsigned long long int) st.f_bfree, | |
a14f121d | 22 | #ifdef ST_MANDLOCK |
92861d93 | 23 | (st.f_flag & ST_MANDLOCK) ? "yes" : "no", |
a14f121d | 24 | #else |
92861d93 | 25 | "no", |
a14f121d | 26 | #endif |
92861d93 | 27 | st.f_type); |
a14f121d UD |
28 | } |
29 | return 0; | |
30 | } | |
31 | ||
32 | #define TEST_FUNCTION do_test (argc, argv) | |
33 | #include "../test-skeleton.c" |