Skip to content
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

netbsd: fix fallback and test it using configuration flag #555

Merged
merged 4 commits into from
Dec 4, 2024

Conversation

newpavlov
Copy link
Member

@newpavlov newpavlov commented Dec 4, 2024

Fixes bug in the NetBSD fallback code based on KERN_ARND. sysctl returns either 0 or -1, while the code assumed that on success it returns number of bytes filled.

Adds the getrandom_test_netbsd_fallback configuration flag, which forces the NetBSD backend to use the KERN_ARND fallback, and tweaks CI to use the flag.

Closes #289

@newpavlov
Copy link
Member Author

newpavlov commented Dec 4, 2024

Huh... It looks our NetBSD fallback code was incorrect. Surprisingly, the bug was not reported for all this time, so I guess virtually no one uses Rust on older NetBSDs.

@newpavlov newpavlov changed the title netbsd: test fallback using configuration flag netbsd: fix fallback and test it using configuration flag Dec 4, 2024
@newpavlov newpavlov merged commit cee3bf1 into master Dec 4, 2024
55 checks passed
@newpavlov newpavlov deleted the netbsd_fallback branch December 4, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

For platforms that implement runtime fallback logic, all paths should be tested
1 participant