From 956c50882b749f8b3cc007aaec8c0a5c2c6725ee Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 2 Mar 2017 00:17:34 +0100 Subject: util.crand: Only include getrandom shiv with glibc older than 2.25 --- util-src/crand.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util-src/crand.c b/util-src/crand.c index 353b153c..ef9da4d2 100644 --- a/util-src/crand.c +++ b/util-src/crand.c @@ -28,17 +28,22 @@ #include #if defined(WITH_GETRANDOM) + +#if ! __GLIBC_PREREQ(2,25) #include #include -#include #ifndef SYS_getrandom #error getrandom() requires Linux 3.17 or later #endif +/* This wasn't present before glibc 2.25 */ int getrandom(void *buf, size_t buflen, unsigned int flags) { return syscall(SYS_getrandom, buf, buflen, flags); } +#else +#include +#endif #elif defined(WITH_ARC4RANDOM) #include -- cgit v1.2.3