summaryrefslogtreecommitdiffstats
path: root/sbin/sysctl
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>1999-11-22 08:38:29 +0000
committerdes <des@FreeBSD.org>1999-11-22 08:38:29 +0000
commitebb4d4db224a550cd1582e5c989d693fae40304d (patch)
tree7d375f40e24b5754cc4e9534959e94d32978f088 /sbin/sysctl
parentf718803a245e6b52ce9a54769ec18141b98953cd (diff)
downloadFreeBSD-src-ebb4d4db224a550cd1582e5c989d693fae40304d.zip
FreeBSD-src-ebb4d4db224a550cd1582e5c989d693fae40304d.tar.gz
Belatedly back out rev. 1.20.
Diffstat (limited to 'sbin/sysctl')
-rw-r--r--sbin/sysctl/sysctl.87
-rw-r--r--sbin/sysctl/sysctl.c27
2 files changed, 9 insertions, 25 deletions
diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8
index 599e36f..611637a 100644
--- a/sbin/sysctl/sysctl.8
+++ b/sbin/sysctl/sysctl.8
@@ -40,14 +40,14 @@
.Nd get or set kernel state
.Sh SYNOPSIS
.Nm sysctl
-.Op Fl bdn
+.Op Fl bn
.Ar name ...
.Nm sysctl
.Op Fl bn
.Fl w
.Ar name=value ...
.Nm sysctl
-.Op Fl bdn
+.Op Fl bn
.Fl aAX
.Sh DESCRIPTION
The
@@ -85,9 +85,6 @@ set psize=`sysctl -n hw.pagesize`
Force the value of the variable(s) to be output in raw, binary
format. No names are printed and no terminating newlines are output.
This is mostly useful with a single variable.
-.It Fl d
-Display the description rather than the value of the requested
-variable(s).
.It Fl w Ar name=value ...
Set the MIB
.Ar name
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
index 5b5672c..fb7c305 100644
--- a/sbin/sysctl/sysctl.c
+++ b/sbin/sysctl/sysctl.c
@@ -58,7 +58,7 @@ static const char rcsid[] =
#include <string.h>
#include <unistd.h>
-static int Aflag, aflag, bflag, dflag, nflag, wflag, Xflag;
+static int Aflag, aflag, bflag, nflag, wflag, Xflag;
static int oidfmt(int *, int, char *, u_int *);
static void parse(char *);
@@ -71,11 +71,11 @@ usage(void)
{
(void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n",
- "usage: sysctl [-bdn] variable ...",
+ "usage: sysctl [-bn] variable ...",
" sysctl [-bn] -w variable=value ...",
- " sysctl [-bdn] -a",
- " sysctl [-bdn] -A",
- " sysctl [-bdn] -X");
+ " sysctl [-bn] -a",
+ " sysctl [-bn] -A",
+ " sysctl [-bn] -X");
exit(1);
}
@@ -86,12 +86,11 @@ main(int argc, char **argv)
setbuf(stdout,0);
setbuf(stderr,0);
- while ((ch = getopt(argc, argv, "AabdnwX")) != -1) {
+ while ((ch = getopt(argc, argv, "AabnwX")) != -1) {
switch (ch) {
case 'A': Aflag = 1; break;
case 'a': aflag = 1; break;
case 'b': bflag = 1; break;
- case 'd': dflag = 1; break;
case 'n': nflag = 1; break;
case 'w': wflag = 1; break;
case 'X': Xflag = Aflag = 1; break;
@@ -101,7 +100,7 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
- if (wflag && (Aflag || aflag || dflag))
+ if (wflag && (Aflag || aflag))
usage();
if (Aflag || aflag)
exit (sysctl_all(0, 0));
@@ -356,18 +355,6 @@ show_var(int *oid, int nlen)
if (i || !j)
err(1, "sysctl name %d %d %d", i, j, errno);
- if (dflag) {
- qoid[1] = 5;
- j = sizeof descr;
- i = sysctl(qoid, nlen + 2, descr, &j, 0, 0);
- if (i || !j)
- err(1, "sysctl name %d %d %d", i, j, errno);
- if (!nflag)
- printf("%s: ", name);
- printf("%s", descr[0] ? descr : "[no description]");
- return (0);
- }
-
/* find an estimate of how much we need for this var */
j = 0;
i = sysctl(oid, nlen, 0, &j, 0, 0);
OpenPOWER on IntegriCloud