The ntp_adjtime function sets the structure specified by
tptr to current values.
In addition, ntp_adjtime updates some settings to match what you
pass to it in *tptr. Use the modes element of *tptr
to select what settings to update. You can set offset ,
freq , maxerror , esterror , status ,
constant , and tick .
modes = zero means set nothing.
Only the superuser can update settings.
The return value is 0 on success and other values on failure. The
following errno error conditions are defined for this function:
TIME_ERROR
- The high accuracy clock model is not properly set up at the moment, thus the
clock must be considered unsynchronized, and the values should be
treated with care. Another reason could be that the specified new values
are not allowed.
EPERM
- The process specified a settings update, but is not superuser.
For more details see RFC1305 (Network Time Protocol, Version 3) and
related documents.
Portability note: Early versions of the GNU C library did not
have this function but did have the synonymous adjtimex .
|