Changeset 332513a in mainline for uspace/app/df/df.c
- Timestamp:
- 2013-09-11T22:13:05Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e88f3e9
- Parents:
- e1ec5a2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/df/df.c
re1ec5a2 r332513a 50 50 #define HEADER_TABLE_HR "Filesystem Size Used Available Used%% Mounted on" 51 51 52 #define PERCENTAGE(x, tot) ((unsigned long long) (100L * (x) / (tot))) 52 #define PERCENTAGE(x, tot) ((unsigned long long) (100L * (x) / (tot))) 53 53 #define FSBK_TO_BK(x, fsbk, bk) \ 54 54 (((fsbk) != 0 && (fsbk) < (bk)) ? \ … … 68 68 int optres, errflg = 0; 69 69 struct statfs st; 70 70 71 71 unit_size = 512; 72 72 human_readable = 0; … … 88 88 str_uint32_t(optarg, NULL, 0, 0, &unit_size); 89 89 break; 90 91 case ':': 90 91 case ':': 92 92 fprintf(stderr, "Option -%c requires an operand\n", optopt); 93 93 errflg++; … … 110 110 errflg++; 111 111 } 112 112 113 113 if (errflg) { 114 114 print_usage(); 115 115 return 1; 116 116 } 117 117 118 118 LIST_INITIALIZE(mtab_list); 119 119 get_mtab_list(&mtab_list); … … 123 123 print_statfs(&st, mtab_ent->fs_name, mtab_ent->mp); 124 124 } 125 putchar('\n'); 125 putchar('\n'); 126 126 return 0; 127 127 } … … 148 148 { 149 149 if (human_readable) 150 printf(HEADER_TABLE_HR); 151 else 150 printf(HEADER_TABLE_HR); 151 else 152 152 printf(HEADER_TABLE, unit_size); 153 153 putchar('\n'); … … 157 157 { 158 158 printf("%10s", name); 159 159 160 160 if (human_readable) { 161 161 char tmp[1024]; … … 179 179 mountpoint /* Mounted on */ 180 180 ); 181 181 182 182 } 183 183 184 184 static void print_usage(void) 185 185 { 186 187 printf(" u : Show usage.\n"); 188 printf(" h : \"Human-readable\" output.\n"); 189 printf(" b : Scale block sizes by selected size.\n"); 190 186 printf("syntax: %s [-u] [-h] [-b <size>] \n", NAME); 187 printf(" u : Show usage.\n"); 188 printf(" h : \"Human-readable\" output.\n"); 189 printf(" b : Scale block sizes by selected size.\n"); 190 printf("\n"); 191 191 } 192 192
Note:
See TracChangeset
for help on using the changeset viewer.