From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 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 dcvr.yhbt.net (Postfix) with ESMTPS id 6D5121F461 for ; Wed, 28 Aug 2019 20:21:47 +0000 (UTC) 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:references:date:in-reply-to :message-id:mime-version:content-type; q=dns; s=default; b=bJJZH L7fOFgBg5b0v/8KlpAQeckFOkmZpdeC2RoWbn4ihg/WQFunku+WCNFSt+u0pYfbH BBCe58Y6CH4htgOqMtzd4H1VHlUFER3m5pv+/O1vXafYBy49lAZDc0IpdRba4JJb 2H2e6YXBSUhSGtaJUCsfzLVg1D2JsJKKRtLXwA= 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:references:date:in-reply-to :message-id:mime-version:content-type; s=default; bh=j1go/KrF8dq XJqCIlraNOZnSblc=; b=WK8I41E2mb7QBTQKy20TeRjsfCH4Wm/Z2WJH4fLSV4Q dcFM5kOe7SXXC6METFFeKaoGxdIKhvIns1oOITysIHPckWcc6G29SOS+BVSUgydb vYWG1HagH0F3VXkDZvlD8EYX3B4gG+C+2+YoosLIdGC/1ieatmBdS0A2fYf/E2AM = Received: (qmail 114147 invoked by alias); 28 Aug 2019 20:21:44 -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 Received: (qmail 114135 invoked by uid 89); 28 Aug 2019 20:21:44 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mx1.redhat.com From: Florian Weimer To: Paul Eggert Cc: Zack Weinberg , libc-alpha@sourceware.org, Joseph Myers , Lukasz Majewski , Alistair Francis , Stepan Golosunov , Arnd Bergmann , Adhemerval Zanella , Samuel Thibault Subject: Re: [PATCH v2 05/10] Use clock_gettime to implement time. References: <20190828153236.18229-1-zackw@panix.com> <20190828153236.18229-6-zackw@panix.com> <87muftb1fk.fsf@oldenburg2.str.redhat.com> Date: Wed, 28 Aug 2019 22:21:35 +0200 In-Reply-To: (Paul Eggert's message of "Wed, 28 Aug 2019 13:01:45 -0700") Message-ID: <87sgpl9h2o.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain * Paul Eggert: > Florian Weimer wrote: >> Given that time has no stringent accuracy requirements, this shouldn't >> come as a surprise. > > In what sense does 'time' have less-stringent accuracy requirements > than clock_gettime (CLOCK_REALTIME) does? Can 'time' return a value > that disagrees with the time_t part of what clock_gettime > (CLOCK_REALTIME) returns? Any such disagreement would cause > application bugs that could well be unlikely and hard to track down; > also, if there is disagreement, replacing calls to 'time' with calls > to clock_gettime might not be advisable even aside from performance > issues. Maybe accuracy is the wrong word. But time can definitely return the value of a variable that is incremented periodically from the timer interrupt. That's not possible for gettimeofday or clock_gettime with CLOCK_REALTIME (from a quality-of-implementation perspective). Thanks, Florian