diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-14 18:57:40 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-26 06:59:41 +0000 |
| commit | 5b4168c763837a520e277025f4a6c56a67c5af9d (patch) | |
| tree | 2dfa199f5c9d1ef4b1ad14bbfafd8d330de79b59 | |
| parent | 8ccdde57e1b740c5fe9f6423d520bf001c69abdf (diff) | |
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 <leah@libreboot.org>
| -rw-r--r-- | util/nvmutil/nvmutil.c | 8 |
1 files changed, 7 insertions, 1 deletions
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 |
