build/include the gpio.resource
[AROS.git] / test / clib / statfs.c
blob416afac935fa692b12532716af6276b45995104b
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <string.h>
7 #include <errno.h>
8 #include <sys/mount.h>
9 #include <stdio.h>
10 #include <fcntl.h>
11 #include <unistd.h>
12 #include "test.h"
14 char testfilename[] = "RAM:__TEST__";
16 int main()
18 struct statfs buf;
19 int fd;
21 fd = creat(testfilename, 0777);
22 TEST((fd != -1));
23 close(fd);
24 TEST((statfs(testfilename, &buf) != -1));
26 printf("Name:\t\t\t%s\n", buf.f_mntonname);
27 printf("Fundamental block size:\t%ld\n", buf.f_fsize);
28 printf("Optimal block size:\t%ld\n", buf.f_bsize);
29 printf("Number of blocks:\t%ld\n", buf.f_blocks);
30 printf("Free blocks:\t\t%ld\n", buf.f_bfree);
31 printf("Available blocks:\t%ld\n", buf.f_bavail);
33 cleanup();
34 return OK;
37 void cleanup()
39 remove(testfilename);