aio

Details

define AIO_ALLDONE

define AIO_CANCELED

define AIO_NOTCANCELED

define LIO_NOP

define LIO_NOWAIT

define LIO_READ

define LIO_WAIT

define LIO_WRITE

int aio_cancel(

int fildes,
struct aiocb * aiocbp
)

This function is not supported this version.

Returns

-1 with errno set to ENOTSUP


int aio_error(

const struct aiocb * aiocbp
)

This function gets the error value for aiocbp.

Returns

The error value for the operation or zero for no errors:

  • EINPROGRESS: The operation is still in progress
  • Other interface specific error

int aio_fsync(

int op,
struct aiocb * aiocbp
)

This function is not supported this version.

Returns

-1 with errno set to ENOTSUP


int aio_read(

struct aiocb * aiocbp
)

The function initiates an asynchronous read using the data specified by aiocbp.

Returns

0 on success or -1 with errno (see Errno) set to:

  • EIO: failed to start the transfer

int aio_write(

struct aiocb * aiocbp
)

The function initiates an asynchronous write using the data specified by aiocbp.

Returns

0 on success or -1 with errno (see Errno) set to:

  • EIO: failed to start the transfer

ssize_t aio_return(

struct aiocb * aiocbp
)

This function returns the number of bytes read/written for the asynchronous operation.

Returns

The number of bytes transferred or -1 if there was an error (or if the operation is not yet complete). aio_error() can be used to determine the error.


int suspend(

struct aiocb *const list,
int nent,
const struct timespec * timeout,
bool block_on_all
)


int aio_suspend(

struct aiocb *const list,
int nent,
const struct timespec * timeout
)

This function will suspend the currently executing thread until an AIO operation in list completes or until the timeout value is surpassed. If timeout is NULL, it is ignored.

Returns

0 on success or -1 with errno (see Errno) set to:

  • EAGAIN: timeout was exceeded before any operations completed.
  • EINTR: the thread received a signal before any operations completed.

int lio_listio(

int mode,
struct aiocb *const list,
int nent,
struct sigevent * sig
)

This function initiates a list of asynchronous transfers.

Asynchronous notification is not supported in this version. ENOTSUP is returned if an attempt is made to invoke an asynchronous notification.

This function is experimental in this version.

Returns

Zero on success or -1 with errno (see Errno) set to:

  • EINTR: the thread received an signal before completed all transactions
  • ENOTSUP: mode is LIO_NOWAIT and sig is not null or sigev_notify is not set to SIGEV_NONE
  • EINVAL: mode is not set to LIO_NOWAIT or LIO_WAIT

struct::aiocb

This is the data structure used when performing asynchronous reads or writes.

int aio_fildes

off_t aio_offset

void * aio_buf

size_t aio_nbytes

int aio_reqprio

struct sigevent aio_sigevent

int aio_lio_opcode

devfs_async_t async

X

Thanks for Coming!

Subscribe to news and updates