BSD 4_3_Tahoe development
[unix-history] / usr / man / cat2 / adjtime.0
ADJTIME(2) UNIX Programmer's Manual ADJTIME(2)
N\bNA\bAM\bME\bE
adjtime - correct the time to allow synchronization of the
system clock
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
#\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<s\bsy\bys\bs/\b/t\bti\bim\bme\be.\b.h\bh>\b>
a\bad\bdj\bjt\bti\bim\bme\be(\b(d\bde\bel\blt\bta\ba,\b, o\bol\bld\bdd\bde\bel\blt\bta\ba)\b)
s\bst\btr\bru\buc\bct\bt t\bti\bim\bme\bev\bva\bal\bl *\b*d\bde\bel\blt\bta\ba;\b;
s\bst\btr\bru\buc\bct\bt t\bti\bim\bme\bev\bva\bal\bl *\b*o\bol\bld\bdd\bde\bel\blt\bta\ba;\b;
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
_\bA_\bd_\bj_\bt_\bi_\bm_\be makes small adjustments to the system time, as
returned by _\bg_\be_\bt_\bt_\bi_\bm_\be_\bo_\bf_\bd_\ba_\by(2), advancing or retarding it by
the time specified by the timeval _\bd_\be_\bl_\bt_\ba. If _\bd_\be_\bl_\bt_\ba is nega-
tive, the clock is slowed down by incrementing it more
slowly than normal until the correction is complete. If
_\bd_\be_\bl_\bt_\ba is positive, a larger increment than normal is used.
The skew used to perform the correction is generally a frac-
tion of one percent. Thus, the time is always a monotoni-
cally increasing function. A time correction from an ear-
lier call to _\ba_\bd_\bj_\bt_\bi_\bm_\be may not be finished when _\ba_\bd_\bj_\bt_\bi_\bm_\be is
called again. If _\bo_\bl_\bd_\bd_\be_\bl_\bt_\ba is non-zero, then the structure
pointed to will contain, upon return, the number of
microseconds still to be corrected from the earlier call.
This call may be used by time servers that synchronize the
clocks of computers 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 _\ba_\bd_\bj_\bt_\bi_\bm_\be(2) is restricted to the super-user.
R\bRE\bET\bTU\bUR\bRN\bN V\bVA\bAL\bLU\bUE\bE
A return value of 0 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
_\be_\br_\br_\bn_\bo.
E\bER\bRR\bRO\bOR\bRS\bS
The following error codes may be set in _\be_\br_\br_\bn_\bo:
[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.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
date(1), gettimeofday(2), timed(8), timedc(8),
_\bT_\bS_\bP: _\bT_\bh_\be _\bT_\bi_\bm_\be _\bS_\by_\bn_\bc_\bh_\br_\bo_\bn_\bi_\bz_\ba_\bt_\bi_\bo_\bn _\bP_\br_\bo_\bt_\bo_\bc_\bo_\bl _\bf_\bo_\br _\bU_\bN_\bI_\bX _\b4._\b3_\bB_\bS_\bD, R.
Printed 7/9/88 July 9, 1988 1
ADJTIME(2) UNIX Programmer's Manual ADJTIME(2)
Gusella and S. Zatti
Printed 7/9/88 July 9, 1988 2