Skip to content
Advertisement

Tag: epoll

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: The epoll_data_t structure has the

Does epoll(), do its job in O(1)?

Wikipedia says unlike the older system calls, which operate at O(n), epoll operates in O(1) [2]). http://en.wikipedia.org/wiki/Epoll However, the source code at fs/eventpoll.c on Linux-2.6.38, seems it is implemented with an RB tree for searching, which has O(logN) In fact, I couldn’t see any man page saying the complexity of epoll() is O(1). Why is it known as O(1)? Answer

Advertisement