annotate lib/fcntl.in.h @ 9299:ada4d73c37a6

New module 'open'.
author Bruno Haible <bruno@clisp.org>
date Sun, 07 Oct 2007 04:39:17 +0200
parents dc86ef955b9b
children bbbbbf4cd1c5
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
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 Copyright (C) 2006-2007 Free Software Foundation, Inc.
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 This program is free software; you can redistribute it and/or modify
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
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 the Free Software Foundation; either version 2, or (at your option)
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 any later version.
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
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 along with this program; if not, write to the Free Software Foundation,
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 /* written by Paul Eggert */
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #ifndef _GL_FCNTL_H
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 #include <sys/types.h>
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 #include <sys/stat.h>
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 #include <unistd.h>
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 /* 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
27 #@INCLUDE_NEXT@ @NEXT_FCNTL_H@
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 #ifndef _GL_FCNTL_H
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 #define _GL_FCNTL_H
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31
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 /* Declare overridden functions. */
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 #ifdef __cplusplus
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 extern "C" {
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 #endif
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38
9299
ada4d73c37a6 New module 'open'.
Bruno Haible <bruno@clisp.org>
parents: 9247
diff changeset
39 #if (@GNULIB_OPEN@ && @REPLACE_OPEN@) || defined FCHDIR_REPLACEMENT
9247
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 # define open rpl_open
9299
ada4d73c37a6 New module 'open'.
Bruno Haible <bruno@clisp.org>
parents: 9247
diff changeset
41 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
42 #endif
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 #ifdef __cplusplus
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 #endif
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
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 /* Fix up the O_* macros. */
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 #if !defined O_DIRECT && defined O_DIRECTIO
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 /* Tru64 spells it `O_DIRECTIO'. */
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53 # define O_DIRECT O_DIRECTIO
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 #endif
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 #ifndef O_DIRECT
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 # define O_DIRECT 0
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 #endif
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 #ifndef O_DIRECTORY
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 # define O_DIRECTORY 0
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 #endif
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 #ifndef O_DSYNC
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 # define O_DSYNC 0
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 #endif
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68 #ifndef O_NDELAY
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69 # define O_NDELAY 0
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 #endif
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72 #ifndef O_NOATIME
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73 # define O_NOATIME 0
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
74 #endif
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
75
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
76 #ifndef O_NONBLOCK
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
77 # define O_NONBLOCK O_NDELAY
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
78 #endif
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
79
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
80 #ifndef O_NOCTTY
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
81 # define O_NOCTTY 0
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
82 #endif
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
83
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
84 #ifndef O_NOFOLLOW
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
85 # define O_NOFOLLOW 0
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
86 #endif
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
87
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
88 #ifndef O_NOLINKS
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
89 # define O_NOLINKS 0
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
90 #endif
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
91
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
92 #ifndef O_RSYNC
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
93 # define O_RSYNC 0
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
94 #endif
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
95
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
96 #ifndef O_SYNC
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
97 # define O_SYNC 0
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
98 #endif
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
99
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
100 /* 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
101 O_BINARY is usually declared in fcntl.h */
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
102 #if !defined O_BINARY && defined _O_BINARY
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
103 /* For MSC-compatible compilers. */
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
104 # define O_BINARY _O_BINARY
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
105 # define O_TEXT _O_TEXT
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
106 #endif
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
107
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
108 #ifdef __BEOS__
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
109 /* 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
110 # undef O_BINARY
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
111 # undef O_TEXT
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
112 #endif
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
113
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
114 #ifndef O_BINARY
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
115 # define O_BINARY 0
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
116 # define O_TEXT 0
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
117 #endif
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
118
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
119
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
120 #endif /* _GL_FCNTL_H */
dc86ef955b9b Rename fcntl_.h to fcntl.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
121 #endif /* _GL_FCNTL_H */