| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 int result = fstat(fd, &buf); | 219 int result = fstat(fd, &buf); |
| 220 if (result == -1) return -1; | 220 if (result == -1) return -1; |
| 221 if (S_ISCHR(buf.st_mode)) return File::kTerminal; | 221 if (S_ISCHR(buf.st_mode)) return File::kTerminal; |
| 222 if (S_ISFIFO(buf.st_mode)) return File::kPipe; | 222 if (S_ISFIFO(buf.st_mode)) return File::kPipe; |
| 223 if (S_ISREG(buf.st_mode)) return File::kFile; | 223 if (S_ISREG(buf.st_mode)) return File::kFile; |
| 224 return File::kOther; | 224 return File::kOther; |
| 225 } | 225 } |
| 226 | 226 |
| 227 | 227 |
| 228 intptr_t Socket::GetStdioHandle(intptr_t num) { | 228 intptr_t Socket::GetStdioHandle(intptr_t num) { |
| 229 Socket::SetNonBlocking(num); | |
| 230 return num; | 229 return num; |
| 231 } | 230 } |
| 232 | 231 |
| 233 | 232 |
| 234 AddressList<SocketAddress>* Socket::LookupAddress(const char* host, | 233 AddressList<SocketAddress>* Socket::LookupAddress(const char* host, |
| 235 int type, | 234 int type, |
| 236 OSError** os_error) { | 235 OSError** os_error) { |
| 237 // Perform a name lookup for a host name. | 236 // Perform a name lookup for a host name. |
| 238 struct addrinfo hints; | 237 struct addrinfo hints; |
| 239 memset(&hints, 0, sizeof(hints)); | 238 memset(&hints, 0, sizeof(hints)); |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 | 636 |
| 638 bool Socket::LeaveMulticast( | 637 bool Socket::LeaveMulticast( |
| 639 intptr_t fd, RawAddr* addr, RawAddr* interface, int interfaceIndex) { | 638 intptr_t fd, RawAddr* addr, RawAddr* interface, int interfaceIndex) { |
| 640 return JoinOrLeaveMulticast(fd, addr, interface, interfaceIndex, false); | 639 return JoinOrLeaveMulticast(fd, addr, interface, interfaceIndex, false); |
| 641 } | 640 } |
| 642 | 641 |
| 643 } // namespace bin | 642 } // namespace bin |
| 644 } // namespace dart | 643 } // namespace dart |
| 645 | 644 |
| 646 #endif // defined(TARGET_OS_MACOS) | 645 #endif // defined(TARGET_OS_MACOS) |
| OLD | NEW |