public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] syscalls/semctl08: Skip semctl08 when __USE_TIME64_REDIRECTS is defined
@ 2025-05-23  7:41 Jiaying Song via ltp
  2025-09-18 12:34 ` Petr Vorel
  0 siblings, 1 reply; 2+ messages in thread
From: Jiaying Song via ltp @ 2025-05-23  7:41 UTC (permalink / raw)
  To: ltp

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

When __USE_TIME64_REDIRECTS is defined, glibc redirects struct semid_ds to a
64-bit time-safe version that omits the sem_otime_high and sem_ctime_high
fields. As a result, the case becomes invalid and leads to incorrect behavior.

This patch adds a check to skip the test when __USE_TIME64_REDIRECTS is
defined, ensuring the test only runs when semid_ds structurally matches
semid64_ds and the *_high fields are accessible.

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

diff --git a/testcases/kernel/syscalls/ipc/semctl/semctl08.c b/testcases/kernel/syscalls/ipc/semctl/semctl08.c
index 1878bd4..3b799fa 100644
--- a/testcases/kernel/syscalls/ipc/semctl/semctl08.c
+++ b/testcases/kernel/syscalls/ipc/semctl/semctl08.c
@@ -10,7 +10,11 @@
 #include "tst_test.h"
 #include "libnewipc.h"
 
-#ifdef HAVE_SEMID64_DS_TIME_HIGH
+#if !defined(HAVE_SEMID64_DS_TIME_HIGH)
+TST_TEST_TCONF("test requires struct semid64_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)
 {
@@ -47,6 +51,4 @@ static struct tst_test test = {
 	.test_all = run,
 	.needs_tmpdir = 1,
 };
-#else
-TST_TEST_TCONF("test requires struct semid64_ds to have the time_high fields");
 #endif
-- 
2.34.1


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

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

end of thread, other threads:[~2025-09-18 12:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-23  7:41 [LTP] [PATCH] syscalls/semctl08: Skip semctl08 when __USE_TIME64_REDIRECTS is defined Jiaying Song via ltp
2025-09-18 12:34 ` Petr Vorel

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