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=-3.8 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 B7CC41F461 for ; Thu, 29 Aug 2019 17:41:39 +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:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type; q=dns; s=default; b=KPEg sd4I9txkGlbwko6tCQbJ6N1OXjmgxvVCzqzbFUySR8vtAYmJuzw+Ggn8XWThRHcu 8hZtGGsoaYpVj8HYZ64ZZCWVOcxEiAX+jpaL+0CymynWILB1mLAs88WZv/hANBjV aMnrCf1tpegla8x2TxxJaIMKi6uP5GYqxPQQiGA= 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:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type; s=default; bh=rKjTVylvzy SQYt3JpFc+r+ImUjo=; b=lkZZR44kfxMk7wwJ4h2Y8q19+4n5K1SYGgDmu/u1F4 KTF5yYIENofD2mghXUdLCdIcKrVhFoqG54GR28Gyh8tJJ09YosjRwefOYGhIBdnO pA6i/IK1BI1dZFpj6D7dDJTptGc5TIpY9thagqlEVR8LyvSjWxQu1Me+Z1u4mRtQ M= Received: (qmail 31739 invoked by alias); 29 Aug 2019 17:41:37 -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 31731 invoked by uid 89); 29 Aug 2019 17:41:37 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mailbackend.panix.com MIME-Version: 1.0 References: <20190828153236.18229-1-zackw@panix.com> <20190828153236.18229-11-zackw@panix.com> In-Reply-To: From: Zack Weinberg Date: Thu, 29 Aug 2019 13:41:23 -0400 Message-ID: Subject: Re: [PATCH v2 10/10] Revise the documentation of simple calendar time. To: Paul Eggert Cc: GNU C Library , Joseph Myers , Florian Weimer , Lukasz Majewski , Alistair Francis , Stepan Golosunov , Arnd Bergmann , Adhemerval Zanella , Samuel Thibault Content-Type: text/plain; charset="UTF-8" On Wed, Aug 28, 2019 at 9:09 PM Paul Eggert wrote: > Zack Weinberg wrote: > > +This is the simplest function for getting the current calendar time. > > +It returns the calendar time as a value of type @code{time_t}; on > > +POSIX systems, that means it has a resolution of one second. It > > +uses the same clock as @w{@samp{clock_gettime (CLOCK_REALTIME)}} > > +and @code{gettimeofday} (see below). > > As we've discussed recently (e.g., > ), the 'time' > function does not necessarily use the same clock as clock_gettime > (CLOCK_REALTIME). ... > This function uses a clock close to the clocks of @w{@samp{clock_gettime > (CLOCK_REALTIME)}} and of @code{gettimeofday} (see below), but the three clocks > are not necessarily in lock-step, and precise timestamp comparison is reliable > only when timestamps come from the same clock. I think it's good to add a cautionary note *like* this, but I'm worried that your suggested text might confuse readers into thinking that these clocks might use different epochs or could be set independently. I'll think about how to put it better. zw