packages icon
MDATE: program for synchronising machines.

Mdate is intended to be used as a simple device for keeping several
machine clocks in sync over a small size local area network. It is
based on the older programs rdate and ping. The most important change
is that mdate uses ICMP timestamps. This makes it far more accurate
than rdate.  Over short distances (say, within a building) mdate can
synchronise to within about 10 milliseconds, which should be close
enough for most purposes. The disadvantage is that you have to be
super-user to use mdate even just for testing. Mdate also provides
several options for testing and debugging.

TESTED

and believed to work on SUN-OS 3.5 and HP-UX 8 & 9 .

INSTALLATION

Before starting to compile mdate, the installer should determine the
QUANTUM, which is the smallest time interval that the local machine
can measure.  I have provided a supplementary program called tick to
help with this. You should then edit the source file site.h to define
QUANTUM correctly. This must be an integer > 0; unit = millisec; 
default = 1. Do:

make tick
tick

Tick is a simple program; it should work on any Unix machine. It calls
gettimeofday() repeatedly. Then it prints out the value of each call
and the differences between each call & the previous.  On our 712, the
diffs are typically all ~~ 14 microseconds. Since this is < 1
millisec, QUANTUM should be defined as 1 (this is the default and the
smallest diff that mdate can measure even in principle). On our SUNS
(3/60) most of the diffs are 1 but some are ~~20000. Each large diff
goes with a time value that is an exact multiple of 20000. This means
that the system clock only moves every 20 msec, but each call of
gettimeofday() advances the microsecond counter by 1 unit irrespective
of how much time has actually passed. So the correct QUANTUM is 20.

Other things you might need to edit in  site.h  are:

OLDGETHOST Indicates that gethostbyname() returns just one address: 
	modern versions return a pointer to a list.

OLDSELECT Indicates that select() lacks the supplementary macros
	fd_set (etc) that construct suitable bitmasks.

NORANDOM, NOADJTIME  Indicate that these are lacking. 

Then edit Makefile to reflect the install directories, etc: then

make mdate
make install