[ntp:questions] Using ntpd with custom clock

Brian Utterback brian.utterback at oracle.com
Tue Oct 16 20:11:11 UTC 2012

On 10/16/12 13:40, Chuck Swiger wrote:
> Hi--
> On Oct 15, 2012, at 10:51 AM, Felipe Blauth wrote:
>> Hello.
>> I'd like to build a custom version of ntpd with a single change: instead
>> of synchronizing with operating system clock, it would synchronize with a
>> custom clock.
> OK; ntpd is designed to do exactly that via refclock drivers.
> ntpd doesn't normally sync to the OS clock, unless you insist by using the
> local clock driver (which isn't recommended).
>> I can mimic operating system calls (like gettimeofday and settimeofday).
> That's OK-- you won't need to.
>> I'm just starting out and would appreciate some directions on doing this.
>> If someone could point me a file or a function, it would be of great help.
> http://www.eecis.udel.edu/~mills/ntp/html/refclock.html
> http://www.eecis.udel.edu/~mills/ntp/html/howto.html
> Regards,

I think the original poster is asking to do something a little bit 
different than the usual. If I am reading it right, he is not asking how 
to get ntpd to read a custom clock as a source of time (which as noted 
is what a refclock is for). I think he is asking how to get ntpd to 
*set* a custom clock, treating it as it would the system clock, so as to 
sync the custom clock with the upstream NTP server time.

Brian Utterback


Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live. - Martin Golding
Brian Utterback - Solaris RPE, Oracle Corporation.
Ph:603-262-3916, Em:brian.utterback at oracle.com

More information about the questions mailing list