source: tools/getfreespace/getfreespace.c @ 2677

Last change on this file since 2677 was 2677, checked in by nit, 14 years ago

update getfreespace

File size: 335 bytes
Line 
1#include <sys/vfs.h>
2
3main(argc,argv)
4int argc;
5char *argv[];
6{
7        if (argc == 2)
8        {
9                struct statfs s;
10                                        long long tmp;
11                if (statfs(argv[1], &s)<0)
12                        tmp=0;
13                else
14                {
15                        tmp=s.f_bfree;
16                        tmp*=s.f_bsize;
17                }
18
19                printf("%lld\n", tmp/1024);
20        }
21        else
22                printf("0\n");
23}
Note: See TracBrowser for help on using the repository browser.