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>
This commit is contained in:
Leah Rowe
2026-04-01 11:36:41 +01:00
parent 716140b80f
commit 2c40ad7816
8 changed files with 42 additions and 61 deletions
+10 -8
View File
@@ -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>
#include <sys/syscall.h>
long syscall(long number, ...);
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <sys/syscall.h>
#include <sys/random.h>
#endif
#ifdef __OpenBSD__
#include <sys/param.h>
#endif
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>