Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3029)

Unified Diff: base/sys_info_openbsd.cc

Issue 8228005: openbsd and freebsd fixes for base (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixes after the comments from Mark Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698