aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/sysctl.h
diff options
context:
space:
mode:
authorJake Burkholder <jake@FreeBSD.org>2003-01-04 08:50:43 +0000
committerJake Burkholder <jake@FreeBSD.org>2003-01-04 08:50:43 +0000
commit4bf2855c97e081eda0fa40ccbc1d26f125e3187c (patch)
tree4503fda4d32e452ded5573b285831cbeaf7d4a37 /sys/sys/sysctl.h
parentc6e3ae999b200e6c05b8a22f893bbd5d662e63b9 (diff)
downloadsrc-4bf2855c97e081eda0fa40ccbc1d26f125e3187c.tar.gz
src-4bf2855c97e081eda0fa40ccbc1d26f125e3187c.zip
Use a separate macro to generate the name of the sysctl_oid_list that holds
the children of a sysctl node, so that the arguments to the SYSCTL_NODE macro can themselves be macros. It would be nice to use __CONCAT throughout this file, but the macros are so large that it quickly becomes unweildly, (4 nested __CONCATs).
Notes
Notes: svn path=/head/; revision=108649
Diffstat (limited to 'sys/sys/sysctl.h')
-rw-r--r--sys/sys/sysctl.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h
index 4010fdc7b4ce..4ee51b790763 100644
--- a/sys/sys/sysctl.h
+++ b/sys/sys/sysctl.h
@@ -178,6 +178,9 @@ struct sysctl_ctx_entry {
TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
+#define SYSCTL_NODE_CHILDREN(parent, name) \
+ sysctl_##parent##_##name##_children
+
/* This constructs a "raw" MIB oid. */
#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
static struct sysctl_oid sysctl__##parent##_##name = { \
@@ -190,9 +193,9 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
/* This constructs a node from which other oids can hang. */
#define SYSCTL_NODE(parent, nbr, name, access, handler, descr) \
- struct sysctl_oid_list sysctl_##parent##_##name##_children; \
+ struct sysctl_oid_list SYSCTL_NODE_CHILDREN(parent, name); \
SYSCTL_OID(parent, nbr, name, CTLTYPE_NODE|(access), \
- (void*)&sysctl_##parent##_##name##_children, 0, handler, \
+ (void*)&SYSCTL_NODE_CHILDREN(parent, name), 0, handler, \
"N", descr)
#define SYSCTL_ADD_NODE(ctx, parent, nbr, name, access, handler, descr) \