Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
lwres_gethostbyname(3) OSS Library Calls Reference Manual
NAME
lwres_gethostbyname - Gets the Internet address (IPv4) of the host whose name is specified
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 <netdb.h>
extern lwres_h_errno
struct hostent *lwres_gethostbyname(
const char *name );
PARAMETERS
name Points to either the official name or an alias of the host whose Internet address is
to be found.
DESCRIPTION
The lwres_gethostbyname( ) function gets the address of the host with the specified Internet host
name. This function provides the same information as the gethostbyname( ) function but uses
the Domain Name System (DNS) lightweight resolver server lwresd instead of the named DNS
server.
EXAMPLE
char *name;
struct hostent *hp;
hp = lwres_gethostbyname(name);
The above example makes a call to lwres_gethostbyname( ) by passing the Internet host name
as an argument. If an answer is found, a pointer to the hostent structure is returned and stored in
hp. NULL is returned if no answer is found.
NOTES
The name value passed to the lwres_gethostbyname( ) function is case-sensitive.
The hostent structure is statically declared. Subsequent calls to lwres_gethostbyname( ) replace
the existing data in the hostent structure.
RETURNED VALUES
Upon successful completion of the call, the returned value points to a structure (based on the
hostent structure) in which information for the specified host is returned. The information
includes the official name, aliases, and addresses for the host.
ERRORS
If the call fails, lwres_gethostbyname( ) returns NULL to indicate an error. In this case, the glo-
bal variable lwres_h_errno contains one of the following error codes as defined in the netdb.h
header file:
HOST_NOT_FOUND
The host or address was not found.
TRY_AGAIN A recoverable error occurred, for example, a timeout. Retrying the lookup might
succeed.
4−162 Hewlett-Packard Company 527187-017