aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/systat
diff options
context:
space:
mode:
authorPhilippe Charnier <charnier@FreeBSD.org>1997-08-13 06:45:11 +0000
committerPhilippe Charnier <charnier@FreeBSD.org>1997-08-13 06:45:11 +0000
commitd8793dfac31358bc82c7de0974dd9a78970dfa5f (patch)
tree0e558448bd8a94568c7e45e156eaa76b4b78359d /usr.bin/systat
parenta2940c0e75ae4c28015e0581b21a34aba7be64ab (diff)
downloadsrc-d8793dfac31358bc82c7de0974dd9a78970dfa5f.tar.gz
src-d8793dfac31358bc82c7de0974dd9a78970dfa5f.zip
Use err(3). /sys/dkstat.h -> /usr/include/sys/dkstat.h
Notes
Notes: svn path=/head/; revision=28149
Diffstat (limited to 'usr.bin/systat')
-rw-r--r--usr.bin/systat/main.c29
-rw-r--r--usr.bin/systat/systat.115
-rw-r--r--usr.bin/systat/vmstat.c19
3 files changed, 32 insertions, 31 deletions
diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c
index 78dd7169a2d7..6ddee0e4e302 100644
--- a/usr.bin/systat/main.c
+++ b/usr.bin/systat/main.c
@@ -38,11 +38,16 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
+#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
+#include <err.h>
#include <locale.h>
#include <nlist.h>
#include <signal.h>
@@ -91,16 +96,10 @@ main(argc, argv)
struct cmdtab *p;
p = lookup(&argv[0][1]);
- if (p == (struct cmdtab *)-1) {
- fprintf(stderr, "%s: ambiguous request\n",
- &argv[0][1]);
- exit(1);
- }
- if (p == (struct cmdtab *)0) {
- fprintf(stderr, "%s: unknown request\n",
- &argv[0][1]);
- exit(1);
- }
+ if (p == (struct cmdtab *)-1)
+ errx(1, "%s: ambiguous request", &argv[0][1]);
+ if (p == (struct cmdtab *)0)
+ errx(1, "%s: unknown request", &argv[0][1]);
curcmd = p;
} else {
naptime = atoi(argv[0]);
@@ -128,22 +127,20 @@ main(argc, argv)
CMDLINE = LINES - 1;
wnd = (*curcmd->c_open)();
if (wnd == NULL) {
- fprintf(stderr, "Couldn't initialize display.\n");
+ warnx("couldn't initialize display");
die(0);
}
wload = newwin(1, 0, 3, 20);
if (wload == NULL) {
- fprintf(stderr, "Couldn't set up load average window.\n");
+ warnx("couldn't set up load average window");
die(0);
}
if (kvm_nlist(kd, namelist)) {
nlisterr(namelist);
exit(1);
}
- if (namelist[X_FIRST].n_type == 0) {
- fprintf(stderr, "couldn't read namelist.\n");
- exit(1);
- }
+ if (namelist[X_FIRST].n_type == 0)
+ errx(1, "couldn't read namelist");
gethostname(hostname, sizeof (hostname));
NREAD(X_HZ, &hz, LONG);
NREAD(X_STATHZ, &stathz, LONG);
diff --git a/usr.bin/systat/systat.1 b/usr.bin/systat/systat.1
index a4870248b9ab..1280a114bc81 100644
--- a/usr.bin/systat/systat.1
+++ b/usr.bin/systat/systat.1
@@ -38,7 +38,7 @@
.Nm systat
.Nd display system statistics on a crt
.Sh SYNOPSIS
-.Nm systat
+.Nm
.Op Fl display
.Op Ar refresh-interval
.Sh DESCRIPTION
@@ -48,7 +48,7 @@ using the curses screen display library,
.Xr curses 3 .
.Pp
While
-.Nm systat
+.Nm
is running the screen is usually divided into two windows (an exception
is the vmstat display which uses the entire screen). The
upper window depicts the current system load average. The
@@ -57,7 +57,7 @@ user commands. The last line on the screen is reserved for user
input and error messages.
.Pp
By default
-.Nm systat
+.Nm
displays the processes getting the largest percentage of the processor
in the lower window. Other displays show swap space usage, disk
.Tn I/O
@@ -164,7 +164,7 @@ on disk throughput show, for each drive, kilobytes of data transferred,
number of disk transactions performed, and average seek time
(in milliseconds). This information may be displayed as
bar graphs or as rows of numbers which scroll downward. Bar
-graphs are shown by default;
+graphs are shown by default.
.Pp
The following commands are specific to the
.Ic iostat
@@ -247,8 +247,9 @@ of kilobyte blocks transferred per second averaged over the
refresh period of the display (by default, five seconds).
For some disks it also reports the average milliseconds per seek.
Note that the system only keeps statistics on at most eight disks
-(this is controlled by the constant DK_NDRIVE in /sys/dkstat.h as
-a kernel compile-time constant).
+(this is controlled by the constant DK_NDRIVE in
+.Pa /usr/include/sys/dkstat.h
+as a kernel compile-time constant).
.Pp
Under the date in the upper right hand quadrant are statistics
on paging and swapping activity.
@@ -414,7 +415,7 @@ For port names.
.El
.Sh HISTORY
The
-.Nm systat
+.Nm
program appeared in
.Bx 4.3 .
.Sh BUGS
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index 1436234c995d..316aa797d990 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -32,7 +32,11 @@
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
/*
@@ -52,15 +56,16 @@ static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94";
#include <vm/vm_param.h>
-#include <signal.h>
-#include <nlist.h>
#include <ctype.h>
-#include <utmp.h>
+#include <err.h>
+#include <nlist.h>
#include <paths.h>
-#include <string.h>
+#include <signal.h>
#include <stdlib.h>
+#include <string.h>
#include <time.h>
#include <unistd.h>
+#include <utmp.h>
#include "systat.h"
#include "extern.h"
@@ -626,10 +631,8 @@ allocinfo(s)
{
s->intrcnt = (long *) calloc(nintr, sizeof(long));
- if (s->intrcnt == NULL) {
- fprintf(stderr, "systat: out of memory\n");
- exit(2);
- }
+ if (s->intrcnt == NULL)
+ errx(2, "out of memory");
}
static void