8911cb6f6e95c9244058adddbc3813def090bcc3
[reactos.git] / posix / include / aio.h
1 /*
2 * aio.h
3 *
4 * asynchronous input and output (REALTIME). Based on the Single UNIX(r)
5 * Specification, Version 2
6 *
7 * This file is part of the ReactOS Operating System.
8 *
9 * Contributors:
10 * Created by KJK::Hyperion <noog@libero.it>
11 *
12 * THIS SOFTWARE IS NOT COPYRIGHTED
13 *
14 * This source code is offered for use in the public domain. You may
15 * use, modify or distribute it freely.
16 *
17 * This code is distributed in the hope that it will be useful but
18 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
19 * DISCLAMED. This includes but is not limited to warranties of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 *
22 */
23 #ifndef __AIO_H_INCLUDED__
24 #define __AIO_H_INCLUDED__
25
26 #ifdef __PSXDLL__
27
28 /* headers for internal usage by psxdll.dll and ReactOS */
29 #include <psxdll/fcntl.h>
30 #include <psxdll/signal.h>
31 #include <psxdll/sys/types.h>
32 #include <psxdll/time.h>
33
34 #else /* ! __PSXDLL__ */
35
36 /* standard POSIX headers */
37 #include <fcntl.h>
38 #include <signal.h>
39 #include <sys/types.h>
40 #include <time.h>
41
42 #endif
43
44 /* types */
45 typedef struct _tag_aiocb
46 {
47 int aio_fildes /* file descriptor */
48 off_t aio_offset /* file offset */
49 volatile void* aio_buf /* location of buffer
50 size_t aio_nbytes /* length of transfer */
51 int aio_reqprio /* request priority offset */
52 struct sigevent aio_sigevent /* signal number and value */
53 int aio_lio_opcode /* operation to be performed */
54 } aiocb;
55
56 /* constants */
57 #define AIO_CANCELED 0
58 #define AIO_NOTCANCELED 1
59 #define AIO_ALLDONE 2
60
61 #define LIO_WAIT 0
62 #define LIO_NOWAIT 1
63 #define LIO_READ 2
64 #define LIO_WRITE 3
65 #define LIO_NOP 4
66
67 /* prototypes */
68 int aio_cancel(int, struct aiocb *);
69 int aio_error(const struct aiocb *);
70 int aio_fsync(int, struct aiocb *);
71 int aio_read(struct aiocb *);
72 ssize_t aio_return(struct aiocb *);
73 int aio_suspend(const struct aiocb *const[], int, const struct timespec *);
74 int aio_write(struct aiocb *);
75 int lio_listio(int, struct aiocb *const[], int, struct sigevent *);
76
77 #endif /* __AIO_H_INCLUDED__ */
78
79 /* EOF */
80