[RFC,04/12] y2038: Rename xclock_gettime to __xclock_gettime

Message ID 20200601140740.16371-5-lukma@denx.de
State Dropped
Delegated to: Lukasz Majewski
Headers
Series y2038: Convert timespec_{sub|add|create} in support to be Y2038 safe |

Commit Message

Lukasz Majewski June 1, 2020, 2:07 p.m. UTC
  As the xclock_gettime is used locally in glibc, its name shall begin with
"__". This change adds this prefix.

Tested with glibc/glibc-many-build --keep failed glibcs
---
 nptl/tst-rwlock6.c             | 10 +++++-----
 nptl/tst-rwlock7.c             |  6 +++---
 nptl/tst-rwlock9.c             |  4 ++--
 nptl/tst-sem5.c                |  2 +-
 support/timespec.h             |  4 ++--
 support/xclock_gettime.c       |  3 +--
 support/xtime.h                |  5 +++--
 sysdeps/pthread/tst-cond11.c   |  2 +-
 sysdeps/pthread/tst-rwlock14.c |  2 +-
 9 files changed, 19 insertions(+), 19 deletions(-)
  

Patch

diff --git a/nptl/tst-rwlock6.c b/nptl/tst-rwlock6.c
index 8714381a16..ade2b3050b 100644
--- a/nptl/tst-rwlock6.c
+++ b/nptl/tst-rwlock6.c
@@ -60,7 +60,7 @@  tf (void *arg)
 
   /* Timeout: 0.3 secs.  */
   struct timespec ts_start;
-  xclock_gettime (clockid_for_get, &ts_start);
+  __xclock_gettime (clockid_for_get, &ts_start);
 
   struct timespec ts_timeout = timespec_add (ts_start,
                                              __make_timespec (0, 300000000));
@@ -77,7 +77,7 @@  tf (void *arg)
 
   TEST_TIMESPEC_NOW_OR_AFTER (CLOCK_REALTIME, ts_timeout);
 
-  xclock_gettime (clockid_for_get, &ts_timeout);
+  __xclock_gettime (clockid_for_get, &ts_timeout);
   ts_timeout.tv_sec += 10;
   /* Note that the following operation makes ts invalid.  */
   ts_timeout.tv_nsec += 1000000000;
@@ -117,7 +117,7 @@  do_test_clock (clockid_t clockid, const char *fnname)
         FAIL_EXIT1 ("round %Zu: rwlockattr_destroy failed\n", cnt);
 
       struct timespec ts;
-      xclock_gettime (clockid_for_get, &ts);
+      __xclock_gettime (clockid_for_get, &ts);
       ++ts.tv_sec;
 
       /* Get a write lock.  */
@@ -130,7 +130,7 @@  do_test_clock (clockid_t clockid, const char *fnname)
 
       verbose_printf ("1st %swrlock done\n", fnname);
 
-      xclock_gettime (clockid_for_get, &ts);
+      __xclock_gettime (clockid_for_get, &ts);
       ++ts.tv_sec;
       if (clockid == CLOCK_USE_TIMEDLOCK)
         TEST_COMPARE (pthread_rwlock_timedrdlock (&r, &ts), EDEADLK);
@@ -139,7 +139,7 @@  do_test_clock (clockid_t clockid, const char *fnname)
 
       verbose_printf ("1st %srdlock done\n", fnname);
 
-      xclock_gettime (clockid_for_get, &ts);
+      __xclock_gettime (clockid_for_get, &ts);
       ++ts.tv_sec;
       if (clockid == CLOCK_USE_TIMEDLOCK)
         TEST_COMPARE (pthread_rwlock_timedwrlock (&r, &ts), EDEADLK);
diff --git a/nptl/tst-rwlock7.c b/nptl/tst-rwlock7.c
index bdbfb5dac9..7dcb2d17ae 100644
--- a/nptl/tst-rwlock7.c
+++ b/nptl/tst-rwlock7.c
@@ -59,7 +59,7 @@  tf (void *arg)
 
   /* Timeout: 0.3 secs.  */
   struct timespec ts_start;
-  xclock_gettime (clockid_for_get, &ts_start);
+  __xclock_gettime (clockid_for_get, &ts_start);
   const struct timespec ts_timeout = timespec_add (ts_start,
                                                    __make_timespec (0, 300000000));
 
@@ -73,7 +73,7 @@  tf (void *arg)
   TEST_TIMESPEC_NOW_OR_AFTER (clockid_for_get, ts_timeout);
 
   struct timespec ts_invalid;
-  xclock_gettime (clockid_for_get, &ts_invalid);
+  __xclock_gettime (clockid_for_get, &ts_invalid);
   ts_invalid.tv_sec += 10;
   /* Note that the following operation makes ts invalid.  */
   ts_invalid.tv_nsec += 1000000000;
@@ -113,7 +113,7 @@  do_test_clock (clockid_t clockid, const char *fnname)
         FAIL_EXIT1 ("round %Zu: rwlockattr_destroy failed\n", cnt);
 
       struct timespec ts;
-      xclock_gettime (clockid_for_get, &ts);
+      __xclock_gettime (clockid_for_get, &ts);
 
       ++ts.tv_sec;
 
