fcntl.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 Ralf Baechle
  7. */
  8. #ifndef _ASM_FCNTL_H
  9. #define _ASM_FCNTL_H
  10. /* open/fcntl - O_SYNC is only implemented on blocks devices and on files
  11. located on an ext2 file system */
  12. #define O_APPEND 0x0008
  13. #define O_SYNC 0x0010
  14. #define O_NONBLOCK 0x0080
  15. #define O_CREAT 0x0100 /* not fcntl */
  16. #define O_TRUNC 0x0200 /* not fcntl */
  17. #define O_EXCL 0x0400 /* not fcntl */
  18. #define O_NOCTTY 0x0800 /* not fcntl */
  19. #define FASYNC 0x1000 /* fcntl, for BSD compatibility */
  20. #define O_LARGEFILE 0x2000 /* allow large file opens */
  21. #define O_DIRECT 0x8000 /* direct disk access hint */
  22. #define O_DIRECTORY 0x10000 /* must be a directory */
  23. #define O_NOFOLLOW 0x20000 /* don't follow links */
  24. #define O_NOATIME 0x40000
  25. #define O_NDELAY O_NONBLOCK
  26. #define F_GETLK 14
  27. #define F_SETLK 6
  28. #define F_SETLKW 7
  29. #define F_SETOWN 24 /* for sockets. */
  30. #define F_GETOWN 23 /* for sockets. */
  31. #define F_SETSIG 10 /* for sockets. */
  32. #define F_GETSIG 11 /* for sockets. */
  33. #ifndef __mips64
  34. #define F_GETLK64 33 /* using 'struct flock64' */
  35. #define F_SETLK64 34
  36. #define F_SETLKW64 35
  37. #endif
  38. /* for posix fcntl() and lockf() */
  39. #define F_RDLCK 0
  40. #define F_WRLCK 1
  41. #define F_UNLCK 2
  42. /* for old implementation of bsd flock () */
  43. #define F_EXLCK 4 /* or 3 */
  44. #define F_SHLCK 8 /* or 4 */
  45. /* for leases */
  46. #define F_INPROGRESS 16
  47. /*
  48. * The flavours of struct flock. "struct flock" is the ABI compliant
  49. * variant. Finally struct flock64 is the LFS variant of struct flock. As
  50. * a historic accident and inconsistence with the ABI definition it doesn't
  51. * contain all the same fields as struct flock.
  52. */
  53. #ifndef __mips64
  54. struct flock {
  55. short l_type;
  56. short l_whence;
  57. __kernel_off_t l_start;
  58. __kernel_off_t l_len;
  59. long l_sysid;
  60. __kernel_pid_t l_pid;
  61. long pad[4];
  62. } flock_t;
  63. typedef struct flock64 {
  64. short l_type;
  65. short l_whence;
  66. loff_t l_start;
  67. loff_t l_len;
  68. pid_t l_pid;
  69. } flock64_t;
  70. #else /* 64-bit definitions */
  71. typedef struct flock {
  72. short l_type;
  73. short l_whence;
  74. __kernel_off_t l_start;
  75. __kernel_off_t l_len;
  76. __kernel_pid_t l_pid;
  77. } flock_t;
  78. #ifdef __KERNEL__
  79. #define flock64 flock
  80. #endif
  81. #endif
  82. #include <asm-generic/fcntl.h>
  83. #endif /* _ASM_FCNTL_H */