From c7cb0983b4db30c058e9572c9fcec53cb38ce8cb Mon Sep 17 00:00:00 2001 From: albert <> Date: Sun, 8 Dec 2002 18:56:05 +0000 Subject: [PATCH] status.h --- proc/status.c | 4 +++- proc/status.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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