RTEMS 6.1-rc6
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables

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_chainrtems_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_requestinit_write_req (struct aiocb *aiocbp)
 initializes a read rtems_aio_request
 
rtems_aio_requestinit_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
 

Detailed Description

POSIX Asynchronous I/O Private Support.

This defines private information for the AIO implementation.

Macro Definition Documentation

◆ AIO_LIO_EVENT

#define AIO_LIO_EVENT   2

Notification via event delivery

◆ AIO_LIO_NO_NOTIFY

#define AIO_LIO_NO_NOTIFY   0

Constants to identify list completion notification No notification required

◆ AIO_LIO_SIGEV

#define AIO_LIO_SIGEV   1

Notification via sigevent

◆ AIO_NOTRETURNED

#define AIO_NOTRETURNED   1

The aio operation return value has not been retrieved

◆ AIO_OP_DSYNC

#define AIO_OP_DSYNC   3

Needed by aio_fsync()

◆ AIO_OP_READ

#define AIO_OP_READ   0

Constants to identify op type Needed by aio_fsync()

◆ AIO_OP_SYNC

#define AIO_OP_SYNC   2

Needed by aio_fsync()

◆ AIO_OP_WRITE

#define AIO_OP_WRITE   1

Needed by aio_fsync()

◆ AIO_RETURNED

#define AIO_RETURNED   0

The aio operation return value has been retrieved

Function Documentation

◆ init_read_req()

rtems_aio_request * init_read_req ( struct aiocb *  aiocbp)

initializes a write rtems_aio_request

Parameters
aiocbpointer to the aiocb describing the request
Return values
NULLthe aiocb passed was invalid, errno indicates the error:
Returns
rtems_aio_request* a pointer to the newly created request.

◆ init_write_req()

rtems_aio_request * init_write_req ( struct aiocb *  aiocbp)

initializes a read rtems_aio_request

Parameters
aiocbpointer to the aiocb describing the request
Return values
NULLthe aiocb passed was invalid, errno indicates the error:
Returns
rtems_aio_request* a pointer to the newly created request.

◆ rtems_aio_check_sigevent()

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.

Parameters
sigpIs a pointer to the sigevent struct to check.
Return values
0The struct is not valid.
1The struct is valid.

◆ rtems_aio_completed_list_op()

void rtems_aio_completed_list_op ( listcb listcbp)

updates listcb after op completion

Parameters
listcbp

◆ rtems_aio_enqueue()

int rtems_aio_enqueue ( rtems_aio_request req)

Enqueue requests, and creates threads to process them.

Parameters
[in,out]reqA pointer to the request.
Return values
0if the request was added to the queue, errno otherwise.

◆ rtems_aio_init()

int rtems_aio_init ( void  )

Initialize the request queue for AIO Operations.

Return values
0The queue has bees succesfully initialized.
-1An error occured while initializing the queue.

◆ rtems_aio_remove_fd()

void rtems_aio_remove_fd ( rtems_aio_request_chain r_chain)

Removes all the requests in a FD chain.

Parameters
[in,out]r_chainA pointer to a chain of requests for a given FD

◆ rtems_aio_remove_req()

int rtems_aio_remove_req ( rtems_chain_control chain,
struct aiocb *  aiocbp 
)

Remove request from given chain.

Parameters
[in,out]chainA pointer to the FD chain that may contain the request
[in,out]aiocbpA pointer to the AIO control block of the request.
Return values
AIO_CANCELEDThe request was canceled.
AIO_NOTCANCELEDThe request was not canceled.

◆ rtems_aio_search_fd()

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.

Parameters
[in,out]chainA pointer to a chain of FD chains.
[in]fildesThe file descriptor to search for.
[in]createIf create == 0, the function just searches for the given FD. If create == 1, the function creates a new chain if none is found.
Return values
NULLIf create == 0 and no chain is found for the given FD.
Returns
A pointer to the chain if a chain for the given FD exists.
A pointer to a newly created chain if create == 1 and no chain is found for the given FD.