fcntl.in.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /* Like <fcntl.h>, but with non-working flags defined to 0.
  2. Copyright (C) 2006-2008 Free Software Foundation, Inc.
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  13. /* written by Paul Eggert */
  14. #if __GNUC__ >= 3
  15. @PRAGMA_SYSTEM_HEADER@
  16. #endif
  17. #if defined __need_system_fcntl_h
  18. /* Special invocation convention. */
  19. #include <sys/types.h>
  20. #include <sys/stat.h>
  21. #include <unistd.h>
  22. #@INCLUDE_NEXT@ @NEXT_FCNTL_H@
  23. #else
  24. /* Normal invocation convention. */
  25. #ifndef _GL_FCNTL_H
  26. #include <sys/types.h>
  27. #include <sys/stat.h>
  28. #include <unistd.h>
  29. /* The include_next requires a split double-inclusion guard. */
  30. #@INCLUDE_NEXT@ @NEXT_FCNTL_H@
  31. #ifndef _GL_FCNTL_H
  32. #define _GL_FCNTL_H
  33. /* Declare overridden functions. */
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. #if @GNULIB_OPEN@
  38. # if @REPLACE_OPEN@
  39. # undef open
  40. # define open rpl_open
  41. extern int open (const char *filename, int flags, ...);
  42. # endif
  43. #endif
  44. #ifdef FCHDIR_REPLACEMENT
  45. /* gnulib internal function. */
  46. extern void _gl_register_fd (int fd, const char *filename);
  47. #endif
  48. #ifdef __cplusplus
  49. }
  50. #endif
  51. /* Fix up the O_* macros. */
  52. #if !defined O_DIRECT && defined O_DIRECTIO
  53. /* Tru64 spells it `O_DIRECTIO'. */
  54. # define O_DIRECT O_DIRECTIO
  55. #endif
  56. #ifndef O_DIRECT
  57. # define O_DIRECT 0
  58. #endif
  59. #ifndef O_DIRECTORY
  60. # define O_DIRECTORY 0
  61. #endif
  62. #ifndef O_DSYNC
  63. # define O_DSYNC 0
  64. #endif
  65. #ifndef O_NDELAY
  66. # define O_NDELAY 0
  67. #endif
  68. #ifndef O_NOATIME
  69. # define O_NOATIME 0
  70. #endif
  71. #ifndef O_NONBLOCK
  72. # define O_NONBLOCK O_NDELAY
  73. #endif
  74. #ifndef O_NOCTTY
  75. # define O_NOCTTY 0
  76. #endif
  77. #ifndef O_NOFOLLOW
  78. # define O_NOFOLLOW 0
  79. #endif
  80. #ifndef O_NOLINKS
  81. # define O_NOLINKS 0
  82. #endif
  83. #ifndef O_RSYNC
  84. # define O_RSYNC 0
  85. #endif
  86. #ifndef O_SYNC
  87. # define O_SYNC 0
  88. #endif
  89. /* For systems that distinguish between text and binary I/O.
  90. O_BINARY is usually declared in fcntl.h */
  91. #if !defined O_BINARY && defined _O_BINARY
  92. /* For MSC-compatible compilers. */
  93. # define O_BINARY _O_BINARY
  94. # define O_TEXT _O_TEXT
  95. #endif
  96. #if defined __BEOS__ || defined __HAIKU__
  97. /* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect. */
  98. # undef O_BINARY
  99. # undef O_TEXT
  100. #endif
  101. #ifndef O_BINARY
  102. # define O_BINARY 0
  103. # define O_TEXT 0
  104. #endif
  105. #endif /* _GL_FCNTL_H */
  106. #endif /* _GL_FCNTL_H */
  107. #endif