Index: base/sys_info_openbsd.cc |
diff --git a/base/sys_info_openbsd.cc b/base/sys_info_openbsd.cc |
index 887722290b1c9f35db49fc4fc09ab43a659bfa7f..f4d57f22b52cfa9ce92c14d5cab5ca1ae288fc1e 100644 |
--- a/base/sys_info_openbsd.cc |
+++ b/base/sys_info_openbsd.cc |
@@ -22,4 +22,15 @@ int SysInfo::NumberOfProcessors() { |
return ncpu; |
} |
+int64 SysInfo::AmountOfPhysicalMemory() { |
+ long pages = sysconf(_SC_PHYS_PAGES); |
+ long page_size = sysconf(_SC_PAGESIZE); |
+ if (pages == -1 || page_size == -1) { |
+ NOTREACHED(); |
+ return 0; |
+ } |
+ |
+ return static_cast<int64>(pages) * page_size; |
+} |
+ |
} // namespace base |