select accepts five parameters. The second parameter is a pointer to a set of FDs to monitor for read availability. The third parameter is a pointer to a set of FDs to monitor for write availaility. The fourth parameter is a pointer to a set of FDs to monitor for exceptions. The second to fourth parameters are “optional”. If a NULL pointer is passed, the set is assumed empty.
The first parameter is the largest FD of all three sets plus one. In essence, the first parameter is an exclusive bound that defines how many FDs select should scan for each set.
The fifth parameter is a pointer to a timeval structure that defines a time out period. This parameter is also optional. If it is a NULL pointer, then the select call never times out.