Quoting pipe(7):

    If all file descriptors referring to the write end of a pipe
    have been closed, then an attempt to read (2) from the pipe
    will see end-of-file ( read (2) will return 0).

  Consider a pipe with 1 reading and 1 writing processes.  The
reading process was put to sleep by the scheduler after he has
opened the pipe.  The writing process currently writes 1 byte to
the pipe.  It will close the pipe immediately afterwards.  So
there is a pipe containing 1 byte, no writing processes, and 1
reading process.

Am I right that:

1. In reality, when the the reading process runs and reads the pipe,
   it will see the single byte that was written to it, followed by
   an end-of-file.
2. Strictly following the quote from above, when the reading
   process runs and reads the pipe, it should immediately see an
   end-of-file.

Therefore, pipe(7) choice of words is unfortunate.  I think a bug
should be filed.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/1333717912.87219.yahoomailclas...@web120705.mail.ne1.yahoo.com

Reply via email to