Skip to contentSkip to conversation

uapi: if.h: fix linux/libc-compat.h include on Linux < 3.12

PATCH New Thomas Devoogdt 1 participant 1 message Feb 22, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uapi: if.h: fix linux/libc-compat.h include on Linux < 3.12

./uapi/linux/if.h:23:10: fatal error: linux/libc-compat.h: No such file or directory
. #include <linux/libc-compat.h> /* for compatibility with glibc */

          ^~~~~~~~~~~~~~~~~~~~~

https://github.com/torvalds/linux/commit/cfd280c91253cc28e4919e349fa7a813b63e71e8

---
 uapi/linux/if.h | 5 +++++
 1 file changed, 5 insertions(+)
uapi/linux/if.h +5 -0
index b287b2a..8861497 100644
@@ -20,7 +20,12 @@
 #ifndef _LINUX_IF_H
 #define _LINUX_IF_H
 
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
 #include <linux/libc-compat.h>          /* for compatibility with glibc */
+#endif
+
 #include <linux/types.h>		/* for "__kernel_caddr_t" et al	*/
 #include <linux/socket.h>		/* for "struct sockaddr" et al	*/
 		/* for "__user" et al           */
Signature · 1 line
2.39.2