locks: add new fcntl cmd values for handling file private locks
[linux-2.6-block.git] / include / uapi / asm-generic / fcntl.h
index 36025f77c6ed2ab2cafc2fa2e11a3b919ad38ecc..a9b13f8b3595107579ca6ea20421d53a9dd15017 100644 (file)
 #define F_GETOWNER_UIDS        17
 #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.
+ */
+#define F_GETLKP       36
+#define F_SETLKP       37
+#define F_SETLKPW      38
+
 #define F_OWNER_TID    0
 #define F_OWNER_PID    1
 #define F_OWNER_PGRP   2