diff --git a/random.c b/random.c index 0cbb74d..d3f6f0f 100644 --- a/random.c +++ b/random.c @@ -1,11 +1,21 @@ #include #include -#include - #include "random.h" #include "util.h" +#if __has_include() +// glibc 2.25 and later +#include +#else +#include +#include + +static ssize_t getrandom(void *buf, size_t buflen, unsigned int flags) { + return syscall(SYS_getrandom, buf, buflen, flags); +} +#endif + void get_random_seed(void *buf, size_t size) { while (size > 0) { ssize_t r;