Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 20 Nov 2022 09:23:02 +0100
From: Jₑₙₛ Gustedt <>
To: "罗勇刚(Yonggang Luo)" <>
Cc:, Jason Ekstrand <>
Subject: Re: C23 implications for C libraries


on Sun, 20 Nov 2022 01:19:40 +0800 you (罗勇刚(Yonggang Luo)
<>) wrote:

> > I am not sure why you'd want to do this, are you trying to port that
> > code such that it gets rid of any reference to POSIX interfaces? If
> > so, you'd have to wait and see if other C libraries will interface
> > the "new" time bases that C23 specifies. (Or does your code only
> > run with musl or windows?)  
> Yeap, I want to gets rid of any reference to POSIX interfaces, as I am
> writing code shared between windows and linux or even more
> platforms(with or without posix support), And I am implementing
> timespec_get in mesa code base to avoid waiting c23 or future c2x to
> be implemented by c standard library provider, currently for mesa's
> special usage, We need access to CLOCK_REALTIME  CLOCK_MONOTONIC and
> TIME_MONOTONIC_RAW in Cx standard is good.

There is not much chance that `TIME_MONOTONIC_RAW` would be supported
by a sufficiently large set of C libraries as an extension in the near
future. `CLOCK_MONOTONIC_RAW` as all the others beyond
`CLOCK_THREAD_CPUTIME_ID` is a Linux extension. Only the new optional
time bases in C23 are those that are already standardized in POSIX.

That would be sensible only if

- C libraries that implement C23 would start to support
  the optional time base `TIME_MONOTONIC`
- You would convince yourself and the users of this code that you
  don't need `TIME_MONOTONIC_RAW` and may use `TIME_MONOTONIC` instead
  as a fallback.

You will not know if this is feasible before the end of 2023 /
beginning of 2024.

The first thing to do would perhaps to work on the second point,
because as said that clock is Linux specific. So before getting rid of
POSIX dependencies you should get rid of Linux dependencies.


:: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS :::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: ::

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.