-
Notifications
You must be signed in to change notification settings - Fork 1.8k
FreeBSD: Use new SYSCTL_SIZEOF() #17309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
SYSCTL_SIZEOF() has been introduced in FreeBSD by commit "sysctl(9): Ease exporting struct sizes; Discourage doing that" (713abc9880aa) in branch 'main'. It will soon be backported to 'stable/14'. We will thus be able to remove the old, alternate version left in the '#else' branch as soon as 'stable/13' goes out of support (April 30, 2026). Sponsored-by: The FreeBSD Foundation Signed-off-by: Olivier Certner <[email protected]>
While here, could you add a line for me in
? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is somewhat surprising to see an improvement for a discouraged API, but since it is already in FreeBSD, sure.
I understand... :-) This started out as code factorization for adding more uses, but then it appeared we rather wanted to limit the use of In fact, it's not the API that's discouraged, but its use for such purposes. However, there are still legitimate temporary use cases, such as what ZFS is doing here (communicating the size as a kind of KBI versioning for userland), pending designing a better interface (which we all know sometimes never comes... or very late). Here's for the rationale. |
@amotin Thanks! While here, if you could add a |
Ok, I'll do that. |
@OlCe2 I'm doing an AUTHORS update PR right now. I can take care of it there if you like, no problem. (I know you said mailmap, it's all part of the same thing) |
SYSCTL_SIZEOF()
has been introduced in FreeBSD by commit "sysctl(9): Ease exporting struct sizes; Discourage doing that" (713abc9880aa) in branch 'main', and is the preferred way to create leaves under thedebug.sizeof
sysctl node.This is simply a FreeBSD-specific code update to use it, where available, with backward compatibility (which is needed as long as
stable/13
is supported, so April 30, 2026 in theory).