blob: 19bc28a9b19e0d5c3aa90fcf1aa8a36745dcf259 [file] [log] [blame]
Rich Felkerb4de6f92011-09-09 01:07:38 -04001#ifndef _AIO_H
2#define _AIO_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
Rich Felkerc1a96582012-09-07 23:13:55 -04008#include <features.h>
Rich Felkerb4de6f92011-09-09 01:07:38 -04009#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
17struct aiocb {
Rich Felkerf0a8d602011-09-28 11:36:11 -040018 int aio_fildes, aio_lio_opcode, aio_reqprio;
Rich Felkerb4de6f92011-09-09 01:07:38 -040019 volatile void *aio_buf;
20 size_t aio_nbytes;
21 struct sigevent aio_sigevent;
22 void *__td;
23 int __lock[2];
Rich Felker56fbaa32015-03-03 22:50:02 -050024 volatile int __err;
Rich Felkerb4de6f92011-09-09 01:07:38 -040025 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 Felker4da289e2011-09-13 21:21:53 -040042int aio_read(struct aiocb *);
43int aio_write(struct aiocb *);
Rich Felker13cd9692011-09-13 21:09:35 -040044int aio_error(const struct aiocb *);
Rich Felkerb4de6f92011-09-09 01:07:38 -040045ssize_t aio_return(struct aiocb *);
46int aio_cancel(int, struct aiocb *);
Rich Felker13cd9692011-09-13 21:09:35 -040047int aio_suspend(const struct aiocb *const [], int, const struct timespec *);
Rich Felkerb4de6f92011-09-09 01:07:38 -040048int aio_fsync(int, struct aiocb *);
49
Rich Felker400c5e52012-09-06 22:44:55 -040050int lio_listio(int, struct aiocb *__restrict const *__restrict, int, struct sigevent *__restrict);
Rich Felkerb4de6f92011-09-09 01:07:38 -040051
Rich Felker3b94dab2012-06-04 08:03:56 -040052#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
Rich Felker2dd8d5e2012-05-04 00:13:23 -040053#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 Felkerf0722272012-07-19 00:37:43 -040061#define lio_listio64 lio_listio
Rich Felker2dd8d5e2012-05-04 00:13:23 -040062#define off64_t off_t
63#endif
64
Rich Felkerb4de6f92011-09-09 01:07:38 -040065#ifdef __cplusplus
66}
67#endif
68
69#endif