diff options
author | cvs2svn <cvs2svn@FreeBSD.org> | 1999-05-02 10:18:15 +0000 |
---|---|---|
committer | cvs2svn <cvs2svn@FreeBSD.org> | 1999-05-02 10:18:15 +0000 |
commit | dad085251b33ea35bd93522a98d4a54bf7fdfbde (patch) | |
tree | 03217800ac8d41e0e851ad678aea070c6f5a4840 /contrib/gdb/libiberty/xstrerror.c | |
parent | f2489878f0ac9621ddd293f6f626b62ec6e8f5f4 (diff) |
Notes
Diffstat (limited to 'contrib/gdb/libiberty/xstrerror.c')
-rw-r--r-- | contrib/gdb/libiberty/xstrerror.c | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/contrib/gdb/libiberty/xstrerror.c b/contrib/gdb/libiberty/xstrerror.c deleted file mode 100644 index d05369ac9725f..0000000000000 --- a/contrib/gdb/libiberty/xstrerror.c +++ /dev/null @@ -1,54 +0,0 @@ -/* xstrerror.c -- jacket routine for more robust strerror() usage. - Fri Jun 16 18:30:00 1995 Pat Rankin <rankin@eql.caltech.edu> - This code is in the public domain. */ - -#include "libiberty.h" -#include "config.h" - -#ifdef VMS -#include <errno.h> -#if !defined (__STRICT_ANSI__) && !defined (__HIDE_FORBIDDEN_NAMES) -extern char *strerror PARAMS ((int,...)); -#define DONT_DECLARE_STRERROR -#endif -#endif /* VMS */ - -#ifndef DONT_DECLARE_STRERROR -extern char *strerror PARAMS ((int)); -#endif - -/* If strerror returns NULL, we'll format the number into a static buffer. */ - -#define ERRSTR_FMT "undocumented error #%d" -static char xstrerror_buf[sizeof ERRSTR_FMT + 20]; - -/* Like strerror, but result is never a null pointer. */ - -char * -xstrerror (errnum) - int errnum; -{ - char *errstr; -#ifdef VMS - char *(*vmslib_strerror) PARAMS ((int,...)); - - /* Override any possibly-conflicting declaration from system header. */ - vmslib_strerror = (char *(*) PARAMS ((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); -#else - errstr = strerror (errnum); -#endif - - /* 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; -} |