Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115871203
D36748.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D36748.diff
View Options
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -136,7 +136,7 @@
struct sysctl_oid *oidp;
SYSCTL_ASSERT_LOCKED();
- RB_FOREACH(oidp, sysctl_oid_list, list) {
+ SYSCTL_FOREACH(oidp, list) {
if (strcmp(oidp->oid_name, name) == 0) {
return (oidp);
}
@@ -1005,7 +1005,7 @@
struct sysctl_oid *oidp;
SYSCTL_ASSERT_LOCKED();
- RB_FOREACH(oidp, sysctl_oid_list, l) {
+ SYSCTL_FOREACH(oidp, l) {
for (k=0; k<i; k++)
printf(" ");
@@ -1327,7 +1327,7 @@
for (*len = 0; *len < CTL_MAXNAME;) {
p = strsep(&name, ".");
- RB_FOREACH(oidp, sysctl_oid_list, lsp) {
+ SYSCTL_FOREACH(oidp, lsp) {
if (strcmp(p, oidp->oid_name) == 0)
break;
}
diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h
--- a/sys/sys/sysctl.h
+++ b/sys/sys/sysctl.h
@@ -918,6 +918,9 @@
NULL); \
})
+#define SYSCTL_FOREACH(oidp, list) \
+ RB_FOREACH(oidp, sysctl_oid_list, list)
+
/*
* A macro to generate a read-only sysctl to indicate the presence of optional
* kernel features.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 30, 8:07 PM (3 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17864122
Default Alt Text
D36748.diff (1 KB)
Attached To
Mode
D36748: sysctl(3): Implement SYSCTL_FOREACH() to iterate all OIDs in a sysctl list.
Attached
Detach File
Event Timeline
Log In to Comment