This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC][glibc PATCH] fcntl-linux.h: add new definitions and manual updates for open file description locks
- From: ams at gnu dot org (Alfred M. Szmidt)
- To: Jeff Layton <jlayton at redhat dot com>
- Cc: libc-alpha at sourceware dot org, linux-fsdevel at vger dot kernel dot org, linux-kernel at vger dot kernel dot org, tytso at mit dot edu, dalias at libc dot org, mtk dot manpages at gmail dot com, samba-technical at lists dot samba dot org, nfs-ganesha-devel at lists dot sourceforge dot net, carlos at redhat dot com, metze at samba dot org, hch at infradead dot org, bharrosh at panasas dot com
- Date: Wed, 23 Apr 2014 15:00:06 -0400
- Subject: Re: [RFC][glibc PATCH] fcntl-linux.h: add new definitions and manual updates for open file description locks
- Authentication-results: sourceware.org; auth=none
- References: <1398253172-9221-1-git-send-email-jlayton at redhat dot com> <E1Wcyo3-0000Eg-UC at fencepost dot gnu dot org> <20140423112843 dot 77889d16 at tlielax dot poochiereds dot net>
- Reply-to: ams at gnu dot org
> 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.
GETLK are used is to "get the first lock".
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).
While I kinda see your point, it isn't what GETLK does; it really does
get you information about the first lock -- you're not testing
anything. It is also the terminology used in the POSIX standard.