Contents of /trunk/mkinitrd-magellan/klibc/usr/klibc/tests/statfs.c
Parent Directory | Revision Log
Revision 532 -
(show annotations)
(download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 8 months ago) by niro
File MIME type: text/plain
File size: 859 byte(s)
Sat Sep 1 22:45:15 2007 UTC (16 years, 8 months ago) by niro
File MIME type: text/plain
File size: 859 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd
1 | #include <stdio.h> |
2 | #include <stdlib.h> |
3 | #include <errno.h> |
4 | #include <sys/vfs.h> |
5 | |
6 | static void do_statfs(const char *path) |
7 | { |
8 | struct statfs sfs; |
9 | |
10 | if (statfs(path, &sfs)) { |
11 | perror(path); |
12 | exit(1); |
13 | } |
14 | |
15 | printf("Path = %s\n" |
16 | " f_type = %#jx\n" |
17 | " f_bsize = %jd\n" |
18 | " f_blocks = %jd\n" |
19 | " f_bfree = %jd\n" |
20 | " f_bavail = %jd\n" |
21 | " f_files = %jd\n" |
22 | " f_ffree = %jd\n" |
23 | " f_namelen = %jd\n", |
24 | path, |
25 | (uintmax_t) sfs.f_type, |
26 | (intmax_t) sfs.f_bsize, |
27 | (intmax_t) sfs.f_blocks, |
28 | (intmax_t) sfs.f_bfree, |
29 | (intmax_t) sfs.f_bavail, |
30 | (intmax_t) sfs.f_files, |
31 | (intmax_t) sfs.f_ffree, (intmax_t) sfs.f_namelen); |
32 | } |
33 | |
34 | int main(int argc, char *argv[]) |
35 | { |
36 | int i; |
37 | |
38 | for (i = 1; i < argc; i++) |
39 | do_statfs(argv[i]); |
40 | |
41 | return 0; |
42 | } |