Advertisement
JoelSjogren

Untitled

Jun 21st, 2013
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.58 KB | None | 0 0
  1. #include <sys/types.h>
  2. #include <sys/socket.h>
  3. #include <netdb.h>
  4. #include <string.h>
  5. #include <stdio.h>
  6.  
  7. /*
  8. int getaddrinfo(const char *hostname,
  9.                 const char *service,
  10.                 const struct addrinfo *hints,
  11.                 struct addrinfo **res);
  12. */
  13.  
  14. int main() {
  15.     const char *hostname = "joel-desktop";
  16.     const char *service = NULL;
  17.     const struct addrinfo *hints = NULL;
  18.     struct addrinfo *res = NULL;
  19.  
  20.     int ret = getaddrinfo(hostname, service, hints, &res);
  21.     printf("getaddrinfo returned %d\n", ret);
  22.    
  23.    
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement