xref: /nrf52832-nimble/rt-thread/components/libc/aio/posix_aio.h (revision 104654410c56c573564690304ae786df310c91fc)
1 /*
2  * Copyright (c) 2006-2018, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2017/12/30     Bernard      The first version.
9  */
10 
11 #ifndef POSIX_AIO_H__
12 #define POSIX_AIO_H__
13 
14 struct aiocb
15 {
16     int aio_fildes;         /* File descriptor. */
17     off_t aio_offset;       /* File offset. */
18 
19     volatile void *aio_buf; /* Location of buffer. */
20     size_t aio_nbytes;      /* Length of transfer. */
21     int aio_reqprio;        /* Request priority offset. */
22     struct sigevent aio_sigevent; /* Signal number and value. */
23     int aio_lio_opcode;     /* Operation to be performed. */
24 
25     int aio_result;
26     struct rt_work aio_work;
27 };
28 
29 int aio_cancel(int fd, struct aiocb *cb);
30 int aio_error (const struct aiocb *cb);
31 
32 int aio_fsync(int op, struct aiocb *cb);
33 
34 int aio_read(struct aiocb *cb);
35 ssize_t  aio_return(struct aiocb *cb);
36 int aio_suspend(const struct aiocb *const list[], int nent,
37              const struct timespec *timeout);
38 int aio_write(struct aiocb *cb);
39 
40 int lio_listio(int mode, struct aiocb * const list[], int nent,
41             struct sigevent *sig);
42 
43 #endif
44