7 char *find_type(int t);
8 char *expand_flags(int f);
12 struct statfs *mntlist;
15 n = getmntinfo(&mntlist, MNT_NOWAIT);
17 fprintf(stderr, "getmntinfo failed : %s\n", strerror(errno));
21 printf("%s\t%s\t%s\t%s\t%x\n",
22 mntlist[i].f_mntonname,
23 mntlist[i].f_mntfromname,
24 mntlist[i].f_fstypename,
25 expand_flags(mntlist[i].f_flags),
31 char *expand_flags(int f)
33 static char buf[1024];
35 if (f & MNT_RDONLY) strcat(buf, "ro,");
36 if (f & MNT_NOEXEC) strcat(buf, "noexec,");
37 if (f & MNT_NOSUID) strcat(buf, "nosuid,");
38 if (f & MNT_NOATIME) strcat(buf, "noatime,");
39 if (f & MNT_NODEV) strcat(buf, "nodev,");
40 if (f & MNT_SYNCHRONOUS) strcat(buf, "sync,");
41 if (f & MNT_ASYNC) strcat(buf, "async,");
42 if (f & MNT_QUOTA) strcat(buf, "quota,");
43 if (f & MNT_NOSYMFOLLOW) strcat(buf, "nosymfollow,");
44 if (f & MNT_SUIDDIR) strcat(buf, "suiddir,");
45 if (f & MNT_UNION) strcat(buf, "union,");
46 if (f & MNT_NOCLUSTERR) strcat(buf, "noclusterr,");
47 if (f & MNT_NOCLUSTERW) strcat(buf, "noclusterw,");
48 if (buf[0] == 0) return "-";
49 buf[strlen(buf)-1] = 0;