diff options
Diffstat (limited to 'include/aio.h')
| -rw-r--r-- | include/aio.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/include/aio.h b/include/aio.h new file mode 100644 index 00000000..8481d9cf --- /dev/null +++ b/include/aio.h @@ -0,0 +1,80 @@ +#ifndef __AIO_H +#define __AIO_H + +#define __BITS_SIGEVENT_H_ +#include <bits/sigevent.h> +#undef __BITS_SIGEVENT_H_ + +#define __BITS_TIMESPEC_H_ +#include <bits/timespec.h> +#undef __BITS_TIMESPEC_H_ + +/** A return value indicating that all requested operations have been canceled. + */ +#define AIO_CANCELED 0 + +/** + * A return value indicating that some of the requested operations + * could not be canceled since they are in progress. + */ +#define AIO_NOTCANCELED 1 + +/** + * A return value indicating that none of the requested operations + * could be canceled since they are already complete. + */ +#define AIO_ALLDONE 2 + +/** A lio_listio() element operation option requesting a read. */ +#define LIO_READ 0 + +/** + * A lio_listio() synchronization operation indicating that the calling + * thread is to suspend until the lio_listio() operation is complete. + */ +#define LIO_WRITE 1 + +/** + * A lio_listio() element operation option indicating + * that no transfer is requested. + */ +#define LIO_NOP 2 + +/** + * A lio_listio() synchronization operation indicating that the calling + * thread is to suspend until the lio_listio() operation is complete. + */ +#define LIO_WAIT 0 + +/** + * A lio_listio() synchronization operation indicating that the calling thread + * is to continue execution while the lio_listio() operation is being performed, + * and no notification is given when the operation is complete. + */ +#define LIO_NOWAIT 1 + +typedef __INT64_TYPE__ off_t; +typedef __SIZE_TYPE__ size_t; +typedef __INT64_TYPE__ ssize_t; + +struct aiocb { + int aio_fildes; /**< File descriptor. */ + off_t aio_offset; /**< File offset. */ + volatile void *aio_buf; /**< Location of buffer. */ + size_t aio_nbytes; /**< Length of transfer. */ + int aio_reqprio; /**< Request priority offset. */ + struct sigevent aio_sigevent; /**< Signal number and value. */ + int aio_lio_opcode; /**< Operation to be performed. */ +}; + +int aio_cancel(int, struct aiocb *); +int aio_error(const struct aiocb *); +int aio_fsync(int, struct aiocb *); +int aio_read(struct aiocb *); +ssize_t aio_return(struct aiocb *); +int aio_suspend(const struct aiocb *const[], int, const struct timespec *); +int aio_write(struct aiocb *); +int lio_listio(int, struct aiocb *restrict const[restrict], int, + struct sigevent *restrict); + +#endif |
