From: Davide Libenzi Date: Sat, 24 Sep 2005 05:26:43 GMT Subject: Re: git 0.99.7b doesn't build on Cygwin Message-ID: In-Reply-To: On Fri, 23 Sep 2005, Linus Torvalds wrote: > But looking at send_pack() or fetch_pack(), for example, they are both > _very_ traditional fork()+exec() calls, with just a few close() calls in > between. > > Looking a bit closer at the diff() usage, I actually think that we could > move the fork() closer to the exec - we'd just have to move it _into_ all > the different cases (ie you'd have two different fork() calls: one for > the "builtin" case, one for the external pgm case, but then the child in > both cases would be very simple). > > Oh. Actually, I wonder if we could mke them "vfork()" calls. Does anybody > know if cygwin has an easier time with vfork() + eventual exec? That > _should_ map better to a non-UNIX process model, so maybe we could do it > that way? If you have only to run diff/patch, just use the native Win32 CreateProcess(). You abstract that on a git_exec(), and you use fork/exec on Unix and CreateProcess() on Winblows. If fork() is slow on Cygwin, fork+exec is pathetic. They do all that work to give you a fork(), and you throw it away with an exec(). - Davide