sysctl.9 (162877) | sysctl.9 (164560) |
---|---|
1.\" 2.\" Copyright (c) 2006 Robert N. M. Watson 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24.\" SUCH DAMAGE. 25.\" | 1.\" 2.\" Copyright (c) 2006 Robert N. M. Watson 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24.\" SUCH DAMAGE. 25.\" |
26.\" $FreeBSD: head/share/man/man9/sysctl.9 162877 2006-09-30 17:09:59Z ru $ | 26.\" $FreeBSD: head/share/man/man9/sysctl.9 164560 2006-11-23 14:28:19Z yar $ |
27.\" | 27.\" |
28.Dd April 28, 2006 | 28.Dd November 23, 2006 |
29.Dt SYSCTL 9 30.Os 31.Sh NAME 32.Nm SYSCTL_DECL , 33.Nm SYSCTL_INT , 34.Nm SYSCTL_LONG , 35.Nm SYSCTL_NODE , 36.Nm SYSCTL_OPAQUE , --- 204 unchanged lines hidden (view full) --- 241 * information. Notice that the data type is declared, the NULL 242 * variable pointer and 0 size, the function pointer, and the 243 * format string for sysctl(8). 244 */ 245SYSCTL_PROC(_kern_timecounter, OID_AUTO, hardware, CTLTYPE_STRING | 246 CTLFLAG_RW, NULL, 0, sysctl_kern_timecounter_hardware, "A", 247 ""); 248.Ed | 29.Dt SYSCTL 9 30.Os 31.Sh NAME 32.Nm SYSCTL_DECL , 33.Nm SYSCTL_INT , 34.Nm SYSCTL_LONG , 35.Nm SYSCTL_NODE , 36.Nm SYSCTL_OPAQUE , --- 204 unchanged lines hidden (view full) --- 241 * information. Notice that the data type is declared, the NULL 242 * variable pointer and 0 size, the function pointer, and the 243 * format string for sysctl(8). 244 */ 245SYSCTL_PROC(_kern_timecounter, OID_AUTO, hardware, CTLTYPE_STRING | 246 CTLFLAG_RW, NULL, 0, sysctl_kern_timecounter_hardware, "A", 247 ""); 248.Ed |
249.Pp | 249.Sh SYSCTL NAMING |
250When adding, modifying, or removing sysctl names, it is important to be 251aware that these interfaces may be used by users, libraries, applications, 252or documentation (such as published books), and are implicitly published application interfaces. 253As with other application interfaces, caution must be taken not to break 254existing applications, and to think about future use of new name spaces so as 255to avoid the need to rename or remove interfaces that might be depended on in 256the future. | 250When adding, modifying, or removing sysctl names, it is important to be 251aware that these interfaces may be used by users, libraries, applications, 252or documentation (such as published books), and are implicitly published application interfaces. 253As with other application interfaces, caution must be taken not to break 254existing applications, and to think about future use of new name spaces so as 255to avoid the need to rename or remove interfaces that might be depended on in 256the future. |
257.Pp 258The semantics chosen for a new sysctl should be as clear as possible, 259and the name of the sysctl must closely reflect its semantics. 260Therefore the sysctl name deserves a fair amount of consideration. 261It should be short but yet representative of the sysctl meaning. 262If the name consists of several words, they should be separated by 263underscore characters, as in 264.Va compute_summary_at_mount . 265Underscore characters may be omitted only if the name consists of not more 266than two words, each being not longer than four characters, as in 267.Va bootfile . 268For boolean sysctls, negative logic should be totally avoided. 269That is, do not use names like 270.Va no_foobar 271or 272.Va foobar_disable . 273They are confusing and lead to configuration errors. 274Use positive logic instead: 275.Va foobar , 276.Va foobar_enable . 277.Pp 278A temporary sysctl node that should not be relied upon must be designated 279as such by a leading underscore character in its name. For example: 280.Va _dirty_hack . |
|
257.Sh SEE ALSO 258.Xr sysctl 8 , 259.Xr sysctl_add_oid 9 , 260.Xr sysctl_ctx_free 9 , 261.Xr sysctl_ctx_init 9 , 262.Xr sysctl_remove_oid 9 263.Sh HISTORY 264The --- 16 unchanged lines hidden --- | 281.Sh SEE ALSO 282.Xr sysctl 8 , 283.Xr sysctl_add_oid 9 , 284.Xr sysctl_ctx_free 9 , 285.Xr sysctl_ctx_init 9 , 286.Xr sysctl_remove_oid 9 287.Sh HISTORY 288The --- 16 unchanged lines hidden --- |