Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jan 2008 18:31:14 -0800
From:      Alfred Perlstein <alfred@freebsd.org>
To:        Julian Elischer <julian@elischer.org>
Cc:        arch@freebsd.org
Subject:   Re: RFC: sysctl additional functions/macros
Message-ID:  <20080104023114.GG76698@elvis.mu.org>
In-Reply-To: <477D9948.3050508@elischer.org>
References:  <477D931D.4000303@elischer.org> <20080104021905.GE76698@elvis.mu.org> <477D9948.3050508@elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* Julian Elischer <julian@elischer.org> [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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080104023114.GG76698>