Module Name: src
Committed By: pgoyette
Date: Wed Aug 7 13:22:00 UTC 2019
Modified Files:
src/share/man/man9: sysctl.9
Log Message:
Document interaction of SYSCTL_SETUP functions and the module loader.
To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/share/man/man9/sysctl.9
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/share/man/man9/sysctl.9
diff -u src/share/man/man9/sysctl.9:1.20 src/share/man/man9/sysctl.9:1.21
--- src/share/man/man9/sysctl.9:1.20 Mon Jul 3 21:28:48 2017
+++ src/share/man/man9/sysctl.9 Wed Aug 7 13:22:00 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: sysctl.9,v 1.20 2017/07/03 21:28:48 wiz Exp $
+.\" $NetBSD: sysctl.9,v 1.21 2019/08/07 13:22:00 pgoyette Exp $
.\"
.\" Copyright (c) 2004 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -27,7 +27,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd December 4, 2011
+.Dd August 7, 2019
.Dt SYSCTL 9
.Os
.Sh NAME
@@ -547,7 +547,7 @@ specifically ignores any arguments given
.Fa oldlenp
to zero, and returns success.
.Sh SETUP FUNCTIONS
-Though nodes can be added to the SYSCTL tree at any time, in order to
+Although nodes can be added to the SYSCTL tree at any time, in order to
add nodes during the kernel bootstrap phase, a proper
.Dq setup
function must be used.
@@ -561,9 +561,17 @@ See the
kernel configuration in
.Xr options 4 .
.Pc
+.Pp
The address of the function is added to a list of functions that
.Fn sysctl_init
traverses during initialization.
+For loadable kernel modules (see
+.Xr modules 9 ) ,
+the list of functions is called from the module loader after the module's
+initialization routine.
+Any sysctl nodes created for the loadable module are removed using
+.Fn sysctl_teardown
+before calling the module's termination code.
.Pp
Setup functions do not have to add nodes to the main tree, but can set
up their own trees for emulation or other purposes.