c6d234
commit 0961f7e1e300ef633b0c1ad95d0999fb5c169f4e
c6d234
Author: Jeff Layton <jlayton@poochiereds.net>
c6d234
Date:   Wed Jul 23 14:21:05 2014 -0400
c6d234
c6d234
    fcntl-linux.h: add new definitions and manual updates for open file description locks
c6d234
    
c6d234
    Open file description locks have been merged into the Linux kernel for
c6d234
    v3.15.  Add the appropriate command-value definitions and an update to
c6d234
    the manual that describes their usage.
c6d234
c6d234
Note by DJ: the implementation doesn't work correctly for 32-bit file
c6d234
offsets.  Upstream changed the ABI to compensate but RHEL can't, so we
c6d234
enable these only for when file offsets are 64 bits.
c6d234
c6d234
diff -rup a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
c6d234
--- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h	2018-04-13 18:38:24.000000000 -0400
c6d234
+++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h	2018-04-13 20:05:21.743234360 -0400
c6d234
@@ -117,6 +117,25 @@
c6d234
 # define F_SETLKW64	14	/* Set record locking info (blocking).	*/
c6d234
 #endif
c6d234
 
c6d234
+#ifdef __USE_FILE_OFFSET64
c6d234
+/* open file description locks.
c6d234
+
c6d234
+   Usually record locks held by a process are released on *any* close and are
c6d234
+   not inherited across a fork.
c6d234
+
c6d234
+   These cmd values will set locks that conflict with process-associated record
c6d234
+   locks, but are "owned" by the opened file description, not the process.
c6d234
+   This means that they are inherited across fork or clone with CLONE_FILES
c6d234
+   like BSD (flock) locks, and they are only released automatically when the
c6d234
+   last reference to the the file description against which they were acquired
c6d234
+   is put. */
c6d234
+#ifdef __USE_GNU
c6d234
+# define F_OFD_GETLK	36
c6d234
+# define F_OFD_SETLK	37
c6d234
+# define F_OFD_SETLKW	38
c6d234
+#endif
c6d234
+#endif
c6d234
+
c6d234
 #ifdef __USE_LARGEFILE64
c6d234
 # define O_LARGEFILE __O_LARGEFILE
c6d234
 #endif