adjtime(SSC) 6 January 1993 adjtime(SSC) Name adjtime - correct the time to allow synchronization of the system clock Syntax #include <sys/time.h> adjtime(delta, olddelta) struct timeval *delta; struct timeval *olddelta; Description adjtime makes adjustments to the system time, as returned by gettimeofday(SSC), advancing or retarding it by the time specified by the timeval delta. If delta is negative, the clock is slowed down. If delta is positive, the clock is set ahead. The structure pointed to will con- tain, upon return, the number of microseconds still to be corrected from the earlier call. adjtime is intended for making adjustments in small increments; there- fore, the time adjustment specified by delta should be less than or equal to 20 seconds. This call may be used by time servers that synchronize the clocks of com- puters 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 call adjtime(SSC) is restricted to the super-user. Return value A return value of zero 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. Note Implementations with poor control over the system clock will always return a zero timeval for olddelta. The time adjustment to be made may be incorrectly calculated if the time adjustment specified by delta is greater than 20 seconds. See also date(C), gettimeofday(SSC), rdate(ADMN), timed(ADMN) and timedc(ADMN).