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,