named pipe is borken and proposed fix

Rich Felker dalias at aerifal.cx
Thu Jun 2 23:44:07 UTC 2011


On Thu, Jun 02, 2011 at 02:00:41PM -0700, Jian Peng wrote:
> " The generally accepted, portable way to handle sequential reads
> on a FIFO is for the reader to also open the writing end of the
> FIFO (and do nothing with it) for as long as it wants to read."
> 
> It did not work. I am not sure whether it is possible to open same
> FIFO, and use one as reader, and use second as writer, in same user
> process.

Of course it can. The easiest way to do this is open the FIFO with the
O_RDWR flag. Then you will never get EOF.

Rich


More information about the uClibc mailing list