On Sat, 2010-05-01 at 16:38 +0400, Sergei Golovan wrote:
> On Sat, May 1, 2010 at 2:07 PM, Andreas Metzler
> <ametz...@downhill.at.eu.org> wrote:
> >
> > The aim of this test is to run "find -neweraa" and verify that it
> > runs and exits cleanly with an error (exit code 1) instead of
> > segfaulting. (Bug #496853).
> 
> The attached patch to sv-bug-24169.exp should make test working on
> kfreebsd also.
> 
> BTW, now I'm not sure which behavior is correct - FreeBSD which
> doesn't kill a child process before the parent reads it's output, or
> Linux which kills the child if it's output is sufficiently short.

A pipe normally has a buffer of size 1 page, so a process that writes up
to 4K to a pipe will not block while writing, but a process that writes
more than 4K will block if nothing reads from the other end of the pipe.

Neither kernel kills the child process, but Linux allows it to exit
immediately whereas FreeBSD appears to make it block on exit if it has
output buffered in a pipe.  This behaviour is useful because it
guarantees that the parent will receive the child's output and its exit
code in the 'right' order.  However, I think that either behaviour is
acceptable.

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to