From owner-freebsd-arch@FreeBSD.ORG Fri Jan 4 02:33:40 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC60F16A41A for ; Fri, 4 Jan 2008 02:33:40 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id CD93113C459 for ; Fri, 4 Jan 2008 02:33:40 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 9EEDA1A4D82; Thu, 3 Jan 2008 18:31:14 -0800 (PST) Date: Thu, 3 Jan 2008 18:31:14 -0800 From: Alfred Perlstein To: Julian Elischer Message-ID: <20080104023114.GG76698@elvis.mu.org> References: <477D931D.4000303@elischer.org> <20080104021905.GE76698@elvis.mu.org> <477D9948.3050508@elischer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <477D9948.3050508@elischer.org> User-Agent: Mutt/1.4.2.3i Cc: arch@freebsd.org Subject: Re: RFC: sysctl additional functions/macros 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: Fri, 04 Jan 2008 02:33:40 -0000 * Julian Elischer [080103 18:23] wrote: > Alfred Perlstein wrote: > >Yes, but EINVAL please. > > > >Another idea would be a simplified SYSCTL_INT_PROC > >that allowed one to define a function like so: > > > >int > >sysctl_handle_int_proc(void *handle, int *newval, int *max, int *min) > >{ > > > > > >} > > > >If this function returned '0' then 'newval' would be accepted. > >Otherwise the function should return an error, most likely EINVAL. > > > >The point being that a lot of these maximums may take a calculation > >and we should make it as easy as possible to do this calculation > >and provide the function for doing so. > > yes I was thinking about that.. > something that allowed one to supply a simple comparison snippet. > > the limit is in the fields that are stored in the sysctl_oid > structure. Whichever you decide, I think either would be a step forward. -Alfred