epoll returning with 0 events

view story

http://stackoverflow.com – I have two file descriptors, one read file descriptor on pipe and another socket connection descriptor. Neither of them is non blocking. Both of them are added to epoll context with single EPOLLIN event. Lastly, i call epoll_wait with timeout = -1. Below is the sample code. I have two questions :- Do pipe and connection descriptors need to be non blocking. This is not edge triggered. If yes, is it good practice or mandatory and if mandatory, why ? I am setting timeout to -1, yet epoll_wait returns immediately with the return value 0. Why is that happening? with timeout of -1, epoll_wait sho (HowTos)