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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 int result = fstat(fd, &buf); | 218 int result = fstat(fd, &buf); |
219 if (result == -1) return -1; | 219 if (result == -1) return -1; |
220 if (S_ISCHR(buf.st_mode)) return File::kTerminal; | 220 if (S_ISCHR(buf.st_mode)) return File::kTerminal; |
221 if (S_ISFIFO(buf.st_mode)) return File::kPipe; | 221 if (S_ISFIFO(buf.st_mode)) return File::kPipe; |
222 if (S_ISREG(buf.st_mode)) return File::kFile; | 222 if (S_ISREG(buf.st_mode)) return File::kFile; |
223 return File::kOther; | 223 return File::kOther; |
224 } | 224 } |
225 | 225 |
226 | 226 |
227 intptr_t Socket::GetStdioHandle(intptr_t num) { | 227 intptr_t Socket::GetStdioHandle(intptr_t num) { |
228 Socket::SetNonBlocking(num); | |
229 return num; | 228 return num; |
230 } | 229 } |
231 | 230 |
232 | 231 |
233 AddressList<SocketAddress>* Socket::LookupAddress(const char* host, | 232 AddressList<SocketAddress>* Socket::LookupAddress(const char* host, |
234 int type, | 233 int type, |
235 OSError** os_error) { | 234 OSError** os_error) { |
236 // Perform a name lookup for a host name. | 235 // Perform a name lookup for a host name. |
237 struct addrinfo hints; | 236 struct addrinfo hints; |
238 memset(&hints, 0, sizeof(hints)); | 237 memset(&hints, 0, sizeof(hints)); |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 mreq.gr_interface = interfaceIndex; | 575 mreq.gr_interface = interfaceIndex; |
577 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr)); | 576 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr)); |
578 return TEMP_FAILURE_RETRY_BLOCK_SIGNALS(setsockopt( | 577 return TEMP_FAILURE_RETRY_BLOCK_SIGNALS(setsockopt( |
579 fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0; | 578 fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0; |
580 } | 579 } |
581 | 580 |
582 } // namespace bin | 581 } // namespace bin |
583 } // namespace dart | 582 } // namespace dart |
584 | 583 |
585 #endif // defined(TARGET_OS_ANDROID) | 584 #endif // defined(TARGET_OS_ANDROID) |
OLD | NEW |