I agree -- the manual page could offer a little more help.
I've added new text for man-pages-2.04. (Please close
this report.) New text is:
If a process uses open(2) (or similar) to obtain more than
one descriptor for the same file, these descriptors are
treated independently by flock(). An attempt to lock the
file using one of these file descriptors may be denied by
a lock that the calling process has already placed via
another descriptor.
Kevin Ryde said:
> The lock is actually associated with the file table entry
> is it? Or the table entry plus the process? Perhaps this
> can be clarified.
Note that the manual page did already say the following
elsewhere:
Locks created by flock() are associated with an open file
table entry. This means that duplicate file descriptors
(created by, for example, fork(2) or dup(2)) refer to the
same lock, and this lock may be modified or released using
any of these descriptors. Furthermore, the lock is
released either by an explicit LOCK_UN operation on any of
these duplicate descriptors, or when all such descriptors
have been closed.
Cheers,
Michael
--
Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7
Want to help with man page maintenance? Grab the latest
tarball at ftp://ftp.win.tue.nl/pub/linux-local/manpages/
and grep the source files for 'FIXME'.
Please submit non-trivial man page suggestions as
"diff -u" patches.
Geschenkt: 3 Monate GMX ProMail gratis + 3 Ausgaben stern gratis
++ Jetzt anmelden & testen ++ http://www.gmx.net/de/go/promail ++
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]