1 #ifndef _AIO_H 2 #define _AIO_H 3 4 #ifdef __cplusplus 5 extern "C" { 6 #endif 7 8 #include <features.h> 9 #include <signal.h> 10 #include <time.h> 11 12 #define __NEED_ssize_t 13 #define __NEED_off_t 14 #ifdef __LITEOS__ 15 #define __NEED_int64_t 16 #endif 17 18 #include <bits/alltypes.h> 19 20 struct aiocb { 21 int aio_fildes, aio_lio_opcode, aio_reqprio; 22 volatile void *aio_buf; 23 size_t aio_nbytes; 24 struct sigevent aio_sigevent; 25 void *__td; 26 int __lock[2]; 27 volatile int __err; 28 ssize_t __ret; 29 off_t aio_offset; 30 void *__next, *__prev; 31 char __dummy4[32-2*sizeof(void *)]; 32 }; 33 34 #define AIO_CANCELED 0 35 #define AIO_NOTCANCELED 1 36 #define AIO_ALLDONE 2 37 38 #define LIO_READ 0 39 #define LIO_WRITE 1 40 #define LIO_NOP 2 41 42 #define LIO_WAIT 0 43 #define LIO_NOWAIT 1 44 45 int aio_read(struct aiocb *); 46 int aio_write(struct aiocb *); 47 int aio_error(const struct aiocb *); 48 ssize_t aio_return(struct aiocb *); 49 int aio_cancel(int, struct aiocb *); 50 int aio_suspend(const struct aiocb *const [], int, const struct timespec *); 51 int aio_fsync(int, struct aiocb *); 52 53 int lio_listio(int, struct aiocb *__restrict const *__restrict, int, struct sigevent *__restrict); 54 55 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) 56 #define aiocb64 aiocb 57 #define aio_read64 aio_read 58 #define aio_write64 aio_write 59 #define aio_error64 aio_error 60 #define aio_return64 aio_return 61 #define aio_cancel64 aio_cancel 62 #define aio_suspend64 aio_suspend 63 #define aio_fsync64 aio_fsync 64 #define lio_listio64 lio_listio 65 #ifdef __LITEOS__ 66 #define off64_t int64_t 67 #else 68 #define off64_t off_t 69 #endif 70 #endif 71 72 #if _REDIR_TIME64 73 __REDIR(aio_suspend, __aio_suspend_time64); 74 #endif 75 76 #ifdef __cplusplus 77 } 78 #endif 79 80 #endif 81