From: albert <> Date: Sun, 8 Dec 2002 18:56:05 +0000 (+0000) Subject: status.h X-Git-Tag: v3.3.0~309 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c7cb0983b4db30c058e9572c9fcec53cb38ce8cb;p=procps-ng status.h --- diff --git a/proc/status.c b/proc/status.c index 83a53b78..93ba36f6 100644 --- a/proc/status.c +++ b/proc/status.c @@ -11,14 +11,16 @@ #include "readproc.h" #include "status.h" -char * status(proc_t* task) { +const char * status(const proc_t *restrict task) { static char buf[4] = " "; buf[0] = task->state; + if (task->rss == 0 && task->state != 'Z') buf[1] = 'W'; else buf[1] = ' '; + if (task->nice < 0) buf[2] = '<'; else if (task->nice > 0) diff --git a/proc/status.h b/proc/status.h index 562efae4..8eefe790 100644 --- a/proc/status.h +++ b/proc/status.h @@ -1,4 +1,4 @@ #ifndef __PROC_STATUS_H #define __PROC_STATUS_H -extern char *status(proc_t* task); +extern const char * status(const proc_t *restrict task); #endif