| 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_MACOS) | 6 #if defined(TARGET_OS_MACOS) |
| 7 | 7 |
| 8 #include <mach-o/dyld.h> | |
| 9 #include <sys/types.h> | |
| 10 #include <sys/sysctl.h> | |
| 11 | |
| 12 #include "bin/file.h" | |
| 13 #include "bin/platform.h" | |
| 14 | |
| 15 #if !TARGET_OS_IOS | 8 #if !TARGET_OS_IOS |
| 16 #include <crt_externs.h> // NOLINT | 9 #include <crt_externs.h> // NOLINT |
| 17 #endif // !TARGET_OS_IOS | 10 #endif // !TARGET_OS_IOS |
| 11 #include <mach-o/dyld.h> |
| 18 #include <signal.h> // NOLINT | 12 #include <signal.h> // NOLINT |
| 19 #include <string.h> // NOLINT | 13 #include <string.h> // NOLINT |
| 14 #include <sys/sysctl.h> // NOLINT |
| 15 #include <sys/types.h> // NOLINT |
| 20 #include <unistd.h> // NOLINT | 16 #include <unistd.h> // NOLINT |
| 21 | 17 |
| 22 #include "bin/fdutils.h" | 18 #include "bin/fdutils.h" |
| 23 | 19 #include "bin/file.h" |
| 20 #include "bin/platform.h" |
| 24 | 21 |
| 25 namespace dart { | 22 namespace dart { |
| 26 namespace bin { | 23 namespace bin { |
| 27 | 24 |
| 28 bool Platform::Initialize() { | 25 bool Platform::Initialize() { |
| 29 // Turn off the signal handler for SIGPIPE as it causes the process | 26 // Turn off the signal handler for SIGPIPE as it causes the process |
| 30 // to terminate on writing to a closed pipe. Without the signal | 27 // to terminate on writing to a closed pipe. Without the signal |
| 31 // handler error EPIPE is set instead. | 28 // handler error EPIPE is set instead. |
| 32 struct sigaction act; | 29 struct sigaction act; |
| 33 bzero(&act, sizeof(act)); | 30 bzero(&act, sizeof(act)); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 118 |
| 122 | 119 |
| 123 void Platform::Exit(int exit_code) { | 120 void Platform::Exit(int exit_code) { |
| 124 exit(exit_code); | 121 exit(exit_code); |
| 125 } | 122 } |
| 126 | 123 |
| 127 } // namespace bin | 124 } // namespace bin |
| 128 } // namespace dart | 125 } // namespace dart |
| 129 | 126 |
| 130 #endif // defined(TARGET_OS_MACOS) | 127 #endif // defined(TARGET_OS_MACOS) |
| OLD | NEW |