Message-Id: <200408270348.i7R3mSlS032127@delorie.com> Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 From: "Gary R. Van Sickle" To: Subject: RE: F_ULOCK, F_LOCK, F_TLOCK, F_TEST missing in unistd.h Date: Thu, 26 Aug 2004 22:48:20 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: <20040826133503.GE27978@cygbert.vinschen.de> X-IsSubscribed: yes [snip] > Seriously, the basic idea is not to implement lockf, but to > implement advisory locking. Windows doesn't support advisory > locking, only mandatory locking. So, roughly the idea is to > use some internal locking structure and to implement lockf, > flock and fcntl-locking on top of that. All these > implementations are only advisory, so the whole job is to > keep the information ready for all Cygwin processes, and to > give them the expected locking behaviour as a process would > get on, say, GNU/Linux, but without actually locking the > files on Win32 level. > Well, I just did my 2 minute due diligence and looked up the difference between advisory and mandatory file locking. Did I read right? Does advisory locking actually in no way prevent write access to the "locked" file unless all the interested processes also explicitly use lockf() etc? Yikes. If so (and I must be missing something there), couldn't this be implemented in Windows simply as named mutexes, with the names being some suitably-chosen derivative of the file name? You wouldn't even need to do any explicit sharing between Cygwin processes then. -- Gary R. Van Sickle -- 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/