[LEAPSECS] Time math libraries, UTC to TAI

Zefram zefram at fysh.org
Tue Jan 3 12:07:11 EST 2017


Martin Burnicki wrote:
>Of course it would be great if there was an API call which executes fast
>to yield a high performance, and returns a timestamp plus an associated
>status code consistently, in an atomic operation.

A read-only adjtimex() does return all of this information, at least on
systems where struct timex includes the current time.  (Where it doesn't,
there's no atomic way to get this information.)  Obviously it's more
expensive than a mere clock_gettime(), but by how much?  One would think
that just reading the state would be relatively cheap; nothing needs to
be recomputed.

I think the "timestamp plus associated status code" call that should
exist is actually clock_gettime(CLOCK_UTC).  Once that exists, I'm
dubious about the utility of any proposed syscall that would just return
a subset of struct timex.  The whole structure is quite useful for clock
readers because it lets one construct an uncertainty bound, which is
not available through any of the purpose-specific clock reading syscalls.

-zefram


More information about the LEAPSECS mailing list