4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
25 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
32 #include <sys/types.h>
33 #include <sys/fcntl.h>
34 #include <sys/siginfo.h>
41 typedef struct aiocb
{
43 volatile void *aio_buf
; /* buffer location */
44 size_t aio_nbytes
; /* length of transfer */
45 off_t aio_offset
; /* file offset */
46 int aio_reqprio
; /* request priority offset */
47 struct sigevent aio_sigevent
; /* notification type */
48 int aio_lio_opcode
; /* listio operation */
49 aio_result_t aio_resultp
; /* results */
50 int aio_state
; /* state flag for List I/O */
51 int aio__pad
[1]; /* extension padding */
54 #ifdef _LARGEFILE64_SOURCE
56 typedef struct aiocb64
{
58 volatile void *aio_buf
; /* buffer location */
59 size_t aio_nbytes
; /* length of transfer */
60 off64_t aio_offset
; /* file offset */
61 int aio_reqprio
; /* request priority offset */
62 struct sigevent aio_sigevent
; /* notification type */
63 int aio_lio_opcode
; /* listio operation */
64 aio_result_t aio_resultp
; /* results */
65 int aio_state
; /* state flag for List I/O */
66 int aio__pad
[1]; /* extension padding */
70 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
74 typedef struct aiocb64_32
{
76 caddr32_t aio_buf
; /* buffer location */
77 uint32_t aio_nbytes
; /* length of transfer */
78 off64_t aio_offset
; /* file offset */
79 int aio_reqprio
; /* request priority offset */
80 struct sigevent32 aio_sigevent
; /* notification type */
81 int aio_lio_opcode
; /* listio operation */
82 aio_result32_t aio_resultp
; /* results */
83 int aio_state
; /* state flag for List I/O */
84 int aio__pad
[1]; /* extension padding */
87 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
91 #endif /* !defined(_KERNEL) */
92 #endif /* _LARGEFILE64_SOURCE */
95 typedef struct aiocb32
{
97 caddr32_t aio_buf
; /* buffer location */
98 uint32_t aio_nbytes
; /* length of transfer */
99 uint32_t aio_offset
; /* file offset */
100 int aio_reqprio
; /* request priority offset */
101 struct sigevent32 aio_sigevent
; /* notification type */
102 int aio_lio_opcode
; /* listio operation */
103 aio_result32_t aio_resultp
; /* results */
104 int aio_state
; /* state flag for List I/O */
105 int aio__pad
[1]; /* extension padding */
108 #endif /* _SYSCALL32 */
110 * return values for aiocancel()
112 #define AIO_CANCELED 0
113 #define AIO_ALLDONE 1
114 #define AIO_NOTCANCELED 2
117 * mode values for lio_listio()
124 * listio operation codes
126 * LIO_READ and LIO_WRITE were previously defined as FREAD and FWRITE as
127 * defined in <sys/file.h>. However, inclusion of <sys/file.h> results
128 * in X/Open namespace pollution and as such is no longer included in
129 * this header. The values of LIO_READ and LIO_WRITE must be identical
130 * to the values of FREAD and FWRITE in <sys/file.h>. Any change to one
131 * will require a change to the other.
135 #define LIO_READ 0x01 /* Must match value of FREAD in sys/file.h */
136 #define LIO_WRITE 0x02 /* Must match value of FWRITE in sys/file.h */
142 #endif /* _SYS_AIOCB_H */