xref: /titanic_41/usr/src/uts/common/sys/aio.h (revision 3470957343f37ed9baa957980891dbbe4c2d7092)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*34709573Sraf  * Common Development and Distribution License (the "License").
6*34709573Sraf  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
21*34709573Sraf 
227c478bd9Sstevel@tonic-gate /*
23*34709573Sraf  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef _SYS_AIO_H
287c478bd9Sstevel@tonic-gate #define	_SYS_AIO_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
337c478bd9Sstevel@tonic-gate extern "C" {
347c478bd9Sstevel@tonic-gate #endif
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate typedef struct aio_result_t {
377c478bd9Sstevel@tonic-gate 	ssize_t aio_return;	/* return value of read or write */
387c478bd9Sstevel@tonic-gate 	int aio_errno;		/* errno generated by the IO */
397c478bd9Sstevel@tonic-gate } aio_result_t;
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate #ifdef	_SYSCALL32
427c478bd9Sstevel@tonic-gate typedef struct aio_result32_t {
437c478bd9Sstevel@tonic-gate 	int aio_return;		/* return value of read or write */
447c478bd9Sstevel@tonic-gate 	int aio_errno;		/* errno generated by the IO */
457c478bd9Sstevel@tonic-gate } aio_result32_t;
467c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */
477c478bd9Sstevel@tonic-gate 
487c478bd9Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
497c478bd9Sstevel@tonic-gate #define	AIOREAD		0	/* opcodes for aio calls */
507c478bd9Sstevel@tonic-gate #define	AIOWRITE	1
517c478bd9Sstevel@tonic-gate #define	AIOWAIT		2
527c478bd9Sstevel@tonic-gate #define	AIOCANCEL	3
537c478bd9Sstevel@tonic-gate #define	AIONOTIFY	4
547c478bd9Sstevel@tonic-gate #define	AIOINIT		5
557c478bd9Sstevel@tonic-gate #define	AIOSTART	6
567c478bd9Sstevel@tonic-gate #define	AIOLIO		7
577c478bd9Sstevel@tonic-gate #define	AIOSUSPEND	8
587c478bd9Sstevel@tonic-gate #define	AIOERROR	9
597c478bd9Sstevel@tonic-gate #define	AIOLIOWAIT	10
607c478bd9Sstevel@tonic-gate #define	AIOAREAD	11
617c478bd9Sstevel@tonic-gate #define	AIOAWRITE	12
62*34709573Sraf #define	AIOFSYNC	20
63*34709573Sraf #define	AIOWAITN	21
64*34709573Sraf #define	AIORESERVED1	23	/* reserved for the aio implementation */
65*34709573Sraf #define	AIORESERVED2	24
66*34709573Sraf #define	AIORESERVED3	25
677c478bd9Sstevel@tonic-gate #ifdef _LARGEFILE64_SOURCE
687c478bd9Sstevel@tonic-gate #if	defined(_LP64) && !defined(_KERNEL)
697c478bd9Sstevel@tonic-gate #define	AIOLIO64	AIOLIO
707c478bd9Sstevel@tonic-gate #define	AIOSUSPEND64	AIOSUSPEND
717c478bd9Sstevel@tonic-gate #define	AIOERROR64	AIOERROR
727c478bd9Sstevel@tonic-gate #define	AIOLIOWAIT64	AIOLIOWAIT
737c478bd9Sstevel@tonic-gate #define	AIOAREAD64	AIOAREAD
747c478bd9Sstevel@tonic-gate #define	AIOAWRITE64	AIOAWRITE
757c478bd9Sstevel@tonic-gate #define	AIOCANCEL64	AIOCANCEL
76*34709573Sraf #define	AIOFSYNC64	AIOFSYNC
777c478bd9Sstevel@tonic-gate #else
787c478bd9Sstevel@tonic-gate #define	AIOLIO64	13
797c478bd9Sstevel@tonic-gate #define	AIOSUSPEND64	14
807c478bd9Sstevel@tonic-gate #define	AIOERROR64	15
817c478bd9Sstevel@tonic-gate #define	AIOLIOWAIT64	16
827c478bd9Sstevel@tonic-gate #define	AIOAREAD64	17
837c478bd9Sstevel@tonic-gate #define	AIOAWRITE64	18
847c478bd9Sstevel@tonic-gate #define	AIOCANCEL64	19
85*34709573Sraf #define	AIOFSYNC64	22
867c478bd9Sstevel@tonic-gate #endif /* defined(_LP64) && !defined(_KERNEL) */
877c478bd9Sstevel@tonic-gate #endif /* _LARGEFILE64_SOURCE */
887c478bd9Sstevel@tonic-gate #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
897c478bd9Sstevel@tonic-gate 
907c478bd9Sstevel@tonic-gate #define	AIO_POLL_BIT	0x20	/* opcode filter for AIO_INPROGRESS */
91*34709573Sraf 
927c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
937c478bd9Sstevel@tonic-gate }
947c478bd9Sstevel@tonic-gate #endif
957c478bd9Sstevel@tonic-gate 
967c478bd9Sstevel@tonic-gate #endif /* _SYS_AIO_H */
97