From: Jeff Layton Subject: [RFC][PATCH 1/2] fcntl.h: add new definitions for file-private lock cmd values Date: Tue, 11 Feb 2014 14:03:55 -0500 Message-ID: <1392145436-13983-2-git-send-email-jlayton@redhat.com> References: <1392145436-13983-1-git-send-email-jlayton@redhat.com> Cc: linux-fsdevel@vger.kernel.org To: libc-alpha@sourceware.org Return-path: Received: from mail-qc0-f170.google.com ([209.85.216.170]:58360 "EHLO mail-qc0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751366AbaBKTEF (ORCPT ); Tue, 11 Feb 2014 14:04:05 -0500 Received: by mail-qc0-f170.google.com with SMTP id e9so13766755qcy.15 for ; Tue, 11 Feb 2014 11:04:05 -0800 (PST) In-Reply-To: <1392145436-13983-1-git-send-email-jlayton@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Signed-off-by: Jeff Layton --- ChangeLog | 4 ++++ sysdeps/unix/sysv/linux/bits/fcntl-linux.h | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5e820f7e9900..db5b90385e2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-02-11 Jeff Layton + + * add new fcntl cmd macros for file-private locks + 2014-02-11 Stefan Liebler [BZ #16447] diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h index cd4722b836ea..71fd80dba2d8 100644 --- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h +++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h @@ -117,6 +117,24 @@ # define F_SETLKW64 14 /* Set record locking info (blocking). */ #endif +/* + * fd "private" POSIX locks. + * + * Usually POSIX locks held by a process are released on *any* close and are + * not inherited across a fork(). + * + * These cmd values will set locks that conflict with normal POSIX locks, but + * are "owned" by the opened file, not the process. This means that they are + * inherited across fork() like BSD (flock) locks, and they are only released + * automatically when the last reference to the the open file against which + * they were acquired is put. + */ +#ifndef F_GETLKP +# define F_GETLKP 36 +# define F_SETLKP 37 +# define F_SETLKPW 38 +#endif + #ifdef __USE_LARGEFILE64 # define O_LARGEFILE __O_LARGEFILE #endif -- 1.8.5.3