| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_ANDROID) | 6 #if defined(TARGET_OS_ANDROID) |
| 7 | 7 |
| 8 #include "bin/process.h" | 8 #include "bin/process.h" |
| 9 | 9 |
| 10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 } | 629 } |
| 630 | 630 |
| 631 | 631 |
| 632 intptr_t Process::CurrentProcessId() { | 632 intptr_t Process::CurrentProcessId() { |
| 633 return static_cast<intptr_t>(getpid()); | 633 return static_cast<intptr_t>(getpid()); |
| 634 } | 634 } |
| 635 | 635 |
| 636 | 636 |
| 637 static Mutex* signal_mutex = new Mutex(); | 637 static Mutex* signal_mutex = new Mutex(); |
| 638 static SignalInfo* signal_handlers = NULL; | 638 static SignalInfo* signal_handlers = NULL; |
| 639 static const int kSignalsCount = 6; | 639 static const int kSignalsCount = 7; |
| 640 static const int kSignals[kSignalsCount] = { | 640 static const int kSignals[kSignalsCount] = { |
| 641 SIGHUP, | 641 SIGHUP, |
| 642 SIGINT, | 642 SIGINT, |
| 643 SIGTERM, | 643 SIGTERM, |
| 644 SIGUSR1, | 644 SIGUSR1, |
| 645 SIGUSR2, | 645 SIGUSR2, |
| 646 SIGWINCH | 646 SIGWINCH, |
| 647 SIGQUIT // Allow VMService to listen on SIGQUIT. |
| 647 }; | 648 }; |
| 648 | 649 |
| 649 | 650 |
| 650 SignalInfo::~SignalInfo() { | 651 SignalInfo::~SignalInfo() { |
| 651 VOID_TEMP_FAILURE_RETRY(close(fd_)); | 652 VOID_TEMP_FAILURE_RETRY(close(fd_)); |
| 652 } | 653 } |
| 653 | 654 |
| 654 | 655 |
| 655 static void SignalHandler(int signal) { | 656 static void SignalHandler(int signal) { |
| 656 MutexLocker lock(signal_mutex); | 657 MutexLocker lock(signal_mutex); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 bzero(&act, sizeof(act)); | 744 bzero(&act, sizeof(act)); |
| 744 act.sa_handler = SIG_DFL; | 745 act.sa_handler = SIG_DFL; |
| 745 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); | 746 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); |
| 746 } | 747 } |
| 747 } | 748 } |
| 748 | 749 |
| 749 } // namespace bin | 750 } // namespace bin |
| 750 } // namespace dart | 751 } // namespace dart |
| 751 | 752 |
| 752 #endif // defined(TARGET_OS_ANDROID) | 753 #endif // defined(TARGET_OS_ANDROID) |
| OLD | NEW |