1 | /* Like <fcntl.h>, but with non-working flags defined to 0.
|
---|
2 |
|
---|
3 | Copyright (C) 2006 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 2, or (at your option)
|
---|
8 | 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, write to the Free Software Foundation,
|
---|
17 | Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
---|
18 |
|
---|
19 | /* written by Paul Eggert */
|
---|
20 |
|
---|
21 | #ifndef _GL_FCNTL_H
|
---|
22 | #define _GL_FCNTL_H
|
---|
23 |
|
---|
24 | #include <sys/types.h>
|
---|
25 | #include <sys/stat.h>
|
---|
26 | #include <unistd.h>
|
---|
27 | #include @ABSOLUTE_FCNTL_H@
|
---|
28 |
|
---|
29 |
|
---|
30 | /* Declare overridden functions. */
|
---|
31 |
|
---|
32 | #ifdef __cplusplus
|
---|
33 | extern "C" {
|
---|
34 | #endif
|
---|
35 |
|
---|
36 | #ifdef FCHDIR_REPLACEMENT
|
---|
37 | # define open rpl_open
|
---|
38 | extern int open (const char *, int, ...);
|
---|
39 | #endif
|
---|
40 |
|
---|
41 | #ifdef __cplusplus
|
---|
42 | }
|
---|
43 | #endif
|
---|
44 |
|
---|
45 |
|
---|
46 | /* Fix up the O_* macros. */
|
---|
47 |
|
---|
48 | #if !defined O_DIRECT && defined O_DIRECTIO
|
---|
49 | /* Tru64 spells it `O_DIRECTIO'. */
|
---|
50 | # define O_DIRECT O_DIRECTIO
|
---|
51 | #endif
|
---|
52 |
|
---|
53 | #ifndef O_DIRECT
|
---|
54 | # define O_DIRECT 0
|
---|
55 | #endif
|
---|
56 |
|
---|
57 | #ifndef O_DIRECTORY
|
---|
58 | # define O_DIRECTORY 0
|
---|
59 | #endif
|
---|
60 |
|
---|
61 | #ifndef O_DSYNC
|
---|
62 | # define O_DSYNC 0
|
---|
63 | #endif
|
---|
64 |
|
---|
65 | #ifndef O_NDELAY
|
---|
66 | # define O_NDELAY 0
|
---|
67 | #endif
|
---|
68 |
|
---|
69 | #ifndef O_NOATIME
|
---|
70 | # define O_NOATIME 0
|
---|
71 | #endif
|
---|
72 |
|
---|
73 | #ifndef O_NONBLOCK
|
---|
74 | # define O_NONBLOCK O_NDELAY
|
---|
75 | #endif
|
---|
76 |
|
---|
77 | #ifndef O_NOCTTY
|
---|
78 | # define O_NOCTTY 0
|
---|
79 | #endif
|
---|
80 |
|
---|
81 | #ifndef O_NOFOLLOW
|
---|
82 | # define O_NOFOLLOW 0
|
---|
83 | #endif
|
---|
84 |
|
---|
85 | #ifndef O_NOLINKS
|
---|
86 | # define O_NOLINKS 0
|
---|
87 | #endif
|
---|
88 |
|
---|
89 | #ifndef O_RSYNC
|
---|
90 | # define O_RSYNC 0
|
---|
91 | #endif
|
---|
92 |
|
---|
93 | #ifndef O_SYNC
|
---|
94 | # define O_SYNC 0
|
---|
95 | #endif
|
---|
96 |
|
---|
97 | /* For systems that distinguish between text and binary I/O.
|
---|
98 | O_BINARY is usually declared in fcntl.h */
|
---|
99 | #if !defined O_BINARY && defined _O_BINARY
|
---|
100 | /* For MSC-compatible compilers. */
|
---|
101 | # define O_BINARY _O_BINARY
|
---|
102 | # define O_TEXT _O_TEXT
|
---|
103 | #endif
|
---|
104 |
|
---|
105 | #ifdef __BEOS__
|
---|
106 | /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */
|
---|
107 | # undef O_BINARY
|
---|
108 | # undef O_TEXT
|
---|
109 | #endif
|
---|
110 |
|
---|
111 | #ifndef O_BINARY
|
---|
112 | # define O_BINARY 0
|
---|
113 | # define O_TEXT 0
|
---|
114 | #endif
|
---|
115 |
|
---|
116 | #endif
|
---|