Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 3/4] start_command: detect execvp failures early

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:01

Johannes Sixt [off-list ref] writes:
On Donnerstag, 14. Januar 2010, Junio C Hamano wrote:
quoted
Johannes Sixt [off-list ref] writes:
quoted
Previously, failures during execvp could be detected only by
finish_command. However, in some situations it is beneficial for the
parent process to know earlier that the child process will not run.

The idea to use a pipe to signal failures to the parent process and
the test case were lifted from patches by Ilari Liusvaara.
I wonder if we can do this without pipe, perhaps using "vfork, exec, then
update a variable"....
Except that some systems implement vfork(2) in terms of fork(2), I heard. 
As long as they implement it correctly, we don't care if it is implemented
in terms of fork or knife or chopstick.  The only thing we care about in
this crazy-idea was the shared address space the child can write into
until it exec or _exit while the parent is in a frozen state.
Moreover, I think that we do way too many things before the exec; isn't that 
dangerous?
Yeah, we do seem to do quite a lot more than I thought.  Scratch that
crazy idea, then.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help