Open System Services System Calls Reference Manual (G06.28+)

gethostbyaddr_r(2) OSS System Calls Reference Manual
NAME
gethostbyaddr_r - Gets a network host entry by address (AF_INET only) (reentrant)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <sys/socket.h>]
[#include <netdb.h>]
#include <spthread.h>
[extern h_errno;]
struct hostent *gethostbyaddr_r (
const char *addr,
int length,
int type,
struct hostent *host,
char *buffer,
int buen,
int *h_errnop
);
PARAMETERS
addr Species an Internet address in network-byte order.
length On input, species the number of bytes in addr. On output, species the number
of bytes in the retrieved address.
type Species the Internet domain address format. The value AF_INET must be
used.
host Points to a struct hostent structure allocated by the caller.
buffer Points to the buffer supplied by the caller and used as a storage space for host
data.
buflen Species the size of the buffer passed in bytes.
h_errnop Points to the global integer h_errno to indicate the error code if an error occurs.
See the ERRORS subsection of this reference page for the possible values that
can be returned.
DESCRIPTION
The gethostbyaddr_r() function is the reentrant version of the gethostbyaddr() function.
The gethostbyaddr_r() function searches host entries until a match with the addr and type
parameters is found. This function returns a pointer to a hostent struct whose members specify
data from a name server specied in the /etc/resolv.conf le or the /etc/hosts network hostname
database le. gethostbyaddr_r() rst attempts to search /etc/resolv.conf, but when the name
server is not running, the gethostbyaddr_r() function searches the hosts name le.
The gethostbyaddr_r() function updates the hostent structure pointed to by the host parameter.
Storage referenced by the hostent structure is allocated from the memory provided with the
buffer parameter, which is buen characters in size. The h_errnop parameter is updated with the
value of the h_errno variable to indicate any errors.
The hostent structure is dened in the netdb.h header le.
354 Hewlett-Packard Company 527186-005