| Server IP : 82.208.35.60 / Your IP : 216.73.217.33 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/games/multimc/files/ |
Upload File : |
--- libraries/systeminfo/src/sys_unix.cpp.orig 2019-03-09 17:25:33 UTC
+++ libraries/systeminfo/src/sys_unix.cpp
@@ -18,6 +18,7 @@ Sys::KernelInfo Sys::getKernelInfo()
uint64_t Sys::getSystemRam()
{
std::string token;
+ #ifdef Q_OS_LINUX
std::ifstream file("/proc/meminfo");
while(file >> token)
{
@@ -36,6 +37,19 @@ uint64_t Sys::getSystemRam()
// ignore rest of the line
file.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
+ #elif defined Q_OS_FREEBSD
+ char buff[512];
+ FILE *fp = popen("sysctl hw.physmem", "r");
+ if (fp != NULL)
+ {
+ while(fgets(buff, 512, fp) != NULL)
+ {
+ std::string str(buff);
+ uint64_t mem = std::stoull(str.substr(12, std::string::npos));
+ return mem * 1024ull;
+ }
+ }
+ #endif
return 0; // nothing found
}