| 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_MACOS) | 6 #if defined(TARGET_OS_MACOS) |
| 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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 } | 671 } |
| 672 | 672 |
| 673 | 673 |
| 674 intptr_t Process::CurrentProcessId() { | 674 intptr_t Process::CurrentProcessId() { |
| 675 return static_cast<intptr_t>(getpid()); | 675 return static_cast<intptr_t>(getpid()); |
| 676 } | 676 } |
| 677 | 677 |
| 678 | 678 |
| 679 static Mutex* signal_mutex = new Mutex(); | 679 static Mutex* signal_mutex = new Mutex(); |
| 680 static SignalInfo* signal_handlers = NULL; | 680 static SignalInfo* signal_handlers = NULL; |
| 681 static const int kSignalsCount = 6; | 681 static const int kSignalsCount = 7; |
| 682 static const int kSignals[kSignalsCount] = { | 682 static const int kSignals[kSignalsCount] = { |
| 683 SIGHUP, | 683 SIGHUP, |
| 684 SIGINT, | 684 SIGINT, |
| 685 SIGTERM, | 685 SIGTERM, |
| 686 SIGUSR1, | 686 SIGUSR1, |
| 687 SIGUSR2, | 687 SIGUSR2, |
| 688 SIGWINCH | 688 SIGWINCH, |
| 689 SIGQUIT // Allow VMService to listen on SIGQUIT. |
| 689 }; | 690 }; |
| 690 | 691 |
| 691 | 692 |
| 692 SignalInfo::~SignalInfo() { | 693 SignalInfo::~SignalInfo() { |
| 693 VOID_TEMP_FAILURE_RETRY(close(fd_)); | 694 VOID_TEMP_FAILURE_RETRY(close(fd_)); |
| 694 } | 695 } |
| 695 | 696 |
| 696 | 697 |
| 697 static void SignalHandler(int signal) { | 698 static void SignalHandler(int signal) { |
| 698 MutexLocker lock(signal_mutex); | 699 MutexLocker lock(signal_mutex); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 bzero(&act, sizeof(act)); | 792 bzero(&act, sizeof(act)); |
| 792 act.sa_handler = SIG_DFL; | 793 act.sa_handler = SIG_DFL; |
| 793 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); | 794 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); |
| 794 } | 795 } |
| 795 } | 796 } |
| 796 | 797 |
| 797 } // namespace bin | 798 } // namespace bin |
| 798 } // namespace dart | 799 } // namespace dart |
| 799 | 800 |
| 800 #endif // defined(TARGET_OS_MACOS) | 801 #endif // defined(TARGET_OS_MACOS) |
| OLD | NEW |