RHOST(3N) — Silicon Graphics
NAME
rhost, raddr − look up internet hosts by name or address
SYNOPSIS
iaddr = rhost(aname);
long iaddr;
char **aname; name = raddr(iaddr);
long iaddr;
DESCRIPTION
rhost uses the pointer to an Internet host name (aname) and returns the 32-bit Internet address in network byte order. This is used as the sockaddr_in Internet address as sockaddr_in.sin_addr.s_addr. If the host name is unknown, rhost returns −1. If the host name is known, *aname points to the standard name of the specified host (the first name in its entry in /etc/hosts). The return value is saved with malloc and is not destroyed on subsequent calls.
raddr works similarly, looking up the name for an Internet address.
FILES
/etc/hosts
SEE ALSO
rsh(1C), rlogin(1C), socket(3N)
Version 2.4 — September 29, 2021