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: Phil Blundell <pb at pbcl dot net>
- To: Navid Rahimi <rahimi dot nv at gmail dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 10 Sep 2015 19:26:46 +0100
- 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> <55F19B66 dot 9050001 at arm dot com> <55F19C50 dot 3010502 at gmail dot com>
On Thu, 2015-09-10 at 19:35 +0430, Navid Rahimi wrote:
> I think our main objection here is to avoid forking when there is no
> file.There is so many other variable for checking if execve is going to
> success or not.
On the other hand, your patch will add an extra system call and
directory lookup to every successful posix_spawn() call, i.e. you are
optimising the failure case at the expense of the successful case. It's
not at all obvious to me that this is a sensible thing to do. Can you
explain your reasoning in a bit more detail?
p.