prng: support getrandom & getentropy

If the C library supports these random functions, use them directly
instead of reading the /dev/urandom file.  This makes life easier on
platforms that don't have /dev/urandom (like WASM).
This commit is contained in:
Mike Frysinger
2026-01-19 21:36:54 -05:00
committed by Alex Chernyakhovsky
parent 8e472066be
commit b5775df441
2 changed files with 43 additions and 1 deletions
+3
View File
@@ -272,6 +272,7 @@ AC_CHECK_HEADERS(m4_normalize([
stdlib.h
string.h
sys/ioctl.h
sys/random.h
sys/resource.h
sys/socket.h
sys/stat.h
@@ -304,6 +305,8 @@ AC_TYPE_UINTPTR_T
# Checks for library functions.
AC_CHECK_FUNCS(m4_normalize([
getentropy
getrandom
gettimeofday
posix_memalign
cfmakeraw