diff --git a/nptl/tst-rwlock9.c b/nptl/tst-rwlock9.c
index 408bbcdd5d..f35ed6feaa 100644
--- a/nptl/tst-rwlock9.c
+++ b/nptl/tst-rwlock9.c
@@ -73,7 +73,7 @@  writer_thread (void *arg)
       int e;
       do
 	{
-	  xclock_gettime (clockid_for_get, &ts);
+	  __xclock_gettime (clockid_for_get, &ts);
 
           ts = timespec_add (ts, timeout);
           ts = timespec_add (ts, timeout);
@@ -120,7 +120,7 @@  reader_thread (void *arg)
       int e;
       do
 	{
-	  xclock_gettime (clockid_for_get, &ts);
+	  __xclock_gettime (clockid_for_get, &ts);
 
           ts = timespec_add (ts, timeout);
 
diff --git a/nptl/tst-sem5.c b/nptl/tst-sem5.c
index 8f5c5b9bb1..611fff3e69 100644
--- a/nptl/tst-sem5.c
+++ b/nptl/tst-sem5.c
@@ -41,7 +41,7 @@  do_test_clock (clockid_t clockid)
   TEST_COMPARE (TEMP_FAILURE_RETRY (sem_wait (&s)), 0);
 
   /* We wait for half a second.  */
-  xclock_gettime (clockid_for_get, &ts);
+  __xclock_gettime (clockid_for_get, &ts);
   ts = timespec_add (ts, __make_timespec (0, TIMESPEC_HZ/2));
 
   errno = 0;
diff --git a/support/timespec.h b/support/timespec.h
index dbe12938d8..08df1d473b 100644
--- a/support/timespec.h
+++ b/support/timespec.h
@@ -57,7 +57,7 @@  void test_timespec_equal_or_after_impl (const char *file, int line,
   ({                                                            \
     struct timespec now;                                        \
     const int saved_errno = errno;                              \
-    xclock_gettime ((clockid), &now);                           \
+    __xclock_gettime ((clockid), &now);                         \
     TEST_TIMESPEC_BEFORE ((left), now);                         \
     errno = saved_errno;                                        \
   })
@@ -71,7 +71,7 @@  void test_timespec_equal_or_after_impl (const char *file, int line,
   ({                                                            \
     struct timespec now;                                        \
     const int saved_errno = errno;                              \
-    xclock_gettime ((clockid), &now);                           \
+    __xclock_gettime ((clockid), &now);                         \
     TEST_TIMESPEC_EQUAL_OR_AFTER (now, (right));                \
     errno = saved_errno;                                        \
   })
diff --git a/support/xclock_gettime.c b/support/xclock_gettime.c
index 47f78016a0..fed397b784 100644
--- a/support/xclock_gettime.c
+++ b/support/xclock_gettime.c
@@ -21,8 +21,7 @@ 
 #include <support/xthread.h>
 
 void
-xclock_gettime (clockid_t clockid,
-                struct timespec *ts)
+__xclock_gettime (clockid_t clockid, struct timespec *ts)
 {
   const int ret = clock_gettime (clockid, ts);
   if (ret < 0)
diff --git a/support/xtime.h b/support/xtime.h
index 65edbb01d3..0912ead0ec 100644
--- a/support/xtime.h
+++ b/support/xtime.h
@@ -20,13 +20,14 @@ 
 #define SUPPORT_TIME_H
 
 #include <time.h>
+#include <struct___timespec64.h>
 
 __BEGIN_DECLS
 
 /* The following functions call the corresponding libc functions and
    terminate the process on error.  */
 
-void xclock_gettime (clockid_t clock, struct timespec *ts);
+void __xclock_gettime (clockid_t clock, struct timespec *ts);
 
 /* This helper can often simplify tests by avoiding an explicit
    variable declaration or allowing that declaration to be const. */
@@ -34,7 +35,7 @@  void xclock_gettime (clockid_t clock, struct timespec *ts);
 static inline struct timespec xclock_now (clockid_t clock)
 {
   struct timespec ts;
-  xclock_gettime (clock, &ts);
+  __xclock_gettime (clock, &ts);
   return ts;
 }
 
diff --git a/sysdeps/pthread/tst-cond11.c b/sysdeps/pthread/tst-cond11.c
index 209e2f0c8d..5d510859a0 100644
--- a/sysdeps/pthread/tst-cond11.c
+++ b/sysdeps/pthread/tst-cond11.c
@@ -61,7 +61,7 @@  run_test (clockid_t attr_clock, clockid_t wait_clock)
   TEST_COMPARE (pthread_mutex_lock (&mut), EDEADLK);
 
   struct timespec ts_timeout;
-  xclock_gettime (wait_clock == CLOCK_USE_ATTR_CLOCK ? attr_clock : wait_clock,
+  __xclock_gettime (wait_clock == CLOCK_USE_ATTR_CLOCK ? attr_clock : wait_clock,
                   &ts_timeout);
 
   /* Wait one second.  */
diff --git a/sysdeps/pthread/tst-rwlock14.c b/sysdeps/pthread/tst-rwlock14.c
index 3583b19e3c..225bfae486 100644
--- a/sysdeps/pthread/tst-rwlock14.c
+++ b/sysdeps/pthread/tst-rwlock14.c
@@ -52,7 +52,7 @@  do_test (void)
 {
   struct timespec ts;
 
-  xclock_gettime (CLOCK_REALTIME, &ts);
+  __xclock_gettime (CLOCK_REALTIME, &ts);
   xpthread_barrier_init (&b, NULL, 2);
 
   pthread_t me = pthread_self ();