Skip to contentSkip to conversation

selftests: pidfd: add missing sys/mount.h include in pidfd_fdinfo_test.c

PATCH In review Peter Seiderer 2 participants 6 messages Jan 15, 2025 – Apr 30, 2025

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

PATCH 1/3 selftests: pidfd: add missing sys/mount.h include in pidfd_fdinfo_test.c

Fix compile on openSUSE Tumbleweed (gcc-14.2.1, glibc-2.40):
- add missing sys/mount.h include

Fixes:

pidfd_fdinfo_test.c: In function ‘child_fdinfo_nspid_test’:
pidfd_fdinfo_test.c:230:13: error: implicit declaration of function ‘mount’ [-Wimplicit-function-declaration]

    230 |         r = mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0);
        |             ^~~~~
---
 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.47.1
#1 lore raw

PATCH 2/3 selftests: pidfd: add missing sys/ioctl.h include in pidfd_setns_test.c

Fix compile on openSUSE Tumbleweed (gcc-14.2.1, glibc-2.40):
- add missing sys/ioctl.h include

Fixes:

pidfd_setns_test.c: In function ‘current_nsset_setup’:
pidfd_setns_test.c:172:54: error: implicit declaration of function ‘ioctl’ [-Wimplicit-function-declaration]

    172 |                 self->child_pidfd_derived_nsfds[i] = ioctl(self->pidfd, info->pidfd_ioctl, 0);
        |                                                      ^~~~~
---
 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.47.1
Reviewed-by on v1 2/3
#2 lore raw

Re: [PATCH v1 2/3] selftests: pidfd: add missing sys/ioctl.h include in pidfd_setns_test.c

Quoted 4 lines · Peter Seiderer

Fix compile on openSUSE Tumbleweed (gcc-14.2.1, glibc-2.40):
- add missing sys/ioctl.h include

Quoted 8 lines

Fixes:

pidfd_setns_test.c: In function ‘current_nsset_setup’:
pidfd_setns_test.c:172:54: error: implicit declaration of function ‘ioctl’ [-Wimplicit-function-declaration]

    172 |                 self->child_pidfd_derived_nsfds[i] = ioctl(self->pidfd, info->pidfd_ioctl, 0);
        |                                                      ^~~~~
Quoted 19 lines
---
 tools/testing/selftests/pidfd/pidfd_setns_test.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/pidfd/pidfd_setns_test.c +1 -1
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"
--

2.47.1

#3 lore raw

PATCH 3/3 selftests: pid_namespace: add missing sys/mount.h include in pid_max.c

In reply to Peter Seiderer

Fix compile on openSUSE Tumbleweed (gcc-14.2.1, glibc-2.40):
- add missing sys/mount.h include

Fixes:

pid_max.c: In function ‘pid_max_cb’:
pid_max.c:42:15: error: implicit declaration of function ‘mount’ [-Wimplicit-function-declaration]

     42 |         ret = mount("", "/", NULL, MS_PRIVATE | MS_REC, 0);
        |               ^~~~~
---
 tools/testing/selftests/pid_namespace/pid_max.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/pid_namespace/pid_max.c +1 -0
index 51c414faabb0..96f274f0582b 100644
@@ -10,6 +10,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <syscall.h>
+#include <sys/mount.h>
 #include <sys/wait.h>
 
 #include "../kselftest_harness.h"
Signature · 1 line
2.47.1
Reviewed-by on v1 3/3
#4 lore raw

Re: [PATCH v1 3/3] selftests: pid_namespace: add missing sys/mount.h include in pid_max.c

Quoted 4 lines · Peter Seiderer

Fix compile on openSUSE Tumbleweed (gcc-14.2.1, glibc-2.40):
- add missing sys/mount.h include

Quoted 8 lines

Fixes:

pid_max.c: In function ‘pid_max_cb’:
pid_max.c:42:15: error: implicit declaration of function ‘mount’ [-Wimplicit-function-declaration]

     42 |         ret = mount("", "/", NULL, MS_PRIVATE | MS_REC, 0);
        |               ^~~~~
Reviewed-by on v1 1/3
#5 lore raw
In reply to Peter Seiderer
Quoted 4 lines · Peter Seiderer

Fix compile on openSUSE Tumbleweed (gcc-14.2.1, glibc-2.40):
- add missing sys/mount.h include

Quoted 8 lines

Fixes:

pidfd_fdinfo_test.c: In function ‘child_fdinfo_nspid_test’:
pidfd_fdinfo_test.c:230:13: error: implicit declaration of function ‘mount’ [-Wimplicit-function-declaration]

    230 |         r = mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0);
        |             ^~~~~
Quoted 19 lines
---
 tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/pidfd/pidfd_fdinfo_test.c +1 -1
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"
--

2.47.1