Jim Meyering <[EMAIL PROTECTED]> writes: > Paul Eggert <[EMAIL PROTECTED]> 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? _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib