|
|
|
@@ -55,10 +55,10 @@ bool SystemStats::isOperatingSystem64Bit() |
|
|
|
//==============================================================================
|
|
|
|
namespace LinuxStatsHelpers
|
|
|
|
{
|
|
|
|
String getCpuInfo (const char* const key)
|
|
|
|
String getConfigFileValue (const char* file, const char* const key)
|
|
|
|
{
|
|
|
|
StringArray lines;
|
|
|
|
File ("/proc/cpuinfo").readLines (lines);
|
|
|
|
File (file).readLines (lines);
|
|
|
|
|
|
|
|
for (int i = lines.size(); --i >= 0;) // (NB - it's important that this runs in reverse order)
|
|
|
|
if (lines[i].upToFirstOccurrenceOf (":", false, false).trim().equalsIgnoreCase (key))
|
|
|
|
@@ -66,6 +66,11 @@ namespace LinuxStatsHelpers |
|
|
|
|
|
|
|
return String();
|
|
|
|
}
|
|
|
|
|
|
|
|
String getCpuInfo (const char* key)
|
|
|
|
{
|
|
|
|
return getConfigFileValue ("/proc/cpuinfo", key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
String SystemStats::getDeviceDescription()
|
|
|
|
@@ -189,3 +194,13 @@ bool Time::setSystemTimeToThisTime() const |
|
|
|
|
|
|
|
return settimeofday (&t, 0) == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger()
|
|
|
|
{
|
|
|
|
#if JUCE_BSD
|
|
|
|
return false;
|
|
|
|
#else
|
|
|
|
return LinuxStatsHelpers::getConfigFileValue ("/proc/self/status", "TracerPid")
|
|
|
|
.getIntValue() > 0;
|
|
|
|
#endif
|
|
|
|
}
|