From: Jim Warner Date: Sun, 6 Sep 2015 05:00:00 +0000 (-0500) Subject: library: swat (now) obvious bug from PROCPS_PIDS_extra X-Git-Tag: v4.0.0~1044 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c39f4735c0ccde0d75daac76c7d9215e249fb518;p=procps-ng 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 --- diff --git a/proc/pids.c b/proc/pids.c index 16eac33a..37a1e9f0 100644 --- a/proc/pids.c +++ b/proc/pids.c @@ -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 }