diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-14 18:30:15 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-14 18:30:15 -0400 |
| commit | e69534cbd65d8739cdfb67b5b1a5161236c7361e (patch) | |
| tree | f7fc541bf52640a4cad473d87ed6e773731ce5ca | |
| parent | f62c651b59da6b68f5e9eea48526b4f3693c139e (diff) | |
Include stdlib
| -rw-r--r-- | lib/random/sysrandom.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/random/sysrandom.h b/lib/random/sysrandom.h index ea29296b..d276be45 100644 --- a/lib/random/sysrandom.h +++ b/lib/random/sysrandom.h @@ -1,6 +1,7 @@ #pragma once #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) +#include <stdlib.h> static ssize_t getrandom(void *buf, size_t buflen, unsigned int flags) { (void)flags; arc4random_buf(buf, buflen); @@ -8,7 +9,7 @@ static ssize_t getrandom(void *buf, size_t buflen, unsigned int flags) { } #elif defined(__linux__) // Use getrandom() -# include <sys/random.h> +#include <sys/random.h> #else #error "Unsupported platform for secure random number generation" #endif |
