Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netdb.h>
- #include <string.h>
- #include <stdio.h>
- /*
- int getaddrinfo(const char *hostname,
- const char *service,
- const struct addrinfo *hints,
- struct addrinfo **res);
- */
- int main() {
- const char *hostname = "joel-desktop";
- const char *service = NULL;
- const struct addrinfo *hints = NULL;
- struct addrinfo *res = NULL;
- int ret = getaddrinfo(hostname, service, hints, &res);
- printf("getaddrinfo returned %d\n", ret);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement