bc616b3615
Gosh, just because nobody uses some newlib provision I guess, since it is being offered, it ought to actually be tested at some point. Well, that point just arrived and guess what? A surprise: some bugs were discovered. The procps_pids_select function established a for loop wherein readproc is called until the passed 'maxthese' limit. Unfortunately this was incorrect for 2 reasons: 1. For PROCPS_FILL_PID results are limited by what the oldlib finds, having established the pid list at open. Total found already cannot exceed a passed 'maxthese'; 2. With PROCPS_FILL_UID, returned results could exceed a 'maxthese' thus making the for loop incorrect again. [ plus yours truly neglected to forward the required ] [ UIDs total to our old library, another oops biggie ] In summary: the loop should have been forever, exiting only when all those identified procs had been located. So, while addressing those bugs, I've consolidated all the retrieval code (initialize, iterate, summarize) in a single helper function which will now serve both the procps_pids_reap and select functions. And as a result those guys were reduced to quite trivial housekeeping. This patch, hopefully, completes the normalization for reap/select (fill), which began with references shown. Reference(s): commit |
||
---|---|---|
.. | ||
.gitignore | ||
alloc.c | ||
alloc.h | ||
COPYING | ||
devname.c | ||
devname.h | ||
diskstat.c | ||
diskstat.h | ||
escape.c | ||
escape.h | ||
libprocps.pc.in | ||
libprocps.sym | ||
meminfo.c | ||
meminfo.h | ||
namespace.c | ||
namespace.h | ||
openproc.3 | ||
pids.c | ||
pids.h | ||
procps-private.h | ||
procps.h | ||
pwcache.c | ||
pwcache.h | ||
readproc.3 | ||
readproc.c | ||
readproc.h | ||
readproctab.3 | ||
readstat.c | ||
readstat.h | ||
slab.c | ||
slab.h | ||
sysinfo.c | ||
sysinfo.h | ||
test_namespace.c | ||
test_sysinfo.c | ||
uptime.c | ||
uptime.h | ||
version.c | ||
version.h | ||
vmstat.c | ||
vmstat.h | ||
wchan.c | ||
wchan.h |