From patchwork Tue Mar 24 13:18:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 38601 Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by sourceware.org (Postfix) with ESMTPS id 25B5A385B834 for ; Tue, 24 Mar 2020 13:18:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 25B5A385B834 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=lukma@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 48msJj72FBz1rrL9; Tue, 24 Mar 2020 14:18:45 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 48msJj6hkBz1r0bv; Tue, 24 Mar 2020 14:18:45 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id X4GnyU7JZCUr; Tue, 24 Mar 2020 14:18:44 +0100 (CET) X-Auth-Info: pSijJX/1KzgsRjhnZM3dOkfCMYURcucFFNJK9+SjRzw= Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 24 Mar 2020 14:18:44 +0100 (CET) From: Lukasz Majewski To: Joseph Myers , Adhemerval Zanella Cc: Alistair Francis , Alistair Francis , GNU C Library , Florian Weimer , Andreas Schwab , Lukasz Majewski , Samuel Thibault Subject: [PATCH 2/5] y2038: hurd: Provide __clock_gettime64 function Date: Tue, 24 Mar 2020 14:18:18 +0100 Message-Id: <20200324131821.22048-3-lukma@denx.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200324131821.22048-1-lukma@denx.de> References: <20200324131821.22048-1-lukma@denx.de> MIME-Version: 1.0 X-Spam-Status: No, score=-31.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Mar 2020 13:18:48 -0000 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 Reviewed-by: Alistair Francis --- 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)