Last change
on this file was 2036, checked in by bird, 20 years ago |
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
758 bytes
|
Line | |
---|
1 | #include <stdio.h>
|
---|
2 | #include <sys/statvfs.h>
|
---|
3 |
|
---|
4 |
|
---|
5 | /* This test cannot detect many errors. But it will fail if the
|
---|
6 | statvfs is completely hosed and it'll detect a missing export. So
|
---|
7 | it is better than nothing. */
|
---|
8 | static int
|
---|
9 | do_test (int argc, char *argv[])
|
---|
10 | {
|
---|
11 | for (int i = 1; i < argc; ++i)
|
---|
12 | {
|
---|
13 | struct statvfs st;
|
---|
14 | if (statvfs (argv[i], &st) != 0)
|
---|
15 | printf ("%s: failed (%m)\n", argv[i]);
|
---|
16 | else
|
---|
17 | printf ("%s: free: %llu, mandatory: %s\n", argv[i],
|
---|
18 | (unsigned long long int) st.f_bfree,
|
---|
19 | #ifdef ST_MANDLOCK
|
---|
20 | (st.f_flag & ST_MANDLOCK) ? "yes" : "no"
|
---|
21 | #else
|
---|
22 | "no"
|
---|
23 | #endif
|
---|
24 | );
|
---|
25 | }
|
---|
26 | return 0;
|
---|
27 | }
|
---|
28 |
|
---|
29 | #define TEST_FUNCTION do_test (argc, argv)
|
---|
30 | #include "../test-skeleton.c"
|
---|
Note:
See
TracBrowser
for help on using the repository browser.