|
发表于 2006-12-25 19:51:14
|
显示全部楼层
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netdb.h>
- struct hostent *getipnodebyname(const char *name,
- int af, int flags,
- int *error_num);
- struct hostent *getipnodebyaddr(const void *addr,
- size_t len, int af,
- int *error_num);
- void freehostent(struct hostent *ip);
复制代码 不过系统现在推荐用getaddrinfo和getnameinfo。 |
|