# include <poll.h>
#endif
+#ifndef STA_NANO
+# define STA_NANO 0x2000
+#endif
+
static const char *config_keys[] =
{
"Host",
int i;
/* On Linux, if the STA_NANO bit is set in ik->status, then ik->offset
- * is is nanoseconds, otherwise it's microseconds.
- * TODO(octo): STA_NANO is defined in the Linux specific <sys/timex.h> header. */
+ * is is nanoseconds, otherwise it's microseconds. */
double scale_loop = 1e-6;
double scale_error = 1e-6;
return (-1);
}
+ if (ntohs(ik->status) & STA_NANO) {
+ scale_loop = 1e-9;
+ scale_error = 1e-9;
+ }
+
/* kerninfo -> estimated error */
offset_loop = scale_loop * ((gauge_t) ntohl (ik->offset));
freq_loop = ntpd_read_fp (ik->freq);