[RFC v3 05/23] sysdeps/timespec_get: Use clock_gettime64 if avaliable

Joseph Myers joseph@codesourcery.com
Thu Jul 25 20:14:00 GMT 2019


On Wed, 17 Jul 2019, Arnd Bergmann wrote:

> > I don't think this is right.  I think you need to cache clock_gettime64
> > support somewhere and avoid trying to call the non-existing system call
> > again and again.
> 
> How important is this? It sounds like a micro-optimization for a case that
> very few people are going to hit, given that running an application with
> 64-bit time_t on an old kernel will likely hit other bugs that glibc cannot
> deal with.

It's a generic design question for all the time64 patches that might end 
up using one or another syscall at runtime depending on kernel support - 
we'll need to arrive at a consensus on whether such caching (probably 
shared between all relevant syscalls) is desired.  It's not clear to me 
whether the case of _TIME_BITS=64 on an old kernel will end up as a rare 
case or not.  And as per my previous comments, many existing functions 
using 32-bit times should end up as thin wrappers round functions using 
64-bit times, so potentially making two syscalls every time unless there 
is such caching.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list