diff --git a/lib/lwres/Makefile.in b/lib/lwres/Makefile.in index 359c2b8320..fc3ec440a1 100644 --- a/lib/lwres/Makefile.in +++ b/lib/lwres/Makefile.in @@ -26,13 +26,13 @@ CDEFINES = CWARNINGS = # Alphabetically -OBJS = context.@O@ getaddrinfo.@O@ gethost.@O@ getipnode.@O@ \ - getnameinfo.@O@ getnet.@O@ herror.@O@ lwbuffer.@O@ \ - lwpacket.@O@ lwresutil.@O@ lwres_gabn.@O@ lwres_gnba.@O@ \ - lwres_noop.@O@ +OBJS = context.@O@ gai_strerror.@O@ getaddrinfo.@O@ gethost.@O@ \ + getipnode.@O@ getnameinfo.@O@ getnet.@O@ herror.@O@ \ + lwbuffer.@O@ lwpacket.@O@ lwresutil.@O@ lwres_gabn.@O@ \ + lwres_gnba.@O@ lwres_noop.@O@ # Alphabetically -SRCS = context.c getaddrinfo.c gethost.c getipnode.c \ +SRCS = context.c gai_strerror.c getaddrinfo.c gethost.c getipnode.c \ getnameinfo.c getnet.c herror.c lwbuffer.c lwpacket.c \ lwresutil.c lwres_gabn.c lwres_gnba.c lwres_noop.c diff --git a/lib/lwres/gai_strerror.c b/lib/lwres/gai_strerror.c new file mode 100644 index 0000000000..57bac5759f --- /dev/null +++ b/lib/lwres/gai_strerror.c @@ -0,0 +1,43 @@ +/* +%%% copyright-cmetz-97 +This software is Copyright 1997-1998 by Craig Metz, All Rights Reserved. +The Inner Net License Version 2 applies to this software. +You should have received a copy of the license with this software. If +you didn't get a copy, you may request one from . + +*/ + +#include +#include + +char * +gai_strerror(int errnum) { + switch(errnum) { + case 0: + return "no error"; + case EAI_BADFLAGS: + return "invalid value for ai_flags"; + case EAI_NONAME: + return "name or service is not known"; + case EAI_AGAIN: + return "temporary failure in name resolution"; + case EAI_FAIL: + return "non-recoverable failure in name resolution"; + case EAI_NODATA: + return "no address associated with name"; + case EAI_FAMILY: + return "ai_family not supported"; + case EAI_SOCKTYPE: + return "ai_socktype not supported"; + case EAI_SERVICE: + return "service not supported for ai_socktype"; + case EAI_ADDRFAMILY: + return "address family for name not supported"; + case EAI_MEMORY: + return "memory allocation failure"; + case EAI_SYSTEM: + return "system error"; + default: + return "unknown error"; + }; +}