i...@home.imil.net (Emile 'iMil' Heitor) writes: >Except it does not, the first time it calls back the helper function, >*oldlenp value is 1024 no matter what I set it to before. >But if I return once again (either with ENOMEM or 0, doesn't matter), >the helper function will now be called with the right *oldlenp value.
The helper function produces the value that is returned in *oldlenp. If you happen to use CTL_DESCRIBE (e.g. running sysctl -d), it's not your helper function being called but the sysctl_describe helper that returns a value of 1024. Maybe you can show your helper routine and how you call sysctl ?