aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/clock_gettime.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/clock_gettime.c')
-rw-r--r--sysdeps/unix/clock_gettime.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/sysdeps/unix/clock_gettime.c b/sysdeps/unix/clock_gettime.c
index 10a6c96..2a82fc1 100644
--- a/sysdeps/unix/clock_gettime.c
+++ b/sysdeps/unix/clock_gettime.c
@@ -17,24 +17,9 @@
<http://www.gnu.org/licenses/>. */
#include <errno.h>
-#include <stdint.h>
#include <time.h>
#include <sys/time.h>
-#include <libc-internal.h>
-#include <ldsodefs.h>
-
-
-static inline int
-realtime_gettime (struct timespec *tp)
-{
- struct timeval tv;
- int retval = __gettimeofday (&tv, NULL);
- if (retval == 0)
- /* Convert into `timespec'. */
- TIMEVAL_TO_TIMESPEC (&tv, tp);
- return retval;
-}
-
+#include <shlib-compat.h>
/* Get current value of CLOCK and store it in TP. */
int
@@ -60,5 +45,12 @@ __clock_gettime (clockid_t clock_id, struct timespec *tp)
return retval;
}
-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