From 9a0980fadf9b7a2a4a9c239f3ae667483ea175da Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 15 Sep 2016 12:01:26 +0000 Subject: s6-fillurandompool: add workaround for old libcs that don't define SYS_getrandom --- src/minutils/s6-fillurandompool.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/minutils') diff --git a/src/minutils/s6-fillurandompool.c b/src/minutils/s6-fillurandompool.c index 775f289..57cd88c 100644 --- a/src/minutils/s6-fillurandompool.c +++ b/src/minutils/s6-fillurandompool.c @@ -5,15 +5,18 @@ #endif #include +#include #include #include #include -#define USAGE "s6-fillurandompool" - static int getrandom (void *buf, size_t buflen, unsigned int flags) { +#ifdef SYS_getrandom return syscall(SYS_getrandom, buf, buflen, flags) ; +#else + return (errno = ENOSYS, -1) ; +#endif } int main (void) -- cgit v1.2.3