My Linux kernel version is 2.6.35.7 and it doesn't seem to have the 
implementation of syscall for __NR_clock_adjtime. In which kernel version was 
it initially introduced?

I changed the function clock_adjtime() to use adjtimex() as shown in the 
following. Would that work fine when it's called to perform a clock step (with 
the modes ADJ_SETOFFSET bit set) and slewing? Is it better to use 
settimeofday() to step the clock? My system runs ptp4l in software timestamping 
mode.

#ifndef HAVE_CLOCK_ADJTIME
static inline int clock_adjtime(clockid_t id, struct timex *tx)
{
        // return syscall(__NR_clock_adjtime, id, tx);
        return adjtimex(tx);
}
#endif

The adjtimex() function does not have the clock id parameter. I'm unclear how 
to deal with it. In my debugging messages, I've only seen CLOCK_REALTIME whose 
Id is 0 which is the clock that adjtimex() applies to. Is clock_adjtime() 
executed in some case for other clock id such as CLOCK_MONOTONIC?

Thanks,
Daniel


------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to