Dear LazyWeb,
No matter how I modify this following code it does not work with
Solaris. Solaris always returns "non-recoverable name resolution
failure":
int error;
char port_buf[NI_MAXSERV];
size_socket addrLen = sizeof(vio->remote);
if (getpeername(vio->sd, (struct sockaddr *) (&vio->remote),
&addrLen) != 0)
{
DBUG_PRINT("exit", ("getpeername gave error: %d", socket_errno));
DBUG_RETURN(1);
}
if ((error= getnameinfo((struct sockaddr *)(&vio->remote),
sizeof(struct sockaddr_storage),
buf, buflen,
port_buf, NI_MAXSERV, NI_NUMERICHOST|NI_NUMERICSERV)))
{
WATCHPOINT_STRING(gai_strerror(error));
DBUG_PRINT("exit", ("getnameinfo gave error: %s",
gai_strerror(error)));
DBUG_RETURN(1);
}
…
[Read more]