From fed746a535ca11a1df35a70ea06e6e2ee618e62e Mon Sep 17 00:00:00 2001 From: Dima Ruban Date: Mon, 6 Oct 1997 18:52:16 +0000 Subject: [PATCH] Be more specific about -f/-t options (they're not yet implemented), not just exit with 0 status. This definitely should go to 2.2.5. If i won't have any objections - I'll commit it tonight. --- usr.bin/vmstat/vmstat.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index 37ba621aab70..ddb434f67916 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)vmstat.c 8.1 (Berkeley) 6/6/93"; #endif static const char rcsid[] = - "$Id$"; + "$Id: vmstat.c,v 1.18 1997/08/25 06:40:05 charnier Exp $"; #endif /* not lint */ #include @@ -71,6 +71,7 @@ static const char rcsid[] = #include #include #include +#include #include #include @@ -103,7 +104,7 @@ struct nlist namelist[] = { { "_kmemstats" }, #define X_KMEMBUCKETS 13 { "_bucket" }, -#ifdef notdef +#ifdef notyet #define X_DEFICIT 14 { "_deficit" }, #define X_FORKSTAT 15 @@ -171,7 +172,7 @@ kvm_t *kd; void cpustats(), dkstats(), dointr(), domem(), dosum(); void dovmstat(), kread(), usage(); -#ifdef notdef +#ifdef notyet void dotimes(), doforkst(); #endif void printhdr __P((void)); @@ -194,11 +195,13 @@ main(argc, argv) case 'c': reps = atoi(optarg); break; -#ifndef notdef case 'f': +#ifdef notyet todo |= FORKSTAT; - break; +#else + errx(EX_USAGE, "sorry, -f is not (re)implemented yet"); #endif + break; case 'i': todo |= INTRSTAT; break; @@ -214,11 +217,13 @@ main(argc, argv) case 's': todo |= SUMSTAT; break; -#ifndef notdef case 't': +#ifdef notyet todo |= TIMESTAT; - break; +#else + errx(EX_USAGE, "sorry, -t is not (re)implemented yet"); #endif + break; case 'w': interval = atoi(optarg); break; @@ -285,7 +290,7 @@ main(argc, argv) } else if (reps) interval = 1; -#ifdef notdef +#ifdef notyet if (todo & FORKSTAT) doforkst(); #endif @@ -293,7 +298,7 @@ main(argc, argv) domem(); if (todo & SUMSTAT) dosum(); -#ifdef notdef +#ifdef notyet if (todo & TIMESTAT) dotimes(); #endif @@ -486,7 +491,7 @@ needhdr() hdrcnt = 1; } -#ifdef notdef +#ifdef notyet void dotimes() { @@ -598,7 +603,7 @@ dosum() #endif } -#ifdef notdef +#ifdef notyet void doforkst() {