diff options
author | Peter Wemm <peter@FreeBSD.org> | 1997-09-28 00:59:04 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 1997-09-28 00:59:04 +0000 |
commit | e5aff02f684e47b69aceaa0ceee03f1f047252a7 (patch) | |
tree | d9d672d94471042f3b81f4f8008abcb7cbfd446b /usr.bin/top/machine.c | |
parent | 39a3d94ba8f85aa75e043a519da519f56ba0260d (diff) | |
download | src-test2-e5aff02f684e47b69aceaa0ceee03f1f047252a7.tar.gz src-test2-e5aff02f684e47b69aceaa0ceee03f1f047252a7.zip |
Notes
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 d5cb16da7dc0..7eb3cdbb56ca 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, |