X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Wed, 18 Nov 2009 21:11:05 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Problem with fcnlt F_GETLK command
Message-ID: <20091118201105.GZ29173@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <936047.37094.qm@web87013.mail.ird.yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <936047.37094.qm@web87013.mail.ird.yahoo.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Nov 18 08:08, jmsplat101-cygwin@yahoo.co.uk wrote:
> Hello,
> 
> I've down loaded version 1.7 onto my Windows XP laptop (uname -a
> reports CYGWIN_NT-5.1 XXXXXXXXXX 1.7.0(0.217/5/3) 2009-11-10 13:03
> i686 Cygwin) and I'm having some problems with the fcntl() function.
> 
> I've written the following sample to demonstrate the problem:
> [SNIP]
> If I run this code in the same directory in two seperate shells I'd
> expect only the first instance to print 'No blocking lock' 
> however both do and the  second then goes on to block waiting for the
> actual lock (which it gets when I terminate the first instance). So
> the locking functionality works just fine; however the lock reporting
> does seem not to work and always returns F_UNLCK.
> 
> Can someone confirm if this is a known limittaion of the current
> version, a limitation of the underlying windows API or a bug?

It's a bug.  The original BSD code which the Cygwin code is based on
took a shortcut in a specific case, which is invalid for Cygwin.
I disabled this shaortcut and your testcase runs fine now.  I'll
prepare a new 1.7.0 testrelease in the next few days.

Thanks for the report and espcially thanks for the simple testcase.


Corinna

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

--
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

