summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/lib/rand.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-04-01 11:36:41 +0100
committerLeah Rowe <leah@libreboot.org>2026-04-01 11:52:53 +0100
commit2c40ad78166c4cdb667caf4238080a4708c43326 (patch)
treedc67bccbc3eb8725e1d5be65dc9f638ff650b5a2 /util/libreboot-utils/lib/rand.c
parent716140b80feebaeea5ef833de1f6acae68e8a8f1 (diff)
lbutils: only use GNU SOURCE for syscall
and remove manual prototypes; fchmod, realpath and so on rely on the _XOPEN_SOURCE macro. the POSIX macro wasn't needed: _XOPEN_SOURCE is sufficient. Signed-off-by: Leah Rowe <leah@libreboot.org>
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>