1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-21 11:13:30 +00:00

Add description of "sysctl_remove_name()" function.

This commit is contained in:
Hans Petter Selasky 2014-08-28 04:35:38 +00:00
parent bc0203e201
commit b5177e001b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=270740
2 changed files with 31 additions and 4 deletions

View File

@ -1379,7 +1379,8 @@ MLINKS+=sysctl.9 SYSCTL_DECL.9 \
sysctl.9 SYSCTL_ULONG.9 \
sysctl.9 SYSCTL_UQUAD.9
MLINKS+=sysctl_add_oid.9 sysctl_move_oid.9 \
sysctl_add_oid.9 sysctl_remove_oid.9
sysctl_add_oid.9 sysctl_remove_oid.9 \
sysctl_add_oid.9 sysctl_remove_name.9
MLINKS+=sysctl_ctx_init.9 sysctl_ctx_entry_add.9 \
sysctl_ctx_init.9 sysctl_ctx_entry_del.9 \
sysctl_ctx_init.9 sysctl_ctx_entry_find.9 \

View File

@ -27,13 +27,14 @@
.\"
.\" $FreeBSD$
.\"
.Dd July 31, 2014
.Dd August 28, 2014
.Dt SYSCTL_ADD_OID 9
.Os
.Sh NAME
.Nm sysctl_add_oid ,
.Nm sysctl_move_oid ,
.Nm sysctl_remove_oid
.Nm sysctl_remove_oid ,
.Nm sysctl_remove_name
.Nd runtime sysctl tree manipulation
.Sh SYNOPSIS
.In sys/types.h
@ -62,6 +63,13 @@
.Fa "int del"
.Fa "int recurse"
.Fc
.Ft int
.Fo sysctl_remove_name
.Fa "struct sysctl_oid *oidp"
.Fa "const char *name"
.Fa "int del"
.Fa "int recurse"
.Fc
.Sh DESCRIPTION
These functions provide the interface for creating and deleting sysctl
OIDs at runtime for example during the lifetime of a module.
@ -149,7 +157,25 @@ Be aware, though, that this may result in a system
if other code sections continue to use removed subtrees.
.El
.Pp
Again, in most cases the programmer should use contexts,
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,
as described in
.Xr sysctl_ctx_init 9 ,
to keep track of created OIDs,