This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: spawnv() unlocks files in the calling program
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Sun, 9 Feb 2014 23:08:22 -0500
- Subject: Re: spawnv() unlocks files in the calling program
- Authentication-results: sourceware.org; auth=none
- References: <040201cf25c4$54e9cd20$febd6760$ at lbmsys dot com> <20140209192859 dot GG2821 at calimero dot vinschen dot de> <041d01cf25d2$6a59e5b0$3f0db110$ at lbmsys dot com> <20140209203825 dot GJ2821 at calimero dot vinschen dot de> <045801cf25db$2dc95af0$895c10d0$ at lbmsys dot com>
- Reply-to: cygwin at cygwin dot com
On Sun, Feb 09, 2014 at 04:09:03PM -0500, Steven Bardwell wrote:
>On Sun, Feb 09, 2014 at 09:38:25PM +0100, Corinna Vinschen wrote:
>>Ok, I can reproduce it, but it's too late to debug this today.
>>
>>I have to say, though, that fcntl advisory locking is POSIX
>>functionality, while the spawn functions are not. In fact these
>>dreaded spawn entry points are rather old stuff, which hasn't been
>>tested for a long time. FWIW, advisory file locking has never been
>>tested with them, and the fact that it doesn't work as expected doesn't
>>exactly disturb me.
>>
>Knowing this, I will use the posix_spawn() function -- I wanted to
>reduce the number of fork() calls in my application (because of the
>many warnings about the complexity of the Cygwin implementation of
>fork() and reported problems with it), but if spawnv() won't do what I
>need, then under the bus it goes.
As I think has been pointed out, posix_spawn uses fork() so you are not
going to see any differences there. And, FWIW, Cygwin's spawn/exec are
hardly simple either. Both fork and exec are trying to implement something
that can't be done easily on Windows.
cgf
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple