Are Linux timezone files always in / usr / share / zoneinfo?

I am writing a program that should be able to read in timezone files on Linux. And that means that I need to be able to consistently find them through distributions. As far as I know, they are always located in / usr / share / zoneinfo. The question is, are they always located in / usr / share / zoneinfo? Or are there distributions that put them elsewhere? And if so, where to put them?

+3
source share
2 answers

Quote from tzset(3):

The time zone directory used depends on the version (g) of libc. Libc4 and libc5 use / usr / lib / zoneinfo, and since libc-5.4.6, when this does not work, try / usr / share / zoneinfo. Glibc2 will use the TZDIR environment variable, if one exists. this by default depends on how it was installed, but usually it is / usr / share / zoneinfo.

Note, however, that there is nothing stopping some perverse distribution from fixing libc and placing files where they want.

+3
source

The public domain time zone database contains code and data for processing time zones in Linux.

, . , , UTC . ( tz zoneinfo) , GNU C , GNU/Linux, FreeBSD, NetBSD, OpenBSD, Cygwin, DJGPP, AIX, Mac OS X, OpenVMS, Oracle Database, Solaris, Tru64 UnixWare.

, , , - . , zonezinfo . (, POSIX XPG4) API .

+1

Source: https://habr.com/ru/post/1768751/


All Articles