刚才学了gethostbyname函数,这个gethostbyaddr函数的作用是通过一个IPv4的地址来获取主机信息,并放在hostent结构体中. #include <netdb.h> struct hostent * gethostbyaddr(const char * addr, socklen_t len, int family);//返回:若成功则为非空指针,若出错则为NULL且设置h_errno //上面的const char * 是UNP中的写法,而我在linux 2.6中看到…