bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gettime's gettimeofday call may fail


From: Paul Eggert
Subject: Re: gettime's gettimeofday call may fail
Date: Sun, 23 Oct 2005 16:31:54 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Jim Meyering <address@hidden> writes:

> Paul Eggert <address@hidden> wrote:
>> How about the following idea?  If gettimeofday, clock_gettime,
>> etc. fail with EOVERFLOW, invoke xtime_overflow, which prints a
>> warning to stderr and returns the maximum time value.
>
> I like it.  But why trigger only on EOVERFLOW?  at least for the current
> next-to-last-resort gettimeofday call, it might be better to let any
> nonzero return provoke failure, in case some other system sets errno to
> a different value in this unusual case.

In that case I suppose it should be called xtime_error instead of
xtime_overflow, since it could fail for other reasons (e.g., no access
to a hardware clock?).

Returning the maximum value is a bit odd if the error is something
other than EOVERFLOW.

Maybe xtime_error should print a warning diagnostic and return the
maximum value if EOVERFLOW, and print an error diagnostic and exit
with any other error?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]