[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: info/t/dir-dangling-entry.sh hang on netbsd
From: |
Gavin Smith |
Subject: |
Re: info/t/dir-dangling-entry.sh hang on netbsd |
Date: |
Wed, 3 Jun 2015 02:01:49 +0100 |
On 3 June 2015 at 01:52, Gavin Smith <address@hidden> wrote:
> So I suspect the difference is in the way that the NetBSD shell
> redirects file descriptors for background processes. I expect that on
> the other systems the shell forks and then redirects the file
> descriptors, but presumably on NetBSD there is some kind of
> redirection before the fork.
Not quite, if the following is relevant:
http://cvsweb.netbsd.org/bsdweb.cgi/src/bin/sh/redir.c?rev=1.29&content-type=text/x-cvsweb-markup
http://cvsweb.netbsd.org/bsdweb.cgi/src/bin/sh/redir.c.diff?r1=1.28&r2=1.29
PR/25699: David Laight: sh(1) hangs opening a named pipe as stdin for
background process
This happens because we vfork, and then open a named pipe with O_RDONLY
and block in the child. We avoid this, by opening the file with O_NONBLOCK,
and then reset it if we are vforked. XXX: this is an ugly fix.
According to a man page, vfork "creates a child process and blocks the parent".
I don't know why this is still a problem considering this patch was
from July 2004.