some overflow problems fixed -- thanks Holger Kiehl

This commit is contained in:
albert 2004-07-26 13:48:59 +00:00
parent 266d5b708a
commit 713d32a93a
3 changed files with 20 additions and 3 deletions

1
NEWS
View File

@ -5,6 +5,7 @@ avoid warning about -lncurses when not linking (more)
new names for shared libraries (packagers: watch out!)
"make install" no longer rebuilds everything
wchan now '*' for multi-threaded processes
vmstat: some overflow problems fixed -- thanks Holger Kiehl
procps-3.2.1 --> procps-3.2.2

15
TODO
View File

@ -2,11 +2,14 @@
Implement /usr/proc/bin tools like Solaris has.
The prstat command is interesting, like top in batch mode.
SCO has a pstat command.
Don't these really belong in the procps package?
killall pstree fuser lsof who
(they are maintained elsewhere, which causes version problems)
OpenBSD has a pfind command.
Cache results of dev_to_tty.
---------------------- kernel -------------------------
@ -59,6 +62,10 @@ Adjust PID-like and PSR-like columns to fit the data.
The normal PID limit is 5 digits; it can go up to 10.
The normal CPU limit is 1 digit; it can go to 3 or 4.
don't truncate long usernames
have a --config option
---------------- ps for now, maybe move to libproc ------------------
With forest output and a tty named /dev/this_is_my_tty, the position
@ -96,7 +103,13 @@ Add an option to select all processes that a user can kill.
(related to RUID, EUID, tty, etc. -- but maybe ignore root power)
Add a nice display option for killing things.
ruser,euser,ppid,pid,pmem,stime,args isn't too bad
ruser,euser,ppid,pid,pmem,stime,args
For RT stuff:
pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm
For job control:
stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm
Make the column alignment algorithm support this:
FOO BAR

View File

@ -347,6 +347,7 @@ void getstat(jiff *restrict cuse, jiff *restrict cice, jiff *restrict csys, jiff
unsigned int *restrict running, unsigned int *restrict blocked,
unsigned int *restrict btime, unsigned int *restrict processes) {
static int fd;
unsigned long long llbuf = 0;
int need_vmstat_file = 0;
int need_proc_scan = 0;
const char* b;
@ -376,10 +377,12 @@ void getstat(jiff *restrict cuse, jiff *restrict cice, jiff *restrict csys, jiff
else need_vmstat_file = 1;
b = strstr(buff, "intr ");
if(b) sscanf(b, "intr %u", intr);
if(b) sscanf(b, "intr %Lu", &llbuf);
*intr = llbuf;
b = strstr(buff, "ctxt ");
if(b) sscanf(b, "ctxt %u", ctxt);
if(b) sscanf(b, "ctxt %Lu", &llbuf);
*ctxt = llbuf;
b = strstr(buff, "btime ");
if(b) sscanf(b, "btime %u", btime);