[LTP] [PATCH] syscalls/ipc: Skip msgctl05 when __USE_TIME64_REDIRECTS is defined
Andrea Cervesato
andrea.cervesato@suse.com
Tue Feb 17 09:50:08 CET 2026
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
More information about the ltp
mailing list