annotate lib/fcntl.in.h @ 10528:97cab1215a7c

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