]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Finish move of clock_* functions to libc. [BZ #24959]
authorZack Weinberg <zackw@panix.com>
Wed, 4 Sep 2019 06:18:57 +0000 (08:18 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 4 Sep 2019 12:39:38 +0000 (14:39 +0200)
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/.

72 files changed:
ChangeLog
include/time.h
rt/Makefile
rt/Versions
rt/clock-compat.c [deleted file]
sysdeps/mach/hurd/i386/libc.abilist
sysdeps/mach/hurd/i386/librt.abilist
sysdeps/posix/clock_getres.c
sysdeps/unix/clock_gettime.c
sysdeps/unix/clock_nanosleep.c
sysdeps/unix/clock_settime.c
sysdeps/unix/sysv/linux/alpha/libc.abilist
sysdeps/unix/sysv/linux/alpha/librt.abilist
sysdeps/unix/sysv/linux/arm/be/libc.abilist
sysdeps/unix/sysv/linux/arm/be/librt.abilist
sysdeps/unix/sysv/linux/arm/le/libc.abilist
sysdeps/unix/sysv/linux/arm/le/librt.abilist
sysdeps/unix/sysv/linux/clock_getcpuclockid.c
sysdeps/unix/sysv/linux/clock_getres.c
sysdeps/unix/sysv/linux/clock_gettime.c
sysdeps/unix/sysv/linux/clock_nanosleep.c
sysdeps/unix/sysv/linux/clock_settime.c
sysdeps/unix/sysv/linux/hppa/libc.abilist
sysdeps/unix/sysv/linux/hppa/librt.abilist
sysdeps/unix/sysv/linux/i386/libc.abilist
sysdeps/unix/sysv/linux/i386/librt.abilist
sysdeps/unix/sysv/linux/ia64/libc.abilist
sysdeps/unix/sysv/linux/ia64/librt.abilist
sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist
sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist
sysdeps/unix/sysv/linux/microblaze/be/librt.abilist
sysdeps/unix/sysv/linux/microblaze/le/librt.abilist
sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
sysdeps/unix/sysv/linux/mips/mips32/librt.abilist
sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
sysdeps/unix/sysv/linux/mips/mips64/librt.abilist
sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc64/be/librt.abilist
sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist
sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist
sysdeps/unix/sysv/linux/sh/be/libc.abilist
sysdeps/unix/sysv/linux/sh/be/librt.abilist
sysdeps/unix/sysv/linux/sh/le/libc.abilist
sysdeps/unix/sysv/linux/sh/le/librt.abilist
sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist
sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist
sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
sysdeps/unix/sysv/linux/x86_64/64/librt.abilist
sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist
time/Makefile
time/Versions
time/clock_getcpuclockid.c [moved from rt/clock_getcpuclockid.c with 75% similarity]
time/clock_getres.c [moved from rt/clock_getres.c with 73% similarity]
time/clock_gettime.c [moved from rt/clock_gettime.c with 74% similarity]
time/clock_nanosleep.c [moved from rt/clock_nanosleep.c with 76% similarity]
time/clock_settime.c [moved from rt/clock_settime.c with 71% similarity]
time/tst-clock.c [moved from rt/tst-clock.c with 100% similarity]
time/tst-clock2.c [moved from rt/tst-clock2.c with 100% similarity]
time/tst-clock_nanosleep.c [moved from rt/tst-clock_nanosleep.c with 100% similarity]
time/tst-cpuclock1.c [moved from rt/tst-cpuclock1.c with 100% similarity]

index 46fd5f2a24d66b6e110b6142fb25942f2fa9f3cb..7903eb955654ba93c3b898f0885eae794fd858fb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,107 @@
+2019-09-04  Zack Weinberg  <zackw@panix.com>
+
+       [BZ #24959]
+       * rt/clock_getcpuclockid.c: Move to time/clock_getcpuclockid.c.
+       * rt/clock_getres.c: Move to time/clock_getres.c.
+       * rt/clock_gettime.c: Move to time/clock_gettime.c.
+       * rt/clock_nanosleep.c: Move to time/clock_nanosleep.c.
+       * rt/clock_settime.c: Move to time/clock_settime.c.
+       * rt/tst-clock.c: Move to time/tst-clock.c.
+       * rt/tst-clock2.c: Move to time/tst-clock2.c.
+       * rt/tst-clock_nanosleep.c: Move to time/tst-clock_nanosleep.c.
+       * rt/tst-cpuclock1.c: Move to time/tst-cpuclock1.c.
+       * rt/clock-compat.c: Delete file.
+
+       * time/clock_getcpuclockid.c
+       * time/clock_getres.c
+       * time/clock_gettime.c
+       * time/clock_nanosleep.c
+       * time/clock_settime.c
+       * sysdeps/posix/clock_getres.c
+       * sysdeps/unix/clock_gettime.c
+       * sysdeps/unix/clock_nanosleep.c
+       * sysdeps/unix/clock_settime.c
+       * sysdeps/unix/sysv/linux/clock_getcpuclockid.c
+       * sysdeps/unix/sysv/linux/clock_getres.c
+       * sysdeps/unix/sysv/linux/clock_gettime.c
+       * sysdeps/unix/sysv/linux/clock_nanosleep.c
+       * sysdeps/unix/sysv/linux/clock_settime.c: Define the function
+       defined by this file with default symbol version GLIBC_2_17,
+       and optionally a compatibility alias at symbol version GLIBC_2_2.
+       * include/time.h: Remove internal prototypes for clock_getres,
+       clock_nanosleep, and clock_getcpuclockid.
+
+       * sysdeps/unix/sysv/linux/clock_gettime.c: Prune includes.
+       Remove unused function realtime_gettime.
+
+       * rt/Makefile (clock-routines, routines): Remove variable.
+       (librt-routines): Remove clock-compat.
+       (tests): Remove tst-clock, tst-clock2, tst-clock_nanosleep,
+       and tst-cpuclock1.
+       * time/Makefile (routines): Add clock_getres, clock_gettime,
+       clock_settime, clock_getcpuclockid, and clock_nanosleep.
+       (tests): Add tst-clock, tst-clock2, tst-clock_nanosleep,
+       and tst-cpuclock1.
+
+       * rt/Versions (libc): Remove entire stanza.
+       (librt GLIBC_2.2): Remove all clock_* functions.
+       * time/Versions (libc GLIBC_2.2, libc GLIBC_2.17):
+       Add clock_getres, clock_gettime, clock_settime,
+       clock_getcpuclockid, and clock_nanosleep.
+       (libc GLIBC_PRIVATE): Add __clock_gettime.
+
+       * sysdeps/mach/hurd/i386/librt.abilist
+       * sysdeps/unix/sysv/linux/alpha/librt.abilist
+       * sysdeps/unix/sysv/linux/arm/be/librt.abilist
+       * sysdeps/unix/sysv/linux/arm/le/librt.abilist
+       * sysdeps/unix/sysv/linux/hppa/librt.abilist
+       * sysdeps/unix/sysv/linux/i386/librt.abilist
+       * sysdeps/unix/sysv/linux/ia64/librt.abilist
+       * sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist
+       * sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist
+       * sysdeps/unix/sysv/linux/microblaze/be/librt.abilist
+       * sysdeps/unix/sysv/linux/microblaze/le/librt.abilist
+       * sysdeps/unix/sysv/linux/mips/mips32/librt.abilist
+       * sysdeps/unix/sysv/linux/mips/mips64/librt.abilist
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist
+       * sysdeps/unix/sysv/linux/powerpc/powerpc64/be/librt.abilist
+       * sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist
+       * sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist
+       * sysdeps/unix/sysv/linux/sh/librt.abilist
+       * sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist
+       * sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist
+       * sysdeps/unix/sysv/linux/x86_64/64/librt.abilist
+       * sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist:
+       Remove entries for clock_getres, clock_gettime, clock_settime,
+       clock_getcpuclockid, and clock_nanosleep.
+
+       * sysdeps/mach/hurd/i386/libc.abilist
+       * sysdeps/unix/sysv/linux/alpha/libc.abilist
+       * sysdeps/unix/sysv/linux/arm/libc.abilist
+       * sysdeps/unix/sysv/linux/hppa/libc.abilist
+       * sysdeps/unix/sysv/linux/i386/libc.abilist
+       * sysdeps/unix/sysv/linux/ia64/libc.abilist
+       * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+       * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+       * sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+       * sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+       * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+       * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+       * sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+       * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+       * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+       * sysdeps/unix/sysv/linux/sh/be/libc.abilist
+       * sysdeps/unix/sysv/linux/sh/le/libc.abilist
+       * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+       * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+       * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+       * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist:
+       Add another set of entries for clock_getres, clock_gettime,
+       clock_settime, clock_getcpuclockid, and clock_nanosleep at
+       whatever version GLIBC_2.2 maps to.
+
 2019-09-03  Aurelien Jarno  <aurelien@aurel32.net>
 
        * sysdeps/alpha/fpu/libm-test-ulps: Regenerated using GCC 9.2.
index ac3163c2a54d6691f82a1701c7a543e974fd55bf..dcf91855add3829c713e7fca40e562e3801697d9 100644 (file)
@@ -18,12 +18,10 @@ libc_hidden_proto (localtime)
 libc_hidden_proto (strftime)
 libc_hidden_proto (strptime)
 
-extern __typeof (clock_getres) __clock_getres;
 extern __typeof (clock_gettime) __clock_gettime;
 libc_hidden_proto (__clock_gettime)
 extern __typeof (clock_settime) __clock_settime;
-extern __typeof (clock_nanosleep) __clock_nanosleep;
-extern __typeof (clock_getcpuclockid) __clock_getcpuclockid;
+libc_hidden_proto (__clock_settime)
 
 /* Now define the internal interfaces.  */
 struct tm;
index 9ea8394565815bf795f91912f71812a25d0459ff..e6fbc32438c205cf337c2e682cc0741cab5af8ac 100644 (file)
@@ -28,9 +28,6 @@ aio-routines   := aio_cancel aio_error aio_fsync aio_misc aio_read    \
                  aio_read64 aio_return aio_suspend aio_write           \
                  aio_write64 lio_listio lio_listio64 aio_sigqueue      \
                  aio_notify
-clock-routines := clock_getcpuclockid                                  \
-                 clock_getres clock_gettime clock_settime              \
-                 clock_nanosleep
 timer-routines := timer_create timer_delete timer_getoverr             \
                  timer_gettime timer_settime
 shm-routines   := shm_open shm_unlink
@@ -38,22 +35,18 @@ mq-routines    := mq_open mq_close mq_unlink mq_getattr mq_setattr  \
                  mq_notify mq_send mq_receive mq_timedsend             \
                  mq_timedreceive
 
-routines = $(clock-routines)
-
 librt-routines = $(aio-routines) \
                 $(timer-routines) \
-                $(shm-routines) $(mq-routines) \
-                clock-compat
+                $(shm-routines) $(mq-routines)
 
-tests := tst-shm tst-clock tst-clock_nanosleep tst-timer tst-timer2 \
+tests := tst-shm tst-timer tst-timer2 \
         tst-aio tst-aio64 tst-aio2 tst-aio3 tst-aio4 tst-aio5 tst-aio6 \
         tst-aio7 tst-aio8 tst-aio9 tst-aio10 \
         tst-mqueue1 tst-mqueue2 tst-mqueue3 tst-mqueue4 \
         tst-mqueue5 tst-mqueue6 tst-mqueue7 tst-mqueue8 tst-mqueue9 \
         tst-timer3 tst-timer4 tst-timer5 \
-        tst-cpuclock1 tst-cpuclock2 \
-        tst-cputimer1 tst-cputimer2 tst-cputimer3 \
-        tst-clock2 tst-shm-cancel
+        tst-cpuclock2 tst-cputimer1 tst-cputimer2 tst-cputimer3 \
+        tst-shm-cancel
 
 extra-libs := librt
 extra-libs-others := $(extra-libs)
index 91e3fd2a204ded9c1c0ab25e606a02788e5e4458..84d1345420dc4dc486ad41040b23fae2b0274b03 100644 (file)
@@ -1,15 +1,3 @@
-libc {
-  GLIBC_2.17 {
-    # c*
-    clock_getres; clock_gettime; clock_settime; clock_getcpuclockid;
-    clock_nanosleep;
-  }
-  GLIBC_PRIVATE {
-    __clock_getres; __clock_gettime; __clock_settime; __clock_getcpuclockid;
-    __clock_nanosleep;
-  }
-}
-
 librt {
   GLIBC_2.1 {
     # AIO functions.
@@ -18,10 +6,6 @@ librt {
     aio_suspend64; aio_write; aio_write64; lio_listio; lio_listio64;
   }
   GLIBC_2.2 {
-    # These have moved to libc and are still here only for compatibility.
-    clock_getres; clock_gettime; clock_settime; clock_getcpuclockid;
-    clock_nanosleep;
-
     # s*
     shm_open; shm_unlink;
 
diff --git a/rt/clock-compat.c b/rt/clock-compat.c
deleted file mode 100644 (file)
index d8ced3c..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/* ABI compatibility redirects for clock_* symbols in librt.
-   Copyright (C) 2012-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <shlib-compat.h>
-
-/* The clock_* symbols were originally defined in librt and so
-   are part of its ABI.  As of 2.17, they have moved to libc.
-   So we supply definitions for librt that just redirect to
-   their libc counterparts.  */
-
-#if SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_17)
-
-#include <time.h>
-
-#if HAVE_IFUNC
-# undef INIT_ARCH
-# define INIT_ARCH()
-# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name) \
-    compat_symbol (librt, name, name, GLIBC_2_2);
-#else
-# define COMPAT_REDIRECT(name, proto, arglist)                               \
-  int                                                                        \
-  name proto                                                                 \
-  {                                                                          \
-    return __##name arglist;                                                 \
-  }                                                                          \
-  compat_symbol (librt, name, name, GLIBC_2_2);
-#endif
-
-COMPAT_REDIRECT (clock_getres,
-                (clockid_t clock_id, struct timespec *res),
-                (clock_id, res))
-COMPAT_REDIRECT (clock_gettime,
-                (clockid_t clock_id, struct timespec *tp),
-                (clock_id, tp))
-COMPAT_REDIRECT (clock_settime,
-                (clockid_t clock_id, const struct timespec *tp),
-                (clock_id, tp))
-COMPAT_REDIRECT (clock_getcpuclockid,
-                (pid_t pid, clockid_t *clock_id),
-                (pid, clock_id))
-COMPAT_REDIRECT (clock_nanosleep,
-                (clockid_t clock_id, int flags,
-                 const struct timespec *req,
-                 struct timespec *rem),
-                (clock_id, flags, req, rem))
-
-#endif
index 1fc7ab2433fd0bfd1b08ddc1bcd6ef028460e419..7c2cb2b05a788695b12f430b606d9440ed304bbc 100644 (file)
@@ -711,6 +711,11 @@ GLIBC_2.2.6 clntudp_bufcreate F
 GLIBC_2.2.6 clntudp_create F
 GLIBC_2.2.6 clntunix_create F
 GLIBC_2.2.6 clock F
+GLIBC_2.2.6 clock_getcpuclockid F
+GLIBC_2.2.6 clock_getres F
+GLIBC_2.2.6 clock_gettime F
+GLIBC_2.2.6 clock_nanosleep F
+GLIBC_2.2.6 clock_settime F
 GLIBC_2.2.6 close F
 GLIBC_2.2.6 closedir F
 GLIBC_2.2.6 closelog F
index d5fe32b3a99172540d663a72f2f980392d32ec2c..3726e41f06cc500c3b2714e0ea8393f5040d290a 100644 (file)
@@ -13,11 +13,6 @@ GLIBC_2.2.6 aio_suspend F
 GLIBC_2.2.6 aio_suspend64 F
 GLIBC_2.2.6 aio_write F
 GLIBC_2.2.6 aio_write64 F
-GLIBC_2.2.6 clock_getcpuclockid F
-GLIBC_2.2.6 clock_getres F
-GLIBC_2.2.6 clock_gettime F
-GLIBC_2.2.6 clock_nanosleep F
-GLIBC_2.2.6 clock_settime F
 GLIBC_2.2.6 lio_listio F
 GLIBC_2.2.6 lio_listio64 F
 GLIBC_2.2.6 shm_open F
index 01024a3f558832841c1220df81e45f2d52a05ea2..e529cadb1f827946a58a3c3f21104ecfd4a8503e 100644 (file)
@@ -22,7 +22,7 @@
 #include <unistd.h>
 #include <sys/param.h>
 #include <libc-internal.h>
-
+#include <shlib-compat.h>
 
 static inline int
 realtime_getres (struct timespec *res)
@@ -62,4 +62,11 @@ __clock_getres (clockid_t clock_id, struct timespec *res)
 
   return retval;
 }
-weak_alias (__clock_getres, clock_getres)
+
+versioned_symbol (libc, __clock_getres, clock_getres, GLIBC_2_17);
+/* clock_getres 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_getres, __clock_getres_2);
+compat_symbol (libc, __clock_getres_2, clock_getres, GLIBC_2_2);
+#endif
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
index b27608570ca629c8ef50c5f8ab0217159b04b02f..6a477520d11536f24efbf106c20d36d5d7812701 100644 (file)
@@ -20,6 +20,7 @@
 #include <errno.h>
 #include <time.h>
 #include <sysdep-cancel.h>
+#include <shlib-compat.h>
 
 /* This implementation assumes that these is only a `nanosleep' system
    call.  So we have to remap all other activities.  */
@@ -76,4 +77,11 @@ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
 
   return __nanosleep (req, rem), 0 ? errno : 0;
 }
-weak_alias (__clock_nanosleep, clock_nanosleep)
+
+versioned_symbol (libc, __clock_nanosleep, clock_nanosleep, GLIBC_2_17);
+/* clock_nanosleep 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_nanosleep, __clock_nanosleep_2);
+compat_symbol (libc, __clock_nanosleep_2, clock_nanosleep, GLIBC_2_2);
+#endif
index 109a1ad872671b502ba56b296525c92e825c74f7..5b398491abc83512464eb42f7aab3393bba90fde 100644 (file)
@@ -18,8 +18,7 @@
 #include <errno.h>
 #include <time.h>
 #include <sys/time.h>
-#include <ldsodefs.h>
-
+#include <shlib-compat.h>
 
 /* Set CLOCK to value TP.  */
 int
@@ -51,4 +50,12 @@ __clock_settime (clockid_t clock_id, const struct timespec *tp)
 
   return retval;
 }
-weak_alias (__clock_settime, clock_settime)
+libc_hidden_def (__clock_settime)
+
+versioned_symbol (libc, __clock_settime, clock_settime, GLIBC_2_17);
+/* clock_settime 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_settime, __clock_settime_2);
+compat_symbol (libc, __clock_settime_2, clock_settime, GLIBC_2_2);
+#endif
index fe85a356200c5bebcb2895fea65cb64c47f1db57..e7f2174ac217231e4f460fc0c67c74e2418867c1 100644 (file)
@@ -1863,6 +1863,11 @@ GLIBC_2.2 __xpg_sigpause F
 GLIBC_2.2 _flushlbf F
 GLIBC_2.2 _res_hconf D 0x48
 GLIBC_2.2 bind_textdomain_codeset F
+GLIBC_2.2 clock_getcpuclockid F
+GLIBC_2.2 clock_getres F
+GLIBC_2.2 clock_gettime F
+GLIBC_2.2 clock_nanosleep F
+GLIBC_2.2 clock_settime F
 GLIBC_2.2 dcngettext F
 GLIBC_2.2 dngettext F
 GLIBC_2.2 fgetpos F
index d7a049cf600e296645ae60d016ff8086cb45b1d7..71f86e03ce67fd1900e45f8b233b2ae19541b09b 100644 (file)
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
 GLIBC_2.1 aio_write64 F
 GLIBC_2.1 lio_listio F
 GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 clock_getcpuclockid F
-GLIBC_2.2 clock_getres F
-GLIBC_2.2 clock_gettime F
-GLIBC_2.2 clock_nanosleep F
-GLIBC_2.2 clock_settime F
 GLIBC_2.2 shm_open F
 GLIBC_2.2 shm_unlink F
 GLIBC_2.2 timer_create F
index bc3df8dcea36d657f49969df409e41d1fdde95e0..9371927927093d6f2e6a21ae558d32ab04cf484c 100644 (file)
@@ -766,6 +766,11 @@ GLIBC_2.4 clntudp_bufcreate F
 GLIBC_2.4 clntudp_create F
 GLIBC_2.4 clntunix_create F
 GLIBC_2.4 clock F
+GLIBC_2.4 clock_getcpuclockid F
+GLIBC_2.4 clock_getres F
+GLIBC_2.4 clock_gettime F
+GLIBC_2.4 clock_nanosleep F
+GLIBC_2.4 clock_settime F
 GLIBC_2.4 clone F
 GLIBC_2.4 close F
 GLIBC_2.4 closedir F
index cfbbd2755765e720d9424060856bbf177b0cb36f..3c0647b2516bb51dcae71481de6b3d123e4b5183 100644 (file)
@@ -13,11 +13,6 @@ GLIBC_2.4 aio_suspend F
 GLIBC_2.4 aio_suspend64 F
 GLIBC_2.4 aio_write F
 GLIBC_2.4 aio_write64 F
-GLIBC_2.4 clock_getcpuclockid F
-GLIBC_2.4 clock_getres F
-GLIBC_2.4 clock_gettime F
-GLIBC_2.4 clock_nanosleep F
-GLIBC_2.4 clock_settime F
 GLIBC_2.4 lio_listio F
 GLIBC_2.4 lio_listio64 F
 GLIBC_2.4 mq_close F
index bc3df8dcea36d657f49969df409e41d1fdde95e0..9371927927093d6f2e6a21ae558d32ab04cf484c 100644 (file)
@@ -766,6 +766,11 @@ GLIBC_2.4 clntudp_bufcreate F
 GLIBC_2.4 clntudp_create F
 GLIBC_2.4 clntunix_create F
 GLIBC_2.4 clock F
+GLIBC_2.4 clock_getcpuclockid F
+GLIBC_2.4 clock_getres F
+GLIBC_2.4 clock_gettime F
+GLIBC_2.4 clock_nanosleep F
+GLIBC_2.4 clock_settime F
 GLIBC_2.4 clone F
 GLIBC_2.4 close F
 GLIBC_2.4 closedir F
index cfbbd2755765e720d9424060856bbf177b0cb36f..3c0647b2516bb51dcae71481de6b3d123e4b5183 100644 (file)
@@ -13,11 +13,6 @@ GLIBC_2.4 aio_suspend F
 GLIBC_2.4 aio_suspend64 F
 GLIBC_2.4 aio_write F
 GLIBC_2.4 aio_write64 F
-GLIBC_2.4 clock_getcpuclockid F
-GLIBC_2.4 clock_getres F
-GLIBC_2.4 clock_gettime F
-GLIBC_2.4 clock_nanosleep F
-GLIBC_2.4 clock_settime F
 GLIBC_2.4 lio_listio F
 GLIBC_2.4 lio_listio64 F
 GLIBC_2.4 mq_close F
index f4a652966fe7bd6ce874903a0e8a77389cdc8723..f2d8b916cb24010fcdafc219a2804f17841d14bc 100644 (file)
@@ -20,6 +20,7 @@
 #include <time.h>
 #include <unistd.h>
 #include "kernel-posix-cpu-timers.h"
+#include <shlib-compat.h>
 
 int
 __clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
@@ -45,4 +46,11 @@ __clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
   else
     return INTERNAL_SYSCALL_ERRNO (r, err);
 }
-weak_alias (__clock_getcpuclockid, clock_getcpuclockid)
+
+versioned_symbol (libc, __clock_getcpuclockid, clock_getcpuclockid, GLIBC_2_17);
+/* clock_getcpuclockid 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_getcpuclockid, __clock_getcpuclockid_2);
+compat_symbol (libc, __clock_getcpuclockid_2, clock_getcpuclockid, GLIBC_2_2);
+#endif
index 24b2299938c10b2b2eae75518c94357817017bc1..18a7ce53c0a4e3c3e495fff9159cdae9b64edad9 100644 (file)
 #endif
 #include <sysdep-vdso.h>
 
+#include <shlib-compat.h>
+
 /* Get resolution of clock.  */
 int
 __clock_getres (clockid_t clock_id, struct timespec *res)
 {
   return INLINE_VSYSCALL (clock_getres, 2, clock_id, res);
 }
-weak_alias (__clock_getres, clock_getres)
+
+versioned_symbol (libc, __clock_getres, clock_getres, GLIBC_2_17);
+/* clock_getres 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_getres, __clock_getres_2);
+compat_symbol (libc, __clock_getres_2, clock_getres, GLIBC_2_2);
+#endif
index 5fc47fb7dc7c8fabe46b060bdc46ecee2d5aa053..7ad1c91be68a10cf010c220b08c6f665b2e15b34 100644 (file)
 #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
index 0cb6614dc9224097ecbf2b0323510f5ed4eef2f1..e19e09d197d6f0156139bde23945c444cf627b7a 100644 (file)
@@ -21,6 +21,7 @@
 #include <sysdep-cancel.h>
 #include "kernel-posix-cpu-timers.h"
 
+#include <shlib-compat.h>
 
 /* We can simply use the syscall.  The CPU clocks are not supported
    with this function.  */
@@ -41,4 +42,11 @@ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
   return (INTERNAL_SYSCALL_ERROR_P (r, err)
          ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
 }
-weak_alias (__clock_nanosleep, clock_nanosleep)
+
+versioned_symbol (libc, __clock_nanosleep, clock_nanosleep, GLIBC_2_17);
+/* clock_nanosleep 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_nanosleep, __clock_nanosleep_2);
+compat_symbol (libc, __clock_nanosleep_2, clock_nanosleep, GLIBC_2_2);
+#endif
index d837e3019c6aca93fe4a26f234888076bd18e8e3..0586d1572221f563f37ebbb0fb240ca4ac34d32a 100644 (file)
@@ -18,6 +18,7 @@
 #include <errno.h>
 #include <sysdep.h>
 #include <time.h>
+#include <shlib-compat.h>
 
 #include "kernel-posix-cpu-timers.h"
 
@@ -34,4 +35,12 @@ __clock_settime (clockid_t clock_id, const struct timespec *tp)
 
   return INLINE_SYSCALL_CALL (clock_settime, clock_id, tp);
 }
-weak_alias (__clock_settime, clock_settime)
+libc_hidden_def (__clock_settime)
+
+versioned_symbol (libc, __clock_settime, clock_settime, GLIBC_2_17);
+/* clock_settime 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_settime, __clock_settime_2);
+compat_symbol (libc, __clock_settime_2, clock_settime, GLIBC_2_2);
+#endif
index 75edece94a17129e10e2c3e89ed0c345894675ea..df6d96fbae04ecef8b978152c90372e7722c9dee 100644 (file)
@@ -615,6 +615,11 @@ GLIBC_2.2 clntudp_bufcreate F
 GLIBC_2.2 clntudp_create F
 GLIBC_2.2 clntunix_create F
 GLIBC_2.2 clock F
+GLIBC_2.2 clock_getcpuclockid F
+GLIBC_2.2 clock_getres F
+GLIBC_2.2 clock_gettime F
+GLIBC_2.2 clock_nanosleep F
+GLIBC_2.2 clock_settime F
 GLIBC_2.2 clone F
 GLIBC_2.2 close F
 GLIBC_2.2 closedir F
index 595f1b712a4e8d70c00ff0a29ed83e0f88fddf34..bb03781dcc04d219b93f3ce4837967762b2049b7 100644 (file)
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
 GLIBC_2.1 aio_write64 F
 GLIBC_2.1 lio_listio F
 GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 clock_getcpuclockid F
-GLIBC_2.2 clock_getres F
-GLIBC_2.2 clock_gettime F
-GLIBC_2.2 clock_nanosleep F
-GLIBC_2.2 clock_settime F
 GLIBC_2.2 shm_open F
 GLIBC_2.2 shm_unlink F
 GLIBC_2.2 timer_create F
index edeaf8e72208a820b87e49f9ab35caddafa12e87..fcb625b6bf2414381e04d7462bcf1d83299a142f 100644 (file)
@@ -1869,6 +1869,11 @@ GLIBC_2.2 _flushlbf F
 GLIBC_2.2 _res_hconf D 0x30
 GLIBC_2.2 alphasort64 F
 GLIBC_2.2 bind_textdomain_codeset F
+GLIBC_2.2 clock_getcpuclockid F
+GLIBC_2.2 clock_getres F
+GLIBC_2.2 clock_gettime F
+GLIBC_2.2 clock_nanosleep F
+GLIBC_2.2 clock_settime F
 GLIBC_2.2 dcngettext F
 GLIBC_2.2 dngettext F
 GLIBC_2.2 fgetpos F
index 595f1b712a4e8d70c00ff0a29ed83e0f88fddf34..bb03781dcc04d219b93f3ce4837967762b2049b7 100644 (file)
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
 GLIBC_2.1 aio_write64 F
 GLIBC_2.1 lio_listio F
 GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 clock_getcpuclockid F
-GLIBC_2.2 clock_getres F
-GLIBC_2.2 clock_gettime F
-GLIBC_2.2 clock_nanosleep F
-GLIBC_2.2 clock_settime F
 GLIBC_2.2 shm_open F
 GLIBC_2.2 shm_unlink F
 GLIBC_2.2 timer_create F
index b5d460eeb21bb85073bc0135bf6e61c17e27d0f2..cb556c59987c9f0c9c6455abf80447feb4e50a83 100644 (file)
@@ -627,6 +627,11 @@ GLIBC_2.2 clntudp_bufcreate F
 GLIBC_2.2 clntudp_create F
 GLIBC_2.2 clntunix_create F
 GLIBC_2.2 clock F
+GLIBC_2.2 clock_getcpuclockid F
+GLIBC_2.2 clock_getres F
+GLIBC_2.2 clock_gettime F
+GLIBC_2.2 clock_nanosleep F
+GLIBC_2.2 clock_settime F
 GLIBC_2.2 close F
 GLIBC_2.2 closedir F
 GLIBC_2.2 closelog F
index 804622a14abd8ea92b332e4bff0fdb9a292ec8b1..08384c906518837d04e56847c812fcd21bf57e82 100644 (file)
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
 GLIBC_2.1 aio_write64 F
 GLIBC_2.1 lio_listio F
 GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 clock_getcpuclockid F
-GLIBC_2.2 clock_getres F
-GLIBC_2.2 clock_gettime F
-GLIBC_2.2 clock_nanosleep F
-GLIBC_2.2 clock_settime F
 GLIBC_2.2 shm_open F
 GLIBC_2.2 shm_unlink F
 GLIBC_2.2 timer_create F
index 05633b3cb82098b90704cd3247c4e7766eb5828a..f3aa47d09022e1a45ae2ee7703d7fcb3565cd966 100644 (file)
@@ -755,6 +755,11 @@ GLIBC_2.4 clntudp_bufcreate F
 GLIBC_2.4 clntudp_create F
 GLIBC_2.4 clntunix_create F
 GLIBC_2.4 clock F
+GLIBC_2.4 clock_getcpuclockid F
+GLIBC_2.4 clock_getres F
+GLIBC_2.4 clock_gettime F
+GLIBC_2.4 clock_nanosleep F
+GLIBC_2.4 clock_settime F
 GLIBC_2.4 clone F
 GLIBC_2.4 close F
 GLIBC_2.4 closedir F
index cfbbd2755765e720d9424060856bbf177b0cb36f..3c0647b2516bb51dcae71481de6b3d123e4b5183 100644 (file)
@@ -13,11 +13,6 @@ GLIBC_2.4 aio_suspend F
 GLIBC_2.4 aio_suspend64 F
 GLIBC_2.4 aio_write F
 GLIBC_2.4 aio_write64 F
-GLIBC_2.4 clock_getcpuclockid F
-GLIBC_2.4 clock_getres F
-GLIBC_2.4 clock_gettime F
-GLIBC_2.4 clock_nanosleep F
-GLIBC_2.4 clock_settime F
 GLIBC_2.4 lio_listio F
 GLIBC_2.4 lio_listio64 F
 GLIBC_2.4 mq_close F
index 47eb7b46082848a4711d371955712b588a181816..64d4623b6b14bd1a2d8e921f9fe2ffae4e9e4532 100644 (file)
@@ -1825,6 +1825,11 @@ GLIBC_2.2 _flushlbf F
 GLIBC_2.2 _res_hconf D 0x30
 GLIBC_2.2 alphasort64 F
 GLIBC_2.2 bind_textdomain_codeset F
+GLIBC_2.2 clock_getcpuclockid F
+GLIBC_2.2 clock_getres F
+GLIBC_2.2 clock_gettime F
+GLIBC_2.2 clock_nanosleep F
+GLIBC_2.2 clock_settime F
 GLIBC_2.2 dcngettext F
 GLIBC_2.2 dngettext F
 GLIBC_2.2 fgetpos F
index 595f1b712a4e8d70c00ff0a29ed83e0f88fddf34..bb03781dcc04d219b93f3ce4837967762b2049b7 100644 (file)
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
 GLIBC_2.1 aio_write64 F
 GLIBC_2.1 lio_listio F
 GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 clock_getcpuclockid F
-GLIBC_2.2 clock_getres F
-GLIBC_2.2 clock_gettime F
-GLIBC_2.2 clock_nanosleep F
-GLIBC_2.2 clock_settime F
 GLIBC_2.2 shm_open F
 GLIBC_2.2 shm_unlink F
 GLIBC_2.2 timer_create F
index fb85d8729e1bc69d3c3e0de48c830c730745781b..889dfbc0eef5e75a8d557e0e7a2df8a6b5f7c3cc 100644 (file)
@@ -14,11 +14,6 @@ GLIBC_2.18 aio_suspend F
 GLIBC_2.18 aio_suspend64 F
 GLIBC_2.18 aio_write F
 GLIBC_2.18 aio_write64 F
-GLIBC_2.18 clock_getcpuclockid F
-GLIBC_2.18 clock_getres F
-GLIBC_2.18 clock_gettime F
-GLIBC_2.18 clock_nanosleep F
-GLIBC_2.18 clock_settime F
 GLIBC_2.18 lio_listio F
 GLIBC_2.18 lio_listio64 F
 GLIBC_2.18 mq_close F
index fb85d8729e1bc69d3c3e0de48c830c730745781b..889dfbc0eef5e75a8d557e0e7a2df8a6b5f7c3cc 100644 (file)
@@ -14,11 +14,6 @@ GLIBC_2.18 aio_suspend F
 GLIBC_2.18 aio_suspend64 F
 GLIBC_2.18 aio_write F
 GLIBC_2.18 aio_write64 F
-GLIBC_2.18 clock_getcpuclockid F
-GLIBC_2.18 clock_getres F
-GLIBC_2.18 clock_gettime F
-GLIBC_2.18 clock_nanosleep F
-GLIBC_2.18 clock_settime F
 GLIBC_2.18 lio_listio F
 GLIBC_2.18 lio_listio64 F
 GLIBC_2.18 mq_close F
index e49dc4272eb8362ef256cdf5cd23bf25c1b21025..06c2e64eddeceaa22f208de4e6c79ec00b30931c 100644 (file)
@@ -1612,6 +1612,11 @@ GLIBC_2.2 capget F
 GLIBC_2.2 capset F
 GLIBC_2.2 cbc_crypt F
 GLIBC_2.2 clntunix_create F
+GLIBC_2.2 clock_getcpuclockid F
+GLIBC_2.2 clock_getres F
+GLIBC_2.2 clock_gettime F
+GLIBC_2.2 clock_nanosleep F
+GLIBC_2.2 clock_settime F
 GLIBC_2.2 creat64 F
 GLIBC_2.2 dcngettext F
 GLIBC_2.2 des_setparity F
index 84837c8a2ef02e1b2509c5919e6ae7aea1087286..1539c1cef92bccfd8a7ccd72aa37ac1e83fa694b 100644 (file)
@@ -13,11 +13,6 @@ GLIBC_2.2 aio_suspend F
 GLIBC_2.2 aio_suspend64 F
 GLIBC_2.2 aio_write F
 GLIBC_2.2 aio_write64 F
-GLIBC_2.2 clock_getcpuclockid F
-GLIBC_2.2 clock_getres F
-GLIBC_2.2 clock_gettime F
-GLIBC_2.2 clock_nanosleep F
-GLIBC_2.2 clock_settime F
 GLIBC_2.2 lio_listio F
 GLIBC_2.2 lio_listio64 F
 GLIBC_2.2 shm_open F
index daa3b60c5b010bc36d248da598692ac07b6dabcb..bdfd073b86061382e8ec982e8a52374d20199e88 100644 (file)
@@ -1610,6 +1610,11 @@ GLIBC_2.2 capget F
 GLIBC_2.2 capset F
 GLIBC_2.2 cbc_crypt F
 GLIBC_2.2 clntunix_create F
+GLIBC_2.2 clock_getcpuclockid F
+GLIBC_2.2 clock_getres F
+GLIBC_2.2 clock_gettime F
+GLIBC_2.2 clock_nanosleep F
+GLIBC_2.2 clock_settime F
 GLIBC_2.2 creat64 F
 GLIBC_2.2 dcngettext F
 GLIBC_2.2 des_setparity F
index 84837c8a2ef02e1b2509c5919e6ae7aea1087286..1539c1cef92bccfd8a7ccd72aa37ac1e83fa694b 100644 (file)
@@ -13,11 +13,6 @@ GLIBC_2.2 aio_suspend F
 GLIBC_2.2 aio_suspend64 F
 GLIBC_2.2 aio_write F
 GLIBC_2.2 aio_write64 F
-GLIBC_2.2 clock_getcpuclockid F
-GLIBC_2.2 clock_getres F
-GLIBC_2.2 clock_gettime F
-GLIBC_2.2 clock_nanosleep F
-GLIBC_2.2 clock_settime F
 GLIBC_2.2 lio_listio F
 GLIBC_2.2 lio_listio64 F
 GLIBC_2.2 shm_open F
index 457ce0b6f2a8f844a8418b26a9641fbafd070792..3d61d4974a2e704f65c579a0263227ae388021ce 100644 (file)
@@ -1611,6 +1611,11 @@ GLIBC_2.2 capget F
 GLIBC_2.2 capset F
 GLIBC_2.2 cbc_crypt F
 GLIBC_2.2 clntunix_create F
+GLIBC_2.2 clock_getcpuclockid F
+GLIBC_2.2 clock_getres F
+GLIBC_2.2 clock_gettime F
+GLIBC_2.2 clock_nanosleep F
+GLIBC_2.2 clock_settime F
 GLIBC_2.2 creat64 F
 GLIBC_2.2 dcngettext F
 GLIBC_2.2 des_setparity F
index 63d5c03bfb129ff7fecb7e08c060e61250775a8e..675acca5db24c883b42d7560ffcaf8f7917df8c6 100644 (file)
@@ -1607,6 +1607,11 @@ GLIBC_2.2 capget F
 GLIBC_2.2 capset F
 GLIBC_2.2 cbc_crypt F
 GLIBC_2.2 clntunix_create F
+GLIBC_2.2 clock_getcpuclockid F
+GLIBC_2.2 clock_getres F
+GLIBC_2.2 clock_gettime F
+GLIBC_2.2 clock_nanosleep F
+GLIBC_2.2 clock_settime F
 GLIBC_2.2 creat64 F
 GLIBC_2.2 dcngettext F
 GLIBC_2.2 des_setparity F
index 9200a543098a48291a5be3a70a939c95bc488f20..1e8ff6f83e4661bf3da026d50201d0b855449574 100644 (file)
@@ -1830,6 +1830,11 @@ GLIBC_2.2 __xstat64 F
 GLIBC_2.2 _flushlbf F
 GLIBC_2.2 _res_hconf D 0x30
 GLIBC_2.2 bind_textdomain_codeset F
+GLIBC_2.2 clock_getcpuclockid F
+GLIBC_2.2 clock_getres F
+GLIBC_2.2 clock_gettime F
+GLIBC_2.2 clock_nanosleep F
+GLIBC_2.2 clock_settime F
 GLIBC_2.2 dcngettext F
 GLIBC_2.2 dngettext F
 GLIBC_2.2 fgetpos F
index 595f1b712a4e8d70c00ff0a29ed83e0f88fddf34..bb03781dcc04d219b93f3ce4837967762b2049b7 100644 (file)
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
 GLIBC_2.1 aio_write64 F
 GLIBC_2.1 lio_listio F
 GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 clock_getcpuclockid F
-GLIBC_2.2 clock_getres F
-GLIBC_2.2 clock_gettime F
-GLIBC_2.2 clock_nanosleep F
-GLIBC_2.2 clock_settime F
 GLIBC_2.2 shm_open F
 GLIBC_2.2 shm_unlink F
 GLIBC_2.2 timer_create F
index ef7779905f6a6eabde793c5c256561fc4a03ed58..b5a0751d90b2c99914a8eaac1598b6f8c71b95d3 100644 (file)
@@ -1834,6 +1834,11 @@ GLIBC_2.2 __xstat64 F
 GLIBC_2.2 _flushlbf F
 GLIBC_2.2 _res_hconf D 0x30
 GLIBC_2.2 bind_textdomain_codeset F
+GLIBC_2.2 clock_getcpuclockid F
+GLIBC_2.2 clock_getres F
+GLIBC_2.2 clock_gettime F
+GLIBC_2.2 clock_nanosleep F
+GLIBC_2.2 clock_settime F
 GLIBC_2.2 dcngettext F
 GLIBC_2.2 dngettext F
 GLIBC_2.2 fgetpos F
index 2860df8ebca8c63c74adb91f725aa5465cf50510..0c86217fc6c8db2e969159c0490a0357ac4bbc52 100644 (file)
@@ -673,6 +673,11 @@ GLIBC_2.3 clntudp_bufcreate F
 GLIBC_2.3 clntudp_create F
 GLIBC_2.3 clntunix_create F
 GLIBC_2.3 clock F
+GLIBC_2.3 clock_getcpuclockid F
+GLIBC_2.3 clock_getres F
+GLIBC_2.3 clock_gettime F
+GLIBC_2.3 clock_nanosleep F
+GLIBC_2.3 clock_settime F
 GLIBC_2.3 clone F
 GLIBC_2.3 close F
 GLIBC_2.3 closedir F
index e76b7eb49566718bfd22e72210dc948726121b7d..6a5bd96963e67109324ad51024475c2e2fdbb265 100644 (file)
@@ -13,11 +13,6 @@ GLIBC_2.3 aio_suspend F
 GLIBC_2.3 aio_suspend64 F
 GLIBC_2.3 aio_write F
 GLIBC_2.3 aio_write64 F
-GLIBC_2.3 clock_getcpuclockid F
-GLIBC_2.3 clock_getres F
-GLIBC_2.3 clock_gettime F
-GLIBC_2.3 clock_nanosleep F
-GLIBC_2.3 clock_settime F
 GLIBC_2.3 lio_listio F
 GLIBC_2.3 lio_listio64 F
 GLIBC_2.3 shm_open F
index 576295deff372ec6d88138717f2a070f7199cd34..122d0fb65a53ff227fd3eaccf134753cf1ad444f 100644 (file)
@@ -1829,6 +1829,11 @@ GLIBC_2.2 _flushlbf F
 GLIBC_2.2 _res_hconf D 0x30
 GLIBC_2.2 alphasort64 F
 GLIBC_2.2 bind_textdomain_codeset F
+GLIBC_2.2 clock_getcpuclockid F
+GLIBC_2.2 clock_getres F
+GLIBC_2.2 clock_gettime F
+GLIBC_2.2 clock_nanosleep F
+GLIBC_2.2 clock_settime F
 GLIBC_2.2 dcngettext F
 GLIBC_2.2 dngettext F
 GLIBC_2.2 fgetpos F
index 595f1b712a4e8d70c00ff0a29ed83e0f88fddf34..bb03781dcc04d219b93f3ce4837967762b2049b7 100644 (file)
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
 GLIBC_2.1 aio_write64 F
 GLIBC_2.1 lio_listio F
 GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 clock_getcpuclockid F
-GLIBC_2.2 clock_getres F
-GLIBC_2.2 clock_gettime F
-GLIBC_2.2 clock_nanosleep F
-GLIBC_2.2 clock_settime F
 GLIBC_2.2 shm_open F
 GLIBC_2.2 shm_unlink F
 GLIBC_2.2 timer_create F
index abf04736831aec4bbede6f2303812cbb023110c0..efe588a0728cfd6b19c58101db903ae71581bbc0 100644 (file)
@@ -632,6 +632,11 @@ GLIBC_2.2 clntudp_bufcreate F
 GLIBC_2.2 clntudp_create F
 GLIBC_2.2 clntunix_create F
 GLIBC_2.2 clock F
+GLIBC_2.2 clock_getcpuclockid F
+GLIBC_2.2 clock_getres F
+GLIBC_2.2 clock_gettime F
+GLIBC_2.2 clock_nanosleep F
+GLIBC_2.2 clock_settime F
 GLIBC_2.2 clone F
 GLIBC_2.2 close F
 GLIBC_2.2 closedir F
index 41be3bb84b6e4df053057f241103483701ada2bc..5905498a488359d704935ad23992f325b2dae422 100644 (file)
@@ -13,11 +13,6 @@ GLIBC_2.2 aio_suspend F
 GLIBC_2.2 aio_suspend64 F
 GLIBC_2.2 aio_write F
 GLIBC_2.2 aio_write64 F
-GLIBC_2.2 clock_getcpuclockid F
-GLIBC_2.2 clock_getres F
-GLIBC_2.2 clock_gettime F
-GLIBC_2.2 clock_nanosleep F
-GLIBC_2.2 clock_settime F
 GLIBC_2.2 lio_listio F
 GLIBC_2.2 lio_listio64 F
 GLIBC_2.2 shm_open F
index 41977f6e9c735ed1f81b9d84517526515b5e1c45..4b057bf4a2d2dce34a85614b06121d7ce7d9a349 100644 (file)
@@ -618,6 +618,11 @@ GLIBC_2.2 clntudp_bufcreate F
 GLIBC_2.2 clntudp_create F
 GLIBC_2.2 clntunix_create F
 GLIBC_2.2 clock F
+GLIBC_2.2 clock_getcpuclockid F
+GLIBC_2.2 clock_getres F
+GLIBC_2.2 clock_gettime F
+GLIBC_2.2 clock_nanosleep F
+GLIBC_2.2 clock_settime F
 GLIBC_2.2 clone F
 GLIBC_2.2 close F
 GLIBC_2.2 closedir F
index 595f1b712a4e8d70c00ff0a29ed83e0f88fddf34..bb03781dcc04d219b93f3ce4837967762b2049b7 100644 (file)
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
 GLIBC_2.1 aio_write64 F
 GLIBC_2.1 lio_listio F
 GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 clock_getcpuclockid F
-GLIBC_2.2 clock_getres F
-GLIBC_2.2 clock_gettime F
-GLIBC_2.2 clock_nanosleep F
-GLIBC_2.2 clock_settime F
 GLIBC_2.2 shm_open F
 GLIBC_2.2 shm_unlink F
 GLIBC_2.2 timer_create F
index 41977f6e9c735ed1f81b9d84517526515b5e1c45..4b057bf4a2d2dce34a85614b06121d7ce7d9a349 100644 (file)
@@ -618,6 +618,11 @@ GLIBC_2.2 clntudp_bufcreate F
 GLIBC_2.2 clntudp_create F
 GLIBC_2.2 clntunix_create F
 GLIBC_2.2 clock F
+GLIBC_2.2 clock_getcpuclockid F
+GLIBC_2.2 clock_getres F
+GLIBC_2.2 clock_gettime F
+GLIBC_2.2 clock_nanosleep F
+GLIBC_2.2 clock_settime F
 GLIBC_2.2 clone F
 GLIBC_2.2 close F
 GLIBC_2.2 closedir F
index 595f1b712a4e8d70c00ff0a29ed83e0f88fddf34..bb03781dcc04d219b93f3ce4837967762b2049b7 100644 (file)
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
 GLIBC_2.1 aio_write64 F
 GLIBC_2.1 lio_listio F
 GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 clock_getcpuclockid F
-GLIBC_2.2 clock_getres F
-GLIBC_2.2 clock_gettime F
-GLIBC_2.2 clock_nanosleep F
-GLIBC_2.2 clock_settime F
 GLIBC_2.2 shm_open F
 GLIBC_2.2 shm_unlink F
 GLIBC_2.2 timer_create F
index 3d2f00ca527bb4194008214ebe8ec4d5c1fea3b9..49cd597fd65af94f01990de54c19892e1a190d55 100644 (file)
@@ -1826,6 +1826,11 @@ GLIBC_2.2 __xstat64 F
 GLIBC_2.2 _flushlbf F
 GLIBC_2.2 _res_hconf D 0x30
 GLIBC_2.2 bind_textdomain_codeset F
+GLIBC_2.2 clock_getcpuclockid F
+GLIBC_2.2 clock_getres F
+GLIBC_2.2 clock_gettime F
+GLIBC_2.2 clock_nanosleep F
+GLIBC_2.2 clock_settime F
 GLIBC_2.2 dcngettext F
 GLIBC_2.2 dngettext F
 GLIBC_2.2 fgetpos F
index cb874f41477109c30f8671a3f971f03d5b7ec857..38f0aad79179301062672f321481e5315c643607 100644 (file)
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
 GLIBC_2.1 aio_write64 F
 GLIBC_2.1 lio_listio F
 GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 clock_getcpuclockid F
-GLIBC_2.2 clock_getres F
-GLIBC_2.2 clock_gettime F
-GLIBC_2.2 clock_nanosleep F
-GLIBC_2.2 clock_settime F
 GLIBC_2.2 shm_open F
 GLIBC_2.2 shm_unlink F
 GLIBC_2.2 timer_create F
index 2f20643e8eca73ed419d74b14c3b37f3a0840387..95e68e0ba16adeecd1a98f3edace078311a3bff6 100644 (file)
@@ -660,6 +660,11 @@ GLIBC_2.2 clntudp_bufcreate F
 GLIBC_2.2 clntudp_create F
 GLIBC_2.2 clntunix_create F
 GLIBC_2.2 clock F
+GLIBC_2.2 clock_getcpuclockid F
+GLIBC_2.2 clock_getres F
+GLIBC_2.2 clock_gettime F
+GLIBC_2.2 clock_nanosleep F
+GLIBC_2.2 clock_settime F
 GLIBC_2.2 clone F
 GLIBC_2.2 close F
 GLIBC_2.2 closedir F
index d7a049cf600e296645ae60d016ff8086cb45b1d7..71f86e03ce67fd1900e45f8b233b2ae19541b09b 100644 (file)
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
 GLIBC_2.1 aio_write64 F
 GLIBC_2.1 lio_listio F
 GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 clock_getcpuclockid F
-GLIBC_2.2 clock_getres F
-GLIBC_2.2 clock_gettime F
-GLIBC_2.2 clock_nanosleep F
-GLIBC_2.2 clock_settime F
 GLIBC_2.2 shm_open F
 GLIBC_2.2 shm_unlink F
 GLIBC_2.2 timer_create F
index 59f85d937367db0d24d6c05def9484c97a9bff2f..1f2dbd1451f930b52409fa708dd9fba7a918d0b2 100644 (file)
@@ -621,6 +621,11 @@ GLIBC_2.2.5 clntudp_bufcreate F
 GLIBC_2.2.5 clntudp_create F
 GLIBC_2.2.5 clntunix_create F
 GLIBC_2.2.5 clock F
+GLIBC_2.2.5 clock_getcpuclockid F
+GLIBC_2.2.5 clock_getres F
+GLIBC_2.2.5 clock_gettime F
+GLIBC_2.2.5 clock_nanosleep F
+GLIBC_2.2.5 clock_settime F
 GLIBC_2.2.5 clone F
 GLIBC_2.2.5 close F
 GLIBC_2.2.5 closedir F
index e2e8b60bf8e29f5534c25da027e1d27e3bc712c2..95e3f22daa06b237001c0867ae66a1bb9af2620a 100644 (file)
@@ -13,11 +13,6 @@ GLIBC_2.2.5 aio_suspend F
 GLIBC_2.2.5 aio_suspend64 F
 GLIBC_2.2.5 aio_write F
 GLIBC_2.2.5 aio_write64 F
-GLIBC_2.2.5 clock_getcpuclockid F
-GLIBC_2.2.5 clock_getres F
-GLIBC_2.2.5 clock_gettime F
-GLIBC_2.2.5 clock_nanosleep F
-GLIBC_2.2.5 clock_settime F
 GLIBC_2.2.5 lio_listio F
 GLIBC_2.2.5 lio_listio64 F
 GLIBC_2.2.5 shm_open F
index 67a4e238d63c585d5274eb555bcaacd82e4ec180..59da85a5d8d381923524f2e9ff82b0d0ad33e4d5 100644 (file)
@@ -660,6 +660,11 @@ GLIBC_2.16 clntudp_create F
 GLIBC_2.16 clntunix_create F
 GLIBC_2.16 clock F
 GLIBC_2.16 clock_adjtime F
+GLIBC_2.16 clock_getcpuclockid F
+GLIBC_2.16 clock_getres F
+GLIBC_2.16 clock_gettime F
+GLIBC_2.16 clock_nanosleep F
+GLIBC_2.16 clock_settime F
 GLIBC_2.16 clone F
 GLIBC_2.16 close F
 GLIBC_2.16 closedir F
index 94e84e4dcfaa85dceb7d565f18d2b5588073a382..66969fb9ab8877560f243432dafa393c83ea7188 100644 (file)
@@ -14,11 +14,6 @@ GLIBC_2.16 aio_suspend F
 GLIBC_2.16 aio_suspend64 F
 GLIBC_2.16 aio_write F
 GLIBC_2.16 aio_write64 F
-GLIBC_2.16 clock_getcpuclockid F
-GLIBC_2.16 clock_getres F
-GLIBC_2.16 clock_gettime F
-GLIBC_2.16 clock_nanosleep F
-GLIBC_2.16 clock_settime F
 GLIBC_2.16 lio_listio F
 GLIBC_2.16 lio_listio64 F
 GLIBC_2.16 mq_close F
index a428f5524573260161f7791855c73da4badccdda..85a62c0376bfff77dc78cd0495541f223fc7f485 100644 (file)
@@ -36,14 +36,18 @@ routines := offtime asctime clock ctime ctime_r difftime \
            stime dysize timegm ftime                    \
            getdate strptime strptime_l                  \
            strftime wcsftime strftime_l wcsftime_l      \
-           timespec_get
+           timespec_get                                 \
+           clock_getcpuclockid clock_getres             \
+           clock_gettime clock_settime clock_nanosleep
+
 aux :=     era alt_digit lc-time-cleanup
 
 tests  := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
           tst-getdate tst-mktime tst-mktime2 tst-ftime_l tst-strftime \
           tst-mktime3 tst-strptime2 bug-asctime bug-asctime_r bug-mktime1 \
           tst-strptime3 bug-getdate1 tst-strptime-whitespace tst-ftime \
-          tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3
+          tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \
+          tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1
 
 include ../Rules
 
index fd838181e4f0969dbd9a553d0378a7e8d4a90eff..8788e192ce358d77bacd854a13a53787930ff73f 100644 (file)
@@ -49,6 +49,10 @@ libc {
   GLIBC_2.2 {
     # w*
     wcsftime;
+
+    # c*; actually in librt in version 2.2, moved to libc in 2.17
+    clock_getres; clock_gettime; clock_settime; clock_getcpuclockid;
+    clock_nanosleep;
   }
   GLIBC_2.3 {
     # these internal names are used by libstdc++
@@ -65,4 +69,13 @@ libc {
   GLIBC_2.16 {
     timespec_get;
   }
+  GLIBC_2.17 {
+    # c*
+    clock_getres; clock_gettime; clock_settime; clock_getcpuclockid;
+    clock_nanosleep;
+  }
+  GLIBC_PRIVATE {
+    # same as clock_gettime; used in other libraries
+    __clock_gettime;
+  }
 }
similarity index 75%
rename from rt/clock_getcpuclockid.c
rename to time/clock_getcpuclockid.c
index 22b9f1383c8bc180878016fe79cbeed9ee81e44f..8d205abfa96c868236be912392aa548a4fc653d8 100644 (file)
@@ -19,6 +19,7 @@
 #include <errno.h>
 #include <time.h>
 #include <unistd.h>
+#include <shlib-compat.h>
 
 int
 __clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
@@ -37,4 +38,10 @@ __clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
   return ENOENT;
 #endif
 }
-weak_alias (__clock_getcpuclockid, clock_getcpuclockid)
+versioned_symbol (libc, __clock_getcpuclockid, clock_getcpuclockid, GLIBC_2_17);
+/* clock_getcpuclockid 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_getcpuclockid, __clock_getcpuclockid_2);
+compat_symbol (libc, __clock_getcpuclockid_2, clock_getcpuclockid, GLIBC_2_2);
+#endif
similarity index 73%
rename from rt/clock_getres.c
rename to time/clock_getres.c
index b990bf0af0f6718aade426bc20e3d0ea50169f85..412f80fbec345e5fbb867c24bf730c009f9299bb 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <errno.h>
 #include <time.h>
+#include <shlib-compat.h>
 
 /* Get resolution of clock.  */
 int
@@ -26,5 +27,13 @@ __clock_getres (clockid_t clock_id, struct timespec *res)
   __set_errno (ENOSYS);
   return -1;
 }
-weak_alias (__clock_getres, clock_getres)
+
+versioned_symbol (libc, __clock_getres, clock_getres, GLIBC_2_17);
+/* clock_getres 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_getres, __clock_getres_2);
+compat_symbol (libc, __clock_getres_2, clock_getres, GLIBC_2_2);
+#endif
+
 stub_warning (clock_getres)
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)
similarity index 76%
rename from rt/clock_nanosleep.c
rename to time/clock_nanosleep.c
index 5b724e593bf790adce24a5e9da481f2bd3506d38..c53c820880ad718685e0ff7d65ce9d6b16f7d5d4 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <errno.h>
 #include <time.h>
+#include <shlib-compat.h>
 
 int
 __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
@@ -33,5 +34,13 @@ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
   /* Not implemented.  */
   return ENOSYS;
 }
-weak_alias (__clock_nanosleep, clock_nanosleep)
+
+versioned_symbol (libc, __clock_nanosleep, clock_nanosleep, GLIBC_2_17);
+/* clock_nanosleep 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_nanosleep, __clock_nanosleep_2);
+compat_symbol (libc, __clock_nanosleep_2, clock_nanosleep, GLIBC_2_2);
+#endif
+
 stub_warning (clock_nanosleep)
similarity index 71%
rename from rt/clock_settime.c
rename to time/clock_settime.c
index 891925ab2c2ee307a72af9ea600b3935941f31d2..dd86a1c189deba7a2e9e7d5c492afb479ccd046b 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <errno.h>
 #include <time.h>
+#include <shlib-compat.h>
 
 /* Set CLOCK to value TP.  */
 int
@@ -26,5 +27,14 @@ __clock_settime (clockid_t clock_id, const struct timespec *tp)
   __set_errno (ENOSYS);
   return -1;
 }
-weak_alias (__clock_settime, clock_settime)
+libc_hidden_def (__clock_settime)
+
+versioned_symbol (libc, __clock_settime, clock_settime, GLIBC_2_17);
+/* clock_settime 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_settime, __clock_settime_2);
+compat_symbol (libc, __clock_settime_2, clock_settime, GLIBC_2_2);
+#endif
+
 stub_warning (clock_settime)
similarity index 100%
rename from rt/tst-clock.c
rename to time/tst-clock.c
similarity index 100%
rename from rt/tst-clock2.c
rename to time/tst-clock2.c
similarity index 100%
rename from rt/tst-cpuclock1.c
rename to time/tst-cpuclock1.c