From patchwork Wed Apr 18 20:17:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Albert ARIBAUD (3ADEV)" X-Patchwork-Id: 900339 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-91632-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=3adev.fr Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="YTcOvLxF"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RD4G4g5Qz9s1j for ; Thu, 19 Apr 2018 06:19:42 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=cH3jdRJXOycwoL7XmeeF/z762ttMwQX A2pSYRwkx8EIHFBXOcC53w2Q8GkV2O3iR0L71QLddkoPVRVTZkMObwqnCrKeqClU b4Uvuv90ig0/A8EkDHk7VdNTHi5wlHxfasSDrDwOZHOaqWimPFytvgKTuQvehLjS w8MwQWJJLo8w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=Z1IUhmzqPygOTAdlgJe3s0rGBmg=; b=YTcOv LxFG0DiBqa3qINwubuSwbrJ/JIC2+J+za2XD1MzdcqTNVLM8aA5A9a1e8P7VbSTH 6q4R3BVP7EYCz1bi2DjWIdX0h8DHnSUJPfCQcicR+l0W9rPFAOC1TwLI3/6XiCzn 3Veqt3FLKplOxHuRMHcPpEuQMKf3h7nhp5Vwpg= Received: (qmail 100221 invoked by alias); 18 Apr 2018 20:19:05 -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 100146 invoked by uid 89); 18 Apr 2018 20:19:04 -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=Hx-languages-length:1489, east X-HELO: smtp3-g21.free.fr From: "Albert ARIBAUD (3ADEV)" To: libc-alpha@sourceware.org Cc: "Albert ARIBAUD (3ADEV)" Subject: [[PATCH RFC 2] 07/63] Y2038: add function __gmtime64_r Date: Wed, 18 Apr 2018 22:17:23 +0200 Message-Id: <20180418201819.15952-8-albert.aribaud@3adev.fr> In-Reply-To: <20180418201819.15952-7-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> --- include/time.h | 3 +++ time/Versions | 2 +- time/gmtime.c | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/time.h b/include/time.h index 81cb0fbc00..b0a1199308 100644 --- a/include/time.h +++ b/include/time.h @@ -71,6 +71,9 @@ extern struct tm *__gmtime_r (const time_t *__restrict __timer, struct tm *__restrict __tp); libc_hidden_proto (__gmtime_r) +extern struct tm *__gmtime64_r (const __time64_t *__restrict __timer, + struct tm *__restrict __tp); + /* Compute the `struct tm' representation of T, offset OFFSET seconds east of UTC, and store year, yday, mon, mday, wday, hour, min, sec into *TP. diff --git a/time/Versions b/time/Versions index 511580b6d8..d226a8557f 100644 --- a/time/Versions +++ b/time/Versions @@ -67,7 +67,7 @@ libc { } GLIBC_2.27 { __difftime64; - __gmtime64; + __gmtime64; __gmtime64_r; __localtime64; __localtime64_r; } } diff --git a/time/gmtime.c b/time/gmtime.c index 4a8c0cbfd7..b66ab3f853 100644 --- a/time/gmtime.c +++ b/time/gmtime.c @@ -47,6 +47,14 @@ gmtime (const time_t *t) return __tz_convert (*t, 0, &_tmbuf); } +/* Return the `struct tm' representation of 64-bit-time *T + in UTC, using *TP to store the result. */ +struct tm * +__gmtime64_r (const __time64_t *t, struct tm *tp) +{ + return __tz_convert (*t, 0, tp); +} + /* Return the `struct tm' representation of 64-bit-time *T in UTC. */ struct tm * __gmtime64 (const __time64_t *t)