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