1ADJTIME(2)                    System Calls Manual                   ADJTIME(2)
2
3
4

NAME

6       adjtime - correct the time to allow synchronization of the system clock
7

SYNOPSIS

9       #include <sys/time.h>
10
11       adjtime(delta, olddelta)
12       struct timeval *delta;
13       struct timeval *olddelta;
14

DESCRIPTION

16       Adjtime makes small adjustments to the system time, as returned by get‐
17       timeofday(2), advancing or retarding it by the time  specified  by  the
18       timeval  delta.   If  delta  is  negative,  the clock is slowed down by
19       incrementing it more slowly than normal until the  correction  is  com‐
20       plete.   If  delta is positive, a larger increment than normal is used.
21       The skew used to perform the correction is generally a fraction of  one
22       percent.  Thus, the time is always a monotonically increasing function.
23       A time correction from an earlier call to adjtime may not  be  finished
24       when adjtime is called again.  If olddelta is non-zero, then the struc‐
25       ture pointed to will contain, upon return, the number  of  microseconds
26       still to be corrected from the earlier call.
27
28       This  call  may  be used by time servers that synchronize the clocks of
29       computers in a local area network.  Such time servers would  slow  down
30       the  clocks of some machines and speed up the clocks of others to bring
31       them to the average network time.
32
33       The call adjtime(2) is restricted to the super-user.
34

RETURN VALUE

36       A return value of 0 indicates that the call succeeded.  A return  value
37       of  -1 indicates that an error occurred, and in this case an error code
38       is stored in the global variable errno.
39

ERRORS

41       The following error codes may be set in errno:
42
43       [EFAULT]       An  argument  points  outside  the  process's  allocated
44                      address space.
45
46       [EPERM]        The  process's  effective  user  ID  is  not that of the
47                      super-user.
48

SEE ALSO

50       date(1), gettimeofday(2), timed(8), timedc(8),
51       TSP: The Time Synchronization Protocol for UNIX 4.3BSD, R. Gusella  and
52       S. Zatti
53

NOTES (PDP-11)

55       Adjtime(2)  calls  are executed immediately, not over a period of time,
56       therefore, the olddelta return  values  for  an  adjtime(2)  call  will
57       always be zero.
58
59
60
614.3 Berkeley Distribution        May 15, 1986                       ADJTIME(2)
Impressum