Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH v1] ioctl_pidfd06: Accept both ESRCH and EREMOTE for PIDFD_GET_INFO
@ 2026-04-06  2:35 Wei Gao via ltp
  2026-04-24 10:22 ` Petr Vorel
  0 siblings, 1 reply; 4+ messages in thread
From: Wei Gao via ltp @ 2026-04-06  2:35 UTC (permalink / raw)
  To: ltp

LTP commit f630471a6520 attempted to handle this using a kernel version
check (7.0.0). However, this is proving unreliable as the change is
appearing in earlier kernel versions (e.g., 6.19.x) due to different
release cycles or backports.

Fixes: f630471a6520 ("ioctl_pidfd06: Select expected errno for PIDFD_GET_INFO across pidns")
Signed-off-by: Wei Gao <wegao@suse.com>
---
 testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c b/testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c
index 0f24d4741..fec85d680 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c
@@ -14,7 +14,10 @@
 
 static struct tst_clone_args *args;
 static struct pidfd_info *info;
-static int err_nr = ESRCH;
+static int exp_errnos[] = {
+	ESRCH,
+	EREMOTE,
+};
 
 static void run(void)
 {
@@ -42,7 +45,10 @@ static void run(void)
 	args->exit_signal = SIGCHLD;
 
 	if (!SAFE_CLONE(args)) {
-		TST_EXP_FAIL(ioctl(pidfd, PIDFD_GET_INFO, info), err_nr);
+		TST_EXP_FAIL_ARR(
+				ioctl(pidfd, PIDFD_GET_INFO, info),
+				exp_errnos, ARRAY_SIZE(exp_errnos)
+				);
 		exit(0);
 	}
 
@@ -53,9 +59,6 @@ static void setup(void)
 {
 	if (!ioctl_pidfd_info_exit_supported())
 		tst_brk(TCONF, "PIDFD_INFO_EXIT is not supported by ioctl()");
-
-	if (tst_kvercmp(7, 0, 0) >= 0)
-		err_nr = EREMOTE;
 }
 
 static struct tst_test test = {
-- 
2.52.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2026-04-28  9:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-06  2:35 [LTP] [PATCH v1] ioctl_pidfd06: Accept both ESRCH and EREMOTE for PIDFD_GET_INFO Wei Gao via ltp
2026-04-24 10:22 ` Petr Vorel
2026-04-24 12:02   ` Wei Gao via ltp
2026-04-28  9:24     ` Petr Vorel

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