misc: adapt additional programs to changes, <STAT> api
This patch brings the ps program (very small impact) & that vmstat program (major impact) into agreement with the new <stat> API. In the case of the latter guy, the many separate calls to 'get' should be replaced by one single 'select' call obtaining all data in one stroke. [ but, i was too tired to undertake that enhancement ] Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
14
ps/output.c
14
ps/output.c
@@ -91,15 +91,11 @@ extern long Hertz;
|
||||
|
||||
static void get_boot_time(void)
|
||||
{
|
||||
struct procps_stat *sys_info;
|
||||
if (procps_stat_new(&sys_info) < 0)
|
||||
xerrx(EXIT_FAILURE,
|
||||
_("Unable to create system stat structure"));
|
||||
if (procps_stat_read(sys_info,0) < 0)
|
||||
xerrx(EXIT_FAILURE,
|
||||
_("Unable to read system stat information"));
|
||||
boot_time = procps_stat_sys_get(sys_info, PROCPS_STAT_BTIME);
|
||||
procps_stat_unref(&sys_info);
|
||||
struct procps_statinfo *stat_info = NULL;
|
||||
if (procps_stat_new(&stat_info) < 0)
|
||||
xerrx(EXIT_FAILURE, _("Unable to create NEW ystem stat structure"));
|
||||
boot_time = procps_stat_get(stat_info, PROCPS_STAT_SYS_TIME_OF_BOOT);
|
||||
procps_stat_unref(&stat_info);
|
||||
}
|
||||
|
||||
static void get_memory_total()
|
||||
|
||||
Reference in New Issue
Block a user