[tz] Timezone change detection

Paul Eggert eggert at cs.ucla.edu
Fri Sep 3 20:40:30 UTC 2021


On 9/3/21 9:53 AM, Edward Tomasz Napierała via tz wrote:
> The use case is to make the applications handle
> moving between timezones, or changing the default system timezone.

Does the use case include installing new timezone tables when a new tzdb 
release comes out? Or is it to handle only the case where /etc/timezone 
changes because the system has moved or has changed its default timezone 
for other reasons?

Won't the change break applications like 'zdump' that call 'localtime' 
several times and assume that all the 'localtime' calls return 
consistent values for a single timezone? Perhaps it would be better to 
do change detection only when tzset is called explicitly; this would be 
less likely to break zdump etc.

A smaller question: when opening the TZif file for the first time, 
wouldn't it be more efficient (and avoid a race) to do open+fstat 
instead of stat+open?


More information about the tz mailing list