From patchwork Thu Sep 7 22:41:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Albert ARIBAUD (3ADEV)" X-Patchwork-Id: 811199 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-84323-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="dtPejqH5"; 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 3xpFq62rzFz9sCZ for ; Fri, 8 Sep 2017 08:43:30 +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=YS0Brlq/HYaD3BK2fffMEBwaFIw9g0X wre34njyJK2JhCkE/wSh005gY1WzF2Y/rrdM5ankUCo36jcodNxUIX33A+TXFFw7 JX0MaqAMF+054N0gbGvZsCNR+8BJFy3tmQRoVun3f2evdxEWvzzNf3j7krQebv49 ADi6GRGab8SU= 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=OOAAxm5+pzfuR1dh8pwNMFwm80Q=; b=dtPej qH56P5orUn9KCMctyIF57F9eCgrbTidWOUYvD9KNlXGjRAsQgGArEaxsLUepWUO/ mHk5anUazS1zaQWts9w1GotEx/I7wkYxfbc8W9dG2GZiQfk81d3UqlldIGBtaYVu En1ZMp6ZqT5ifplcbhoB50lIqUSKCXVE8LjBfE= Received: (qmail 61281 invoked by alias); 7 Sep 2017 22:42:51 -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 61174 invoked by uid 89); 7 Sep 2017 22:42:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.6 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 autolearn=ham version=3.3.2 spammy=265 X-HELO: smtp6-g21.free.fr From: "Albert ARIBAUD (3ADEV)" To: libc-alpha@sourceware.org Cc: "Albert ARIBAUD (3ADEV)" Subject: [RFC PATCH 05/52] Y2038: add function __timegm64 Date: Fri, 8 Sep 2017 00:41:32 +0200 Message-Id: <20170907224219.12483-6-albert.aribaud@3adev.fr> In-Reply-To: <20170907224219.12483-5-albert.aribaud@3adev.fr> References: <20170907224219.12483-1-albert.aribaud@3adev.fr> <20170907224219.12483-2-albert.aribaud@3adev.fr> <20170907224219.12483-3-albert.aribaud@3adev.fr> <20170907224219.12483-4-albert.aribaud@3adev.fr> <20170907224219.12483-5-albert.aribaud@3adev.fr> Implementation is based on the same __mktime64_internal function which was introduced in the '__mktime64' implementation change. Again, the implementation does not require a Y2038-proof kernel. Signed-off-by: Albert ARIBAUD (3ADEV) --- sysdeps/unix/sysv/linux/arm/Versions | 1 + time/timegm.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/sysdeps/unix/sysv/linux/arm/Versions b/sysdeps/unix/sysv/linux/arm/Versions index 546d7c60ee..f7feda3650 100644 --- a/sysdeps/unix/sysv/linux/arm/Versions +++ b/sysdeps/unix/sysv/linux/arm/Versions @@ -26,5 +26,6 @@ libc { __gmtime64; __gmtime64_r; __localtime64; __localtime64_r; __mktime64; __timelocal64_r; + __timegm64; } } diff --git a/time/timegm.c b/time/timegm.c index b0f5d16d16..0c8879285a 100644 --- a/time/timegm.c +++ b/time/timegm.c @@ -36,6 +36,9 @@ time_t __mktime_internal (struct tm *, struct tm * (*) (time_t const *, struct tm *), time_t *); +__time64_t __mktime64_internal (struct tm *, + struct tm * (*) (__time64_t const *, struct tm *), + __time64_t *); #endif time_t @@ -45,3 +48,11 @@ timegm (struct tm *tmp) tmp->tm_isdst = 0; return __mktime_internal (tmp, __gmtime_r, &gmtime_offset); } + +__time64_t +__timegm64 (struct tm *tmp) +{ + static __time64_t gmtime64_offset; + tmp->tm_isdst = 0; + return __mktime64_internal (tmp, __gmtime64_r, &gmtime64_offset); +}