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 <errno.h> // NOLINT | 8 #include <errno.h> // NOLINT |
9 #include <stdio.h> // NOLINT | 9 #include <stdio.h> // NOLINT |
10 #include <stdlib.h> // NOLINT | 10 #include <stdlib.h> // NOLINT |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 DebuggerConnectionHandler::listener_fd_, &event)); | 99 DebuggerConnectionHandler::listener_fd_, &event)); |
100 if (status == -1) { | 100 if (status == -1) { |
101 FATAL("Failed adding listener fd to epoll instance"); | 101 FATAL("Failed adding listener fd to epoll instance"); |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 | 105 |
106 void DebuggerConnectionImpl::StartHandler(int port_number) { | 106 void DebuggerConnectionImpl::StartHandler(int port_number) { |
107 ASSERT(DebuggerConnectionHandler::listener_fd_ != -1); | 107 ASSERT(DebuggerConnectionHandler::listener_fd_ != -1); |
108 SetupPollQueue(); | 108 SetupPollQueue(); |
109 int result = dart::Thread::Start(&DebuggerConnectionImpl::Handler, 0); | 109 int result = Thread::Start(&DebuggerConnectionImpl::Handler, 0); |
110 if (result != 0) { | 110 if (result != 0) { |
111 FATAL1("Failed to start debugger connection handler thread: %d\n", result); | 111 FATAL1("Failed to start debugger connection handler thread: %d\n", result); |
112 } | 112 } |
113 } | 113 } |
114 | 114 |
115 | 115 |
116 intptr_t DebuggerConnectionImpl::Send(intptr_t socket, | 116 intptr_t DebuggerConnectionImpl::Send(intptr_t socket, |
117 const char* buf, | 117 const char* buf, |
118 int len) { | 118 int len) { |
119 return TEMP_FAILURE_RETRY(write(socket, buf, len)); | 119 return TEMP_FAILURE_RETRY(write(socket, buf, len)); |
120 } | 120 } |
121 | 121 |
122 | 122 |
123 intptr_t DebuggerConnectionImpl::Receive(intptr_t socket, char* buf, int len) { | 123 intptr_t DebuggerConnectionImpl::Receive(intptr_t socket, char* buf, int len) { |
124 return TEMP_FAILURE_RETRY(read(socket, buf, len)); | 124 return TEMP_FAILURE_RETRY(read(socket, buf, len)); |
125 } | 125 } |
126 | 126 |
127 } // namespace bin | 127 } // namespace bin |
128 } // namespace dart | 128 } // namespace dart |
129 | 129 |
130 #endif // defined(TARGET_OS_LINUX) | 130 #endif // defined(TARGET_OS_LINUX) |
OLD | NEW |