.TH gethostbyaddr() "" "" "Sockets Function (libsocket)"
.PC "Retrieve host information by address"
.B "#include <netinet/in.h>"
.B "#include <arpa/inet.h>"
.B "#include <netdb.h>"
.B "#include <sys/socket.h>"
\fBstruct hostent *gethostbyaddr(\fIaddr\^\fB, \fIlen\^\fB, \fItype\^\fB)\fR
\fBchar *\fIhost\^\fB;\fR
\fBint \fIlen\^\fB, \fItype\^\fB;\fR
.PP
Function
.B gethostbyaddr()
interrogates file
.B /etc/hosts
and returns information about a given host on a network.
.PP
.II "Internet^address"
.I addr
gives the address at which the host's Internet address resides in memory.
.I length
gives the number of characters in its name.
.I type
gives the type of address this is.
If it is anything other than type
.BR AF_INET ,
.B gethostbyaddr()
returns NULL.
.PP
If it could find information about the host in question,
.B gethostbyaddr()
returns the address in a instance of structure
.BR hostent ,
which is defined in header file
.BR <netdb.h> .
If it could not, it returns
.BR NULL .
.SH "See Also"
.Xr "endhostent()," endhosten
.Xr "gethostbyname()," gethostbn
.Xr "libsocket," libsocket
.Xr "sethostent()" sethosten












     Page 2


