| 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_LINUX) | 6 #if defined(TARGET_OS_LINUX) |
| 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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 } | 625 } |
| 626 | 626 |
| 627 | 627 |
| 628 intptr_t Process::CurrentProcessId() { | 628 intptr_t Process::CurrentProcessId() { |
| 629 return static_cast<intptr_t>(getpid()); | 629 return static_cast<intptr_t>(getpid()); |
| 630 } | 630 } |
| 631 | 631 |
| 632 | 632 |
| 633 static Mutex* signal_mutex = new Mutex(); | 633 static Mutex* signal_mutex = new Mutex(); |
| 634 static SignalInfo* signal_handlers = NULL; | 634 static SignalInfo* signal_handlers = NULL; |
| 635 static const int kSignalsCount = 6; | 635 static const int kSignalsCount = 7; |
| 636 static const int kSignals[kSignalsCount] = { | 636 static const int kSignals[kSignalsCount] = { |
| 637 SIGHUP, | 637 SIGHUP, |
| 638 SIGINT, | 638 SIGINT, |
| 639 SIGTERM, | 639 SIGTERM, |
| 640 SIGUSR1, | 640 SIGUSR1, |
| 641 SIGUSR2, | 641 SIGUSR2, |
| 642 SIGWINCH | 642 SIGWINCH, |
| 643 SIGQUIT // Allow VMService to listen on SIGQUIT. |
| 643 }; | 644 }; |
| 644 | 645 |
| 645 | 646 |
| 646 SignalInfo::~SignalInfo() { | 647 SignalInfo::~SignalInfo() { |
| 647 VOID_TEMP_FAILURE_RETRY(close(fd_)); | 648 VOID_TEMP_FAILURE_RETRY(close(fd_)); |
| 648 } | 649 } |
| 649 | 650 |
| 650 | 651 |
| 651 static void SignalHandler(int signal) { | 652 static void SignalHandler(int signal) { |
| 652 MutexLocker lock(signal_mutex); | 653 MutexLocker lock(signal_mutex); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 bzero(&act, sizeof(act)); | 737 bzero(&act, sizeof(act)); |
| 737 act.sa_handler = SIG_DFL; | 738 act.sa_handler = SIG_DFL; |
| 738 sigaction(signal, &act, NULL); | 739 sigaction(signal, &act, NULL); |
| 739 } | 740 } |
| 740 } | 741 } |
| 741 | 742 |
| 742 } // namespace bin | 743 } // namespace bin |
| 743 } // namespace dart | 744 } // namespace dart |
| 744 | 745 |
| 745 #endif // defined(TARGET_OS_LINUX) | 746 #endif // defined(TARGET_OS_LINUX) |
| OLD | NEW |