summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-01-10 07:45:33 +0000
committerphk <phk@FreeBSD.org>1999-01-10 07:45:33 +0000
commit5be9d2c45d63238b7ef1f2ff40297b861287bea5 (patch)
tree7515641ea164aed752448e1c1dcea0f46deadc54 /sys
parent710c564eff6e3b7b417bf56b31cd34a37a08daed (diff)
downloadFreeBSD-src-5be9d2c45d63238b7ef1f2ff40297b861287bea5.zip
FreeBSD-src-5be9d2c45d63238b7ef1f2ff40297b861287bea5.tar.gz
Back out last change to sysctl.
It was nay'ed before committing on the grounds that this is not the way to do it, and has been decided as such several times in the past. There is not point in loading gobs of ascii into the kernel when the only use of that ascii is presentation to the user. Next thing we'd be adding all section 4 man pages to the loaded kernel as well. The argument about KLD's is bogus, klds can store a file in /usr/share/doc/sysctl/dev/foo/thisvar.txt with a description and sysctl or other facilities can pick it up there. Proper documentation will take several K worth of text for many sysctl variables, we don't want that in the kernel under any circumstances. I will welcome any well thought out attempt at improving the situation wrt. sysctl documentation, but this wasn't it.
Diffstat (limited to 'sys')
-rw-r--r--sys/conf/NOTES3
-rw-r--r--sys/conf/options1
-rw-r--r--sys/i386/conf/LINT3
-rw-r--r--sys/i386/conf/NOTES3
-rw-r--r--sys/kern/kern_sysctl.c49
-rw-r--r--sys/sys/sysctl.h10
6 files changed, 2 insertions, 67 deletions
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index 7fa3e23..7e93763 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -772,9 +772,6 @@ options VINUMDEBUG #enable Vinum debugging hooks
# Size of the kernel message buffer. Should be N * pagesize.
options "MSGBUF_SIZE=40960"
-# Conserve space by not including sysctl descriptions (see sysctl(8))
-#options NO_SYSCTL_DESCRIPTIONS
-
#####################################################################
# HARDWARE DEVICE CONFIGURATION
diff --git a/sys/conf/options b/sys/conf/options
index d401ef8..c0dafcf 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -254,7 +254,6 @@ DIAGNOSTIC opt_global.h
ENABLE_VFS_IOOPT opt_global.h
INVARIANT_SUPPORT opt_global.h
INVARIANTS opt_global.h
-NO_SYSCTL_DESCRIPTIONS opt_global.h
SIMPLELOCK_DEBUG opt_global.h
VFS_BIO_DEBUG opt_global.h
diff --git a/sys/i386/conf/LINT b/sys/i386/conf/LINT
index 7fa3e23..7e93763 100644
--- a/sys/i386/conf/LINT
+++ b/sys/i386/conf/LINT
@@ -772,9 +772,6 @@ options VINUMDEBUG #enable Vinum debugging hooks
# Size of the kernel message buffer. Should be N * pagesize.
options "MSGBUF_SIZE=40960"
-# Conserve space by not including sysctl descriptions (see sysctl(8))
-#options NO_SYSCTL_DESCRIPTIONS
-
#####################################################################
# HARDWARE DEVICE CONFIGURATION
diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES
index 7fa3e23..7e93763 100644
--- a/sys/i386/conf/NOTES
+++ b/sys/i386/conf/NOTES
@@ -772,9 +772,6 @@ options VINUMDEBUG #enable Vinum debugging hooks
# Size of the kernel message buffer. Should be N * pagesize.
options "MSGBUF_SIZE=40960"
-# Conserve space by not including sysctl descriptions (see sysctl(8))
-#options NO_SYSCTL_DESCRIPTIONS
-
#####################################################################
# HARDWARE DEVICE CONFIGURATION
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 26dade4..fbf2f6a 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -155,10 +155,9 @@ sysctl_order_all(void)
*
* {0,0} printf the entire MIB-tree.
* {0,1,...} return the name of the "..." OID.
- * {0,2} return the next OID.
+ * {0,2,...} return the next OID.
* {0,3} return the OID of the name in "new"
* {0,4,...} return the kind & format info for the "..." OID.
- * {0,5,...} return the description for the "..." OID.
*/
static void
@@ -490,52 +489,8 @@ found:
return (error);
}
-SYSCTL_NODE(_sysctl, 4, oidfmt, CTLFLAG_RD, sysctl_sysctl_oidfmt, "");
-
-static int
-sysctl_sysctl_descr SYSCTL_HANDLER_ARGS
-{
-#ifndef NO_SYSCTL_DESCRIPTIONS
- int *name = (int *) arg1;
- u_int namelen = arg2;
- int i, j, error = 0;
- struct sysctl_oid **oidpp;
- struct linker_set *lsp = &sysctl_;
- if (!lsp || !namelen)
- return (SYSCTL_OUT(req, "", 1));
-
- while (namelen) {
- oidpp = (struct sysctl_oid **) lsp->ls_items;
- j = lsp->ls_length;
- lsp = 0;
- for (i = 0; i < j; i++, oidpp++) {
- if (*oidpp && ((*oidpp)->oid_number != *name))
- continue;
-
- namelen--;
- name++;
-
- if (((*oidpp)->oid_kind & CTLTYPE) != CTLTYPE_NODE)
- break;
-
- if ((*oidpp)->oid_handler)
- break;
-
- lsp = (struct linker_set*)(*oidpp)->oid_arg1;
- break;
- }
- }
-
- error = SYSCTL_OUT(req, (*oidpp)->oid_descr,
- strlen((*oidpp)->oid_descr) + 1);
- return (error);
-#else
- return (SYSCTL_OUT(req, "", 1));
-#endif /* !NO_SYSCTL_DESCRIPTIONS */
-}
-
-SYSCTL_NODE(_sysctl, 5, descr, CTLFLAG_RD, sysctl_sysctl_descr, "");
+SYSCTL_NODE(_sysctl, 4, oidfmt, CTLFLAG_RD, sysctl_sysctl_oidfmt, "");
/*
* Default "handler" functions.
diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h
index 01049d0..89cf9c0 100644
--- a/sys/sys/sysctl.h
+++ b/sys/sys/sysctl.h
@@ -122,9 +122,6 @@ struct sysctl_oid {
const char *oid_name;
int (*oid_handler) SYSCTL_HANDLER_ARGS;
const char *oid_fmt;
-#ifndef NO_SYSCTL_DESCRIPTIONS
- const char *oid_descr;
-#endif /* !NO_SYSCTL_DESCRIPTIONS */
};
#define SYSCTL_IN(r, p, l) (r->newfunc)(r, p, l)
@@ -137,17 +134,10 @@ int sysctl_handle_string SYSCTL_HANDLER_ARGS;
int sysctl_handle_opaque SYSCTL_HANDLER_ARGS;
/* This constructs a "raw" MIB oid. */
-#ifndef NO_SYSCTL_DESCRIPTIONS
-#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
- static struct sysctl_oid sysctl__##parent##_##name = { \
- nbr, kind, a1, a2, #name, handler, fmt, descr }; \
- DATA_SET(sysctl_##parent, sysctl__##parent##_##name)
-#else
#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
static struct sysctl_oid sysctl__##parent##_##name = { \
nbr, kind, a1, a2, #name, handler, fmt }; \
DATA_SET(sysctl_##parent, sysctl__##parent##_##name)
-#endif /* !NO_SYSCTL_DESCRIPTIONS */
/* This constructs a node from which other oids can hang. */
#define SYSCTL_NODE(parent, nbr, name, access, handler, descr) \
OpenPOWER on IntegriCloud