Changeset e8f0158 in mainline for uspace/app/df/df.c
- Timestamp:
- 2013-07-11T21:17:42Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d0a1e9b6
- Parents:
- 67632f7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/df/df.c
r67632f7 re8f0158 38 38 #include <stdlib.h> 39 39 #include <unistd.h> 40 #include <stdint.h> 40 41 #include <sys/statfs.h> 41 42 #include <errno.h> … … 47 48 #define HEADER_TABLE "Filesystem 512-blocks Used Available Used% Mounted on" 48 49 49 #define PERCENTAGE(x, tot) (( long) (100L * (x) / (tot)))50 #define PERCENTAGE(x, tot) ((unsigned long long) (100L * (x) / (tot))) 50 51 51 52 int main(int argc, char *argv[]) … … 60 61 link); 61 62 statfs(mtab_ent->mp, &st); 62 printf("block size:%l d\n",st.f_bsize);63 printf("%13s %15ll d %9lld %9lld %3ld%% %s\n",63 printf("block size:%lu\n", (unsigned long)st.f_bsize); 64 printf("%13s %15llu %9llu %9llu %3llu%% %s\n", 64 65 mtab_ent->fs_name, 65 ( long long) st.f_blocks * st.f_bsize,66 ( long long) (st.f_blocks - st.f_bfree) * st.f_bsize,67 ( long long) st.f_bfree * st.f_bsize,66 (unsigned long long) st.f_blocks * st.f_bsize, 67 (unsigned long long) (st.f_blocks - st.f_bfree) * st.f_bsize, 68 (unsigned long long) st.f_bfree * st.f_bsize, 68 69 (st.f_blocks)?PERCENTAGE(st.f_blocks - st.f_bfree, st.f_blocks):0L, 69 70 mtab_ent->mp);
Note:
See TracChangeset
for help on using the changeset viewer.