The structure of pollfd is:
struct pollfd {
int fd; /* file descriptor */
short events; /* requested events */
short revents; /* returned events */
}
The structure of libusb_pollfd is:
struct libusb_pollfd {
int fd; /* Numeric file descriptor. */
short events;
}
The structure of the poll function is:
int poll(struct pollfd *fds, nfds_t nfds, int timeout);
What is the correct way of polling a list of libusb_pollfd structures? Do you use the poll function with some kind of modification? Or is there a libusb function which is supposed to be used?
It seems the only way to achieve this, is using the following code:
Which is what I was trying to avoid. Let me know if there's a better way.