diff mbox series

syscalls/ipc: Skip msgctl05 when __USE_TIME64_REDIRECTS is defined

Message ID 20250522093003.1958528-1-jiaying.song.cn@windriver.com
State Needs Review / ACK
Headers show
Series syscalls/ipc: Skip msgctl05 when __USE_TIME64_REDIRECTS is defined | expand

Checks

Context Check Description
ltpci/debian_stable_s390x-linux-gnu-gcc_s390x success success
ltpci/debian_stable_aarch64-linux-gnu-gcc_arm64 success success
ltpci/debian_stable_powerpc64le-linux-gnu-gcc_ppc64el success success
ltpci/debian_stable_gcc success success
ltpci/ubuntu_jammy_gcc success success
ltpci/quay-io-centos-centos_stream9_gcc success success
ltpci/debian_stable_gcc success success
ltpci/opensuse-leap_latest_gcc success success
ltpci/fedora_latest_clang success success
ltpci/ubuntu_bionic_gcc success success
ltpci/alpine_latest_gcc success success
ltpci/debian_testing_clang success success
ltpci/debian_oldstable_gcc success success
ltpci/debian_testing_gcc success success
ltpci/debian_oldstable_clang success success
ltpci/opensuse-archive_42-2_gcc success success

Commit Message

Jiaying Song via ltp May 22, 2025, 9:30 a.m. UTC
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 mbox series

Patch

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