xref: /illumos-gate/usr/src/uts/common/sys/types.h (revision 7c478bd9)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
23*7c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
24*7c478bd9Sstevel@tonic-gate 
25*7c478bd9Sstevel@tonic-gate 
26*7c478bd9Sstevel@tonic-gate /*
27*7c478bd9Sstevel@tonic-gate  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
28*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
29*7c478bd9Sstevel@tonic-gate  */
30*7c478bd9Sstevel@tonic-gate 
31*7c478bd9Sstevel@tonic-gate #ifndef _SYS_TYPES_H
32*7c478bd9Sstevel@tonic-gate #define	_SYS_TYPES_H
33*7c478bd9Sstevel@tonic-gate 
34*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h>
37*7c478bd9Sstevel@tonic-gate #include <sys/isa_defs.h>
38*7c478bd9Sstevel@tonic-gate 
39*7c478bd9Sstevel@tonic-gate /*
40*7c478bd9Sstevel@tonic-gate  * Machine dependent definitions moved to <sys/machtypes.h>.
41*7c478bd9Sstevel@tonic-gate  */
42*7c478bd9Sstevel@tonic-gate #include <sys/machtypes.h>
43*7c478bd9Sstevel@tonic-gate 
44*7c478bd9Sstevel@tonic-gate /*
45*7c478bd9Sstevel@tonic-gate  * Include fixed width type declarations proposed by the ISO/JTC1/SC22/WG14 C
46*7c478bd9Sstevel@tonic-gate  * committee's working draft for the revision of the current ISO C standard,
47*7c478bd9Sstevel@tonic-gate  * ISO/IEC 9899:1990 Programming language - C.  These are not currently
48*7c478bd9Sstevel@tonic-gate  * required by any standard but constitute a useful, general purpose set
49*7c478bd9Sstevel@tonic-gate  * of type definitions which is namespace clean with respect to all standards.
50*7c478bd9Sstevel@tonic-gate  */
51*7c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
52*7c478bd9Sstevel@tonic-gate #include <sys/inttypes.h>
53*7c478bd9Sstevel@tonic-gate #else	/* _KERNEL */
54*7c478bd9Sstevel@tonic-gate #include <sys/int_types.h>
55*7c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
56*7c478bd9Sstevel@tonic-gate 
57*7c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_SYSCALL32)
58*7c478bd9Sstevel@tonic-gate #include <sys/types32.h>
59*7c478bd9Sstevel@tonic-gate #endif
60*7c478bd9Sstevel@tonic-gate 
61*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
62*7c478bd9Sstevel@tonic-gate extern "C" {
63*7c478bd9Sstevel@tonic-gate #endif
64*7c478bd9Sstevel@tonic-gate 
65*7c478bd9Sstevel@tonic-gate /*
66*7c478bd9Sstevel@tonic-gate  * Strictly conforming ANSI C environments prior to the 1999
67*7c478bd9Sstevel@tonic-gate  * revision of the C Standard (ISO/IEC 9899:1999) do not have
68*7c478bd9Sstevel@tonic-gate  * the long long data type.
69*7c478bd9Sstevel@tonic-gate  */
70*7c478bd9Sstevel@tonic-gate #if defined(_LONGLONG_TYPE)
71*7c478bd9Sstevel@tonic-gate typedef	long long		longlong_t;
72*7c478bd9Sstevel@tonic-gate typedef	unsigned long long	u_longlong_t;
73*7c478bd9Sstevel@tonic-gate #else
74*7c478bd9Sstevel@tonic-gate /* used to reserve space and generate alignment */
75*7c478bd9Sstevel@tonic-gate typedef union {
76*7c478bd9Sstevel@tonic-gate 	double	_d;
77*7c478bd9Sstevel@tonic-gate 	int32_t	_l[2];
78*7c478bd9Sstevel@tonic-gate } longlong_t;
79*7c478bd9Sstevel@tonic-gate typedef union {
80*7c478bd9Sstevel@tonic-gate 	double		_d;
81*7c478bd9Sstevel@tonic-gate 	uint32_t	_l[2];
82*7c478bd9Sstevel@tonic-gate } u_longlong_t;
83*7c478bd9Sstevel@tonic-gate #endif	/* defined(_LONGLONG_TYPE) */
84*7c478bd9Sstevel@tonic-gate 
85*7c478bd9Sstevel@tonic-gate /*
86*7c478bd9Sstevel@tonic-gate  * These types (t_{u}scalar_t) exist because the XTI/TPI/DLPI standards had
87*7c478bd9Sstevel@tonic-gate  * to use them instead of int32_t and uint32_t because DEC had
88*7c478bd9Sstevel@tonic-gate  * shipped 64-bit wide.
89*7c478bd9Sstevel@tonic-gate  */
90*7c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
91*7c478bd9Sstevel@tonic-gate typedef int32_t		t_scalar_t;
92*7c478bd9Sstevel@tonic-gate typedef uint32_t	t_uscalar_t;
93*7c478bd9Sstevel@tonic-gate #else
94*7c478bd9Sstevel@tonic-gate typedef long		t_scalar_t;	/* historical versions */
95*7c478bd9Sstevel@tonic-gate typedef unsigned long	t_uscalar_t;
96*7c478bd9Sstevel@tonic-gate #endif	/* defined(_LP64) || defined(_I32LPx) */
97*7c478bd9Sstevel@tonic-gate 
98*7c478bd9Sstevel@tonic-gate /*
99*7c478bd9Sstevel@tonic-gate  * POSIX Extensions
100*7c478bd9Sstevel@tonic-gate  */
101*7c478bd9Sstevel@tonic-gate typedef	unsigned char	uchar_t;
102*7c478bd9Sstevel@tonic-gate typedef	unsigned short	ushort_t;
103*7c478bd9Sstevel@tonic-gate typedef	unsigned int	uint_t;
104*7c478bd9Sstevel@tonic-gate typedef	unsigned long	ulong_t;
105*7c478bd9Sstevel@tonic-gate 
106*7c478bd9Sstevel@tonic-gate typedef	char		*caddr_t;	/* ?<core address> type */
107*7c478bd9Sstevel@tonic-gate typedef	long		daddr_t;	/* <disk address> type */
108*7c478bd9Sstevel@tonic-gate typedef	short		cnt_t;		/* ?<count> type */
109*7c478bd9Sstevel@tonic-gate 
110*7c478bd9Sstevel@tonic-gate #if !defined(_PTRDIFF_T) || __cplusplus >= 199711L
111*7c478bd9Sstevel@tonic-gate #define	_PTRDIFF_T
112*7c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
113*7c478bd9Sstevel@tonic-gate typedef	long	ptrdiff_t;		/* pointer difference */
114*7c478bd9Sstevel@tonic-gate #else
115*7c478bd9Sstevel@tonic-gate typedef	int	ptrdiff_t;		/* (historical version) */
116*7c478bd9Sstevel@tonic-gate #endif
117*7c478bd9Sstevel@tonic-gate #endif
118*7c478bd9Sstevel@tonic-gate 
119*7c478bd9Sstevel@tonic-gate /*
120*7c478bd9Sstevel@tonic-gate  * VM-related types
121*7c478bd9Sstevel@tonic-gate  */
122*7c478bd9Sstevel@tonic-gate typedef	ulong_t		pfn_t;		/* page frame number */
123*7c478bd9Sstevel@tonic-gate typedef	ulong_t		pgcnt_t;	/* number of pages */
124*7c478bd9Sstevel@tonic-gate typedef	long		spgcnt_t;	/* signed number of pages */
125*7c478bd9Sstevel@tonic-gate 
126*7c478bd9Sstevel@tonic-gate typedef	uchar_t		use_t;		/* use count for swap.  */
127*7c478bd9Sstevel@tonic-gate typedef	short		sysid_t;
128*7c478bd9Sstevel@tonic-gate typedef	short		index_t;
129*7c478bd9Sstevel@tonic-gate typedef void		*timeout_id_t;	/* opaque handle from timeout(9F) */
130*7c478bd9Sstevel@tonic-gate typedef void		*bufcall_id_t;	/* opaque handle from bufcall(9F) */
131*7c478bd9Sstevel@tonic-gate 
132*7c478bd9Sstevel@tonic-gate /*
133*7c478bd9Sstevel@tonic-gate  * The size of off_t and related types depends on the setting of
134*7c478bd9Sstevel@tonic-gate  * _FILE_OFFSET_BITS.  (Note that other system headers define other types
135*7c478bd9Sstevel@tonic-gate  * related to those defined here.)
136*7c478bd9Sstevel@tonic-gate  *
137*7c478bd9Sstevel@tonic-gate  * If _LARGEFILE64_SOURCE is defined, variants of these types that are
138*7c478bd9Sstevel@tonic-gate  * explicitly 64 bits wide become available.
139*7c478bd9Sstevel@tonic-gate  */
140*7c478bd9Sstevel@tonic-gate #ifndef _OFF_T
141*7c478bd9Sstevel@tonic-gate #define	_OFF_T
142*7c478bd9Sstevel@tonic-gate 
143*7c478bd9Sstevel@tonic-gate #if defined(_LP64) || _FILE_OFFSET_BITS == 32
144*7c478bd9Sstevel@tonic-gate typedef long		off_t;		/* offsets within files */
145*7c478bd9Sstevel@tonic-gate #elif _FILE_OFFSET_BITS == 64
146*7c478bd9Sstevel@tonic-gate typedef longlong_t	off_t;		/* offsets within files */
147*7c478bd9Sstevel@tonic-gate #endif
148*7c478bd9Sstevel@tonic-gate 
149*7c478bd9Sstevel@tonic-gate #if defined(_LARGEFILE64_SOURCE)
150*7c478bd9Sstevel@tonic-gate #ifdef _LP64
151*7c478bd9Sstevel@tonic-gate typedef	off_t		off64_t;	/* offsets within files */
152*7c478bd9Sstevel@tonic-gate #else
153*7c478bd9Sstevel@tonic-gate typedef longlong_t	off64_t;	/* offsets within files */
154*7c478bd9Sstevel@tonic-gate #endif
155*7c478bd9Sstevel@tonic-gate #endif	/* _LARGEFILE64_SOURCE */
156*7c478bd9Sstevel@tonic-gate 
157*7c478bd9Sstevel@tonic-gate #endif /* _OFF_T */
158*7c478bd9Sstevel@tonic-gate 
159*7c478bd9Sstevel@tonic-gate #if defined(_LP64) || _FILE_OFFSET_BITS == 32
160*7c478bd9Sstevel@tonic-gate typedef ulong_t		ino_t;		/* expanded inode type	*/
161*7c478bd9Sstevel@tonic-gate typedef long		blkcnt_t;	/* count of file blocks */
162*7c478bd9Sstevel@tonic-gate typedef ulong_t		fsblkcnt_t;	/* count of file system blocks */
163*7c478bd9Sstevel@tonic-gate typedef ulong_t		fsfilcnt_t;	/* count of files */
164*7c478bd9Sstevel@tonic-gate #elif _FILE_OFFSET_BITS == 64
165*7c478bd9Sstevel@tonic-gate typedef u_longlong_t	ino_t;		/* expanded inode type	*/
166*7c478bd9Sstevel@tonic-gate typedef longlong_t	blkcnt_t;	/* count of file blocks */
167*7c478bd9Sstevel@tonic-gate typedef u_longlong_t	fsblkcnt_t;	/* count of file system blocks */
168*7c478bd9Sstevel@tonic-gate typedef u_longlong_t	fsfilcnt_t;	/* count of files */
169*7c478bd9Sstevel@tonic-gate #endif
170*7c478bd9Sstevel@tonic-gate 
171*7c478bd9Sstevel@tonic-gate #if defined(_LARGEFILE64_SOURCE)
172*7c478bd9Sstevel@tonic-gate #ifdef _LP64
173*7c478bd9Sstevel@tonic-gate typedef	ino_t		ino64_t;	/* expanded inode type */
174*7c478bd9Sstevel@tonic-gate typedef	blkcnt_t	blkcnt64_t;	/* count of file blocks */
175*7c478bd9Sstevel@tonic-gate typedef	fsblkcnt_t	fsblkcnt64_t;	/* count of file system blocks */
176*7c478bd9Sstevel@tonic-gate typedef	fsfilcnt_t	fsfilcnt64_t;	/* count of files */
177*7c478bd9Sstevel@tonic-gate #else
178*7c478bd9Sstevel@tonic-gate typedef u_longlong_t	ino64_t;	/* expanded inode type	*/
179*7c478bd9Sstevel@tonic-gate typedef longlong_t	blkcnt64_t;	/* count of file blocks */
180*7c478bd9Sstevel@tonic-gate typedef u_longlong_t	fsblkcnt64_t;	/* count of file system blocks */
181*7c478bd9Sstevel@tonic-gate typedef u_longlong_t	fsfilcnt64_t;	/* count of files */
182*7c478bd9Sstevel@tonic-gate #endif
183*7c478bd9Sstevel@tonic-gate #endif	/* _LARGEFILE64_SOURCE */
184*7c478bd9Sstevel@tonic-gate 
185*7c478bd9Sstevel@tonic-gate #ifdef _LP64
186*7c478bd9Sstevel@tonic-gate typedef	int		blksize_t;	/* used for block sizes */
187*7c478bd9Sstevel@tonic-gate #else
188*7c478bd9Sstevel@tonic-gate typedef	long		blksize_t;	/* used for block sizes */
189*7c478bd9Sstevel@tonic-gate #endif
190*7c478bd9Sstevel@tonic-gate 
191*7c478bd9Sstevel@tonic-gate #if defined(__XOPEN_OR_POSIX)
192*7c478bd9Sstevel@tonic-gate typedef enum { _B_FALSE, _B_TRUE } boolean_t;
193*7c478bd9Sstevel@tonic-gate #else
194*7c478bd9Sstevel@tonic-gate typedef enum { B_FALSE, B_TRUE } boolean_t;
195*7c478bd9Sstevel@tonic-gate #endif /* defined(__XOPEN_OR_POSIX) */
196*7c478bd9Sstevel@tonic-gate 
197*7c478bd9Sstevel@tonic-gate /*
198*7c478bd9Sstevel@tonic-gate  * The {u,}pad64_t types can be used in structures such that those structures
199*7c478bd9Sstevel@tonic-gate  * may be accessed by code produced by compilation environments which don't
200*7c478bd9Sstevel@tonic-gate  * support a 64 bit integral datatype.  The intention is not to allow
201*7c478bd9Sstevel@tonic-gate  * use of these fields in such environments, but to maintain the alignment
202*7c478bd9Sstevel@tonic-gate  * and offsets of the structure.
203*7c478bd9Sstevel@tonic-gate  *
204*7c478bd9Sstevel@tonic-gate  * Similar comments for {u,}pad128_t.
205*7c478bd9Sstevel@tonic-gate  *
206*7c478bd9Sstevel@tonic-gate  * Note that these types do NOT generate any stronger alignment constraints
207*7c478bd9Sstevel@tonic-gate  * than those available in the underlying ABI.  See <sys/isa_defs.h>
208*7c478bd9Sstevel@tonic-gate  */
209*7c478bd9Sstevel@tonic-gate #if defined(_INT64_TYPE)
210*7c478bd9Sstevel@tonic-gate typedef int64_t		pad64_t;
211*7c478bd9Sstevel@tonic-gate typedef	uint64_t	upad64_t;
212*7c478bd9Sstevel@tonic-gate #else
213*7c478bd9Sstevel@tonic-gate typedef union {
214*7c478bd9Sstevel@tonic-gate 	double   _d;
215*7c478bd9Sstevel@tonic-gate 	int32_t  _l[2];
216*7c478bd9Sstevel@tonic-gate } pad64_t;
217*7c478bd9Sstevel@tonic-gate 
218*7c478bd9Sstevel@tonic-gate typedef union {
219*7c478bd9Sstevel@tonic-gate 	double   _d;
220*7c478bd9Sstevel@tonic-gate 	uint32_t _l[2];
221*7c478bd9Sstevel@tonic-gate } upad64_t;
222*7c478bd9Sstevel@tonic-gate #endif
223*7c478bd9Sstevel@tonic-gate 
224*7c478bd9Sstevel@tonic-gate typedef union {
225*7c478bd9Sstevel@tonic-gate 	long double	_q;
226*7c478bd9Sstevel@tonic-gate 	int32_t		_l[4];
227*7c478bd9Sstevel@tonic-gate } pad128_t;
228*7c478bd9Sstevel@tonic-gate 
229*7c478bd9Sstevel@tonic-gate typedef union {
230*7c478bd9Sstevel@tonic-gate 	long double	_q;
231*7c478bd9Sstevel@tonic-gate 	uint32_t	_l[4];
232*7c478bd9Sstevel@tonic-gate } upad128_t;
233*7c478bd9Sstevel@tonic-gate 
234*7c478bd9Sstevel@tonic-gate typedef	longlong_t	offset_t;
235*7c478bd9Sstevel@tonic-gate typedef	u_longlong_t	u_offset_t;
236*7c478bd9Sstevel@tonic-gate typedef u_longlong_t	len_t;
237*7c478bd9Sstevel@tonic-gate typedef	u_longlong_t	diskaddr_t;
238*7c478bd9Sstevel@tonic-gate #if (defined(_KERNEL) || defined(_KMEMUSER))
239*7c478bd9Sstevel@tonic-gate typedef	uint64_t	paddr_t;
240*7c478bd9Sstevel@tonic-gate #endif
241*7c478bd9Sstevel@tonic-gate 
242*7c478bd9Sstevel@tonic-gate /*
243*7c478bd9Sstevel@tonic-gate  * Definitions remaining from previous partial support for 64-bit file
244*7c478bd9Sstevel@tonic-gate  * offsets.  This partial support for devices greater than 2gb requires
245*7c478bd9Sstevel@tonic-gate  * compiler support for long long.
246*7c478bd9Sstevel@tonic-gate  */
247*7c478bd9Sstevel@tonic-gate #ifdef _LONG_LONG_LTOH
248*7c478bd9Sstevel@tonic-gate typedef union {
249*7c478bd9Sstevel@tonic-gate 	offset_t	_f;	/* Full 64 bit offset value */
250*7c478bd9Sstevel@tonic-gate 	struct {
251*7c478bd9Sstevel@tonic-gate 		int32_t	_l;	/* lower 32 bits of offset value */
252*7c478bd9Sstevel@tonic-gate 		int32_t	_u;	/* upper 32 bits of offset value */
253*7c478bd9Sstevel@tonic-gate 	} _p;
254*7c478bd9Sstevel@tonic-gate } lloff_t;
255*7c478bd9Sstevel@tonic-gate #endif
256*7c478bd9Sstevel@tonic-gate 
257*7c478bd9Sstevel@tonic-gate #ifdef _LONG_LONG_HTOL
258*7c478bd9Sstevel@tonic-gate typedef union {
259*7c478bd9Sstevel@tonic-gate 	offset_t	_f;	/* Full 64 bit offset value */
260*7c478bd9Sstevel@tonic-gate 	struct {
261*7c478bd9Sstevel@tonic-gate 		int32_t	_u;	/* upper 32 bits of offset value */
262*7c478bd9Sstevel@tonic-gate 		int32_t	_l;	/* lower 32 bits of offset value */
263*7c478bd9Sstevel@tonic-gate 	} _p;
264*7c478bd9Sstevel@tonic-gate } lloff_t;
265*7c478bd9Sstevel@tonic-gate #endif
266*7c478bd9Sstevel@tonic-gate 
267*7c478bd9Sstevel@tonic-gate #ifdef _LONG_LONG_LTOH
268*7c478bd9Sstevel@tonic-gate typedef union {
269*7c478bd9Sstevel@tonic-gate 	longlong_t	_f;	/* Full 64 bit disk address value */
270*7c478bd9Sstevel@tonic-gate 	struct {
271*7c478bd9Sstevel@tonic-gate 		int32_t	_l;	/* lower 32 bits of disk address value */
272*7c478bd9Sstevel@tonic-gate 		int32_t	_u;	/* upper 32 bits of disk address value */
273*7c478bd9Sstevel@tonic-gate 	} _p;
274*7c478bd9Sstevel@tonic-gate } lldaddr_t;
275*7c478bd9Sstevel@tonic-gate #endif
276*7c478bd9Sstevel@tonic-gate 
277*7c478bd9Sstevel@tonic-gate #ifdef _LONG_LONG_HTOL
278*7c478bd9Sstevel@tonic-gate typedef union {
279*7c478bd9Sstevel@tonic-gate 	longlong_t	_f;	/* Full 64 bit disk address value */
280*7c478bd9Sstevel@tonic-gate 	struct {
281*7c478bd9Sstevel@tonic-gate 		int32_t	_u;	/* upper 32 bits of disk address value */
282*7c478bd9Sstevel@tonic-gate 		int32_t	_l;	/* lower 32 bits of disk address value */
283*7c478bd9Sstevel@tonic-gate 	} _p;
284*7c478bd9Sstevel@tonic-gate } lldaddr_t;
285*7c478bd9Sstevel@tonic-gate #endif
286*7c478bd9Sstevel@tonic-gate 
287*7c478bd9Sstevel@tonic-gate typedef uint_t k_fltset_t;	/* kernel fault set type */
288*7c478bd9Sstevel@tonic-gate 
289*7c478bd9Sstevel@tonic-gate /*
290*7c478bd9Sstevel@tonic-gate  * The following type is for various kinds of identifiers.  The
291*7c478bd9Sstevel@tonic-gate  * actual type must be the same for all since some system calls
292*7c478bd9Sstevel@tonic-gate  * (such as sigsend) take arguments that may be any of these
293*7c478bd9Sstevel@tonic-gate  * types.  The enumeration type idtype_t defined in sys/procset.h
294*7c478bd9Sstevel@tonic-gate  * is used to indicate what type of id is being specified --
295*7c478bd9Sstevel@tonic-gate  * a process id, process group id, session id, scheduling class id,
296*7c478bd9Sstevel@tonic-gate  * user id, group id, project id, task id or zone id.
297*7c478bd9Sstevel@tonic-gate  */
298*7c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
299*7c478bd9Sstevel@tonic-gate typedef int		id_t;
300*7c478bd9Sstevel@tonic-gate #else
301*7c478bd9Sstevel@tonic-gate typedef	long		id_t;		/* (historical version) */
302*7c478bd9Sstevel@tonic-gate #endif
303*7c478bd9Sstevel@tonic-gate 
304*7c478bd9Sstevel@tonic-gate /*
305*7c478bd9Sstevel@tonic-gate  * Type useconds_t is an unsigned integral type capable of storing
306*7c478bd9Sstevel@tonic-gate  * values at least in the range of zero to 1,000,000.
307*7c478bd9Sstevel@tonic-gate  */
308*7c478bd9Sstevel@tonic-gate typedef uint_t		useconds_t;	/* Time, in microseconds */
309*7c478bd9Sstevel@tonic-gate 
310*7c478bd9Sstevel@tonic-gate #ifndef	_SUSECONDS_T
311*7c478bd9Sstevel@tonic-gate #define	_SUSECONDS_T
312*7c478bd9Sstevel@tonic-gate typedef long	suseconds_t;	/* signed # of microseconds */
313*7c478bd9Sstevel@tonic-gate #endif	/* _SUSECONDS_T */
314*7c478bd9Sstevel@tonic-gate 
315*7c478bd9Sstevel@tonic-gate /*
316*7c478bd9Sstevel@tonic-gate  * Typedefs for dev_t components.
317*7c478bd9Sstevel@tonic-gate  */
318*7c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
319*7c478bd9Sstevel@tonic-gate typedef uint_t	major_t;	/* major part of device number */
320*7c478bd9Sstevel@tonic-gate typedef uint_t	minor_t;	/* minor part of device number */
321*7c478bd9Sstevel@tonic-gate #else
322*7c478bd9Sstevel@tonic-gate typedef ulong_t	major_t;	/* (historical version) */
323*7c478bd9Sstevel@tonic-gate typedef ulong_t	minor_t;	/* (historical version) */
324*7c478bd9Sstevel@tonic-gate #endif
325*7c478bd9Sstevel@tonic-gate 
326*7c478bd9Sstevel@tonic-gate /*
327*7c478bd9Sstevel@tonic-gate  * The data type of a thread priority.
328*7c478bd9Sstevel@tonic-gate  */
329*7c478bd9Sstevel@tonic-gate typedef short	pri_t;
330*7c478bd9Sstevel@tonic-gate 
331*7c478bd9Sstevel@tonic-gate /*
332*7c478bd9Sstevel@tonic-gate  * The data type for a CPU flags field.  (Can be extended to larger unsigned
333*7c478bd9Sstevel@tonic-gate  * types, if needed, limited by ability to update atomically.)
334*7c478bd9Sstevel@tonic-gate  */
335*7c478bd9Sstevel@tonic-gate typedef ushort_t	cpu_flag_t;
336*7c478bd9Sstevel@tonic-gate 
337*7c478bd9Sstevel@tonic-gate /*
338*7c478bd9Sstevel@tonic-gate  * For compatibility reasons the following typedefs (prefixed o_)
339*7c478bd9Sstevel@tonic-gate  * can't grow regardless of the EFT definition. Although,
340*7c478bd9Sstevel@tonic-gate  * applications should not explicitly use these typedefs
341*7c478bd9Sstevel@tonic-gate  * they may be included via a system header definition.
342*7c478bd9Sstevel@tonic-gate  * WARNING: These typedefs may be removed in a future
343*7c478bd9Sstevel@tonic-gate  * release.
344*7c478bd9Sstevel@tonic-gate  *		ex. the definitions in s5inode.h (now obsoleted)
345*7c478bd9Sstevel@tonic-gate  *			remained small to preserve compatibility
346*7c478bd9Sstevel@tonic-gate  *			in the S5 file system type.
347*7c478bd9Sstevel@tonic-gate  */
348*7c478bd9Sstevel@tonic-gate typedef	ushort_t o_mode_t;		/* old file attribute type */
349*7c478bd9Sstevel@tonic-gate typedef short	o_dev_t;		/* old device type	*/
350*7c478bd9Sstevel@tonic-gate typedef	ushort_t o_uid_t;		/* old UID type		*/
351*7c478bd9Sstevel@tonic-gate typedef	o_uid_t	o_gid_t;		/* old GID type		*/
352*7c478bd9Sstevel@tonic-gate typedef	short	o_nlink_t;		/* old file link type	*/
353*7c478bd9Sstevel@tonic-gate typedef short	o_pid_t;		/* old process id type	*/
354*7c478bd9Sstevel@tonic-gate typedef ushort_t o_ino_t;		/* old inode type	*/
355*7c478bd9Sstevel@tonic-gate 
356*7c478bd9Sstevel@tonic-gate 
357*7c478bd9Sstevel@tonic-gate /*
358*7c478bd9Sstevel@tonic-gate  * POSIX and XOPEN Declarations
359*7c478bd9Sstevel@tonic-gate  */
360*7c478bd9Sstevel@tonic-gate typedef	int	key_t;			/* IPC key type		*/
361*7c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
362*7c478bd9Sstevel@tonic-gate typedef	uint_t	mode_t;			/* file attribute type	*/
363*7c478bd9Sstevel@tonic-gate #else
364*7c478bd9Sstevel@tonic-gate typedef	ulong_t	mode_t;			/* (historical version) */
365*7c478bd9Sstevel@tonic-gate #endif
366*7c478bd9Sstevel@tonic-gate 
367*7c478bd9Sstevel@tonic-gate #ifndef	_UID_T
368*7c478bd9Sstevel@tonic-gate #define	_UID_T
369*7c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
370*7c478bd9Sstevel@tonic-gate typedef	int	uid_t;			/* UID type		*/
371*7c478bd9Sstevel@tonic-gate #else
372*7c478bd9Sstevel@tonic-gate typedef	long	uid_t;			/* (historical version) */
373*7c478bd9Sstevel@tonic-gate #endif
374*7c478bd9Sstevel@tonic-gate #endif	/* _UID_T */
375*7c478bd9Sstevel@tonic-gate 
376*7c478bd9Sstevel@tonic-gate typedef	uid_t	gid_t;			/* GID type		*/
377*7c478bd9Sstevel@tonic-gate 
378*7c478bd9Sstevel@tonic-gate typedef id_t    taskid_t;
379*7c478bd9Sstevel@tonic-gate typedef id_t    projid_t;
380*7c478bd9Sstevel@tonic-gate typedef	id_t	poolid_t;
381*7c478bd9Sstevel@tonic-gate typedef id_t	zoneid_t;
382*7c478bd9Sstevel@tonic-gate typedef id_t	ctid_t;
383*7c478bd9Sstevel@tonic-gate 
384*7c478bd9Sstevel@tonic-gate /*
385*7c478bd9Sstevel@tonic-gate  * POSIX definitions are same as defined in thread.h and synch.h.
386*7c478bd9Sstevel@tonic-gate  * Any changes made to here should be reflected in corresponding
387*7c478bd9Sstevel@tonic-gate  * files as described in comments.
388*7c478bd9Sstevel@tonic-gate  */
389*7c478bd9Sstevel@tonic-gate typedef	uint_t	pthread_t;	/* = thread_t in thread.h */
390*7c478bd9Sstevel@tonic-gate typedef	uint_t	pthread_key_t;	/* = thread_key_t in thread.h */
391*7c478bd9Sstevel@tonic-gate 
392*7c478bd9Sstevel@tonic-gate /* "Magic numbers" tagging synchronization object types */
393*7c478bd9Sstevel@tonic-gate #define	_MUTEX_MAGIC	0x4d58		/* "MX" */
394*7c478bd9Sstevel@tonic-gate #define	_SEMA_MAGIC	0x534d		/* "SM" */
395*7c478bd9Sstevel@tonic-gate #define	_COND_MAGIC	0x4356		/* "CV" */
396*7c478bd9Sstevel@tonic-gate #define	_RWL_MAGIC	0x5257		/* "RW" */
397*7c478bd9Sstevel@tonic-gate 
398*7c478bd9Sstevel@tonic-gate typedef	struct _pthread_mutex {		/* = mutex_t in synch.h */
399*7c478bd9Sstevel@tonic-gate 	struct {
400*7c478bd9Sstevel@tonic-gate 		uint16_t	__pthread_mutex_flag1;
401*7c478bd9Sstevel@tonic-gate 		uint8_t		__pthread_mutex_flag2;
402*7c478bd9Sstevel@tonic-gate 		uint8_t		__pthread_mutex_ceiling;
403*7c478bd9Sstevel@tonic-gate 		uint16_t 	__pthread_mutex_type;
404*7c478bd9Sstevel@tonic-gate 		uint16_t 	__pthread_mutex_magic;
405*7c478bd9Sstevel@tonic-gate 	} __pthread_mutex_flags;
406*7c478bd9Sstevel@tonic-gate 	union {
407*7c478bd9Sstevel@tonic-gate 		struct {
408*7c478bd9Sstevel@tonic-gate 			uint8_t	__pthread_mutex_pad[8];
409*7c478bd9Sstevel@tonic-gate 		} __pthread_mutex_lock64;
410*7c478bd9Sstevel@tonic-gate 		struct {
411*7c478bd9Sstevel@tonic-gate 			uint32_t __pthread_ownerpid;
412*7c478bd9Sstevel@tonic-gate 			uint32_t __pthread_lockword;
413*7c478bd9Sstevel@tonic-gate 		} __pthread_mutex_lock32;
414*7c478bd9Sstevel@tonic-gate 		upad64_t __pthread_mutex_owner64;
415*7c478bd9Sstevel@tonic-gate 	} __pthread_mutex_lock;
416*7c478bd9Sstevel@tonic-gate 	upad64_t __pthread_mutex_data;
417*7c478bd9Sstevel@tonic-gate } pthread_mutex_t;
418*7c478bd9Sstevel@tonic-gate 
419*7c478bd9Sstevel@tonic-gate typedef	struct _pthread_cond {		/* = cond_t in synch.h */
420*7c478bd9Sstevel@tonic-gate 	struct {
421*7c478bd9Sstevel@tonic-gate 		uint8_t		__pthread_cond_flag[4];
422*7c478bd9Sstevel@tonic-gate 		uint16_t 	__pthread_cond_type;
423*7c478bd9Sstevel@tonic-gate 		uint16_t 	__pthread_cond_magic;
424*7c478bd9Sstevel@tonic-gate 	} __pthread_cond_flags;
425*7c478bd9Sstevel@tonic-gate 	upad64_t __pthread_cond_data;
426*7c478bd9Sstevel@tonic-gate } pthread_cond_t;
427*7c478bd9Sstevel@tonic-gate 
428*7c478bd9Sstevel@tonic-gate /*
429*7c478bd9Sstevel@tonic-gate  * UNIX 98 Extension
430*7c478bd9Sstevel@tonic-gate  */
431*7c478bd9Sstevel@tonic-gate typedef	struct _pthread_rwlock {	/* = rwlock_t in synch.h */
432*7c478bd9Sstevel@tonic-gate 	int32_t		__pthread_rwlock_readers;
433*7c478bd9Sstevel@tonic-gate 	uint16_t	__pthread_rwlock_type;
434*7c478bd9Sstevel@tonic-gate 	uint16_t	__pthread_rwlock_magic;
435*7c478bd9Sstevel@tonic-gate 	pthread_mutex_t	__pthread_rwlock_mutex;
436*7c478bd9Sstevel@tonic-gate 	pthread_cond_t	__pthread_rwlock_readercv;
437*7c478bd9Sstevel@tonic-gate 	pthread_cond_t	__pthread_rwlock_writercv;
438*7c478bd9Sstevel@tonic-gate } pthread_rwlock_t;
439*7c478bd9Sstevel@tonic-gate 
440*7c478bd9Sstevel@tonic-gate /*
441*7c478bd9Sstevel@tonic-gate  * SUSV3
442*7c478bd9Sstevel@tonic-gate  */
443*7c478bd9Sstevel@tonic-gate typedef struct {
444*7c478bd9Sstevel@tonic-gate 	uint32_t	__pthread_barrier_count;
445*7c478bd9Sstevel@tonic-gate 	uint32_t	__pthread_barrier_current;
446*7c478bd9Sstevel@tonic-gate 	upad64_t	__pthread_barrier_cycle;
447*7c478bd9Sstevel@tonic-gate 	upad64_t	__pthread_barrier_reserved;
448*7c478bd9Sstevel@tonic-gate 	pthread_mutex_t	__pthread_barrier_lock;
449*7c478bd9Sstevel@tonic-gate 	pthread_cond_t	__pthread_barrier_cond;
450*7c478bd9Sstevel@tonic-gate } pthread_barrier_t;
451*7c478bd9Sstevel@tonic-gate 
452*7c478bd9Sstevel@tonic-gate typedef	pthread_mutex_t	pthread_spinlock_t;
453*7c478bd9Sstevel@tonic-gate 
454*7c478bd9Sstevel@tonic-gate /*
455*7c478bd9Sstevel@tonic-gate  * attributes for threads, dynamically allocated by library
456*7c478bd9Sstevel@tonic-gate  */
457*7c478bd9Sstevel@tonic-gate typedef struct _pthread_attr {
458*7c478bd9Sstevel@tonic-gate 	void	*__pthread_attrp;
459*7c478bd9Sstevel@tonic-gate } pthread_attr_t;
460*7c478bd9Sstevel@tonic-gate 
461*7c478bd9Sstevel@tonic-gate /*
462*7c478bd9Sstevel@tonic-gate  * attributes for mutex, dynamically allocated by library
463*7c478bd9Sstevel@tonic-gate  */
464*7c478bd9Sstevel@tonic-gate typedef struct _pthread_mutexattr {
465*7c478bd9Sstevel@tonic-gate 	void	*__pthread_mutexattrp;
466*7c478bd9Sstevel@tonic-gate } pthread_mutexattr_t;
467*7c478bd9Sstevel@tonic-gate 
468*7c478bd9Sstevel@tonic-gate /*
469*7c478bd9Sstevel@tonic-gate  * attributes for cond, dynamically allocated by library
470*7c478bd9Sstevel@tonic-gate  */
471*7c478bd9Sstevel@tonic-gate typedef struct _pthread_condattr {
472*7c478bd9Sstevel@tonic-gate 	void	*__pthread_condattrp;
473*7c478bd9Sstevel@tonic-gate } pthread_condattr_t;
474*7c478bd9Sstevel@tonic-gate 
475*7c478bd9Sstevel@tonic-gate /*
476*7c478bd9Sstevel@tonic-gate  * pthread_once
477*7c478bd9Sstevel@tonic-gate  */
478*7c478bd9Sstevel@tonic-gate typedef	struct _once {
479*7c478bd9Sstevel@tonic-gate 	upad64_t	__pthread_once_pad[4];
480*7c478bd9Sstevel@tonic-gate } pthread_once_t;
481*7c478bd9Sstevel@tonic-gate 
482*7c478bd9Sstevel@tonic-gate /*
483*7c478bd9Sstevel@tonic-gate  * UNIX 98 Extensions
484*7c478bd9Sstevel@tonic-gate  * attributes for rwlock, dynamically allocated by library
485*7c478bd9Sstevel@tonic-gate  */
486*7c478bd9Sstevel@tonic-gate typedef struct _pthread_rwlockattr {
487*7c478bd9Sstevel@tonic-gate 	void	*__pthread_rwlockattrp;
488*7c478bd9Sstevel@tonic-gate } pthread_rwlockattr_t;
489*7c478bd9Sstevel@tonic-gate 
490*7c478bd9Sstevel@tonic-gate /*
491*7c478bd9Sstevel@tonic-gate  * SUSV3
492*7c478bd9Sstevel@tonic-gate  * attributes for pthread_barrier_t, dynamically allocated by library
493*7c478bd9Sstevel@tonic-gate  */
494*7c478bd9Sstevel@tonic-gate typedef struct {
495*7c478bd9Sstevel@tonic-gate 	void	*__pthread_barrierattrp;
496*7c478bd9Sstevel@tonic-gate } pthread_barrierattr_t;
497*7c478bd9Sstevel@tonic-gate 
498*7c478bd9Sstevel@tonic-gate typedef ulong_t	dev_t;			/* expanded device type */
499*7c478bd9Sstevel@tonic-gate 
500*7c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
501*7c478bd9Sstevel@tonic-gate typedef	uint_t nlink_t;			/* file link type	*/
502*7c478bd9Sstevel@tonic-gate typedef int	pid_t;			/* process id type	*/
503*7c478bd9Sstevel@tonic-gate #else
504*7c478bd9Sstevel@tonic-gate typedef	ulong_t	nlink_t;		/* (historical version) */
505*7c478bd9Sstevel@tonic-gate typedef	long	pid_t;			/* (historical version) */
506*7c478bd9Sstevel@tonic-gate #endif
507*7c478bd9Sstevel@tonic-gate 
508*7c478bd9Sstevel@tonic-gate #if !defined(_SIZE_T) || __cplusplus >= 199711L
509*7c478bd9Sstevel@tonic-gate #define	_SIZE_T
510*7c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
511*7c478bd9Sstevel@tonic-gate typedef	ulong_t	size_t;		/* size of something in bytes */
512*7c478bd9Sstevel@tonic-gate #else
513*7c478bd9Sstevel@tonic-gate typedef	uint_t	size_t;		/* (historical version) */
514*7c478bd9Sstevel@tonic-gate #endif
515*7c478bd9Sstevel@tonic-gate #endif	/* _SIZE_T */
516*7c478bd9Sstevel@tonic-gate 
517*7c478bd9Sstevel@tonic-gate #ifndef _SSIZE_T
518*7c478bd9Sstevel@tonic-gate #define	_SSIZE_T
519*7c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
520*7c478bd9Sstevel@tonic-gate typedef long	ssize_t;	/* size of something in bytes or -1 */
521*7c478bd9Sstevel@tonic-gate #else
522*7c478bd9Sstevel@tonic-gate typedef int	ssize_t;	/* (historical version) */
523*7c478bd9Sstevel@tonic-gate #endif
524*7c478bd9Sstevel@tonic-gate #endif	/* _SSIZE_T */
525*7c478bd9Sstevel@tonic-gate 
526*7c478bd9Sstevel@tonic-gate #if !defined(_TIME_T) || __cplusplus >= 199711L
527*7c478bd9Sstevel@tonic-gate #define	_TIME_T
528*7c478bd9Sstevel@tonic-gate typedef	long		time_t;	/* time of day in seconds */
529*7c478bd9Sstevel@tonic-gate #endif	/* _TIME_T */
530*7c478bd9Sstevel@tonic-gate 
531*7c478bd9Sstevel@tonic-gate #if !defined(_CLOCK_T) || __cplusplus >= 199711L
532*7c478bd9Sstevel@tonic-gate #define	_CLOCK_T
533*7c478bd9Sstevel@tonic-gate typedef	long		clock_t; /* relative time in a specified resolution */
534*7c478bd9Sstevel@tonic-gate #endif	/* ifndef _CLOCK_T */
535*7c478bd9Sstevel@tonic-gate 
536*7c478bd9Sstevel@tonic-gate #ifndef _CLOCKID_T
537*7c478bd9Sstevel@tonic-gate #define	_CLOCKID_T
538*7c478bd9Sstevel@tonic-gate typedef	int	clockid_t;	/* clock identifier type */
539*7c478bd9Sstevel@tonic-gate #endif	/* ifndef _CLOCKID_T */
540*7c478bd9Sstevel@tonic-gate 
541*7c478bd9Sstevel@tonic-gate #ifndef _TIMER_T
542*7c478bd9Sstevel@tonic-gate #define	_TIMER_T
543*7c478bd9Sstevel@tonic-gate typedef	int	timer_t;	/* timer identifier type */
544*7c478bd9Sstevel@tonic-gate #endif	/* ifndef _TIMER_T */
545*7c478bd9Sstevel@tonic-gate 
546*7c478bd9Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
547*7c478bd9Sstevel@tonic-gate 
548*7c478bd9Sstevel@tonic-gate /* BEGIN CSTYLED */
549*7c478bd9Sstevel@tonic-gate typedef	unsigned char	unchar;
550*7c478bd9Sstevel@tonic-gate typedef	unsigned short	ushort;
551*7c478bd9Sstevel@tonic-gate typedef	unsigned int	uint;
552*7c478bd9Sstevel@tonic-gate typedef	unsigned long	ulong;
553*7c478bd9Sstevel@tonic-gate /* END CSTYLED */
554*7c478bd9Sstevel@tonic-gate 
555*7c478bd9Sstevel@tonic-gate #if defined(_KERNEL)
556*7c478bd9Sstevel@tonic-gate 
557*7c478bd9Sstevel@tonic-gate #define	SHRT_MIN	(-32768)	/* min value of a "short int" */
558*7c478bd9Sstevel@tonic-gate #define	SHRT_MAX	32767		/* max value of a "short int" */
559*7c478bd9Sstevel@tonic-gate #define	USHRT_MAX	65535		/* max of "unsigned short int" */
560*7c478bd9Sstevel@tonic-gate #define	INT_MIN		(-2147483647-1) /* min value of an "int" */
561*7c478bd9Sstevel@tonic-gate #define	INT_MAX		2147483647	/* max value of an "int" */
562*7c478bd9Sstevel@tonic-gate #define	UINT_MAX	4294967295U	/* max value of an "unsigned int" */
563*7c478bd9Sstevel@tonic-gate #if defined(_LP64)
564*7c478bd9Sstevel@tonic-gate #define	LONG_MIN	(-9223372036854775807L-1L)
565*7c478bd9Sstevel@tonic-gate 					/* min value of a "long int" */
566*7c478bd9Sstevel@tonic-gate #define	LONG_MAX	9223372036854775807L
567*7c478bd9Sstevel@tonic-gate 					/* max value of a "long int" */
568*7c478bd9Sstevel@tonic-gate #define	ULONG_MAX	18446744073709551615UL
569*7c478bd9Sstevel@tonic-gate 					/* max of "unsigned long int" */
570*7c478bd9Sstevel@tonic-gate #else /* _ILP32 */
571*7c478bd9Sstevel@tonic-gate #define	LONG_MIN	(-2147483647L-1L)
572*7c478bd9Sstevel@tonic-gate 					/* min value of a "long int" */
573*7c478bd9Sstevel@tonic-gate #define	LONG_MAX	2147483647L	/* max value of a "long int" */
574*7c478bd9Sstevel@tonic-gate #define	ULONG_MAX	4294967295UL	/* max of "unsigned long int" */
575*7c478bd9Sstevel@tonic-gate #endif
576*7c478bd9Sstevel@tonic-gate 
577*7c478bd9Sstevel@tonic-gate #endif	/* defined(_KERNEL) */
578*7c478bd9Sstevel@tonic-gate 
579*7c478bd9Sstevel@tonic-gate #define	P_MYPID	((pid_t)0)
580*7c478bd9Sstevel@tonic-gate 
581*7c478bd9Sstevel@tonic-gate /*
582*7c478bd9Sstevel@tonic-gate  * The following is the value of type id_t to use to indicate the
583*7c478bd9Sstevel@tonic-gate  * caller's current id.  See procset.h for the type idtype_t
584*7c478bd9Sstevel@tonic-gate  * which defines which kind of id is being specified.
585*7c478bd9Sstevel@tonic-gate  */
586*7c478bd9Sstevel@tonic-gate #define	P_MYID	(-1)
587*7c478bd9Sstevel@tonic-gate #define	NOPID (pid_t)(-1)
588*7c478bd9Sstevel@tonic-gate 
589*7c478bd9Sstevel@tonic-gate #ifndef NODEV
590*7c478bd9Sstevel@tonic-gate #define	NODEV	(dev_t)(-1l)
591*7c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32
592*7c478bd9Sstevel@tonic-gate #define	NODEV32	(dev32_t)(-1)
593*7c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
594*7c478bd9Sstevel@tonic-gate #endif	/* NODEV */
595*7c478bd9Sstevel@tonic-gate 
596*7c478bd9Sstevel@tonic-gate /*
597*7c478bd9Sstevel@tonic-gate  * The following value of type pfn_t is used to indicate
598*7c478bd9Sstevel@tonic-gate  * invalid page frame number.
599*7c478bd9Sstevel@tonic-gate  */
600*7c478bd9Sstevel@tonic-gate #define	PFN_INVALID	((pfn_t)-1)
601*7c478bd9Sstevel@tonic-gate #define	PFN_SUSPENDED	((pfn_t)-2)
602*7c478bd9Sstevel@tonic-gate 
603*7c478bd9Sstevel@tonic-gate /* BEGIN CSTYLED */
604*7c478bd9Sstevel@tonic-gate typedef unsigned char	u_char;
605*7c478bd9Sstevel@tonic-gate typedef unsigned short	u_short;
606*7c478bd9Sstevel@tonic-gate typedef unsigned int	u_int;
607*7c478bd9Sstevel@tonic-gate typedef unsigned long	u_long;
608*7c478bd9Sstevel@tonic-gate typedef struct _quad { int val[2]; } quad_t;	/* used by UFS */
609*7c478bd9Sstevel@tonic-gate typedef quad_t		quad;			/* used by UFS */
610*7c478bd9Sstevel@tonic-gate /* END CSTYLED */
611*7c478bd9Sstevel@tonic-gate 
612*7c478bd9Sstevel@tonic-gate /*
613*7c478bd9Sstevel@tonic-gate  * Nested include for BSD/sockets source compatibility.
614*7c478bd9Sstevel@tonic-gate  * (The select macros used to be defined here).
615*7c478bd9Sstevel@tonic-gate  */
616*7c478bd9Sstevel@tonic-gate #include <sys/select.h>
617*7c478bd9Sstevel@tonic-gate 
618*7c478bd9Sstevel@tonic-gate #endif	/* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
619*7c478bd9Sstevel@tonic-gate 
620*7c478bd9Sstevel@tonic-gate /*
621*7c478bd9Sstevel@tonic-gate  * _VOID was defined to be either void or char but this is not
622*7c478bd9Sstevel@tonic-gate  * required because previous SunOS compilers have accepted the void
623*7c478bd9Sstevel@tonic-gate  * type. However, because many system header and source files use the
624*7c478bd9Sstevel@tonic-gate  * void keyword, the volatile keyword, and ANSI C function prototypes,
625*7c478bd9Sstevel@tonic-gate  * non-ANSI compilers cannot compile the system anyway. The _VOID macro
626*7c478bd9Sstevel@tonic-gate  * should therefore not be used and remains for source compatibility
627*7c478bd9Sstevel@tonic-gate  * only.
628*7c478bd9Sstevel@tonic-gate  */
629*7c478bd9Sstevel@tonic-gate /* CSTYLED */
630*7c478bd9Sstevel@tonic-gate #define	_VOID	void
631*7c478bd9Sstevel@tonic-gate 
632*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
633*7c478bd9Sstevel@tonic-gate }
634*7c478bd9Sstevel@tonic-gate #endif
635*7c478bd9Sstevel@tonic-gate 
636*7c478bd9Sstevel@tonic-gate #endif	/* _SYS_TYPES_H */
637