From: linuxtestproject.agent@gmail.com
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it, LTP AI Reviewer <ltp-ai@noreply.github.com>
Subject: Re: [LTP] nanosleep: use POSIX runtime detection for CLOCK_MONOTONIC
Date: Thu, 16 Apr 2026 13:45:04 +0000 [thread overview]
Message-ID: <20260416134504.3846-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260416-fix_nanosleep_include-v2-1-b3147763acb8@suse.com>
Hi Andrea,
On 2026-04-16, Andrea Cervesato wrote:
> nanosleep: use POSIX runtime detection for CLOCK_MONOTONIC
> +static inline clockid_t get_supported_clock(void)
> +{
> +#ifdef _POSIX_MONOTONIC_CLOCK
> + if (_POSIX_MONOTONIC_CLOCK > 0)
> + return CLOCK_MONOTONIC;
> +
> + if (!_POSIX_MONOTONIC_CLOCK && sysconf(_SC_MONOTONIC_CLOCK) > 0)
> + return CLOCK_MONOTONIC;
> +#endif
> +
> + printf("CLOCK_MONOTONIC unavailable, test may fail due to "
> + "external clock adjustments\n");
> + return CLOCK_REALTIME;
> +}
Correct POSIX runtime detection — handles all three _POSIX_MONOTONIC_CLOCK
states (>0, ==0, undefined) properly, and the unistd.h include in helpers.h
closes the silent fallback that affected 1-1.c, 2-1.c, and 10000-1.c.
Reviewed-by: LTP AI Reviewer <ltp-ai@noreply.github.com>
---
Note:
Our agent completed the review of the patch.
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-04-16 13:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-16 12:33 [LTP] [PATCH v2] nanosleep: use POSIX runtime detection for CLOCK_MONOTONIC Andrea Cervesato
2026-04-16 13:45 ` linuxtestproject.agent [this message]
2026-04-17 12:58 ` Petr Vorel
-- strict thread matches above, loose matches on Subject: below --
2026-04-16 6:59 [LTP] [PATCH] " Andrea Cervesato
2026-04-16 8:03 ` [LTP] " linuxtestproject.agent
2026-04-16 11:58 ` Petr Vorel
2026-04-16 12:04 ` Andrea Cervesato via ltp
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=20260416134504.3846-1-linuxtestproject.agent@gmail.com \
--to=linuxtestproject.agent@gmail.com \
--cc=andrea.cervesato@suse.de \
--cc=ltp-ai@noreply.github.com \
--cc=ltp@lists.linux.it \
/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