procps/proc/status.c

31 lines
695 B
C
Raw Normal View History

// Copyright (C) 1992-1998 by Michael K. Johnson, johnsonm@redhat.com
// Copyright 2002 Albert Cahalan
//
// This file is placed under the conditions of the GNU Library
// General Public License, version 2, or any later version.
// See file COPYING for information on distribution conditions.
2002-02-02 04:17:29 +05:30
2002-10-11 04:10:35 +05:30
#include "procps.h"
#include "readproc.h"
2002-10-10 05:31:37 +05:30
#include "status.h"
2002-02-02 04:17:29 +05:30
2002-12-09 00:26:05 +05:30
const char * status(const proc_t *restrict task) {
2002-02-02 04:17:29 +05:30
static char buf[4] = " ";
buf[0] = task->state;
2002-12-09 00:26:05 +05:30
2002-02-02 04:17:29 +05:30
if (task->rss == 0 && task->state != 'Z')
buf[1] = 'W';
else
buf[1] = ' ';
2002-12-09 00:26:05 +05:30
2002-02-02 04:17:29 +05:30
if (task->nice < 0)
buf[2] = '<';
else if (task->nice > 0)
buf[2] = 'N';
else
buf[2] = ' ';
return(buf);
}