Use poll(2) instead of select(2).