From patchwork Fri Oct 25 12:08:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 1184088 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-106287-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="AUMRD6D+"; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="vBa+jmVo"; 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 4702x03w1jz9sPK for ; Fri, 25 Oct 2019 23:09:56 +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:in-reply-to :references; q=dns; s=default; b=ypp1F6So9Kh7i7HdD60tD5gWBThQa1j 0uoPe5OD1RpgS6vREXRwAXC5Jw89E4OE/Ck4Tw4/hnhum9WDAdnB0iETSsCeWHCv NawnrB1eHVvTEfDPIZ9MRGJ/ml0YITeXM3QLNdfy6Y8Ry/F/Urnw5q1o7jfXovmp icTJ+kl/SMus= 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=2ExCZ1lH4tSPMNaBZQChUN5znew=; b=AUMRD 6D+7zdqaV+UYFFH0iXvdYRQmCqOizz02flp7TNZuDm3h/qjDgbPQLXxokwZfOKuq 66sONF/9oRuFCofOx62K1+iC16RBqVbqGS+NK95AF65iDt3g11J+/Bid1tqeyyoH 2iviUXZcyPAMh4ul3CZveBOvOUP+l7/I9Kcx2Y= Received: (qmail 78519 invoked by alias); 25 Oct 2019 12:09:02 -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 78018 invoked by uid 89); 25 Oct 2019 12:08:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-qk1-f181.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AkNAYvR65lm8Jqes2Lkse7Wn0/rCmP654JpZxnf8yYk=; b=vBa+jmVo8Cmh4yWXOVCupfJUqgUmk7TbpomrSkqDNx6LuF1MmJhXZvvLFuB4mzzyiX TnW9cgXdjsl6ThUCLmqIdqWTEOggbTtgoWDAS6IJ8rPzQg46yxEToXs2IM8es0aJajZz R2AOhDiY8aBj1c12SFjpMAexLJNMFFV14Eq+BNGFYmAyUeuMhjFDhtZGkxvJmh+ku83B 3UZ7+0nmBsPYLI//fh8aE3lCICLome39hTNd3xAjMBXyvfYCeTxLNAZLgSkfLCjM/PzQ fcQHwDzN3bUVyYo7UANR8m+VnZlvIrR75ZAjobzJLcoyU/B+O5ZE0krw2an9rd0Ds8wF YxAw== From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Lukasz Majewski Subject: [PATCH v2 06/11] Change most internal uses of time to __clock_gettime. Date: Fri, 25 Oct 2019 09:08:27 -0300 Message-Id: <20191025120832.27667-7-adhemerval.zanella@linaro.org> In-Reply-To: <20191025120832.27667-1-adhemerval.zanella@linaro.org> References: <20191025120832.27667-1-adhemerval.zanella@linaro.org> As for gettimeofday, time will be implemented based on clock_gettime on all platforms and internal code should use clock_gettime directly. In addition to removing a layer of indirection, this will allow us to remove the PLT-bypass gunk for gettimeofday. The changed code always assumes __clock_gettime (CLOCK_REALTIME) or __clock_gettime (CLOCK_REALTIME_COURSE) (for Linux case) cannot fail, using the same rationale for gettimeofday change. And internal helper was added (time_now). Checked on x86_64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu, powerpc64-linux-gnu, and powerpc-linux-gnu. Reviewed-by: Lukasz Majewski --- include/time.h | 11 +++- misc/syslog.c | 2 +- nscd/nscd_gethst_r.c | 2 +- nscd/nscd_helper.c | 4 +- string/strfry.c | 4 +- sysdeps/unix/sysv/linux/check_native.c | 2 +- sysdeps/unix/sysv/linux/check_pf.c | 2 +- sysdeps/unix/sysv/linux/getsysstats.c | 2 +- sysdeps/unix/sysv/linux/i386/time.c | 34 ------------ sysdeps/unix/sysv/linux/ifaddrs.c | 2 +- sysdeps/unix/sysv/linux/powerpc/time.c | 71 ++++++++------------------ sysdeps/unix/sysv/linux/x86/time.c | 34 ++++-------- time/getdate.c | 2 +- time/time.c | 1 - 14 files changed, 52 insertions(+), 121 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/i386/time.c diff --git a/include/time.h b/include/time.h index d93b16a781..3eac3dcb8d 100644 --- a/include/time.h +++ b/include/time.h @@ -7,12 +7,12 @@ # include # include