Add command and error to IOCTL failure exception

When an IOCTL call fails in the driver library, the failure exception
only states "IOCTL failed" without any further information. To make it
easier to see what IOCTL call failed and why, the exception will now
include the command that failed and the reason for the failure.

Change-Id: Ife4957d2c0d692b3fcdbdc72538690d50385d365
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
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 @@
 __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