$TOPRC, eliminate status() fn, avoid /proc/*/stat more

This commit is contained in:
albert
2004-08-30 17:30:41 +00:00
parent 0d77d98bf3
commit 55b3e73334
4 changed files with 15 additions and 65 deletions

View File

@@ -1,30 +0,0 @@
// 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.
#include "procps.h"
#include "readproc.h"
#include "status.h"
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)
buf[2] = 'N';
else
buf[2] = ' ';
return(buf);
}

View File

@@ -1,12 +0,0 @@
#ifndef PROC_STATUS_H
#define PROC_STATUS_H
#include "procps.h"
EXTERN_C_BEGIN
extern const char * status(const proc_t *restrict task);
EXTERN_C_END
#endif