-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Assume getrandom
on Linux
#15040
Assume getrandom
on Linux
#15040
Conversation
https://crystal-lang.org/reference/1.13/syntax_and_semantics/platform_support.html list already as a requirement |
We also expect kernel 2.6.18 to be compatible, but |
The
getrandom(2)
syscall was added in 2017 and at the time we couldn't expect the glibc 2.25 to be widely available, but we're in 2024 now, and even Ubuntu 18.04 LTS that is now EOL had a compatible glibc release (2.27). I assume musl-libc also added the symbol at the same time.We can simplify the implementation to assume
getrandom
is available, which avoids the initial check, initialization and fallback to urandom. We still fallback to urandom at compile time when targeting android api level < 28 (we support 24+).An issue is that executables will now expect glibc 2.25+ (for example), though the interpreter already did.
Related to #15034.