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

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

Issue 99933002: [NaCl SDK] nacl_io: implement getaddrinfo() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
binji 2014/01/29 19:18:52 In the man pages it says EAI_SYSTEM should set err
Sam Clegg 2014/01/29 22:06:13 That would be a little more complicated, since our
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698