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