named pipe is borken and proposed fix

Jian Peng jipeng at broadcom.com
Fri Jun 3 00:40:41 UTC 2011


This is the nice trick. It works!
Thank you so much.

Jian

-----Original Message-----
From: uclibc-bounces at uclibc.org [mailto:uclibc-bounces at uclibc.org] On Behalf Of Rich Felker
Sent: Thursday, June 02, 2011 4:44 PM
To: uclibc at uclibc.org
Subject: Re: named pipe is borken and proposed fix

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
_______________________________________________
uClibc mailing list
uClibc at uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc




More information about the uClibc mailing list