2 .\" Copyright (c) 2006 by Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .TH adjtime 3 (date) "Linux man-pages (unreleased)"
8 adjtime \- correct the time to synchronize the system clock
11 .RI ( libc ", " \-lc )
14 .B #include <sys/time.h>
16 .BI "int adjtime(const struct timeval *" delta ", struct timeval *" olddelta );
20 Feature Test Macro Requirements for glibc (see
21 .BR feature_test_macros (7)):
28 glibc 2.19 and earlier:
34 function gradually adjusts the system clock (as returned by
35 .BR gettimeofday (2)).
36 The amount of time by which the clock is to be adjusted is specified
37 in the structure pointed to by
39 This structure has the following form:
44 time_t tv_sec; /* seconds */
45 suseconds_t tv_usec; /* microseconds */
52 is positive, then the system clock is speeded up by some
53 small percentage (i.e., by adding a small
54 amount of time to the clock value in each second) until the adjustment
58 is negative, then the clock is slowed down in a similar fashion.
60 If a clock adjustment from an earlier
62 call is already in progress
63 at the time of a later
67 is not NULL for the later call, then the earlier adjustment is stopped,
68 but any already completed part of that adjustment is not undone.
72 is not NULL, then the buffer that it points to is used to return
73 the amount of time remaining from any previous adjustment that
74 has not yet been completed.
79 On failure, \-1 is returned, and
81 is set to indicate the error.
87 is outside the permitted range.
90 The caller does not have sufficient privilege to adjust the time.
93 capability is required.
95 For an explanation of the terms used in this section, see
103 Interface Attribute Value
106 T} Thread safety MT-Safe
116 makes to the clock is carried out in such a manner that the clock
117 is always monotonically increasing.
120 to adjust the time prevents the problems that can be caused for certain
123 by abrupt positive or negative jumps in the system time.
126 is intended to be used to make small adjustments to the system time.
127 Most systems impose a limit on the adjustment that can be specified in
129 In the glibc implementation,
131 must be less than or equal to (INT_MAX / 1000000 \- 2)
132 and greater than or equal to (INT_MIN / 1000000 + 2)
133 (respectively 2145 and \-2145 seconds on i386).
136 .\" http://sourceware.org/bugzilla/show_bug?id=2449
137 .\" http://bugzilla.kernel.org/show_bug.cgi?id=6761
140 was specified as NULL,
141 no valid information about the outstanding clock adjustment was returned in
143 (In this circumstance,
145 should return the outstanding clock adjustment, without changing it.)
147 .\" Thanks to the new adjtimex() ADJ_OFFSET_SS_READ flag
148 on systems with glibc 2.8 or later and
149 Linux kernel 2.6.26 or later.
152 .BR gettimeofday (2),