Use epoll on linux and kqueue on bsd.