source: rtems/cpukit/posix/include/aio.h @ a29d2e7

4.104.114.84.95
Last change on this file since a29d2e7 was 0ff3df03, checked in by Ralf Corsepius <ralf.corsepius@…>, on 12/10/04 at 04:17:50

2004-12-10 Ralf Corsepius <ralf.corsepius@…>

  • posix/include/aio.h, posix/include/devctl.h, posix/include/intr.h, posix/include/mqueue.h, posix/include/sched.h, posix/include/semaphore.h, posix/src/ptimer.c, posix/src/ptimer1.c: Include <unistd.h> instead of <sys/features.h> to pick up _POSIX_* defines (Mandated by POSIX).
  • Property mode set to 100644
File size: 3.2 KB
Line 
1/**
2 * @file aio.h
3 */
4
5/*
6 *  $Id$
7 */
8
9#ifndef __POSIX_ASYNCHRONOUS_IO_h
10#define __POSIX_ASYNCHRONOUS_IO_h
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#include <unistd.h>
17
18#if defined(_POSIX_ASYNCHRONOUS_IO)
19
20/*
21 *  6.7.1 Data Definitions for Asynchronous Input and Output,
22 *        P1003.1b-1993, p. 151
23 */
24
25#include <sys/types.h>
26#include <signal.h>
27#include <time.h>
28#include <fcntl.h>
29
30/*
31 *  6.7.1.2 Manifest Constants, P1003.1b-1993, p. 153
32 */
33
34#define AIO_CANCELED    0 /* all requested operations have been canceled */
35#define AIO_NOTCANCELED 1 /* some of the operations could not be canceled */
36                          /*   since they are in progress */
37#define AIO_ALLDONE     2 /* none of the requested operations could be */
38                          /*   canceled since they are already complete */
39
40/* lio_listio() options */
41
42#define LIO_WAIT        0 /* calling process is to suspend until the */
43                          /*   operation is complete */
44#define LIO_NOWAIT      1 /* calling process is to continue execution while */
45                          /*   the operation is performed and no notification */
46                          /*   shall be given when the operation is completed */
47#define LIO_READ        2 /* request a read() */
48#define LIO_WRITE       3 /* request a write() */
49#define LIO_NOP         4 /* no transfer is requested */
50
51/*
52 *  6.7.1.1 Asynchronous I/O Control Block, P1003.1b-1993, p. 151
53 */
54
55struct aiocb {
56  int             aio_fildes;     /* File descriptor */
57  off_t           aio_offset;     /* File offset */
58  volatile void  *aio_buf;        /* Location of buffer */
59  size_t          aio_nbytes;     /* Length of transfer */
60  int             aio_reqprio;    /* Request priority offset */
61  struct sigevent aio_sigevent;   /* Signal number and value */
62  int             aoi_lio_opcode; /* Operation to be performed */
63};
64
65/*
66 *  6.7.2 Asynchronous Read, P1003.1b-1993, p. 154
67 */
68
69int aio_read(
70  struct aiocb  *aiocbp
71);
72
73/*
74 *  6.7.3 Asynchronous Write, P1003.1b-1993, p. 155
75 */
76
77int aio_write(
78  struct aiocb  *aiocbp
79);
80
81/*
82 *  6.7.4 List Directed I/O, P1003.1b-1993, p. 158
83 */
84
85int lio_listio(
86  int                    mode,
87  struct aiocb  * const  list[],
88  int                    nent,
89  struct sigevent       *sig
90);
91
92/*
93 *  6.7.5 Retrieve Error of Asynchronous I/O Operation, P1003.1b-1993, p. 161
94 */
95
96int aio_error(
97  const struct aiocb  *aiocbp
98);
99
100/*
101 *  6.7.6 Retrieve Return Status of Asynchronous I/O Operation,
102 *        P1003.1b-1993, p. 162
103 */
104
105int aio_return(
106  const struct aiocb  *aiocbp
107);
108
109/*
110 *  6.7.7 Cancel Asynchronous I/O Operation, P1003.1b-1993, p. 163
111 */
112
113int aio_cancel(
114  int            filedes,
115  struct aiocb  *aiocbp
116);
117
118/*
119 *  6.7.7 Wait for Asynchronous I/O Request, P1003.1b-1993, p. 164
120 */
121
122int aio_suspend(
123  struct aiocb  * const   list[],
124  int                     nent,
125  const struct timespec  *timeout
126);
127
128#if defined(_POSIX_SYNCHRONIZED_IO)
129
130/*
131 *  6.7.9 Asynchronous File Synchronization, P1003.1b-1993, p. 166
132 */
133
134int aio_fsync(
135  int            op,
136  struct aiocb  *aiocbp
137);
138
139#endif /* _POSIX_SYNCHRONIZED_IO */
140
141#endif /* _POSIX_ASYNCHRONOUS_IO */
142
143#ifdef __cplusplus
144}
145#endif
146
147#endif
148/* end of include file */
Note: See TracBrowser for help on using the repository browser.