On Sat, Nov 06, 1999 at 01:29:16PM -0600, Jonathan Lemon wrote:

> From the manual page for flock:
> 
> NOTES
>      Locks are on files, not file descriptors.  That is, file descriptors du-
>      plicated 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.

Doesn't this make it impossible to hold a lock on a file when you
want to fork a child to do some task 'cos the lock will be dropped
when the child closes its copy of the file discriptor on exit?
Either it's a posix goof or the lock shouldn't be let go until
either explicitly released or the last instance of the file discriptor
is closed?

        David.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to