fcntl.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #ifndef _LINUX_FCNTL_H
  2. #define _LINUX_FCNTL_H
  3. #include <asm/fcntl.h>
  4. #define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)
  5. #define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1)
  6. /*
  7. * Cancel a blocking posix lock; internal use only until we expose an
  8. * asynchronous lock api to userspace:
  9. */
  10. #define F_CANCELLK (F_LINUX_SPECIFIC_BASE + 5)
  11. /* Create a file descriptor with FD_CLOEXEC set. */
  12. #define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
  13. /*
  14. * Request nofications on a directory.
  15. * See below for events that may be notified.
  16. */
  17. #define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2)
  18. /*
  19. * Set and get of pipe page size array
  20. */
  21. #define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7)
  22. #define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
  23. /*
  24. * Types of directory notifications that may be requested.
  25. */
  26. #define DN_ACCESS 0x00000001 /* File accessed */
  27. #define DN_MODIFY 0x00000002 /* File modified */
  28. #define DN_CREATE 0x00000004 /* File created */
  29. #define DN_DELETE 0x00000008 /* File removed */
  30. #define DN_RENAME 0x00000010 /* File renamed */
  31. #define DN_ATTRIB 0x00000020 /* File changed attibutes */
  32. #define DN_MULTISHOT 0x80000000 /* Don't remove notifier */
  33. #define AT_FDCWD -100 /* Special value used to indicate
  34. openat should use the current
  35. working directory. */
  36. #define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */
  37. #define AT_REMOVEDIR 0x200 /* Remove directory instead of
  38. unlinking file. */
  39. #define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
  40. #define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount traversal */
  41. #define AT_EMPTY_PATH 0x1000 /* Allow empty relative pathname */
  42. #ifdef __KERNEL__
  43. #ifndef force_o_largefile
  44. #define force_o_largefile() (BITS_PER_LONG != 32)
  45. #endif
  46. #if BITS_PER_LONG == 32
  47. #define IS_GETLK32(cmd) ((cmd) == F_GETLK)
  48. #define IS_SETLK32(cmd) ((cmd) == F_SETLK)
  49. #define IS_SETLKW32(cmd) ((cmd) == F_SETLKW)
  50. #define IS_GETLK64(cmd) ((cmd) == F_GETLK64)
  51. #define IS_SETLK64(cmd) ((cmd) == F_SETLK64)
  52. #define IS_SETLKW64(cmd) ((cmd) == F_SETLKW64)
  53. #else
  54. #define IS_GETLK32(cmd) (0)
  55. #define IS_SETLK32(cmd) (0)
  56. #define IS_SETLKW32(cmd) (0)
  57. #define IS_GETLK64(cmd) ((cmd) == F_GETLK)
  58. #define IS_SETLK64(cmd) ((cmd) == F_SETLK)
  59. #define IS_SETLKW64(cmd) ((cmd) == F_SETLKW)
  60. #endif /* BITS_PER_LONG == 32 */
  61. #define IS_GETLK(cmd) (IS_GETLK32(cmd) || IS_GETLK64(cmd))
  62. #define IS_SETLK(cmd) (IS_SETLK32(cmd) || IS_SETLK64(cmd))
  63. #define IS_SETLKW(cmd) (IS_SETLKW32(cmd) || IS_SETLKW64(cmd))
  64. #endif /* __KERNEL__ */
  65. #endif