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 Netto X-Patchwork-Id: 177737 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3602828ill; Fri, 25 Oct 2019 05:10:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxuUfvVyWEUIyHhx80MG+d5UsCcaQw9kHBCto70ursYTrBLxg5vkermkfFMOZy4NJ7PgyD X-Received: by 2002:aa7:cfd4:: with SMTP id r20mr3505539edy.268.1572005402351; Fri, 25 Oct 2019 05:10:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572005402; cv=none; d=google.com; s=arc-20160816; b=xNRqJguXeWMxfyv98+68w6Tm8W05Trcaf1oRvhC9aVBEnmNwCrOQAHQF7hPVr5tiVd aV5RDr9tSaEnLZXzZDa7VoUIncU7bjlNO5dESGRmt58OxrFddAtSMHLLqEK6N0cc6FYC alFUa3Dmqfc3xjD+xxMIMmK8Cini2NDVxg2naK3FmQPPPEu+1/OR5wVjdw4q9sqRCQEI 2lB3UHBm4IsaivZLMcjuEOSWU0oi5EJ9yUJL8b/SKEBypPZy5wZI9OtRgxtgWWFFm9aY TvrtCdGuPxKmsj1w+K5hW6JJCzD4Zvk8zjla9L0+mvAgY9EmDCHN4h1CrOUaU08YEYbj Cwdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=AkNAYvR65lm8Jqes2Lkse7Wn0/rCmP654JpZxnf8yYk=; b=OhMuWcbp86hchzW0cs6XFOSqzA4g9DhHp+Qr1Kmzojn+XjGwBnHJQtAwjnzzpCtDjD t0yAK1DP8CRapQC1PI3oInQQdmTSpjDjubP06sXOZM35h1EpgYhucXhaKwozBHhwqwZw GQzj05cMQ5uoQ5gTG5SpumaWWusqRWU5uLNOQun0sXx0ctreTKI5I8UJdJeP52Yp3DLa IyExFrouF7tclvXLgh6A9DP3h/Ehk6bIbtzXJZiQPO0uDreu3rdiiRvLwvu9B1M0MYeG pef56DMbuPYg0Pequmwj14v9URQ118YMgsN/MxlLehW73IxuEhHItprXxVph3nZjm+2/ 3RlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=bV0sd6Ns; dkim=pass header.i=@linaro.org header.s=google header.b=vBa+jmVo; spf=pass (google.com: domain of libc-alpha-return-106287-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-106287-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id c24si1256117edb.328.2019.10.25.05.10.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Oct 2019 05:10:02 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-106287-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=bV0sd6Ns; dkim=pass header.i=@linaro.org header.s=google header.b=vBa+jmVo; spf=pass (google.com: domain of libc-alpha-return-106287-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-106287-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=og6FCOfZQGoTpd6PBbJLwQwlSpifKuv hsXXstxbLD2wgzAoOPpmSVLPYz2KxT7C2Y6xrmYdNuFekn/WEK3lwZZXYV0Kpm5w zBlzQ7Dfw3BDvCXTsXBo71pYffTm1Wlj1zt6T/zw9rD9OgW2c/eKeUBNPmST/j0d kNHExE0btoiA= 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=bV0sd 6NsfMjTR/3Ms5e1dSSDSL38XvBybEiu9/lB03nFcVWw4Bi2V89/HeZ2GjPBTz4Ht JwrQclu+rEasJLPZdreLKzLdDARSHOohgCRk0WpajdD+PYIoHjqTMvRum2Iw8b8/ iLgLqBfXAJTFzeLDOjUl0BUo3PhAOiagxKDVkE= 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== Return-Path: 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. --- 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 -- 2.17.1 Reviewed-by: Lukasz Majewski 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