+-

我正在编写一个程序,该程序需要能够在 Linux上的时区文件中读取.这意味着我需要能够在发行版中始终如一地找到它们.据我所知,它们始终位于/usr/share / zoneinfo中.问题是,它们实际上是否始终位于/usr/share / zoneinfo中?还是有将它们放到其他地方的发行版?如果是这样,他们将它们放在哪里?
最佳答案
tzset(3)的报价:
The system timezone directory used depends on the (g)libc version.
Libc4 and libc5 use /usr/lib/zoneinfo,
and, since libc-5.4.6,
when this doesn’t work, will try /usr/share/zoneinfo.
Glibc2 will use the environment
variable TZDIR, when that exists. Its
default depends on how it was installed, but normally is
/usr/share/zoneinfo.
但是请注意,没有什么可以阻止某些有害发行版修补libc并将文件放置在所需的任何位置.
点击查看更多相关文章
转载注明原文:Linux的时区文件是否始终在/usr/share / zoneinfo中? - 乐贴网