diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-09-01 16:44:58 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-09-01 16:44:58 -0400 |
| commit | ed50c5fefb8892ad2ba5262491669f268ddbd436 (patch) | |
| tree | e93a6a8b7e963c37a001691751d6845d10e0cbf8 /lib/random/sysrandom.h | |
| parent | 02a99d24a310c04622a875dcf4b0c6fd2de71332 (diff) | |
Overhaul code to stop keeping examples and libraries in the same repo,
but instead spin each out into its own repo.
Diffstat (limited to 'lib/random/sysrandom.h')
| -rw-r--r-- | lib/random/sysrandom.h | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/lib/random/sysrandom.h b/lib/random/sysrandom.h deleted file mode 100644 index 3d6b800f..00000000 --- a/lib/random/sysrandom.h +++ /dev/null @@ -1,17 +0,0 @@ -// Logic for using system random numbers - -#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); - return buflen; -} -#elif defined(__linux__) -// Use getrandom() -#include <sys/random.h> -#else -#error "Unsupported platform for secure random number generation" -#endif |
