![]() |
![]() |
![]() |
![]() |
![]() |
This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Get a network host entry, in a thread-safe manner
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
struct hostent * gethostbyaddr_r(
const void * addr,
socklen_t length,
int type,
struct hostent * result,
char * buffer,
int buflen,
int * h_errnop );
libsocket
Use the -l socket option to qcc to link against this library.
The gethostbyaddr_r() function is a thread-safe version of gethostbyaddr(). This function gets the network host entry for the host specified by addr. The addr argument is the network address of the specified network family, type. The buffer for addr is at least length bytes.
If you need to convert a text-based address into the format necessary for use as gethostbyaddr_r()'s addr, see inet_pton().
A pointer to result, or NULL if an error occurs.
If an error occurs, the int pointed to by h_errnop is set to:
| Safety: | |
|---|---|
| Cancellation point | Yes |
| Interrupt handler | No |
| Signal handler | No |
| Thread | Yes |
gethostbyaddr(), gethostbyname(), gethostbyname_r(), inet_ntop(), inet_pton()
/etc/hosts, /etc/resolv.conf in the Utilities Reference
![]() |
![]() |
![]() |
![]() |