Thread (19 messages) 19 messages, 4 authors, 2026-02-09

Re: [PATCH net-next v2 2/4] selftests/landlock: Move some UAPI header inclusions after libc ones

From: Mickaël Salaün <mic@digikod.net>
Date: 2026-01-20 22:25:17
Also in: bpf, linux-kselftest, linux-security-module, lkml, mptcp, netdev

On Tue, Jan 20, 2026 at 03:10:32PM +0100, Thomas Weißschuh wrote:
Interleaving inclusions of UAPI headers and libc headers is problematic.
Both sets of headers define conflicting symbols. To enable their
coexistence a compatibility-mechanism is in place.

An upcoming change will define 'struct sockaddr' from linux/socket.h.
However sys/socket.h from libc does not yet handle this case and a
symbol conflict will arise.

Move the inclusion of all UAPI headers after the inclusion of the glibc
ones, so the compatibility mechanism from the UAPI headers is used.

Signed-off-by: Thomas Weißschuh <redacted>
Reviewed-by: Mickaël Salaün <mic@digikod.net>

Thanks!
quoted hunk ↗ jump to hunk
---
 tools/testing/selftests/landlock/audit.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/landlock/audit.h b/tools/testing/selftests/landlock/audit.h
index 44eb433e9666..c12b16c690dc 100644
--- a/tools/testing/selftests/landlock/audit.h
+++ b/tools/testing/selftests/landlock/audit.h
@@ -7,9 +7,6 @@
 
 #define _GNU_SOURCE
 #include <errno.h>
-#include <linux/audit.h>
-#include <linux/limits.h>
-#include <linux/netlink.h>
 #include <regex.h>
 #include <stdbool.h>
 #include <stdint.h>
@@ -20,6 +17,10 @@
 #include <sys/time.h>
 #include <unistd.h>
 
+#include <linux/audit.h>
+#include <linux/limits.h>
+#include <linux/netlink.h>
+
 #include "kselftest.h"
 
 #ifndef ARRAY_SIZE
-- 
2.52.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help