MCPcopy Create free account
hub / github.com/coreutils/coreutils / do_statfs

Function do_statfs

src/stat.c:1257–1279  ·  view source on GitHub ↗

Stat the file system and print what we find. */

Source from the content-addressed store, hash-verified

1255
1256/* Stat the file system and print what we find. */
1257NODISCARD
1258static bool
1259do_statfs (char const *filename, char const *format)
1260{
1261 STRUCT_STATVFS statfsbuf;
1262
1263 if (streq (filename, "-"))
1264 {
1265 error (0, 0, _("using %s to denote standard input does not work"
1266 " in file system mode"), quoteaf (filename));
1267 return false;
1268 }
1269
1270 if (STATFS (filename, &statfsbuf) != 0)
1271 {
1272 error (0, errno, _("cannot read file system information for %s"),
1273 quoteaf (filename));
1274 return false;
1275 }
1276
1277 bool fail = print_it (format, -1, filename, print_statfs, &statfsbuf);
1278 return ! fail;
1279}
1280
1281struct print_args {
1282 struct stat *st;

Callers 1

mainFunction · 0.85

Calls 1

print_itFunction · 0.85

Tested by

no test coverage detected