NTPDATE for VMS

   This file contains the instructions for building ntpdate for VMS. 
Ntpdate performs a function similar to its Unix counter part.  It is a
program which polls one or more ntp servers and sets the system time
according to the selected server.

System Requirements

   Ntpdate has been compiled with VAXC and successfully tested under
VMS 5.x, VMS 6.1, UCX 2.x, and UCX 3.1.

Building ntpdate

1. Edit config.h and change the values of the defines to describe your
   time zone and Daylight Savings Time policy.

2. Create a link options file (e.g. link.opts) with the lines

      sys$library:ucx$ipc.olb/lib
      sys$share:vaxcrtl.exe/share

3. Compile ntpdate for VAX or AXP

      cc ntpdate                    ! For VMS on VAX
      cc/standard=vaxc ntpdate      ! Avoid annoying messages on AXP

4. Link ntpdate

      link ntpdate, link.opts/opt

5. Define ntpdate as a foreign command and test it with query mode

      ntpdate == "$<directory>ntpdate"
      ntpdate -q <ntpserver address>

   For example,

      $ ntpdate -q foo.bar.com

      Server foo.bar.com (123.456.789), stratum 3
      offset -0.2093049, delay +0.0409133
      Selected server is foo.bar.com (123.456.789) offset -0.2093049

   The offset is the number of seconds that should be added to the local
machine in order to be synchronized with the server.  To set the time,
run ntpdate without the -q switch and with the names of one or more
servers.  In order to successfully set system time, the user must have
LOG_IO and OPER privileges.  To see the command line options, type
"ntpdate" without any other arguments.

Discussion

   Hopefully your campus or enterprise already has 2 or 3 local ntp
servers with which you may synchronize the time.  If they are not
available, ntp servers on the Internet should be listed in clock 
documentation which may be found at the location where you obtained this
software.
   After running ntpdate, the time could be accurate to within 10
milliseconds, all things being equal.  However, VMS does not provide a
method to compensate for clock drift.  How often you run ntpdate depends
on your tolerance, but it shouldn't be necessary to run it more often
than once an hour.  Once a night in a batch file might be sufficient for
many people.
   Queued every morning at 2:01 a.m., ntpdate will update the time and
also adjust for Daylight Savings Time according the rules in the
configuration file.  Be aware that some programs and/or people do not
like a sudden, one-hour time warp.  If that is the case for you, you
will need to phase in the time adjustment by hand and then use ntpdate.
