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

Side by Side Diff: runtime/bin/process_linux.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_android.cc ('k') | runtime/bin/process_macos.cc » ('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_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
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
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)
OLDNEW
« no previous file with comments | « runtime/bin/process_android.cc ('k') | runtime/bin/process_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698