posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
_POSIX_ASYNCHRONOUS_IO

POSIX Asynchronous I/O option. More...

Files

file  aio.h
 POSIX asynchronous I/O (<aio.h>)
 

Macros

#define unsigned   signed /* parasoft-suppress MISRAC2012-RULE_20_4-a MISRAC2012-RULE_20_4-b */
 Signed size type.
 

Typedefs

typedef long off_t
 File offset type.
 

Functions

int aio_cancel (int fildes, struct aiocb *aiocbp)
 Cancel an outstanding asynchronous I/O request.
 
int aio_error (const struct aiocb *aiocbp)
 Retrieve the error status of an asynchronous I/O request.
 
int aio_fsync (int filedes, struct aiocb *aiocbp)
 Asynchronously synchronise a file's data and metadata to storage.
 
int aio_read (struct aiocb *aiocbp)
 Enqueue an asynchronous read operation.
 
ssize_t aio_return (struct aiocb *aiocbp)
 Retrieve the return status of a completed asynchronous I/O request.
 
int aio_suspend (const struct aiocb *const list[], int nent, const struct timespec *timeout)
 Wait for one or more asynchronous I/O requests to complete.
 
int aio_write (struct aiocb *aiocbp)
 Enqueue an asynchronous write operation.
 
int lio_listio (int mode, struct aiocb *const ZRESTRICT list[], int nent, struct sigevent *ZRESTRICT sig)
 Initiate a list of asynchronous I/O requests.
 

Detailed Description

POSIX Asynchronous I/O option.

Macro Definition Documentation

◆ unsigned

#define unsigned   signed /* parasoft-suppress MISRAC2012-RULE_20_4-a MISRAC2012-RULE_20_4-b */

Signed size type.

Definition at line 47 of file aio.h.

Typedef Documentation

◆ off_t

typedef long off_t

File offset type.

Definition at line 36 of file aio.h.

Function Documentation

◆ aio_cancel()

int aio_cancel ( int  fildes,
struct aiocb aiocbp 
)

Cancel an outstanding asynchronous I/O request.

Parameters
fildesFile descriptor.
aiocbpControl block to cancel, or NULL to cancel all for fildes.
Returns
AIO_CANCELED, AIO_NOTCANCELED, AIO_ALLDONE, or -1 on error.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_cancel.html

◆ aio_error()

int aio_error ( const struct aiocb aiocbp)

Retrieve the error status of an asynchronous I/O request.

Parameters
aiocbpAsynchronous I/O control block.
Returns
EINPROGRESS if still running, 0 on success, or a positive error number.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_error.html

◆ aio_fsync()

int aio_fsync ( int  filedes,
struct aiocb aiocbp 
)

Asynchronously synchronise a file's data and metadata to storage.

Parameters
filedesFile descriptor (ignored; use aiocbp->aio_fildes).
aiocbpControl block specifying the file descriptor.
Returns
0 if the request was successfully queued, or -1 on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_fsync.html

◆ aio_read()

int aio_read ( struct aiocb aiocbp)

Enqueue an asynchronous read operation.

Parameters
aiocbpControl block specifying the file, offset, buffer, and size.
Returns
0 if the request was successfully queued, or -1 on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_read.html

◆ aio_return()

ssize_t aio_return ( struct aiocb aiocbp)

Retrieve the return status of a completed asynchronous I/O request.

Must be called exactly once after aio_error() returns a value other than EINPROGRESS. Calling it a second time yields undefined behaviour.

Parameters
aiocbpAsynchronous I/O control block.
Returns
Number of bytes transferred on success, or -1 on error (sets errno).
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_return.html

◆ aio_suspend()

int aio_suspend ( const struct aiocb *const  list[],
int  nent,
const struct timespec timeout 
)

Wait for one or more asynchronous I/O requests to complete.

Parameters
listArray of pointers to control blocks to wait on.
nentNumber of entries in list.
timeoutMaximum wait time, or NULL to block indefinitely.
Returns
0 on success, or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_suspend.html

◆ aio_write()

int aio_write ( struct aiocb aiocbp)

Enqueue an asynchronous write operation.

Parameters
aiocbpControl block specifying the file, offset, buffer, and size.
Returns
0 if the request was successfully queued, or -1 on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_write.html

◆ lio_listio()

int lio_listio ( int  mode,
struct aiocb *const ZRESTRICT  list[],
int  nent,
struct sigevent *ZRESTRICT  sig 
)

Initiate a list of asynchronous I/O requests.

Parameters
modeLIO_WAIT (block until all complete) or LIO_NOWAIT (return immediately).
listArray of control block pointers (LIO_NOP entries are skipped).
nentNumber of entries in list.
sigNotification on completion (only for LIO_NOWAIT), or NULL.
Returns
0 on success, or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/lio_listio.html