From: Petr Vorel <pvorel@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: Linux Test Project <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH] nanosleep: use POSIX runtime detection for CLOCK_MONOTONIC
Date: Thu, 16 Apr 2026 14:08:21 +0200 [thread overview]
Message-ID: <20260416120821.GB299728@pevik> (raw)
In-Reply-To: <20260416-fix_nanosleep_include-v1-1-f584b5556141@suse.com>
Hi Andrea,
...
> --- /dev/null
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/helpers.h
> @@ -0,0 +1,28 @@
> +/*
> + * Copyright (c) 2026, Linux Test Project
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
> +
> +#ifndef NANOSLEEP_HELPERS_H
> +#define NANOSLEEP_HELPERS_H
> +
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <time.h>
> +
> +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;
> +}
> +
> +#endif /* NANOSLEEP_HELPERS_H */
Could you please also fix
testcases/open_posix_testsuite/conformance/interfaces/clock_settime/helpers.h?
The rest LGTM.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-04-16 12:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-16 6:59 [LTP] [PATCH] nanosleep: use POSIX runtime detection for CLOCK_MONOTONIC 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
2026-04-16 12:08 ` Petr Vorel [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-05-04 13:20 [LTP] [PATCH] " Andrea Cervesato
2026-05-05 14:29 ` Cyril Hrubis
2026-05-05 14:32 ` 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=20260416120821.GB299728@pevik \
--to=pvorel@suse.cz \
--cc=andrea.cervesato@suse.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.