Fix use getrandom on cosmopolitan libc (#2674)

Fixes the Cosmopolitan Libc platform attempting to use `/dev/urandom`
on operating systems that do not have it.

Signed-off-by: G4Vi <gavin@dylibso.com>
This commit is contained in:
Gavin Hayes 2023-10-27 02:07:16 -04:00 committed by GitHub
parent 9b8fe049b3
commit 51a6b069d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,7 @@
// On Linux, prefer to use getrandom, though it isn't available in
// GLIBC before 2.25.
#if (defined(__linux__) || defined(ESP_PLATFORM)) \
#if (defined(__linux__) || defined(ESP_PLATFORM) || defined(__COSMOPOLITAN__)) \
&& (!defined(__GLIBC__) || __GLIBC__ > 2 \
|| (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 25))
#define CONFIG_HAS_GETRANDOM 1