sysctl.9 (161253) | sysctl.9 (161256) |
---|---|
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 161253 2006-08-12 20:09:33Z obrien $ | 26.\" $FreeBSD: head/share/man/man9/sysctl.9 161256 2006-08-12 23:33:10Z obrien $ |
27.\" 28.Dd April 28, 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 , 37.Nm SYSCTL_PROC , 38.Nm SYSCTL_STRING , 39.Nm SYSCTL_STRUCT , 40.Nm SYSCTL_UINT , | 27.\" 28.Dd April 28, 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 , 37.Nm SYSCTL_PROC , 38.Nm SYSCTL_STRING , 39.Nm SYSCTL_STRUCT , 40.Nm SYSCTL_UINT , |
41.Nm SYSCTL_ULONG | 41.Nm SYSCTL_ULONG , 42.Nm SYSCTL_XINT , 43.Nm SYSCTL_XLONG |
42.Nd Static sysctl declaration functions 43.Sh SYNOPSIS 44.In sys/types.h 45.In sys/sysctl.h 46.Fo SYSCTL_DECL 47.Fa "name" 48.Fc 49.Fo SYSCTL_INT --- 74 unchanged lines hidden (view full) --- 124.Fa "parent" 125.Fa "nbr" 126.Fa "name" 127.Fa "access" 128.Fa "ptr" 129.Fa "val" 130.Fa "descr" 131.Fc | 44.Nd Static sysctl declaration functions 45.Sh SYNOPSIS 46.In sys/types.h 47.In sys/sysctl.h 48.Fo SYSCTL_DECL 49.Fa "name" 50.Fc 51.Fo SYSCTL_INT --- 74 unchanged lines hidden (view full) --- 126.Fa "parent" 127.Fa "nbr" 128.Fa "name" 129.Fa "access" 130.Fa "ptr" 131.Fa "val" 132.Fa "descr" 133.Fc |
134.Fo SYSCTL_XINT 135.Fa "parent" 136.Fa "nbr" 137.Fa "name" 138.Fa "access" 139.Fa "ptr" 140.Fa "val" 141.Fa "descr" 142.Fc 143.Fo SYSCTL_XLONG 144.Fa "parent" 145.Fa "nbr" 146.Fa "name" 147.Fa "access" 148.Fa "ptr" 149.Fa "val" 150.Fa "descr" 151.Fc |
|
132.Sh DESCRIPTION 133The 134.Nm 135kernel interfaces allow code to statically declare 136.Xr sysctl 8 137MIB entries, which will be initialized when the kernel module containing the 138declaration is initialized. 139When the module is unloaded, the sysctl will be automatically destroyed. --- 8 unchanged lines hidden (view full) --- 148.Nm SYSCTL_INT , 149.Nm SYSCTL_LONG , 150.Nm SYSCTL_NODE , 151.Nm SYSCTL_OPAQUE , 152.Nm SYSCTL_PROC , 153.Nm SYSCTL_STRING , 154.Nm SYSCTL_STRUCT , 155.Nm SYSCTL_UINT , | 152.Sh DESCRIPTION 153The 154.Nm 155kernel interfaces allow code to statically declare 156.Xr sysctl 8 157MIB entries, which will be initialized when the kernel module containing the 158declaration is initialized. 159When the module is unloaded, the sysctl will be automatically destroyed. --- 8 unchanged lines hidden (view full) --- 168.Nm SYSCTL_INT , 169.Nm SYSCTL_LONG , 170.Nm SYSCTL_NODE , 171.Nm SYSCTL_OPAQUE , 172.Nm SYSCTL_PROC , 173.Nm SYSCTL_STRING , 174.Nm SYSCTL_STRUCT , 175.Nm SYSCTL_UINT , |
176.Nm SYSCTL_ULONG , 177.Nm SYSCTL_XINT , |
|
156and | 178and |
157.Nm SYSCTL_ULONG . | 179.Nm SYSCTL_XLONG . |
158Each macro accepts a parent name, as declared using 159.Nm SYSCTL_DECL , 160an OID number, typically 161.Dv OID_AUTO , 162a node name, a set of control and access flags, and a description. 163Depending on the macro, a pointer to a variable supporting the MIB entry, a 164size, a value, and a function pointer implementing the MIB entry may also be 165present. --- 100 unchanged lines hidden (view full) --- 266.Ed 267.Pp 268Examples of integer, opaque, string, and procedure sysctls follow: 269.Bd -literal -offset indent 270/* 271 * Example of a constant integer value. Notice that the control 272 * flags are CTLFLAG_RD, the variable pointer is NULL, and the 273 * value is declared. | 180Each macro accepts a parent name, as declared using 181.Nm SYSCTL_DECL , 182an OID number, typically 183.Dv OID_AUTO , 184a node name, a set of control and access flags, and a description. 185Depending on the macro, a pointer to a variable supporting the MIB entry, a 186size, a value, and a function pointer implementing the MIB entry may also be 187present. --- 100 unchanged lines hidden (view full) --- 288.Ed 289.Pp 290Examples of integer, opaque, string, and procedure sysctls follow: 291.Bd -literal -offset indent 292/* 293 * Example of a constant integer value. Notice that the control 294 * flags are CTLFLAG_RD, the variable pointer is NULL, and the 295 * value is declared. |
296 * If sysctl(8) should print this value in hex, use 'SYSCTL_XINT'. |
|
274 */ 275SYSCTL_INT(_debug_sizeof, OID_AUTO, bio, CTLFLAG_RD, NULL, 276 sizeof(struct bio), "sizeof(struct bio)"); 277 278/* 279 * Example of a variable integer value. Notice that the control 280 * flags are CTLFLAG_RW, the variable pointer is set, and the 281 * value is 0. --- 62 unchanged lines hidden --- | 297 */ 298SYSCTL_INT(_debug_sizeof, OID_AUTO, bio, CTLFLAG_RD, NULL, 299 sizeof(struct bio), "sizeof(struct bio)"); 300 301/* 302 * Example of a variable integer value. Notice that the control 303 * flags are CTLFLAG_RW, the variable pointer is set, and the 304 * value is 0. --- 62 unchanged lines hidden --- |