Date: Mon, 15 Aug 2005 08:15:00 +0200 From: m.ehinger@ltur.de To: Pawel Jakub Dawidek <pjd@FreeBSD.org> Cc: freebsd-arch@freebsd.org Subject: Re: sysctl_proc calls handler twice Message-ID: <OF28F4B4F7.07CB26A2-ONC125705E.00222E3B-C125705E.00226191@gateway-inter.net> In-Reply-To: <20050812162719.GA27362@garage.freebsd.pl>
next in thread | previous in thread | raw e-mail | index | archive | help
thanks,
meanwhile i found out that sysctlbyname(3) calls it only once.
maik
Pawel Jakub Dawidek <pjd@FreeBSD.org>
12.08.2005 18:27 An
m.ehinger@ltur.de
Kopie
freebsd-arch@freebsd.org
Thema
Re: sysctl_proc calls handler twice
On Thu, Aug 11, 2005 at 06:12:14PM +0200, m.ehinger@ltur.de wrote:
+> Hi,
+>
+> can someone explain why a proc sysctl (add via SYSCTL_PROC or SYSCTL_ADD_PROC) calls the handler twice if i read the sysctl only
+> once? Is this the normal behaviour?
Yes, AFAIR first call is done to find out how much memory should be
allocated and second one is request for a real data.
+> How can i prevent this?
You can't, try to live with it.
--
Pawel Jakub Dawidek http://www.wheel.pl
pjd@FreeBSD.org http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?OF28F4B4F7.07CB26A2-ONC125705E.00222E3B-C125705E.00226191>
