1 .\" Copyright (c) 2006 by Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .TH ADJTIME 3 2017-09-15 "Linux" "Linux Programmer's Manual"
27 adjtime \- correct the time to synchronize the system clock
30 .B #include <sys/time.h>
32 .BI "int adjtime(const struct timeval *" delta ", struct timeval *" olddelta );
36 Feature Test Macro Requirements for glibc (see
37 .BR feature_test_macros (7)):
43 Glibc 2.19 and earlier:
48 function gradually adjusts the system clock (as returned by
49 .BR gettimeofday (2)).
50 The amount of time by which the clock is to be adjusted is specified
51 in the structure pointed to by
53 This structure has the following form:
58 time_t tv_sec; /* seconds */
59 suseconds_t tv_usec; /* microseconds */
66 is positive, then the system clock is speeded up by some
67 small percentage (i.e., by adding a small
68 amount of time to the clock value in each second) until the adjustment
72 is negative, then the clock is slowed down in a similar fashion.
74 If a clock adjustment from an earlier
76 call is already in progress
77 at the time of a later
81 is not NULL for the later call, then the earlier adjustment is stopped,
82 but any already completed part of that adjustment is not undone.
86 is not NULL, then the buffer that it points to is used to return
87 the amount of time remaining from any previous adjustment that
88 has not yet been completed.
93 On failure, \-1 is returned, and
95 is set to indicate the error.
101 is outside the permitted range.
104 The caller does not have sufficient privilege to adjust the time.
107 capability is required.
109 For an explanation of the terms used in this section, see
115 Interface Attribute Value
118 T} Thread safety MT-Safe
125 makes to the clock is carried out in such a manner that the clock
126 is always monotonically increasing.
129 to adjust the time prevents the problems that can be caused for certain
132 by abrupt positive or negative jumps in the system time.
135 is intended to be used to make small adjustments to the system time.
136 Most systems impose a limit on the adjustment that can be specified in
138 In the glibc implementation,
140 must be less than or equal to (INT_MAX / 1000000 \- 2)
141 and greater than or equal to (INT_MIN / 1000000 + 2)
142 (respectively 2145 and \-2145 seconds on i386).
145 .\" http://sourceware.org/bugzilla/show_bug?id=2449
146 .\" http://bugzilla.kernel.org/show_bug.cgi?id=6761
149 was specified as NULL,
150 no valid information about the outstanding clock adjustment was returned in
152 (In this circumstance,
154 should return the outstanding clock adjustment, without changing it.)
156 .\" Thanks to the new adjtimex() ADJ_OFFSET_SS_READ flag
157 on systems with glibc 2.8 or later and
158 Linux kernel 2.6.26 or later.
161 .BR gettimeofday (2),