mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "Jₑₙₛ Gustedt" <jens.gustedt@inria.fr>
To: "罗勇刚(Yonggang Luo)" <luoyonggang@gmail.com>
Cc: musl@lists.openwall.com, Jason Ekstrand <jason@jlekstrand.net>
Subject: Re: [musl] C23 implications for C libraries
Date: Sun, 20 Nov 2022 09:23:02 +0100	[thread overview]
Message-ID: <20221120092302.067dd658@inria.fr> (raw)
In-Reply-To: <CAE2XoE9DL9z5xBx5a=3rK2DEkLKSyw0axu9G=3=yDa1cyX4cMQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2154 bytes --]

罗勇刚,

on Sun, 20 Nov 2022 01:19:40 +0800 you (罗勇刚(Yonggang Luo)
<luoyonggang@gmail.com>) 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
> CLOCK_MONOTONIC_RAW, so the equivalent TIME_UTC, TIME_MONOTONIC,
> 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.

Jₑₙₛ

-- 
:: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS :::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2022-11-20  8:23 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 [this message]
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
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=20221120092302.067dd658@inria.fr \
    --to=jens.gustedt@inria.fr \
    --cc=jason@jlekstrand.net \
    --cc=luoyonggang@gmail.com \
    --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).