added ifdef to support portability and epoll for Linux at the same time