#if ! __cpp_constinit
# if __has_cpp_attribute(clang::require_constant_initialization)
# define constinit [[clang::require_constant_initialization]]
-#else // YOLO
-# define constinit
+# else // YOLO
+# define constinit
# endif
#endif
if (auto tz = do_locate_zone(this->zones, this->links, name))
return tz;
}
+
+ if (ifstream tzf{"/etc/sysconfig/clock"})
+ {
+ string line;
+ string_view key = "DEFAULT_TIMEZONE=";
+ while (std::getline(tzf, line))
+ if (line.starts_with(key))
+ {
+ string_view name = line;
+ name.remove_prefix(key.size());
+ if (name.size() != 0 && name.front() == '"')
+ {
+ name.remove_prefix(1);
+ if (auto pos = name.find('"'); pos != name.npos)
+ name = name.substr(0, pos);
+ }
+ if (auto tz = do_locate_zone(this->zones, this->links, name))
+ return tz;
+ }
+ }
#else
// AIX stores current zone in $TZ in /etc/environment but the value
// is typically a POSIX time zone name, not IANA zone.