RTEMS 6.1-rc5
Loading...
Searching...
No Matches
aio.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
13/*
14 * COPYRIGHT (c) 1989-2011.
15 * On-Line Applications Research Corporation (OAR).
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions
19 * are met:
20 * 1. Redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39#ifndef _AIO_H
40#define _AIO_H
41
42#include <sys/cdefs.h>
43#include <unistd.h>
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
56#if defined(_POSIX_ASYNCHRONOUS_IO)
57
58/*
59 * 6.7.1 Data Definitions for Asynchronous Input and Output,
60 * P1003.1b-1993, p. 151
61 */
62#include <sys/types.h>
63#include <signal.h>
64#include <time.h>
65#include <fcntl.h>
66
67/*
68 * 6.7.1.2 Manifest Constants, P1003.1b-1993, p. 153
69 */
70
72#define AIO_CANCELED 0
73
75#define AIO_NOTCANCELED 1
76
81#define AIO_ALLDONE 2
82
84#define LIO_WAIT 0
85
90#define LIO_NOWAIT 1
91
93#define LIO_NOP 0
94
96#define LIO_READ 1
97
99#define LIO_WRITE 2
100
106struct aiocb {
110 int aio_fildes;
112 off_t aio_offset;
114 volatile void *aio_buf;
116 size_t aio_nbytes;
118 int aio_reqprio;
120 struct sigevent aio_sigevent;
122 int aio_lio_opcode;
123
127 int return_status;
129 int error_code;
131 ssize_t return_value;
132};
133
154int aio_read(
155 struct aiocb *aiocbp
156);
157
176int aio_write(
177 struct aiocb *aiocbp
178);
179
206int lio_listio(
207 int mode,
208 struct aiocb *__restrict const list[__restrict],
209 int nent,
210 struct sigevent *__restrict sig
211);
212
227int aio_error(
228 const struct aiocb *aiocbp
229);
230
246ssize_t aio_return(
247 struct aiocb *aiocbp
248);
249
266int aio_cancel(
267 int filedes,
268 struct aiocb *aiocbp
269);
270
276int aio_suspend(
277 const struct aiocb * const list[],
278 int nent,
279 const struct timespec *timeout
280);
281
282#if defined(_POSIX_SYNCHRONIZED_IO)
283
304int aio_fsync(
305 int op,
306 struct aiocb *aiocbp
307);
308
309#endif /* _POSIX_SYNCHRONIZED_IO */
310
311#endif /* _POSIX_ASYNCHRONOUS_IO */
312
315#ifdef __cplusplus
316}
317#endif
318
319#endif
320
321/* end of include file */
322