From e5aff02f684e47b69aceaa0ceee03f1f047252a7 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Sun, 28 Sep 1997 00:59:04 +0000 Subject: [PATCH] YAMF22: (rev 1.3.2.2) Display realtime and idle priorities appropriately. --- usr.bin/top/machine.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index d5cb16da7dc0..7eb3cdbb56ca 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -17,7 +17,7 @@ * Steven Wallace * Wolfram Schneider * - * $Id: machine.c,v 1.5 1997/07/14 09:06:46 peter Exp $ + * $Id: machine.c,v 1.6 1997/08/27 03:48:25 peter Exp $ */ @@ -39,6 +39,8 @@ #include #include #include +#include +#include /* Swap */ #include @@ -594,7 +596,17 @@ char *(*get_userid)(); namelength, namelength, (*get_userid)(EP(pp, e_pcred.p_ruid)), PP(pp, p_priority) - PZERO, - PP(pp, p_nice) - NZERO, + + /* + * normal time -> nice value -20 - +20 + * real time 0 - 31 -> nice value -52 - -21 + * idle time 0 - 31 -> nice value +21 - +52 + */ + (PP(pp, p_rtprio.type) == RTP_PRIO_NORMAL ? + PP(pp, p_nice) - NZERO : + (PP(pp, p_rtprio.type) == RTP_PRIO_REALTIME ? + (PRIO_MIN - 1 - RTP_PRIO_MAX + PP(pp, p_rtprio.prio)) : + (PRIO_MAX + 1 + PP(pp, p_rtprio.prio)))), format_k2(pagetok(PROCSIZE(pp))), format_k2(pagetok(VP(pp, vm_rssize))), status,