fcntl.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1995, 96, 97, 98, 99, 2003, 05 Ralf Baechle
  7. */
  8. #ifndef _ASM_FCNTL_H
  9. #define _ASM_FCNTL_H
  10. #define O_APPEND 0x0008
  11. #define O_DSYNC 0x0010 /* used to be O_SYNC, see below */
  12. #define O_NONBLOCK 0x0080
  13. #define O_CREAT 0x0100 /* not fcntl */
  14. #define O_TRUNC 0x0200 /* not fcntl */
  15. #define O_EXCL 0x0400 /* not fcntl */
  16. #define O_NOCTTY 0x0800 /* not fcntl */
  17. #define FASYNC 0x1000 /* fcntl, for BSD compatibility */
  18. #define O_LARGEFILE 0x2000 /* allow large file opens */
  19. /*
  20. * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using
  21. * the O_SYNC flag. We continue to use the existing numerical value
  22. * for O_DSYNC semantics now, but using the correct symbolic name for it.
  23. * This new value is used to request true Posix O_SYNC semantics. It is
  24. * defined in this strange way to make sure applications compiled against
  25. * new headers get at least O_DSYNC semantics on older kernels.
  26. *
  27. * This has the nice side-effect that we can simply test for O_DSYNC
  28. * wherever we do not care if O_DSYNC or O_SYNC is used.
  29. *
  30. * Note: __O_SYNC must never be used directly.
  31. */
  32. #define __O_SYNC 0x4000
  33. #define O_SYNC (__O_SYNC|O_DSYNC)
  34. #define O_DIRECT 0x8000 /* direct disk access hint */
  35. #define F_GETLK 14
  36. #define F_SETLK 6
  37. #define F_SETLKW 7
  38. #define F_SETOWN 24 /* for sockets. */
  39. #define F_GETOWN 23 /* for sockets. */
  40. #ifndef __mips64
  41. #define F_GETLK64 33 /* using 'struct flock64' */
  42. #define F_SETLK64 34
  43. #define F_SETLKW64 35
  44. #endif
  45. /*
  46. * The flavours of struct flock. "struct flock" is the ABI compliant
  47. * variant. Finally struct flock64 is the LFS variant of struct flock. As
  48. * a historic accident and inconsistence with the ABI definition it doesn't
  49. * contain all the same fields as struct flock.
  50. */
  51. #ifdef CONFIG_32BIT
  52. #include <linux/types.h>
  53. struct flock {
  54. short l_type;
  55. short l_whence;
  56. off_t l_start;
  57. off_t l_len;
  58. long l_sysid;
  59. __kernel_pid_t l_pid;
  60. long pad[4];
  61. };
  62. #define HAVE_ARCH_STRUCT_FLOCK
  63. #endif /* CONFIG_32BIT */
  64. #include <asm-generic/fcntl.h>
  65. #endif /* _ASM_FCNTL_H */