Please check the manual page select(2).