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

Unified Diff: base/sys_info_openbsd.cc

Issue 8382001: OpenBSD patches for base and build, part 2 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: remove newline from string 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/sys_info_linux.cc ('k') | build/common.gypi » ('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 2d1b3906a70f23fce81d585313fdbdb9cd9e10e8..b9aec20e74cd9cbf0b60155194f86be84fd039b1 100644
--- a/base/sys_info_openbsd.cc
+++ b/base/sys_info_openbsd.cc
@@ -5,6 +5,7 @@
#include "base/sys_info.h"
#include <sys/param.h>
+#include <sys/shm.h>
#include <sys/sysctl.h>
#include "base/logging.h"
@@ -15,7 +16,7 @@ int SysInfo::NumberOfProcessors() {
int mib[] = { CTL_HW, HW_NCPU };
int ncpu;
size_t size = sizeof(ncpu);
- if (sysctl(mib, 2, &ncpu, &size, NULL, 0) == -1) {
+ if (sysctl(mib, arraysize(mib), &ncpu, &size, NULL, 0) == -1) {
NOTREACHED();
return 1;
}
@@ -33,4 +34,15 @@ int64 SysInfo::AmountOfPhysicalMemory() {
return static_cast<int64>(pages) * page_size;
}
+size_t SysInfo::MaxSharedMemorySize() {
+ int mib[] = { CTL_KERN, KERN_SHMINFO, KERN_SHMINFO_SHMMAX };
+ size_t limit;
+ size_t size = sizeof(limit);
+ if (sysctl(mib, arraysize(mib), &limit, &size, NULL, 0) < 0) {
+ NOTREACHED();
+ return 0;
+ }
+ return limit;
+}
+
} // namespace base
« no previous file with comments | « base/sys_info_linux.cc ('k') | build/common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698