mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-08 14:20:07 +00:00
Y2038: add function __ctime64_r
Tested with 'make check' on x86_64-linux-gnu and i686-linux.gnu. * include/time.h (__ctime64_r): Add. * time/ctime_r.c (__ctime64_r): Add. [__TIMESIZE != 64] (__ctime_r): Turn into a wrapper.
This commit is contained in:
parent
7755e50411
commit
c4c2836ada
@ -1,5 +1,11 @@
|
||||
2018-12-18 Albert ARIBAUD <albert.aribaud@3adev.fr>
|
||||
|
||||
* include/time.h
|
||||
(__ctime64_r): Add.
|
||||
* time/ctime_r.c
|
||||
(__ctime64_r): Add.
|
||||
[__TIMESIZE != 64] (__ctime_r): Turn into a wrapper.
|
||||
|
||||
* include/time.h
|
||||
(__ctime64): Add.
|
||||
* time/gmtime.c
|
||||
|
@ -64,6 +64,14 @@ extern char *__ctime64 (const __time64_t *__timer) __THROW;
|
||||
libc_hidden_proto (__ctime64);
|
||||
#endif
|
||||
|
||||
#if __TIMESIZE == 64
|
||||
# define __ctime64_r ctime_r
|
||||
#else
|
||||
extern char *__ctime64_r (const __time64_t *__restrict __timer,
|
||||
char *__restrict __buf) __THROW;
|
||||
libc_hidden_proto (__ctime64_r);
|
||||
#endif
|
||||
|
||||
#if __TIMESIZE == 64
|
||||
# define __localtime64 localtime
|
||||
#else
|
||||
|
@ -22,8 +22,23 @@
|
||||
/* Return a string as returned by asctime which is the representation
|
||||
of *T in that form. Reentrant version. */
|
||||
char *
|
||||
ctime_r (const time_t *t, char *buf)
|
||||
__ctime64_r (const __time64_t *t, char *buf)
|
||||
{
|
||||
struct tm tm;
|
||||
return __asctime_r (__localtime_r (t, &tm), buf);
|
||||
return __asctime_r (__localtime64_r (t, &tm), buf);
|
||||
}
|
||||
|
||||
/* Provide a 32-bit variant if needed. */
|
||||
|
||||
#if __TIMESIZE != 64
|
||||
|
||||
libc_hidden_def (__ctime64_r)
|
||||
|
||||
char *
|
||||
ctime_r (const time_t *t, char *buf)
|
||||
{
|
||||
__time64_t t64 = *t;
|
||||
return __ctime64_r (&t64, buf);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user