fcntl.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. * Request nofications on a directory.
  8. * See below for events that may be notified.
  9. */
  10. #define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2)
  11. /*
  12. * Types of directory notifications that may be requested.
  13. */
  14. #define DN_ACCESS 0x00000001 /* File accessed */
  15. #define DN_MODIFY 0x00000002 /* File modified */
  16. #define DN_CREATE 0x00000004 /* File created */
  17. #define DN_DELETE 0x00000008 /* File removed */
  18. #define DN_RENAME 0x00000010 /* File renamed */
  19. #define DN_ATTRIB 0x00000020 /* File changed attibutes */
  20. #define DN_MULTISHOT 0x80000000 /* Don't remove notifier */
  21. #define AT_FDCWD -100 /* Special value used to indicate
  22. openat should use the current
  23. working directory. */
  24. #define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */
  25. #define AT_REMOVEDIR 0x200 /* Remove directory instead of
  26. unlinking file. */
  27. #define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
  28. #ifdef __KERNEL__
  29. #ifndef force_o_largefile
  30. #define force_o_largefile() (BITS_PER_LONG != 32)
  31. #endif
  32. #if BITS_PER_LONG == 32
  33. #define IS_GETLK32(cmd) ((cmd) == F_GETLK)
  34. #define IS_SETLK32(cmd) ((cmd) == F_SETLK)
  35. #define IS_SETLKW32(cmd) ((cmd) == F_SETLKW)
  36. #define IS_GETLK64(cmd) ((cmd) == F_GETLK64)
  37. #define IS_SETLK64(cmd) ((cmd) == F_SETLK64)
  38. #define IS_SETLKW64(cmd) ((cmd) == F_SETLKW64)
  39. #else
  40. #define IS_GETLK32(cmd) (0)
  41. #define IS_SETLK32(cmd) (0)
  42. #define IS_SETLKW32(cmd) (0)
  43. #define IS_GETLK64(cmd) ((cmd) == F_GETLK)
  44. #define IS_SETLK64(cmd) ((cmd) == F_SETLK)
  45. #define IS_SETLKW64(cmd) ((cmd) == F_SETLKW)
  46. #endif /* BITS_PER_LONG == 32 */
  47. #define IS_GETLK(cmd) (IS_GETLK32(cmd) || IS_GETLK64(cmd))
  48. #define IS_SETLK(cmd) (IS_SETLK32(cmd) || IS_SETLK64(cmd))
  49. #define IS_SETLKW(cmd) (IS_SETLKW32(cmd) || IS_SETLKW64(cmd))
  50. #endif /* __KERNEL__ */
  51. #endif