Daniel Le
2015-06-23 22:06:20 UTC
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
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