Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
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
Date: Sat, 28 Aug 2004 11:14:42 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: F_ULOCK, F_LOCK, F_TLOCK, F_TEST missing in unistd.h
Message-ID: <20040828091442.GD4786@cygbert.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <20040827101109.GK27978@cygbert.vinschen.de> <200408280228.i7S2SIs3014737@mx3.redhat.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200408280228.i7S2SIs3014737@mx3.redhat.com>
User-Agent: Mutt/1.4.2i

On Aug 27 21:27, Gary R. Van Sickle wrote:
> > On Aug 26 22:48, Gary R. Van Sickle wrote:
> > > 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?
> > 
> > Yes.
> > 
> 
> Wow.  Is this acually a useful thing, or just an unseemly holdover from the
> bad-old-days?

Yes, this is a useful thing.  Also POSIX does only define advisory locking.
See "mandatory.txt" in the Linux docs for more information.

> Hmmm.  Well, is there some reason you couldn't just use LockFile{Ex} et al?
> Any apps that are expecting to simultaneously write to the same file without
> "real" locking are busted anyway, aren't they?

LockFile/LockFileEx are mandatory locking, plus they are far from having
POSIX semantics.  See MSDN, especially the description of UnlockFileEx.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.

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

