summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/minutils/s6-fillurandompool.c7
1 files changed, 5 insertions, 2 deletions
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 <unistd.h>
+#include <errno.h>
#include <sys/syscall.h>
#include <skalibs/strerr2.h>
#include <skalibs/djbunix.h>
-#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)