On Mon, May 21, 2012 at 09:08:15PM +0200, Richard Cochran wrote:On Mon, May 21, 2012 at 11:09:51AM -0700, John Stultz wrote:...On 05/18/2012 07:09 AM, Richard Cochran wrote:+ /* Tracks where we stand with regard to leap the second epoch. */
+ enum {
+ LEAP_IDLE,
+ LEAP_INS_PENDING,
+ LEAP_INS_DONE,
+ LEAP_DEL_PENDING,
+ LEAP_DEL_DONE,
+ } leap_state;
I don't think I am explaining this very well. I will try again to makeThe following table illustrates what happens around a (fictitious)
it clear using a table or something later on.
leap second. Imagine a new epoch will occur at UTC time value 10 and
the new TAI - UTC offset will be 2 seconds. The columns of the table
show the values of the relevant time variables.
U: UTC time
CODE: NTP time code
T: TAI - UTC offset
P: pending (explained below)
U CODE T P
--------------------
1 INS 1 1 leap second sheduled
--------------------
2 INS 1 1
--------------------
...
--------------------
8 INS 1 1
--------------------
9 INS 1 1
--------------------
| 10 OOP 1 1 leap second, 1st tick
|~~~~~~~~~~~~~~~~~~~
| 9 2 0 leap second, 2nd and subsequent ticks
--------------------
10 WAIT 2 0 new epoch
--------------------
11 WAIT 2 0