NetBSD/bin/ps
dholland e9b3916bd6 When converting from pages to kilobytes, cast the return value of
getpagesize() to size_t. For some reason getpagesize() is defined to
return int, and several of the page counts we get come back from the
kernel as int32_t; in LP64 without the cast the byte count will be
computed in a 32-bit value and for large processes will overflow and
become negative... and then remain negative when divided by 1024 to
convert to kilobytes.

Fixes a problem I hit the other day where I saw negative RSS, which
turns out also to be PR 40642.

Note: other logic in here will break down when we first get >2TB
processes... and int32 page counts will break on >8TB processes. But
hopefully we won't see any of that for a few years yet.
2011-06-13 03:42:15 +00:00
..
Makefile
extern.h Fix ps(1) and top(1) to show reasonable CPU numbers i.e. cpu_index() provided 2010-05-31 03:18:33 +00:00
fmt.c use __RCSID() 2007-12-12 22:55:42 +00:00
keyword.c Remove uarea swap-out functionality: 2009-10-21 21:11:57 +00:00
nlist.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
print.c When converting from pages to kilobytes, cast the return value of 2011-06-13 03:42:15 +00:00
ps.1 fix typo, from Randolf Richardson in PR 44559 2011-02-13 08:34:00 +00:00
ps.c Fix ps(1) and top(1) to show reasonable CPU numbers i.e. cpu_index() provided 2010-05-31 03:18:33 +00:00
ps.h * When all columns are given null customised headers, the blank header 2006-10-02 17:54:35 +00:00