Replace select() by poll().