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

Side by Side Diff: base/sys_info_posix.cc

Issue 199105: Continue with the FreeBSD port - this version builds and links, though... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/sys_info.h ('k') | build/common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/file_util.h" 5 #include "base/file_util.h"
6 #include "base/sys_info.h" 6 #include "base/sys_info.h"
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 8
9 #include <errno.h> 9 #include <errno.h>
10 #include <string.h> 10 #include <string.h>
11 #include <sys/statvfs.h> 11 #include <sys/statvfs.h>
12 #include <sys/utsname.h> 12 #include <sys/utsname.h>
13 #include <unistd.h> 13 #include <unistd.h>
14 14
15 #if defined(OS_MACOSX) 15 #if defined(OS_MACOSX)
16 #include <mach/mach_host.h> 16 #include <mach/mach_host.h>
17 #include <mach/mach_init.h> 17 #include <mach/mach_init.h>
18 #endif 18 #endif
19 19
20 #if defined(OS_OPENBSD) 20 #if defined(OS_OPENBSD) || defined(OS_FREEBSD)
21 #include <sys/param.h> 21 #include <sys/param.h>
22 #include <sys/sysctl.h> 22 #include <sys/sysctl.h>
23 #endif 23 #endif
24 24
25 #include "base/logging.h" 25 #include "base/logging.h"
26 #include "base/string_util.h" 26 #include "base/string_util.h"
27 27
28 namespace base { 28 namespace base {
29 29
30 int SysInfo::NumberOfProcessors() { 30 int SysInfo::NumberOfProcessors() {
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 164
165 if (!limit_valid) { 165 if (!limit_valid) {
166 std::string contents; 166 std::string contents;
167 file_util::ReadFileToString(FilePath("/proc/sys/kernel/shmmax"), &contents); 167 file_util::ReadFileToString(FilePath("/proc/sys/kernel/shmmax"), &contents);
168 limit = strtoul(contents.c_str(), NULL, 0); 168 limit = strtoul(contents.c_str(), NULL, 0);
169 limit_valid = true; 169 limit_valid = true;
170 } 170 }
171 171
172 return limit; 172 return limit;
173 } 173 }
174 #elif defined(OS_FREEBSD)
175 size_t SysInfo::MaxSharedMemorySize() {
176 // TODO(benl): we should be able to get this from sysctl
177 // (kern.ipc.shmmax) but the constants are missing from the headers...
178 return 33554432;
179 }
174 #endif 180 #endif
175 181
176 } // namespace base 182 } // namespace base
OLDNEW
« no previous file with comments | « base/sys_info.h ('k') | build/common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698