How to get errno when epoll_wait returns EPOLLERR?
Is there a way to find out the errno when epoll_wait returns EPOLLERR for a particular fd? Is there any further information about the nature of the error? Edit: Adding more information to prevent ambiguity epoll_wait waits on a number of file descriptors. When you call epoll_wait you pass it an array of epoll_event structures: struct epoll_event { uint32_t events; /* Epoll events */ epoll_data_t data; /* User data variable */ }; The epoll_data_t structure has the same details as the one you used with epoll_ctl to add a file descriptor to epoll: typedef union epoll_data { void *ptr; int fd;