X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-3.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <502E5D7D.5050503@etr-usa.com> Date: Fri, 17 Aug 2012 09:04:29 -0600 From: Warren Young User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Options for getting mandatory locking in cygwin1.dll References: <502C0B7D DOT 10909 AT etr-usa DOT com> <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> <20120817093737 DOT GB26407 AT calimero DOT vinschen DOT de> In-Reply-To: <20120817093737.GB26407@calimero.vinschen.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 8/17/2012 3:37 AM, Corinna Vinschen wrote: > On Aug 16 13:51, Warren Young wrote: >> On 8/16/2012 6:26 AM, Corinna Vinschen wrote: >> >>> You are aware that there's no chance at all to implement the UNIX >>> locking API calls correctly this way... >> >> Cygwin could follow Linux and implement 'mount -o mand' > > 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, I don't see why -o mand is a good default. It isn't the default on Linux. Besides, wouldn't that dredge up all the hairy problems with Windows' by-default mandatory locking? All I'm wishing for here is a way to say "this subtree should use mandatory locks". The user makes the choice, presumably for good reasons. I like my per-process Cygwin-specific solution better, though. In that case, libsqlite would make the decision, because it knows that on Windows, mandatory locking of SQLite DB files is almost certainly the right thing. The rare counterexample like Achim's can be handled through an environment variable or similar; if set, it would cause libsqlite to pass 0 to my proposed cygwin_set_mandatory_locking() call, or skip calling it entirely. > 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. I'm totally fine with limping by with the current solution, where we do locking the "Wrong (tm)" way in libsqlite for now, with the hope that we can fix it the Right way later in the Cygwin DLL itself. Is there old code in the DLL's code repo that does this? I mean, did the Cygwin DLL use mandatory locking once upon a time, which was replaced by its current advisory locking scheme, or has it always provided advisory locking only? -- 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