[LTP] [PATCH] syscalls/ipc: Skip msgctl05 when __USE_TIME64_REDIRECTS is defined

jiaying.song.cn@windriver.com jiaying.song.cn@windriver.com
Thu May 22 11:30:03 CEST 2025


From: Jiaying Song <jiaying.song.cn@windriver.com>

The msgctl05 test checks if the kernel clears the *_high fields in struct msqid64_ds.

However, when __USE_TIME64_REDIRECTS is defined, this structure may not
contain those fields due to header redirection. This patch adds a check
to skip the test in such cases, avoiding false failures and improving test robustness.

Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
---
 testcases/kernel/syscalls/ipc/msgctl/msgctl05.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c
index cd2643b..27beeb8 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c
@@ -11,7 +11,11 @@
 #include "tst_test.h"
 #include "tst_safe_sysv_ipc.h"
 
-#ifdef HAVE_MSQID64_DS_TIME_HIGH
+#if !defined(HAVE_MSQID64_DS_TIME_HIGH)
+TST_TEST_TCONF("test requires struct msqid64_ds to have the time_high fields");
+#elif defined(__USE_TIME64_REDIRECTS)
+TST_TEST_TCONF("test requires __USE_TIME64_REDIRECTS to be undefined");
+#else
 
 static void run(void)
 {
@@ -43,6 +47,5 @@ static struct tst_test test = {
 	.test_all = run,
 	.needs_tmpdir = 1,
 };
-#else
-TST_TEST_TCONF("test requires struct msqid64_ds to have the time_high fields");
+
 #endif
-- 
2.34.1



More information about the ltp mailing list