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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/host_resolver.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef __STDC_LIMIT_MACROS 5 #ifndef __STDC_LIMIT_MACROS
6 #define __STDC_LIMIT_MACROS 6 #define __STDC_LIMIT_MACROS
7 #endif 7 #endif
8 8
9 #include "nacl_io/host_resolver.h" 9 #include "nacl_io/host_resolver.h"
10 10
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 void HostResolver::freeaddrinfo(struct addrinfo* res) { 214 void HostResolver::freeaddrinfo(struct addrinfo* res) {
215 while (res) { 215 while (res) {
216 struct addrinfo* cur = res; 216 struct addrinfo* cur = res;
217 res = res->ai_next; 217 res = res->ai_next;
218 free(cur->ai_addr); 218 free(cur->ai_addr);
219 free(cur->ai_canonname); 219 free(cur->ai_canonname);
220 free(cur); 220 free(cur);
221 } 221 }
222 } 222 }
223 223
224 int HostResolver::getnameinfo(const struct sockaddr *sa,
225 socklen_t salen,
226 char *host,
227 size_t hostlen,
228 char *serv,
229 size_t servlen,
230 int flags) {
231 return ENOSYS;
232 }
233
224 int HostResolver::getaddrinfo(const char* node, 234 int HostResolver::getaddrinfo(const char* node,
225 const char* service, 235 const char* service,
226 const struct addrinfo* hints_in, 236 const struct addrinfo* hints_in,
227 struct addrinfo** result) { 237 struct addrinfo** result) {
228 *result = NULL; 238 *result = NULL;
229 struct addrinfo* end = NULL; 239 struct addrinfo* end = NULL;
230 240
231 if (node == NULL && service == NULL) { 241 if (node == NULL && service == NULL) {
232 LOG_TRACE("node and service are NULL."); 242 LOG_TRACE("node and service are NULL.");
233 return EAI_NONAME; 243 return EAI_NONAME;
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 hostent_.h_addr_list = NULL; 451 hostent_.h_addr_list = NULL;
442 #if !defined(h_addr) 452 #if !defined(h_addr)
443 // Initialize h_addr separately in the case where it is not a macro. 453 // Initialize h_addr separately in the case where it is not a macro.
444 hostent_.h_addr = NULL; 454 hostent_.h_addr = NULL;
445 #endif 455 #endif
446 } 456 }
447 457
448 } // namespace nacl_io 458 } // namespace nacl_io
449 459
450 #endif // PROVIDES_SOCKET_API 460 #endif // PROVIDES_SOCKET_API
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/host_resolver.h ('k') | native_client_sdk/src/libraries/nacl_io/kernel_intercept.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698