File: status.c

package info (click to toggle)
grmonitor 0.53-6
  • links: PTS
  • area: main
  • in suites: slink
  • size: 280 kB
  • ctags: 418
  • sloc: ansic: 2,660; makefile: 130
file content (20 lines) | stat: -rw-r--r-- 364 bytes parent folder | download | duplicates (2)
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);
}