ADJTIMEX
adjtimex - tune kernel clock
#include <sys/time> int adjtimex(struct timex *buf);__
Linux uses David L. Mills' clock adjustment algorithm (see RFC 1305). The system call adjtimex reads and optionally sets adjustment parameters for this algorithm. It takes a pointer to a timex structure, updates kernel parameters from field values, and returns the same structure with current kernel values. This structure is declared as
struct timex {
int modes; /* mode selector / long offset; / time offset (usec) / long freq; / frequency offset (scaled ppm) / long maxerror; / maximum error (usec) / long esterror; / estimated error (usec) / int status; / clock command/status / long constant; / pll time constant / long precision; / clock precision (usec) (read only) / long tolerance; / clock frequency tolerance (ppm) (read only) / struct timeval time; / current time (read only) / long tick; / usecs between clock ticks */
};
The modes field determines which parameters, if any, to set. It may contain a bitwise-or combination of
Ordinary users are restricted to a zero value for mode. Only the superuser may set any parameters.
On failure, adjtimex returns -1 and sets errno.
adjtimex is Linux specific and should not be used in programs intended to be portable. There is a similar but less general call adjtime in SVr4.
4 pages link to adjtimex(2):