From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hossein Mobahi Subject: Re: Problem with read() and named pipe (FIFO) (pipe not disk) Date: Tue, 17 Aug 2004 12:25:11 -0700 (PDT) Sender: linux-c-programming-owner@vger.kernel.org Message-ID: <20040817192511.83411.qmail@web12703.mail.yahoo.com> References: <41224737.9010006@sancharnet.in> Mime-Version: 1.0 Return-path: In-Reply-To: <41224737.9010006@sancharnet.in> List-Id: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-c-programming@vger.kernel.org Sure, the stdio's buffer is limited. However, as you said, the real-time constraint doesn't let me wait for the buffer to become full. I need to read it as soon as the data is written to the buffer. So I really need to flush stdio's buffer out of that process. --Hossein --- joy wrote: > The program cannot buffer data for all eternity and > must eventually > write it to the > pipe. So, even if read() blocks because there is no > data available, it > must return as soon as data > is written. The real-time element will be lost > though I doubt it will > buffer for a long time. > Is this the behavior you are experiencing and is > there a problem with this ? > > Hossein Mobahi wrote: > >The solution that I know is using > >write(STDOUT_FILENO,....) instead of printf because > it > >does not buffer. However, I do not have access to > the > >source code of prg1, and I must somehow make prg1 > >flush its standard I/O buffer from outside. __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail