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.
13 #include <linux/autoconf.h>
16 #include <sys/types.h>
24 #include <linux/major.h>
26 #include <linux/types.h>
29 #include <sys/param.h>
33 do_df(int argc, char * argv[])
47 if (statfs(name, &stbuf) == -1) {
48 printf("Unable to get disk space of %s: %s\n", name, strerror(errno));
52 printf("Total Kbytes: %ld\n", (stbuf.f_bsize / 256) * (stbuf.f_blocks / 4));
53 printf("Free Kbytes: %ld\n", (stbuf.f_bsize / 256) * (stbuf.f_bfree / 4));
54 printf("Total nodes: %ld\n", stbuf.f_files);
55 printf("Free nodes: %ld\n", stbuf.f_ffree);