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 12:25:21 +0800
From: 罗勇刚(Yonggang Luo) <>
To:, Rich Felker <>
Cc: Jens Gustedt <>, Jason Ekstrand <>
Subject: Re: C23 implications for C libraries

On Sun, Nov 20, 2022 at 2:32 AM Rich Felker <> wrote:
> On Sat, Nov 19, 2022 at 04:46:22AM +0800, 罗勇刚(Yonggang Luo) wrote:
> > There is a concept called CLOCK_MONOTONIC_RAW  (since Linux 2.6.28;
> > Linux-specific),
> > May C2x provide TIME_MONOTONIC_RAW in future or can we just implement
> > CLOCK_MONOTONIC_RAW  on Linux? When implement mesa vulkan driver, it's
> >
> >
> >
> > May intention is using C2x timespec_get to replace function
> > vk_clock_gettime but it's lack of  TIME_MONOTONIC_RAW, so I don't know
> > what's the best way
> The code there is already doing exactly what it should do in the case
> where CLOCK_MONOTONIC_RAW is not defined so I'm not sure what you're
> trying to achieve.
> On a system where CLOCK_MONOTONIC_RAW is defined, the caller may have
> (for likely-nonsensical reasons) chosen to pass CLOCK_MONOTONIC_RAW,
> and they're handling the case where the kernel is too old to have that
> extension clock by substituting CLOCK_MONOTONIC instead.

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,
 // The code
but with
if (timespec_get(ts, TIME_MONOTONIC_RAW) != 0) {

> If CLOCK_MONOTONIC_RAW is not defined, then most certainly the caller
> did not pass it (since there's no such thing) and thus there is no
> need for any fallback code.
> No action is needed at all here.
> Rich

Yonggang Luo

Content of type "text/html" 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.