2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
12 struct statfs
*buf
= NULL
;
16 int fscount
, newfscount
;
18 fscount
= getfsstat(NULL
, 0, 0);
19 TEST((fscount
!= -1));
20 printf("Number of filesystems: %d\n", fscount
);
21 buf
= malloc(sizeof(struct statfs
) * fscount
);
23 newfscount
= getfsstat(buf
, (long) sizeof(struct statfs
) * fscount
, 0);
24 TEST((newfscount
!= -1));
25 TEST((newfscount
== fscount
));
26 printf("Printing filesystem data:\n\n");
27 for(i
= 0; i
< newfscount
; i
++)
29 printf("Record number:\t\t%d\n", i
+1);
30 printf("Name:\t\t\t%s\n", buf
[i
].f_mntonname
);
31 printf("Fundamental block size:\t%ld\n", buf
[i
].f_fsize
);
32 printf("Optimal block size:\t%ld\n", buf
[i
].f_bsize
);
33 printf("Number of blocks:\t%ld\n", buf
[i
].f_blocks
);
34 printf("Free blocks:\t\t%ld\n", buf
[i
].f_bfree
);
35 printf("Available blocks:\t%ld\n", buf
[i
].f_bavail
);
38 newfscount
= getfsstat(buf
, 1, 0);
39 TEST((newfscount
== 0));