OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "nacl_io/kernel_proxy.h" | 5 #include "nacl_io/kernel_proxy.h" |
6 | 6 |
7 #include <assert.h> | 7 #include <assert.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <limits.h> | 10 #include <limits.h> |
(...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 | 1257 |
1258 error = handle->Connect(addr, len); | 1258 error = handle->Connect(addr, len); |
1259 if (error != 0) { | 1259 if (error != 0) { |
1260 errno = error; | 1260 errno = error; |
1261 return -1; | 1261 return -1; |
1262 } | 1262 } |
1263 | 1263 |
1264 return 0; | 1264 return 0; |
1265 } | 1265 } |
1266 | 1266 |
| 1267 void KernelProxy::freeaddrinfo(struct addrinfo *res) { |
| 1268 return host_resolver_.freeaddrinfo(res); |
| 1269 } |
| 1270 |
| 1271 int KernelProxy::getaddrinfo(const char* node, const char* service, |
| 1272 const struct addrinfo* hints, |
| 1273 struct addrinfo** res) { |
| 1274 return host_resolver_.getaddrinfo(node, service, hints, res); |
| 1275 } |
| 1276 |
1267 struct hostent* KernelProxy::gethostbyname(const char* name) { | 1277 struct hostent* KernelProxy::gethostbyname(const char* name) { |
1268 return host_resolver_.gethostbyname(name); | 1278 return host_resolver_.gethostbyname(name); |
1269 } | 1279 } |
1270 | 1280 |
1271 int KernelProxy::getpeername(int fd, struct sockaddr* addr, socklen_t* len) { | 1281 int KernelProxy::getpeername(int fd, struct sockaddr* addr, socklen_t* len) { |
1272 if (NULL == addr || NULL == len) { | 1282 if (NULL == addr || NULL == len) { |
1273 errno = EFAULT; | 1283 errno = EFAULT; |
1274 return -1; | 1284 return -1; |
1275 } | 1285 } |
1276 | 1286 |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1619 errno = ENOTSOCK; | 1629 errno = ENOTSOCK; |
1620 return -1; | 1630 return -1; |
1621 } | 1631 } |
1622 | 1632 |
1623 return 0; | 1633 return 0; |
1624 } | 1634 } |
1625 | 1635 |
1626 #endif // PROVIDES_SOCKET_API | 1636 #endif // PROVIDES_SOCKET_API |
1627 | 1637 |
1628 } // namespace_nacl_io | 1638 } // namespace_nacl_io |
OLD | NEW |