From e9698175b0b60407db1e89bcf29437ab224bca0b Mon Sep 17 00:00:00 2001 From: Lukasz Majewski Date: Mon, 16 Mar 2020 08:31:41 +0100 Subject: 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). --- sysdeps/generic/memusage.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysdeps/generic/memusage.h') diff --git a/sysdeps/generic/memusage.h b/sysdeps/generic/memusage.h index a111864b0b..91e56d24de 100644 --- a/sysdeps/generic/memusage.h +++ b/sysdeps/generic/memusage.h @@ -28,9 +28,9 @@ #ifndef GETTIME # define GETTIME(low,high) \ { \ - struct timespec now; \ + struct __timespec64 now; \ uint64_t usecs; \ - clock_gettime (CLOCK_REALTIME, &now); \ + __clock_gettime64 (CLOCK_REALTIME, &now); \ usecs = (uint64_t)now.tv_nsec / 1000 + (uint64_t)now.tv_sec * 1000000; \ low = usecs & 0xffffffff; \ high = usecs >> 32; \ -- cgit 1.4.1