summaryrefslogtreecommitdiffstats
path: root/bin/ps/print.c
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2002-02-03 14:43:04 +0000
committermarkm <markm@FreeBSD.org>2002-02-03 14:43:04 +0000
commitaa05461c142ad4066a0a15602416ba40936a61c9 (patch)
tree7d38defe5cb3081da17d7b6c01870764bc1cc69a /bin/ps/print.c
parent792e9550ac5bdc8f338e9d340053549aa3aae463 (diff)
downloadFreeBSD-src-aa05461c142ad4066a0a15602416ba40936a61c9.zip
FreeBSD-src-aa05461c142ad4066a0a15602416ba40936a61c9.tar.gz
WARNS=4 fixes (incomplete, so set NO_WERROR), and lots of extra
cleanup courtesy of automatic checking (lint).
Diffstat (limited to 'bin/ps/print.c')
-rw-r--r--bin/ps/print.c51
1 files changed, 17 insertions, 34 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 7b80f03..0385308 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -31,13 +31,15 @@
* SUCH DAMAGE.
*/
-#ifndef lint
+#include <sys/cdefs.h>
+
+__FBSDID("$FreeBSD$");
+
#if 0
+#ifndef lint
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
-#endif
-static const char rcsid[] =
- "$FreeBSD$";
#endif /* not lint */
+#endif
#include <sys/param.h>
#include <sys/time.h>
@@ -45,10 +47,8 @@ static const char rcsid[] =
#include <sys/proc.h>
#include <sys/stat.h>
-#include <sys/ucred.h>
#include <sys/user.h>
#include <sys/sysctl.h>
-#include <vm/vm.h>
#include <err.h>
#include <langinfo.h>
@@ -58,13 +58,15 @@ static const char rcsid[] =
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
#include <string.h>
+#include <unistd.h>
#include <vis.h>
#include "lomac.h"
#include "ps.h"
+static void printval __P((char *, VAR *));
+
void
printheader(void)
{
@@ -424,26 +426,6 @@ vsize(KINFO *k, VARENT *ve)
}
void
-rssize(KINFO *k, VARENT *ve)
-{
- VAR *v;
-
- v = ve->var;
- /* XXX don't have info about shared */
- (void)printf("%*lu", v->width,
- (u_long)pgtok(k->ki_p->ki_rssize));
-}
-
-void
-p_rssize(KINFO *k, VARENT *ve) /* doesn't account for text */
-{
- VAR *v;
-
- v = ve->var;
- (void)printf("%*ld", v->width, (long)pgtok(k->ki_p->ki_rssize));
-}
-
-void
cputime(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -483,7 +465,7 @@ cputime(KINFO *k, VARENT *ve)
}
double
-getpcpu(KINFO *k)
+getpcpu(const KINFO *k)
{
static int failure;
@@ -512,7 +494,7 @@ pcpu(KINFO *k, VARENT *ve)
(void)printf("%*.1f", v->width, getpcpu(k));
}
-double
+static double
getpmem(KINFO *k)
{
static int failure;
@@ -550,8 +532,9 @@ pagein(KINFO *k, VARENT *ve)
k->ki_valid ? k->ki_p->ki_rusage.ru_majflt : 0);
}
+/* ARGSUSED */
void
-maxrss(KINFO *k, VARENT *ve)
+maxrss(KINFO *k __unused, VARENT *ve)
{
VAR *v;
@@ -573,14 +556,14 @@ void
priorityr(KINFO *k, VARENT *ve)
{
VAR *v;
- struct priority *pri;
+ struct priority *lpri;
char str[8];
unsigned class, level;
v = ve->var;
- pri = (struct priority *) ((char *)k + v->off);
- class = pri->pri_class;
- level = pri->pri_level;
+ lpri = (struct priority *) ((char *)k + v->off);
+ class = lpri->pri_class;
+ level = lpri->pri_level;
switch (class) {
case PRI_REALTIME:
snprintf(str, sizeof(str), "real:%u", level);
OpenPOWER on IntegriCloud