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

Private implementation for Asynchronous I/O. More...

#include <pthread.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <signal.h>
#include <rtems/posix/aio_misc.h>
#include <rtems/score/assert.h>
#include <errno.h>
#include <limits.h>

Functions

int rtems_aio_init (void)
 Initialize the request queue for AIO Operations.
 
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
 
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_enqueue (rtems_aio_request *req)
 Enqueue requests, and creates threads to process them.
 
int rtems_aio_check_sigevent (struct sigevent *sigp)
 Checks the validity of a sigevent struct.
 

Variables

rtems_aio_queue aio_request_queue
 

Detailed Description

Private implementation for Asynchronous I/O.

This file contains the implementation of private methods used for the processing of Asynchronous I/O requests.

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.