1 // Copyright (C) 1992-1998 by Michael K. Johnson, johnsonm@redhat.com 2 // Copyright 2002 Albert Cahalan 3 // 4 // This file is placed under the conditions of the GNU Library 5 // General Public License, version 2, or any later version. 6 // See file COPYING for information on distribution conditions. 7 8 #include "procps.h" 9 #include "readproc.h" 10 #include "status.h" 11 status(const proc_t * restrict task)12const char *status(const proc_t * restrict task) 13 { 14 static char buf[4] = " "; 15 16 buf[0] = task->state; 17 18 if (task->rss == 0 && task->state != 'Z') 19 buf[1] = 'W'; 20 else 21 buf[1] = ' '; 22 23 if (task->nice < 0) 24 buf[2] = '<'; 25 else if (task->nice > 0) 26 buf[2] = 'N'; 27 else 28 buf[2] = ' '; 29 30 return (buf); 31 } 32