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

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: Add myself to the AUTHORS 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
« no previous file with comments | « base/process_util_unittest.cc ('k') | base/threading/platform_thread_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sys_info_openbsd.cc
diff --git a/base/sys_info_openbsd.cc b/base/sys_info_openbsd.cc
index 887722290b1c9f35db49fc4fc09ab43a659bfa7f..2d1b3906a70f23fce81d585313fdbdb9cd9e10e8 100644
--- a/base/sys_info_openbsd.cc
+++ b/base/sys_info_openbsd.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -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
« no previous file with comments | « base/process_util_unittest.cc ('k') | base/threading/platform_thread_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698