xref: /illumos-gate/usr/src/uts/common/sys/asynch.h (revision ddb365bfc9e868ad24ccdcb0dc91af18b10df082)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1991 by Sun Microsystems, Inc.
24  */
25 
26 #ifndef _SYS_ASYNCH_H
27 #define	_SYS_ASYNCH_H
28 
29 #include <sys/feature_tests.h>
30 #include <sys/types.h>
31 #include <sys/aio.h>
32 
33 #ifdef	__cplusplus
34 extern "C" {
35 #endif
36 
37 #define	AIO_INPROGRESS	-2	/* values not set by the system */
38 
39 /* large file compilation environment setup */
40 #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
41 #ifdef __PRAGMA_REDEFINE_EXTNAME
42 #pragma redefine_extname	aioread		aioread64
43 #pragma redefine_extname	aiowrite	aiowrite64
44 #else
45 #define	aioread			aioread64
46 #define	aiowrite		aiowrite64
47 #endif
48 #endif /* _FILE_OFFSET_BITS */
49 
50 #if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
51 #ifdef __PRAGMA_REDEFINE_EXTNAME
52 #pragma	redefine_extname	aioread64	aioread
53 #pragma	redefine_extname	aiowrite64	aiowrite
54 #else
55 #define	aioread64	aioread
56 #define	aiowrite64	aiowrite
57 #endif
58 #endif	/* _LP64 && _LARGEFILE64_SOURCE */
59 extern int aioread(int, caddr_t, int, off_t, int, aio_result_t *);
60 extern int aiowrite(int, caddr_t, int, off_t, int, aio_result_t *);
61 extern int aiocancel(aio_result_t *);
62 extern aio_result_t *aiowait(struct timeval *);
63 
64 /* transitional large file interfaces */
65 #if	defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
66 	    !defined(__PRAGMA_REDEFINE_EXTNAME))
67 extern int aioread64(int, caddr_t, int, off64_t, int, aio_result_t *);
68 extern int aiowrite64(int, caddr_t, int, off64_t, int, aio_result_t *);
69 #endif	/* _LARGEFILE64_SOURCE... */
70 
71 #define	MAXASYNCHIO 200		/* maxi.number of outstanding i/o's */
72 
73 #ifdef	__cplusplus
74 }
75 #endif
76 
77 #endif /* _SYS_ASYNCH_H */
78