| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2014 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 <errno.h> | 7 #include <errno.h> |
| 8 #include <pthread.h> | 8 #include <pthread.h> |
| 9 #include <signal.h> | 9 #include <signal.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 #endif | 189 #endif |
| 190 } | 190 } |
| 191 | 191 |
| 192 /* Signal handler, responsible for calling the registered handler. */ | 192 /* Signal handler, responsible for calling the registered handler. */ |
| 193 static void signal_catch(int sig, linux_siginfo_t *info, void *uc) { | 193 static void signal_catch(int sig, linux_siginfo_t *info, void *uc) { |
| 194 if (g_signal_handler_function_pointer) { | 194 if (g_signal_handler_function_pointer) { |
| 195 struct NonSfiExceptionFrame exception_frame; | 195 struct NonSfiExceptionFrame exception_frame; |
| 196 exception_frame_from_signal_context(&exception_frame, uc); | 196 exception_frame_from_signal_context(&exception_frame, uc); |
| 197 g_signal_handler_function_pointer(&exception_frame.context); | 197 g_signal_handler_function_pointer(&exception_frame.context); |
| 198 } | 198 } |
| 199 _exit(-1); | 199 _exit(-sig); |
| 200 } | 200 } |
| 201 | 201 |
| 202 static void nonsfi_initialize_signal_handler_locked() { | 202 static void nonsfi_initialize_signal_handler_locked() { |
| 203 struct linux_sigaction sa; | 203 struct linux_sigaction sa; |
| 204 unsigned int a; | 204 unsigned int a; |
| 205 | 205 |
| 206 memset(&sa, 0, sizeof(sa)); | 206 memset(&sa, 0, sizeof(sa)); |
| 207 sa.sa_sigaction = signal_catch; | 207 sa.sa_sigaction = signal_catch; |
| 208 sa.sa_flags = LINUX_SA_SIGINFO | LINUX_SA_ONSTACK; | 208 sa.sa_flags = LINUX_SA_SIGINFO | LINUX_SA_ONSTACK; |
| 209 | 209 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 if (linux_sigprocmask(LINUX_SIG_UNBLOCK, &mask, NULL) != 0) | 286 if (linux_sigprocmask(LINUX_SIG_UNBLOCK, &mask, NULL) != 0) |
| 287 abort(); | 287 abort(); |
| 288 | 288 |
| 289 return 0; | 289 return 0; |
| 290 } | 290 } |
| 291 | 291 |
| 292 int nacl_exception_set_stack(void *p, size_t s) { | 292 int nacl_exception_set_stack(void *p, size_t s) { |
| 293 /* Not implemented yet. */ | 293 /* Not implemented yet. */ |
| 294 return ENOSYS; | 294 return ENOSYS; |
| 295 } | 295 } |
| OLD | NEW |