aboutsummaryrefslogtreecommitdiff
path: root/bin/ps/print.c
diff options
context:
space:
mode:
authorGarance A Drosehn <gad@FreeBSD.org>2004-06-23 11:56:57 +0000
committerGarance A Drosehn <gad@FreeBSD.org>2004-06-23 11:56:57 +0000
commit820434b27f0822221f8b85db26279a3b5fb993de (patch)
treed9f09cce579e6e640c53fd88d01c1705b3a5f9e3 /bin/ps/print.c
parent31172f6e1bdc7521e6087dde38c917dd8eb36b02 (diff)
downloadsrc-820434b27f0822221f8b85db26279a3b5fb993de.tar.gz
src-820434b27f0822221f8b85db26279a3b5fb993de.zip
Make sure the value of "upr" (scheduling priority on return from system call)
is scaled in the same way that "pri" (scheduling priority) is scaled. Submitted by: Cyrille Lefevre
Notes
Notes: svn path=/head/; revision=130974
Diffstat (limited to 'bin/ps/print.c')
-rw-r--r--bin/ps/print.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index de5c69b1e779..0f2b14ae2af5 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -265,14 +265,26 @@ state(KINFO *k, VARENT *ve)
(void)printf("%-*s", v->width, buf);
}
+#define scalepri(x) ((x) - PZERO)
+
void
pri(KINFO *k, VARENT *ve)
{
VAR *v;
v = ve->var;
- (void)printf("%*d", v->width, k->ki_p->ki_pri.pri_level - PZERO);
+ (void)printf("%*d", v->width, scalepri(k->ki_p->ki_pri.pri_level));
+}
+
+void
+upr(KINFO *k, VARENT *ve)
+{
+ VAR *v;
+
+ v = ve->var;
+ (void)printf("%*d", v->width, scalepri(k->ki_p->ki_pri.pri_user));
}
+#undef scalepri
void
uname(KINFO *k, VARENT *ve)