![]() |
RTEMS 6.1
|
POSIX Asynchronous I/O Private Support. More...
#include <string.h>#include <signal.h>#include <aio.h>#include <pthread.h>#include <stdatomic.h>#include <rtems.h>#include <rtems/chain.h>#include <rtems/seterr.h>Go to the source code of this file.
Data Structures | |
| union | lio_notification_union |
| holds a pointer to a sigevent struct or a thread id More... | |
| struct | listcb |
| Control block for every list enqueued with lio_listio() More... | |
| struct | rtems_aio_request |
| The request being processed. More... | |
| struct | rtems_aio_request_chain |
| A chain of requests for the same FD. More... | |
| struct | rtems_aio_queue |
| The queue of all the requests in progress and waiting to be processed. More... | |
Macros | |
| #define | AIO_OP_READ 0 |
| #define | AIO_OP_WRITE 1 |
| #define | AIO_OP_SYNC 2 |
| #define | AIO_OP_DSYNC 3 |
| #define | AIO_RETURNED 0 |
| #define | AIO_NOTRETURNED 1 |
| #define | AIO_LIO_NO_NOTIFY 0 |
| #define | AIO_LIO_SIGEV 1 |
| #define | AIO_LIO_EVENT 2 |
| #define | AIO_QUEUE_INITIALIZED 0xB00B |
| #define | AIO_MAX_THREADS 5 |
| #define | AIO_LISTIO_MAX 20 |
| #define | RTEMS_AIO_MAX 100 |
| #define | AIO_assert(_x) |
| #define | AIO_printf(_x) |
Functions | |
| int | rtems_aio_init (void) |
| Initialize the request queue for AIO Operations. | |
| int | rtems_aio_enqueue (rtems_aio_request *req) |
| Enqueue requests, and creates threads to process them. | |
| rtems_aio_request_chain * | rtems_aio_search_fd (rtems_chain_control *chain, int fildes, int create) |
| Search for and create a chain of requests for a given file descriptor. | |
| void | rtems_aio_remove_fd (rtems_aio_request_chain *r_chain) |
| Removes all the requests in a FD chain. | |
| int | rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp) |
| Remove request from given chain. | |
| int | rtems_aio_check_sigevent (struct sigevent *sigp) |
| Checks the validity of a sigevent struct. | |
| rtems_aio_request * | init_write_req (struct aiocb *aiocbp) |
| initializes a read rtems_aio_request | |
| rtems_aio_request * | init_read_req (struct aiocb *aiocbp) |
| initializes a write rtems_aio_request | |
| void | rtems_aio_completed_list_op (listcb *listcbp) |
| updates listcb after op completion | |
Variables | |
| rtems_aio_queue | aio_request_queue |
POSIX Asynchronous I/O Private Support.
This defines private information for the AIO implementation.
| #define AIO_LIO_EVENT 2 |
Notification via event delivery
| #define AIO_LIO_NO_NOTIFY 0 |
Constants to identify list completion notification No notification required
| #define AIO_LIO_SIGEV 1 |
Notification via sigevent
| #define AIO_NOTRETURNED 1 |
The aio operation return value has not been retrieved
| #define AIO_OP_DSYNC 3 |
Needed by aio_fsync()
| #define AIO_OP_READ 0 |
Constants to identify op type Needed by aio_fsync()
| #define AIO_OP_SYNC 2 |
Needed by aio_fsync()
| #define AIO_OP_WRITE 1 |
Needed by aio_fsync()
| #define AIO_RETURNED 0 |
The aio operation return value has been retrieved
| rtems_aio_request * init_read_req | ( | struct aiocb * | aiocbp | ) |
initializes a write rtems_aio_request
| aiocb | pointer to the aiocb describing the request |
| NULL | the aiocb passed was invalid, errno indicates the error: |
| rtems_aio_request * init_write_req | ( | struct aiocb * | aiocbp | ) |
initializes a read rtems_aio_request
| aiocb | pointer to the aiocb describing the request |
| NULL | the aiocb passed was invalid, errno indicates the error: |
| int rtems_aio_check_sigevent | ( | struct sigevent * | sigp | ) |
Checks the validity of a sigevent struct.
Checks if the pointer passed as parameter points to a valid sigevent struct.
| sigp | Is a pointer to the sigevent struct to check. |
| 0 | The struct is not valid. |
| 1 | The struct is valid. |
| void rtems_aio_completed_list_op | ( | listcb * | listcbp | ) |
updates listcb after op completion
| listcbp |
| int rtems_aio_enqueue | ( | rtems_aio_request * | req | ) |
Enqueue requests, and creates threads to process them.
| [in,out] | req | A pointer to the request. |
| 0 | if the request was added to the queue, errno otherwise. |
| int rtems_aio_init | ( | void | ) |
Initialize the request queue for AIO Operations.
| 0 | The queue has bees succesfully initialized. |
| -1 | An error occured while initializing the queue. |
| void rtems_aio_remove_fd | ( | rtems_aio_request_chain * | r_chain | ) |
Removes all the requests in a FD chain.
| [in,out] | r_chain | A pointer to a chain of requests for a given FD |
| int rtems_aio_remove_req | ( | rtems_chain_control * | chain, |
| struct aiocb * | aiocbp | ||
| ) |
Remove request from given chain.
| [in,out] | chain | A pointer to the FD chain that may contain the request |
| [in,out] | aiocbp | A pointer to the AIO control block of the request. |
| AIO_CANCELED | The request was canceled. |
| AIO_NOTCANCELED | The request was not canceled. |
| rtems_aio_request_chain * rtems_aio_search_fd | ( | rtems_chain_control * | chain, |
| int | fildes, | ||
| int | create | ||
| ) |
Search for and create a chain of requests for a given file descriptor.
| [in,out] | chain | A pointer to a chain of FD chains. |
| [in] | fildes | The file descriptor to search for. |
| [in] | create | If create == 0, the function just searches for the given FD. If create == 1, the function creates a new chain if none is found. |
| NULL | If create == 0 and no chain is found for the given FD. |