]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/unix/clock_gettime.c
Finish move of clock_* functions to libc. [BZ #24959]
[thirdparty/glibc.git] / sysdeps / unix / clock_gettime.c
index 10a6c96d9d62edc3c0ce5f4e797cd5ecf876e49b..2a82fc106663acc742a4868680778562f232b9e3 100644 (file)
    <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