3 * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>,
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
14 #include <sys/types.h>
22 #include <linux/major.h>
24 #include <linux/types.h>
27 #include <sys/param.h>
31 do_df(int argc
, char * argv
[])
45 if (statfs(name
, &stbuf
) == -1) {
46 printf("Unable to get disk space of %s: %s\n", name
, strerror(errno
));
50 printf("Total Kbytes: %ld\n", (stbuf
.f_bsize
/ 256) * (stbuf
.f_blocks
/ 4));
51 printf("Free Kbytes: %ld\n", (stbuf
.f_bsize
/ 256) * (stbuf
.f_bfree
/ 4));
52 printf("Total nodes: %ld\n", stbuf
.f_files
);
53 printf("Free nodes: %ld\n", stbuf
.f_ffree
);