OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 <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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 struct stat buf; | 185 struct stat buf; |
186 int result = fstat(fd, &buf); | 186 int result = fstat(fd, &buf); |
187 if (result == -1) return -1; | 187 if (result == -1) return -1; |
188 if (S_ISCHR(buf.st_mode)) return File::kTerminal; | 188 if (S_ISCHR(buf.st_mode)) return File::kTerminal; |
189 if (S_ISFIFO(buf.st_mode)) return File::kPipe; | 189 if (S_ISFIFO(buf.st_mode)) return File::kPipe; |
190 if (S_ISREG(buf.st_mode)) return File::kFile; | 190 if (S_ISREG(buf.st_mode)) return File::kFile; |
191 return File::kOther; | 191 return File::kOther; |
192 } | 192 } |
193 | 193 |
194 | 194 |
195 intptr_t Socket::GetStdioHandle(int num) { | 195 intptr_t Socket::GetStdioHandle(intptr_t num) { |
196 return static_cast<intptr_t>(num); | 196 return num; |
197 } | 197 } |
198 | 198 |
199 | 199 |
200 AddressList<SocketAddress>* Socket::LookupAddress(const char* host, | 200 AddressList<SocketAddress>* Socket::LookupAddress(const char* host, |
201 int type, | 201 int type, |
202 OSError** os_error) { | 202 OSError** os_error) { |
203 // Perform a name lookup for a host name. | 203 // Perform a name lookup for a host name. |
204 struct addrinfo hints; | 204 struct addrinfo hints; |
205 memset(&hints, 0, sizeof(hints)); | 205 memset(&hints, 0, sizeof(hints)); |
206 hints.ai_family = SocketAddress::FromType(type); | 206 hints.ai_family = SocketAddress::FromType(type); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 IPPROTO_TCP, | 407 IPPROTO_TCP, |
408 TCP_NODELAY, | 408 TCP_NODELAY, |
409 reinterpret_cast<char *>(&on), | 409 reinterpret_cast<char *>(&on), |
410 sizeof(on))) == 0; | 410 sizeof(on))) == 0; |
411 } | 411 } |
412 | 412 |
413 } // namespace bin | 413 } // namespace bin |
414 } // namespace dart | 414 } // namespace dart |
415 | 415 |
416 #endif // defined(TARGET_OS_MACOS) | 416 #endif // defined(TARGET_OS_MACOS) |
OLD | NEW |