File: status.c

package info (click to toggle)
grmonitor 0.81-4.2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,556 kB
  • ctags: 1,767
  • sloc: ansic: 12,657; python: 186; makefile: 175
file content (20 lines) | stat: -rw-r--r-- 364 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "proc/ps.h"
#include "proc/readproc.h"

char * status(proc_t* 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)
	buf[2] = 'N';
    else
	buf[2] = ' ';

    return(buf);
}