Event library and routines (epoll and select)