From owner-freebsd-arch Mon Jan 15 12:17:14 2001 Delivered-To: freebsd-arch@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id B6F5C37B698; Mon, 15 Jan 2001 12:16:56 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id f0FKGuh14523; Mon, 15 Jan 2001 12:16:56 -0800 (PST) Date: Mon, 15 Jan 2001 12:16:56 -0800 From: Alfred Perlstein To: Hajimu UMEMOTO Cc: arch@FreeBSD.ORG Subject: Re: dynamic vs static sysctls? Message-ID: <20010115121656.D7240@fw.wintelcom.net> References: <20010115103757.B7240@fw.wintelcom.net> <20010116.035009.71081161.ume@FreeBSD.org> <20010115111439.C7240@fw.wintelcom.net> <20010116.044305.78700228.ume@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010116.044305.78700228.ume@FreeBSD.org>; from ume@FreeBSD.ORG on Tue, Jan 16, 2001 at 04:43:05AM +0900 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Hajimu UMEMOTO [010115 11:47] wrote: > >>>>> 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. I think sysctl probably returns something like ENOENT if getsysctlbyname fails. If not it should. > > 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. -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message