aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--driver_library/src/ethosu.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/driver_library/src/ethosu.cpp b/driver_library/src/ethosu.cpp
index 64aee4d..dcdde8c 100644
--- a/driver_library/src/ethosu.cpp
+++ b/driver_library/src/ethosu.cpp
@@ -20,7 +20,9 @@
#include <uapi/ethosu.h>
#include <algorithm>
+#include <cerrno>
#include <cstdlib>
+#include <cstring>
#include <exception>
#include <fstream>
#include <iomanip>
@@ -104,7 +106,7 @@ const SemanticVersion getLibraryVersion() {
__attribute__((weak)) int eioctl(int fd, unsigned long cmd, void *data = nullptr) {
int ret = ::ioctl(fd, cmd, data);
if (ret < 0) {
- throw EthosU::Exception("IOCTL failed");
+ throw EthosU::Exception(string("IOCTL cmd=").append(to_string(cmd) + " failed: " + strerror(errno)).c_str());
}
Log(Severity::Debug) << "ioctl. fd=" << fd << ", cmd=" << setw(8) << setfill('0') << hex << cmd << ", ret=" << ret