* [PATCH] selftests: pidfd: Fix compiling warning of pidfs_setns
@ 2025-02-05 5:50 I Hsin Cheng
2025-02-05 12:09 ` Peter Seiderer
0 siblings, 1 reply; 2+ messages in thread
From: I Hsin Cheng @ 2025-02-05 5:50 UTC (permalink / raw)
To: shuah
Cc: brauner, linux-kernel, linux-kselftest, linux-kernel-mentees,
I Hsin Cheng
In the compilation of pidfs_setns_test.c , a warning as the following
will pop out.
pidfd_setns_test.c: In function ‘current_nsset_setup’:
pidfd_setns_test.c:173:54: warning: implicit declaration of function \
‘ioctl’ [-Wimplicit-function-declaration]
173 | self->child_pidfd_derived_nsfds[i] = \
ioctl(self->pidfd, info->pidfd_ioctl, 0);
It's caused by wrong import of header file <linux/ioctl.h>, fix it to
<sys/ioctl.h>.
Signed-off-by: I Hsin Cheng <richard120310@gmail.com>
---
tools/testing/selftests/pidfd/pidfd_setns_test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/pidfd/pidfd_setns_test.c b/tools/testing/selftests/pidfd/pidfd_setns_test.c
index 7c2a43491..3ed42f1eb 100644
--- a/tools/testing/selftests/pidfd/pidfd_setns_test.c
+++ b/tools/testing/selftests/pidfd/pidfd_setns_test.c
@@ -16,7 +16,7 @@
#include <unistd.h>
#include <sys/socket.h>
#include <sys/stat.h>
-#include <linux/ioctl.h>
+#include <sys/ioctl.h>
#include "pidfd.h"
#include "../clone3/clone3_selftests.h"
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] selftests: pidfd: Fix compiling warning of pidfs_setns
2025-02-05 5:50 [PATCH] selftests: pidfd: Fix compiling warning of pidfs_setns I Hsin Cheng
@ 2025-02-05 12:09 ` Peter Seiderer
0 siblings, 0 replies; 2+ messages in thread
From: Peter Seiderer @ 2025-02-05 12:09 UTC (permalink / raw)
To: I Hsin Cheng
Cc: shuah, brauner, linux-kernel, linux-kselftest,
linux-kernel-mentees
Hello *,
On Wed, 5 Feb 2025 13:50:31 +0800, I Hsin Cheng <richard120310@gmail.com> wrote:
> In the compilation of pidfs_setns_test.c , a warning as the following
> will pop out.
>
> pidfd_setns_test.c: In function ‘current_nsset_setup’:
> pidfd_setns_test.c:173:54: warning: implicit declaration of function \
> ‘ioctl’ [-Wimplicit-function-declaration]
> 173 | self->child_pidfd_derived_nsfds[i] = \
> ioctl(self->pidfd, info->pidfd_ioctl, 0);
>
> It's caused by wrong import of header file <linux/ioctl.h>, fix it to
> <sys/ioctl.h>.
>
> Signed-off-by: I Hsin Cheng <richard120310@gmail.com>
> ---
> tools/testing/selftests/pidfd/pidfd_setns_test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/pidfd/pidfd_setns_test.c b/tools/testing/selftests/pidfd/pidfd_setns_test.c
> index 7c2a43491..3ed42f1eb 100644
> --- a/tools/testing/selftests/pidfd/pidfd_setns_test.c
> +++ b/tools/testing/selftests/pidfd/pidfd_setns_test.c
> @@ -16,7 +16,7 @@
> #include <unistd.h>
> #include <sys/socket.h>
> #include <sys/stat.h>
> -#include <linux/ioctl.h>
> +#include <sys/ioctl.h>
>
> #include "pidfd.h"
> #include "../clone3/clone3_selftests.h"
Predated patch already available, see
https://lore.kernel.org/linux-kselftest/20250115105211.390370-2-ps.report@gmx.net/
Regards,
Peter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-05 12:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-05 5:50 [PATCH] selftests: pidfd: Fix compiling warning of pidfs_setns I Hsin Cheng
2025-02-05 12:09 ` Peter Seiderer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox