util/superiotool: Fix build on musl-libc systems
- use __linux__ instead of __GLIBC__ guard for Linux-specific includes - use POSIX ioperm instead of deprecated iopl Signed-off-by: Fabian Groffen <grobian@gentoo.org> Change-Id: I99613007aa9feddcb1041f31085cdeb195ff7a68 Reviewed-on: https://review.coreboot.org/c/coreboot/+/73358 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
This commit is contained in:
parent
c1cc7eb869
commit
318ddb8aab
|
@ -323,9 +323,12 @@ int main(int argc, char *argv[])
|
|||
#if defined(__FreeBSD__)
|
||||
if ((io_fd = open("/dev/io", O_RDWR)) < 0) {
|
||||
perror("/dev/io");
|
||||
#else
|
||||
#elif defined(__NetBSD__)
|
||||
if (iopl(3) < 0) {
|
||||
perror("iopl");
|
||||
#else
|
||||
if (ioperm(0, 6000, 1) < 0) {
|
||||
perror("ioperm");
|
||||
#endif
|
||||
printf("Superiotool must be run as root.\n");
|
||||
exit(1);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <getopt.h>
|
||||
#if defined(__GLIBC__)
|
||||
#if defined(__linux__)
|
||||
#include <sys/io.h>
|
||||
#endif
|
||||
#if (defined(__MACH__) && defined(__APPLE__))
|
||||
|
@ -24,6 +24,9 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
#include <sys/types.h>
|
||||
#include <machine/cpufunc.h>
|
||||
|
|
Loading…
Reference in New Issue