adjtime(2) DG/UX 4.30 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;
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->tv_sec and a number of
microseconds between 0 and 999999 (inclusive) in
delta->tv_usec. Specify a negative adjustment by placing a
negative number of seconds in delta->tv_sec and a number of
microseconds between 0 and 999999 (inclusive) in
delta->tv_usec. 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->tv_sec
and 300000 into delta->tv_usec. To indicate an advancement
of 7.22 seconds, place 7 into delta->tv_sec and 220000 into
delta->tv_usec.
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.
Licensed material--property of copyright holder(s) Page 1
adjtime(2) DG/UX 4.30 adjtime(2)
ACCESS CONTROL
The effective user id of the calling process must be
superuser.
RETURN VALUE
A return value of 0 indicates that the call succeeded. A
return value of -1 indicates that an error occurred, and in
this case an error code is stored in the global variable
errno.
ERRORS
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 super-user.
SEE ALSO
date(1), gettimeofday(2).
Licensed material--property of copyright holder(s) Page 2