On Tue, May 22, 2012 at 11:06:09AM -0700, John Stultz wrote:epoch + 1 here, right?It seems currently we have:Okay, if you want it that way, then you will have to add the other
U CODE T
----------------
9 INS 1
----------------
10 INS 1 pre tick, post leap second edge (this is the technically incorrect interval)
~~~~~~~~~~~~~~~~
9 OOP 2 post tick, post leap second edge
----------------
10 WAIT 2 new epoch
If you're trying to correct the pre-tick, post leap second edge, the above provides all you need.
In the adjtimex code, all you have to do is:
if (unlikely(CODE == INS&& U == 10))
/*note, we're not modifying state here, just returning corrected local values*/
return (U-1, OOP, T+1);
return (U,CODE, T);
cases. For example:
switch (code) {
case INS:
if (U == epoch) {
U--;
T++;
code = OOP;
}
break;
case OOP:
if (U == epoch) {
code = WAIT;
}
break;
case DEL:
if (U == epoch - 1) {
U++;
T--;
code = WAIT;
}
break;
default:
break;
}
return (U, code, T);
This is beginning to look a lot like the code in my patch. However,
your approach is somewhat simpler, because it assumes the tick will
never miss a second overflow.
Since when the tick triggers, we'll move the CODE state appropriately.Considering the tickless options, is it safe to assume that the CODE
Or am I still missing something?
state update will never be an entire second too late? If so, then
I'll rework the patch as above. If not, then I think the patch I
posted already handles all the cases.