From 7e0edd566d7554fd4a2f30f32ca442854d22df93 Mon Sep 17 00:00:00 2001 From: Kylie McClain Date: Wed, 20 Jan 2016 22:19:44 -0500 Subject: [PATCH] kernel.h: Only include sysinfo.h on glibc Including sysinfo.h is unneeded on non-glibc libraries; on musl libc, any header that uses kernel.h, and also uses sys/sysinfo.h will hit redefinition errors of structs within sysinfo.h. Rather than removing the inclusion, it is #ifdef'd away so that only glibc uses it, in order to not break their headers. This patch was originally authored by David Heidelberger , who I got permission from to resubmit adapted for any changes since the time he submitted them. Original patch: https://lkml.org/lkml/2014/3/14/269 --- 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 321e399..e8ff821 100644 --- a/include/uapi/linux/kernel.h +++ b/include/uapi/linux/kernel.h @@ -1,7 +1,9 @@ #ifndef _UAPI_LINUX_KERNEL_H #define _UAPI_LINUX_KERNEL_H +#ifdef __GLIBC__ #include +#endif /* * 'kernel.h' contains some often-used function prototypes etc