Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc

Issue 512603008: [NaCl SDK] nacl_io: add getnameinfo scaffolding (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 return host_resolver_.freeaddrinfo(res); 1349 return host_resolver_.freeaddrinfo(res);
1350 } 1350 }
1351 1351
1352 int KernelProxy::getaddrinfo(const char* node, 1352 int KernelProxy::getaddrinfo(const char* node,
1353 const char* service, 1353 const char* service,
1354 const struct addrinfo* hints, 1354 const struct addrinfo* hints,
1355 struct addrinfo** res) { 1355 struct addrinfo** res) {
1356 return host_resolver_.getaddrinfo(node, service, hints, res); 1356 return host_resolver_.getaddrinfo(node, service, hints, res);
1357 } 1357 }
1358 1358
1359 int KernelProxy::getnameinfo(const struct sockaddr *sa,
1360 socklen_t salen,
1361 char *host,
1362 size_t hostlen,
1363 char *serv,
1364 size_t servlen,
1365 int flags) {
1366 return host_resolver_.getnameinfo(sa, salen, host, hostlen, serv, servlen,
1367 flags);
1368 }
1369
1359 struct hostent* KernelProxy::gethostbyname(const char* name) { 1370 struct hostent* KernelProxy::gethostbyname(const char* name) {
1360 return host_resolver_.gethostbyname(name); 1371 return host_resolver_.gethostbyname(name);
1361 } 1372 }
1362 1373
1363 int KernelProxy::getpeername(int fd, struct sockaddr* addr, socklen_t* len) { 1374 int KernelProxy::getpeername(int fd, struct sockaddr* addr, socklen_t* len) {
1364 if (NULL == addr || NULL == len) { 1375 if (NULL == addr || NULL == len) {
1365 errno = EFAULT; 1376 errno = EFAULT;
1366 return -1; 1377 return -1;
1367 } 1378 }
1368 1379
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
1708 errno = ENOTSOCK; 1719 errno = ENOTSOCK;
1709 return -1; 1720 return -1;
1710 } 1721 }
1711 1722
1712 return 0; 1723 return 0;
1713 } 1724 }
1714 1725
1715 #endif // PROVIDES_SOCKET_API 1726 #endif // PROVIDES_SOCKET_API
1716 1727
1717 } // namespace_nacl_io 1728 } // namespace_nacl_io
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/kernel_proxy.h ('k') | native_client_sdk/src/libraries/nacl_io/library.dsc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698