hstrerror.c

来自「unix网络编程第一卷socket编程书上的全部源代码」· C语言 代码 · 共 31 行

C
31
字号
/* * Return a string containing some additional information after a * host name or address lookup error - gethostbyname() or gethostbyaddr(). * * This is only compiled if the local host does not provide it--recent * versions of BIND supply this function. */#include	"unp.h"const char *hstrerror(int err){	if (err == 0)		return("no error");	if (err == HOST_NOT_FOUND)		return("Unknown host");	if (err == TRY_AGAIN)		return("Hostname lookup failure");	if (err == NO_RECOVERY)		return("Unknown server error");	if (err == NO_DATA)        return("No address associated with name");	return("unknown error");}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?