Print out flags as text rather than a number.

This commit is contained in:
Garrett Wollman 1995-03-16 18:37:47 +00:00
parent cff19ac2ef
commit f1b2407b0b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=7094
2 changed files with 19 additions and 7 deletions

View file

@ -1,8 +1,8 @@
.\" $Id$
.\" $Id: lsvfs.1,v 1.1 1994/09/22 01:25:56 wollman Exp $
.\" Garrett A. Wollman, September 1994
.\" This file is in the public domain.
.\"
.Dd September 21, 1994
.Dd March 16, 1995
.Dt LSVFS 1
.Os
.Sh NAME
@ -40,7 +40,9 @@ parameter to
the number of references to this VFS; i.e., the number of currently
mounted filesystems of this type
.It Flags
flag bits (none are currently defined).
flag bits (only
.Dq static
is currently defined).
.El
.Sh SEE ALSO
.Xr mount 2 ,

View file

@ -2,6 +2,8 @@
* lsvfs - lsit loaded VFSes
* Garrett A. Wollman, September 1994
* This file is in the public domain.
*
* $Id$
*/
#include <sys/types.h>
@ -10,9 +12,11 @@
#include <stdio.h>
#include <err.h>
#define FMT "%-32.32s %5d %5d %5d\n"
#define HDRFMT "%-32.32s %5.5s %5.5s %5.5s\n"
#define DASHES "-------------------------------- ----- ----- -----\n"
#define FMT "%-32.32s %5d %5d %s\n"
#define HDRFMT "%-32.32s %5.5s %5.5s %s\n"
#define DASHES "-------------------------------- ----- ----- ---------------\n"
static const char *fmt_flags(int);
int
main(int argc, char **argv)
@ -31,7 +35,7 @@ main(int argc, char **argv)
vfc = getvfsbyname(*argv);
if(vfc) {
printf(FMT, vfc->vfc_name, vfc->vfc_index, vfc->vfc_refcount,
vfc->vfc_flags);
fmt_flags(vfc->vfc_flags));
} else {
warnx("VFS %s unknown or not loaded", *argv);
rv++;
@ -48,3 +52,9 @@ main(int argc, char **argv)
return rv;
}
static const char *
fmt_flags(int flags)
{
return (flags & VFCF_STATIC) ? "static" : "";
}