summaryrefslogtreecommitdiffstats
path: root/usr.bin/vmstat
diff options
context:
space:
mode:
authordima <dima@FreeBSD.org>1997-10-06 18:52:16 +0000
committerdima <dima@FreeBSD.org>1997-10-06 18:52:16 +0000
commitc345be185126458d145656f14d79eaa889c2f7c3 (patch)
tree291e3a0460493707f08faf58c0043abe3f39cd6e /usr.bin/vmstat
parentb94cf466deadb033a61bcb7f1e568b23f22bf255 (diff)
downloadFreeBSD-src-c345be185126458d145656f14d79eaa889c2f7c3.zip
FreeBSD-src-c345be185126458d145656f14d79eaa889c2f7c3.tar.gz
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.
Diffstat (limited to 'usr.bin/vmstat')
-rw-r--r--usr.bin/vmstat/vmstat.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index 37ba621..ddb434f 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 <sys/param.h>
@@ -71,6 +71,7 @@ static const char rcsid[] =
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sysexits.h>
#include <time.h>
#include <unistd.h>
@@ -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()
{
OpenPOWER on IntegriCloud