File: rfdf.c

package info (click to toggle)
lcgdm 1.10.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 17,532 kB
  • sloc: ansic: 226,887; sh: 13,562; perl: 11,575; python: 11,572; cpp: 5,716; sql: 1,824; makefile: 1,301; fortran: 113
file content (31 lines) | stat: -rw-r--r-- 884 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <stdio.h>
#include <stdlib.h>
#include "rfio_api.h"
#include "u64subr.h"
main(int argc, char **argv)
{
	int errflg = 0;
	int i;
	struct rfstatfs64 statfsbuf;
	char tmpbuf[21];

	if (argc == 1) {
		fprintf (stderr, "usage: %s path ...\n", argv[0]);
		exit (1);
	}
	for (i = 1; i < argc; i++) {
		if (rfio_statfs64 (argv[i], &statfsbuf) < 0) {
			fprintf (stderr, "%s: '%s': %s\n", argv[0], argv[i],
			    rfio_serror());
			errflg++;
		} else {
			printf ("%s\n", argv[i]);
			printf ("\tblocksize    : %d\n", statfsbuf.bsize);
			printf ("\ttotal blocks : %s\n", i64tostr (statfsbuf.totblks, tmpbuf, 0));
			printf ("\tfree blocks  : %s\n", i64tostr (statfsbuf.freeblks, tmpbuf, 0));
			printf ("\ttotal inodes : %s\n", i64tostr (statfsbuf.totnods, tmpbuf, 0));
			printf ("\tfree inodes  : %s\n", i64tostr (statfsbuf.freenods, tmpbuf, 0));
		}
	}
	exit (errflg ? 1 : 0);
}