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: unlock fails if file not locked


On Aug 10 00:41, Neal Norwitz wrote:
> This test was taken from the python test suite.  It works on many
> different platforms and architecture's except cygwin's.  I'm not
> entirely sure that cygwin is really wrong either though.

Thanks for the testcase!  Cygwin is wrong here.  The underlying Windows
function returns an error code ERROR_NOT_LOCKED when trying to unlock
a non-locked region.  This should have been converted into a successful
return from fcntl.  I fixed that in CVS.

Note, however, that file locking is not implemented quite correctly on
Cygwin anyway.  File locking on POSIX systems using fcntl is usually
advisory (except in certain cases which require changes in the system
settings).  The Windows functions implement only mandatory locking and
there's no advisory locking mechanism provided.  Cygwin shouldn't
actually use the underlying Windows functions but implement advisory
file locking by keeping its own datastructures.  But that's easier said
than done.  It's one point on a long TODO list...


Corinna

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

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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