From patchwork Wed Apr 18 20:17:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Albert ARIBAUD X-Patchwork-Id: 26788 Received: (qmail 101475 invoked by alias); 18 Apr 2018 20:19:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 101354 invoked by uid 89); 18 Apr 2018 20:19:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RCVD_IN_RP_RNBL autolearn=ham version=3.3.2 spammy= X-HELO: smtp3-g21.free.fr From: "Albert ARIBAUD (3ADEV)" To: libc-alpha@sourceware.org Cc: "Albert ARIBAUD (3ADEV)" Subject: [[PATCH RFC 2] 09/63] Y2038: add function __ctime64_r Date: Wed, 18 Apr 2018 22:17:25 +0200 Message-Id: <20180418201819.15952-10-albert.aribaud@3adev.fr> In-Reply-To: <20180418201819.15952-9-albert.aribaud@3adev.fr> References: <20180418201819.15952-1-albert.aribaud@3adev.fr> <20180418201819.15952-2-albert.aribaud@3adev.fr> <20180418201819.15952-3-albert.aribaud@3adev.fr> <20180418201819.15952-4-albert.aribaud@3adev.fr> <20180418201819.15952-5-albert.aribaud@3adev.fr> <20180418201819.15952-6-albert.aribaud@3adev.fr> <20180418201819.15952-7-albert.aribaud@3adev.fr> <20180418201819.15952-8-albert.aribaud@3adev.fr> <20180418201819.15952-9-albert.aribaud@3adev.fr> --- time/Versions | 2 +- time/ctime_r.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/time/Versions b/time/Versions index b625c55c82..0ad2749f2c 100644 --- a/time/Versions +++ b/time/Versions @@ -67,7 +67,7 @@ libc { } GLIBC_2.27 { __difftime64; - __ctime64; + __ctime64; __ctime64_r; __gmtime64; __gmtime64_r; __localtime64; __localtime64_r; } diff --git a/time/ctime_r.c b/time/ctime_r.c index c111146d76..742a967fdd 100644 --- a/time/ctime_r.c +++ b/time/ctime_r.c @@ -27,3 +27,12 @@ ctime_r (const time_t *t, char *buf) struct tm tm; return __asctime_r (__localtime_r (t, &tm), buf); } + +/* Return a string as returned by asctime which is the representation + of *T in that form. Reentrant Y2038-proof version. */ +char * +__ctime64_r (const __time64_t *t, char *buf) +{ + struct tm tm; + return __asctime_r (__localtime64_r (t, &tm), buf); +}