From patchwork Wed Apr 18 20:17:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Albert ARIBAUD X-Patchwork-Id: 26787 Received: (qmail 100793 invoked by alias); 18 Apr 2018 20:19:09 -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 100720 invoked by uid 89); 18 Apr 2018 20:19:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, RCVD_IN_RP_RNBL autolearn=ham version=3.3.2 spammy=Apply X-HELO: smtp3-g21.free.fr From: "Albert ARIBAUD (3ADEV)" To: libc-alpha@sourceware.org Cc: "Albert ARIBAUD (3ADEV)" Subject: [[PATCH RFC 2] 08/63] Y2038: add function __ctime64 Date: Wed, 18 Apr 2018 22:17:24 +0200 Message-Id: <20180418201819.15952-9-albert.aribaud@3adev.fr> In-Reply-To: <20180418201819.15952-8-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> --- time/Versions | 1 + time/ctime.c | 10 ++++++++++ 2 files changed, 11 insertions(+) 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)); +}