From patchwork Mon May 20 10:27:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1101931 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-102097-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="XtJXO1/D"; 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 456w8J5FLWz9s3Z for ; Mon, 20 May 2019 20:28:00 +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=yfpW/NJ72w5+C3xLmYXTc8Hc5IiGqsK zYPrkyYTiuKvcFzhANR+m2OzmO9imTTodtiSsg1TGVlMTiZUqkCNQbzZBQOCQb0f xnJxsi2m2hEhW2mWvkPt4XlLd3crIFMRKj+WT4Zy6wj9TMtqR/isvRupm3MRof7o YSuVZ+cvZae4= 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=pN11AVaYbhg/yY6n3lUEeysdKXE=; b=XtJXO 1/DrjefNKazgrmg8kw71CxbiOP9ePVat9Q8xJGSzcrMKMM6ziOO+/Muye8///LGC wZqeNfI3rCdX6Ej5UJ1PRiR9/5Qnt4nadze9v8NFDYwyXEatFx1WpAweBmzsYEO0 c1JosEW3hs1EedGUj4deT5xZQWjOJdpXJWrdQY= Received: (qmail 122709 invoked by alias); 20 May 2019 10:27:47 -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 122648 invoked by uid 89); 20 May 2019 10:27:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=H*r:192.168.8, H*Ad:D*edu X-HELO: mail-out.m-online.net From: Lukasz Majewski To: libc-alpha@sourceware.org Cc: Stepan Golosunov , Arnd Bergmann , Paul Eggert , Joseph Myers , Lukasz Majewski Subject: [PATCH v4 0/3] y2038: Linux: Provide __clock_settime64 function supporting 64 bit time Date: Mon, 20 May 2019 12:27:20 +0200 Message-Id: <20190520102723.5380-1-lukma@denx.de> In-Reply-To: <20190414220841.20243-1-lukma@denx.de> References: <20190414220841.20243-1-lukma@denx.de> This patch set introduces the conversion of __clock_settime to explicit 64 bit struct __timespec64 arguments. As a result this function is now Y2038 safe. To achieve the above goal - new, internal to glibc, struct __timespec64 has been also introduced as well as helper functions to handle time conversions on systems with __TIMESIZE != 64. The code from this patch set uses the new clock_settime64 syscall from Linux kernel (5.1+). This work is (loosely) based on a previous development/patches: https://libc-alpha.sourceware.narkive.com/zniMOWui/rfc-patch-00-52-make-glibc-y2038-proof#post68 Github branch (including the y2038 conversion example): https://github.com/lmajewski/y2038_glibc/commits/Y2038-2.29-glibc-__clock-internal-struct-timespec-v4 Those patches have been applied on top of master branch: SHA1: 1f50f2ad854c84ead522bfc7331b46dbe6057d53 Shall be used with provided meta-y2038 for development and testing: https://github.com/lmajewski/meta-y2038 I've used guidelines from: https://www.gnu.org/software/libc/manual/html_mono/libc.html "D.2.1 64-bit time symbol handling in the GNU C Library" to convert *clock_settime*. and most notably from: https://sourceware.org/glibc/wiki/Y2038ProofnessDesign#clock_gettime.28.29 Dependency: The patch adding __ASSUME_TIME64_SYSCALLS define: "y2038: Introduce __ASSUME_TIME64_SYSCALLS define" https://patchwork.ozlabs.org/patch/1100097/ Feedback and comments are more than welcome. Lukasz Majewski (3): y2038: Introduce internal for glibc struct __timespec64 y2038: Provide conversion helpers for struct __timespec64 y2038: linux: Provide __clock_settime64 implementation include/time.h | 118 ++++++++++++++++++++++++++++++++ sysdeps/unix/sysv/linux/clock_settime.c | 38 +++++++++- 2 files changed, 153 insertions(+), 3 deletions(-)