diff mbox series

tests/pid_namespace: Add missing sys/mount.h

Message ID 20250407225953.1540476-1-tjmercier@google.com
State Superseded
Headers show
Series tests/pid_namespace: Add missing sys/mount.h | expand

Commit Message

T.J. Mercier April 7, 2025, 10:59 p.m. UTC
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_PRIVATE
pid_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_umount2
pid_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 <tjmercier@google.com>
---
 tools/testing/selftests/pid_namespace/pid_max.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Shuah Khan April 8, 2025, 10:48 p.m. UTC | #1
On 4/7/25 16:59, T.J. Mercier wrote:
> 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_PRIVATE
> pid_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_umount2
> pid_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 <tjmercier@google.com>

Change the short log to include the subsystem. Send v2 with this
change.

selftests: pid_namespace: Add missing sys/mount.h

thanks,
-- Shuah
T.J. Mercier April 8, 2025, 11:10 p.m. UTC | #2
On Tue, Apr 8, 2025 at 3:48 PM Shuah Khan <skhan@linuxfoundation.org> wrote:
>
> On 4/7/25 16:59, T.J. Mercier wrote:
> > 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_PRIVATE
> > pid_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_umount2
> > pid_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 <tjmercier@google.com>
>
> Change the short log to include the subsystem. Send v2 with this
> change.
>
> selftests: pid_namespace: Add missing sys/mount.h
>
> thanks,
> -- Shuah

Done, thanks!
https://lore.kernel.org/all/20250408230204.2775226-1-tjmercier@google.com/
diff mbox series

Patch

diff --git a/tools/testing/selftests/pid_namespace/pid_max.c b/tools/testing/selftests/pid_namespace/pid_max.c
index 51c414faabb0..96f274f0582b 100644
--- a/tools/testing/selftests/pid_namespace/pid_max.c
+++ b/tools/testing/selftests/pid_namespace/pid_max.c
@@ -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"