summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/lib/rand.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/libreboot-utils/lib/rand.c')
-rw-r--r--util/libreboot-utils/lib/rand.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/util/libreboot-utils/lib/rand.c b/util/libreboot-utils/lib/rand.c
index 8c3fbf4c..726d5cd2 100644
--- a/util/libreboot-utils/lib/rand.c
+++ b/util/libreboot-utils/lib/rand.c
@@ -7,19 +7,21 @@
#ifndef RAND_H
#define RAND_H
-#ifdef __OpenBSD__
-#include <sys/param.h>
-#endif
-#include <sys/types.h>
-
#if defined(USE_URANDOM) && \
((USE_URANDOM) > 0)
#include <fcntl.h> /* if not arc4random: /dev/urandom */
#elif defined(__linux__)
-#include <sys/random.h>
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE 1
+#endif
#include <sys/syscall.h>
-long syscall(long number, ...);
+#include <sys/random.h>
+#endif
+
+#ifdef __OpenBSD__
+#include <sys/param.h>
#endif
+#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>