Does `epoll_wait` signify which event was triggered when both EPOLLIN and EPOLLOUT were added?
Suppose I am specifying both EPOLLIN
and EPOLLOUT
flags when adding descriptors t开发者_运维知识库o monitor with epoll_wait
. From the 'epoll' manpages it is unclear what exactly each of the epoll_event
structures returned as part of the array carries in its events
field. Quoting:
the events member will contain the returned event bit field.
Does it mean that it is impossible to distinguish whether an event was triggered signifying 'can-write' as opposed to 'can-read'? Basically there is an event mask, and I would logically expect returned array to signify exactly what event(s) have 'happened' on a file descriptor?
Your expectation is right. The events
member will contain the event(s) that have occured for that file descriptor.
精彩评论