static uint32_t GetMaxThreadNameLength();
static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
+ static bool GetOSBuildString(std::string &s);
+ static bool GetOSKernelDescription(std::string &s);
static llvm::StringRef GetDistributionId();
static FileSpec GetProgramFileSpec();
return success;
}
+bool
+HostInfoLinux::GetOSBuildString(std::string &s)
+{
+ struct utsname un;
+ ::memset(&un, 0, sizeof(utsname));
+ s.clear();
+
+ if (uname(&un) < 0)
+ return false;
+
+ s.assign(un.release);
+ return true;
+}
+
+bool
+HostInfoLinux::GetOSKernelDescription(std::string &s)
+{
+ struct utsname un;
+
+ ::memset(&un, 0, sizeof(utsname));
+ s.clear();
+
+ if (uname(&un) < 0)
+ return false;
+
+ s.assign(un.version);
+ return true;
+}
+
llvm::StringRef
HostInfoLinux::GetDistributionId()
{
}
std::string s;
-#if !defined(__linux__)
if (HostInfo::GetOSBuildString(s))
{
response.PutCString ("os_build:");
response.PutCStringAsRawHex8(s.c_str());
response.PutChar(';');
}
-#endif
#if defined(__APPLE__)