initial code to support epoll