Skip to contentSkip to conversation

selftests/pidfd: Fix missing headers

PATCH In review Siddharth Menon 2 participants 4 messages Mar 2, 2025 – Mar 3, 2025

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

cover selftests/pidfd: Fix missing headers

Fix compilation errors caused by missing headers in the pidfd selftest.

The errors include:
pidfd_fdinfo_test.c:230:13: error: implicit declaration of function ‘mount’ pidfd_setns_test.c:172:54: error: implicit declaration of function ‘ioctl’

Siddharth Menon (2):
selftests/pidfd: Fix missing header
selftests/pidfd: Fix missing header

 tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 1 +
 tools/testing/selftests/pidfd/pidfd_setns_test.c  | 1 +
 2 files changed, 2 insertions(+)
Signature · 1 line
2.48.1
#1 lore raw

PATCH 1/2 selftests/pidfd: Fix missing header

Fix compilation errors caused by the missing sys/mount.h header

---
 tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/pidfd/pidfd_fdinfo_test.c +1 -0
index f062a986e382..f718aac75068 100644
@@ -13,6 +13,7 @@
 #include <syscall.h>
 #include <sys/wait.h>
 #include <sys/mman.h>
+#include <sys/mount.h>
 
 #include "pidfd.h"
 #include "../kselftest.h"
Signature · 1 line
2.48.1
#2 lore raw

PATCH 2/2 selftests/pidfd: Fix missing header

In reply to Siddharth Menon

Fix compilation errors caused by the missing sys/ioctl.h header

---
 tools/testing/selftests/pidfd/pidfd_setns_test.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/pidfd/pidfd_setns_test.c +1 -0
index 222f8131283b..4c8a0253a64f 100644
@@ -17,6 +17,7 @@
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <linux/ioctl.h>
+#include <sys/ioctl.h>
 
 #include "pidfd.h"
 #include "../kselftest_harness.h"
Signature · 1 line
2.48.1
#3 lore raw
In reply to Siddharth Menon

Hello Siddharth,

Quoted 6 lines · Siddharth Menon

Fix compilation errors caused by missing headers in the pidfd selftest.

The errors include:
pidfd_fdinfo_test.c:230:13: error: implicit declaration of function ‘mount’ pidfd_setns_test.c:172:54: error: implicit declaration of function ‘ioctl’

Quoted 8 lines

Siddharth Menon (2):
selftests/pidfd: Fix missing header
selftests/pidfd: Fix missing header

 tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 1 +
 tools/testing/selftests/pidfd/pidfd_setns_test.c  | 1 +
 2 files changed, 2 insertions(+)

Predated patches already available, see

        https://lore.kernel.org/linux-kselftest/[email protected]/
        https://lore.kernel.org/linux-kselftest/[email protected]/
	https://lore.kernel.org/linux-kselftest/[email protected]/

Regards,
Peter