public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: <jiaying.song.cn@windriver.com>, <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH] syscalls/ipc: Skip msgctl05 when __USE_TIME64_REDIRECTS is defined
Date: Tue, 17 Feb 2026 09:50:08 +0100	[thread overview]
Message-ID: <DGH3WFEFIBFP.33NJI688DM4ZP@suse.com> (raw)
In-Reply-To: <20250522093003.1958528-1-jiaying.song.cn@windriver.com>

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

      reply	other threads:[~2026-02-17  8:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DGH3WFEFIBFP.33NJI688DM4ZP@suse.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    --cc=jiaying.song.cn@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox