logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

fcntl.h (5766B)


  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _LINUX_FCNTL_H
  3. #define _LINUX_FCNTL_H
  4. #include <asm/fcntl.h>
  5. #include <linux/openat2.h>
  6. #define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)
  7. #define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1)
  8. /*
  9. * Request nofications on a directory.
  10. * See below for events that may be notified.
  11. */
  12. #define F_NOTIFY (F_LINUX_SPECIFIC_BASE + 2)
  13. #define F_DUPFD_QUERY (F_LINUX_SPECIFIC_BASE + 3)
  14. /* Was the file just created? */
  15. #define F_CREATED_QUERY (F_LINUX_SPECIFIC_BASE + 4)
  16. /*
  17. * Cancel a blocking posix lock; internal use only until we expose an
  18. * asynchronous lock api to userspace:
  19. */
  20. #define F_CANCELLK (F_LINUX_SPECIFIC_BASE + 5)
  21. /* Create a file descriptor with FD_CLOEXEC set. */
  22. #define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
  23. /*
  24. * Set and get of pipe page size array
  25. */
  26. #define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7)
  27. #define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
  28. /*
  29. * Set/Get seals
  30. */
  31. #define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
  32. #define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)
  33. /*
  34. * Types of seals
  35. */
  36. #define F_SEAL_SEAL 0x0001 /* prevent further seals from being set */
  37. #define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */
  38. #define F_SEAL_GROW 0x0004 /* prevent file from growing */
  39. #define F_SEAL_WRITE 0x0008 /* prevent writes */
  40. #define F_SEAL_FUTURE_WRITE 0x0010 /* prevent future writes while mapped */
  41. #define F_SEAL_EXEC 0x0020 /* prevent chmod modifying exec bits */
  42. /* (1U << 31) is reserved for signed error codes */
  43. /*
  44. * Set/Get write life time hints. {GET,SET}_RW_HINT operate on the
  45. * underlying inode, while {GET,SET}_FILE_RW_HINT operate only on
  46. * the specific file.
  47. */
  48. #define F_GET_RW_HINT (F_LINUX_SPECIFIC_BASE + 11)
  49. #define F_SET_RW_HINT (F_LINUX_SPECIFIC_BASE + 12)
  50. #define F_GET_FILE_RW_HINT (F_LINUX_SPECIFIC_BASE + 13)
  51. #define F_SET_FILE_RW_HINT (F_LINUX_SPECIFIC_BASE + 14)
  52. /*
  53. * Valid hint values for F_{GET,SET}_RW_HINT. 0 is "not set", or can be
  54. * used to clear any hints previously set.
  55. */
  56. #define RWH_WRITE_LIFE_NOT_SET 0
  57. #define RWH_WRITE_LIFE_NONE 1
  58. #define RWH_WRITE_LIFE_SHORT 2
  59. #define RWH_WRITE_LIFE_MEDIUM 3
  60. #define RWH_WRITE_LIFE_LONG 4
  61. #define RWH_WRITE_LIFE_EXTREME 5
  62. /*
  63. * The originally introduced spelling is remained from the first
  64. * versions of the patch set that introduced the feature, see commit
  65. * v4.13-rc1~212^2~51.
  66. */
  67. #define RWF_WRITE_LIFE_NOT_SET RWH_WRITE_LIFE_NOT_SET
  68. /*
  69. * Types of directory notifications that may be requested.
  70. */
  71. #define DN_ACCESS 0x00000001 /* File accessed */
  72. #define DN_MODIFY 0x00000002 /* File modified */
  73. #define DN_CREATE 0x00000004 /* File created */
  74. #define DN_DELETE 0x00000008 /* File removed */
  75. #define DN_RENAME 0x00000010 /* File renamed */
  76. #define DN_ATTRIB 0x00000020 /* File changed attibutes */
  77. #define DN_MULTISHOT 0x80000000 /* Don't remove notifier */
  78. #define AT_FDCWD -100 /* Special value for dirfd used to
  79. indicate openat should use the
  80. current working directory. */
  81. /* Generic flags for the *at(2) family of syscalls. */
  82. /* Reserved for per-syscall flags 0xff. */
  83. #define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic
  84. links. */
  85. /* Reserved for per-syscall flags 0x200 */
  86. #define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
  87. #define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount
  88. traversal. */
  89. #define AT_EMPTY_PATH 0x1000 /* Allow empty relative
  90. pathname to operate on dirfd
  91. directly. */
  92. /*
  93. * These flags are currently statx(2)-specific, but they could be made generic
  94. * in the future and so they should not be used for other per-syscall flags.
  95. */
  96. #define AT_STATX_SYNC_TYPE 0x6000 /* Type of synchronisation required from statx() */
  97. #define AT_STATX_SYNC_AS_STAT 0x0000 /* - Do whatever stat() does */
  98. #define AT_STATX_FORCE_SYNC 0x2000 /* - Force the attributes to be sync'd with the server */
  99. #define AT_STATX_DONT_SYNC 0x4000 /* - Don't sync attributes with the server */
  100. #define AT_RECURSIVE 0x8000 /* Apply to the entire subtree */
  101. /*
  102. * Per-syscall flags for the *at(2) family of syscalls.
  103. *
  104. * These are flags that are so syscall-specific that a user passing these flags
  105. * to the wrong syscall is so "clearly wrong" that we can safely call such
  106. * usage "undefined behaviour".
  107. *
  108. * For example, the constants AT_REMOVEDIR and AT_EACCESS have the same value.
  109. * AT_EACCESS is meaningful only to faccessat, while AT_REMOVEDIR is meaningful
  110. * only to unlinkat. The two functions do completely different things and
  111. * therefore, the flags can be allowed to overlap. For example, passing
  112. * AT_REMOVEDIR to faccessat would be undefined behavior and thus treating it
  113. * equivalent to AT_EACCESS is valid undefined behavior.
  114. *
  115. * Note for implementers: When picking a new per-syscall AT_* flag, try to
  116. * reuse already existing flags first. This leaves us with as many unused bits
  117. * as possible, so we can use them for generic bits in the future if necessary.
  118. */
  119. /* Flags for renameat2(2) (must match legacy RENAME_* flags). */
  120. #define AT_RENAME_NOREPLACE 0x0001
  121. #define AT_RENAME_EXCHANGE 0x0002
  122. #define AT_RENAME_WHITEOUT 0x0004
  123. /* Flag for faccessat(2). */
  124. #define AT_EACCESS 0x200 /* Test access permitted for
  125. effective IDs, not real IDs. */
  126. /* Flag for unlinkat(2). */
  127. #define AT_REMOVEDIR 0x200 /* Remove directory instead of
  128. unlinking file. */
  129. /* Flags for name_to_handle_at(2). */
  130. #define AT_HANDLE_FID 0x200 /* File handle is needed to compare
  131. object identity and may not be
  132. usable with open_by_handle_at(2). */
  133. #define AT_HANDLE_MNT_ID_UNIQUE 0x001 /* Return the u64 unique mount ID. */
  134. #endif /* _LINUX_FCNTL_H */