[PATCH] [BZ #18433] Check file access/existence before forking.

Ondřej Bílka neleai@seznam.cz
Fri Sep 11 06:29:00 GMT 2015


On Thu, Sep 10, 2015 at 07:26:46PM +0100, Phil Blundell wrote:
> 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?
> 
And do you have programs where that would matter? On quick test just
calling fork around takes 240000 cycles so this would likely lost in
noise.



More information about the Libc-alpha mailing list