diff options
author | Jason McIntyre <jmc@cvs.openbsd.org> | 2004-02-25 08:39:03 +0000 |
---|---|---|
committer | Jason McIntyre <jmc@cvs.openbsd.org> | 2004-02-25 08:39:03 +0000 |
commit | 6f96585c9df4243ccf9c1dc2d8e1617dcbf5fb4b (patch) | |
tree | a5a35a2dee90abfc2fa45c0d92fa13f8a8756f1c | |
parent | e9262ddb4e3598829a2f9717fbdf6e89e868a2bc (diff) |
note that -w is optional and adjust accordingly;
remove -w from EXAMPLES;
diffs from Paul de Weerd;
ok deraadt@
-rw-r--r-- | sbin/sysctl/sysctl.8 | 39 | ||||
-rw-r--r-- | sbin/sysctl/sysctl.c | 8 |
2 files changed, 30 insertions, 17 deletions
diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index eeb64fd7a3f..4c572832027 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sysctl.8,v 1.118 2004/02/10 20:56:19 millert Exp $ +.\" $OpenBSD: sysctl.8,v 1.119 2004/02/25 08:39:02 jmc Exp $ .\" $NetBSD: sysctl.8,v 1.4 1995/09/30 07:12:49 thorpej Exp $ .\" .\" Copyright (c) 1993 @@ -41,8 +41,7 @@ .Op Fl n .Ar variable ... .Nm sysctl -.Op Fl nq -.Fl w +.Op Fl nqw .Ar variable Ns = Ns Ar value ... .Nm sysctl .Op Fl n @@ -57,6 +56,15 @@ The state to be retrieved or set is described using a .Pq MIB style name, described as a dotted set of components. .Pp +When setting a variable, +the MIB name should be followed by an equal sign and the new value. +Variables are set implicitly using the +.Ar variable Ns = Ns Ar value +syntax, or explicitly with the +.Fl w +option. +Both forms are identical. +.Pp The options are as follows: .Bl -tag -width xxx .It Fl A @@ -78,8 +86,13 @@ Suppress all output when setting a variable. This option overrides the behaviour of .Fl n . .It Fl w -Required to set a variable. -The MIB name should be followed by an equal sign and the new value. +Set a variable. +It must be followed by a +.Ar variable Ns = Ns Ar value +assignment. +The +.Fl w +flag is optional when setting a variable. .El .Pp The information available from @@ -445,7 +458,7 @@ in the system: To set the maximum number of processes allowed in the system to 1000: .Pp -.Dl # sysctl -w kern.maxproc=1000 +.Dl # sysctl kern.maxproc=1000 .Pp To retrieve information about the system clock rate: .Pp @@ -459,12 +472,12 @@ To make the .Xr chown 2 system call use traditional BSD semantics (don't clear setuid/setgid bits): .Pp -.Dl # sysctl -w fs.posix.setuid=0 +.Dl # sysctl fs.posix.setuid=0 .Pp To set the list of reserved TCP ports that should not be allocated by the kernel dynamically: .Pp -.Dl # sysctl -w net.inet.tcp.baddynamic=749,750,751,760,761,871 +.Dl # sysctl net.inet.tcp.baddynamic=749,750,751,760,761,871 .Pp This can be used to keep daemons from stealing a specific port that another program needs to function. @@ -472,8 +485,8 @@ List elements may be separated by commas and/or whitespace. .Pp It is also possible to add or remove ports from the current list: .Bd -literal -offset indent -# sysctl -w net.inet.tcp.baddynamic=+748 -# sysctl -w net.inet.tcp.baddynamic=-871 +# sysctl net.inet.tcp.baddynamic=+748 +# sysctl net.inet.tcp.baddynamic=-871 .Ed .Pp To adjust the number of kernel @@ -481,7 +494,7 @@ To adjust the number of kernel threads used to service asynchronous I/O requests on an NFS client machine: .Pp -.Dl # sysctl -w vfs.nfs.iothreads=4 +.Dl # sysctl vfs.nfs.iothreads=4 .Pp The number of 4 is the default, 20 is the maximum. See @@ -493,8 +506,8 @@ for further discussion. To set the amount of shared memory available in the system and the maximum number of shared memory segments: .Bd -literal -offset indent -# sysctl -w kern.shminfo.shmmax=33554432 -# sysctl -w kern.shminfo.shmseg=32 +# sysctl kern.shminfo.shmmax=33554432 +# sysctl kern.shminfo.shmseg=32 .Ed .Sh SEE ALSO .Xr sysctl 3 , diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index be00a997f1c..7ab606e27a2 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysctl.c,v 1.110 2004/02/24 21:45:01 tedu Exp $ */ +/* $OpenBSD: sysctl.c,v 1.111 2004/02/25 08:39:02 jmc Exp $ */ /* $NetBSD: sysctl.c,v 1.9 1995/09/30 07:12:50 thorpej Exp $ */ /* @@ -40,7 +40,7 @@ static const char copyright[] = #if 0 static const char sccsid[] = "@(#)sysctl.c 8.5 (Berkeley) 5/9/95"; #else -static const char rcsid[] = "$OpenBSD: sysctl.c,v 1.110 2004/02/24 21:45:01 tedu Exp $"; +static const char rcsid[] = "$OpenBSD: sysctl.c,v 1.111 2004/02/25 08:39:02 jmc Exp $"; #endif #endif /* not lint */ @@ -2187,7 +2187,7 @@ usage(void) { (void)fprintf(stderr, "usage:\t%s\n\t%s\n\t%s\n", - "sysctl [-n] variable ...", "sysctl [-nq] -w variable=value ...", - "sysctl -aA [-n]"); + "sysctl [-n] variable ...", "sysctl [-nqw] variable=value ...", + "sysctl [-n] -Aa"); exit(1); } |