Magellan Linux

Contents of /trunk/mkinitrd-magellan/klibc/usr/klibc/tests/statfs.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1297 - (show annotations) (download)
Fri May 27 15:12:11 2011 UTC (12 years, 11 months ago) by niro
File MIME type: text/plain
File size: 840 byte(s)
-updated to klibc-1.5.22 with mntproc definitions patch included
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <sys/vfs.h>
4
5 static void do_statfs(const char *path)
6 {
7 struct statfs sfs;
8
9 if (statfs(path, &sfs)) {
10 perror(path);
11 exit(1);
12 }
13
14 printf("Path = %s\n"
15 " f_type = %#jx\n"
16 " f_bsize = %jd\n"
17 " f_blocks = %jd\n"
18 " f_bfree = %jd\n"
19 " f_bavail = %jd\n"
20 " f_files = %jd\n"
21 " f_ffree = %jd\n"
22 " f_namelen = %jd\n",
23 path,
24 (uintmax_t) sfs.f_type,
25 (intmax_t) sfs.f_bsize,
26 (intmax_t) sfs.f_blocks,
27 (intmax_t) sfs.f_bfree,
28 (intmax_t) sfs.f_bavail,
29 (intmax_t) sfs.f_files,
30 (intmax_t) sfs.f_ffree, (intmax_t) sfs.f_namelen);
31 }
32
33 int main(int argc, char *argv[])
34 {
35 int i;
36
37 for (i = 1; i < argc; i++)
38 do_statfs(argv[i]);
39
40 return 0;
41 }