select () on 'old' data

Gus field at cs.pitt.edu
Tue Aug 7 06:13:07 AEST 1990


I using select () to detect data on a file descriptor.  Upon detecting
info, I perform a read ().  If I don't read all the data on the
descriptor, and then return to select (), select will only return
when _new_ data is delivered to the descriptor.  Is there a way to
have select () return whenever there is pending data to be read (whether 
or not new data has arrived).

Some specifics: I'm running on a Sun-4, 4.0.3.  The file I'm reading
from is a serial port (canonical off, c_cc[MIN] = 1, c_cc[TIME] = 0,
no echo). 

I would like to avoid performing a manual select (ioctl with FIONREAD)
since I may be listening to lots of serial ports.

Please respond via e-mail, I'll summarize if there is interest.

Brian
-----
field at cs.pitt.edu



More information about the Comp.unix.questions mailing list