fcntl-linux.h: add new definitions for file-private lock cmd values
authorJeff Layton <jlayton@redhat.com>
Tue, 11 Feb 2014 14:53:04 +0000 (09:53 -0500)
committerJeff Layton <jlayton@redhat.com>
Tue, 11 Feb 2014 14:53:04 +0000 (09:53 -0500)
Signed-off-by: Jeff Layton <jlayton@redhat.com>
ChangeLog
sysdeps/unix/sysv/linux/bits/fcntl-linux.h

index 5e820f7e99007ad8be8a35173dafa37ec3016a1b..0cbc1bb4cba9285fae6edcd949aade30f49357d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-02-11  Jeff Layton  <jlayton@redhat.com>
+
+       * sysdeps/unix/sysv/linux/bits/fcntl-linux.h:
+         (F_GETLKP, F_SETLKP, F_SETLKPW): New macros.
+
 2014-02-11  Stefan Liebler  <stli@linux.vnet.ibm.com>
 
        [BZ #16447]
 2014-02-11  Stefan Liebler  <stli@linux.vnet.ibm.com>
 
        [BZ #16447]
index cd4722b836ea048094a6c62ef7fdb721a133a0e3..5f36a84fd3a9151b25d9dab8c8eac527cae457bc 100644 (file)
 # define F_SETLKW64    14      /* Set record locking info (blocking).  */
 #endif
 
 # 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.
+ */
+#ifdef __USE_GNU
+# ifndef F_GETLKP
+#  define F_GETLKP     36
+#  define F_SETLKP     37
+#  define F_SETLKPW    38
+# endif
+#endif
+
 #ifdef __USE_LARGEFILE64
 # define O_LARGEFILE __O_LARGEFILE
 #endif
 #ifdef __USE_LARGEFILE64
 # define O_LARGEFILE __O_LARGEFILE
 #endif