hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/tools/include/uapi/linux/fcntl.h
....@@ -3,6 +3,7 @@
33 #define _UAPI_LINUX_FCNTL_H
44
55 #include <asm/fcntl.h>
6
+#include <linux/openat2.h>
67
78 #define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)
89 #define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1)
....@@ -41,6 +42,7 @@
4142 #define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */
4243 #define F_SEAL_GROW 0x0004 /* prevent file from growing */
4344 #define F_SEAL_WRITE 0x0008 /* prevent writes */
45
+#define F_SEAL_FUTURE_WRITE 0x0010 /* prevent future writes while mapped */
4446 /* (1U << 31) is reserved for signed error codes */
4547
4648 /*
....@@ -57,12 +59,19 @@
5759 * Valid hint values for F_{GET,SET}_RW_HINT. 0 is "not set", or can be
5860 * used to clear any hints previously set.
5961 */
60
-#define RWF_WRITE_LIFE_NOT_SET 0
62
+#define RWH_WRITE_LIFE_NOT_SET 0
6163 #define RWH_WRITE_LIFE_NONE 1
6264 #define RWH_WRITE_LIFE_SHORT 2
6365 #define RWH_WRITE_LIFE_MEDIUM 3
6466 #define RWH_WRITE_LIFE_LONG 4
6567 #define RWH_WRITE_LIFE_EXTREME 5
68
+
69
+/*
70
+ * The originally introduced spelling is remained from the first
71
+ * versions of the patch set that introduced the feature, see commit
72
+ * v4.13-rc1~212^2~51.
73
+ */
74
+#define RWF_WRITE_LIFE_NOT_SET RWH_WRITE_LIFE_NOT_SET
6675
6776 /*
6877 * Types of directory notifications that may be requested.
....@@ -75,10 +84,20 @@
7584 #define DN_ATTRIB 0x00000020 /* File changed attibutes */
7685 #define DN_MULTISHOT 0x80000000 /* Don't remove notifier */
7786
87
+/*
88
+ * The constants AT_REMOVEDIR and AT_EACCESS have the same value. AT_EACCESS is
89
+ * meaningful only to faccessat, while AT_REMOVEDIR is meaningful only to
90
+ * unlinkat. The two functions do completely different things and therefore,
91
+ * the flags can be allowed to overlap. For example, passing AT_REMOVEDIR to
92
+ * faccessat would be undefined behavior and thus treating it equivalent to
93
+ * AT_EACCESS is valid undefined behavior.
94
+ */
7895 #define AT_FDCWD -100 /* Special value used to indicate
7996 openat should use the current
8097 working directory. */
8198 #define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */
99
+#define AT_EACCESS 0x200 /* Test access permitted for
100
+ effective IDs, not real IDs. */
82101 #define AT_REMOVEDIR 0x200 /* Remove directory instead of
83102 unlinking file. */
84103 #define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
....@@ -90,5 +109,6 @@
90109 #define AT_STATX_FORCE_SYNC 0x2000 /* - Force the attributes to be sync'd with the server */
91110 #define AT_STATX_DONT_SYNC 0x4000 /* - Don't sync attributes with the server */
92111
112
+#define AT_RECURSIVE 0x8000 /* Apply to the entire subtree */
93113
94114 #endif /* _UAPI_LINUX_FCNTL_H */