From df6d227e69082c5cab33b60aa676aebf08b7585e Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 28 Jun 2021 09:51:00 +0200 Subject: Linux: Move timer_getoverrun from librt to libc The symbol was moved using scripts/move-symbol-to-libc.py. The way the ABI intransition is implemented is changed with this commit: the implementation is now consolidated in one file with a TIMER_T_WAS_INT_COMPAT check. Reviewed-by: Adhemerva Zanella --- sysdeps/unix/sysv/linux/timer_getoverr.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'sysdeps/unix/sysv/linux/timer_getoverr.c') diff --git a/sysdeps/unix/sysv/linux/timer_getoverr.c b/sysdeps/unix/sysv/linux/timer_getoverr.c index 9c7ba3acad..18467c4059 100644 --- a/sysdeps/unix/sysv/linux/timer_getoverr.c +++ b/sysdeps/unix/sysv/linux/timer_getoverr.c @@ -20,17 +20,33 @@ #include #include #include "kernel-posix-timers.h" - - -#ifdef timer_getoverrun_alias -# define timer_getoverrun timer_getoverrun_alias -#endif - +#include int -timer_getoverrun (timer_t timerid) +___timer_getoverrun (timer_t timerid) { -#undef timer_getoverrun kernel_timer_t ktimerid = timerid_to_kernel_timer (timerid); return INLINE_SYSCALL_CALL (timer_getoverrun, ktimerid); } +versioned_symbol (libc, ___timer_getoverrun, timer_getoverrun, GLIBC_2_34); +libc_hidden_ver (___timer_getoverrun, __timer_getoverrun) + +#if TIMER_T_WAS_INT_COMPAT +# if OTHER_SHLIB_COMPAT (librt, GLIBC_2_3_3, GLIBC_2_34) +compat_symbol (librt, ___timer_getoverrun, timer_getoverrun, GLIBC_2_3_3); +# endif + +# if OTHER_SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_3_3) +int +__timer_getoverrun_old (int timerid) +{ + return __timer_getoverrun (__timer_compat_list[timerid]); +} +compat_symbol (librt, __timer_getoverrun_old, timer_getoverrun, GLIBC_2_2); +# endif /* OTHER_SHLIB_COMPAT */ + +#else /* !TIMER_T_WAS_INT_COMPAT */ +# if OTHER_SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_34) +compat_symbol (librt, ___timer_getoverrun, timer_getoverrun, GLIBC_2_2); +# endif +#endif /* !TIMER_T_WAS_INT_COMPAT */ -- cgit v1.2.3-70-g09d2