X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Wed, 18 Nov 2009 21:11:05 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Problem with fcnlt F_GETLK command Message-ID: <20091118201105.GZ29173@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <936047 DOT 37094 DOT qm AT web87013 DOT mail DOT ird DOT yahoo DOT 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 AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: 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 Nov 18 08:08, jmsplat101-cygwin AT yahoo DOT co DOT 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