aio.h
001: 
002: 
003: 
004: 
005: 
006: 
007: 
008: 
009: 
010: 
011: 
012: 
013: 
014: 
015: 
016: 
017: 
018: 
019: 
020: 
021: 
022: 
023: #ifndef _AIO_H
024: #define _AIO_H  1
025: 
026: #include <features.h>
027: #include <fcntl.h>
028: #include <signal.h>
029: #include <time.h>
030: #include <sys/types.h>
031: 
032: __BEGIN_DECLS
033: 
034: 
035: struct aiocb
036: {
037:   int aio_fildes;               
038:   int aio_lio_opcode;           
039:   int aio_reqprio;              
040:   volatile void *aio_buf;       
041:   size_t aio_nbytes;            
042:   struct sigevent aio_sigevent; 
043: 
044:   
045:   struct aiocb *__next_prio;
046:   int __abs_prio;
047:   int __policy;
048:   int __error_code;
049:   __ssize_t __return_value;
050: 
051: #ifndef __USE_FILE_OFFSET64
052:   __off_t aio_offset;           
053:   char __pad[sizeof (__off64_t) - sizeof (__off_t)];
054: #else
055:   __off64_t aio_offset;         
056: #endif
057:   char __unused[32];
058: };
059: 
060: 
061: 
062: #ifdef __USE_LARGEFILE64
063: struct aiocb64
064: {
065:   int aio_fildes;               
066:   int aio_lio_opcode;           
067:   int aio_reqprio;              
068:   volatile void *aio_buf;       
069:   size_t aio_nbytes;            
070:   struct sigevent aio_sigevent; 
071: 
072:   
073:   struct aiocb *__next_prio;
074:   int __abs_prio;
075:   int __policy;
076:   int __error_code;
077:   __ssize_t __return_value;
078: 
079:   __off64_t aio_offset;         
080:   char __unused[32];
081: };
082: #endif
083: 
084: 
085: #ifdef __USE_GNU
086: 
087: 
088: struct aioinit
089:   {
090:     int aio_threads;            
091:     int aio_num;                
092:     int aio_locks;              
093:     int aio_usedba;             
094:     int aio_debug;              
095:     int aio_numusers;           
096:     int aio_idle_time;          
097: 
098:     int aio_reserved;
099:   };
100: #endif
101: 
102: 
103: 
104: enum
105: {
106:   AIO_CANCELED,
107: #define AIO_CANCELED AIO_CANCELED
108:   AIO_NOTCANCELED,
109: #define AIO_NOTCANCELED AIO_NOTCANCELED
110:   AIO_ALLDONE
111: #define AIO_ALLDONE AIO_ALLDONE
112: };
113: 
114: 
115: 
116: enum
117: {
118:   LIO_READ,
119: #define LIO_READ LIO_READ
120:   LIO_WRITE,
121: #define LIO_WRITE LIO_WRITE
122:   LIO_NOP
123: #define LIO_NOP LIO_NOP
124: };
125: 
126: 
127: 
128: enum
129: {
130:   LIO_WAIT,
131: #define LIO_WAIT LIO_WAIT
132:   LIO_NOWAIT
133: #define LIO_NOWAIT LIO_NOWAIT
134: };
135: 
136: 
137: 
138: #ifdef __USE_GNU
139: extern void aio_init (__const struct aioinit *__init) __THROW __nonnull ((1));
140: #endif
141: 
142: 
143: #ifndef __USE_FILE_OFFSET64
144: 
145: extern int aio_read (struct aiocb *__aiocbp) __THROW __nonnull ((1));
146: 
147: extern int aio_write (struct aiocb *__aiocbp) __THROW __nonnull ((1));
148: 
149: 
150: extern int lio_listio (int __mode,
151:                        struct aiocb *__const __list[__restrict_arr],
152:                        int __nent, struct sigevent *__restrict __sig)
153:   __THROW __nonnull ((2));
154: 
155: 
156: extern int aio_error (__const struct aiocb *__aiocbp) __THROW __nonnull ((1));
157: 
158: extern __ssize_t aio_return (struct aiocb *__aiocbp) __THROW __nonnull ((1));
159: 
160: 
161: 
162: extern int aio_cancel (int __fildes, struct aiocb *__aiocbp) __THROW;
163: 
164: 
165: 
166: 
167: 
168: 
169: extern int aio_suspend (__const struct aiocb *__const __list[], int __nent,
170:                         __const struct timespec *__restrict __timeout)
171:   __nonnull ((1));
172: 
173: 
174: 
175: extern int aio_fsync (int __operation, struct aiocb *__aiocbp)
176:   __THROW __nonnull ((2));
177: #else
178: # ifdef __REDIRECT_NTH
179: extern int __REDIRECT_NTH (aio_read, (struct aiocb *__aiocbp), aio_read64)
180:   __nonnull ((1));
181: extern int __REDIRECT_NTH (aio_write, (struct aiocb *__aiocbp), aio_write64)
182:   __nonnull ((1));
183: 
184: extern int __REDIRECT_NTH (lio_listio,
185:                            (int __mode,
186:                             struct aiocb *__const __list[__restrict_arr],
187:                             int __nent, struct sigevent *__restrict __sig),
188:                            lio_listio64) __nonnull ((2));
189: 
190: extern int __REDIRECT_NTH (aio_error, (__const struct aiocb *__aiocbp),
191:                            aio_error64) __nonnull ((1));
192: extern __ssize_t __REDIRECT_NTH (aio_return, (struct aiocb *__aiocbp),
193:                                  aio_return64) __nonnull ((1));
194: 
195: extern int __REDIRECT_NTH (aio_cancel,
196:                            (int __fildes, struct aiocb *__aiocbp),
197:                            aio_cancel64);
198: 
199: extern int __REDIRECT_NTH (aio_suspend,
200:                            (__const struct aiocb *__const __list[], int __nent,
201:                             __const struct timespec *__restrict __timeout),
202:                            aio_suspend64) __nonnull ((1));
203: 
204: extern int __REDIRECT_NTH (aio_fsync,
205:                            (int __operation, struct aiocb *__aiocbp),
206:                            aio_fsync64) __nonnull ((2));
207: 
208: # else
209: #  define aio_read aio_read64
210: #  define aio_write aio_write64
211: #  define lio_listio lio_listio64
212: #  define aio_error aio_error64
213: #  define aio_return aio_return64
214: #  define aio_cancel aio_cancel64
215: #  define aio_suspend aio_suspend64
216: #  define aio_fsync aio_fsync64
217: # endif
218: #endif
219: 
220: #ifdef __USE_LARGEFILE64
221: extern int aio_read64 (struct aiocb64 *__aiocbp) __THROW __nonnull ((1));
222: extern int aio_write64 (struct aiocb64 *__aiocbp) __THROW __nonnull ((1));
223: 
224: extern int lio_listio64 (int __mode,
225:                          struct aiocb64 *__const __list[__restrict_arr],
226:                          int __nent, struct sigevent *__restrict __sig)
227:   __THROW __nonnull ((2));
228: 
229: extern int aio_error64 (__const struct aiocb64 *__aiocbp)
230:   __THROW __nonnull ((1));
231: extern __ssize_t aio_return64 (struct aiocb64 *__aiocbp)
232:   __THROW __nonnull ((1));
233: 
234: extern int aio_cancel64 (int __fildes, struct aiocb64 *__aiocbp) __THROW;
235: 
236: extern int aio_suspend64 (__const struct aiocb64 *__const __list[], int __nent,
237:                           __const struct timespec *__restrict __timeout)
238:   __THROW __nonnull ((1));
239: 
240: extern int aio_fsync64 (int __operation, struct aiocb64 *__aiocbp)
241:   __THROW __nonnull ((2));
242: #endif
243: 
244: __END_DECLS
245: 
246: #endif 
247: 
      
      
      
      
   
      
      
         
            
            © Andrew Scott 2006 -
            2025, 
            All Rights Reserved