Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ adjtime(2) — DG/UX 5.4R3.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

date(1)

gettimeofday(2)



adjtime(2)                     DG/UX 5.4R3.00                     adjtime(2)


NAME
       adjtime - correct the time to allow synchronization of the system
       clock

SYNOPSIS
       #include <sys/time.h>

       adjtime(delta, olddelta)
       struct timeval *delta;
       struct timeval *olddelta;

   where:
       delta     The name of a structure containing a number of seconds
       olddelta  The name of a structure containing a number of seconds

DESCRIPTION
       Adjtime makes small adjustments to the system time, as returned by
       gettimeofday(2), advancing or retarding it by the amount of time
       specified by the struct timeval pointed to by delta.  The adjustment
       is gradual.  If *delta represents a negative adjustment, the clock is
       slowed down by incrementing it more slowly than normal until the
       correction is complete.  If *delta represents a positive adjustment,
       the correction is achieved by using a larger than normal increment.

       Specify a positive adjustment by placing a non-negative number of
       seconds in delta->tvsec and a number of microseconds between 0 and
       999999 (inclusive) in delta->tvusec.  Specify a negative adjustment
       by placing a negative number of seconds in delta->tvsec and a number
       of microseconds between 0 and 999999 (inclusive) in delta->tvusec.
       Note that the number of microseconds must always be non-negative and
       always acts to widen an advancement or to shorten a delay.  For
       instance, to indicate a delay of 0.7 seconds, place -1 into
       delta->tvsec and 300000 into delta->tvusec.  To indicate an
       advancement of 7.22 seconds, place 7 into delta->tvsec and 220000
       into delta->tvusec.

       A time correction from an earlier call to adjtime may not be finished
       when adjtime is called again.  In this case, the previous time
       correction is aborted.  Further, if olddelta is not NULL, then the
       struct timeval it points to will contain, upon return, the number of
       microseconds which were still to be corrected from the earlier call.

       Note also that setting the time of day does not cancel any time
       adjustments in progress.

       This call may be used by time servers that synchronize the clocks of
       computers in a local area network.  Such time servers would slow down
       the clocks of some machines and speed up the clocks of others to
       bring them to the average network time.

ACCESS CONTROL
       The effective user id of the calling process must be superuser.





Licensed material--property of copyright holder(s)                         1




adjtime(2)                     DG/UX 5.4R3.00                     adjtime(2)


RETURN VALUE
       0      The call succeeded.

       -1     An error occurred; an error code is stored in the global
              variable errno.

DIAGNOSTICS
       The following error codes may be set in errno:

       EFAULT    An argument points outside the process's allocated address
                 space.

       EPERM     The process's effective user id is not that of the
                 superuser.

SEE ALSO
       date(1), gettimeofday(2).








































Licensed material--property of copyright holder(s)                         2


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026