These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.\"
|
2000-10-27 16:05:39 +00:00
|
|
|
.\" Copyright (c) 2000, Andrzej Bialecki <abial@FreeBSD.org>
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. The name of the author may not be used to endorse or promote products
|
|
|
|
.\" derived from this software without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2015-11-07 01:58:17 +00:00
|
|
|
.Dd November 6, 2015
|
2000-07-18 07:46:14 +00:00
|
|
|
.Dt SYSCTL_ADD_OID 9
|
|
|
|
.Os
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm sysctl_add_oid ,
|
2004-02-27 17:13:42 +00:00
|
|
|
.Nm sysctl_move_oid ,
|
2014-08-28 04:35:38 +00:00
|
|
|
.Nm sysctl_remove_oid ,
|
|
|
|
.Nm sysctl_remove_name
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Nd runtime sysctl tree manipulation
|
|
|
|
.Sh SYNOPSIS
|
2001-10-04 09:14:48 +00:00
|
|
|
.In sys/types.h
|
2001-10-01 16:09:29 +00:00
|
|
|
.In sys/sysctl.h
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Ft struct sysctl_oid *
|
|
|
|
.Fo sysctl_add_oid
|
|
|
|
.Fa "struct sysctl_ctx_list *ctx"
|
|
|
|
.Fa "struct sysctl_oid_list *parent"
|
|
|
|
.Fa "int number"
|
2001-10-04 09:14:48 +00:00
|
|
|
.Fa "const char *name"
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Fa "int kind"
|
|
|
|
.Fa "void *arg1"
|
2015-11-07 01:43:01 +00:00
|
|
|
.Fa "intmax_t arg2"
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Fa "int (*handler) (SYSCTL_HANDLER_ARGS)"
|
2001-10-04 09:14:48 +00:00
|
|
|
.Fa "const char *format"
|
|
|
|
.Fa "const char *descr"
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Fc
|
|
|
|
.Ft int
|
2004-02-27 17:13:42 +00:00
|
|
|
.Fo sysctl_move_oid
|
|
|
|
.Fa "struct sysctl_oid *oidp"
|
|
|
|
.Fa "struct sysctl_oid_list *parent"
|
|
|
|
.Fc
|
|
|
|
.Ft int
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Fo sysctl_remove_oid
|
|
|
|
.Fa "struct sysctl_oid *oidp"
|
|
|
|
.Fa "int del"
|
|
|
|
.Fa "int recurse"
|
|
|
|
.Fc
|
2014-08-28 04:35:38 +00:00
|
|
|
.Ft int
|
|
|
|
.Fo sysctl_remove_name
|
|
|
|
.Fa "struct sysctl_oid *oidp"
|
|
|
|
.Fa "const char *name"
|
|
|
|
.Fa "int del"
|
|
|
|
.Fa "int recurse"
|
|
|
|
.Fc
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Sh DESCRIPTION
|
2014-07-31 17:18:40 +00:00
|
|
|
These functions provide the interface for creating and deleting sysctl
|
|
|
|
OIDs at runtime for example during the lifetime of a module.
|
|
|
|
The wrapper macros defined by
|
|
|
|
.Xr sysctl 9
|
|
|
|
are recommended when creating new OIDs.
|
|
|
|
.Fn sysctl_add_oid
|
|
|
|
should not be called directly from the code.
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Pp
|
2014-07-31 17:18:40 +00:00
|
|
|
Dynamic OIDs of type
|
2000-07-18 07:46:14 +00:00
|
|
|
.Dv CTLTYPE_NODE
|
|
|
|
are reusable
|
|
|
|
so that several code sections can create and delete them,
|
|
|
|
but in reality they are allocated and freed
|
|
|
|
based on their reference count.
|
|
|
|
As a consequence,
|
|
|
|
it is possible for two or more code sections
|
|
|
|
to create partially overlapping trees that they both can use.
|
|
|
|
It is not possible to create overlapping leaves,
|
2001-06-24 01:30:38 +00:00
|
|
|
nor to create different child types with the same name and parent.
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Pp
|
2000-07-18 07:46:14 +00:00
|
|
|
The
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Fn sysctl_add_oid
|
2014-07-31 17:18:40 +00:00
|
|
|
function creates a raw OID of any type and connects it to its parent node, if any.
|
|
|
|
If the OID is successfully created,
|
|
|
|
the function returns a pointer to it else
|
|
|
|
it returns
|
2000-07-18 07:46:14 +00:00
|
|
|
.Dv NULL .
|
|
|
|
Many of the arguments for
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Fn sysctl_add_oid
|
2014-07-31 17:18:40 +00:00
|
|
|
are common to the wrapper macros defined by
|
|
|
|
.Xr sysctl 9 .
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Pp
|
2000-07-18 07:46:14 +00:00
|
|
|
The
|
2004-02-27 17:13:42 +00:00
|
|
|
.Fn sysctl_move_oid
|
2014-07-31 17:18:40 +00:00
|
|
|
function reparents an existing OID.
|
|
|
|
The OID is assigned a new number as if it had been created with
|
2004-02-27 17:13:42 +00:00
|
|
|
.Fa number
|
|
|
|
set to
|
|
|
|
.Dv OID_AUTO .
|
|
|
|
.Pp
|
|
|
|
The
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Fn sysctl_remove_oid
|
2014-07-31 17:18:40 +00:00
|
|
|
function removes a dynamically created OID from the tree and
|
2000-07-18 07:46:14 +00:00
|
|
|
optionally freeing its resources.
|
|
|
|
It takes the following arguments:
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Bl -tag -width recurse
|
2000-07-18 07:46:14 +00:00
|
|
|
.It Fa oidp
|
2014-07-31 17:18:40 +00:00
|
|
|
A pointer to the dynamic OID to be removed.
|
|
|
|
If the OID is not dynamic, or the pointer is
|
2000-07-18 07:46:14 +00:00
|
|
|
.Dv NULL ,
|
|
|
|
the function returns
|
|
|
|
.Er EINVAL .
|
|
|
|
.It Fa del
|
|
|
|
If non-zero,
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Fn sysctl_remove_oid
|
2014-07-31 17:18:40 +00:00
|
|
|
will try to free the OID's resources
|
|
|
|
when the reference count of the OID becomes zero.
|
2000-07-18 07:46:14 +00:00
|
|
|
However, if
|
|
|
|
.Fa del
|
|
|
|
is set to 0,
|
2014-07-31 17:18:40 +00:00
|
|
|
the routine will only deregister the OID from the tree,
|
2000-07-18 07:46:14 +00:00
|
|
|
without freeing its resources.
|
|
|
|
This behaviour is useful when the caller expects to rollback
|
|
|
|
(possibly partially failed)
|
2014-07-31 17:18:40 +00:00
|
|
|
deletion of many OIDs later.
|
2000-07-18 07:46:14 +00:00
|
|
|
.It Fa recurse
|
|
|
|
If non-zero, attempt to remove the node and all its children.
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
If
|
|
|
|
.Pa recurse
|
2000-07-18 07:46:14 +00:00
|
|
|
is set to 0,
|
|
|
|
any attempt to remove a node that contains any children
|
|
|
|
will result in a
|
|
|
|
.Er ENOTEMPTY
|
|
|
|
error.
|
2001-02-01 16:38:02 +00:00
|
|
|
.Em WARNING : "use recursive deletion with extreme caution" !
|
2000-07-18 07:46:14 +00:00
|
|
|
Normally it should not be needed if contexts are used.
|
|
|
|
Contexts take care of tracking inter-dependencies
|
|
|
|
between users of the tree.
|
|
|
|
However, in some extreme cases it might be necessary
|
|
|
|
to remove part of the subtree no matter how it was created,
|
|
|
|
in order to free some other resources.
|
|
|
|
Be aware, though, that this may result in a system
|
|
|
|
.Xr panic 9
|
|
|
|
if other code sections continue to use removed subtrees.
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
2014-08-28 04:35:38 +00:00
|
|
|
The
|
|
|
|
.Fn sysctl_remove_name
|
|
|
|
function looks up the child node matching the
|
|
|
|
.Fa name
|
|
|
|
argument and then invokes the
|
|
|
|
.Fn sysctl_remove_oid
|
|
|
|
function on that node, passing along the
|
|
|
|
.Fa del
|
|
|
|
and
|
|
|
|
.Fa recurse
|
|
|
|
arguments.
|
|
|
|
If a node having the specified name does not exist an error code of
|
|
|
|
.Er ENOENT
|
|
|
|
is returned.
|
|
|
|
Else the error code from
|
|
|
|
.Fn sysctl_remove_oid
|
|
|
|
is returned.
|
|
|
|
.Pp
|
|
|
|
In most cases the programmer should use contexts,
|
2000-07-18 07:46:14 +00:00
|
|
|
as described in
|
|
|
|
.Xr sysctl_ctx_init 9 ,
|
2014-07-31 17:18:40 +00:00
|
|
|
to keep track of created OIDs,
|
2000-07-18 07:46:14 +00:00
|
|
|
and to delete them later in orderly fashion.
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Sh SEE ALSO
|
2000-07-18 13:03:09 +00:00
|
|
|
.Xr sysctl 8 ,
|
2006-04-28 10:45:27 +00:00
|
|
|
.Xr sysctl 9 ,
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Xr sysctl_ctx_free 9 ,
|
2000-07-18 13:03:09 +00:00
|
|
|
.Xr sysctl_ctx_init 9
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Sh HISTORY
|
2000-07-18 07:46:14 +00:00
|
|
|
These functions first appeared in
|
2001-08-01 12:15:21 +00:00
|
|
|
.Fx 4.2 .
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Sh AUTHORS
|
2014-06-26 21:44:30 +00:00
|
|
|
.An Andrzej Bialecki Aq Mt abial@FreeBSD.org
|
These patches implement dynamic sysctls. It's possible now to add
and remove sysctl oids at will during runtime - they don't rely on
linker sets. Also, the node oids can be referenced by more than
one kernel user, which means that it's possible to create partially
overlapping trees.
Add sysctl contexts to help programmers manage multiple dynamic
oids in convenient way.
Please see the manpages for detailed discussion, and example module
for typical use.
This work is based on ideas and code snippets coming from many
people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson,
Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like
to specially thank Brian Feldman for detailed review and style
fixes.
PR: kern/16928
Reviewed by: dfr, green, phk
2000-07-15 10:26:04 +00:00
|
|
|
.Sh BUGS
|
2000-07-18 07:46:14 +00:00
|
|
|
Sharing nodes between many code sections
|
|
|
|
causes interdependencies that sometimes may lock the resources.
|
|
|
|
For example,
|
2014-07-31 17:18:40 +00:00
|
|
|
if module A hooks up a subtree to an OID created by module B,
|
|
|
|
module B will be unable to delete that OID.
|
2000-07-18 07:46:14 +00:00
|
|
|
These issues are handled properly by sysctl contexts.
|
|
|
|
.Pp
|
|
|
|
Many operations on the tree involve traversing linked lists.
|
2014-07-31 17:18:40 +00:00
|
|
|
For this reason, OID creation and removal is relatively costly.
|