This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] [BZ #18433] Check file access/existence before forking.
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: Zack Weinberg <zackw at panix dot com>, navid Rahimi <rahimi dot nv at gmail dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 11 Sep 2015 12:33:24 +0300 (MSK)
- Subject: Re: [PATCH] [BZ #18433] Check file access/existence before forking.
- Authentication-results: sourceware.org; auth=none
- References: <55F19819 dot 3010601 at gmail dot com> <ACDB9D4B-30B6-46C1-9286-5F03594CEACC at panix dot com> <CAOUBrm3oeUVDM-q4VFP08gjEkD2UFaz0Xfq1oGBW+m76rDRu+A at mail dot gmail dot com> <CAKCAbMiYkywWeSiJ5jkH7r8eYMSOWFmYDsjEN3k5ZaTPEeJGXw at mail dot gmail dot com> <55F29C54 dot 5010809 at redhat dot com>
On Fri, 11 Sep 2015, Florian Weimer wrote:
> The downside is that this adds additional blocking to the posix_spawn
> operation, which is not something all callers want (some may even prefer
> that the vfork happens on a new thread). So I think this needs a
> configuration knob.
Huh? By definition, the vfork parent is suspended until the vfork child
either execs or terminates. In both outcomes, the pipe will be already
closed when the parent is resumed, so it will not block on reading.
(and if you can rely on parent-suspending semantics of vfork, you don't even
need a pipe)
Unless I've missed something?
Alexander