From patchwork Wed Apr 18 20:17:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Albert ARIBAUD X-Patchwork-Id: 26783 Received: (qmail 98483 invoked by alias); 18 Apr 2018 20:18:52 -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 98356 invoked by uid 89); 18 Apr 2018 20:18:51 -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=19, 8 X-HELO: smtp3-g21.free.fr From: "Albert ARIBAUD (3ADEV)" To: libc-alpha@sourceware.org Cc: "Albert ARIBAUD (3ADEV)" Subject: [[PATCH RFC 2] 04/63] Y2038: add function __localtime64 Date: Wed, 18 Apr 2018 22:17:20 +0200 Message-Id: <20180418201819.15952-5-albert.aribaud@3adev.fr> In-Reply-To: <20180418201819.15952-4-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> --- include/time.h | 4 ++++ time/Versions | 1 + time/localtime.c | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/include/time.h b/include/time.h index 6ffa9b2efc..1d8f76f0c3 100644 --- a/include/time.h +++ b/include/time.h @@ -9,6 +9,8 @@ extern __typeof (strftime_l) __strftime_l; libc_hidden_proto (__strftime_l) extern __typeof (strptime_l) __strptime_l; +extern struct tm *__localtime64 (const __time64_t *__timer); + libc_hidden_proto (time) libc_hidden_proto (asctime) libc_hidden_proto (mktime) @@ -17,6 +19,8 @@ libc_hidden_proto (localtime) libc_hidden_proto (strftime) libc_hidden_proto (strptime) +libc_hidden_proto (__localtime64) + extern __typeof (clock_getres) __clock_getres; extern __typeof (clock_gettime) __clock_gettime; libc_hidden_proto (__clock_gettime) diff --git a/time/Versions b/time/Versions index 57314b98c8..48d545b8c8 100644 --- a/time/Versions +++ b/time/Versions @@ -67,5 +67,6 @@ libc { } GLIBC_2.27 { __difftime64; + __localtime64; } } diff --git a/time/localtime.c b/time/localtime.c index 362fdb3c21..74f7ad6807 100644 --- a/time/localtime.c +++ b/time/localtime.c @@ -50,3 +50,12 @@ localtime (const time_t *t) return __tz_convert (*t, 1, &_tmbuf); } libc_hidden_def (localtime) + +/* 64-bit-time versions */ + +/* Return the `struct tm' representation of *T in local time. */ +struct tm * +__localtime64 (const __time64_t *t) +{ + return __tz_convert (*t, 1, &_tmbuf); +}