Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/head/fcntl.h
+++ new/usr/src/head/fcntl.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 + *
23 25 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 26 * Use is subject to license terms.
25 27 */
26 28
27 29 /* Copyright (c) 1988 AT&T */
28 30 /* All Rights Reserved */
29 31
30 32 #ifndef _FCNTL_H
31 33 #define _FCNTL_H
32 34
33 -#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.6.1.7 */
34 -
35 35 #include <sys/feature_tests.h>
36 36 #if defined(__EXTENSIONS__) || defined(_XPG4)
37 37 #include <sys/stat.h>
38 38 #endif
39 39 #include <sys/types.h>
40 40 #include <sys/fcntl.h>
41 41
42 42 #ifdef __cplusplus
43 43 extern "C" {
44 44 #endif
45 45
46 46 #if defined(__EXTENSIONS__) || defined(_XPG4)
47 47
48 48 /* Symbolic constants for the "lseek" routine. */
49 49
50 50 #ifndef SEEK_SET
51 51 #define SEEK_SET 0 /* Set file pointer to "offset" */
52 52 #endif
53 53
54 54 #ifndef SEEK_CUR
55 55 #define SEEK_CUR 1 /* Set file pointer to current plus "offset" */
56 56 #endif
57 57
58 58 #ifndef SEEK_END
59 59 #define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
60 60 #endif
61 61 #endif /* defined(__EXTENSIONS__) || defined(_XPG4) */
62 62
63 63 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
64 64 #ifndef SEEK_DATA
65 65 #define SEEK_DATA 3 /* Set file pointer to next data past offset */
66 66 #endif
67 67
68 68 #ifndef SEEK_HOLE
69 69 #define SEEK_HOLE 4 /* Set file pointer to next hole past offset */
70 70 #endif
71 71 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
72 72
73 73
74 74 /* large file compilation environment setup */
75 75 #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
76 76 #ifdef __PRAGMA_REDEFINE_EXTNAME
77 77 #pragma redefine_extname open open64
78 78 #pragma redefine_extname creat creat64
79 79 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
80 80 #pragma redefine_extname posix_fadvise posix_fadvise64
81 81 #pragma redefine_extname posix_fallocate posix_fallocate64
82 82 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || ... */
83 83 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
84 84 defined(_ATFILE_SOURCE)
85 85 #pragma redefine_extname openat openat64
86 86 #pragma redefine_extname attropen attropen64
87 87 #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
88 88 #else
89 89 #define open open64
90 90 #define creat creat64
91 91 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
92 92 #define posix_fadvise posix_fadvise64
93 93 #define posix_fallocate posix_fallocate64
94 94 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || ... */
95 95 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
96 96 defined(_ATFILE_SOURCE)
97 97 #define openat openat64
98 98 #define attropen attropen64
99 99 #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
100 100 #endif
101 101 #endif /* !_LP64 && _FILE_OFFSET_BITS == 64 */
102 102
103 103 #if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
104 104 #ifdef __PRAGMA_REDEFINE_EXTNAME
105 105 #pragma redefine_extname open64 open
106 106 #pragma redefine_extname creat64 creat
107 107 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
108 108 #pragma redefine_extname posix_fadvise64 posix_fadvise
109 109 #pragma redefine_extname posix_fallocate64 posix_fallocate
110 110 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || ... */
111 111 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
112 112 defined(_ATFILE_SOURCE)
113 113 #pragma redefine_extname openat64 openat
114 114 #pragma redefine_extname attropen64 attropen
115 115 #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
116 116 #else
117 117 #define open64 open
118 118 #define creat64 creat
119 119 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
120 120 #define posix_fadvise64 posix_fadvise
↓ open down ↓ |
76 lines elided |
↑ open up ↑ |
121 121 #define posix_fallocate64 posix_fallocate
122 122 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || ... */
123 123 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
124 124 defined(_ATFILE_SOURCE)
125 125 #define openat64 openat
126 126 #define attropen64 attropen
127 127 #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
128 128 #endif
129 129 #endif /* _LP64 && _LARGEFILE64_SOURCE */
130 130
131 -#if defined(__STDC__)
132 -
133 131 extern int fcntl(int, int, ...);
134 132 extern int open(const char *, int, ...);
135 133 extern int creat(const char *, mode_t);
136 134 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
137 135 extern int posix_fadvise(int, off_t, off_t, int);
138 136 extern int posix_fallocate(int, off_t, off_t);
139 137 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || ... */
140 138 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
141 139 defined(_ATFILE_SOURCE)
142 140 extern int openat(int, const char *, int, ...);
143 141 extern int attropen(const char *, const char *, int, ...);
144 142 #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
145 143 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
146 144 extern int directio(int, int);
147 145 #endif
148 146
149 147 /* transitional large file interface versions */
150 148 #if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
151 149 !defined(__PRAGMA_REDEFINE_EXTNAME))
152 150 extern int open64(const char *, int, ...);
153 151 extern int creat64(const char *, mode_t);
154 152 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
155 153 extern int posix_fadvise64(int, off64_t, off64_t, int);
156 154 extern int posix_fallocate64(int, off64_t, off64_t);
157 155 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || ... */
158 156 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
159 157 defined(_ATFILE_SOURCE)
160 158 extern int openat64(int, const char *, int, ...);
161 159 extern int attropen64(const char *, const char *, int, ...);
162 160 #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
163 161 #endif
164 162
165 -#else /* defined(__STDC__) */
166 -
167 -extern int fcntl();
168 -extern int open();
169 -extern int creat();
170 -#if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
171 -extern int posix_fadvise();
172 -extern int posix_fallocate();
173 -#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || ... */
174 -#if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
175 - defined(_ATFILE_SOURCE)
176 -extern int openat();
177 -extern int attropen();
178 -#endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
179 -
180 -#if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
181 -extern int directio();
182 -#endif
183 -
184 -/* transitional large file interface versions */
185 -#if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
186 - !defined(__PRAGMA_REDEFINE_EXTNAME))
187 -extern int open64();
188 -extern int creat64();
189 -#if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
190 -extern int posix_fadvise64();
191 -extern int posix_fallocate64();
192 -#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || ... */
193 -#if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
194 - defined(_ATFILE_SOURCE)
195 -extern int openat64();
196 -extern int attropen64();
197 -#endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
198 -#endif
199 -
200 -#endif /* defined(__STDC__) */
201 -
202 163 #ifdef __cplusplus
203 164 }
204 165 #endif
205 166
206 167 #endif /* _FCNTL_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX