1 /* Like <fcntl.h>, but with non-working flags defined to 0.
3 Copyright (C) 2006-2008 Free Software Foundation, Inc.
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.
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.
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/>. */
18 /* written by Paul Eggert */
21 @PRAGMA_SYSTEM_HEADER@
24 #if defined __need_system_fcntl_h
25 /* Special invocation convention. */
27 #include <sys/types.h>
30 #@INCLUDE_NEXT@ @NEXT_FCNTL_H@
33 /* Normal invocation convention. */
37 #include <sys/types.h>
40 /* The include_next requires a split double-inclusion guard. */
41 #@INCLUDE_NEXT@ @NEXT_FCNTL_H@
47 /* Declare overridden functions. */
56 # define open rpl_open
57 extern int open (const char *filename
, int flags
, ...);
61 #ifdef FCHDIR_REPLACEMENT
62 /* gnulib internal function. */
63 extern void _gl_register_fd (int fd
, const char *filename
);
71 /* Fix up the O_* macros. */
73 #if !defined O_DIRECT && defined O_DIRECTIO
74 /* Tru64 spells it `O_DIRECTIO'. */
75 # define O_DIRECT O_DIRECTIO
83 # define O_DIRECTORY 0
99 # define O_NONBLOCK O_NDELAY
107 # define O_NOFOLLOW 0
122 /* For systems that distinguish between text and binary I/O.
123 O_BINARY is usually declared in fcntl.h */
124 #if !defined O_BINARY && defined _O_BINARY
125 /* For MSC-compatible compilers. */
126 # define O_BINARY _O_BINARY
127 # define O_TEXT _O_TEXT
130 #if defined __BEOS__ || defined __HAIKU__
131 /* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect. */
142 #endif /* _GL_FCNTL_H */
143 #endif /* _GL_FCNTL_H */