TCP/IP Programming Manual

Errors
Upon successful completion, this function returns 0 (zero) and the requested values are stored in
the buffers specified for the call. Otherwise, the value returned is nonzero and errno is set to
indicate the error (only when the error is EAI_SYSTEM). See the return values described for
lwres_gai_strerror (page 141).
Example
The example calls the lwres_getnameinfo routine to get a hostname's fully qualified domain
name.
error = lwres_getnameinfo((struct sockaddr *)sin,
addrlen, hname, sizeof(hname), sname,
sizeof(sname), NI_NUMERICHOST|NI_NUMERICSERV);
if(error)
ifprintf(stderr, "Error: %s\n", lwres_gai_strerror(error));
Usage Guidelines
By default, this function returns the hostname's fully qualified domain name.
This function, along with lwres_getipnodebyaddr, is a protocol-independent replacement for
lwres_gethostbyaddr. lwres_getnameinfo provides extra functionality because it handles
both the host's address and port number.
lwres_hstrerror
The lwres_hstrerror function returns an appropriate string for the error code given by err_num.
(This function is supported for G06.27 and later G-series RVUs and H06.05 and later H-series
RVUs of NonStop TCP/IPv6.)
C Synopsis
#include <netdb.h>
const char * lwres_hstrerror(int err_num);
TAL Synopsis
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
ret_val := lwres_hstrerror(err_num)
INT(32) ret_val;
INT err_num;
ret_val
return value; a pointer to a string described in err_num.
err_num
input value; specifies the integer error code.
Errors
The values of the error codes and messages are:
NETDB_SUCCESS
Resolver error 0 (no error).
HOST_NOT_FOUND
Unknown host.
TRY_AGAIN
hostname lookup failure.
152 Library Routines