Skip to contentSkip to conversation

question about linux time change

DISCUSSION Chris Friesen 2 participants 3 messages Oct 7, 2004 – Oct 13, 2004

lore
Share & tools
lore
#0 lore raw

I have been asked to add the ability to notify userspace when the time of day changes. The actual notification is the easy part. I'm having issues with where exactly the time is really changed.

do_settimeofday() is pretty straightforward. No problems there. adjtimex() with ADJ_OFFSET_SINGLESHOT mode seems reasonable as well.

adjtimex() with ADJ_OFFSET is a bit harder to follow. Can you give me any pointers on what's going on with ADJ_OFFSET?

Thanks,

Chris

#1 lore raw
Quoted 2 lines · Chris Friesen

I have been asked to add the ability to notify userspace when the time of day changes. The actual notification is the easy part. I'm having issues with where exactly the time is really changed.

Just what sort of time changes do you want to notify on? The ntp code "drifts" time a lot. Do you want to know about this? If it is only cases where there is a jump in time, you might do well to look at "clock_was_set()". It is in kernel/posix-timers.c and is called when ever do_settimeofday() is called AND on leap second calls.

You will even find code in there to push the ladder out of the softirq context.

Quoted 11 lines

do_settimeofday() is pretty straightforward. No problems there. adjtimex() with ADJ_OFFSET_SINGLESHOT mode seems reasonable as well.

adjtimex() with ADJ_OFFSET is a bit harder to follow. Can you give me any pointers on what's going on with ADJ_OFFSET?

Thanks,

Chris

Signature · 3 lines
George Anzinger   [email protected]
High-res-timers:  http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml
#2 lore raw
Quoted 9 lines · George Anzinger
Quoted 2 lines · Chris Friesen

I have been asked to add the ability to notify userspace when the time of day changes. The actual notification is the easy part. I'm having issues with where exactly the time is really changed.

Just what sort of time changes do you want to notify on? The ntp code "drifts" time a lot. Do you want to know about this? If it is only cases where there is a jump in time, you might do well to look at "clock_was_set()". It is in kernel/posix-timers.c and is called when ever do_settimeofday() is called AND on leap second calls.

You will even find code in there to push the ladder out of the softirq context.

Cool. Will do.

Chris