sysctl.8 (28917) | sysctl.8 (30602) |
---|---|
1.\" Copyright (c) 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 16 unchanged lines hidden (view full) --- 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 | 1.\" Copyright (c) 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 16 unchanged lines hidden (view full) --- 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 |
33.\" $Id: sysctl.8,v 1.12 1997/02/22 16:13:58 peter Exp $ | 33.\" $Id: sysctl.8,v 1.13 1997/08/30 02:28:00 kato Exp $ |
34.\" 35.Dd September 23, 1994 36.Dt SYSCTL 8 37.Os 38.Sh NAME 39.Nm sysctl 40.Nd get or set kernel state 41.Sh SYNOPSIS --- 4 unchanged lines hidden (view full) --- 46.Op Fl bn 47.Fl w 48.Ar name=value ... 49.Nm sysctl 50.Op Fl bn 51.Fl aAX 52.Sh DESCRIPTION 53The | 34.\" 35.Dd September 23, 1994 36.Dt SYSCTL 8 37.Os 38.Sh NAME 39.Nm sysctl 40.Nd get or set kernel state 41.Sh SYNOPSIS --- 4 unchanged lines hidden (view full) --- 46.Op Fl bn 47.Fl w 48.Ar name=value ... 49.Nm sysctl 50.Op Fl bn 51.Fl aAX 52.Sh DESCRIPTION 53The |
54.Nm sysctl | 54.Nm |
55utility retrieves kernel state and allows processes with 56appropriate privilege to set kernel state. 57The state to be retrieved or set is described using a 58``Management Information Base'' (``MIB'') style name, 59described as a dotted set of components. 60.Pp | 55utility retrieves kernel state and allows processes with 56appropriate privilege to set kernel state. 57The state to be retrieved or set is described using a 58``Management Information Base'' (``MIB'') style name, 59described as a dotted set of components. 60.Pp |
61The 62.Fl a 63flag can be used to list all the currently available string or integer values. 64.Pp 65The 66.Fl A 67flag will list all the known MIB names including opaques. | 61The following options are available: 62.Bl -tag -width indent 63.It Fl a 64List all the currently available string or integer values. 65.It Fl A 66List all the known MIB names including opaques. |
68Those with string or integer values will be printed as with the 69.Fl a 70flag; for the opaque values, 71information about the format and the length is printed in addition the first 72few bytes is dumped in hex. | 67Those with string or integer values will be printed as with the 68.Fl a 69flag; for the opaque values, 70information about the format and the length is printed in addition the first 71few bytes is dumped in hex. |
73.Pp 74The 75.Fl X 76flag is the same as | 72.It Fl X 73Same as |
77.Fl A 78except the entire value of opaque variables is hexdumped. | 74.Fl A 75except the entire value of opaque variables is hexdumped. |
79.Pp 80The 81.Fl n 82flag specifies that the printing of the field name should be | 76.It Fl n 77Specify that the printing of the field name should be |
83suppressed and that only its value should be output. 84This flag is useful for setting shell variables. 85For example, to save the pagesize in variable psize, use: 86.Bd -literal -offset indent -compact 87set psize=`sysctl -n hw.pagesize` 88.Ed | 78suppressed and that only its value should be output. 79This flag is useful for setting shell variables. 80For example, to save the pagesize in variable psize, use: 81.Bd -literal -offset indent -compact 82set psize=`sysctl -n hw.pagesize` 83.Ed |
89.Pp 90The 91.Fl b 92flag forces the value of the variable(s) to be output in raw, binary | 84.It Fl b 85Force the value of the variable(s) to be output in raw, binary |
93format. No names are printed and no terminating newlines are output. 94This is mostly useful with a single variable. | 86format. No names are printed and no terminating newlines are output. 87This is mostly useful with a single variable. |
95.Pp 96If just a MIB style name is given, | 88.It Fl w Ar name=value ... 89Set the MIB 90.Ar name 91to the new 92.Ar value . 93If just a MIB style 94.Ar name 95is given, |
97the corresponding value is retrieved. | 96the corresponding value is retrieved. |
98If a value is to be set, the 99.Fl w 100flag must be specified and the MIB name followed 101by an equal sign and the new value to be used. | 97.El |
102.Pp 103The information available from | 98.Pp 99The information available from |
104.Nm sysctl | 100.Nm |
105consists of integers, strings, and opaques. | 101consists of integers, strings, and opaques. |
106.Nm sysctl | 102.Nm Sysctl |
107only knows about a couple of opaque types, and will resort to hexdumps 108for the rest. 109The opaque information is much more useful if retrieved by special 110purpose programs such as 111.Nm ps , 112.Nm systat , 113and 114.Nm netstat . --- 59 unchanged lines hidden (view full) --- 174.It user.posix2_fort_run integer no 175.It user.posix2_localedef integer no 176.It user.posix2_sw_dev integer no 177.It user.posix2_upe integer no 178.It user.stream_max integer no 179.It user.tzname_max integer no 180.El 181.Sh EXAMPLES | 103only knows about a couple of opaque types, and will resort to hexdumps 104for the rest. 105The opaque information is much more useful if retrieved by special 106purpose programs such as 107.Nm ps , 108.Nm systat , 109and 110.Nm netstat . --- 59 unchanged lines hidden (view full) --- 170.It user.posix2_fort_run integer no 171.It user.posix2_localedef integer no 172.It user.posix2_sw_dev integer no 173.It user.posix2_upe integer no 174.It user.stream_max integer no 175.It user.tzname_max integer no 176.El 177.Sh EXAMPLES |
182.Pp | |
183For example, to retrieve the maximum number of processes allowed 184in the system, one would use the follow request: 185.Bd -literal -offset indent -compact 186sysctl kern.maxproc 187.Ed 188.Pp 189To set the maximum number of processes allowed 190in the system to 1000, one would use the follow request: 191.Bd -literal -offset indent -compact 192sysctl -w kern.maxproc=1000 193.Ed 194.Pp 195Information about the system clock rate may be obtained with: 196.Bd -literal -offset indent -compact 197sysctl kern.clockrate 198.Ed 199.Pp | 178For example, to retrieve the maximum number of processes allowed 179in the system, one would use the follow request: 180.Bd -literal -offset indent -compact 181sysctl kern.maxproc 182.Ed 183.Pp 184To set the maximum number of processes allowed 185in the system to 1000, one would use the follow request: 186.Bd -literal -offset indent -compact 187sysctl -w kern.maxproc=1000 188.Ed 189.Pp 190Information about the system clock rate may be obtained with: 191.Bd -literal -offset indent -compact 192sysctl kern.clockrate 193.Ed 194.Pp |
200Information about the load average history may be obtained with | 195Information about the load average history may be obtained with: |
201.Bd -literal -offset indent -compact 202sysctl vm.loadavg 203.Ed 204.Pp 205More variables than these exist, and the best and likely only place 206to search for their deeper meaning is undoubtedly the source where 207they are defined. 208.Sh FILES --- 13 unchanged lines hidden (view full) --- 222.It Pa <netinet/icmp_var.h> 223definitions for fourth level ICMP identifiers 224.It Pa <netinet/udp_var.h> 225definitions for fourth level UDP identifiers 226.El 227.Sh SEE ALSO 228.Xr sysctl 3 229.Sh BUGS | 196.Bd -literal -offset indent -compact 197sysctl vm.loadavg 198.Ed 199.Pp 200More variables than these exist, and the best and likely only place 201to search for their deeper meaning is undoubtedly the source where 202they are defined. 203.Sh FILES --- 13 unchanged lines hidden (view full) --- 217.It Pa <netinet/icmp_var.h> 218definitions for fourth level ICMP identifiers 219.It Pa <netinet/udp_var.h> 220definitions for fourth level UDP identifiers 221.El 222.Sh SEE ALSO 223.Xr sysctl 3 224.Sh BUGS |
230.Nm sysctl | 225.Nm Sysctl |
231presently exploits an undocumented interface to the kernel 232sysctl facility to traverse the sysctl tree and to retrieve format 233and name information. 234This correct interface is being thought about for the time being. 235.Sh HISTORY | 226presently exploits an undocumented interface to the kernel 227sysctl facility to traverse the sysctl tree and to retrieve format 228and name information. 229This correct interface is being thought about for the time being. 230.Sh HISTORY |
236.Nm sysctl | 231.Nm Sysctl |
237first appeared in 238.Bx 4.4 . 239.Pp 240In | 232first appeared in 233.Bx 4.4 . 234.Pp 235In |
241.Fx 2.2 242.Nm sysctl | 236.Fx 2.2 , 237.Nm |
243was significantly remodeled. | 238was significantly remodeled. |