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

4.115
Last change on this file since b27ec1e was b27ec1e, checked in by Ralf Corsepius <ralf.corsepius@…>, on 08/20/10 at 13:30:32

2010-08-16 Ralf Corsépius <ralf.corsepius@…>

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