public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] syscalls/ipc: Skip msgctl05 when __USE_TIME64_REDIRECTS is defined
@ 2025-05-22  9:30 Jiaying Song via ltp
  2026-02-17  8:50 ` Andrea Cervesato via ltp
  0 siblings, 1 reply; 2+ messages in thread
From: Jiaying Song via ltp @ 2025-05-22  9:30 UTC (permalink / raw)
  To: ltp

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


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

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

* Re: [LTP] [PATCH] syscalls/ipc: Skip msgctl05 when __USE_TIME64_REDIRECTS is defined
  2025-05-22  9:30 [LTP] [PATCH] syscalls/ipc: Skip msgctl05 when __USE_TIME64_REDIRECTS is defined Jiaying Song via ltp
@ 2026-02-17  8:50 ` Andrea Cervesato via ltp
  0 siblings, 0 replies; 2+ messages in thread
From: Andrea Cervesato via ltp @ 2026-02-17  8:50 UTC (permalink / raw)
  To: jiaying.song.cn, ltp

Hi!

On Thu May 22, 2025 at 11:30 AM CEST, Jiaying Song via ltp wrote:
> 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.

Let's make it more clear:

On systems with 64-bit time_t and glibc's time64 redirects, struct msqid64_ds
may not expose the separate *_high fields, causing the test to fail at compile
time or report false negatives. This can be verified by checking if
__USE_TIME64_REDIRECTS has been defined.

>
> 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");

Missing space ad the beginning, as well as in the next TST_TEST_TCONF.

> +#elif defined(__USE_TIME64_REDIRECTS)
> +TST_TEST_TCONF("test requires __USE_TIME64_REDIRECTS to be undefined");

Here we should back it more clear:

"test cannot run with __USE_TIME64_REDIRECTS defined (time_high fields not accessible)"

> +#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

The rest looks ok.

Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>

-- 
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com


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

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

end of thread, other threads:[~2026-02-17  8:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-22  9:30 [LTP] [PATCH] syscalls/ipc: Skip msgctl05 when __USE_TIME64_REDIRECTS is defined Jiaying Song via ltp
2026-02-17  8:50 ` Andrea Cervesato via ltp

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