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 find_type(mntlist[i].f_type),
25 expand_flags(mntlist[i].f_flags),
31 char *type_name[] = { "none", "ufs", "nfs", "mfs", "msdos", "lfs",
32 "lofs", "fdesc", "portal", "null", "umap", "kernfs",
33 "procfs", "afs", "cd9660", "union", "devfs", "ext2fs",
36 char *find_type(int t)
38 if (t < 0 || t > 18) return "???";
39 else return type_name[t];
42 char *expand_flags(int f)
44 static char buf[1024];
46 if (f & MNT_RDONLY) strcat(buf, "ro,");
47 if (f & MNT_NOEXEC) strcat(buf, "noexec,");
48 if (f & MNT_NOSUID) strcat(buf, "nosuid,");
49 if (f & MNT_NOATIME) strcat(buf, "noatime,");
50 if (f & MNT_NODEV) strcat(buf, "nodev,");
51 if (f & MNT_SYNCHRONOUS) strcat(buf, "sync,");
52 if (f & MNT_ASYNC) strcat(buf, "async,");
53 if (f & MNT_QUOTA) strcat(buf, "quota,");
54 if (buf[0] == 0) return "-";
55 buf[strlen(buf)-1] = 0;