GC the -W option. kvm(3) doesn't read swap for almost 10 years.

PR:		docs/34134
Reviewed by:	bde, peter
MFC after:	1 month
This commit is contained in:
ru 2002-01-28 09:43:26 +00:00
parent ce84ffa046
commit 1afca48ebe
2 changed files with 7 additions and 21 deletions

View File

@ -51,7 +51,6 @@
.Op , Ns Ar username Ns No ... .Op , Ns Ar username Ns No ...
.Xc .Xc
.Oc .Oc
.Op Fl W Ar swap
.Nm .Nm
.Op Fl L .Op Fl L
.Sh DESCRIPTION .Sh DESCRIPTION
@ -169,9 +168,6 @@ The
option implies the option implies the
.Fl m .Fl m
option. option.
.It Fl W
Extract swap information from the specified file instead of
using libkvm.
.It Fl w .It Fl w
Use 132 columns to display information, instead of the default which Use 132 columns to display information, instead of the default which
is your window size. is your window size.
@ -500,10 +496,6 @@ exit or stop status (valid only for stopped or zombie process)
.El .El
.Sh FILES .Sh FILES
.Bl -tag -width /var/db/kvm_kernel.db -compact .Bl -tag -width /var/db/kvm_kernel.db -compact
.It Pa /dev
special files and device names
.It Pa /dev/drum
default swap device
.It Pa /dev/kmem .It Pa /dev/kmem
default kernel memory default kernel memory
.It Pa /dev/lomac .It Pa /dev/lomac

View File

@ -128,7 +128,7 @@ main(argc, argv)
uid_t *uids; uid_t *uids;
int all, ch, flag, i, fmt, lineno, nentries, dropgid; int all, ch, flag, i, fmt, lineno, nentries, dropgid;
int prtheader, wflag, what, xflg, uid, nuids; int prtheader, wflag, what, xflg, uid, nuids;
char *nlistf, *memf, *swapf, errbuf[_POSIX2_LINE_MAX]; char *nlistf, *memf, errbuf[_POSIX2_LINE_MAX];
(void) setlocale(LC_ALL, ""); (void) setlocale(LC_ALL, "");
@ -149,12 +149,12 @@ main(argc, argv)
uids = NULL; uids = NULL;
ttydev = NODEV; ttydev = NODEV;
dropgid = 0; dropgid = 0;
memf = nlistf = swapf = _PATH_DEVNULL; memf = nlistf = _PATH_DEVNULL;
while ((ch = getopt(argc, argv, while ((ch = getopt(argc, argv,
#if defined(LAZY_PS) #if defined(LAZY_PS)
"aCcefghjLlM:mN:O:o:p:rSTt:U:uvW:wxZ")) != -1) "aCcefghjLlM:mN:O:o:p:rSTt:U:uv:wxZ")) != -1)
#else #else
"aCceghjLlM:mN:O:o:p:rSTt:U:uvW:wxZ")) != -1) "aCceghjLlM:mN:O:o:p:rSTt:U:uv:wxZ")) != -1)
#endif #endif
switch((char)ch) { switch((char)ch) {
case 'a': case 'a':
@ -263,10 +263,6 @@ main(argc, argv)
fmt = 1; fmt = 1;
vfmt[0] = '\0'; vfmt[0] = '\0';
break; break;
case 'W':
swapf = optarg;
dropgid = 1;
break;
case 'w': case 'w':
if (wflag) if (wflag)
termwidth = UNLIMITED; termwidth = UNLIMITED;
@ -294,8 +290,6 @@ main(argc, argv)
nlistf = *argv; nlistf = *argv;
if (*++argv) { if (*++argv) {
memf = *argv; memf = *argv;
if (*++argv)
swapf = *argv;
} }
} }
#endif #endif
@ -308,7 +302,7 @@ main(argc, argv)
setuid(getuid()); setuid(getuid());
} }
kd = kvm_openfiles(nlistf, memf, swapf, O_RDONLY, errbuf); kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf);
if (kd == 0) if (kd == 0)
errx(1, "%s", errbuf); errx(1, "%s", errbuf);
@ -611,7 +605,7 @@ kludge_oldps_options(s)
* option string, the remainder of the string is the argument to * option string, the remainder of the string is the argument to
* that flag; do not modify that argument. * that flag; do not modify that argument.
*/ */
if (strcspn(s, "MNOoUW") == len && *cp == 't' && *s != '-') if (strcspn(s, "MNOoU") == len && *cp == 't' && *s != '-')
*cp = 'T'; *cp = 'T';
else { else {
/* /*
@ -643,7 +637,7 @@ usage()
(void)fprintf(stderr, "%s\n%s\n%s\n", (void)fprintf(stderr, "%s\n%s\n%s\n",
"usage: ps [-aChjlmrSTuvwx] [-O|o fmt] [-p pid] [-t tty] [-U user]", "usage: ps [-aChjlmrSTuvwx] [-O|o fmt] [-p pid] [-t tty] [-U user]",
" [-M core] [-N system] [-W swap]", " [-M core] [-N system]",
" ps [-L]"); " ps [-L]");
exit(1); exit(1);
} }