libexplain
1.4.D001
|
#include <libexplain/ac/assert.h>
#include <libexplain/ac/errno.h>
#include <libexplain/ac/netdb.h>
#include <libexplain/getaddrinfo.h>
#include <libexplain/output.h>
Go to the source code of this file.
Functions | |
int | explain_getaddrinfo_on_error (const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res) |
int explain_getaddrinfo_on_error | ( | const char * | node, |
const char * | service, | ||
const struct addrinfo * | hints, | ||
struct addrinfo ** | res | ||
) |
The explain_getaddrinfo_on_error function is used to call the getaddrinfo(3) system call. On failure an explanation will be printed to stderr, but it still returns.
This function is intended to be used in a fashion similar to the following example:
if (explain_getaddrinfo_on_error(node, service, hints, res)) { ...handle error ...error message already printed }
node | The node, exactly as to be passed to the getaddrinfo(3) system call. |
service | The service, exactly as to be passed to the getaddrinfo(3) system call. |
hints | The hints, exactly as to be passed to the getaddrinfo(3) system call. |
res | The res, exactly as to be passed to the getaddrinfo(3) system call. |
Definition at line 28 of file getaddrinfo_on_error.c.