Middleware, development tools, realtime operating system
software and services for superior embedded design


Home
QNX Community Resources
Developer Support
QNX Documentation Library
QNX Developer Support

QNX Developer Support

QNX Software Systems
Developer Resources
Blogs
Board support packages
Foundry27 projects
Forums
Hardware support listing
Online video tutorials
Product documentation
Technical Articles

[Previous] [Contents] [Index] [Next]

herror()

Print the message associated with the value of h_errno to standard error

Synopsis:

#include <netdb.h>

void herror( const char* prefix );

Arguments:

prefix
NULL, or a string that you want to print before the error message.

Library:

libsocket

Use the -l socket option to qcc to link against this library.

Description:

The herror() function prints the message corresponding to the error number contained in h_errno to stderr. The following functions can set h_errno:

If the prefix string is non-NULL, it's printed, followed by a colon and a space. The error message is printed with a trailing newline. One of the following messages could be printed:

HOST_NOT_FOUND
Authoritative answer: Unknown host.
NETDB_INTERNAL
You specified an invalid address family when calling gethostbyname2().
NO_DATA
Valid name, no data record of the requested type. The name is known to the name server, but has no IP address associated with it -- this isn't a temporary error. Another type of request to the name server using this domain name will result in an answer (e.g. a mail-forwarder may be registered for this domain).
NO_RECOVERY
Unknown server error. An unexpected server failure was encountered. This is a nonrecoverable network error.
TRY_AGAIN
Nonauthoritative answer: Host name lookup failure. This is usually a temporary error and means that the local server didn't receive a response from an authoritative server. A retry at some later time may succeed.

Classification:

Unix

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler No
Thread No

See also:

gethostbyaddr(), gethostbyaddr_r(), gethostbyname(), gethostbyname_r(), h_errno, res_query(), res_search(), stderr


[Previous] [Contents] [Index] [Next]