public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Florian Weimer <fweimer@redhat.com>
Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>,
	libc-alpha@sourceware.org, Bruno Haible <bruno@clisp.org>
Subject: Re: [PATCH] time: Use CLOCK_REALTIME for time (BZ #30200)
Date: Wed, 8 Mar 2023 15:08:48 -0800	[thread overview]
Message-ID: <7f7c23db-15ce-c0bf-67b8-a11fab836c1a@cs.ucla.edu> (raw)
In-Reply-To: <874jqvty7w.fsf@oldenburg.str.redhat.com>

On 3/8/23 00:59, Florian Weimer wrote:
> Even if the same underlying clock is used, rounding may cause interface
> which use different precision for the fractional seconds part to report
> different integral seconds.  The standard does not require rounding
> towards minus infinity.
Actually, POSIX does require rounding timestamps towards minus infinity 
for file timestamps, in its spec for utimensat. This requirement was put 
in because some implementations played fast and loose with these 
timestamps, with some rounding up and some rounding down, and this 
confusion caused more trouble than it was worth.

Perhaps it would help if POSIX had a similar requirement for the 'time' 
function, as my impression from this discussion is that the confusion 
with 'time' being out-of-sync with CLOCK_REALTIME is also more trouble 
than it's worth.

Anyway, thanks for clarifying what Glibc does.

  reply	other threads:[~2023-03-08 23:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06 16:03 Adhemerval Zanella
2023-03-07 11:11 ` Florian Weimer
2023-03-07 11:45   ` Adhemerval Zanella Netto
2023-03-07 11:51     ` Florian Weimer
2023-03-07 11:57       ` Adhemerval Zanella Netto
2023-03-07 12:07         ` Florian Weimer
2023-03-08  5:51           ` Paul Eggert
2023-03-08  8:59             ` Florian Weimer
2023-03-08 23:08               ` Paul Eggert [this message]
2023-03-08 16:23             ` Bruno Haible
2023-03-08 16:57               ` Adhemerval Zanella Netto
2023-03-08 17:09                 ` Florian Weimer
2023-03-08 17:46                   ` Adhemerval Zanella Netto
2023-03-08 17:44                 ` Bruno Haible
2023-03-08 17:50                   ` Adhemerval Zanella Netto

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

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

  git send-email \
    --in-reply-to=7f7c23db-15ce-c0bf-67b8-a11fab836c1a@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=adhemerval.zanella@linaro.org \
    --cc=bruno@clisp.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /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).