Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Update.
* sysdeps/unix/sysv/linux/internal_statvfs.c (__internal_statvfs): Avoid infinite loops in case the mounts file is hosed. * io/Makefile: Add rules to build and run tst-statvfs. * io/tst-statvfs.c: New file.
- Loading branch information
Ulrich Drepper
committed
Oct 27, 2003
1 parent
5a4b507
commit a14f121
Showing
4 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include <stdio.h> | ||
#include <sys/statvfs.h> | ||
|
||
|
||
/* This test cannot detect many errors. But it will fail if the | ||
statvfs is completely hosed and it'll detect a missing export. So | ||
it is better than nothing. */ | ||
static int | ||
do_test (int argc, char *argv[]) | ||
{ | ||
for (int i = 1; i < argc; ++i) | ||
{ | ||
struct statvfs st; | ||
if (statvfs (argv[i], &st) != 0) | ||
printf ("%s: failed (%m)\n", argv[i]); | ||
else | ||
printf ("%s: free: %llu, mandatory: %s\n", argv[i], | ||
(unsigned long long int) st.f_bfree, | ||
#ifdef ST_MANDLOCK | ||
(st.f_flag & ST_MANDLOCK) ? "yes" : "no" | ||
#else | ||
"no" | ||
#endif | ||
); | ||
} | ||
return 0; | ||
} | ||
|
||
#define TEST_FUNCTION do_test (argc, argv) | ||
#include "../test-skeleton.c" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters