Fix compiler error on FreeBSD

This commit is contained in:
Sebastian Messmer 2016-10-20 10:35:29 +02:00
parent fb123f8fd0
commit abae027538
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Version 0.9.7 (unreleased)
--------------
Compatibility:
* Runs on FreeBSD
Version 0.9.6
---------------
Fixed bugs:

View File

@ -14,7 +14,7 @@ namespace cpputils{
if (0 != result) {
throw std::runtime_error("sysctlbyname syscall failed");
}
#elif __linux__
#elif __linux__ || __FreeBSD__
long numRAMPages = sysconf(_SC_PHYS_PAGES);
long pageSize = sysconf(_SC_PAGESIZE);
mem = numRAMPages * pageSize;