Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ adjtime(2) — DG/UX R4.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

date(1)

gettimeofday(2,)



adjtime(2)                        SDK R4.11                       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.

       The rate at which the system clock is adjusted can be controlled by
       setting the parameter ADJTIMEDIVISOR in the system file when
       building a kernel.  This is documented in the master file
       (/usr/etc/master.d/dgux).

ACCESS CONTROL
       The calling process must have appropriate privilege to successfully
       execute this system call.

       On a generic DG/UX system, appropriate privilege is granted by having
       an effective UID of 0 (root). See the appropriateprivilege(5) man
       page for more information.

       On a system with DG/UX information security, appropriate privilege is
       granted by having one or more specific capabilities enabled in the
       effective capability set of the user.  See capdefaults(5) for the
       default capabilities for this command.

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 calling process does not have appropriate privilege.

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


Licensed material--property of copyright holder(s)

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