diff options
| author | Kazuki Yamaguchi <k@rhe.jp> | 2025-06-20 19:21:55 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu.nakada@gmail.com> | 2025-06-21 19:57:19 +0900 |
| commit | 0cec4a14fb832aed4b498a21ec0c19765642d408 (patch) | |
| tree | fba8d6a8146da551a7e3b5c9b965e782b674b5f6 /include/ruby/debug.h | |
| parent | 1181a682a6c314c92686e3701defa1eb44068c4e (diff) | |
Restore getrandom(2) path for Linux with glibc 2.36 or later
This is a follow-up to commit b120f5e38d9c (avoid fork-unsafe arc4random
implementations, 2018-09-04).
Avoid defining a no-op fill_random_bytes_syscall() if arc4random_buf(3)
exists, but we are unsure if it is fork-safe. Check for other options
instead. IOW, see if getrandom(2) is available.
glibc 2.36, released in 2022, started to provide arc4random_buf(3) on
Linux. This causes fill_random_bytes_syscall() to use neither of them
and makes Random.urandom solely rely on getentropy(3) via
fill_random_bytes_urandom().
While the glibc implementation is safe, I did not add it to the list
because using getrandom(2) directly is preferable on Linux.
Diffstat (limited to 'include/ruby/debug.h')
0 files changed, 0 insertions, 0 deletions
