help needed on a unix system-call question

der Mouse mouse at mcgill-vision.UUCP
Wed Mar 29 21:57:12 AEST 1989


In article <7553 at june.cs.washington.edu>, ka at june.cs.washington.edu (Kenneth Almquist) writes:
> guy at auspex.UUCP (Guy Harris) writes:
>> Assuming by "is it possible to lose the partially read data" you
>> mean "if the 'read' blocks, and then transfers some data and blocks
>> waiting for more data, and *then* gets interrupted by a signal, is
>> the data it transferred more-or-less lost", the answer is "yes, and
>> [...]" [...].
> Reads on cooked tty devices block until an entire line is available
> and then copy in the entire line at once.

The original posting seems to have expired here.  There is one common
case which *looks* like "partially read" data being "lost", even though
this is not really true: when the signal coming in is due to a special
character (interrupt or quit, for example) being typed on the tty
that's being read from.  In this case, the input buffer is generally
flushed, losing any partial line that's been typed.  Until you realize
that the partial line is being buffered in the kernel and not
transferred to the user's buffer until you push return (and therefore
isn't partially read at all), this looks a lot like "losing partially
read data".

The original question probably belonged in comp.unix.questions, but we
all know nobody pays any attention to the distinction any longer :-(.

					der Mouse

			old: mcgill-vision!mouse
			new: mouse at larry.mcrcim.mcgill.edu



More information about the Comp.unix.wizards mailing list