From: Willy Tarreau <w@1wt.eu>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Cc: "Thomas Weißschuh" <linux@weissschuh.net>,
"Shuah Khan" <shuah@kernel.org>,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH] tools/nolibc: add support for clock_nanosleep() and nanosleep()
Date: Sun, 6 Jul 2025 08:26:33 +0200 [thread overview]
Message-ID: <20250706062633.GB29601@1wt.eu> (raw)
In-Reply-To: <20250704-nolibc-nanosleep-v1-1-d79c19701952@linutronix.de>
Hi Thomas,
On Fri, Jul 04, 2025 at 04:19:48PM +0200, Thomas Weißschuh wrote:
> +static __attribute__((unused))
> +int sys_clock_nanosleep(clockid_t clockid, int flags, const struct timespec *rqtp,
> + struct timespec *rmtp)
> +{
> +#if defined(__NR_clock_nanosleep)
> + return my_syscall4(__NR_clock_nanosleep, clockid, flags, rqtp, rmtp);
> +#elif defined(__NR_clock_nanosleep_time64)
> + struct __kernel_timespec krqtp, krmtp;
> + int ret;
> +
> + __nolibc_timespec_user_to_kernel(rqtp, &krqtp);
> + ret = my_syscall4(__NR_clock_nanosleep_time64, clockid, flags, &krqtp, &krmtp);
> + if (rmtp)
> + __nolibc_timespec_kernel_to_user(&krmtp, rmtp);
> + return ret;
> +#else
> + return __nolibc_enosys(__func__, clockid, flags, rqtp, rmtp);
> +#endif
I don't know which archs do not have clock_nanosleep, but if it becomes
needed on some of them, we could probably fall back to pslelect() if
available, of course, and ignore the clockid.
Acked-by: Willy Tarreau <w@1wt.eu>
Cheers,
Willy
next prev parent reply other threads:[~2025-07-06 6:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-04 14:19 Thomas Weißschuh
2025-07-06 6:26 ` Willy Tarreau [this message]
2025-07-06 8:44 ` Thomas Weißschuh
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=20250706062633.GB29601@1wt.eu \
--to=w@1wt.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=shuah@kernel.org \
--cc=thomas.weissschuh@linutronix.de \
/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
all inboxes | Powered by JetHome®