RFC: sysctl additional functions/macros

Alfred Perlstein alfred at freebsd.org
Thu Jan 3 18:33:40 PST 2008


* Julian Elischer <julian at 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


More information about the freebsd-arch mailing list