Subject: select on raw mode terminal
To: None <tech-kern@sun-lamp.cs.berkeley.edu>
From: Wolfgang Solfrank <ws@tools.de>
List: tech-kern
Date: 02/12/1994 22:49:32
I've got some problems with the semantics of select on a raw mode terminal
with both VMIN and VTIME set.
The problem is that select returns when a file descriptor is ready for reading,
which is interpreted by us as that a subsequent read call will return
immediately.
On fds referring to raw mode terminals with both VMIN and VTIME set this read
will return only then immediately when the number of characters exceeds the
VMIN value. If no characters is available then the read will block until
at least one character is input.
The problem is what to do in select when less than VMIN characters are
available.
On one hand, the read will return without any further action on the input
line. On the other hand the read will not return immediately, but start
a timer and return at the earliest when VTIME tenths of a second are over.
Other OSs (like e.g. SunOS) seem to interpret this differently from NetBSD.
On these systems the select assumes the file descriptor as being ready for
reading if only one byte is available. And I have software (flexfax) that
depends on this behavior.
For the moment I changed the code (in my version) in ttnread to not return
0 in the relevant case. This seems to work OK, but I would like further
support on this before checking this in.
--
ws@TooLs.DE (Wolfgang Solfrank, TooLs GmbH) +49-228-985800
------------------------------------------------------------------------------