This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][glibc PATCH] fcntl-linux.h: add new definitions and manual updates for open file description locks


On Wed, 23 Apr 2014 11:09:51 -0400
ams@gnu.org (Alfred M. Szmidt) wrote:

>    @@ -2890,7 +2894,7 @@ Get flags associated with the open file.  @xref{File Status Flags}.
>     Set flags associated with the open file.  @xref{File Status Flags}.
> 
>     @item F_GETLK
>    -Get a file lock.  @xref{File Locks}.
>    +Test a file lock.  @xref{File Locks}.
> 
> F_GETLK does get the (first) lock which blocks; it doesn't test for
> it.  "Retrieves information about the first blocking lock ..." or
> something might be better than the original
> 
>    @@ -2898,6 +2902,18 @@ Set or clear a file lock.  @xref{File Locks}.
>     @item F_SETLKW
>     Like @code{F_SETLK}, but wait for completion.  @xref{File Locks}.
> 
>    +@item F_OFD_GETLK
>    +Test a open file description lock.  @xref{Open File Description Locks}.
>    +Specific to Linux.
> 
> Likewise.  You infact write that it does get the lock information
> later in the document wrt. F_OFD_GETLK.

Sorry, I disagree here...GETLK is really a misnomer, IMO. TESTLK would
have been a better name.

It's a way to test whether a particular lock can be applied, and to
return information about a conflicting lock if it can't. If, for
instance there is no conflicting lock, then you don't "get" any lock
information back (l_type just gets reset to F_UNLCK).

-- 
Jeff Layton <jlayton@redhat.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]