SCCS-vsn: lib/libc/net/gethostbyname.3 6.5
.\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\"
.\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\"
-.\" @(#)gethostbyname.3 6.4 (Berkeley) %G%
+.\" @(#)gethostbyname.3 6.5 (Berkeley) %G%
.\"
.TH GETHOSTBYNAME 3N ""
.UC 5
.\"
.TH GETHOSTBYNAME 3N ""
.UC 5
each return a pointer to an object with the
following structure.
This structure contains either the information obtained from the name server,
each return a pointer to an object with the
following structure.
This structure contains either the information obtained from the name server,
-.IR named (8)
-or broken-out fields in a line in
+.IR named (8),
+or broken-out fields from a line in
.IR /etc/hosts .
If the local name server is not running these routines do a lookup in
.IR /etc/hosts .
.IR /etc/hosts .
If the local name server is not running these routines do a lookup in
.IR /etc/hosts .
.SH DIAGNOSTICS
.PP
Error return status from
.SH DIAGNOSTICS
.PP
Error return status from
and
.I gethostbyaddr
is indicated by return of a null pointer.
and
.I gethostbyaddr
is indicated by return of a null pointer.
hosts(5), resolver(3), named(8)
.SH CAVEAT
.PP
hosts(5), resolver(3), named(8)
.SH CAVEAT
.PP
-.IR sethostent
-is redefined,
+.I sethostent
+and
+.I endhostent
+are redefined,
when
.IR libc
is built to use only the routines to lookup in
.IR /etc/hosts
and not the name server.
.PP
when
.IR libc
is built to use only the routines to lookup in
.IR /etc/hosts
and not the name server.
.PP
opening the file if necessary.
.PP
opening the file if necessary.
.PP
-.IR Sethostent
-is redefined to open and rewind the file. If
+.I Sethostent
+is redefined to open and rewind the file. If the
the hosts data base will not be closed after each call to
the hosts data base will not be closed after each call to
-.IR gethostent
-(either directly, or indirectly through
-.IR gethostbyname
+.IR gethostbyaddr .
+.I Endhostent
+is redefined to close the file.
.SH BUGS
All information
is contained in a static area
.SH BUGS
All information
is contained in a static area