replace select() with poll()