dsprenkels / randombytes

A portable C library for generating cypto-secure random bytes
MIT License
96 stars 37 forks source link

Fallback to old-style entropy count if ioctl returns ENOSYS #25

Closed dsprenkels closed 4 years ago

dsprenkels commented 4 years ago

On the MIPS platform, the GETRNDENTCNT ioctl on /dev/urandom gives back an ENOSYS error, even if linux/random.h is correctly included. I am not sure if this is even documented by the relevant man pages.

In any case, when this happens we will fall back to the strategy where we read from /proc/sys/kernel/random/entropy_avail.