unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: Zack Weinberg <zackw@panix.com>,
	 libc-alpha@sourceware.org,
	 Joseph Myers <joseph@codesourcery.com>,
	 Lukasz Majewski <lukma@denx.de>,
	 Alistair Francis <alistair23@gmail.com>,
	 Stepan Golosunov <stepan@golosunov.pp.ru>,
	 Arnd Bergmann <arnd@arndb.de>,
	 Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	 Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: Re: [PATCH v2 05/10] Use clock_gettime to implement time.
Date: Wed, 28 Aug 2019 22:21:35 +0200	[thread overview]
Message-ID: <87sgpl9h2o.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <e2fd0284-2e7c-bec9-7961-2f143acc37ad@cs.ucla.edu> (Paul Eggert's message of "Wed, 28 Aug 2019 13:01:45 -0700")

* 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

  reply	other threads:[~2019-08-28 20:21 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28 15:32 [PATCH v2 00/10] Y2038 preparation: use clock_[gs]ettime to implement the other time-getting and -setting functions Zack Weinberg
2019-08-28 15:32 ` [PATCH v2 01/10] Change most internal uses of __gettimeofday to __clock_gettime Zack Weinberg
2019-08-29 20:30   ` Adhemerval Zanella
2019-08-29 20:42     ` Samuel Thibault
2019-08-28 15:32 ` [PATCH v2 02/10] Finish move of clock_* functions to libc Zack Weinberg
2019-08-30 17:40   ` Adhemerval Zanella
2019-09-03  7:29   ` Florian Weimer
2019-09-03 13:25     ` Adhemerval Zanella
2019-09-03 13:31       ` Florian Weimer
2019-09-03 13:44         ` Adhemerval Zanella
2019-09-03 14:34           ` Zack Weinberg
2019-09-03 18:50             ` Adhemerval Zanella
2019-08-28 15:32 ` [PATCH v2 03/10] Use clock_settime to implement stime; withdraw stime Zack Weinberg
2019-08-30 17:54   ` Adhemerval Zanella
2019-08-28 15:32 ` [PATCH v2 04/10] Use clock_settime to implement settimeofday Zack Weinberg
2019-09-02 13:22   ` Adhemerval Zanella
2019-09-03 14:44     ` Zack Weinberg
2019-08-28 15:32 ` [PATCH v2 05/10] Use clock_gettime to implement time Zack Weinberg
2019-08-28 18:16   ` Florian Weimer
2019-08-28 18:36     ` Zack Weinberg
2019-08-28 18:49       ` Florian Weimer
2019-08-28 20:01     ` Paul Eggert
2019-08-28 20:21       ` Florian Weimer [this message]
2019-08-28 21:12         ` Paul Eggert
2019-08-28 21:39           ` Florian Weimer
2019-08-29 17:49             ` Zack Weinberg
2019-09-02 13:32               ` Florian Weimer
2019-09-02 18:35                 ` Adhemerval Zanella
2019-08-28 15:32 ` [PATCH v2 06/10] Use clock_gettime to implement ftime; withdraw ftime Zack Weinberg
2019-09-02 18:42   ` Adhemerval Zanella
2019-08-28 15:32 ` [PATCH v2 07/10] Use clock_gettime to implement timespec_get Zack Weinberg
2019-09-02 19:25   ` Adhemerval Zanella
2019-08-28 15:32 ` [PATCH v2 08/10] Use clock_gettime to implement gettimeofday Zack Weinberg
2019-08-28 18:27   ` Florian Weimer
2019-09-02 19:31     ` Adhemerval Zanella
2019-08-28 15:32 ` [PATCH v2 09/10] Warn when gettimeofday is called with non-null tzp argument Zack Weinberg
2019-09-03 19:56   ` Adhemerval Zanella
2019-08-28 15:32 ` [PATCH v2 10/10] Revise the documentation of simple calendar time Zack Weinberg
2019-08-29  1:09   ` Paul Eggert
2019-08-29 17:41     ` Zack Weinberg
2019-08-30 19:17       ` Paul Eggert
2019-08-28 17:15 ` [PATCH v2 00/10] Y2038 preparation: use clock_[gs]ettime to implement the other time-getting and -setting functions Joseph Myers
2019-09-03 14:43   ` Zack Weinberg
2019-09-10 17:32     ` Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sgpl9h2o.fsf@oldenburg2.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=alistair23@gmail.com \
    --cc=arnd@arndb.de \
    --cc=eggert@cs.ucla.edu \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=lukma@denx.de \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=stepan@golosunov.pp.ru \
    --cc=zackw@panix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).