diff options
author | peter <peter@FreeBSD.org> | 1997-09-28 00:59:04 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1997-09-28 00:59:04 +0000 |
commit | 66e710212a85a4a710c20ae55a4fa6f07d0e08b7 (patch) | |
tree | ee696427d98b2f5118014f92a0daec0822bc261e /usr.bin/top/machine.c | |
parent | bc20671bb81b2907b0c577afe883f3ffcb94ecbb (diff) | |
download | FreeBSD-src-66e710212a85a4a710c20ae55a4fa6f07d0e08b7.zip FreeBSD-src-66e710212a85a4a710c20ae55a4fa6f07d0e08b7.tar.gz |
YAMF22: (rev 1.3.2.2) Display realtime and idle priorities appropriately.
Diffstat (limited to 'usr.bin/top/machine.c')
-rw-r--r-- | usr.bin/top/machine.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index d5cb16d..7eb3cdb 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -17,7 +17,7 @@ * Steven Wallace <swallace@freebsd.org> * Wolfram Schneider <wosch@FreeBSD.org> * - * $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 <sys/proc.h> #include <sys/user.h> #include <sys/vmmeter.h> +#include <sys/resource.h> +#include <sys/rtprio.h> /* Swap */ #include <stdlib.h> @@ -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, |