Bug 16928

Summary: dynamic sysctl enhancement
Product: Base System Reporter: adsharma <adsharma>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-CURRENT   
Hardware: Any   
OS: Any   

Description adsharma 2000-02-23 06:40:01 UTC
A patch to create dynamic sysctl nodes at runtime

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);
}
How-To-Repeat: 
N/A
Comment 1 tim 2000-05-16 04:42:02 UTC
>
>   Description
>          
>A patch to create dynamic sysctl nodes at runtime

Hmm.  Do you have suggestions of sample situations where the ability
to create dynamic sysctls would be useful?

[Be sure to include freebsd-gnats-submit@FreeBSD.org in the Cc of your
 reply].
Comment 2 adsharma 2000-05-16 05:04:24 UTC
On Mon, May 15, 2000 at 11:42:02PM -0400, Tim Vanderhoek wrote:
> >
> >   Description
> >          
> >A patch to create dynamic sysctl nodes at runtime
> 
> Hmm.  Do you have suggestions of sample situations where the ability
> to create dynamic sysctls would be useful?

See http://www.FreeBSD.org/cgi/query-pr.cgi?pr=18524 - specifically
sysctl.tar.gz. I want to create one sysctl node for each CPU in the
system. This information is available only at runtime.

	-Arun
Comment 3 Poul-Henning Kamp freebsd_committer freebsd_triage 2001-06-06 21:43:31 UTC
State Changed
From-To: open->closed

Dynamic sysctl's have been implemented.