From owner-freebsd-arch Mon Jan 15 11:44:45 2001 Delivered-To: freebsd-arch@freebsd.org Received: from peace.mahoroba.org (peace.calm.imasy.or.jp [202.227.26.34]) by hub.freebsd.org (Postfix) with ESMTP id A307537B400 for ; Mon, 15 Jan 2001 11:44:25 -0800 (PST) Received: from localhost (IDENT:7SJytFdI1vPyN6QO893Uhj5vlanE7URwFVWeh5EGKSt1dQTpLCkxQLNJxYAlPD/v@localhost [::1]) (authenticated) by peace.mahoroba.org (8.11.2/8.11.2/peace) with ESMTP/inet6 id f0FJh6w02406; Tue, 16 Jan 2001 04:43:06 +0900 (JST) (envelope-from ume@FreeBSD.org) Date: Tue, 16 Jan 2001 04:43:05 +0900 (JST) Message-Id: <20010116.044305.78700228.ume@FreeBSD.org> To: bright@wintelcom.net Cc: arch@FreeBSD.org Subject: Re: dynamic vs static sysctls? From: Hajimu UMEMOTO In-Reply-To: <20010115111439.C7240@fw.wintelcom.net> References: <20010115103757.B7240@fw.wintelcom.net> <20010116.035009.71081161.ume@FreeBSD.org> <20010115111439.C7240@fw.wintelcom.net> X-Mailer: xcite1.38> Mew version 1.95b97 on Emacs 20.7 / Mule 4.0 =?iso-2022-jp?B?KBskQjJWMWMbKEIp?= X-PGP-Public-Key: http://www.imasy.org/~ume/publickey.asc X-PGP-Fingerprint: 6B 0C 53 FC 5D D0 37 91 05 D0 B3 EF 36 9B 6A BC X-URL: http://www.imasy.org/~ume/ X-OS: FreeBSD 5.0-CURRENT Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >>>>> On Mon, 15 Jan 2001 11:14:39 -0800 >>>>> Alfred Perlstein said: bright> Just do this: bright> static unsigned int nforks = 0; bright> SYSCTL_UINT(_kern, OID_AUTO, nforks, CTLFLAG_RD, &nforks, 0, bright> "number of fork()s since boot"); bright> document the sysctl. :) Okey. Thanks. bright> Oh, you mean in a kernel module? I think you need to use bright> kernel_sysctl() (from kern/kern_sysctl.c), I'm not sure if it's bright> documented anywhere, if not it'd be nice to have a sysctl(9) manpage. bright> :) No. I just want to distinguish the version from userland. > Do you mean ALLPROC_LOCK(AP_EXCLUSIVE) / ALLPROC_LOCK(AP_RELEASE) ? > If so, I'll move nforks++ between them. bright> No, don't do that, we'll figure out how to lock it later, you may bright> want to use the mp_fixme (mpfixme?) macro near the sysctl variable bright> though. Okey, I see. -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@bisd.hitachi.co.jp ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message