]> granicus.if.org Git - procps-ng/commit
library: improve internal 'get' processing, <STAT> api
authorJim Warner <james.warner@comcast.net>
Wed, 1 Jun 2016 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Tue, 7 Jun 2016 11:04:43 +0000 (21:04 +1000)
commit2aaae6f29be47c67a8f4dd035898d62120bf6a62
treead0c53362543746348d885ccb4b7860dd6b22ec2
parentaf0c65900bedbc659ffd2dbb7b45ecddd083ba9f
library: improve internal 'get' processing, <STAT> api

With an eye to the future, rather than managing a long
switch/case construct in the procps_stat_get function,
we'll adopt the approach used in the <meminfo> module.

By making 'get' processing table driven too, just like
'select' is already, that may ease future maintenance.

Along the way a rather large boo-boo was fixed dealing
with that /proc/stat 'procs_running' field which crept
in with the commit referenced below. It wasn't spelled
correctly and thus was never captured as PROC_RUNNING.

Reference(s):
commit abc71a46ada71b790eb526d6cddb91e0d0aed4cb

Signed-off-by: Jim Warner <james.warner@comcast.net>
proc/stat.c
proc/stat.h