From 5fee2e1a79dc6fc05658821a86b0e7b5678a90dd Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sat, 5 Jan 2008 03:26:41 +0000 Subject: ps: add conditional support for -o [e]time --- libbb/procps.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libbb/procps.c') diff --git a/libbb/procps.c b/libbb/procps.c index 6bc16d166..015ad80ef 100644 --- a/libbb/procps.c +++ b/libbb/procps.c @@ -243,7 +243,8 @@ procps_status_t *procps_scan(procps_status_t* sp, int flags) "%lu %lu " /* utime, stime */ "%*s %*s %*s " /* cutime, cstime, priority */ "%ld " /* nice */ - "%*s %*s %*s " /* timeout, it_real_value, start_time */ + "%*s %*s " /* timeout, it_real_value */ + "%lu " /* start_time */ "%lu " /* vsize */ "%lu " /* rss */ /* "%lu %lu %lu %lu %lu %lu " rss_rlim, start_code, end_code, start_stack, kstk_esp, kstk_eip */ @@ -254,6 +255,7 @@ procps_status_t *procps_scan(procps_status_t* sp, int flags) &sp->pgid, &sp->sid, &tty, &sp->utime, &sp->stime, &tasknice, + &sp->start_time, &vsz, &rss); if (n != 10) @@ -280,7 +282,8 @@ procps_status_t *procps_scan(procps_status_t* sp, int flags) sp->stime = fast_strtoul_10(&cp); cp = skip_fields(cp, 3); /* cutime, cstime, priority */ tasknice = fast_strtoul_10(&cp); - cp = skip_fields(cp, 3); /* timeout, it_real_value, start_time */ + cp = skip_fields(cp, 2); /* timeout, it_real_value */ + sp->start_time = fast_strtoul_10(&cp); /* vsz is in bytes and we want kb */ sp->vsz = fast_strtoul_10(&cp) >> 10; /* vsz is in bytes but rss is in *PAGES*! Can you believe that? */ -- cgit v1.2.3