[ntp:questions] ntpd code

mayer at gis.net mayer at gis.net
Wed Mar 23 16:27:38 UTC 2005

----- Original Message Follows -----
> Hi,
> I am trying to modify some portion of NTP source code to maintain a
> high  resolution, precise (as far as NTP goes) logical clock instead
> of modifying  the system clock of the user (as it may not have
> necessary privileges doing  so)... You can view it as intercepting the
> system calls from NTP to  manipulate a software clock; I am not sure
> how successful it would be... The  development and testing environment
> is strictly Windows...

I'm not sure I understand this at all. Why wouldn't you be running this
as a service with the right privileges? If you want to intercept
system calls you probably need privileges anyway (I haven't looked at
the code to verify this). ntpd IS a high resolution precise logical
already. What is it that you are trying to achieve?

> I have observed two points in the source code by now...
> Is there a reason for the latest 4.2.0 version not using ClockThread
> (in  nt_clockstuff.c) for clock interpolation (high resolution clock
> read)? I  couldnot find a place calling StartClockThread()...
> Also, I believe developers/maintainers are already aware, but I am
> guessing  at method service_exit() in ntpd.c source file, the IF logic
> should read
> (!debug && NoWinService == FALSE)
> otherwise, it would result in error if we were to start the ntpd so as
> not  to run as a Windows service.

You appear to be looking at a rather old version of the source code.
You should get the latest snapshot and use that. StartClockThread()
is in ntclockstuff.c and that logical statement is in ntservice.c in
service_exit. It's not in ntpd.c. The condition is: if (!foreground)
rather than the above.

> Regards,
> -Kemal. 
> _______________________________________________
> questions mailing list
> questions at lists.ntp.isc.org
> https://lists.ntp.isc.org/mailman/listinfo/questions

More information about the questions mailing list