Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH v2] selftests: pid_namespace: Add missing sys/mount.h
@ 2025-04-08 23:02 T.J. Mercier
  2025-04-09  8:53 ` Peter Seiderer
  0 siblings, 1 reply; 3+ messages in thread
From: T.J. Mercier @ 2025-04-08 23:02 UTC (permalink / raw)
  To: Christian Brauner, Shuah Khan, Alexander Mikhalitsyn
  Cc: T.J. Mercier, linux-kernel, linux-kselftest

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(+)

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"
-- 
2.49.0.504.g3bcea36a83-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] selftests: pid_namespace: Add missing sys/mount.h
  2025-04-08 23:02 [PATCH v2] selftests: pid_namespace: Add missing sys/mount.h T.J. Mercier
@ 2025-04-09  8:53 ` Peter Seiderer
  2025-04-09 16:15   ` T.J. Mercier
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Seiderer @ 2025-04-09  8:53 UTC (permalink / raw)
  To: T.J. Mercier
  Cc: Christian Brauner, Shuah Khan, Alexander Mikhalitsyn,
	linux-kernel, linux-kselftest

Hello T.J.,

On Tue,  8 Apr 2025 23:02:02 +0000, "T.J. Mercier" <tjmercier@google.com> 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>
> ---
>  tools/testing/selftests/pid_namespace/pid_max.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> 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"

Predated patch already available, see

	https://lore.kernel.org/linux-kselftest/20250115105211.390370-3-ps.report@gmx.net/

Regards,
Peter

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] selftests: pid_namespace: Add missing sys/mount.h
  2025-04-09  8:53 ` Peter Seiderer
@ 2025-04-09 16:15   ` T.J. Mercier
  0 siblings, 0 replies; 3+ messages in thread
From: T.J. Mercier @ 2025-04-09 16:15 UTC (permalink / raw)
  To: Peter Seiderer
  Cc: Christian Brauner, Shuah Khan, Alexander Mikhalitsyn,
	linux-kernel, linux-kselftest

On Wed, Apr 9, 2025 at 1:53 AM Peter Seiderer <ps.report@gmx.net> wrote:
>
> Hello T.J.,
>
> On Tue,  8 Apr 2025 23:02:02 +0000, "T.J. Mercier" <tjmercier@google.com> 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>
> > ---
> >  tools/testing/selftests/pid_namespace/pid_max.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > 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"
>
> Predated patch already available, see
>
>         https://lore.kernel.org/linux-kselftest/20250115105211.390370-3-ps.report@gmx.net/
>
> Regards,
> Peter

Thanks Peter, looks like that was never taken into anybody's tree?

You can have my:
Reviewed-by: T.J. Mercier <tjmercier@google.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-09 16:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-08 23:02 [PATCH v2] selftests: pid_namespace: Add missing sys/mount.h T.J. Mercier
2025-04-09  8:53 ` Peter Seiderer
2025-04-09 16:15   ` T.J. Mercier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox