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(HOST_OS_MACOS) | 6 #if defined(HOST_OS_MACOS) |
7 | 7 |
8 #include "bin/platform.h" | 8 #include "bin/platform.h" |
9 | 9 |
10 #include <CoreFoundation/CoreFoundation.h> | 10 #include <CoreFoundation/CoreFoundation.h> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 return false; | 53 return false; |
54 } | 54 } |
55 if (sigaddset(&act.sa_mask, SIGPROF) != 0) { | 55 if (sigaddset(&act.sa_mask, SIGPROF) != 0) { |
56 perror("sigaddset() failed"); | 56 perror("sigaddset() failed"); |
57 return false; | 57 return false; |
58 } | 58 } |
59 if (sigaction(SIGSEGV, &act, NULL) != 0) { | 59 if (sigaction(SIGSEGV, &act, NULL) != 0) { |
60 perror("sigaction() failed."); | 60 perror("sigaction() failed."); |
61 return false; | 61 return false; |
62 } | 62 } |
| 63 if (sigaction(SIGBUS, &act, NULL) != 0) { |
| 64 perror("sigaction() failed."); |
| 65 return false; |
| 66 } |
63 if (sigaction(SIGTRAP, &act, NULL) != 0) { | 67 if (sigaction(SIGTRAP, &act, NULL) != 0) { |
64 perror("sigaction() failed."); | 68 perror("sigaction() failed."); |
65 return false; | 69 return false; |
66 } | 70 } |
67 return true; | 71 return true; |
68 } | 72 } |
69 | 73 |
70 int Platform::NumberOfProcessors() { | 74 int Platform::NumberOfProcessors() { |
71 int32_t cpus = -1; | 75 int32_t cpus = -1; |
72 size_t cpus_length = sizeof(cpus); | 76 size_t cpus_length = sizeof(cpus); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 } | 206 } |
203 | 207 |
204 void Platform::Exit(int exit_code) { | 208 void Platform::Exit(int exit_code) { |
205 exit(exit_code); | 209 exit(exit_code); |
206 } | 210 } |
207 | 211 |
208 } // namespace bin | 212 } // namespace bin |
209 } // namespace dart | 213 } // namespace dart |
210 | 214 |
211 #endif // defined(HOST_OS_MACOS) | 215 #endif // defined(HOST_OS_MACOS) |
OLD | NEW |