9 char *find_type(int t);
10 char *expand_flags(int f);
14 struct statfs *mntlist;
17 n = getmntinfo(&mntlist, MNT_NOWAIT);
19 fprintf(stderr, "getmntinfo failed : %s\n", strerror(errno));
23 printf("%s\t%s\t%s\t%s\t%x\n",
24 mntlist[i].f_mntonname,
25 mntlist[i].f_mntfromname,
26 mntlist[i].f_fstypename,
27 expand_flags(mntlist[i].f_flags),
33 char *expand_flags(int f)
35 static char buf[1024];
37 if (f & MNT_RDONLY) strcat(buf, "ro,");
38 if (f & MNT_NOEXEC) strcat(buf, "noexec,");
39 if (f & MNT_NOSUID) strcat(buf, "nosuid,");
40 if (f & MNT_NOATIME) strcat(buf, "noatime,");
41 if (f & MNT_NODEV) strcat(buf, "nodev,");
42 if (f & MNT_SYNCHRONOUS) strcat(buf, "sync,");
43 if (f & MNT_ASYNC) strcat(buf, "async,");
44 if (f & MNT_QUOTA) strcat(buf, "quota,");
45 if (f & MNT_UNION) strcat(buf, "union,");
46 if (buf[0] == 0) return "-";
47 buf[strlen(buf)-1] = 0;