Commit cf8b9cdb authored by Dainius Simelevicius's avatar Dainius Simelevicius
Browse files

references #271: correctly interpreting return values and errno of ib verb functions

parent 1e8c45a4
...@@ -41,7 +41,23 @@ std::list<ibvla::Device> ibvla::getDeviceList () ...@@ -41,7 +41,23 @@ std::list<ibvla::Device> ibvla::getDeviceList ()
if (devlist == 0) if (devlist == 0)
{ {
std::stringstream ss; std::stringstream ss;
ss << "Failure to get device list, errno = " << ::strerror(errno); ss << "Failed to get device list: ";
if (errno == EPERM)
{
ss << "Permission denied, " << strerror(errno) << "(" << errno << ")";
}
else if (errno == ENOMEM)
{
ss << "Insufficient memory to complete the operation, " << strerror(errno) << "(" << errno << ")";
}
else if (errno == ENOSYS)
{
ss << "No kernel support for RDMA, " << strerror(errno) << "(" << errno << ")";
}
else
{
ss << "Not understood error, errno = " << errno;
}
XCEPT_RAISE(ibvla::exception::Exception, ss.str()); XCEPT_RAISE(ibvla::exception::Exception, ss.str());
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment