From patchwork Wed Sep 18 21:16:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1164209 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-105238-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="po5iu3Ac"; 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 46YXpv2lD1z9s4Y for ; Thu, 19 Sep 2019 07:16:38 +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; q=dns; s= default; b=uX2pJqXn5IFArOLSenBUifU/QEYHQIAQNl6YrXc4fhQBDbYas/hxJ vvafi1x2S0lvqlZCCW0I2dI/FTZ2Yx1EmG9mdH5rUWY5+WeR3y49Qm7+/wF3oC/D ntIrDE5BDOxzJiVz+0YJQjN/1oZR4BJ7npgADezJ+J9bwSspf5Oz08= 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; s=default; bh=+6rPqx0TF/WOB3l0tPtpTqk8Rxg=; b=po5iu3AcqrigVbi8ggBWK1+lxzBe nQhhcGrCLNMG75VgDP39kzM1Kyh5J5bhOsGsoFmXGPvfu8xrCeCRVoa284Qvke15 KHH+ZOwR541jiJQoBaC+KJihwPbrjfVXCeowWmoHKP0prjZ/zJA+TikH8rLaomds zvM04/Z7fa13H+I= Received: (qmail 79973 invoked by alias); 18 Sep 2019 21:16:32 -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 79961 invoked by uid 89); 18 Sep 2019 21:16:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy= X-HELO: mail-out.m-online.net From: Lukasz Majewski To: Joseph Myers , Alistair Francis , Alistair Francis , Zack Weinberg Cc: Arnd Bergmann , GNU C Library , Adhemerval Zanella , Florian Weimer , Carlos O'Donell , Stepan Golosunov , Lukasz Majewski Subject: [PATCH v8 0/3] y2038: Linux: Introduce __clock_settime64 function Date: Wed, 18 Sep 2019 23:16:00 +0200 Message-Id: <20190918211603.8444-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. 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/glibc__clock_settime-conversion-v8 Those patches have been applied on top of master branch: SHA1: 87accae3978c77c1a50d19ea8e3da3f0248d2612 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 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 | 115 ++++++++++++++++++++++++ sysdeps/unix/sysv/linux/clock_settime.c | 38 +++++++- 2 files changed, 149 insertions(+), 4 deletions(-)