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/platform.h" | 8 #include "bin/platform.h" |
9 | 9 |
10 #include <signal.h> // NOLINT | 10 #include <signal.h> // NOLINT |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 return false; | 47 return false; |
48 } | 48 } |
49 if (sigaddset(&act.sa_mask, SIGPROF) != 0) { | 49 if (sigaddset(&act.sa_mask, SIGPROF) != 0) { |
50 perror("sigaddset() failed"); | 50 perror("sigaddset() failed"); |
51 return false; | 51 return false; |
52 } | 52 } |
53 if (sigaction(SIGSEGV, &act, NULL) != 0) { | 53 if (sigaction(SIGSEGV, &act, NULL) != 0) { |
54 perror("sigaction() failed."); | 54 perror("sigaction() failed."); |
55 return false; | 55 return false; |
56 } | 56 } |
| 57 if (sigaction(SIGTRAP, &act, NULL) != 0) { |
| 58 perror("sigaction() failed."); |
| 59 return false; |
| 60 } |
57 return true; | 61 return true; |
58 } | 62 } |
59 | 63 |
60 | 64 |
61 int Platform::NumberOfProcessors() { | 65 int Platform::NumberOfProcessors() { |
62 return sysconf(_SC_NPROCESSORS_ONLN); | 66 return sysconf(_SC_NPROCESSORS_ONLN); |
63 } | 67 } |
64 | 68 |
65 | 69 |
66 const char* Platform::OperatingSystem() { | 70 const char* Platform::OperatingSystem() { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 111 |
108 | 112 |
109 void Platform::Exit(int exit_code) { | 113 void Platform::Exit(int exit_code) { |
110 exit(exit_code); | 114 exit(exit_code); |
111 } | 115 } |
112 | 116 |
113 } // namespace bin | 117 } // namespace bin |
114 } // namespace dart | 118 } // namespace dart |
115 | 119 |
116 #endif // defined(TARGET_OS_LINUX) | 120 #endif // defined(TARGET_OS_LINUX) |
OLD | NEW |