OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2013 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. |
| 5 */ |
| 6 |
| 7 #include <errno.h> |
| 8 #include <signal.h> |
| 9 #include <sys/types.h> |
| 10 |
| 11 #include "native_client/src/untrusted/nacl/nacl_irt.h" |
| 12 |
| 13 sighandler_t signal(int sig, sighandler_t handler) { |
| 14 if (!__libnacl_irt_init_fn(&__libnacl_irt_dev_process.signal, |
| 15 __libnacl_irt_dev_process_init)) { |
| 16 return -1; |
| 17 } |
| 18 |
| 19 sighandler_t oldhandler; |
| 20 int error = __libnacl_irt_dev_process.signal(sig, handler, &oldhandler); |
| 21 if (error) { |
| 22 errno = error; |
| 23 return SIG_ERR; |
| 24 } |
| 25 |
| 26 return oldhandler; |
| 27 } |
OLD | NEW |