1 // RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s
5 #include <sys/statvfs.h>
12 printf("getvfsstat\n");
14 int rv
= getvfsstat(NULL
, 0, ST_WAIT
);
17 size_t sz
= rv
* sizeof(struct statvfs
);
18 struct statvfs
*buf
= (struct statvfs
*)malloc(sz
);
21 rv
= getvfsstat(buf
, sz
, ST_WAIT
);
24 for (int i
= 0; i
< rv
; i
++) {
25 printf("Filesystem %d\n", i
);
26 printf("\tfstypename=%s\n", buf
[i
].f_fstypename
);
27 printf("\tmntonname=%s\n", buf
[i
].f_mntonname
);
28 printf("\tmntfromname=%s\n", buf
[i
].f_mntfromname
);