copy-paster: Fixes in poll and epoll versions, added simple tester.