Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jan 2001 14:17:19 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Alfred Perlstein <bright@wintelcom.net>
Cc:        arch@FreeBSD.org, Hajimu UMEMOTO <ume@FreeBSD.org>
Subject:   RE: dynamic vs static sysctls?
Message-ID:  <XFMail.010115141719.jhb@FreeBSD.org>
In-Reply-To: <20010115103757.B7240@fw.wintelcom.net>

next in thread | previous in thread | raw e-mail | index | archive | help

On 15-Jan-01 Alfred Perlstein wrote:
> [moved to -arch]
> 
> * Hajimu UMEMOTO <ume@FreeBSD.org> [010115 10:33] wrote:
>> Hi,
>> 
>> >>>>> On Mon, 15 Jan 2001 10:06:18 -0800
>> >>>>> Alfred Perlstein <bright@wintelcom.net> said:
>> 
>> bright> * Hajimu UMEMOTO <ume@FreeBSD.ORG> [010115 10:00] wrote:
>> > Hi,
>> > 
>> > I wish to obtain number of processes forked since boot from userland.
>> > So, I made a patch to intend to commit.
>> > Any comment?
>> 
>> bright> Why not just use a dynamic sysctl for this?
>> 
>> I think dynamic sysctl is useful for dynamic context.  But, here is
>> just static and it seems there is no advantage.  Isn't it?
> 
> Well all the sysctl's I've added have been dynamic, I think the
> only reason for the 'static' sysctls is to give sysctl() a
> numeric way to get at the sysctls, which isn't very useful 
> when we have getsysctlbyname().

Actually, he means dynamic as in SYSCTL_ADD_*.  I.e., sysctls created at
runtime, not compile time like SYSCTL_*.  One should use static sysctls if
possible as they don't need malloc() at runtime, etc.  Dynamic sysctls are good
for providing sysctl access to variables that are dynamically generated.

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


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?XFMail.010115141719.jhb>