Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(541)

Side by Side Diff: runtime/bin/process_macos.cc

Issue 262463002: Allow internal usage of SIGQUIT signal listening. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/process_linux.cc ('k') | runtime/bin/process_patch.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « runtime/bin/process_linux.cc ('k') | runtime/bin/process_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698