Re: Unadjusted system time

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Wed, 3 Nov 1999 14:55:13 +0100


Michael Schimek wrote:
> For the new multimedia interfaces we need some global system clock for
> timestamping and synchronization purposes. It has been argued the
> time-of-day clock is inappropriate since not guaranteed to increase
> monotonically.

A lot more applications than that break if the time is not monotonic or
jumps forward. Emacs for example will get confused. So will mail
transport agents (sendmail), and Netscape. Anything that has a pause or
a peridic event handler.

Many window managers will also break. In some cases, you have to wait
for the duration of the jump before getting control of your windows
again.

One fix is to change all of those applications to use the UST where
appropriate. But when is it appropriate and when is it not? A clock
display program (including Emacs and xclock) ought to use both UST and
gettimeofday: UST for the display update period, and gettimeofday to
show the time itself.

A jump in the the system time breaks so many things that I'd argue you
should simply not do it except perhaps at boot time. A gradual slew is
reasonable, and there are programs like ntptime that can help you with
that. Though they don't work either in many cases, like when you dial
up once every few days and your system has drifted 15 minutes in the
meantime.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/