h6. [[Internet]] h6(. » [[Internet SWI Calls|SWI Calls]] h6((. » Socket_Select h2. Socket_Select h5. (SWI &41211) |_<^{width:4em}. Entry | | |<^. R0 |<^. Number of descriptors to consider from each set | |<^. R1 |<^. Pointer to a read set | |<^. R2 |<^. Pointer to a write set | |<^. R3 |<^. Pointer to a exception set | |<^. R4 |<^. Pointer to a 2 word timeout value | |_<^{width:4em}. Exit | | |<^. R0 |<^. Number of descriptors which became ready | h4. Use The purpose of this call is to wait until one of the descriptors becomes ready based on the read/write/exception masks provided, or a timeout occurs. h4. Berkeley sockets equivalence This SWI directly corresponds to the function "select":https://pubs.opengroup.org/onlinepubs/007908775/xsh/select.html and would ordinarily be called from C using the <code>select()</code> function in <code>socklib.h</code>. h4. Notes The value on entry in R0 would typically be the highest bit set to inspect plus one in each of the masks. For example if the socket descriptors were 3 + 4 + 5 then there are 6 descriptors to consider (0 to 5 inclusive). Setting it to a larger value than necessary just wastes processor time looking at descriptors which are of no interest. h4. See also * [[Internet]]