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 Feb  9 13:25, Steven Bardwell wrote:
> I have a simple programs that show the following issue:
> 
> 1) program locks a file (in my test /tmp/yyy)
> 2) program then calls spawnv() (in my test    "/bin/sh  -c  /bin/touch
> /tmp/xxx").
> 3) after the spawnv(), the file /tmp/yyy is no longer locked.

How do you test that?  You're calling fcntl(F_SETLKW) exactly once at
the start of your test application, but never again later.  We're
talking advisory file locking here, so, where's the next fcntl call
waiting for the lock?

I debugged your test app and the lock still exists after the spawn call.



Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgprimaLNNh7h.pgp
Description: PGP signature


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