[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Path searching in svn_io_start_cmd

From: Branko Čibej <brane_at_xbc.nu>
Date: 2005-11-20 04:39:30 CET

Julian Foad wrote:
> Branko Čibej wrote:
>> Julian Foad wrote:
>>
>>> It makes sense if you come to it from first knowing the "execve"
>>> family of functions,
>>
>> (Actually the "spawn" family -- spawnle and spawnlp being the culprits.)
>
> (Actually the version of APR that I have in my source tree (revision
> 128444) uses "fork" followed by "execve" or "execvp" for the two modes
> that we invoke in its implementation of apr_proc_create() for
> Unix-like systems.)
That's because many Unices don't actually provide the spawn* family of
functions, presumably on the grounds that spawn == fork+exec. That is in
fact true for all practical purposes on Unix. On Windows, for example,
it's exactly the opposite -- spawn is easy to implement but exec (and
certainly fork) are not.

If you've a taste for horror stories, take a look at the Cygwin sources
some day to see how it implements fork() on Windows. It's most ...
enlightening ... :)

(It's also a good indication of why it is a good idea to use spawn in
portable code instead of fork+exec. APR does this right on the API level.)

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Nov 20 04:40:20 2005

This is an archived mail posted to the Subversion Dev mailing list.