kernel: bump 4.9 to 4.9.77
[openwrt/openwrt.git] / target / linux / generic / pending-4.9 / 270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch
1 From: David Heidelberger <david.heidelberger@ixit.cz>
2 Subject: uapi/kernel.h: glibc specific inclusion of sysinfo.h
3
4 including sysinfo.h from kernel.h makes no sense whatsoever,
5 but removing it breaks glibc's userspace header,
6 which includes kernel.h instead of sysinfo.h from their sys/sysinfo.h.
7 this seems to be a historical mistake.
8 on musl, including any header that uses kernel.h directly or indirectly
9 plus sys/sysinfo.h will produce a compile error due to redefinition of
10 struct sysinfo from sys/sysinfo.h.
11 so for now, only include it on glibc or when including from kernel
12 in order not to break their headers.
13
14 Signed-off-by: John Spencer <maillist-linux@barfooze.de>
15 Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
16 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
17 ---
18 include/uapi/linux/kernel.h | 2 ++
19 1 file changed, 2 insertions(+)
20
21 --- a/include/uapi/linux/kernel.h
22 +++ b/include/uapi/linux/kernel.h
23 @@ -1,7 +1,9 @@
24 #ifndef _UAPI_LINUX_KERNEL_H
25 #define _UAPI_LINUX_KERNEL_H
26
27 +#if defined(__KERNEL__) || defined( __GLIBC__)
28 #include <linux/sysinfo.h>
29 +#endif
30
31 /*
32 * 'kernel.h' contains some often-used function prototypes etc