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 |