July 29, 2016
11:37 p.m.
enh wrote:
is there a more detailed explanation of why mktime does binary search?
Russ Allbery answered the errno question, but as for the binary search: mktime is *really* *hard* to write, correctly, otherwise. Besides being considerably easier to implement, the binary search implementation effectively ensures that mktime is a perfect inverse of localtime, because it (literally) takes the localtime function and inverts it.