38 #define ERRNOBASE 0x40000000
45 static const int errSlots = 144;
46 const char* Errno2String[errSlots] = {0};
48 int initErrTable(std::map<int, std::string> &e2sMap)
50 char *eTxt, eBuff[80];
55 for(
int i = 1; i < errSlots; i++)
58 { eTxt = strdup(eTxt);
59 *eTxt = tolower(*eTxt);
60 Errno2String[i] = eTxt;
70 free((
char*)Errno2String[EBADE -
ERRNOBASE]);
71 Errno2String[EBADE -
ERRNOBASE] =
"authentication failed - possible invalid exchange";
76 e2sMap[EBADE] =
"authentication failed - possible invalid exchange";
82 for (
int i = 1; i < lastGood; i++)
83 {
if (!Errno2String[i])
84 {snprintf(eBuff,
sizeof(eBuff),
"unknown error %d",
ERRNOBASE + i);
85 Errno2String[i] = strdup(eBuff);
91 Errno2String[0] =
"no error";
104 static std::map<int, std::string> &e2sMap = *
new std::map<int, std::string>;
105 static const int maxErrno = initErrTable(e2sMap);
110 if (errcode == 0)
return Errno2String[0];
112 return Errno2String[errcode -
ERRNOBASE];
116 if (errcode < 0)
return "negative error";
122 std::string &eTxt = e2sMap[errcode];
124 {snprintf(eBuff,
sizeof(eBuff),
"unknown error %d", errcode);
125 eTxt = std::string(eBuff);
126 e2sMap[errcode] = eTxt;
const char * XrdSysE2T(int errcode)