]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - time/clock_gettime.c
Finish move of clock_* functions to libc. [BZ #24959]
[thirdparty/glibc.git] / time / clock_gettime.c
similarity index 74%
rename from rt/clock_gettime.c
rename to time/clock_gettime.c
index 0426dd2c764d315c4a2e37de46b8afe867eca6b5..92c6081dcb29684d4156d851efd4d82106681fe1 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <errno.h>
 #include <time.h>
+#include <shlib-compat.h>
 
 /* Get current value of CLOCK and store it in TP.  */
 int
@@ -26,6 +27,14 @@ __clock_gettime (clockid_t clock_id, struct timespec *tp)
   __set_errno (ENOSYS);
   return -1;
 }
-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
+
 stub_warning (clock_gettime)