Brute force clockspeed patch

Uwe Ohse <[email protected]> Thu, 26 Aug 2004 10:36:31 +0000
Newsgroups gmane.comp.lib.libtai
Message-ID <[email protected]>
http://www.ohse.de/uwe/patches/clockspeed-time-status.diff:

This patch may be useful on linux systems if clockspeed doesn't seem to work.
It includes the usual time.h and errno workarounds.

It has been tested on exactly one machine, and will not work anywhere but
on linux.

What it does:
  It calls adjtimex every 180 seconds to reset the in-kernel maxerror
  counter and the in-kernel time status to 0, thus allowing clockspeed to
  work even if the kernel believes that the clock status is bad / not
  synchronized.
  The time status may be bad if the machine has a bad clock and has been
  running for some time before clockspeed was started.

Prerequesites:
  A halfway modern gcc (3.3.1 worked for me).

How to use this patch:
  1. stop clockspedd
  2. cd your-clockspeed-sources
  3. patch <this-file
  4. make setup check
  5. restart clockspeed

Sidenote: 
  The adjtimex utility (not the system call with the same name) under 
  linux is a piece of garbage. Do not trust it, ever.