Rich Felker | b4de6f9 | 2011-09-09 01:07:38 -0400 | [diff] [blame] | 1 | #ifndef _AIO_H |
| 2 | #define _AIO_H |
| 3 | |
| 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
Rich Felker | c1a9658 | 2012-09-07 23:13:55 -0400 | [diff] [blame] | 8 | #include <features.h> |
Rich Felker | b4de6f9 | 2011-09-09 01:07:38 -0400 | [diff] [blame] | 9 | #include <signal.h> |
| 10 | #include <time.h> |
| 11 | |
| 12 | #define __NEED_ssize_t |
| 13 | #define __NEED_off_t |
| 14 | |
| 15 | #include <bits/alltypes.h> |
| 16 | |
| 17 | struct aiocb { |
Rich Felker | f0a8d60 | 2011-09-28 11:36:11 -0400 | [diff] [blame] | 18 | int aio_fildes, aio_lio_opcode, aio_reqprio; |
Rich Felker | b4de6f9 | 2011-09-09 01:07:38 -0400 | [diff] [blame] | 19 | volatile void *aio_buf; |
| 20 | size_t aio_nbytes; |
| 21 | struct sigevent aio_sigevent; |
| 22 | void *__td; |
| 23 | int __lock[2]; |
Rich Felker | 56fbaa3 | 2015-03-03 22:50:02 -0500 | [diff] [blame] | 24 | volatile int __err; |
Rich Felker | b4de6f9 | 2011-09-09 01:07:38 -0400 | [diff] [blame] | 25 | ssize_t __ret; |
| 26 | off_t aio_offset; |
| 27 | void *__next, *__prev; |
| 28 | char __dummy4[32-2*sizeof(void *)]; |
| 29 | }; |
| 30 | |
| 31 | #define AIO_CANCELED 0 |
| 32 | #define AIO_NOTCANCELED 1 |
| 33 | #define AIO_ALLDONE 2 |
| 34 | |
| 35 | #define LIO_READ 0 |
| 36 | #define LIO_WRITE 1 |
| 37 | #define LIO_NOP 2 |
| 38 | |
| 39 | #define LIO_WAIT 0 |
| 40 | #define LIO_NOWAIT 1 |
| 41 | |
Rich Felker | 4da289e | 2011-09-13 21:21:53 -0400 | [diff] [blame] | 42 | int aio_read(struct aiocb *); |
| 43 | int aio_write(struct aiocb *); |
Rich Felker | 13cd969 | 2011-09-13 21:09:35 -0400 | [diff] [blame] | 44 | int aio_error(const struct aiocb *); |
Rich Felker | b4de6f9 | 2011-09-09 01:07:38 -0400 | [diff] [blame] | 45 | ssize_t aio_return(struct aiocb *); |
| 46 | int aio_cancel(int, struct aiocb *); |
Rich Felker | 13cd969 | 2011-09-13 21:09:35 -0400 | [diff] [blame] | 47 | int aio_suspend(const struct aiocb *const [], int, const struct timespec *); |
Rich Felker | b4de6f9 | 2011-09-09 01:07:38 -0400 | [diff] [blame] | 48 | int aio_fsync(int, struct aiocb *); |
| 49 | |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 50 | int lio_listio(int, struct aiocb *__restrict const *__restrict, int, struct sigevent *__restrict); |
Rich Felker | b4de6f9 | 2011-09-09 01:07:38 -0400 | [diff] [blame] | 51 | |
Rich Felker | 3b94dab | 2012-06-04 08:03:56 -0400 | [diff] [blame] | 52 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) |
Rich Felker | 2dd8d5e | 2012-05-04 00:13:23 -0400 | [diff] [blame] | 53 | #define aiocb64 aiocb |
| 54 | #define aio_read64 aio_read |
| 55 | #define aio_write64 aio_write |
| 56 | #define aio_error64 aio_error |
| 57 | #define aio_return64 aio_return |
| 58 | #define aio_cancel64 aio_cancel |
| 59 | #define aio_suspend64 aio_suspend |
| 60 | #define aio_fsync64 aio_fsync |
Rich Felker | f072227 | 2012-07-19 00:37:43 -0400 | [diff] [blame] | 61 | #define lio_listio64 lio_listio |
Rich Felker | 2dd8d5e | 2012-05-04 00:13:23 -0400 | [diff] [blame] | 62 | #define off64_t off_t |
| 63 | #endif |
| 64 | |
Rich Felker | b4de6f9 | 2011-09-09 01:07:38 -0400 | [diff] [blame] | 65 | #ifdef __cplusplus |
| 66 | } |
| 67 | #endif |
| 68 | |
| 69 | #endif |