| 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_LINUX) | 6 #if defined(HOST_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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 return false; | 46 return false; |
| 47 } | 47 } |
| 48 if (sigaddset(&act.sa_mask, SIGPROF) != 0) { | 48 if (sigaddset(&act.sa_mask, SIGPROF) != 0) { |
| 49 perror("sigaddset() failed"); | 49 perror("sigaddset() failed"); |
| 50 return false; | 50 return false; |
| 51 } | 51 } |
| 52 if (sigaction(SIGSEGV, &act, NULL) != 0) { | 52 if (sigaction(SIGSEGV, &act, NULL) != 0) { |
| 53 perror("sigaction() failed."); | 53 perror("sigaction() failed."); |
| 54 return false; | 54 return false; |
| 55 } | 55 } |
| 56 if (sigaction(SIGBUS, &act, NULL) != 0) { |
| 57 perror("sigaction() failed."); |
| 58 return false; |
| 59 } |
| 56 if (sigaction(SIGTRAP, &act, NULL) != 0) { | 60 if (sigaction(SIGTRAP, &act, NULL) != 0) { |
| 57 perror("sigaction() failed."); | 61 perror("sigaction() failed."); |
| 58 return false; | 62 return false; |
| 59 } | 63 } |
| 60 return true; | 64 return true; |
| 61 } | 65 } |
| 62 | 66 |
| 63 int Platform::NumberOfProcessors() { | 67 int Platform::NumberOfProcessors() { |
| 64 return sysconf(_SC_NPROCESSORS_ONLN); | 68 return sysconf(_SC_NPROCESSORS_ONLN); |
| 65 } | 69 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 } | 118 } |
| 115 | 119 |
| 116 void Platform::Exit(int exit_code) { | 120 void Platform::Exit(int exit_code) { |
| 117 exit(exit_code); | 121 exit(exit_code); |
| 118 } | 122 } |
| 119 | 123 |
| 120 } // namespace bin | 124 } // namespace bin |
| 121 } // namespace dart | 125 } // namespace dart |
| 122 | 126 |
| 123 #endif // defined(HOST_OS_LINUX) | 127 #endif // defined(HOST_OS_LINUX) |
| OLD | NEW |