36 lines · cpp
1// RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s2//3// UNSUPPORTED: target={{.*(linux|solaris).*}}4 5#include <sys/types.h>6 7#if defined(__NetBSD__)8#include <sys/statvfs.h>9#else10#include <sys/mount.h>11#endif12 13#include <err.h>14#include <stdio.h>15#include <stdlib.h>16 17int main(void) {18 printf("getmntinfo\n");19 20#if defined(__NetBSD__)21 struct statvfs *fss;22#else23 struct statfs *fss;24#endif25 int nfss = getmntinfo(&fss, MNT_NOWAIT);26 if (nfss <= 0)27 errx(1, "getmntinfo");28 29 for (int i = 0; i < nfss; i++)30 printf("%d: %s\n", i, fss[i].f_fstypename);31 32 // CHECK: getmntinfo33 34 return 0;35}36