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

Side by Side Diff: chrome/nacl/nacl_helper_linux.cc

Issue 10826039: Support 64-bit reserved_at_zero value chrome-side (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/app/nacl_fork_delegate_linux.cc ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // A mini-zygote specifically for Native Client. 5 // A mini-zygote specifically for Native Client.
6 6
7 #include "chrome/common/nacl_helper_linux.h" 7 #include "chrome/common/nacl_helper_linux.h"
8 8
9 #include <errno.h> 9 #include <errno.h>
10 #include <link.h> 10 #include <link.h>
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 * came in as our argv[0]. 168 * came in as our argv[0].
169 */ 169 */
170 struct link_map *l = _r_debug.r_map; 170 struct link_map *l = _r_debug.r_map;
171 if (l->l_name[0] == '\0') 171 if (l->l_name[0] == '\0')
172 l->l_name = argv0; 172 l->l_name = argv0;
173 } 173 }
174 } 174 }
175 } 175 }
176 176
177 /* 177 /*
178 * The zygote passes --reserved_at_zero=0xXXXXXXXX. 178 * The zygote passes --reserved_at_zero=0xXXXXXXXXXXXXXXXX.
179 * nacl_helper_bootstrap replaces the Xs with the amount of prereserved 179 * nacl_helper_bootstrap replaces the Xs with the amount of prereserved
180 * sandbox memory. 180 * sandbox memory.
181 * 181 *
182 * CheckReservedAtZero parses the value of the argument reserved_at_zero 182 * CheckReservedAtZero parses the value of the argument reserved_at_zero
183 * and returns the amount of prereserved sandbox memory. 183 * and returns the amount of prereserved sandbox memory.
184 */ 184 */
185 static size_t CheckReservedAtZero() { 185 static size_t CheckReservedAtZero() {
186 size_t prereserved_sandbox_size = 0; 186 size_t prereserved_sandbox_size = 0;
187 std::string reserved_at_zero_switch_value = 187 std::string reserved_at_zero_switch_value =
188 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 188 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 _exit(-1); 259 _exit(-1);
260 } 260 }
261 // if fork fails, send PID=-1 to zygote 261 // if fork fails, send PID=-1 to zygote
262 if (!UnixDomainSocket::SendMsg(kNaClZygoteDescriptor, &badpid, 262 if (!UnixDomainSocket::SendMsg(kNaClZygoteDescriptor, &badpid,
263 sizeof(badpid), empty)) { 263 sizeof(badpid), empty)) {
264 LOG(ERROR) << "*** send() to zygote failed"; 264 LOG(ERROR) << "*** send() to zygote failed";
265 } 265 }
266 } 266 }
267 CHECK(false); // This routine must not return 267 CHECK(false); // This routine must not return
268 } 268 }
OLDNEW
« no previous file with comments | « chrome/app/nacl_fork_delegate_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698