Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (g - h) gethostent(3)
NAME
gethostent - Gets the next entry in the network host database
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zinetdll |
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yinetdll |
SYNOPSIS
[#include <sys/socket.h>]
#include <netdb.h>
struct hostent *gethostent(void);
PARAMETERS
None.
DESCRIPTION
The gethostent( ) function retrieves the next entry in /etc/hosts, the network host database.
If multiple threads interleave calls to gethostbyname_r( ), gethostbyaddr_r( ), gethostent_r( )
and their base versions, the threads enumerate disjoint subsets of the hosts database.
NOTES
In a threaded environment, the behavior of the application is undetermined if more than one
thread in application is calling different sequences of the sethostent( ), gethostent( ),
gethostent_r( ), gethostbyaddr( ), gethostbyaddr_r( ), gethostbyname( ), gethostbyname_r( ),
or endhostent( ) functions.
RETURN VALUES
On successful completion, gethostent( ) returns a pointer to a hostent structure if the entry was
found, and a null pointer if the end of the database was reached. If the call to gethostent( ) fails,
a null pointer is returned.
ERRORS
gethostent( ) does not set errno.
FILES
/etc/hosts The Internet network hostname database. Each record in the file occupies a sin-
gle line and has three fields: the host address, the official hostname, and aliases.
RELATED INFORMATION
Functions: gethostbyname(3), gethostbyaddr(3), sethostent(3).
Files: hosts(4).
527187-017 Hewlett-Packard Company 3−65