Add `-k' option, per Matt Green.
Put the description of the `-n' option in the table, where it belongs. Also, fix the formatting of the table for consistency with the other man pages. Document the BLOCKSIZE environment variable.
This commit is contained in:
parent
92702177a0
commit
07871af1af
|
@ -30,7 +30,7 @@
|
|||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" from: @(#)pstat.8 8.4 (Berkeley) 4/19/94
|
||||
.\" $Id: pstat.8,v 1.2 1994/05/13 21:48:00 cgd Exp $
|
||||
.\" $Id: pstat.8,v 1.3 1995/01/15 07:08:55 mycroft Exp $
|
||||
.\"
|
||||
.Dd April 19, 1994
|
||||
.Dt PSTAT 8
|
||||
|
@ -40,7 +40,7 @@
|
|||
.Nd display system data structures
|
||||
.Sh SYNOPSIS
|
||||
.Nm pstat
|
||||
.Op Fl Tfnstv
|
||||
.Op Fl Tfknstv
|
||||
.Op Fl M Ar core
|
||||
.Op Fl N Ar system
|
||||
.Sh DESCRIPTION
|
||||
|
@ -57,13 +57,9 @@ The required namelist is taken from
|
|||
unless
|
||||
.Ar system
|
||||
is specified.
|
||||
The
|
||||
.Fl n
|
||||
option specifies that devices should be printed out by major/minor
|
||||
number rather than by name.
|
||||
.Pp
|
||||
Options are
|
||||
.Bl -tag -width indent
|
||||
The following options are available:
|
||||
.Bl -tag -width Ds
|
||||
.It Fl T
|
||||
Prints the number of used and free slots in the several system tables
|
||||
and is useful for checking to see how large system tables have become
|
||||
|
@ -101,6 +97,10 @@ The location of the vnode table entry or socket structure for this file.
|
|||
The file offset (see
|
||||
.Xr lseek 2 ) .
|
||||
.El
|
||||
.It Fl k
|
||||
Use 1K-byte blocks.
|
||||
.It Fl n
|
||||
Print devices by major/minor number rather than by name.
|
||||
.It Fl s
|
||||
Print information about swap space usage on all the
|
||||
swap areas compiled into the kernel.
|
||||
|
@ -292,6 +292,16 @@ Number of bytes in an ordinary file, or
|
|||
major and minor device of special file.
|
||||
.El
|
||||
.El
|
||||
.Sh ENVIRONMENTAL VARIABLES
|
||||
.Bl -tag -width BLOCKSIZE
|
||||
.It Ev BLOCKSIZE
|
||||
If the environmental variable
|
||||
.Ev BLOCKSIZE
|
||||
is set, and the
|
||||
.Fl k
|
||||
option is not specified, the block counts will be displayed in units of that
|
||||
size block.
|
||||
.El
|
||||
.Sh FILES
|
||||
.Bl -tag -width /dev/kmemxxx -compact
|
||||
.It Pa /netbsd
|
||||
|
|
|
@ -39,7 +39,7 @@ static char copyright[] =
|
|||
|
||||
#ifndef lint
|
||||
/* from: static char sccsid[] = "@(#)pstat.c 8.9 (Berkeley) 2/16/94"; */
|
||||
static char *rcsid = "$Id: pstat.c,v 1.7 1995/01/04 05:35:47 mycroft Exp $";
|
||||
static char *rcsid = "$Id: pstat.c,v 1.8 1995/01/15 07:08:57 mycroft Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -165,6 +165,7 @@ struct nlist nl[] = {
|
|||
|
||||
int usenumflag;
|
||||
int totalflag;
|
||||
int kflag;
|
||||
char *nlistf = NULL;
|
||||
char *memf = NULL;
|
||||
kvm_t *kd;
|
||||
|
@ -219,7 +220,7 @@ main(argc, argv)
|
|||
char buf[_POSIX2_LINE_MAX];
|
||||
|
||||
fileflag = swapflag = ttyflag = vnodeflag = 0;
|
||||
while ((ch = getopt(argc, argv, "TM:N:finstv")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "TM:N:fiknstv")) != -1)
|
||||
switch (ch) {
|
||||
case 'f':
|
||||
fileflag = 1;
|
||||
|
@ -242,6 +243,9 @@ main(argc, argv)
|
|||
case 't':
|
||||
ttyflag = 1;
|
||||
break;
|
||||
case 'k':
|
||||
kflag = 1;
|
||||
break;
|
||||
case 'v':
|
||||
case 'i': /* Backward compatibility. */
|
||||
vnodeflag = 1;
|
||||
|
@ -1090,7 +1094,12 @@ swapmode()
|
|||
}
|
||||
}
|
||||
|
||||
header = getbsize(&hlen, &blocksize);
|
||||
if (kflag) {
|
||||
header = "1K-blocks";
|
||||
blocksize = 1024;
|
||||
hlen = strlen(header);
|
||||
} else
|
||||
header = getbsize(&hlen, &blocksize);
|
||||
if (!totalflag)
|
||||
(void)printf("%-11s %*s %8s %8s %8s %s\n",
|
||||
"Device", hlen, header,
|
||||
|
@ -1149,6 +1158,6 @@ void
|
|||
usage()
|
||||
{
|
||||
(void)fprintf(stderr,
|
||||
"usage: pstat [-Tfnstv] [-M core] [-N system]\n");
|
||||
"usage: pstat [-Tfknstv] [-M core] [-N system]\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue