Mercurial > hg > toybox
comparison toys/other/stat.c @ 1702:8ce8c5365f8b draft 0.5.2
stat -f didn't work on 32 bit systems because type sizes wrong (fix from Elliott Hughes).
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 25 Feb 2015 00:45:50 -0600 |
parents | 00e816559b1f |
children |
comparison
equal
deleted
inserted
replaced
1701:83c14a9cd0fe | 1702:8ce8c5365f8b |
---|---|
104 } | 104 } |
105 | 105 |
106 static void print_statfs(char type) { | 106 static void print_statfs(char type) { |
107 struct statfs *statfs = (struct statfs *)&TT.stat; | 107 struct statfs *statfs = (struct statfs *)&TT.stat; |
108 | 108 |
109 if (type == 'a') xprintf("%lu", statfs->f_bavail); | 109 if (type == 'a') xprintf("%llu", statfs->f_bavail); |
110 else if (type == 'b') xprintf("%lu", statfs->f_blocks); | 110 else if (type == 'b') xprintf("%llu", statfs->f_blocks); |
111 else if (type == 'c') xprintf("%lu", statfs->f_files); | 111 else if (type == 'c') xprintf("%llu", statfs->f_files); |
112 else if (type == 'd') xprintf("%lu", statfs->f_ffree); | 112 else if (type == 'd') xprintf("%llu", statfs->f_ffree); |
113 else if (type == 'f') xprintf("%lu", statfs->f_bfree); | 113 else if (type == 'f') xprintf("%llu", statfs->f_bfree); |
114 else if (type == 'l') xprintf("%ld", statfs->f_namelen); | 114 else if (type == 'l') xprintf("%ld", statfs->f_namelen); |
115 else if (type == 't') xprintf("%lx", statfs->f_type); | 115 else if (type == 't') xprintf("%lx", statfs->f_type); |
116 else if (type == 'i') | 116 else if (type == 'i') |
117 xprintf("%08x%08x", statfs->f_fsid.__val[0], statfs->f_fsid.__val[1]); | 117 xprintf("%08x%08x", statfs->f_fsid.__val[0], statfs->f_fsid.__val[1]); |
118 else if (type == 's') xprintf("%d", statfs->f_frsize); | 118 else if (type == 's') xprintf("%d", statfs->f_frsize); |