X-Spam-Check-By: sourceware.org Date: Thu, 10 Aug 2006 10:46:35 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: unlock fails if file not locked Message-ID: <20060810084635.GI20467@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2i Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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/