From patchwork Wed Apr 18 20:17:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Albert ARIBAUD X-Patchwork-Id: 26784 Received: (qmail 99043 invoked by alias); 18 Apr 2018 20:18:56 -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 98956 invoked by uid 89); 18 Apr 2018 20:18:56 -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] 05/63] Y2038: add function __localtime64_r Date: Wed, 18 Apr 2018 22:17:21 +0200 Message-Id: <20180418201819.15952-6-albert.aribaud@3adev.fr> In-Reply-To: <20180418201819.15952-5-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> --- include/time.h | 3 +++ time/Versions | 2 +- time/localtime.c | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/time.h b/include/time.h index 1d8f76f0c3..81cb0fbc00 100644 --- a/include/time.h +++ b/include/time.h @@ -64,6 +64,9 @@ extern time_t __mktime_internal (struct tm *__tp, extern struct tm *__localtime_r (const time_t *__timer, struct tm *__tp) attribute_hidden; +extern struct tm *__localtime64_r (const __time64_t *__timer, + struct tm *__tp) attribute_hidden; + extern struct tm *__gmtime_r (const time_t *__restrict __timer, struct tm *__restrict __tp); libc_hidden_proto (__gmtime_r) diff --git a/time/Versions b/time/Versions index 48d545b8c8..723a03cd13 100644 --- a/time/Versions +++ b/time/Versions @@ -67,6 +67,6 @@ libc { } GLIBC_2.27 { __difftime64; - __localtime64; + __localtime64; __localtime64_r; } } diff --git a/time/localtime.c b/time/localtime.c index 74f7ad6807..0a9a826a6a 100644 --- a/time/localtime.c +++ b/time/localtime.c @@ -53,6 +53,14 @@ libc_hidden_def (localtime) /* 64-bit-time versions */ +/* Return the `struct tm' representation of *T in local time, + using *TP to store the result. */ +struct tm * +__localtime64_r (const __time64_t *t, struct tm *tp) +{ + return __tz_convert (*t, 1, tp); +} + /* Return the `struct tm' representation of *T in local time. */ struct tm * __localtime64 (const __time64_t *t)