EOF on a pipe?

Jeff Lo jlo at elan.UUCP
Sat May 14 09:43:04 AEST 1988


I need to be able to read from a pipe in no delay mode and be able to
ditinguish between EOF, and cases when there is just no data, but the
pipe is still open.

This is no problem under 4.2 since the read() will return 0 on EOF, and
if the pipe is empty, but still open on the other end, it will return -1
and set errno to EWOULDBLOCK.

Under System 5 (5.2 and 5.3) the read() returns 0 in both cases. Does
anybody know how to distinguish between these two cases under System 5?

				Jeff Lo
				Elan Computer Group, Inc.
				..!{ames,hplabs}!elan!jlo



More information about the Comp.unix.questions mailing list