Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't block in getrandom() detection (#26)
On Linux, we detect if `getrandom` is present by calling getrandom with an empty buffer and seeing if `ENOSYS` is returned. However, even with an empty buffer, this call will block unless we explicitly pass a flag. This can be seen in the source for `getrandom`: https://elixir.bootlin.com/linux/v5.1.8/source/drivers/char/random.c#L2043 This change adds a boolean parameter to `syscall_getrandom` to control the blocking behavior. We now don't block in initialization, but do block when actually reading random data.