From owner-freebsd-bugs Tue Feb 22 22:40: 5 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id C9DA537BA0D for ; Tue, 22 Feb 2000 22:40:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id WAA64763; Tue, 22 Feb 2000 22:40:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from c62443-a.frmt1.sfba.home.com (c62443-a.frmt1.sfba.home.com [24.0.69.165]) by hub.freebsd.org (Postfix) with ESMTP id DD1DC37B848 for ; Tue, 22 Feb 2000 22:33:28 -0800 (PST) (envelope-from adsharma@sharmas.dhs.org) Received: from sharmas.dhs.org (astra.sharmas.org [192.168.0.12]) by c62443-a.frmt1.sfba.home.com (8.9.3/8.9.3) with ESMTP id WAA05465 for ; Tue, 22 Feb 2000 22:33:28 -0800 Received: (from adsharma@localhost) by sharmas.dhs.org (8.9.3/8.9.3) id WAA04551; Tue, 22 Feb 2000 22:33:28 -0800 (PST) (envelope-from adsharma) Message-Id: <200002230633.WAA04551@sharmas.dhs.org> Date: Tue, 22 Feb 2000 22:33:28 -0800 (PST) From: Arun Sharma Reply-To: adsharma@sharmas.dhs.org To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/16928: dynamic sysctl enhancement Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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