Fix IO memory access .. SB128 driver makes noises in VMWare - CMI is untested (Curren...
[AROS.git] / test / clib / statfs.c
blobc1e872f15d6d0b9436f6f2c630b7a9ee7ffb8785
1 #include <string.h>
2 #include <errno.h>
3 #include <sys/mount.h>
4 #include <stdio.h>
5 #include <fcntl.h>
6 #include <unistd.h>
7 #include "test.h"
9 char testfilename[] = "RAM:__TEST__";
11 int main()
13 struct statfs buf;
14 int fd;
16 fd = creat(testfilename, 0777);
17 TEST((fd != -1));
18 close(fd);
19 TEST((statfs(testfilename, &buf) != -1));
21 printf("Name:\t\t\t%s\n", buf.f_mntonname);
22 printf("Fundamental block size:\t%ld\n", buf.f_fsize);
23 printf("Optimal block size:\t%ld\n", buf.f_bsize);
24 printf("Number of blocks:\t%ld\n", buf.f_blocks);
25 printf("Free blocks:\t\t%ld\n", buf.f_bfree);
26 printf("Available blocks:\t%ld\n", buf.f_bavail);
28 cleanup();
29 return OK;
32 void cleanup()
34 remove(testfilename);