diff options
author | charnier <charnier@FreeBSD.org> | 1997-08-13 06:45:11 +0000 |
---|---|---|
committer | charnier <charnier@FreeBSD.org> | 1997-08-13 06:45:11 +0000 |
commit | d1a307d129d105dee069f5755f92a715d49cccc7 (patch) | |
tree | a615e79d13bf22177e06df7420227f7a27a61a12 /usr.bin/systat | |
parent | 30f274935dad98d54395e3b115cbd6b314a87ec2 (diff) | |
download | FreeBSD-src-d1a307d129d105dee069f5755f92a715d49cccc7.zip FreeBSD-src-d1a307d129d105dee069f5755f92a715d49cccc7.tar.gz |
Use err(3). /sys/dkstat.h -> /usr/include/sys/dkstat.h
Diffstat (limited to 'usr.bin/systat')
-rw-r--r-- | usr.bin/systat/main.c | 29 | ||||
-rw-r--r-- | usr.bin/systat/systat.1 | 15 | ||||
-rw-r--r-- | usr.bin/systat/vmstat.c | 19 |
3 files changed, 32 insertions, 31 deletions
diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c index 78dd716..6ddee0e 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 a487024..1280a11 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 1436234..316aa79 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 |