On Oct 4, 2025, at 4:22 PM, Steffen Nurpmeso via tz <[email protected]> wrote:

> What a terrible thing, isn't it.  It is optional as you say.
> You know, if it would be a possibility to install a handler,
> so that all the many programs which actually run an eventloop

In macOS, even programs that *don't* explicitly set up an event loop get 
notified of changes to the current time zone setting, and update; try, for 
example, a program that sleeps for 5 seconds, calls time(), and prints the 
result of ctime() on the returned value.  I'll change the time it's printing if 
you change the system time zone.

I don't think the notifications are delivered if the OS's update mechanism 
installs an update to the tz files, however. Deborah?

The tzcode in macOS checks for change notifications in various internal 
routines (internal routines used by tzset() and tzsetwall(), and getsub() as 
used by localtime().

This uses macOS's notify(3) mechanism, in particular notify_check(), which I 
think sends a (Mach) message to the notification daemon asking whether a 
notification has been posted (it doesn't wait for one to be posted).

Reply via email to