| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 int result = fstat(fd, &buf); | 195 int result = fstat(fd, &buf); |
| 196 if (result == -1) return -1; | 196 if (result == -1) return -1; |
| 197 if (S_ISCHR(buf.st_mode)) return File::kTerminal; | 197 if (S_ISCHR(buf.st_mode)) return File::kTerminal; |
| 198 if (S_ISFIFO(buf.st_mode)) return File::kPipe; | 198 if (S_ISFIFO(buf.st_mode)) return File::kPipe; |
| 199 if (S_ISREG(buf.st_mode)) return File::kFile; | 199 if (S_ISREG(buf.st_mode)) return File::kFile; |
| 200 return File::kOther; | 200 return File::kOther; |
| 201 } | 201 } |
| 202 | 202 |
| 203 | 203 |
| 204 intptr_t Socket::GetStdioHandle(intptr_t num) { | 204 intptr_t Socket::GetStdioHandle(intptr_t num) { |
| 205 Socket::SetNonBlocking(num); |
| 205 return num; | 206 return num; |
| 206 } | 207 } |
| 207 | 208 |
| 208 | 209 |
| 209 AddressList<SocketAddress>* Socket::LookupAddress(const char* host, | 210 AddressList<SocketAddress>* Socket::LookupAddress(const char* host, |
| 210 int type, | 211 int type, |
| 211 OSError** os_error) { | 212 OSError** os_error) { |
| 212 // Perform a name lookup for a host name. | 213 // Perform a name lookup for a host name. |
| 213 struct addrinfo hints; | 214 struct addrinfo hints; |
| 214 memset(&hints, 0, sizeof(hints)); | 215 memset(&hints, 0, sizeof(hints)); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 IPPROTO_TCP, | 417 IPPROTO_TCP, |
| 417 TCP_NODELAY, | 418 TCP_NODELAY, |
| 418 reinterpret_cast<char *>(&on), | 419 reinterpret_cast<char *>(&on), |
| 419 sizeof(on))) == 0; | 420 sizeof(on))) == 0; |
| 420 } | 421 } |
| 421 | 422 |
| 422 } // namespace bin | 423 } // namespace bin |
| 423 } // namespace dart | 424 } // namespace dart |
| 424 | 425 |
| 425 #endif // defined(TARGET_OS_MACOS) | 426 #endif // defined(TARGET_OS_MACOS) |
| OLD | NEW |