3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /* Copyright (c) 1988 AT&T */
28 /* All Rights Reserved */
29
30 #ifndef _FCNTL_H
31 #define _FCNTL_H
32
33 #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.6.1.7 */
34
35 #include <sys/feature_tests.h>
36 #if defined(__EXTENSIONS__) || defined(_XPG4)
37 #include <sys/stat.h>
38 #endif
39 #include <sys/types.h>
40 #include <sys/fcntl.h>
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
46 #if defined(__EXTENSIONS__) || defined(_XPG4)
47
48 /* Symbolic constants for the "lseek" routine. */
49
50 #ifndef SEEK_SET
51 #define SEEK_SET 0 /* Set file pointer to "offset" */
52 #endif
53
54 #ifndef SEEK_CUR
111 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
112 defined(_ATFILE_SOURCE)
113 #pragma redefine_extname openat64 openat
114 #pragma redefine_extname attropen64 attropen
115 #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
116 #else
117 #define open64 open
118 #define creat64 creat
119 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
120 #define posix_fadvise64 posix_fadvise
121 #define posix_fallocate64 posix_fallocate
122 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || ... */
123 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
124 defined(_ATFILE_SOURCE)
125 #define openat64 openat
126 #define attropen64 attropen
127 #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
128 #endif
129 #endif /* _LP64 && _LARGEFILE64_SOURCE */
130
131 #if defined(__STDC__)
132
133 extern int fcntl(int, int, ...);
134 extern int open(const char *, int, ...);
135 extern int creat(const char *, mode_t);
136 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
137 extern int posix_fadvise(int, off_t, off_t, int);
138 extern int posix_fallocate(int, off_t, off_t);
139 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || ... */
140 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
141 defined(_ATFILE_SOURCE)
142 extern int openat(int, const char *, int, ...);
143 extern int attropen(const char *, const char *, int, ...);
144 #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
145 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
146 extern int directio(int, int);
147 #endif
148
149 /* transitional large file interface versions */
150 #if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
151 !defined(__PRAGMA_REDEFINE_EXTNAME))
152 extern int open64(const char *, int, ...);
153 extern int creat64(const char *, mode_t);
154 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
155 extern int posix_fadvise64(int, off64_t, off64_t, int);
156 extern int posix_fallocate64(int, off64_t, off64_t);
157 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || ... */
158 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
159 defined(_ATFILE_SOURCE)
160 extern int openat64(int, const char *, int, ...);
161 extern int attropen64(const char *, const char *, int, ...);
162 #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
163 #endif
164
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 #ifdef __cplusplus
203 }
204 #endif
205
206 #endif /* _FCNTL_H */
|
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 *
25 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 /* Copyright (c) 1988 AT&T */
30 /* All Rights Reserved */
31
32 #ifndef _FCNTL_H
33 #define _FCNTL_H
34
35 #include <sys/feature_tests.h>
36 #if defined(__EXTENSIONS__) || defined(_XPG4)
37 #include <sys/stat.h>
38 #endif
39 #include <sys/types.h>
40 #include <sys/fcntl.h>
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
46 #if defined(__EXTENSIONS__) || defined(_XPG4)
47
48 /* Symbolic constants for the "lseek" routine. */
49
50 #ifndef SEEK_SET
51 #define SEEK_SET 0 /* Set file pointer to "offset" */
52 #endif
53
54 #ifndef SEEK_CUR
111 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
112 defined(_ATFILE_SOURCE)
113 #pragma redefine_extname openat64 openat
114 #pragma redefine_extname attropen64 attropen
115 #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
116 #else
117 #define open64 open
118 #define creat64 creat
119 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
120 #define posix_fadvise64 posix_fadvise
121 #define posix_fallocate64 posix_fallocate
122 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || ... */
123 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
124 defined(_ATFILE_SOURCE)
125 #define openat64 openat
126 #define attropen64 attropen
127 #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
128 #endif
129 #endif /* _LP64 && _LARGEFILE64_SOURCE */
130
131 extern int fcntl(int, int, ...);
132 extern int open(const char *, int, ...);
133 extern int creat(const char *, mode_t);
134 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
135 extern int posix_fadvise(int, off_t, off_t, int);
136 extern int posix_fallocate(int, off_t, off_t);
137 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || ... */
138 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
139 defined(_ATFILE_SOURCE)
140 extern int openat(int, const char *, int, ...);
141 extern int attropen(const char *, const char *, int, ...);
142 #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
143 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
144 extern int directio(int, int);
145 #endif
146
147 /* transitional large file interface versions */
148 #if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
149 !defined(__PRAGMA_REDEFINE_EXTNAME))
150 extern int open64(const char *, int, ...);
151 extern int creat64(const char *, mode_t);
152 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
153 extern int posix_fadvise64(int, off64_t, off64_t, int);
154 extern int posix_fallocate64(int, off64_t, off64_t);
155 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || ... */
156 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
157 defined(_ATFILE_SOURCE)
158 extern int openat64(int, const char *, int, ...);
159 extern int attropen64(const char *, const char *, int, ...);
160 #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
161 #endif
162
163 #ifdef __cplusplus
164 }
165 #endif
166
167 #endif /* _FCNTL_H */
|