| static int ok = EXIT_SUCCESS; |
| static void printsize(long long n) |
| printf("%4lld.%1lld%c", t/10, t%10, unit); |
| static void df(char *s, int always) { |
| if (statfs(s, &st) < 0) { |
| fprintf(stderr, "%s: %s\n", s, strerror(errno)); |
| if (st.f_blocks == 0 && !always) |
| printsize((long long)st.f_blocks * (long long)st.f_bsize); |
| printsize((long long)(st.f_blocks - (long long)st.f_bfree) * st.f_bsize); |
| printsize((long long)st.f_bfree * (long long)st.f_bsize); |
| printf(" %d\n", (int) st.f_bsize); |
| int df_main(int argc, char *argv[]) { |
| printf("Filesystem Size Used Free Blksize\n"); |
| FILE *f = fopen("/proc/mounts", "r"); |
| while (fgets(s, 2000, f)) { |
| for (i = 1; i < argc; i++) { |