Re: FIFO and tty programming details?
Mon, 13 May 1996 22:51:53 +0200

Leslie Mikesell:

: Yes, following up my own posting... The only real difference
: turned out to be that SysV returned 0 from a non-blocking read()
: with nothing in the FIFO and Linux returns -1. Is this
: posix-specified behaviour?

Yes. When attempting from an empty pipe (or FIFO):
(i) If no process has the pipe open for writing, read() shall
return 0 to indicate end-of-file.
(ii) If some process has the pipe open for writing and O_NONBLOCK
is set, read() shall return -1 and set errno to EAGAIN.