Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Oct 1996 11:00:34 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        michaelh@cet.co.jp (Michael Hancock)
Cc:        terry@lambert.org, julian@whistle.com, eng@alpo.whistle.com, hackers@freebsd.org
Subject:   Re: flock/sendmail stuffup
Message-ID:  <199610011800.LAA02000@phaeton.artisoft.com>
In-Reply-To: <Pine.SV4.3.93.961001135922.22919D-100000@parkplace.cet.co.jp> from "Michael Hancock" at Oct 1, 96 02:01:58 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> On Mon, 30 Sep 1996, Terry Lambert wrote:
> 
> > 8-).  Already there.  flock uses an advisory range lock on the entire
> > file -- that's how it operates: it's a simplified special case of fcntl()
> > locking.
> 
> flock also has better semantics.  I think fcntl() still releases all locks
> when any one process closes the file.

I will have to check it.  If it does, it is in error.  Locks must be
explicitly released, or there is an implied release on decrement of
reference count from 1->0.  In other words, it's in the close() code,
not the exit code that calls the close code.

There *does* need to be two counting references -- instantiation count
vs. open count, since an object in the name cache is considered to be
instantiated, but not necessarily reference for the purpose of resource
tracking the locks.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610011800.LAA02000>