mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Finish move of clock_* functions to libc. [BZ #24959]
In glibc 2.17, the functions clock_getcpuclockid, clock_getres, clock_gettime, clock_nanosleep, and clock_settime were moved from librt.so to libc.so, leaving compatibility stubs behind. Now that the dynamic linker no longer insists on finding versioned symbols in the same library that originally defined them, we do not need the stubs anymore, and this means we don't need GLIBC_PRIVATE __-prefix aliases for most of the functions anymore either. (clock_gettime still needs one.) For ports added before 2.17, libc.so needs to provide two symbol versions for each, the default at GLIBC_2.17 plus a compat version matching what librt had. While I'm at it, move the clock_*.c files and their tests from rt/ to time/.
This commit is contained in:
committed by
Florian Weimer
parent
b5367a08ae
commit
7b5af2d8f2
@ -26,11 +26,20 @@
|
||||
#endif
|
||||
#include <sysdep-vdso.h>
|
||||
|
||||
#include <shlib-compat.h>
|
||||
|
||||
/* Get current value of CLOCK and store it in TP. */
|
||||
int
|
||||
__clock_gettime (clockid_t clock_id, struct timespec *tp)
|
||||
{
|
||||
return INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp);
|
||||
}
|
||||
weak_alias (__clock_gettime, clock_gettime)
|
||||
libc_hidden_def (__clock_gettime)
|
||||
|
||||
versioned_symbol (libc, __clock_gettime, clock_gettime, GLIBC_2_17);
|
||||
/* clock_gettime moved to libc in version 2.17;
|
||||
old binaries may expect the symbol version it had in librt. */
|
||||
#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
|
||||
strong_alias (__clock_gettime, __clock_gettime_2);
|
||||
compat_symbol (libc, __clock_gettime_2, clock_gettime, GLIBC_2_2);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user