Skip to content

Commit

Permalink
Solaris: I hope it will works for all clones of Solaris
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-w committed Jan 28, 2024
1 parent 733bca3 commit 480a613
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/StelLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
#include <string>
#endif

#ifdef Q_OS_SOLARIS
#include <sys/types.h>
#include <sys/processor.h>
#include <unistd.h>
#endif

// Init statics variables.
QFile StelLogger::logFile;
QString StelLogger::log;
Expand Down Expand Up @@ -326,6 +332,20 @@ void StelLogger::init(const QString& logFilePath)
sysctlbyname(_physmem, &totalRAM, &len, nullptr, 0);
writeLog(QString("Total physical memory: %1 MB").arg(totalRAM/(1024<<10)));
#endif

#ifdef Q_OS_SOLARIS
processor_info_t pinfo;
processor_info(0, &pinfo);
writeLog(QString("Processor name: %1").arg(pinfo.pi_processor_type));
writeLog(QString("Processor speed: %1 MHz").arg(pinfo.pi_clock));

int ncpu = sysconf( _SC_NPROCESSORS_ONLN );
writeLog(QString("Processor logical cores: %1").arg(ncpu));

// memory info
int64_t totalRAM = (size_t)sysconf( _SC_PHYS_PAGES ) * (size_t)sysconf( _SC_PAGESIZE );
writeLog(QString("Total physical memory: %1 MB").arg(totalRAM/(1024<<10)));
#endif
}

void StelLogger::deinit()
Expand Down

0 comments on commit 480a613

Please sign in to comment.