Back to index

cell-binutils  2.17cvs20070401
Defines | Functions | Variables
xstrerror.c File Reference
#include <stdio.h>
#include "config.h"
#include "libiberty.h"

Go to the source code of this file.


#define ERRSTR_FMT   "undocumented error #%d"


char * strerror (int)
char * xstrerror (int errnum)


static char xstrerror_buf [sizeof ERRSTR_FMT+20]

Define Documentation

#define ERRSTR_FMT   "undocumented error #%d"

Definition at line 48 of file xstrerror.c.

Function Documentation

char* strerror ( int  )

Definition at line 626 of file strerror.c.

  const char *msg;
  static char buf[32];


  if (error_names == NULL)
      init_error_tables ();


  if ((errnoval < 0) || (errnoval >= sys_nerr))
#ifdef EVMSERR
      if (errnoval == evmserr.value)
       msg = evmserr.msg;
      /* Out of range, just return NULL */
      msg = NULL;
  else if ((sys_errlist == NULL) || (sys_errlist[errnoval] == NULL))
      /* In range, but no sys_errlist or no entry at this index. */
      sprintf (buf, "Error %d", errnoval);
      msg = buf;
      /* In range, and a valid message.  Just return the message. */
      msg = (char *) sys_errlist[errnoval];
  return (msg);

Here is the call graph for this function:

char* xstrerror ( int  errnum)

Definition at line 54 of file xstrerror.c.

  char *errstr;
#ifdef VMS
  char *(*vmslib_strerror) (int,...);

  /* Override any possibly-conflicting declaration from system header.  */
  vmslib_strerror = (char *(*) (int,...)) strerror;
  /* Second argument matters iff first is EVMSERR, but it's simpler to
     pass it unconditionally.  `vaxc$errno' is declared in <errno.h>
     and maintained by the run-time library in parallel to `errno'.
     We assume that `errnum' corresponds to the last value assigned to
     errno by the run-time library, hence vaxc$errno will be relevant.  */
  errstr = (*vmslib_strerror) (errnum, vaxc$errno);
  errstr = strerror (errnum);

  /* If `errnum' is out of range, result might be NULL.  We'll fix that.  */
  if (!errstr)
      sprintf (xstrerror_buf, ERRSTR_FMT, errnum);
      errstr = xstrerror_buf;
  return errstr;

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

char xstrerror_buf[sizeof ERRSTR_FMT+20] [static]

Definition at line 49 of file xstrerror.c.