lkml.org 
[lkml]   [1997]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: read() blocks on pipes
On Mon, 24 Feb 1997, Tim Waugh wrote:

> What exactly is supposed to happen when doing a read() on a pipe that has
> been closed?
>
Return EOF, if the last handle to the "write end" of the pipe is closed.

> I have a routine to fork, redirect output to a pipe, and exec a child.
> The parent reads from the pipe, and all is well until the child dies.
> read() blocks -- is this correct behaviour? I'd like it to return with
> some error or zero.

100% sure this is a bug in your program: Make sure you close the write
handle in the parent process, this should fix it.

Gerd


l-w--w--w- 1 kraxel users 42 Jan 1 19:70 .signature <- /dev/null


\
 
 \ /
  Last update: 2005-03-22 13:39    [W:0.028 / U:1.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site