00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include <stdio.h>
00017
00018 #include "config.h"
00019 #include "libiberty.h"
00020
00021 #ifdef VMS
00022 # include <errno.h>
00023 # if !defined (__STRICT_ANSI__) && !defined (__HIDE_FORBIDDEN_NAMES)
00024 # ifdef __cplusplus
00025 extern "C" {
00026 # endif
00027 extern char *strerror (int,...);
00028 # define DONT_DECLARE_STRERROR
00029 # ifdef __cplusplus
00030 }
00031 # endif
00032 # endif
00033 #endif
00034
00035
00036 #ifndef DONT_DECLARE_STRERROR
00037 # ifdef __cplusplus
00038 extern "C" {
00039 # endif
00040 extern char *strerror (int);
00041 # ifdef __cplusplus
00042 }
00043 # endif
00044 #endif
00045
00046
00047
00048 #define ERRSTR_FMT "undocumented error #%d"
00049 static char xstrerror_buf[sizeof ERRSTR_FMT + 20];
00050
00051
00052
00053 char *
00054 xstrerror (int errnum)
00055 {
00056 char *errstr;
00057 #ifdef VMS
00058 char *(*vmslib_strerror) (int,...);
00059
00060
00061 vmslib_strerror = (char *(*) (int,...)) strerror;
00062
00063
00064
00065
00066
00067 errstr = (*vmslib_strerror) (errnum, vaxc$errno);
00068 #else
00069 errstr = strerror (errnum);
00070 #endif
00071
00072
00073 if (!errstr)
00074 {
00075 sprintf (xstrerror_buf, ERRSTR_FMT, errnum);
00076 errstr = xstrerror_buf;
00077 }
00078 return errstr;
00079 }