I am running into trouble calling libusb_open
in C++ on Linux (running on Raspberry Pi but virtualized to x86 using Exagear).
I can find a device using libusb_get_device_list
but it appears translating a device to a device handler using libusb_open
is causing problems, even though it returns a 0 (success), however no further commands work. It is giving me the error:
libusb: error [op_open] getcap failed (22)
UPDATE
A little bit of digging has revealed that the following command is producing the error (within libusb):
r = ioctl(hpriv->fd, IOCTL_USBFS_GET_CAPABILITIES, &hpriv->caps);
where IOCTL_USBFS_GET_CAPABILITIES
is _IOR('U', 26, __u32)
. Digging has revealed that error 22
from ioctl
is an invalid argument. I'm still trying to unpick this, but any help here is greatly appreciated.
question from:
https://stackoverflow.com/questions/41504792/libusb-error-op-open-getcap-failed-in-c-on-linux 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…