1

I'm trying to get libusb to work with epoll instead of poll, as I'm already using epoll in an application that needs scalability and will only be running on Linux. I'm wondering if the events flags returned by libusb_get_pollfds, which are intended for poll, are compatible with epoll.

Can the POLLIN flag, for example, be registered with epoll and achieve the same behavior as the EPOLLIN flag, or do I need to map these event flags to their corresponding epoll version?

Blake Beaupain
  • 638
  • 1
  • 6
  • 16
  • 2
    Do you anticipate having 10000 usb devices connected? Otherwise this is utterly pointless, gratuitous introduction of a non-portable interface in place of a more portable one. – R.. GitHub STOP HELPING ICE Jun 06 '15 at 17:21
  • 3
    I'm using epoll for more than just usb in this application, and scalability is of concern. Linux is the only target platform. – Blake Beaupain Jun 06 '15 at 17:28

1 Answers1

3

Can the POLLIN flag, for example, be registered with epoll and achieve the same behavior as the EPOLLIN flag, or do I need to map these event flags to their corresponding epoll version?

This answer is telling. Excerpt:

The most glaring problem with epoll documentation is its failure to state in "bold caps" that epoll events, are, in fact, fully identical to poll (2) events.

Community
  • 1
  • 1
Armali
  • 18,255
  • 14
  • 57
  • 171