summaryrefslogtreecommitdiffstats
path: root/contrib/top
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2002-01-24 17:58:42 +0000
committerdwmalone <dwmalone@FreeBSD.org>2002-01-24 17:58:42 +0000
commitc48987263d3f55042a1e5d0c5e8411ed21161f2d (patch)
tree77ba8c0759d802c8505f8c156c2ba17717d80db5 /contrib/top
parent37a39754f41e50ca628e970dc78475098d1c10c5 (diff)
downloadFreeBSD-src-c48987263d3f55042a1e5d0c5e8411ed21161f2d.zip
FreeBSD-src-c48987263d3f55042a1e5d0c5e8411ed21161f2d.tar.gz
Resolve conflicts.
Diffstat (limited to 'contrib/top')
-rw-r--r--contrib/top/display.c8
-rw-r--r--contrib/top/machine.h12
-rw-r--r--contrib/top/utils.c30
3 files changed, 40 insertions, 10 deletions
diff --git a/contrib/top/display.c b/contrib/top/display.c
index 2a39072..22a940a 100644
--- a/contrib/top/display.c
+++ b/contrib/top/display.c
@@ -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;
}
}
diff --git a/contrib/top/machine.h b/contrib/top/machine.h
index 0f14bf3..4f4f6af 100644
--- a/contrib/top/machine.h
+++ b/contrib/top/machine.h
@@ -1,4 +1,8 @@
/*
+ * $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
* for any specific machine.
@@ -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;
diff --git a/contrib/top/utils.c b/contrib/top/utils.c
index 94233de..906170a 100644
--- a/contrib/top/utils.c
+++ b/contrib/top/utils.c
@@ -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");
}
OpenPOWER on IntegriCloud