blob: e704f65c113f21f265f69013f0c42e6c929f962d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
From 202d79fcf4e184818bd074f8c06e94e700670898 Mon Sep 17 00:00:00 2001
From: Jory Pratt <anarchy@gentoo.org>
Date: Tue, 11 Jun 2019 01:48:01 -0500
Subject: [PATCH] including sysinfo.h from kernel.h makes no sense whatsoever,
but removing it breaks glibc's userspace header, which includes kernel.h
instead of sysinfo.h from their sys/sysinfo.h. this seems to be a historical
mistake. on musl, including any header that uses kernel.h directly or
indirectly plus sys/sysinfo.h will produce a compile error due to
redefinition of struct sysinfo. so for now, only include it on glibc in order
not to break their headers.
Signed-off-by: Jory Pratt <anarchy@gentoo.org>
---
include/uapi/linux/kernel.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/uapi/linux/kernel.h b/include/uapi/linux/kernel.h
index d99ffa1..f917115 100644
--- a/include/uapi/linux/kernel.h
+++ b/include/uapi/linux/kernel.h
@@ -2,7 +2,9 @@
#ifndef _LINUX_KERNEL_H
#define _LINUX_KERNEL_H
+#ifdef __GLIBC__
#include <linux/sysinfo.h>
+#endif
/*
* 'kernel.h' contains some often-used function prototypes etc
--
2.22.0
|