This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v3 7/7] y2038: linux: Provide ___gettimeofday64 implementation



On 06/02/2020 07:08, Lukasz Majewski wrote:
>>>> I would say to just not define USE_IFUNC_GETTIMEOFDAY for i686 and
>>>> powerpc32 and make them follow the expected code path for y2038
>>>> safeness.  
>>>
>>> Shall this be added to this patch? Or shall I left the
>>> USE_IFUNC_GETTIMEOFDAY untouched?  
>>
>> Since this patch aims to add time64 gettimeofday for all supported
>> Linux ABI, I think it should be along this patch.
> 
> So the proposed solution here is to remove 
> 
> #define USE_IFUNC_GETTIMEOFDAY
> 
> from 
> 
> sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
> sysdeps/unix/sysv/linux/x86/gettimeofday.c

Only if the ABI have legacy 32 bits time support. More specifically,
for x86 implementation:

#ifdef __x86_64__
# define USE_IFUNC_GETTIMEOFDAY
#endif

And for powerpc:

#ifdef __powerpc64__
# define USE_IFUNC_GETTIMEOFDAY
#endif

> 
> ?
> 
> I do guess that it would be acceptable to trade some minimal extra
> overhead for gettimeofday serving on those archs for glibc simplicity
> and Y2038 safeness?

My point is the vDSO ifunc optimization on a y2038 safe kernel does not
really matter, since there won't be a 64-bit time gettimeofday implementation
and all architectures will need to call clock_gettime64 (either by syscall or
vDSO) anyway.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]