From 48d17cae0f5f3e298cb7b4f1d8b4ca694661734e Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 14 Mar 2026 18:57:40 +0000 Subject: util/nvmutil: enable arc4random on linux not available on older systems. can just pass the relevant flag in the compiler: HAVE_ARC4RANDOM_BUF=0 at build time if you need the fallback. Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'util/nvmutil') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 9865f24b..ba3fc29f 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -15,8 +15,14 @@ * -Os -Wall -Wextra -Werror -pedantic -std=c90 */ +/* + * NOTE: older Linux lacked arc4random. + * added in glibc 2.36. Just pass HAVE_ARC4RANDOM_BUF=0 + * at build time if you need old Linux / other libc. + */ #if defined(__OpenBSD__) || defined(__FreeBSD__) || \ - defined(__NetBSD__) || defined(__APPLE__) + defined(__NetBSD__) || defined(__APPLE__) || \ + defined(__linux__) #ifndef HAVE_ARC4RANDOM_BUF #define HAVE_ARC4RANDOM_BUF 1 #endif -- cgit v1.2.1