This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: spawnv() unlocks files in the calling program


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]