Back to index

glibc  2.9
Functions | Variables
herror.c File Reference
#include <sys/types.h>
#include <sys/param.h>
#include <sys/uio.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <netdb.h>
#include <resolv.h>
#include <string.h>
#include <unistd.h>
#include <libintl.h>
#include <not-cancel.h>

Go to the source code of this file.

Functions

void herror (const char *s)
const char * hstrerror (int err)

Variables

const char *const h_errlist []
const int h_nerr = { sizeof h_errlist / sizeof h_errlist[0] }

Function Documentation

void herror ( const char *  s)

Definition at line 81 of file herror.c.

                      {
       struct iovec iov[4], *v = iov;

       if (s != NULL && *s != '\0') {
              v->iov_base = (/*noconst*/ char *)s;
              v->iov_len = strlen(s);
              v++;
              v->iov_base = ": ";
              v->iov_len = 2;
              v++;
       }
       v->iov_base = (char *)hstrerror(h_errno);
       v->iov_len = strlen(v->iov_base);
       v++;
       v->iov_base = "\n";
       v->iov_len = 1;
       writev_not_cancel_no_status(STDERR_FILENO, iov, (v - iov) + 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char* hstrerror ( int  err)

Definition at line 105 of file herror.c.

                   {
       if (err < 0)
              return _("Resolver internal error");
       else if (err < h_nerr)
              return _(h_errlist[err]);
       return _("Unknown resolver error");
}

Here is the caller graph for this function:


Variable Documentation

Initial value:
 {
       N_("Resolver Error 0 (no error)"),
       N_("Unknown host"),                
       N_("Host name lookup failure"),           
       N_("Unknown server error"),        
       N_("No address associated with name"),    
}

Definition at line 67 of file herror.c.

const int h_nerr = { sizeof h_errlist / sizeof h_errlist[0] }

Definition at line 74 of file herror.c.