OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 * Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | 8 #include <string.h> |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 | 10 |
11 #include "native_client/src/include/elf32.h" | 11 #include "native_client/src/include/elf32.h" |
12 #include "native_client/src/include/elf_auxv.h" | 12 #include "native_client/src/include/elf_auxv.h" |
13 #include "native_client/src/untrusted/irt/irt.h" | 13 #include "native_client/src/untrusted/irt/irt.h" |
14 #include "ppapi/nacl_irt/public/irt_ppapi.h" | 14 #include "ppapi/nacl_irt/public/irt_ppapi.h" |
15 #include "ppapi/native_client/src/shared/ppapi_proxy/ppruntime.h" | 15 #include "ppapi/native_client/src/shared/ppapi_proxy/ppruntime.h" |
16 #include "ppapi/native_client/src/untrusted/irt_stub/thread_creator.h" | 16 #include "ppapi/native_client/src/untrusted/irt_stub/thread_creator.h" |
17 | 17 |
18 static void fatal_error(const char *message) { | 18 static void fatal_error(const char *message) { |
19 write(2, message, strlen(message)); | 19 ssize_t wrote __attribute__((unused)); |
| 20 wrote = write(2, message, strlen(message)); |
20 _exit(127); | 21 _exit(127); |
21 } | 22 } |
22 | 23 |
23 /* | 24 /* |
24 * TODO(mcgrathr): This extremely stupid function should not exist. | 25 * TODO(mcgrathr): This extremely stupid function should not exist. |
25 * If the startup calling sequence were sane, this would be done | 26 * If the startup calling sequence were sane, this would be done |
26 * someplace that has the initial pointer locally rather than stealing | 27 * someplace that has the initial pointer locally rather than stealing |
27 * it from environ. | 28 * it from environ. |
28 * See http://code.google.com/p/nativeclient/issues/detail?id=651 | 29 * See http://code.google.com/p/nativeclient/issues/detail?id=651 |
29 */ | 30 */ |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 62 |
62 struct nacl_irt_ppapihook hooks; | 63 struct nacl_irt_ppapihook hooks; |
63 if (sizeof(hooks) != query_func(NACL_IRT_PPAPIHOOK_v0_1, | 64 if (sizeof(hooks) != query_func(NACL_IRT_PPAPIHOOK_v0_1, |
64 &hooks, sizeof(hooks))) | 65 &hooks, sizeof(hooks))) |
65 fatal_error("PpapiPluginStart: PPAPI hooks not found\n"); | 66 fatal_error("PpapiPluginStart: PPAPI hooks not found\n"); |
66 | 67 |
67 __nacl_register_thread_creator(&hooks); | 68 __nacl_register_thread_creator(&hooks); |
68 | 69 |
69 return hooks.ppapi_start(funcs); | 70 return hooks.ppapi_start(funcs); |
70 } | 71 } |
OLD | NEW |