send showerror output to kernel log if neither dos nor intuition are available
[cake.git] / test / clib / statfs.c
blobaded1435f213d82110930092ed784a874f574469
1 #include <string.h>
2 #include <errno.h>
3 #include <sys/mount.h>
4 #include <stdio.h>
5 #include <fcntl.h>
6 #include "test.h"
8 char testfilename[] = "RAM:__TEST__";
10 int main()
12 struct statfs buf;
13 int fd;
15 fd = creat(testfilename, 0777);
16 TEST((fd != -1));
17 close(fd);
18 TEST((statfs(testfilename, &buf) != -1));
20 printf("Name:\t\t\t%s\n", buf.f_mntonname);
21 printf("Fundamental block size:\t%ld\n", buf.f_fsize);
22 printf("Optimal block size:\t%ld\n", buf.f_bsize);
23 printf("Number of blocks:\t%ld\n", buf.f_blocks);
24 printf("Free blocks:\t\t%ld\n", buf.f_bfree);
25 printf("Available blocks:\t%ld\n", buf.f_bavail);
27 cleanup();
28 return OK;
31 void cleanup()
33 remove(testfilename);