ntp_gettime - get local clock values
#include <sys/timex.h> int ntp_gettime(struct ntptimeval *tptr);
The ntp_gettime() function reads the local clock value and dispersion, returning the information in tptr.
The ntptimeval structure contains the following members:
struct ntptimeval { struct timeval time; /* current time (ro) */ int32_t maxerror; /* maximum error (us) (ro) */ int32_t esterror; /* estimated error (us) (ro) */ };
Upon successful completion, ntp_gettime() returns the current clock state (see <sys/timex.h>). Otherwise, it returns -1 and sets errno to indicate the error.
The ntp_gettime() function will fail if:
EFAULT
The ntp_gettime() function will fail for 32-bit interfaces if:
EOVERFLOW
xntpd(1M), ntp_adjtime(2)
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |