status.h
This commit is contained in:
parent
ab8b5f314d
commit
c7cb0983b4
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user