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

Side by Side Diff: base/sys_info_posix.cc

Issue 159843: Linux: don't try and read shmmax in the sandbox. (Closed)
Patch Set: Created 11 years, 4 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
« no previous file with comments | « base/sys_info.h ('k') | chrome/browser/zygote_main_linux.cc » ('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/sys_info.h" 6 #include "base/sys_info.h"
6 #include "base/basictypes.h" 7 #include "base/basictypes.h"
7 8
8 #include <errno.h> 9 #include <errno.h>
9 #include <string.h> 10 #include <string.h>
10 #include <sys/statvfs.h> 11 #include <sys/statvfs.h>
11 #include <sys/utsname.h> 12 #include <sys/utsname.h>
12 #include <unistd.h> 13 #include <unistd.h>
13 14
14 #if defined(OS_MACOSX) 15 #if defined(OS_MACOSX)
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 int SysInfo::DisplayCount() { 144 int SysInfo::DisplayCount() {
144 NOTIMPLEMENTED(); 145 NOTIMPLEMENTED();
145 return 1; 146 return 1;
146 } 147 }
147 148
148 // static 149 // static
149 size_t SysInfo::VMAllocationGranularity() { 150 size_t SysInfo::VMAllocationGranularity() {
150 return getpagesize(); 151 return getpagesize();
151 } 152 }
152 153
154 #if defined(OS_LINUX)
155 // static
156 size_t SysInfo::MaxSharedMemorySize() {
157 static size_t limit;
158 static bool limit_valid = false;
159
160 if (!limit_valid) {
161 std::string contents;
162 file_util::ReadFileToString(FilePath("/proc/sys/kernel/shmmax"), &contents);
163 limit = strtoul(contents.c_str(), NULL, 0);
164 limit_valid = true;
165 }
166
167 return limit;
168 }
169 #endif
170
153 } // namespace base 171 } // namespace base
OLDNEW
« no previous file with comments | « base/sys_info.h ('k') | chrome/browser/zygote_main_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698