From patchwork Thu Jan 16 13:27:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1224223 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-108722-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.a=rsa-sha1 header.s=default header.b=yKZM9Ka2; 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 47z4l52lrXz9sRd for ; Fri, 17 Jan 2020 00:28:17 +1100 (AEDT) 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 :mime-version:content-transfer-encoding; q=dns; s=default; b=mYl Wc2j/VDtPyCD64nL/talxv0zFf5SvjrR+HQLVp4UVTTzLH2DDkltXnSVUrAjIFnW nhX9drrklmLetrpSurruBDFep7ygNTXgp5PFytGhSvUrpVddxBiiE5TJWrkyAYmt aWZXpmPQliMWru03EXragO3I4i9CqrhUEMq7zbDc= 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 :mime-version:content-transfer-encoding; s=default; bh=NFIVWm3XE Dk7fdRdQ4fX2sl/0Mg=; b=yKZM9Ka2KxXjUc6V3B1eZbHhcXECQ+OExddqKuNxM 0uriPMuJqPM3SFTVGMKh6G+4+V2Dd7BOytj3AFULN7TCGXH5jcWWXQYUStHDuP3n +iS+H++AUUgo883Q5H7RiZFRCfh6Z/l57TtAPJAPfkPn4JhOTAeDXhBySahkbr5K YM= Received: (qmail 47863 invoked by alias); 16 Jan 2020 13:28:03 -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 47756 invoked by uid 89); 16 Jan 2020 13:28:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=H*Ad:U*zackw, H*Ad:D*panix.com, HContent-Transfer-Encoding:8bit X-HELO: mail-out.m-online.net From: Lukasz Majewski To: Joseph Myers , Paul Eggert , Adhemerval Zanella , Andreas Schwab , Samuel Thibault Cc: Alistair Francis , Alistair Francis , GNU C Library , Siddhesh Poyarekar , Florian Weimer , Florian Weimer , Zack Weinberg , Carlos O'Donell , Lukasz Majewski Subject: [PATCH 1/2] y2038: hurd: Provide __clock_gettime64 function Date: Thu, 16 Jan 2020 14:27:27 +0100 Message-Id: <20200116132728.11646-1-lukma@denx.de> MIME-Version: 1.0 For Linux glibc ports the __TIMESIZE == 64 ensures proper aliasing for __clock_gettime64 (to __clock_gettime). When __TIMESIZE != 64 (like ARM32, PPC) the glibc expects separate definition of the __clock_gettime64. The HURD port only provides __clock_gettime, so this patch adds __clock_gettime64 as a tiny wrapper on it. Acked-by: Samuel Thibault --- sysdeps/mach/clock_gettime.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sysdeps/mach/clock_gettime.c b/sysdeps/mach/clock_gettime.c index ac3547df3c..fbd80536d5 100644 --- a/sysdeps/mach/clock_gettime.c +++ b/sysdeps/mach/clock_gettime.c @@ -49,3 +49,17 @@ versioned_symbol (libc, __clock_gettime, clock_gettime, GLIBC_2_17); strong_alias (__clock_gettime, __clock_gettime_2); compat_symbol (libc, __clock_gettime_2, clock_gettime, GLIBC_2_2); #endif + +int +__clock_gettime64 (clockid_t clock_id, struct __timespec64 *ts64) +{ + struct timespec ts; + int ret; + + ret = __clock_gettime (clock_id, &ts); + if (ret == 0) + *ts64 = valid_timespec_to_timespec64 (ts); + + return ret; +} +libc_hidden_def (__clock_gettime64)