Blake Beaupain
Blake Beaupain

Reputation: 638

Are poll and epoll event flags compatible?

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?

Upvotes: 1

Views: 923

Answers (1)

Armali
Armali

Reputation: 19395

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.

Upvotes: 3

Related Questions