| 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_ANDROID) | 6 #if defined(TARGET_OS_ANDROID) |
| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 int result = fstat(fd, &buf); | 194 int result = fstat(fd, &buf); |
| 195 if (result == -1) return -1; | 195 if (result == -1) return -1; |
| 196 if (S_ISCHR(buf.st_mode)) return File::kTerminal; | 196 if (S_ISCHR(buf.st_mode)) return File::kTerminal; |
| 197 if (S_ISFIFO(buf.st_mode)) return File::kPipe; | 197 if (S_ISFIFO(buf.st_mode)) return File::kPipe; |
| 198 if (S_ISREG(buf.st_mode)) return File::kFile; | 198 if (S_ISREG(buf.st_mode)) return File::kFile; |
| 199 return File::kOther; | 199 return File::kOther; |
| 200 } | 200 } |
| 201 | 201 |
| 202 | 202 |
| 203 intptr_t Socket::GetStdioHandle(intptr_t num) { | 203 intptr_t Socket::GetStdioHandle(intptr_t num) { |
| 204 Socket::SetNonBlocking(num); |
| 204 return num; | 205 return num; |
| 205 } | 206 } |
| 206 | 207 |
| 207 | 208 |
| 208 AddressList<SocketAddress>* Socket::LookupAddress(const char* host, | 209 AddressList<SocketAddress>* Socket::LookupAddress(const char* host, |
| 209 int type, | 210 int type, |
| 210 OSError** os_error) { | 211 OSError** os_error) { |
| 211 // Perform a name lookup for a host name. | 212 // Perform a name lookup for a host name. |
| 212 struct addrinfo hints; | 213 struct addrinfo hints; |
| 213 memset(&hints, 0, sizeof(hints)); | 214 memset(&hints, 0, sizeof(hints)); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 IPPROTO_TCP, | 384 IPPROTO_TCP, |
| 384 TCP_NODELAY, | 385 TCP_NODELAY, |
| 385 reinterpret_cast<char *>(&on), | 386 reinterpret_cast<char *>(&on), |
| 386 sizeof(on))) == 0; | 387 sizeof(on))) == 0; |
| 387 } | 388 } |
| 388 | 389 |
| 389 } // namespace bin | 390 } // namespace bin |
| 390 } // namespace dart | 391 } // namespace dart |
| 391 | 392 |
| 392 #endif // defined(TARGET_OS_ANDROID) | 393 #endif // defined(TARGET_OS_ANDROID) |
| OLD | NEW |