posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
aio.h File Reference

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

#include <stddef.h>
#include <stdint.h>
#include <signal.h>
#include <zephyr/toolchain.h>
#include <time.h>
Include dependency graph for aio.h:

Go to the source code of this file.

Data Structures

struct  timespec
 Time value with nanosecond resolution. More...
 
struct  aiocb
 Asynchronous I/O control block. More...
 

Macros

#define __SIZE_TYPE__   unsigned long
 
#define unsigned   signed /* parasoft-suppress MISRAC2012-RULE_20_4-a MISRAC2012-RULE_20_4-b */
 
#define AIO_ALLDONE   2
 All requested operations have already completed.
 
#define AIO_CANCELED   0
 All requested operations were canceled.
 
#define AIO_NOTCANCELED   1
 Some of the requested operations could not be canceled.
 
#define LIO_NOP   2
 lio_listio() list element: no transfer is requested.
 
#define LIO_NOWAIT   1
 lio_listio() mode: return once the operations are queued.
 
#define LIO_READ   0
 lio_listio() list element: request a read.
 
#define LIO_WAIT   0
 lio_listio() mode: wait until all operations are complete.
 
#define LIO_WRITE   1
 lio_listio() list element: request a write.
 

Typedefs

typedef long off_t
 
typedef signed long ssize_t
 

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 op, 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 list[ZRESTRICT], int nent, struct sigevent *ZRESTRICT sig)
 Initiate a list of asynchronous I/O requests.
 

Detailed Description

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

Provides the aiocb control block and the asynchronous I/O functions. Operations are submitted to the OS-managed request pool (CONFIG_SYS_AIO) and performed by a dedicated kernel service queue; completion is observed with aio_error(), aio_suspend(), and aio_return(), or announced by the control block's sigevent.

See also
POSIX.1-2017 <aio.h>

Definition in file aio.h.

Macro Definition Documentation

◆ __SIZE_TYPE__

#define __SIZE_TYPE__   unsigned long

Definition at line 45 of file aio.h.

◆ AIO_ALLDONE

#define AIO_ALLDONE   2

All requested operations have already completed.

Definition at line 91 of file aio.h.

◆ AIO_CANCELED

#define AIO_CANCELED   0

All requested operations were canceled.

Definition at line 93 of file aio.h.

◆ AIO_NOTCANCELED

#define AIO_NOTCANCELED   1

Some of the requested operations could not be canceled.

Definition at line 95 of file aio.h.

◆ LIO_NOP

#define LIO_NOP   2

lio_listio() list element: no transfer is requested.

Definition at line 98 of file aio.h.

◆ LIO_NOWAIT

#define LIO_NOWAIT   1

lio_listio() mode: return once the operations are queued.

Definition at line 100 of file aio.h.

◆ LIO_READ

#define LIO_READ   0

lio_listio() list element: request a read.

Definition at line 102 of file aio.h.

◆ LIO_WAIT

#define LIO_WAIT   0

lio_listio() mode: wait until all operations are complete.

Definition at line 104 of file aio.h.

◆ LIO_WRITE

#define LIO_WRITE   1

lio_listio() list element: request a write.

Definition at line 106 of file aio.h.

◆ unsigned

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

Definition at line 50 of file aio.h.

Typedef Documentation

◆ off_t

typedef long off_t

Definition at line 39 of file aio.h.

◆ ssize_t

typedef signed long ssize_t

Definition at line 51 of file aio.h.