mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-10 05:03:06 +03:00
y2038: Replace __clock_gettime with __clock_gettime64
The __clock_gettime internal function is not supporting 64 bit time on architectures with __WORDSIZE == 32 and __TIMESIZE != 64 (like e.g. ARM 32 bit). The __clock_gettime64 function shall be used instead in the glibc itself as it supports 64 bit time on those systems. This patch does not bring any changes to systems with __WORDSIZE == 64 as for them the __clock_gettime64 is aliased to __clock_gettime (in ./include/time.h).
This commit is contained in:
@@ -30,8 +30,8 @@
|
||||
static inline uint32_t
|
||||
random_bits (void)
|
||||
{
|
||||
struct timespec tv;
|
||||
__clock_gettime (CLOCK_MONOTONIC, &tv);
|
||||
struct __timespec64 tv;
|
||||
__clock_gettime64 (CLOCK_MONOTONIC, &tv);
|
||||
/* Shuffle the lower bits to minimize the clock bias. */
|
||||
uint32_t ret = tv.tv_nsec ^ tv.tv_sec;
|
||||
ret ^= (ret << 24) | (ret >> 8);
|
||||
|
Reference in New Issue
Block a user