OpenBSD manual page server

Manual Page Search Parameters

ADJFREQ(2) System Calls Manual ADJFREQ(2)

adjfreqcorrect the rate of the system clock

#include <sys/types.h>
#include <sys/time.h>

adjfreq(const int64_t *freq, int64_t *oldfreq);

() adjusts the rate in which time progresses if freq is non-null. The unit of the rate of adjustment is nanoseconds per second, shifted left 32 bits to allow for fractional values.

If oldfreq is non-null, the current value is returned.

Only the superuser may adjust the frequency.

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 errno.

adjfreq() will fail if:

Either of the arguments point outside the process's allocated address space.
The freq argument is non-null and the process's effective user ID is not that of the superuser.

date(1), adjtime(2), gettimeofday(2), ntpd(8)

The adjfreq() function call first appeared in OpenBSD 4.0.

July 7, 2011 OpenBSD-5.3