Date: Tue, 22 Feb 2000 22:33:28 -0800 (PST) From: Arun Sharma <adsharma@sharmas.dhs.org> To: FreeBSD-gnats-submit@freebsd.org Subject: kern/16928: dynamic sysctl enhancement Message-ID: <200002230633.WAA04551@sharmas.dhs.org>
next in thread | raw e-mail | index | archive | help
>Number: 16928
>Category: kern
>Synopsis: dynamic sysctl enhancement
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Tue Feb 22 22:40:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Arun Sharma
>Release: FreeBSD 4.0-CURRENT i386
>Organization:
Myself
>Environment:
FreeBSD 4.0
>Description:
A patch to create dynamic sysctl nodes at runtime
>How-To-Repeat:
N/A
>Fix:
The following code (and corresponding code for other data types supported
by sysctl) needs to go into /usr/src/sys/kern/kern_sysctl.c
void
sysctl_register_long(struct sysctl_oid_list *parent, int number, char *name,
int access, long *ptr, struct sysctl_oid *oidp)
{
oidp->oid_parent = parent;
SLIST_NEXT(oidp, oid_link) = NULL;
oidp->oid_number = number;
oidp->oid_name = name;
oidp->oid_handler = sysctl_handle_long;
oidp->oid_kind = CTLTYPE_INT | access;
oidp->oid_arg1 = (void *) ptr;
oidp->oid_arg2 = 0;
oidp->oid_fmt = "L";
/* Register this oid */
sysctl_register_oid(oidp);
}
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200002230633.WAA04551>
