unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: Joseph Myers <joseph@codesourcery.com>,
	Paul Eggert <eggert@cs.ucla.edu>,
	Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: Florian Weimer <fweimer@redhat.com>,
	GNU C Library <libc-alpha@sourceware.org>,
	Andreas Schwab <schwab@suse.de>,
	Alistair Francis <alistair.francis@wdc.com>
Subject: [RFC 04/12] y2038: Rename xclock_gettime to __xclock_gettime
Date: Mon,  1 Jun 2020 16:07:32 +0200	[thread overview]
Message-ID: <20200601140740.16371-5-lukma@denx.de> (raw)
In-Reply-To: <20200601140740.16371-1-lukma@denx.de>

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(-)

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 ();
-- 
2.20.1


  parent reply	other threads:[~2020-06-01 14:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01 14:07 [RFC 00/12] [RFC] y2038: Convert timespec_{sub|add|create} in support to be Y2038 safe Lukasz Majewski
2020-06-01 14:07 ` [RFC 01/12] doc: Fix wording and formattine in ./support/README Lukasz Majewski
2020-06-01 14:07 ` [RFC 02/12] y2038: Rename timespec_compare to __timespec_compare Lukasz Majewski
2020-06-01 14:07 ` [RFC 03/12] y2038: Rename make_timespec to __make_timespec Lukasz Majewski
2020-06-01 14:07 ` Lukasz Majewski [this message]
2020-06-01 14:07 ` [RFC 05/12] y2038: Rename xclock_now to __xclock_now Lukasz Majewski
2020-06-01 14:07 ` [RFC 06/12] y2038: Rename timespec_sub to __timespec_sub Lukasz Majewski
2020-06-01 14:07 ` [RFC 07/12] y2038: Rename timespec_add to __timespec_add Lukasz Majewski
2020-06-01 14:07 ` [RFC 08/12] y2038: Convert __make_timespec to be Y2038 safe Lukasz Majewski
2020-06-01 14:07 ` [RFC 09/12] y2038: Convert __xclock_gettime " Lukasz Majewski
2020-06-01 14:07 ` [RFC 10/12] y2038: Convert __xclock_now " Lukasz Majewski
2020-06-01 14:07 ` [RFC 11/12] y2038: Convert timespec* files in ./support " Lukasz Majewski
2020-06-01 14:07 ` [RFC 12/12] y2038: Convert timespec_* from posix-timer.h " Lukasz Majewski
2020-06-02 18:05 ` [RFC 00/12] [RFC] y2038: Convert timespec_{sub|add|create} in support " Joseph Myers
2020-06-03 11:42   ` Lukasz Majewski
2020-06-03 12:53 ` [Y2038] Replacement of struct timespec with struct __timespec64 in glibc internal code Lukasz Majewski
2020-06-03 17:28   ` Joseph Myers
2020-06-03 20:45     ` Lukasz Majewski
2020-06-24 12:26     ` Lukasz Majewski
2020-06-24 12:43       ` Andreas Schwab
2020-06-24 20:39         ` Lukasz Majewski
2020-06-24 22:10           ` Joseph Myers
2020-06-24 17:43       ` Joseph Myers
2020-06-08 22:23   ` Samuel Thibault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200601140740.16371-5-lukma@denx.de \
    --to=lukma@denx.de \
    --cc=adhemerval.zanella@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=eggert@cs.ucla.edu \
    --cc=fweimer@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).