[[PATCH,RFC,2] 08/63] Y2038: add function __ctime64

Message ID 20180418201819.15952-9-albert.aribaud@3adev.fr
State New, archived
Headers

Commit Message

Albert ARIBAUD April 18, 2018, 8:17 p.m. UTC
  ---
 time/Versions |  1 +
 time/ctime.c  | 10 ++++++++++
 2 files changed, 11 insertions(+)
  

Patch

diff --git a/time/Versions b/time/Versions
index d226a8557f..b625c55c82 100644
--- a/time/Versions
+++ b/time/Versions
@@ -67,6 +67,7 @@  libc {
   }
   GLIBC_2.27 {
     __difftime64;
+    __ctime64;
     __gmtime64; __gmtime64_r;
     __localtime64; __localtime64_r;
   }
diff --git a/time/ctime.c b/time/ctime.c
index 1222614f29..fbfb61fcd6 100644
--- a/time/ctime.c
+++ b/time/ctime.c
@@ -26,3 +26,13 @@  ctime (const time_t *t)
      In particular, ctime and asctime must yield the same pointer.  */
   return asctime (localtime (t));
 }
+
+/* Return a string as returned by asctime which
+   is the representation of *T in that form.  */
+char *
+__ctime64 (const __time64_t *t)
+{
+  /* Apply the same rule as ctime:
+     make ctime64 (t) is equivalent to asctime (localtime64 (t)).  */
+  return asctime (__localtime64 (t));
+}