================ @@ -27,6 +30,31 @@ using namespace lldb_private; +namespace { +struct HostInfoPosixFields { + llvm::once_flag m_os_version_once_flag; + llvm::VersionTuple m_os_version; +}; +} // namespace + +llvm::VersionTuple HostInfoPosix::GetOSVersion() { + static HostInfoPosixFields *g_fields = new HostInfoPosixFields(); + assert(g_fields && "Missing call to Initialize?"); + llvm::call_once(g_fields->m_os_version_once_flag, []() { + struct utsname un; + if (uname(&un) != 0) + return; + + llvm::StringRef release = un.release; + // The kernel release string can include a lot of stuff (e.g. ---------------- DavidSpickett wrote:
Other kernels are probably quirky too, but we know this referred to Linux originally. https://github.com/llvm/llvm-project/pull/119694 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits