| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client 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 "native_client/tests/thread_suspension/suspend_test.h" | 7 #include "native_client/tests/thread_suspension/suspend_test.h" |
| 8 | 8 |
| 9 #include "native_client/src/include/portability_io.h" | 9 #include "native_client/src/include/portability_io.h" |
| 10 #include "native_client/src/shared/gio/gio.h" | 10 #include "native_client/src/shared/gio/gio.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 int main(int argc, char **argv) { | 130 int main(int argc, char **argv) { |
| 131 struct NaClApp app; | 131 struct NaClApp app; |
| 132 struct GioMemoryFileSnapshot gio_file; | 132 struct GioMemoryFileSnapshot gio_file; |
| 133 | 133 |
| 134 /* Turn off buffering to aid debugging. */ | 134 /* Turn off buffering to aid debugging. */ |
| 135 setvbuf(stdout, NULL, _IONBF, 0); | 135 setvbuf(stdout, NULL, _IONBF, 0); |
| 136 setvbuf(stderr, NULL, _IONBF, 0); | 136 setvbuf(stderr, NULL, _IONBF, 0); |
| 137 | 137 |
| 138 NaClAllModulesInit(); | 138 NaClAllModulesInit(); |
| 139 | 139 |
| 140 #if NACL_LINUX |
| 141 NaClSignalHandlerInit(); |
| 142 #endif |
| 143 |
| 140 if (argc != 2) { | 144 if (argc != 2) { |
| 141 NaClLog(LOG_FATAL, "Expected 1 argument: executable filename\n"); | 145 NaClLog(LOG_FATAL, "Expected 1 argument: executable filename\n"); |
| 142 } | 146 } |
| 143 | 147 |
| 144 NaClFileNameForValgrind(argv[1]); | 148 NaClFileNameForValgrind(argv[1]); |
| 145 CHECK(GioMemoryFileSnapshotCtor(&gio_file, argv[1])); | 149 CHECK(GioMemoryFileSnapshotCtor(&gio_file, argv[1])); |
| 146 CHECK(NaClAppCtor(&app)); | 150 CHECK(NaClAppCtor(&app)); |
| 147 CHECK(NaClAppLoadFile((struct Gio *) &gio_file, &app) == LOAD_OK); | 151 CHECK(NaClAppLoadFile((struct Gio *) &gio_file, &app) == LOAD_OK); |
| 148 CHECK(NaClAppPrepareToLaunch(&app) == LOAD_OK); | 152 CHECK(NaClAppPrepareToLaunch(&app) == LOAD_OK); |
| 149 | 153 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 161 | 165 |
| 162 printf("Running TrySuspendingSyscallInvokerThread...\n"); | 166 printf("Running TrySuspendingSyscallInvokerThread...\n"); |
| 163 TrySuspendingSyscallInvokerThread(&app); | 167 TrySuspendingSyscallInvokerThread(&app); |
| 164 | 168 |
| 165 /* | 169 /* |
| 166 * Avoid calling exit() because it runs process-global destructors | 170 * Avoid calling exit() because it runs process-global destructors |
| 167 * which might break code that is running in our unjoined threads. | 171 * which might break code that is running in our unjoined threads. |
| 168 */ | 172 */ |
| 169 NaClExit(0); | 173 NaClExit(0); |
| 170 } | 174 } |
| OLD | NEW |