selftests: pid_namespace and pidfd missing include
Subsystems (3)
PATCH 1/1 selftests: pid_namespace and pidfd missing include
Running "make kselftest" results in several errors like these:
pidfd_fdinfo_test.c:231:36: error: ‘MS_REC’ undeclared (first use in this function)
231 | r = mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0);
pidfd_fdinfo_test.c:231:45: error: ‘MS_PRIVATE’ undeclared (first use in this function); did you mean ‘MAP_PRIVATE’?
231 | r = mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0);
pid_max.c:48:9: warning: implicit declaration of function ‘umount2’; did you mean ‘SYS_umount2’? [-Wimplicit-function-declaration]
48 | umount2("/proc", MNT_DETACH);
This patch adds the <sys/mount.h> include in pidfd_fdinfo_test.c and pid_max.c files to find the variables MS_REC, MS_PRIVATE, MNT_DETACH.
--- tools/testing/selftests/pid_namespace/pid_max.c | 1 + tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 1 + 2 files changed, 2 insertions(+)
tools/testing/selftests/pid_namespace/pid_max.c +1 -0
@@ -11,6 +11,7 @@#include <string.h> #include <syscall.h> #include <sys/wait.h> +#include <sys/mount.h> #include "../kselftest_harness.h" #include "../pidfd/pidfd.h"
tools/testing/selftests/pidfd/pidfd_fdinfo_test.c +1 -0
@@ -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.43.0
Quoted 48 lines
Running "make kselftest" results in several errors like these:
pidfd_fdinfo_test.c:231:36: error: ‘MS_REC’ undeclared (first use in this function)
231 | r =mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0);pidfd_fdinfo_test.c:231:45: error: ‘MS_PRIVATE’ undeclared (first use in this function); did you mean ‘MAP_PRIVATE’?
231 | r =mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0);pid_max.c:48:9: warning: implicit declaration of function ‘umount2’; did you mean ‘SYS_umount2’? [-Wimplicit-function-declaration]
48 |umount2("/proc", MNT_DETACH);This patch adds the <
sys/mount.h> include inpidfd_fdinfo_test.candpid_max.cfiles to find the variablesMS_REC,MS_PRIVATE,MNT_DETACH.Signed-off-by Alessandro Zanni <[email protected]>--- tools/testing/selftests/pid_namespace/pid_max.c | 1 + tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 1 + 2 files changed, 2 insertions(+)tools/testing/selftests/pid_namespace/pid_max.c +1
-0@@ -11,6 +11,7 @@#include <string.h> #include <syscall.h> #include <sys/wait.h> +#include <sys/mount.h> #include "../kselftest_harness.h" #include "../pidfd/pidfd.h" tools/testing/selftests/pidfd/pidfd_fdinfo_test.c +1
-1@@ -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" --
Quoted 1 line
2.43.0
Hello,
I'm reaching out to know if you have any comments or feedbacks about this patch.
Thanks,
Alessandro
Shuah Khan
maintainerQuoted 52 lines · Alessandro Zanni
Quoted 48 lines
Running "make kselftest" results in several errors like these:
pidfd_fdinfo_test.c:231:36: error: ‘MS_REC’ undeclared (first use in this function)
231 | r =mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0);pidfd_fdinfo_test.c:231:45: error: ‘MS_PRIVATE’ undeclared (first use in this function); did you mean ‘MAP_PRIVATE’?
231 | r =mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0);pid_max.c:48:9: warning: implicit declaration of function ‘umount2’; did you mean ‘SYS_umount2’? [-Wimplicit-function-declaration]
48 | umount2("/proc", MNT_DETACH);This patch adds the <
sys/mount.h> include inpidfd_fdinfo_test.candpid_max.cfiles to find the variablesMS_REC,MS_PRIVATE,MNT_DETACH.Signed-off-by Alessandro Zanni <[email protected]>--- tools/testing/selftests/pid_namespace/pid_max.c | 1 + tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 1 + 2 files changed, 2 insertions(+)tools/testing/selftests/pid_namespace/pid_max.c +1
-0@@ -11,6 +11,7 @@#include <string.h> #include <syscall.h> #include <sys/wait.h> +#include <sys/mount.h> #include "../kselftest_harness.h" #include "../pidfd/pidfd.h" tools/testing/selftests/pidfd/pidfd_fdinfo_test.c +1
-1@@ -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" --Quoted 1 line
2.43.0
Hello,
Quoted 3 lines
I'm reaching out to know if you have any comments or feedbacks about this patch.
Christian, would you like me to pick this patch up?
thanks,
-- Shuah
Quoted 46 lines · Shuah Khan
Quoted 45 lines · Alessandro Zanni
Quoted 45 lines
Running "make kselftest" results in several errors like these:
pidfd_fdinfo_test.c:231:36: error: ‘MS_REC’ undeclared (first use in this function)
231 | r =mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0);pidfd_fdinfo_test.c:231:45: error: ‘MS_PRIVATE’ undeclared (first use in this function); did you mean ‘MAP_PRIVATE’?
231 | r =mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0);pid_max.c:48:9: warning: implicit declaration of function ‘umount2’; did you mean ‘SYS_umount2’? [-Wimplicit-function-declaration]
48 | umount2("/proc", MNT_DETACH);This patch adds the <
sys/mount.h> include inpidfd_fdinfo_test.candpid_max.cfiles to find the variablesMS_REC,MS_PRIVATE,MNT_DETACH.Signed-off-by Alessandro Zanni <[email protected]>--- tools/testing/selftests/pid_namespace/pid_max.c | 1 + tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 1 + 2 files changed, 2 insertions(+)tools/testing/selftests/pid_namespace/pid_max.c +1
-0@@ -11,6 +11,7 @@#include <string.h> #include <syscall.h> #include <sys/wait.h> +#include <sys/mount.h> #include "../kselftest_harness.h" #include "../pidfd/pidfd.h" tools/testing/selftests/pidfd/pidfd_fdinfo_test.c +1
-0@@ -13,6 +13,7 @@#include <syscall.h> #include <sys/wait.h> #include <sys/mman.h> +#include <sys/mount.h>
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
tools/testing/selftests/pidfd/pidfd_fdinfo_test.c +0
-1#include "pidfd.h" #include "../kselftest.h" --2.43.0
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
~
~
Quoted 11 lines
Quoted 6 lines
Hello,
I'm reaching out to know if you have any comments or feedbacks about this patch.
Christian, would you like me to pick this patch up?
thanks,
-- Shuah