selftests: pid_namespace: Add missing sys/mount.h
Subsystems (2)
PATCH v2 1/1 selftests: pid_namespace: Add missing sys/mount.h
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);
| ^~~~~
pid_max.c:42:36: error: ‘MS_PRIVATE’ undeclared (first use in this
function); did you mean ‘MAP_PRIVATE’?
42 | ret = mount("", "/", NULL, MS_PRIVATE | MS_REC, 0);
| ^~~~~~~~~~
| MAP_PRIVATEpid_max.c:42:49: error: ‘MS_REC’ undeclared (first use in this function)
42 | ret = mount("", "/", NULL, MS_PRIVATE | MS_REC, 0);
| ^~~~~~
pid_max.c:48:9: error: implicit declaration of function ‘umount2’; did
you mean ‘SYS_umount2’? [-Wimplicit-function-declaration]
48 | umount2("/proc", MNT_DETACH);
| ^~~~~~~
| SYS_umount2pid_max.c:48:26: error: ‘MNT_DETACH’ undeclared (first use in this
function)
48 | umount2("/proc", MNT_DETACH);
--- tools/testing/selftests/pid_namespace/pid_max.c | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/pid_namespace/pid_max.c +1 -0
@@ -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.49.0.504.g3bcea36a83-goog
Hello T.J.,
Quoted 33 lines · T.J. Mercier
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); | ^~~~~ pid_max.c:42:36: error: ‘MS_PRIVATE’ undeclared (first use in this function); did you mean ‘MAP_PRIVATE’? 42 | ret = mount("", "/", NULL, MS_PRIVATE | MS_REC, 0); | ^~~~~~~~~~ | MAP_PRIVATEpid_max.c:42:49: error: ‘MS_REC’ undeclared (first use in this function)
42 | ret =mount("", "/", NULL, MS_PRIVATE | MS_REC, 0);
| ^~~~~~
pid_max.c:48:9: error: implicit declaration of function ‘umount2’; did
you mean ‘SYS_umount2’? [-Wimplicit-function-declaration]48 | umount2("/proc", MNT_DETACH); | ^~~~~~~ | SYS_umount2pid_max.c:48:26: error: ‘MNT_DETACH’ undeclared (first use in this
function)
48 |umount2("/proc", MNT_DETACH);Fixes 615ab43b838b ("tests/pid_namespace: add pid_max tests")Signed-off-by T.J. Mercier <[email protected]>--- tools/testing/selftests/pid_namespace/pid_max.c | 1 + 1 file changed, 1 insertion(+)tools/testing/selftests/pid_namespace/pid_max.c +0
-0
tools/testing/selftests/pid_namespace/pid_max.c line 16
Quoted 7 lines
tools/testing/selftests/pid_namespace/pid_max.c +1
-0@@ -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"
Predated patch already available, see
https://lore.kernel.org/linux-kselftest/[email protected]/
Regards,
Peter
T.J. Mercier
Reviewed-byQuoted 44 lines · Peter Seiderer
Hello T.J.,
Quoted 39 lines · T.J. Mercier
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); | ^~~~~ pid_max.c:42:36: error: ‘MS_PRIVATE’ undeclared (first use in this function); did you mean ‘MAP_PRIVATE’? 42 | ret = mount("", "/", NULL, MS_PRIVATE | MS_REC, 0); | ^~~~~~~~~~ | MAP_PRIVATEpid_max.c:42:49: error: ‘MS_REC’ undeclared (first use in this function)
42 | ret =mount("", "/", NULL, MS_PRIVATE | MS_REC, 0);
| ^~~~~~
pid_max.c:48:9: error: implicit declaration of function ‘umount2’; did
you mean ‘SYS_umount2’? [-Wimplicit-function-declaration]48 | umount2("/proc", MNT_DETACH); | ^~~~~~~ | SYS_umount2pid_max.c:48:26: error: ‘MNT_DETACH’ undeclared (first use in this
function)
48 |umount2("/proc", MNT_DETACH);Fixes 615ab43b838b ("tests/pid_namespace: add pid_max tests")Signed-off-by T.J. Mercier <[email protected]>--- tools/testing/selftests/pid_namespace/pid_max.c | 1 + 1 file changed, 1 insertion(+)tools/testing/selftests/pid_namespace/pid_max.c +1
-0@@ -10,6 +10,7 @@#include <stdlib.h> #include <string.h> #include <syscall.h> +#include <sys/mount.h> #include <sys/wait.h>
Quoted 8 lines
tools/testing/selftests/pid_namespace/pid_max.c line 16
Quoted 1 line
tools/testing/selftests/pid_namespace/pid_max.c +0
-0#include "../kselftest_harness.h" Predated patch already available, see
https://lore.kernel.org/linux-kselftest/[email protected]/Regards,
Peter
Thanks Peter, looks like that was never taken into anybody's tree?
You can have my: