Loading...
Searching...
No Matches
XrdSysE2T.hh File Reference
`#include <cerrno>`
Include dependency graph for XrdSysE2T.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions

const char * | XrdSysE2T (int errcode)

## Function Documentation

## XrdSysE2T()

const char * XrdSysE2T | ( | int | errcode | ) |

extern

Convert error number to string in a thread-safe way.

Parameters

  errcode | The error number (usually from errno).

Returns
  A non-nil pointer to the string holding the error description.

Definition at line 104 of file XrdSysE2T.cc.

{
char eBuff[80];
// Check if we can return this immediately
//
if (errcode == 0) return Errno2String[0];
if (errcode > ERRNOBASE && errcode <= ERRNOBASE + maxErrno)
return Errno2String[errcode - ERRNOBASE];
// If this is a negative value, then return a generic message
//
if (errcode < 0) return "negative error";
// Our errno registration wasn't sufficient, so check if it's already
// registered and if not, register it.
//
e2sMutex.Lock();
std::string &eTxt = e2sMap[errcode];
if (!eTxt.size())
{snprintf(eBuff, sizeof(eBuff), "unknown error %d", errcode);
eTxt = std::string(eBuff);
e2sMap[errcode] = eTxt;
}
// Return the result
//
e2sMutex.UnLock();
return eTxt.c_str();
}
ERRNOBASE
#define ERRNOBASE
Definition XrdSysE2T.cc:40

References ERRNOBASE.

Referenced by XrdOucGMap::XrdOucGMap(), XrdXmlRdrTiny::XrdXmlRdrTiny(), XrdXmlRdrXml2::XrdXmlRdrXml2(), XrdTlsSocket::Accept(), XrdSys::IOEvents::PollE::Begin(), XrdSys::IOEvents::PollKQ::Begin(), XrdSys::IOEvents::PollPoll::Begin(), XrdSys::IOEvents::PollPort::Begin(), XrdPfc::FsTraversal::begin_traversal(), XrdSysLogger::Bind(), XrdCl::CheckSumManager::Calculate(), XrdPfc::FsTraversal::cd_down(), cfOut(), XrdCl::LocalFileHandler::Close(), XrdCpConfig::Config(), XrdSysLogging::Configure(), XrdTlsSocket::Connect(), XrdXmlMetaLink::Convert(), DoTail(), XrdSysError::ec2text(), XrdDigFS::Emsg(), XrdSfsNative::Emsg(), XrdSecProtocolsss::eMsg(), Ereason(), XrdOucUtils::eText(), XrdW41Dirs::Expand(), Fatal(), XrdNetIF::GetIF(), XrdSys::IOEvents::Poller::GetRequest(), main(), main(), XrdCl::AsyncSocketHandler::OnConnectionReturn(), XrdCl::LogOutFile::Open(), XrdSsiFileSess::open(), XrdTls::RC2Text(), XrdCl::LocalFileHandler::Read(), XrdCl::LocalFileHandler::ReadV(), XrdXrootdAioTask::SendError(), XrdW41Gate::Serialize(), XrdNetAddr::Set(), XrdOucECMsg::SetErrno(), XrdPfc::FsTraversal::slurp_dir_ll(), XrdCl::JobManager::Start(), XrdCl::PollerBuiltIn::Start(), XrdCl::TaskManager::Start(), XrdCl::LocalFileHandler::Stat(), XrdCl::TaskManager::Stop(), XrdCl::LocalFileHandler::Sync(), XrdOfsCPFile::Target(), XrdCl::Status::ToString(), XrdCl::LocalFileHandler::Truncate(), XrdOucUtils::ValPath(), XrdCl::LocalFileHandler::VectorRead(), XrdCl::LocalFileHandler::VectorWrite(), XrdSecProtect::Verify(), XrdW41Gate::Wait41(), XrdCl::AsyncHSWriter::Write(), XrdCl::AsyncMsgWriter::Write(), XrdCl::LocalFileHandler::Write(), XrdCl::LogOutFile::Write(), XrdSsiFileSess::write(), XrdCl::LocalFileHandler::WriteV(), XrdSecsssAdmin_addKey(), XrdSecsssAdmin_delKey(), XrdSecsssAdmin_insKey(), XrdOssSys::xspaceBuild(), and XrdSysLogger::zHandler().

Here is the caller graph for this function: