In message: <[EMAIL PROTECTED]> "Joseph S. Myers" <[EMAIL PROTECTED]> writes: : The Linux kernel (with NTP synchronisation) duly syslogged : : Dec 31 23:59:59 digraph kernel: Clock: inserting leap second 23:59:60 UTC : : and Markus's program showed a transition from 1136073600.005623 to : 1136073599.013130, i.e. 23:59:59 was repeated (whereas a POSIX clock in : perfect synchronisation with UTC should appear to repeat 00:00:00, and a : kernel source code comment : : /* The timer interpolator will make time change gradually instead : * of an immediate jump by one second. : */ : : describes what would practically be a safer approach, if the code followed : the comment).
ntp synced computers repeat the last second of the day. POSIX is just flat wrong here. Actually, POSIX is completely silent on what is to happen at the leap second to system time. Once can infer what might be the right behavior by working backwards from what mktime does for 23:59:60, but that's a weak inference for what the 'right' posix behavior is for the system time accross a leap second. POSIX simply does not have leap seconds in any meaningful way. It is as if they do not exist at all. There's no clarifications to the POSIX standard that say that 0:00:00 should be repeated at a leap second, at least that I've been able to find. If there is such an explicit clarification, I'd like to know about it. FreeBSD does the same thing (as do all kernels that use the ntp kernel stuff supplied with udel ntpd and successors). FreeBSD doesn't actually log the leap second via syslog, but maybe it should. Ideally, we'd switch to running computers with TAI and doing all the conversion on input/output of time. However, *THAT*'s definitely not POSIX. Warner