xref: /illumos-gate/usr/src/uts/common/sys/asynch.h (revision 5422785d352a2bb398daceab3d1898a8aa64d006)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #include <sys/feature_tests.h>
32 #include <sys/types.h>
33 #include <sys/aio.h>
34 
35 #ifdef	__cplusplus
36 extern "C" {
37 #endif
38 
39 #define	AIO_INPROGRESS	-2	/* values not set by the system */
40 
41 /* large file compilation environment setup */
42 #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
43 #ifdef __PRAGMA_REDEFINE_EXTNAME
44 #pragma redefine_extname	aioread		aioread64
45 #pragma redefine_extname	aiowrite	aiowrite64
46 #else
47 #define	aioread			aioread64
48 #define	aiowrite		aiowrite64
49 #endif
50 #endif /* _FILE_OFFSET_BITS */
51 
52 #if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
53 #ifdef __PRAGMA_REDEFINE_EXTNAME
54 #pragma	redefine_extname	aioread64	aioread
55 #pragma	redefine_extname	aiowrite64	aiowrite
56 #else
57 #define	aioread64	aioread
58 #define	aiowrite64	aiowrite
59 #endif
60 #endif	/* _LP64 && _LARGEFILE64_SOURCE */
61 extern int aioread(int, caddr_t, int, off_t, int, aio_result_t *);
62 extern int aiowrite(int, caddr_t, int, off_t, int, aio_result_t *);
63 extern int aiocancel(aio_result_t *);
64 extern aio_result_t *aiowait(struct timeval *);
65 
66 /* transitional large file interfaces */
67 #if	defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
68 	    !defined(__PRAGMA_REDEFINE_EXTNAME))
69 extern int aioread64(int, caddr_t, int, off64_t, int, aio_result_t *);
70 extern int aiowrite64(int, caddr_t, int, off64_t, int, aio_result_t *);
71 #endif	/* _LARGEFILE64_SOURCE... */
72 
73 #define	MAXASYNCHIO 200		/* maxi.number of outstanding i/o's */
74 
75 #ifdef	__cplusplus
76 }
77 #endif
78 
79 #endif /* _SYS_ASYNCH_H */
80