From 0dc1a378b135ec46fcc451d96c4a3a64c08e2ace Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Wed, 11 Dec 2019 16:39:01 -0300 Subject: linux: Add support for clock_getres64 vDSO No architecture currently defines the vDSO symbol. On archictures with 64-bit time_t the HAVE_CLOCK_GETRES_VSYSCALL is renamed to HAVE_CLOCK_GETRES64_VSYSCALL, it simplifies clock_gettime code. Reviewed-by: Siddhesh Poyarekar --- sysdeps/unix/sysv/linux/clock_getres.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'sysdeps/unix/sysv/linux/clock_getres.c') diff --git a/sysdeps/unix/sysv/linux/clock_getres.c b/sysdeps/unix/sysv/linux/clock_getres.c index d3cabfcb2f..2ba72110ba 100644 --- a/sysdeps/unix/sysv/linux/clock_getres.c +++ b/sysdeps/unix/sysv/linux/clock_getres.c @@ -30,20 +30,23 @@ __clock_getres64 (clockid_t clock_id, struct __timespec64 *res) { #ifdef __ASSUME_TIME64_SYSCALLS /* 64 bit ABIs or Newer 32-bit ABIs that only support 64-bit time_t. */ -# ifdef __NR_clock_getres_time64 - return INLINE_SYSCALL_CALL (clock_getres_time64, clock_id, res); +# ifndef __NR_clock_getres_time64 +# define __NR_clock_getres_time64 __NR_clock_getres +# endif +# ifdef HAVE_CLOCK_GETRES64_VSYSCALL + return INLINE_VSYSCALL (clock_getres_time64, 2, clock_id, res); # else -# ifdef HAVE_CLOCK_GETRES_VSYSCALL - return INLINE_VSYSCALL (clock_getres, 2, clock_id, res); -# else - return INLINE_SYSCALL_CALL (clock_getres, clock_id, res); -# endif + return INLINE_SYSCALL_CALL (clock_getres_time64, clock_id, res); # endif #else int r; /* Old 32-bit ABI with possible 64-bit time_t support. */ # ifdef __NR_clock_getres_time64 +# ifdef HAVE_CLOCK_GETRES64_VSYSCALL + r = INLINE_VSYSCALL (clock_getres_time64, 2, clock_id, res); +# else r = INLINE_SYSCALL_CALL (clock_getres_time64, clock_id, res); +# endif if (r == 0 || errno != ENOSYS) return r; # endif -- cgit 1.4.1