3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #ifndef _AIO_H
28 #define _AIO_H
29
30 #pragma ident "%Z%%M% %I% %E% SMI"
31
32 #include <sys/feature_tests.h>
33 #include <sys/types.h>
34 #include <sys/fcntl.h>
35 #include <sys/siginfo.h>
36 #include <sys/aiocb.h>
37 #include <time.h>
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 #if (_POSIX_C_SOURCE - 0 > 0) && (_POSIX_C_SOURCE - 0 <= 2)
44 #error "POSIX Asynchronous I/O is not supported in POSIX.1-1990"
45 #endif
46
47 /* large file compilation environment setup */
48 #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
49 #ifdef __PRAGMA_REDEFINE_EXTNAME
50 #pragma redefine_extname aio_read aio_read64
51 #pragma redefine_extname aio_write aio_write64
87 #pragma redefine_extname aio_fsync64 aio_fsync
88 #pragma redefine_extname aio_waitn64 aio_waitn
89 #else
90 #define aiocb64 aiocb
91 #define aiocb64_t aiocb_t
92 #define aio_read64 aio_read
93 #define aio_write64 aio_write
94 #define lio_listio64 lio_listio
95 #define aio_error64 aio_error
96 #define aio_return64 aio_return
97 #define aio_cancel64 aio_cancel
98 #define aio_suspend64 aio_suspend
99 #define aio_fsync64 aio_fsync
100 #define aio_waitn64 aio_waitn
101 #endif
102 #endif /* _LP64 && _LARGEFILE64_SOURCE */
103
104 /*
105 * function prototypes
106 */
107 #if defined(__STDC__)
108 extern int aio_read(aiocb_t *);
109 extern int aio_write(aiocb_t *);
110 extern int lio_listio(int,
111 aiocb_t *_RESTRICT_KYWD const *_RESTRICT_KYWD,
112 int, struct sigevent *_RESTRICT_KYWD);
113 extern int aio_error(const aiocb_t *);
114 extern ssize_t aio_return(aiocb_t *);
115 extern int aio_cancel(int, aiocb_t *);
116 extern int aio_suspend(const aiocb_t *const[], int,
117 const struct timespec *);
118 extern int aio_fsync(int, aiocb_t *);
119 extern int aio_waitn(aiocb_t *[], uint_t, uint_t *,
120 const struct timespec *);
121
122
123 #if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
124 !defined(__PRAGMA_REDEFINE_EXTNAME))
125 extern int aio_read64(aiocb64_t *);
126 extern int aio_write64(aiocb64_t *);
127 extern int lio_listio64(int,
128 aiocb64_t *_RESTRICT_KYWD const *_RESTRICT_KYWD,
129 int, struct sigevent *_RESTRICT_KYWD);
130 extern int aio_error64(const aiocb64_t *);
131 extern ssize_t aio_return64(aiocb64_t *);
132 extern int aio_cancel64(int, aiocb64_t *);
133 extern int aio_suspend64(const aiocb64_t *const[], int,
134 const struct timespec *);
135 extern int aio_fsync64(int, aiocb64_t *);
136 extern int aio_waitn64(aiocb64_t *[], uint_t, uint_t *,
137 const struct timespec *);
138 #endif /* _LARGEFILE64_SOURCE */
139
140 #else
141 extern int aio_read();
142 extern int aio_write();
143 extern int lio_listio();
144 extern int aio_error();
145 extern ssize_t aio_return();
146 extern int aio_cancel();
147 extern int aio_suspend();
148 extern int aio_fsync();
149 extern int aio_waitn();
150
151 #if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
152 !defined(__PRAGMA_REDEFINE_EXTNAME))
153 extern int aio_read64();
154 extern int aio_write64();
155 extern int lio_listio64();
156 extern int aio_error64();
157 extern ssize_t aio_return64();
158 extern int aio_cancel64();
159 extern int aio_suspend64();
160 extern int aio_fsync64();
161 extern int aio_waitn64();
162 #endif /* _LARGEFILE64_SOURCE */
163
164 #endif /* __STDC__ */
165
166 #ifdef __cplusplus
167 }
168 #endif
169
170 #endif /* _AIO_H */
|
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 *
25 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 #ifndef _AIO_H
30 #define _AIO_H
31
32 #include <sys/feature_tests.h>
33 #include <sys/types.h>
34 #include <sys/fcntl.h>
35 #include <sys/siginfo.h>
36 #include <sys/aiocb.h>
37 #include <time.h>
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 #if (_POSIX_C_SOURCE - 0 > 0) && (_POSIX_C_SOURCE - 0 <= 2)
44 #error "POSIX Asynchronous I/O is not supported in POSIX.1-1990"
45 #endif
46
47 /* large file compilation environment setup */
48 #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
49 #ifdef __PRAGMA_REDEFINE_EXTNAME
50 #pragma redefine_extname aio_read aio_read64
51 #pragma redefine_extname aio_write aio_write64
87 #pragma redefine_extname aio_fsync64 aio_fsync
88 #pragma redefine_extname aio_waitn64 aio_waitn
89 #else
90 #define aiocb64 aiocb
91 #define aiocb64_t aiocb_t
92 #define aio_read64 aio_read
93 #define aio_write64 aio_write
94 #define lio_listio64 lio_listio
95 #define aio_error64 aio_error
96 #define aio_return64 aio_return
97 #define aio_cancel64 aio_cancel
98 #define aio_suspend64 aio_suspend
99 #define aio_fsync64 aio_fsync
100 #define aio_waitn64 aio_waitn
101 #endif
102 #endif /* _LP64 && _LARGEFILE64_SOURCE */
103
104 /*
105 * function prototypes
106 */
107 extern int aio_read(aiocb_t *);
108 extern int aio_write(aiocb_t *);
109 extern int lio_listio(int,
110 aiocb_t *_RESTRICT_KYWD const *_RESTRICT_KYWD,
111 int, struct sigevent *_RESTRICT_KYWD);
112 extern int aio_error(const aiocb_t *);
113 extern ssize_t aio_return(aiocb_t *);
114 extern int aio_cancel(int, aiocb_t *);
115 extern int aio_suspend(const aiocb_t *const[], int,
116 const struct timespec *);
117 extern int aio_fsync(int, aiocb_t *);
118 extern int aio_waitn(aiocb_t *[], uint_t, uint_t *,
119 const struct timespec *);
120
121
122 #if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
123 !defined(__PRAGMA_REDEFINE_EXTNAME))
124 extern int aio_read64(aiocb64_t *);
125 extern int aio_write64(aiocb64_t *);
126 extern int lio_listio64(int,
127 aiocb64_t *_RESTRICT_KYWD const *_RESTRICT_KYWD,
128 int, struct sigevent *_RESTRICT_KYWD);
129 extern int aio_error64(const aiocb64_t *);
130 extern ssize_t aio_return64(aiocb64_t *);
131 extern int aio_cancel64(int, aiocb64_t *);
132 extern int aio_suspend64(const aiocb64_t *const[], int,
133 const struct timespec *);
134 extern int aio_fsync64(int, aiocb64_t *);
135 extern int aio_waitn64(aiocb64_t *[], uint_t, uint_t *,
136 const struct timespec *);
137 #endif /* _LARGEFILE64_SOURCE */
138
139 #ifdef __cplusplus
140 }
141 #endif
142
143 #endif /* _AIO_H */
|