Resolve conflicts.
This commit is contained in:
parent
db6a108dbf
commit
337fd7a891
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=89758
@ -164,9 +164,9 @@ struct statics *statics;
|
||||
ip = cpustate_columns;
|
||||
while (*pp != NULL)
|
||||
{
|
||||
*ip++ = cpustate_total_length;
|
||||
if ((i = strlen(*pp++)) > 0)
|
||||
{
|
||||
*ip++ = cpustate_total_length;
|
||||
cpustate_total_length += i + 8;
|
||||
}
|
||||
}
|
||||
@ -279,7 +279,7 @@ time_t *tod;
|
||||
}
|
||||
|
||||
static int ltotal = 0;
|
||||
static char procstates_buffer[128];
|
||||
static char procstates_buffer[MAX_COLS];
|
||||
|
||||
/*
|
||||
* *_procstates(total, brkdn, names) - print the process summary line
|
||||
@ -321,7 +321,7 @@ int total;
|
||||
int *brkdn;
|
||||
|
||||
{
|
||||
static char new[128];
|
||||
static char new[MAX_COLS];
|
||||
register int i;
|
||||
|
||||
/* update number of processes only if it has changed */
|
||||
@ -467,7 +467,7 @@ register int *states;
|
||||
((double)value)/10.);
|
||||
|
||||
/* remember it for next time */
|
||||
*lp = *states;
|
||||
*lp = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
/*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file defines the interface between top and the machine-dependent
|
||||
* module. It is NOT machine dependent and should not need to be changed
|
||||
@ -22,12 +26,18 @@ struct statics
|
||||
* the system_info struct is filled in by a machine dependent routine.
|
||||
*/
|
||||
|
||||
#ifdef p_active /* uw7 define macro p_active */
|
||||
#define P_ACTIVE p_pactive
|
||||
#else
|
||||
#define P_ACTIVE p_active
|
||||
#endif
|
||||
|
||||
struct system_info
|
||||
{
|
||||
int last_pid;
|
||||
double load_avg[NUM_AVERAGES];
|
||||
int p_total;
|
||||
int p_active; /* number of procs considered "active" */
|
||||
int P_ACTIVE; /* number of procs considered "active" */
|
||||
int *procstates;
|
||||
int *cpustates;
|
||||
int *memory;
|
||||
|
@ -7,6 +7,8 @@
|
||||
*
|
||||
* Copyright (c) 1984, 1989, William LeFebvre, Rice University
|
||||
* Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -324,24 +326,42 @@ long *diffs;
|
||||
/*
|
||||
* errmsg(errnum) - return an error message string appropriate to the
|
||||
* error number "errnum". This is a substitute for the System V
|
||||
* function "strerror" with one important difference: the string
|
||||
* returned by this function does NOT end in a newline!
|
||||
* N.B.: there appears to be no reliable way to determine if
|
||||
* "strerror" exists at compile time, so I make do by providing
|
||||
* something of similar functionality.
|
||||
* function "strerror". There appears to be no reliable way to
|
||||
* determine if "strerror" exists at compile time, so I make do
|
||||
* by providing something of similar functionality. For those
|
||||
* systems that have strerror and NOT errlist, define
|
||||
* -DHAVE_STRERROR in the module file and this function will
|
||||
* use strerror.
|
||||
*/
|
||||
|
||||
/* externs referenced by errmsg */
|
||||
|
||||
#ifndef HAVE_STRERROR
|
||||
#ifndef SYS_ERRLIST_DECLARED
|
||||
#define SYS_ERRLIST_DECLARED
|
||||
extern char *sys_errlist[];
|
||||
#endif
|
||||
|
||||
extern int sys_nerr;
|
||||
#endif
|
||||
|
||||
char *errmsg(errnum)
|
||||
|
||||
int errnum;
|
||||
|
||||
{
|
||||
#ifdef HAVE_STRERROR
|
||||
char *msg = strerror(errnum);
|
||||
if (msg != NULL)
|
||||
{
|
||||
return msg;
|
||||
}
|
||||
#else
|
||||
if (errnum > 0 && errnum < sys_nerr)
|
||||
{
|
||||
return((char *)sys_errlist[errnum]);
|
||||
}
|
||||
#endif
|
||||
return("No error");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user