Skip to contentSkip to conversation

NTP leap second question

DISCUSSION [email protected] 3 participants 5 messages Sep 14, 2005 – Sep 17, 2005

lore
Share & tools
lore
#0 lore raw

The simplest way to achieve this is to:
a) Hack ntpd to "not notice" the leap-second announce bits 01 in the packet header and pretend they're actually 00. This will make it not insert a leap second.
b) Run it with the -x flag so that it always slews the time.

The real solution would be to implement Markus Kuhn's UTS proposal
(http://www.cl.cam.ac.uk/~mgk25/uts.txt), which is about the most reasonable meshing of the expectation that there are 86400 seconds per day with the fact that there are not.

#1 lore raw
Quoted 4 lines · [email protected] wrote:

The simplest way to achieve this is to:
a) Hack ntpd to "not notice" the leap-second announce bits 01 in the packet header and pretend they're actually 00. This will make it not insert a leap second.

Would a rude and crude way to do this be to shut down ntpd at say 11:55PM and restart it at 00:01?

What I am asking is when is the flag sent to the kernel. My reading of the kernel code says that it will insert the second on the second roll immeadiatly after the flag is set.

Quoted 12 lines

b) Run it with the -x flag so that it always slews the time.

The real solution would be to implement Markus Kuhn's UTS proposal
(http://www.cl.cam.ac.uk/~mgk25/uts.txt), which is about the most reasonable meshing of the expectation that there are 86400 seconds per day with the fact that there are not.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 2 lines
George Anzinger   [email protected]
HRT (High-res-timers):  http://sourceforge.net/projects/high-res-timers/
#2 lore raw
Quoted 3 lines · George Anzinger

What I am asking is when is the flag sent to the kernel. My reading of the kernel code says that it will insert the second on the second roll immeadiatly after the flag is set.

Kernel clock ticks are not adjusted or slewed or anything else for a leap second when correctly configured. UTC leap second adjustment is performed by glibc for locales that expect it (which I think is all of them)

Alan

#3 lore raw
Quoted 9 lines · Alan Cox
Quoted 1 line · George Anzinger

What I am asking is when is the flag sent to the kernel. My reading of the kernel code says that it will insert the second on the second roll immeadiatly after the flag is set.

Kernel clock ticks are not adjusted or slewed or anything else for a leap second when correctly configured. UTC leap second adjustment is performed by glibc for locales that expect it (which I think is all of them)

Eh?? Then what is one to make of the code in timer.c that add leapseconds? It seems to be controlled by the adjtime() system call.

Sure looks like it sets the system clock (xtime) ahead or back by a second at midnight if the flag is set to do so.

Signature · 2 lines
George Anzinger   [email protected]
HRT (High-res-timers):  http://sourceforge.net/projects/high-res-timers/
#4 lore raw
Quoted 5 lines

Eh?? Then what is one to make of the code in timer.c that add leapseconds? It seems to be controlled by the adjtime() system call.

Sure looks like it sets the system clock (xtime) ahead or back by a second at midnight if the flag is set to do so.

Yes it supports that - but since nobody runs the system clock in GMT it should never be getting set by any caller. At least as far as I can see from the code in glibc any glibc using system should never have xntpd set the flag