delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/08/17/05:38:55

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Fri, 17 Aug 2012 11:37:37 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Options for getting mandatory locking in cygwin1.dll (was: Promote sqlite 3.7.13-1 from test status?)
Message-ID: <20120817093737.GB26407@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <announce DOT 5029275C DOT 4040009 AT etr-usa DOT com> <502C0B7D DOT 10909 AT etr-usa DOT com> <loom DOT 20120816T092134-266 AT post DOT gmane DOT org> <20120816085016 DOT GB5536 AT calimero DOT vinschen DOT de> <502CCBB1 DOT 2070600 AT etr-usa DOT com> <20120816105507 DOT GD17546 AT calimero DOT vinschen DOT de> <502CE120 DOT 4050900 AT etr-usa DOT com> <20120816122654 DOT GG17546 AT calimero DOT vinschen DOT de> <502D4F2F DOT 5080306 AT etr-usa DOT com>
MIME-Version: 1.0
In-Reply-To: <502D4F2F.5080306@etr-usa.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 16 13:51, Warren Young wrote:
> On 8/16/2012 6:26 AM, Corinna Vinschen wrote:
> >On Aug 16 06:01, Warren Young wrote:
> >>Advisory locking only works when all players cooperate.  We can't
> >>assume that on Windows, unless we set up an insular Cygwin ghetto.
> >
> >So, are you saying that Cygwin should use mandatory file locking?
> 
> Of course not.  That would be a disaster.
> 
> >You are aware that there's no chance at all to implement the UNIX
> >locking API calls correctly this way since Windows locking has nothing
> >in common with UNIX locking except for the word "locking".
> 
> Not even on a per-process basis (cygwin_set_mandatory_locking(1)),
> in conjunction with fcntl(F_SETLK)?  That's how SQLite's
> unixFileLock() function is implemented.
> 
> That is, this proposal would put the DLL in a mode where it called
> LockFileEx() to establish the reader/writer lock byte ranges instead
> of using its private advisory locking scheme.
> 
> Alternately, Cygwin could follow Linux and implement 'mount -o
> mand'. You could get mandatory locking on just your svn checkout
> tree this way, for example.  It would apply to all Cygwin programs,
> not just svn/SQLite, but it shouldn't be any more problematic than
> normal day to day Windows use.  Cygwin programs not run within that
> mount wouldn't be affected.

A "mand" mount option sounds like a really interesting idea, together
with the special group permission settings as described in the Linux
fcntl(2) man page.  Maybe we can even relax that by making the "mand"
option the default setting, so the correct file permissions would be
the only requirement by default.  Ok, this also requires to use a
filesystem with real file permissions, so FAT or "noacl" mounted
filesystems are out of th question, but I can live with that just fine.

The problem with this approach is a non-technical one:  In the next
couple of months I have probably no time to implement it.  It's not
overly tricky to implement it, as far as I can see, but, as usual,
somebody has to do it.  So if anybody would like to take a stab at
it...


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019