summaryrefslogtreecommitdiffstats
path: root/sbin/sysctl/sysctl.8
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1995-12-21 12:39:25 +0000
committerphk <phk@FreeBSD.org>1995-12-21 12:39:25 +0000
commit160da4bc8b11d5bd77d01a089018767822aa8995 (patch)
treef3e24d02e5a7a6b4d3c8ff434f3ed95b2dd53f6a /sbin/sysctl/sysctl.8
parent15fd08703140e2413a5a6c4c6e6fb23c8310efba (diff)
downloadFreeBSD-src-160da4bc8b11d5bd77d01a089018767822aa8995.zip
FreeBSD-src-160da4bc8b11d5bd77d01a089018767822aa8995.tar.gz
The rewamped sysctl program that will find all the variables itself.
Also a couple of handy new options.
Diffstat (limited to 'sbin/sysctl/sysctl.8')
-rw-r--r--sbin/sysctl/sysctl.852
1 files changed, 42 insertions, 10 deletions
diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8
index 931ac35..c09b418 100644
--- a/sbin/sysctl/sysctl.8
+++ b/sbin/sysctl/sysctl.8
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93
-.\" $Id: sysctl.8,v 1.5 1995/02/16 00:28:40 wollman Exp $
+.\" $Id: sysctl.8,v 1.6 1995/02/20 19:42:42 guido Exp $
.\"
.Dd September 23, 1994
.Dt SYSCTL 8
@@ -40,15 +40,15 @@
.Nd get or set kernel state
.Sh SYNOPSIS
.Nm sysctl
-.Op Fl n
+.Op Fl bn
.Ar name ...
.Nm sysctl
-.Op Fl n
+.Op Fl bn
.Fl w
.Ar name=value ...
.Nm sysctl
-.Op Fl n
-.Fl aA
+.Op Fl bn
+.Fl aAX
.Sh DESCRIPTION
The
.Nm sysctl
@@ -57,16 +57,25 @@ appropriate privilege to set kernel state.
The state to be retrieved or set is described using a
``Management Information Base'' (``MIB'') style name,
described as a dotted set of components.
+.Pp
The
.Fl a
flag can be used to list all the currently available string or integer values.
+.Pp
The
.Fl A
-flag will list all the known MIB names including tables.
+flag will list all the known MIB names including opaques.
Those with string or integer values will be printed as with the
.Fl a
-flag; for the table values,
-the name of the utility to retrieve them is given.
+flag; for the opaque values,
+information about the format and the length is printed in addition the first
+few bytes is dumped in hex.
+.Pp
+The
+.Fl X
+flag is the same as
+.Fl A
+except the entire value of opaque variables is hexdumped.
.Pp
The
.Fl n
@@ -78,6 +87,12 @@ For example, to save the pagesize in variable psize, use:
set psize=`sysctl -n hw.pagesize`
.Ed
.Pp
+The
+.Fl b
+flag forces 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.
+.Pp
If just a MIB style name is given,
the corresponding value is retrieved.
If a value is to be set, the
@@ -87,16 +102,21 @@ by an equal sign and the new value to be used.
.Pp
The information available from
.Nm sysctl
-consists of integers, strings, and tables.
-The tabular information can only be retrieved by special
+consists of integers, strings, and opaques.
+.Nm sysctl
+only knows about a couple of opaque types, and will resort to hexdumps
+for the rest.
+The opaque information is much more useful if retrieved by special
purpose programs such as
.Nm ps ,
.Nm systat ,
and
.Nm netstat .
+.Pp
The string and integer information is summaried below.
For a detailed description of these variable see
.Xr sysctl 3 .
+.Pp
The changeable column indicates whether a process with appropriate
privilege can change the value.
.Bl -column net.inet.ip.forwardingxxxxxx integerxxx
@@ -187,6 +207,10 @@ Information about the load average history may be obtained with
.Bd -literal -offset indent -compact
sysctl vm.loadavg
.Ed
+.Pp
+More variables than these exist, and the best and likely only place
+to search for their deeper meaning is undoubtedly the source where
+they are defined.
.Sh FILES
.Bl -tag -width <netinet/icmpXvar.h> -compact
.It Pa <sys/sysctl.h>
@@ -208,6 +232,14 @@ definitions for fourth level UDP identifiers
.El
.Sh SEE ALSO
.Xr sysctl 3
+.Sh BUGS
+.Nm sysctl
+presently exploits an undocumented interface to the kernel
+sysctl facility to traverse the sysctl tree and to retrive format
+and name information.
+This correct interface is being thought about for the time being.
.Sh HISTORY
.Nm sysctl
first appeared in 4.4BSD.
+.Pp
+In FreeBSD 2.2 sysctl was significantly remodeled.
OpenPOWER on IntegriCloud