[ntp:hackers] kern_ntptime and FreeBSD 6.1

David L. Mills mills at udel.edu
Thu Jan 18 12:25:08 PST 2007


Your attachment was eaten by our virus filters.

I wrote the original ntptime some years ago, but apparently busy fingers 
have hideously transformed it. I wrote the kernel code as well, but 
others might have broken that. As per spec in the timex.h header file, 
the NTP kernel code does not return a negative number, except possibly 
in case of root violation or copyin/copyout problem. As specified in the 
timex.h header file, it returns an integer 0 - 5 rpresenting the leap 
condition, with 5 reserved for error.

The error return of 5 was purposely chosen to be non-negative, as the 
intended action is to inspect the status word returned by the call. This 
leaves room for the operating system to intercede with one of its own 
codes. Therefore, a negatie return indicates a kernel problem, not a NTP 


M. Warner Losh wrote:

> btw, it looks like opensolaris returns -1 on fault conditions and much
> of the ntp code assumes that < 0 is an error...  The enclosed patch
> will fix that.
> Warner

More information about the hackers mailing list