diff --git a/about-distro/src/Module.cpp b/about-distro/src/Module.cpp index c9667dfa..863817ce 100644 --- a/about-distro/src/Module.cpp +++ b/about-distro/src/Module.cpp @@ -33,9 +33,7 @@ #include #include -#ifdef Q_OS_LINUX -#include -#endif +#include #include #include "OSRelease.h" @@ -45,13 +43,12 @@ K_PLUGIN_FACTORY_DECLARATION(KcmAboutDistroFactory); static qlonglong calculateTotalRam() { qlonglong ret = -1; -#ifdef Q_OS_LINUX - struct sysinfo info; - if (sysinfo(&info) == 0) - // manpage "sizes are given as multiples of mem_unit bytes" - ret = info.totalram * info.mem_unit; +#if defined(_SC_PHYS_PAGES) && defined(_SC_PAGESIZE) + ret = sysconf(_SC_PHYS_PAGES); + ret *= sysconf(_SC_PAGESIZE); + ret /= 1.03; #else -# warning calculateTotalRam() not implemented for this OS +# warning calculateTotalRam() not implemented #endif return ret; }