On 12/08/2026 03:04, Collin Funk wrote:
Pádraig Brady <[email protected]> writes:

Also the /usr/share/zoneinfo dir is parameterized
both at build and runtime through TZDIR define and $TZDIR respectively.
So we'd have to use the TZDIR define and getenv("TZDIR") to get
the appropriate directory.
Also one could use #ifdef TZDIR, to restrict the code above to
supported platforms.

Is there anywhere where /usr/share/zoneinfo isn't the correct location?
That works on macOS, which typically has a stranger layout, e.g.,
/Users/collinfunk instead of /home/collinfunk or /usrc/home/collinfunk.

Oops I did `git grep TZDIR` in the glibc source
and incorrectly assumed it was exposed as a define.
I see c++config.h has #define _GLIBCXX_ZONEINFO_DIR "/usr/share/zoneinfo"
but it's otherwise not exposed at build time :(

I suppose this could be best effort.
I.e. hardcode /usr/share/zoneinfo but support getenv(TZDIR),
and also restrict to --debug output.

cheers,
Padraig

Reply via email to