interrupted select() buggy if no timeout is specified (4.2BSD)

Matt Crawford matt at oddjob.UUCP
Fri May 17 08:57:23 AEST 1985


In article <163 at Gregorio.ARPA> mogul at Gregorio.ARPA writes:
>
>Description:
>	If select() is called with a null pointer for the "timeout"
>	argument, and then interrupted, it fails to modify the
>	bit mask arguments, thus implying that all descriptors
>	are ready (although they may not be).
>	....

If you do not test the return value of select() your program is wrong.
Only use the mask values if the return value is strictly greater than 0.
The manual page says that it is a bug that the masks are ever modified
when select times out.  The same comment should also be made about
interrupts.  In fact, the pyramid does not have this bug.  
_____________________________________________________
Matt		University	crawford at anl-mcs.arpa
Crawford	of Chicago	ihnp4!oddjob!matt



More information about the Comp.bugs.4bsd.ucb-fixes mailing list