fcntl.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _UAPI_LINUX_FCNTL_H
  3. #define _UAPI_LINUX_FCNTL_H
  4. #include <asm/fcntl.h>
  5. #define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)
  6. #define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1)
  7. /*
  8. * Cancel a blocking posix lock; internal use only until we expose an
  9. * asynchronous lock api to userspace:
  10. */
  11. #define F_CANCELLK (F_LINUX_SPECIFIC_BASE + 5)
  12. /* Create a file descriptor with FD_CLOEXEC set. */
  13. #define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
  14. /*
  15. * Request nofications on a directory.
  16. * See below for events that may be notified.
  17. */
  18. #define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2)
  19. /*
  20. * Set and get of pipe page size array
  21. */
  22. #define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7)
  23. #define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
  24. /*
  25. * Set/Get seals
  26. */
  27. #define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
  28. #define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)
  29. /*
  30. * Types of seals
  31. */
  32. #define F_SEAL_SEAL 0x0001 /* prevent further seals from being set */
  33. #define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */
  34. #define F_SEAL_GROW 0x0004 /* prevent file from growing */
  35. #define F_SEAL_WRITE 0x0008 /* prevent writes */
  36. /* (1U << 31) is reserved for signed error codes */
  37. /*
  38. * Set/Get write life time hints. {GET,SET}_RW_HINT operate on the
  39. * underlying inode, while {GET,SET}_FILE_RW_HINT operate only on
  40. * the specific file.
  41. */
  42. #define F_GET_RW_HINT (F_LINUX_SPECIFIC_BASE + 11)
  43. #define F_SET_RW_HINT (F_LINUX_SPECIFIC_BASE + 12)
  44. #define F_GET_FILE_RW_HINT (F_LINUX_SPECIFIC_BASE + 13)
  45. #define F_SET_FILE_RW_HINT (F_LINUX_SPECIFIC_BASE + 14)
  46. /*
  47. * Valid hint values for F_{GET,SET}_RW_HINT. 0 is "not set", or can be
  48. * used to clear any hints previously set.
  49. */
  50. #define RWF_WRITE_LIFE_NOT_SET 0
  51. #define RWH_WRITE_LIFE_NONE 1
  52. #define RWH_WRITE_LIFE_SHORT 2
  53. #define RWH_WRITE_LIFE_MEDIUM 3
  54. #define RWH_WRITE_LIFE_LONG 4
  55. #define RWH_WRITE_LIFE_EXTREME 5
  56. /*
  57. * Types of directory notifications that may be requested.
  58. */
  59. #define DN_ACCESS 0x00000001 /* File accessed */
  60. #define DN_MODIFY 0x00000002 /* File modified */
  61. #define DN_CREATE 0x00000004 /* File created */
  62. #define DN_DELETE 0x00000008 /* File removed */
  63. #define DN_RENAME 0x00000010 /* File renamed */
  64. #define DN_ATTRIB 0x00000020 /* File changed attibutes */
  65. #define DN_MULTISHOT 0x80000000 /* Don't remove notifier */
  66. #define AT_FDCWD -100 /* Special value used to indicate
  67. openat should use the current
  68. working directory. */
  69. #define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */
  70. #define AT_REMOVEDIR 0x200 /* Remove directory instead of
  71. unlinking file. */
  72. #define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
  73. #define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount traversal */
  74. #define AT_EMPTY_PATH 0x1000 /* Allow empty relative pathname */
  75. #define AT_STATX_SYNC_TYPE 0x6000 /* Type of synchronisation required from statx() */
  76. #define AT_STATX_SYNC_AS_STAT 0x0000 /* - Do whatever stat() does */
  77. #define AT_STATX_FORCE_SYNC 0x2000 /* - Force the attributes to be sync'd with the server */
  78. #define AT_STATX_DONT_SYNC 0x4000 /* - Don't sync attributes with the server */
  79. #endif /* _UAPI_LINUX_FCNTL_H */