Use err(3). /sys/dkstat.h -> /usr/include/sys/dkstat.h
This commit is contained in:
parent
a2940c0e75
commit
d8793dfac3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=28149
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user