RFC: sysctl additional functions/macros

Poul-Henning Kamp phk at phk.freebsd.dk
Fri Jan 4 09:13:02 PST 2008


In message <200801041150.49541.jhb at freebsd.org>, John Baldwin writes:
>On Friday 04 January 2008 11:18:29 am Poul-Henning Kamp wrote:
>> In message <477E592B.9040106 at elischer.org>, Julian Elischer writes:
>> >John Baldwin wrote:
>> 
>> >right, so you've solved that one.. 
>> 
>> Please no!
>> 
>> This is far more complicated and wasteful than it needs to be.
>> 
>> Please just include the code in the macro call and instantiate
>> a function with that code inlined.
>
>Your code body in the example though is the just the validation step, it 
>doesn't have all the copyin/copyout goop (nor should it).

Of course not, the SYSCTL_INT_CODE() macro should instantiate that
in the new function.

>Are you really 
>worried about the overhead of having a worker function call a function 
>containing the validation code?

No, I'm appalled at another clutch of weird data structures to encapsulate
what is really a piece of code as a number of weird fields.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the freebsd-arch mailing list