From owner-freebsd-arch@FreeBSD.ORG Mon Aug 15 06:15:38 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF10016A41F; Mon, 15 Aug 2005 06:15:38 +0000 (GMT) (envelope-from m.ehinger@ltur.de) Received: from posty.gateway-inter.net (posty.gateway-inter.net [213.144.19.86]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09D6E43D6E; Mon, 15 Aug 2005 06:15:35 +0000 (GMT) (envelope-from m.ehinger@ltur.de) In-Reply-To: <20050812162719.GA27362@garage.freebsd.pl> To: Pawel Jakub Dawidek Message-ID: From: m.ehinger@ltur.de Date: Mon, 15 Aug 2005 08:15:00 +0200 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Cc: freebsd-arch@freebsd.org Subject: Re: sysctl_proc calls handler twice X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Aug 2005 06:15:39 -0000 thanks, meanwhile i found out that sysctlbyname(3) calls it only once. maik Pawel Jakub Dawidek 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!