{"id":7078,"date":"2022-12-20T19:35:12","date_gmt":"2022-12-20T22:35:12","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/adjtime-man3\/"},"modified":"2022-12-20T19:35:12","modified_gmt":"2022-12-20T22:35:12","slug":"adjtime-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/adjtime-man3\/","title":{"rendered":"ADJTIME (man3)"},"content":{"rendered":"<h1 align=\"center\">ADJTIME<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#RETURN VALUE\">RETURN VALUE<\/a><br \/> <a href=\"#ERRORS\">ERRORS<\/a><br \/> <a href=\"#ATTRIBUTES\">ATTRIBUTES<\/a><br \/> <a href=\"#CONFORMING TO\">CONFORMING TO<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a><br \/> <a href=\"#BUGS\">BUGS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#COLOPHON\">COLOPHON<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">adjtime \u2212 correct the time to synchronize the system clock<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>#include <sys\/time.h><\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>int adjtime(const struct timeval *<\/b><i>delta<\/i><b>, struct timeval *<\/b><i>olddelta<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:5%; margin-top: 1em\">Feature Test Macro Requirements for glibc (see <b>feature_test_macros<\/b>(7)):<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>adjtime<\/b>(): <br \/> Since glibc 2.19: <br \/> _DEFAULT_SOURCE <br \/> Glibc 2.19 and earlier: <br \/> _BSD_SOURCE<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>adjtime<\/b>() function gradually adjusts the system clock (as returned by <b>gettimeofday<\/b>(2)). The amount of time by which the clock is to be adjusted is specified in the structure pointed to by <i>delta<\/i>. This structure has the following form:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">struct timeval { <br \/> time_t tv_sec; \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var seconds bodies\/ usr\/ <br \/> suseconds_t tv_usec; \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var microseconds bodies\/ usr\/ <br \/> };<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If the adjustment in <i>delta<\/i> is positive, then the system clock is speeded up by some small percentage (i.e., by adding a small amount of time to the clock value in each second) until the adjustment has been completed. If the adjustment in <i>delta<\/i> is negative, then the clock is slowed down in a similar fashion.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If a clock adjustment from an earlier <b>adjtime<\/b>() call is already in progress at the time of a later <b>adjtime<\/b>() call, and <i>delta<\/i> is not NULL for the later call, then the earlier adjustment is stopped, but any already completed part of that adjustment is not undone.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If <i>olddelta<\/i> is not NULL, then the buffer that it points to is used to return the amount of time remaining from any previous adjustment that has not yet been completed.<\/p>\n<h2>RETURN VALUE <a name=\"RETURN VALUE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">On success, <b>adjtime<\/b>() returns 0. On failure, \u22121 is returned, and <i>errno<\/i> is set to indicate the error.<\/p>\n<h2>ERRORS <a name=\"ERRORS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p style=\"margin-top: 1em\"><b>EINVAL<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p style=\"margin-top: 1em\">The adjustment in <i>delta<\/i> is outside the permitted range.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>EPERM<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>The caller does not have sufficient privilege to adjust the time. Under Linux, the <b>CAP_SYS_TIME<\/b> capability is required.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>ATTRIBUTES <a name=\"ATTRIBUTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">For an explanation of the terms used in this section, see <b>attributes<\/b>(7).<\/p>\n<p align=\"center\" style=\"margin-top: 1em\"><img decoding=\"async\" src=\"grohtml-1566631.png\" alt=\"Image grohtml-1566631.png\"><\/p>\n<h2>CONFORMING TO <a name=\"CONFORMING TO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">4.3BSD, System V.<\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The adjustment that <b>adjtime<\/b>() makes to the clock is carried out in such a manner that the clock is always monotonically increasing. Using <b>adjtime<\/b>() to adjust the time prevents the problems that can be caused for certain applications (e.g., <b>make<\/b>(1)) by abrupt positive or negative jumps in the system time.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>adjtime<\/b>() is intended to be used to make small adjustments to the system time. Most systems impose a limit on the adjustment that can be specified in <i>delta<\/i>. In the glibc implementation, <i>delta<\/i> must be less than or equal to (INT_MAX \/ 1000000 \u2212 2) and greater than or equal to (INT_MIN \/ 1000000 + 2) (respectively 2145 and \u22122145 seconds on i386).<\/p>\n<h2>BUGS <a name=\"BUGS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">A longstanding bug meant that if <i>delta<\/i> was specified as NULL, no valid information about the outstanding clock adjustment was returned in <i>olddelta<\/i>. (In this circumstance, <b>adjtime<\/b>() should return the outstanding clock adjustment, without changing it.) This bug is fixed on systems with glibc 2.8 or later and Linux kernel 2.6.26 or later.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>adjtimex<\/b>(2), <b>gettimeofday<\/b>(2), <b>time<\/b>(7)<\/p>\n<h2>COLOPHON <a name=\"COLOPHON\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This page is part of release 5.10 of the Linux <i>man-pages<\/i> project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https:\/\/www.kernel.org\/doc\/man\u2212pages\/.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  adjtime \u2212 correct the time to synchronize the system clock <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2536],"tags":[2538,3422,3007],"class_list":["post-7078","post","type-post","status-publish","format-standard","hentry","category-3-llamadas-de-bibliotecas","tag-2538","tag-adjtime","tag-man3"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=7078"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7078\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7078"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7078"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}