This is Patch 2, which attempts to improve localtime's error handling further. It will tell you if it couldn't open a zoneinfo file (explicitly stating which one and why); it will tell you if it had trouble parsing a zoneinfo file; it will tell you if it had trouble parsing a Posix timezone string not referencing a file. That's all well and good, but the drawbacks are that this ends up requiring rather a lot of changes, and the implementation is significantly imperfect in that it uses some errno-style static global data which renders it non thread safe in the error handling case. As a user, patch 1's error messages (though arguably better than nothing) would have me putting my fist through the screen ("Come on, tell me *which* *file* you couldn't open!"). But Patch 2's nonreentrancy is likely to be a fatal flaw in some people's eyes, and rightly so. For those looking at the code: the error handling variables in question are tzlb_reason and tzlb_filename. The obvious non-statically-global place to stash them, for better thread safety, would be in an instance of union local_storage, but those guys don't stick around long enough under all circumstances. Addressing that will be the subject of Patch 3, at the cost of yet more code rearrangement. This patch is with respect to 2017c, plus Patch 1. Steve Summit scs@eskimo.com