add clang-compatible thread-pointer code for mips
[musl] / include / aio.h
1 #ifndef _AIO_H
2 #define _AIO_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #if __STDC_VERSION__ >= 199901L
9 #define __restrict restrict
10 #elif !defined(__GNUC__)
11 #define __restrict
12 #endif
13
14 #include <signal.h>
15 #include <time.h>
16
17 #define __NEED_ssize_t
18 #define __NEED_off_t
19
20 #include <bits/alltypes.h>
21
22 struct aiocb {
23         int aio_fildes, aio_lio_opcode, aio_reqprio;
24         volatile void *aio_buf;
25         size_t aio_nbytes;
26         struct sigevent aio_sigevent;
27         void *__td;
28         int __lock[2];
29         int __err;
30         ssize_t __ret;
31         off_t aio_offset;
32         void *__next, *__prev;
33         char __dummy4[32-2*sizeof(void *)];
34 };
35
36 #define AIO_CANCELED 0
37 #define AIO_NOTCANCELED 1
38 #define AIO_ALLDONE 2
39
40 #define LIO_READ 0
41 #define LIO_WRITE 1
42 #define LIO_NOP 2
43
44 #define LIO_WAIT 0
45 #define LIO_NOWAIT 1
46
47 int aio_read(struct aiocb *);
48 int aio_write(struct aiocb *);
49 int aio_error(const struct aiocb *);
50 ssize_t aio_return(struct aiocb *);
51 int aio_cancel(int, struct aiocb *);
52 int aio_suspend(const struct aiocb *const [], int, const struct timespec *);
53 int aio_fsync(int, struct aiocb *);
54
55 int lio_listio(int, struct aiocb *__restrict const *__restrict, int, struct sigevent *__restrict);
56
57 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
58 #define aiocb64 aiocb
59 #define aio_read64 aio_read
60 #define aio_write64 aio_write
61 #define aio_error64 aio_error
62 #define aio_return64 aio_return
63 #define aio_cancel64 aio_cancel
64 #define aio_suspend64 aio_suspend
65 #define aio_fsync64 aio_fsync
66 #define lio_listio64 lio_listio
67 #define off64_t off_t
68 #endif
69
70 #ifdef __cplusplus
71 }
72 #endif
73
74 #endif