From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22173 invoked from network); 20 Nov 2022 08:23:20 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 20 Nov 2022 08:23:20 -0000 Received: (qmail 16011 invoked by uid 550); 20 Nov 2022 08:23:17 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 15979 invoked from network); 20 Nov 2022 08:23:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:message-id:in-reply-to: references:mime-version; bh=EWY7oknTTRplSa3ogaHBbsorhkXAkqiCdnxFxBo/3Zk=; b=r6Kzqyx0rMlTiwMVXPkXUuhbjJ0ZYKzIuvF7WnpnRiFMYAm5ayxL9Sfp WtlEtQGg2u3tvXh/ARoIQANPVJRflT9yXdSrmbnHmDoQRqRu3DWspY/JD 5FgfuFDuTIfVQacMQOdSZ6fNT/IhgdLgpSEfLRyWEPaSDTsT7XFmk7vYt w=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=jens.gustedt@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="5.96,179,1665439200"; d="scan'208";a="40265372" Date: Sun, 20 Nov 2022 09:23:02 +0100 From: =?UTF-8?B?SuKCkeKCmeKCmw==?= Gustedt To: "=?UTF-8?B?572X5YuH5Yia?=(Yonggang Luo)" Cc: musl@lists.openwall.com, Jason Ekstrand Message-ID: <20221120092302.067dd658@inria.fr> In-Reply-To: References: <20220923162518.56284329@inria.fr> <20221119153350.292e390b@inria.fr> Organization: inria.fr X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) X-Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAAXNSR0IArs4c6QAAACRQTFRFERslNjAsLTE9Ok9wUk9TaUs8iWhSrYZkj42Rz6aD3sGZ MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/LQmj0Vg/cn6wo._wDAs/0f."; protocol="application/pgp-signature"; micalg=pgp-sha1 Subject: Re: [musl] C23 implications for C libraries --Sig_/LQmj0Vg/cn6wo._wDAs/0f. Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =E7=BD=97=E5=8B=87=E5=88=9A, on Sun, 20 Nov 2022 01:19:40 +0800 you (=E7=BD=97=E5=8B=87=E5=88=9A(Yonggan= g 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?) =20 >=20 > 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=EF=BC=89, 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=E2=82=91=E2=82=99=E2=82=9B --=20 :: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS ::: :: :::::::::::::::::::::: gsm France : +33 651400183 :: :: ::::::::::::::: gsm international : +49 15737185122 :: :: http://icube-icps.unistra.fr/index.php/Jens_Gustedt :: --Sig_/LQmj0Vg/cn6wo._wDAs/0f. Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQSN9stI2OFN1pLljN0P0+hp2tU34gUCY3nj5gAKCRAP0+hp2tU3 4q5iAJwIemvcwaX0VioRu8qW6zMy8ryFkACePPXikX0JUiValAYeVz5q+RoZOVQ= =9eXz -----END PGP SIGNATURE----- --Sig_/LQmj0Vg/cn6wo._wDAs/0f.--