top(1): further unconditionally assume we're on FreeBSD

This commit is contained in:
Eitan Adler 2018-05-21 04:02:45 +00:00
parent 1d6a4ba350
commit 47ffa267d7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=333960
4 changed files with 2 additions and 44 deletions

View File

@ -489,13 +489,11 @@ renice_procs(char *str)
prio = -prio;
}
#if defined(PRIO_MIN) && defined(PRIO_MAX)
/* check for validity */
if (procnum == -1 || prio < PRIO_MIN || prio > PRIO_MAX)
{
return(" bad priority value");
}
#endif
/* move to the first process number */
if ((str = next_field(str)) == NULL)

View File

@ -441,40 +441,6 @@ int *brkdn;
}
}
#ifdef no_more
/*
* *_cpustates(states, names) - print the cpu state percentages
*
* Assumptions: cursor is on the PREVIOUS line
*/
/* cpustates_tag() calculates the correct tag to use to label the line */
char *cpustates_tag()
{
char *use;
static char *short_tag = "CPU: ";
static char *long_tag = "CPU states: ";
/* if length + strlen(long_tag) >= screen_width, then we have to
use the shorter tag (we subtract 2 to account for ": ") */
if (cpustate_total_length + (int)strlen(long_tag) - 2 >= screen_width)
{
use = short_tag;
}
else
{
use = long_tag;
}
/* set cpustates_column accordingly then return result */
cpustates_column = strlen(use);
return(use);
}
#endif
void
i_cpustates(states)

View File

@ -13,7 +13,6 @@ void clear_message(void);
int display_resize(void);
void i_header(char *text);
char *printable(char *string);
char *cpustates_tag(void);
void display_header(int t);
int display_init(struct statics *statics);
void i_arc(int *stats);

View File

@ -42,8 +42,9 @@
#include <vis.h>
#include "top.h"
#include "machine.h"
#include "display.h"
#include "machine.h"
#include "loadavg.h"
#include "screen.h"
#include "utils.h"
#include "layout.h"
@ -56,11 +57,7 @@ extern struct process_select ps;
extern struct timeval timeout;
static int smpmode;
enum displaymodes displaymode;
#ifdef TOP_USERNAME_LEN
static int namelength = TOP_USERNAME_LEN;
#else
static int namelength = 8;
#endif
/* TOP_JID_LEN based on max of 999999 */
#define TOP_JID_LEN 7
#define TOP_SWAP_LEN 6
@ -75,8 +72,6 @@ struct handle {
int remaining; /* number of pointers remaining */
};
/* declarations for load_avg */
#include "loadavg.h"
/* define what weighted cpu is. */
#define weighted_cpu(pct, pp) ((pp)->ki_swtime == 0 ? 0.0 : \