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

Side by Side Diff: src/untrusted/init/kernel_service.cc

Issue 25147002: nacl_init Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/untrusted/init/kernel_service.h ('k') | src/untrusted/init/nacl.scons » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Native Client Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "native_client/src/untrusted/init/process_lib.h"
6
7 #include <errno.h>
8 #include <fcntl.h>
9 #include <stdlib.h>
10 #include <unistd.h>
11
12 #include "native_client/src/public/imc_syscalls.h"
13 #include "native_client/src/public/name_service.h"
14 #include "native_client/src/trusted/service_runtime/include/bits/nacl_syscalls.h "
15 #include "native_client/src/trusted/service_runtime/include/sys/nacl_kernel_serv ice.h"
16
17 #include "native_client/src/trusted/service_runtime/nacl_config.h"
18
19 namespace nacl {
20
21 bool KernelServiceClient::CreateProcess(int *child_sockaddr,
22 int *app_sockaddr) {
23 if (!initialized()) {
24 return 0;
25 }
26 NaClSrpcResultCodes result;
27 int status;
28 result = NaClSrpcInvokeBySignature(chan(), NACL_KERNEL_SERVICE_CREATE_PROCESS,
29 &status, child_sockaddr, app_sockaddr);
30 if (NACL_SRPC_RESULT_OK != result) {
31 fprintf(stderr, "create process failed (%d): %s\n", result,
32 NaClSrpcErrorString(result));
33 return 0;
34 }
35 return 1;
36 }
37
38 ServiceRuntimeClient* KernelServiceClient::ServiceRuntimeClientFactory(
39 int child_sockaddr) {
40 ServiceRuntimeClient* src = new ServiceRuntimeClient;
41 if (!src->InitializeFromConnectionCapability(child_sockaddr)) {
42 delete src;
43 return NULL;
44 }
45 return src;
46 }
47
48 } // namespace nacl
OLDNEW
« no previous file with comments | « src/untrusted/init/kernel_service.h ('k') | src/untrusted/init/nacl.scons » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698