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