On Fri, 31 Jan 2003, Tom Lane wrote:
> Antti Haapala <antti.haapala@iki.fi> writes:
> > And from SunOS 5.8 flock
> > Locks are on files, not file descriptors. That is, file
> > descriptors duplicated through dup(2) or fork(2) do not
> > result in multiple instances of a lock, but rather multiple
> > references to a single lock. If a process holding a lock on
> > a file forks and the child explicitly unlocks the file, the
> > parent will lose its lock. Locks are not inherited by a
> > child process.
>
> That seems self-contradictory.
Yes. I note that in NetBSD, that paragraph of the manual page is
identical except that the last sentence has been removed.
At any rate, it seems to me highly unlikely that, since the child has
the *same* descriptor as the parent had, that the lock would disappear.
The other option would be that the lock belongs to the process, in which
case one would think that a child doing an unlock should not affect the
parent, because it's a different process....
cjs
--
Curt Sampson <cjs@cynic.net> +81 90 7737 2974 http://www.netbsd.org Don't you know, in this new Dark Age, we're
alllight. --XTC