fcntl.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /*
  2. * This program is free software; you can redistribute it and/or modify
  3. * it under the terms of the GNU General Public License version 2 as
  4. * published by the Free Software Foundation, or (at your option) any
  5. * later version. See the COPYING file in the top-level directory.
  6. */
  7. #ifndef GENERIC_FCNTL_H
  8. #define GENERIC_FCNTL_H
  9. /* <asm-generic/fcntl.h> values follow. */
  10. #define TARGET_O_ACCMODE 0003
  11. #define TARGET_O_RDONLY 00
  12. #define TARGET_O_WRONLY 01
  13. #define TARGET_O_RDWR 02
  14. #ifndef TARGET_O_CREAT
  15. #define TARGET_O_CREAT 0100 /* not fcntl */
  16. #endif
  17. #ifndef TARGET_O_EXCL
  18. #define TARGET_O_EXCL 0200 /* not fcntl */
  19. #endif
  20. #ifndef TARGET_O_NOCTTY
  21. #define TARGET_O_NOCTTY 0400 /* not fcntl */
  22. #endif
  23. #ifndef TARGET_O_TRUNC
  24. #define TARGET_O_TRUNC 01000 /* not fcntl */
  25. #endif
  26. #ifndef TARGET_O_APPEND
  27. #define TARGET_O_APPEND 02000
  28. #endif
  29. #ifndef TARGET_O_NONBLOCK
  30. #define TARGET_O_NONBLOCK 04000
  31. #endif
  32. #ifndef TARGET_O_DSYNC
  33. #define TARGET_O_DSYNC 010000
  34. #endif
  35. #ifndef TARGET_FASYNC
  36. #define TARGET_FASYNC 020000 /* fcntl, for BSD compatibility */
  37. #endif
  38. #ifndef TARGET_O_DIRECT
  39. #define TARGET_O_DIRECT 040000 /* direct disk access hint */
  40. #endif
  41. #ifndef TARGET_O_LARGEFILE
  42. #define TARGET_O_LARGEFILE 0100000
  43. #endif
  44. #ifndef TARGET_O_DIRECTORY
  45. #define TARGET_O_DIRECTORY 0200000 /* must be a directory */
  46. #endif
  47. #ifndef TARGET_O_NOFOLLOW
  48. #define TARGET_O_NOFOLLOW 0400000 /* don't follow links */
  49. #endif
  50. #ifndef TARGET_O_NOATIME
  51. #define TARGET_O_NOATIME 01000000
  52. #endif
  53. #ifndef TARGET_O_CLOEXEC
  54. #define TARGET_O_CLOEXEC 02000000
  55. #endif
  56. #ifndef TARGET___O_SYNC
  57. #define TARGET___O_SYNC 04000000
  58. #endif
  59. #ifndef TARGET_O_PATH
  60. #define TARGET_O_PATH 010000000
  61. #endif
  62. #ifndef TARGET___O_TMPFILE
  63. #define TARGET___O_TMPFILE 020000000
  64. #endif
  65. #ifndef TARGET_O_TMPFILE
  66. #define TARGET_O_TMPFILE (TARGET___O_TMPFILE | TARGET_O_DIRECTORY)
  67. #endif
  68. #ifndef TARGET_O_NDELAY
  69. #define TARGET_O_NDELAY TARGET_O_NONBLOCK
  70. #endif
  71. #ifndef TARGET_O_SYNC
  72. #define TARGET_O_SYNC (TARGET___O_SYNC | TARGET_O_DSYNC)
  73. #endif
  74. #define TARGET_F_DUPFD 0 /* dup */
  75. #define TARGET_F_GETFD 1 /* get close_on_exec */
  76. #define TARGET_F_SETFD 2 /* set/clear close_on_exec */
  77. #define TARGET_F_GETFL 3 /* get file->f_flags */
  78. #define TARGET_F_SETFL 4 /* set file->f_flags */
  79. #ifndef TARGET_F_GETLK
  80. #define TARGET_F_GETLK 5
  81. #define TARGET_F_SETLK 6
  82. #define TARGET_F_SETLKW 7
  83. #endif
  84. #ifndef TARGET_F_SETOWN
  85. #define TARGET_F_SETOWN 8 /* for sockets. */
  86. #define TARGET_F_GETOWN 9 /* for sockets. */
  87. #endif
  88. #ifndef TARGET_F_SETSIG
  89. #define TARGET_F_SETSIG 10 /* for sockets. */
  90. #define TARGET_F_GETSIG 11 /* for sockets. */
  91. #endif
  92. #ifndef TARGET_F_GETLK64
  93. #define TARGET_F_GETLK64 12 /* using 'struct flock64' */
  94. #define TARGET_F_SETLK64 13
  95. #define TARGET_F_SETLKW64 14
  96. #endif
  97. #ifndef TARGET_F_SETOWN_EX
  98. #define TARGET_F_SETOWN_EX 15
  99. #define TARGET_F_GETOWN_EX 16
  100. #endif
  101. struct target_f_owner_ex {
  102. int type; /* Owner type of ID. */
  103. int pid; /* ID of owner. */
  104. };
  105. #ifndef TARGET_F_RDLCK
  106. #define TARGET_F_RDLCK 0
  107. #define TARGET_F_WRLCK 1
  108. #define TARGET_F_UNLCK 2
  109. #endif
  110. #ifndef TARGET_F_EXLCK
  111. #define TARGET_F_EXLCK 4
  112. #define TARGET_F_SHLCK 8
  113. #endif
  114. #ifndef TARGET_HAVE_ARCH_STRUCT_FLOCK
  115. #ifndef TARGET_ARCH_FLOCK_PAD
  116. #define TARGET_ARCH_FLOCK_PAD
  117. #endif
  118. struct target_flock {
  119. short l_type;
  120. short l_whence;
  121. abi_long l_start;
  122. abi_long l_len;
  123. int l_pid;
  124. TARGET_ARCH_FLOCK_PAD
  125. };
  126. #endif
  127. #ifndef TARGET_HAVE_ARCH_STRUCT_FLOCK64
  128. #ifndef TARGET_ARCH_FLOCK64_PAD
  129. #define TARGET_ARCH_FLOCK64_PAD
  130. #endif
  131. struct target_flock64 {
  132. abi_short l_type;
  133. abi_short l_whence;
  134. abi_llong l_start;
  135. abi_llong l_len;
  136. abi_int l_pid;
  137. TARGET_ARCH_FLOCK64_PAD
  138. };
  139. #endif
  140. #endif