Date: Mon, 15 Jan 2001 12:16:56 -0800 From: Alfred Perlstein <bright@wintelcom.net> To: Hajimu UMEMOTO <ume@FreeBSD.ORG> Cc: arch@FreeBSD.ORG Subject: Re: dynamic vs static sysctls? Message-ID: <20010115121656.D7240@fw.wintelcom.net> In-Reply-To: <20010116.044305.78700228.ume@FreeBSD.org>; from ume@FreeBSD.ORG on Tue, Jan 16, 2001 at 04:43:05AM %2B0900 References: <20010115103757.B7240@fw.wintelcom.net> <20010116.035009.71081161.ume@FreeBSD.org> <20010115111439.C7240@fw.wintelcom.net> <20010116.044305.78700228.ume@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
* Hajimu UMEMOTO <ume@FreeBSD.ORG> [010115 11:47] wrote: > >>>>> On Mon, 15 Jan 2001 11:14:39 -0800 > >>>>> Alfred Perlstein <bright@wintelcom.net> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010115121656.D7240>