summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sysctl.c
diff options
context:
space:
mode:
authormux <mux@FreeBSD.org>2002-08-10 19:56:45 +0000
committermux <mux@FreeBSD.org>2002-08-10 19:56:45 +0000
commit120b32fbcc3d50570076359500df08aac80318b6 (patch)
treee659d5f8bcd3cf7ee0a07c311845f496f90d100e /sys/kern/kern_sysctl.c
parentc78ea1d741d77a23a623682662f957cc4e152643 (diff)
downloadFreeBSD-src-120b32fbcc3d50570076359500df08aac80318b6.zip
FreeBSD-src-120b32fbcc3d50570076359500df08aac80318b6.tar.gz
Introduce a new sysctl flag, CTLFLAG_SKIP, which will cause
sysctl_sysctl_next() to skip this sysctl. The sysctl is still available, but doesn't appear in a "sysctl -a". This is especially useful when you want to deprecate a sysctl, and add a warning into it to warn users that they are using an old interface. Without this flag, the warning would get echoed when running "sysctl -a" (which happens at boot).
Diffstat (limited to 'sys/kern/kern_sysctl.c')
-rw-r--r--sys/kern/kern_sysctl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index eb219dc..57c6be8 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -542,6 +542,9 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int *name, u_int namelen,
*next = oidp->oid_number;
*oidpp = oidp;
+ if (oidp->oid_kind & CTLFLAG_SKIP)
+ continue;
+
if (!namelen) {
if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE)
return 0;
OpenPOWER on IntegriCloud