mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Cc: Rich Felker <dalias@libc.org>,
	Jens Gustedt <jens.gustedt@inria.fr>,
	Jason Ekstrand <jason@jlekstrand.net>
Subject: Re: [musl] C23 implications for C libraries
Date: Sun, 20 Nov 2022 06:34:56 +0100	[thread overview]
Message-ID: <20221120053456.GA2497@voyager> (raw)
In-Reply-To: <CAE2XoE_WmDRPnZ6kBrcgrwZnX3QY7Ngx9-ZuEYg-AdDx=XHt+g@mail.gmail.com>

On Sun, Nov 20, 2022 at 12:25:21PM +0800, 罗勇刚(Yonggang Luo) wrote:
> That's the issue, when you access `CLOCK_MONOTONIC_RAW`, it's have to be
> defined, suppose we have
> standardized TIME_MONOTONIC_RAW, then we have no need get the time with,
> ```
> #ifndef CLOCK_MONOTONIC_RAW
>  // The code
> #endif
> ```
> but with
> ```
> if (timespec_get(ts, TIME_MONOTONIC_RAW) != 0) {
> }
> ```
>
>
>
>

But the standard defines these additional clocks as optional, too,
right? I'm looking at a C23 draft from Sept. 3rd, 2022, and it says in
§7.29.1.3 sentence 1:

"The definition macros for time bases other than TIME_UTC are optional."

Meaning even a fully conforming implementation does not have to define
these. Never mind the fact that TIME_MONOTONIC_RAW is not mentioned in
there, ever. The implementation is allowed to add further names
beginning with TIME_ to the header, but the only time bases mentioned
are UTC, MONOTONIC, ACTIVE, and THREAD_ACTIVE.

The Vulkan people are also likely to not want to throw away
compatibility with existing libcs that are not yet C23 capable,
especially for something so minor as a timestamp. The current code works
only on Linux, but it works as long as libc is young enough to define
the time base. The C23 time base you are proposing can only be supported
if the Linux time base is also supported, so the set of libcs supporting
this extension is necessarily a subset of the ones supporting the
existing code. Narrowing the set of supported libcs does not seem
prudent to me.

Ciao,
Markus

  reply	other threads:[~2022-11-20  5:35 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-23 14:25 Jₑₙₛ Gustedt
2022-09-23 14:58 ` Rich Felker
2022-09-23 15:11   ` Alexander Monakov
2022-09-23 15:35   ` Jₑₙₛ Gustedt
2022-09-23 15:28 ` enh
2022-09-23 15:40   ` Jₑₙₛ Gustedt
2022-09-23 23:52     ` enh
2022-09-24  7:31       ` Jₑₙₛ Gustedt
2022-09-26  3:18         ` Damian McGuckin
2022-09-26  3:33         ` Rich Felker
2022-09-26 10:49         ` Florian Weimer
2022-09-26 12:52           ` Jₑₙₛ Gustedt
2022-09-26 20:13         ` enh
2022-11-18 20:46 ` 罗勇刚(Yonggang Luo)
2022-11-19 14:33   ` Jₑₙₛ Gustedt
2022-11-19 17:19     ` 罗勇刚(Yonggang Luo)
2022-11-20  8:23       ` Jₑₙₛ Gustedt
2022-11-19 18:28     ` Rich Felker
2022-11-20  8:42       ` Jₑₙₛ Gustedt
2023-05-03 22:58     ` enh
2023-05-04  6:19       ` Jₑₙₛ Gustedt
2023-05-04 16:03         ` Rich Felker
2023-05-04 16:07           ` enh
2023-05-04 23:16             ` Gabriel Ravier
2023-05-05  0:37               ` JeanHeyd Meneide
2023-05-05  6:56                 ` Jₑₙₛ Gustedt
2023-05-05 12:40                   ` Rich Felker
2023-05-05  6:40             ` Jₑₙₛ Gustedt
2023-05-04 16:03         ` enh
2023-05-04 23:11           ` Gabriel Ravier
2022-11-19 18:31   ` Rich Felker
2022-11-20  4:25     ` 罗勇刚(Yonggang Luo)
2022-11-20  5:34       ` Markus Wichmann [this message]
2022-11-21 11:46 ` Reini Urban
2022-11-21 21:06   ` Jₑₙₛ Gustedt
2022-11-23  4:31     ` 罗勇刚(Yonggang Luo)
2022-11-23  8:11       ` Jₑₙₛ Gustedt
2022-11-23  8:20         ` 罗勇刚(Yonggang Luo)
2022-11-23  8:33           ` Jₑₙₛ Gustedt
2022-11-23  8:41             ` 罗勇刚(Yonggang Luo)

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=20221120053456.GA2497@voyager \
    --to=nullplan@gmx.net \
    --cc=dalias@libc.org \
    --cc=jason@jlekstrand.net \
    --cc=jens.gustedt@inria.fr \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).