library: swat (now) obvious bug from PROCPS_PIDS_extra

I can't remember during what sleepy hour that enum was
added to pids.h, but it damn sure fell short of a full
implementation by approximately 1,000,000 miles or so.

Strangely it surfaced on Craig's system seemingly ggdb
related whereas on mine, a segmentation fault was only
seen when that -h (no header) argument was being used.

Oh well, the road to its resolution also offered us an
opportunity to cleanup some other items along the way.

Reference(s):
http://www.freelists.org/post/procps/newlib-at-the-precipice,4

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2015-09-06 00:00:00 -05:00 committed by Craig Small
parent 34395be330
commit c39f4735c0

View File

@ -222,6 +222,7 @@ setDECL(VM_USED) { (void)I; R->result.ul_int = P->vm_swap + P->vm_rss; }
REG_set(VSIZE_PGS, ul_int, vsize)
ADR_set(WCHAN_ADDR, addr, wchan)
setDECL(WCHAN_NAME) { (void)I; R->result.str = strdup(lookup_wchan(P->tid)); }
setDECL(xtra) { (void)I; (void)R; (void)P; return; }
setDECL(noop) { (void)I; (void)R; (void)P; return; }
setDECL(logical_end) { (void)I; (void)R; (void)P; return; }
setDECL(physical_end) { (void)I; (void)R; (void)P; return; }
@ -461,6 +462,7 @@ static struct {
{ RS(VSIZE_PGS), f_stat, NULL, QS(ul_int), 0 },
{ RS(WCHAN_ADDR), f_stat, NULL, QS(addr), 0 },
{ RS(WCHAN_NAME), 0, FF(str), QS(str), 0 },
{ RS(xtra), 0, NULL, QS(noop), 0 },
{ RS(noop), 0, NULL, QS(noop), 0 },
{ RS(logical_end), 0, NULL, QS(noop), 0 },
{ RS(physical_end), 0, NULL, QS(noop), 0 }